@wormhole-foundation/wormhole-connect 0.2.5-beta.2-development → 0.2.5-beta.3-development
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/assets/{cosmos-_wqy4SgE.js → cosmos-R02QmrCi.js} +1 -1
- package/dist/assets/index-sf7Dq5sz.js +3 -0
- package/dist/assets/{solana-mxqvqbiT.js → solana-3Sa-HcsX.js} +2 -2
- package/dist/assets/{solanaEmbed.esm-t-E-c26P.js → solanaEmbed.esm-P7vk0eRu.js} +1 -1
- package/dist/main.js +8 -8
- package/lib/cjs/index.js +1 -1
- package/lib/esm/index.js +1 -1
- package/package.json +1 -1
- package/dist/assets/index-OmMVPptj.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Er,p as Kd,b4 as Jd,d as ye,s as er,a$ as Dr,F as Dn,b5 as Xd,q as Ye,b2 as Yd,aZ as Da,z as Uf,b6 as Qd,b7 as Ff,b8 as eh,u as th,aX as Te,ad as Ma}from"../main.js";import{s as rh,h as nh,u as ih}from"./index-OmMVPptj.js";var xs=Nn;Nn.default=Nn;Nn.stable=Wf;Nn.stableStringify=Wf;var fi="[...]",Hf="[Circular]",Pr=[],Cr=[];function zf(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Nn(e,t,r,n){typeof n>"u"&&(n=zf()),cs(e,"",0,[],void 0,0,n);var i;try{Cr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Vf(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Pr.length!==0;){var o=Pr.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Zr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Pr.push([n,r,t,i])):Cr.push([t,r,e]):(n[r]=e,Pr.push([n,r,t]))}function cs(e,t,r,n,i,o,s){o+=1;var u;if(typeof e=="object"&&e!==null){for(u=0;u<n.length;u++)if(n[u]===e){Zr(Hf,e,t,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Zr(fi,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){Zr(fi,e,t,i);return}if(n.push(e),Array.isArray(e))for(u=0;u<e.length;u++)cs(e[u],u,u,n,e,o,s);else{var l=Object.keys(e);for(u=0;u<l.length;u++){var f=l[u];cs(e[f],f,u,n,e,o,s)}}n.pop()}}function oh(e,t){return e<t?-1:e>t?1:0}function Wf(e,t,r,n){typeof n>"u"&&(n=zf());var i=ds(e,"",0,[],void 0,0,n)||e,o;try{Cr.length===0?o=JSON.stringify(i,t,r):o=JSON.stringify(i,Vf(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Pr.length!==0;){var s=Pr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function ds(e,t,r,n,i,o,s){o+=1;var u;if(typeof e=="object"&&e!==null){for(u=0;u<n.length;u++)if(n[u]===e){Zr(Hf,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Zr(fi,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){Zr(fi,e,t,i);return}if(n.push(e),Array.isArray(e))for(u=0;u<e.length;u++)ds(e[u],u,u,n,e,o,s);else{var l={},f=Object.keys(e).sort(oh);for(u=0;u<f.length;u++){var c=f[u];ds(e[c],c,u,n,e,o,s),l[c]=e[c]}if(typeof i<"u")Pr.push([i,t,e]),i[t]=l;else return l}n.pop()}}function Vf(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Cr.length>0)for(var n=0;n<Cr.length;n++){var i=Cr[n];if(i[1]===t&&i[0]===r){r=i[2],Cr.splice(n,1);break}}return e.call(this,t,r)}}const sh=Er(xs);var ah=lh;function lh(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const fh=Er(ah),Mr=Kd(Jd);var hs={exports:{}},yo,ja;function uh(){if(ja)return yo;ja=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,o=n*365.25;yo=function(c,h){h=h||{};var m=typeof c;if(m==="string"&&c.length>0)return s(c);if(m==="number"&&isFinite(c))return h.long?l(c):u(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function s(c){if(c=String(c),!(c.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(h){var m=parseFloat(h[1]),p=(h[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return m*o;case"weeks":case"week":case"w":return m*i;case"days":case"day":case"d":return m*n;case"hours":case"hour":case"hrs":case"hr":case"h":return m*r;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function u(c){var h=Math.abs(c);return h>=n?Math.round(c/n)+"d":h>=r?Math.round(c/r)+"h":h>=t?Math.round(c/t)+"m":h>=e?Math.round(c/e)+"s":c+"ms"}function l(c){var h=Math.abs(c);return h>=n?f(c,h,n,"day"):h>=r?f(c,h,r,"hour"):h>=t?f(c,h,t,"minute"):h>=e?f(c,h,e,"second"):c+" ms"}function f(c,h,m,p){var v=h>=m*1.5;return Math.round(c/m)+" "+p+(v?"s":"")}return yo}function ch(e){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=i,r.enabled=s,r.humanize=uh(),r.destroy=f,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let h=0;for(let m=0;m<c.length;m++)h=(h<<5)-h+c.charCodeAt(m),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=t;function r(c){let h,m=null,p,v;function q(...M){if(!q.enabled)return;const D=q,E=Number(new Date),H=E-(h||E);D.diff=H,D.prev=h,D.curr=E,h=E,M[0]=r.coerce(M[0]),typeof M[0]!="string"&&M.unshift("%O");let R=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(x,j)=>{if(x==="%%")return"%";R++;const ee=r.formatters[j];if(typeof ee=="function"){const z=M[R];x=ee.call(D,z),M.splice(R,1),R--}return x}),r.formatArgs.call(D,M),(D.log||r.log).apply(D,M)}return q.namespace=c,q.useColors=r.useColors(),q.color=r.selectColor(c),q.extend=n,q.destroy=r.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(p!==r.namespaces&&(p=r.namespaces,v=r.enabled(c)),v),set:M=>{m=M}}),typeof r.init=="function"&&r.init(q),q}function n(c,h){const m=r(this.namespace+(typeof h>"u"?":":h)+c);return m.log=this.log,m}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let h;const m=(typeof c=="string"?c:"").split(/[\s,]+/),p=m.length;for(h=0;h<p;h++)m[h]&&(c=m[h].replace(/\*/g,".*?"),c[0]==="-"?r.skips.push(new RegExp("^"+c.slice(1)+"$")):r.names.push(new RegExp("^"+c+"$")))}function o(){const c=[...r.names.map(u),...r.skips.map(u).map(h=>"-"+h)].join(",");return r.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h<m;h++)if(r.skips[h].test(c))return!1;for(h=0,m=r.names.length;h<m;h++)if(r.names[h].test(c))return!0;return!1}function u(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function l(c){return c instanceof Error?c.stack||c.message:c}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var dh=ch;(function(e,t){var r={};t.formatArgs=i,t.save=o,t.load=s,t.useColors=n,t.storage=u(),t.destroy=(()=>{let f=!1;return()=>{f||(f=!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"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;f.splice(1,0,c,"color: inherit");let h=0,m=0;f[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(h++,p==="%c"&&(m=h))}),f.splice(m,0,c)}t.log=console.debug||console.log||(()=>{});function o(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function s(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof ye.process<"u"&&"env"in ye.process&&(f=r.DEBUG),f}function u(){try{return localStorage}catch{}}e.exports=dh(t);const{formatters:l}=e.exports;l.j=function(f){try{return JSON.stringify(f)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(hs,hs.exports);var hh=hs.exports,Ht={},yr={};Object.defineProperty(yr,"__esModule",{value:!0});yr.EthereumProviderError=yr.EthereumRpcError=void 0;const gh=xs;class qf extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return gh.default(this.serialize(),ph,2)}}yr.EthereumRpcError=qf;let _h=class extends qf{constructor(t,r,n){if(!bh(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};yr.EthereumProviderError=_h;function bh(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function ph(e,t){if(t!=="[Circular]")return t}var ks={},wr={};Object.defineProperty(wr,"__esModule",{value:!0});wr.errorValues=wr.errorCodes=void 0;wr.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};wr.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=wr,r=yr,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function s(m,p=i){if(Number.isInteger(m)){const v=m.toString();if(h(t.errorValues,v))return t.errorValues[v].message;if(f(m))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return p}e.getMessageFromCode=s;function u(m){if(!Number.isInteger(m))return!1;const p=m.toString();return!!(t.errorValues[p]||f(m))}e.isValidCode=u;function l(m,{fallbackError:p=o,shouldIncludeStack:v=!1}={}){var q,M;if(!p||!Number.isInteger(p.code)||typeof p.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(m instanceof r.EthereumRpcError)return m.serialize();const D={};if(m&&typeof m=="object"&&!Array.isArray(m)&&h(m,"code")&&u(m.code)){const H=m;D.code=H.code,H.message&&typeof H.message=="string"?(D.message=H.message,h(H,"data")&&(D.data=H.data)):(D.message=s(D.code),D.data={originalError:c(m)})}else{D.code=p.code;const H=(q=m)===null||q===void 0?void 0:q.message;D.message=H&&typeof H=="string"?H:p.message,D.data={originalError:c(m)}}const E=(M=m)===null||M===void 0?void 0:M.stack;return v&&m&&E&&typeof E=="string"&&(D.stack=E),D}e.serializeError=l;function f(m){return m>=-32099&&m<=-32e3}function c(m){return m&&typeof m=="object"&&!Array.isArray(m)?Object.assign({},m):m}function h(m,p){return Object.prototype.hasOwnProperty.call(m,p)}})(ks);var mi={};Object.defineProperty(mi,"__esModule",{value:!0});mi.ethErrors=void 0;const Ds=yr,Gf=ks,_t=wr;mi.ethErrors={rpc:{parse:e=>Tt(_t.errorCodes.rpc.parse,e),invalidRequest:e=>Tt(_t.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Tt(_t.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Tt(_t.errorCodes.rpc.methodNotFound,e),internal:e=>Tt(_t.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Tt(t,e)},invalidInput:e=>Tt(_t.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Tt(_t.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Tt(_t.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Tt(_t.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Tt(_t.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Tt(_t.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>gn(_t.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>gn(_t.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>gn(_t.errorCodes.provider.unsupportedMethod,e),disconnected:e=>gn(_t.errorCodes.provider.disconnected,e),chainDisconnected:e=>gn(_t.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Ds.EthereumProviderError(t,r,n)}}};function Tt(e,t){const[r,n]=Zf(t);return new Ds.EthereumRpcError(e,r||Gf.getMessageFromCode(e),n)}function gn(e,t){const[r,n]=Zf(t);return new Ds.EthereumProviderError(e,r||Gf.getMessageFromCode(e),n)}function Zf(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=yr;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=ks;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=mi;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=wr;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Ht);var yh={exports:{}},wo={exports:{}},st={ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Uint8Array},Kf={exports:{}};(function(e){const t=er,r=Object.getPrototypeOf(async function(){}).constructor,n=globalThis.Blob||t.Blob,i=typeof n<"u"?function(u){return u instanceof n}:function(u){return!1};class o extends Error{constructor(u){if(!Array.isArray(u))throw new TypeError(`Expected input to be an Array, got ${typeof u}`);let l="";for(let f=0;f<u.length;f++)l+=` ${u[f].stack}
|
|
1
|
+
import{g as Er,p as Kd,b4 as Jd,d as ye,s as er,a$ as Dr,F as Dn,b5 as Xd,q as Ye,b2 as Yd,aZ as Da,z as Uf,b6 as Qd,b7 as Ff,b8 as eh,u as th,aX as Te,ad as Ma}from"../main.js";import{s as rh,h as nh,u as ih}from"./index-sf7Dq5sz.js";var xs=Nn;Nn.default=Nn;Nn.stable=Wf;Nn.stableStringify=Wf;var fi="[...]",Hf="[Circular]",Pr=[],Cr=[];function zf(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Nn(e,t,r,n){typeof n>"u"&&(n=zf()),cs(e,"",0,[],void 0,0,n);var i;try{Cr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Vf(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Pr.length!==0;){var o=Pr.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Zr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Pr.push([n,r,t,i])):Cr.push([t,r,e]):(n[r]=e,Pr.push([n,r,t]))}function cs(e,t,r,n,i,o,s){o+=1;var u;if(typeof e=="object"&&e!==null){for(u=0;u<n.length;u++)if(n[u]===e){Zr(Hf,e,t,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Zr(fi,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){Zr(fi,e,t,i);return}if(n.push(e),Array.isArray(e))for(u=0;u<e.length;u++)cs(e[u],u,u,n,e,o,s);else{var l=Object.keys(e);for(u=0;u<l.length;u++){var f=l[u];cs(e[f],f,u,n,e,o,s)}}n.pop()}}function oh(e,t){return e<t?-1:e>t?1:0}function Wf(e,t,r,n){typeof n>"u"&&(n=zf());var i=ds(e,"",0,[],void 0,0,n)||e,o;try{Cr.length===0?o=JSON.stringify(i,t,r):o=JSON.stringify(i,Vf(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Pr.length!==0;){var s=Pr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function ds(e,t,r,n,i,o,s){o+=1;var u;if(typeof e=="object"&&e!==null){for(u=0;u<n.length;u++)if(n[u]===e){Zr(Hf,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){Zr(fi,e,t,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){Zr(fi,e,t,i);return}if(n.push(e),Array.isArray(e))for(u=0;u<e.length;u++)ds(e[u],u,u,n,e,o,s);else{var l={},f=Object.keys(e).sort(oh);for(u=0;u<f.length;u++){var c=f[u];ds(e[c],c,u,n,e,o,s),l[c]=e[c]}if(typeof i<"u")Pr.push([i,t,e]),i[t]=l;else return l}n.pop()}}function Vf(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Cr.length>0)for(var n=0;n<Cr.length;n++){var i=Cr[n];if(i[1]===t&&i[0]===r){r=i[2],Cr.splice(n,1);break}}return e.call(this,t,r)}}const sh=Er(xs);var ah=lh;function lh(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const fh=Er(ah),Mr=Kd(Jd);var hs={exports:{}},yo,ja;function uh(){if(ja)return yo;ja=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,o=n*365.25;yo=function(c,h){h=h||{};var m=typeof c;if(m==="string"&&c.length>0)return s(c);if(m==="number"&&isFinite(c))return h.long?l(c):u(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function s(c){if(c=String(c),!(c.length>100)){var h=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(h){var m=parseFloat(h[1]),p=(h[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return m*o;case"weeks":case"week":case"w":return m*i;case"days":case"day":case"d":return m*n;case"hours":case"hour":case"hrs":case"hr":case"h":return m*r;case"minutes":case"minute":case"mins":case"min":case"m":return m*t;case"seconds":case"second":case"secs":case"sec":case"s":return m*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function u(c){var h=Math.abs(c);return h>=n?Math.round(c/n)+"d":h>=r?Math.round(c/r)+"h":h>=t?Math.round(c/t)+"m":h>=e?Math.round(c/e)+"s":c+"ms"}function l(c){var h=Math.abs(c);return h>=n?f(c,h,n,"day"):h>=r?f(c,h,r,"hour"):h>=t?f(c,h,t,"minute"):h>=e?f(c,h,e,"second"):c+" ms"}function f(c,h,m,p){var v=h>=m*1.5;return Math.round(c/m)+" "+p+(v?"s":"")}return yo}function ch(e){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=i,r.enabled=s,r.humanize=uh(),r.destroy=f,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let h=0;for(let m=0;m<c.length;m++)h=(h<<5)-h+c.charCodeAt(m),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=t;function r(c){let h,m=null,p,v;function q(...M){if(!q.enabled)return;const D=q,E=Number(new Date),H=E-(h||E);D.diff=H,D.prev=h,D.curr=E,h=E,M[0]=r.coerce(M[0]),typeof M[0]!="string"&&M.unshift("%O");let R=0;M[0]=M[0].replace(/%([a-zA-Z%])/g,(x,j)=>{if(x==="%%")return"%";R++;const ee=r.formatters[j];if(typeof ee=="function"){const z=M[R];x=ee.call(D,z),M.splice(R,1),R--}return x}),r.formatArgs.call(D,M),(D.log||r.log).apply(D,M)}return q.namespace=c,q.useColors=r.useColors(),q.color=r.selectColor(c),q.extend=n,q.destroy=r.destroy,Object.defineProperty(q,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(p!==r.namespaces&&(p=r.namespaces,v=r.enabled(c)),v),set:M=>{m=M}}),typeof r.init=="function"&&r.init(q),q}function n(c,h){const m=r(this.namespace+(typeof h>"u"?":":h)+c);return m.log=this.log,m}function i(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let h;const m=(typeof c=="string"?c:"").split(/[\s,]+/),p=m.length;for(h=0;h<p;h++)m[h]&&(c=m[h].replace(/\*/g,".*?"),c[0]==="-"?r.skips.push(new RegExp("^"+c.slice(1)+"$")):r.names.push(new RegExp("^"+c+"$")))}function o(){const c=[...r.names.map(u),...r.skips.map(u).map(h=>"-"+h)].join(",");return r.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h<m;h++)if(r.skips[h].test(c))return!1;for(h=0,m=r.names.length;h<m;h++)if(r.names[h].test(c))return!0;return!1}function u(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function l(c){return c instanceof Error?c.stack||c.message:c}function f(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var dh=ch;(function(e,t){var r={};t.formatArgs=i,t.save=o,t.load=s,t.useColors=n,t.storage=u(),t.destroy=(()=>{let f=!1;return()=>{f||(f=!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"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;f.splice(1,0,c,"color: inherit");let h=0,m=0;f[0].replace(/%[a-zA-Z%]/g,p=>{p!=="%%"&&(h++,p==="%c"&&(m=h))}),f.splice(m,0,c)}t.log=console.debug||console.log||(()=>{});function o(f){try{f?t.storage.setItem("debug",f):t.storage.removeItem("debug")}catch{}}function s(){let f;try{f=t.storage.getItem("debug")}catch{}return!f&&typeof ye.process<"u"&&"env"in ye.process&&(f=r.DEBUG),f}function u(){try{return localStorage}catch{}}e.exports=dh(t);const{formatters:l}=e.exports;l.j=function(f){try{return JSON.stringify(f)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(hs,hs.exports);var hh=hs.exports,Ht={},yr={};Object.defineProperty(yr,"__esModule",{value:!0});yr.EthereumProviderError=yr.EthereumRpcError=void 0;const gh=xs;class qf extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return gh.default(this.serialize(),ph,2)}}yr.EthereumRpcError=qf;let _h=class extends qf{constructor(t,r,n){if(!bh(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};yr.EthereumProviderError=_h;function bh(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function ph(e,t){if(t!=="[Circular]")return t}var ks={},wr={};Object.defineProperty(wr,"__esModule",{value:!0});wr.errorValues=wr.errorCodes=void 0;wr.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};wr.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=wr,r=yr,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function s(m,p=i){if(Number.isInteger(m)){const v=m.toString();if(h(t.errorValues,v))return t.errorValues[v].message;if(f(m))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return p}e.getMessageFromCode=s;function u(m){if(!Number.isInteger(m))return!1;const p=m.toString();return!!(t.errorValues[p]||f(m))}e.isValidCode=u;function l(m,{fallbackError:p=o,shouldIncludeStack:v=!1}={}){var q,M;if(!p||!Number.isInteger(p.code)||typeof p.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(m instanceof r.EthereumRpcError)return m.serialize();const D={};if(m&&typeof m=="object"&&!Array.isArray(m)&&h(m,"code")&&u(m.code)){const H=m;D.code=H.code,H.message&&typeof H.message=="string"?(D.message=H.message,h(H,"data")&&(D.data=H.data)):(D.message=s(D.code),D.data={originalError:c(m)})}else{D.code=p.code;const H=(q=m)===null||q===void 0?void 0:q.message;D.message=H&&typeof H=="string"?H:p.message,D.data={originalError:c(m)}}const E=(M=m)===null||M===void 0?void 0:M.stack;return v&&m&&E&&typeof E=="string"&&(D.stack=E),D}e.serializeError=l;function f(m){return m>=-32099&&m<=-32e3}function c(m){return m&&typeof m=="object"&&!Array.isArray(m)?Object.assign({},m):m}function h(m,p){return Object.prototype.hasOwnProperty.call(m,p)}})(ks);var mi={};Object.defineProperty(mi,"__esModule",{value:!0});mi.ethErrors=void 0;const Ds=yr,Gf=ks,_t=wr;mi.ethErrors={rpc:{parse:e=>Tt(_t.errorCodes.rpc.parse,e),invalidRequest:e=>Tt(_t.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Tt(_t.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Tt(_t.errorCodes.rpc.methodNotFound,e),internal:e=>Tt(_t.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Tt(t,e)},invalidInput:e=>Tt(_t.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Tt(_t.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Tt(_t.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Tt(_t.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Tt(_t.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Tt(_t.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>gn(_t.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>gn(_t.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>gn(_t.errorCodes.provider.unsupportedMethod,e),disconnected:e=>gn(_t.errorCodes.provider.disconnected,e),chainDisconnected:e=>gn(_t.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Ds.EthereumProviderError(t,r,n)}}};function Tt(e,t){const[r,n]=Zf(t);return new Ds.EthereumRpcError(e,r||Gf.getMessageFromCode(e),n)}function gn(e,t){const[r,n]=Zf(t);return new Ds.EthereumProviderError(e,r||Gf.getMessageFromCode(e),n)}function Zf(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=yr;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=ks;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=mi;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=wr;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Ht);var yh={exports:{}},wo={exports:{}},st={ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Uint8Array},Kf={exports:{}};(function(e){const t=er,r=Object.getPrototypeOf(async function(){}).constructor,n=globalThis.Blob||t.Blob,i=typeof n<"u"?function(u){return u instanceof n}:function(u){return!1};class o extends Error{constructor(u){if(!Array.isArray(u))throw new TypeError(`Expected input to be an Array, got ${typeof u}`);let l="";for(let f=0;f<u.length;f++)l+=` ${u[f].stack}
|
|
2
2
|
`;super(l),this.name="AggregateError",this.errors=u}}e.exports={AggregateError:o,kEmptyObject:Object.freeze({}),once(s){let u=!1;return function(...l){u||(u=!0,s.apply(this,l))}},createDeferredPromise:function(){let s,u;return{promise:new Promise((f,c)=>{s=f,u=c}),resolve:s,reject:u}},promisify(s){return new Promise((u,l)=>{s((f,...c)=>f?l(f):u(...c))})},debuglog(){return function(){}},format(s,...u){return s.replace(/%([sdifj])/g,function(...[l,f]){const c=u.shift();return f==="f"?c.toFixed(6):f==="j"?JSON.stringify(c):f==="s"&&typeof c=="object"?`${c.constructor!==Object?c.constructor.name:""} {}`.trim():c.toString()})},inspect(s){switch(typeof s){case"string":if(s.includes("'"))if(s.includes('"')){if(!s.includes("`")&&!s.includes("${"))return`\`${s}\``}else return`"${s}"`;return`'${s}'`;case"number":return isNaN(s)?"NaN":Object.is(s,-0)?String(s):s;case"bigint":return`${String(s)}n`;case"boolean":case"undefined":return String(s);case"object":return"{}"}},types:{isAsyncFunction(s){return s instanceof r},isArrayBufferView(s){return ArrayBuffer.isView(s)}},isBlob:i},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Kf);var cr=Kf.exports,Ms={},_n={exports:{}},Ua;function js(){if(Ua)return _n.exports;Ua=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return _n.exports=e,_n.exports.AbortSignal=t,_n.exports.default=e,_n.exports}const{format:wh,inspect:ui,AggregateError:mh}=cr,Eh=globalThis.AggregateError||mh,vh=Symbol("kIsNodeError"),Sh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Rh=/^([A-Z][a-z0-9]*)+$/,Ah="__node_internal_",Ei={};function Nr(e,t){if(!e)throw new Ei.ERR_INTERNAL_ASSERTION(t)}function Fa(e){let t="",r=e.length;const n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Ih(e,t,r){if(typeof t=="function")return Nr(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const n=(t.match(/%[dfijoOs]/g)||[]).length;return Nr(n===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?t:wh(t,...r)}function ht(e,t,r){r||(r=Error);class n extends r{constructor(...o){super(Ih(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[vh]=!0,Ei[e]=n}function Ha(e){const t=Ah+e.name;return Object.defineProperty(e,"name",{value:t}),e}function Th(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new Eh([t,e],t.message);return r.code=t.code,r}return e||t}let Oh=class extends Error{constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new Ei.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}};ht("ERR_ASSERTION","%s",Error);ht("ERR_INVALID_ARG_TYPE",(e,t,r)=>{Nr(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const i=[],o=[],s=[];for(const l of t)Nr(typeof l=="string","All expected entries have to be of type string"),Sh.includes(l)?i.push(l.toLowerCase()):Rh.test(l)?o.push(l):(Nr(l!=="object",'The value "object" should be written as "Object"'),s.push(l));if(o.length>0){const l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{const l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(o.length>0||s.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{const l=s.pop();n+=`one of ${s.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var u;if((u=r.constructor)!==null&&u!==void 0&&u.name)n+=`. Received an instance of ${r.constructor.name}`;else{const l=ui(r,{depth:-1});n+=`. Received ${l}`}}else{let l=ui(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);ht("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=ui(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError);ht("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;const i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${i}.`},TypeError);ht("ERR_MISSING_ARGS",(...e)=>{Nr(e.length>0,"At least one arg needs to be specified");let t;const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);ht("ERR_OUT_OF_RANGE",(e,t,r)=>{Nr(t,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Fa(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=Fa(n)),n+="n"):n=ui(r),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);ht("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);ht("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);ht("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);ht("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);ht("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);ht("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ht("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);ht("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);ht("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);ht("ERR_STREAM_WRITE_AFTER_END","write after end",Error);ht("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var St={AbortError:Oh,aggregateTwoErrors:Ha(Th),hideStackFrames:Ha,codes:Ei};const{ArrayIsArray:Us,ArrayPrototypeIncludes:Jf,ArrayPrototypeJoin:Xf,ArrayPrototypeMap:Ch,NumberIsInteger:Fs,NumberIsNaN:Lh,NumberMAX_SAFE_INTEGER:Nh,NumberMIN_SAFE_INTEGER:Ph,NumberParseInt:Bh,ObjectPrototypeHasOwnProperty:$h,RegExpPrototypeExec:Yf,String:xh,StringPrototypeToUpperCase:kh,StringPrototypeTrim:Dh}=st,{hideStackFrames:$t,codes:{ERR_SOCKET_BAD_PORT:Mh,ERR_INVALID_ARG_TYPE:wt,ERR_INVALID_ARG_VALUE:an,ERR_OUT_OF_RANGE:Br,ERR_UNKNOWN_SIGNAL:za}}=St,{normalizeEncoding:jh}=cr,{isAsyncFunction:Uh,isArrayBufferView:Fh}=cr.types,Wa={};function Hh(e){return e===(e|0)}function zh(e){return e===e>>>0}const Wh=/^[0-7]+$/,Vh="must be a 32-bit unsigned integer or an octal string";function qh(e,t,r){if(typeof e>"u"&&(e=r),typeof e=="string"){if(Yf(Wh,e)===null)throw new an(t,e,Vh);e=Bh(e,8)}return Qf(e,t),e}const Gh=$t((e,t,r=Ph,n=Nh)=>{if(typeof e!="number")throw new wt(t,"number",e);if(!Fs(e))throw new Br(t,"an integer",e);if(e<r||e>n)throw new Br(t,`>= ${r} && <= ${n}`,e)}),Zh=$t((e,t,r=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new wt(t,"number",e);if(!Fs(e))throw new Br(t,"an integer",e);if(e<r||e>n)throw new Br(t,`>= ${r} && <= ${n}`,e)}),Qf=$t((e,t,r=!1)=>{if(typeof e!="number")throw new wt(t,"number",e);if(!Fs(e))throw new Br(t,"an integer",e);const n=r?1:0,i=4294967295;if(e<n||e>i)throw new Br(t,`>= ${n} && <= ${i}`,e)});function Hs(e,t){if(typeof e!="string")throw new wt(t,"string",e)}function Kh(e,t,r=void 0,n){if(typeof e!="number")throw new wt(t,"number",e);if(r!=null&&e<r||n!=null&&e>n||(r!=null||n!=null)&&Lh(e))throw new Br(t,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}const Jh=$t((e,t,r)=>{if(!Jf(r,e)){const i="must be one of: "+Xf(Ch(r,o=>typeof o=="string"?`'${o}'`:xh(o)),", ");throw new an(t,e,i)}});function eu(e,t){if(typeof e!="boolean")throw new wt(t,"boolean",e)}function mo(e,t,r){return e==null||!$h(e,t)?r:e[t]}const Xh=$t((e,t,r=null)=>{const n=mo(r,"allowArray",!1),i=mo(r,"allowFunction",!1);if(!mo(r,"nullable",!1)&&e===null||!n&&Us(e)||typeof e!="object"&&(!i||typeof e!="function"))throw new wt(t,"Object",e)}),Yh=$t((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new wt(t,"a dictionary",e)}),zs=$t((e,t,r=0)=>{if(!Us(e))throw new wt(t,"Array",e);if(e.length<r){const n=`must be longer than ${r}`;throw new an(t,e,n)}});function Qh(e,t){zs(e,t);for(let r=0;r<e.length;r++)Hs(e[r],`${t}[${r}]`)}function eg(e,t){zs(e,t);for(let r=0;r<e.length;r++)eu(e[r],`${t}[${r}]`)}function tg(e,t="signal"){if(Hs(e,t),Wa[e]===void 0)throw Wa[kh(e)]!==void 0?new za(e+" (signals must use all capital letters)"):new za(e)}const rg=$t((e,t="buffer")=>{if(!Fh(e))throw new wt(t,["Buffer","TypedArray","DataView"],e)});function ng(e,t){const r=jh(t),n=e.length;if(r==="hex"&&n%2!==0)throw new an("encoding",t,`is invalid for data of length ${n}`)}function ig(e,t="Port",r=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&Dh(e).length===0||+e!==+e>>>0||e>65535||e===0&&!r)throw new Mh(t,e,r);return e|0}const og=$t((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new wt(t,"AbortSignal",e)}),sg=$t((e,t)=>{if(typeof e!="function")throw new wt(t,"Function",e)}),ag=$t((e,t)=>{if(typeof e!="function"||Uh(e))throw new wt(t,"Function",e)}),lg=$t((e,t)=>{if(e!==void 0)throw new wt(t,"undefined",e)});function fg(e,t,r){if(!Jf(r,e))throw new wt(t,`('${Xf(r,"|")}')`,e)}const ug=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Va(e,t){if(typeof e>"u"||!Yf(ug,e))throw new an(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function cg(e){if(typeof e=="string")return Va(e,"hints"),e;if(Us(e)){const t=e.length;let r="";if(t===0)return r;for(let n=0;n<t;n++){const i=e[n];Va(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new an("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var vi={isInt32:Hh,isUint32:zh,parseFileMode:qh,validateArray:zs,validateStringArray:Qh,validateBooleanArray:eg,validateBoolean:eu,validateBuffer:rg,validateDictionary:Yh,validateEncoding:ng,validateFunction:sg,validateInt32:Zh,validateInteger:Gh,validateNumber:Kh,validateObject:Xh,validateOneOf:Jh,validatePlainFunction:ag,validatePort:ig,validateSignalName:tg,validateString:Hs,validateUint32:Qf,validateUndefined:lg,validateUnion:fg,validateAbortSignal:og,validateLinkHeaderValue:cg},Ws={exports:{}};const{Symbol:Si,SymbolAsyncIterator:qa,SymbolIterator:Ga,SymbolFor:tu}=st,ru=Si("kDestroyed"),nu=Si("kIsErrored"),gs=Si("kIsReadable"),iu=Si("kIsDisturbed"),dg=tu("nodejs.webstream.isClosedPromise"),hg=tu("nodejs.webstream.controllerErrorFunction");function Ri(e,t=!1){var r;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((r=e._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function Ai(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}function gg(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function rr(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function ou(e){return!!(e&&!rr(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function su(e){return!!(e&&!rr(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function au(e){return!!(e&&!rr(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function _g(e){return ou(e)||su(e)||au(e)}function bg(e,t){return e==null?!1:t===!0?typeof e[qa]=="function":t===!1?typeof e[Ga]=="function":typeof e[qa]=="function"||typeof e[Ga]=="function"}function Ii(e){if(!rr(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[ru]||n!=null&&n.destroyed)}function lu(e){if(!Ai(e))return null;if(e.writableEnded===!0)return!0;const t=e._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function pg(e,t){if(!Ai(e))return null;if(e.writableFinished===!0)return!0;const r=e._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||t===!1&&r.ended===!0&&r.length===0)}function yg(e){if(!Ri(e))return null;if(e.readableEnded===!0)return!0;const t=e._readableState;return!t||t.errored?!1:typeof(t==null?void 0:t.ended)!="boolean"?null:t.ended}function fu(e,t){if(!Ri(e))return null;const r=e._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||t===!1&&r.ended===!0&&r.length===0)}function uu(e){return e&&e[gs]!=null?e[gs]:typeof(e==null?void 0:e.readable)!="boolean"?null:Ii(e)?!1:Ri(e)&&e.readable&&!fu(e)}function cu(e){return typeof(e==null?void 0:e.writable)!="boolean"?null:Ii(e)?!1:Ai(e)&&e.writable&&!lu(e)}function wg(e,t){return rr(e)?Ii(e)?!0:!((t==null?void 0:t.readable)!==!1&&uu(e)||(t==null?void 0:t.writable)!==!1&&cu(e)):null}function mg(e){var t,r;return rr(e)?e.writableErrored?e.writableErrored:(t=(r=e._writableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function Eg(e){var t,r;return rr(e)?e.readableErrored?e.readableErrored:(t=(r=e._readableState)===null||r===void 0?void 0:r.errored)!==null&&t!==void 0?t:null:null}function vg(e){if(!rr(e))return null;if(typeof e.closed=="boolean")return e.closed;const t=e._writableState,r=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(t==null?void 0:t.closed)||(r==null?void 0:r.closed):typeof e._closed=="boolean"&&du(e)?e._closed:null}function du(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function hu(e){return typeof e._sent100=="boolean"&&du(e)}function Sg(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}function Rg(e){if(!rr(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&hu(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Ag(e){var t;return!!(e&&((t=e[iu])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function Ig(e){var t,r,n,i,o,s,u,l,f,c;return!!(e&&((t=(r=(n=(i=(o=(s=e[nu])!==null&&s!==void 0?s:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&i!==void 0?i:(u=e._readableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&n!==void 0?n:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(f=e._readableState)===null||f===void 0?void 0:f.errored)!==null&&t!==void 0?t:!((c=e._writableState)===null||c===void 0)&&c.errored))}var dr={kDestroyed:ru,isDisturbed:Ag,kIsDisturbed:iu,isErrored:Ig,kIsErrored:nu,isReadable:uu,kIsReadable:gs,kIsClosedPromise:dg,kControllerErrorFunction:hg,isClosed:vg,isDestroyed:Ii,isDuplexNodeStream:gg,isFinished:wg,isIterable:bg,isReadableNodeStream:Ri,isReadableStream:ou,isReadableEnded:yg,isReadableFinished:fu,isReadableErrored:Eg,isNodeStream:rr,isWebStream:_g,isWritable:cu,isWritableNodeStream:Ai,isWritableStream:su,isWritableEnded:lu,isWritableFinished:pg,isWritableErrored:mg,isServerRequest:Sg,isServerResponse:hu,willEmitClose:Rg,isTransformStream:au};const _r=Dr,{AbortError:gu,codes:Tg}=St,{ERR_INVALID_ARG_TYPE:Og,ERR_STREAM_PREMATURE_CLOSE:Za}=Tg,{kEmptyObject:_s,once:bs}=cr,{validateAbortSignal:Cg,validateFunction:Lg,validateObject:Ng,validateBoolean:Pg}=vi,{Promise:Bg,PromisePrototypeThen:$g}=st,{isClosed:xg,isReadable:Ka,isReadableNodeStream:Eo,isReadableStream:kg,isReadableFinished:Ja,isReadableErrored:Xa,isWritable:Ya,isWritableNodeStream:Qa,isWritableStream:Dg,isWritableFinished:el,isWritableErrored:tl,isNodeStream:Mg,willEmitClose:jg,kIsClosedPromise:Ug}=dr;function Fg(e){return e.setHeader&&typeof e.abort=="function"}const ps=()=>{};function _u(e,t,r){var n,i;if(arguments.length===2?(r=t,t=_s):t==null?t=_s:Ng(t,"options"),Lg(r,"callback"),Cg(t.signal,"options.signal"),r=bs(r),kg(e)||Dg(e))return Hg(e,t,r);if(!Mg(e))throw new Og("stream",["ReadableStream","WritableStream","Stream"],e);const o=(n=t.readable)!==null&&n!==void 0?n:Eo(e),s=(i=t.writable)!==null&&i!==void 0?i:Qa(e),u=e._writableState,l=e._readableState,f=()=>{e.writable||m()};let c=jg(e)&&Eo(e)===o&&Qa(e)===s,h=el(e,!1);const m=()=>{h=!0,e.destroyed&&(c=!1),!(c&&(!e.readable||o))&&(!o||p)&&r.call(e)};let p=Ja(e,!1);const v=()=>{p=!0,e.destroyed&&(c=!1),!(c&&(!e.writable||s))&&(!s||h)&&r.call(e)},q=V=>{r.call(e,V)};let M=xg(e);const D=()=>{M=!0;const V=tl(e)||Xa(e);if(V&&typeof V!="boolean")return r.call(e,V);if(o&&!p&&Eo(e,!0)&&!Ja(e,!1))return r.call(e,new Za);if(s&&!h&&!el(e,!1))return r.call(e,new Za);r.call(e)},E=()=>{M=!0;const V=tl(e)||Xa(e);if(V&&typeof V!="boolean")return r.call(e,V);r.call(e)},H=()=>{e.req.on("finish",m)};Fg(e)?(e.on("complete",m),c||e.on("abort",D),e.req?H():e.on("request",H)):s&&!u&&(e.on("end",f),e.on("close",f)),!c&&typeof e.aborted=="boolean"&&e.on("aborted",D),e.on("end",v),e.on("finish",m),t.error!==!1&&e.on("error",q),e.on("close",D),M?_r.nextTick(D):u!=null&&u.errorEmitted||l!=null&&l.errorEmitted?c||_r.nextTick(E):(!o&&(!c||Ka(e))&&(h||Ya(e)===!1)||!s&&(!c||Ya(e))&&(p||Ka(e)===!1)||l&&e.req&&e.aborted)&&_r.nextTick(E);const R=()=>{r=ps,e.removeListener("aborted",D),e.removeListener("complete",m),e.removeListener("abort",D),e.removeListener("request",H),e.req&&e.req.removeListener("finish",m),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",m),e.removeListener("end",v),e.removeListener("error",q),e.removeListener("close",D)};if(t.signal&&!M){const V=()=>{const x=r;R(),x.call(e,new gu(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)_r.nextTick(V);else{const x=r;r=bs((...j)=>{t.signal.removeEventListener("abort",V),x.apply(e,j)}),t.signal.addEventListener("abort",V)}}return R}function Hg(e,t,r){let n=!1,i=ps;if(t.signal)if(i=()=>{n=!0,r.call(e,new gu(void 0,{cause:t.signal.reason}))},t.signal.aborted)_r.nextTick(i);else{const s=r;r=bs((...u)=>{t.signal.removeEventListener("abort",i),s.apply(e,u)}),t.signal.addEventListener("abort",i)}const o=(...s)=>{n||_r.nextTick(()=>r.apply(e,s))};return $g(e[Ug].promise,o,o),ps}function zg(e,t){var r;let n=!1;return t===null&&(t=_s),(r=t)!==null&&r!==void 0&&r.cleanup&&(Pg(t.cleanup,"cleanup"),n=t.cleanup),new Bg((i,o)=>{const s=_u(e,t,u=>{n&&s(),u?o(u):i()})})}Ws.exports=_u;Ws.exports.finished=zg;var vr=Ws.exports;const Yt=Dr,{aggregateTwoErrors:Wg,codes:{ERR_MULTIPLE_CALLBACK:Vg},AbortError:qg}=St,{Symbol:bu}=st,{kDestroyed:Gg,isDestroyed:Zg,isFinished:Kg,isServerRequest:Jg}=dr,pu=bu("kDestroy"),ys=bu("kConstruct");function yu(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function Xg(e,t){const r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof t=="function"&&t(),this):(yu(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?rl(this,e,t):this.once(pu,function(o){rl(this,Wg(o,e),t)}),this)}function rl(e,t,r){let n=!1;function i(o){if(n)return;n=!0;const s=e._readableState,u=e._writableState;yu(o,u,s),u&&(u.closed=!0),s&&(s.closed=!0),typeof r=="function"&&r(o),o?Yt.nextTick(Yg,e,o):Yt.nextTick(wu,e)}try{e._destroy(t||null,i)}catch(o){i(o)}}function Yg(e,t){ws(e,t),wu(e)}function wu(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(r!=null&&r.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function ws(e,t){const r=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function Qg(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function ms(e,t,r){const n=e._readableState,i=e._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),n&&!n.errored&&(n.errored=t),r?Yt.nextTick(ws,e,t):ws(e,t))}function e0(e,t){if(typeof e._construct!="function")return;const r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(ys,t),!(e.listenerCount(ys)>1)&&Yt.nextTick(t0,e)}function t0(e){let t=!1;function r(n){if(t){ms(e,n??new Vg);return}t=!0;const i=e._readableState,o=e._writableState,s=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(pu,n):n?ms(e,n,!0):Yt.nextTick(r0,e)}try{e._construct(n=>{Yt.nextTick(r,n)})}catch(n){Yt.nextTick(r,n)}}function r0(e){e.emit(ys)}function nl(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function mu(e){e.emit("close")}function n0(e,t){e.emit("error",t),Yt.nextTick(mu,e)}function i0(e,t){!e||Zg(e)||(!t&&!Kg(e)&&(t=new qg),Jg(e)?(e.socket=null,e.destroy(t)):nl(e)?e.abort():nl(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?Yt.nextTick(n0,e,t):Yt.nextTick(mu,e),e.destroyed||(e[Gg]=!0))}var ln={construct:e0,destroyer:i0,destroy:Xg,undestroy:Qg,errorOrDestroy:ms};const{ArrayIsArray:o0,ObjectSetPrototypeOf:Eu}=st,{EventEmitter:Ti}=Dn;function Oi(e){Ti.call(this,e)}Eu(Oi.prototype,Ti.prototype);Eu(Oi,Ti);Oi.prototype.pipe=function(e,t){const r=this;function n(c){e.writable&&e.write(c)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",s),r.on("close",u));let o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function l(c){f(),Ti.listenerCount(this,"error")===0&&this.emit("error",c)}Es(r,"error",l),Es(e,"error",l);function f(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e};function Es(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):o0(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}var Vs={Stream:Oi,prependListener:Es},vu={exports:{}};(function(e){const{AbortError:t,codes:r}=St,{isNodeStream:n,isWebStream:i,kControllerErrorFunction:o}=dr,s=vr,{ERR_INVALID_ARG_TYPE:u}=r,l=(f,c)=>{if(typeof f!="object"||!("aborted"in f))throw new u(c,"AbortSignal",f)};e.exports.addAbortSignal=function(c,h){if(l(c,"signal"),!n(h)&&!i(h))throw new u("stream",["ReadableStream","WritableStream","Stream"],h);return e.exports.addAbortSignalNoValidate(c,h)},e.exports.addAbortSignalNoValidate=function(f,c){if(typeof f!="object"||!("aborted"in f))return c;const h=n(c)?()=>{c.destroy(new t(void 0,{cause:f.reason}))}:()=>{c[o](new t(void 0,{cause:f.reason}))};return f.aborted?h():(f.addEventListener("abort",h),s(c,()=>f.removeEventListener("abort",h))),c}})(vu);var Ci=vu.exports;const{StringPrototypeSlice:il,SymbolIterator:s0,TypedArrayPrototypeSet:Kn,Uint8Array:a0}=st,{Buffer:vo}=er,{inspect:l0}=cr;var f0=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){const r={data:t,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;const t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=t+r.data;return n}concat(t){if(this.length===0)return vo.alloc(0);const r=vo.allocUnsafe(t>>>0);let n=this.head,i=0;for(;n;)Kn(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(t,r){const n=this.head.data;if(t<n.length){const i=n.slice(0,t);return this.head.data=n.slice(t),i}return t===n.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[s0](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",n=this.head,i=0;do{const o=n.data;if(t>o.length)r+=o,t-=o.length;else{t===o.length?(r+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=il(o,0,t),this.head=n,n.data=il(o,t));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(t){const r=vo.allocUnsafe(t),n=t;let i=this.head,o=0;do{const s=i.data;if(t>s.length)Kn(r,s,n-t),t-=s.length;else{t===s.length?(Kn(r,s,n-t),++o,i.next?this.head=i.next:this.head=this.tail=null):(Kn(r,new a0(s.buffer,s.byteOffset,t),n-t),this.head=i,i.data=s.slice(t));break}++o}while((i=i.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return l0(this,{...r,depth:0,customInspect:!1})}};const{MathFloor:u0,NumberIsInteger:c0}=st,{ERR_INVALID_ARG_VALUE:d0}=St.codes;function h0(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Su(e){return e?16:16*1024}function g0(e,t,r,n){const i=h0(t,n,r);if(i!=null){if(!c0(i)||i<0){const o=n?`options.${r}`:"options.highWaterMark";throw new d0(o,i)}return u0(i)}return Su(e.objectMode)}var qs={getHighWaterMark:g0,getDefaultHighWaterMark:Su};const ol=Dr,{PromisePrototypeThen:_0,SymbolAsyncIterator:sl,SymbolIterator:al}=st,{Buffer:b0}=er,{ERR_INVALID_ARG_TYPE:p0,ERR_STREAM_NULL_VALUES:y0}=St.codes;function w0(e,t,r){let n;if(typeof t=="string"||t instanceof b0)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});let i;if(t&&t[sl])i=!0,n=t[sl]();else if(t&&t[al])i=!1,n=t[al]();else throw new p0("iterable",["Iterable"],t);const o=new e({objectMode:!0,highWaterMark:1,...r});let s=!1;o._read=function(){s||(s=!0,l())},o._destroy=function(f,c){_0(u(f),()=>ol.nextTick(c,f),h=>ol.nextTick(c,h||f))};async function u(f){const c=f!=null,h=typeof n.throw=="function";if(c&&h){const{value:m,done:p}=await n.throw(f);if(await m,p)return}if(typeof n.return=="function"){const{value:m}=await n.return();await m}}async function l(){for(;;){try{const{value:f,done:c}=i?await n.next():n.next();if(c)o.push(null);else{const h=f&&typeof f.then=="function"?await f:f;if(h===null)throw s=!1,new y0;if(o.push(h))continue;s=!1}}catch(f){o.destroy(f)}break}}return o}var Ru=w0,So,ll;function Li(){if(ll)return So;ll=1;const e=Dr,{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:s,ObjectSetPrototypeOf:u,Promise:l,SafeSet:f,SymbolAsyncIterator:c,Symbol:h}=st;So=O,O.ReadableState=P;const{EventEmitter:m}=Dn,{Stream:p,prependListener:v}=Vs,{Buffer:q}=er,{addAbortSignal:M}=Ci,D=vr;let E=cr.debuglog("stream",S=>{E=S});const H=f0,R=ln,{getHighWaterMark:V,getDefaultHighWaterMark:x}=qs,{aggregateTwoErrors:j,codes:{ERR_INVALID_ARG_TYPE:ee,ERR_METHOD_NOT_IMPLEMENTED:z,ERR_OUT_OF_RANGE:C,ERR_STREAM_PUSH_AFTER_EOF:G,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:_}}=St,{validateObject:y}=vi,b=h("kPaused"),{StringDecoder:B}=Xd(),W=Ru;u(O.prototype,p.prototype),u(O,p);const N=()=>{},{errorOrDestroy:k}=R;function P(S,I,de){typeof de!="boolean"&&(de=I instanceof lr()),this.objectMode=!!(S&&S.objectMode),de&&(this.objectMode=this.objectMode||!!(S&&S.readableObjectMode)),this.highWaterMark=S?V(this,S,"readableHighWaterMark",de):x(!1),this.buffer=new H,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[b]=null,this.errorEmitted=!1,this.emitClose=!S||S.emitClose!==!1,this.autoDestroy=!S||S.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=S&&S.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,S&&S.encoding&&(this.decoder=new B(S.encoding),this.encoding=S.encoding)}function O(S){if(!(this instanceof O))return new O(S);const I=this instanceof lr();this._readableState=new P(S,this,I),S&&(typeof S.read=="function"&&(this._read=S.read),typeof S.destroy=="function"&&(this._destroy=S.destroy),typeof S.construct=="function"&&(this._construct=S.construct),S.signal&&!I&&M(S.signal,this)),p.call(this,S),R.construct(this,()=>{this._readableState.needReadable&&be(this,this._readableState)})}O.prototype.destroy=R.destroy,O.prototype._undestroy=R.undestroy,O.prototype._destroy=function(S,I){I(S)},O.prototype[m.captureRejectionSymbol]=function(S){this.destroy(S)},O.prototype.push=function(S,I){return J(this,S,I,!1)},O.prototype.unshift=function(S,I){return J(this,S,I,!0)};function J(S,I,de,ae){E("readableAddChunk",I);const pe=S._readableState;let je;if(pe.objectMode||(typeof I=="string"?(de=de||pe.defaultEncoding,pe.encoding!==de&&(ae&&pe.encoding?I=q.from(I,de).toString(pe.encoding):(I=q.from(I,de),de=""))):I instanceof q?de="":p._isUint8Array(I)?(I=p._uint8ArrayToBuffer(I),de=""):I!=null&&(je=new ee("chunk",["string","Buffer","Uint8Array"],I))),je)k(S,je);else if(I===null)pe.reading=!1,he(S,pe);else if(pe.objectMode||I&&I.length>0)if(ae)if(pe.endEmitted)k(S,new _);else{if(pe.destroyed||pe.errored)return!1;ne(S,pe,I,!0)}else if(pe.ended)k(S,new G);else{if(pe.destroyed||pe.errored)return!1;pe.reading=!1,pe.decoder&&!de?(I=pe.decoder.write(I),pe.objectMode||I.length!==0?ne(S,pe,I,!1):be(S,pe)):ne(S,pe,I,!1)}else ae||(pe.reading=!1,be(S,pe));return!pe.ended&&(pe.length<pe.highWaterMark||pe.length===0)}function ne(S,I,de,ae){I.flowing&&I.length===0&&!I.sync&&S.listenerCount("data")>0?(I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null,I.dataEmitted=!0,S.emit("data",de)):(I.length+=I.objectMode?1:de.length,ae?I.buffer.unshift(de):I.buffer.push(de),I.needReadable&&Se(S)),be(S,I)}O.prototype.isPaused=function(){const S=this._readableState;return S[b]===!0||S.flowing===!1},O.prototype.setEncoding=function(S){const I=new B(S);this._readableState.decoder=I,this._readableState.encoding=this._readableState.decoder.encoding;const de=this._readableState.buffer;let ae="";for(const pe of de)ae+=I.write(pe);return de.clear(),ae!==""&&de.push(ae),this._readableState.length=ae.length,this};const re=1073741824;function se(S){if(S>re)throw new C("size","<= 1GiB",S);return S--,S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S++,S}function ce(S,I){return S<=0||I.length===0&&I.ended?0:I.objectMode?1:n(S)?I.flowing&&I.length?I.buffer.first().length:I.length:S<=I.length?S:I.ended?I.length:0}O.prototype.read=function(S){E("read",S),S===void 0?S=NaN:r(S)||(S=i(S,10));const I=this._readableState,de=S;if(S>I.highWaterMark&&(I.highWaterMark=se(S)),S!==0&&(I.emittedReadable=!1),S===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return E("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?Be(this):Se(this),null;if(S=ce(S,I),S===0&&I.ended)return I.length===0&&Be(this),null;let ae=I.needReadable;if(E("need readable",ae),(I.length===0||I.length-S<I.highWaterMark)&&(ae=!0,E("length less than watermark",ae)),I.ended||I.reading||I.destroyed||I.errored||!I.constructed)ae=!1,E("reading, ended or constructing",ae);else if(ae){E("do read"),I.reading=!0,I.sync=!0,I.length===0&&(I.needReadable=!0);try{this._read(I.highWaterMark)}catch(je){k(this,je)}I.sync=!1,I.reading||(S=ce(de,I))}let pe;return S>0?pe=Ie(S,I):pe=null,pe===null?(I.needReadable=I.length<=I.highWaterMark,S=0):(I.length-=S,I.multiAwaitDrain?I.awaitDrainWriters.clear():I.awaitDrainWriters=null),I.length===0&&(I.ended||(I.needReadable=!0),de!==S&&I.ended&&Be(this)),pe!==null&&!I.errorEmitted&&!I.closeEmitted&&(I.dataEmitted=!0,this.emit("data",pe)),pe};function he(S,I){if(E("onEofChunk"),!I.ended){if(I.decoder){const de=I.decoder.end();de&&de.length&&(I.buffer.push(de),I.length+=I.objectMode?1:de.length)}I.ended=!0,I.sync?Se(S):(I.needReadable=!1,I.emittedReadable=!0,ge(S))}}function Se(S){const I=S._readableState;E("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(E("emitReadable",I.flowing),I.emittedReadable=!0,e.nextTick(ge,S))}function ge(S){const I=S._readableState;E("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&!I.errored&&(I.length||I.ended)&&(S.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,ue(S)}function be(S,I){!I.readingMore&&I.constructed&&(I.readingMore=!0,e.nextTick(Ce,S,I))}function Ce(S,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){const de=I.length;if(E("maybeReadMore read 0"),S.read(0),de===I.length)break}I.readingMore=!1}O.prototype._read=function(S){throw new z("_read()")},O.prototype.pipe=function(S,I){const de=this,ae=this._readableState;ae.pipes.length===1&&(ae.multiAwaitDrain||(ae.multiAwaitDrain=!0,ae.awaitDrainWriters=new f(ae.awaitDrainWriters?[ae.awaitDrainWriters]:[]))),ae.pipes.push(S),E("pipe count=%d opts=%j",ae.pipes.length,I);const je=(!I||I.end!==!1)&&S!==e.stdout&&S!==e.stderr?ie:X;ae.endEmitted?e.nextTick(je):de.once("end",je),S.on("unpipe",w);function w(Y,g){E("onunpipe"),Y===de&&g&&g.hasUnpiped===!1&&(g.hasUnpiped=!0,U())}function ie(){E("onend"),S.end()}let fe,we=!1;function U(){E("cleanup"),S.removeListener("close",Ae),S.removeListener("finish",a),fe&&S.removeListener("drain",fe),S.removeListener("error",le),S.removeListener("unpipe",w),de.removeListener("end",ie),de.removeListener("end",X),de.removeListener("data",d),we=!0,fe&&ae.awaitDrainWriters&&(!S._writableState||S._writableState.needDrain)&&fe()}function te(){we||(ae.pipes.length===1&&ae.pipes[0]===S?(E("false write response, pause",0),ae.awaitDrainWriters=S,ae.multiAwaitDrain=!1):ae.pipes.length>1&&ae.pipes.includes(S)&&(E("false write response, pause",ae.awaitDrainWriters.size),ae.awaitDrainWriters.add(S)),de.pause()),fe||(fe=Le(de,S),S.on("drain",fe))}de.on("data",d);function d(Y){E("ondata");const g=S.write(Y);E("dest.write",g),g===!1&&te()}function le(Y){if(E("onerror",Y),X(),S.removeListener("error",le),S.listenerCount("error")===0){const g=S._writableState||S._readableState;g&&!g.errorEmitted?k(S,Y):S.emit("error",Y)}}v(S,"error",le);function Ae(){S.removeListener("finish",a),X()}S.once("close",Ae);function a(){E("onfinish"),S.removeListener("close",Ae),X()}S.once("finish",a);function X(){E("unpipe"),de.unpipe(S)}return S.emit("pipe",de),S.writableNeedDrain===!0?ae.flowing&&te():ae.flowing||(E("pipe resume"),de.resume()),S};function Le(S,I){return function(){const ae=S._readableState;ae.awaitDrainWriters===I?(E("pipeOnDrain",1),ae.awaitDrainWriters=null):ae.multiAwaitDrain&&(E("pipeOnDrain",ae.awaitDrainWriters.size),ae.awaitDrainWriters.delete(I)),(!ae.awaitDrainWriters||ae.awaitDrainWriters.size===0)&&S.listenerCount("data")&&S.resume()}}O.prototype.unpipe=function(S){const I=this._readableState,de={hasUnpiped:!1};if(I.pipes.length===0)return this;if(!S){const pe=I.pipes;I.pipes=[],this.pause();for(let je=0;je<pe.length;je++)pe[je].emit("unpipe",this,{hasUnpiped:!1});return this}const ae=t(I.pipes,S);return ae===-1?this:(I.pipes.splice(ae,1),I.pipes.length===0&&this.pause(),S.emit("unpipe",this,de),this)},O.prototype.on=function(S,I){const de=p.prototype.on.call(this,S,I),ae=this._readableState;return S==="data"?(ae.readableListening=this.listenerCount("readable")>0,ae.flowing!==!1&&this.resume()):S==="readable"&&!ae.endEmitted&&!ae.readableListening&&(ae.readableListening=ae.needReadable=!0,ae.flowing=!1,ae.emittedReadable=!1,E("on readable",ae.length,ae.reading),ae.length?Se(this):ae.reading||e.nextTick(T,this)),de},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(S,I){const de=p.prototype.removeListener.call(this,S,I);return S==="readable"&&e.nextTick(Oe,this),de},O.prototype.off=O.prototype.removeListener,O.prototype.removeAllListeners=function(S){const I=p.prototype.removeAllListeners.apply(this,arguments);return(S==="readable"||S===void 0)&&e.nextTick(Oe,this),I};function Oe(S){const I=S._readableState;I.readableListening=S.listenerCount("readable")>0,I.resumeScheduled&&I[b]===!1?I.flowing=!0:S.listenerCount("data")>0?S.resume():I.readableListening||(I.flowing=null)}function T(S){E("readable nexttick read 0"),S.read(0)}O.prototype.resume=function(){const S=this._readableState;return S.flowing||(E("resume"),S.flowing=!S.readableListening,L(this,S)),S[b]=!1,this};function L(S,I){I.resumeScheduled||(I.resumeScheduled=!0,e.nextTick(Z,S,I))}function Z(S,I){E("resume",I.reading),I.reading||S.read(0),I.resumeScheduled=!1,S.emit("resume"),ue(S),I.flowing&&!I.reading&&S.read(0)}O.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[b]=!0,this};function ue(S){const I=S._readableState;for(E("flow",I.flowing);I.flowing&&S.read()!==null;);}O.prototype.wrap=function(S){let I=!1;S.on("data",ae=>{!this.push(ae)&&S.pause&&(I=!0,S.pause())}),S.on("end",()=>{this.push(null)}),S.on("error",ae=>{k(this,ae)}),S.on("close",()=>{this.destroy()}),S.on("destroy",()=>{this.destroy()}),this._read=()=>{I&&S.resume&&(I=!1,S.resume())};const de=s(S);for(let ae=1;ae<de.length;ae++){const pe=de[ae];this[pe]===void 0&&typeof S[pe]=="function"&&(this[pe]=S[pe].bind(S))}return this},O.prototype[c]=function(){return oe(this)},O.prototype.iterator=function(S){return S!==void 0&&y(S,"options"),oe(this,S)};function oe(S,I){typeof S.read!="function"&&(S=O.wrap(S,{objectMode:!0}));const de=_e(S,I);return de.stream=S,de}async function*_e(S,I){let de=N;function ae(w){this===S?(de(),de=N):de=w}S.on("readable",ae);let pe;const je=D(S,{writable:!1},w=>{pe=w?j(pe,w):null,de(),de=N});try{for(;;){const w=S.destroyed?null:S.read();if(w!==null)yield w;else{if(pe)throw pe;if(pe===null)return;await new l(ae)}}}catch(w){throw pe=j(pe,w),pe}finally{(pe||(I==null?void 0:I.destroyOnReturn)!==!1)&&(pe===void 0||S._readableState.autoDestroy)?R.destroyer(S,null):(S.off("readable",ae),je())}}o(O.prototype,{readable:{__proto__:null,get(){const S=this._readableState;return!!S&&S.readable!==!1&&!S.destroyed&&!S.errorEmitted&&!S.endEmitted},set(S){this._readableState&&(this._readableState.readable=!!S)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(S){this._readableState&&(this._readableState.flowing=S)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(S){this._readableState&&(this._readableState.destroyed=S)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(P.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[b]!==!1},set(S){this[b]=!!S}}}),O._fromList=Ie;function Ie(S,I){if(I.length===0)return null;let de;return I.objectMode?de=I.buffer.shift():!S||S>=I.length?(I.decoder?de=I.buffer.join(""):I.buffer.length===1?de=I.buffer.first():de=I.buffer.concat(I.length),I.buffer.clear()):de=I.buffer.consume(S,I.decoder),de}function Be(S){const I=S._readableState;E("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,e.nextTick(ze,I,S))}function ze(S,I){if(E("endReadableNT",S.endEmitted,S.length),!S.errored&&!S.closeEmitted&&!S.endEmitted&&S.length===0){if(S.endEmitted=!0,I.emit("end"),I.writable&&I.allowHalfOpen===!1)e.nextTick(Fe,I);else if(S.autoDestroy){const de=I._writableState;(!de||de.autoDestroy&&(de.finished||de.writable===!1))&&I.destroy()}}}function Fe(S){S.writable&&!S.writableEnded&&!S.destroyed&&S.end()}O.from=function(S,I){return W(O,S,I)};let Me;function nt(){return Me===void 0&&(Me={}),Me}return O.fromWeb=function(S,I){return nt().newStreamReadableFromReadableStream(S,I)},O.toWeb=function(S,I){return nt().newReadableStreamFromStreamReadable(S,I)},O.wrap=function(S,I){var de,ae;return new O({objectMode:(de=(ae=S.readableObjectMode)!==null&&ae!==void 0?ae:S.objectMode)!==null&&de!==void 0?de:!0,...I,destroy(pe,je){R.destroyer(S,pe),je(pe)}}).wrap(S)},So}var Ro,fl;function Au(){if(fl)return Ro;fl=1;const e=Dr,{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:s,StringPrototypeToLowerCase:u,Symbol:l,SymbolHasInstance:f}=st;Ro=B,B.WritableState=y;const{EventEmitter:c}=Dn,h=Vs.Stream,{Buffer:m}=er,p=ln,{addAbortSignal:v}=Ci,{getHighWaterMark:q,getDefaultHighWaterMark:M}=qs,{ERR_INVALID_ARG_TYPE:D,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:H,ERR_STREAM_CANNOT_PIPE:R,ERR_STREAM_DESTROYED:V,ERR_STREAM_ALREADY_FINISHED:x,ERR_STREAM_NULL_VALUES:j,ERR_STREAM_WRITE_AFTER_END:ee,ERR_UNKNOWN_ENCODING:z}=St.codes,{errorOrDestroy:C}=p;s(B.prototype,h.prototype),s(B,h);function G(){}const _=l("kOnFinished");function y(T,L,Z){typeof Z!="boolean"&&(Z=L instanceof lr()),this.objectMode=!!(T&&T.objectMode),Z&&(this.objectMode=this.objectMode||!!(T&&T.writableObjectMode)),this.highWaterMark=T?q(this,T,"writableHighWaterMark",Z):M(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ue=!!(T&&T.decodeStrings===!1);this.decodeStrings=!ue,this.defaultEncoding=T&&T.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=O.bind(void 0,L),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,b(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!T||T.emitClose!==!1,this.autoDestroy=!T||T.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[_]=[]}function b(T){T.buffered=[],T.bufferedIndex=0,T.allBuffers=!0,T.allNoop=!0}y.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},i(y.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function B(T){const L=this instanceof lr();if(!L&&!n(B,this))return new B(T);this._writableState=new y(T,this,L),T&&(typeof T.write=="function"&&(this._write=T.write),typeof T.writev=="function"&&(this._writev=T.writev),typeof T.destroy=="function"&&(this._destroy=T.destroy),typeof T.final=="function"&&(this._final=T.final),typeof T.construct=="function"&&(this._construct=T.construct),T.signal&&v(T.signal,this)),h.call(this,T),p.construct(this,()=>{const Z=this._writableState;Z.writing||se(this,Z),ge(this,Z)})}i(B,f,{__proto__:null,value:function(T){return n(this,T)?!0:this!==B?!1:T&&T._writableState instanceof y}}),B.prototype.pipe=function(){C(this,new R)};function W(T,L,Z,ue){const oe=T._writableState;if(typeof Z=="function")ue=Z,Z=oe.defaultEncoding;else{if(!Z)Z=oe.defaultEncoding;else if(Z!=="buffer"&&!m.isEncoding(Z))throw new z(Z);typeof ue!="function"&&(ue=G)}if(L===null)throw new j;if(!oe.objectMode)if(typeof L=="string")oe.decodeStrings!==!1&&(L=m.from(L,Z),Z="buffer");else if(L instanceof m)Z="buffer";else if(h._isUint8Array(L))L=h._uint8ArrayToBuffer(L),Z="buffer";else throw new D("chunk",["string","Buffer","Uint8Array"],L);let _e;return oe.ending?_e=new ee:oe.destroyed&&(_e=new V("write")),_e?(e.nextTick(ue,_e),C(T,_e,!0),_e):(oe.pendingcb++,N(T,oe,L,Z,ue))}B.prototype.write=function(T,L,Z){return W(this,T,L,Z)===!0},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){const T=this._writableState;T.corked&&(T.corked--,T.writing||se(this,T))},B.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=u(L)),!m.isEncoding(L))throw new z(L);return this._writableState.defaultEncoding=L,this};function N(T,L,Z,ue,oe){const _e=L.objectMode?1:Z.length;L.length+=_e;const Ie=L.length<L.highWaterMark;return Ie||(L.needDrain=!0),L.writing||L.corked||L.errored||!L.constructed?(L.buffered.push({chunk:Z,encoding:ue,callback:oe}),L.allBuffers&&ue!=="buffer"&&(L.allBuffers=!1),L.allNoop&&oe!==G&&(L.allNoop=!1)):(L.writelen=_e,L.writecb=oe,L.writing=!0,L.sync=!0,T._write(Z,ue,L.onwrite),L.sync=!1),Ie&&!L.errored&&!L.destroyed}function k(T,L,Z,ue,oe,_e,Ie){L.writelen=ue,L.writecb=Ie,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new V("write")):Z?T._writev(oe,L.onwrite):T._write(oe,_e,L.onwrite),L.sync=!1}function P(T,L,Z,ue){--L.pendingcb,ue(Z),re(L),C(T,Z)}function O(T,L){const Z=T._writableState,ue=Z.sync,oe=Z.writecb;if(typeof oe!="function"){C(T,new H);return}Z.writing=!1,Z.writecb=null,Z.length-=Z.writelen,Z.writelen=0,L?(L.stack,Z.errored||(Z.errored=L),T._readableState&&!T._readableState.errored&&(T._readableState.errored=L),ue?e.nextTick(P,T,Z,L,oe):P(T,Z,L,oe)):(Z.buffered.length>Z.bufferedIndex&&se(T,Z),ue?Z.afterWriteTickInfo!==null&&Z.afterWriteTickInfo.cb===oe?Z.afterWriteTickInfo.count++:(Z.afterWriteTickInfo={count:1,cb:oe,stream:T,state:Z},e.nextTick(J,Z.afterWriteTickInfo)):ne(T,Z,1,oe))}function J({stream:T,state:L,count:Z,cb:ue}){return L.afterWriteTickInfo=null,ne(T,L,Z,ue)}function ne(T,L,Z,ue){for(!L.ending&&!T.destroyed&&L.length===0&&L.needDrain&&(L.needDrain=!1,T.emit("drain"));Z-- >0;)L.pendingcb--,ue();L.destroyed&&re(L),ge(T,L)}function re(T){if(T.writing)return;for(let oe=T.bufferedIndex;oe<T.buffered.length;++oe){var L;const{chunk:_e,callback:Ie}=T.buffered[oe],Be=T.objectMode?1:_e.length;T.length-=Be,Ie((L=T.errored)!==null&&L!==void 0?L:new V("write"))}const Z=T[_].splice(0);for(let oe=0;oe<Z.length;oe++){var ue;Z[oe]((ue=T.errored)!==null&&ue!==void 0?ue:new V("end"))}b(T)}function se(T,L){if(L.corked||L.bufferProcessing||L.destroyed||!L.constructed)return;const{buffered:Z,bufferedIndex:ue,objectMode:oe}=L,_e=Z.length-ue;if(!_e)return;let Ie=ue;if(L.bufferProcessing=!0,_e>1&&T._writev){L.pendingcb-=_e-1;const Be=L.allNoop?G:Fe=>{for(let Me=Ie;Me<Z.length;++Me)Z[Me].callback(Fe)},ze=L.allNoop&&Ie===0?Z:t(Z,Ie);ze.allBuffers=L.allBuffers,k(T,L,!0,L.length,ze,"",Be),b(L)}else{do{const{chunk:Be,encoding:ze,callback:Fe}=Z[Ie];Z[Ie++]=null;const Me=oe?1:Be.length;k(T,L,!1,Me,Be,ze,Fe)}while(Ie<Z.length&&!L.writing);Ie===Z.length?b(L):Ie>256?(Z.splice(0,Ie),L.bufferedIndex=0):L.bufferedIndex=Ie}L.bufferProcessing=!1}B.prototype._write=function(T,L,Z){if(this._writev)this._writev([{chunk:T,encoding:L}],Z);else throw new E("_write()")},B.prototype._writev=null,B.prototype.end=function(T,L,Z){const ue=this._writableState;typeof T=="function"?(Z=T,T=null,L=null):typeof L=="function"&&(Z=L,L=null);let oe;if(T!=null){const _e=W(this,T,L);_e instanceof r&&(oe=_e)}return ue.corked&&(ue.corked=1,this.uncork()),oe||(!ue.errored&&!ue.ending?(ue.ending=!0,ge(this,ue,!0),ue.ended=!0):ue.finished?oe=new x("end"):ue.destroyed&&(oe=new V("end"))),typeof Z=="function"&&(oe||ue.finished?e.nextTick(Z,oe):ue[_].push(Z)),this};function ce(T){return T.ending&&!T.destroyed&&T.constructed&&T.length===0&&!T.errored&&T.buffered.length===0&&!T.finished&&!T.writing&&!T.errorEmitted&&!T.closeEmitted}function he(T,L){let Z=!1;function ue(oe){if(Z){C(T,oe??H());return}if(Z=!0,L.pendingcb--,oe){const _e=L[_].splice(0);for(let Ie=0;Ie<_e.length;Ie++)_e[Ie](oe);C(T,oe,L.sync)}else ce(L)&&(L.prefinished=!0,T.emit("prefinish"),L.pendingcb++,e.nextTick(be,T,L))}L.sync=!0,L.pendingcb++;try{T._final(ue)}catch(oe){ue(oe)}L.sync=!1}function Se(T,L){!L.prefinished&&!L.finalCalled&&(typeof T._final=="function"&&!L.destroyed?(L.finalCalled=!0,he(T,L)):(L.prefinished=!0,T.emit("prefinish")))}function ge(T,L,Z){ce(L)&&(Se(T,L),L.pendingcb===0&&(Z?(L.pendingcb++,e.nextTick((ue,oe)=>{ce(oe)?be(ue,oe):oe.pendingcb--},T,L)):ce(L)&&(L.pendingcb++,be(T,L))))}function be(T,L){L.pendingcb--,L.finished=!0;const Z=L[_].splice(0);for(let ue=0;ue<Z.length;ue++)Z[ue]();if(T.emit("finish"),L.autoDestroy){const ue=T._readableState;(!ue||ue.autoDestroy&&(ue.endEmitted||ue.readable===!1))&&T.destroy()}}o(B.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(T){this._writableState&&(this._writableState.destroyed=T)}},writable:{__proto__:null,get(){const T=this._writableState;return!!T&&T.writable!==!1&&!T.destroyed&&!T.errored&&!T.ending&&!T.ended},set(T){this._writableState&&(this._writableState.writable=!!T)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const T=this._writableState;return T?!T.destroyed&&!T.ending&&T.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const Ce=p.destroy;B.prototype.destroy=function(T,L){const Z=this._writableState;return!Z.destroyed&&(Z.bufferedIndex<Z.buffered.length||Z[_].length)&&e.nextTick(re,Z),Ce.call(this,T,L),this},B.prototype._undestroy=p.undestroy,B.prototype._destroy=function(T,L){L(T)},B.prototype[c.captureRejectionSymbol]=function(T){this.destroy(T)};let Le;function Oe(){return Le===void 0&&(Le={}),Le}return B.fromWeb=function(T,L){return Oe().newStreamWritableFromWritableStream(T,L)},B.toWeb=function(T){return Oe().newWritableStreamFromStreamWritable(T)},Ro}var Ao,ul;function m0(){if(ul)return Ao;ul=1;const e=Dr,t=er,{isReadable:r,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:s,isWritableNodeStream:u,isDuplexNodeStream:l}=dr,f=vr,{AbortError:c,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:m}}=St,{destroyer:p}=ln,v=lr(),q=Li(),{createDeferredPromise:M}=cr,D=Ru,E=globalThis.Blob||t.Blob,H=typeof E<"u"?function(C){return C instanceof E}:function(C){return!1},R=globalThis.AbortController||js().AbortController,{FunctionPrototypeCall:V}=st;class x extends v{constructor(C){super(C),(C==null?void 0:C.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(C==null?void 0:C.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Ao=function z(C,G){if(l(C))return C;if(s(C))return ee({readable:C});if(u(C))return ee({writable:C});if(o(C))return ee({writable:!1,readable:!1});if(typeof C=="function"){const{value:y,write:b,final:B,destroy:W}=j(C);if(i(y))return D(x,y,{objectMode:!0,write:b,final:B,destroy:W});const N=y==null?void 0:y.then;if(typeof N=="function"){let k;const P=V(N,y,O=>{if(O!=null)throw new m("nully","body",O)},O=>{p(k,O)});return k=new x({objectMode:!0,readable:!1,write:b,final(O){B(async()=>{try{await P,e.nextTick(O,null)}catch(J){e.nextTick(O,J)}})},destroy:W})}throw new m("Iterable, AsyncIterable or AsyncFunction",G,y)}if(H(C))return z(C.arrayBuffer());if(i(C))return D(x,C,{objectMode:!0,writable:!1});if(typeof(C==null?void 0:C.writable)=="object"||typeof(C==null?void 0:C.readable)=="object"){const y=C!=null&&C.readable?s(C==null?void 0:C.readable)?C==null?void 0:C.readable:z(C.readable):void 0,b=C!=null&&C.writable?u(C==null?void 0:C.writable)?C==null?void 0:C.writable:z(C.writable):void 0;return ee({readable:y,writable:b})}const _=C==null?void 0:C.then;if(typeof _=="function"){let y;return V(_,C,b=>{b!=null&&y.push(b),y.push(null)},b=>{p(y,b)}),y=new x({objectMode:!0,writable:!1,read(){}})}throw new h(G,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],C)};function j(z){let{promise:C,resolve:G}=M();const _=new R,y=_.signal;return{value:z(async function*(){for(;;){const B=C;C=null;const{chunk:W,done:N,cb:k}=await B;if(e.nextTick(k),N)return;if(y.aborted)throw new c(void 0,{cause:y.reason});({promise:C,resolve:G}=M()),yield W}}(),{signal:y}),write(B,W,N){const k=G;G=null,k({chunk:B,done:!1,cb:N})},final(B){const W=G;G=null,W({done:!0,cb:B})},destroy(B,W){_.abort(),W(B)}}}function ee(z){const C=z.readable&&typeof z.readable.read!="function"?q.wrap(z.readable):z.readable,G=z.writable;let _=!!r(C),y=!!n(G),b,B,W,N,k;function P(O){const J=N;N=null,J?J(O):O&&k.destroy(O)}return k=new x({readableObjectMode:!!(C!=null&&C.readableObjectMode),writableObjectMode:!!(G!=null&&G.writableObjectMode),readable:_,writable:y}),y&&(f(G,O=>{y=!1,O&&p(C,O),P(O)}),k._write=function(O,J,ne){G.write(O,J)?ne():b=ne},k._final=function(O){G.end(),B=O},G.on("drain",function(){if(b){const O=b;b=null,O()}}),G.on("finish",function(){if(B){const O=B;B=null,O()}})),_&&(f(C,O=>{_=!1,O&&p(C,O),P(O)}),C.on("readable",function(){if(W){const O=W;W=null,O()}}),C.on("end",function(){k.push(null)}),k._read=function(){for(;;){const O=C.read();if(O===null){W=k._read;return}if(!k.push(O))return}}),k._destroy=function(O,J){!O&&N!==null&&(O=new c),W=null,b=null,B=null,N===null?J(O):(N=J,p(G,O),p(C,O))},k}return Ao}var Io,cl;function lr(){if(cl)return Io;cl=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:n}=st;Io=s;const i=Li(),o=Au();n(s.prototype,i.prototype),n(s,i);{const c=r(o.prototype);for(let h=0;h<c.length;h++){const m=c[h];s.prototype[m]||(s.prototype[m]=o.prototype[m])}}function s(c){if(!(this instanceof s))return new s(c);i.call(this,c),o.call(this,c),c?(this.allowHalfOpen=c.allowHalfOpen!==!1,c.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),c.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(s.prototype,{writable:{__proto__:null,...t(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(o.prototype,"writableLength")},writableFinished:{__proto__:null,...t(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(c){this._readableState&&this._writableState&&(this._readableState.destroyed=c,this._writableState.destroyed=c)}}});let u;function l(){return u===void 0&&(u={}),u}s.fromWeb=function(c,h){return l().newStreamDuplexFromReadableWritablePair(c,h)},s.toWeb=function(c){return l().newReadableWritablePairFromDuplex(c)};let f;return s.from=function(c){return f||(f=m0()),f(c,"body")},Io}const{ObjectSetPrototypeOf:Iu,Symbol:E0}=st;var Tu=fr;const{ERR_METHOD_NOT_IMPLEMENTED:v0}=St.codes,Gs=lr(),{getHighWaterMark:S0}=qs;Iu(fr.prototype,Gs.prototype);Iu(fr,Gs);const In=E0("kCallback");function fr(e){if(!(this instanceof fr))return new fr(e);const t=e?S0(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),Gs.call(this,e),this._readableState.sync=!1,this[In]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",R0)}function vs(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,r)=>{if(t){e?e(t):this.destroy(t);return}r!=null&&this.push(r),this.push(null),e&&e()}):(this.push(null),e&&e())}function R0(){this._final!==vs&&vs.call(this)}fr.prototype._final=vs;fr.prototype._transform=function(e,t,r){throw new v0("_transform()")};fr.prototype._write=function(e,t,r){const n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(s,u)=>{if(s){r(s);return}u!=null&&this.push(u),i.ended||o===n.length||n.length<n.highWaterMark?r():this[In]=r})};fr.prototype._read=function(){if(this[In]){const e=this[In];this[In]=null,e()}};const{ObjectSetPrototypeOf:Ou}=st;var Cu=Yr;const Zs=Tu;Ou(Yr.prototype,Zs.prototype);Ou(Yr,Zs);function Yr(e){if(!(this instanceof Yr))return new Yr(e);Zs.call(this,e)}Yr.prototype._transform=function(e,t,r){r(null,e)};const Rn=Dr,{ArrayIsArray:A0,Promise:I0,SymbolAsyncIterator:T0}=st,ci=vr,{once:O0}=cr,C0=ln,dl=lr(),{aggregateTwoErrors:L0,codes:{ERR_INVALID_ARG_TYPE:Ss,ERR_INVALID_RETURN_VALUE:To,ERR_MISSING_ARGS:N0,ERR_STREAM_DESTROYED:P0,ERR_STREAM_PREMATURE_CLOSE:B0},AbortError:$0}=St,{validateFunction:x0,validateAbortSignal:k0}=vi,{isIterable:Tr,isReadable:Oo,isReadableNodeStream:ai,isNodeStream:hl,isTransformStream:Gr,isWebStream:D0,isReadableStream:Co,isReadableEnded:M0}=dr,j0=globalThis.AbortController||js().AbortController;let Lo,No;function gl(e,t,r){let n=!1;e.on("close",()=>{n=!0});const i=ci(e,{readable:t,writable:r},o=>{n=!o});return{destroy:o=>{n||(n=!0,C0.destroyer(e,o||new P0("pipe")))},cleanup:i}}function U0(e){return x0(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function Po(e){if(Tr(e))return e;if(ai(e))return F0(e);throw new Ss("val",["Readable","Iterable","AsyncIterable"],e)}async function*F0(e){No||(No=Li()),yield*No.prototype[T0].call(e)}async function Jn(e,t,r,{end:n}){let i,o=null;const s=f=>{if(f&&(i=f),o){const c=o;o=null,c()}},u=()=>new I0((f,c)=>{i?c(i):o=()=>{i?c(i):f()}});t.on("drain",s);const l=ci(t,{readable:!1},s);try{t.writableNeedDrain&&await u();for await(const f of e)t.write(f)||await u();n&&t.end(),await u(),r()}catch(f){r(i!==f?L0(i,f):f)}finally{l(),t.off("drain",s)}}async function Bo(e,t,r,{end:n}){Gr(t)&&(t=t.writable);const i=t.getWriter();try{for await(const o of e)await i.ready,i.write(o).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(o){try{await i.abort(o),r(o)}catch(s){r(s)}}}function H0(...e){return Lu(e,O0(U0(e)))}function Lu(e,t,r){if(e.length===1&&A0(e[0])&&(e=e[0]),e.length<2)throw new N0("streams");const n=new j0,i=n.signal,o=r==null?void 0:r.signal,s=[];k0(o,"options.signal");function u(){p(new $0)}o==null||o.addEventListener("abort",u);let l,f;const c=[];let h=0;function m(D){p(D,--h===0)}function p(D,E){if(D&&(!l||l.code==="ERR_STREAM_PREMATURE_CLOSE")&&(l=D),!(!l&&!E)){for(;c.length;)c.shift()(l);o==null||o.removeEventListener("abort",u),n.abort(),E&&(l||s.forEach(H=>H()),Rn.nextTick(t,l,f))}}let v;for(let D=0;D<e.length;D++){const E=e[D],H=D<e.length-1,R=D>0,V=H||(r==null?void 0:r.end)!==!1,x=D===e.length-1;if(hl(E)){let j=function(ee){ee&&ee.name!=="AbortError"&&ee.code!=="ERR_STREAM_PREMATURE_CLOSE"&&m(ee)};if(V){const{destroy:ee,cleanup:z}=gl(E,H,R);c.push(ee),Oo(E)&&x&&s.push(z)}E.on("error",j),Oo(E)&&x&&s.push(()=>{E.removeListener("error",j)})}if(D===0)if(typeof E=="function"){if(v=E({signal:i}),!Tr(v))throw new To("Iterable, AsyncIterable or Stream","source",v)}else Tr(E)||ai(E)||Gr(E)?v=E:v=dl.from(E);else if(typeof E=="function"){if(Gr(v)){var q;v=Po((q=v)===null||q===void 0?void 0:q.readable)}else v=Po(v);if(v=E(v,{signal:i}),H){if(!Tr(v,!0))throw new To("AsyncIterable",`transform[${D-1}]`,v)}else{var M;Lo||(Lo=Cu);const j=new Lo({objectMode:!0}),ee=(M=v)===null||M===void 0?void 0:M.then;if(typeof ee=="function")h++,ee.call(v,G=>{f=G,G!=null&&j.write(G),V&&j.end(),Rn.nextTick(m)},G=>{j.destroy(G),Rn.nextTick(m,G)});else if(Tr(v,!0))h++,Jn(v,j,m,{end:V});else if(Co(v)||Gr(v)){const G=v.readable||v;h++,Jn(G,j,m,{end:V})}else throw new To("AsyncIterable or Promise","destination",v);v=j;const{destroy:z,cleanup:C}=gl(v,!1,!0);c.push(z),x&&s.push(C)}}else if(hl(E)){if(ai(v)){h+=2;const j=z0(v,E,m,{end:V});Oo(E)&&x&&s.push(j)}else if(Gr(v)||Co(v)){const j=v.readable||v;h++,Jn(j,E,m,{end:V})}else if(Tr(v))h++,Jn(v,E,m,{end:V});else throw new Ss("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=E}else if(D0(E)){if(ai(v))h++,Bo(Po(v),E,m,{end:V});else if(Co(v)||Tr(v))h++,Bo(v,E,m,{end:V});else if(Gr(v))h++,Bo(v.readable,E,m,{end:V});else throw new Ss("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);v=E}else v=dl.from(E)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&Rn.nextTick(u),v}function z0(e,t,r,{end:n}){let i=!1;if(t.on("close",()=>{i||r(new B0)}),e.pipe(t,{end:!1}),n){let o=function(){i=!0,t.end()};M0(e)?Rn.nextTick(o):e.once("end",o)}else r();return ci(e,{readable:!0,writable:!1},o=>{const s=e._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&s&&s.ended&&!s.errored&&!s.errorEmitted?e.once("end",r).once("error",r):r(o)}),ci(t,{readable:!1,writable:!0},r)}var Ks={pipelineImpl:Lu,pipeline:H0};const{pipeline:W0}=Ks,Xn=lr(),{destroyer:V0}=ln,{isNodeStream:Yn,isReadable:_l,isWritable:bl,isWebStream:$o,isTransformStream:Ar,isWritableStream:pl,isReadableStream:yl}=dr,{AbortError:q0,codes:{ERR_INVALID_ARG_VALUE:wl,ERR_MISSING_ARGS:G0}}=St,Z0=vr;var Nu=function(...t){if(t.length===0)throw new G0("streams");if(t.length===1)return Xn.from(t[0]);const r=[...t];if(typeof t[0]=="function"&&(t[0]=Xn.from(t[0])),typeof t[t.length-1]=="function"){const p=t.length-1;t[p]=Xn.from(t[p])}for(let p=0;p<t.length;++p)if(!(!Yn(t[p])&&!$o(t[p]))){if(p<t.length-1&&!(_l(t[p])||yl(t[p])||Ar(t[p])))throw new wl(`streams[${p}]`,r[p],"must be readable");if(p>0&&!(bl(t[p])||pl(t[p])||Ar(t[p])))throw new wl(`streams[${p}]`,r[p],"must be writable")}let n,i,o,s,u;function l(p){const v=s;s=null,v?v(p):p?u.destroy(p):!m&&!h&&u.destroy()}const f=t[0],c=W0(t,l),h=!!(bl(f)||pl(f)||Ar(f)),m=!!(_l(c)||yl(c)||Ar(c));if(u=new Xn({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(c!=null&&c.writableObjectMode),writable:h,readable:m}),h){if(Yn(f))u._write=function(v,q,M){f.write(v,q)?M():n=M},u._final=function(v){f.end(),i=v},f.on("drain",function(){if(n){const v=n;n=null,v()}});else if($o(f)){const q=(Ar(f)?f.writable:f).getWriter();u._write=async function(M,D,E){try{await q.ready,q.write(M).catch(()=>{}),E()}catch(H){E(H)}},u._final=async function(M){try{await q.ready,q.close().catch(()=>{}),i=M}catch(D){M(D)}}}const p=Ar(c)?c.readable:c;Z0(p,()=>{if(i){const v=i;i=null,v()}})}if(m){if(Yn(c))c.on("readable",function(){if(o){const p=o;o=null,p()}}),c.on("end",function(){u.push(null)}),u._read=function(){for(;;){const p=c.read();if(p===null){o=u._read;return}if(!u.push(p))return}};else if($o(c)){const v=(Ar(c)?c.readable:c).getReader();u._read=async function(){for(;;)try{const{value:q,done:M}=await v.read();if(!u.push(q))return;if(M){u.push(null);return}}catch{return}}}}return u._destroy=function(p,v){!p&&s!==null&&(p=new q0),o=null,n=null,i=null,s===null?v(p):(s=v,Yn(c)&&V0(c,p))},u};const Pu=globalThis.AbortController||js().AbortController,{codes:{ERR_INVALID_ARG_VALUE:K0,ERR_INVALID_ARG_TYPE:Mn,ERR_MISSING_ARGS:J0,ERR_OUT_OF_RANGE:X0},AbortError:tr}=St,{validateAbortSignal:jr,validateInteger:Y0,validateObject:Ur}=vi,Q0=st.Symbol("kWeak"),{finished:e_}=vr,t_=Nu,{addAbortSignalNoValidate:r_}=Ci,{isWritable:n_,isNodeStream:i_}=dr,{ArrayPrototypePush:o_,MathFloor:s_,Number:a_,NumberIsNaN:l_,Promise:ml,PromiseReject:El,PromisePrototypeThen:f_,Symbol:Bu}=st,di=Bu("kEmpty"),vl=Bu("kEof");function u_(e,t){if(t!=null&&Ur(t,"options"),(t==null?void 0:t.signal)!=null&&jr(t.signal,"options.signal"),i_(e)&&!n_(e))throw new K0("stream",e,"must be writable");const r=t_(this,e);return t!=null&&t.signal&&r_(t.signal,r),r}function Ni(e,t){if(typeof e!="function")throw new Mn("fn",["Function","AsyncFunction"],e);t!=null&&Ur(t,"options"),(t==null?void 0:t.signal)!=null&&jr(t.signal,"options.signal");let r=1;return(t==null?void 0:t.concurrency)!=null&&(r=s_(t.concurrency)),Y0(r,"concurrency",1),(async function*(){var i,o;const s=new Pu,u=this,l=[],f=s.signal,c={signal:f},h=()=>s.abort();t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted&&h(),t==null||(o=t.signal)===null||o===void 0||o.addEventListener("abort",h);let m,p,v=!1;function q(){v=!0}async function M(){try{for await(let H of u){var D;if(v)return;if(f.aborted)throw new tr;try{H=e(H,c)}catch(R){H=El(R)}H!==di&&(typeof((D=H)===null||D===void 0?void 0:D.catch)=="function"&&H.catch(q),l.push(H),m&&(m(),m=null),!v&&l.length&&l.length>=r&&await new ml(R=>{p=R}))}l.push(vl)}catch(H){const R=El(H);f_(R,void 0,q),l.push(R)}finally{var E;v=!0,m&&(m(),m=null),t==null||(E=t.signal)===null||E===void 0||E.removeEventListener("abort",h)}}M();try{for(;;){for(;l.length>0;){const D=await l[0];if(D===vl)return;if(f.aborted)throw new tr;D!==di&&(yield D),l.shift(),p&&(p(),p=null)}await new ml(D=>{m=D})}}finally{s.abort(),v=!0,p&&(p(),p=null)}}).call(this)}function c_(e=void 0){return e!=null&&Ur(e,"options"),(e==null?void 0:e.signal)!=null&&jr(e.signal,"options.signal"),(async function*(){let r=0;for await(const i of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new tr({cause:e.signal.reason});yield[r++,i]}}).call(this)}async function $u(e,t=void 0){for await(const r of Js.call(this,e,t))return!0;return!1}async function d_(e,t=void 0){if(typeof e!="function")throw new Mn("fn",["Function","AsyncFunction"],e);return!await $u.call(this,async(...r)=>!await e(...r),t)}async function h_(e,t){for await(const r of Js.call(this,e,t))return r}async function g_(e,t){if(typeof e!="function")throw new Mn("fn",["Function","AsyncFunction"],e);async function r(n,i){return await e(n,i),di}for await(const n of Ni.call(this,r,t));}function Js(e,t){if(typeof e!="function")throw new Mn("fn",["Function","AsyncFunction"],e);async function r(n,i){return await e(n,i)?n:di}return Ni.call(this,r,t)}class __ extends J0{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function b_(e,t,r){var n;if(typeof e!="function")throw new Mn("reducer",["Function","AsyncFunction"],e);r!=null&&Ur(r,"options"),(r==null?void 0:r.signal)!=null&&jr(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){const f=new tr(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await e_(this.destroy(f)),f}const o=new Pu,s=o.signal;if(r!=null&&r.signal){const f={once:!0,[Q0]:this};r.signal.addEventListener("abort",()=>o.abort(),f)}let u=!1;try{for await(const f of this){var l;if(u=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new tr;i?t=await e(t,f,{signal:s}):(t=f,i=!0)}if(!u&&!i)throw new __}finally{o.abort()}return t}async function p_(e){e!=null&&Ur(e,"options"),(e==null?void 0:e.signal)!=null&&jr(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new tr(void 0,{cause:e.signal.reason});o_(t,n)}return t}function y_(e,t){const r=Ni.call(this,e,t);return(async function*(){for await(const i of r)yield*i}).call(this)}function xu(e){if(e=a_(e),l_(e))return 0;if(e<0)throw new X0("number",">= 0",e);return e}function w_(e,t=void 0){return t!=null&&Ur(t,"options"),(t==null?void 0:t.signal)!=null&&jr(t.signal,"options.signal"),e=xu(e),(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new tr;for await(const o of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new tr;e--<=0&&(yield o)}}).call(this)}function m_(e,t=void 0){return t!=null&&Ur(t,"options"),(t==null?void 0:t.signal)!=null&&jr(t.signal,"options.signal"),e=xu(e),(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new tr;for await(const o of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new tr;if(e-- >0)yield o;else return}}).call(this)}Ms.streamReturningOperators={asIndexedPairs:c_,drop:w_,filter:Js,flatMap:y_,map:Ni,take:m_,compose:u_};Ms.promiseReturningOperators={every:d_,forEach:g_,reduce:b_,toArray:p_,some:$u,find:h_};var xo,Sl;function ku(){if(Sl)return xo;Sl=1;const{ArrayPrototypePop:e,Promise:t}=st,{isIterable:r,isNodeStream:n,isWebStream:i}=dr,{pipelineImpl:o}=Ks,{finished:s}=vr;Du();function u(...l){return new t((f,c)=>{let h,m;const p=l[l.length-1];if(p&&typeof p=="object"&&!n(p)&&!r(p)&&!i(p)){const v=e(l);h=v.signal,m=v.end}o(l,(v,q)=>{v?c(v):f(q)},{signal:h,end:m})})}return xo={finished:s,pipeline:u},xo}var Rl;function Du(){if(Rl)return wo.exports;Rl=1;const{Buffer:e}=er,{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:n}=st,{promisify:{custom:i}}=cr,{streamReturningOperators:o,promiseReturningOperators:s}=Ms,{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=St,l=Nu,{pipeline:f}=Ks,{destroyer:c}=ln,h=vr,m=ku(),p=dr,v=wo.exports=Vs.Stream;v.isDisturbed=p.isDisturbed,v.isErrored=p.isErrored,v.isReadable=p.isReadable,v.Readable=Li();for(const M of r(o)){let E=function(...H){if(new.target)throw u();return v.Readable.from(n(D,this,H))};const D=o[M];t(E,"name",{__proto__:null,value:D.name}),t(E,"length",{__proto__:null,value:D.length}),t(v.Readable.prototype,M,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const M of r(s)){let E=function(...H){if(new.target)throw u();return n(D,this,H)};const D=s[M];t(E,"name",{__proto__:null,value:D.name}),t(E,"length",{__proto__:null,value:D.length}),t(v.Readable.prototype,M,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}v.Writable=Au(),v.Duplex=lr(),v.Transform=Tu,v.PassThrough=Cu,v.pipeline=f;const{addAbortSignal:q}=Ci;return v.addAbortSignal=q,v.finished=h,v.destroy=c,v.compose=l,t(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return m}}),t(f,i,{__proto__:null,enumerable:!0,get(){return m.pipeline}}),t(h,i,{__proto__:null,enumerable:!0,get(){return m.finished}}),v.Stream=v,v._isUint8Array=function(D){return D instanceof Uint8Array},v._uint8ArrayToBuffer=function(D){return e.from(D.buffer,D.byteOffset,D.byteLength)},wo.exports}(function(e){const t=Du(),r=ku(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(yh);var E_={},$r={},Xs={},dt={};Object.defineProperty(dt,"__esModule",{value:!0});dt.assertExhaustive=dt.assertStruct=dt.assert=dt.AssertionError=void 0;const v_=Mr;function S_(e){return typeof e=="object"&&e!==null&&"message"in e}function R_(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function A_(e){const t=S_(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Mu(e,t){return R_(e)?new e({message:t}):e({message:t})}class Ys extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}dt.AssertionError=Ys;function I_(e,t="Assertion failed.",r=Ys){if(!e)throw t instanceof Error?t:Mu(r,t)}dt.assert=I_;function T_(e,t,r="Assertion failed",n=Ys){try{(0,v_.assert)(e,t)}catch(i){throw Mu(n,`${r}: ${A_(i)}.`)}}dt.assertStruct=T_;function O_(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}dt.assertExhaustive=O_;var jn={};Object.defineProperty(jn,"__esModule",{value:!0});jn.base64=void 0;const C_=Mr,L_=dt,N_=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,o=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let s;o==="base64"?s=String.raw`[A-Za-z0-9+\/]`:((0,L_.assert)(o==="base64url"),s=String.raw`[-_A-Za-z0-9]`);let u;return i?u=new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):u=new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,C_.pattern)(e,u)};jn.base64=N_;var Ue={},Un={};(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=Mr,r=dt;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);function n(f){return(0,t.is)(f,e.HexStruct)}e.isHexString=n;function i(f){return(0,t.is)(f,e.StrictHexStruct)}e.isStrictHexString=i;function o(f){(0,r.assert)(n(f),"Value must be a hexadecimal string.")}e.assertIsHexString=o;function s(f){(0,r.assert)(i(f),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=s;function u(f){return f.startsWith("0x")?f:f.startsWith("0X")?`0x${f.substring(2)}`:`0x${f}`}e.add0x=u;function l(f){return f.startsWith("0x")||f.startsWith("0X")?f.substring(2):f}e.remove0x=l})(Un);Object.defineProperty(Ue,"__esModule",{value:!0});Ue.createDataView=Ue.concatBytes=Ue.valueToBytes=Ue.stringToBytes=Ue.numberToBytes=Ue.signedBigIntToBytes=Ue.bigIntToBytes=Ue.hexToBytes=Ue.bytesToString=Ue.bytesToNumber=Ue.bytesToSignedBigInt=Ue.bytesToBigInt=Ue.bytesToHex=Ue.assertIsBytes=Ue.isBytes=void 0;const At=dt,Rs=Un,Al=48,Il=58,Tl=87;function P_(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const B_=P_();function Qs(e){return e instanceof Uint8Array}Ue.isBytes=Qs;function fn(e){(0,At.assert)(Qs(e),"Value must be a Uint8Array.")}Ue.assertIsBytes=fn;function ju(e){if(fn(e),e.length===0)return"0x";const t=B_(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Rs.add0x)(r.join(""))}Ue.bytesToHex=ju;function Uu(e){fn(e);const t=ju(e);return BigInt(t)}Ue.bytesToBigInt=Uu;function $_(e){fn(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}Ue.bytesToSignedBigInt=$_;function x_(e){fn(e);const t=Uu(e);return(0,At.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}Ue.bytesToNumber=x_;function k_(e){return fn(e),new TextDecoder().decode(e)}Ue.bytesToString=k_;function Pi(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Rs.assertIsHexString)(e);const r=(0,Rs.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let o=0;o<i.length;o++){const s=n.charCodeAt(o*2),u=n.charCodeAt(o*2+1),l=s-(s<Il?Al:Tl),f=u-(u<Il?Al:Tl);i[o]=l*16+f}return i}Ue.hexToBytes=Pi;function Fu(e){(0,At.assert)(typeof e=="bigint","Value must be a bigint."),(0,At.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Pi(t)}Ue.bigIntToBytes=Fu;function D_(e,t){(0,At.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function M_(e,t){(0,At.assert)(typeof e=="bigint","Value must be a bigint."),(0,At.assert)(typeof t=="number","Byte length must be a number."),(0,At.assert)(t>0,"Byte length must be greater than 0."),(0,At.assert)(D_(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}Ue.signedBigIntToBytes=M_;function Hu(e){(0,At.assert)(typeof e=="number","Value must be a number."),(0,At.assert)(e>=0,"Value must be a non-negative number."),(0,At.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Pi(t)}Ue.numberToBytes=Hu;function zu(e){return(0,At.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}Ue.stringToBytes=zu;function Wu(e){if(typeof e=="bigint")return Fu(e);if(typeof e=="number")return Hu(e);if(typeof e=="string")return e.startsWith("0x")?Pi(e):zu(e);if(Qs(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}Ue.valueToBytes=Wu;function j_(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const o=Wu(e[i]);t[i]=o,r+=o.length}const n=new Uint8Array(r);for(let i=0,o=0;i<t.length;i++)n.set(t[i],o),o+=t[i].length;return n}Ue.concatBytes=j_;function U_(e){if(typeof ye.Buffer<"u"&&e instanceof ye.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)}Ue.createDataView=U_;var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ChecksumStruct=void 0;const Ol=Mr,F_=jn;Bi.ChecksumStruct=(0,Ol.size)((0,F_.base64)((0,Ol.string)(),{paddingRequired:!0}),44,44);var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.createHex=Zt.createBytes=Zt.createBigInt=Zt.createNumber=void 0;const Qe=Mr,H_=dt,Vu=Ue,$i=Un,qu=(0,Qe.union)([(0,Qe.number)(),(0,Qe.bigint)(),(0,Qe.string)(),$i.StrictHexStruct]),z_=(0,Qe.coerce)((0,Qe.number)(),qu,Number),W_=(0,Qe.coerce)((0,Qe.bigint)(),qu,BigInt);(0,Qe.union)([$i.StrictHexStruct,(0,Qe.instance)(Uint8Array)]);const V_=(0,Qe.coerce)((0,Qe.instance)(Uint8Array),(0,Qe.union)([$i.StrictHexStruct]),Vu.hexToBytes),q_=(0,Qe.coerce)($i.StrictHexStruct,(0,Qe.instance)(Uint8Array),Vu.bytesToHex);function G_(e){try{const t=(0,Qe.create)(e,z_);return(0,H_.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Qe.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Zt.createNumber=G_;function Z_(e){try{return(0,Qe.create)(e,W_)}catch(t){throw t instanceof Qe.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Zt.createBigInt=Z_;function K_(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Qe.create)(e,V_)}catch(t){throw t instanceof Qe.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Zt.createBytes=K_;function J_(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Qe.create)(e,q_)}catch(t){throw t instanceof Qe.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Zt.createHex=J_;var Qr={},Gu=Ye&&Ye.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},yt=Ye&&Ye.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Dt,Vt;Object.defineProperty(Qr,"__esModule",{value:!0});Qr.FrozenSet=Qr.FrozenMap=void 0;class ea{constructor(t){Dt.set(this,void 0),Gu(this,Dt,new Map(t),"f"),Object.freeze(this)}get size(){return yt(this,Dt,"f").size}[(Dt=new WeakMap,Symbol.iterator)](){return yt(this,Dt,"f")[Symbol.iterator]()}entries(){return yt(this,Dt,"f").entries()}forEach(t,r){return yt(this,Dt,"f").forEach((n,i,o)=>t.call(r,n,i,this))}get(t){return yt(this,Dt,"f").get(t)}has(t){return yt(this,Dt,"f").has(t)}keys(){return yt(this,Dt,"f").keys()}values(){return yt(this,Dt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Qr.FrozenMap=ea;class ta{constructor(t){Vt.set(this,void 0),Gu(this,Vt,new Set(t),"f"),Object.freeze(this)}get size(){return yt(this,Vt,"f").size}[(Vt=new WeakMap,Symbol.iterator)](){return yt(this,Vt,"f")[Symbol.iterator]()}entries(){return yt(this,Vt,"f").entries()}forEach(t,r){return yt(this,Vt,"f").forEach((n,i,o)=>t.call(r,n,i,this))}has(t){return yt(this,Vt,"f").has(t)}keys(){return yt(this,Vt,"f").keys()}values(){return yt(this,Vt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Qr.FrozenSet=ta;Object.freeze(ea);Object.freeze(ea.prototype);Object.freeze(ta);Object.freeze(ta.prototype);var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});var Ku={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),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.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Mr,r=dt,n=()=>(0,t.define)("finite number",V=>(0,t.is)(V,(0,t.number)())&&Number.isFinite(V));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(V,x)=>{function j(ee,z){const G=[...z.validator(ee,x)];return G.length>0?G:!0}try{const ee=j(V,e.UnsafeJsonStruct);return ee!==!0?ee:j(JSON.parse(JSON.stringify(V)),e.UnsafeJsonStruct)}catch(ee){return ee instanceof RangeError?"Circular reference detected":!1}});function i(V){return(0,t.is)(V,e.JsonStruct)}e.isValidJson=i;function o(V){(0,r.assertStruct)(V,e.JsonStruct,"Invalid JSON value");const x=JSON.stringify(V);return new TextEncoder().encode(x).byteLength}e.getJsonSize=o,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"]);function s(V){return(0,t.is)(V,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=s;function u(V,x){(0,r.assertStruct)(V,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",x)}e.assertIsJsonRpcNotification=u;function l(V){return(0,t.is)(V,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=l;function f(V,x){(0,r.assertStruct)(V,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",x)}e.assertIsJsonRpcRequest=f,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]);function c(V){return(0,t.is)(V,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=c;function h(V,x){(0,r.assertStruct)(V,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",x)}e.assertIsPendingJsonRpcResponse=h;function m(V){return(0,t.is)(V,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=m;function p(V,x){(0,r.assertStruct)(V,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",x)}e.assertIsJsonRpcResponse=p;function v(V){return(0,t.is)(V,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=v;function q(V,x){(0,r.assertStruct)(V,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",x)}e.assertIsJsonRpcSuccess=q;function M(V){return(0,t.is)(V,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=M;function D(V,x){(0,r.assertStruct)(V,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",x)}e.assertIsJsonRpcFailure=D;function E(V){return(0,t.is)(V,e.JsonRpcErrorStruct)}e.isJsonRpcError=E;function H(V,x){(0,r.assertStruct)(V,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",x)}e.assertIsJsonRpcError=H;function R(V){const{permitEmptyString:x,permitFractions:j,permitNull:ee}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},V);return C=>!!(typeof C=="number"&&(j||Number.isInteger(C))||typeof C=="string"&&(x||C.length>0)||ee&&C===null)}e.getJsonRpcIdValidator=R})(Ku);var Ju={};Object.defineProperty(Ju,"__esModule",{value:!0});var en={},X_=Ye&&Ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(en,"__esModule",{value:!0});en.createModuleLogger=en.createProjectLogger=void 0;const Y_=X_(hh),Q_=(0,Y_.default)("metamask");function eb(e){return Q_.extend(e)}en.createProjectLogger=eb;function tb(e,t){return e.extend(t)}en.createModuleLogger=tb;var Xu={};(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;function t(f){return Array.isArray(f)&&f.length>0}e.isNonEmptyArray=t;function r(f){return f==null}e.isNullOrUndefined=r;function n(f){return!!f&&typeof f=="object"&&!Array.isArray(f)}e.isObject=n;const i=(f,c)=>Object.hasOwnProperty.call(f,c);e.hasProperty=i,function(f){f[f.Null=4]="Null",f[f.Comma=1]="Comma",f[f.Wrapper=1]="Wrapper",f[f.True=4]="True",f[f.False=5]="False",f[f.Quote=1]="Quote",f[f.Colon=1]="Colon",f[f.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function o(f){if(typeof f!="object"||f===null)return!1;try{let c=f;for(;Object.getPrototypeOf(c)!==null;)c=Object.getPrototypeOf(c);return Object.getPrototypeOf(f)===c}catch{return!1}}e.isPlainObject=o;function s(f){return f.charCodeAt(0)<=127}e.isASCII=s;function u(f){var c;return f.split("").reduce((m,p)=>s(p)?m+1:m+2,0)+((c=f.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&c!==void 0?c:[]).length}e.calculateStringSize=u;function l(f){return f.toString().length}e.calculateNumberSize=l})(Xu);var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.hexToBigInt=Kt.hexToNumber=Kt.bigIntToHex=Kt.numberToHex=void 0;const Kr=dt,Pn=Un,rb=e=>((0,Kr.assert)(typeof e=="number","Value must be a number."),(0,Kr.assert)(e>=0,"Value must be a non-negative number."),(0,Kr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Pn.add0x)(e.toString(16)));Kt.numberToHex=rb;const nb=e=>((0,Kr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Kr.assert)(e>=0,"Value must be a non-negative bigint."),(0,Pn.add0x)(e.toString(16)));Kt.bigIntToHex=nb;const ib=e=>{(0,Pn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Kr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Kt.hexToNumber=ib;const ob=e=>((0,Pn.assertIsHexString)(e),BigInt((0,Pn.add0x)(e)));Kt.hexToBigInt=ob;var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0});var Qu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(o){o[o.Millisecond=1]="Millisecond",o[o.Second=1e3]="Second",o[o.Minute=6e4]="Minute",o[o.Hour=36e5]="Hour",o[o.Day=864e5]="Day",o[o.Week=6048e5]="Week",o[o.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=o=>Number.isInteger(o)&&o>=0,r=(o,s)=>{if(!t(o))throw new Error(`"${s}" must be a non-negative integer. Received: "${o}".`)};function n(o,s){return r(o,"count"),o*s}e.inMilliseconds=n;function i(o){return r(o,"timestamp"),Date.now()-o}e.timeSince=i})(Qu);var ec={};Object.defineProperty(ec,"__esModule",{value:!0});var tc={},As={exports:{}};const sb="2.0.0",rc=256,ab=Number.MAX_SAFE_INTEGER||9007199254740991,lb=16,fb=rc-6,ub=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var xi={MAX_LENGTH:rc,MAX_SAFE_COMPONENT_LENGTH:lb,MAX_SAFE_BUILD_LENGTH:fb,MAX_SAFE_INTEGER:ab,RELEASE_TYPES:ub,SEMVER_SPEC_VERSION:sb,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ko={};const cb=typeof ye.process=="object"&&ko&&ko.NODE_DEBUG&&/\bsemver\b/i.test(ko.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var ki=cb;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=xi,o=ki;t=e.exports={};const s=t.re=[],u=t.safeRe=[],l=t.src=[],f=t.t={};let c=0;const h="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",i],[h,n]],p=q=>{for(const[M,D]of m)q=q.split(`${M}*`).join(`${M}{0,${D}}`).split(`${M}+`).join(`${M}{1,${D}}`);return q},v=(q,M,D)=>{const E=p(M),H=c++;o(q,H,M),f[q]=H,l[H]=M,s[H]=new RegExp(M,D?"g":void 0),u[H]=new RegExp(E,D?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),v("MAINVERSION",`(${l[f.NUMERICIDENTIFIER]})\\.(${l[f.NUMERICIDENTIFIER]})\\.(${l[f.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${l[f.NUMERICIDENTIFIERLOOSE]})\\.(${l[f.NUMERICIDENTIFIERLOOSE]})\\.(${l[f.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${l[f.NUMERICIDENTIFIER]}|${l[f.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${l[f.NUMERICIDENTIFIERLOOSE]}|${l[f.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${l[f.PRERELEASEIDENTIFIER]}(?:\\.${l[f.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${l[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[f.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${h}+`),v("BUILD",`(?:\\+(${l[f.BUILDIDENTIFIER]}(?:\\.${l[f.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${l[f.MAINVERSION]}${l[f.PRERELEASE]}?${l[f.BUILD]}?`),v("FULL",`^${l[f.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${l[f.MAINVERSIONLOOSE]}${l[f.PRERELEASELOOSE]}?${l[f.BUILD]}?`),v("LOOSE",`^${l[f.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${l[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${l[f.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${l[f.XRANGEIDENTIFIER]})(?:\\.(${l[f.XRANGEIDENTIFIER]})(?:\\.(${l[f.XRANGEIDENTIFIER]})(?:${l[f.PRERELEASE]})?${l[f.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${l[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[f.XRANGEIDENTIFIERLOOSE]})(?:${l[f.PRERELEASELOOSE]})?${l[f.BUILD]}?)?)?`),v("XRANGE",`^${l[f.GTLT]}\\s*${l[f.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${l[f.GTLT]}\\s*${l[f.XRANGEPLAINLOOSE]}$`),v("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),v("COERCERTL",l[f.COERCE],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${l[f.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",v("TILDE",`^${l[f.LONETILDE]}${l[f.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${l[f.LONETILDE]}${l[f.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${l[f.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",v("CARET",`^${l[f.LONECARET]}${l[f.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${l[f.LONECARET]}${l[f.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${l[f.GTLT]}\\s*(${l[f.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${l[f.GTLT]}\\s*(${l[f.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${l[f.GTLT]}\\s*(${l[f.LOOSEPLAIN]}|${l[f.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${l[f.XRANGEPLAIN]})\\s+-\\s+(${l[f.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${l[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[f.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(As,As.exports);var Fn=As.exports;const db=Object.freeze({loose:!0}),hb=Object.freeze({}),gb=e=>e?typeof e!="object"?db:e:hb;var ra=gb;const Cl=/^[0-9]+$/,nc=(e,t)=>{const r=Cl.test(e),n=Cl.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},_b=(e,t)=>nc(t,e);var ic={compareIdentifiers:nc,rcompareIdentifiers:_b};const Qn=ki,{MAX_LENGTH:Ll,MAX_SAFE_INTEGER:ei}=xi,{safeRe:Nl,t:Pl}=Fn,bb=ra,{compareIdentifiers:zr}=ic;let pb=class qt{constructor(t,r){if(r=bb(r),t instanceof qt){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ll)throw new TypeError(`version is longer than ${Ll} characters`);Qn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Nl[Pl.LOOSE]:Nl[Pl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ei||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ei||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ei||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const o=+i;if(o>=0&&o<ei)return o}return i}):this.prerelease=[],this.build=n[5]?n[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(t){if(Qn("SemVer.compare",this.version,this.options,t),!(t instanceof qt)){if(typeof t=="string"&&t===this.version)return 0;t=new qt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof qt||(t=new qt(t,this.options)),zr(this.major,t.major)||zr(this.minor,t.minor)||zr(this.patch,t.patch)}comparePre(t){if(t instanceof qt||(t=new qt(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(Qn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return zr(n,i)}while(++r)}compareBuild(t){t instanceof qt||(t=new qt(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(Qn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return zr(n,i)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),zr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var mt=pb;const Bl=mt,yb=(e,t,r=!1)=>{if(e instanceof Bl)return e;try{return new Bl(e,t)}catch(n){if(!r)return null;throw n}};var un=yb;const wb=un,mb=(e,t)=>{const r=wb(e,t);return r?r.version:null};var Eb=mb;const vb=un,Sb=(e,t)=>{const r=vb(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var Rb=Sb;const $l=mt,Ab=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new $l(e instanceof $l?e.version:e,r).inc(t,n,i).version}catch{return null}};var Ib=Ab;const xl=un,Tb=(e,t)=>{const r=xl(e,null,!0),n=xl(t,null,!0),i=r.compare(n);if(i===0)return null;const o=i>0,s=o?r:n,u=o?n:r,l=!!s.prerelease.length;if(!!u.prerelease.length&&!l)return!u.patch&&!u.minor?"major":s.patch?"patch":s.minor?"minor":"major";const c=l?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};var Ob=Tb;const Cb=mt,Lb=(e,t)=>new Cb(e,t).major;var Nb=Lb;const Pb=mt,Bb=(e,t)=>new Pb(e,t).minor;var $b=Bb;const xb=mt,kb=(e,t)=>new xb(e,t).patch;var Db=kb;const Mb=un,jb=(e,t)=>{const r=Mb(e,t);return r&&r.prerelease.length?r.prerelease:null};var Ub=jb;const kl=mt,Fb=(e,t,r)=>new kl(e,r).compare(new kl(t,r));var zt=Fb;const Hb=zt,zb=(e,t,r)=>Hb(t,e,r);var Wb=zb;const Vb=zt,qb=(e,t)=>Vb(e,t,!0);var Gb=qb;const Dl=mt,Zb=(e,t,r)=>{const n=new Dl(e,r),i=new Dl(t,r);return n.compare(i)||n.compareBuild(i)};var na=Zb;const Kb=na,Jb=(e,t)=>e.sort((r,n)=>Kb(r,n,t));var Xb=Jb;const Yb=na,Qb=(e,t)=>e.sort((r,n)=>Yb(n,r,t));var ep=Qb;const tp=zt,rp=(e,t,r)=>tp(e,t,r)>0;var Di=rp;const np=zt,ip=(e,t,r)=>np(e,t,r)<0;var ia=ip;const op=zt,sp=(e,t,r)=>op(e,t,r)===0;var oc=sp;const ap=zt,lp=(e,t,r)=>ap(e,t,r)!==0;var sc=lp;const fp=zt,up=(e,t,r)=>fp(e,t,r)>=0;var oa=up;const cp=zt,dp=(e,t,r)=>cp(e,t,r)<=0;var sa=dp;const hp=oc,gp=sc,_p=Di,bp=oa,pp=ia,yp=sa,wp=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return hp(e,r,n);case"!=":return gp(e,r,n);case">":return _p(e,r,n);case">=":return bp(e,r,n);case"<":return pp(e,r,n);case"<=":return yp(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var ac=wp;const mp=mt,Ep=un,{safeRe:ti,t:ri}=Fn,vp=(e,t)=>{if(e instanceof mp)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(ti[ri.COERCE]);else{let n;for(;(n=ti[ri.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),ti[ri.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;ti[ri.COERCERTL].lastIndex=-1}return r===null?null:Ep(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};var Sp=vp,Do,Ml;function Rp(){return Ml||(Ml=1,Do=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Do}var Ap=He;He.Node=xr;He.create=He;function He(e){var t=this;if(t instanceof He||(t=new He),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}He.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};He.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++}};He.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++}};He.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Tp(this,arguments[e]);return this.length};He.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Op(this,arguments[e]);return this.length};He.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}};He.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}};He.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};He.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};He.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};He.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};He.prototype.map=function(e,t){t=t||this;for(var r=new He,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};He.prototype.mapReverse=function(e,t){t=t||this;for(var r=new He,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};He.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};He.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};He.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};He.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};He.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new He;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(;i!==null&&n<t;n++,i=i.next)r.push(i.value);return r};He.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new He;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};He.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(var o=[],n=0;i&&n<t;n++)o.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=Ip(this,i,r[n]);return o};He.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function Ip(e,t,r){var n=t===e.head?new xr(r,null,t,e):new xr(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function Tp(e,t){e.tail=new xr(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Op(e,t){e.head=new xr(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function xr(e,t,r,n){if(!(this instanceof xr))return new xr(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}try{Rp()(He)}catch{}const Cp=Ap,Or=Symbol("max"),sr=Symbol("length"),Wr=Symbol("lengthCalculator"),Tn=Symbol("allowStale"),Lr=Symbol("maxAge"),nr=Symbol("dispose"),jl=Symbol("noDisposeOnSet"),lt=Symbol("lruList"),jt=Symbol("cache"),lc=Symbol("updateAgeOnGet"),Mo=()=>1;class Lp{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[Or]=t.max||1/0;const r=t.length||Mo;if(this[Wr]=typeof r!="function"?Mo:r,this[Tn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Lr]=t.maxAge||0,this[nr]=t.dispose,this[jl]=t.noDisposeOnSet||!1,this[lc]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Or]=t||1/0,bn(this)}get max(){return this[Or]}set allowStale(t){this[Tn]=!!t}get allowStale(){return this[Tn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Lr]=t,bn(this)}get maxAge(){return this[Lr]}set lengthCalculator(t){typeof t!="function"&&(t=Mo),t!==this[Wr]&&(this[Wr]=t,this[sr]=0,this[lt].forEach(r=>{r.length=this[Wr](r.value,r.key),this[sr]+=r.length})),bn(this)}get lengthCalculator(){return this[Wr]}get length(){return this[sr]}get itemCount(){return this[lt].length}rforEach(t,r){r=r||this;for(let n=this[lt].tail;n!==null;){const i=n.prev;Ul(this,t,n,r),n=i}}forEach(t,r){r=r||this;for(let n=this[lt].head;n!==null;){const i=n.next;Ul(this,t,n,r),n=i}}keys(){return this[lt].toArray().map(t=>t.key)}values(){return this[lt].toArray().map(t=>t.value)}reset(){this[nr]&&this[lt]&&this[lt].length&&this[lt].forEach(t=>this[nr](t.key,t.value)),this[jt]=new Map,this[lt]=new Cp,this[sr]=0}dump(){return this[lt].map(t=>hi(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[lt]}set(t,r,n){if(n=n||this[Lr],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,o=this[Wr](r,t);if(this[jt].has(t)){if(o>this[Or])return Jr(this,this[jt].get(t)),!1;const l=this[jt].get(t).value;return this[nr]&&(this[jl]||this[nr](t,l.value)),l.now=i,l.maxAge=n,l.value=r,this[sr]+=o-l.length,l.length=o,this.get(t),bn(this),!0}const s=new Np(t,r,o,i,n);return s.length>this[Or]?(this[nr]&&this[nr](t,r),!1):(this[sr]+=s.length,this[lt].unshift(s),this[jt].set(t,this[lt].head),bn(this),!0)}has(t){if(!this[jt].has(t))return!1;const r=this[jt].get(t).value;return!hi(this,r)}get(t){return jo(this,t,!0)}peek(t){return jo(this,t,!1)}pop(){const t=this[lt].tail;return t?(Jr(this,t),t.value):null}del(t){Jr(this,this[jt].get(t))}load(t){this.reset();const r=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[n],o=i.e||0;if(o===0)this.set(i.k,i.v);else{const s=o-r;s>0&&this.set(i.k,i.v,s)}}}prune(){this[jt].forEach((t,r)=>jo(this,r,!1))}}const jo=(e,t,r)=>{const n=e[jt].get(t);if(n){const i=n.value;if(hi(e,i)){if(Jr(e,n),!e[Tn])return}else r&&(e[lc]&&(n.value.now=Date.now()),e[lt].unshiftNode(n));return i.value}},hi=(e,t)=>{if(!t||!t.maxAge&&!e[Lr])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[Lr]&&r>e[Lr]},bn=e=>{if(e[sr]>e[Or])for(let t=e[lt].tail;e[sr]>e[Or]&&t!==null;){const r=t.prev;Jr(e,t),t=r}},Jr=(e,t)=>{if(t){const r=t.value;e[nr]&&e[nr](r.key,r.value),e[sr]-=r.length,e[jt].delete(r.key),e[lt].removeNode(t)}};class Np{constructor(t,r,n,i,o){this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=o||0}}const Ul=(e,t,r,n)=>{let i=r.value;hi(e,i)&&(Jr(e,r),e[Tn]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};var Pp=Lp,Uo,Fl;function Wt(){if(Fl)return Uo;Fl=1;class e{constructor(b,B){if(B=n(B),b instanceof e)return b.loose===!!B.loose&&b.includePrerelease===!!B.includePrerelease?b:new e(b.raw,B);if(b instanceof i)return this.raw=b.value,this.set=[[b]],this.format(),this;if(this.options=B,this.loose=!!B.loose,this.includePrerelease=!!B.includePrerelease,this.raw=b.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(W=>this.parseRange(W.trim())).filter(W=>W.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const W=this.set[0];if(this.set=this.set.filter(N=>!v(N[0])),this.set.length===0)this.set=[W];else if(this.set.length>1){for(const N of this.set)if(N.length===1&&q(N[0])){this.set=[N];break}}}this.format()}format(){return this.range=this.set.map(b=>b.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(b){const W=((this.options.includePrerelease&&m)|(this.options.loose&&p))+":"+b,N=r.get(W);if(N)return N;const k=this.options.loose,P=k?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];b=b.replace(P,G(this.options.includePrerelease)),o("hyphen replace",b),b=b.replace(u[l.COMPARATORTRIM],f),o("comparator trim",b),b=b.replace(u[l.TILDETRIM],c),o("tilde trim",b),b=b.replace(u[l.CARETTRIM],h),o("caret trim",b);let O=b.split(" ").map(se=>D(se,this.options)).join(" ").split(/\s+/).map(se=>C(se,this.options));k&&(O=O.filter(se=>(o("loose invalid filter",se,this.options),!!se.match(u[l.COMPARATORLOOSE])))),o("range list",O);const J=new Map,ne=O.map(se=>new i(se,this.options));for(const se of ne){if(v(se))return[se];J.set(se.value,se)}J.size>1&&J.has("")&&J.delete("");const re=[...J.values()];return r.set(W,re),re}intersects(b,B){if(!(b instanceof e))throw new TypeError("a Range is required");return this.set.some(W=>M(W,B)&&b.set.some(N=>M(N,B)&&W.every(k=>N.every(P=>k.intersects(P,B)))))}test(b){if(!b)return!1;if(typeof b=="string")try{b=new s(b,this.options)}catch{return!1}for(let B=0;B<this.set.length;B++)if(_(this.set[B],b,this.options))return!0;return!1}}Uo=e;const t=Pp,r=new t({max:1e3}),n=ra,i=Mi(),o=ki,s=mt,{safeRe:u,t:l,comparatorTrimReplace:f,tildeTrimReplace:c,caretTrimReplace:h}=Fn,{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:p}=xi,v=y=>y.value==="<0.0.0-0",q=y=>y.value==="",M=(y,b)=>{let B=!0;const W=y.slice();let N=W.pop();for(;B&&W.length;)B=W.every(k=>N.intersects(k,b)),N=W.pop();return B},D=(y,b)=>(o("comp",y,b),y=V(y,b),o("caret",y),y=H(y,b),o("tildes",y),y=j(y,b),o("xrange",y),y=z(y,b),o("stars",y),y),E=y=>!y||y.toLowerCase()==="x"||y==="*",H=(y,b)=>y.trim().split(/\s+/).map(B=>R(B,b)).join(" "),R=(y,b)=>{const B=b.loose?u[l.TILDELOOSE]:u[l.TILDE];return y.replace(B,(W,N,k,P,O)=>{o("tilde",y,W,N,k,P,O);let J;return E(N)?J="":E(k)?J=`>=${N}.0.0 <${+N+1}.0.0-0`:E(P)?J=`>=${N}.${k}.0 <${N}.${+k+1}.0-0`:O?(o("replaceTilde pr",O),J=`>=${N}.${k}.${P}-${O} <${N}.${+k+1}.0-0`):J=`>=${N}.${k}.${P} <${N}.${+k+1}.0-0`,o("tilde return",J),J})},V=(y,b)=>y.trim().split(/\s+/).map(B=>x(B,b)).join(" "),x=(y,b)=>{o("caret",y,b);const B=b.loose?u[l.CARETLOOSE]:u[l.CARET],W=b.includePrerelease?"-0":"";return y.replace(B,(N,k,P,O,J)=>{o("caret",y,N,k,P,O,J);let ne;return E(k)?ne="":E(P)?ne=`>=${k}.0.0${W} <${+k+1}.0.0-0`:E(O)?k==="0"?ne=`>=${k}.${P}.0${W} <${k}.${+P+1}.0-0`:ne=`>=${k}.${P}.0${W} <${+k+1}.0.0-0`:J?(o("replaceCaret pr",J),k==="0"?P==="0"?ne=`>=${k}.${P}.${O}-${J} <${k}.${P}.${+O+1}-0`:ne=`>=${k}.${P}.${O}-${J} <${k}.${+P+1}.0-0`:ne=`>=${k}.${P}.${O}-${J} <${+k+1}.0.0-0`):(o("no pr"),k==="0"?P==="0"?ne=`>=${k}.${P}.${O}${W} <${k}.${P}.${+O+1}-0`:ne=`>=${k}.${P}.${O}${W} <${k}.${+P+1}.0-0`:ne=`>=${k}.${P}.${O} <${+k+1}.0.0-0`),o("caret return",ne),ne})},j=(y,b)=>(o("replaceXRanges",y,b),y.split(/\s+/).map(B=>ee(B,b)).join(" ")),ee=(y,b)=>{y=y.trim();const B=b.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return y.replace(B,(W,N,k,P,O,J)=>{o("xRange",y,W,N,k,P,O,J);const ne=E(k),re=ne||E(P),se=re||E(O),ce=se;return N==="="&&ce&&(N=""),J=b.includePrerelease?"-0":"",ne?N===">"||N==="<"?W="<0.0.0-0":W="*":N&&ce?(re&&(P=0),O=0,N===">"?(N=">=",re?(k=+k+1,P=0,O=0):(P=+P+1,O=0)):N==="<="&&(N="<",re?k=+k+1:P=+P+1),N==="<"&&(J="-0"),W=`${N+k}.${P}.${O}${J}`):re?W=`>=${k}.0.0${J} <${+k+1}.0.0-0`:se&&(W=`>=${k}.${P}.0${J} <${k}.${+P+1}.0-0`),o("xRange return",W),W})},z=(y,b)=>(o("replaceStars",y,b),y.trim().replace(u[l.STAR],"")),C=(y,b)=>(o("replaceGTE0",y,b),y.trim().replace(u[b.includePrerelease?l.GTE0PRE:l.GTE0],"")),G=y=>(b,B,W,N,k,P,O,J,ne,re,se,ce,he)=>(E(W)?B="":E(N)?B=`>=${W}.0.0${y?"-0":""}`:E(k)?B=`>=${W}.${N}.0${y?"-0":""}`:P?B=`>=${B}`:B=`>=${B}${y?"-0":""}`,E(ne)?J="":E(re)?J=`<${+ne+1}.0.0-0`:E(se)?J=`<${ne}.${+re+1}.0-0`:ce?J=`<=${ne}.${re}.${se}-${ce}`:y?J=`<${ne}.${re}.${+se+1}-0`:J=`<=${J}`,`${B} ${J}`.trim()),_=(y,b,B)=>{for(let W=0;W<y.length;W++)if(!y[W].test(b))return!1;if(b.prerelease.length&&!B.includePrerelease){for(let W=0;W<y.length;W++)if(o(y[W].semver),y[W].semver!==i.ANY&&y[W].semver.prerelease.length>0){const N=y[W].semver;if(N.major===b.major&&N.minor===b.minor&&N.patch===b.patch)return!0}return!1}return!0};return Uo}var Fo,Hl;function Mi(){if(Hl)return Fo;Hl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,h){if(h=r(h),c instanceof t){if(c.loose===!!h.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,h),this.options=h,this.loose=!!h.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const h=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],m=c.match(h);if(!m)throw new TypeError(`Invalid comparator: ${c}`);this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new u(m[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new u(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,h){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(c.value,h).test(this.value):c.operator===""?c.value===""?!0:new l(this.value,h).test(c.semver):(h=r(h),h.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,h)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,h)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}Fo=t;const r=ra,{safeRe:n,t:i}=Fn,o=ac,s=ki,u=mt,l=Wt();return Fo}const Bp=Wt(),$p=(e,t,r)=>{try{t=new Bp(t,r)}catch{return!1}return t.test(e)};var ji=$p;const xp=Wt(),kp=(e,t)=>new xp(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Dp=kp;const Mp=mt,jp=Wt(),Up=(e,t,r)=>{let n=null,i=null,o=null;try{o=new jp(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new Mp(n,r))}),n};var Fp=Up;const Hp=mt,zp=Wt(),Wp=(e,t,r)=>{let n=null,i=null,o=null;try{o=new zp(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Hp(n,r))}),n};var Vp=Wp;const Ho=mt,qp=Wt(),zl=Di,Gp=(e,t)=>{e=new qp(e,t);let r=new Ho("0.0.0");if(e.test(r)||(r=new Ho("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const i=e.set[n];let o=null;i.forEach(s=>{const u=new Ho(s.semver.version);switch(s.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!o||zl(u,o))&&(o=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||zl(r,o))&&(r=o)}return r&&e.test(r)?r:null};var Zp=Gp;const Kp=Wt(),Jp=(e,t)=>{try{return new Kp(e,t).range||"*"}catch{return null}};var Xp=Jp;const Yp=mt,fc=Mi(),{ANY:Qp}=fc,ey=Wt(),ty=ji,Wl=Di,Vl=ia,ry=sa,ny=oa,iy=(e,t,r,n)=>{e=new Yp(e,n),t=new ey(t,n);let i,o,s,u,l;switch(r){case">":i=Wl,o=ry,s=Vl,u=">",l=">=";break;case"<":i=Vl,o=ny,s=Wl,u="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ty(e,t,n))return!1;for(let f=0;f<t.set.length;++f){const c=t.set[f];let h=null,m=null;if(c.forEach(p=>{p.semver===Qp&&(p=new fc(">=0.0.0")),h=h||p,m=m||p,i(p.semver,h.semver,n)?h=p:s(p.semver,m.semver,n)&&(m=p)}),h.operator===u||h.operator===l||(!m.operator||m.operator===u)&&o(e,m.semver))return!1;if(m.operator===l&&s(e,m.semver))return!1}return!0};var aa=iy;const oy=aa,sy=(e,t,r)=>oy(e,t,">",r);var ay=sy;const ly=aa,fy=(e,t,r)=>ly(e,t,"<",r);var uy=fy;const ql=Wt(),cy=(e,t,r)=>(e=new ql(e,r),t=new ql(t,r),e.intersects(t,r));var dy=cy;const hy=ji,gy=zt;var _y=(e,t,r)=>{const n=[];let i=null,o=null;const s=e.sort((c,h)=>gy(c,h,r));for(const c of s)hy(c,t,r)?(o=c,i||(i=c)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);const u=[];for(const[c,h]of n)c===h?u.push(c):!h&&c===s[0]?u.push("*"):h?c===s[0]?u.push(`<=${h}`):u.push(`${c} - ${h}`):u.push(`>=${c}`);const l=u.join(" || "),f=typeof t.raw=="string"?t.raw:String(t);return l.length<f.length?l:t};const Gl=Wt(),la=Mi(),{ANY:zo}=la,pn=ji,fa=zt,by=(e,t,r={})=>{if(e===t)return!0;e=new Gl(e,r),t=new Gl(t,r);let n=!1;e:for(const i of e.set){for(const o of t.set){const s=yy(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},py=[new la(">=0.0.0-0")],Zl=[new la(">=0.0.0")],yy=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===zo){if(t.length===1&&t[0].semver===zo)return!0;r.includePrerelease?e=py:e=Zl}if(t.length===1&&t[0].semver===zo){if(r.includePrerelease)return!0;t=Zl}const n=new Set;let i,o;for(const p of e)p.operator===">"||p.operator===">="?i=Kl(i,p,r):p.operator==="<"||p.operator==="<="?o=Jl(o,p,r):n.add(p.semver);if(n.size>1)return null;let s;if(i&&o){if(s=fa(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(const p of n){if(i&&!pn(p,String(i),r)||o&&!pn(p,String(o),r))return null;for(const v of t)if(!pn(p,String(v),r))return!1;return!0}let u,l,f,c,h=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,m=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&o.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const p of t){if(c=c||p.operator===">"||p.operator===">=",f=f||p.operator==="<"||p.operator==="<=",i){if(m&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===m.major&&p.semver.minor===m.minor&&p.semver.patch===m.patch&&(m=!1),p.operator===">"||p.operator===">="){if(u=Kl(i,p,r),u===p&&u!==i)return!1}else if(i.operator===">="&&!pn(i.semver,String(p),r))return!1}if(o){if(h&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===h.major&&p.semver.minor===h.minor&&p.semver.patch===h.patch&&(h=!1),p.operator==="<"||p.operator==="<="){if(l=Jl(o,p,r),l===p&&l!==o)return!1}else if(o.operator==="<="&&!pn(o.semver,String(p),r))return!1}if(!p.operator&&(o||i)&&s!==0)return!1}return!(i&&f&&!o&&s!==0||o&&c&&!i&&s!==0||m||h)},Kl=(e,t,r)=>{if(!e)return t;const n=fa(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Jl=(e,t,r)=>{if(!e)return t;const n=fa(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var wy=by;const Wo=Fn,Xl=xi,my=mt,Yl=ic,Ey=un,vy=Eb,Sy=Rb,Ry=Ib,Ay=Ob,Iy=Nb,Ty=$b,Oy=Db,Cy=Ub,Ly=zt,Ny=Wb,Py=Gb,By=na,$y=Xb,xy=ep,ky=Di,Dy=ia,My=oc,jy=sc,Uy=oa,Fy=sa,Hy=ac,zy=Sp,Wy=Mi(),Vy=Wt(),qy=ji,Gy=Dp,Zy=Fp,Ky=Vp,Jy=Zp,Xy=Xp,Yy=aa,Qy=ay,ew=uy,tw=dy,rw=_y,nw=wy;var iw={parse:Ey,valid:vy,clean:Sy,inc:Ry,diff:Ay,major:Iy,minor:Ty,patch:Oy,prerelease:Cy,compare:Ly,rcompare:Ny,compareLoose:Py,compareBuild:By,sort:$y,rsort:xy,gt:ky,lt:Dy,eq:My,neq:jy,gte:Uy,lte:Fy,cmp:Hy,coerce:zy,Comparator:Wy,Range:Vy,satisfies:qy,toComparators:Gy,maxSatisfying:Zy,minSatisfying:Ky,minVersion:Jy,validRange:Xy,outside:Yy,gtr:Qy,ltr:ew,intersects:tw,simplifyRange:rw,subset:nw,SemVer:my,re:Wo.re,src:Wo.src,tokens:Wo.t,SEMVER_SPEC_VERSION:Xl.SEMVER_SPEC_VERSION,RELEASE_TYPES:Xl.RELEASE_TYPES,compareIdentifiers:Yl.compareIdentifiers,rcompareIdentifiers:Yl.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=iw,r=Mr,n=dt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",h=>(0,t.valid)(h)===null?`Expected SemVer version, got "${h}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",h=>(0,t.validRange)(h)===null?`Expected SemVer range, got "${h}"`:!0);function i(h){return(0,r.is)(h,e.VersionStruct)}e.isValidSemVerVersion=i;function o(h){return(0,r.is)(h,e.VersionRangeStruct)}e.isValidSemVerRange=o;function s(h){(0,n.assertStruct)(h,e.VersionStruct)}e.assertIsSemVerVersion=s;function u(h){(0,n.assertStruct)(h,e.VersionRangeStruct)}e.assertIsSemVerRange=u;function l(h,m){return(0,t.gt)(h,m)}e.gtVersion=l;function f(h,m){return(0,t.gtr)(h,m)}e.gtRange=f;function c(h,m){return(0,t.satisfies)(h,m,{includePrerelease:!0})}e.satisfiesVersionRange=c})(tc);(function(e){var t=Ye&&Ye.__createBinding||(Object.create?function(n,i,o,s){s===void 0&&(s=o);var u=Object.getOwnPropertyDescriptor(i,o);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,s,u)}:function(n,i,o,s){s===void 0&&(s=o),n[s]=i[o]}),r=Ye&&Ye.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(dt,e),r(jn,e),r(Ue,e),r(Bi,e),r(Zt,e),r(Qr,e),r(Zu,e),r(Un,e),r(Ku,e),r(Ju,e),r(en,e),r(Xu,e),r(Kt,e),r(Yu,e),r(Qu,e),r(ec,e),r(tc,e)})(Xs);var Ui={},mr={};Object.defineProperty(mr,"__esModule",{value:!0});mr.errorValues=mr.errorCodes=void 0;mr.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};mr.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeCause=e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Xs,r=mr,n=r.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function s(p,v=i){if(u(p)){const q=p.toString();if((0,t.hasProperty)(r.errorValues,q))return r.errorValues[q].message;if(c(p))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return v}e.getMessageFromCode=s;function u(p){return Number.isInteger(p)}e.isValidCode=u;function l(p,{fallbackError:v=o,shouldIncludeStack:q=!0}={}){if(!(0,t.isJsonRpcError)(v))throw new Error("Must provide fallback error with integer number code and string message.");const M=f(p,v);return q||delete M.stack,M}e.serializeError=l;function f(p,v){if(p&&typeof p=="object"&&"serialize"in p&&typeof p.serialize=="function")return p.serialize();if((0,t.isJsonRpcError)(p))return p;const q=h(p);return{...v,data:{cause:q}}}function c(p){return p>=-32099&&p<=-32e3}function h(p){return Array.isArray(p)?p.map(v=>(0,t.isValidJson)(v)?v:(0,t.isObject)(v)?m(v):null):(0,t.isObject)(p)?m(p):(0,t.isValidJson)(p)?p:null}e.serializeCause=h;function m(p){return Object.getOwnPropertyNames(p).reduce((v,q)=>{const M=p[q];return(0,t.isValidJson)(M)&&(v[q]=M),v},{})}})(Ui);var ow=Ye&&Ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($r,"__esModule",{value:!0});$r.EthereumProviderError=$r.JsonRpcError=void 0;const sw=Xs,aw=ow(xs),lw=Ui;class uc extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a non-empty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data,(0,sw.isPlainObject)(this.data)&&(t.data.cause=(0,lw.serializeCause)(this.data.cause))),this.stack&&(t.stack=this.stack),t}toString(){return(0,aw.default)(this.serialize(),cw,2)}}$r.JsonRpcError=uc;class fw extends uc{constructor(t,r,n){if(!uw(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}$r.EthereumProviderError=fw;function uw(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function cw(e,t){if(t!=="[Circular]")return t}var tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.providerErrors=tn.rpcErrors=void 0;const ua=$r,bt=mr,cc=Ui;tn.rpcErrors={parse:e=>Ot(bt.errorCodes.rpc.parse,e),invalidRequest:e=>Ot(bt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Ot(bt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Ot(bt.errorCodes.rpc.methodNotFound,e),internal:e=>Ot(bt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ot(t,e)},invalidInput:e=>Ot(bt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Ot(bt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Ot(bt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Ot(bt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Ot(bt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Ot(bt.errorCodes.rpc.limitExceeded,e)};tn.providerErrors={userRejectedRequest:e=>yn(bt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>yn(bt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>yn(bt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>yn(bt.errorCodes.provider.disconnected,e),chainDisconnected:e=>yn(bt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ua.EthereumProviderError(t,r,n)}};function Ot(e,t){const[r,n]=dc(t);return new ua.JsonRpcError(e,r??(0,cc.getMessageFromCode)(e),n)}function yn(e,t){const[r,n]=dc(t);return new ua.EthereumProviderError(e,r??(0,cc.getMessageFromCode)(e),n)}function dc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorCodes=e.providerErrors=e.rpcErrors=e.getMessageFromCode=e.serializeError=e.serializeCause=e.EthereumProviderError=e.JsonRpcError=void 0;var t=$r;Object.defineProperty(e,"JsonRpcError",{enumerable:!0,get:function(){return t.JsonRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});var r=Ui;Object.defineProperty(e,"serializeCause",{enumerable:!0,get:function(){return r.serializeCause}}),Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});var n=tn;Object.defineProperty(e,"rpcErrors",{enumerable:!0,get:function(){return n.rpcErrors}}),Object.defineProperty(e,"providerErrors",{enumerable:!0,get:function(){return n.providerErrors}});var i=mr;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(E_);var ca={exports:{}},dw=hc;function hc(e,t){if(e&&t)return hc(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=e.apply(this,n),s=n[n.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(u){o[u]=s[u]}),o}}var gc=dw;ca.exports=gc(li);ca.exports.strict=gc(_c);li.proto=li(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return li(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return _c(this)},configurable:!0})});function li(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function _c(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}var da=ca.exports;const hw=Er(da);var gw=da,_w=function(){},bw=function(e){return e.setHeader&&typeof e.abort=="function"},pw=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},bc=function(e,t,r){if(typeof t=="function")return bc(e,null,t);t||(t={}),r=gw(r||_w);var n=e._writableState,i=e._readableState,o=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,u=!1,l=function(){e.writable||f()},f=function(){s=!1,o||r.call(e)},c=function(){o=!1,s||r.call(e)},h=function(M){r.call(e,M?new Error("exited with error code: "+M):null)},m=function(M){r.call(e,M)},p=function(){ye.process.nextTick(v)},v=function(){if(!u){if(o&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},q=function(){e.req.on("finish",f)};return bw(e)?(e.on("complete",f),e.on("abort",p),e.req?q():e.on("request",q)):s&&!n&&(e.on("end",l),e.on("close",l)),pw(e)&&e.on("exit",h),e.on("end",c),e.on("finish",f),t.error!==!1&&e.on("error",m),e.on("close",p),function(){u=!0,e.removeListener("complete",f),e.removeListener("abort",p),e.removeListener("request",q),e.req&&e.req.removeListener("finish",f),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",f),e.removeListener("exit",h),e.removeListener("end",c),e.removeListener("error",m),e.removeListener("close",p)}},pc=bc;const Ql=Er(pc);var yw=da,ww=pc,Vo=Yd,Bn=function(){},mw=/^v?\.0/.test(ye.process.version),Fi=function(e){return typeof e=="function"},Ew=function(e){return!mw||!Vo?!1:(e instanceof(Vo.ReadStream||Bn)||e instanceof(Vo.WriteStream||Bn))&&Fi(e.close)},vw=function(e){return e.setHeader&&Fi(e.abort)},Sw=function(e,t,r,n){n=yw(n);var i=!1;e.on("close",function(){i=!0}),ww(e,{readable:t,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,Ew(e))return e.close(Bn);if(vw(e))return e.abort();if(Fi(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},ef=function(e){e()},Rw=function(e,t){return e.pipe(t)},Aw=function(){var e=Array.prototype.slice.call(arguments),t=Fi(e[e.length-1]||Bn)&&e.pop()||Bn;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,n=e.map(function(i,o){var s=o<e.length-1,u=o>0;return Sw(i,s,u,function(l){r||(r=l),l&&n.forEach(ef),!s&&(n.forEach(ef),t(r))})});return e.reduce(Rw)},Iw=Aw;const tf=Er(Iw);var Tw={},Hi={},zi={},yc={},rn={},Wi={},ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.output=ft.exists=ft.hash=ft.bytes=ft.bool=ft.number=void 0;function gi(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}ft.number=gi;function wc(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}ft.bool=wc;function ha(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}ft.bytes=ha;function mc(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");gi(e.outputLen),gi(e.blockLen)}ft.hash=mc;function Ec(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}ft.exists=Ec;function vc(e,t){ha(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}ft.output=vc;const Ow={number:gi,bool:wc,bytes:ha,hash:mc,exists:Ec,output:vc};ft.default=Ow;var ur={},Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.crypto=void 0;Vi.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;(function(e){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;const t=Vi,r=x=>x instanceof Uint8Array,n=x=>new Uint8Array(x.buffer,x.byteOffset,x.byteLength);e.u8=n;const i=x=>new Uint32Array(x.buffer,x.byteOffset,Math.floor(x.byteLength/4));e.u32=i;const o=x=>new DataView(x.buffer,x.byteOffset,x.byteLength);e.createView=o;const s=(x,j)=>x<<32-j|x>>>j;if(e.rotr=s,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");const u=Array.from({length:256},(x,j)=>j.toString(16).padStart(2,"0"));function l(x){if(!r(x))throw new Error("Uint8Array expected");let j="";for(let ee=0;ee<x.length;ee++)j+=u[x[ee]];return j}e.bytesToHex=l;function f(x){if(typeof x!="string")throw new Error("hex string expected, got "+typeof x);const j=x.length;if(j%2)throw new Error("padded hex string expected, got unpadded hex of length "+j);const ee=new Uint8Array(j/2);for(let z=0;z<ee.length;z++){const C=z*2,G=x.slice(C,C+2),_=Number.parseInt(G,16);if(Number.isNaN(_)||_<0)throw new Error("Invalid byte sequence");ee[z]=_}return ee}e.hexToBytes=f;const c=async()=>{};e.nextTick=c;async function h(x,j,ee){let z=Date.now();for(let C=0;C<x;C++){ee(C);const G=Date.now()-z;G>=0&&G<j||(await(0,e.nextTick)(),z+=G)}}e.asyncLoop=h;function m(x){if(typeof x!="string")throw new Error(`utf8ToBytes expected string, got ${typeof x}`);return new Uint8Array(new TextEncoder().encode(x))}e.utf8ToBytes=m;function p(x){if(typeof x=="string"&&(x=m(x)),!r(x))throw new Error(`expected Uint8Array, got ${typeof x}`);return x}e.toBytes=p;function v(...x){const j=new Uint8Array(x.reduce((z,C)=>z+C.length,0));let ee=0;return x.forEach(z=>{if(!r(z))throw new Error("Uint8Array expected");j.set(z,ee),ee+=z.length}),j}e.concatBytes=v;class q{clone(){return this._cloneInto()}}e.Hash=q;const M=x=>Object.prototype.toString.call(x)==="[object Object]"&&x.constructor===Object;function D(x,j){if(j!==void 0&&(typeof j!="object"||!M(j)))throw new Error("Options should be object or undefined");return Object.assign(x,j)}e.checkOpts=D;function E(x){const j=z=>x().update(p(z)).digest(),ee=x();return j.outputLen=ee.outputLen,j.blockLen=ee.blockLen,j.create=()=>x(),j}e.wrapConstructor=E;function H(x){const j=(z,C)=>x(C).update(p(z)).digest(),ee=x({});return j.outputLen=ee.outputLen,j.blockLen=ee.blockLen,j.create=z=>x(z),j}e.wrapConstructorWithOpts=H;function R(x){const j=(z,C)=>x(C).update(p(z)).digest(),ee=x({});return j.outputLen=ee.outputLen,j.blockLen=ee.blockLen,j.create=z=>x(z),j}e.wrapXOFConstructorWithOpts=R;function V(x=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(x));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=V})(ur);Object.defineProperty(Wi,"__esModule",{value:!0});Wi.SHA2=void 0;const qo=ft,wn=ur;function Cw(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),u=Number(r&o),l=n?4:0,f=n?0:4;e.setUint32(t+l,s,n),e.setUint32(t+f,u,n)}class Lw extends wn.Hash{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,wn.createView)(this.buffer)}update(t){qo.default.exists(this);const{view:r,buffer:n,blockLen:i}=this;t=(0,wn.toBytes)(t);const o=t.length;for(let s=0;s<o;){const u=Math.min(i-this.pos,o-s);if(u===i){const l=(0,wn.createView)(t);for(;i<=o-s;s+=i)this.process(l,s);continue}n.set(t.subarray(s,s+u),this.pos),this.pos+=u,s+=u,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){qo.default.exists(this),qo.default.output(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:o}=this;let{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let h=s;h<i;h++)r[h]=0;Cw(n,i-8,BigInt(this.length*8),o),this.process(n,0);const u=(0,wn.createView)(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=l/4,c=this.get();if(f>c.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<f;h++)u.setUint32(4*h,c[h],o)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:o,destroyed:s,pos:u}=this;return t.length=i,t.pos=u,t.finished=o,t.destroyed=s,i%r&&t.buffer.set(n),t}}Wi.SHA2=Lw;Object.defineProperty(rn,"__esModule",{value:!0});rn.sha224=rn.sha256=void 0;const Nw=Wi,Lt=ur,Pw=(e,t,r)=>e&t^~e&r,Bw=(e,t,r)=>e&t^e&r^t&r,$w=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),hr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),gr=new Uint32Array(64);class Sc extends Nw.SHA2{constructor(){super(64,32,8,!1),this.A=hr[0]|0,this.B=hr[1]|0,this.C=hr[2]|0,this.D=hr[3]|0,this.E=hr[4]|0,this.F=hr[5]|0,this.G=hr[6]|0,this.H=hr[7]|0}get(){const{A:t,B:r,C:n,D:i,E:o,F:s,G:u,H:l}=this;return[t,r,n,i,o,s,u,l]}set(t,r,n,i,o,s,u,l){this.A=t|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=u|0,this.H=l|0}process(t,r){for(let h=0;h<16;h++,r+=4)gr[h]=t.getUint32(r,!1);for(let h=16;h<64;h++){const m=gr[h-15],p=gr[h-2],v=(0,Lt.rotr)(m,7)^(0,Lt.rotr)(m,18)^m>>>3,q=(0,Lt.rotr)(p,17)^(0,Lt.rotr)(p,19)^p>>>10;gr[h]=q+gr[h-7]+v+gr[h-16]|0}let{A:n,B:i,C:o,D:s,E:u,F:l,G:f,H:c}=this;for(let h=0;h<64;h++){const m=(0,Lt.rotr)(u,6)^(0,Lt.rotr)(u,11)^(0,Lt.rotr)(u,25),p=c+m+Pw(u,l,f)+$w[h]+gr[h]|0,q=((0,Lt.rotr)(n,2)^(0,Lt.rotr)(n,13)^(0,Lt.rotr)(n,22))+Bw(n,i,o)|0;c=f,f=l,l=u,u=s+p|0,s=o,o=i,i=n,n=p+q|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,u=u+this.E|0,l=l+this.F|0,f=f+this.G|0,c=c+this.H|0,this.set(n,i,o,s,u,l,f,c)}roundClean(){gr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class xw extends Sc{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}rn.sha256=(0,Lt.wrapConstructor)(()=>new Sc);rn.sha224=(0,Lt.wrapConstructor)(()=>new xw);var Pe={},Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.validateObject=Ne.createHmacDrbg=Ne.bitMask=Ne.bitSet=Ne.bitGet=Ne.bitLen=Ne.utf8ToBytes=Ne.equalBytes=Ne.concatBytes=Ne.ensureBytes=Ne.numberToVarBytesBE=Ne.numberToBytesLE=Ne.numberToBytesBE=Ne.bytesToNumberLE=Ne.bytesToNumberBE=Ne.hexToBytes=Ne.hexToNumber=Ne.numberToHexUnpadded=Ne.bytesToHex=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rc=BigInt(0),qi=BigInt(1),kw=BigInt(2),Gi=e=>e instanceof Uint8Array,Dw=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ga(e){if(!Gi(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=Dw[e[r]];return t}Ne.bytesToHex=ga;function Ac(e){const t=e.toString(16);return t.length&1?`0${t}`:t}Ne.numberToHexUnpadded=Ac;function _a(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}Ne.hexToNumber=_a;function Zi(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let n=0;n<r.length;n++){const i=n*2,o=e.slice(i,i+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");r[n]=s}return r}Ne.hexToBytes=Zi;function Mw(e){return _a(ga(e))}Ne.bytesToNumberBE=Mw;function jw(e){if(!Gi(e))throw new Error("Uint8Array expected");return _a(ga(Uint8Array.from(e).reverse()))}Ne.bytesToNumberLE=jw;function Ic(e,t){return Zi(e.toString(16).padStart(t*2,"0"))}Ne.numberToBytesBE=Ic;function Uw(e,t){return Ic(e,t).reverse()}Ne.numberToBytesLE=Uw;function Fw(e){return Zi(Ac(e))}Ne.numberToVarBytesBE=Fw;function Hw(e,t,r){let n;if(typeof t=="string")try{n=Zi(t)}catch(o){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${o}`)}else if(Gi(t))n=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n}Ne.ensureBytes=Hw;function Tc(...e){const t=new Uint8Array(e.reduce((n,i)=>n+i.length,0));let r=0;return e.forEach(n=>{if(!Gi(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}Ne.concatBytes=Tc;function zw(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}Ne.equalBytes=zw;function Ww(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}Ne.utf8ToBytes=Ww;function Vw(e){let t;for(t=0;e>Rc;e>>=qi,t+=1);return t}Ne.bitLen=Vw;function qw(e,t){return e>>BigInt(t)&qi}Ne.bitGet=qw;const Gw=(e,t,r)=>e|(r?qi:Rc)<<BigInt(t);Ne.bitSet=Gw;const Zw=e=>(kw<<BigInt(e-1))-qi;Ne.bitMask=Zw;const Go=e=>new Uint8Array(e),rf=e=>Uint8Array.from(e);function Kw(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Go(e),i=Go(e),o=0;const s=()=>{n.fill(1),i.fill(0),o=0},u=(...h)=>r(i,n,...h),l=(h=Go())=>{i=u(rf([0]),h),n=u(),h.length!==0&&(i=u(rf([1]),h),n=u())},f=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let h=0;const m=[];for(;h<t;){n=u();const p=n.slice();m.push(p),h+=n.length}return Tc(...m)};return(h,m)=>{s(),l(h);let p;for(;!(p=m(f()));)l();return s(),p}}Ne.createHmacDrbg=Kw;const Jw={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Xw(e,t,r={}){const n=(i,o,s)=>{const u=Jw[o];if(typeof u!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=e[i];if(!(s&&l===void 0)&&!u(l,e))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${o}`)};for(const[i,o]of Object.entries(t))n(i,o,!1);for(const[i,o]of Object.entries(r))n(i,o,!0);return e}Ne.validateObject=Xw;Object.defineProperty(Pe,"__esModule",{value:!0});Pe.hashToPrivateScalar=Pe.FpSqrtEven=Pe.FpSqrtOdd=Pe.Field=Pe.nLength=Pe.FpIsSquare=Pe.FpDiv=Pe.FpInvertBatch=Pe.FpPow=Pe.validateField=Pe.isNegativeLE=Pe.FpSqrt=Pe.tonelliShanks=Pe.invert=Pe.pow2=Pe.pow=Pe.mod=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ar=Ne,ut=BigInt(0),Xe=BigInt(1),pr=BigInt(2),Yw=BigInt(3),Is=BigInt(4),nf=BigInt(5),of=BigInt(8);BigInt(9);BigInt(16);function Nt(e,t){const r=e%t;return r>=ut?r:t+r}Pe.mod=Nt;function Oc(e,t,r){if(r<=ut||t<ut)throw new Error("Expected power/modulo > 0");if(r===Xe)return ut;let n=Xe;for(;t>ut;)t&Xe&&(n=n*e%r),e=e*e%r,t>>=Xe;return n}Pe.pow=Oc;function Qw(e,t,r){let n=e;for(;t-- >ut;)n*=n,n%=r;return n}Pe.pow2=Qw;function _i(e,t){if(e===ut||t<=ut)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Nt(e,t),n=t,i=ut,o=Xe;for(;r!==ut;){const u=n/r,l=n%r,f=i-o*u;n=r,r=l,i=o,o=f}if(n!==Xe)throw new Error("invert: does not exist");return Nt(i,t)}Pe.invert=_i;function Cc(e){const t=(e-Xe)/pr;let r,n,i;for(r=e-Xe,n=0;r%pr===ut;r/=pr,n++);for(i=pr;i<e&&Oc(i,t,e)!==e-Xe;i++);if(n===1){const s=(e+Xe)/Is;return function(l,f){const c=l.pow(f,s);if(!l.eql(l.sqr(c),f))throw new Error("Cannot find square root");return c}}const o=(r+Xe)/pr;return function(u,l){if(u.pow(l,t)===u.neg(u.ONE))throw new Error("Cannot find square root");let f=n,c=u.pow(u.mul(u.ONE,i),r),h=u.pow(l,o),m=u.pow(l,r);for(;!u.eql(m,u.ONE);){if(u.eql(m,u.ZERO))return u.ZERO;let p=1;for(let q=u.sqr(m);p<f&&!u.eql(q,u.ONE);p++)q=u.sqr(q);const v=u.pow(c,Xe<<BigInt(f-p-1));c=u.sqr(v),h=u.mul(h,v),m=u.mul(m,c),f=p}return h}}Pe.tonelliShanks=Cc;function Lc(e){if(e%Is===Yw){const t=(e+Xe)/Is;return function(n,i){const o=n.pow(i,t);if(!n.eql(n.sqr(o),i))throw new Error("Cannot find square root");return o}}if(e%of===nf){const t=(e-nf)/of;return function(n,i){const o=n.mul(i,pr),s=n.pow(o,t),u=n.mul(i,s),l=n.mul(n.mul(u,pr),s),f=n.mul(u,n.sub(l,n.ONE));if(!n.eql(n.sqr(f),i))throw new Error("Cannot find square root");return f}}return Cc(e)}Pe.FpSqrt=Lc;const em=(e,t)=>(Nt(e,t)&Xe)===Xe;Pe.isNegativeLE=em;const tm=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function rm(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=tm.reduce((n,i)=>(n[i]="function",n),t);return(0,ar.validateObject)(e,r)}Pe.validateField=rm;function Nc(e,t,r){if(r<ut)throw new Error("Expected power > 0");if(r===ut)return e.ONE;if(r===Xe)return t;let n=e.ONE,i=t;for(;r>ut;)r&Xe&&(n=e.mul(n,i)),i=e.sqr(i),r>>=Xe;return n}Pe.FpPow=Nc;function Pc(e,t){const r=new Array(t.length),n=t.reduce((o,s,u)=>e.is0(s)?o:(r[u]=o,e.mul(o,s)),e.ONE),i=e.inv(n);return t.reduceRight((o,s,u)=>e.is0(s)?o:(r[u]=e.mul(o,r[u]),e.mul(o,s)),i),r}Pe.FpInvertBatch=Pc;function nm(e,t,r){return e.mul(t,typeof r=="bigint"?_i(r,e.ORDER):e.inv(r))}Pe.FpDiv=nm;function im(e){const t=(e.ORDER-Xe)/pr;return r=>{const n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}}Pe.FpIsSquare=im;function ba(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}Pe.nLength=ba;function om(e,t,r=!1,n={}){if(e<=ut)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:o}=ba(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=Lc(e),u=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:(0,ar.bitMask)(i),ZERO:ut,ONE:Xe,create:l=>Nt(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return ut<=l&&l<e},is0:l=>l===ut,isOdd:l=>(l&Xe)===Xe,neg:l=>Nt(-l,e),eql:(l,f)=>l===f,sqr:l=>Nt(l*l,e),add:(l,f)=>Nt(l+f,e),sub:(l,f)=>Nt(l-f,e),mul:(l,f)=>Nt(l*f,e),pow:(l,f)=>Nc(u,l,f),div:(l,f)=>Nt(l*_i(f,e),e),sqrN:l=>l*l,addN:(l,f)=>l+f,subN:(l,f)=>l-f,mulN:(l,f)=>l*f,inv:l=>_i(l,e),sqrt:n.sqrt||(l=>s(u,l)),invertBatch:l=>Pc(u,l),cmov:(l,f,c)=>c?f:l,toBytes:l=>r?(0,ar.numberToBytesLE)(l,o):(0,ar.numberToBytesBE)(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?(0,ar.bytesToNumberLE)(l):(0,ar.bytesToNumberBE)(l)}});return Object.freeze(u)}Pe.Field=om;function sm(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}Pe.FpSqrtOdd=sm;function am(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}Pe.FpSqrtEven=am;function lm(e,t,r=!1){e=(0,ar.ensureBytes)("privateHash",e);const n=e.length,i=ba(t).nByteLength+8;if(i<24||n<i||n>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);const o=r?(0,ar.bytesToNumberLE)(e):(0,ar.bytesToNumberBE)(e);return Nt(o,t-Xe)+Xe}Pe.hashToPrivateScalar=lm;var pa={},nn={};Object.defineProperty(nn,"__esModule",{value:!0});nn.validateBasic=nn.wNAF=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const sf=Pe,fm=Ne,um=BigInt(0),Zo=BigInt(1);function cm(e,t){const r=(i,o)=>{const s=o.negate();return i?s:o},n=i=>{const o=Math.ceil(t/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:r,unsafeLadder(i,o){let s=e.ZERO,u=i;for(;o>um;)o&Zo&&(s=s.add(u)),u=u.double(),o>>=Zo;return s},precomputeWindow(i,o){const{windows:s,windowSize:u}=n(o),l=[];let f=i,c=f;for(let h=0;h<s;h++){c=f,l.push(c);for(let m=1;m<u;m++)c=c.add(f),l.push(c);f=c.double()}return l},wNAF(i,o,s){const{windows:u,windowSize:l}=n(i);let f=e.ZERO,c=e.BASE;const h=BigInt(2**i-1),m=2**i,p=BigInt(i);for(let v=0;v<u;v++){const q=v*l;let M=Number(s&h);s>>=p,M>l&&(M-=m,s+=Zo);const D=q,E=q+Math.abs(M)-1,H=v%2!==0,R=M<0;M===0?c=c.add(r(H,o[D])):f=f.add(r(R,o[E]))}return{p:f,f:c}},wNAFCached(i,o,s,u){const l=i._WINDOW_SIZE||1;let f=o.get(i);return f||(f=this.precomputeWindow(i,l),l!==1&&o.set(i,u(f))),this.wNAF(l,f,s)}}}nn.wNAF=cm;function dm(e){return(0,sf.validateField)(e.Fp),(0,fm.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,sf.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}nn.validateBasic=dm;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapToCurveSimpleSWU=e.SWUFpSqrtRatio=e.weierstrass=e.weierstrassPoints=e.DER=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=Pe,r=Ne,n=Ne,i=nn;function o(E){const H=(0,i.validateBasic)(E);r.validateObject(H,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:R,Fp:V,a:x}=H;if(R){if(!V.eql(x,V.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof R!="object"||typeof R.beta!="bigint"||typeof R.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...H})}const{bytesToNumberBE:s,hexToBytes:u}=r;e.DER={Err:class extends Error{constructor(H=""){super(H)}},_parseInt(E){const{Err:H}=e.DER;if(E.length<2||E[0]!==2)throw new H("Invalid signature integer tag");const R=E[1],V=E.subarray(2,R+2);if(!R||V.length!==R)throw new H("Invalid signature integer: wrong length");if(V[0]&128)throw new H("Invalid signature integer: negative");if(V[0]===0&&!(V[1]&128))throw new H("Invalid signature integer: unnecessary leading zero");return{d:s(V),l:E.subarray(R+2)}},toSig(E){const{Err:H}=e.DER,R=typeof E=="string"?u(E):E;if(!(R instanceof Uint8Array))throw new Error("ui8a expected");let V=R.length;if(V<2||R[0]!=48)throw new H("Invalid signature tag");if(R[1]!==V-2)throw new H("Invalid signature: incorrect length");const{d:x,l:j}=e.DER._parseInt(R.subarray(2)),{d:ee,l:z}=e.DER._parseInt(j);if(z.length)throw new H("Invalid signature: left bytes after parsing");return{r:x,s:ee}},hexFromSig(E){const H=G=>Number.parseInt(G[0],16)&8?"00"+G:G,R=G=>{const _=G.toString(16);return _.length&1?`0${_}`:_},V=H(R(E.s)),x=H(R(E.r)),j=V.length/2,ee=x.length/2,z=R(j),C=R(ee);return`30${R(ee+j+4)}02${C}${x}02${z}${V}`}};const l=BigInt(0),f=BigInt(1),c=BigInt(2),h=BigInt(3),m=BigInt(4);function p(E){const H=o(E),{Fp:R}=H,V=H.toBytes||((W,N,k)=>{const P=N.toAffine();return r.concatBytes(Uint8Array.from([4]),R.toBytes(P.x),R.toBytes(P.y))}),x=H.fromBytes||(W=>{const N=W.subarray(1),k=R.fromBytes(N.subarray(0,R.BYTES)),P=R.fromBytes(N.subarray(R.BYTES,2*R.BYTES));return{x:k,y:P}});function j(W){const{a:N,b:k}=H,P=R.sqr(W),O=R.mul(P,W);return R.add(R.add(O,R.mul(W,N)),k)}if(!R.eql(R.sqr(H.Gy),j(H.Gx)))throw new Error("bad generator point: equation left != right");function ee(W){return typeof W=="bigint"&&l<W&&W<H.n}function z(W){if(!ee(W))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function C(W){const{allowedPrivateKeyLengths:N,nByteLength:k,wrapPrivateKey:P,n:O}=H;if(N&&typeof W!="bigint"){if(W instanceof Uint8Array&&(W=r.bytesToHex(W)),typeof W!="string"||!N.includes(W.length))throw new Error("Invalid key");W=W.padStart(k*2,"0")}let J;try{J=typeof W=="bigint"?W:r.bytesToNumberBE((0,n.ensureBytes)("private key",W,k))}catch{throw new Error(`private key must be ${k} bytes, hex or bigint, not ${typeof W}`)}return P&&(J=t.mod(J,O)),z(J),J}const G=new Map;function _(W){if(!(W instanceof y))throw new Error("ProjectivePoint expected")}class y{constructor(N,k,P){if(this.px=N,this.py=k,this.pz=P,N==null||!R.isValid(N))throw new Error("x required");if(k==null||!R.isValid(k))throw new Error("y required");if(P==null||!R.isValid(P))throw new Error("z required")}static fromAffine(N){const{x:k,y:P}=N||{};if(!N||!R.isValid(k)||!R.isValid(P))throw new Error("invalid affine point");if(N instanceof y)throw new Error("projective point not allowed");const O=J=>R.eql(J,R.ZERO);return O(k)&&O(P)?y.ZERO:new y(k,P,R.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(N){const k=R.invertBatch(N.map(P=>P.pz));return N.map((P,O)=>P.toAffine(k[O])).map(y.fromAffine)}static fromHex(N){const k=y.fromAffine(x((0,n.ensureBytes)("pointHex",N)));return k.assertValidity(),k}static fromPrivateKey(N){return y.BASE.multiply(C(N))}_setWindowSize(N){this._WINDOW_SIZE=N,G.delete(this)}assertValidity(){if(this.is0()){if(H.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:N,y:k}=this.toAffine();if(!R.isValid(N)||!R.isValid(k))throw new Error("bad point: x or y not FE");const P=R.sqr(k),O=j(N);if(!R.eql(P,O))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:N}=this.toAffine();if(R.isOdd)return!R.isOdd(N);throw new Error("Field doesn't support isOdd")}equals(N){_(N);const{px:k,py:P,pz:O}=this,{px:J,py:ne,pz:re}=N,se=R.eql(R.mul(k,re),R.mul(J,O)),ce=R.eql(R.mul(P,re),R.mul(ne,O));return se&&ce}negate(){return new y(this.px,R.neg(this.py),this.pz)}double(){const{a:N,b:k}=H,P=R.mul(k,h),{px:O,py:J,pz:ne}=this;let re=R.ZERO,se=R.ZERO,ce=R.ZERO,he=R.mul(O,O),Se=R.mul(J,J),ge=R.mul(ne,ne),be=R.mul(O,J);return be=R.add(be,be),ce=R.mul(O,ne),ce=R.add(ce,ce),re=R.mul(N,ce),se=R.mul(P,ge),se=R.add(re,se),re=R.sub(Se,se),se=R.add(Se,se),se=R.mul(re,se),re=R.mul(be,re),ce=R.mul(P,ce),ge=R.mul(N,ge),be=R.sub(he,ge),be=R.mul(N,be),be=R.add(be,ce),ce=R.add(he,he),he=R.add(ce,he),he=R.add(he,ge),he=R.mul(he,be),se=R.add(se,he),ge=R.mul(J,ne),ge=R.add(ge,ge),he=R.mul(ge,be),re=R.sub(re,he),ce=R.mul(ge,Se),ce=R.add(ce,ce),ce=R.add(ce,ce),new y(re,se,ce)}add(N){_(N);const{px:k,py:P,pz:O}=this,{px:J,py:ne,pz:re}=N;let se=R.ZERO,ce=R.ZERO,he=R.ZERO;const Se=H.a,ge=R.mul(H.b,h);let be=R.mul(k,J),Ce=R.mul(P,ne),Le=R.mul(O,re),Oe=R.add(k,P),T=R.add(J,ne);Oe=R.mul(Oe,T),T=R.add(be,Ce),Oe=R.sub(Oe,T),T=R.add(k,O);let L=R.add(J,re);return T=R.mul(T,L),L=R.add(be,Le),T=R.sub(T,L),L=R.add(P,O),se=R.add(ne,re),L=R.mul(L,se),se=R.add(Ce,Le),L=R.sub(L,se),he=R.mul(Se,T),se=R.mul(ge,Le),he=R.add(se,he),se=R.sub(Ce,he),he=R.add(Ce,he),ce=R.mul(se,he),Ce=R.add(be,be),Ce=R.add(Ce,be),Le=R.mul(Se,Le),T=R.mul(ge,T),Ce=R.add(Ce,Le),Le=R.sub(be,Le),Le=R.mul(Se,Le),T=R.add(T,Le),be=R.mul(Ce,T),ce=R.add(ce,be),be=R.mul(L,T),se=R.mul(Oe,se),se=R.sub(se,be),be=R.mul(Oe,Ce),he=R.mul(L,he),he=R.add(he,be),new y(se,ce,he)}subtract(N){return this.add(N.negate())}is0(){return this.equals(y.ZERO)}wNAF(N){return B.wNAFCached(this,G,N,k=>{const P=R.invertBatch(k.map(O=>O.pz));return k.map((O,J)=>O.toAffine(P[J])).map(y.fromAffine)})}multiplyUnsafe(N){const k=y.ZERO;if(N===l)return k;if(z(N),N===f)return this;const{endo:P}=H;if(!P)return B.unsafeLadder(this,N);let{k1neg:O,k1:J,k2neg:ne,k2:re}=P.splitScalar(N),se=k,ce=k,he=this;for(;J>l||re>l;)J&f&&(se=se.add(he)),re&f&&(ce=ce.add(he)),he=he.double(),J>>=f,re>>=f;return O&&(se=se.negate()),ne&&(ce=ce.negate()),ce=new y(R.mul(ce.px,P.beta),ce.py,ce.pz),se.add(ce)}multiply(N){z(N);let k=N,P,O;const{endo:J}=H;if(J){const{k1neg:ne,k1:re,k2neg:se,k2:ce}=J.splitScalar(k);let{p:he,f:Se}=this.wNAF(re),{p:ge,f:be}=this.wNAF(ce);he=B.constTimeNegate(ne,he),ge=B.constTimeNegate(se,ge),ge=new y(R.mul(ge.px,J.beta),ge.py,ge.pz),P=he.add(ge),O=Se.add(be)}else{const{p:ne,f:re}=this.wNAF(k);P=ne,O=re}return y.normalizeZ([P,O])[0]}multiplyAndAddUnsafe(N,k,P){const O=y.BASE,J=(re,se)=>se===l||se===f||!re.equals(O)?re.multiplyUnsafe(se):re.multiply(se),ne=J(this,k).add(J(N,P));return ne.is0()?void 0:ne}toAffine(N){const{px:k,py:P,pz:O}=this,J=this.is0();N==null&&(N=J?R.ONE:R.inv(O));const ne=R.mul(k,N),re=R.mul(P,N),se=R.mul(O,N);if(J)return{x:R.ZERO,y:R.ZERO};if(!R.eql(se,R.ONE))throw new Error("invZ was invalid");return{x:ne,y:re}}isTorsionFree(){const{h:N,isTorsionFree:k}=H;if(N===f)return!0;if(k)return k(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:N,clearCofactor:k}=H;return N===f?this:k?k(y,this):this.multiplyUnsafe(H.h)}toRawBytes(N=!0){return this.assertValidity(),V(y,this,N)}toHex(N=!0){return r.bytesToHex(this.toRawBytes(N))}}y.BASE=new y(H.Gx,H.Gy,R.ONE),y.ZERO=new y(R.ZERO,R.ONE,R.ZERO);const b=H.nBitLength,B=(0,i.wNAF)(y,H.endo?Math.ceil(b/2):b);return{CURVE:H,ProjectivePoint:y,normPrivateKeyToScalar:C,weierstrassEquation:j,isWithinCurveOrder:ee}}e.weierstrassPoints=p;function v(E){const H=(0,i.validateBasic)(E);return r.validateObject(H,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...H})}function q(E){const H=v(E),{Fp:R,n:V}=H,x=R.BYTES+1,j=2*R.BYTES+1;function ee(T){return l<T&&T<R.ORDER}function z(T){return t.mod(T,V)}function C(T){return t.invert(T,V)}const{ProjectivePoint:G,normPrivateKeyToScalar:_,weierstrassEquation:y,isWithinCurveOrder:b}=p({...H,toBytes(T,L,Z){const ue=L.toAffine(),oe=R.toBytes(ue.x),_e=r.concatBytes;return Z?_e(Uint8Array.from([L.hasEvenY()?2:3]),oe):_e(Uint8Array.from([4]),oe,R.toBytes(ue.y))},fromBytes(T){const L=T.length,Z=T[0],ue=T.subarray(1);if(L===x&&(Z===2||Z===3)){const oe=r.bytesToNumberBE(ue);if(!ee(oe))throw new Error("Point is not on curve");const _e=y(oe);let Ie=R.sqrt(_e);const Be=(Ie&f)===f;return(Z&1)===1!==Be&&(Ie=R.neg(Ie)),{x:oe,y:Ie}}else if(L===j&&Z===4){const oe=R.fromBytes(ue.subarray(0,R.BYTES)),_e=R.fromBytes(ue.subarray(R.BYTES,2*R.BYTES));return{x:oe,y:_e}}else throw new Error(`Point of length ${L} was invalid. Expected ${x} compressed bytes or ${j} uncompressed bytes`)}}),B=T=>r.bytesToHex(r.numberToBytesBE(T,H.nByteLength));function W(T){const L=V>>f;return T>L}function N(T){return W(T)?z(-T):T}const k=(T,L,Z)=>r.bytesToNumberBE(T.slice(L,Z));class P{constructor(L,Z,ue){this.r=L,this.s=Z,this.recovery=ue,this.assertValidity()}static fromCompact(L){const Z=H.nByteLength;return L=(0,n.ensureBytes)("compactSignature",L,Z*2),new P(k(L,0,Z),k(L,Z,2*Z))}static fromDER(L){const{r:Z,s:ue}=e.DER.toSig((0,n.ensureBytes)("DER",L));return new P(Z,ue)}assertValidity(){if(!b(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!b(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(L){return new P(this.r,this.s,L)}recoverPublicKey(L){const{r:Z,s:ue,recovery:oe}=this,_e=ce((0,n.ensureBytes)("msgHash",L));if(oe==null||![0,1,2,3].includes(oe))throw new Error("recovery id invalid");const Ie=oe===2||oe===3?Z+H.n:Z;if(Ie>=R.ORDER)throw new Error("recovery id 2 or 3 invalid");const Be=oe&1?"03":"02",ze=G.fromHex(Be+B(Ie)),Fe=C(Ie),Me=z(-_e*Fe),nt=z(ue*Fe),S=G.BASE.multiplyAndAddUnsafe(ze,Me,nt);if(!S)throw new Error("point at infinify");return S.assertValidity(),S}hasHighS(){return W(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,z(-this.s),this.recovery):this}toDERRawBytes(){return r.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return r.hexToBytes(this.toCompactHex())}toCompactHex(){return B(this.r)+B(this.s)}}const O={isValidPrivateKey(T){try{return _(T),!0}catch{return!1}},normPrivateKeyToScalar:_,randomPrivateKey:()=>{const T=H.randomBytes(R.BYTES+8),L=t.hashToPrivateScalar(T,V);return r.numberToBytesBE(L,H.nByteLength)},precompute(T=8,L=G.BASE){return L._setWindowSize(T),L.multiply(BigInt(3)),L}};function J(T,L=!0){return G.fromPrivateKey(T).toRawBytes(L)}function ne(T){const L=T instanceof Uint8Array,Z=typeof T=="string",ue=(L||Z)&&T.length;return L?ue===x||ue===j:Z?ue===2*x||ue===2*j:T instanceof G}function re(T,L,Z=!0){if(ne(T))throw new Error("first arg must be private key");if(!ne(L))throw new Error("second arg must be public key");return G.fromHex(L).multiply(_(T)).toRawBytes(Z)}const se=H.bits2int||function(T){const L=r.bytesToNumberBE(T),Z=T.length*8-H.nBitLength;return Z>0?L>>BigInt(Z):L},ce=H.bits2int_modN||function(T){return z(se(T))},he=r.bitMask(H.nBitLength);function Se(T){if(typeof T!="bigint")throw new Error("bigint expected");if(!(l<=T&&T<he))throw new Error(`bigint expected < 2^${H.nBitLength}`);return r.numberToBytesBE(T,H.nByteLength)}function ge(T,L,Z=be){if(["recovered","canonical"].some(de=>de in Z))throw new Error("sign() legacy options not supported");const{hash:ue,randomBytes:oe}=H;let{lowS:_e,prehash:Ie,extraEntropy:Be}=Z;_e==null&&(_e=!0),T=(0,n.ensureBytes)("msgHash",T),Ie&&(T=(0,n.ensureBytes)("prehashed msgHash",ue(T)));const ze=ce(T),Fe=_(L),Me=[Se(Fe),Se(ze)];if(Be!=null){const de=Be===!0?oe(R.BYTES):Be;Me.push((0,n.ensureBytes)("extraEntropy",de,R.BYTES))}const nt=r.concatBytes(...Me),S=ze;function I(de){const ae=se(de);if(!b(ae))return;const pe=C(ae),je=G.BASE.multiply(ae).toAffine(),w=z(je.x);if(w===l)return;const ie=z(pe*z(S+w*Fe));if(ie===l)return;let fe=(je.x===w?0:2)|Number(je.y&f),we=ie;return _e&&W(ie)&&(we=N(ie),fe^=1),new P(w,we,fe)}return{seed:nt,k2sig:I}}const be={lowS:H.lowS,prehash:!1},Ce={lowS:H.lowS,prehash:!1};function Le(T,L,Z=be){const{seed:ue,k2sig:oe}=ge(T,L,Z),_e=H;return r.createHmacDrbg(_e.hash.outputLen,_e.nByteLength,_e.hmac)(ue,oe)}G.BASE._setWindowSize(8);function Oe(T,L,Z,ue=Ce){var je;const oe=T;if(L=(0,n.ensureBytes)("msgHash",L),Z=(0,n.ensureBytes)("publicKey",Z),"strict"in ue)throw new Error("options.strict was renamed to lowS");const{lowS:_e,prehash:Ie}=ue;let Be,ze;try{if(typeof oe=="string"||oe instanceof Uint8Array)try{Be=P.fromDER(oe)}catch(w){if(!(w instanceof e.DER.Err))throw w;Be=P.fromCompact(oe)}else if(typeof oe=="object"&&typeof oe.r=="bigint"&&typeof oe.s=="bigint"){const{r:w,s:ie}=oe;Be=new P(w,ie)}else throw new Error("PARSE");ze=G.fromHex(Z)}catch(w){if(w.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(_e&&Be.hasHighS())return!1;Ie&&(L=H.hash(L));const{r:Fe,s:Me}=Be,nt=ce(L),S=C(Me),I=z(nt*S),de=z(Fe*S),ae=(je=G.BASE.multiplyAndAddUnsafe(ze,I,de))==null?void 0:je.toAffine();return ae?z(ae.x)===Fe:!1}return{CURVE:H,getPublicKey:J,getSharedSecret:re,sign:Le,verify:Oe,ProjectivePoint:G,Signature:P,utils:O}}e.weierstrass=q;function M(E,H){const R=E.ORDER;let V=l;for(let W=R-f;W%c===l;W/=c)V+=f;const x=V,j=c<<x-f-f,ee=j*c,z=(R-f)/ee,C=(z-f)/c,G=ee-f,_=j,y=E.pow(H,z),b=E.pow(H,(z+f)/c);let B=(W,N)=>{let k=y,P=E.pow(N,G),O=E.sqr(P);O=E.mul(O,N);let J=E.mul(W,O);J=E.pow(J,C),J=E.mul(J,P),P=E.mul(J,N),O=E.mul(J,W);let ne=E.mul(O,P);J=E.pow(ne,_);let re=E.eql(J,E.ONE);P=E.mul(O,b),J=E.mul(ne,k),O=E.cmov(P,O,re),ne=E.cmov(J,ne,re);for(let se=x;se>f;se--){let ce=se-c;ce=c<<ce-f;let he=E.pow(ne,ce);const Se=E.eql(he,E.ONE);P=E.mul(O,k),k=E.mul(k,k),he=E.mul(ne,k),O=E.cmov(P,O,Se),ne=E.cmov(he,ne,Se)}return{isValid:re,value:O}};if(E.ORDER%m===h){const W=(E.ORDER-h)/m,N=E.sqrt(E.neg(H));B=(k,P)=>{let O=E.sqr(P);const J=E.mul(k,P);O=E.mul(O,J);let ne=E.pow(O,W);ne=E.mul(ne,J);const re=E.mul(ne,N),se=E.mul(E.sqr(ne),P),ce=E.eql(se,k);let he=E.cmov(re,ne,ce);return{isValid:ce,value:he}}}return B}e.SWUFpSqrtRatio=M;function D(E,H){if(t.validateField(E),!E.isValid(H.A)||!E.isValid(H.B)||!E.isValid(H.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const R=M(E,H.Z);if(!E.isOdd)throw new Error("Fp.isOdd is not implemented!");return V=>{let x,j,ee,z,C,G,_,y;x=E.sqr(V),x=E.mul(x,H.Z),j=E.sqr(x),j=E.add(j,x),ee=E.add(j,E.ONE),ee=E.mul(ee,H.B),z=E.cmov(H.Z,E.neg(j),!E.eql(j,E.ZERO)),z=E.mul(z,H.A),j=E.sqr(ee),G=E.sqr(z),C=E.mul(G,H.A),j=E.add(j,C),j=E.mul(j,ee),G=E.mul(G,z),C=E.mul(G,H.B),j=E.add(j,C),_=E.mul(x,ee);const{isValid:b,value:B}=R(j,G);y=E.mul(x,V),y=E.mul(y,B),_=E.cmov(_,ee,b),y=E.cmov(y,B,b);const W=E.isOdd(V)===E.isOdd(y);return y=E.cmov(E.neg(y),y,W),_=E.div(_,z),{x:_,y}}}e.mapToCurveSimpleSWU=D})(pa);var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.createHasher=Pt.isogenyMap=Pt.hash_to_field=Pt.expand_message_xof=Pt.expand_message_xmd=void 0;const hm=Pe,Ut=Ne;function gm(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return(0,Ut.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}const _m=Ut.bytesToNumberBE;function br(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=e&255,e>>>=8;return new Uint8Array(r)}function bm(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function $n(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected")}function ya(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function Bc(e,t,r,n){$n(e),$n(t),ya(r),t.length>255&&(t=n((0,Ut.concatBytes)((0,Ut.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:i,blockLen:o}=n,s=Math.ceil(r/i);if(s>255)throw new Error("Invalid xmd length");const u=(0,Ut.concatBytes)(t,br(t.length,1)),l=br(0,o),f=br(r,2),c=new Array(s),h=n((0,Ut.concatBytes)(l,e,f,br(0,1),u));c[0]=n((0,Ut.concatBytes)(h,br(1,1),u));for(let p=1;p<=s;p++){const v=[bm(h,c[p-1]),br(p+1,1),u];c[p]=n((0,Ut.concatBytes)(...v))}return(0,Ut.concatBytes)(...c).slice(0,r)}Pt.expand_message_xmd=Bc;function $c(e,t,r,n,i){if($n(e),$n(t),ya(r),t.length>255){const o=Math.ceil(2*n/8);t=i.create({dkLen:o}).update((0,Ut.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(e).update(br(r,2)).update(t).update(br(t.length,1)).digest()}Pt.expand_message_xof=$c;function Ts(e,t,r){(0,Ut.validateObject)(r,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:n,k:i,m:o,hash:s,expand:u,DST:l}=r;$n(e),ya(t);const f=gm(l),c=n.toString(2).length,h=Math.ceil((c+i)/8),m=t*o*h;let p;if(u==="xmd")p=Bc(e,f,m,s);else if(u==="xof")p=$c(e,f,m,i,s);else if(u==="_internal_pass")p=e;else throw new Error('expand must be "xmd" or "xof"');const v=new Array(t);for(let q=0;q<t;q++){const M=new Array(o);for(let D=0;D<o;D++){const E=h*(D+q*o),H=p.subarray(E,E+h);M[D]=(0,hm.mod)(_m(H),n)}v[q]=M}return v}Pt.hash_to_field=Ts;function pm(e,t){const r=t.map(n=>Array.from(n).reverse());return(n,i)=>{const[o,s,u,l]=r.map(f=>f.reduce((c,h)=>e.add(e.mul(c,n),h)));return n=e.div(o,s),i=e.mul(i,e.div(u,l)),{x:n,y:i}}}Pt.isogenyMap=pm;function ym(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=Ts(n,2,{...r,DST:r.DST,...i}),s=e.fromAffine(t(o[0])),u=e.fromAffine(t(o[1])),l=s.add(u).clearCofactor();return l.assertValidity(),l},encodeToCurve(n,i){const o=Ts(n,1,{...r,DST:r.encodeDST,...i}),s=e.fromAffine(t(o[0])).clearCofactor();return s.assertValidity(),s}}}Pt.createHasher=ym;var on={},xc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=ft,r=ur;class n extends r.Hash{constructor(s,u){super(),this.finished=!1,this.destroyed=!1,t.default.hash(s);const l=(0,r.toBytes)(u);if(this.iHash=s.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const f=this.blockLen,c=new Uint8Array(f);c.set(l.length>f?s.create().update(l).digest():l);for(let h=0;h<c.length;h++)c[h]^=54;this.iHash.update(c),this.oHash=s.create();for(let h=0;h<c.length;h++)c[h]^=106;this.oHash.update(c),c.fill(0)}update(s){return t.default.exists(this),this.iHash.update(s),this}digestInto(s){t.default.exists(this),t.default.bytes(s,this.outputLen),this.finished=!0,this.iHash.digestInto(s),this.oHash.update(s),this.oHash.digestInto(s),this.destroy()}digest(){const s=new Uint8Array(this.oHash.outputLen);return this.digestInto(s),s}_cloneInto(s){s||(s=Object.create(Object.getPrototypeOf(this),{}));const{oHash:u,iHash:l,finished:f,destroyed:c,blockLen:h,outputLen:m}=this;return s=s,s.finished=f,s.destroyed=c,s.blockLen=h,s.outputLen=m,s.oHash=u._cloneInto(s.oHash),s.iHash=l._cloneInto(s.iHash),s}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n;const i=(o,s,u)=>new n(o,s).update(u).digest();e.hmac=i,e.hmac.create=(o,s)=>new n(o,s)})(xc);Object.defineProperty(on,"__esModule",{value:!0});on.createCurve=on.getHash=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wm=xc,af=ur,mm=pa;function kc(e){return{hash:e,hmac:(t,...r)=>(0,wm.hmac)(e,t,(0,af.concatBytes)(...r)),randomBytes:af.randomBytes}}on.getHash=kc;function Em(e,t){const r=n=>(0,mm.weierstrass)({...e,...kc(n)});return Object.freeze({...r(t),create:r})}on.createCurve=Em;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=rn,r=ur,n=Pe,i=pa,o=Ne,s=Pt,u=on,l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),f=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),c=BigInt(1),h=BigInt(2),m=(P,O)=>(P+O/h)/O;function p(P){const O=l,J=BigInt(3),ne=BigInt(6),re=BigInt(11),se=BigInt(22),ce=BigInt(23),he=BigInt(44),Se=BigInt(88),ge=P*P*P%O,be=ge*ge*P%O,Ce=(0,n.pow2)(be,J,O)*be%O,Le=(0,n.pow2)(Ce,J,O)*be%O,Oe=(0,n.pow2)(Le,h,O)*ge%O,T=(0,n.pow2)(Oe,re,O)*Oe%O,L=(0,n.pow2)(T,se,O)*T%O,Z=(0,n.pow2)(L,he,O)*L%O,ue=(0,n.pow2)(Z,Se,O)*Z%O,oe=(0,n.pow2)(ue,he,O)*L%O,_e=(0,n.pow2)(oe,J,O)*be%O,Ie=(0,n.pow2)(_e,ce,O)*T%O,Be=(0,n.pow2)(Ie,ne,O)*ge%O,ze=(0,n.pow2)(Be,h,O);if(!v.eql(v.sqr(ze),P))throw new Error("Cannot find square root");return ze}const v=(0,n.Field)(l,void 0,void 0,{sqrt:p});e.secp256k1=(0,u.createCurve)({a:BigInt(0),b:BigInt(7),Fp:v,n:f,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:P=>{const O=f,J=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),ne=-c*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),re=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),se=J,ce=BigInt("0x100000000000000000000000000000000"),he=m(se*P,O),Se=m(-ne*P,O);let ge=(0,n.mod)(P-he*J-Se*re,O),be=(0,n.mod)(-he*ne-Se*se,O);const Ce=ge>ce,Le=be>ce;if(Ce&&(ge=O-ge),Le&&(be=O-be),ge>ce||be>ce)throw new Error("splitScalar: Endomorphism failed, k="+P);return{k1neg:Ce,k1:ge,k2neg:Le,k2:be}}}},t.sha256);const q=BigInt(0),M=P=>typeof P=="bigint"&&q<P&&P<l,D=P=>typeof P=="bigint"&&q<P&&P<f,E={};function H(P,...O){let J=E[P];if(J===void 0){const ne=(0,t.sha256)(Uint8Array.from(P,re=>re.charCodeAt(0)));J=(0,o.concatBytes)(ne,ne),E[P]=J}return(0,t.sha256)((0,o.concatBytes)(J,...O))}const R=P=>P.toRawBytes(!0).slice(1),V=P=>(0,o.numberToBytesBE)(P,32),x=P=>(0,n.mod)(P,l),j=P=>(0,n.mod)(P,f),ee=e.secp256k1.ProjectivePoint,z=(P,O,J)=>ee.BASE.multiplyAndAddUnsafe(P,O,J);function C(P){let O=e.secp256k1.utils.normPrivateKeyToScalar(P),J=ee.fromPrivateKey(O);return{scalar:J.hasEvenY()?O:j(-O),bytes:R(J)}}function G(P){if(!M(P))throw new Error("bad x: need 0 < x < p");const O=x(P*P),J=x(O*P+BigInt(7));let ne=p(J);ne%h!==q&&(ne=x(-ne));const re=new ee(P,ne,c);return re.assertValidity(),re}function _(...P){return j((0,o.bytesToNumberBE)(H("BIP0340/challenge",...P)))}function y(P){return C(P).bytes}function b(P,O,J=(0,r.randomBytes)(32)){const ne=(0,o.ensureBytes)("message",P),{bytes:re,scalar:se}=C(O),ce=(0,o.ensureBytes)("auxRand",J,32),he=V(se^(0,o.bytesToNumberBE)(H("BIP0340/aux",ce))),Se=H("BIP0340/nonce",he,re,ne),ge=j((0,o.bytesToNumberBE)(Se));if(ge===q)throw new Error("sign failed: k is zero");const{bytes:be,scalar:Ce}=C(ge),Le=_(be,re,ne),Oe=new Uint8Array(64);if(Oe.set(be,0),Oe.set(V(j(Ce+Le*se)),32),!B(Oe,ne,re))throw new Error("sign: Invalid signature produced");return Oe}function B(P,O,J){const ne=(0,o.ensureBytes)("signature",P,64),re=(0,o.ensureBytes)("message",O),se=(0,o.ensureBytes)("publicKey",J,32);try{const ce=G((0,o.bytesToNumberBE)(se)),he=(0,o.bytesToNumberBE)(ne.subarray(0,32));if(!M(he))return!1;const Se=(0,o.bytesToNumberBE)(ne.subarray(32,64));if(!D(Se))return!1;const ge=_(V(he),R(ce),re),be=z(ce,Se,j(-ge));return!(!be||!be.hasEvenY()||be.toAffine().x!==he)}catch{return!1}}e.schnorr={getPublicKey:y,sign:b,verify:B,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:G,pointToBytes:R,numberToBytesBE:o.numberToBytesBE,bytesToNumberBE:o.bytesToNumberBE,taggedHash:H,mod:n.mod}};const W=(0,s.isogenyMap)(v,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(P=>P.map(O=>BigInt(O)))),N=(0,i.mapToCurveSimpleSWU)(v,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:v.create(BigInt("-11"))}),k=(0,s.createHasher)(e.secp256k1.ProjectivePoint,P=>{const{x:O,y:J}=N(v.create(P[0]));return W(O,J)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:v.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=k.hashToCurve,e.encodeToCurve=k.encodeToCurve})(yc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=yc;Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})})(zi);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_WITHDRAWALS_PER_PAYLOAD=e.RLP_EMPTY_STRING=e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.SECP256K1_ORDER_DIV_2=e.SECP256K1_ORDER=e.MAX_INTEGER_BIGINT=e.MAX_INTEGER=e.MAX_UINT64=void 0;const t=er,r=zi;e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=r.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=r.secp256k1.CURVE.n/BigInt(2),e.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=t.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=t.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=t.Buffer.from(e.KECCAK256_RLP_S,"hex"),e.RLP_EMPTY_STRING=t.Buffer.from([128]),e.MAX_WITHDRAWALS_PER_PAYLOAD=16})(Hi);var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.GWEI_TO_WEI=void 0;Ki.GWEI_TO_WEI=BigInt(1e9);var wa={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.RLP=Jt.utils=Jt.decode=Jt.encode=void 0;function ma(e){if(Array.isArray(e)){const r=[];let n=0;for(let i=0;i<e.length;i++){const o=ma(e[i]);r.push(o),n+=o.length}return Cs(ff(n,192),...r)}const t=Hc(e);return t.length===1&&t[0]<128?t:Cs(ff(t.length,128),t)}Jt.encode=ma;function Vr(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function lf(e){if(e[0]===0)throw new Error("invalid RLP: extra zeros");return jc(Mc(e))}function ff(e,t){if(e<56)return Uint8Array.from([e+t]);const r=Ls(e),n=r.length/2,i=Ls(t+55+n);return Uint8Array.from(bi(i+r))}function Dc(e,t=!1){if(typeof e>"u"||e===null||e.length===0)return Uint8Array.from([]);const r=Hc(e),n=Os(r);if(t)return n;if(n.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return n.data}Jt.decode=Dc;function Os(e){let t,r,n,i,o;const s=[],u=e[0];if(u<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(u<=183){if(t=u-127,u===128?n=Uint8Array.from([]):n=Vr(e,1,t),t===2&&n[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:n,remainder:e.slice(t)}}else if(u<=191){if(r=u-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=lf(Vr(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return n=Vr(e,r,t+r),{data:n,remainder:e.slice(t+r)}}else if(u<=247){for(t=u-191,i=Vr(e,1,t);i.length;)o=Os(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.slice(t)}}else{if(r=u-246,t=lf(Vr(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const l=r+t;if(l>e.length)throw new Error("invalid RLP: total length is larger than the data");for(i=Vr(e,r,l);i.length;)o=Os(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.slice(l)}}}const vm=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Mc(e){let t="";for(let r=0;r<e.length;r++)t+=vm[e[r]];return t}function jc(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function bi(e){if(typeof e!="string")throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=r*2;t[r]=jc(e.slice(n,n+2))}return t}function Cs(...e){if(e.length===1)return e[0];const t=e.reduce((n,i)=>n+i.length,0),r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){const o=e[n];r.set(o,i),i+=o.length}return r}function Uc(e){return new TextEncoder().encode(e)}function Ls(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function Sm(e){return e.length%2?`0${e}`:e}function Fc(e){return e.length>=2&&e[0]==="0"&&e[1]==="x"}function Rm(e){return typeof e!="string"?e:Fc(e)?e.slice(2):e}function Hc(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return Fc(e)?bi(Sm(Rm(e))):Uc(e);if(typeof e=="number"||typeof e=="bigint")return e?bi(Ls(e)):Uint8Array.from([]);if(e==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}Jt.utils={bytesToHex:Mc,concatBytes:Cs,hexToBytes:bi,utf8ToBytes:Uc};Jt.RLP={encode:ma,decode:Dc};var Ft={},qe={},zc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.add=e.toBig=e.split=e.fromBig=void 0;const t=BigInt(2**32-1),r=BigInt(32);function n(C,G=!1){return G?{h:Number(C&t),l:Number(C>>r&t)}:{h:Number(C>>r&t)|0,l:Number(C&t)|0}}e.fromBig=n;function i(C,G=!1){let _=new Uint32Array(C.length),y=new Uint32Array(C.length);for(let b=0;b<C.length;b++){const{h:B,l:W}=n(C[b],G);[_[b],y[b]]=[B,W]}return[_,y]}e.split=i;const o=(C,G)=>BigInt(C>>>0)<<r|BigInt(G>>>0);e.toBig=o;const s=(C,G,_)=>C>>>_,u=(C,G,_)=>C<<32-_|G>>>_,l=(C,G,_)=>C>>>_|G<<32-_,f=(C,G,_)=>C<<32-_|G>>>_,c=(C,G,_)=>C<<64-_|G>>>_-32,h=(C,G,_)=>C>>>_-32|G<<64-_,m=(C,G)=>G,p=(C,G)=>C,v=(C,G,_)=>C<<_|G>>>32-_,q=(C,G,_)=>G<<_|C>>>32-_,M=(C,G,_)=>G<<_-32|C>>>64-_,D=(C,G,_)=>C<<_-32|G>>>64-_;function E(C,G,_,y){const b=(G>>>0)+(y>>>0);return{h:C+_+(b/2**32|0)|0,l:b|0}}e.add=E;const H=(C,G,_)=>(C>>>0)+(G>>>0)+(_>>>0),R=(C,G,_,y)=>G+_+y+(C/2**32|0)|0,V=(C,G,_,y)=>(C>>>0)+(G>>>0)+(_>>>0)+(y>>>0),x=(C,G,_,y,b)=>G+_+y+b+(C/2**32|0)|0,j=(C,G,_,y,b)=>(C>>>0)+(G>>>0)+(_>>>0)+(y>>>0)+(b>>>0),ee=(C,G,_,y,b,B)=>G+_+y+b+B+(C/2**32|0)|0,z={fromBig:n,split:i,toBig:e.toBig,shrSH:s,shrSL:u,rotrSH:l,rotrSL:f,rotrBH:c,rotrBL:h,rotr32H:m,rotr32L:p,rotlSH:v,rotlSL:q,rotlBH:M,rotlBL:D,add:E,add3L:H,add3H:R,add4L:V,add4H:x,add5H:ee,add5L:j};e.default=z})(zc);Object.defineProperty(qe,"__esModule",{value:!0});qe.shake256=qe.shake128=qe.keccak_512=qe.keccak_384=qe.keccak_256=qe.keccak_224=qe.sha3_512=qe.sha3_384=qe.sha3_256=qe.sha3_224=qe.Keccak=qe.keccakP=void 0;const qr=ft,xn=zc,On=ur,[Wc,Vc,qc]=[[],[],[]],Am=BigInt(0),mn=BigInt(1),Im=BigInt(2),Tm=BigInt(7),Om=BigInt(256),Cm=BigInt(113);for(let e=0,t=mn,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Wc.push(2*(5*n+r)),Vc.push((e+1)*(e+2)/2%64);let i=Am;for(let o=0;o<7;o++)t=(t<<mn^(t>>Tm)*Cm)%Om,t&Im&&(i^=mn<<(mn<<BigInt(o))-mn);qc.push(i)}const[Lm,Nm]=xn.default.split(qc,!0),uf=(e,t,r)=>r>32?xn.default.rotlBH(e,t,r):xn.default.rotlSH(e,t,r),cf=(e,t,r)=>r>32?xn.default.rotlBL(e,t,r):xn.default.rotlSL(e,t,r);function Gc(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){const u=(s+8)%10,l=(s+2)%10,f=r[l],c=r[l+1],h=uf(f,c,1)^r[u],m=cf(f,c,1)^r[u+1];for(let p=0;p<50;p+=10)e[s+p]^=h,e[s+p+1]^=m}let i=e[2],o=e[3];for(let s=0;s<24;s++){const u=Vc[s],l=uf(i,o,u),f=cf(i,o,u),c=Wc[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=f}for(let s=0;s<50;s+=10){for(let u=0;u<10;u++)r[u]=e[s+u];for(let u=0;u<10;u++)e[s+u]^=~r[(u+2)%10]&r[(u+4)%10]}e[0]^=Lm[n],e[1]^=Nm[n]}r.fill(0)}qe.keccakP=Gc;class Hn extends On.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,qr.default.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,On.u32)(this.state)}keccak(){Gc(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){qr.default.exists(this);const{blockLen:r,state:n}=this;t=(0,On.toBytes)(t);const i=t.length;for(let o=0;o<i;){const s=Math.min(r-this.pos,i-o);for(let u=0;u<s;u++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,r&128&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){qr.default.exists(this,!1),qr.default.bytes(t),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return qr.default.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(qr.default.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new Hn(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}}qe.Keccak=Hn;const Sr=(e,t,r)=>(0,On.wrapConstructor)(()=>new Hn(t,e,r));qe.sha3_224=Sr(6,144,224/8);qe.sha3_256=Sr(6,136,256/8);qe.sha3_384=Sr(6,104,384/8);qe.sha3_512=Sr(6,72,512/8);qe.keccak_224=Sr(1,144,224/8);qe.keccak_256=Sr(1,136,256/8);qe.keccak_384=Sr(1,104,384/8);qe.keccak_512=Sr(1,72,512/8);const Zc=(e,t,r)=>(0,On.wrapXOFConstructorWithOpts)((n={})=>new Hn(t,e,n.dkLen===void 0?r:n.dkLen,!0));qe.shake128=Zc(31,168,128/8);qe.shake256=Zc(31,136,256/8);var pi={exports:{}};pi.exports;(function(e,t){var r=Ye&&Ye.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.wrapHash=t.equalsBytes=t.hexToBytes=t.bytesToUtf8=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0;const n=r(ft),i=ur,o=n.default.bool;t.assertBool=o;const s=n.default.bytes;t.assertBytes=s;var u=ur;Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return u.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return u.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return u.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return u.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return u.utf8ToBytes}});function l(m){if(!(m instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof m}`);return new TextDecoder().decode(m)}t.bytesToUtf8=l;function f(m){const p=m.startsWith("0x")?m.substring(2):m;return(0,i.hexToBytes)(p)}t.hexToBytes=f;function c(m,p){if(m.length!==p.length)return!1;for(let v=0;v<m.length;v++)if(m[v]!==p[v])return!1;return!0}t.equalsBytes=c;function h(m){return p=>(n.default.bytes(p),m(p))}t.wrapHash=h,t.crypto=(()=>{const m=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,p=typeof Da=="function"&&Da.bind(e);return{node:p&&!m?p("crypto"):void 0,web:m}})()})(pi,pi.exports);var Kc=pi.exports;Object.defineProperty(Ft,"__esModule",{value:!0});Ft.keccak512=Ft.keccak384=Ft.keccak256=Ft.keccak224=void 0;const kn=qe,Ji=Kc;Ft.keccak224=(0,Ji.wrapHash)(kn.keccak_224);Ft.keccak256=(()=>{const e=(0,Ji.wrapHash)(kn.keccak_256);return e.create=kn.keccak_256.create,e})();Ft.keccak384=(0,Ji.wrapHash)(kn.keccak_384);Ft.keccak512=(0,Ji.wrapHash)(kn.keccak_512);var Fr={},Bt={},Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.isHexString=Ge.getKeys=Ge.fromAscii=Ge.fromUtf8=Ge.toAscii=Ge.arrayContainsArray=Ge.getBinarySize=Ge.padToEven=Ge.stripHexPrefix=Ge.isHexPrefixed=void 0;function Jc(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}Ge.isHexPrefixed=Jc;const Pm=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return Jc(e)?e.slice(2):e};Ge.stripHexPrefix=Pm;function Xc(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}Ge.padToEven=Xc;function Bm(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return ye.Buffer.byteLength(e,"utf8")}Ge.getBinarySize=Bm;function $m(e,t,r){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[r===!0?"some":"every"](n=>e.indexOf(n)>=0)}Ge.arrayContainsArray=$m;function xm(e){let t="",r=0;const n=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<n;r+=2){const i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t}Ge.toAscii=xm;function km(e){const t=ye.Buffer.from(e,"utf8");return`0x${Xc(t.toString("hex")).replace(/^0+|0+$/g,"")}`}Ge.fromUtf8=km;function Dm(e){let t="";for(let r=0;r<e.length;r++){const i=e.charCodeAt(r).toString(16);t+=i.length<2?`0${i}`:i}return`0x${t}`}Ge.fromAscii=Dm;function Mm(e,t,r){if(!Array.isArray(e))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof e}`);if(typeof t!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof e}`);const n=[];for(let i=0;i<e.length;i++){let o=e[i][t];if(r===!0&&!o)o="";else if(typeof o!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof o}`);n.push(o)}return n}Ge.getKeys=Mm;function jm(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t<"u"&&t>0&&e.length!==2+2*t)}Ge.isHexString=jm;Object.defineProperty(Bt,"__esModule",{value:!0});Bt.assertIsString=Bt.assertIsArray=Bt.assertIsBuffer=Bt.assertIsHexString=void 0;const Um=Ge,Fm=function(e){if(!(0,Um.isHexString)(e)){const t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}};Bt.assertIsHexString=Fm;const Hm=function(e){if(!ye.Buffer.isBuffer(e)){const t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};Bt.assertIsBuffer=Hm;const zm=function(e){if(!Array.isArray(e)){const t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}};Bt.assertIsArray=zm;const Wm=function(e){if(typeof e!="string"){const t=`This method only supports strings but input was: ${e}`;throw new Error(t)}};Bt.assertIsString=Wm;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intToUnpaddedBuffer=e.bigIntToUnpaddedBuffer=e.bigIntToHex=e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.short=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToInt=e.bigIntToBuffer=e.bufferToBigInt=e.bufferToHex=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;const t=Bt,r=Ge,n=function(b){if(!Number.isSafeInteger(b)||b<0)throw new Error(`Received an invalid integer type: ${b}`);return`0x${b.toString(16)}`};e.intToHex=n;const i=function(b){const B=(0,e.intToHex)(b);return ye.Buffer.from((0,r.padToEven)(B.slice(2)),"hex")};e.intToBuffer=i;const o=function(b){return ye.Buffer.allocUnsafe(b).fill(0)};e.zeros=o;const s=function(b,B,W){const N=(0,e.zeros)(B);return W?b.length<B?(b.copy(N),N):b.slice(0,B):b.length<B?(b.copy(N,B-b.length),N):b.slice(-B)},u=function(b,B){return(0,t.assertIsBuffer)(b),s(b,B,!1)};e.setLengthLeft=u;const l=function(b,B){return(0,t.assertIsBuffer)(b),s(b,B,!0)};e.setLengthRight=l;const f=function(b){let B=b[0];for(;b.length>0&&B.toString()==="0";)b=b.slice(1),B=b[0];return b},c=function(b){return(0,t.assertIsBuffer)(b),f(b)};e.unpadBuffer=c;const h=function(b){return(0,t.assertIsArray)(b),f(b)};e.unpadArray=h;const m=function(b){return(0,t.assertIsHexString)(b),b=(0,r.stripHexPrefix)(b),"0x"+f(b)};e.unpadHexString=m;const p=function(b){if(b==null)return ye.Buffer.allocUnsafe(0);if(ye.Buffer.isBuffer(b))return ye.Buffer.from(b);if(Array.isArray(b)||b instanceof Uint8Array)return ye.Buffer.from(b);if(typeof b=="string"){if(!(0,r.isHexString)(b))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${b}`);return ye.Buffer.from((0,r.padToEven)((0,r.stripHexPrefix)(b)),"hex")}if(typeof b=="number")return(0,e.intToBuffer)(b);if(typeof b=="bigint"){if(b<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${b}`);let B=b.toString(16);return B.length%2&&(B="0"+B),ye.Buffer.from(B,"hex")}if(b.toArray)return ye.Buffer.from(b.toArray());if(b.toBuffer)return ye.Buffer.from(b.toBuffer());throw new Error("invalid type")};e.toBuffer=p;const v=function(b){return b=(0,e.toBuffer)(b),"0x"+b.toString("hex")};e.bufferToHex=v;function q(b){const B=(0,e.bufferToHex)(b);return BigInt(B==="0x"?0:B)}e.bufferToBigInt=q;function M(b){return(0,e.toBuffer)("0x"+b.toString(16))}e.bigIntToBuffer=M;const D=function(b){const B=Number(q(b));if(!Number.isSafeInteger(B))throw new Error("Number exceeds 53 bits");return B};e.bufferToInt=D;const E=function(b){return BigInt.asIntN(256,q(b))};e.fromSigned=E;const H=function(b){return M(BigInt.asUintN(256,b))};e.toUnsigned=H;const R=function(b){return typeof b!="string"||(0,r.isHexPrefixed)(b)?b:"0x"+b};e.addHexPrefix=R;function V(b,B=50){const W=ye.Buffer.isBuffer(b)?b.toString("hex"):b;return W.length<=B?W:W.slice(0,B)+"…"}e.short=V;const x=function(b){const B=/^(00)+|(00)+$/g;if(b=(0,r.stripHexPrefix)(b),b.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return ye.Buffer.from(b.replace(B,""),"hex").toString("utf8")};e.toUtf8=x;const j=function(b){if(ye.Buffer.isBuffer(b))return`0x${b.toString("hex")}`;if(b instanceof Array){const B=[];for(let W=0;W<b.length;W++)B.push((0,e.baToJSON)(b[W]));return B}};e.baToJSON=j;const ee=function(b){for(const[B,W]of Object.entries(b))if(W!==void 0&&W.length>0&&W[0]===0)throw new Error(`${B} cannot have leading zeroes, received: ${W.toString("hex")}`)};e.validateNoLeadingZeroes=ee;function z(b){return Array.isArray(b)?b.map(B=>z(B)):ye.Buffer.from(b)}e.arrToBufArr=z;function C(b){return Array.isArray(b)?b.map(B=>C(B)):Uint8Array.from(b??[])}e.bufArrToArr=C;const G=b=>"0x"+b.toString(16);e.bigIntToHex=G;function _(b){return(0,e.unpadBuffer)(M(b))}e.bigIntToUnpaddedBuffer=_;function y(b){return(0,e.unpadBuffer)((0,e.intToBuffer)(b))}e.intToUnpaddedBuffer=y})(Fr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.accountBodyToRLP=e.accountBodyToSlim=e.accountBodyFromSlim=e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const t=Jt,r=Ft,n=zi,i=Kc,o=Fr,s=Hi,u=Bt,l=Ge,f=BigInt(0);class c{constructor(y=f,b=f,B=s.KECCAK256_RLP,W=s.KECCAK256_NULL){this.nonce=y,this.balance=b,this.storageRoot=B,this.codeHash=W,this._validate()}static fromAccountData(y){const{nonce:b,balance:B,storageRoot:W,codeHash:N}=y;return new c(b!==void 0?(0,o.bufferToBigInt)((0,o.toBuffer)(b)):void 0,B!==void 0?(0,o.bufferToBigInt)((0,o.toBuffer)(B)):void 0,W!==void 0?(0,o.toBuffer)(W):void 0,N!==void 0?(0,o.toBuffer)(N):void 0)}static fromRlpSerializedAccount(y){const b=(0,o.arrToBufArr)(t.RLP.decode(Uint8Array.from(y)));if(!Array.isArray(b))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(b)}static fromValuesArray(y){const[b,B,W,N]=y;return new c((0,o.bufferToBigInt)(b),(0,o.bufferToBigInt)(B),W,N)}_validate(){if(this.nonce<f)throw new Error("nonce must be greater than zero");if(this.balance<f)throw new Error("balance must be greater than zero");if(this.storageRoot.length!==32)throw new Error("storageRoot must have a length of 32");if(this.codeHash.length!==32)throw new Error("codeHash must have a length of 32")}raw(){return[(0,o.bigIntToUnpaddedBuffer)(this.nonce),(0,o.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return ye.Buffer.from(t.RLP.encode((0,o.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(s.KECCAK256_NULL)}isEmpty(){return this.balance===f&&this.nonce===f&&this.codeHash.equals(s.KECCAK256_NULL)}}e.Account=c;const h=function(_){try{(0,u.assertIsString)(_)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(_)};e.isValidAddress=h;const m=function(_,y){(0,u.assertIsHexString)(_);const b=(0,l.stripHexPrefix)(_).toLowerCase();let B="";y!==void 0&&(B=(0,o.bufferToBigInt)((0,o.toBuffer)(y)).toString()+"0x");const W=ye.Buffer.from(B+b,"utf8"),N=(0,i.bytesToHex)((0,r.keccak256)(W));let k="0x";for(let P=0;P<b.length;P++)parseInt(N[P],16)>=8?k+=b[P].toUpperCase():k+=b[P];return k};e.toChecksumAddress=m;const p=function(_,y){return(0,e.isValidAddress)(_)&&(0,e.toChecksumAddress)(_,y)===_};e.isValidChecksumAddress=p;const v=function(_,y){return(0,u.assertIsBuffer)(_),(0,u.assertIsBuffer)(y),(0,o.bufferToBigInt)(y)===BigInt(0)?ye.Buffer.from((0,r.keccak256)(t.RLP.encode((0,o.bufArrToArr)([_,null])))).slice(-20):ye.Buffer.from((0,r.keccak256)(t.RLP.encode((0,o.bufArrToArr)([_,y])))).slice(-20)};e.generateAddress=v;const q=function(_,y,b){if((0,u.assertIsBuffer)(_),(0,u.assertIsBuffer)(y),(0,u.assertIsBuffer)(b),_.length!==20)throw new Error("Expected from to be of length 20");if(y.length!==32)throw new Error("Expected salt to be of length 32");const B=(0,r.keccak256)(ye.Buffer.concat([ye.Buffer.from("ff","hex"),_,y,(0,r.keccak256)(b)]));return(0,o.toBuffer)(B).slice(-20)};e.generateAddress2=q;const M=function(_){return n.secp256k1.utils.isValidPrivateKey(_)};e.isValidPrivate=M;const D=function(_,y=!1){if((0,u.assertIsBuffer)(_),_.length===64)try{return n.secp256k1.ProjectivePoint.fromHex(ye.Buffer.concat([ye.Buffer.from([4]),_])),!0}catch{return!1}if(!y)return!1;try{return n.secp256k1.ProjectivePoint.fromHex(_),!0}catch{return!1}};e.isValidPublic=D;const E=function(_,y=!1){if((0,u.assertIsBuffer)(_),y&&_.length!==64&&(_=ye.Buffer.from(n.secp256k1.ProjectivePoint.fromHex(_).toRawBytes(!1).slice(1))),_.length!==64)throw new Error("Expected pubKey to be of length 64");return ye.Buffer.from((0,r.keccak256)(_)).slice(-20)};e.pubToAddress=E,e.publicToAddress=e.pubToAddress;const H=function(_){return(0,u.assertIsBuffer)(_),ye.Buffer.from(n.secp256k1.ProjectivePoint.fromPrivateKey(_).toRawBytes(!1).slice(1))};e.privateToPublic=H;const R=function(_){return(0,e.publicToAddress)((0,e.privateToPublic)(_))};e.privateToAddress=R;const V=function(_){return(0,u.assertIsBuffer)(_),_.length!==64&&(_=ye.Buffer.from(n.secp256k1.ProjectivePoint.fromHex(_).toRawBytes(!1).slice(1))),_};e.importPublic=V;const x=function(){const y=(0,o.zeros)(20);return(0,o.bufferToHex)(y)};e.zeroAddress=x;const j=function(_){try{(0,u.assertIsString)(_)}catch{return!1}return(0,e.zeroAddress)()===_};e.isZeroAddress=j;function ee(_){const[y,b,B,W]=_;return[y,b,(0,o.arrToBufArr)(B).length===0?s.KECCAK256_RLP:B,(0,o.arrToBufArr)(W).length===0?s.KECCAK256_NULL:W]}e.accountBodyFromSlim=ee;const z=new Uint8Array(0);function C(_){const[y,b,B,W]=_;return[y,b,(0,o.arrToBufArr)(B).equals(s.KECCAK256_RLP)?z:B,(0,o.arrToBufArr)(W).equals(s.KECCAK256_NULL)?z:W]}e.accountBodyToSlim=C;function G(_,y=!0){const b=y?ee(_):_;return(0,o.arrToBufArr)(t.RLP.encode(b))}e.accountBodyToRLP=G})(wa);var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.Address=void 0;const En=wa,ni=Fr;class ir{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new ir((0,ni.zeros)(20))}static fromString(t){if(!(0,En.isValidAddress)(t))throw new Error("Invalid address");return new ir((0,ni.toBuffer)(t))}static fromPublicKey(t){if(!ye.Buffer.isBuffer(t))throw new Error("Public key should be Buffer");const r=(0,En.pubToAddress)(t);return new ir(r)}static fromPrivateKey(t){if(!ye.Buffer.isBuffer(t))throw new Error("Private key should be Buffer");const r=(0,En.privateToAddress)(t);return new ir(r)}static generate(t,r){if(typeof r!="bigint")throw new Error("Expected nonce to be a bigint");return new ir((0,En.generateAddress)(t.buf,(0,ni.bigIntToBuffer)(r)))}static generate2(t,r,n){if(!ye.Buffer.isBuffer(r))throw new Error("Expected salt to be a Buffer");if(!ye.Buffer.isBuffer(n))throw new Error("Expected initCode to be a Buffer");return new ir((0,En.generateAddress2)(t.buf,r,n))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(ir.zero())}isPrecompileOrSystemAddress(){const t=(0,ni.bufferToBigInt)(this.buf),r=BigInt(0),n=BigInt("0xffff");return t>=r&&t<=n}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return ye.Buffer.from(this.buf)}}zn.Address=ir;var Xi={},Ea={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const t=Fr,r=Ge;var n;(function(o){o[o.Number=0]="Number",o[o.BigInt=1]="BigInt",o[o.Buffer=2]="Buffer",o[o.PrefixedHexString=3]="PrefixedHexString"})(n=e.TypeOutput||(e.TypeOutput={}));function i(o,s){if(o===null)return null;if(o===void 0)return;if(typeof o=="string"&&!(0,r.isHexString)(o))throw new Error(`A string must be provided with a 0x-prefix, given: ${o}`);if(typeof o=="number"&&!Number.isSafeInteger(o))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const u=(0,t.toBuffer)(o);switch(s){case n.Buffer:return u;case n.BigInt:return(0,t.bufferToBigInt)(u);case n.Number:{const l=(0,t.bufferToBigInt)(u);if(l>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(l)}case n.PrefixedHexString:return(0,t.bufferToHex)(u);default:throw new Error("unknown outputType")}}e.toType=i})(Ea);Object.defineProperty(Xi,"__esModule",{value:!0});Xi.Withdrawal=void 0;const df=zn,Ko=Fr,tt=Ea;class Cn{constructor(t,r,n,i){this.index=t,this.validatorIndex=r,this.address=n,this.amount=i}static fromWithdrawalData(t){const{index:r,validatorIndex:n,address:i,amount:o}=t,s=(0,tt.toType)(r,tt.TypeOutput.BigInt),u=(0,tt.toType)(n,tt.TypeOutput.BigInt),l=new df.Address((0,tt.toType)(i,tt.TypeOutput.Buffer)),f=(0,tt.toType)(o,tt.TypeOutput.BigInt);return new Cn(s,u,l,f)}static fromValuesArray(t){if(t.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[r,n,i,o]=t;return Cn.fromWithdrawalData({index:r,validatorIndex:n,address:i,amount:o})}static toBufferArray(t){const{index:r,validatorIndex:n,address:i,amount:o}=t,s=(0,tt.toType)(r,tt.TypeOutput.BigInt)===BigInt(0)?ye.Buffer.alloc(0):(0,tt.toType)(r,tt.TypeOutput.Buffer),u=(0,tt.toType)(n,tt.TypeOutput.BigInt)===BigInt(0)?ye.Buffer.alloc(0):(0,tt.toType)(n,tt.TypeOutput.Buffer);let l;i instanceof df.Address?l=i.buf:l=(0,tt.toType)(i,tt.TypeOutput.Buffer);const f=(0,tt.toType)(o,tt.TypeOutput.BigInt)===BigInt(0)?ye.Buffer.alloc(0):(0,tt.toType)(o,tt.TypeOutput.Buffer);return[s,u,l,f]}raw(){return Cn.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,Ko.bigIntToHex)(this.index),validatorIndex:(0,Ko.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,Ko.bigIntToHex)(this.amount)}}}Xi.Withdrawal=Cn;var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.hashPersonalMessage=pt.isValidSignature=pt.fromRpcSig=pt.toCompactSig=pt.toRpcSig=pt.ecrecover=pt.ecsign=void 0;const Vm=Ft,Yc=zi,vt=Fr,Jo=Hi,qm=Bt;function Gm(e,t,r){const n=Yc.secp256k1.sign(e,t),i=n.toCompactRawBytes(),o=ye.Buffer.from(i.slice(0,32)),s=ye.Buffer.from(i.slice(32,64)),u=r===void 0?BigInt(n.recovery+27):BigInt(n.recovery+35)+BigInt(r)*BigInt(2);return{r:o,s,v:u}}pt.ecsign=Gm;function Yi(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function Qi(e){return e===BigInt(0)||e===BigInt(1)}const Zm=function(e,t,r,n,i){const o=ye.Buffer.concat([(0,vt.setLengthLeft)(r,32),(0,vt.setLengthLeft)(n,32)],64),s=Yi(t,i);if(!Qi(s))throw new Error("Invalid signature v value");const l=Yc.secp256k1.Signature.fromCompact(o).addRecoveryBit(Number(s)).recoverPublicKey(e);return ye.Buffer.from(l.toRawBytes(!1).slice(1))};pt.ecrecover=Zm;const Km=function(e,t,r,n){const i=Yi(e,n);if(!Qi(i))throw new Error("Invalid signature v value");return(0,vt.bufferToHex)(ye.Buffer.concat([(0,vt.setLengthLeft)(t,32),(0,vt.setLengthLeft)(r,32),(0,vt.toBuffer)(e)]))};pt.toRpcSig=Km;const Jm=function(e,t,r,n){const i=Yi(e,n);if(!Qi(i))throw new Error("Invalid signature v value");let o=r;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(o=ye.Buffer.from(r),o[0]|=128),(0,vt.bufferToHex)(ye.Buffer.concat([(0,vt.setLengthLeft)(t,32),(0,vt.setLengthLeft)(o,32)]))};pt.toCompactSig=Jm;const Xm=function(e){const t=(0,vt.toBuffer)(e);let r,n,i;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),i=(0,vt.bufferToBigInt)(t.slice(64));else if(t.length===64)r=t.slice(0,32),n=t.slice(32,64),i=BigInt((0,vt.bufferToInt)(t.slice(32,33))>>7),n[0]&=127;else throw new Error("Invalid signature length");return i<27&&(i=i+BigInt(27)),{v:i,r,s:n}};pt.fromRpcSig=Xm;const Ym=function(e,t,r,n=!0,i){if(t.length!==32||r.length!==32||!Qi(Yi(e,i)))return!1;const o=(0,vt.bufferToBigInt)(t),s=(0,vt.bufferToBigInt)(r);return!(o===BigInt(0)||o>=Jo.SECP256K1_ORDER||s===BigInt(0)||s>=Jo.SECP256K1_ORDER||n&&s>=Jo.SECP256K1_ORDER_DIV_2)};pt.isValidSignature=Ym;const Qm=function(e){(0,qm.assertIsBuffer)(e);const t=ye.Buffer.from(`Ethereum Signed Message:
|
|
3
3
|
${e.length}`,"utf-8");return ye.Buffer.from((0,Vm.keccak256)(ye.Buffer.concat([t,e])))};pt.hashPersonalMessage=Qm;var Qc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compactBytesToNibbles=e.bytesToNibbles=e.nibblesToCompactBytes=e.nibblesToBytes=e.hasTerminator=void 0;const t=s=>s.length>0&&s[s.length-1]===16;e.hasTerminator=t;const r=(s,u)=>{for(let l=0,f=0;f<s.length;l+=1,f+=2)u[l]=s[f]<<4|s[f+1]};e.nibblesToBytes=r;const n=s=>{let u=0;(0,e.hasTerminator)(s)&&(u=1,s=s.subarray(0,s.length-1));const l=new Uint8Array(s.length/2+1);return l[0]=u<<5,(s.length&1)===1&&(l[0]|=16,l[0]|=s[0],s=s.subarray(1)),(0,e.nibblesToBytes)(s,l.subarray(1)),l};e.nibblesToCompactBytes=n;const i=s=>{const u=s.length*2+1,l=new Uint8Array(u);for(let f=0;f<s.length;f++){const c=s[f];l[f*2]=c/16,l[f*2+1]=c%16}return l[u-1]=16,l};e.bytesToNibbles=i;const o=s=>{if(s.length===0)return s;let u=(0,e.bytesToNibbles)(s);u[0]<2&&(u=u.subarray(0,u.length-1));const l=2-(u[0]&1);return u.subarray(l)};e.compactBytesToNibbles=o})(Qc);var eo={};Object.defineProperty(eo,"__esModule",{value:!0});eo.AsyncEventEmitter=void 0;const eE=Dn;async function tE(e,t,r){let n;for await(const i of t)try{i.length<2?i.call(e,r):await new Promise((o,s)=>{i.call(e,r,u=>{u?s(u):o()})})}catch(o){n=o}if(n)throw n}class rE extends eE.EventEmitter{emit(t,...r){let[n,i]=r;const o=this;let s=o._events[t]??[];return i===void 0&&typeof n=="function"&&(i=n,n=void 0),(t==="newListener"||t==="removeListener")&&(n={event:n,fn:i},i=void 0),s=Array.isArray(s)?s:[s],tE(o,s.slice(),n).then(i).catch(i),o.listenerCount(t)>0}once(t,r){const n=this;let i;if(typeof r!="function")throw new TypeError("listener must be a function");return r.length>=2?i=function(o,s){n.removeListener(t,i),r(o,s)}:i=function(o){n.removeListener(t,i),r(o,i)},n.on(t,i),n}first(t,r){let n=this._events[t]??[];if(typeof r!="function")throw new TypeError("listener must be a function");return Array.isArray(n)||(this._events[t]=n=[n]),n.unshift(r),this}before(t,r,n){return this.beforeOrAfter(t,r,n)}after(t,r,n){return this.beforeOrAfter(t,r,n,"after")}beforeOrAfter(t,r,n,i){let o=this._events[t]??[],s,u;const l=i==="after"?1:0;if(typeof n!="function")throw new TypeError("listener must be a function");if(typeof r!="function")throw new TypeError("target must be a function");for(Array.isArray(o)||(this._events[t]=o=[o]),u=o.length,s=o.length;s--;)if(o[s]===r){u=s+l;break}return o.splice(u,0,n),this}on(t,r){return super.on(t,r)}addListener(t,r){return super.addListener(t,r)}prependListener(t,r){return super.prependListener(t,r)}prependOnceListener(t,r){return super.prependOnceListener(t,r)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,r){return super.removeListener(t,r)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}eo.AsyncEventEmitter=rE;var to={};Object.defineProperty(to,"__esModule",{value:!0});to.Lock=void 0;class nE{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise(t=>this.promiseResolverQueue.push(t))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(this.permits===1&&this.promiseResolverQueue.length>0){this.permits-=1;const t=this.promiseResolverQueue.shift();t&&t(!0)}}}to.Lock=nE;var sn={},kr={},Xo={},Yo={},Qo,hf;function iE(){if(hf)return Qo;hf=1;function e(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return Qo=e,Qo}var Mt={},es={},gf;function ro(){return gf||(gf=1,function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function r(o,s){return Object.prototype.hasOwnProperty.call(o,s)}e.assign=function(o){for(var s=Array.prototype.slice.call(arguments,1);s.length;){var u=s.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var l in u)r(u,l)&&(o[l]=u[l])}}return o},e.shrinkBuf=function(o,s){return o.length===s?o:o.subarray?o.subarray(0,s):(o.length=s,o)};var n={arraySet:function(o,s,u,l,f){if(s.subarray&&o.subarray){o.set(s.subarray(u,u+l),f);return}for(var c=0;c<l;c++)o[f+c]=s[u+c]},flattenChunks:function(o){var s,u,l,f,c,h;for(l=0,s=0,u=o.length;s<u;s++)l+=o[s].length;for(h=new Uint8Array(l),f=0,s=0,u=o.length;s<u;s++)c=o[s],h.set(c,f),f+=c.length;return h}},i={arraySet:function(o,s,u,l,f){for(var c=0;c<l;c++)o[f+c]=s[u+c]},flattenChunks:function(o){return[].concat.apply([],o)}};e.setTyped=function(o){o?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)}(es)),es}var Ir={},_f;function oE(){if(_f)return Ir;_f=1;var e=ro(),t=4,r=0,n=1,i=2;function o(w){for(var ie=w.length;--ie>=0;)w[ie]=0}var s=0,u=1,l=2,f=3,c=258,h=29,m=256,p=m+1+h,v=30,q=19,M=2*p+1,D=15,E=16,H=7,R=256,V=16,x=17,j=18,ee=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],z=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_=512,y=new Array((p+2)*2);o(y);var b=new Array(v*2);o(b);var B=new Array(_);o(B);var W=new Array(c-f+1);o(W);var N=new Array(h);o(N);var k=new Array(v);o(k);function P(w,ie,fe,we,U){this.static_tree=w,this.extra_bits=ie,this.extra_base=fe,this.elems=we,this.max_length=U,this.has_stree=w&&w.length}var O,J,ne;function re(w,ie){this.dyn_tree=w,this.max_code=0,this.stat_desc=ie}function se(w){return w<256?B[w]:B[256+(w>>>7)]}function ce(w,ie){w.pending_buf[w.pending++]=ie&255,w.pending_buf[w.pending++]=ie>>>8&255}function he(w,ie,fe){w.bi_valid>E-fe?(w.bi_buf|=ie<<w.bi_valid&65535,ce(w,w.bi_buf),w.bi_buf=ie>>E-w.bi_valid,w.bi_valid+=fe-E):(w.bi_buf|=ie<<w.bi_valid&65535,w.bi_valid+=fe)}function Se(w,ie,fe){he(w,fe[ie*2],fe[ie*2+1])}function ge(w,ie){var fe=0;do fe|=w&1,w>>>=1,fe<<=1;while(--ie>0);return fe>>>1}function be(w){w.bi_valid===16?(ce(w,w.bi_buf),w.bi_buf=0,w.bi_valid=0):w.bi_valid>=8&&(w.pending_buf[w.pending++]=w.bi_buf&255,w.bi_buf>>=8,w.bi_valid-=8)}function Ce(w,ie){var fe=ie.dyn_tree,we=ie.max_code,U=ie.stat_desc.static_tree,te=ie.stat_desc.has_stree,d=ie.stat_desc.extra_bits,le=ie.stat_desc.extra_base,Ae=ie.stat_desc.max_length,a,X,Y,g,$,K,Re=0;for(g=0;g<=D;g++)w.bl_count[g]=0;for(fe[w.heap[w.heap_max]*2+1]=0,a=w.heap_max+1;a<M;a++)X=w.heap[a],g=fe[fe[X*2+1]*2+1]+1,g>Ae&&(g=Ae,Re++),fe[X*2+1]=g,!(X>we)&&(w.bl_count[g]++,$=0,X>=le&&($=d[X-le]),K=fe[X*2],w.opt_len+=K*(g+$),te&&(w.static_len+=K*(U[X*2+1]+$)));if(Re!==0){do{for(g=Ae-1;w.bl_count[g]===0;)g--;w.bl_count[g]--,w.bl_count[g+1]+=2,w.bl_count[Ae]--,Re-=2}while(Re>0);for(g=Ae;g!==0;g--)for(X=w.bl_count[g];X!==0;)Y=w.heap[--a],!(Y>we)&&(fe[Y*2+1]!==g&&(w.opt_len+=(g-fe[Y*2+1])*fe[Y*2],fe[Y*2+1]=g),X--)}}function Le(w,ie,fe){var we=new Array(D+1),U=0,te,d;for(te=1;te<=D;te++)we[te]=U=U+fe[te-1]<<1;for(d=0;d<=ie;d++){var le=w[d*2+1];le!==0&&(w[d*2]=ge(we[le]++,le))}}function Oe(){var w,ie,fe,we,U,te=new Array(D+1);for(fe=0,we=0;we<h-1;we++)for(N[we]=fe,w=0;w<1<<ee[we];w++)W[fe++]=we;for(W[fe-1]=we,U=0,we=0;we<16;we++)for(k[we]=U,w=0;w<1<<z[we];w++)B[U++]=we;for(U>>=7;we<v;we++)for(k[we]=U<<7,w=0;w<1<<z[we]-7;w++)B[256+U++]=we;for(ie=0;ie<=D;ie++)te[ie]=0;for(w=0;w<=143;)y[w*2+1]=8,w++,te[8]++;for(;w<=255;)y[w*2+1]=9,w++,te[9]++;for(;w<=279;)y[w*2+1]=7,w++,te[7]++;for(;w<=287;)y[w*2+1]=8,w++,te[8]++;for(Le(y,p+1,te),w=0;w<v;w++)b[w*2+1]=5,b[w*2]=ge(w,5);O=new P(y,ee,m+1,p,D),J=new P(b,z,0,v,D),ne=new P(new Array(0),C,0,q,H)}function T(w){var ie;for(ie=0;ie<p;ie++)w.dyn_ltree[ie*2]=0;for(ie=0;ie<v;ie++)w.dyn_dtree[ie*2]=0;for(ie=0;ie<q;ie++)w.bl_tree[ie*2]=0;w.dyn_ltree[R*2]=1,w.opt_len=w.static_len=0,w.last_lit=w.matches=0}function L(w){w.bi_valid>8?ce(w,w.bi_buf):w.bi_valid>0&&(w.pending_buf[w.pending++]=w.bi_buf),w.bi_buf=0,w.bi_valid=0}function Z(w,ie,fe,we){L(w),we&&(ce(w,fe),ce(w,~fe)),e.arraySet(w.pending_buf,w.window,ie,fe,w.pending),w.pending+=fe}function ue(w,ie,fe,we){var U=ie*2,te=fe*2;return w[U]<w[te]||w[U]===w[te]&&we[ie]<=we[fe]}function oe(w,ie,fe){for(var we=w.heap[fe],U=fe<<1;U<=w.heap_len&&(U<w.heap_len&&ue(ie,w.heap[U+1],w.heap[U],w.depth)&&U++,!ue(ie,we,w.heap[U],w.depth));)w.heap[fe]=w.heap[U],fe=U,U<<=1;w.heap[fe]=we}function _e(w,ie,fe){var we,U,te=0,d,le;if(w.last_lit!==0)do we=w.pending_buf[w.d_buf+te*2]<<8|w.pending_buf[w.d_buf+te*2+1],U=w.pending_buf[w.l_buf+te],te++,we===0?Se(w,U,ie):(d=W[U],Se(w,d+m+1,ie),le=ee[d],le!==0&&(U-=N[d],he(w,U,le)),we--,d=se(we),Se(w,d,fe),le=z[d],le!==0&&(we-=k[d],he(w,we,le)));while(te<w.last_lit);Se(w,R,ie)}function Ie(w,ie){var fe=ie.dyn_tree,we=ie.stat_desc.static_tree,U=ie.stat_desc.has_stree,te=ie.stat_desc.elems,d,le,Ae=-1,a;for(w.heap_len=0,w.heap_max=M,d=0;d<te;d++)fe[d*2]!==0?(w.heap[++w.heap_len]=Ae=d,w.depth[d]=0):fe[d*2+1]=0;for(;w.heap_len<2;)a=w.heap[++w.heap_len]=Ae<2?++Ae:0,fe[a*2]=1,w.depth[a]=0,w.opt_len--,U&&(w.static_len-=we[a*2+1]);for(ie.max_code=Ae,d=w.heap_len>>1;d>=1;d--)oe(w,fe,d);a=te;do d=w.heap[1],w.heap[1]=w.heap[w.heap_len--],oe(w,fe,1),le=w.heap[1],w.heap[--w.heap_max]=d,w.heap[--w.heap_max]=le,fe[a*2]=fe[d*2]+fe[le*2],w.depth[a]=(w.depth[d]>=w.depth[le]?w.depth[d]:w.depth[le])+1,fe[d*2+1]=fe[le*2+1]=a,w.heap[1]=a++,oe(w,fe,1);while(w.heap_len>=2);w.heap[--w.heap_max]=w.heap[1],Ce(w,ie),Le(fe,Ae,w.bl_count)}function Be(w,ie,fe){var we,U=-1,te,d=ie[0*2+1],le=0,Ae=7,a=4;for(d===0&&(Ae=138,a=3),ie[(fe+1)*2+1]=65535,we=0;we<=fe;we++)te=d,d=ie[(we+1)*2+1],!(++le<Ae&&te===d)&&(le<a?w.bl_tree[te*2]+=le:te!==0?(te!==U&&w.bl_tree[te*2]++,w.bl_tree[V*2]++):le<=10?w.bl_tree[x*2]++:w.bl_tree[j*2]++,le=0,U=te,d===0?(Ae=138,a=3):te===d?(Ae=6,a=3):(Ae=7,a=4))}function ze(w,ie,fe){var we,U=-1,te,d=ie[0*2+1],le=0,Ae=7,a=4;for(d===0&&(Ae=138,a=3),we=0;we<=fe;we++)if(te=d,d=ie[(we+1)*2+1],!(++le<Ae&&te===d)){if(le<a)do Se(w,te,w.bl_tree);while(--le!==0);else te!==0?(te!==U&&(Se(w,te,w.bl_tree),le--),Se(w,V,w.bl_tree),he(w,le-3,2)):le<=10?(Se(w,x,w.bl_tree),he(w,le-3,3)):(Se(w,j,w.bl_tree),he(w,le-11,7));le=0,U=te,d===0?(Ae=138,a=3):te===d?(Ae=6,a=3):(Ae=7,a=4)}}function Fe(w){var ie;for(Be(w,w.dyn_ltree,w.l_desc.max_code),Be(w,w.dyn_dtree,w.d_desc.max_code),Ie(w,w.bl_desc),ie=q-1;ie>=3&&w.bl_tree[G[ie]*2+1]===0;ie--);return w.opt_len+=3*(ie+1)+5+5+4,ie}function Me(w,ie,fe,we){var U;for(he(w,ie-257,5),he(w,fe-1,5),he(w,we-4,4),U=0;U<we;U++)he(w,w.bl_tree[G[U]*2+1],3);ze(w,w.dyn_ltree,ie-1),ze(w,w.dyn_dtree,fe-1)}function nt(w){var ie=4093624447,fe;for(fe=0;fe<=31;fe++,ie>>>=1)if(ie&1&&w.dyn_ltree[fe*2]!==0)return r;if(w.dyn_ltree[9*2]!==0||w.dyn_ltree[10*2]!==0||w.dyn_ltree[13*2]!==0)return n;for(fe=32;fe<m;fe++)if(w.dyn_ltree[fe*2]!==0)return n;return r}var S=!1;function I(w){S||(Oe(),S=!0),w.l_desc=new re(w.dyn_ltree,O),w.d_desc=new re(w.dyn_dtree,J),w.bl_desc=new re(w.bl_tree,ne),w.bi_buf=0,w.bi_valid=0,T(w)}function de(w,ie,fe,we){he(w,(s<<1)+(we?1:0),3),Z(w,ie,fe,!0)}function ae(w){he(w,u<<1,3),Se(w,R,y),be(w)}function pe(w,ie,fe,we){var U,te,d=0;w.level>0?(w.strm.data_type===i&&(w.strm.data_type=nt(w)),Ie(w,w.l_desc),Ie(w,w.d_desc),d=Fe(w),U=w.opt_len+3+7>>>3,te=w.static_len+3+7>>>3,te<=U&&(U=te)):U=te=fe+5,fe+4<=U&&ie!==-1?de(w,ie,fe,we):w.strategy===t||te===U?(he(w,(u<<1)+(we?1:0),3),_e(w,y,b)):(he(w,(l<<1)+(we?1:0),3),Me(w,w.l_desc.max_code+1,w.d_desc.max_code+1,d+1),_e(w,w.dyn_ltree,w.dyn_dtree)),T(w),we&&L(w)}function je(w,ie,fe){return w.pending_buf[w.d_buf+w.last_lit*2]=ie>>>8&255,w.pending_buf[w.d_buf+w.last_lit*2+1]=ie&255,w.pending_buf[w.l_buf+w.last_lit]=fe&255,w.last_lit++,ie===0?w.dyn_ltree[fe*2]++:(w.matches++,ie--,w.dyn_ltree[(W[fe]+m+1)*2]++,w.dyn_dtree[se(ie)*2]++),w.last_lit===w.lit_bufsize-1}return Ir._tr_init=I,Ir._tr_stored_block=de,Ir._tr_flush_block=pe,Ir._tr_tally=je,Ir._tr_align=ae,Ir}var ts,bf;function ed(){if(bf)return ts;bf=1;function e(t,r,n,i){for(var o=t&65535|0,s=t>>>16&65535|0,u=0;n!==0;){u=n>2e3?2e3:n,n-=u;do o=o+r[i++]|0,s=s+o|0;while(--u);o%=65521,s%=65521}return o|s<<16|0}return ts=e,ts}var rs,pf;function td(){if(pf)return rs;pf=1;function e(){for(var n,i=[],o=0;o<256;o++){n=o;for(var s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;i[o]=n}return i}var t=e();function r(n,i,o,s){var u=t,l=s+o;n^=-1;for(var f=s;f<l;f++)n=n>>>8^u[(n^i[f])&255];return n^-1}return rs=r,rs}var ns,yf;function sE(){return yf||(yf=1,ns={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),ns}var wf;function aE(){if(wf)return Mt;wf=1;var e=ro(),t=oE(),r=ed(),n=td(),i=sE(),o=0,s=1,u=3,l=4,f=5,c=0,h=1,m=-2,p=-3,v=-5,q=-1,M=1,D=2,E=3,H=4,R=0,V=2,x=8,j=9,ee=15,z=8,C=29,G=256,_=G+1+C,y=30,b=19,B=2*_+1,W=15,N=3,k=258,P=k+N+1,O=32,J=42,ne=69,re=73,se=91,ce=103,he=113,Se=666,ge=1,be=2,Ce=3,Le=4,Oe=3;function T(a,X){return a.msg=i[X],X}function L(a){return(a<<1)-(a>4?9:0)}function Z(a){for(var X=a.length;--X>=0;)a[X]=0}function ue(a){var X=a.state,Y=X.pending;Y>a.avail_out&&(Y=a.avail_out),Y!==0&&(e.arraySet(a.output,X.pending_buf,X.pending_out,Y,a.next_out),a.next_out+=Y,X.pending_out+=Y,a.total_out+=Y,a.avail_out-=Y,X.pending-=Y,X.pending===0&&(X.pending_out=0))}function oe(a,X){t._tr_flush_block(a,a.block_start>=0?a.block_start:-1,a.strstart-a.block_start,X),a.block_start=a.strstart,ue(a.strm)}function _e(a,X){a.pending_buf[a.pending++]=X}function Ie(a,X){a.pending_buf[a.pending++]=X>>>8&255,a.pending_buf[a.pending++]=X&255}function Be(a,X,Y,g){var $=a.avail_in;return $>g&&($=g),$===0?0:(a.avail_in-=$,e.arraySet(X,a.input,a.next_in,$,Y),a.state.wrap===1?a.adler=r(a.adler,X,$,Y):a.state.wrap===2&&(a.adler=n(a.adler,X,$,Y)),a.next_in+=$,a.total_in+=$,$)}function ze(a,X){var Y=a.max_chain_length,g=a.strstart,$,K,Re=a.prev_length,me=a.nice_match,Ee=a.strstart>a.w_size-P?a.strstart-(a.w_size-P):0,$e=a.window,it=a.w_mask,Ze=a.prev,xe=a.strstart+k,rt=$e[g+Re-1],at=$e[g+Re];a.prev_length>=a.good_match&&(Y>>=2),me>a.lookahead&&(me=a.lookahead);do if($=X,!($e[$+Re]!==at||$e[$+Re-1]!==rt||$e[$]!==$e[g]||$e[++$]!==$e[g+1])){g+=2,$++;do;while($e[++g]===$e[++$]&&$e[++g]===$e[++$]&&$e[++g]===$e[++$]&&$e[++g]===$e[++$]&&$e[++g]===$e[++$]&&$e[++g]===$e[++$]&&$e[++g]===$e[++$]&&$e[++g]===$e[++$]&&g<xe);if(K=k-(xe-g),g=xe-k,K>Re){if(a.match_start=X,Re=K,K>=me)break;rt=$e[g+Re-1],at=$e[g+Re]}}while((X=Ze[X&it])>Ee&&--Y!==0);return Re<=a.lookahead?Re:a.lookahead}function Fe(a){var X=a.w_size,Y,g,$,K,Re;do{if(K=a.window_size-a.lookahead-a.strstart,a.strstart>=X+(X-P)){e.arraySet(a.window,a.window,X,X,0),a.match_start-=X,a.strstart-=X,a.block_start-=X,g=a.hash_size,Y=g;do $=a.head[--Y],a.head[Y]=$>=X?$-X:0;while(--g);g=X,Y=g;do $=a.prev[--Y],a.prev[Y]=$>=X?$-X:0;while(--g);K+=X}if(a.strm.avail_in===0)break;if(g=Be(a.strm,a.window,a.strstart+a.lookahead,K),a.lookahead+=g,a.lookahead+a.insert>=N)for(Re=a.strstart-a.insert,a.ins_h=a.window[Re],a.ins_h=(a.ins_h<<a.hash_shift^a.window[Re+1])&a.hash_mask;a.insert&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[Re+N-1])&a.hash_mask,a.prev[Re&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=Re,Re++,a.insert--,!(a.lookahead+a.insert<N)););}while(a.lookahead<P&&a.strm.avail_in!==0)}function Me(a,X){var Y=65535;for(Y>a.pending_buf_size-5&&(Y=a.pending_buf_size-5);;){if(a.lookahead<=1){if(Fe(a),a.lookahead===0&&X===o)return ge;if(a.lookahead===0)break}a.strstart+=a.lookahead,a.lookahead=0;var g=a.block_start+Y;if((a.strstart===0||a.strstart>=g)&&(a.lookahead=a.strstart-g,a.strstart=g,oe(a,!1),a.strm.avail_out===0)||a.strstart-a.block_start>=a.w_size-P&&(oe(a,!1),a.strm.avail_out===0))return ge}return a.insert=0,X===l?(oe(a,!0),a.strm.avail_out===0?Ce:Le):(a.strstart>a.block_start&&(oe(a,!1),a.strm.avail_out===0),ge)}function nt(a,X){for(var Y,g;;){if(a.lookahead<P){if(Fe(a),a.lookahead<P&&X===o)return ge;if(a.lookahead===0)break}if(Y=0,a.lookahead>=N&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+N-1])&a.hash_mask,Y=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),Y!==0&&a.strstart-Y<=a.w_size-P&&(a.match_length=ze(a,Y)),a.match_length>=N)if(g=t._tr_tally(a,a.strstart-a.match_start,a.match_length-N),a.lookahead-=a.match_length,a.match_length<=a.max_lazy_match&&a.lookahead>=N){a.match_length--;do a.strstart++,a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+N-1])&a.hash_mask,Y=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart;while(--a.match_length!==0);a.strstart++}else a.strstart+=a.match_length,a.match_length=0,a.ins_h=a.window[a.strstart],a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+1])&a.hash_mask;else g=t._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++;if(g&&(oe(a,!1),a.strm.avail_out===0))return ge}return a.insert=a.strstart<N-1?a.strstart:N-1,X===l?(oe(a,!0),a.strm.avail_out===0?Ce:Le):a.last_lit&&(oe(a,!1),a.strm.avail_out===0)?ge:be}function S(a,X){for(var Y,g,$;;){if(a.lookahead<P){if(Fe(a),a.lookahead<P&&X===o)return ge;if(a.lookahead===0)break}if(Y=0,a.lookahead>=N&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+N-1])&a.hash_mask,Y=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart),a.prev_length=a.match_length,a.prev_match=a.match_start,a.match_length=N-1,Y!==0&&a.prev_length<a.max_lazy_match&&a.strstart-Y<=a.w_size-P&&(a.match_length=ze(a,Y),a.match_length<=5&&(a.strategy===M||a.match_length===N&&a.strstart-a.match_start>4096)&&(a.match_length=N-1)),a.prev_length>=N&&a.match_length<=a.prev_length){$=a.strstart+a.lookahead-N,g=t._tr_tally(a,a.strstart-1-a.prev_match,a.prev_length-N),a.lookahead-=a.prev_length-1,a.prev_length-=2;do++a.strstart<=$&&(a.ins_h=(a.ins_h<<a.hash_shift^a.window[a.strstart+N-1])&a.hash_mask,Y=a.prev[a.strstart&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=a.strstart);while(--a.prev_length!==0);if(a.match_available=0,a.match_length=N-1,a.strstart++,g&&(oe(a,!1),a.strm.avail_out===0))return ge}else if(a.match_available){if(g=t._tr_tally(a,0,a.window[a.strstart-1]),g&&oe(a,!1),a.strstart++,a.lookahead--,a.strm.avail_out===0)return ge}else a.match_available=1,a.strstart++,a.lookahead--}return a.match_available&&(g=t._tr_tally(a,0,a.window[a.strstart-1]),a.match_available=0),a.insert=a.strstart<N-1?a.strstart:N-1,X===l?(oe(a,!0),a.strm.avail_out===0?Ce:Le):a.last_lit&&(oe(a,!1),a.strm.avail_out===0)?ge:be}function I(a,X){for(var Y,g,$,K,Re=a.window;;){if(a.lookahead<=k){if(Fe(a),a.lookahead<=k&&X===o)return ge;if(a.lookahead===0)break}if(a.match_length=0,a.lookahead>=N&&a.strstart>0&&($=a.strstart-1,g=Re[$],g===Re[++$]&&g===Re[++$]&&g===Re[++$])){K=a.strstart+k;do;while(g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&g===Re[++$]&&$<K);a.match_length=k-(K-$),a.match_length>a.lookahead&&(a.match_length=a.lookahead)}if(a.match_length>=N?(Y=t._tr_tally(a,1,a.match_length-N),a.lookahead-=a.match_length,a.strstart+=a.match_length,a.match_length=0):(Y=t._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++),Y&&(oe(a,!1),a.strm.avail_out===0))return ge}return a.insert=0,X===l?(oe(a,!0),a.strm.avail_out===0?Ce:Le):a.last_lit&&(oe(a,!1),a.strm.avail_out===0)?ge:be}function de(a,X){for(var Y;;){if(a.lookahead===0&&(Fe(a),a.lookahead===0)){if(X===o)return ge;break}if(a.match_length=0,Y=t._tr_tally(a,0,a.window[a.strstart]),a.lookahead--,a.strstart++,Y&&(oe(a,!1),a.strm.avail_out===0))return ge}return a.insert=0,X===l?(oe(a,!0),a.strm.avail_out===0?Ce:Le):a.last_lit&&(oe(a,!1),a.strm.avail_out===0)?ge:be}function ae(a,X,Y,g,$){this.good_length=a,this.max_lazy=X,this.nice_length=Y,this.max_chain=g,this.func=$}var pe;pe=[new ae(0,0,0,0,Me),new ae(4,4,8,4,nt),new ae(4,5,16,8,nt),new ae(4,6,32,32,nt),new ae(4,4,16,16,S),new ae(8,16,32,32,S),new ae(8,16,128,128,S),new ae(8,32,128,256,S),new ae(32,128,258,1024,S),new ae(32,258,258,4096,S)];function je(a){a.window_size=2*a.w_size,Z(a.head),a.max_lazy_match=pe[a.level].max_lazy,a.good_match=pe[a.level].good_length,a.nice_match=pe[a.level].nice_length,a.max_chain_length=pe[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=N-1,a.match_available=0,a.ins_h=0}function w(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=x,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new e.Buf16(B*2),this.dyn_dtree=new e.Buf16((2*y+1)*2),this.bl_tree=new e.Buf16((2*b+1)*2),Z(this.dyn_ltree),Z(this.dyn_dtree),Z(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(W+1),this.heap=new e.Buf16(2*_+1),Z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*_+1),Z(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ie(a){var X;return!a||!a.state?T(a,m):(a.total_in=a.total_out=0,a.data_type=V,X=a.state,X.pending=0,X.pending_out=0,X.wrap<0&&(X.wrap=-X.wrap),X.status=X.wrap?J:he,a.adler=X.wrap===2?0:1,X.last_flush=o,t._tr_init(X),c)}function fe(a){var X=ie(a);return X===c&&je(a.state),X}function we(a,X){return!a||!a.state||a.state.wrap!==2?m:(a.state.gzhead=X,c)}function U(a,X,Y,g,$,K){if(!a)return m;var Re=1;if(X===q&&(X=6),g<0?(Re=0,g=-g):g>15&&(Re=2,g-=16),$<1||$>j||Y!==x||g<8||g>15||X<0||X>9||K<0||K>H)return T(a,m);g===8&&(g=9);var me=new w;return a.state=me,me.strm=a,me.wrap=Re,me.gzhead=null,me.w_bits=g,me.w_size=1<<me.w_bits,me.w_mask=me.w_size-1,me.hash_bits=$+7,me.hash_size=1<<me.hash_bits,me.hash_mask=me.hash_size-1,me.hash_shift=~~((me.hash_bits+N-1)/N),me.window=new e.Buf8(me.w_size*2),me.head=new e.Buf16(me.hash_size),me.prev=new e.Buf16(me.w_size),me.lit_bufsize=1<<$+6,me.pending_buf_size=me.lit_bufsize*4,me.pending_buf=new e.Buf8(me.pending_buf_size),me.d_buf=1*me.lit_bufsize,me.l_buf=3*me.lit_bufsize,me.level=X,me.strategy=K,me.method=Y,fe(a)}function te(a,X){return U(a,X,x,ee,z,R)}function d(a,X){var Y,g,$,K;if(!a||!a.state||X>f||X<0)return a?T(a,m):m;if(g=a.state,!a.output||!a.input&&a.avail_in!==0||g.status===Se&&X!==l)return T(a,a.avail_out===0?v:m);if(g.strm=a,Y=g.last_flush,g.last_flush=X,g.status===J)if(g.wrap===2)a.adler=0,_e(g,31),_e(g,139),_e(g,8),g.gzhead?(_e(g,(g.gzhead.text?1:0)+(g.gzhead.hcrc?2:0)+(g.gzhead.extra?4:0)+(g.gzhead.name?8:0)+(g.gzhead.comment?16:0)),_e(g,g.gzhead.time&255),_e(g,g.gzhead.time>>8&255),_e(g,g.gzhead.time>>16&255),_e(g,g.gzhead.time>>24&255),_e(g,g.level===9?2:g.strategy>=D||g.level<2?4:0),_e(g,g.gzhead.os&255),g.gzhead.extra&&g.gzhead.extra.length&&(_e(g,g.gzhead.extra.length&255),_e(g,g.gzhead.extra.length>>8&255)),g.gzhead.hcrc&&(a.adler=n(a.adler,g.pending_buf,g.pending,0)),g.gzindex=0,g.status=ne):(_e(g,0),_e(g,0),_e(g,0),_e(g,0),_e(g,0),_e(g,g.level===9?2:g.strategy>=D||g.level<2?4:0),_e(g,Oe),g.status=he);else{var Re=x+(g.w_bits-8<<4)<<8,me=-1;g.strategy>=D||g.level<2?me=0:g.level<6?me=1:g.level===6?me=2:me=3,Re|=me<<6,g.strstart!==0&&(Re|=O),Re+=31-Re%31,g.status=he,Ie(g,Re),g.strstart!==0&&(Ie(g,a.adler>>>16),Ie(g,a.adler&65535)),a.adler=1}if(g.status===ne)if(g.gzhead.extra){for($=g.pending;g.gzindex<(g.gzhead.extra.length&65535)&&!(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),ue(a),$=g.pending,g.pending===g.pending_buf_size));)_e(g,g.gzhead.extra[g.gzindex]&255),g.gzindex++;g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),g.gzindex===g.gzhead.extra.length&&(g.gzindex=0,g.status=re)}else g.status=re;if(g.status===re)if(g.gzhead.name){$=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),ue(a),$=g.pending,g.pending===g.pending_buf_size)){K=1;break}g.gzindex<g.gzhead.name.length?K=g.gzhead.name.charCodeAt(g.gzindex++)&255:K=0,_e(g,K)}while(K!==0);g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),K===0&&(g.gzindex=0,g.status=se)}else g.status=se;if(g.status===se)if(g.gzhead.comment){$=g.pending;do{if(g.pending===g.pending_buf_size&&(g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),ue(a),$=g.pending,g.pending===g.pending_buf_size)){K=1;break}g.gzindex<g.gzhead.comment.length?K=g.gzhead.comment.charCodeAt(g.gzindex++)&255:K=0,_e(g,K)}while(K!==0);g.gzhead.hcrc&&g.pending>$&&(a.adler=n(a.adler,g.pending_buf,g.pending-$,$)),K===0&&(g.status=ce)}else g.status=ce;if(g.status===ce&&(g.gzhead.hcrc?(g.pending+2>g.pending_buf_size&&ue(a),g.pending+2<=g.pending_buf_size&&(_e(g,a.adler&255),_e(g,a.adler>>8&255),a.adler=0,g.status=he)):g.status=he),g.pending!==0){if(ue(a),a.avail_out===0)return g.last_flush=-1,c}else if(a.avail_in===0&&L(X)<=L(Y)&&X!==l)return T(a,v);if(g.status===Se&&a.avail_in!==0)return T(a,v);if(a.avail_in!==0||g.lookahead!==0||X!==o&&g.status!==Se){var Ee=g.strategy===D?de(g,X):g.strategy===E?I(g,X):pe[g.level].func(g,X);if((Ee===Ce||Ee===Le)&&(g.status=Se),Ee===ge||Ee===Ce)return a.avail_out===0&&(g.last_flush=-1),c;if(Ee===be&&(X===s?t._tr_align(g):X!==f&&(t._tr_stored_block(g,0,0,!1),X===u&&(Z(g.head),g.lookahead===0&&(g.strstart=0,g.block_start=0,g.insert=0))),ue(a),a.avail_out===0))return g.last_flush=-1,c}return X!==l?c:g.wrap<=0?h:(g.wrap===2?(_e(g,a.adler&255),_e(g,a.adler>>8&255),_e(g,a.adler>>16&255),_e(g,a.adler>>24&255),_e(g,a.total_in&255),_e(g,a.total_in>>8&255),_e(g,a.total_in>>16&255),_e(g,a.total_in>>24&255)):(Ie(g,a.adler>>>16),Ie(g,a.adler&65535)),ue(a),g.wrap>0&&(g.wrap=-g.wrap),g.pending!==0?c:h)}function le(a){var X;return!a||!a.state?m:(X=a.state.status,X!==J&&X!==ne&&X!==re&&X!==se&&X!==ce&&X!==he&&X!==Se?T(a,m):(a.state=null,X===he?T(a,p):c))}function Ae(a,X){var Y=X.length,g,$,K,Re,me,Ee,$e,it;if(!a||!a.state||(g=a.state,Re=g.wrap,Re===2||Re===1&&g.status!==J||g.lookahead))return m;for(Re===1&&(a.adler=r(a.adler,X,Y,0)),g.wrap=0,Y>=g.w_size&&(Re===0&&(Z(g.head),g.strstart=0,g.block_start=0,g.insert=0),it=new e.Buf8(g.w_size),e.arraySet(it,X,Y-g.w_size,g.w_size,0),X=it,Y=g.w_size),me=a.avail_in,Ee=a.next_in,$e=a.input,a.avail_in=Y,a.next_in=0,a.input=X,Fe(g);g.lookahead>=N;){$=g.strstart,K=g.lookahead-(N-1);do g.ins_h=(g.ins_h<<g.hash_shift^g.window[$+N-1])&g.hash_mask,g.prev[$&g.w_mask]=g.head[g.ins_h],g.head[g.ins_h]=$,$++;while(--K);g.strstart=$,g.lookahead=N-1,Fe(g)}return g.strstart+=g.lookahead,g.block_start=g.strstart,g.insert=g.lookahead,g.lookahead=0,g.match_length=g.prev_length=N-1,g.match_available=0,a.next_in=Ee,a.input=$e,a.avail_in=me,g.wrap=Re,c}return Mt.deflateInit=te,Mt.deflateInit2=U,Mt.deflateReset=fe,Mt.deflateResetKeep=ie,Mt.deflateSetHeader=we,Mt.deflate=d,Mt.deflateEnd=le,Mt.deflateSetDictionary=Ae,Mt.deflateInfo="pako deflate (from Nodeca project)",Mt}var Ct={},is,mf;function lE(){if(mf)return is;mf=1;var e=30,t=12;return is=function(n,i){var o,s,u,l,f,c,h,m,p,v,q,M,D,E,H,R,V,x,j,ee,z,C,G,_,y;o=n.state,s=n.next_in,_=n.input,u=s+(n.avail_in-5),l=n.next_out,y=n.output,f=l-(i-n.avail_out),c=l+(n.avail_out-257),h=o.dmax,m=o.wsize,p=o.whave,v=o.wnext,q=o.window,M=o.hold,D=o.bits,E=o.lencode,H=o.distcode,R=(1<<o.lenbits)-1,V=(1<<o.distbits)-1;e:do{D<15&&(M+=_[s++]<<D,D+=8,M+=_[s++]<<D,D+=8),x=E[M&R];t:for(;;){if(j=x>>>24,M>>>=j,D-=j,j=x>>>16&255,j===0)y[l++]=x&65535;else if(j&16){ee=x&65535,j&=15,j&&(D<j&&(M+=_[s++]<<D,D+=8),ee+=M&(1<<j)-1,M>>>=j,D-=j),D<15&&(M+=_[s++]<<D,D+=8,M+=_[s++]<<D,D+=8),x=H[M&V];r:for(;;){if(j=x>>>24,M>>>=j,D-=j,j=x>>>16&255,j&16){if(z=x&65535,j&=15,D<j&&(M+=_[s++]<<D,D+=8,D<j&&(M+=_[s++]<<D,D+=8)),z+=M&(1<<j)-1,z>h){n.msg="invalid distance too far back",o.mode=e;break e}if(M>>>=j,D-=j,j=l-f,z>j){if(j=z-j,j>p&&o.sane){n.msg="invalid distance too far back",o.mode=e;break e}if(C=0,G=q,v===0){if(C+=m-j,j<ee){ee-=j;do y[l++]=q[C++];while(--j);C=l-z,G=y}}else if(v<j){if(C+=m+v-j,j-=v,j<ee){ee-=j;do y[l++]=q[C++];while(--j);if(C=0,v<ee){j=v,ee-=j;do y[l++]=q[C++];while(--j);C=l-z,G=y}}}else if(C+=v-j,j<ee){ee-=j;do y[l++]=q[C++];while(--j);C=l-z,G=y}for(;ee>2;)y[l++]=G[C++],y[l++]=G[C++],y[l++]=G[C++],ee-=3;ee&&(y[l++]=G[C++],ee>1&&(y[l++]=G[C++]))}else{C=l-z;do y[l++]=y[C++],y[l++]=y[C++],y[l++]=y[C++],ee-=3;while(ee>2);ee&&(y[l++]=y[C++],ee>1&&(y[l++]=y[C++]))}}else if(j&64){n.msg="invalid distance code",o.mode=e;break e}else{x=H[(x&65535)+(M&(1<<j)-1)];continue r}break}}else if(j&64)if(j&32){o.mode=t;break e}else{n.msg="invalid literal/length code",o.mode=e;break e}else{x=E[(x&65535)+(M&(1<<j)-1)];continue t}break}}while(s<u&&l<c);ee=D>>3,s-=ee,D-=ee<<3,M&=(1<<D)-1,n.next_in=s,n.next_out=l,n.avail_in=s<u?5+(u-s):5-(s-u),n.avail_out=l<c?257+(c-l):257-(l-c),o.hold=M,o.bits=D},is}var os,Ef;function fE(){if(Ef)return os;Ef=1;var e=ro(),t=15,r=852,n=592,i=0,o=1,s=2,u=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],l=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],f=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return os=function(m,p,v,q,M,D,E,H){var R=H.bits,V=0,x=0,j=0,ee=0,z=0,C=0,G=0,_=0,y=0,b=0,B,W,N,k,P,O=null,J=0,ne,re=new e.Buf16(t+1),se=new e.Buf16(t+1),ce=null,he=0,Se,ge,be;for(V=0;V<=t;V++)re[V]=0;for(x=0;x<q;x++)re[p[v+x]]++;for(z=R,ee=t;ee>=1&&re[ee]===0;ee--);if(z>ee&&(z=ee),ee===0)return M[D++]=1<<24|64<<16|0,M[D++]=1<<24|64<<16|0,H.bits=1,0;for(j=1;j<ee&&re[j]===0;j++);for(z<j&&(z=j),_=1,V=1;V<=t;V++)if(_<<=1,_-=re[V],_<0)return-1;if(_>0&&(m===i||ee!==1))return-1;for(se[1]=0,V=1;V<t;V++)se[V+1]=se[V]+re[V];for(x=0;x<q;x++)p[v+x]!==0&&(E[se[p[v+x]]++]=x);if(m===i?(O=ce=E,ne=19):m===o?(O=u,J-=257,ce=l,he-=257,ne=256):(O=f,ce=c,ne=-1),b=0,x=0,V=j,P=D,C=z,G=0,N=-1,y=1<<z,k=y-1,m===o&&y>r||m===s&&y>n)return 1;for(;;){Se=V-G,E[x]<ne?(ge=0,be=E[x]):E[x]>ne?(ge=ce[he+E[x]],be=O[J+E[x]]):(ge=96,be=0),B=1<<V-G,W=1<<C,j=W;do W-=B,M[P+(b>>G)+W]=Se<<24|ge<<16|be|0;while(W!==0);for(B=1<<V-1;b&B;)B>>=1;if(B!==0?(b&=B-1,b+=B):b=0,x++,--re[V]===0){if(V===ee)break;V=p[v+E[x]]}if(V>z&&(b&k)!==N){for(G===0&&(G=z),P+=j,C=V-G,_=1<<C;C+G<ee&&(_-=re[C+G],!(_<=0));)C++,_<<=1;if(y+=1<<C,m===o&&y>r||m===s&&y>n)return 1;N=b&k,M[N]=z<<24|C<<16|P-D|0}}return b!==0&&(M[P+b]=V-G<<24|64<<16|0),H.bits=z,0},os}var vf;function uE(){if(vf)return Ct;vf=1;var e=ro(),t=ed(),r=td(),n=lE(),i=fE(),o=0,s=1,u=2,l=4,f=5,c=6,h=0,m=1,p=2,v=-2,q=-3,M=-4,D=-5,E=8,H=1,R=2,V=3,x=4,j=5,ee=6,z=7,C=8,G=9,_=10,y=11,b=12,B=13,W=14,N=15,k=16,P=17,O=18,J=19,ne=20,re=21,se=22,ce=23,he=24,Se=25,ge=26,be=27,Ce=28,Le=29,Oe=30,T=31,L=32,Z=852,ue=592,oe=15,_e=oe;function Ie(U){return(U>>>24&255)+(U>>>8&65280)+((U&65280)<<8)+((U&255)<<24)}function Be(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new e.Buf16(320),this.work=new e.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ze(U){var te;return!U||!U.state?v:(te=U.state,U.total_in=U.total_out=te.total=0,U.msg="",te.wrap&&(U.adler=te.wrap&1),te.mode=H,te.last=0,te.havedict=0,te.dmax=32768,te.head=null,te.hold=0,te.bits=0,te.lencode=te.lendyn=new e.Buf32(Z),te.distcode=te.distdyn=new e.Buf32(ue),te.sane=1,te.back=-1,h)}function Fe(U){var te;return!U||!U.state?v:(te=U.state,te.wsize=0,te.whave=0,te.wnext=0,ze(U))}function Me(U,te){var d,le;return!U||!U.state||(le=U.state,te<0?(d=0,te=-te):(d=(te>>4)+1,te<48&&(te&=15)),te&&(te<8||te>15))?v:(le.window!==null&&le.wbits!==te&&(le.window=null),le.wrap=d,le.wbits=te,Fe(U))}function nt(U,te){var d,le;return U?(le=new Be,U.state=le,le.window=null,d=Me(U,te),d!==h&&(U.state=null),d):v}function S(U){return nt(U,_e)}var I=!0,de,ae;function pe(U){if(I){var te;for(de=new e.Buf32(512),ae=new e.Buf32(32),te=0;te<144;)U.lens[te++]=8;for(;te<256;)U.lens[te++]=9;for(;te<280;)U.lens[te++]=7;for(;te<288;)U.lens[te++]=8;for(i(s,U.lens,0,288,de,0,U.work,{bits:9}),te=0;te<32;)U.lens[te++]=5;i(u,U.lens,0,32,ae,0,U.work,{bits:5}),I=!1}U.lencode=de,U.lenbits=9,U.distcode=ae,U.distbits=5}function je(U,te,d,le){var Ae,a=U.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new e.Buf8(a.wsize)),le>=a.wsize?(e.arraySet(a.window,te,d-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(Ae=a.wsize-a.wnext,Ae>le&&(Ae=le),e.arraySet(a.window,te,d-le,Ae,a.wnext),le-=Ae,le?(e.arraySet(a.window,te,d-le,le,0),a.wnext=le,a.whave=a.wsize):(a.wnext+=Ae,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=Ae))),0}function w(U,te){var d,le,Ae,a,X,Y,g,$,K,Re,me,Ee,$e,it,Ze=0,xe,rt,at,gt,xt,Hr,et,Et,ot=new e.Buf8(4),kt,ct,Wn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!U||!U.state||!U.output||!U.input&&U.avail_in!==0)return v;d=U.state,d.mode===b&&(d.mode=B),X=U.next_out,Ae=U.output,g=U.avail_out,a=U.next_in,le=U.input,Y=U.avail_in,$=d.hold,K=d.bits,Re=Y,me=g,Et=h;e:for(;;)switch(d.mode){case H:if(d.wrap===0){d.mode=B;break}for(;K<16;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if(d.wrap&2&&$===35615){d.check=0,ot[0]=$&255,ot[1]=$>>>8&255,d.check=r(d.check,ot,2,0),$=0,K=0,d.mode=R;break}if(d.flags=0,d.head&&(d.head.done=!1),!(d.wrap&1)||((($&255)<<8)+($>>8))%31){U.msg="incorrect header check",d.mode=Oe;break}if(($&15)!==E){U.msg="unknown compression method",d.mode=Oe;break}if($>>>=4,K-=4,et=($&15)+8,d.wbits===0)d.wbits=et;else if(et>d.wbits){U.msg="invalid window size",d.mode=Oe;break}d.dmax=1<<et,U.adler=d.check=1,d.mode=$&512?_:b,$=0,K=0;break;case R:for(;K<16;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if(d.flags=$,(d.flags&255)!==E){U.msg="unknown compression method",d.mode=Oe;break}if(d.flags&57344){U.msg="unknown header flags set",d.mode=Oe;break}d.head&&(d.head.text=$>>8&1),d.flags&512&&(ot[0]=$&255,ot[1]=$>>>8&255,d.check=r(d.check,ot,2,0)),$=0,K=0,d.mode=V;case V:for(;K<32;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}d.head&&(d.head.time=$),d.flags&512&&(ot[0]=$&255,ot[1]=$>>>8&255,ot[2]=$>>>16&255,ot[3]=$>>>24&255,d.check=r(d.check,ot,4,0)),$=0,K=0,d.mode=x;case x:for(;K<16;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}d.head&&(d.head.xflags=$&255,d.head.os=$>>8),d.flags&512&&(ot[0]=$&255,ot[1]=$>>>8&255,d.check=r(d.check,ot,2,0)),$=0,K=0,d.mode=j;case j:if(d.flags&1024){for(;K<16;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}d.length=$,d.head&&(d.head.extra_len=$),d.flags&512&&(ot[0]=$&255,ot[1]=$>>>8&255,d.check=r(d.check,ot,2,0)),$=0,K=0}else d.head&&(d.head.extra=null);d.mode=ee;case ee:if(d.flags&1024&&(Ee=d.length,Ee>Y&&(Ee=Y),Ee&&(d.head&&(et=d.head.extra_len-d.length,d.head.extra||(d.head.extra=new Array(d.head.extra_len)),e.arraySet(d.head.extra,le,a,Ee,et)),d.flags&512&&(d.check=r(d.check,le,Ee,a)),Y-=Ee,a+=Ee,d.length-=Ee),d.length))break e;d.length=0,d.mode=z;case z:if(d.flags&2048){if(Y===0)break e;Ee=0;do et=le[a+Ee++],d.head&&et&&d.length<65536&&(d.head.name+=String.fromCharCode(et));while(et&&Ee<Y);if(d.flags&512&&(d.check=r(d.check,le,Ee,a)),Y-=Ee,a+=Ee,et)break e}else d.head&&(d.head.name=null);d.length=0,d.mode=C;case C:if(d.flags&4096){if(Y===0)break e;Ee=0;do et=le[a+Ee++],d.head&&et&&d.length<65536&&(d.head.comment+=String.fromCharCode(et));while(et&&Ee<Y);if(d.flags&512&&(d.check=r(d.check,le,Ee,a)),Y-=Ee,a+=Ee,et)break e}else d.head&&(d.head.comment=null);d.mode=G;case G:if(d.flags&512){for(;K<16;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if($!==(d.check&65535)){U.msg="header crc mismatch",d.mode=Oe;break}$=0,K=0}d.head&&(d.head.hcrc=d.flags>>9&1,d.head.done=!0),U.adler=d.check=0,d.mode=b;break;case _:for(;K<32;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}U.adler=d.check=Ie($),$=0,K=0,d.mode=y;case y:if(d.havedict===0)return U.next_out=X,U.avail_out=g,U.next_in=a,U.avail_in=Y,d.hold=$,d.bits=K,p;U.adler=d.check=1,d.mode=b;case b:if(te===f||te===c)break e;case B:if(d.last){$>>>=K&7,K-=K&7,d.mode=be;break}for(;K<3;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}switch(d.last=$&1,$>>>=1,K-=1,$&3){case 0:d.mode=W;break;case 1:if(pe(d),d.mode=ne,te===c){$>>>=2,K-=2;break e}break;case 2:d.mode=P;break;case 3:U.msg="invalid block type",d.mode=Oe}$>>>=2,K-=2;break;case W:for($>>>=K&7,K-=K&7;K<32;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if(($&65535)!==($>>>16^65535)){U.msg="invalid stored block lengths",d.mode=Oe;break}if(d.length=$&65535,$=0,K=0,d.mode=N,te===c)break e;case N:d.mode=k;case k:if(Ee=d.length,Ee){if(Ee>Y&&(Ee=Y),Ee>g&&(Ee=g),Ee===0)break e;e.arraySet(Ae,le,a,Ee,X),Y-=Ee,a+=Ee,g-=Ee,X+=Ee,d.length-=Ee;break}d.mode=b;break;case P:for(;K<14;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if(d.nlen=($&31)+257,$>>>=5,K-=5,d.ndist=($&31)+1,$>>>=5,K-=5,d.ncode=($&15)+4,$>>>=4,K-=4,d.nlen>286||d.ndist>30){U.msg="too many length or distance symbols",d.mode=Oe;break}d.have=0,d.mode=O;case O:for(;d.have<d.ncode;){for(;K<3;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}d.lens[Wn[d.have++]]=$&7,$>>>=3,K-=3}for(;d.have<19;)d.lens[Wn[d.have++]]=0;if(d.lencode=d.lendyn,d.lenbits=7,kt={bits:d.lenbits},Et=i(o,d.lens,0,19,d.lencode,0,d.work,kt),d.lenbits=kt.bits,Et){U.msg="invalid code lengths set",d.mode=Oe;break}d.have=0,d.mode=J;case J:for(;d.have<d.nlen+d.ndist;){for(;Ze=d.lencode[$&(1<<d.lenbits)-1],xe=Ze>>>24,rt=Ze>>>16&255,at=Ze&65535,!(xe<=K);){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if(at<16)$>>>=xe,K-=xe,d.lens[d.have++]=at;else{if(at===16){for(ct=xe+2;K<ct;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if($>>>=xe,K-=xe,d.have===0){U.msg="invalid bit length repeat",d.mode=Oe;break}et=d.lens[d.have-1],Ee=3+($&3),$>>>=2,K-=2}else if(at===17){for(ct=xe+3;K<ct;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}$>>>=xe,K-=xe,et=0,Ee=3+($&7),$>>>=3,K-=3}else{for(ct=xe+7;K<ct;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}$>>>=xe,K-=xe,et=0,Ee=11+($&127),$>>>=7,K-=7}if(d.have+Ee>d.nlen+d.ndist){U.msg="invalid bit length repeat",d.mode=Oe;break}for(;Ee--;)d.lens[d.have++]=et}}if(d.mode===Oe)break;if(d.lens[256]===0){U.msg="invalid code -- missing end-of-block",d.mode=Oe;break}if(d.lenbits=9,kt={bits:d.lenbits},Et=i(s,d.lens,0,d.nlen,d.lencode,0,d.work,kt),d.lenbits=kt.bits,Et){U.msg="invalid literal/lengths set",d.mode=Oe;break}if(d.distbits=6,d.distcode=d.distdyn,kt={bits:d.distbits},Et=i(u,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,kt),d.distbits=kt.bits,Et){U.msg="invalid distances set",d.mode=Oe;break}if(d.mode=ne,te===c)break e;case ne:d.mode=re;case re:if(Y>=6&&g>=258){U.next_out=X,U.avail_out=g,U.next_in=a,U.avail_in=Y,d.hold=$,d.bits=K,n(U,me),X=U.next_out,Ae=U.output,g=U.avail_out,a=U.next_in,le=U.input,Y=U.avail_in,$=d.hold,K=d.bits,d.mode===b&&(d.back=-1);break}for(d.back=0;Ze=d.lencode[$&(1<<d.lenbits)-1],xe=Ze>>>24,rt=Ze>>>16&255,at=Ze&65535,!(xe<=K);){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if(rt&&!(rt&240)){for(gt=xe,xt=rt,Hr=at;Ze=d.lencode[Hr+(($&(1<<gt+xt)-1)>>gt)],xe=Ze>>>24,rt=Ze>>>16&255,at=Ze&65535,!(gt+xe<=K);){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}$>>>=gt,K-=gt,d.back+=gt}if($>>>=xe,K-=xe,d.back+=xe,d.length=at,rt===0){d.mode=ge;break}if(rt&32){d.back=-1,d.mode=b;break}if(rt&64){U.msg="invalid literal/length code",d.mode=Oe;break}d.extra=rt&15,d.mode=se;case se:if(d.extra){for(ct=d.extra;K<ct;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}d.length+=$&(1<<d.extra)-1,$>>>=d.extra,K-=d.extra,d.back+=d.extra}d.was=d.length,d.mode=ce;case ce:for(;Ze=d.distcode[$&(1<<d.distbits)-1],xe=Ze>>>24,rt=Ze>>>16&255,at=Ze&65535,!(xe<=K);){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if(!(rt&240)){for(gt=xe,xt=rt,Hr=at;Ze=d.distcode[Hr+(($&(1<<gt+xt)-1)>>gt)],xe=Ze>>>24,rt=Ze>>>16&255,at=Ze&65535,!(gt+xe<=K);){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}$>>>=gt,K-=gt,d.back+=gt}if($>>>=xe,K-=xe,d.back+=xe,rt&64){U.msg="invalid distance code",d.mode=Oe;break}d.offset=at,d.extra=rt&15,d.mode=he;case he:if(d.extra){for(ct=d.extra;K<ct;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}d.offset+=$&(1<<d.extra)-1,$>>>=d.extra,K-=d.extra,d.back+=d.extra}if(d.offset>d.dmax){U.msg="invalid distance too far back",d.mode=Oe;break}d.mode=Se;case Se:if(g===0)break e;if(Ee=me-g,d.offset>Ee){if(Ee=d.offset-Ee,Ee>d.whave&&d.sane){U.msg="invalid distance too far back",d.mode=Oe;break}Ee>d.wnext?(Ee-=d.wnext,$e=d.wsize-Ee):$e=d.wnext-Ee,Ee>d.length&&(Ee=d.length),it=d.window}else it=Ae,$e=X-d.offset,Ee=d.length;Ee>g&&(Ee=g),g-=Ee,d.length-=Ee;do Ae[X++]=it[$e++];while(--Ee);d.length===0&&(d.mode=re);break;case ge:if(g===0)break e;Ae[X++]=d.length,g--,d.mode=re;break;case be:if(d.wrap){for(;K<32;){if(Y===0)break e;Y--,$|=le[a++]<<K,K+=8}if(me-=g,U.total_out+=me,d.total+=me,me&&(U.adler=d.check=d.flags?r(d.check,Ae,me,X-me):t(d.check,Ae,me,X-me)),me=g,(d.flags?$:Ie($))!==d.check){U.msg="incorrect data check",d.mode=Oe;break}$=0,K=0}d.mode=Ce;case Ce:if(d.wrap&&d.flags){for(;K<32;){if(Y===0)break e;Y--,$+=le[a++]<<K,K+=8}if($!==(d.total&4294967295)){U.msg="incorrect length check",d.mode=Oe;break}$=0,K=0}d.mode=Le;case Le:Et=m;break e;case Oe:Et=q;break e;case T:return M;case L:default:return v}return U.next_out=X,U.avail_out=g,U.next_in=a,U.avail_in=Y,d.hold=$,d.bits=K,(d.wsize||me!==U.avail_out&&d.mode<Oe&&(d.mode<be||te!==l))&&je(U,U.output,U.next_out,me-U.avail_out),Re-=U.avail_in,me-=U.avail_out,U.total_in+=Re,U.total_out+=me,d.total+=me,d.wrap&&me&&(U.adler=d.check=d.flags?r(d.check,Ae,me,U.next_out-me):t(d.check,Ae,me,U.next_out-me)),U.data_type=d.bits+(d.last?64:0)+(d.mode===b?128:0)+(d.mode===ne||d.mode===N?256:0),(Re===0&&me===0||te===l)&&Et===h&&(Et=D),Et}function ie(U){if(!U||!U.state)return v;var te=U.state;return te.window&&(te.window=null),U.state=null,h}function fe(U,te){var d;return!U||!U.state||(d=U.state,!(d.wrap&2))?v:(d.head=te,te.done=!1,h)}function we(U,te){var d=te.length,le,Ae,a;return!U||!U.state||(le=U.state,le.wrap!==0&&le.mode!==y)?v:le.mode===y&&(Ae=1,Ae=t(Ae,te,d,0),Ae!==le.check)?q:(a=je(U,te,d,d),a?(le.mode=T,M):(le.havedict=1,h))}return Ct.inflateReset=Fe,Ct.inflateReset2=Me,Ct.inflateResetKeep=ze,Ct.inflateInit=S,Ct.inflateInit2=nt,Ct.inflate=w,Ct.inflateEnd=ie,Ct.inflateGetHeader=fe,Ct.inflateSetDictionary=we,Ct.inflateInfo="pako inflate (from Nodeca project)",Ct}var ss,Sf;function cE(){return Sf||(Sf=1,ss={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),ss}var Rf;function dE(){return Rf||(Rf=1,function(e){var t=Uf(),r=iE(),n=aE(),i=uE(),o=cE();for(var s in o)e[s]=o[s];e.NONE=0,e.DEFLATE=1,e.INFLATE=2,e.GZIP=3,e.GUNZIP=4,e.DEFLATERAW=5,e.INFLATERAW=6,e.UNZIP=7;var u=31,l=139;function f(c){if(typeof c!="number"||c<e.DEFLATE||c>e.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=c,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}f.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,t(this.init_done,"close before init"),t(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?n.deflateEnd(this.strm):(this.mode===e.INFLATE||this.mode===e.GUNZIP||this.mode===e.INFLATERAW||this.mode===e.UNZIP)&&i.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null},f.prototype.write=function(c,h,m,p,v,q,M){return this._write(!0,c,h,m,p,v,q,M)},f.prototype.writeSync=function(c,h,m,p,v,q,M){return this._write(!1,c,h,m,p,v,q,M)},f.prototype._write=function(c,h,m,p,v,q,M,D){if(t.equal(arguments.length,8),t(this.init_done,"write before init"),t(this.mode!==e.NONE,"already finalized"),t.equal(!1,this.write_in_progress,"write already in progress"),t.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,t.equal(!1,h===void 0,"must provide flush value"),this.write_in_progress=!0,h!==e.Z_NO_FLUSH&&h!==e.Z_PARTIAL_FLUSH&&h!==e.Z_SYNC_FLUSH&&h!==e.Z_FULL_FLUSH&&h!==e.Z_FINISH&&h!==e.Z_BLOCK)throw new Error("Invalid flush value");if(m==null&&(m=ye.Buffer.alloc(0),v=0,p=0),this.strm.avail_in=v,this.strm.input=m,this.strm.next_in=p,this.strm.avail_out=D,this.strm.output=q,this.strm.next_out=M,this.flush=h,!c)return this._process(),this._checkError()?this._afterSync():void 0;var E=this;return ye.process.nextTick(function(){E._process(),E._after()}),this},f.prototype._afterSync=function(){var c=this.strm.avail_out,h=this.strm.avail_in;return this.write_in_progress=!1,[h,c]},f.prototype._process=function(){var c=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=n.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(c=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(c===null)break;if(this.strm.input[c]===u){if(this.gzip_id_bytes_read=1,c++,this.strm.avail_in===1)break}else{this.mode=e.INFLATE;break}case 1:if(c===null)break;this.strm.input[c]===l?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=i.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=i.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=i.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=i.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},f.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===e.Z_FINISH)return this._error("unexpected end of file"),!1;break;case e.Z_STREAM_END:break;case e.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},f.prototype._after=function(){if(this._checkError()){var c=this.strm.avail_out,h=this.strm.avail_in;this.write_in_progress=!1,this.callback(h,c),this.pending_close&&this.close()}},f.prototype._error=function(c){this.strm.msg&&(c=this.strm.msg),this.onerror(c,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},f.prototype.init=function(c,h,m,p,v){t(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),t(c>=8&&c<=15,"invalid windowBits"),t(h>=-1&&h<=9,"invalid compression level"),t(m>=1&&m<=9,"invalid memlevel"),t(p===e.Z_FILTERED||p===e.Z_HUFFMAN_ONLY||p===e.Z_RLE||p===e.Z_FIXED||p===e.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(h,c,m,p,v),this._setDictionary()},f.prototype.params=function(){throw new Error("deflateParams Not supported")},f.prototype.reset=function(){this._reset(),this._setDictionary()},f.prototype._init=function(c,h,m,p,v){switch(this.level=c,this.windowBits=h,this.memLevel=m,this.strategy=p,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,(this.mode===e.GZIP||this.mode===e.GUNZIP)&&(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),(this.mode===e.DEFLATERAW||this.mode===e.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new r,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=n.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=i.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==e.Z_OK&&this._error("Init error"),this.dictionary=v,this.write_in_progress=!1,this.init_done=!0},f.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=n.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==e.Z_OK&&this._error("Failed to set dictionary")}},f.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=n.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=i.inflateReset(this.strm);break}this.err!==e.Z_OK&&this._error("Failed to reset stream")},e.Zlib=f}(Yo)),Yo}var Af;function hE(){return Af||(Af=1,function(e){var t=er.Buffer,r=Qd().Transform,n=dE(),i=Ff,o=Uf().ok,s=er.kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes";n.Z_MIN_WINDOWBITS=8,n.Z_MAX_WINDOWBITS=15,n.Z_DEFAULT_WINDOWBITS=15,n.Z_MIN_CHUNK=64,n.Z_MAX_CHUNK=1/0,n.Z_DEFAULT_CHUNK=16*1024,n.Z_MIN_MEMLEVEL=1,n.Z_MAX_MEMLEVEL=9,n.Z_DEFAULT_MEMLEVEL=8,n.Z_MIN_LEVEL=-1,n.Z_MAX_LEVEL=9,n.Z_DEFAULT_LEVEL=n.Z_DEFAULT_COMPRESSION;for(var l=Object.keys(n),f=0;f<l.length;f++){var c=l[f];c.match(/^Z/)&&Object.defineProperty(e,c,{enumerable:!0,value:n[c],writable:!1})}for(var h={Z_OK:n.Z_OK,Z_STREAM_END:n.Z_STREAM_END,Z_NEED_DICT:n.Z_NEED_DICT,Z_ERRNO:n.Z_ERRNO,Z_STREAM_ERROR:n.Z_STREAM_ERROR,Z_DATA_ERROR:n.Z_DATA_ERROR,Z_MEM_ERROR:n.Z_MEM_ERROR,Z_BUF_ERROR:n.Z_BUF_ERROR,Z_VERSION_ERROR:n.Z_VERSION_ERROR},m=Object.keys(h),p=0;p<m.length;p++){var v=m[p];h[h[v]]=v}Object.defineProperty(e,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),e.Deflate=D,e.Inflate=E,e.Gzip=H,e.Gunzip=R,e.DeflateRaw=V,e.InflateRaw=x,e.Unzip=j,e.createDeflate=function(_){return new D(_)},e.createInflate=function(_){return new E(_)},e.createDeflateRaw=function(_){return new V(_)},e.createInflateRaw=function(_){return new x(_)},e.createGzip=function(_){return new H(_)},e.createGunzip=function(_){return new R(_)},e.createUnzip=function(_){return new j(_)},e.deflate=function(_,y,b){return typeof y=="function"&&(b=y,y={}),q(new D(y),_,b)},e.deflateSync=function(_,y){return M(new D(y),_)},e.gzip=function(_,y,b){return typeof y=="function"&&(b=y,y={}),q(new H(y),_,b)},e.gzipSync=function(_,y){return M(new H(y),_)},e.deflateRaw=function(_,y,b){return typeof y=="function"&&(b=y,y={}),q(new V(y),_,b)},e.deflateRawSync=function(_,y){return M(new V(y),_)},e.unzip=function(_,y,b){return typeof y=="function"&&(b=y,y={}),q(new j(y),_,b)},e.unzipSync=function(_,y){return M(new j(y),_)},e.inflate=function(_,y,b){return typeof y=="function"&&(b=y,y={}),q(new E(y),_,b)},e.inflateSync=function(_,y){return M(new E(y),_)},e.gunzip=function(_,y,b){return typeof y=="function"&&(b=y,y={}),q(new R(y),_,b)},e.gunzipSync=function(_,y){return M(new R(y),_)},e.inflateRaw=function(_,y,b){return typeof y=="function"&&(b=y,y={}),q(new x(y),_,b)},e.inflateRawSync=function(_,y){return M(new x(y),_)};function q(_,y,b){var B=[],W=0;_.on("error",k),_.on("end",P),_.end(y),N();function N(){for(var O;(O=_.read())!==null;)B.push(O),W+=O.length;_.once("readable",N)}function k(O){_.removeListener("end",P),_.removeListener("readable",N),b(O)}function P(){var O,J=null;W>=s?J=new RangeError(u):O=t.concat(B,W),B=[],_.close(),b(J,O)}}function M(_,y){if(typeof y=="string"&&(y=t.from(y)),!t.isBuffer(y))throw new TypeError("Not a string or buffer");var b=_._finishFlushFlag;return _._processChunk(y,b)}function D(_){if(!(this instanceof D))return new D(_);z.call(this,_,n.DEFLATE)}function E(_){if(!(this instanceof E))return new E(_);z.call(this,_,n.INFLATE)}function H(_){if(!(this instanceof H))return new H(_);z.call(this,_,n.GZIP)}function R(_){if(!(this instanceof R))return new R(_);z.call(this,_,n.GUNZIP)}function V(_){if(!(this instanceof V))return new V(_);z.call(this,_,n.DEFLATERAW)}function x(_){if(!(this instanceof x))return new x(_);z.call(this,_,n.INFLATERAW)}function j(_){if(!(this instanceof j))return new j(_);z.call(this,_,n.UNZIP)}function ee(_){return _===n.Z_NO_FLUSH||_===n.Z_PARTIAL_FLUSH||_===n.Z_SYNC_FLUSH||_===n.Z_FULL_FLUSH||_===n.Z_FINISH||_===n.Z_BLOCK}function z(_,y){var b=this;if(this._opts=_=_||{},this._chunkSize=_.chunkSize||e.Z_DEFAULT_CHUNK,r.call(this,_),_.flush&&!ee(_.flush))throw new Error("Invalid flush flag: "+_.flush);if(_.finishFlush&&!ee(_.finishFlush))throw new Error("Invalid flush flag: "+_.finishFlush);if(this._flushFlag=_.flush||n.Z_NO_FLUSH,this._finishFlushFlag=typeof _.finishFlush<"u"?_.finishFlush:n.Z_FINISH,_.chunkSize&&(_.chunkSize<e.Z_MIN_CHUNK||_.chunkSize>e.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+_.chunkSize);if(_.windowBits&&(_.windowBits<e.Z_MIN_WINDOWBITS||_.windowBits>e.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+_.windowBits);if(_.level&&(_.level<e.Z_MIN_LEVEL||_.level>e.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+_.level);if(_.memLevel&&(_.memLevel<e.Z_MIN_MEMLEVEL||_.memLevel>e.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+_.memLevel);if(_.strategy&&_.strategy!=e.Z_FILTERED&&_.strategy!=e.Z_HUFFMAN_ONLY&&_.strategy!=e.Z_RLE&&_.strategy!=e.Z_FIXED&&_.strategy!=e.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+_.strategy);if(_.dictionary&&!t.isBuffer(_.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new n.Zlib(y);var B=this;this._hadError=!1,this._handle.onerror=function(k,P){C(B),B._hadError=!0;var O=new Error(k);O.errno=P,O.code=e.codes[P],B.emit("error",O)};var W=e.Z_DEFAULT_COMPRESSION;typeof _.level=="number"&&(W=_.level);var N=e.Z_DEFAULT_STRATEGY;typeof _.strategy=="number"&&(N=_.strategy),this._handle.init(_.windowBits||e.Z_DEFAULT_WINDOWBITS,W,_.memLevel||e.Z_DEFAULT_MEMLEVEL,N,_.dictionary),this._buffer=t.allocUnsafe(this._chunkSize),this._offset=0,this._level=W,this._strategy=N,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!b._handle},configurable:!0,enumerable:!0})}i.inherits(z,r),z.prototype.params=function(_,y,b){if(_<e.Z_MIN_LEVEL||_>e.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+_);if(y!=e.Z_FILTERED&&y!=e.Z_HUFFMAN_ONLY&&y!=e.Z_RLE&&y!=e.Z_FIXED&&y!=e.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+y);if(this._level!==_||this._strategy!==y){var B=this;this.flush(n.Z_SYNC_FLUSH,function(){o(B._handle,"zlib binding closed"),B._handle.params(_,y),B._hadError||(B._level=_,B._strategy=y,b&&b())})}else ye.process.nextTick(b)},z.prototype.reset=function(){return o(this._handle,"zlib binding closed"),this._handle.reset()},z.prototype._flush=function(_){this._transform(t.alloc(0),"",_)},z.prototype.flush=function(_,y){var b=this,B=this._writableState;(typeof _=="function"||_===void 0&&!y)&&(y=_,_=n.Z_FULL_FLUSH),B.ended?y&&ye.process.nextTick(y):B.ending?y&&this.once("end",y):B.needDrain?y&&this.once("drain",function(){return b.flush(_,y)}):(this._flushFlag=_,this.write(t.alloc(0),"",y))},z.prototype.close=function(_){C(this,_),ye.process.nextTick(G,this)};function C(_,y){y&&ye.process.nextTick(y),_._handle&&(_._handle.close(),_._handle=null)}function G(_){_.emit("close")}z.prototype._transform=function(_,y,b){var B,W=this._writableState,N=W.ending||W.ended,k=N&&(!_||W.length===_.length);if(_!==null&&!t.isBuffer(_))return b(new Error("invalid input"));if(!this._handle)return b(new Error("zlib binding closed"));k?B=this._finishFlushFlag:(B=this._flushFlag,_.length>=W.length&&(this._flushFlag=this._opts.flush||n.Z_NO_FLUSH)),this._processChunk(_,B,b)},z.prototype._processChunk=function(_,y,b){var B=_&&_.length,W=this._chunkSize-this._offset,N=0,k=this,P=typeof b=="function";if(!P){var O=[],J=0,ne;this.on("error",function(Se){ne=Se}),o(this._handle,"zlib binding closed");do var re=this._handle.writeSync(y,_,N,B,this._buffer,this._offset,W);while(!this._hadError&&he(re[0],re[1]));if(this._hadError)throw ne;if(J>=s)throw C(this),new RangeError(u);var se=t.concat(O,J);return C(this),se}o(this._handle,"zlib binding closed");var ce=this._handle.write(y,_,N,B,this._buffer,this._offset,W);ce.buffer=_,ce.callback=he;function he(Se,ge){if(this&&(this.buffer=null,this.callback=null),!k._hadError){var be=W-ge;if(o(be>=0,"have should not go down"),be>0){var Ce=k._buffer.slice(k._offset,k._offset+be);k._offset+=be,P?k.push(Ce):(O.push(Ce),J+=Ce.length)}if((ge===0||k._offset>=k._chunkSize)&&(W=k._chunkSize,k._offset=0,k._buffer=t.allocUnsafe(k._chunkSize)),ge===0){if(N+=B-Se,B=Se,!P)return!0;var Le=k._handle.write(y,_,N,B,k._buffer,k._offset,k._chunkSize);Le.callback=he,Le.buffer=_;return}if(!P)return!1;b()}}},i.inherits(D,z),i.inherits(E,z),i.inherits(H,z),i.inherits(R,z),i.inherits(V,z),i.inherits(x,z),i.inherits(j,z)}(Xo)),Xo}Object.defineProperty(kr,"__esModule",{value:!0});kr.InvalidStatusCodeError=kr.InvalidCertError=void 0;const rd=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class Ns extends Error{constructor(t,r){super(t),this.fingerprint256=r}}kr.InvalidCertError=Ns;class va extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}kr.InvalidStatusCodeError=va;function nd(e,t){if(!t||t==="text"||t==="json")try{let r=new TextDecoder("utf8",{fatal:!0}).decode(e);if(t==="text")return r;try{return JSON.parse(r)}catch(n){if(t==="json")throw n;return r}}catch(r){if(t==="text"||t==="json")throw r}return e}let If={};function Ps(e,t){var m;let r={...rd,...t};const n=rh,i=nh,o=hE(),{promisify:s}=Ff,{resolve:u}=ih,l=!!/^https/.test(e);let f={method:r.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const c=p=>p.replace(/:| /g,"").toLowerCase();if(r.keepAlive){const p={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},v=[l,l&&((m=r.sslPinnedCertificates)==null?void 0:m.map(q=>c(q)).sort())].join();f.agent=If[v]||(If[v]=new(l?i:n).Agent(p))}r.type==="json"&&(f.headers["Content-Type"]="application/json"),r.data&&(r.method||(f.method="POST"),f.body=r.type==="json"?JSON.stringify(r.data):r.data),f.headers={...f.headers,...r.headers},r.sslAllowSelfSigned&&(f.rejectUnauthorized=!1);const h=async p=>{const v=p.statusCode;if(r.redirect&&300<=v&&v<400&&p.headers.location){if(r._redirectCount==10)throw new Error("Request failed. Too much redirects.");return r._redirectCount+=1,await Ps(u(e,p.headers.location),r)}if(r.expectStatusCode&&v!==r.expectStatusCode)throw p.resume(),new va(v);let q=[];for await(const H of p)q.push(H);let M=ye.Buffer.concat(q);const D=p.headers["content-encoding"];D==="br"&&(M=await s(o.brotliDecompress)(M)),(D==="gzip"||D==="deflate")&&(M=await s(o.unzip)(M));const E=nd(M,r.type);return r.full?{headers:p.headers,status:v,body:E}:E};return new Promise((p,v)=>{var H;const q=async R=>{if(R&&R.code==="DEPTH_ZERO_SELF_SIGNED_CERT")try{await Ps(e,{...r,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(V){V&&V.fingerprint256&&(R=new Ns(`Self-signed SSL certificate: ${V.fingerprint256}`,V.fingerprint256))}v(R)},M=(l?i:n).request(e,f,R=>{R.on("error",q),(async()=>{try{p(await h(R))}catch(V){v(V)}})()});M.on("error",q);const D=(H=r.sslPinnedCertificates)==null?void 0:H.map(R=>c(R)),E=R=>{var x;const V=c(((x=R.getPeerCertificate())==null?void 0:x.fingerprint256)||"");if(!(!V&&R.isSessionReused())&&!D.includes(V))return M.emit("error",new Ns(`Invalid SSL certificate: ${V} Expected: ${D}`,V)),M.abort()};r.sslPinnedCertificates&&M.on("socket",R=>{R.listeners("secureConnect").map(x=>(x.name||"").replace("bound ","")).includes("mfetchSecureConnect")||R.on("secureConnect",E.bind(null,R))}),r.keepAlive&&M.setNoDelay(!0),f.body&&M.write(f.body),M.end()})}const gE=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map(e=>e.toLowerCase())),_E=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map(e=>e.toLowerCase()));async function bE(e,t){let r={...rd,...t};const n=new Headers;r.type==="json"&&n.set("Content-Type","application/json");let i=new URL(e);if(i.username){const l=btoa(`${i.username}:${i.password}`);n.set("Authorization",`Basic ${l}`),i.username="",i.password=""}e=""+i;for(let l in r.headers){const f=l.toLowerCase();(gE.has(f)||r.cors&&!_E.has(f))&&n.set(l,r.headers[l])}let o={headers:n,redirect:r.redirect?"follow":"manual"};r.referrer||(o.referrerPolicy="no-referrer"),r.cors&&(o.mode="cors"),r.data&&(r.method||(o.method="POST"),o.body=r.type==="json"?JSON.stringify(r.data):r.data);const s=await fetch(e,o);if(r.expectStatusCode&&s.status!==r.expectStatusCode)throw new va(s.status);const u=nd(new Uint8Array(await s.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(s.headers.entries()),status:s.status,body:u}:u}const pE=!!(typeof ye.process=="object"&&ye.process.versions&&ye.process.versions.node&&ye.process.versions.v8);function yE(e,t){return(pE?Ps:bE)(e,t)}kr.default=yE;Object.defineProperty(sn,"__esModule",{value:!0});sn.getProvider=sn.fetchFromProvider=void 0;const wE=kr,mE=async(e,t)=>(await(0,wE.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;sn.fetchFromProvider=mE;const EE=e=>{var t;if(typeof e=="string")return e;if(((t=e==null?void 0:e.connection)==null?void 0:t.url)!==void 0)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")};sn.getProvider=EE;(function(e){var t=Ye&&Ye.__createBinding||(Object.create?function(i,o,s,u){u===void 0&&(u=s);var l=Object.getOwnPropertyDescriptor(o,s);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(i,u,l)}:function(i,o,s,u){u===void 0&&(u=s),i[u]=o[s]}),r=Ye&&Ye.__exportStar||function(i,o){for(var s in i)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&t(o,i,s)};Object.defineProperty(e,"__esModule",{value:!0}),e.toAscii=e.stripHexPrefix=e.padToEven=e.isHexString=e.isHexPrefixed=e.getKeys=e.getBinarySize=e.fromUtf8=e.fromAscii=e.arrayContainsArray=void 0,r(Hi,e),r(Ki,e),r(wa,e),r(zn,e),r(Xi,e),r(pt,e),r(Fr,e),r(Ea,e),r(Qc,e),r(eo,e);var n=Ge;Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return n.arrayContainsArray}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return n.fromUtf8}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return n.getBinarySize}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return n.getKeys}}),Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return n.isHexPrefixed}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return n.isHexString}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return n.padToEven}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return n.stripHexPrefix}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}}),r(to,e),r(sn,e)})(Tw);var id={exports:{}};(function(e){(function(t,r){e.exports?e.exports=r():t.log=r()})(Ye,function(){var t=function(){},r="undefined",n=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function o(q,M){var D=q[M];if(typeof D.bind=="function")return D.bind(q);try{return Function.prototype.bind.call(D,q)}catch{return function(){return Function.prototype.apply.apply(D,[q,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(q){return q==="debug"&&(q="log"),typeof console===r?!1:q==="trace"&&n?s:console[q]!==void 0?o(console,q):console.log!==void 0?o(console,"log"):t}function l(q,M){for(var D=0;D<i.length;D++){var E=i[D];this[E]=D<q?t:this.methodFactory(E,q,M)}this.log=this.debug}function f(q,M,D){return function(){typeof console!==r&&(l.call(this,M,D),this[q].apply(this,arguments))}}function c(q,M,D){return u(q)||f.apply(this,arguments)}function h(q,M,D){var E=this,H;M=M??"WARN";var R="loglevel";typeof q=="string"?R+=":"+q:typeof q=="symbol"&&(R=void 0);function V(z){var C=(i[z]||"silent").toUpperCase();if(!(typeof window===r||!R)){try{window.localStorage[R]=C;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+C+";"}catch{}}}function x(){var z;if(!(typeof window===r||!R)){try{z=window.localStorage[R]}catch{}if(typeof z===r)try{var C=window.document.cookie,G=C.indexOf(encodeURIComponent(R)+"=");G!==-1&&(z=/^([^;]+)/.exec(C.slice(G))[1])}catch{}return E.levels[z]===void 0&&(z=void 0),z}}function j(){if(!(typeof window===r||!R)){try{window.localStorage.removeItem(R);return}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}E.name=q,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=D||c,E.getLevel=function(){return H},E.setLevel=function(z,C){if(typeof z=="string"&&E.levels[z.toUpperCase()]!==void 0&&(z=E.levels[z.toUpperCase()]),typeof z=="number"&&z>=0&&z<=E.levels.SILENT){if(H=z,C!==!1&&V(z),l.call(E,z,q),typeof console===r&&z<E.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+z},E.setDefaultLevel=function(z){M=z,x()||E.setLevel(z,!1)},E.resetLevel=function(){E.setLevel(M,!1),j()},E.enableAll=function(z){E.setLevel(E.levels.TRACE,z)},E.disableAll=function(z){E.setLevel(E.levels.SILENT,z)};var ee=x();ee==null&&(ee=M),E.setLevel(ee,!1)}var m=new h,p={};m.getLogger=function(M){if(typeof M!="symbol"&&typeof M!="string"||M==="")throw new TypeError("You must supply a name when creating a logger.");var D=p[M];return D||(D=p[M]=new h(M,m.getLevel(),m.methodFactory)),D};var v=typeof window!==r?window.log:void 0;return m.noConflict=function(){return typeof window!==r&&window.log===m&&(window.log=v),m},m.getLoggers=function(){return p},m.default=m,m})})(id);var od=id.exports;const yi=Er(od);var wi={exports:{}};wi.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=800,o=16,s=9007199254740991,u="[object Arguments]",l="[object Array]",f="[object AsyncFunction]",c="[object Boolean]",h="[object Date]",m="[object Error]",p="[object Function]",v="[object GeneratorFunction]",q="[object Map]",M="[object Number]",D="[object Null]",E="[object Object]",H="[object Proxy]",R="[object RegExp]",V="[object Set]",x="[object String]",j="[object Undefined]",ee="[object WeakMap]",z="[object ArrayBuffer]",C="[object DataView]",G="[object Float32Array]",_="[object Float64Array]",y="[object Int8Array]",b="[object Int16Array]",B="[object Int32Array]",W="[object Uint8Array]",N="[object Uint8ClampedArray]",k="[object Uint16Array]",P="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,J=/^\[object .+?Constructor\]$/,ne=/^(?:0|[1-9]\d*)$/,re={};re[G]=re[_]=re[y]=re[b]=re[B]=re[W]=re[N]=re[k]=re[P]=!0,re[u]=re[l]=re[z]=re[c]=re[C]=re[h]=re[m]=re[p]=re[q]=re[M]=re[E]=re[R]=re[V]=re[x]=re[ee]=!1;var se=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,ce=typeof self=="object"&&self&&self.Object===Object&&self,he=se||ce||Function("return this")(),Se=t&&!t.nodeType&&t,ge=Se&&!0&&e&&!e.nodeType&&e,be=ge&&ge.exports===Se,Ce=be&&se.process,Le=function(){try{var A=ge&&ge.require&&ge.require("util").types;return A||Ce&&Ce.binding&&Ce.binding("util")}catch{}}(),Oe=Le&&Le.isTypedArray;function T(A,F,Q){switch(Q.length){case 0:return A.call(F);case 1:return A.call(F,Q[0]);case 2:return A.call(F,Q[0],Q[1]);case 3:return A.call(F,Q[0],Q[1],Q[2])}return A.apply(F,Q)}function L(A,F){for(var Q=-1,ve=Array(A);++Q<A;)ve[Q]=F(Q);return ve}function Z(A){return function(F){return A(F)}}function ue(A,F){return A==null?void 0:A[F]}function oe(A,F){return function(Q){return A(F(Q))}}var _e=Array.prototype,Ie=Function.prototype,Be=Object.prototype,ze=he["__core-js_shared__"],Fe=Ie.toString,Me=Be.hasOwnProperty,nt=function(){var A=/[^.]+$/.exec(ze&&ze.keys&&ze.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}(),S=Be.toString,I=Fe.call(Object),de=RegExp("^"+Fe.call(Me).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ae=be?he.Buffer:void 0,pe=he.Symbol,je=he.Uint8Array,w=ae?ae.allocUnsafe:void 0,ie=oe(Object.getPrototypeOf,Object),fe=Object.create,we=Be.propertyIsEnumerable,U=_e.splice,te=pe?pe.toStringTag:void 0,d=function(){try{var A=fo(Object,"defineProperty");return A({},"",{}),A}catch{}}(),le=ae?ae.isBuffer:void 0,Ae=Math.max,a=Date.now,X=fo(he,"Map"),Y=fo(Object,"create"),g=function(){function A(){}return function(F){if(!Rr(F))return{};if(fe)return fe(F);A.prototype=F;var Q=new A;return A.prototype=void 0,Q}}();function $(A){var F=-1,Q=A==null?0:A.length;for(this.clear();++F<Q;){var ve=A[F];this.set(ve[0],ve[1])}}function K(){this.__data__=Y?Y(null):{},this.size=0}function Re(A){var F=this.has(A)&&delete this.__data__[A];return this.size-=F?1:0,F}function me(A){var F=this.__data__;if(Y){var Q=F[A];return Q===n?void 0:Q}return Me.call(F,A)?F[A]:void 0}function Ee(A){var F=this.__data__;return Y?F[A]!==void 0:Me.call(F,A)}function $e(A,F){var Q=this.__data__;return this.size+=this.has(A)?0:1,Q[A]=Y&&F===void 0?n:F,this}$.prototype.clear=K,$.prototype.delete=Re,$.prototype.get=me,$.prototype.has=Ee,$.prototype.set=$e;function it(A){var F=-1,Q=A==null?0:A.length;for(this.clear();++F<Q;){var ve=A[F];this.set(ve[0],ve[1])}}function Ze(){this.__data__=[],this.size=0}function xe(A){var F=this.__data__,Q=Vn(F,A);if(Q<0)return!1;var ve=F.length-1;return Q==ve?F.pop():U.call(F,Q,1),--this.size,!0}function rt(A){var F=this.__data__,Q=Vn(F,A);return Q<0?void 0:F[Q][1]}function at(A){return Vn(this.__data__,A)>-1}function gt(A,F){var Q=this.__data__,ve=Vn(Q,A);return ve<0?(++this.size,Q.push([A,F])):Q[ve][1]=F,this}it.prototype.clear=Ze,it.prototype.delete=xe,it.prototype.get=rt,it.prototype.has=at,it.prototype.set=gt;function xt(A){var F=-1,Q=A==null?0:A.length;for(this.clear();++F<Q;){var ve=A[F];this.set(ve[0],ve[1])}}function Hr(){this.size=0,this.__data__={hash:new $,map:new(X||it),string:new $}}function et(A){var F=Gn(this,A).delete(A);return this.size-=F?1:0,F}function Et(A){return Gn(this,A).get(A)}function ot(A){return Gn(this,A).has(A)}function kt(A,F){var Q=Gn(this,A),ve=Q.size;return Q.set(A,F),this.size+=Q.size==ve?0:1,this}xt.prototype.clear=Hr,xt.prototype.delete=et,xt.prototype.get=Et,xt.prototype.has=ot,xt.prototype.set=kt;function ct(A){var F=this.__data__=new it(A);this.size=F.size}function Wn(){this.__data__=new it,this.size=0}function dd(A){var F=this.__data__,Q=F.delete(A);return this.size=F.size,Q}function hd(A){return this.__data__.get(A)}function gd(A){return this.__data__.has(A)}function _d(A,F){var Q=this.__data__;if(Q instanceof it){var ve=Q.__data__;if(!X||ve.length<r-1)return ve.push([A,F]),this.size=++Q.size,this;Q=this.__data__=new xt(ve)}return Q.set(A,F),this.size=Q.size,this}ct.prototype.clear=Wn,ct.prototype.delete=dd,ct.prototype.get=hd,ct.prototype.has=gd,ct.prototype.set=_d;function bd(A,F){var Q=ho(A),ve=!Q&&co(A),De=!Q&&!ve&&Na(A),We=!Q&&!ve&&!De&&Ba(A),Ke=Q||ve||De||We,ke=Ke?L(A.length,String):[],Je=ke.length;for(var It in A)(F||Me.call(A,It))&&!(Ke&&(It=="length"||De&&(It=="offset"||It=="parent")||We&&(It=="buffer"||It=="byteLength"||It=="byteOffset")||Ca(It,Je)))&&ke.push(It);return ke}function ao(A,F,Q){(Q!==void 0&&!Zn(A[F],Q)||Q===void 0&&!(F in A))&&lo(A,F,Q)}function pd(A,F,Q){var ve=A[F];(!(Me.call(A,F)&&Zn(ve,Q))||Q===void 0&&!(F in A))&&lo(A,F,Q)}function Vn(A,F){for(var Q=A.length;Q--;)if(Zn(A[Q][0],F))return Q;return-1}function lo(A,F,Q){F=="__proto__"&&d?d(A,F,{configurable:!0,enumerable:!0,value:Q,writable:!0}):A[F]=Q}var yd=Nd();function qn(A){return A==null?A===void 0?j:D:te&&te in Object(A)?Pd(A):Md(A)}function Ta(A){return dn(A)&&qn(A)==u}function wd(A){if(!Rr(A)||kd(A))return!1;var F=_o(A)?de:J;return F.test(Hd(A))}function md(A){return dn(A)&&Pa(A.length)&&!!re[qn(A)]}function Ed(A){if(!Rr(A))return Dd(A);var F=La(A),Q=[];for(var ve in A)ve=="constructor"&&(F||!Me.call(A,ve))||Q.push(ve);return Q}function Oa(A,F,Q,ve,De){A!==F&&yd(F,function(We,Ke){if(De||(De=new ct),Rr(We))vd(A,F,Ke,Q,Oa,ve,De);else{var ke=ve?ve(uo(A,Ke),We,Ke+"",A,F,De):void 0;ke===void 0&&(ke=We),ao(A,Ke,ke)}},$a)}function vd(A,F,Q,ve,De,We,Ke){var ke=uo(A,Q),Je=uo(F,Q),It=Ke.get(Je);if(It){ao(A,Q,It);return}var Rt=We?We(ke,Je,Q+"",A,F,Ke):void 0,hn=Rt===void 0;if(hn){var bo=ho(Je),po=!bo&&Na(Je),ka=!bo&&!po&&Ba(Je);Rt=Je,bo||po||ka?ho(ke)?Rt=ke:zd(ke)?Rt=Od(ke):po?(hn=!1,Rt=Ad(Je,!0)):ka?(hn=!1,Rt=Td(Je,!0)):Rt=[]:Wd(Je)||co(Je)?(Rt=ke,co(ke)?Rt=Vd(ke):(!Rr(ke)||_o(ke))&&(Rt=Bd(Je))):hn=!1}hn&&(Ke.set(Je,Rt),De(Rt,Je,ve,We,Ke),Ke.delete(Je)),ao(A,Q,Rt)}function Sd(A,F){return Ud(jd(A,F,xa),A+"")}var Rd=d?function(A,F){return d(A,"toString",{configurable:!0,enumerable:!1,value:Gd(F),writable:!0})}:xa;function Ad(A,F){if(F)return A.slice();var Q=A.length,ve=w?w(Q):new A.constructor(Q);return A.copy(ve),ve}function Id(A){var F=new A.constructor(A.byteLength);return new je(F).set(new je(A)),F}function Td(A,F){var Q=F?Id(A.buffer):A.buffer;return new A.constructor(Q,A.byteOffset,A.length)}function Od(A,F){var Q=-1,ve=A.length;for(F||(F=Array(ve));++Q<ve;)F[Q]=A[Q];return F}function Cd(A,F,Q,ve){var De=!Q;Q||(Q={});for(var We=-1,Ke=F.length;++We<Ke;){var ke=F[We],Je=ve?ve(Q[ke],A[ke],ke,Q,A):void 0;Je===void 0&&(Je=A[ke]),De?lo(Q,ke,Je):pd(Q,ke,Je)}return Q}function Ld(A){return Sd(function(F,Q){var ve=-1,De=Q.length,We=De>1?Q[De-1]:void 0,Ke=De>2?Q[2]:void 0;for(We=A.length>3&&typeof We=="function"?(De--,We):void 0,Ke&&$d(Q[0],Q[1],Ke)&&(We=De<3?void 0:We,De=1),F=Object(F);++ve<De;){var ke=Q[ve];ke&&A(F,ke,ve,We)}return F})}function Nd(A){return function(F,Q,ve){for(var De=-1,We=Object(F),Ke=ve(F),ke=Ke.length;ke--;){var Je=Ke[A?ke:++De];if(Q(We[Je],Je,We)===!1)break}return F}}function Gn(A,F){var Q=A.__data__;return xd(F)?Q[typeof F=="string"?"string":"hash"]:Q.map}function fo(A,F){var Q=ue(A,F);return wd(Q)?Q:void 0}function Pd(A){var F=Me.call(A,te),Q=A[te];try{A[te]=void 0;var ve=!0}catch{}var De=S.call(A);return ve&&(F?A[te]=Q:delete A[te]),De}function Bd(A){return typeof A.constructor=="function"&&!La(A)?g(ie(A)):{}}function Ca(A,F){var Q=typeof A;return F=F??s,!!F&&(Q=="number"||Q!="symbol"&&ne.test(A))&&A>-1&&A%1==0&&A<F}function $d(A,F,Q){if(!Rr(Q))return!1;var ve=typeof F;return(ve=="number"?go(Q)&&Ca(F,Q.length):ve=="string"&&F in Q)?Zn(Q[F],A):!1}function xd(A){var F=typeof A;return F=="string"||F=="number"||F=="symbol"||F=="boolean"?A!=="__proto__":A===null}function kd(A){return!!nt&&nt in A}function La(A){var F=A&&A.constructor,Q=typeof F=="function"&&F.prototype||Be;return A===Q}function Dd(A){var F=[];if(A!=null)for(var Q in Object(A))F.push(Q);return F}function Md(A){return S.call(A)}function jd(A,F,Q){return F=Ae(F===void 0?A.length-1:F,0),function(){for(var ve=arguments,De=-1,We=Ae(ve.length-F,0),Ke=Array(We);++De<We;)Ke[De]=ve[F+De];De=-1;for(var ke=Array(F+1);++De<F;)ke[De]=ve[De];return ke[F]=Q(Ke),T(A,this,ke)}}function uo(A,F){if(!(F==="constructor"&&typeof A[F]=="function")&&F!="__proto__")return A[F]}var Ud=Fd(Rd);function Fd(A){var F=0,Q=0;return function(){var ve=a(),De=o-(ve-Q);if(Q=ve,De>0){if(++F>=i)return arguments[0]}else F=0;return A.apply(void 0,arguments)}}function Hd(A){if(A!=null){try{return Fe.call(A)}catch{}try{return A+""}catch{}}return""}function Zn(A,F){return A===F||A!==A&&F!==F}var co=Ta(function(){return arguments}())?Ta:function(A){return dn(A)&&Me.call(A,"callee")&&!we.call(A,"callee")},ho=Array.isArray;function go(A){return A!=null&&Pa(A.length)&&!_o(A)}function zd(A){return dn(A)&&go(A)}var Na=le||Zd;function _o(A){if(!Rr(A))return!1;var F=qn(A);return F==p||F==v||F==f||F==H}function Pa(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function Rr(A){var F=typeof A;return A!=null&&(F=="object"||F=="function")}function dn(A){return A!=null&&typeof A=="object"}function Wd(A){if(!dn(A)||qn(A)!=E)return!1;var F=ie(A);if(F===null)return!0;var Q=Me.call(F,"constructor")&&F.constructor;return typeof Q=="function"&&Q instanceof Q&&Fe.call(Q)==I}var Ba=Oe?Z(Oe):md;function Vd(A){return Cd(A,$a(A))}function $a(A){return go(A)?bd(A,!0):Ed(A)}var qd=Ld(function(A,F,Q){Oa(A,F,Q)});function Gd(A){return function(){return A}}function xa(A){return A}function Zd(){return!1}e.exports=qd})(wi,wi.exports);wi.exports;const vE=yi.getLogger("http-helpers");vE.setLevel(od.levels.INFO);fh();const vn={IFRAME_STATUS:"iframe_status",CREATE_WINDOW:"create_window",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},Gt={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",OPENED_WINDOW:"opened_window",CLOSED_WINDOW:"closed_window",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key"},SE={GET_PROVIDER_STATE:"wallet_get_provider_state"},as={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"};function RE(e){return function(r,n,i){i(o=>{n.error&&yi.warn(`Error in RPC response:
|
|
4
4
|
`,n),!r.isTorusInternal&&(yi.info(`RPC (${e.origin}):`,r,"->",n),o())})}}var Tf;(function(e){e.approved="approved",e.cancelled="cancelled",e.confirmed="confirmed",e.failed="failed",e.finalized="finalized",e.processed="processed",e.rejected="rejected",e.signed="signed",e.submitted="submitted",e.unapproved="unapproved",e.dropped="dropped",e.expired="expired"})(Tf||(Tf={}));var no=eh(),AE=th();const IE=Er(AE);var TE={exports:{}},Sa={},Ra={};Object.defineProperty(Ra,"__esModule",{value:!0});function OE(e){var t=4,r=e.length,n=r%t;if(!n)return e;var i=r,o=t-n,s=r+o,u=ye.Buffer.alloc(s);for(u.write(e);o--;)u.write("=",i++);return u.toString()}Ra.default=OE;Object.defineProperty(Sa,"__esModule",{value:!0});var CE=Ra;function sd(e,t){return t===void 0&&(t="utf8"),ye.Buffer.isBuffer(e)?Bs(e.toString("base64")):Bs(ye.Buffer.from(e,t).toString("base64"))}function LE(e,t){return t===void 0&&(t="utf8"),ye.Buffer.from(Aa(e),"base64").toString(t)}function Aa(e){return e=e.toString(),CE.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function Bs(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function NE(e){return ye.Buffer.from(Aa(e),"base64")}var cn=sd;cn.encode=sd;cn.decode=LE;cn.toBase64=Aa;cn.fromBase64=Bs;cn.toBuffer=NE;Sa.default=cn;(function(e){e.exports=Sa.default,e.exports.default=e.exports})(TE);const PE=()=>IE(32).toString("hex");function ii(){}const Of="SYN",ls="ACK",Cf="BRK";class Lf extends no.Duplex{constructor(t){let{name:r,target:n,targetWindow:i=window,targetOrigin:o="*"}=t;if(super({objectMode:!0}),Te(this,"_init",void 0),Te(this,"_haveSyn",void 0),Te(this,"_name",void 0),Te(this,"_target",void 0),Te(this,"_targetWindow",void 0),Te(this,"_targetOrigin",void 0),Te(this,"_onMessage",void 0),Te(this,"_synIntervalId",void 0),!r||!n)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=r,this._target=n,this._targetWindow=i,this._targetOrigin=o,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write(Cf,null,ii),this._haveSyn=!1,this._init=!1}_handShake(){this._write(Of,null,ii),this.cork()}_onData(t){if(!this._init)t===Of?(this._haveSyn=!0,this._write(ls,null,ii)):t===ls&&(this._init=!0,this._haveSyn||this._write(ls,null,ii),this.uncork());else if(t===Cf)this._break();else try{this.push(t)}catch(r){this.emit("error",r)}}_postMessage(t){const r=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:t},r)}onMessage(t){const r=t.data;this._targetOrigin!=="*"&&t.origin!==this._targetOrigin||t.source!==this._targetWindow||typeof r!="object"||r.target!==this._name||!r.data||this._onData(r.data)}_read(){}_write(t,r,n){this._postMessage(t),n()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function Nf(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function BE(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}class io extends Dn.EventEmitter{emit(t){let r=t==="error";const n=this._events;if(n!==void 0)r=r&&n.error===void 0;else if(!r)return!1;for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(r){let l;if(o.length>0&&([l]=o),l instanceof Error)throw l;const f=new Error(`Unhandled error.${l?` (${l.message})`:""}`);throw f.context=l,f}const u=n[t];if(u===void 0)return!1;if(typeof u=="function")Nf(u,this,o);else{const l=u.length,f=BE(u);for(let c=0;c<l;c+=1)Nf(f[c],this,o)}return!0}}class Sn extends Error{constructor(t){let{code:r,message:n,data:i}=t;if(!Number.isInteger(r))throw new Error("code must be an integer");if(!n||typeof n!="string")throw new Error("message must be string");super(n),Te(this,"code",void 0),Te(this,"data",void 0),this.code=r,i!==void 0&&(this.data=i)}toString(){return sh({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const $s=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(n,i)=>{n||i.error?t(n||i.error):!r||Array.isArray(i)?e(i):e(i.result)}};function $E(){const e={};function t(){return!1}const r=new io;function n(l){const f=e[l.id];if(!f)throw new Error(`StreamMiddleware - Unknown response id "${l.id}"`);delete e[l.id],Object.assign(f.res,l),setTimeout(f.end)}function i(l){r.emit("notification",l)}function o(l,f,c){let h;try{!l.id?i(l):n(l)}catch(m){h=m}c(h)}const s=new no.Duplex({objectMode:!0,read:t,write:o});return{events:r,middleware:(l,f,c,h)=>{s.push(l),e[l.id]={req:l,res:f,next:c,end:h}},stream:s}}function xE(){return(e,t,r,n)=>{const i=e.id,o=PE();e.id=o,t.id=o,r(s=>{e.id=i,t.id=i,s()})}}function Pf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pf(Object(r),!0).forEach(function(n){Te(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}class or extends io{constructor(){super(),Te(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(t,r,n){const i=[];let o=null,s=!1;for(const u of n)if([o,s]=await or._runMiddleware(t,r,u,i),s)break;return[o,s,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(o=>{const s=l=>{const f=l||r.error;f&&(r.error=Ht.serializeError(f)),o([f,!0])},u=l=>{r.error?s(r.error):(l&&(typeof l!="function"&&s(new Sn({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),i.push(l)),o([null,!1]))};try{n(t,r,u,s)}catch(l){s(l)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(o=>o?i(o):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new Sn({code:-32603,message:"Response has no error or result for request"});if(!n)throw new Sn({code:-32603,message:"Nothing ended request"})}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[o,s,u]=await or._runAllMiddleware(t,r,this._middleware);return s?(await or._runReturnHandlers(u),i(o)):n(async l=>{try{await or._runReturnHandlers(u)}catch(f){return l(f)}return l()})}catch(o){return i(o)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const s=new Sn({code:-32603,message:"request must be plain object"});return r(s,{id:void 0,jsonrpc:"2.0",error:s})}if(typeof t.method!="string"){const s=new Sn({code:-32603,message:"method must be string"});return r(s,{id:t.id,jsonrpc:"2.0",error:s})}const n=kE({},t),i={id:n.id,jsonrpc:n.jsonrpc};let o=null;try{await this._processRequest(n,i)}catch(s){o=s}return o&&(delete i.result,i.error||(i.error=Ht.serializeError(o))),r(o,i)}async _processRequest(t,r){const[n,i,o]=await or._runAllMiddleware(t,r,this._middleware);if(or._checkForCompletion(t,r,i),await or._runReturnHandlers(o),n)throw n}}class DE extends no.Duplex{constructor(t){let{parent:r,name:n}=t;super({objectMode:!0}),Te(this,"_parent",void 0),Te(this,"_name",void 0),this._parent=r,this._name=n}_read(){}_write(t,r,n){this._parent.push({name:this._name,data:t}),n()}}function Bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $f(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bf(Object(r),!0).forEach(function(n){Te(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const xf=Symbol("IGNORE_SUBSTREAM");class ME extends no.Duplex{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super($f($f({},t),{},{objectMode:!0})),Te(this,"_substreams",void 0),Te(this,"getStream",void 0),this._substreams={}}createStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);const r=new DE({parent:this,name:t});return this._substreams[t]=r,jE(this,n=>r.destroy(n||void 0)),r}ignoreStream(t){if(!t)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${t}" already exists`);this._substreams[t]=xf}_read(){}_write(t,r,n){const{name:i,data:o}=t;if(!i)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${t}"`),n();const s=this._substreams[i];return s?(s!==xf&&s.push(o),n()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${i}"`),n())}}function jE(e,t){const r=hw(t);Ql(e,{readable:!1},r),Ql(e,{writable:!1},r)}const Qt=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";Qt.writable=e=>Qt(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";Qt.readable=e=>Qt(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";Qt.duplex=e=>Qt.writable(e)&&Qt.readable(e);Qt.transform=e=>Qt.duplex(e)&&typeof e._transform=="function";var UE=Qt,FE=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const HE=Er(FE);var zE="0.3.4",Xt={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:e=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:e=>`Invalid options. Received: { maxEventListeners: ${e}}`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`Torus: Connected to chain with ID "${e}".`},warnings:{}};const gv={MOONPAY:"moonpay",WYRE:"wyre",RAMPNETWORK:"rampnetwork",XANPOOL:"xanpool",MERCURYO:"mercuryo",TRANSAK:"transak"},WE={PRODUCTION:"production",DEVELOPMENT:"development",TESTING:"testing"},An={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},fs={GOOGLE:"google",FACEBOOK:"facebook",REDDIT:"reddit",DISCORD:"discord",TWITCH:"twitch",APPLE:"apple",LINE:"line",GITHUB:"github",KAKAO:"kakao",LINKEDIN:"linkedin",TWITTER:"twitter",WEIBO:"weibo",WECHAT:"wechat",EMAIL_PASSWORDLESS:"email_passwordless"},VE={en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies benötigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"継続する",actionRequired:"認証が必要です",pendingAction:"続行をクリックして、ポップアップでリクエストを続行します",cookiesRequired:"必要なクッキー",enableCookies:"Torusにアクセスするには、ブラウザの設定でCookieを有効にしてください。",clickHere:"詳しくは"}},ko:{embed:{continue:"계속하다",actionRequired:"승인 필요",pendingAction:"팝업에서 요청을 진행하려면 계속을 클릭하십시오.",cookiesRequired:"쿠키 필요",enableCookies:"브라우저 환경 설정에서 쿠키를 활성화하여 Torus에 액세스하십시오.",clickHere:"더 많은 정보"}},zh:{embed:{continue:"继续",actionRequired:"需要授权",pendingAction:"单击继续以在弹出窗口中继续您的请求",cookiesRequired:"必填Cookie",enableCookies:"请在您的浏览器首选项中启用cookie以访问Torus。",clickHere:"更多信息"}}};var Ia={supportedVerifierList:[fs.GOOGLE,fs.REDDIT,fs.DISCORD],api:"https://api.tor.us",translations:VE,prodTorusUrl:"",localStorageKeyPrefix:"torus-"},Ve=yi.getLogger("solana-embed");function qE(){return(e,t,r)=>{(typeof e.method!="string"||!e.method)&&(t.error=Ht.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),r(n=>{const{error:i}=t;return i&&Ve.error(`Torus - RPC Error: ${i.message}`,i),n()})}}function GE(e,t,r){let n=`Torus: Lost connection to "${e}".`;t!=null&&t.stack&&(n+=`
|