@wormhole-foundation/wormhole-connect 1.0.0-beta.3-development → 1.0.0-beta.5-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/{ccip-YN27M9dL.js → ccip-B-OK94pJ.js} +1 -1
- package/dist/assets/{evm-wKiUiV3-.js → evm-CPj7oFVL.js} +4 -4
- package/dist/assets/{index-B9_Snb-C.js → index-BWMdho2w.js} +2 -2
- package/dist/assets/{index-8fbGA94c.js → index-DGFWhjyA.js} +1 -1
- package/dist/assets/{index-BBy_QGBB.js → index-Ddso83Ti.js} +1 -1
- package/dist/assets/{index.es-BY7lrdO_.js → index.es-VchQxXD4.js} +2 -2
- package/dist/main.js +115 -62
- package/dist/src/components/v2/Button.d.ts +1 -1
- package/dist/src/components/v2/Button.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +17 -3
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistory.d.ts +1 -1
- package/dist/src/hooks/useTransactionHistory.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/dist/src/icons/TxReadyForClaim.d.ts +2 -2
- package/dist/src/icons/TxReadyForClaim.d.ts.map +1 -1
- package/dist/src/utils/inProgressTxCache.d.ts +5 -0
- package/dist/src/utils/inProgressTxCache.d.ts.map +1 -0
- package/dist/src/utils/polling.d.ts +5 -0
- package/dist/src/utils/polling.d.ts.map +1 -0
- package/dist/src/utils/sdkv2.d.ts +3 -2
- package/dist/src/utils/sdkv2.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/index.d.ts.map +1 -1
- package/dist/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/dist/src/views/v2/TxHistory/Widget/Item.d.ts +8 -0
- package/dist/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -0
- package/dist/src/views/v2/TxHistory/Widget/index.d.ts +4 -0
- package/dist/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -0
- package/dist/src/views/v2/TxHistory/index.d.ts.map +1 -1
- package/lib/{algorand-DIrI8hux.js → algorand-DFJZIdnH.js} +1 -1
- package/lib/{algorand-BZLSulqp.mjs → algorand-qEY4HHOc.mjs} +3 -3
- package/lib/{aptos-ClFQX748.mjs → aptos-BCuZuiBG.mjs} +1 -1
- package/lib/{aptos-B61S9Mku.js → aptos-BHw0JlTE.js} +1 -1
- package/lib/{aptos-poOCeL-e.js → aptos-D-S8DXGs.js} +2 -2
- package/lib/{aptos-BXyptrTk.mjs → aptos-DoqExVYR.mjs} +3 -3
- package/lib/{ccip-CROSeCCn.js → ccip-CXJ3nCk_.js} +1 -1
- package/lib/{ccip-BcLqF-ov.mjs → ccip-_0LmpQds.mjs} +1 -1
- package/lib/{cosmos-B7IowZE9.mjs → cosmos-0un-E2-0.mjs} +6 -6
- package/lib/{cosmos-D-fRtzTz.js → cosmos-DCgWSBll.js} +1 -1
- package/lib/{cosmwasm-BU28GqyN.js → cosmwasm-BsEhYnuw.js} +2 -2
- package/lib/{cosmwasm-i8-2LBd4.mjs → cosmwasm-DvwgrLe6.mjs} +7 -7
- package/lib/{events-BIfEV615.mjs → events-BL2eUG60.mjs} +1 -1
- package/lib/{events-CG085uVS.js → events-wpqGOay9.js} +1 -1
- package/lib/{evm-z72BQwjo.js → evm-B46tP5Ah.js} +1 -1
- package/lib/{evm-DSo1klm4.js → evm-BOrFw20j.js} +4 -4
- package/lib/{evm-BG4p6wWc.mjs → evm-CkxKsuQ-.mjs} +7 -7
- package/lib/{evm-DqVh4NBz.mjs → evm-kynWl8-i.mjs} +5 -5
- package/lib/{index-Coqx-ZYc.js → index-6gwCyfQU.js} +1 -1
- package/lib/{index-B-bMfv9J.mjs → index-BHOu1oLq.mjs} +3 -3
- package/lib/{index-9Ifk_2V6.js → index-BNWJG0G4.js} +1 -1
- package/lib/{index-Xxsx46yX.mjs → index-BOppeFAI.mjs} +1 -1
- package/lib/{index-l3VuXtv4.mjs → index-BTBmklHJ.mjs} +2 -2
- package/lib/{index-CQ_e_FtW.js → index-BVz1aMw3.js} +1 -1
- package/lib/{index--kQS0wX-.js → index-BWNh4wvK.js} +1 -1
- package/lib/{index-x3yNXPc-.js → index-BwCIDEBK.js} +1 -1
- package/lib/{index-DkmEXbbA.js → index-C4ri6eMC.js} +1 -1
- package/lib/{index-CytdQ1id.js → index-C7amSMG9.js} +1 -1
- package/lib/{index-CdnXAZl6.js → index-CAkX47d8.js} +1 -1
- package/lib/{index-ByG9EJHX.js → index-CDGktAjP.js} +137 -84
- package/lib/{index-CkrE6mmF.js → index-CFVm1KSi.js} +1 -1
- package/lib/{index-Cfu2mlWW.mjs → index-CLH7U4rp.mjs} +2 -2
- package/lib/{index-BhfoV5RZ.js → index-CNIDBiCc.js} +1 -1
- package/lib/{index-xrevpHY6.js → index-CPgdgK8L.js} +1 -1
- package/lib/{index-DjSK9SdK.mjs → index-CTwzW64I.mjs} +2 -2
- package/lib/{index-Cf-xLfst.js → index-CUInBQd6.js} +1 -1
- package/lib/{index-CGmv-GLf.js → index-CaFGZvKm.js} +1 -1
- package/lib/{index-DTLOaiZ5.mjs → index-Cb47usqO.mjs} +2 -2
- package/lib/{index-BDhzG0Bz.mjs → index-CjwA7HmM.mjs} +5313 -4809
- package/lib/{index--orPBbEs.mjs → index-CkPaHAgJ.mjs} +3 -3
- package/lib/{index-C1XMdJFH.js → index-ClLbfY74.js} +1 -1
- package/lib/{index-CJJaUncM.js → index-ClRkhvNK.js} +1 -1
- package/lib/{index-DGI2tbSC.mjs → index-Cm3iq-IJ.mjs} +1 -1
- package/lib/{index-DEfagu36.js → index-CtJdy4GW.js} +1 -1
- package/lib/{index-BUcxdUpo.mjs → index-D0W1ZmqN.mjs} +2 -2
- package/lib/{index-Bn9MsO0e.mjs → index-D5SPCl8N.mjs} +2 -2
- package/lib/{index-C8UyzBg3.mjs → index-D6Sqxs9J.mjs} +4 -4
- package/lib/{index-BM3TrHYu.mjs → index-DC65dQZI.mjs} +7 -7
- package/lib/{index-2u6Q9y32.js → index-DICIR39L.js} +1 -1
- package/lib/{index-C8tIBuyM.mjs → index-DIddLRbN.mjs} +1 -1
- package/lib/{index-C1t8_dYP.mjs → index-DSSXLwpv.mjs} +1 -1
- package/lib/{index-eY_q88kc.js → index-DVKptZW_.js} +1 -1
- package/lib/{index-CLiemfL3.js → index-DcbhKZoU.js} +1 -1
- package/lib/{index-B51snNHX.mjs → index-DojwGTf0.mjs} +1 -1
- package/lib/{index-3CEBQmCn.mjs → index-DrQrqu4U.mjs} +2 -2
- package/lib/{index-C262JAz4.mjs → index-DvQkOUhD.mjs} +4 -4
- package/lib/{index-C1fq1xT0.mjs → index-Dw4gUoPq.mjs} +2 -2
- package/lib/{index-DTtBAHqC.mjs → index-IypSUdxl.mjs} +2 -2
- package/lib/{index-GyFHGs5Z.js → index-QfqpopxL.js} +1 -1
- package/lib/{index-C2ZrCXVv.mjs → index-SiA6wvOM.mjs} +2 -2
- package/lib/{index-D1GFc9u_.js → index-dZuWNqUJ.js} +1 -1
- package/lib/{index-DTj0BYI6.mjs → index-fzN-meRd.mjs} +1 -1
- package/lib/{index-CYfEuKEC.js → index-hWgZ0Dfs.js} +1 -1
- package/lib/{index-BrFyHtHO.js → index-tKKMDrTV.js} +1 -1
- package/lib/{index-B3uNul6-.mjs → index-tKooq_Tx.mjs} +3 -3
- package/lib/{index-C3Ztf7te.mjs → index-yd8RiLQo.mjs} +4 -4
- package/lib/{index.es-CTYy3A6V.js → index.es-BfpZO8dT.js} +2 -2
- package/lib/{index.es-zlUSra_a.mjs → index.es-P5wvRtJq.mjs} +5 -5
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{libsodium-wrappers-BL6m46dv.mjs → libsodium-wrappers-BB6-Iffd.mjs} +1 -1
- package/lib/{libsodium-wrappers-_Sv3nUjE.js → libsodium-wrappers-BvMpC4vD.js} +1 -1
- package/lib/{pako.esm-Bf33_673.mjs → pako.esm-C7QrkxRd.mjs} +3 -3
- package/lib/{pako.esm-CEjOh_1P.js → pako.esm-DlDLS2rv.js} +1 -1
- package/lib/{pbkdf2-C3vdgkb4.mjs → pbkdf2-DMV4l9Li.mjs} +1 -1
- package/lib/{pbkdf2-BJ3CFykt.js → pbkdf2-Di1EjoiV.js} +1 -1
- package/lib/{sei-BXWrZef6.mjs → sei-CnR3Aw9g.mjs} +4 -4
- package/lib/{sei-LGYYUG8M.js → sei-RTyi_UJs.js} +1 -1
- package/lib/{signer-DaJj3hCp.mjs → signer-BAztlcE7.mjs} +1 -1
- package/lib/{signer-BQ4T60Nz.js → signer-CbhSUdvo.js} +1 -1
- package/lib/solana-Bkh_veaR.mjs +16 -0
- package/lib/solana-CKipdoh2.js +1 -0
- package/lib/{solana-Cl4jwD2F.mjs → solana-CP3uz3z9.mjs} +4 -4
- package/lib/{solana-AQlZomQ6.js → solana-Cglhypga.js} +1 -1
- package/lib/{solanaEmbed.esm-B_5axZif.js → solanaEmbed.esm-8VvaQIYa.js} +1 -1
- package/lib/{solanaEmbed.esm-DEMxZG02.mjs → solanaEmbed.esm-DfSXcnar.mjs} +4 -4
- package/lib/src/components/v2/Button.d.ts +1 -1
- package/lib/src/components/v2/Button.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +17 -3
- package/lib/src/config/types.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistory.d.ts +1 -1
- package/lib/src/hooks/useTransactionHistory.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/lib/src/icons/TxReadyForClaim.d.ts +2 -2
- package/lib/src/icons/TxReadyForClaim.d.ts.map +1 -1
- package/lib/src/utils/inProgressTxCache.d.ts +5 -0
- package/lib/src/utils/inProgressTxCache.d.ts.map +1 -0
- package/lib/src/utils/polling.d.ts +5 -0
- package/lib/src/utils/polling.d.ts.map +1 -0
- package/lib/src/utils/sdkv2.d.ts +3 -2
- package/lib/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/index.d.ts.map +1 -1
- package/lib/src/views/v2/Redeem/index.d.ts.map +1 -1
- package/lib/src/views/v2/TxHistory/Widget/Item.d.ts +8 -0
- package/lib/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -0
- package/lib/src/views/v2/TxHistory/Widget/index.d.ts +4 -0
- package/lib/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -0
- package/lib/src/views/v2/TxHistory/index.d.ts.map +1 -1
- package/lib/{sui-IAt2YxVB.js → sui-BLA0P5P1.js} +2 -2
- package/lib/{sui-tX-807Bw.js → sui-BMLSVXBy.js} +1 -1
- package/lib/{sui-DfdFzATl.mjs → sui-C73zQuHR.mjs} +1 -1
- package/lib/{sui-BpKCqOiX.mjs → sui-WPdV6u03.mjs} +4 -4
- package/lib/{unsignedTransaction-B1rzGa0o.mjs → unsignedTransaction-BWLDqwPd.mjs} +2 -2
- package/lib/{unsignedTransaction-BzNQ2WFS.js → unsignedTransaction-Cl0WbHFW.js} +1 -1
- package/lib/{utils-DZZcQv7V.js → utils-CA5brb9u.js} +1 -1
- package/lib/{utils-Xa6ErDQY.mjs → utils-Cd5O9nI7.mjs} +2 -2
- package/package.json +1 -1
- package/lib/solana-6EZacoKb.js +0 -1
- package/lib/solana-CbB3tRah.mjs +0 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("./index-ByG9EJHX.js"),aS=require("./events-CG085uVS.js"),a0=require("./index-C1XMdJFH.js"),wr=require("./utils-DZZcQv7V.js");var fS=uS;function uS(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,n=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return n=n%t,n++}}const lS=V.getDefaultExportFromCjs(fS);var kl={exports:{}},Ju,ag;function cS(){if(ag)return Ju;ag=1;var e=1e3,t=e*60,n=t*60,o=n*24,a=o*7,f=o*365.25;Ju=function(_,E){E=E||{};var v=typeof _;if(v==="string"&&_.length>0)return u(_);if(v==="number"&&isFinite(_))return E.long?d(_):g(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function u(_){if(_=String(_),!(_.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(E){var v=parseFloat(E[1]),y=(E[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return v*f;case"weeks":case"week":case"w":return v*a;case"days":case"day":case"d":return v*o;case"hours":case"hour":case"hrs":case"hr":case"h":return v*n;case"minutes":case"minute":case"mins":case"min":case"m":return v*t;case"seconds":case"second":case"secs":case"sec":case"s":return v*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}function g(_){var E=Math.abs(_);return E>=o?Math.round(_/o)+"d":E>=n?Math.round(_/n)+"h":E>=t?Math.round(_/t)+"m":E>=e?Math.round(_/e)+"s":_+"ms"}function d(_){var E=Math.abs(_);return E>=o?h(_,E,o,"day"):E>=n?h(_,E,n,"hour"):E>=t?h(_,E,t,"minute"):E>=e?h(_,E,e,"second"):_+" ms"}function h(_,E,v,y){var B=E>=v*1.5;return Math.round(_/v)+" "+y+(B?"s":"")}return Ju}function dS(e){n.debug=n,n.default=n,n.coerce=d,n.disable=f,n.enable=a,n.enabled=u,n.humanize=cS(),n.destroy=h,Object.keys(e).forEach(_=>{n[_]=e[_]}),n.names=[],n.skips=[],n.formatters={};function t(_){let E=0;for(let v=0;v<_.length;v++)E=(E<<5)-E+_.charCodeAt(v),E|=0;return n.colors[Math.abs(E)%n.colors.length]}n.selectColor=t;function n(_){let E,v=null,y,B;function D(...j){if(!D.enabled)return;const q=D,H=Number(new Date),L=H-(E||H);q.diff=L,q.prev=E,q.curr=H,E=H,j[0]=n.coerce(j[0]),typeof j[0]!="string"&&j.unshift("%O");let P=0;j[0]=j[0].replace(/%([a-zA-Z%])/g,(ae,oe)=>{if(ae==="%%")return"%";P++;const be=n.formatters[oe];if(typeof be=="function"){const de=j[P];ae=be.call(q,de),j.splice(P,1),P--}return ae}),n.formatArgs.call(q,j),(q.log||n.log).apply(q,j)}return D.namespace=_,D.useColors=n.useColors(),D.color=n.selectColor(_),D.extend=o,D.destroy=n.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(y!==n.namespaces&&(y=n.namespaces,B=n.enabled(_)),B),set:j=>{v=j}}),typeof n.init=="function"&&n.init(D),D}function o(_,E){const v=n(this.namespace+(typeof E>"u"?":":E)+_);return v.log=this.log,v}function a(_){n.save(_),n.namespaces=_,n.names=[],n.skips=[];let E;const v=(typeof _=="string"?_:"").split(/[\s,]+/),y=v.length;for(E=0;E<y;E++)v[E]&&(_=v[E].replace(/\*/g,".*?"),_[0]==="-"?n.skips.push(new RegExp("^"+_.slice(1)+"$")):n.names.push(new RegExp("^"+_+"$")))}function f(){const _=[...n.names.map(g),...n.skips.map(g).map(E=>"-"+E)].join(",");return n.enable(""),_}function u(_){if(_[_.length-1]==="*")return!0;let E,v;for(E=0,v=n.skips.length;E<v;E++)if(n.skips[E].test(_))return!1;for(E=0,v=n.names.length;E<v;E++)if(n.names[E].test(_))return!0;return!1}function g(_){return _.toString().substring(2,_.toString().length-2).replace(/\.\*\?$/,"*")}function d(_){return _ instanceof Error?_.stack||_.message:_}function h(){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 n.enable(n.load()),n}var hS=dS;(function(e,t){t.formatArgs=o,t.save=a,t.load=f,t.useColors=n,t.storage=u(),t.destroy=(()=>{let d=!1;return()=>{d||(d=!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(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let d;return 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&&(d=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(d[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;d.splice(1,0,h,"color: inherit");let _=0,E=0;d[0].replace(/%[a-zA-Z%]/g,v=>{v!=="%%"&&(_++,v==="%c"&&(E=_))}),d.splice(E,0,h)}t.log=console.debug||console.log||(()=>{});function a(d){try{d?t.storage.setItem("debug",d):t.storage.removeItem("debug")}catch{}}function f(){let d;try{d=t.storage.getItem("debug")}catch{}return!d&&typeof V.dist.process<"u"&&"env"in V.dist.process&&(d=V.dist.process.env.DEBUG),d}function u(){try{return localStorage}catch{}}e.exports=hS(t);const{formatters:g}=e.exports;g.j=function(d){try{return JSON.stringify(d)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(kl,kl.exports);var gS=kl.exports,fn={},ii={},lc=rs;rs.default=rs;rs.stable=l0;rs.stableStringify=l0;var ka="[...]",f0="[Circular]",Si=[],vi=[];function u0(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function rs(e,t,n,o){typeof o>"u"&&(o=u0()),Fl(e,"",0,[],void 0,0,o);var a;try{vi.length===0?a=JSON.stringify(e,t,n):a=JSON.stringify(e,c0(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Si.length!==0;){var f=Si.pop();f.length===4?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return a}function io(e,t,n,o){var a=Object.getOwnPropertyDescriptor(o,n);a.get!==void 0?a.configurable?(Object.defineProperty(o,n,{value:e}),Si.push([o,n,t,a])):vi.push([t,n,e]):(o[n]=e,Si.push([o,n,t]))}function Fl(e,t,n,o,a,f,u){f+=1;var g;if(typeof e=="object"&&e!==null){for(g=0;g<o.length;g++)if(o[g]===e){io(f0,e,t,a);return}if(typeof u.depthLimit<"u"&&f>u.depthLimit){io(ka,e,t,a);return}if(typeof u.edgesLimit<"u"&&n+1>u.edgesLimit){io(ka,e,t,a);return}if(o.push(e),Array.isArray(e))for(g=0;g<e.length;g++)Fl(e[g],g,g,o,e,f,u);else{var d=Object.keys(e);for(g=0;g<d.length;g++){var h=d[g];Fl(e[h],h,g,o,e,f,u)}}o.pop()}}function _S(e,t){return e<t?-1:e>t?1:0}function l0(e,t,n,o){typeof o>"u"&&(o=u0());var a=Ul(e,"",0,[],void 0,0,o)||e,f;try{vi.length===0?f=JSON.stringify(a,t,n):f=JSON.stringify(a,c0(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Si.length!==0;){var u=Si.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return f}function Ul(e,t,n,o,a,f,u){f+=1;var g;if(typeof e=="object"&&e!==null){for(g=0;g<o.length;g++)if(o[g]===e){io(f0,e,t,a);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof u.depthLimit<"u"&&f>u.depthLimit){io(ka,e,t,a);return}if(typeof u.edgesLimit<"u"&&n+1>u.edgesLimit){io(ka,e,t,a);return}if(o.push(e),Array.isArray(e))for(g=0;g<e.length;g++)Ul(e[g],g,g,o,e,f,u);else{var d={},h=Object.keys(e).sort(_S);for(g=0;g<h.length;g++){var _=h[g];Ul(e[_],_,g,o,e,f,u),d[_]=e[_]}if(typeof a<"u")Si.push([a,t,e]),a[t]=d;else return d}o.pop()}}function c0(e){return e=typeof e<"u"?e:function(t,n){return n},function(t,n){if(vi.length>0)for(var o=0;o<vi.length;o++){var a=vi[o];if(a[1]===t&&a[0]===n){n=a[2],vi.splice(o,1);break}}return e.call(this,t,n)}}const pS=V.getDefaultExportFromCjs(lc);Object.defineProperty(ii,"__esModule",{value:!0});ii.EthereumProviderError=ii.EthereumRpcError=void 0;const bS=lc;class d0 extends Error{constructor(t,n,o){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=t,o!==void 0&&(this.data=o)}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 bS.default(this.serialize(),mS,2)}}ii.EthereumRpcError=d0;let wS=class extends d0{constructor(t,n,o){if(!yS(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,n,o)}};ii.EthereumProviderError=wS;function yS(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function mS(e,t){if(t!=="[Circular]")return t}var cc={},oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.errorValues=oi.errorCodes=void 0;oi.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}};oi.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=oi,n=ii,o=t.errorCodes.rpc.internal,a="Unspecified error message. This is a bug, please report it.",f={code:o,message:u(o)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function u(v,y=a){if(Number.isInteger(v)){const B=v.toString();if(E(t.errorValues,B))return t.errorValues[B].message;if(h(v))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return y}e.getMessageFromCode=u;function g(v){if(!Number.isInteger(v))return!1;const y=v.toString();return!!(t.errorValues[y]||h(v))}e.isValidCode=g;function d(v,{fallbackError:y=f,shouldIncludeStack:B=!1}={}){var D,j;if(!y||!Number.isInteger(y.code)||typeof y.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(v instanceof n.EthereumRpcError)return v.serialize();const q={};if(v&&typeof v=="object"&&!Array.isArray(v)&&E(v,"code")&&g(v.code)){const L=v;q.code=L.code,L.message&&typeof L.message=="string"?(q.message=L.message,E(L,"data")&&(q.data=L.data)):(q.message=u(q.code),q.data={originalError:_(v)})}else{q.code=y.code;const L=(D=v)===null||D===void 0?void 0:D.message;q.message=L&&typeof L=="string"?L:y.message,q.data={originalError:_(v)}}const H=(j=v)===null||j===void 0?void 0:j.stack;return B&&v&&H&&typeof H=="string"&&(q.stack=H),q}e.serializeError=d;function h(v){return v>=-32099&&v<=-32e3}function _(v){return v&&typeof v=="object"&&!Array.isArray(v)?Object.assign({},v):v}function E(v,y){return Object.prototype.hasOwnProperty.call(v,y)}})(cc);var Za={};Object.defineProperty(Za,"__esModule",{value:!0});Za.ethErrors=void 0;const dc=ii,h0=cc,ur=oi;Za.ethErrors={rpc:{parse:e=>Gr(ur.errorCodes.rpc.parse,e),invalidRequest:e=>Gr(ur.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Gr(ur.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Gr(ur.errorCodes.rpc.methodNotFound,e),internal:e=>Gr(ur.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 Gr(t,e)},invalidInput:e=>Gr(ur.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Gr(ur.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Gr(ur.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Gr(ur.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Gr(ur.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Gr(ur.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>qo(ur.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>qo(ur.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>qo(ur.errorCodes.provider.unsupportedMethod,e),disconnected:e=>qo(ur.errorCodes.provider.disconnected,e),chainDisconnected:e=>qo(ur.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:n,data:o}=e;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new dc.EthereumProviderError(t,n,o)}}};function Gr(e,t){const[n,o]=g0(t);return new dc.EthereumRpcError(e,n||h0.getMessageFromCode(e),o)}function qo(e,t){const[n,o]=g0(t);return new dc.EthereumProviderError(e,n||h0.getMessageFromCode(e),o)}function g0(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,n]}}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=ii;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const n=cc;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const o=Za;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});const a=oi;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})})(fn);var vS={exports:{}},Xu={exports:{}},Wt={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,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},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,n){return Object.defineProperty(e,t,n)},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,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},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,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array},_0={exports:{}},Go={exports:{}},fg;function ns(){if(fg)return Go.exports;fg=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return Go.exports=e,Go.exports.AbortSignal=t,Go.exports.default=e,Go.exports}(function(e){const t=V.bufferPolyfill,{kResistStopPropagation:n,SymbolDispose:o}=Wt,a=globalThis.AbortSignal||ns().AbortSignal,f=globalThis.AbortController||ns().AbortController,u=Object.getPrototypeOf(async function(){}).constructor,g=globalThis.Blob||t.Blob,d=typeof g<"u"?function(y){return y instanceof g}:function(y){return!1},h=(v,y)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new ERR_INVALID_ARG_TYPE(y,"AbortSignal",v)},_=(v,y)=>{if(typeof v!="function")throw new ERR_INVALID_ARG_TYPE(y,"Function",v)};class E extends Error{constructor(y){if(!Array.isArray(y))throw new TypeError(`Expected input to be an Array, got ${typeof y}`);let B="";for(let D=0;D<y.length;D++)B+=` ${y[D].stack}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("./index-CDGktAjP.js"),aS=require("./events-wpqGOay9.js"),a0=require("./index-ClLbfY74.js"),wr=require("./utils-CA5brb9u.js");var fS=uS;function uS(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,n=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return n=n%t,n++}}const lS=V.getDefaultExportFromCjs(fS);var kl={exports:{}},Ju,ag;function cS(){if(ag)return Ju;ag=1;var e=1e3,t=e*60,n=t*60,o=n*24,a=o*7,f=o*365.25;Ju=function(_,E){E=E||{};var v=typeof _;if(v==="string"&&_.length>0)return u(_);if(v==="number"&&isFinite(_))return E.long?d(_):g(_);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(_))};function u(_){if(_=String(_),!(_.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(_);if(E){var v=parseFloat(E[1]),y=(E[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return v*f;case"weeks":case"week":case"w":return v*a;case"days":case"day":case"d":return v*o;case"hours":case"hour":case"hrs":case"hr":case"h":return v*n;case"minutes":case"minute":case"mins":case"min":case"m":return v*t;case"seconds":case"second":case"secs":case"sec":case"s":return v*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}function g(_){var E=Math.abs(_);return E>=o?Math.round(_/o)+"d":E>=n?Math.round(_/n)+"h":E>=t?Math.round(_/t)+"m":E>=e?Math.round(_/e)+"s":_+"ms"}function d(_){var E=Math.abs(_);return E>=o?h(_,E,o,"day"):E>=n?h(_,E,n,"hour"):E>=t?h(_,E,t,"minute"):E>=e?h(_,E,e,"second"):_+" ms"}function h(_,E,v,y){var B=E>=v*1.5;return Math.round(_/v)+" "+y+(B?"s":"")}return Ju}function dS(e){n.debug=n,n.default=n,n.coerce=d,n.disable=f,n.enable=a,n.enabled=u,n.humanize=cS(),n.destroy=h,Object.keys(e).forEach(_=>{n[_]=e[_]}),n.names=[],n.skips=[],n.formatters={};function t(_){let E=0;for(let v=0;v<_.length;v++)E=(E<<5)-E+_.charCodeAt(v),E|=0;return n.colors[Math.abs(E)%n.colors.length]}n.selectColor=t;function n(_){let E,v=null,y,B;function D(...j){if(!D.enabled)return;const q=D,H=Number(new Date),L=H-(E||H);q.diff=L,q.prev=E,q.curr=H,E=H,j[0]=n.coerce(j[0]),typeof j[0]!="string"&&j.unshift("%O");let P=0;j[0]=j[0].replace(/%([a-zA-Z%])/g,(ae,oe)=>{if(ae==="%%")return"%";P++;const be=n.formatters[oe];if(typeof be=="function"){const de=j[P];ae=be.call(q,de),j.splice(P,1),P--}return ae}),n.formatArgs.call(q,j),(q.log||n.log).apply(q,j)}return D.namespace=_,D.useColors=n.useColors(),D.color=n.selectColor(_),D.extend=o,D.destroy=n.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(y!==n.namespaces&&(y=n.namespaces,B=n.enabled(_)),B),set:j=>{v=j}}),typeof n.init=="function"&&n.init(D),D}function o(_,E){const v=n(this.namespace+(typeof E>"u"?":":E)+_);return v.log=this.log,v}function a(_){n.save(_),n.namespaces=_,n.names=[],n.skips=[];let E;const v=(typeof _=="string"?_:"").split(/[\s,]+/),y=v.length;for(E=0;E<y;E++)v[E]&&(_=v[E].replace(/\*/g,".*?"),_[0]==="-"?n.skips.push(new RegExp("^"+_.slice(1)+"$")):n.names.push(new RegExp("^"+_+"$")))}function f(){const _=[...n.names.map(g),...n.skips.map(g).map(E=>"-"+E)].join(",");return n.enable(""),_}function u(_){if(_[_.length-1]==="*")return!0;let E,v;for(E=0,v=n.skips.length;E<v;E++)if(n.skips[E].test(_))return!1;for(E=0,v=n.names.length;E<v;E++)if(n.names[E].test(_))return!0;return!1}function g(_){return _.toString().substring(2,_.toString().length-2).replace(/\.\*\?$/,"*")}function d(_){return _ instanceof Error?_.stack||_.message:_}function h(){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 n.enable(n.load()),n}var hS=dS;(function(e,t){t.formatArgs=o,t.save=a,t.load=f,t.useColors=n,t.storage=u(),t.destroy=(()=>{let d=!1;return()=>{d||(d=!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(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let d;return 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&&(d=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(d[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const h="color: "+this.color;d.splice(1,0,h,"color: inherit");let _=0,E=0;d[0].replace(/%[a-zA-Z%]/g,v=>{v!=="%%"&&(_++,v==="%c"&&(E=_))}),d.splice(E,0,h)}t.log=console.debug||console.log||(()=>{});function a(d){try{d?t.storage.setItem("debug",d):t.storage.removeItem("debug")}catch{}}function f(){let d;try{d=t.storage.getItem("debug")}catch{}return!d&&typeof V.dist.process<"u"&&"env"in V.dist.process&&(d=V.dist.process.env.DEBUG),d}function u(){try{return localStorage}catch{}}e.exports=hS(t);const{formatters:g}=e.exports;g.j=function(d){try{return JSON.stringify(d)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}})(kl,kl.exports);var gS=kl.exports,fn={},ii={},lc=rs;rs.default=rs;rs.stable=l0;rs.stableStringify=l0;var ka="[...]",f0="[Circular]",Si=[],vi=[];function u0(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function rs(e,t,n,o){typeof o>"u"&&(o=u0()),Fl(e,"",0,[],void 0,0,o);var a;try{vi.length===0?a=JSON.stringify(e,t,n):a=JSON.stringify(e,c0(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Si.length!==0;){var f=Si.pop();f.length===4?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return a}function io(e,t,n,o){var a=Object.getOwnPropertyDescriptor(o,n);a.get!==void 0?a.configurable?(Object.defineProperty(o,n,{value:e}),Si.push([o,n,t,a])):vi.push([t,n,e]):(o[n]=e,Si.push([o,n,t]))}function Fl(e,t,n,o,a,f,u){f+=1;var g;if(typeof e=="object"&&e!==null){for(g=0;g<o.length;g++)if(o[g]===e){io(f0,e,t,a);return}if(typeof u.depthLimit<"u"&&f>u.depthLimit){io(ka,e,t,a);return}if(typeof u.edgesLimit<"u"&&n+1>u.edgesLimit){io(ka,e,t,a);return}if(o.push(e),Array.isArray(e))for(g=0;g<e.length;g++)Fl(e[g],g,g,o,e,f,u);else{var d=Object.keys(e);for(g=0;g<d.length;g++){var h=d[g];Fl(e[h],h,g,o,e,f,u)}}o.pop()}}function _S(e,t){return e<t?-1:e>t?1:0}function l0(e,t,n,o){typeof o>"u"&&(o=u0());var a=Ul(e,"",0,[],void 0,0,o)||e,f;try{vi.length===0?f=JSON.stringify(a,t,n):f=JSON.stringify(a,c0(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Si.length!==0;){var u=Si.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return f}function Ul(e,t,n,o,a,f,u){f+=1;var g;if(typeof e=="object"&&e!==null){for(g=0;g<o.length;g++)if(o[g]===e){io(f0,e,t,a);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof u.depthLimit<"u"&&f>u.depthLimit){io(ka,e,t,a);return}if(typeof u.edgesLimit<"u"&&n+1>u.edgesLimit){io(ka,e,t,a);return}if(o.push(e),Array.isArray(e))for(g=0;g<e.length;g++)Ul(e[g],g,g,o,e,f,u);else{var d={},h=Object.keys(e).sort(_S);for(g=0;g<h.length;g++){var _=h[g];Ul(e[_],_,g,o,e,f,u),d[_]=e[_]}if(typeof a<"u")Si.push([a,t,e]),a[t]=d;else return d}o.pop()}}function c0(e){return e=typeof e<"u"?e:function(t,n){return n},function(t,n){if(vi.length>0)for(var o=0;o<vi.length;o++){var a=vi[o];if(a[1]===t&&a[0]===n){n=a[2],vi.splice(o,1);break}}return e.call(this,t,n)}}const pS=V.getDefaultExportFromCjs(lc);Object.defineProperty(ii,"__esModule",{value:!0});ii.EthereumProviderError=ii.EthereumRpcError=void 0;const bS=lc;class d0 extends Error{constructor(t,n,o){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=t,o!==void 0&&(this.data=o)}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 bS.default(this.serialize(),mS,2)}}ii.EthereumRpcError=d0;let wS=class extends d0{constructor(t,n,o){if(!yS(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,n,o)}};ii.EthereumProviderError=wS;function yS(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function mS(e,t){if(t!=="[Circular]")return t}var cc={},oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.errorValues=oi.errorCodes=void 0;oi.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}};oi.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=oi,n=ii,o=t.errorCodes.rpc.internal,a="Unspecified error message. This is a bug, please report it.",f={code:o,message:u(o)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function u(v,y=a){if(Number.isInteger(v)){const B=v.toString();if(E(t.errorValues,B))return t.errorValues[B].message;if(h(v))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return y}e.getMessageFromCode=u;function g(v){if(!Number.isInteger(v))return!1;const y=v.toString();return!!(t.errorValues[y]||h(v))}e.isValidCode=g;function d(v,{fallbackError:y=f,shouldIncludeStack:B=!1}={}){var D,j;if(!y||!Number.isInteger(y.code)||typeof y.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(v instanceof n.EthereumRpcError)return v.serialize();const q={};if(v&&typeof v=="object"&&!Array.isArray(v)&&E(v,"code")&&g(v.code)){const L=v;q.code=L.code,L.message&&typeof L.message=="string"?(q.message=L.message,E(L,"data")&&(q.data=L.data)):(q.message=u(q.code),q.data={originalError:_(v)})}else{q.code=y.code;const L=(D=v)===null||D===void 0?void 0:D.message;q.message=L&&typeof L=="string"?L:y.message,q.data={originalError:_(v)}}const H=(j=v)===null||j===void 0?void 0:j.stack;return B&&v&&H&&typeof H=="string"&&(q.stack=H),q}e.serializeError=d;function h(v){return v>=-32099&&v<=-32e3}function _(v){return v&&typeof v=="object"&&!Array.isArray(v)?Object.assign({},v):v}function E(v,y){return Object.prototype.hasOwnProperty.call(v,y)}})(cc);var Za={};Object.defineProperty(Za,"__esModule",{value:!0});Za.ethErrors=void 0;const dc=ii,h0=cc,ur=oi;Za.ethErrors={rpc:{parse:e=>Gr(ur.errorCodes.rpc.parse,e),invalidRequest:e=>Gr(ur.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Gr(ur.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Gr(ur.errorCodes.rpc.methodNotFound,e),internal:e=>Gr(ur.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 Gr(t,e)},invalidInput:e=>Gr(ur.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Gr(ur.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Gr(ur.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Gr(ur.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Gr(ur.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Gr(ur.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>qo(ur.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>qo(ur.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>qo(ur.errorCodes.provider.unsupportedMethod,e),disconnected:e=>qo(ur.errorCodes.provider.disconnected,e),chainDisconnected:e=>qo(ur.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:n,data:o}=e;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new dc.EthereumProviderError(t,n,o)}}};function Gr(e,t){const[n,o]=g0(t);return new dc.EthereumRpcError(e,n||h0.getMessageFromCode(e),o)}function qo(e,t){const[n,o]=g0(t);return new dc.EthereumProviderError(e,n||h0.getMessageFromCode(e),o)}function g0(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,n]}}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=ii;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const n=cc;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const o=Za;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});const a=oi;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})})(fn);var vS={exports:{}},Xu={exports:{}},Wt={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,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},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,n){return Object.defineProperty(e,t,n)},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,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},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,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array},_0={exports:{}},Go={exports:{}},fg;function ns(){if(fg)return Go.exports;fg=1;const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;return Go.exports=e,Go.exports.AbortSignal=t,Go.exports.default=e,Go.exports}(function(e){const t=V.bufferPolyfill,{kResistStopPropagation:n,SymbolDispose:o}=Wt,a=globalThis.AbortSignal||ns().AbortSignal,f=globalThis.AbortController||ns().AbortController,u=Object.getPrototypeOf(async function(){}).constructor,g=globalThis.Blob||t.Blob,d=typeof g<"u"?function(y){return y instanceof g}:function(y){return!1},h=(v,y)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new ERR_INVALID_ARG_TYPE(y,"AbortSignal",v)},_=(v,y)=>{if(typeof v!="function")throw new ERR_INVALID_ARG_TYPE(y,"Function",v)};class E extends Error{constructor(y){if(!Array.isArray(y))throw new TypeError(`Expected input to be an Array, got ${typeof y}`);let B="";for(let D=0;D<y.length;D++)B+=` ${y[D].stack}
|
|
2
2
|
`;super(B),this.name="AggregateError",this.errors=y}}e.exports={AggregateError:E,kEmptyObject:Object.freeze({}),once(v){let y=!1;return function(...B){y||(y=!0,v.apply(this,B))}},createDeferredPromise:function(){let v,y;return{promise:new Promise((D,j)=>{v=D,y=j}),resolve:v,reject:y}},promisify(v){return new Promise((y,B)=>{v((D,...j)=>D?B(D):y(...j))})},debuglog(){return function(){}},format(v,...y){return v.replace(/%([sdifj])/g,function(...[B,D]){const j=y.shift();return D==="f"?j.toFixed(6):D==="j"?JSON.stringify(j):D==="s"&&typeof j=="object"?`${j.constructor!==Object?j.constructor.name:""} {}`.trim():j.toString()})},inspect(v){switch(typeof v){case"string":if(v.includes("'"))if(v.includes('"')){if(!v.includes("`")&&!v.includes("${"))return`\`${v}\``}else return`"${v}"`;return`'${v}'`;case"number":return isNaN(v)?"NaN":Object.is(v,-0)?String(v):v;case"bigint":return`${String(v)}n`;case"boolean":case"undefined":return String(v);case"object":return"{}"}},types:{isAsyncFunction(v){return v instanceof u},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:d,deprecate(v,y){return v},addAbortListener:V.requireEvents().addAbortListener||function(y,B){if(y===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",y);h(y,"signal"),_(B,"listener");let D;return y.aborted?queueMicrotask(()=>B()):(y.addEventListener("abort",B,{__proto__:null,once:!0,[n]:!0}),D=()=>{y.removeEventListener("abort",B)}),{__proto__:null,[o](){var j;(j=D)===null||j===void 0||j()}}},AbortSignalAny:a.any||function(y){if(y.length===1)return y[0];const B=new f,D=()=>B.abort();return y.forEach(j=>{h(j,"signals"),j.addEventListener("abort",D,{once:!0})}),B.signal.addEventListener("abort",()=>{y.forEach(j=>j.removeEventListener("abort",D))},{once:!0}),B.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(_0);var yr=_0.exports,hc={};const{format:ES,inspect:Fa,AggregateError:SS}=yr,RS=globalThis.AggregateError||SS,AS=Symbol("kIsNodeError"),IS=["string","function","number","object","Function","Object","boolean","bigint","symbol"],TS=/^([A-Z][a-z0-9]*)+$/,OS="__node_internal_",Ka={};function Ei(e,t){if(!e)throw new Ka.ERR_INTERNAL_ASSERTION(t)}function ug(e){let t="",n=e.length;const o=e[0]==="-"?1:0;for(;n>=o+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function CS(e,t,n){if(typeof t=="function")return Ei(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);const o=(t.match(/%[dfijoOs]/g)||[]).length;return Ei(o===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${o}).`),n.length===0?t:ES(t,...n)}function nr(e,t,n){n||(n=Error);class o extends n{constructor(...f){super(CS(e,t,f))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[AS]=!0,Ka[e]=o}function lg(e){const t=OS+e.name;return Object.defineProperty(e,"name",{value:t}),e}function PS(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const n=new RS([t,e],t.message);return n.code=t.code,n}return e||t}let LS=class extends Error{constructor(t="The operation was aborted",n=void 0){if(n!==void 0&&typeof n!="object")throw new Ka.ERR_INVALID_ARG_TYPE("options","Object",n);super(t,n),this.code="ABORT_ERR",this.name="AbortError"}};nr("ERR_ASSERTION","%s",Error);nr("ERR_INVALID_ARG_TYPE",(e,t,n)=>{Ei(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let o="The ";e.endsWith(" argument")?o+=`${e} `:o+=`"${e}" ${e.includes(".")?"property":"argument"} `,o+="must be ";const a=[],f=[],u=[];for(const d of t)Ei(typeof d=="string","All expected entries have to be of type string"),IS.includes(d)?a.push(d.toLowerCase()):TS.test(d)?f.push(d):(Ei(d!=="object",'The value "object" should be written as "Object"'),u.push(d));if(f.length>0){const d=a.indexOf("object");d!==-1&&(a.splice(a,d,1),f.push("Object"))}if(a.length>0){switch(a.length){case 1:o+=`of type ${a[0]}`;break;case 2:o+=`one of type ${a[0]} or ${a[1]}`;break;default:{const d=a.pop();o+=`one of type ${a.join(", ")}, or ${d}`}}(f.length>0||u.length>0)&&(o+=" or ")}if(f.length>0){switch(f.length){case 1:o+=`an instance of ${f[0]}`;break;case 2:o+=`an instance of ${f[0]} or ${f[1]}`;break;default:{const d=f.pop();o+=`an instance of ${f.join(", ")}, or ${d}`}}u.length>0&&(o+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(o+="an "),o+=`${u[0]}`;break;case 2:o+=`one of ${u[0]} or ${u[1]}`;break;default:{const d=u.pop();o+=`one of ${u.join(", ")}, or ${d}`}}if(n==null)o+=`. Received ${n}`;else if(typeof n=="function"&&n.name)o+=`. Received function ${n.name}`;else if(typeof n=="object"){var g;if((g=n.constructor)!==null&&g!==void 0&&g.name)o+=`. Received an instance of ${n.constructor.name}`;else{const d=Fa(n,{depth:-1});o+=`. Received ${d}`}}else{let d=Fa(n,{colors:!1});d.length>25&&(d=`${d.slice(0,25)}...`),o+=`. Received type ${typeof n} (${d})`}return o},TypeError);nr("ERR_INVALID_ARG_VALUE",(e,t,n="is invalid")=>{let o=Fa(t);return o.length>128&&(o=o.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${n}. Received ${o}`},TypeError);nr("ERR_INVALID_RETURN_VALUE",(e,t,n)=>{var o;const a=n!=null&&(o=n.constructor)!==null&&o!==void 0&&o.name?`instance of ${n.constructor.name}`:`type ${typeof n}`;return`Expected ${e} to be returned from the "${t}" function but got ${a}.`},TypeError);nr("ERR_MISSING_ARGS",(...e)=>{Ei(e.length>0,"At least one arg needs to be specified");let t;const n=e.length;switch(e=(Array.isArray(e)?e:[e]).map(o=>`"${o}"`).join(" or "),n){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const o=e.pop();t+=`The ${e.join(", ")}, and ${o} arguments`}break}return`${t} must be specified`},TypeError);nr("ERR_OUT_OF_RANGE",(e,t,n)=>{Ei(t,'Missing "range" argument');let o;return Number.isInteger(n)&&Math.abs(n)>2**32?o=ug(String(n)):typeof n=="bigint"?(o=String(n),(n>2n**32n||n<-(2n**32n))&&(o=ug(o)),o+="n"):o=Fa(n),`The value of "${e}" is out of range. It must be ${t}. Received ${o}`},RangeError);nr("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);nr("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);nr("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);nr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);nr("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);nr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);nr("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);nr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);nr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);nr("ERR_STREAM_WRITE_AFTER_END","write after end",Error);nr("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var Ir={AbortError:LS,aggregateTwoErrors:lg(PS),hideStackFrames:lg,codes:Ka};const{ArrayIsArray:gc,ArrayPrototypeIncludes:p0,ArrayPrototypeJoin:b0,ArrayPrototypeMap:NS,NumberIsInteger:_c,NumberIsNaN:BS,NumberMAX_SAFE_INTEGER:$S,NumberMIN_SAFE_INTEGER:xS,NumberParseInt:DS,ObjectPrototypeHasOwnProperty:MS,RegExpPrototypeExec:w0,String:kS,StringPrototypeToUpperCase:FS,StringPrototypeTrim:US}=Wt,{hideStackFrames:Xr,codes:{ERR_SOCKET_BAD_PORT:jS,ERR_INVALID_ARG_TYPE:hr,ERR_INVALID_ARG_VALUE:go,ERR_OUT_OF_RANGE:Ri,ERR_UNKNOWN_SIGNAL:cg}}=Ir,{normalizeEncoding:HS}=yr,{isAsyncFunction:WS,isArrayBufferView:zS}=yr.types,dg={};function qS(e){return e===(e|0)}function GS(e){return e===e>>>0}const VS=/^[0-7]+$/,ZS="must be a 32-bit unsigned integer or an octal string";function KS(e,t,n){if(typeof e>"u"&&(e=n),typeof e=="string"){if(w0(VS,e)===null)throw new go(t,e,ZS);e=DS(e,8)}return y0(e,t),e}const JS=Xr((e,t,n=xS,o=$S)=>{if(typeof e!="number")throw new hr(t,"number",e);if(!_c(e))throw new Ri(t,"an integer",e);if(e<n||e>o)throw new Ri(t,`>= ${n} && <= ${o}`,e)}),XS=Xr((e,t,n=-2147483648,o=2147483647)=>{if(typeof e!="number")throw new hr(t,"number",e);if(!_c(e))throw new Ri(t,"an integer",e);if(e<n||e>o)throw new Ri(t,`>= ${n} && <= ${o}`,e)}),y0=Xr((e,t,n=!1)=>{if(typeof e!="number")throw new hr(t,"number",e);if(!_c(e))throw new Ri(t,"an integer",e);const o=n?1:0,a=4294967295;if(e<o||e>a)throw new Ri(t,`>= ${o} && <= ${a}`,e)});function pc(e,t){if(typeof e!="string")throw new hr(t,"string",e)}function YS(e,t,n=void 0,o){if(typeof e!="number")throw new hr(t,"number",e);if(n!=null&&e<n||o!=null&&e>o||(n!=null||o!=null)&&BS(e))throw new Ri(t,`${n!=null?`>= ${n}`:""}${n!=null&&o!=null?" && ":""}${o!=null?`<= ${o}`:""}`,e)}const QS=Xr((e,t,n)=>{if(!p0(n,e)){const a="must be one of: "+b0(NS(n,f=>typeof f=="string"?`'${f}'`:kS(f)),", ");throw new go(t,e,a)}});function m0(e,t){if(typeof e!="boolean")throw new hr(t,"boolean",e)}function Yu(e,t,n){return e==null||!MS(e,t)?n:e[t]}const eR=Xr((e,t,n=null)=>{const o=Yu(n,"allowArray",!1),a=Yu(n,"allowFunction",!1);if(!Yu(n,"nullable",!1)&&e===null||!o&&gc(e)||typeof e!="object"&&(!a||typeof e!="function"))throw new hr(t,"Object",e)}),tR=Xr((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new hr(t,"a dictionary",e)}),Ja=Xr((e,t,n=0)=>{if(!gc(e))throw new hr(t,"Array",e);if(e.length<n){const o=`must be longer than ${n}`;throw new go(t,e,o)}});function rR(e,t){Ja(e,t);for(let n=0;n<e.length;n++)pc(e[n],`${t}[${n}]`)}function nR(e,t){Ja(e,t);for(let n=0;n<e.length;n++)m0(e[n],`${t}[${n}]`)}function iR(e,t){Ja(e,t);for(let n=0;n<e.length;n++){const o=e[n],a=`${t}[${n}]`;if(o==null)throw new hr(a,"AbortSignal",o);v0(o,a)}}function oR(e,t="signal"){if(pc(e,t),dg[e]===void 0)throw dg[FS(e)]!==void 0?new cg(e+" (signals must use all capital letters)"):new cg(e)}const sR=Xr((e,t="buffer")=>{if(!zS(e))throw new hr(t,["Buffer","TypedArray","DataView"],e)});function aR(e,t){const n=HS(t),o=e.length;if(n==="hex"&&o%2!==0)throw new go("encoding",t,`is invalid for data of length ${o}`)}function fR(e,t="Port",n=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&US(e).length===0||+e!==+e>>>0||e>65535||e===0&&!n)throw new jS(t,e,n);return e|0}const v0=Xr((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new hr(t,"AbortSignal",e)}),uR=Xr((e,t)=>{if(typeof e!="function")throw new hr(t,"Function",e)}),lR=Xr((e,t)=>{if(typeof e!="function"||WS(e))throw new hr(t,"Function",e)}),cR=Xr((e,t)=>{if(e!==void 0)throw new hr(t,"undefined",e)});function dR(e,t,n){if(!p0(n,e))throw new hr(t,`('${b0(n,"|")}')`,e)}const hR=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function hg(e,t){if(typeof e>"u"||!w0(hR,e))throw new go(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function gR(e){if(typeof e=="string")return hg(e,"hints"),e;if(gc(e)){const t=e.length;let n="";if(t===0)return n;for(let o=0;o<t;o++){const a=e[o];hg(a,"hints"),n+=a,o!==t-1&&(n+=", ")}return n}throw new go("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var as={isInt32:qS,isUint32:GS,parseFileMode:KS,validateArray:Ja,validateStringArray:rR,validateBooleanArray:nR,validateAbortSignalArray:iR,validateBoolean:m0,validateBuffer:sR,validateDictionary:tR,validateEncoding:aR,validateFunction:uR,validateInt32:XS,validateInteger:JS,validateNumber:YS,validateObject:eR,validateOneOf:QS,validatePlainFunction:lR,validatePort:fR,validateSignalName:oR,validateString:pc,validateUint32:y0,validateUndefined:cR,validateUnion:dR,validateAbortSignal:v0,validateLinkHeaderValue:gR},bc={exports:{}};const{SymbolAsyncIterator:gg,SymbolIterator:_g,SymbolFor:Ti}=Wt,E0=Ti("nodejs.stream.destroyed"),S0=Ti("nodejs.stream.errored"),jl=Ti("nodejs.stream.readable"),Hl=Ti("nodejs.stream.writable"),R0=Ti("nodejs.stream.disturbed"),_R=Ti("nodejs.webstream.isClosedPromise"),pR=Ti("nodejs.webstream.controllerErrorFunction");function Xa(e,t=!1){var n;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((n=e._readableState)===null||n===void 0?void 0:n.readable)!==!1)&&(!e._writableState||e._readableState))}function Ya(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 bR(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}function An(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}function A0(e){return!!(e&&!An(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}function I0(e){return!!(e&&!An(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}function T0(e){return!!(e&&!An(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}function wR(e){return A0(e)||I0(e)||T0(e)}function yR(e,t){return e==null?!1:t===!0?typeof e[gg]=="function":t===!1?typeof e[_g]=="function":typeof e[gg]=="function"||typeof e[_g]=="function"}function Qa(e){if(!An(e))return null;const t=e._writableState,n=e._readableState,o=t||n;return!!(e.destroyed||e[E0]||o!=null&&o.destroyed)}function O0(e){if(!Ya(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 mR(e,t){if(!Ya(e))return null;if(e.writableFinished===!0)return!0;const n=e._writableState;return n!=null&&n.errored?!1:typeof(n==null?void 0:n.finished)!="boolean"?null:!!(n.finished||t===!1&&n.ended===!0&&n.length===0)}function vR(e){if(!Xa(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 C0(e,t){if(!Xa(e))return null;const n=e._readableState;return n!=null&&n.errored?!1:typeof(n==null?void 0:n.endEmitted)!="boolean"?null:!!(n.endEmitted||t===!1&&n.ended===!0&&n.length===0)}function P0(e){return e&&e[jl]!=null?e[jl]:typeof(e==null?void 0:e.readable)!="boolean"?null:Qa(e)?!1:Xa(e)&&e.readable&&!C0(e)}function L0(e){return e&&e[Hl]!=null?e[Hl]:typeof(e==null?void 0:e.writable)!="boolean"?null:Qa(e)?!1:Ya(e)&&e.writable&&!O0(e)}function ER(e,t){return An(e)?Qa(e)?!0:!((t==null?void 0:t.readable)!==!1&&P0(e)||(t==null?void 0:t.writable)!==!1&&L0(e)):null}function SR(e){var t,n;return An(e)?e.writableErrored?e.writableErrored:(t=(n=e._writableState)===null||n===void 0?void 0:n.errored)!==null&&t!==void 0?t:null:null}function RR(e){var t,n;return An(e)?e.readableErrored?e.readableErrored:(t=(n=e._readableState)===null||n===void 0?void 0:n.errored)!==null&&t!==void 0?t:null:null}function AR(e){if(!An(e))return null;if(typeof e.closed=="boolean")return e.closed;const t=e._writableState,n=e._readableState;return typeof(t==null?void 0:t.closed)=="boolean"||typeof(n==null?void 0:n.closed)=="boolean"?(t==null?void 0:t.closed)||(n==null?void 0:n.closed):typeof e._closed=="boolean"&&N0(e)?e._closed:null}function N0(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}function B0(e){return typeof e._sent100=="boolean"&&N0(e)}function IR(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 TR(e){if(!An(e))return null;const t=e._writableState,n=e._readableState,o=t||n;return!o&&B0(e)||!!(o&&o.autoDestroy&&o.emitClose&&o.closed===!1)}function OR(e){var t;return!!(e&&((t=e[R0])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}function CR(e){var t,n,o,a,f,u,g,d,h,_;return!!(e&&((t=(n=(o=(a=(f=(u=e[S0])!==null&&u!==void 0?u:e.readableErrored)!==null&&f!==void 0?f:e.writableErrored)!==null&&a!==void 0?a:(g=e._readableState)===null||g===void 0?void 0:g.errorEmitted)!==null&&o!==void 0?o:(d=e._writableState)===null||d===void 0?void 0:d.errorEmitted)!==null&&n!==void 0?n:(h=e._readableState)===null||h===void 0?void 0:h.errored)!==null&&t!==void 0?t:!((_=e._writableState)===null||_===void 0)&&_.errored))}var Wn={isDestroyed:Qa,kIsDestroyed:E0,isDisturbed:OR,kIsDisturbed:R0,isErrored:CR,kIsErrored:S0,isReadable:P0,kIsReadable:jl,kIsClosedPromise:_R,kControllerErrorFunction:pR,kIsWritable:Hl,isClosed:AR,isDuplexNodeStream:bR,isFinished:ER,isIterable:yR,isReadableNodeStream:Xa,isReadableStream:A0,isReadableEnded:vR,isReadableFinished:C0,isReadableErrored:RR,isNodeStream:An,isWebStream:wR,isWritable:L0,isWritableNodeStream:Ya,isWritableStream:I0,isWritableEnded:O0,isWritableFinished:mR,isWritableErrored:SR,isServerRequest:IR,isServerResponse:B0,willEmitClose:TR,isTransformStream:T0};const ti=V.browserExports,{AbortError:$0,codes:PR}=Ir,{ERR_INVALID_ARG_TYPE:LR,ERR_STREAM_PREMATURE_CLOSE:pg}=PR,{kEmptyObject:Wl,once:zl}=yr,{validateAbortSignal:NR,validateFunction:BR,validateObject:$R,validateBoolean:xR}=as,{Promise:DR,PromisePrototypeThen:MR,SymbolDispose:x0}=Wt,{isClosed:kR,isReadable:bg,isReadableNodeStream:Qu,isReadableStream:FR,isReadableFinished:wg,isReadableErrored:yg,isWritable:mg,isWritableNodeStream:vg,isWritableStream:UR,isWritableFinished:Eg,isWritableErrored:Sg,isNodeStream:jR,willEmitClose:HR,kIsClosedPromise:WR}=Wn;let oo;function zR(e){return e.setHeader&&typeof e.abort=="function"}const ql=()=>{};function D0(e,t,n){var o,a;if(arguments.length===2?(n=t,t=Wl):t==null?t=Wl:$R(t,"options"),BR(n,"callback"),NR(t.signal,"options.signal"),n=zl(n),FR(e)||UR(e))return qR(e,t,n);if(!jR(e))throw new LR("stream",["ReadableStream","WritableStream","Stream"],e);const f=(o=t.readable)!==null&&o!==void 0?o:Qu(e),u=(a=t.writable)!==null&&a!==void 0?a:vg(e),g=e._writableState,d=e._readableState,h=()=>{e.writable||v()};let _=HR(e)&&Qu(e)===f&&vg(e)===u,E=Eg(e,!1);const v=()=>{E=!0,e.destroyed&&(_=!1),!(_&&(!e.readable||f))&&(!f||y)&&n.call(e)};let y=wg(e,!1);const B=()=>{y=!0,e.destroyed&&(_=!1),!(_&&(!e.writable||u))&&(!u||E)&&n.call(e)},D=K=>{n.call(e,K)};let j=kR(e);const q=()=>{j=!0;const K=Sg(e)||yg(e);if(K&&typeof K!="boolean")return n.call(e,K);if(f&&!y&&Qu(e,!0)&&!wg(e,!1))return n.call(e,new pg);if(u&&!E&&!Eg(e,!1))return n.call(e,new pg);n.call(e)},H=()=>{j=!0;const K=Sg(e)||yg(e);if(K&&typeof K!="boolean")return n.call(e,K);n.call(e)},L=()=>{e.req.on("finish",v)};zR(e)?(e.on("complete",v),_||e.on("abort",q),e.req?L():e.on("request",L)):u&&!g&&(e.on("end",h),e.on("close",h)),!_&&typeof e.aborted=="boolean"&&e.on("aborted",q),e.on("end",B),e.on("finish",v),t.error!==!1&&e.on("error",D),e.on("close",q),j?ti.nextTick(q):g!=null&&g.errorEmitted||d!=null&&d.errorEmitted?_||ti.nextTick(H):(!f&&(!_||bg(e))&&(E||mg(e)===!1)||!u&&(!_||mg(e))&&(y||bg(e)===!1)||d&&e.req&&e.aborted)&&ti.nextTick(H);const P=()=>{n=ql,e.removeListener("aborted",q),e.removeListener("complete",v),e.removeListener("abort",q),e.removeListener("request",L),e.req&&e.req.removeListener("finish",v),e.removeListener("end",h),e.removeListener("close",h),e.removeListener("finish",v),e.removeListener("end",B),e.removeListener("error",D),e.removeListener("close",q)};if(t.signal&&!j){const K=()=>{const ae=n;P(),ae.call(e,new $0(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)ti.nextTick(K);else{oo=oo||yr.addAbortListener;const ae=oo(t.signal,K),oe=n;n=zl((...be)=>{ae[x0](),oe.apply(e,be)})}}return P}function qR(e,t,n){let o=!1,a=ql;if(t.signal)if(a=()=>{o=!0,n.call(e,new $0(void 0,{cause:t.signal.reason}))},t.signal.aborted)ti.nextTick(a);else{oo=oo||yr.addAbortListener;const u=oo(t.signal,a),g=n;n=zl((...d)=>{u[x0](),g.apply(e,d)})}const f=(...u)=>{o||ti.nextTick(()=>n.apply(e,u))};return MR(e[WR].promise,f,f),ql}function GR(e,t){var n;let o=!1;return t===null&&(t=Wl),(n=t)!==null&&n!==void 0&&n.cleanup&&(xR(t.cleanup,"cleanup"),o=t.cleanup),new DR((a,f)=>{const u=D0(e,t,g=>{o&&u(),g?f(g):a()})})}bc.exports=D0;bc.exports.finished=GR;var ai=bc.exports;const En=V.browserExports,{aggregateTwoErrors:VR,codes:{ERR_MULTIPLE_CALLBACK:ZR},AbortError:KR}=Ir,{Symbol:M0}=Wt,{kIsDestroyed:JR,isDestroyed:XR,isFinished:YR,isServerRequest:QR}=Wn,k0=M0("kDestroy"),Gl=M0("kConstruct");function F0(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function eA(e,t){const n=this._readableState,o=this._writableState,a=o||n;return o!=null&&o.destroyed||n!=null&&n.destroyed?(typeof t=="function"&&t(),this):(F0(e,o,n),o&&(o.destroyed=!0),n&&(n.destroyed=!0),a.constructed?Rg(this,e,t):this.once(k0,function(f){Rg(this,VR(f,e),t)}),this)}function Rg(e,t,n){let o=!1;function a(f){if(o)return;o=!0;const u=e._readableState,g=e._writableState;F0(f,g,u),g&&(g.closed=!0),u&&(u.closed=!0),typeof n=="function"&&n(f),f?En.nextTick(tA,e,f):En.nextTick(U0,e)}try{e._destroy(t||null,a)}catch(f){a(f)}}function tA(e,t){Vl(e,t),U0(e)}function U0(e){const t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(n!=null&&n.emitClose||t!=null&&t.emitClose)&&e.emit("close")}function Vl(e,t){const n=e._readableState,o=e._writableState;o!=null&&o.errorEmitted||n!=null&&n.errorEmitted||(o&&(o.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit("error",t))}function rA(){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 Zl(e,t,n){const o=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||o!=null&&o.destroyed)return this;o!=null&&o.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),o&&!o.errored&&(o.errored=t),n?En.nextTick(Vl,e,t):Vl(e,t))}function nA(e,t){if(typeof e._construct!="function")return;const n=e._readableState,o=e._writableState;n&&(n.constructed=!1),o&&(o.constructed=!1),e.once(Gl,t),!(e.listenerCount(Gl)>1)&&En.nextTick(iA,e)}function iA(e){let t=!1;function n(o){if(t){Zl(e,o??new ZR);return}t=!0;const a=e._readableState,f=e._writableState,u=f||a;a&&(a.constructed=!0),f&&(f.constructed=!0),u.destroyed?e.emit(k0,o):o?Zl(e,o,!0):En.nextTick(oA,e)}try{e._construct(o=>{En.nextTick(n,o)})}catch(o){En.nextTick(n,o)}}function oA(e){e.emit(Gl)}function Ag(e){return(e==null?void 0:e.setHeader)&&typeof e.abort=="function"}function j0(e){e.emit("close")}function sA(e,t){e.emit("error",t),En.nextTick(j0,e)}function aA(e,t){!e||XR(e)||(!t&&!YR(e)&&(t=new KR),QR(e)?(e.socket=null,e.destroy(t)):Ag(e)?e.abort():Ag(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?En.nextTick(sA,e,t):En.nextTick(j0,e),e.destroyed||(e[JR]=!0))}var _o={construct:nA,destroyer:aA,destroy:eA,undestroy:rA,errorOrDestroy:Zl};const{ArrayIsArray:fA,ObjectSetPrototypeOf:H0}=Wt,{EventEmitter:ef}=V.requireEvents();function tf(e){ef.call(this,e)}H0(tf.prototype,ef.prototype);H0(tf,ef);tf.prototype.pipe=function(e,t){const n=this;function o(_){e.writable&&e.write(_)===!1&&n.pause&&n.pause()}n.on("data",o);function a(){n.readable&&n.resume&&n.resume()}e.on("drain",a),!e._isStdio&&(!t||t.end!==!1)&&(n.on("end",u),n.on("close",g));let f=!1;function u(){f||(f=!0,e.end())}function g(){f||(f=!0,typeof e.destroy=="function"&&e.destroy())}function d(_){h(),ef.listenerCount(this,"error")===0&&this.emit("error",_)}Kl(n,"error",d),Kl(e,"error",d);function h(){n.removeListener("data",o),e.removeListener("drain",a),n.removeListener("end",u),n.removeListener("close",g),n.removeListener("error",d),e.removeListener("error",d),n.removeListener("end",h),n.removeListener("close",h),e.removeListener("close",h)}return n.on("end",h),n.on("close",h),e.on("close",h),e.emit("pipe",n),e};function Kl(e,t,n){if(typeof e.prependListener=="function")return e.prependListener(t,n);!e._events||!e._events[t]?e.on(t,n):fA(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]}var wc={Stream:tf,prependListener:Kl},W0={exports:{}};(function(e){const{SymbolDispose:t}=Wt,{AbortError:n,codes:o}=Ir,{isNodeStream:a,isWebStream:f,kControllerErrorFunction:u}=Wn,g=ai,{ERR_INVALID_ARG_TYPE:d}=o;let h;const _=(E,v)=>{if(typeof E!="object"||!("aborted"in E))throw new d(v,"AbortSignal",E)};e.exports.addAbortSignal=function(v,y){if(_(v,"signal"),!a(y)&&!f(y))throw new d("stream",["ReadableStream","WritableStream","Stream"],y);return e.exports.addAbortSignalNoValidate(v,y)},e.exports.addAbortSignalNoValidate=function(E,v){if(typeof E!="object"||!("aborted"in E))return v;const y=a(v)?()=>{v.destroy(new n(void 0,{cause:E.reason}))}:()=>{v[u](new n(void 0,{cause:E.reason}))};if(E.aborted)y();else{h=h||yr.addAbortListener;const B=h(E,y);g(v,B[t])}return v}})(W0);var rf=W0.exports;const{StringPrototypeSlice:Ig,SymbolIterator:uA,TypedArrayPrototypeSet:Sa,Uint8Array:lA}=Wt,{Buffer:el}=V.bufferPolyfill,{inspect:cA}=yr;var dA=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){const n={data:t,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}unshift(t){const n={data:t,next:this.head};this.length===0&&(this.tail=n),this.head=n,++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 n=this.head,o=""+n.data;for(;(n=n.next)!==null;)o+=t+n.data;return o}concat(t){if(this.length===0)return el.alloc(0);const n=el.allocUnsafe(t>>>0);let o=this.head,a=0;for(;o;)Sa(n,o.data,a),a+=o.data.length,o=o.next;return n}consume(t,n){const o=this.head.data;if(t<o.length){const a=o.slice(0,t);return this.head.data=o.slice(t),a}return t===o.length?this.shift():n?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[uA](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let n="",o=this.head,a=0;do{const f=o.data;if(t>f.length)n+=f,t-=f.length;else{t===f.length?(n+=f,++a,o.next?this.head=o.next:this.head=this.tail=null):(n+=Ig(f,0,t),this.head=o,o.data=Ig(f,t));break}++a}while((o=o.next)!==null);return this.length-=a,n}_getBuffer(t){const n=el.allocUnsafe(t),o=t;let a=this.head,f=0;do{const u=a.data;if(t>u.length)Sa(n,u,o-t),t-=u.length;else{t===u.length?(Sa(n,u,o-t),++f,a.next?this.head=a.next:this.head=this.tail=null):(Sa(n,new lA(u.buffer,u.byteOffset,t),o-t),this.head=a,a.data=u.slice(t));break}++f}while((a=a.next)!==null);return this.length-=f,n}[Symbol.for("nodejs.util.inspect.custom")](t,n){return cA(this,{...n,depth:0,customInspect:!1})}};const{MathFloor:hA,NumberIsInteger:gA}=Wt,{validateInteger:_A}=as,{ERR_INVALID_ARG_VALUE:pA}=Ir.codes;let z0=16*1024,q0=16;function bA(e,t,n){return e.highWaterMark!=null?e.highWaterMark:t?e[n]:null}function G0(e){return e?q0:z0}function wA(e,t){_A(t,"value",0),e?q0=t:z0=t}function yA(e,t,n,o){const a=bA(t,o,n);if(a!=null){if(!gA(a)||a<0){const f=o?`options.${n}`:"options.highWaterMark";throw new pA(f,a)}return hA(a)}return G0(e.objectMode)}var nf={getHighWaterMark:yA,getDefaultHighWaterMark:G0,setDefaultHighWaterMark:wA};const Tg=V.browserExports,{PromisePrototypeThen:mA,SymbolAsyncIterator:Og,SymbolIterator:Cg}=Wt,{Buffer:vA}=V.bufferPolyfill,{ERR_INVALID_ARG_TYPE:EA,ERR_STREAM_NULL_VALUES:SA}=Ir.codes;function RA(e,t,n){let o;if(typeof t=="string"||t instanceof vA)return new e({objectMode:!0,...n,read(){this.push(t),this.push(null)}});let a;if(t&&t[Og])a=!0,o=t[Og]();else if(t&&t[Cg])a=!1,o=t[Cg]();else throw new EA("iterable",["Iterable"],t);const f=new e({objectMode:!0,highWaterMark:1,...n});let u=!1;f._read=function(){u||(u=!0,d())},f._destroy=function(h,_){mA(g(h),()=>Tg.nextTick(_,h),E=>Tg.nextTick(_,E||h))};async function g(h){const _=h!=null,E=typeof o.throw=="function";if(_&&E){const{value:v,done:y}=await o.throw(h);if(await v,y)return}if(typeof o.return=="function"){const{value:v}=await o.return();await v}}async function d(){for(;;){try{const{value:h,done:_}=a?await o.next():o.next();if(_)f.push(null);else{const E=h&&typeof h.then=="function"?await h:h;if(E===null)throw u=!1,new SA;if(f.push(E))continue;u=!1}}catch(h){f.destroy(h)}break}}return f}var V0=RA,tl,Pg;function of(){if(Pg)return tl;Pg=1;const e=V.browserExports,{ArrayPrototypeIndexOf:t,NumberIsInteger:n,NumberIsNaN:o,NumberParseInt:a,ObjectDefineProperties:f,ObjectKeys:u,ObjectSetPrototypeOf:g,Promise:d,SafeSet:h,SymbolAsyncDispose:_,SymbolAsyncIterator:E,Symbol:v}=Wt;tl=xe,xe.ReadableState=et;const{EventEmitter:y}=V.requireEvents(),{Stream:B,prependListener:D}=wc,{Buffer:j}=V.bufferPolyfill,{addAbortSignal:q}=rf,H=ai;let L=yr.debuglog("stream",w=>{L=w});const P=dA,K=_o,{getHighWaterMark:ae,getDefaultHighWaterMark:oe}=nf,{aggregateTwoErrors:be,codes:{ERR_INVALID_ARG_TYPE:de,ERR_METHOD_NOT_IMPLEMENTED:Oe,ERR_OUT_OF_RANGE:ve,ERR_STREAM_PUSH_AFTER_EOF:R,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:T},AbortError:I}=Ir,{validateObject:M}=as,X=v("kPaused"),{StringDecoder:k}=V.requireString_decoder(),J=V0;g(xe.prototype,B.prototype),g(xe,B);const x=()=>{},{errorOrDestroy:z}=K,re=1,he=2,ee=4,ye=8,_e=16,Re=32,Fe=64,Le=128,$e=256,Qe=512,Ke=1024,We=2048,$=4096,U=8192,ne=16384,Ie=32768,we=65536,Ne=1<<17,qe=1<<18;function He(w){return{enumerable:!1,get(){return(this.state&w)!==0},set(C){C?this.state|=w:this.state&=~w}}}f(et.prototype,{objectMode:He(re),ended:He(he),endEmitted:He(ee),reading:He(ye),constructed:He(_e),sync:He(Re),needReadable:He(Fe),emittedReadable:He(Le),readableListening:He($e),resumeScheduled:He(Qe),errorEmitted:He(Ke),emitClose:He(We),autoDestroy:He($),destroyed:He(U),closed:He(ne),closeEmitted:He(Ie),multiAwaitDrain:He(we),readingMore:He(Ne),dataEmitted:He(qe)});function et(w,C,ge){typeof ge!="boolean"&&(ge=C instanceof jn()),this.state=We|$|_e|Re,w&&w.objectMode&&(this.state|=re),ge&&w&&w.readableObjectMode&&(this.state|=re),this.highWaterMark=w?ae(this,w,"readableHighWaterMark",ge):oe(!1),this.buffer=new P,this.length=0,this.pipes=[],this.flowing=null,this[X]=null,w&&w.emitClose===!1&&(this.state&=~We),w&&w.autoDestroy===!1&&(this.state&=~$),this.errored=null,this.defaultEncoding=w&&w.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,w&&w.encoding&&(this.decoder=new k(w.encoding),this.encoding=w.encoding)}function xe(w){if(!(this instanceof xe))return new xe(w);const C=this instanceof jn();this._readableState=new et(w,this,C),w&&(typeof w.read=="function"&&(this._read=w.read),typeof w.destroy=="function"&&(this._destroy=w.destroy),typeof w.construct=="function"&&(this._construct=w.construct),w.signal&&!C&&q(w.signal,this)),B.call(this,w),K.construct(this,()=>{this._readableState.needReadable&&A(this,this._readableState)})}xe.prototype.destroy=K.destroy,xe.prototype._undestroy=K.undestroy,xe.prototype._destroy=function(w,C){C(w)},xe.prototype[y.captureRejectionSymbol]=function(w){this.destroy(w)},xe.prototype[_]=function(){let w;return this.destroyed||(w=this.readableEnded?null:new I,this.destroy(w)),new d((C,ge)=>H(this,Pe=>Pe&&Pe!==w?ge(Pe):C(null)))},xe.prototype.push=function(w,C){return st(this,w,C,!1)},xe.prototype.unshift=function(w,C){return st(this,w,C,!0)};function st(w,C,ge,Pe){L("readableAddChunk",C);const Be=w._readableState;let Ve;if(Be.state&re||(typeof C=="string"?(ge=ge||Be.defaultEncoding,Be.encoding!==ge&&(Pe&&Be.encoding?C=j.from(C,ge).toString(Be.encoding):(C=j.from(C,ge),ge=""))):C instanceof j?ge="":B._isUint8Array(C)?(C=B._uint8ArrayToBuffer(C),ge=""):C!=null&&(Ve=new de("chunk",["string","Buffer","Uint8Array"],C))),Ve)z(w,Ve);else if(C===null)Be.state&=~ye,ft(w,Be);else if(Be.state&re||C&&C.length>0)if(Pe)if(Be.state&ee)z(w,new T);else{if(Be.destroyed||Be.errored)return!1;xt(w,Be,C,!0)}else if(Be.ended)z(w,new R);else{if(Be.destroyed||Be.errored)return!1;Be.state&=~ye,Be.decoder&&!ge?(C=Be.decoder.write(C),Be.objectMode||C.length!==0?xt(w,Be,C,!1):A(w,Be)):xt(w,Be,C,!1)}else Pe||(Be.state&=~ye,A(w,Be));return!Be.ended&&(Be.length<Be.highWaterMark||Be.length===0)}function xt(w,C,ge,Pe){C.flowing&&C.length===0&&!C.sync&&w.listenerCount("data")>0?(C.state&we?C.awaitDrainWriters.clear():C.awaitDrainWriters=null,C.dataEmitted=!0,w.emit("data",ge)):(C.length+=C.objectMode?1:ge.length,Pe?C.buffer.unshift(ge):C.buffer.push(ge),C.state&Fe&&Nt(w)),A(w,C)}xe.prototype.isPaused=function(){const w=this._readableState;return w[X]===!0||w.flowing===!1},xe.prototype.setEncoding=function(w){const C=new k(w);this._readableState.decoder=C,this._readableState.encoding=this._readableState.decoder.encoding;const ge=this._readableState.buffer;let Pe="";for(const Be of ge)Pe+=C.write(Be);return ge.clear(),Pe!==""&&ge.push(Pe),this._readableState.length=Pe.length,this};const gt=1073741824;function ir(w){if(w>gt)throw new ve("size","<= 1GiB",w);return w--,w|=w>>>1,w|=w>>>2,w|=w>>>4,w|=w>>>8,w|=w>>>16,w++,w}function St(w,C){return w<=0||C.length===0&&C.ended?0:C.state&re?1:o(w)?C.flowing&&C.length?C.buffer.first().length:C.length:w<=C.length?w:C.ended?C.length:0}xe.prototype.read=function(w){L("read",w),w===void 0?w=NaN:n(w)||(w=a(w,10));const C=this._readableState,ge=w;if(w>C.highWaterMark&&(C.highWaterMark=ir(w)),w!==0&&(C.state&=~Le),w===0&&C.needReadable&&((C.highWaterMark!==0?C.length>=C.highWaterMark:C.length>0)||C.ended))return L("read: emitReadable",C.length,C.ended),C.length===0&&C.ended?fe(this):Nt(this),null;if(w=St(w,C),w===0&&C.ended)return C.length===0&&fe(this),null;let Pe=(C.state&Fe)!==0;if(L("need readable",Pe),(C.length===0||C.length-w<C.highWaterMark)&&(Pe=!0,L("length less than watermark",Pe)),C.ended||C.reading||C.destroyed||C.errored||!C.constructed)Pe=!1,L("reading, ended or constructing",Pe);else if(Pe){L("do read"),C.state|=ye|Re,C.length===0&&(C.state|=Fe);try{this._read(C.highWaterMark)}catch(Ve){z(this,Ve)}C.state&=~Re,C.reading||(w=St(ge,C))}let Be;return w>0?Be=se(w,C):Be=null,Be===null?(C.needReadable=C.length<=C.highWaterMark,w=0):(C.length-=w,C.multiAwaitDrain?C.awaitDrainWriters.clear():C.awaitDrainWriters=null),C.length===0&&(C.ended||(C.needReadable=!0),ge!==w&&C.ended&&fe(this)),Be!==null&&!C.errorEmitted&&!C.closeEmitted&&(C.dataEmitted=!0,this.emit("data",Be)),Be};function ft(w,C){if(L("onEofChunk"),!C.ended){if(C.decoder){const ge=C.decoder.end();ge&&ge.length&&(C.buffer.push(ge),C.length+=C.objectMode?1:ge.length)}C.ended=!0,C.sync?Nt(w):(C.needReadable=!1,C.emittedReadable=!0,Dt(w))}}function Nt(w){const C=w._readableState;L("emitReadable",C.needReadable,C.emittedReadable),C.needReadable=!1,C.emittedReadable||(L("emitReadable",C.flowing),C.emittedReadable=!0,e.nextTick(Dt,w))}function Dt(w){const C=w._readableState;L("emitReadable_",C.destroyed,C.length,C.ended),!C.destroyed&&!C.errored&&(C.length||C.ended)&&(w.emit("readable"),C.emittedReadable=!1),C.needReadable=!C.flowing&&!C.ended&&C.length<=C.highWaterMark,Ae(w)}function A(w,C){!C.readingMore&&C.constructed&&(C.readingMore=!0,e.nextTick(me,w,C))}function me(w,C){for(;!C.reading&&!C.ended&&(C.length<C.highWaterMark||C.flowing&&C.length===0);){const ge=C.length;if(L("maybeReadMore read 0"),w.read(0),ge===C.length)break}C.readingMore=!1}xe.prototype._read=function(w){throw new Oe("_read()")},xe.prototype.pipe=function(w,C){const ge=this,Pe=this._readableState;Pe.pipes.length===1&&(Pe.multiAwaitDrain||(Pe.multiAwaitDrain=!0,Pe.awaitDrainWriters=new h(Pe.awaitDrainWriters?[Pe.awaitDrainWriters]:[]))),Pe.pipes.push(w),L("pipe count=%d opts=%j",Pe.pipes.length,C);const Ve=(!C||C.end!==!1)&&w!==e.stdout&&w!==e.stderr?Mt:kr;Pe.endEmitted?e.nextTick(Ve):ge.once("end",Ve),w.on("unpipe",at);function at(Qr,Or){L("onunpipe"),Qr===ge&&Or&&Or.hasUnpiped===!1&&(Or.hasUnpiped=!0,cn())}function Mt(){L("onend"),w.end()}let _t,Yr=!1;function cn(){L("cleanup"),w.removeListener("close",Ut),w.removeListener("finish",Zt),_t&&w.removeListener("drain",_t),w.removeListener("error",Bt),w.removeListener("unpipe",at),ge.removeListener("end",Mt),ge.removeListener("end",kr),ge.removeListener("data",Vt),Yr=!0,_t&&Pe.awaitDrainWriters&&(!w._writableState||w._writableState.needDrain)&&_t()}function Rt(){Yr||(Pe.pipes.length===1&&Pe.pipes[0]===w?(L("false write response, pause",0),Pe.awaitDrainWriters=w,Pe.multiAwaitDrain=!1):Pe.pipes.length>1&&Pe.pipes.includes(w)&&(L("false write response, pause",Pe.awaitDrainWriters.size),Pe.awaitDrainWriters.add(w)),ge.pause()),_t||(_t=Ce(ge,w),w.on("drain",_t))}ge.on("data",Vt);function Vt(Qr){L("ondata");const Or=w.write(Qr);L("dest.write",Or),Or===!1&&Rt()}function Bt(Qr){if(L("onerror",Qr),kr(),w.removeListener("error",Bt),w.listenerCount("error")===0){const Or=w._writableState||w._readableState;Or&&!Or.errorEmitted?z(w,Qr):w.emit("error",Qr)}}D(w,"error",Bt);function Ut(){w.removeListener("finish",Zt),kr()}w.once("close",Ut);function Zt(){L("onfinish"),w.removeListener("close",Ut),kr()}w.once("finish",Zt);function kr(){L("unpipe"),ge.unpipe(w)}return w.emit("pipe",ge),w.writableNeedDrain===!0?Rt():Pe.flowing||(L("pipe resume"),ge.resume()),w};function Ce(w,C){return function(){const Pe=w._readableState;Pe.awaitDrainWriters===C?(L("pipeOnDrain",1),Pe.awaitDrainWriters=null):Pe.multiAwaitDrain&&(L("pipeOnDrain",Pe.awaitDrainWriters.size),Pe.awaitDrainWriters.delete(C)),(!Pe.awaitDrainWriters||Pe.awaitDrainWriters.size===0)&&w.listenerCount("data")&&w.resume()}}xe.prototype.unpipe=function(w){const C=this._readableState,ge={hasUnpiped:!1};if(C.pipes.length===0)return this;if(!w){const Be=C.pipes;C.pipes=[],this.pause();for(let Ve=0;Ve<Be.length;Ve++)Be[Ve].emit("unpipe",this,{hasUnpiped:!1});return this}const Pe=t(C.pipes,w);return Pe===-1?this:(C.pipes.splice(Pe,1),C.pipes.length===0&&this.pause(),w.emit("unpipe",this,ge),this)},xe.prototype.on=function(w,C){const ge=B.prototype.on.call(this,w,C),Pe=this._readableState;return w==="data"?(Pe.readableListening=this.listenerCount("readable")>0,Pe.flowing!==!1&&this.resume()):w==="readable"&&!Pe.endEmitted&&!Pe.readableListening&&(Pe.readableListening=Pe.needReadable=!0,Pe.flowing=!1,Pe.emittedReadable=!1,L("on readable",Pe.length,Pe.reading),Pe.length?Nt(this):Pe.reading||e.nextTick(Z,this)),ge},xe.prototype.addListener=xe.prototype.on,xe.prototype.removeListener=function(w,C){const ge=B.prototype.removeListener.call(this,w,C);return w==="readable"&&e.nextTick(De,this),ge},xe.prototype.off=xe.prototype.removeListener,xe.prototype.removeAllListeners=function(w){const C=B.prototype.removeAllListeners.apply(this,arguments);return(w==="readable"||w===void 0)&&e.nextTick(De,this),C};function De(w){const C=w._readableState;C.readableListening=w.listenerCount("readable")>0,C.resumeScheduled&&C[X]===!1?C.flowing=!0:w.listenerCount("data")>0?w.resume():C.readableListening||(C.flowing=null)}function Z(w){L("readable nexttick read 0"),w.read(0)}xe.prototype.resume=function(){const w=this._readableState;return w.flowing||(L("resume"),w.flowing=!w.readableListening,ce(this,w)),w[X]=!1,this};function ce(w,C){C.resumeScheduled||(C.resumeScheduled=!0,e.nextTick(b,w,C))}function b(w,C){L("resume",C.reading),C.reading||w.read(0),C.resumeScheduled=!1,w.emit("resume"),Ae(w),C.flowing&&!C.reading&&w.read(0)}xe.prototype.pause=function(){return L("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(L("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[X]=!0,this};function Ae(w){const C=w._readableState;for(L("flow",C.flowing);C.flowing&&w.read()!==null;);}xe.prototype.wrap=function(w){let C=!1;w.on("data",Pe=>{!this.push(Pe)&&w.pause&&(C=!0,w.pause())}),w.on("end",()=>{this.push(null)}),w.on("error",Pe=>{z(this,Pe)}),w.on("close",()=>{this.destroy()}),w.on("destroy",()=>{this.destroy()}),this._read=()=>{C&&w.resume&&(C=!1,w.resume())};const ge=u(w);for(let Pe=1;Pe<ge.length;Pe++){const Be=ge[Pe];this[Be]===void 0&&typeof w[Be]=="function"&&(this[Be]=w[Be].bind(w))}return this},xe.prototype[E]=function(){return Ge(this)},xe.prototype.iterator=function(w){return w!==void 0&&M(w,"options"),Ge(this,w)};function Ge(w,C){typeof w.read!="function"&&(w=xe.wrap(w,{objectMode:!0}));const ge=l(w,C);return ge.stream=w,ge}async function*l(w,C){let ge=x;function Pe(at){this===w?(ge(),ge=x):ge=at}w.on("readable",Pe);let Be;const Ve=H(w,{writable:!1},at=>{Be=at?be(Be,at):null,ge(),ge=x});try{for(;;){const at=w.destroyed?null:w.read();if(at!==null)yield at;else{if(Be)throw Be;if(Be===null)return;await new d(Pe)}}}catch(at){throw Be=be(Be,at),Be}finally{(Be||(C==null?void 0:C.destroyOnReturn)!==!1)&&(Be===void 0||w._readableState.autoDestroy)?K.destroyer(w,null):(w.off("readable",Pe),Ve())}}f(xe.prototype,{readable:{__proto__:null,get(){const w=this._readableState;return!!w&&w.readable!==!1&&!w.destroyed&&!w.errorEmitted&&!w.endEmitted},set(w){this._readableState&&(this._readableState.readable=!!w)}},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(w){this._readableState&&(this._readableState.flowing=w)}},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(w){this._readableState&&(this._readableState.destroyed=w)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),f(et.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[X]!==!1},set(w){this[X]=!!w}}}),xe._fromList=se;function se(w,C){if(C.length===0)return null;let ge;return C.objectMode?ge=C.buffer.shift():!w||w>=C.length?(C.decoder?ge=C.buffer.join(""):C.buffer.length===1?ge=C.buffer.first():ge=C.buffer.concat(C.length),C.buffer.clear()):ge=C.buffer.consume(w,C.decoder),ge}function fe(w){const C=w._readableState;L("endReadable",C.endEmitted),C.endEmitted||(C.ended=!0,e.nextTick(m,C,w))}function m(w,C){if(L("endReadableNT",w.endEmitted,w.length),!w.errored&&!w.closeEmitted&&!w.endEmitted&&w.length===0){if(w.endEmitted=!0,C.emit("end"),C.writable&&C.allowHalfOpen===!1)e.nextTick(W,C);else if(w.autoDestroy){const ge=C._writableState;(!ge||ge.autoDestroy&&(ge.finished||ge.writable===!1))&&C.destroy()}}}function W(w){w.writable&&!w.writableEnded&&!w.destroyed&&w.end()}xe.from=function(w,C){return J(xe,w,C)};let ie;function Ue(){return ie===void 0&&(ie={}),ie}return xe.fromWeb=function(w,C){return Ue().newStreamReadableFromReadableStream(w,C)},xe.toWeb=function(w,C){return Ue().newReadableStreamFromStreamReadable(w,C)},xe.wrap=function(w,C){var ge,Pe;return new xe({objectMode:(ge=(Pe=w.readableObjectMode)!==null&&Pe!==void 0?Pe:w.objectMode)!==null&&ge!==void 0?ge:!0,...C,destroy(Be,Ve){K.destroyer(w,Be),Ve(Be)}}).wrap(w)},tl}var rl,Lg;function yc(){if(Lg)return rl;Lg=1;const e=V.browserExports,{ArrayPrototypeSlice:t,Error:n,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:a,ObjectDefineProperties:f,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:g,Symbol:d,SymbolHasInstance:h}=Wt;rl=M,M.WritableState=T;const{EventEmitter:_}=V.requireEvents(),E=wc.Stream,{Buffer:v}=V.bufferPolyfill,y=_o,{addAbortSignal:B}=rf,{getHighWaterMark:D,getDefaultHighWaterMark:j}=nf,{ERR_INVALID_ARG_TYPE:q,ERR_METHOD_NOT_IMPLEMENTED:H,ERR_MULTIPLE_CALLBACK:L,ERR_STREAM_CANNOT_PIPE:P,ERR_STREAM_DESTROYED:K,ERR_STREAM_ALREADY_FINISHED:ae,ERR_STREAM_NULL_VALUES:oe,ERR_STREAM_WRITE_AFTER_END:be,ERR_UNKNOWN_ENCODING:de}=Ir.codes,{errorOrDestroy:Oe}=y;u(M.prototype,E.prototype),u(M,E);function ve(){}const R=d("kOnFinished");function T($,U,ne){typeof ne!="boolean"&&(ne=U instanceof jn()),this.objectMode=!!($&&$.objectMode),ne&&(this.objectMode=this.objectMode||!!($&&$.writableObjectMode)),this.highWaterMark=$?D(this,$,"writableHighWaterMark",ne):j(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const Ie=!!($&&$.decodeStrings===!1);this.decodeStrings=!Ie,this.defaultEncoding=$&&$.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=z.bind(void 0,U),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,I(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!$||$.emitClose!==!1,this.autoDestroy=!$||$.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[R]=[]}function I($){$.buffered=[],$.bufferedIndex=0,$.allBuffers=!0,$.allNoop=!0}T.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},a(T.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function M($){const U=this instanceof jn();if(!U&&!o(M,this))return new M($);this._writableState=new T($,this,U),$&&(typeof $.write=="function"&&(this._write=$.write),typeof $.writev=="function"&&(this._writev=$.writev),typeof $.destroy=="function"&&(this._destroy=$.destroy),typeof $.final=="function"&&(this._final=$.final),typeof $.construct=="function"&&(this._construct=$.construct),$.signal&&B($.signal,this)),E.call(this,$),y.construct(this,()=>{const ne=this._writableState;ne.writing||ye(this,ne),Le(this,ne)})}a(M,h,{__proto__:null,value:function($){return o(this,$)?!0:this!==M?!1:$&&$._writableState instanceof T}}),M.prototype.pipe=function(){Oe(this,new P)};function X($,U,ne,Ie){const we=$._writableState;if(typeof ne=="function")Ie=ne,ne=we.defaultEncoding;else{if(!ne)ne=we.defaultEncoding;else if(ne!=="buffer"&&!v.isEncoding(ne))throw new de(ne);typeof Ie!="function"&&(Ie=ve)}if(U===null)throw new oe;if(!we.objectMode)if(typeof U=="string")we.decodeStrings!==!1&&(U=v.from(U,ne),ne="buffer");else if(U instanceof v)ne="buffer";else if(E._isUint8Array(U))U=E._uint8ArrayToBuffer(U),ne="buffer";else throw new q("chunk",["string","Buffer","Uint8Array"],U);let Ne;return we.ending?Ne=new be:we.destroyed&&(Ne=new K("write")),Ne?(e.nextTick(Ie,Ne),Oe($,Ne,!0),Ne):(we.pendingcb++,k($,we,U,ne,Ie))}M.prototype.write=function($,U,ne){return X(this,$,U,ne)===!0},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){const $=this._writableState;$.corked&&($.corked--,$.writing||ye(this,$))},M.prototype.setDefaultEncoding=function(U){if(typeof U=="string"&&(U=g(U)),!v.isEncoding(U))throw new de(U);return this._writableState.defaultEncoding=U,this};function k($,U,ne,Ie,we){const Ne=U.objectMode?1:ne.length;U.length+=Ne;const qe=U.length<U.highWaterMark;return qe||(U.needDrain=!0),U.writing||U.corked||U.errored||!U.constructed?(U.buffered.push({chunk:ne,encoding:Ie,callback:we}),U.allBuffers&&Ie!=="buffer"&&(U.allBuffers=!1),U.allNoop&&we!==ve&&(U.allNoop=!1)):(U.writelen=Ne,U.writecb=we,U.writing=!0,U.sync=!0,$._write(ne,Ie,U.onwrite),U.sync=!1),qe&&!U.errored&&!U.destroyed}function J($,U,ne,Ie,we,Ne,qe){U.writelen=Ie,U.writecb=qe,U.writing=!0,U.sync=!0,U.destroyed?U.onwrite(new K("write")):ne?$._writev(we,U.onwrite):$._write(we,Ne,U.onwrite),U.sync=!1}function x($,U,ne,Ie){--U.pendingcb,Ie(ne),ee(U),Oe($,ne)}function z($,U){const ne=$._writableState,Ie=ne.sync,we=ne.writecb;if(typeof we!="function"){Oe($,new L);return}ne.writing=!1,ne.writecb=null,ne.length-=ne.writelen,ne.writelen=0,U?(U.stack,ne.errored||(ne.errored=U),$._readableState&&!$._readableState.errored&&($._readableState.errored=U),Ie?e.nextTick(x,$,ne,U,we):x($,ne,U,we)):(ne.buffered.length>ne.bufferedIndex&&ye($,ne),Ie?ne.afterWriteTickInfo!==null&&ne.afterWriteTickInfo.cb===we?ne.afterWriteTickInfo.count++:(ne.afterWriteTickInfo={count:1,cb:we,stream:$,state:ne},e.nextTick(re,ne.afterWriteTickInfo)):he($,ne,1,we))}function re({stream:$,state:U,count:ne,cb:Ie}){return U.afterWriteTickInfo=null,he($,U,ne,Ie)}function he($,U,ne,Ie){for(!U.ending&&!$.destroyed&&U.length===0&&U.needDrain&&(U.needDrain=!1,$.emit("drain"));ne-- >0;)U.pendingcb--,Ie();U.destroyed&&ee(U),Le($,U)}function ee($){if($.writing)return;for(let we=$.bufferedIndex;we<$.buffered.length;++we){var U;const{chunk:Ne,callback:qe}=$.buffered[we],He=$.objectMode?1:Ne.length;$.length-=He,qe((U=$.errored)!==null&&U!==void 0?U:new K("write"))}const ne=$[R].splice(0);for(let we=0;we<ne.length;we++){var Ie;ne[we]((Ie=$.errored)!==null&&Ie!==void 0?Ie:new K("end"))}I($)}function ye($,U){if(U.corked||U.bufferProcessing||U.destroyed||!U.constructed)return;const{buffered:ne,bufferedIndex:Ie,objectMode:we}=U,Ne=ne.length-Ie;if(!Ne)return;let qe=Ie;if(U.bufferProcessing=!0,Ne>1&&$._writev){U.pendingcb-=Ne-1;const He=U.allNoop?ve:xe=>{for(let st=qe;st<ne.length;++st)ne[st].callback(xe)},et=U.allNoop&&qe===0?ne:t(ne,qe);et.allBuffers=U.allBuffers,J($,U,!0,U.length,et,"",He),I(U)}else{do{const{chunk:He,encoding:et,callback:xe}=ne[qe];ne[qe++]=null;const st=we?1:He.length;J($,U,!1,st,He,et,xe)}while(qe<ne.length&&!U.writing);qe===ne.length?I(U):qe>256?(ne.splice(0,qe),U.bufferedIndex=0):U.bufferedIndex=qe}U.bufferProcessing=!1}M.prototype._write=function($,U,ne){if(this._writev)this._writev([{chunk:$,encoding:U}],ne);else throw new H("_write()")},M.prototype._writev=null,M.prototype.end=function($,U,ne){const Ie=this._writableState;typeof $=="function"?(ne=$,$=null,U=null):typeof U=="function"&&(ne=U,U=null);let we;if($!=null){const Ne=X(this,$,U);Ne instanceof n&&(we=Ne)}return Ie.corked&&(Ie.corked=1,this.uncork()),we||(!Ie.errored&&!Ie.ending?(Ie.ending=!0,Le(this,Ie,!0),Ie.ended=!0):Ie.finished?we=new ae("end"):Ie.destroyed&&(we=new K("end"))),typeof ne=="function"&&(we||Ie.finished?e.nextTick(ne,we):Ie[R].push(ne)),this};function _e($){return $.ending&&!$.destroyed&&$.constructed&&$.length===0&&!$.errored&&$.buffered.length===0&&!$.finished&&!$.writing&&!$.errorEmitted&&!$.closeEmitted}function Re($,U){let ne=!1;function Ie(we){if(ne){Oe($,we??L());return}if(ne=!0,U.pendingcb--,we){const Ne=U[R].splice(0);for(let qe=0;qe<Ne.length;qe++)Ne[qe](we);Oe($,we,U.sync)}else _e(U)&&(U.prefinished=!0,$.emit("prefinish"),U.pendingcb++,e.nextTick($e,$,U))}U.sync=!0,U.pendingcb++;try{$._final(Ie)}catch(we){Ie(we)}U.sync=!1}function Fe($,U){!U.prefinished&&!U.finalCalled&&(typeof $._final=="function"&&!U.destroyed?(U.finalCalled=!0,Re($,U)):(U.prefinished=!0,$.emit("prefinish")))}function Le($,U,ne){_e(U)&&(Fe($,U),U.pendingcb===0&&(ne?(U.pendingcb++,e.nextTick((Ie,we)=>{_e(we)?$e(Ie,we):we.pendingcb--},$,U)):_e(U)&&(U.pendingcb++,$e($,U))))}function $e($,U){U.pendingcb--,U.finished=!0;const ne=U[R].splice(0);for(let Ie=0;Ie<ne.length;Ie++)ne[Ie]();if($.emit("finish"),U.autoDestroy){const Ie=$._readableState;(!Ie||Ie.autoDestroy&&(Ie.endEmitted||Ie.readable===!1))&&$.destroy()}}f(M.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set($){this._writableState&&(this._writableState.destroyed=$)}},writable:{__proto__:null,get(){const $=this._writableState;return!!$&&$.writable!==!1&&!$.destroyed&&!$.errored&&!$.ending&&!$.ended},set($){this._writableState&&(this._writableState.writable=!!$)}},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 $=this._writableState;return $?!$.destroyed&&!$.ending&&$.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 Qe=y.destroy;M.prototype.destroy=function($,U){const ne=this._writableState;return!ne.destroyed&&(ne.bufferedIndex<ne.buffered.length||ne[R].length)&&e.nextTick(ee,ne),Qe.call(this,$,U),this},M.prototype._undestroy=y.undestroy,M.prototype._destroy=function($,U){U($)},M.prototype[_.captureRejectionSymbol]=function($){this.destroy($)};let Ke;function We(){return Ke===void 0&&(Ke={}),Ke}return M.fromWeb=function($,U){return We().newStreamWritableFromWritableStream($,U)},M.toWeb=function($){return We().newWritableStreamFromStreamWritable($)},rl}var nl,Ng;function AA(){if(Ng)return nl;Ng=1;const e=V.browserExports,t=V.bufferPolyfill,{isReadable:n,isWritable:o,isIterable:a,isNodeStream:f,isReadableNodeStream:u,isWritableNodeStream:g,isDuplexNodeStream:d,isReadableStream:h,isWritableStream:_}=Wn,E=ai,{AbortError:v,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:B}}=Ir,{destroyer:D}=_o,j=jn(),q=of(),H=yc(),{createDeferredPromise:L}=yr,P=V0,K=globalThis.Blob||t.Blob,ae=typeof K<"u"?function(T){return T instanceof K}:function(T){return!1},oe=globalThis.AbortController||ns().AbortController,{FunctionPrototypeCall:be}=Wt;class de extends j{constructor(T){super(T),(T==null?void 0:T.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(T==null?void 0:T.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}nl=function R(T,I){if(d(T))return T;if(u(T))return ve({readable:T});if(g(T))return ve({writable:T});if(f(T))return ve({writable:!1,readable:!1});if(h(T))return ve({readable:q.fromWeb(T)});if(_(T))return ve({writable:H.fromWeb(T)});if(typeof T=="function"){const{value:X,write:k,final:J,destroy:x}=Oe(T);if(a(X))return P(de,X,{objectMode:!0,write:k,final:J,destroy:x});const z=X==null?void 0:X.then;if(typeof z=="function"){let re;const he=be(z,X,ee=>{if(ee!=null)throw new B("nully","body",ee)},ee=>{D(re,ee)});return re=new de({objectMode:!0,readable:!1,write:k,final(ee){J(async()=>{try{await he,e.nextTick(ee,null)}catch(ye){e.nextTick(ee,ye)}})},destroy:x})}throw new B("Iterable, AsyncIterable or AsyncFunction",I,X)}if(ae(T))return R(T.arrayBuffer());if(a(T))return P(de,T,{objectMode:!0,writable:!1});if(h(T==null?void 0:T.readable)&&_(T==null?void 0:T.writable))return de.fromWeb(T);if(typeof(T==null?void 0:T.writable)=="object"||typeof(T==null?void 0:T.readable)=="object"){const X=T!=null&&T.readable?u(T==null?void 0:T.readable)?T==null?void 0:T.readable:R(T.readable):void 0,k=T!=null&&T.writable?g(T==null?void 0:T.writable)?T==null?void 0:T.writable:R(T.writable):void 0;return ve({readable:X,writable:k})}const M=T==null?void 0:T.then;if(typeof M=="function"){let X;return be(M,T,k=>{k!=null&&X.push(k),X.push(null)},k=>{D(X,k)}),X=new de({objectMode:!0,writable:!1,read(){}})}throw new y(I,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],T)};function Oe(R){let{promise:T,resolve:I}=L();const M=new oe,X=M.signal;return{value:R(async function*(){for(;;){const J=T;T=null;const{chunk:x,done:z,cb:re}=await J;if(e.nextTick(re),z)return;if(X.aborted)throw new v(void 0,{cause:X.reason});({promise:T,resolve:I}=L()),yield x}}(),{signal:X}),write(J,x,z){const re=I;I=null,re({chunk:J,done:!1,cb:z})},final(J){const x=I;I=null,x({done:!0,cb:J})},destroy(J,x){M.abort(),x(J)}}}function ve(R){const T=R.readable&&typeof R.readable.read!="function"?q.wrap(R.readable):R.readable,I=R.writable;let M=!!n(T),X=!!o(I),k,J,x,z,re;function he(ee){const ye=z;z=null,ye?ye(ee):ee&&re.destroy(ee)}return re=new de({readableObjectMode:!!(T!=null&&T.readableObjectMode),writableObjectMode:!!(I!=null&&I.writableObjectMode),readable:M,writable:X}),X&&(E(I,ee=>{X=!1,ee&&D(T,ee),he(ee)}),re._write=function(ee,ye,_e){I.write(ee,ye)?_e():k=_e},re._final=function(ee){I.end(),J=ee},I.on("drain",function(){if(k){const ee=k;k=null,ee()}}),I.on("finish",function(){if(J){const ee=J;J=null,ee()}})),M&&(E(T,ee=>{M=!1,ee&&D(T,ee),he(ee)}),T.on("readable",function(){if(x){const ee=x;x=null,ee()}}),T.on("end",function(){re.push(null)}),re._read=function(){for(;;){const ee=T.read();if(ee===null){x=re._read;return}if(!re.push(ee))return}}),re._destroy=function(ee,ye){!ee&&z!==null&&(ee=new v),x=null,k=null,J=null,z===null?ye(ee):(z=ye,D(I,ee),D(T,ee))},re}return nl}var il,Bg;function jn(){if(Bg)return il;Bg=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:n,ObjectSetPrototypeOf:o}=Wt;il=u;const a=of(),f=yc();o(u.prototype,a.prototype),o(u,a);{const _=n(f.prototype);for(let E=0;E<_.length;E++){const v=_[E];u.prototype[v]||(u.prototype[v]=f.prototype[v])}}function u(_){if(!(this instanceof u))return new u(_);a.call(this,_),f.call(this,_),_?(this.allowHalfOpen=_.allowHalfOpen!==!1,_.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),_.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(u.prototype,{writable:{__proto__:null,...t(f.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(f.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(f.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(f.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(f.prototype,"writableLength")},writableFinished:{__proto__:null,...t(f.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(f.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(f.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(f.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(_){this._readableState&&this._writableState&&(this._readableState.destroyed=_,this._writableState.destroyed=_)}}});let g;function d(){return g===void 0&&(g={}),g}u.fromWeb=function(_,E){return d().newStreamDuplexFromReadableWritablePair(_,E)},u.toWeb=function(_){return d().newReadableWritablePairFromDuplex(_)};let h;return u.from=function(_){return h||(h=AA()),h(_,"body")},il}const{ObjectSetPrototypeOf:Z0,Symbol:IA}=Wt;var K0=Hn;const{ERR_METHOD_NOT_IMPLEMENTED:TA}=Ir.codes,mc=jn(),{getHighWaterMark:OA}=nf;Z0(Hn.prototype,mc.prototype);Z0(Hn,mc);const Qo=IA("kCallback");function Hn(e){if(!(this instanceof Hn))return new Hn(e);const t=e?OA(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),mc.call(this,e),this._readableState.sync=!1,this[Qo]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",CA)}function Jl(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,n)=>{if(t){e?e(t):this.destroy(t);return}n!=null&&this.push(n),this.push(null),e&&e()}):(this.push(null),e&&e())}function CA(){this._final!==Jl&&Jl.call(this)}Hn.prototype._final=Jl;Hn.prototype._transform=function(e,t,n){throw new TA("_transform()")};Hn.prototype._write=function(e,t,n){const o=this._readableState,a=this._writableState,f=o.length;this._transform(e,t,(u,g)=>{if(u){n(u);return}g!=null&&this.push(g),a.ended||f===o.length||o.length<o.highWaterMark?n():this[Qo]=n})};Hn.prototype._read=function(){if(this[Qo]){const e=this[Qo];this[Qo]=null,e()}};const{ObjectSetPrototypeOf:J0}=Wt;var X0=fo;const vc=K0;J0(fo.prototype,vc.prototype);J0(fo,vc);function fo(e){if(!(this instanceof fo))return new fo(e);vc.call(this,e)}fo.prototype._transform=function(e,t,n){n(null,e)};const Yo=V.browserExports,{ArrayIsArray:PA,Promise:LA,SymbolAsyncIterator:NA,SymbolDispose:BA}=Wt,Ua=ai,{once:$A}=yr,xA=_o,$g=jn(),{aggregateTwoErrors:DA,codes:{ERR_INVALID_ARG_TYPE:Xl,ERR_INVALID_RETURN_VALUE:ol,ERR_MISSING_ARGS:MA,ERR_STREAM_DESTROYED:kA,ERR_STREAM_PREMATURE_CLOSE:FA},AbortError:UA}=Ir,{validateFunction:jA,validateAbortSignal:HA}=as,{isIterable:mi,isReadable:sl,isReadableNodeStream:xa,isNodeStream:xg,isTransformStream:ro,isWebStream:WA,isReadableStream:al,isReadableFinished:zA}=Wn,qA=globalThis.AbortController||ns().AbortController;let fl,ul,ll;function Dg(e,t,n){let o=!1;e.on("close",()=>{o=!0});const a=Ua(e,{readable:t,writable:n},f=>{o=!f});return{destroy:f=>{o||(o=!0,xA.destroyer(e,f||new kA("pipe")))},cleanup:a}}function GA(e){return jA(e[e.length-1],"streams[stream.length - 1]"),e.pop()}function cl(e){if(mi(e))return e;if(xa(e))return VA(e);throw new Xl("val",["Readable","Iterable","AsyncIterable"],e)}async function*VA(e){ul||(ul=of()),yield*ul.prototype[NA].call(e)}async function Ra(e,t,n,{end:o}){let a,f=null;const u=h=>{if(h&&(a=h),f){const _=f;f=null,_()}},g=()=>new LA((h,_)=>{a?_(a):f=()=>{a?_(a):h()}});t.on("drain",u);const d=Ua(t,{readable:!1},u);try{t.writableNeedDrain&&await g();for await(const h of e)t.write(h)||await g();o&&(t.end(),await g()),n()}catch(h){n(a!==h?DA(a,h):h)}finally{d(),t.off("drain",u)}}async function dl(e,t,n,{end:o}){ro(t)&&(t=t.writable);const a=t.getWriter();try{for await(const f of e)await a.ready,a.write(f).catch(()=>{});await a.ready,o&&await a.close(),n()}catch(f){try{await a.abort(f),n(f)}catch(u){n(u)}}}function ZA(...e){return Y0(e,$A(GA(e)))}function Y0(e,t,n){if(e.length===1&&PA(e[0])&&(e=e[0]),e.length<2)throw new MA("streams");const o=new qA,a=o.signal,f=n==null?void 0:n.signal,u=[];HA(f,"options.signal");function g(){B(new UA)}ll=ll||yr.addAbortListener;let d;f&&(d=ll(f,g));let h,_;const E=[];let v=0;function y(H){B(H,--v===0)}function B(H,L){var P;if(H&&(!h||h.code==="ERR_STREAM_PREMATURE_CLOSE")&&(h=H),!(!h&&!L)){for(;E.length;)E.shift()(h);(P=d)===null||P===void 0||P[BA](),o.abort(),L&&(h||u.forEach(K=>K()),Yo.nextTick(t,h,_))}}let D;for(let H=0;H<e.length;H++){const L=e[H],P=H<e.length-1,K=H>0,ae=P||(n==null?void 0:n.end)!==!1,oe=H===e.length-1;if(xg(L)){let be=function(de){de&&de.name!=="AbortError"&&de.code!=="ERR_STREAM_PREMATURE_CLOSE"&&y(de)};if(ae){const{destroy:de,cleanup:Oe}=Dg(L,P,K);E.push(de),sl(L)&&oe&&u.push(Oe)}L.on("error",be),sl(L)&&oe&&u.push(()=>{L.removeListener("error",be)})}if(H===0)if(typeof L=="function"){if(D=L({signal:a}),!mi(D))throw new ol("Iterable, AsyncIterable or Stream","source",D)}else mi(L)||xa(L)||ro(L)?D=L:D=$g.from(L);else if(typeof L=="function"){if(ro(D)){var j;D=cl((j=D)===null||j===void 0?void 0:j.readable)}else D=cl(D);if(D=L(D,{signal:a}),P){if(!mi(D,!0))throw new ol("AsyncIterable",`transform[${H-1}]`,D)}else{var q;fl||(fl=X0);const be=new fl({objectMode:!0}),de=(q=D)===null||q===void 0?void 0:q.then;if(typeof de=="function")v++,de.call(D,R=>{_=R,R!=null&&be.write(R),ae&&be.end(),Yo.nextTick(y)},R=>{be.destroy(R),Yo.nextTick(y,R)});else if(mi(D,!0))v++,Ra(D,be,y,{end:ae});else if(al(D)||ro(D)){const R=D.readable||D;v++,Ra(R,be,y,{end:ae})}else throw new ol("AsyncIterable or Promise","destination",D);D=be;const{destroy:Oe,cleanup:ve}=Dg(D,!1,!0);E.push(Oe),oe&&u.push(ve)}}else if(xg(L)){if(xa(D)){v+=2;const be=KA(D,L,y,{end:ae});sl(L)&&oe&&u.push(be)}else if(ro(D)||al(D)){const be=D.readable||D;v++,Ra(be,L,y,{end:ae})}else if(mi(D))v++,Ra(D,L,y,{end:ae});else throw new Xl("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],D);D=L}else if(WA(L)){if(xa(D))v++,dl(cl(D),L,y,{end:ae});else if(al(D)||mi(D))v++,dl(D,L,y,{end:ae});else if(ro(D))v++,dl(D.readable,L,y,{end:ae});else throw new Xl("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],D);D=L}else D=$g.from(L)}return(a!=null&&a.aborted||f!=null&&f.aborted)&&Yo.nextTick(g),D}function KA(e,t,n,{end:o}){let a=!1;if(t.on("close",()=>{a||n(new FA)}),e.pipe(t,{end:!1}),o){let f=function(){a=!0,t.end()};zA(e)?Yo.nextTick(f):e.once("end",f)}else n();return Ua(e,{readable:!0,writable:!1},f=>{const u=e._readableState;f&&f.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?e.once("end",n).once("error",n):n(f)}),Ua(t,{readable:!1,writable:!0},n)}var Ec={pipelineImpl:Y0,pipeline:ZA};const{pipeline:JA}=Ec,Aa=jn(),{destroyer:XA}=_o,{isNodeStream:Ia,isReadable:Mg,isWritable:kg,isWebStream:hl,isTransformStream:wi,isWritableStream:Fg,isReadableStream:Ug}=Wn,{AbortError:YA,codes:{ERR_INVALID_ARG_VALUE:jg,ERR_MISSING_ARGS:QA}}=Ir,eI=ai;var Q0=function(...t){if(t.length===0)throw new QA("streams");if(t.length===1)return Aa.from(t[0]);const n=[...t];if(typeof t[0]=="function"&&(t[0]=Aa.from(t[0])),typeof t[t.length-1]=="function"){const y=t.length-1;t[y]=Aa.from(t[y])}for(let y=0;y<t.length;++y)if(!(!Ia(t[y])&&!hl(t[y]))){if(y<t.length-1&&!(Mg(t[y])||Ug(t[y])||wi(t[y])))throw new jg(`streams[${y}]`,n[y],"must be readable");if(y>0&&!(kg(t[y])||Fg(t[y])||wi(t[y])))throw new jg(`streams[${y}]`,n[y],"must be writable")}let o,a,f,u,g;function d(y){const B=u;u=null,B?B(y):y?g.destroy(y):!v&&!E&&g.destroy()}const h=t[0],_=JA(t,d),E=!!(kg(h)||Fg(h)||wi(h)),v=!!(Mg(_)||Ug(_)||wi(_));if(g=new Aa({writableObjectMode:!!(h!=null&&h.writableObjectMode),readableObjectMode:!!(_!=null&&_.readableObjectMode),writable:E,readable:v}),E){if(Ia(h))g._write=function(B,D,j){h.write(B,D)?j():o=j},g._final=function(B){h.end(),a=B},h.on("drain",function(){if(o){const B=o;o=null,B()}});else if(hl(h)){const D=(wi(h)?h.writable:h).getWriter();g._write=async function(j,q,H){try{await D.ready,D.write(j).catch(()=>{}),H()}catch(L){H(L)}},g._final=async function(j){try{await D.ready,D.close().catch(()=>{}),a=j}catch(q){j(q)}}}const y=wi(_)?_.readable:_;eI(y,()=>{if(a){const B=a;a=null,B()}})}if(v){if(Ia(_))_.on("readable",function(){if(f){const y=f;f=null,y()}}),_.on("end",function(){g.push(null)}),g._read=function(){for(;;){const y=_.read();if(y===null){f=g._read;return}if(!g.push(y))return}};else if(hl(_)){const B=(wi(_)?_.readable:_).getReader();g._read=async function(){for(;;)try{const{value:D,done:j}=await B.read();if(!g.push(D))return;if(j){g.push(null);return}}catch{return}}}}return g._destroy=function(y,B){!y&&u!==null&&(y=new YA),f=null,o=null,a=null,u===null?B(y):(u=B,Ia(_)&&XA(_,y))},g};const tI=globalThis.AbortController||ns().AbortController,{codes:{ERR_INVALID_ARG_VALUE:rI,ERR_INVALID_ARG_TYPE:fs,ERR_MISSING_ARGS:nI,ERR_OUT_OF_RANGE:iI},AbortError:Rn}=Ir,{validateAbortSignal:Oi,validateInteger:Hg,validateObject:Ci}=as,oI=Wt.Symbol("kWeak"),sI=Wt.Symbol("kResistStopPropagation"),{finished:aI}=ai,fI=Q0,{addAbortSignalNoValidate:uI}=rf,{isWritable:lI,isNodeStream:cI}=Wn,{deprecate:dI}=yr,{ArrayPrototypePush:hI,Boolean:gI,MathFloor:Wg,Number:_I,NumberIsNaN:pI,Promise:zg,PromiseReject:qg,PromiseResolve:bI,PromisePrototypeThen:Gg,Symbol:ep}=Wt,ja=ep("kEmpty"),Vg=ep("kEof");function wI(e,t){if(t!=null&&Ci(t,"options"),(t==null?void 0:t.signal)!=null&&Oi(t.signal,"options.signal"),cI(e)&&!lI(e))throw new rI("stream",e,"must be writable");const n=fI(this,e);return t!=null&&t.signal&&uI(t.signal,n),n}function sf(e,t){if(typeof e!="function")throw new fs("fn",["Function","AsyncFunction"],e);t!=null&&Ci(t,"options"),(t==null?void 0:t.signal)!=null&&Oi(t.signal,"options.signal");let n=1;(t==null?void 0:t.concurrency)!=null&&(n=Wg(t.concurrency));let o=n-1;return(t==null?void 0:t.highWaterMark)!=null&&(o=Wg(t.highWaterMark)),Hg(n,"options.concurrency",1),Hg(o,"options.highWaterMark",0),o+=n,(async function*(){const f=yr.AbortSignalAny([t==null?void 0:t.signal].filter(gI)),u=this,g=[],d={signal:f};let h,_,E=!1,v=0;function y(){E=!0,B()}function B(){v-=1,D()}function D(){_&&!E&&v<n&&g.length<o&&(_(),_=null)}async function j(){try{for await(let q of u){if(E)return;if(f.aborted)throw new Rn;try{if(q=e(q,d),q===ja)continue;q=bI(q)}catch(H){q=qg(H)}v+=1,Gg(q,B,y),g.push(q),h&&(h(),h=null),!E&&(g.length>=o||v>=n)&&await new zg(H=>{_=H})}g.push(Vg)}catch(q){const H=qg(q);Gg(H,B,y),g.push(H)}finally{E=!0,h&&(h(),h=null)}}j();try{for(;;){for(;g.length>0;){const q=await g[0];if(q===Vg)return;if(f.aborted)throw new Rn;q!==ja&&(yield q),g.shift(),D()}await new zg(q=>{h=q})}}finally{E=!0,_&&(_(),_=null)}}).call(this)}function yI(e=void 0){return e!=null&&Ci(e,"options"),(e==null?void 0:e.signal)!=null&&Oi(e.signal,"options.signal"),(async function*(){let n=0;for await(const a of this){var o;if(e!=null&&(o=e.signal)!==null&&o!==void 0&&o.aborted)throw new Rn({cause:e.signal.reason});yield[n++,a]}}).call(this)}async function tp(e,t=void 0){for await(const n of Sc.call(this,e,t))return!0;return!1}async function mI(e,t=void 0){if(typeof e!="function")throw new fs("fn",["Function","AsyncFunction"],e);return!await tp.call(this,async(...n)=>!await e(...n),t)}async function vI(e,t){for await(const n of Sc.call(this,e,t))return n}async function EI(e,t){if(typeof e!="function")throw new fs("fn",["Function","AsyncFunction"],e);async function n(o,a){return await e(o,a),ja}for await(const o of sf.call(this,n,t));}function Sc(e,t){if(typeof e!="function")throw new fs("fn",["Function","AsyncFunction"],e);async function n(o,a){return await e(o,a)?o:ja}return sf.call(this,n,t)}class SI extends nI{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function RI(e,t,n){var o;if(typeof e!="function")throw new fs("reducer",["Function","AsyncFunction"],e);n!=null&&Ci(n,"options"),(n==null?void 0:n.signal)!=null&&Oi(n.signal,"options.signal");let a=arguments.length>1;if(n!=null&&(o=n.signal)!==null&&o!==void 0&&o.aborted){const h=new Rn(void 0,{cause:n.signal.reason});throw this.once("error",()=>{}),await aI(this.destroy(h)),h}const f=new tI,u=f.signal;if(n!=null&&n.signal){const h={once:!0,[oI]:this,[sI]:!0};n.signal.addEventListener("abort",()=>f.abort(),h)}let g=!1;try{for await(const h of this){var d;if(g=!0,n!=null&&(d=n.signal)!==null&&d!==void 0&&d.aborted)throw new Rn;a?t=await e(t,h,{signal:u}):(t=h,a=!0)}if(!g&&!a)throw new SI}finally{f.abort()}return t}async function AI(e){e!=null&&Ci(e,"options"),(e==null?void 0:e.signal)!=null&&Oi(e.signal,"options.signal");const t=[];for await(const o of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Rn(void 0,{cause:e.signal.reason});hI(t,o)}return t}function II(e,t){const n=sf.call(this,e,t);return(async function*(){for await(const a of n)yield*a}).call(this)}function rp(e){if(e=_I(e),pI(e))return 0;if(e<0)throw new iI("number",">= 0",e);return e}function TI(e,t=void 0){return t!=null&&Ci(t,"options"),(t==null?void 0:t.signal)!=null&&Oi(t.signal,"options.signal"),e=rp(e),(async function*(){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new Rn;for await(const f of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new Rn;e--<=0&&(yield f)}}).call(this)}function OI(e,t=void 0){return t!=null&&Ci(t,"options"),(t==null?void 0:t.signal)!=null&&Oi(t.signal,"options.signal"),e=rp(e),(async function*(){var o;if(t!=null&&(o=t.signal)!==null&&o!==void 0&&o.aborted)throw new Rn;for await(const f of this){var a;if(t!=null&&(a=t.signal)!==null&&a!==void 0&&a.aborted)throw new Rn;if(e-- >0&&(yield f),e<=0)return}}).call(this)}hc.streamReturningOperators={asIndexedPairs:dI(yI,"readable.asIndexedPairs will be removed in a future version."),drop:TI,filter:Sc,flatMap:II,map:sf,take:OI,compose:wI};hc.promiseReturningOperators={every:mI,forEach:EI,reduce:RI,toArray:AI,some:tp,find:vI};var gl,Zg;function np(){if(Zg)return gl;Zg=1;const{ArrayPrototypePop:e,Promise:t}=Wt,{isIterable:n,isNodeStream:o,isWebStream:a}=Wn,{pipelineImpl:f}=Ec,{finished:u}=ai;ip();function g(...d){return new t((h,_)=>{let E,v;const y=d[d.length-1];if(y&&typeof y=="object"&&!o(y)&&!n(y)&&!a(y)){const B=e(d);E=B.signal,v=B.end}f(d,(B,D)=>{B?_(B):h(D)},{signal:E,end:v})})}return gl={finished:u,pipeline:g},gl}var Kg;function ip(){if(Kg)return Xu.exports;Kg=1;const{Buffer:e}=V.bufferPolyfill,{ObjectDefineProperty:t,ObjectKeys:n,ReflectApply:o}=Wt,{promisify:{custom:a}}=yr,{streamReturningOperators:f,promiseReturningOperators:u}=hc,{codes:{ERR_ILLEGAL_CONSTRUCTOR:g}}=Ir,d=Q0,{setDefaultHighWaterMark:h,getDefaultHighWaterMark:_}=nf,{pipeline:E}=Ec,{destroyer:v}=_o,y=ai,B=np(),D=Wn,j=Xu.exports=wc.Stream;j.isDestroyed=D.isDestroyed,j.isDisturbed=D.isDisturbed,j.isErrored=D.isErrored,j.isReadable=D.isReadable,j.isWritable=D.isWritable,j.Readable=of();for(const H of n(f)){let P=function(...K){if(new.target)throw g();return j.Readable.from(o(L,this,K))};const L=f[H];t(P,"name",{__proto__:null,value:L.name}),t(P,"length",{__proto__:null,value:L.length}),t(j.Readable.prototype,H,{__proto__:null,value:P,enumerable:!1,configurable:!0,writable:!0})}for(const H of n(u)){let P=function(...K){if(new.target)throw g();return o(L,this,K)};const L=u[H];t(P,"name",{__proto__:null,value:L.name}),t(P,"length",{__proto__:null,value:L.length}),t(j.Readable.prototype,H,{__proto__:null,value:P,enumerable:!1,configurable:!0,writable:!0})}j.Writable=yc(),j.Duplex=jn(),j.Transform=K0,j.PassThrough=X0,j.pipeline=E;const{addAbortSignal:q}=rf;return j.addAbortSignal=q,j.finished=y,j.destroy=v,j.compose=d,j.setDefaultHighWaterMark=h,j.getDefaultHighWaterMark=_,t(j,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return B}}),t(E,a,{__proto__:null,enumerable:!0,get(){return B.pipeline}}),t(y,a,{__proto__:null,enumerable:!0,get(){return B.finished}}),j.Stream=j,j._isUint8Array=function(L){return L instanceof Uint8Array},j._uint8ArrayToBuffer=function(L){return e.from(L.buffer,L.byteOffset,L.byteLength)},Xu.exports}(function(e){const t=ip(),n=np(),o=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=o,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return n}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(vS);var CI={},Ai={},Rc={},rr={};class op extends TypeError{constructor(t,n){let o;const{message:a,explanation:f,...u}=t,{path:g}=t,d=g.length===0?a:`At path: ${g.join(".")} -- ${a}`;super(f??d),f!=null&&(this.cause=d),Object.assign(this,u),this.name=this.constructor.name,this.failures=()=>o??(o=[t,...n()])}}function PI(e){return Jr(e)&&typeof e[Symbol.iterator]=="function"}function Jr(e){return typeof e=="object"&&e!=null}function Jg(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Yt(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function LI(e){const{done:t,value:n}=e.next();return t?void 0:n}function NI(e,t,n,o){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:a,branch:f}=t,{type:u}=n,{refinement:g,message:d=`Expected a value of type \`${u}\`${g?` with refinement \`${g}\``:""}, but received: \`${Yt(o)}\``}=e;return{value:o,type:u,refinement:g,key:a[a.length-1],path:a,branch:f,...e,message:d}}function*Yl(e,t,n,o){PI(e)||(e=[e]);for(const a of e){const f=NI(a,t,n,o);f&&(yield f)}}function*Ac(e,t,n={}){const{path:o=[],branch:a=[e],coerce:f=!1,mask:u=!1}=n,g={path:o,branch:a};if(f&&(e=t.coercer(e,g),u&&t.type!=="type"&&Jr(t.schema)&&Jr(e)&&!Array.isArray(e)))for(const h in e)t.schema[h]===void 0&&delete e[h];let d="valid";for(const h of t.validator(e,g))h.explanation=n.message,d="not_valid",yield[h,void 0];for(let[h,_,E]of t.entries(e,g)){const v=Ac(_,E,{path:h===void 0?o:[...o,h],branch:h===void 0?a:[...a,_],coerce:f,mask:u,message:n.message});for(const y of v)y[0]?(d=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):f&&(_=y[1],h===void 0?e=_:e instanceof Map?e.set(h,_):e instanceof Set?e.add(_):Jr(e)&&(_!==void 0||h in e)&&(e[h]=_))}if(d!=="not_valid")for(const h of t.refiner(e,g))h.explanation=n.message,d="not_refined",yield[h,void 0];d==="valid"&&(yield[void 0,e])}class Gt{constructor(t){const{type:n,schema:o,validator:a,refiner:f,coercer:u=d=>d,entries:g=function*(){}}=t;this.type=n,this.schema=o,this.entries=g,this.coercer=u,a?this.validator=(d,h)=>{const _=a(d,h);return Yl(_,h,this,d)}:this.validator=()=>[],f?this.refiner=(d,h)=>{const _=f(d,h);return Yl(_,h,this,d)}:this.refiner=()=>[]}assert(t,n){return sp(t,this,n)}create(t,n){return ap(t,this,n)}is(t){return Ic(t,this)}mask(t,n){return fp(t,this,n)}validate(t,n={}){return po(t,this,n)}}function sp(e,t,n){const o=po(e,t,{message:n});if(o[0])throw o[0]}function ap(e,t,n){const o=po(e,t,{coerce:!0,message:n});if(o[0])throw o[0];return o[1]}function fp(e,t,n){const o=po(e,t,{coerce:!0,mask:!0,message:n});if(o[0])throw o[0];return o[1]}function Ic(e,t){return!po(e,t)[0]}function po(e,t,n={}){const o=Ac(e,t,n),a=LI(o);return a[0]?[new op(a[0],function*(){for(const u of o)u[0]&&(yield u[0])}),void 0]:[void 0,a[1]]}function BI(...e){const t=e[0].type==="type",n=e.map(a=>a.schema),o=Object.assign({},...n);return t?ls(o):us(o)}function Tr(e,t){return new Gt({type:e,schema:null,validator:t})}function $I(e,t){return new Gt({...e,refiner:(n,o)=>n===void 0||e.refiner(n,o),validator(n,o){return n===void 0?!0:(t(n,o),e.validator(n,o))}})}function xI(e){return new Gt({type:"dynamic",schema:null,*entries(t,n){yield*e(t,n).entries(t,n)},validator(t,n){return e(t,n).validator(t,n)},coercer(t,n){return e(t,n).coercer(t,n)},refiner(t,n){return e(t,n).refiner(t,n)}})}function DI(e){let t;return new Gt({type:"lazy",schema:null,*entries(n,o){t??(t=e()),yield*t.entries(n,o)},validator(n,o){return t??(t=e()),t.validator(n,o)},coercer(n,o){return t??(t=e()),t.coercer(n,o)},refiner(n,o){return t??(t=e()),t.refiner(n,o)}})}function MI(e,t){const{schema:n}=e,o={...n};for(const a of t)delete o[a];switch(e.type){case"type":return ls(o);default:return us(o)}}function kI(e){const t=e instanceof Gt,n=t?{...e.schema}:{...e};for(const o in n)n[o]=up(n[o]);return t&&e.type==="type"?ls(n):us(n)}function FI(e,t){const{schema:n}=e,o={};for(const a of t)o[a]=n[a];switch(e.type){case"type":return ls(o);default:return us(o)}}function UI(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Tr(e,t)}function jI(){return Tr("any",()=>!0)}function HI(e){return new Gt({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,o]of t.entries())yield[n,o,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Yt(t)}`}})}function WI(){return Tr("bigint",e=>typeof e=="bigint")}function zI(){return Tr("boolean",e=>typeof e=="boolean")}function qI(){return Tr("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Yt(e)}`)}function GI(e){const t={},n=e.map(o=>Yt(o)).join();for(const o of e)t[o]=o;return new Gt({type:"enums",schema:t,validator(o){return e.includes(o)||`Expected one of \`${n}\`, but received: ${Yt(o)}`}})}function VI(){return Tr("func",e=>typeof e=="function"||`Expected a function, but received: ${Yt(e)}`)}function ZI(e){return Tr("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Yt(t)}`)}function KI(){return Tr("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Yt(e)}`)}function JI(e){return new Gt({type:"intersection",schema:null,*entries(t,n){for(const o of e)yield*o.entries(t,n)},*validator(t,n){for(const o of e)yield*o.validator(t,n)},*refiner(t,n){for(const o of e)yield*o.refiner(t,n)}})}function XI(e){const t=Yt(e),n=typeof e;return new Gt({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?e:null,validator(o){return o===e||`Expected the literal \`${t}\`, but received: ${Yt(o)}`}})}function YI(e,t){return new Gt({type:"map",schema:null,*entries(n){if(e&&t&&n instanceof Map)for(const[o,a]of n.entries())yield[o,o,e],yield[o,a,t]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${Yt(n)}`}})}function Tc(){return Tr("never",()=>!1)}function QI(e){return new Gt({...e,validator:(t,n)=>t===null||e.validator(t,n),refiner:(t,n)=>t===null||e.refiner(t,n)})}function eT(){return Tr("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Yt(e)}`)}function us(e){const t=e?Object.keys(e):[],n=Tc();return new Gt({type:"object",schema:e||null,*entries(o){if(e&&Jr(o)){const a=new Set(Object.keys(o));for(const f of t)a.delete(f),yield[f,o[f],e[f]];for(const f of a)yield[f,o[f],n]}},validator(o){return Jr(o)||`Expected an object, but received: ${Yt(o)}`},coercer(o){return Jr(o)?{...o}:o}})}function up(e){return new Gt({...e,validator:(t,n)=>t===void 0||e.validator(t,n),refiner:(t,n)=>t===void 0||e.refiner(t,n)})}function tT(e,t){return new Gt({type:"record",schema:null,*entries(n){if(Jr(n))for(const o in n){const a=n[o];yield[o,o,e],yield[o,a,t]}},validator(n){return Jr(n)||`Expected an object, but received: ${Yt(n)}`}})}function rT(){return Tr("regexp",e=>e instanceof RegExp)}function nT(e){return new Gt({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const n of t)yield[n,n,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Yt(t)}`}})}function lp(){return Tr("string",e=>typeof e=="string"||`Expected a string, but received: ${Yt(e)}`)}function iT(e){const t=Tc();return new Gt({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const o=Math.max(e.length,n.length);for(let a=0;a<o;a++)yield[a,n[a],e[a]||t]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${Yt(n)}`}})}function ls(e){const t=Object.keys(e);return new Gt({type:"type",schema:e,*entries(n){if(Jr(n))for(const o of t)yield[o,n[o],e[o]]},validator(n){return Jr(n)||`Expected an object, but received: ${Yt(n)}`},coercer(n){return Jr(n)?{...n}:n}})}function oT(e){const t=e.map(n=>n.type).join(" | ");return new Gt({type:"union",schema:null,coercer(n){for(const o of e){const[a,f]=o.validate(n,{coerce:!0});if(!a)return f}return n},validator(n,o){const a=[];for(const f of e){const[...u]=Ac(n,f,o),[g]=u;if(g[0])for(const[d]of u)d&&a.push(d);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Yt(n)}`,...a]}})}function cp(){return Tr("unknown",()=>!0)}function Oc(e,t,n){return new Gt({...e,coercer:(o,a)=>Ic(o,t)?e.coercer(n(o,a),a):e.coercer(o,a)})}function sT(e,t,n={}){return Oc(e,cp(),o=>{const a=typeof t=="function"?t():t;if(o===void 0)return a;if(!n.strict&&Jg(o)&&Jg(a)){const f={...o};let u=!1;for(const g in a)f[g]===void 0&&(f[g]=a[g],u=!0);if(u)return f}return o})}function aT(e){return Oc(e,lp(),t=>t.trim())}function fT(e){return Pi(e,"empty",t=>{const n=dp(t);return n===0||`Expected an empty ${e.type} but received one with a size of \`${n}\``})}function dp(e){return e instanceof Map||e instanceof Set?e.size:e.length}function uT(e,t,n={}){const{exclusive:o}=n;return Pi(e,"max",a=>o?a<t:a<=t||`Expected a ${e.type} less than ${o?"":"or equal to "}${t} but received \`${a}\``)}function lT(e,t,n={}){const{exclusive:o}=n;return Pi(e,"min",a=>o?a>t:a>=t||`Expected a ${e.type} greater than ${o?"":"or equal to "}${t} but received \`${a}\``)}function cT(e){return Pi(e,"nonempty",t=>dp(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function dT(e,t){return Pi(e,"pattern",n=>t.test(n)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${n}"`)}function hT(e,t,n=t){const o=`Expected a ${e.type}`,a=t===n?`of \`${t}\``:`between \`${t}\` and \`${n}\``;return Pi(e,"size",f=>{if(typeof f=="number"||f instanceof Date)return t<=f&&f<=n||`${o} ${a} but received \`${f}\``;if(f instanceof Map||f instanceof Set){const{size:u}=f;return t<=u&&u<=n||`${o} with a size ${a} but received one with a size of \`${u}\``}else{const{length:u}=f;return t<=u&&u<=n||`${o} with a length ${a} but received one with a length of \`${u}\``}})}function Pi(e,t,n){return new Gt({...e,*refiner(o,a){yield*e.refiner(o,a);const f=n(o,a),u=Yl(f,a,e,o);for(const g of u)yield{...g,refinement:t}}})}const gT=Object.freeze(Object.defineProperty({__proto__:null,Struct:Gt,StructError:op,any:jI,array:HI,assert:sp,assign:BI,bigint:WI,boolean:zI,coerce:Oc,create:ap,date:qI,defaulted:sT,define:Tr,deprecated:$I,dynamic:xI,empty:fT,enums:GI,func:VI,instance:ZI,integer:KI,intersection:JI,is:Ic,lazy:DI,literal:XI,map:YI,mask:fp,max:uT,min:lT,never:Tc,nonempty:cT,nullable:QI,number:eT,object:us,omit:MI,optional:up,partial:kI,pattern:dT,pick:FI,record:tT,refine:Pi,regexp:rT,set:nT,size:hT,string:lp,struct:UI,trimmed:aT,tuple:iT,type:ls,union:oT,unknown:cp,validate:po},Symbol.toStringTag,{value:"Module"})),Li=V.getAugmentedNamespace(gT);Object.defineProperty(rr,"__esModule",{value:!0});rr.assertExhaustive=rr.assertStruct=rr.assert=rr.AssertionError=void 0;const _T=Li;function pT(e){return typeof e=="object"&&e!==null&&"message"in e}function bT(e){var t,n;return typeof((n=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||n===void 0?void 0:n.name)=="string"}function wT(e){const t=pT(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function hp(e,t){return bT(e)?new e({message:t}):e({message:t})}class Cc extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}rr.AssertionError=Cc;function yT(e,t="Assertion failed.",n=Cc){if(!e)throw t instanceof Error?t:hp(n,t)}rr.assert=yT;function mT(e,t,n="Assertion failed",o=Cc){try{(0,_T.assert)(e,t)}catch(a){throw hp(o,`${n}: ${wT(a)}.`)}}rr.assertStruct=mT;function vT(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}rr.assertExhaustive=vT;var cs={};Object.defineProperty(cs,"__esModule",{value:!0});cs.base64=void 0;const ET=Li,ST=rr,RT=(e,t={})=>{var n,o;const a=(n=t.paddingRequired)!==null&&n!==void 0?n:!1,f=(o=t.characterSet)!==null&&o!==void 0?o:"base64";let u;f==="base64"?u=String.raw`[A-Za-z0-9+\/]`:((0,ST.assert)(f==="base64url"),u=String.raw`[-_A-Za-z0-9]`);let g;return a?g=new RegExp(`^(?:${u}{4})*(?:${u}{3}=|${u}{2}==)?$`,"u"):g=new RegExp(`^(?:${u}{4})*(?:${u}{2,3}|${u}{3}=|${u}{2}==)?$`,"u"),(0,ET.pattern)(e,g)};cs.base64=RT;var ht={},ds={};(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=Li,n=rr;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 o(h){return(0,t.is)(h,e.HexStruct)}e.isHexString=o;function a(h){return(0,t.is)(h,e.StrictHexStruct)}e.isStrictHexString=a;function f(h){(0,n.assert)(o(h),"Value must be a hexadecimal string.")}e.assertIsHexString=f;function u(h){(0,n.assert)(a(h),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=u;function g(h){return h.startsWith("0x")?h:h.startsWith("0X")?`0x${h.substring(2)}`:`0x${h}`}e.add0x=g;function d(h){return h.startsWith("0x")||h.startsWith("0X")?h.substring(2):h}e.remove0x=d})(ds);Object.defineProperty(ht,"__esModule",{value:!0});ht.createDataView=ht.concatBytes=ht.valueToBytes=ht.stringToBytes=ht.numberToBytes=ht.signedBigIntToBytes=ht.bigIntToBytes=ht.hexToBytes=ht.bytesToString=ht.bytesToNumber=ht.bytesToSignedBigInt=ht.bytesToBigInt=ht.bytesToHex=ht.assertIsBytes=ht.isBytes=void 0;const Mr=rr,Ql=ds,Xg=48,Yg=58,Qg=87;function AT(){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 IT=AT();function Pc(e){return e instanceof Uint8Array}ht.isBytes=Pc;function bo(e){(0,Mr.assert)(Pc(e),"Value must be a Uint8Array.")}ht.assertIsBytes=bo;function gp(e){if(bo(e),e.length===0)return"0x";const t=IT(),n=new Array(e.length);for(let o=0;o<e.length;o++)n[o]=t[e[o]];return(0,Ql.add0x)(n.join(""))}ht.bytesToHex=gp;function _p(e){bo(e);const t=gp(e);return BigInt(t)}ht.bytesToBigInt=_p;function TT(e){bo(e);let t=BigInt(0);for(const n of e)t=(t<<BigInt(8))+BigInt(n);return BigInt.asIntN(e.length*8,t)}ht.bytesToSignedBigInt=TT;function OT(e){bo(e);const t=_p(e);return(0,Mr.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}ht.bytesToNumber=OT;function CT(e){return bo(e),new TextDecoder().decode(e)}ht.bytesToString=CT;function af(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,Ql.assertIsHexString)(e);const n=(0,Ql.remove0x)(e).toLowerCase(),o=n.length%2===0?n:`0${n}`,a=new Uint8Array(o.length/2);for(let f=0;f<a.length;f++){const u=o.charCodeAt(f*2),g=o.charCodeAt(f*2+1),d=u-(u<Yg?Xg:Qg),h=g-(g<Yg?Xg:Qg);a[f]=d*16+h}return a}ht.hexToBytes=af;function pp(e){(0,Mr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Mr.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return af(t)}ht.bigIntToBytes=pp;function PT(e,t){(0,Mr.assert)(t>0);const n=e>>BigInt(31);return!((~e&n)+(e&~n)>>BigInt(t*8+-1))}function LT(e,t){(0,Mr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Mr.assert)(typeof t=="number","Byte length must be a number."),(0,Mr.assert)(t>0,"Byte length must be greater than 0."),(0,Mr.assert)(PT(e,t),"Byte length is too small to represent the given value.");let n=e;const o=new Uint8Array(t);for(let a=0;a<o.length;a++)o[a]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return o.reverse()}ht.signedBigIntToBytes=LT;function bp(e){(0,Mr.assert)(typeof e=="number","Value must be a number."),(0,Mr.assert)(e>=0,"Value must be a non-negative number."),(0,Mr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return af(t)}ht.numberToBytes=bp;function wp(e){return(0,Mr.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ht.stringToBytes=wp;function yp(e){if(typeof e=="bigint")return pp(e);if(typeof e=="number")return bp(e);if(typeof e=="string")return e.startsWith("0x")?af(e):wp(e);if(Pc(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ht.valueToBytes=yp;function NT(e){const t=new Array(e.length);let n=0;for(let a=0;a<e.length;a++){const f=yp(e[a]);t[a]=f,n+=f.length}const o=new Uint8Array(n);for(let a=0,f=0;a<t.length;a++)o.set(t[a],f),f+=t[a].length;return o}ht.concatBytes=NT;function BT(e){if(typeof V.dist.Buffer<"u"&&e instanceof V.dist.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)}ht.createDataView=BT;var ff={};Object.defineProperty(ff,"__esModule",{value:!0});ff.ChecksumStruct=void 0;const e_=Li,$T=cs;ff.ChecksumStruct=(0,e_.size)((0,$T.base64)((0,e_.string)(),{paddingRequired:!0}),44,44);var wn={};Object.defineProperty(wn,"__esModule",{value:!0});wn.createHex=wn.createBytes=wn.createBigInt=wn.createNumber=void 0;const Ft=Li,xT=rr,mp=ht,uf=ds,vp=(0,Ft.union)([(0,Ft.number)(),(0,Ft.bigint)(),(0,Ft.string)(),uf.StrictHexStruct]),DT=(0,Ft.coerce)((0,Ft.number)(),vp,Number),MT=(0,Ft.coerce)((0,Ft.bigint)(),vp,BigInt);(0,Ft.union)([uf.StrictHexStruct,(0,Ft.instance)(Uint8Array)]);const kT=(0,Ft.coerce)((0,Ft.instance)(Uint8Array),(0,Ft.union)([uf.StrictHexStruct]),mp.hexToBytes),FT=(0,Ft.coerce)(uf.StrictHexStruct,(0,Ft.instance)(Uint8Array),mp.bytesToHex);function UT(e){try{const t=(0,Ft.create)(e,DT);return(0,xT.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Ft.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}wn.createNumber=UT;function jT(e){try{return(0,Ft.create)(e,MT)}catch(t){throw t instanceof Ft.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}wn.createBigInt=jT;function HT(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Ft.create)(e,kT)}catch(t){throw t instanceof Ft.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}wn.createBytes=HT;function WT(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Ft.create)(e,FT)}catch(t){throw t instanceof Ft.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}wn.createHex=WT;var uo={},Ep=V.commonjsGlobal&&V.commonjsGlobal.__classPrivateFieldSet||function(e,t,n,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},br=V.commonjsGlobal&&V.commonjsGlobal.__classPrivateFieldGet||function(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)},on,_n;Object.defineProperty(uo,"__esModule",{value:!0});uo.FrozenSet=uo.FrozenMap=void 0;class Lc{constructor(t){on.set(this,void 0),Ep(this,on,new Map(t),"f"),Object.freeze(this)}get size(){return br(this,on,"f").size}[(on=new WeakMap,Symbol.iterator)](){return br(this,on,"f")[Symbol.iterator]()}entries(){return br(this,on,"f").entries()}forEach(t,n){return br(this,on,"f").forEach((o,a,f)=>t.call(n,o,a,this))}get(t){return br(this,on,"f").get(t)}has(t){return br(this,on,"f").has(t)}keys(){return br(this,on,"f").keys()}values(){return br(this,on,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,n])=>`${String(t)} => ${String(n)}`).join(", ")} `:""}}`}}uo.FrozenMap=Lc;class Nc{constructor(t){_n.set(this,void 0),Ep(this,_n,new Set(t),"f"),Object.freeze(this)}get size(){return br(this,_n,"f").size}[(_n=new WeakMap,Symbol.iterator)](){return br(this,_n,"f")[Symbol.iterator]()}entries(){return br(this,_n,"f").entries()}forEach(t,n){return br(this,_n,"f").forEach((o,a,f)=>t.call(n,o,a,this))}has(t){return br(this,_n,"f").has(t)}keys(){return br(this,_n,"f").keys()}values(){return br(this,_n,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}uo.FrozenSet=Nc;Object.freeze(Lc);Object.freeze(Lc.prototype);Object.freeze(Nc);Object.freeze(Nc.prototype);var Sp={};Object.defineProperty(Sp,"__esModule",{value:!0});var Rp={};(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=Li,n=rr,o=()=>(0,t.define)("finite number",K=>(0,t.is)(K,(0,t.number)())&&Number.isFinite(K));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),o(),(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",(K,ae)=>{function oe(be,de){const ve=[...de.validator(be,ae)];return ve.length>0?ve:!0}try{const be=oe(K,e.UnsafeJsonStruct);return be!==!0?be:oe(JSON.parse(JSON.stringify(K)),e.UnsafeJsonStruct)}catch(be){return be instanceof RangeError?"Circular reference detected":!1}});function a(K){return(0,t.is)(K,e.JsonStruct)}e.isValidJson=a;function f(K){(0,n.assertStruct)(K,e.JsonStruct,"Invalid JSON value");const ae=JSON.stringify(K);return new TextEncoder().encode(ae).byteLength}e.getJsonSize=f,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 u(K){return(0,t.is)(K,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=u;function g(K,ae){(0,n.assertStruct)(K,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",ae)}e.assertIsJsonRpcNotification=g;function d(K){return(0,t.is)(K,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=d;function h(K,ae){(0,n.assertStruct)(K,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",ae)}e.assertIsJsonRpcRequest=h,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 _(K){return(0,t.is)(K,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=_;function E(K,ae){(0,n.assertStruct)(K,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",ae)}e.assertIsPendingJsonRpcResponse=E;function v(K){return(0,t.is)(K,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=v;function y(K,ae){(0,n.assertStruct)(K,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",ae)}e.assertIsJsonRpcResponse=y;function B(K){return(0,t.is)(K,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=B;function D(K,ae){(0,n.assertStruct)(K,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",ae)}e.assertIsJsonRpcSuccess=D;function j(K){return(0,t.is)(K,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=j;function q(K,ae){(0,n.assertStruct)(K,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",ae)}e.assertIsJsonRpcFailure=q;function H(K){return(0,t.is)(K,e.JsonRpcErrorStruct)}e.isJsonRpcError=H;function L(K,ae){(0,n.assertStruct)(K,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",ae)}e.assertIsJsonRpcError=L;function P(K){const{permitEmptyString:ae,permitFractions:oe,permitNull:be}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},K);return Oe=>!!(typeof Oe=="number"&&(oe||Number.isInteger(Oe))||typeof Oe=="string"&&(ae||Oe.length>0)||be&&Oe===null)}e.getJsonRpcIdValidator=P})(Rp);var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0});var lo={},zT=V.commonjsGlobal&&V.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lo,"__esModule",{value:!0});lo.createModuleLogger=lo.createProjectLogger=void 0;const qT=zT(gS),GT=(0,qT.default)("metamask");function VT(e){return GT.extend(e)}lo.createProjectLogger=VT;function ZT(e,t){return e.extend(t)}lo.createModuleLogger=ZT;var Ip={};(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(h){return Array.isArray(h)&&h.length>0}e.isNonEmptyArray=t;function n(h){return h==null}e.isNullOrUndefined=n;function o(h){return!!h&&typeof h=="object"&&!Array.isArray(h)}e.isObject=o;const a=(h,_)=>Object.hasOwnProperty.call(h,_);e.hasProperty=a,function(h){h[h.Null=4]="Null",h[h.Comma=1]="Comma",h[h.Wrapper=1]="Wrapper",h[h.True=4]="True",h[h.False=5]="False",h[h.Quote=1]="Quote",h[h.Colon=1]="Colon",h[h.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function f(h){if(typeof h!="object"||h===null)return!1;try{let _=h;for(;Object.getPrototypeOf(_)!==null;)_=Object.getPrototypeOf(_);return Object.getPrototypeOf(h)===_}catch{return!1}}e.isPlainObject=f;function u(h){return h.charCodeAt(0)<=127}e.isASCII=u;function g(h){var _;return h.split("").reduce((v,y)=>u(y)?v+1:v+2,0)+((_=h.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&_!==void 0?_:[]).length}e.calculateStringSize=g;function d(h){return h.toString().length}e.calculateNumberSize=d})(Ip);var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.hexToBigInt=yn.hexToNumber=yn.bigIntToHex=yn.numberToHex=void 0;const so=rr,is=ds,KT=e=>((0,so.assert)(typeof e=="number","Value must be a number."),(0,so.assert)(e>=0,"Value must be a non-negative number."),(0,so.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,is.add0x)(e.toString(16)));yn.numberToHex=KT;const JT=e=>((0,so.assert)(typeof e=="bigint","Value must be a bigint."),(0,so.assert)(e>=0,"Value must be a non-negative bigint."),(0,is.add0x)(e.toString(16)));yn.bigIntToHex=JT;const XT=e=>{(0,is.assertIsHexString)(e);const t=parseInt(e,16);return(0,so.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};yn.hexToNumber=XT;const YT=e=>((0,is.assertIsHexString)(e),BigInt((0,is.add0x)(e)));yn.hexToBigInt=YT;var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0});var Op={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(f){f[f.Millisecond=1]="Millisecond",f[f.Second=1e3]="Second",f[f.Minute=6e4]="Minute",f[f.Hour=36e5]="Hour",f[f.Day=864e5]="Day",f[f.Week=6048e5]="Week",f[f.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=f=>Number.isInteger(f)&&f>=0,n=(f,u)=>{if(!t(f))throw new Error(`"${u}" must be a non-negative integer. Received: "${f}".`)};function o(f,u){return n(f,"count"),f*u}e.inMilliseconds=o;function a(f){return n(f,"timestamp"),Date.now()-f}e.timeSince=a})(Op);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});var Pp={},ec={exports:{}};const QT="2.0.0",Lp=256,eO=Number.MAX_SAFE_INTEGER||9007199254740991,tO=16,rO=Lp-6,nO=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var lf={MAX_LENGTH:Lp,MAX_SAFE_COMPONENT_LENGTH:tO,MAX_SAFE_BUILD_LENGTH:rO,MAX_SAFE_INTEGER:eO,RELEASE_TYPES:nO,SEMVER_SPEC_VERSION:QT,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const iO=typeof V.dist.process=="object"&&V.dist.process.env&&V.dist.process.env.NODE_DEBUG&&/\bsemver\b/i.test(V.dist.process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var cf=iO;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:a}=lf,f=cf;t=e.exports={};const u=t.re=[],g=t.safeRe=[],d=t.src=[],h=t.t={};let _=0;const E="[a-zA-Z0-9-]",v=[["\\s",1],["\\d",a],[E,o]],y=D=>{for(const[j,q]of v)D=D.split(`${j}*`).join(`${j}{0,${q}}`).split(`${j}+`).join(`${j}{1,${q}}`);return D},B=(D,j,q)=>{const H=y(j),L=_++;f(D,L,j),h[D]=L,d[L]=j,u[L]=new RegExp(j,q?"g":void 0),g[L]=new RegExp(H,q?"g":void 0)};B("NUMERICIDENTIFIER","0|[1-9]\\d*"),B("NUMERICIDENTIFIERLOOSE","\\d+"),B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${E}*`),B("MAINVERSION",`(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})`),B("MAINVERSIONLOOSE",`(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})`),B("PRERELEASEIDENTIFIER",`(?:${d[h.NUMERICIDENTIFIER]}|${d[h.NONNUMERICIDENTIFIER]})`),B("PRERELEASEIDENTIFIERLOOSE",`(?:${d[h.NUMERICIDENTIFIERLOOSE]}|${d[h.NONNUMERICIDENTIFIER]})`),B("PRERELEASE",`(?:-(${d[h.PRERELEASEIDENTIFIER]}(?:\\.${d[h.PRERELEASEIDENTIFIER]})*))`),B("PRERELEASELOOSE",`(?:-?(${d[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[h.PRERELEASEIDENTIFIERLOOSE]})*))`),B("BUILDIDENTIFIER",`${E}+`),B("BUILD",`(?:\\+(${d[h.BUILDIDENTIFIER]}(?:\\.${d[h.BUILDIDENTIFIER]})*))`),B("FULLPLAIN",`v?${d[h.MAINVERSION]}${d[h.PRERELEASE]}?${d[h.BUILD]}?`),B("FULL",`^${d[h.FULLPLAIN]}$`),B("LOOSEPLAIN",`[v=\\s]*${d[h.MAINVERSIONLOOSE]}${d[h.PRERELEASELOOSE]}?${d[h.BUILD]}?`),B("LOOSE",`^${d[h.LOOSEPLAIN]}$`),B("GTLT","((?:<|>)?=?)"),B("XRANGEIDENTIFIERLOOSE",`${d[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),B("XRANGEIDENTIFIER",`${d[h.NUMERICIDENTIFIER]}|x|X|\\*`),B("XRANGEPLAIN",`[v=\\s]*(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:${d[h.PRERELEASE]})?${d[h.BUILD]}?)?)?`),B("XRANGEPLAINLOOSE",`[v=\\s]*(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:${d[h.PRERELEASELOOSE]})?${d[h.BUILD]}?)?)?`),B("XRANGE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAIN]}$`),B("XRANGELOOSE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAINLOOSE]}$`),B("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),B("COERCE",`${d[h.COERCEPLAIN]}(?:$|[^\\d])`),B("COERCEFULL",d[h.COERCEPLAIN]+`(?:${d[h.PRERELEASE]})?(?:${d[h.BUILD]})?(?:$|[^\\d])`),B("COERCERTL",d[h.COERCE],!0),B("COERCERTLFULL",d[h.COERCEFULL],!0),B("LONETILDE","(?:~>?)"),B("TILDETRIM",`(\\s*)${d[h.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",B("TILDE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAIN]}$`),B("TILDELOOSE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAINLOOSE]}$`),B("LONECARET","(?:\\^)"),B("CARETTRIM",`(\\s*)${d[h.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",B("CARET",`^${d[h.LONECARET]}${d[h.XRANGEPLAIN]}$`),B("CARETLOOSE",`^${d[h.LONECARET]}${d[h.XRANGEPLAINLOOSE]}$`),B("COMPARATORLOOSE",`^${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]})$|^$`),B("COMPARATOR",`^${d[h.GTLT]}\\s*(${d[h.FULLPLAIN]})$|^$`),B("COMPARATORTRIM",`(\\s*)${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]}|${d[h.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",B("HYPHENRANGE",`^\\s*(${d[h.XRANGEPLAIN]})\\s+-\\s+(${d[h.XRANGEPLAIN]})\\s*$`),B("HYPHENRANGELOOSE",`^\\s*(${d[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[h.XRANGEPLAINLOOSE]})\\s*$`),B("STAR","(<|>)?=?\\s*\\*"),B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ec,ec.exports);var hs=ec.exports;const oO=Object.freeze({loose:!0}),sO=Object.freeze({}),aO=e=>e?typeof e!="object"?oO:e:sO;var Bc=aO;const t_=/^[0-9]+$/,Np=(e,t)=>{const n=t_.test(e),o=t_.test(t);return n&&o&&(e=+e,t=+t),e===t?0:n&&!o?-1:o&&!n?1:e<t?-1:1},fO=(e,t)=>Np(t,e);var Bp={compareIdentifiers:Np,rcompareIdentifiers:fO};const Ta=cf,{MAX_LENGTH:r_,MAX_SAFE_INTEGER:Oa}=lf,{safeRe:n_,t:i_}=hs,uO=Bc,{compareIdentifiers:eo}=Bp;let lO=class pn{constructor(t,n){if(n=uO(n),t instanceof pn){if(t.loose===!!n.loose&&t.includePrerelease===!!n.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>r_)throw new TypeError(`version is longer than ${r_} characters`);Ta("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const o=t.trim().match(n.loose?n_[i_.LOOSE]:n_[i_.FULL]);if(!o)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>Oa||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Oa||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Oa||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(a=>{if(/^[0-9]+$/.test(a)){const f=+a;if(f>=0&&f<Oa)return f}return a}):this.prerelease=[],this.build=o[5]?o[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(Ta("SemVer.compare",this.version,this.options,t),!(t instanceof pn)){if(typeof t=="string"&&t===this.version)return 0;t=new pn(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof pn||(t=new pn(t,this.options)),eo(this.major,t.major)||eo(this.minor,t.minor)||eo(this.patch,t.patch)}comparePre(t){if(t instanceof pn||(t=new pn(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 n=0;do{const o=this.prerelease[n],a=t.prerelease[n];if(Ta("prerelease compare",n,o,a),o===void 0&&a===void 0)return 0;if(a===void 0)return 1;if(o===void 0)return-1;if(o===a)continue;return eo(o,a)}while(++n)}compareBuild(t){t instanceof pn||(t=new pn(t,this.options));let n=0;do{const o=this.build[n],a=t.build[n];if(Ta("build compare",n,o,a),o===void 0&&a===void 0)return 0;if(a===void 0)return 1;if(o===void 0)return-1;if(o===a)continue;return eo(o,a)}while(++n)}inc(t,n,o){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,o);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,o);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,o),this.inc("pre",n,o);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,o),this.inc("pre",n,o);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 a=Number(o)?1:0;if(!n&&o===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[a];else{let f=this.prerelease.length;for(;--f>=0;)typeof this.prerelease[f]=="number"&&(this.prerelease[f]++,f=-2);if(f===-1){if(n===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(a)}}if(n){let f=[n,a];o===!1&&(f=[n]),eo(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=f):this.prerelease=f}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var mr=lO;const o_=mr,cO=(e,t,n=!1)=>{if(e instanceof o_)return e;try{return new o_(e,t)}catch(o){if(!n)return null;throw o}};var wo=cO;const dO=wo,hO=(e,t)=>{const n=dO(e,t);return n?n.version:null};var gO=hO;const _O=wo,pO=(e,t)=>{const n=_O(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};var bO=pO;const s_=mr,wO=(e,t,n,o,a)=>{typeof n=="string"&&(a=o,o=n,n=void 0);try{return new s_(e instanceof s_?e.version:e,n).inc(t,o,a).version}catch{return null}};var yO=wO;const a_=wo,mO=(e,t)=>{const n=a_(e,null,!0),o=a_(t,null,!0),a=n.compare(o);if(a===0)return null;const f=a>0,u=f?n:o,g=f?o:n,d=!!u.prerelease.length;if(!!g.prerelease.length&&!d)return!g.patch&&!g.minor?"major":u.patch?"patch":u.minor?"minor":"major";const _=d?"pre":"";return n.major!==o.major?_+"major":n.minor!==o.minor?_+"minor":n.patch!==o.patch?_+"patch":"prerelease"};var vO=mO;const EO=mr,SO=(e,t)=>new EO(e,t).major;var RO=SO;const AO=mr,IO=(e,t)=>new AO(e,t).minor;var TO=IO;const OO=mr,CO=(e,t)=>new OO(e,t).patch;var PO=CO;const LO=wo,NO=(e,t)=>{const n=LO(e,t);return n&&n.prerelease.length?n.prerelease:null};var BO=NO;const f_=mr,$O=(e,t,n)=>new f_(e,n).compare(new f_(t,n));var un=$O;const xO=un,DO=(e,t,n)=>xO(t,e,n);var MO=DO;const kO=un,FO=(e,t)=>kO(e,t,!0);var UO=FO;const u_=mr,jO=(e,t,n)=>{const o=new u_(e,n),a=new u_(t,n);return o.compare(a)||o.compareBuild(a)};var $c=jO;const HO=$c,WO=(e,t)=>e.sort((n,o)=>HO(n,o,t));var zO=WO;const qO=$c,GO=(e,t)=>e.sort((n,o)=>qO(o,n,t));var VO=GO;const ZO=un,KO=(e,t,n)=>ZO(e,t,n)>0;var df=KO;const JO=un,XO=(e,t,n)=>JO(e,t,n)<0;var xc=XO;const YO=un,QO=(e,t,n)=>YO(e,t,n)===0;var $p=QO;const e2=un,t2=(e,t,n)=>e2(e,t,n)!==0;var xp=t2;const r2=un,n2=(e,t,n)=>r2(e,t,n)>=0;var Dc=n2;const i2=un,o2=(e,t,n)=>i2(e,t,n)<=0;var Mc=o2;const s2=$p,a2=xp,f2=df,u2=Dc,l2=xc,c2=Mc,d2=(e,t,n,o)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return s2(e,n,o);case"!=":return a2(e,n,o);case">":return f2(e,n,o);case">=":return u2(e,n,o);case"<":return l2(e,n,o);case"<=":return c2(e,n,o);default:throw new TypeError(`Invalid operator: ${t}`)}};var Dp=d2;const h2=mr,g2=wo,{safeRe:Ca,t:Pa}=hs,_2=(e,t)=>{if(e instanceof h2)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?Ca[Pa.COERCEFULL]:Ca[Pa.COERCE]);else{const d=t.includePrerelease?Ca[Pa.COERCERTLFULL]:Ca[Pa.COERCERTL];let h;for(;(h=d.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||h.index+h[0].length!==n.index+n[0].length)&&(n=h),d.lastIndex=h.index+h[1].length+h[2].length;d.lastIndex=-1}if(n===null)return null;const o=n[2],a=n[3]||"0",f=n[4]||"0",u=t.includePrerelease&&n[5]?`-${n[5]}`:"",g=t.includePrerelease&&n[6]?`+${n[6]}`:"";return g2(`${o}.${a}.${f}${u}${g}`,t)};var p2=_2;class b2{constructor(){this.max=1e3,this.map=new Map}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){const a=this.map.keys().next().value;this.delete(a)}this.map.set(t,n)}return this}}var w2=b2,_l,l_;function ln(){if(l_)return _l;l_=1;const e=/\s+/g;class t{constructor(M,X){if(X=a(X),M instanceof t)return M.loose===!!X.loose&&M.includePrerelease===!!X.includePrerelease?M:new t(M.raw,X);if(M instanceof f)return this.raw=M.value,this.set=[[M]],this.formatted=void 0,this;if(this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease,this.raw=M.trim().replace(e," "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(J=>!D(J[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const J of this.set)if(J.length===1&&j(J[0])){this.set=[J];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const X=this.set[M];for(let k=0;k<X.length;k++)k>0&&(this.formatted+=" "),this.formatted+=X[k].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const k=((this.options.includePrerelease&&y)|(this.options.loose&&B))+":"+M,J=o.get(k);if(J)return J;const x=this.options.loose,z=x?d[h.HYPHENRANGELOOSE]:d[h.HYPHENRANGE];M=M.replace(z,R(this.options.includePrerelease)),u("hyphen replace",M),M=M.replace(d[h.COMPARATORTRIM],_),u("comparator trim",M),M=M.replace(d[h.TILDETRIM],E),u("tilde trim",M),M=M.replace(d[h.CARETTRIM],v),u("caret trim",M);let re=M.split(" ").map(_e=>H(_e,this.options)).join(" ").split(/\s+/).map(_e=>ve(_e,this.options));x&&(re=re.filter(_e=>(u("loose invalid filter",_e,this.options),!!_e.match(d[h.COMPARATORLOOSE])))),u("range list",re);const he=new Map,ee=re.map(_e=>new f(_e,this.options));for(const _e of ee){if(D(_e))return[_e];he.set(_e.value,_e)}he.size>1&&he.has("")&&he.delete("");const ye=[...he.values()];return o.set(k,ye),ye}intersects(M,X){if(!(M instanceof t))throw new TypeError("a Range is required");return this.set.some(k=>q(k,X)&&M.set.some(J=>q(J,X)&&k.every(x=>J.every(z=>x.intersects(z,X)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new g(M,this.options)}catch{return!1}for(let X=0;X<this.set.length;X++)if(T(this.set[X],M,this.options))return!0;return!1}}_l=t;const n=w2,o=new n,a=Bc,f=hf(),u=cf,g=mr,{safeRe:d,t:h,comparatorTrimReplace:_,tildeTrimReplace:E,caretTrimReplace:v}=hs,{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:B}=lf,D=I=>I.value==="<0.0.0-0",j=I=>I.value==="",q=(I,M)=>{let X=!0;const k=I.slice();let J=k.pop();for(;X&&k.length;)X=k.every(x=>J.intersects(x,M)),J=k.pop();return X},H=(I,M)=>(u("comp",I,M),I=ae(I,M),u("caret",I),I=P(I,M),u("tildes",I),I=be(I,M),u("xrange",I),I=Oe(I,M),u("stars",I),I),L=I=>!I||I.toLowerCase()==="x"||I==="*",P=(I,M)=>I.trim().split(/\s+/).map(X=>K(X,M)).join(" "),K=(I,M)=>{const X=M.loose?d[h.TILDELOOSE]:d[h.TILDE];return I.replace(X,(k,J,x,z,re)=>{u("tilde",I,k,J,x,z,re);let he;return L(J)?he="":L(x)?he=`>=${J}.0.0 <${+J+1}.0.0-0`:L(z)?he=`>=${J}.${x}.0 <${J}.${+x+1}.0-0`:re?(u("replaceTilde pr",re),he=`>=${J}.${x}.${z}-${re} <${J}.${+x+1}.0-0`):he=`>=${J}.${x}.${z} <${J}.${+x+1}.0-0`,u("tilde return",he),he})},ae=(I,M)=>I.trim().split(/\s+/).map(X=>oe(X,M)).join(" "),oe=(I,M)=>{u("caret",I,M);const X=M.loose?d[h.CARETLOOSE]:d[h.CARET],k=M.includePrerelease?"-0":"";return I.replace(X,(J,x,z,re,he)=>{u("caret",I,J,x,z,re,he);let ee;return L(x)?ee="":L(z)?ee=`>=${x}.0.0${k} <${+x+1}.0.0-0`:L(re)?x==="0"?ee=`>=${x}.${z}.0${k} <${x}.${+z+1}.0-0`:ee=`>=${x}.${z}.0${k} <${+x+1}.0.0-0`:he?(u("replaceCaret pr",he),x==="0"?z==="0"?ee=`>=${x}.${z}.${re}-${he} <${x}.${z}.${+re+1}-0`:ee=`>=${x}.${z}.${re}-${he} <${x}.${+z+1}.0-0`:ee=`>=${x}.${z}.${re}-${he} <${+x+1}.0.0-0`):(u("no pr"),x==="0"?z==="0"?ee=`>=${x}.${z}.${re}${k} <${x}.${z}.${+re+1}-0`:ee=`>=${x}.${z}.${re}${k} <${x}.${+z+1}.0-0`:ee=`>=${x}.${z}.${re} <${+x+1}.0.0-0`),u("caret return",ee),ee})},be=(I,M)=>(u("replaceXRanges",I,M),I.split(/\s+/).map(X=>de(X,M)).join(" ")),de=(I,M)=>{I=I.trim();const X=M.loose?d[h.XRANGELOOSE]:d[h.XRANGE];return I.replace(X,(k,J,x,z,re,he)=>{u("xRange",I,k,J,x,z,re,he);const ee=L(x),ye=ee||L(z),_e=ye||L(re),Re=_e;return J==="="&&Re&&(J=""),he=M.includePrerelease?"-0":"",ee?J===">"||J==="<"?k="<0.0.0-0":k="*":J&&Re?(ye&&(z=0),re=0,J===">"?(J=">=",ye?(x=+x+1,z=0,re=0):(z=+z+1,re=0)):J==="<="&&(J="<",ye?x=+x+1:z=+z+1),J==="<"&&(he="-0"),k=`${J+x}.${z}.${re}${he}`):ye?k=`>=${x}.0.0${he} <${+x+1}.0.0-0`:_e&&(k=`>=${x}.${z}.0${he} <${x}.${+z+1}.0-0`),u("xRange return",k),k})},Oe=(I,M)=>(u("replaceStars",I,M),I.trim().replace(d[h.STAR],"")),ve=(I,M)=>(u("replaceGTE0",I,M),I.trim().replace(d[M.includePrerelease?h.GTE0PRE:h.GTE0],"")),R=I=>(M,X,k,J,x,z,re,he,ee,ye,_e,Re)=>(L(k)?X="":L(J)?X=`>=${k}.0.0${I?"-0":""}`:L(x)?X=`>=${k}.${J}.0${I?"-0":""}`:z?X=`>=${X}`:X=`>=${X}${I?"-0":""}`,L(ee)?he="":L(ye)?he=`<${+ee+1}.0.0-0`:L(_e)?he=`<${ee}.${+ye+1}.0-0`:Re?he=`<=${ee}.${ye}.${_e}-${Re}`:I?he=`<${ee}.${ye}.${+_e+1}-0`:he=`<=${he}`,`${X} ${he}`.trim()),T=(I,M,X)=>{for(let k=0;k<I.length;k++)if(!I[k].test(M))return!1;if(M.prerelease.length&&!X.includePrerelease){for(let k=0;k<I.length;k++)if(u(I[k].semver),I[k].semver!==f.ANY&&I[k].semver.prerelease.length>0){const J=I[k].semver;if(J.major===M.major&&J.minor===M.minor&&J.patch===M.patch)return!0}return!1}return!0};return _l}var pl,c_;function hf(){if(c_)return pl;c_=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(_,E){if(E=n(E),_ instanceof t){if(_.loose===!!E.loose)return _;_=_.value}_=_.trim().split(/\s+/).join(" "),u("comparator",_,E),this.options=E,this.loose=!!E.loose,this.parse(_),this.semver===e?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(_){const E=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],v=_.match(E);if(!v)throw new TypeError(`Invalid comparator: ${_}`);this.operator=v[1]!==void 0?v[1]:"",this.operator==="="&&(this.operator=""),v[2]?this.semver=new g(v[2],this.options.loose):this.semver=e}toString(){return this.value}test(_){if(u("Comparator.test",_,this.options.loose),this.semver===e||_===e)return!0;if(typeof _=="string")try{_=new g(_,this.options)}catch{return!1}return f(_,this.operator,this.semver,this.options)}intersects(_,E){if(!(_ instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(_.value,E).test(this.value):_.operator===""?_.value===""?!0:new d(this.value,E).test(_.semver):(E=n(E),E.includePrerelease&&(this.value==="<0.0.0-0"||_.value==="<0.0.0-0")||!E.includePrerelease&&(this.value.startsWith("<0.0.0")||_.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&_.operator.startsWith(">")||this.operator.startsWith("<")&&_.operator.startsWith("<")||this.semver.version===_.semver.version&&this.operator.includes("=")&&_.operator.includes("=")||f(this.semver,"<",_.semver,E)&&this.operator.startsWith(">")&&_.operator.startsWith("<")||f(this.semver,">",_.semver,E)&&this.operator.startsWith("<")&&_.operator.startsWith(">")))}}pl=t;const n=Bc,{safeRe:o,t:a}=hs,f=Dp,u=cf,g=mr,d=ln();return pl}const y2=ln(),m2=(e,t,n)=>{try{t=new y2(t,n)}catch{return!1}return t.test(e)};var gf=m2;const v2=ln(),E2=(e,t)=>new v2(e,t).set.map(n=>n.map(o=>o.value).join(" ").trim().split(" "));var S2=E2;const R2=mr,A2=ln(),I2=(e,t,n)=>{let o=null,a=null,f=null;try{f=new A2(t,n)}catch{return null}return e.forEach(u=>{f.test(u)&&(!o||a.compare(u)===-1)&&(o=u,a=new R2(o,n))}),o};var T2=I2;const O2=mr,C2=ln(),P2=(e,t,n)=>{let o=null,a=null,f=null;try{f=new C2(t,n)}catch{return null}return e.forEach(u=>{f.test(u)&&(!o||a.compare(u)===1)&&(o=u,a=new O2(o,n))}),o};var L2=P2;const bl=mr,N2=ln(),d_=df,B2=(e,t)=>{e=new N2(e,t);let n=new bl("0.0.0");if(e.test(n)||(n=new bl("0.0.0-0"),e.test(n)))return n;n=null;for(let o=0;o<e.set.length;++o){const a=e.set[o];let f=null;a.forEach(u=>{const g=new bl(u.semver.version);switch(u.operator){case">":g.prerelease.length===0?g.patch++:g.prerelease.push(0),g.raw=g.format();case"":case">=":(!f||d_(g,f))&&(f=g);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),f&&(!n||d_(n,f))&&(n=f)}return n&&e.test(n)?n:null};var $2=B2;const x2=ln(),D2=(e,t)=>{try{return new x2(e,t).range||"*"}catch{return null}};var M2=D2;const k2=mr,Mp=hf(),{ANY:F2}=Mp,U2=ln(),j2=gf,h_=df,g_=xc,H2=Mc,W2=Dc,z2=(e,t,n,o)=>{e=new k2(e,o),t=new U2(t,o);let a,f,u,g,d;switch(n){case">":a=h_,f=H2,u=g_,g=">",d=">=";break;case"<":a=g_,f=W2,u=h_,g="<",d="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(j2(e,t,o))return!1;for(let h=0;h<t.set.length;++h){const _=t.set[h];let E=null,v=null;if(_.forEach(y=>{y.semver===F2&&(y=new Mp(">=0.0.0")),E=E||y,v=v||y,a(y.semver,E.semver,o)?E=y:u(y.semver,v.semver,o)&&(v=y)}),E.operator===g||E.operator===d||(!v.operator||v.operator===g)&&f(e,v.semver))return!1;if(v.operator===d&&u(e,v.semver))return!1}return!0};var kc=z2;const q2=kc,G2=(e,t,n)=>q2(e,t,">",n);var V2=G2;const Z2=kc,K2=(e,t,n)=>Z2(e,t,"<",n);var J2=K2;const __=ln(),X2=(e,t,n)=>(e=new __(e,n),t=new __(t,n),e.intersects(t,n));var Y2=X2;const Q2=gf,eC=un;var tC=(e,t,n)=>{const o=[];let a=null,f=null;const u=e.sort((_,E)=>eC(_,E,n));for(const _ of u)Q2(_,t,n)?(f=_,a||(a=_)):(f&&o.push([a,f]),f=null,a=null);a&&o.push([a,null]);const g=[];for(const[_,E]of o)_===E?g.push(_):!E&&_===u[0]?g.push("*"):E?_===u[0]?g.push(`<=${E}`):g.push(`${_} - ${E}`):g.push(`>=${_}`);const d=g.join(" || "),h=typeof t.raw=="string"?t.raw:String(t);return d.length<h.length?d:t};const p_=ln(),Fc=hf(),{ANY:wl}=Fc,Vo=gf,Uc=un,rC=(e,t,n={})=>{if(e===t)return!0;e=new p_(e,n),t=new p_(t,n);let o=!1;e:for(const a of e.set){for(const f of t.set){const u=iC(a,f,n);if(o=o||u!==null,u)continue e}if(o)return!1}return!0},nC=[new Fc(">=0.0.0-0")],b_=[new Fc(">=0.0.0")],iC=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===wl){if(t.length===1&&t[0].semver===wl)return!0;n.includePrerelease?e=nC:e=b_}if(t.length===1&&t[0].semver===wl){if(n.includePrerelease)return!0;t=b_}const o=new Set;let a,f;for(const y of e)y.operator===">"||y.operator===">="?a=w_(a,y,n):y.operator==="<"||y.operator==="<="?f=y_(f,y,n):o.add(y.semver);if(o.size>1)return null;let u;if(a&&f){if(u=Uc(a.semver,f.semver,n),u>0)return null;if(u===0&&(a.operator!==">="||f.operator!=="<="))return null}for(const y of o){if(a&&!Vo(y,String(a),n)||f&&!Vo(y,String(f),n))return null;for(const B of t)if(!Vo(y,String(B),n))return!1;return!0}let g,d,h,_,E=f&&!n.includePrerelease&&f.semver.prerelease.length?f.semver:!1,v=a&&!n.includePrerelease&&a.semver.prerelease.length?a.semver:!1;E&&E.prerelease.length===1&&f.operator==="<"&&E.prerelease[0]===0&&(E=!1);for(const y of t){if(_=_||y.operator===">"||y.operator===">=",h=h||y.operator==="<"||y.operator==="<=",a){if(v&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===v.major&&y.semver.minor===v.minor&&y.semver.patch===v.patch&&(v=!1),y.operator===">"||y.operator===">="){if(g=w_(a,y,n),g===y&&g!==a)return!1}else if(a.operator===">="&&!Vo(a.semver,String(y),n))return!1}if(f){if(E&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===E.major&&y.semver.minor===E.minor&&y.semver.patch===E.patch&&(E=!1),y.operator==="<"||y.operator==="<="){if(d=y_(f,y,n),d===y&&d!==f)return!1}else if(f.operator==="<="&&!Vo(f.semver,String(y),n))return!1}if(!y.operator&&(f||a)&&u!==0)return!1}return!(a&&h&&!f&&u!==0||f&&_&&!a&&u!==0||v||E)},w_=(e,t,n)=>{if(!e)return t;const o=Uc(e.semver,t.semver,n);return o>0?e:o<0||t.operator===">"&&e.operator===">="?t:e},y_=(e,t,n)=>{if(!e)return t;const o=Uc(e.semver,t.semver,n);return o<0?e:o>0||t.operator==="<"&&e.operator==="<="?t:e};var oC=rC;const yl=hs,m_=lf,sC=mr,v_=Bp,aC=wo,fC=gO,uC=bO,lC=yO,cC=vO,dC=RO,hC=TO,gC=PO,_C=BO,pC=un,bC=MO,wC=UO,yC=$c,mC=zO,vC=VO,EC=df,SC=xc,RC=$p,AC=xp,IC=Dc,TC=Mc,OC=Dp,CC=p2,PC=hf(),LC=ln(),NC=gf,BC=S2,$C=T2,xC=L2,DC=$2,MC=M2,kC=kc,FC=V2,UC=J2,jC=Y2,HC=tC,WC=oC;var zC={parse:aC,valid:fC,clean:uC,inc:lC,diff:cC,major:dC,minor:hC,patch:gC,prerelease:_C,compare:pC,rcompare:bC,compareLoose:wC,compareBuild:yC,sort:mC,rsort:vC,gt:EC,lt:SC,eq:RC,neq:AC,gte:IC,lte:TC,cmp:OC,coerce:CC,Comparator:PC,Range:LC,satisfies:NC,toComparators:BC,maxSatisfying:$C,minSatisfying:xC,minVersion:DC,validRange:MC,outside:kC,gtr:FC,ltr:UC,intersects:jC,simplifyRange:HC,subset:WC,SemVer:sC,re:yl.re,src:yl.src,tokens:yl.t,SEMVER_SPEC_VERSION:m_.SEMVER_SPEC_VERSION,RELEASE_TYPES:m_.RELEASE_TYPES,compareIdentifiers:v_.compareIdentifiers,rcompareIdentifiers:v_.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=zC,n=Li,o=rr;e.VersionStruct=(0,n.refine)((0,n.string)(),"Version",E=>(0,t.valid)(E)===null?`Expected SemVer version, got "${E}"`:!0),e.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",E=>(0,t.validRange)(E)===null?`Expected SemVer range, got "${E}"`:!0);function a(E){return(0,n.is)(E,e.VersionStruct)}e.isValidSemVerVersion=a;function f(E){return(0,n.is)(E,e.VersionRangeStruct)}e.isValidSemVerRange=f;function u(E){(0,o.assertStruct)(E,e.VersionStruct)}e.assertIsSemVerVersion=u;function g(E){(0,o.assertStruct)(E,e.VersionRangeStruct)}e.assertIsSemVerRange=g;function d(E,v){return(0,t.gt)(E,v)}e.gtVersion=d;function h(E,v){return(0,t.gtr)(E,v)}e.gtRange=h;function _(E,v){return(0,t.satisfies)(E,v,{includePrerelease:!0})}e.satisfiesVersionRange=_})(Pp);(function(e){var t=V.commonjsGlobal&&V.commonjsGlobal.__createBinding||(Object.create?function(o,a,f,u){u===void 0&&(u=f);var g=Object.getOwnPropertyDescriptor(a,f);(!g||("get"in g?!a.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return a[f]}}),Object.defineProperty(o,u,g)}:function(o,a,f,u){u===void 0&&(u=f),o[u]=a[f]}),n=V.commonjsGlobal&&V.commonjsGlobal.__exportStar||function(o,a){for(var f in o)f!=="default"&&!Object.prototype.hasOwnProperty.call(a,f)&&t(a,o,f)};Object.defineProperty(e,"__esModule",{value:!0}),n(rr,e),n(cs,e),n(ht,e),n(ff,e),n(wn,e),n(uo,e),n(Sp,e),n(ds,e),n(Rp,e),n(Ap,e),n(lo,e),n(Ip,e),n(yn,e),n(Tp,e),n(Op,e),n(Cp,e),n(Pp,e)})(Rc);var _f={},si={};Object.defineProperty(si,"__esModule",{value:!0});si.errorValues=si.errorCodes=void 0;si.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}};si.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=Rc,n=si,o=n.errorCodes.rpc.internal,a="Unspecified error message. This is a bug, please report it.",f={code:o,message:u(o)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function u(y,B=a){if(g(y)){const D=y.toString();if((0,t.hasProperty)(n.errorValues,D))return n.errorValues[D].message;if(_(y))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return B}e.getMessageFromCode=u;function g(y){return Number.isInteger(y)}e.isValidCode=g;function d(y,{fallbackError:B=f,shouldIncludeStack:D=!0}={}){if(!(0,t.isJsonRpcError)(B))throw new Error("Must provide fallback error with integer number code and string message.");const j=h(y,B);return D||delete j.stack,j}e.serializeError=d;function h(y,B){if(y&&typeof y=="object"&&"serialize"in y&&typeof y.serialize=="function")return y.serialize();if((0,t.isJsonRpcError)(y))return y;const D=E(y);return{...B,data:{cause:D}}}function _(y){return y>=-32099&&y<=-32e3}function E(y){return Array.isArray(y)?y.map(B=>(0,t.isValidJson)(B)?B:(0,t.isObject)(B)?v(B):null):(0,t.isObject)(y)?v(y):(0,t.isValidJson)(y)?y:null}e.serializeCause=E;function v(y){return Object.getOwnPropertyNames(y).reduce((B,D)=>{const j=y[D];return(0,t.isValidJson)(j)&&(B[D]=j),B},{})}})(_f);var qC=V.commonjsGlobal&&V.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.EthereumProviderError=Ai.JsonRpcError=void 0;const GC=Rc,VC=qC(lc),ZC=_f;class kp extends Error{constructor(t,n,o){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a non-empty string.');super(n),this.code=t,o!==void 0&&(this.data=o)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data,(0,GC.isPlainObject)(this.data)&&(t.data.cause=(0,ZC.serializeCause)(this.data.cause))),this.stack&&(t.stack=this.stack),t}toString(){return(0,VC.default)(this.serialize(),XC,2)}}Ai.JsonRpcError=kp;class KC extends kp{constructor(t,n,o){if(!JC(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,n,o)}}Ai.EthereumProviderError=KC;function JC(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function XC(e,t){if(t!=="[Circular]")return t}var co={};Object.defineProperty(co,"__esModule",{value:!0});co.providerErrors=co.rpcErrors=void 0;const jc=Ai,lr=si,Fp=_f;co.rpcErrors={parse:e=>Vr(lr.errorCodes.rpc.parse,e),invalidRequest:e=>Vr(lr.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Vr(lr.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Vr(lr.errorCodes.rpc.methodNotFound,e),internal:e=>Vr(lr.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 Vr(t,e)},invalidInput:e=>Vr(lr.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Vr(lr.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Vr(lr.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Vr(lr.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Vr(lr.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Vr(lr.errorCodes.rpc.limitExceeded,e)};co.providerErrors={userRejectedRequest:e=>Zo(lr.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Zo(lr.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Zo(lr.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Zo(lr.errorCodes.provider.disconnected,e),chainDisconnected:e=>Zo(lr.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:n,data:o}=e;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new jc.EthereumProviderError(t,n,o)}};function Vr(e,t){const[n,o]=Up(t);return new jc.JsonRpcError(e,n??(0,Fp.getMessageFromCode)(e),o)}function Zo(e,t){const[n,o]=Up(t);return new jc.EthereumProviderError(e,n??(0,Fp.getMessageFromCode)(e),o)}function Up(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t??void 0,n]}}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=Ai;Object.defineProperty(e,"JsonRpcError",{enumerable:!0,get:function(){return t.JsonRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});var n=_f;Object.defineProperty(e,"serializeCause",{enumerable:!0,get:function(){return n.serializeCause}}),Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});var o=co;Object.defineProperty(e,"rpcErrors",{enumerable:!0,get:function(){return o.rpcErrors}}),Object.defineProperty(e,"providerErrors",{enumerable:!0,get:function(){return o.providerErrors}});var a=si;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})})(CI);var Hc={exports:{}},YC=jp;function jp(e,t){if(e&&t)return jp(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(o){n[o]=e[o]}),n;function n(){for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];var f=e.apply(this,o),u=o[o.length-1];return typeof f=="function"&&f!==u&&Object.keys(u).forEach(function(g){f[g]=u[g]}),f}}var Hp=YC;Hc.exports=Hp(Da);Hc.exports.strict=Hp(Wp);Da.proto=Da(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Da(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Wp(this)},configurable:!0})});function Da(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function Wp(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}var Wc=Hc.exports;const QC=V.getDefaultExportFromCjs(Wc);var eP=Wc,tP=function(){},rP=function(e){return e.setHeader&&typeof e.abort=="function"},nP=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},zp=function(e,t,n){if(typeof t=="function")return zp(e,null,t);t||(t={}),n=eP(n||tP);var o=e._writableState,a=e._readableState,f=t.readable||t.readable!==!1&&e.readable,u=t.writable||t.writable!==!1&&e.writable,g=!1,d=function(){e.writable||h()},h=function(){u=!1,f||n.call(e)},_=function(){f=!1,u||n.call(e)},E=function(j){n.call(e,j?new Error("exited with error code: "+j):null)},v=function(j){n.call(e,j)},y=function(){V.dist.process.nextTick(B)},B=function(){if(!g){if(f&&!(a&&a.ended&&!a.destroyed))return n.call(e,new Error("premature close"));if(u&&!(o&&o.ended&&!o.destroyed))return n.call(e,new Error("premature close"))}},D=function(){e.req.on("finish",h)};return rP(e)?(e.on("complete",h),e.on("abort",y),e.req?D():e.on("request",D)):u&&!o&&(e.on("end",d),e.on("close",d)),nP(e)&&e.on("exit",E),e.on("end",_),e.on("finish",h),t.error!==!1&&e.on("error",v),e.on("close",y),function(){g=!0,e.removeListener("complete",h),e.removeListener("abort",y),e.removeListener("request",D),e.req&&e.req.removeListener("finish",h),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("exit",E),e.removeListener("end",_),e.removeListener("error",v),e.removeListener("close",y)}},qp=zp;const E_=V.getDefaultExportFromCjs(qp);var iP=Wc,oP=qp,ml=V.require$$2,os=function(){},sP=/^v?\.0/.test(V.dist.process.version),pf=function(e){return typeof e=="function"},aP=function(e){return!sP||!ml?!1:(e instanceof(ml.ReadStream||os)||e instanceof(ml.WriteStream||os))&&pf(e.close)},fP=function(e){return e.setHeader&&pf(e.abort)},uP=function(e,t,n,o){o=iP(o);var a=!1;e.on("close",function(){a=!0}),oP(e,{readable:t,writable:n},function(u){if(u)return o(u);a=!0,o()});var f=!1;return function(u){if(!a&&!f){if(f=!0,aP(e))return e.close(os);if(fP(e))return e.abort();if(pf(e.destroy))return e.destroy();o(u||new Error("stream was destroyed"))}}},S_=function(e){e()},lP=function(e,t){return e.pipe(t)},cP=function(){var e=Array.prototype.slice.call(arguments),t=pf(e[e.length-1]||os)&&e.pop()||os;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var n,o=e.map(function(a,f){var u=f<e.length-1,g=f>0;return uP(a,u,g,function(d){n||(n=d),d&&o.forEach(S_),!u&&(o.forEach(S_),t(n))})});return e.reduce(lP)},dP=cP;const R_=V.getDefaultExportFromCjs(dP);var hP={},bf={},wf={},Gp={},yf={};const gP=V.getAugmentedNamespace(V.hmac$1);var zc={},mf={},Lt={},vt={};Object.defineProperty(vt,"__esModule",{value:!0});vt.bitMask=void 0;vt.isBytes=Ef;vt.abytes=Sf;vt.bytesToHex=qc;vt.numberToHexUnpadded=Zp;vt.hexToNumber=Gc;vt.hexToBytes=Rf;vt.bytesToNumberBE=bP;vt.bytesToNumberLE=wP;vt.numberToBytesBE=Kp;vt.numberToBytesLE=yP;vt.numberToVarBytesBE=mP;vt.ensureBytes=vP;vt.concatBytes=Jp;vt.equalBytes=EP;vt.utf8ToBytes=SP;vt.bitLen=RP;vt.bitGet=AP;vt.bitSet=IP;vt.createHmacDrbg=OP;vt.validateObject=PP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Vp=BigInt(0),vf=BigInt(1),_P=BigInt(2);function Ef(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Sf(e){if(!Ef(e))throw new Error("Uint8Array expected")}const pP=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function qc(e){Sf(e);let t="";for(let n=0;n<e.length;n++)t+=pP[e[n]];return t}function Zp(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function Gc(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}const kn={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function A_(e){if(e>=kn._0&&e<=kn._9)return e-kn._0;if(e>=kn._A&&e<=kn._F)return e-(kn._A-10);if(e>=kn._a&&e<=kn._f)return e-(kn._a-10)}function Rf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const o=new Uint8Array(n);for(let a=0,f=0;a<n;a++,f+=2){const u=A_(e.charCodeAt(f)),g=A_(e.charCodeAt(f+1));if(u===void 0||g===void 0){const d=e[f]+e[f+1];throw new Error('hex string expected, got non-hex character "'+d+'" at index '+f)}o[a]=u*16+g}return o}function bP(e){return Gc(qc(e))}function wP(e){return Sf(e),Gc(qc(Uint8Array.from(e).reverse()))}function Kp(e,t){return Rf(e.toString(16).padStart(t*2,"0"))}function yP(e,t){return Kp(e,t).reverse()}function mP(e){return Rf(Zp(e))}function vP(e,t,n){let o;if(typeof t=="string")try{o=Rf(t)}catch(f){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${f}`)}else if(Ef(t))o=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const a=o.length;if(typeof n=="number"&&a!==n)throw new Error(`${e} expected ${n} bytes, got ${a}`);return o}function Jp(...e){let t=0;for(let o=0;o<e.length;o++){const a=e[o];Sf(a),t+=a.length}const n=new Uint8Array(t);for(let o=0,a=0;o<e.length;o++){const f=e[o];n.set(f,a),a+=f.length}return n}function EP(e,t){if(e.length!==t.length)return!1;let n=0;for(let o=0;o<e.length;o++)n|=e[o]^t[o];return n===0}function SP(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function RP(e){let t;for(t=0;e>Vp;e>>=vf,t+=1);return t}function AP(e,t){return e>>BigInt(t)&vf}function IP(e,t,n){return e|(n?vf:Vp)<<BigInt(t)}const TP=e=>(_P<<BigInt(e-1))-vf;vt.bitMask=TP;const vl=e=>new Uint8Array(e),I_=e=>Uint8Array.from(e);function OP(e,t,n){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 n!="function")throw new Error("hmacFn must be a function");let o=vl(e),a=vl(e),f=0;const u=()=>{o.fill(1),a.fill(0),f=0},g=(...E)=>n(a,o,...E),d=(E=vl())=>{a=g(I_([0]),E),o=g(),E.length!==0&&(a=g(I_([1]),E),o=g())},h=()=>{if(f++>=1e3)throw new Error("drbg: tried 1000 values");let E=0;const v=[];for(;E<t;){o=g();const y=o.slice();v.push(y),E+=o.length}return Jp(...v)};return(E,v)=>{u(),d(E);let y;for(;!(y=v(h()));)d();return u(),y}}const CP={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Ef(e),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 PP(e,t,n={}){const o=(a,f,u)=>{const g=CP[f];if(typeof g!="function")throw new Error(`Invalid validator "${f}", expected function`);const d=e[a];if(!(u&&d===void 0)&&!g(d,e))throw new Error(`Invalid param ${String(a)}=${d} (${typeof d}), expected ${f}`)};for(const[a,f]of Object.entries(t))o(a,f,!1);for(const[a,f]of Object.entries(n))o(a,f,!0);return e}Object.defineProperty(Lt,"__esModule",{value:!0});Lt.isNegativeLE=void 0;Lt.mod=xr;Lt.pow=Xp;Lt.pow2=NP;Lt.invert=Ha;Lt.tonelliShanks=Yp;Lt.FpSqrt=Qp;Lt.validateField=xP;Lt.FpPow=eb;Lt.FpInvertBatch=tb;Lt.FpDiv=DP;Lt.FpIsSquare=MP;Lt.nLength=Vc;Lt.Field=kP;Lt.FpSqrtOdd=FP;Lt.FpSqrtEven=UP;Lt.hashToPrivateScalar=jP;Lt.getFieldBytesLength=Zc;Lt.getMinHashLength=rb;Lt.mapHashToField=HP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Dr=vt,er=BigInt(0),Pt=BigInt(1),ni=BigInt(2),LP=BigInt(3),tc=BigInt(4),T_=BigInt(5),O_=BigInt(8);BigInt(9);BigInt(16);function xr(e,t){const n=e%t;return n>=er?n:t+n}function Xp(e,t,n){if(n<=er||t<er)throw new Error("Expected power/modulo > 0");if(n===Pt)return er;let o=Pt;for(;t>er;)t&Pt&&(o=o*e%n),e=e*e%n,t>>=Pt;return o}function NP(e,t,n){let o=e;for(;t-- >er;)o*=o,o%=n;return o}function Ha(e,t){if(e===er||t<=er)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=xr(e,t),o=t,a=er,f=Pt;for(;n!==er;){const g=o/n,d=o%n,h=a-f*g;o=n,n=d,a=f,f=h}if(o!==Pt)throw new Error("invert: does not exist");return xr(a,t)}function Yp(e){const t=(e-Pt)/ni;let n,o,a;for(n=e-Pt,o=0;n%ni===er;n/=ni,o++);for(a=ni;a<e&&Xp(a,t,e)!==e-Pt;a++);if(o===1){const u=(e+Pt)/tc;return function(d,h){const _=d.pow(h,u);if(!d.eql(d.sqr(_),h))throw new Error("Cannot find square root");return _}}const f=(n+Pt)/ni;return function(g,d){if(g.pow(d,t)===g.neg(g.ONE))throw new Error("Cannot find square root");let h=o,_=g.pow(g.mul(g.ONE,a),n),E=g.pow(d,f),v=g.pow(d,n);for(;!g.eql(v,g.ONE);){if(g.eql(v,g.ZERO))return g.ZERO;let y=1;for(let D=g.sqr(v);y<h&&!g.eql(D,g.ONE);y++)D=g.sqr(D);const B=g.pow(_,Pt<<BigInt(h-y-1));_=g.sqr(B),E=g.mul(E,B),v=g.mul(v,_),h=y}return E}}function Qp(e){if(e%tc===LP){const t=(e+Pt)/tc;return function(o,a){const f=o.pow(a,t);if(!o.eql(o.sqr(f),a))throw new Error("Cannot find square root");return f}}if(e%O_===T_){const t=(e-T_)/O_;return function(o,a){const f=o.mul(a,ni),u=o.pow(f,t),g=o.mul(a,u),d=o.mul(o.mul(g,ni),u),h=o.mul(g,o.sub(d,o.ONE));if(!o.eql(o.sqr(h),a))throw new Error("Cannot find square root");return h}}return Yp(e)}const BP=(e,t)=>(xr(e,t)&Pt)===Pt;Lt.isNegativeLE=BP;const $P=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function xP(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=$P.reduce((o,a)=>(o[a]="function",o),t);return(0,Dr.validateObject)(e,n)}function eb(e,t,n){if(n<er)throw new Error("Expected power > 0");if(n===er)return e.ONE;if(n===Pt)return t;let o=e.ONE,a=t;for(;n>er;)n&Pt&&(o=e.mul(o,a)),a=e.sqr(a),n>>=Pt;return o}function tb(e,t){const n=new Array(t.length),o=t.reduce((f,u,g)=>e.is0(u)?f:(n[g]=f,e.mul(f,u)),e.ONE),a=e.inv(o);return t.reduceRight((f,u,g)=>e.is0(u)?f:(n[g]=e.mul(f,n[g]),e.mul(f,u)),a),n}function DP(e,t,n){return e.mul(t,typeof n=="bigint"?Ha(n,e.ORDER):e.inv(n))}function MP(e){const t=(e.ORDER-Pt)/ni;return n=>{const o=e.pow(n,t);return e.eql(o,e.ZERO)||e.eql(o,e.ONE)}}function Vc(e,t){const n=t!==void 0?t:e.toString(2).length,o=Math.ceil(n/8);return{nBitLength:n,nByteLength:o}}function kP(e,t,n=!1,o={}){if(e<=er)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:a,nByteLength:f}=Vc(e,t);if(f>2048)throw new Error("Field lengths over 2048 bytes are not supported");const u=Qp(e),g=Object.freeze({ORDER:e,BITS:a,BYTES:f,MASK:(0,Dr.bitMask)(a),ZERO:er,ONE:Pt,create:d=>xr(d,e),isValid:d=>{if(typeof d!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof d}`);return er<=d&&d<e},is0:d=>d===er,isOdd:d=>(d&Pt)===Pt,neg:d=>xr(-d,e),eql:(d,h)=>d===h,sqr:d=>xr(d*d,e),add:(d,h)=>xr(d+h,e),sub:(d,h)=>xr(d-h,e),mul:(d,h)=>xr(d*h,e),pow:(d,h)=>eb(g,d,h),div:(d,h)=>xr(d*Ha(h,e),e),sqrN:d=>d*d,addN:(d,h)=>d+h,subN:(d,h)=>d-h,mulN:(d,h)=>d*h,inv:d=>Ha(d,e),sqrt:o.sqrt||(d=>u(g,d)),invertBatch:d=>tb(g,d),cmov:(d,h,_)=>_?h:d,toBytes:d=>n?(0,Dr.numberToBytesLE)(d,f):(0,Dr.numberToBytesBE)(d,f),fromBytes:d=>{if(d.length!==f)throw new Error(`Fp.fromBytes: expected ${f}, got ${d.length}`);return n?(0,Dr.bytesToNumberLE)(d):(0,Dr.bytesToNumberBE)(d)}});return Object.freeze(g)}function FP(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)}function UP(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n}function jP(e,t,n=!1){e=(0,Dr.ensureBytes)("privateHash",e);const o=e.length,a=Vc(t).nByteLength+8;if(a<24||o<a||o>1024)throw new Error(`hashToPrivateScalar: expected ${a}-1024 bytes of input, got ${o}`);const f=n?(0,Dr.bytesToNumberLE)(e):(0,Dr.bytesToNumberBE)(e);return xr(f,t-Pt)+Pt}function Zc(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function rb(e){const t=Zc(e);return t+Math.ceil(t/2)}function HP(e,t,n=!1){const o=e.length,a=Zc(t),f=rb(t);if(o<16||o<f||o>1024)throw new Error(`expected ${f}-1024 bytes of input, got ${o}`);const u=n?(0,Dr.bytesToNumberBE)(e):(0,Dr.bytesToNumberLE)(e),g=xr(u,t-Pt)+Pt;return n?(0,Dr.numberToBytesLE)(g,a):(0,Dr.numberToBytesBE)(g,a)}Object.defineProperty(mf,"__esModule",{value:!0});mf.wNAF=qP;mf.validateBasic=GP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const C_=Lt,WP=vt,zP=BigInt(0),El=BigInt(1);function qP(e,t){const n=(a,f)=>{const u=f.negate();return a?u:f},o=a=>{const f=Math.ceil(t/a)+1,u=2**(a-1);return{windows:f,windowSize:u}};return{constTimeNegate:n,unsafeLadder(a,f){let u=e.ZERO,g=a;for(;f>zP;)f&El&&(u=u.add(g)),g=g.double(),f>>=El;return u},precomputeWindow(a,f){const{windows:u,windowSize:g}=o(f),d=[];let h=a,_=h;for(let E=0;E<u;E++){_=h,d.push(_);for(let v=1;v<g;v++)_=_.add(h),d.push(_);h=_.double()}return d},wNAF(a,f,u){const{windows:g,windowSize:d}=o(a);let h=e.ZERO,_=e.BASE;const E=BigInt(2**a-1),v=2**a,y=BigInt(a);for(let B=0;B<g;B++){const D=B*d;let j=Number(u&E);u>>=y,j>d&&(j-=v,u+=El);const q=D,H=D+Math.abs(j)-1,L=B%2!==0,P=j<0;j===0?_=_.add(n(L,f[q])):h=h.add(n(P,f[H]))}return{p:h,f:_}},wNAFCached(a,f,u,g){const d=a._WINDOW_SIZE||1;let h=f.get(a);return h||(h=this.precomputeWindow(a,d),d!==1&&f.set(a,g(h))),this.wNAF(d,h,u)}}}function GP(e){return(0,C_.validateField)(e.Fp),(0,WP.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,C_.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=y,e.weierstrass=D,e.SWUFpSqrtRatio=j,e.mapToCurveSimpleSWU=q;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t=mf,n=Lt,o=vt,a=vt;function f(H){const L=(0,t.validateBasic)(H);o.validateObject(L,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:P,Fp:K,a:ae}=L;if(P){if(!K.eql(ae,K.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof P!="object"||typeof P.beta!="bigint"||typeof P.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...L})}const{bytesToNumberBE:u,hexToBytes:g}=o;e.DER={Err:class extends Error{constructor(L=""){super(L)}},_parseInt(H){const{Err:L}=e.DER;if(H.length<2||H[0]!==2)throw new L("Invalid signature integer tag");const P=H[1],K=H.subarray(2,P+2);if(!P||K.length!==P)throw new L("Invalid signature integer: wrong length");if(K[0]&128)throw new L("Invalid signature integer: negative");if(K[0]===0&&!(K[1]&128))throw new L("Invalid signature integer: unnecessary leading zero");return{d:u(K),l:H.subarray(P+2)}},toSig(H){const{Err:L}=e.DER,P=typeof H=="string"?g(H):H;o.abytes(P);let K=P.length;if(K<2||P[0]!=48)throw new L("Invalid signature tag");if(P[1]!==K-2)throw new L("Invalid signature: incorrect length");const{d:ae,l:oe}=e.DER._parseInt(P.subarray(2)),{d:be,l:de}=e.DER._parseInt(oe);if(de.length)throw new L("Invalid signature: left bytes after parsing");return{r:ae,s:be}},hexFromSig(H){const L=ve=>Number.parseInt(ve[0],16)&8?"00"+ve:ve,P=ve=>{const R=ve.toString(16);return R.length&1?`0${R}`:R},K=L(P(H.s)),ae=L(P(H.r)),oe=K.length/2,be=ae.length/2,de=P(oe),Oe=P(be);return`30${P(be+oe+4)}02${Oe}${ae}02${de}${K}`}};const d=BigInt(0),h=BigInt(1),_=BigInt(2),E=BigInt(3),v=BigInt(4);function y(H){const L=f(H),{Fp:P}=L,K=L.toBytes||((X,k,J)=>{const x=k.toAffine();return o.concatBytes(Uint8Array.from([4]),P.toBytes(x.x),P.toBytes(x.y))}),ae=L.fromBytes||(X=>{const k=X.subarray(1),J=P.fromBytes(k.subarray(0,P.BYTES)),x=P.fromBytes(k.subarray(P.BYTES,2*P.BYTES));return{x:J,y:x}});function oe(X){const{a:k,b:J}=L,x=P.sqr(X),z=P.mul(x,X);return P.add(P.add(z,P.mul(X,k)),J)}if(!P.eql(P.sqr(L.Gy),oe(L.Gx)))throw new Error("bad generator point: equation left != right");function be(X){return typeof X=="bigint"&&d<X&&X<L.n}function de(X){if(!be(X))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function Oe(X){const{allowedPrivateKeyLengths:k,nByteLength:J,wrapPrivateKey:x,n:z}=L;if(k&&typeof X!="bigint"){if(o.isBytes(X)&&(X=o.bytesToHex(X)),typeof X!="string"||!k.includes(X.length))throw new Error("Invalid key");X=X.padStart(J*2,"0")}let re;try{re=typeof X=="bigint"?X:o.bytesToNumberBE((0,a.ensureBytes)("private key",X,J))}catch{throw new Error(`private key must be ${J} bytes, hex or bigint, not ${typeof X}`)}return x&&(re=n.mod(re,z)),de(re),re}const ve=new Map;function R(X){if(!(X instanceof T))throw new Error("ProjectivePoint expected")}class T{constructor(k,J,x){if(this.px=k,this.py=J,this.pz=x,k==null||!P.isValid(k))throw new Error("x required");if(J==null||!P.isValid(J))throw new Error("y required");if(x==null||!P.isValid(x))throw new Error("z required")}static fromAffine(k){const{x:J,y:x}=k||{};if(!k||!P.isValid(J)||!P.isValid(x))throw new Error("invalid affine point");if(k instanceof T)throw new Error("projective point not allowed");const z=re=>P.eql(re,P.ZERO);return z(J)&&z(x)?T.ZERO:new T(J,x,P.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(k){const J=P.invertBatch(k.map(x=>x.pz));return k.map((x,z)=>x.toAffine(J[z])).map(T.fromAffine)}static fromHex(k){const J=T.fromAffine(ae((0,a.ensureBytes)("pointHex",k)));return J.assertValidity(),J}static fromPrivateKey(k){return T.BASE.multiply(Oe(k))}_setWindowSize(k){this._WINDOW_SIZE=k,ve.delete(this)}assertValidity(){if(this.is0()){if(L.allowInfinityPoint&&!P.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:k,y:J}=this.toAffine();if(!P.isValid(k)||!P.isValid(J))throw new Error("bad point: x or y not FE");const x=P.sqr(J),z=oe(k);if(!P.eql(x,z))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:k}=this.toAffine();if(P.isOdd)return!P.isOdd(k);throw new Error("Field doesn't support isOdd")}equals(k){R(k);const{px:J,py:x,pz:z}=this,{px:re,py:he,pz:ee}=k,ye=P.eql(P.mul(J,ee),P.mul(re,z)),_e=P.eql(P.mul(x,ee),P.mul(he,z));return ye&&_e}negate(){return new T(this.px,P.neg(this.py),this.pz)}double(){const{a:k,b:J}=L,x=P.mul(J,E),{px:z,py:re,pz:he}=this;let ee=P.ZERO,ye=P.ZERO,_e=P.ZERO,Re=P.mul(z,z),Fe=P.mul(re,re),Le=P.mul(he,he),$e=P.mul(z,re);return $e=P.add($e,$e),_e=P.mul(z,he),_e=P.add(_e,_e),ee=P.mul(k,_e),ye=P.mul(x,Le),ye=P.add(ee,ye),ee=P.sub(Fe,ye),ye=P.add(Fe,ye),ye=P.mul(ee,ye),ee=P.mul($e,ee),_e=P.mul(x,_e),Le=P.mul(k,Le),$e=P.sub(Re,Le),$e=P.mul(k,$e),$e=P.add($e,_e),_e=P.add(Re,Re),Re=P.add(_e,Re),Re=P.add(Re,Le),Re=P.mul(Re,$e),ye=P.add(ye,Re),Le=P.mul(re,he),Le=P.add(Le,Le),Re=P.mul(Le,$e),ee=P.sub(ee,Re),_e=P.mul(Le,Fe),_e=P.add(_e,_e),_e=P.add(_e,_e),new T(ee,ye,_e)}add(k){R(k);const{px:J,py:x,pz:z}=this,{px:re,py:he,pz:ee}=k;let ye=P.ZERO,_e=P.ZERO,Re=P.ZERO;const Fe=L.a,Le=P.mul(L.b,E);let $e=P.mul(J,re),Qe=P.mul(x,he),Ke=P.mul(z,ee),We=P.add(J,x),$=P.add(re,he);We=P.mul(We,$),$=P.add($e,Qe),We=P.sub(We,$),$=P.add(J,z);let U=P.add(re,ee);return $=P.mul($,U),U=P.add($e,Ke),$=P.sub($,U),U=P.add(x,z),ye=P.add(he,ee),U=P.mul(U,ye),ye=P.add(Qe,Ke),U=P.sub(U,ye),Re=P.mul(Fe,$),ye=P.mul(Le,Ke),Re=P.add(ye,Re),ye=P.sub(Qe,Re),Re=P.add(Qe,Re),_e=P.mul(ye,Re),Qe=P.add($e,$e),Qe=P.add(Qe,$e),Ke=P.mul(Fe,Ke),$=P.mul(Le,$),Qe=P.add(Qe,Ke),Ke=P.sub($e,Ke),Ke=P.mul(Fe,Ke),$=P.add($,Ke),$e=P.mul(Qe,$),_e=P.add(_e,$e),$e=P.mul(U,$),ye=P.mul(We,ye),ye=P.sub(ye,$e),$e=P.mul(We,Qe),Re=P.mul(U,Re),Re=P.add(Re,$e),new T(ye,_e,Re)}subtract(k){return this.add(k.negate())}is0(){return this.equals(T.ZERO)}wNAF(k){return M.wNAFCached(this,ve,k,J=>{const x=P.invertBatch(J.map(z=>z.pz));return J.map((z,re)=>z.toAffine(x[re])).map(T.fromAffine)})}multiplyUnsafe(k){const J=T.ZERO;if(k===d)return J;if(de(k),k===h)return this;const{endo:x}=L;if(!x)return M.unsafeLadder(this,k);let{k1neg:z,k1:re,k2neg:he,k2:ee}=x.splitScalar(k),ye=J,_e=J,Re=this;for(;re>d||ee>d;)re&h&&(ye=ye.add(Re)),ee&h&&(_e=_e.add(Re)),Re=Re.double(),re>>=h,ee>>=h;return z&&(ye=ye.negate()),he&&(_e=_e.negate()),_e=new T(P.mul(_e.px,x.beta),_e.py,_e.pz),ye.add(_e)}multiply(k){de(k);let J=k,x,z;const{endo:re}=L;if(re){const{k1neg:he,k1:ee,k2neg:ye,k2:_e}=re.splitScalar(J);let{p:Re,f:Fe}=this.wNAF(ee),{p:Le,f:$e}=this.wNAF(_e);Re=M.constTimeNegate(he,Re),Le=M.constTimeNegate(ye,Le),Le=new T(P.mul(Le.px,re.beta),Le.py,Le.pz),x=Re.add(Le),z=Fe.add($e)}else{const{p:he,f:ee}=this.wNAF(J);x=he,z=ee}return T.normalizeZ([x,z])[0]}multiplyAndAddUnsafe(k,J,x){const z=T.BASE,re=(ee,ye)=>ye===d||ye===h||!ee.equals(z)?ee.multiplyUnsafe(ye):ee.multiply(ye),he=re(this,J).add(re(k,x));return he.is0()?void 0:he}toAffine(k){const{px:J,py:x,pz:z}=this,re=this.is0();k==null&&(k=re?P.ONE:P.inv(z));const he=P.mul(J,k),ee=P.mul(x,k),ye=P.mul(z,k);if(re)return{x:P.ZERO,y:P.ZERO};if(!P.eql(ye,P.ONE))throw new Error("invZ was invalid");return{x:he,y:ee}}isTorsionFree(){const{h:k,isTorsionFree:J}=L;if(k===h)return!0;if(J)return J(T,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:k,clearCofactor:J}=L;return k===h?this:J?J(T,this):this.multiplyUnsafe(L.h)}toRawBytes(k=!0){return this.assertValidity(),K(T,this,k)}toHex(k=!0){return o.bytesToHex(this.toRawBytes(k))}}T.BASE=new T(L.Gx,L.Gy,P.ONE),T.ZERO=new T(P.ZERO,P.ONE,P.ZERO);const I=L.nBitLength,M=(0,t.wNAF)(T,L.endo?Math.ceil(I/2):I);return{CURVE:L,ProjectivePoint:T,normPrivateKeyToScalar:Oe,weierstrassEquation:oe,isWithinCurveOrder:be}}function B(H){const L=(0,t.validateBasic)(H);return o.validateObject(L,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...L})}function D(H){const L=B(H),{Fp:P,n:K}=L,ae=P.BYTES+1,oe=2*P.BYTES+1;function be($){return d<$&&$<P.ORDER}function de($){return n.mod($,K)}function Oe($){return n.invert($,K)}const{ProjectivePoint:ve,normPrivateKeyToScalar:R,weierstrassEquation:T,isWithinCurveOrder:I}=y({...L,toBytes($,U,ne){const Ie=U.toAffine(),we=P.toBytes(Ie.x),Ne=o.concatBytes;return ne?Ne(Uint8Array.from([U.hasEvenY()?2:3]),we):Ne(Uint8Array.from([4]),we,P.toBytes(Ie.y))},fromBytes($){const U=$.length,ne=$[0],Ie=$.subarray(1);if(U===ae&&(ne===2||ne===3)){const we=o.bytesToNumberBE(Ie);if(!be(we))throw new Error("Point is not on curve");const Ne=T(we);let qe;try{qe=P.sqrt(Ne)}catch(xe){const st=xe instanceof Error?": "+xe.message:"";throw new Error("Point is not on curve"+st)}const He=(qe&h)===h;return(ne&1)===1!==He&&(qe=P.neg(qe)),{x:we,y:qe}}else if(U===oe&&ne===4){const we=P.fromBytes(Ie.subarray(0,P.BYTES)),Ne=P.fromBytes(Ie.subarray(P.BYTES,2*P.BYTES));return{x:we,y:Ne}}else throw new Error(`Point of length ${U} was invalid. Expected ${ae} compressed bytes or ${oe} uncompressed bytes`)}}),M=$=>o.bytesToHex(o.numberToBytesBE($,L.nByteLength));function X($){const U=K>>h;return $>U}function k($){return X($)?de(-$):$}const J=($,U,ne)=>o.bytesToNumberBE($.slice(U,ne));class x{constructor(U,ne,Ie){this.r=U,this.s=ne,this.recovery=Ie,this.assertValidity()}static fromCompact(U){const ne=L.nByteLength;return U=(0,a.ensureBytes)("compactSignature",U,ne*2),new x(J(U,0,ne),J(U,ne,2*ne))}static fromDER(U){const{r:ne,s:Ie}=e.DER.toSig((0,a.ensureBytes)("DER",U));return new x(ne,Ie)}assertValidity(){if(!I(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!I(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(U){return new x(this.r,this.s,U)}recoverPublicKey(U){const{r:ne,s:Ie,recovery:we}=this,Ne=_e((0,a.ensureBytes)("msgHash",U));if(we==null||![0,1,2,3].includes(we))throw new Error("recovery id invalid");const qe=we===2||we===3?ne+L.n:ne;if(qe>=P.ORDER)throw new Error("recovery id 2 or 3 invalid");const He=we&1?"03":"02",et=ve.fromHex(He+M(qe)),xe=Oe(qe),st=de(-Ne*xe),xt=de(Ie*xe),gt=ve.BASE.multiplyAndAddUnsafe(et,st,xt);if(!gt)throw new Error("point at infinify");return gt.assertValidity(),gt}hasHighS(){return X(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,de(-this.s),this.recovery):this}toDERRawBytes(){return o.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return o.hexToBytes(this.toCompactHex())}toCompactHex(){return M(this.r)+M(this.s)}}const z={isValidPrivateKey($){try{return R($),!0}catch{return!1}},normPrivateKeyToScalar:R,randomPrivateKey:()=>{const $=n.getMinHashLength(L.n);return n.mapHashToField(L.randomBytes($),L.n)},precompute($=8,U=ve.BASE){return U._setWindowSize($),U.multiply(BigInt(3)),U}};function re($,U=!0){return ve.fromPrivateKey($).toRawBytes(U)}function he($){const U=o.isBytes($),ne=typeof $=="string",Ie=(U||ne)&&$.length;return U?Ie===ae||Ie===oe:ne?Ie===2*ae||Ie===2*oe:$ instanceof ve}function ee($,U,ne=!0){if(he($))throw new Error("first arg must be private key");if(!he(U))throw new Error("second arg must be public key");return ve.fromHex(U).multiply(R($)).toRawBytes(ne)}const ye=L.bits2int||function($){const U=o.bytesToNumberBE($),ne=$.length*8-L.nBitLength;return ne>0?U>>BigInt(ne):U},_e=L.bits2int_modN||function($){return de(ye($))},Re=o.bitMask(L.nBitLength);function Fe($){if(typeof $!="bigint")throw new Error("bigint expected");if(!(d<=$&&$<Re))throw new Error(`bigint expected < 2^${L.nBitLength}`);return o.numberToBytesBE($,L.nByteLength)}function Le($,U,ne=$e){if(["recovered","canonical"].some(St=>St in ne))throw new Error("sign() legacy options not supported");const{hash:Ie,randomBytes:we}=L;let{lowS:Ne,prehash:qe,extraEntropy:He}=ne;Ne==null&&(Ne=!0),$=(0,a.ensureBytes)("msgHash",$),qe&&($=(0,a.ensureBytes)("prehashed msgHash",Ie($)));const et=_e($),xe=R(U),st=[Fe(xe),Fe(et)];if(He!=null&&He!==!1){const St=He===!0?we(P.BYTES):He;st.push((0,a.ensureBytes)("extraEntropy",St))}const xt=o.concatBytes(...st),gt=et;function ir(St){const ft=ye(St);if(!I(ft))return;const Nt=Oe(ft),Dt=ve.BASE.multiply(ft).toAffine(),A=de(Dt.x);if(A===d)return;const me=de(Nt*de(gt+A*xe));if(me===d)return;let Ce=(Dt.x===A?0:2)|Number(Dt.y&h),De=me;return Ne&&X(me)&&(De=k(me),Ce^=1),new x(A,De,Ce)}return{seed:xt,k2sig:ir}}const $e={lowS:L.lowS,prehash:!1},Qe={lowS:L.lowS,prehash:!1};function Ke($,U,ne=$e){const{seed:Ie,k2sig:we}=Le($,U,ne),Ne=L;return o.createHmacDrbg(Ne.hash.outputLen,Ne.nByteLength,Ne.hmac)(Ie,we)}ve.BASE._setWindowSize(8);function We($,U,ne,Ie=Qe){var Dt;const we=$;if(U=(0,a.ensureBytes)("msgHash",U),ne=(0,a.ensureBytes)("publicKey",ne),"strict"in Ie)throw new Error("options.strict was renamed to lowS");const{lowS:Ne,prehash:qe}=Ie;let He,et;try{if(typeof we=="string"||o.isBytes(we))try{He=x.fromDER(we)}catch(A){if(!(A instanceof e.DER.Err))throw A;He=x.fromCompact(we)}else if(typeof we=="object"&&typeof we.r=="bigint"&&typeof we.s=="bigint"){const{r:A,s:me}=we;He=new x(A,me)}else throw new Error("PARSE");et=ve.fromHex(ne)}catch(A){if(A.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Ne&&He.hasHighS())return!1;qe&&(U=L.hash(U));const{r:xe,s:st}=He,xt=_e(U),gt=Oe(st),ir=de(xt*gt),St=de(xe*gt),ft=(Dt=ve.BASE.multiplyAndAddUnsafe(et,ir,St))==null?void 0:Dt.toAffine();return ft?de(ft.x)===xe:!1}return{CURVE:L,getPublicKey:re,getSharedSecret:ee,sign:Ke,verify:We,ProjectivePoint:ve,Signature:x,utils:z}}function j(H,L){const P=H.ORDER;let K=d;for(let X=P-h;X%_===d;X/=_)K+=h;const ae=K,oe=_<<ae-h-h,be=oe*_,de=(P-h)/be,Oe=(de-h)/_,ve=be-h,R=oe,T=H.pow(L,de),I=H.pow(L,(de+h)/_);let M=(X,k)=>{let J=T,x=H.pow(k,ve),z=H.sqr(x);z=H.mul(z,k);let re=H.mul(X,z);re=H.pow(re,Oe),re=H.mul(re,x),x=H.mul(re,k),z=H.mul(re,X);let he=H.mul(z,x);re=H.pow(he,R);let ee=H.eql(re,H.ONE);x=H.mul(z,I),re=H.mul(he,J),z=H.cmov(x,z,ee),he=H.cmov(re,he,ee);for(let ye=ae;ye>h;ye--){let _e=ye-_;_e=_<<_e-h;let Re=H.pow(he,_e);const Fe=H.eql(Re,H.ONE);x=H.mul(z,J),J=H.mul(J,J),Re=H.mul(he,J),z=H.cmov(x,z,Fe),he=H.cmov(Re,he,Fe)}return{isValid:ee,value:z}};if(H.ORDER%v===E){const X=(H.ORDER-E)/v,k=H.sqrt(H.neg(L));M=(J,x)=>{let z=H.sqr(x);const re=H.mul(J,x);z=H.mul(z,re);let he=H.pow(z,X);he=H.mul(he,re);const ee=H.mul(he,k),ye=H.mul(H.sqr(he),x),_e=H.eql(ye,J);let Re=H.cmov(ee,he,_e);return{isValid:_e,value:Re}}}return M}function q(H,L){if(n.validateField(H),!H.isValid(L.A)||!H.isValid(L.B)||!H.isValid(L.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const P=j(H,L.Z);if(!H.isOdd)throw new Error("Fp.isOdd is not implemented!");return K=>{let ae,oe,be,de,Oe,ve,R,T;ae=H.sqr(K),ae=H.mul(ae,L.Z),oe=H.sqr(ae),oe=H.add(oe,ae),be=H.add(oe,H.ONE),be=H.mul(be,L.B),de=H.cmov(L.Z,H.neg(oe),!H.eql(oe,H.ZERO)),de=H.mul(de,L.A),oe=H.sqr(be),ve=H.sqr(de),Oe=H.mul(ve,L.A),oe=H.add(oe,Oe),oe=H.mul(oe,be),ve=H.mul(ve,de),Oe=H.mul(ve,L.B),oe=H.add(oe,Oe),R=H.mul(ae,be);const{isValid:I,value:M}=P(oe,ve);T=H.mul(ae,K),T=H.mul(T,M),R=H.cmov(R,be,I),T=H.cmov(T,M,I);const X=H.isOdd(K)===H.isOdd(T);return T=H.cmov(H.neg(T),T,X),R=H.div(R,de),{x:R,y:T}}}})(zc);Object.defineProperty(yf,"__esModule",{value:!0});yf.getHash=nb;yf.createCurve=KP;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const VP=gP,P_=wr.require$$1,ZP=zc;function nb(e){return{hash:e,hmac:(t,...n)=>(0,VP.hmac)(e,t,(0,P_.concatBytes)(...n)),randomBytes:P_.randomBytes}}function KP(e,t){const n=o=>(0,ZP.weierstrass)({...e,...nb(o)});return Object.freeze({...n(t),create:n})}var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});Ni.expand_message_xmd=ib;Ni.expand_message_xof=ob;Ni.hash_to_field=rc;Ni.isogenyMap=QP;Ni.createHasher=eL;const JP=Lt,cr=vt,XP=cr.bytesToNumberBE;function ri(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const n=Array.from({length:t}).fill(0);for(let o=t-1;o>=0;o--)n[o]=e&255,e>>>=8;return new Uint8Array(n)}function YP(e,t){const n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e[o]^t[o];return n}function Kc(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function ib(e,t,n,o){(0,cr.abytes)(e),(0,cr.abytes)(t),Kc(n),t.length>255&&(t=o((0,cr.concatBytes)((0,cr.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:a,blockLen:f}=o,u=Math.ceil(n/a);if(u>255)throw new Error("Invalid xmd length");const g=(0,cr.concatBytes)(t,ri(t.length,1)),d=ri(0,f),h=ri(n,2),_=new Array(u),E=o((0,cr.concatBytes)(d,e,h,ri(0,1),g));_[0]=o((0,cr.concatBytes)(E,ri(1,1),g));for(let y=1;y<=u;y++){const B=[YP(E,_[y-1]),ri(y+1,1),g];_[y]=o((0,cr.concatBytes)(...B))}return(0,cr.concatBytes)(..._).slice(0,n)}function ob(e,t,n,o,a){if((0,cr.abytes)(e),(0,cr.abytes)(t),Kc(n),t.length>255){const f=Math.ceil(2*o/8);t=a.create({dkLen:f}).update((0,cr.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return a.create({dkLen:n}).update(e).update(ri(n,2)).update(t).update(ri(t.length,1)).digest()}function rc(e,t,n){(0,cr.validateObject)(n,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:o,k:a,m:f,hash:u,expand:g,DST:d}=n;(0,cr.abytes)(e),Kc(t);const h=typeof d=="string"?(0,cr.utf8ToBytes)(d):d,_=o.toString(2).length,E=Math.ceil((_+a)/8),v=t*f*E;let y;if(g==="xmd")y=ib(e,h,v,u);else if(g==="xof")y=ob(e,h,v,a,u);else if(g==="_internal_pass")y=e;else throw new Error('expand must be "xmd" or "xof"');const B=new Array(t);for(let D=0;D<t;D++){const j=new Array(f);for(let q=0;q<f;q++){const H=E*(q+D*f),L=y.subarray(H,H+E);j[q]=(0,JP.mod)(XP(L),o)}B[D]=j}return B}function QP(e,t){const n=t.map(o=>Array.from(o).reverse());return(o,a)=>{const[f,u,g,d]=n.map(h=>h.reduce((_,E)=>e.add(e.mul(_,o),E)));return o=e.div(f,u),a=e.mul(a,e.div(g,d)),{x:o,y:a}}}function eL(e,t,n){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(o,a){const f=rc(o,2,{...n,DST:n.DST,...a}),u=e.fromAffine(t(f[0])),g=e.fromAffine(t(f[1])),d=u.add(g).clearCofactor();return d.assertValidity(),d},encodeToCurve(o,a){const f=rc(o,1,{...n,DST:n.encodeDST,...a}),u=e.fromAffine(t(f[0])).clearCofactor();return u.assertValidity(),u},mapToCurve(o){if(!Array.isArray(o))throw new Error("mapToCurve: expected array of bigints");for(const f of o)if(typeof f!="bigint")throw new Error(`mapToCurve: expected array of bigints, got ${f} in array`);const a=e.fromAffine(t(o)).clearCofactor();return a.assertValidity(),a}}}(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=a0.require$$0,n=wr.require$$1,o=yf,a=Ni,f=Lt,u=vt,g=zc,d=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),h=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_=BigInt(1),E=BigInt(2),v=(x,z)=>(x+z/E)/z;function y(x){const z=d,re=BigInt(3),he=BigInt(6),ee=BigInt(11),ye=BigInt(22),_e=BigInt(23),Re=BigInt(44),Fe=BigInt(88),Le=x*x*x%z,$e=Le*Le*x%z,Qe=(0,f.pow2)($e,re,z)*$e%z,Ke=(0,f.pow2)(Qe,re,z)*$e%z,We=(0,f.pow2)(Ke,E,z)*Le%z,$=(0,f.pow2)(We,ee,z)*We%z,U=(0,f.pow2)($,ye,z)*$%z,ne=(0,f.pow2)(U,Re,z)*U%z,Ie=(0,f.pow2)(ne,Fe,z)*ne%z,we=(0,f.pow2)(Ie,Re,z)*U%z,Ne=(0,f.pow2)(we,re,z)*$e%z,qe=(0,f.pow2)(Ne,_e,z)*$%z,He=(0,f.pow2)(qe,he,z)*Le%z,et=(0,f.pow2)(He,E,z);if(!B.eql(B.sqr(et),x))throw new Error("Cannot find square root");return et}const B=(0,f.Field)(d,void 0,void 0,{sqrt:y});e.secp256k1=(0,o.createCurve)({a:BigInt(0),b:BigInt(7),Fp:B,n:h,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:x=>{const z=h,re=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),he=-_*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),ee=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ye=re,_e=BigInt("0x100000000000000000000000000000000"),Re=v(ye*x,z),Fe=v(-he*x,z);let Le=(0,f.mod)(x-Re*re-Fe*ee,z),$e=(0,f.mod)(-Re*he-Fe*ye,z);const Qe=Le>_e,Ke=$e>_e;if(Qe&&(Le=z-Le),Ke&&($e=z-$e),Le>_e||$e>_e)throw new Error("splitScalar: Endomorphism failed, k="+x);return{k1neg:Qe,k1:Le,k2neg:Ke,k2:$e}}}},t.sha256);const D=BigInt(0),j=x=>typeof x=="bigint"&&D<x&&x<d,q=x=>typeof x=="bigint"&&D<x&&x<h,H={};function L(x,...z){let re=H[x];if(re===void 0){const he=(0,t.sha256)(Uint8Array.from(x,ee=>ee.charCodeAt(0)));re=(0,u.concatBytes)(he,he),H[x]=re}return(0,t.sha256)((0,u.concatBytes)(re,...z))}const P=x=>x.toRawBytes(!0).slice(1),K=x=>(0,u.numberToBytesBE)(x,32),ae=x=>(0,f.mod)(x,d),oe=x=>(0,f.mod)(x,h),be=e.secp256k1.ProjectivePoint,de=(x,z,re)=>be.BASE.multiplyAndAddUnsafe(x,z,re);function Oe(x){let z=e.secp256k1.utils.normPrivateKeyToScalar(x),re=be.fromPrivateKey(z);return{scalar:re.hasEvenY()?z:oe(-z),bytes:P(re)}}function ve(x){if(!j(x))throw new Error("bad x: need 0 < x < p");const z=ae(x*x),re=ae(z*x+BigInt(7));let he=y(re);he%E!==D&&(he=ae(-he));const ee=new be(x,he,_);return ee.assertValidity(),ee}function R(...x){return oe((0,u.bytesToNumberBE)(L("BIP0340/challenge",...x)))}function T(x){return Oe(x).bytes}function I(x,z,re=(0,n.randomBytes)(32)){const he=(0,u.ensureBytes)("message",x),{bytes:ee,scalar:ye}=Oe(z),_e=(0,u.ensureBytes)("auxRand",re,32),Re=K(ye^(0,u.bytesToNumberBE)(L("BIP0340/aux",_e))),Fe=L("BIP0340/nonce",Re,ee,he),Le=oe((0,u.bytesToNumberBE)(Fe));if(Le===D)throw new Error("sign failed: k is zero");const{bytes:$e,scalar:Qe}=Oe(Le),Ke=R($e,ee,he),We=new Uint8Array(64);if(We.set($e,0),We.set(K(oe(Qe+Ke*ye)),32),!M(We,he,ee))throw new Error("sign: Invalid signature produced");return We}function M(x,z,re){const he=(0,u.ensureBytes)("signature",x,64),ee=(0,u.ensureBytes)("message",z),ye=(0,u.ensureBytes)("publicKey",re,32);try{const _e=ve((0,u.bytesToNumberBE)(ye)),Re=(0,u.bytesToNumberBE)(he.subarray(0,32));if(!j(Re))return!1;const Fe=(0,u.bytesToNumberBE)(he.subarray(32,64));if(!q(Fe))return!1;const Le=R(K(Re),P(_e),ee),$e=de(_e,Fe,oe(-Le));return!(!$e||!$e.hasEvenY()||$e.toAffine().x!==Re)}catch{return!1}}e.schnorr={getPublicKey:T,sign:I,verify:M,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:ve,pointToBytes:P,numberToBytesBE:u.numberToBytesBE,bytesToNumberBE:u.bytesToNumberBE,taggedHash:L,mod:f.mod}};const X=(0,a.isogenyMap)(B,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(x=>x.map(z=>BigInt(z)))),k=(0,g.mapToCurveSimpleSWU)(B,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:B.create(BigInt("-11"))}),J=(0,a.createHasher)(e.secp256k1.ProjectivePoint,x=>{const{x:z,y:re}=k(B.create(x[0]));return X(z,re)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:B.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=J.hashToCurve,e.encodeToCurve=J.encodeToCurve})(Gp);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var t=Gp;Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return t.secp256k1}})})(wf);(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=V.bufferPolyfill,n=wf;e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=n.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=n.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})(bf);var Af={};Object.defineProperty(Af,"__esModule",{value:!0});Af.GWEI_TO_WEI=void 0;Af.GWEI_TO_WEI=BigInt(1e9);var Jc={},mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.RLP=mn.utils=mn.decode=mn.encode=void 0;function Xc(e){if(Array.isArray(e)){const n=[];let o=0;for(let a=0;a<e.length;a++){const f=Xc(e[a]);n.push(f),o+=f.length}return ic(N_(o,192),...n)}const t=cb(e);return t.length===1&&t[0]<128?t:ic(N_(t.length,128),t)}mn.encode=Xc;function to(e,t,n){if(n>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,n)}function L_(e){if(e[0]===0)throw new Error("invalid RLP: extra zeros");return fb(ab(e))}function N_(e,t){if(e<56)return Uint8Array.from([e+t]);const n=oc(e),o=n.length/2,a=oc(t+55+o);return Uint8Array.from(Wa(a+n))}function sb(e,t=!1){if(typeof e>"u"||e===null||e.length===0)return Uint8Array.from([]);const n=cb(e),o=nc(n);if(t)return o;if(o.remainder.length!==0)throw new Error("invalid RLP: remainder must be zero");return o.data}mn.decode=sb;function nc(e){let t,n,o,a,f;const u=[],g=e[0];if(g<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(g<=183){if(t=g-127,g===128?o=Uint8Array.from([]):o=to(e,1,t),t===2&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:e.slice(t)}}else if(g<=191){if(n=g-182,e.length-1<n)throw new Error("invalid RLP: not enough bytes for string length");if(t=L_(to(e,1,n)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=to(e,n,t+n),{data:o,remainder:e.slice(t+n)}}else if(g<=247){for(t=g-191,a=to(e,1,t);a.length;)f=nc(a),u.push(f.data),a=f.remainder;return{data:u,remainder:e.slice(t)}}else{if(n=g-246,t=L_(to(e,1,n)),t<56)throw new Error("invalid RLP: encoded list too short");const d=n+t;if(d>e.length)throw new Error("invalid RLP: total length is larger than the data");for(a=to(e,n,d);a.length;)f=nc(a),u.push(f.data),a=f.remainder;return{data:u,remainder:e.slice(d)}}}const tL=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ab(e){let t="";for(let n=0;n<e.length;n++)t+=tL[e[n]];return t}function fb(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function Wa(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 n=0;n<t.length;n++){const o=n*2;t[n]=fb(e.slice(o,o+2))}return t}function ic(...e){if(e.length===1)return e[0];const t=e.reduce((o,a)=>o+a.length,0),n=new Uint8Array(t);for(let o=0,a=0;o<e.length;o++){const f=e[o];n.set(f,a),a+=f.length}return n}function ub(e){return new TextEncoder().encode(e)}function oc(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 rL(e){return e.length%2?`0${e}`:e}function lb(e){return e.length>=2&&e[0]==="0"&&e[1]==="x"}function nL(e){return typeof e!="string"?e:lb(e)?e.slice(2):e}function cb(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return lb(e)?Wa(rL(nL(e))):ub(e);if(typeof e=="number"||typeof e=="bigint")return e?Wa(oc(e)):Uint8Array.from([]);if(e==null)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}mn.utils={bytesToHex:ab,concatBytes:ic,hexToBytes:Wa,utf8ToBytes:ub};mn.RLP={encode:Xc,decode:sb};var an={},za={exports:{}};const iL=V.getAugmentedNamespace(V._assert);za.exports;(function(e,t){var n=V.commonjsGlobal&&V.commonjsGlobal.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0,t.bytesToUtf8=d,t.hexToBytes=h,t.equalsBytes=_,t.wrapHash=E;const o=n(iL),a=wr.require$$1,f=o.default.bool;t.assertBool=f;const u=o.default.bytes;t.assertBytes=u;var g=wr.require$$1;Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return g.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return g.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return g.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return g.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return g.utf8ToBytes}});function d(v){if(!(v instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof v}`);return new TextDecoder().decode(v)}function h(v){const y=v.startsWith("0x")?v.substring(2):v;return(0,a.hexToBytes)(y)}function _(v,y){if(v.length!==y.length)return!1;for(let B=0;B<v.length;B++)if(v[B]!==y[B])return!1;return!0}function E(v){return y=>(o.default.bytes(y),v(y))}t.crypto=(()=>{const v=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,y=typeof V.commonjsRequire=="function"&&V.commonjsRequire.bind(e);return{node:y&&!v?y("crypto"):void 0,web:v}})()})(za,za.exports);var db=za.exports;Object.defineProperty(an,"__esModule",{value:!0});an.keccak512=an.keccak384=an.keccak256=an.keccak224=void 0;const ss=a0.require$$0$1,If=db;an.keccak224=(0,If.wrapHash)(ss.keccak_224);an.keccak256=(()=>{const e=(0,If.wrapHash)(ss.keccak_256);return e.create=ss.keccak_256.create,e})();an.keccak384=(0,If.wrapHash)(ss.keccak_384);an.keccak512=(0,If.wrapHash)(ss.keccak_512);var Bi={},Kr={},Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.isHexString=Ct.getKeys=Ct.fromAscii=Ct.fromUtf8=Ct.toAscii=Ct.arrayContainsArray=Ct.getBinarySize=Ct.padToEven=Ct.stripHexPrefix=Ct.isHexPrefixed=void 0;function hb(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"}Ct.isHexPrefixed=hb;const oL=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return hb(e)?e.slice(2):e};Ct.stripHexPrefix=oL;function gb(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}Ct.padToEven=gb;function sL(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return V.dist.Buffer.byteLength(e,"utf8")}Ct.getBinarySize=sL;function aL(e,t,n){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[n===!0?"some":"every"](o=>e.indexOf(o)>=0)}Ct.arrayContainsArray=aL;function fL(e){let t="",n=0;const o=e.length;for(e.substring(0,2)==="0x"&&(n=2);n<o;n+=2){const a=parseInt(e.substr(n,2),16);t+=String.fromCharCode(a)}return t}Ct.toAscii=fL;function uL(e){const t=V.dist.Buffer.from(e,"utf8");return`0x${gb(t.toString("hex")).replace(/^0+|0+$/g,"")}`}Ct.fromUtf8=uL;function lL(e){let t="";for(let n=0;n<e.length;n++){const a=e.charCodeAt(n).toString(16);t+=a.length<2?`0${a}`:a}return`0x${t}`}Ct.fromAscii=lL;function cL(e,t,n){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 o=[];for(let a=0;a<e.length;a++){let f=e[a][t];if(n===!0&&!f)f="";else if(typeof f!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof f}`);o.push(f)}return o}Ct.getKeys=cL;function dL(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t<"u"&&t>0&&e.length!==2+2*t)}Ct.isHexString=dL;Object.defineProperty(Kr,"__esModule",{value:!0});Kr.assertIsString=Kr.assertIsArray=Kr.assertIsBuffer=Kr.assertIsHexString=void 0;const hL=Ct,gL=function(e){if(!(0,hL.isHexString)(e)){const t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}};Kr.assertIsHexString=gL;const _L=function(e){if(!V.dist.Buffer.isBuffer(e)){const t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};Kr.assertIsBuffer=_L;const pL=function(e){if(!Array.isArray(e)){const t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}};Kr.assertIsArray=pL;const bL=function(e){if(typeof e!="string"){const t=`This method only supports strings but input was: ${e}`;throw new Error(t)}};Kr.assertIsString=bL;(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=Kr,n=Ct,o=function(I){if(!Number.isSafeInteger(I)||I<0)throw new Error(`Received an invalid integer type: ${I}`);return`0x${I.toString(16)}`};e.intToHex=o;const a=function(I){const M=(0,e.intToHex)(I);return V.dist.Buffer.from((0,n.padToEven)(M.slice(2)),"hex")};e.intToBuffer=a;const f=function(I){return V.dist.Buffer.allocUnsafe(I).fill(0)};e.zeros=f;const u=function(I,M,X){const k=(0,e.zeros)(M);return X?I.length<M?(I.copy(k),k):I.slice(0,M):I.length<M?(I.copy(k,M-I.length),k):I.slice(-M)},g=function(I,M){return(0,t.assertIsBuffer)(I),u(I,M,!1)};e.setLengthLeft=g;const d=function(I,M){return(0,t.assertIsBuffer)(I),u(I,M,!0)};e.setLengthRight=d;const h=function(I){let M=I[0];for(;I.length>0&&M.toString()==="0";)I=I.slice(1),M=I[0];return I},_=function(I){return(0,t.assertIsBuffer)(I),h(I)};e.unpadBuffer=_;const E=function(I){return(0,t.assertIsArray)(I),h(I)};e.unpadArray=E;const v=function(I){return(0,t.assertIsHexString)(I),I=(0,n.stripHexPrefix)(I),"0x"+h(I)};e.unpadHexString=v;const y=function(I){if(I==null)return V.dist.Buffer.allocUnsafe(0);if(V.dist.Buffer.isBuffer(I)||Array.isArray(I)||I instanceof Uint8Array)return V.dist.Buffer.from(I);if(typeof I=="string"){if(!(0,n.isHexString)(I))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${I}`);return V.dist.Buffer.from((0,n.padToEven)((0,n.stripHexPrefix)(I)),"hex")}if(typeof I=="number")return(0,e.intToBuffer)(I);if(typeof I=="bigint"){if(I<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${I}`);let M=I.toString(16);return M.length%2&&(M="0"+M),V.dist.Buffer.from(M,"hex")}if(I.toArray)return V.dist.Buffer.from(I.toArray());if(I.toBuffer)return V.dist.Buffer.from(I.toBuffer());throw new Error("invalid type")};e.toBuffer=y;const B=function(I){return I=(0,e.toBuffer)(I),"0x"+I.toString("hex")};e.bufferToHex=B;function D(I){const M=(0,e.bufferToHex)(I);return BigInt(M==="0x"?0:M)}e.bufferToBigInt=D;function j(I){return(0,e.toBuffer)("0x"+I.toString(16))}e.bigIntToBuffer=j;const q=function(I){const M=Number(D(I));if(!Number.isSafeInteger(M))throw new Error("Number exceeds 53 bits");return M};e.bufferToInt=q;const H=function(I){return BigInt.asIntN(256,D(I))};e.fromSigned=H;const L=function(I){return j(BigInt.asUintN(256,I))};e.toUnsigned=L;const P=function(I){return typeof I!="string"||(0,n.isHexPrefixed)(I)?I:"0x"+I};e.addHexPrefix=P;function K(I,M=50){const X=V.dist.Buffer.isBuffer(I)?I.toString("hex"):I;return X.length<=M?X:X.slice(0,M)+"…"}e.short=K;const ae=function(I){const M=/^(00)+|(00)+$/g;if(I=(0,n.stripHexPrefix)(I),I.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return V.dist.Buffer.from(I.replace(M,""),"hex").toString("utf8")};e.toUtf8=ae;const oe=function(I){if(V.dist.Buffer.isBuffer(I))return`0x${I.toString("hex")}`;if(I instanceof Array){const M=[];for(let X=0;X<I.length;X++)M.push((0,e.baToJSON)(I[X]));return M}};e.baToJSON=oe;const be=function(I){for(const[M,X]of Object.entries(I))if(X!==void 0&&X.length>0&&X[0]===0)throw new Error(`${M} cannot have leading zeroes, received: ${X.toString("hex")}`)};e.validateNoLeadingZeroes=be;function de(I){return Array.isArray(I)?I.map(M=>de(M)):V.dist.Buffer.from(I)}e.arrToBufArr=de;function Oe(I){return Array.isArray(I)?I.map(M=>Oe(M)):Uint8Array.from(I??[])}e.bufArrToArr=Oe;const ve=I=>"0x"+I.toString(16);e.bigIntToHex=ve;function R(I){return(0,e.unpadBuffer)(j(I))}e.bigIntToUnpaddedBuffer=R;function T(I){return(0,e.unpadBuffer)((0,e.intToBuffer)(I))}e.intToUnpaddedBuffer=T})(Bi);(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=mn,n=an,o=wf,a=db,f=Bi,u=bf,g=Kr,d=Ct,h=BigInt(0);class _{constructor(T=h,I=h,M=u.KECCAK256_RLP,X=u.KECCAK256_NULL){this.nonce=T,this.balance=I,this.storageRoot=M,this.codeHash=X,this._validate()}static fromAccountData(T){const{nonce:I,balance:M,storageRoot:X,codeHash:k}=T;return new _(I!==void 0?(0,f.bufferToBigInt)((0,f.toBuffer)(I)):void 0,M!==void 0?(0,f.bufferToBigInt)((0,f.toBuffer)(M)):void 0,X!==void 0?(0,f.toBuffer)(X):void 0,k!==void 0?(0,f.toBuffer)(k):void 0)}static fromRlpSerializedAccount(T){const I=(0,f.arrToBufArr)(t.RLP.decode(Uint8Array.from(T)));if(!Array.isArray(I))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(I)}static fromValuesArray(T){const[I,M,X,k]=T;return new _((0,f.bufferToBigInt)(I),(0,f.bufferToBigInt)(M),X,k)}_validate(){if(this.nonce<h)throw new Error("nonce must be greater than zero");if(this.balance<h)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,f.bigIntToUnpaddedBuffer)(this.nonce),(0,f.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return V.dist.Buffer.from(t.RLP.encode((0,f.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(u.KECCAK256_NULL)}isEmpty(){return this.balance===h&&this.nonce===h&&this.codeHash.equals(u.KECCAK256_NULL)}}e.Account=_;const E=function(R){try{(0,g.assertIsString)(R)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(R)};e.isValidAddress=E;const v=function(R,T){(0,g.assertIsHexString)(R);const I=(0,d.stripHexPrefix)(R).toLowerCase();let M="";T!==void 0&&(M=(0,f.bufferToBigInt)((0,f.toBuffer)(T)).toString()+"0x");const X=V.dist.Buffer.from(M+I,"utf8"),k=(0,a.bytesToHex)((0,n.keccak256)(X));let J="0x";for(let x=0;x<I.length;x++)parseInt(k[x],16)>=8?J+=I[x].toUpperCase():J+=I[x];return J};e.toChecksumAddress=v;const y=function(R,T){return(0,e.isValidAddress)(R)&&(0,e.toChecksumAddress)(R,T)===R};e.isValidChecksumAddress=y;const B=function(R,T){return(0,g.assertIsBuffer)(R),(0,g.assertIsBuffer)(T),(0,f.bufferToBigInt)(T)===BigInt(0)?V.dist.Buffer.from((0,n.keccak256)(t.RLP.encode((0,f.bufArrToArr)([R,null])))).slice(-20):V.dist.Buffer.from((0,n.keccak256)(t.RLP.encode((0,f.bufArrToArr)([R,T])))).slice(-20)};e.generateAddress=B;const D=function(R,T,I){if((0,g.assertIsBuffer)(R),(0,g.assertIsBuffer)(T),(0,g.assertIsBuffer)(I),R.length!==20)throw new Error("Expected from to be of length 20");if(T.length!==32)throw new Error("Expected salt to be of length 32");const M=(0,n.keccak256)(V.dist.Buffer.concat([V.dist.Buffer.from("ff","hex"),R,T,(0,n.keccak256)(I)]));return(0,f.toBuffer)(M).slice(-20)};e.generateAddress2=D;const j=function(R){return o.secp256k1.utils.isValidPrivateKey(R)};e.isValidPrivate=j;const q=function(R,T=!1){if((0,g.assertIsBuffer)(R),R.length===64)try{return o.secp256k1.ProjectivePoint.fromHex(V.dist.Buffer.concat([V.dist.Buffer.from([4]),R])),!0}catch{return!1}if(!T)return!1;try{return o.secp256k1.ProjectivePoint.fromHex(R),!0}catch{return!1}};e.isValidPublic=q;const H=function(R,T=!1){if((0,g.assertIsBuffer)(R),T&&R.length!==64&&(R=V.dist.Buffer.from(o.secp256k1.ProjectivePoint.fromHex(R).toRawBytes(!1).slice(1))),R.length!==64)throw new Error("Expected pubKey to be of length 64");return V.dist.Buffer.from((0,n.keccak256)(R)).slice(-20)};e.pubToAddress=H,e.publicToAddress=e.pubToAddress;const L=function(R){return(0,g.assertIsBuffer)(R),V.dist.Buffer.from(o.secp256k1.ProjectivePoint.fromPrivateKey(R).toRawBytes(!1).slice(1))};e.privateToPublic=L;const P=function(R){return(0,e.publicToAddress)((0,e.privateToPublic)(R))};e.privateToAddress=P;const K=function(R){return(0,g.assertIsBuffer)(R),R.length!==64&&(R=V.dist.Buffer.from(o.secp256k1.ProjectivePoint.fromHex(R).toRawBytes(!1).slice(1))),R};e.importPublic=K;const ae=function(){const T=(0,f.zeros)(20);return(0,f.bufferToHex)(T)};e.zeroAddress=ae;const oe=function(R){try{(0,g.assertIsString)(R)}catch{return!1}return(0,e.zeroAddress)()===R};e.isZeroAddress=oe;function be(R){const[T,I,M,X]=R;return[T,I,(0,f.arrToBufArr)(M).length===0?u.KECCAK256_RLP:M,(0,f.arrToBufArr)(X).length===0?u.KECCAK256_NULL:X]}e.accountBodyFromSlim=be;const de=new Uint8Array(0);function Oe(R){const[T,I,M,X]=R;return[T,I,(0,f.arrToBufArr)(M).equals(u.KECCAK256_RLP)?de:M,(0,f.arrToBufArr)(X).equals(u.KECCAK256_NULL)?de:X]}e.accountBodyToSlim=Oe;function ve(R,T=!0){const I=T?be(R):R;return(0,f.arrToBufArr)(t.RLP.encode(I))}e.accountBodyToRLP=ve})(Jc);var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.Address=void 0;const Ko=Jc,La=Bi;class Fn{constructor(t){if(t.length!==20)throw new Error("Invalid address length");this.buf=t}static zero(){return new Fn((0,La.zeros)(20))}static fromString(t){if(!(0,Ko.isValidAddress)(t))throw new Error("Invalid address");return new Fn((0,La.toBuffer)(t))}static fromPublicKey(t){if(!V.dist.Buffer.isBuffer(t))throw new Error("Public key should be Buffer");const n=(0,Ko.pubToAddress)(t);return new Fn(n)}static fromPrivateKey(t){if(!V.dist.Buffer.isBuffer(t))throw new Error("Private key should be Buffer");const n=(0,Ko.privateToAddress)(t);return new Fn(n)}static generate(t,n){if(typeof n!="bigint")throw new Error("Expected nonce to be a bigint");return new Fn((0,Ko.generateAddress)(t.buf,(0,La.bigIntToBuffer)(n)))}static generate2(t,n,o){if(!V.dist.Buffer.isBuffer(n))throw new Error("Expected salt to be a Buffer");if(!V.dist.Buffer.isBuffer(o))throw new Error("Expected initCode to be a Buffer");return new Fn((0,Ko.generateAddress2)(t.buf,n,o))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(Fn.zero())}isPrecompileOrSystemAddress(){const t=(0,La.bufferToBigInt)(this.buf),n=BigInt(0),o=BigInt("0xffff");return t>=n&&t<=o}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return V.dist.Buffer.from(this.buf)}}gs.Address=Fn;var Tf={},Yc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const t=Bi,n=Ct;var o;(function(f){f[f.Number=0]="Number",f[f.BigInt=1]="BigInt",f[f.Buffer=2]="Buffer",f[f.PrefixedHexString=3]="PrefixedHexString"})(o=e.TypeOutput||(e.TypeOutput={}));function a(f,u){if(f===null)return null;if(f===void 0)return;if(typeof f=="string"&&!(0,n.isHexString)(f))throw new Error(`A string must be provided with a 0x-prefix, given: ${f}`);if(typeof f=="number"&&!Number.isSafeInteger(f))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const g=(0,t.toBuffer)(f);switch(u){case o.Buffer:return g;case o.BigInt:return(0,t.bufferToBigInt)(g);case o.Number:{const d=(0,t.bufferToBigInt)(g);if(d>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(d)}case o.PrefixedHexString:return(0,t.bufferToHex)(g);default:throw new Error("unknown outputType")}}e.toType=a})(Yc);Object.defineProperty(Tf,"__esModule",{value:!0});Tf.Withdrawal=void 0;const B_=gs,Sl=Bi,Ht=Yc;class es{constructor(t,n,o,a){this.index=t,this.validatorIndex=n,this.address=o,this.amount=a}static fromWithdrawalData(t){const{index:n,validatorIndex:o,address:a,amount:f}=t,u=(0,Ht.toType)(n,Ht.TypeOutput.BigInt),g=(0,Ht.toType)(o,Ht.TypeOutput.BigInt),d=new B_.Address((0,Ht.toType)(a,Ht.TypeOutput.Buffer)),h=(0,Ht.toType)(f,Ht.TypeOutput.BigInt);return new es(u,g,d,h)}static fromValuesArray(t){if(t.length!==4)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[n,o,a,f]=t;return es.fromWithdrawalData({index:n,validatorIndex:o,address:a,amount:f})}static toBufferArray(t){const{index:n,validatorIndex:o,address:a,amount:f}=t,u=(0,Ht.toType)(n,Ht.TypeOutput.BigInt)===BigInt(0)?V.dist.Buffer.alloc(0):(0,Ht.toType)(n,Ht.TypeOutput.Buffer),g=(0,Ht.toType)(o,Ht.TypeOutput.BigInt)===BigInt(0)?V.dist.Buffer.alloc(0):(0,Ht.toType)(o,Ht.TypeOutput.Buffer);let d;a instanceof B_.Address?d=a.buf:d=(0,Ht.toType)(a,Ht.TypeOutput.Buffer);const h=(0,Ht.toType)(f,Ht.TypeOutput.BigInt)===BigInt(0)?V.dist.Buffer.alloc(0):(0,Ht.toType)(f,Ht.TypeOutput.Buffer);return[u,g,d,h]}raw(){return es.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,Sl.bigIntToHex)(this.index),validatorIndex:(0,Sl.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,Sl.bigIntToHex)(this.amount)}}}Tf.Withdrawal=es;var dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.hashPersonalMessage=dr.isValidSignature=dr.fromRpcSig=dr.toCompactSig=dr.toRpcSig=dr.ecrecover=dr.ecsign=void 0;const wL=an,_b=wf,Ar=Bi,Rl=bf,yL=Kr;function mL(e,t,n){const o=_b.secp256k1.sign(e,t),a=o.toCompactRawBytes(),f=V.dist.Buffer.from(a.slice(0,32)),u=V.dist.Buffer.from(a.slice(32,64)),g=n===void 0?BigInt(o.recovery+27):BigInt(o.recovery+35)+BigInt(n)*BigInt(2);return{r:f,s:u,v:g}}dr.ecsign=mL;function Of(e,t){return e===BigInt(0)||e===BigInt(1)?e:t===void 0?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function Cf(e){return e===BigInt(0)||e===BigInt(1)}const vL=function(e,t,n,o,a){const f=V.dist.Buffer.concat([(0,Ar.setLengthLeft)(n,32),(0,Ar.setLengthLeft)(o,32)],64),u=Of(t,a);if(!Cf(u))throw new Error("Invalid signature v value");const d=_b.secp256k1.Signature.fromCompact(f).addRecoveryBit(Number(u)).recoverPublicKey(e);return V.dist.Buffer.from(d.toRawBytes(!1).slice(1))};dr.ecrecover=vL;const EL=function(e,t,n,o){const a=Of(e,o);if(!Cf(a))throw new Error("Invalid signature v value");return(0,Ar.bufferToHex)(V.dist.Buffer.concat([(0,Ar.setLengthLeft)(t,32),(0,Ar.setLengthLeft)(n,32),(0,Ar.toBuffer)(e)]))};dr.toRpcSig=EL;const SL=function(e,t,n,o){const a=Of(e,o);if(!Cf(a))throw new Error("Invalid signature v value");let f=n;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(f=V.dist.Buffer.from(n),f[0]|=128),(0,Ar.bufferToHex)(V.dist.Buffer.concat([(0,Ar.setLengthLeft)(t,32),(0,Ar.setLengthLeft)(f,32)]))};dr.toCompactSig=SL;const RL=function(e){const t=(0,Ar.toBuffer)(e);let n,o,a;if(t.length>=65)n=t.slice(0,32),o=t.slice(32,64),a=(0,Ar.bufferToBigInt)(t.slice(64));else if(t.length===64)n=t.slice(0,32),o=t.slice(32,64),a=BigInt((0,Ar.bufferToInt)(t.slice(32,33))>>7),o[0]&=127;else throw new Error("Invalid signature length");return a<27&&(a=a+BigInt(27)),{v:a,r:n,s:o}};dr.fromRpcSig=RL;const AL=function(e,t,n,o=!0,a){if(t.length!==32||n.length!==32||!Cf(Of(e,a)))return!1;const f=(0,Ar.bufferToBigInt)(t),u=(0,Ar.bufferToBigInt)(n);return!(f===BigInt(0)||f>=Rl.SECP256K1_ORDER||u===BigInt(0)||u>=Rl.SECP256K1_ORDER||o&&u>=Rl.SECP256K1_ORDER_DIV_2)};dr.isValidSignature=AL;const IL=function(e){(0,yL.assertIsBuffer)(e);const t=V.dist.Buffer.from(`Ethereum Signed Message:
|
|
3
3
|
${e.length}`,"utf-8");return V.dist.Buffer.from((0,wL.keccak256)(V.dist.Buffer.concat([t,e])))};dr.hashPersonalMessage=IL;var pb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compactBytesToNibbles=e.bytesToNibbles=e.nibblesToCompactBytes=e.nibblesToBytes=e.hasTerminator=void 0;const t=u=>u.length>0&&u[u.length-1]===16;e.hasTerminator=t;const n=(u,g)=>{for(let d=0,h=0;h<u.length;d+=1,h+=2)g[d]=u[h]<<4|u[h+1]};e.nibblesToBytes=n;const o=u=>{let g=0;(0,e.hasTerminator)(u)&&(g=1,u=u.subarray(0,u.length-1));const d=new Uint8Array(u.length/2+1);return d[0]=g<<5,(u.length&1)===1&&(d[0]|=16,d[0]|=u[0],u=u.subarray(1)),(0,e.nibblesToBytes)(u,d.subarray(1)),d};e.nibblesToCompactBytes=o;const a=u=>{const g=u.length*2+1,d=new Uint8Array(g);for(let h=0;h<u.length;h++){const _=u[h];d[h*2]=_/16,d[h*2+1]=_%16}return d[g-1]=16,d};e.bytesToNibbles=a;const f=u=>{if(u.length===0)return u;let g=(0,e.bytesToNibbles)(u);g[0]<2&&(g=g.subarray(0,g.length-1));const d=2-(g[0]&1);return g.subarray(d)};e.compactBytesToNibbles=f})(pb);var Pf={};Object.defineProperty(Pf,"__esModule",{value:!0});Pf.AsyncEventEmitter=void 0;const TL=V.requireEvents();async function OL(e,t,n){let o;for await(const a of t)try{a.length<2?a.call(e,n):await new Promise((f,u)=>{a.call(e,n,g=>{g?u(g):f()})})}catch(f){o=f}if(o)throw o}class CL extends TL.EventEmitter{emit(t,...n){let[o,a]=n;const f=this;let u=f._events[t]??[];return a===void 0&&typeof o=="function"&&(a=o,o=void 0),(t==="newListener"||t==="removeListener")&&(o={event:o,fn:a},a=void 0),u=Array.isArray(u)?u:[u],OL(f,u.slice(),o).then(a).catch(a),f.listenerCount(t)>0}once(t,n){const o=this;let a;if(typeof n!="function")throw new TypeError("listener must be a function");return n.length>=2?a=function(f,u){o.removeListener(t,a),n(f,u)}:a=function(f){o.removeListener(t,a),n(f,a)},o.on(t,a),o}first(t,n){let o=this._events[t]??[];if(typeof n!="function")throw new TypeError("listener must be a function");return Array.isArray(o)||(this._events[t]=o=[o]),o.unshift(n),this}before(t,n,o){return this.beforeOrAfter(t,n,o)}after(t,n,o){return this.beforeOrAfter(t,n,o,"after")}beforeOrAfter(t,n,o,a){let f=this._events[t]??[],u,g;const d=a==="after"?1:0;if(typeof o!="function")throw new TypeError("listener must be a function");if(typeof n!="function")throw new TypeError("target must be a function");for(Array.isArray(f)||(this._events[t]=f=[f]),g=f.length,u=f.length;u--;)if(f[u]===n){g=u+d;break}return f.splice(g,0,o),this}on(t,n){return super.on(t,n)}addListener(t,n){return super.addListener(t,n)}prependListener(t,n){return super.prependListener(t,n)}prependOnceListener(t,n){return super.prependOnceListener(t,n)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,n){return super.removeListener(t,n)}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)}}Pf.AsyncEventEmitter=CL;var Lf={};Object.defineProperty(Lf,"__esModule",{value:!0});Lf.Lock=void 0;class PL{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)}}}Lf.Lock=PL;var ho={},Ii={},Al={},Il={},Tl,$_;function LL(){if($_)return Tl;$_=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 Tl=e,Tl}var sn={},Ol={},x_;function Nf(){return x_||(x_=1,function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function n(f,u){return Object.prototype.hasOwnProperty.call(f,u)}e.assign=function(f){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var g=u.shift();if(g){if(typeof g!="object")throw new TypeError(g+"must be non-object");for(var d in g)n(g,d)&&(f[d]=g[d])}}return f},e.shrinkBuf=function(f,u){return f.length===u?f:f.subarray?f.subarray(0,u):(f.length=u,f)};var o={arraySet:function(f,u,g,d,h){if(u.subarray&&f.subarray){f.set(u.subarray(g,g+d),h);return}for(var _=0;_<d;_++)f[h+_]=u[g+_]},flattenChunks:function(f){var u,g,d,h,_,E;for(d=0,u=0,g=f.length;u<g;u++)d+=f[u].length;for(E=new Uint8Array(d),h=0,u=0,g=f.length;u<g;u++)_=f[u],E.set(_,h),h+=_.length;return E}},a={arraySet:function(f,u,g,d,h){for(var _=0;_<d;_++)f[h+_]=u[g+_]},flattenChunks:function(f){return[].concat.apply([],f)}};e.setTyped=function(f){f?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,o)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(t)}(Ol)),Ol}var yi={},D_;function NL(){if(D_)return yi;D_=1;var e=Nf(),t=4,n=0,o=1,a=2;function f(A){for(var me=A.length;--me>=0;)A[me]=0}var u=0,g=1,d=2,h=3,_=258,E=29,v=256,y=v+1+E,B=30,D=19,j=2*y+1,q=15,H=16,L=7,P=256,K=16,ae=17,oe=18,be=[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],de=[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],Oe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ve=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],R=512,T=new Array((y+2)*2);f(T);var I=new Array(B*2);f(I);var M=new Array(R);f(M);var X=new Array(_-h+1);f(X);var k=new Array(E);f(k);var J=new Array(B);f(J);function x(A,me,Ce,De,Z){this.static_tree=A,this.extra_bits=me,this.extra_base=Ce,this.elems=De,this.max_length=Z,this.has_stree=A&&A.length}var z,re,he;function ee(A,me){this.dyn_tree=A,this.max_code=0,this.stat_desc=me}function ye(A){return A<256?M[A]:M[256+(A>>>7)]}function _e(A,me){A.pending_buf[A.pending++]=me&255,A.pending_buf[A.pending++]=me>>>8&255}function Re(A,me,Ce){A.bi_valid>H-Ce?(A.bi_buf|=me<<A.bi_valid&65535,_e(A,A.bi_buf),A.bi_buf=me>>H-A.bi_valid,A.bi_valid+=Ce-H):(A.bi_buf|=me<<A.bi_valid&65535,A.bi_valid+=Ce)}function Fe(A,me,Ce){Re(A,Ce[me*2],Ce[me*2+1])}function Le(A,me){var Ce=0;do Ce|=A&1,A>>>=1,Ce<<=1;while(--me>0);return Ce>>>1}function $e(A){A.bi_valid===16?(_e(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):A.bi_valid>=8&&(A.pending_buf[A.pending++]=A.bi_buf&255,A.bi_buf>>=8,A.bi_valid-=8)}function Qe(A,me){var Ce=me.dyn_tree,De=me.max_code,Z=me.stat_desc.static_tree,ce=me.stat_desc.has_stree,b=me.stat_desc.extra_bits,Ae=me.stat_desc.extra_base,Ge=me.stat_desc.max_length,l,se,fe,m,W,ie,Ue=0;for(m=0;m<=q;m++)A.bl_count[m]=0;for(Ce[A.heap[A.heap_max]*2+1]=0,l=A.heap_max+1;l<j;l++)se=A.heap[l],m=Ce[Ce[se*2+1]*2+1]+1,m>Ge&&(m=Ge,Ue++),Ce[se*2+1]=m,!(se>De)&&(A.bl_count[m]++,W=0,se>=Ae&&(W=b[se-Ae]),ie=Ce[se*2],A.opt_len+=ie*(m+W),ce&&(A.static_len+=ie*(Z[se*2+1]+W)));if(Ue!==0){do{for(m=Ge-1;A.bl_count[m]===0;)m--;A.bl_count[m]--,A.bl_count[m+1]+=2,A.bl_count[Ge]--,Ue-=2}while(Ue>0);for(m=Ge;m!==0;m--)for(se=A.bl_count[m];se!==0;)fe=A.heap[--l],!(fe>De)&&(Ce[fe*2+1]!==m&&(A.opt_len+=(m-Ce[fe*2+1])*Ce[fe*2],Ce[fe*2+1]=m),se--)}}function Ke(A,me,Ce){var De=new Array(q+1),Z=0,ce,b;for(ce=1;ce<=q;ce++)De[ce]=Z=Z+Ce[ce-1]<<1;for(b=0;b<=me;b++){var Ae=A[b*2+1];Ae!==0&&(A[b*2]=Le(De[Ae]++,Ae))}}function We(){var A,me,Ce,De,Z,ce=new Array(q+1);for(Ce=0,De=0;De<E-1;De++)for(k[De]=Ce,A=0;A<1<<be[De];A++)X[Ce++]=De;for(X[Ce-1]=De,Z=0,De=0;De<16;De++)for(J[De]=Z,A=0;A<1<<de[De];A++)M[Z++]=De;for(Z>>=7;De<B;De++)for(J[De]=Z<<7,A=0;A<1<<de[De]-7;A++)M[256+Z++]=De;for(me=0;me<=q;me++)ce[me]=0;for(A=0;A<=143;)T[A*2+1]=8,A++,ce[8]++;for(;A<=255;)T[A*2+1]=9,A++,ce[9]++;for(;A<=279;)T[A*2+1]=7,A++,ce[7]++;for(;A<=287;)T[A*2+1]=8,A++,ce[8]++;for(Ke(T,y+1,ce),A=0;A<B;A++)I[A*2+1]=5,I[A*2]=Le(A,5);z=new x(T,be,v+1,y,q),re=new x(I,de,0,B,q),he=new x(new Array(0),Oe,0,D,L)}function $(A){var me;for(me=0;me<y;me++)A.dyn_ltree[me*2]=0;for(me=0;me<B;me++)A.dyn_dtree[me*2]=0;for(me=0;me<D;me++)A.bl_tree[me*2]=0;A.dyn_ltree[P*2]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function U(A){A.bi_valid>8?_e(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function ne(A,me,Ce,De){U(A),_e(A,Ce),_e(A,~Ce),e.arraySet(A.pending_buf,A.window,me,Ce,A.pending),A.pending+=Ce}function Ie(A,me,Ce,De){var Z=me*2,ce=Ce*2;return A[Z]<A[ce]||A[Z]===A[ce]&&De[me]<=De[Ce]}function we(A,me,Ce){for(var De=A.heap[Ce],Z=Ce<<1;Z<=A.heap_len&&(Z<A.heap_len&&Ie(me,A.heap[Z+1],A.heap[Z],A.depth)&&Z++,!Ie(me,De,A.heap[Z],A.depth));)A.heap[Ce]=A.heap[Z],Ce=Z,Z<<=1;A.heap[Ce]=De}function Ne(A,me,Ce){var De,Z,ce=0,b,Ae;if(A.last_lit!==0)do De=A.pending_buf[A.d_buf+ce*2]<<8|A.pending_buf[A.d_buf+ce*2+1],Z=A.pending_buf[A.l_buf+ce],ce++,De===0?Fe(A,Z,me):(b=X[Z],Fe(A,b+v+1,me),Ae=be[b],Ae!==0&&(Z-=k[b],Re(A,Z,Ae)),De--,b=ye(De),Fe(A,b,Ce),Ae=de[b],Ae!==0&&(De-=J[b],Re(A,De,Ae)));while(ce<A.last_lit);Fe(A,P,me)}function qe(A,me){var Ce=me.dyn_tree,De=me.stat_desc.static_tree,Z=me.stat_desc.has_stree,ce=me.stat_desc.elems,b,Ae,Ge=-1,l;for(A.heap_len=0,A.heap_max=j,b=0;b<ce;b++)Ce[b*2]!==0?(A.heap[++A.heap_len]=Ge=b,A.depth[b]=0):Ce[b*2+1]=0;for(;A.heap_len<2;)l=A.heap[++A.heap_len]=Ge<2?++Ge:0,Ce[l*2]=1,A.depth[l]=0,A.opt_len--,Z&&(A.static_len-=De[l*2+1]);for(me.max_code=Ge,b=A.heap_len>>1;b>=1;b--)we(A,Ce,b);l=ce;do b=A.heap[1],A.heap[1]=A.heap[A.heap_len--],we(A,Ce,1),Ae=A.heap[1],A.heap[--A.heap_max]=b,A.heap[--A.heap_max]=Ae,Ce[l*2]=Ce[b*2]+Ce[Ae*2],A.depth[l]=(A.depth[b]>=A.depth[Ae]?A.depth[b]:A.depth[Ae])+1,Ce[b*2+1]=Ce[Ae*2+1]=l,A.heap[1]=l++,we(A,Ce,1);while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],Qe(A,me),Ke(Ce,Ge,A.bl_count)}function He(A,me,Ce){var De,Z=-1,ce,b=me[0*2+1],Ae=0,Ge=7,l=4;for(b===0&&(Ge=138,l=3),me[(Ce+1)*2+1]=65535,De=0;De<=Ce;De++)ce=b,b=me[(De+1)*2+1],!(++Ae<Ge&&ce===b)&&(Ae<l?A.bl_tree[ce*2]+=Ae:ce!==0?(ce!==Z&&A.bl_tree[ce*2]++,A.bl_tree[K*2]++):Ae<=10?A.bl_tree[ae*2]++:A.bl_tree[oe*2]++,Ae=0,Z=ce,b===0?(Ge=138,l=3):ce===b?(Ge=6,l=3):(Ge=7,l=4))}function et(A,me,Ce){var De,Z=-1,ce,b=me[0*2+1],Ae=0,Ge=7,l=4;for(b===0&&(Ge=138,l=3),De=0;De<=Ce;De++)if(ce=b,b=me[(De+1)*2+1],!(++Ae<Ge&&ce===b)){if(Ae<l)do Fe(A,ce,A.bl_tree);while(--Ae!==0);else ce!==0?(ce!==Z&&(Fe(A,ce,A.bl_tree),Ae--),Fe(A,K,A.bl_tree),Re(A,Ae-3,2)):Ae<=10?(Fe(A,ae,A.bl_tree),Re(A,Ae-3,3)):(Fe(A,oe,A.bl_tree),Re(A,Ae-11,7));Ae=0,Z=ce,b===0?(Ge=138,l=3):ce===b?(Ge=6,l=3):(Ge=7,l=4)}}function xe(A){var me;for(He(A,A.dyn_ltree,A.l_desc.max_code),He(A,A.dyn_dtree,A.d_desc.max_code),qe(A,A.bl_desc),me=D-1;me>=3&&A.bl_tree[ve[me]*2+1]===0;me--);return A.opt_len+=3*(me+1)+5+5+4,me}function st(A,me,Ce,De){var Z;for(Re(A,me-257,5),Re(A,Ce-1,5),Re(A,De-4,4),Z=0;Z<De;Z++)Re(A,A.bl_tree[ve[Z]*2+1],3);et(A,A.dyn_ltree,me-1),et(A,A.dyn_dtree,Ce-1)}function xt(A){var me=4093624447,Ce;for(Ce=0;Ce<=31;Ce++,me>>>=1)if(me&1&&A.dyn_ltree[Ce*2]!==0)return n;if(A.dyn_ltree[9*2]!==0||A.dyn_ltree[10*2]!==0||A.dyn_ltree[13*2]!==0)return o;for(Ce=32;Ce<v;Ce++)if(A.dyn_ltree[Ce*2]!==0)return o;return n}var gt=!1;function ir(A){gt||(We(),gt=!0),A.l_desc=new ee(A.dyn_ltree,z),A.d_desc=new ee(A.dyn_dtree,re),A.bl_desc=new ee(A.bl_tree,he),A.bi_buf=0,A.bi_valid=0,$(A)}function St(A,me,Ce,De){Re(A,(u<<1)+(De?1:0),3),ne(A,me,Ce)}function ft(A){Re(A,g<<1,3),Fe(A,P,T),$e(A)}function Nt(A,me,Ce,De){var Z,ce,b=0;A.level>0?(A.strm.data_type===a&&(A.strm.data_type=xt(A)),qe(A,A.l_desc),qe(A,A.d_desc),b=xe(A),Z=A.opt_len+3+7>>>3,ce=A.static_len+3+7>>>3,ce<=Z&&(Z=ce)):Z=ce=Ce+5,Ce+4<=Z&&me!==-1?St(A,me,Ce,De):A.strategy===t||ce===Z?(Re(A,(g<<1)+(De?1:0),3),Ne(A,T,I)):(Re(A,(d<<1)+(De?1:0),3),st(A,A.l_desc.max_code+1,A.d_desc.max_code+1,b+1),Ne(A,A.dyn_ltree,A.dyn_dtree)),$(A),De&&U(A)}function Dt(A,me,Ce){return A.pending_buf[A.d_buf+A.last_lit*2]=me>>>8&255,A.pending_buf[A.d_buf+A.last_lit*2+1]=me&255,A.pending_buf[A.l_buf+A.last_lit]=Ce&255,A.last_lit++,me===0?A.dyn_ltree[Ce*2]++:(A.matches++,me--,A.dyn_ltree[(X[Ce]+v+1)*2]++,A.dyn_dtree[ye(me)*2]++),A.last_lit===A.lit_bufsize-1}return yi._tr_init=ir,yi._tr_stored_block=St,yi._tr_flush_block=Nt,yi._tr_tally=Dt,yi._tr_align=ft,yi}var Cl,M_;function bb(){if(M_)return Cl;M_=1;function e(t,n,o,a){for(var f=t&65535|0,u=t>>>16&65535|0,g=0;o!==0;){g=o>2e3?2e3:o,o-=g;do f=f+n[a++]|0,u=u+f|0;while(--g);f%=65521,u%=65521}return f|u<<16|0}return Cl=e,Cl}var Pl,k_;function wb(){if(k_)return Pl;k_=1;function e(){for(var o,a=[],f=0;f<256;f++){o=f;for(var u=0;u<8;u++)o=o&1?3988292384^o>>>1:o>>>1;a[f]=o}return a}var t=e();function n(o,a,f,u){var g=t,d=u+f;o^=-1;for(var h=u;h<d;h++)o=o>>>8^g[(o^a[h])&255];return o^-1}return Pl=n,Pl}var Ll,F_;function BL(){return F_||(F_=1,Ll={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"}),Ll}var U_;function $L(){if(U_)return sn;U_=1;var e=Nf(),t=NL(),n=bb(),o=wb(),a=BL(),f=0,u=1,g=3,d=4,h=5,_=0,E=1,v=-2,y=-3,B=-5,D=-1,j=1,q=2,H=3,L=4,P=0,K=2,ae=8,oe=9,be=15,de=8,Oe=29,ve=256,R=ve+1+Oe,T=30,I=19,M=2*R+1,X=15,k=3,J=258,x=J+k+1,z=32,re=42,he=69,ee=73,ye=91,_e=103,Re=113,Fe=666,Le=1,$e=2,Qe=3,Ke=4,We=3;function $(l,se){return l.msg=a[se],se}function U(l){return(l<<1)-(l>4?9:0)}function ne(l){for(var se=l.length;--se>=0;)l[se]=0}function Ie(l){var se=l.state,fe=se.pending;fe>l.avail_out&&(fe=l.avail_out),fe!==0&&(e.arraySet(l.output,se.pending_buf,se.pending_out,fe,l.next_out),l.next_out+=fe,se.pending_out+=fe,l.total_out+=fe,l.avail_out-=fe,se.pending-=fe,se.pending===0&&(se.pending_out=0))}function we(l,se){t._tr_flush_block(l,l.block_start>=0?l.block_start:-1,l.strstart-l.block_start,se),l.block_start=l.strstart,Ie(l.strm)}function Ne(l,se){l.pending_buf[l.pending++]=se}function qe(l,se){l.pending_buf[l.pending++]=se>>>8&255,l.pending_buf[l.pending++]=se&255}function He(l,se,fe,m){var W=l.avail_in;return W>m&&(W=m),W===0?0:(l.avail_in-=W,e.arraySet(se,l.input,l.next_in,W,fe),l.state.wrap===1?l.adler=n(l.adler,se,W,fe):l.state.wrap===2&&(l.adler=o(l.adler,se,W,fe)),l.next_in+=W,l.total_in+=W,W)}function et(l,se){var fe=l.max_chain_length,m=l.strstart,W,ie,Ue=l.prev_length,w=l.nice_match,C=l.strstart>l.w_size-x?l.strstart-(l.w_size-x):0,ge=l.window,Pe=l.w_mask,Be=l.prev,Ve=l.strstart+J,at=ge[m+Ue-1],Mt=ge[m+Ue];l.prev_length>=l.good_match&&(fe>>=2),w>l.lookahead&&(w=l.lookahead);do if(W=se,!(ge[W+Ue]!==Mt||ge[W+Ue-1]!==at||ge[W]!==ge[m]||ge[++W]!==ge[m+1])){m+=2,W++;do;while(ge[++m]===ge[++W]&&ge[++m]===ge[++W]&&ge[++m]===ge[++W]&&ge[++m]===ge[++W]&&ge[++m]===ge[++W]&&ge[++m]===ge[++W]&&ge[++m]===ge[++W]&&ge[++m]===ge[++W]&&m<Ve);if(ie=J-(Ve-m),m=Ve-J,ie>Ue){if(l.match_start=se,Ue=ie,ie>=w)break;at=ge[m+Ue-1],Mt=ge[m+Ue]}}while((se=Be[se&Pe])>C&&--fe!==0);return Ue<=l.lookahead?Ue:l.lookahead}function xe(l){var se=l.w_size,fe,m,W,ie,Ue;do{if(ie=l.window_size-l.lookahead-l.strstart,l.strstart>=se+(se-x)){e.arraySet(l.window,l.window,se,se,0),l.match_start-=se,l.strstart-=se,l.block_start-=se,m=l.hash_size,fe=m;do W=l.head[--fe],l.head[fe]=W>=se?W-se:0;while(--m);m=se,fe=m;do W=l.prev[--fe],l.prev[fe]=W>=se?W-se:0;while(--m);ie+=se}if(l.strm.avail_in===0)break;if(m=He(l.strm,l.window,l.strstart+l.lookahead,ie),l.lookahead+=m,l.lookahead+l.insert>=k)for(Ue=l.strstart-l.insert,l.ins_h=l.window[Ue],l.ins_h=(l.ins_h<<l.hash_shift^l.window[Ue+1])&l.hash_mask;l.insert&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[Ue+k-1])&l.hash_mask,l.prev[Ue&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=Ue,Ue++,l.insert--,!(l.lookahead+l.insert<k)););}while(l.lookahead<x&&l.strm.avail_in!==0)}function st(l,se){var fe=65535;for(fe>l.pending_buf_size-5&&(fe=l.pending_buf_size-5);;){if(l.lookahead<=1){if(xe(l),l.lookahead===0&&se===f)return Le;if(l.lookahead===0)break}l.strstart+=l.lookahead,l.lookahead=0;var m=l.block_start+fe;if((l.strstart===0||l.strstart>=m)&&(l.lookahead=l.strstart-m,l.strstart=m,we(l,!1),l.strm.avail_out===0)||l.strstart-l.block_start>=l.w_size-x&&(we(l,!1),l.strm.avail_out===0))return Le}return l.insert=0,se===d?(we(l,!0),l.strm.avail_out===0?Qe:Ke):(l.strstart>l.block_start&&(we(l,!1),l.strm.avail_out===0),Le)}function xt(l,se){for(var fe,m;;){if(l.lookahead<x){if(xe(l),l.lookahead<x&&se===f)return Le;if(l.lookahead===0)break}if(fe=0,l.lookahead>=k&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+k-1])&l.hash_mask,fe=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),fe!==0&&l.strstart-fe<=l.w_size-x&&(l.match_length=et(l,fe)),l.match_length>=k)if(m=t._tr_tally(l,l.strstart-l.match_start,l.match_length-k),l.lookahead-=l.match_length,l.match_length<=l.max_lazy_match&&l.lookahead>=k){l.match_length--;do l.strstart++,l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+k-1])&l.hash_mask,fe=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart;while(--l.match_length!==0);l.strstart++}else l.strstart+=l.match_length,l.match_length=0,l.ins_h=l.window[l.strstart],l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+1])&l.hash_mask;else m=t._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++;if(m&&(we(l,!1),l.strm.avail_out===0))return Le}return l.insert=l.strstart<k-1?l.strstart:k-1,se===d?(we(l,!0),l.strm.avail_out===0?Qe:Ke):l.last_lit&&(we(l,!1),l.strm.avail_out===0)?Le:$e}function gt(l,se){for(var fe,m,W;;){if(l.lookahead<x){if(xe(l),l.lookahead<x&&se===f)return Le;if(l.lookahead===0)break}if(fe=0,l.lookahead>=k&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+k-1])&l.hash_mask,fe=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),l.prev_length=l.match_length,l.prev_match=l.match_start,l.match_length=k-1,fe!==0&&l.prev_length<l.max_lazy_match&&l.strstart-fe<=l.w_size-x&&(l.match_length=et(l,fe),l.match_length<=5&&(l.strategy===j||l.match_length===k&&l.strstart-l.match_start>4096)&&(l.match_length=k-1)),l.prev_length>=k&&l.match_length<=l.prev_length){W=l.strstart+l.lookahead-k,m=t._tr_tally(l,l.strstart-1-l.prev_match,l.prev_length-k),l.lookahead-=l.prev_length-1,l.prev_length-=2;do++l.strstart<=W&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+k-1])&l.hash_mask,fe=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart);while(--l.prev_length!==0);if(l.match_available=0,l.match_length=k-1,l.strstart++,m&&(we(l,!1),l.strm.avail_out===0))return Le}else if(l.match_available){if(m=t._tr_tally(l,0,l.window[l.strstart-1]),m&&we(l,!1),l.strstart++,l.lookahead--,l.strm.avail_out===0)return Le}else l.match_available=1,l.strstart++,l.lookahead--}return l.match_available&&(m=t._tr_tally(l,0,l.window[l.strstart-1]),l.match_available=0),l.insert=l.strstart<k-1?l.strstart:k-1,se===d?(we(l,!0),l.strm.avail_out===0?Qe:Ke):l.last_lit&&(we(l,!1),l.strm.avail_out===0)?Le:$e}function ir(l,se){for(var fe,m,W,ie,Ue=l.window;;){if(l.lookahead<=J){if(xe(l),l.lookahead<=J&&se===f)return Le;if(l.lookahead===0)break}if(l.match_length=0,l.lookahead>=k&&l.strstart>0&&(W=l.strstart-1,m=Ue[W],m===Ue[++W]&&m===Ue[++W]&&m===Ue[++W])){ie=l.strstart+J;do;while(m===Ue[++W]&&m===Ue[++W]&&m===Ue[++W]&&m===Ue[++W]&&m===Ue[++W]&&m===Ue[++W]&&m===Ue[++W]&&m===Ue[++W]&&W<ie);l.match_length=J-(ie-W),l.match_length>l.lookahead&&(l.match_length=l.lookahead)}if(l.match_length>=k?(fe=t._tr_tally(l,1,l.match_length-k),l.lookahead-=l.match_length,l.strstart+=l.match_length,l.match_length=0):(fe=t._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++),fe&&(we(l,!1),l.strm.avail_out===0))return Le}return l.insert=0,se===d?(we(l,!0),l.strm.avail_out===0?Qe:Ke):l.last_lit&&(we(l,!1),l.strm.avail_out===0)?Le:$e}function St(l,se){for(var fe;;){if(l.lookahead===0&&(xe(l),l.lookahead===0)){if(se===f)return Le;break}if(l.match_length=0,fe=t._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++,fe&&(we(l,!1),l.strm.avail_out===0))return Le}return l.insert=0,se===d?(we(l,!0),l.strm.avail_out===0?Qe:Ke):l.last_lit&&(we(l,!1),l.strm.avail_out===0)?Le:$e}function ft(l,se,fe,m,W){this.good_length=l,this.max_lazy=se,this.nice_length=fe,this.max_chain=m,this.func=W}var Nt;Nt=[new ft(0,0,0,0,st),new ft(4,4,8,4,xt),new ft(4,5,16,8,xt),new ft(4,6,32,32,xt),new ft(4,4,16,16,gt),new ft(8,16,32,32,gt),new ft(8,16,128,128,gt),new ft(8,32,128,256,gt),new ft(32,128,258,1024,gt),new ft(32,258,258,4096,gt)];function Dt(l){l.window_size=2*l.w_size,ne(l.head),l.max_lazy_match=Nt[l.level].max_lazy,l.good_match=Nt[l.level].good_length,l.nice_match=Nt[l.level].nice_length,l.max_chain_length=Nt[l.level].max_chain,l.strstart=0,l.block_start=0,l.lookahead=0,l.insert=0,l.match_length=l.prev_length=k-1,l.match_available=0,l.ins_h=0}function A(){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=ae,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(M*2),this.dyn_dtree=new e.Buf16((2*T+1)*2),this.bl_tree=new e.Buf16((2*I+1)*2),ne(this.dyn_ltree),ne(this.dyn_dtree),ne(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new e.Buf16(X+1),this.heap=new e.Buf16(2*R+1),ne(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new e.Buf16(2*R+1),ne(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 me(l){var se;return!l||!l.state?$(l,v):(l.total_in=l.total_out=0,l.data_type=K,se=l.state,se.pending=0,se.pending_out=0,se.wrap<0&&(se.wrap=-se.wrap),se.status=se.wrap?re:Re,l.adler=se.wrap===2?0:1,se.last_flush=f,t._tr_init(se),_)}function Ce(l){var se=me(l);return se===_&&Dt(l.state),se}function De(l,se){return!l||!l.state||l.state.wrap!==2?v:(l.state.gzhead=se,_)}function Z(l,se,fe,m,W,ie){if(!l)return v;var Ue=1;if(se===D&&(se=6),m<0?(Ue=0,m=-m):m>15&&(Ue=2,m-=16),W<1||W>oe||fe!==ae||m<8||m>15||se<0||se>9||ie<0||ie>L)return $(l,v);m===8&&(m=9);var w=new A;return l.state=w,w.strm=l,w.wrap=Ue,w.gzhead=null,w.w_bits=m,w.w_size=1<<w.w_bits,w.w_mask=w.w_size-1,w.hash_bits=W+7,w.hash_size=1<<w.hash_bits,w.hash_mask=w.hash_size-1,w.hash_shift=~~((w.hash_bits+k-1)/k),w.window=new e.Buf8(w.w_size*2),w.head=new e.Buf16(w.hash_size),w.prev=new e.Buf16(w.w_size),w.lit_bufsize=1<<W+6,w.pending_buf_size=w.lit_bufsize*4,w.pending_buf=new e.Buf8(w.pending_buf_size),w.d_buf=1*w.lit_bufsize,w.l_buf=3*w.lit_bufsize,w.level=se,w.strategy=ie,w.method=fe,Ce(l)}function ce(l,se){return Z(l,se,ae,be,de,P)}function b(l,se){var fe,m,W,ie;if(!l||!l.state||se>h||se<0)return l?$(l,v):v;if(m=l.state,!l.output||!l.input&&l.avail_in!==0||m.status===Fe&&se!==d)return $(l,l.avail_out===0?B:v);if(m.strm=l,fe=m.last_flush,m.last_flush=se,m.status===re)if(m.wrap===2)l.adler=0,Ne(m,31),Ne(m,139),Ne(m,8),m.gzhead?(Ne(m,(m.gzhead.text?1:0)+(m.gzhead.hcrc?2:0)+(m.gzhead.extra?4:0)+(m.gzhead.name?8:0)+(m.gzhead.comment?16:0)),Ne(m,m.gzhead.time&255),Ne(m,m.gzhead.time>>8&255),Ne(m,m.gzhead.time>>16&255),Ne(m,m.gzhead.time>>24&255),Ne(m,m.level===9?2:m.strategy>=q||m.level<2?4:0),Ne(m,m.gzhead.os&255),m.gzhead.extra&&m.gzhead.extra.length&&(Ne(m,m.gzhead.extra.length&255),Ne(m,m.gzhead.extra.length>>8&255)),m.gzhead.hcrc&&(l.adler=o(l.adler,m.pending_buf,m.pending,0)),m.gzindex=0,m.status=he):(Ne(m,0),Ne(m,0),Ne(m,0),Ne(m,0),Ne(m,0),Ne(m,m.level===9?2:m.strategy>=q||m.level<2?4:0),Ne(m,We),m.status=Re);else{var Ue=ae+(m.w_bits-8<<4)<<8,w=-1;m.strategy>=q||m.level<2?w=0:m.level<6?w=1:m.level===6?w=2:w=3,Ue|=w<<6,m.strstart!==0&&(Ue|=z),Ue+=31-Ue%31,m.status=Re,qe(m,Ue),m.strstart!==0&&(qe(m,l.adler>>>16),qe(m,l.adler&65535)),l.adler=1}if(m.status===he)if(m.gzhead.extra){for(W=m.pending;m.gzindex<(m.gzhead.extra.length&65535)&&!(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending>W&&(l.adler=o(l.adler,m.pending_buf,m.pending-W,W)),Ie(l),W=m.pending,m.pending===m.pending_buf_size));)Ne(m,m.gzhead.extra[m.gzindex]&255),m.gzindex++;m.gzhead.hcrc&&m.pending>W&&(l.adler=o(l.adler,m.pending_buf,m.pending-W,W)),m.gzindex===m.gzhead.extra.length&&(m.gzindex=0,m.status=ee)}else m.status=ee;if(m.status===ee)if(m.gzhead.name){W=m.pending;do{if(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending>W&&(l.adler=o(l.adler,m.pending_buf,m.pending-W,W)),Ie(l),W=m.pending,m.pending===m.pending_buf_size)){ie=1;break}m.gzindex<m.gzhead.name.length?ie=m.gzhead.name.charCodeAt(m.gzindex++)&255:ie=0,Ne(m,ie)}while(ie!==0);m.gzhead.hcrc&&m.pending>W&&(l.adler=o(l.adler,m.pending_buf,m.pending-W,W)),ie===0&&(m.gzindex=0,m.status=ye)}else m.status=ye;if(m.status===ye)if(m.gzhead.comment){W=m.pending;do{if(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending>W&&(l.adler=o(l.adler,m.pending_buf,m.pending-W,W)),Ie(l),W=m.pending,m.pending===m.pending_buf_size)){ie=1;break}m.gzindex<m.gzhead.comment.length?ie=m.gzhead.comment.charCodeAt(m.gzindex++)&255:ie=0,Ne(m,ie)}while(ie!==0);m.gzhead.hcrc&&m.pending>W&&(l.adler=o(l.adler,m.pending_buf,m.pending-W,W)),ie===0&&(m.status=_e)}else m.status=_e;if(m.status===_e&&(m.gzhead.hcrc?(m.pending+2>m.pending_buf_size&&Ie(l),m.pending+2<=m.pending_buf_size&&(Ne(m,l.adler&255),Ne(m,l.adler>>8&255),l.adler=0,m.status=Re)):m.status=Re),m.pending!==0){if(Ie(l),l.avail_out===0)return m.last_flush=-1,_}else if(l.avail_in===0&&U(se)<=U(fe)&&se!==d)return $(l,B);if(m.status===Fe&&l.avail_in!==0)return $(l,B);if(l.avail_in!==0||m.lookahead!==0||se!==f&&m.status!==Fe){var C=m.strategy===q?St(m,se):m.strategy===H?ir(m,se):Nt[m.level].func(m,se);if((C===Qe||C===Ke)&&(m.status=Fe),C===Le||C===Qe)return l.avail_out===0&&(m.last_flush=-1),_;if(C===$e&&(se===u?t._tr_align(m):se!==h&&(t._tr_stored_block(m,0,0,!1),se===g&&(ne(m.head),m.lookahead===0&&(m.strstart=0,m.block_start=0,m.insert=0))),Ie(l),l.avail_out===0))return m.last_flush=-1,_}return se!==d?_:m.wrap<=0?E:(m.wrap===2?(Ne(m,l.adler&255),Ne(m,l.adler>>8&255),Ne(m,l.adler>>16&255),Ne(m,l.adler>>24&255),Ne(m,l.total_in&255),Ne(m,l.total_in>>8&255),Ne(m,l.total_in>>16&255),Ne(m,l.total_in>>24&255)):(qe(m,l.adler>>>16),qe(m,l.adler&65535)),Ie(l),m.wrap>0&&(m.wrap=-m.wrap),m.pending!==0?_:E)}function Ae(l){var se;return!l||!l.state?v:(se=l.state.status,se!==re&&se!==he&&se!==ee&&se!==ye&&se!==_e&&se!==Re&&se!==Fe?$(l,v):(l.state=null,se===Re?$(l,y):_))}function Ge(l,se){var fe=se.length,m,W,ie,Ue,w,C,ge,Pe;if(!l||!l.state||(m=l.state,Ue=m.wrap,Ue===2||Ue===1&&m.status!==re||m.lookahead))return v;for(Ue===1&&(l.adler=n(l.adler,se,fe,0)),m.wrap=0,fe>=m.w_size&&(Ue===0&&(ne(m.head),m.strstart=0,m.block_start=0,m.insert=0),Pe=new e.Buf8(m.w_size),e.arraySet(Pe,se,fe-m.w_size,m.w_size,0),se=Pe,fe=m.w_size),w=l.avail_in,C=l.next_in,ge=l.input,l.avail_in=fe,l.next_in=0,l.input=se,xe(m);m.lookahead>=k;){W=m.strstart,ie=m.lookahead-(k-1);do m.ins_h=(m.ins_h<<m.hash_shift^m.window[W+k-1])&m.hash_mask,m.prev[W&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=W,W++;while(--ie);m.strstart=W,m.lookahead=k-1,xe(m)}return m.strstart+=m.lookahead,m.block_start=m.strstart,m.insert=m.lookahead,m.lookahead=0,m.match_length=m.prev_length=k-1,m.match_available=0,l.next_in=C,l.input=ge,l.avail_in=w,m.wrap=Ue,_}return sn.deflateInit=ce,sn.deflateInit2=Z,sn.deflateReset=Ce,sn.deflateResetKeep=me,sn.deflateSetHeader=De,sn.deflate=b,sn.deflateEnd=Ae,sn.deflateSetDictionary=Ge,sn.deflateInfo="pako deflate (from Nodeca project)",sn}var Zr={},Nl,j_;function xL(){if(j_)return Nl;j_=1;var e=30,t=12;return Nl=function(o,a){var f,u,g,d,h,_,E,v,y,B,D,j,q,H,L,P,K,ae,oe,be,de,Oe,ve,R,T;f=o.state,u=o.next_in,R=o.input,g=u+(o.avail_in-5),d=o.next_out,T=o.output,h=d-(a-o.avail_out),_=d+(o.avail_out-257),E=f.dmax,v=f.wsize,y=f.whave,B=f.wnext,D=f.window,j=f.hold,q=f.bits,H=f.lencode,L=f.distcode,P=(1<<f.lenbits)-1,K=(1<<f.distbits)-1;e:do{q<15&&(j+=R[u++]<<q,q+=8,j+=R[u++]<<q,q+=8),ae=H[j&P];t:for(;;){if(oe=ae>>>24,j>>>=oe,q-=oe,oe=ae>>>16&255,oe===0)T[d++]=ae&65535;else if(oe&16){be=ae&65535,oe&=15,oe&&(q<oe&&(j+=R[u++]<<q,q+=8),be+=j&(1<<oe)-1,j>>>=oe,q-=oe),q<15&&(j+=R[u++]<<q,q+=8,j+=R[u++]<<q,q+=8),ae=L[j&K];r:for(;;){if(oe=ae>>>24,j>>>=oe,q-=oe,oe=ae>>>16&255,oe&16){if(de=ae&65535,oe&=15,q<oe&&(j+=R[u++]<<q,q+=8,q<oe&&(j+=R[u++]<<q,q+=8)),de+=j&(1<<oe)-1,de>E){o.msg="invalid distance too far back",f.mode=e;break e}if(j>>>=oe,q-=oe,oe=d-h,de>oe){if(oe=de-oe,oe>y&&f.sane){o.msg="invalid distance too far back",f.mode=e;break e}if(Oe=0,ve=D,B===0){if(Oe+=v-oe,oe<be){be-=oe;do T[d++]=D[Oe++];while(--oe);Oe=d-de,ve=T}}else if(B<oe){if(Oe+=v+B-oe,oe-=B,oe<be){be-=oe;do T[d++]=D[Oe++];while(--oe);if(Oe=0,B<be){oe=B,be-=oe;do T[d++]=D[Oe++];while(--oe);Oe=d-de,ve=T}}}else if(Oe+=B-oe,oe<be){be-=oe;do T[d++]=D[Oe++];while(--oe);Oe=d-de,ve=T}for(;be>2;)T[d++]=ve[Oe++],T[d++]=ve[Oe++],T[d++]=ve[Oe++],be-=3;be&&(T[d++]=ve[Oe++],be>1&&(T[d++]=ve[Oe++]))}else{Oe=d-de;do T[d++]=T[Oe++],T[d++]=T[Oe++],T[d++]=T[Oe++],be-=3;while(be>2);be&&(T[d++]=T[Oe++],be>1&&(T[d++]=T[Oe++]))}}else if(oe&64){o.msg="invalid distance code",f.mode=e;break e}else{ae=L[(ae&65535)+(j&(1<<oe)-1)];continue r}break}}else if(oe&64)if(oe&32){f.mode=t;break e}else{o.msg="invalid literal/length code",f.mode=e;break e}else{ae=H[(ae&65535)+(j&(1<<oe)-1)];continue t}break}}while(u<g&&d<_);be=q>>3,u-=be,q-=be<<3,j&=(1<<q)-1,o.next_in=u,o.next_out=d,o.avail_in=u<g?5+(g-u):5-(u-g),o.avail_out=d<_?257+(_-d):257-(d-_),f.hold=j,f.bits=q},Nl}var Bl,H_;function DL(){if(H_)return Bl;H_=1;var e=Nf(),t=15,n=852,o=592,a=0,f=1,u=2,g=[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],d=[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],h=[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],_=[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 Bl=function(v,y,B,D,j,q,H,L){var P=L.bits,K=0,ae=0,oe=0,be=0,de=0,Oe=0,ve=0,R=0,T=0,I=0,M,X,k,J,x,z=null,re=0,he,ee=new e.Buf16(t+1),ye=new e.Buf16(t+1),_e=null,Re=0,Fe,Le,$e;for(K=0;K<=t;K++)ee[K]=0;for(ae=0;ae<D;ae++)ee[y[B+ae]]++;for(de=P,be=t;be>=1&&ee[be]===0;be--);if(de>be&&(de=be),be===0)return j[q++]=1<<24|64<<16|0,j[q++]=1<<24|64<<16|0,L.bits=1,0;for(oe=1;oe<be&&ee[oe]===0;oe++);for(de<oe&&(de=oe),R=1,K=1;K<=t;K++)if(R<<=1,R-=ee[K],R<0)return-1;if(R>0&&(v===a||be!==1))return-1;for(ye[1]=0,K=1;K<t;K++)ye[K+1]=ye[K]+ee[K];for(ae=0;ae<D;ae++)y[B+ae]!==0&&(H[ye[y[B+ae]]++]=ae);if(v===a?(z=_e=H,he=19):v===f?(z=g,re-=257,_e=d,Re-=257,he=256):(z=h,_e=_,he=-1),I=0,ae=0,K=oe,x=q,Oe=de,ve=0,k=-1,T=1<<de,J=T-1,v===f&&T>n||v===u&&T>o)return 1;for(;;){Fe=K-ve,H[ae]<he?(Le=0,$e=H[ae]):H[ae]>he?(Le=_e[Re+H[ae]],$e=z[re+H[ae]]):(Le=96,$e=0),M=1<<K-ve,X=1<<Oe,oe=X;do X-=M,j[x+(I>>ve)+X]=Fe<<24|Le<<16|$e|0;while(X!==0);for(M=1<<K-1;I&M;)M>>=1;if(M!==0?(I&=M-1,I+=M):I=0,ae++,--ee[K]===0){if(K===be)break;K=y[B+H[ae]]}if(K>de&&(I&J)!==k){for(ve===0&&(ve=de),x+=oe,Oe=K-ve,R=1<<Oe;Oe+ve<be&&(R-=ee[Oe+ve],!(R<=0));)Oe++,R<<=1;if(T+=1<<Oe,v===f&&T>n||v===u&&T>o)return 1;k=I&J,j[k]=de<<24|Oe<<16|x-q|0}}return I!==0&&(j[x+I]=K-ve<<24|64<<16|0),L.bits=de,0},Bl}var W_;function ML(){if(W_)return Zr;W_=1;var e=Nf(),t=bb(),n=wb(),o=xL(),a=DL(),f=0,u=1,g=2,d=4,h=5,_=6,E=0,v=1,y=2,B=-2,D=-3,j=-4,q=-5,H=8,L=1,P=2,K=3,ae=4,oe=5,be=6,de=7,Oe=8,ve=9,R=10,T=11,I=12,M=13,X=14,k=15,J=16,x=17,z=18,re=19,he=20,ee=21,ye=22,_e=23,Re=24,Fe=25,Le=26,$e=27,Qe=28,Ke=29,We=30,$=31,U=32,ne=852,Ie=592,we=15,Ne=we;function qe(Z){return(Z>>>24&255)+(Z>>>8&65280)+((Z&65280)<<8)+((Z&255)<<24)}function He(){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 et(Z){var ce;return!Z||!Z.state?B:(ce=Z.state,Z.total_in=Z.total_out=ce.total=0,Z.msg="",ce.wrap&&(Z.adler=ce.wrap&1),ce.mode=L,ce.last=0,ce.havedict=0,ce.dmax=32768,ce.head=null,ce.hold=0,ce.bits=0,ce.lencode=ce.lendyn=new e.Buf32(ne),ce.distcode=ce.distdyn=new e.Buf32(Ie),ce.sane=1,ce.back=-1,E)}function xe(Z){var ce;return!Z||!Z.state?B:(ce=Z.state,ce.wsize=0,ce.whave=0,ce.wnext=0,et(Z))}function st(Z,ce){var b,Ae;return!Z||!Z.state||(Ae=Z.state,ce<0?(b=0,ce=-ce):(b=(ce>>4)+1,ce<48&&(ce&=15)),ce&&(ce<8||ce>15))?B:(Ae.window!==null&&Ae.wbits!==ce&&(Ae.window=null),Ae.wrap=b,Ae.wbits=ce,xe(Z))}function xt(Z,ce){var b,Ae;return Z?(Ae=new He,Z.state=Ae,Ae.window=null,b=st(Z,ce),b!==E&&(Z.state=null),b):B}function gt(Z){return xt(Z,Ne)}var ir=!0,St,ft;function Nt(Z){if(ir){var ce;for(St=new e.Buf32(512),ft=new e.Buf32(32),ce=0;ce<144;)Z.lens[ce++]=8;for(;ce<256;)Z.lens[ce++]=9;for(;ce<280;)Z.lens[ce++]=7;for(;ce<288;)Z.lens[ce++]=8;for(a(u,Z.lens,0,288,St,0,Z.work,{bits:9}),ce=0;ce<32;)Z.lens[ce++]=5;a(g,Z.lens,0,32,ft,0,Z.work,{bits:5}),ir=!1}Z.lencode=St,Z.lenbits=9,Z.distcode=ft,Z.distbits=5}function Dt(Z,ce,b,Ae){var Ge,l=Z.state;return l.window===null&&(l.wsize=1<<l.wbits,l.wnext=0,l.whave=0,l.window=new e.Buf8(l.wsize)),Ae>=l.wsize?(e.arraySet(l.window,ce,b-l.wsize,l.wsize,0),l.wnext=0,l.whave=l.wsize):(Ge=l.wsize-l.wnext,Ge>Ae&&(Ge=Ae),e.arraySet(l.window,ce,b-Ae,Ge,l.wnext),Ae-=Ge,Ae?(e.arraySet(l.window,ce,b-Ae,Ae,0),l.wnext=Ae,l.whave=l.wsize):(l.wnext+=Ge,l.wnext===l.wsize&&(l.wnext=0),l.whave<l.wsize&&(l.whave+=Ge))),0}function A(Z,ce){var b,Ae,Ge,l,se,fe,m,W,ie,Ue,w,C,ge,Pe,Be=0,Ve,at,Mt,_t,Yr,cn,Rt,Vt,Bt=new e.Buf8(4),Ut,Zt,kr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Z||!Z.state||!Z.output||!Z.input&&Z.avail_in!==0)return B;b=Z.state,b.mode===I&&(b.mode=M),se=Z.next_out,Ge=Z.output,m=Z.avail_out,l=Z.next_in,Ae=Z.input,fe=Z.avail_in,W=b.hold,ie=b.bits,Ue=fe,w=m,Vt=E;e:for(;;)switch(b.mode){case L:if(b.wrap===0){b.mode=M;break}for(;ie<16;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if(b.wrap&2&&W===35615){b.check=0,Bt[0]=W&255,Bt[1]=W>>>8&255,b.check=n(b.check,Bt,2,0),W=0,ie=0,b.mode=P;break}if(b.flags=0,b.head&&(b.head.done=!1),!(b.wrap&1)||(((W&255)<<8)+(W>>8))%31){Z.msg="incorrect header check",b.mode=We;break}if((W&15)!==H){Z.msg="unknown compression method",b.mode=We;break}if(W>>>=4,ie-=4,Rt=(W&15)+8,b.wbits===0)b.wbits=Rt;else if(Rt>b.wbits){Z.msg="invalid window size",b.mode=We;break}b.dmax=1<<Rt,Z.adler=b.check=1,b.mode=W&512?R:I,W=0,ie=0;break;case P:for(;ie<16;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if(b.flags=W,(b.flags&255)!==H){Z.msg="unknown compression method",b.mode=We;break}if(b.flags&57344){Z.msg="unknown header flags set",b.mode=We;break}b.head&&(b.head.text=W>>8&1),b.flags&512&&(Bt[0]=W&255,Bt[1]=W>>>8&255,b.check=n(b.check,Bt,2,0)),W=0,ie=0,b.mode=K;case K:for(;ie<32;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}b.head&&(b.head.time=W),b.flags&512&&(Bt[0]=W&255,Bt[1]=W>>>8&255,Bt[2]=W>>>16&255,Bt[3]=W>>>24&255,b.check=n(b.check,Bt,4,0)),W=0,ie=0,b.mode=ae;case ae:for(;ie<16;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}b.head&&(b.head.xflags=W&255,b.head.os=W>>8),b.flags&512&&(Bt[0]=W&255,Bt[1]=W>>>8&255,b.check=n(b.check,Bt,2,0)),W=0,ie=0,b.mode=oe;case oe:if(b.flags&1024){for(;ie<16;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}b.length=W,b.head&&(b.head.extra_len=W),b.flags&512&&(Bt[0]=W&255,Bt[1]=W>>>8&255,b.check=n(b.check,Bt,2,0)),W=0,ie=0}else b.head&&(b.head.extra=null);b.mode=be;case be:if(b.flags&1024&&(C=b.length,C>fe&&(C=fe),C&&(b.head&&(Rt=b.head.extra_len-b.length,b.head.extra||(b.head.extra=new Array(b.head.extra_len)),e.arraySet(b.head.extra,Ae,l,C,Rt)),b.flags&512&&(b.check=n(b.check,Ae,C,l)),fe-=C,l+=C,b.length-=C),b.length))break e;b.length=0,b.mode=de;case de:if(b.flags&2048){if(fe===0)break e;C=0;do Rt=Ae[l+C++],b.head&&Rt&&b.length<65536&&(b.head.name+=String.fromCharCode(Rt));while(Rt&&C<fe);if(b.flags&512&&(b.check=n(b.check,Ae,C,l)),fe-=C,l+=C,Rt)break e}else b.head&&(b.head.name=null);b.length=0,b.mode=Oe;case Oe:if(b.flags&4096){if(fe===0)break e;C=0;do Rt=Ae[l+C++],b.head&&Rt&&b.length<65536&&(b.head.comment+=String.fromCharCode(Rt));while(Rt&&C<fe);if(b.flags&512&&(b.check=n(b.check,Ae,C,l)),fe-=C,l+=C,Rt)break e}else b.head&&(b.head.comment=null);b.mode=ve;case ve:if(b.flags&512){for(;ie<16;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if(W!==(b.check&65535)){Z.msg="header crc mismatch",b.mode=We;break}W=0,ie=0}b.head&&(b.head.hcrc=b.flags>>9&1,b.head.done=!0),Z.adler=b.check=0,b.mode=I;break;case R:for(;ie<32;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}Z.adler=b.check=qe(W),W=0,ie=0,b.mode=T;case T:if(b.havedict===0)return Z.next_out=se,Z.avail_out=m,Z.next_in=l,Z.avail_in=fe,b.hold=W,b.bits=ie,y;Z.adler=b.check=1,b.mode=I;case I:if(ce===h||ce===_)break e;case M:if(b.last){W>>>=ie&7,ie-=ie&7,b.mode=$e;break}for(;ie<3;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}switch(b.last=W&1,W>>>=1,ie-=1,W&3){case 0:b.mode=X;break;case 1:if(Nt(b),b.mode=he,ce===_){W>>>=2,ie-=2;break e}break;case 2:b.mode=x;break;case 3:Z.msg="invalid block type",b.mode=We}W>>>=2,ie-=2;break;case X:for(W>>>=ie&7,ie-=ie&7;ie<32;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if((W&65535)!==(W>>>16^65535)){Z.msg="invalid stored block lengths",b.mode=We;break}if(b.length=W&65535,W=0,ie=0,b.mode=k,ce===_)break e;case k:b.mode=J;case J:if(C=b.length,C){if(C>fe&&(C=fe),C>m&&(C=m),C===0)break e;e.arraySet(Ge,Ae,l,C,se),fe-=C,l+=C,m-=C,se+=C,b.length-=C;break}b.mode=I;break;case x:for(;ie<14;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if(b.nlen=(W&31)+257,W>>>=5,ie-=5,b.ndist=(W&31)+1,W>>>=5,ie-=5,b.ncode=(W&15)+4,W>>>=4,ie-=4,b.nlen>286||b.ndist>30){Z.msg="too many length or distance symbols",b.mode=We;break}b.have=0,b.mode=z;case z:for(;b.have<b.ncode;){for(;ie<3;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}b.lens[kr[b.have++]]=W&7,W>>>=3,ie-=3}for(;b.have<19;)b.lens[kr[b.have++]]=0;if(b.lencode=b.lendyn,b.lenbits=7,Ut={bits:b.lenbits},Vt=a(f,b.lens,0,19,b.lencode,0,b.work,Ut),b.lenbits=Ut.bits,Vt){Z.msg="invalid code lengths set",b.mode=We;break}b.have=0,b.mode=re;case re:for(;b.have<b.nlen+b.ndist;){for(;Be=b.lencode[W&(1<<b.lenbits)-1],Ve=Be>>>24,at=Be>>>16&255,Mt=Be&65535,!(Ve<=ie);){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if(Mt<16)W>>>=Ve,ie-=Ve,b.lens[b.have++]=Mt;else{if(Mt===16){for(Zt=Ve+2;ie<Zt;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if(W>>>=Ve,ie-=Ve,b.have===0){Z.msg="invalid bit length repeat",b.mode=We;break}Rt=b.lens[b.have-1],C=3+(W&3),W>>>=2,ie-=2}else if(Mt===17){for(Zt=Ve+3;ie<Zt;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}W>>>=Ve,ie-=Ve,Rt=0,C=3+(W&7),W>>>=3,ie-=3}else{for(Zt=Ve+7;ie<Zt;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}W>>>=Ve,ie-=Ve,Rt=0,C=11+(W&127),W>>>=7,ie-=7}if(b.have+C>b.nlen+b.ndist){Z.msg="invalid bit length repeat",b.mode=We;break}for(;C--;)b.lens[b.have++]=Rt}}if(b.mode===We)break;if(b.lens[256]===0){Z.msg="invalid code -- missing end-of-block",b.mode=We;break}if(b.lenbits=9,Ut={bits:b.lenbits},Vt=a(u,b.lens,0,b.nlen,b.lencode,0,b.work,Ut),b.lenbits=Ut.bits,Vt){Z.msg="invalid literal/lengths set",b.mode=We;break}if(b.distbits=6,b.distcode=b.distdyn,Ut={bits:b.distbits},Vt=a(g,b.lens,b.nlen,b.ndist,b.distcode,0,b.work,Ut),b.distbits=Ut.bits,Vt){Z.msg="invalid distances set",b.mode=We;break}if(b.mode=he,ce===_)break e;case he:b.mode=ee;case ee:if(fe>=6&&m>=258){Z.next_out=se,Z.avail_out=m,Z.next_in=l,Z.avail_in=fe,b.hold=W,b.bits=ie,o(Z,w),se=Z.next_out,Ge=Z.output,m=Z.avail_out,l=Z.next_in,Ae=Z.input,fe=Z.avail_in,W=b.hold,ie=b.bits,b.mode===I&&(b.back=-1);break}for(b.back=0;Be=b.lencode[W&(1<<b.lenbits)-1],Ve=Be>>>24,at=Be>>>16&255,Mt=Be&65535,!(Ve<=ie);){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if(at&&!(at&240)){for(_t=Ve,Yr=at,cn=Mt;Be=b.lencode[cn+((W&(1<<_t+Yr)-1)>>_t)],Ve=Be>>>24,at=Be>>>16&255,Mt=Be&65535,!(_t+Ve<=ie);){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}W>>>=_t,ie-=_t,b.back+=_t}if(W>>>=Ve,ie-=Ve,b.back+=Ve,b.length=Mt,at===0){b.mode=Le;break}if(at&32){b.back=-1,b.mode=I;break}if(at&64){Z.msg="invalid literal/length code",b.mode=We;break}b.extra=at&15,b.mode=ye;case ye:if(b.extra){for(Zt=b.extra;ie<Zt;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}b.length+=W&(1<<b.extra)-1,W>>>=b.extra,ie-=b.extra,b.back+=b.extra}b.was=b.length,b.mode=_e;case _e:for(;Be=b.distcode[W&(1<<b.distbits)-1],Ve=Be>>>24,at=Be>>>16&255,Mt=Be&65535,!(Ve<=ie);){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if(!(at&240)){for(_t=Ve,Yr=at,cn=Mt;Be=b.distcode[cn+((W&(1<<_t+Yr)-1)>>_t)],Ve=Be>>>24,at=Be>>>16&255,Mt=Be&65535,!(_t+Ve<=ie);){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}W>>>=_t,ie-=_t,b.back+=_t}if(W>>>=Ve,ie-=Ve,b.back+=Ve,at&64){Z.msg="invalid distance code",b.mode=We;break}b.offset=Mt,b.extra=at&15,b.mode=Re;case Re:if(b.extra){for(Zt=b.extra;ie<Zt;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}b.offset+=W&(1<<b.extra)-1,W>>>=b.extra,ie-=b.extra,b.back+=b.extra}if(b.offset>b.dmax){Z.msg="invalid distance too far back",b.mode=We;break}b.mode=Fe;case Fe:if(m===0)break e;if(C=w-m,b.offset>C){if(C=b.offset-C,C>b.whave&&b.sane){Z.msg="invalid distance too far back",b.mode=We;break}C>b.wnext?(C-=b.wnext,ge=b.wsize-C):ge=b.wnext-C,C>b.length&&(C=b.length),Pe=b.window}else Pe=Ge,ge=se-b.offset,C=b.length;C>m&&(C=m),m-=C,b.length-=C;do Ge[se++]=Pe[ge++];while(--C);b.length===0&&(b.mode=ee);break;case Le:if(m===0)break e;Ge[se++]=b.length,m--,b.mode=ee;break;case $e:if(b.wrap){for(;ie<32;){if(fe===0)break e;fe--,W|=Ae[l++]<<ie,ie+=8}if(w-=m,Z.total_out+=w,b.total+=w,w&&(Z.adler=b.check=b.flags?n(b.check,Ge,w,se-w):t(b.check,Ge,w,se-w)),w=m,(b.flags?W:qe(W))!==b.check){Z.msg="incorrect data check",b.mode=We;break}W=0,ie=0}b.mode=Qe;case Qe:if(b.wrap&&b.flags){for(;ie<32;){if(fe===0)break e;fe--,W+=Ae[l++]<<ie,ie+=8}if(W!==(b.total&4294967295)){Z.msg="incorrect length check",b.mode=We;break}W=0,ie=0}b.mode=Ke;case Ke:Vt=v;break e;case We:Vt=D;break e;case $:return j;case U:default:return B}return Z.next_out=se,Z.avail_out=m,Z.next_in=l,Z.avail_in=fe,b.hold=W,b.bits=ie,(b.wsize||w!==Z.avail_out&&b.mode<We&&(b.mode<$e||ce!==d))&&Dt(Z,Z.output,Z.next_out,w-Z.avail_out),Ue-=Z.avail_in,w-=Z.avail_out,Z.total_in+=Ue,Z.total_out+=w,b.total+=w,b.wrap&&w&&(Z.adler=b.check=b.flags?n(b.check,Ge,w,Z.next_out-w):t(b.check,Ge,w,Z.next_out-w)),Z.data_type=b.bits+(b.last?64:0)+(b.mode===I?128:0)+(b.mode===he||b.mode===k?256:0),(Ue===0&&w===0||ce===d)&&Vt===E&&(Vt=q),Vt}function me(Z){if(!Z||!Z.state)return B;var ce=Z.state;return ce.window&&(ce.window=null),Z.state=null,E}function Ce(Z,ce){var b;return!Z||!Z.state||(b=Z.state,!(b.wrap&2))?B:(b.head=ce,ce.done=!1,E)}function De(Z,ce){var b=ce.length,Ae,Ge,l;return!Z||!Z.state||(Ae=Z.state,Ae.wrap!==0&&Ae.mode!==T)?B:Ae.mode===T&&(Ge=1,Ge=t(Ge,ce,b,0),Ge!==Ae.check)?D:(l=Dt(Z,ce,b,b),l?(Ae.mode=$,j):(Ae.havedict=1,E))}return Zr.inflateReset=xe,Zr.inflateReset2=st,Zr.inflateResetKeep=et,Zr.inflateInit=gt,Zr.inflateInit2=xt,Zr.inflate=A,Zr.inflateEnd=me,Zr.inflateGetHeader=Ce,Zr.inflateSetDictionary=De,Zr.inflateInfo="pako inflate (from Nodeca project)",Zr}var $l,z_;function kL(){return z_||(z_=1,$l={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}),$l}var q_;function FL(){return q_||(q_=1,function(e){var t=wr.requireAssert(),n=LL(),o=$L(),a=ML(),f=kL();for(var u in f)e[u]=f[u];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 g=31,d=139;function h(_){if(typeof _!="number"||_<e.DEFLATE||_>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=_,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}h.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?o.deflateEnd(this.strm):(this.mode===e.INFLATE||this.mode===e.GUNZIP||this.mode===e.INFLATERAW||this.mode===e.UNZIP)&&a.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null},h.prototype.write=function(_,E,v,y,B,D,j){return this._write(!0,_,E,v,y,B,D,j)},h.prototype.writeSync=function(_,E,v,y,B,D,j){return this._write(!1,_,E,v,y,B,D,j)},h.prototype._write=function(_,E,v,y,B,D,j,q){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,E===void 0,"must provide flush value"),this.write_in_progress=!0,E!==e.Z_NO_FLUSH&&E!==e.Z_PARTIAL_FLUSH&&E!==e.Z_SYNC_FLUSH&&E!==e.Z_FULL_FLUSH&&E!==e.Z_FINISH&&E!==e.Z_BLOCK)throw new Error("Invalid flush value");if(v==null&&(v=V.dist.Buffer.alloc(0),B=0,y=0),this.strm.avail_in=B,this.strm.input=v,this.strm.next_in=y,this.strm.avail_out=q,this.strm.output=D,this.strm.next_out=j,this.flush=E,!_)return this._process(),this._checkError()?this._afterSync():void 0;var H=this;return V.dist.process.nextTick(function(){H._process(),H._after()}),this},h.prototype._afterSync=function(){var _=this.strm.avail_out,E=this.strm.avail_in;return this.write_in_progress=!1,[E,_]},h.prototype._process=function(){var _=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(_=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(_===null)break;if(this.strm.input[_]===g){if(this.gzip_id_bytes_read=1,_++,this.strm.avail_in===1)break}else{this.mode=e.INFLATE;break}case 1:if(_===null)break;this.strm.input[_]===d?(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=a.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=a.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=a.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=a.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},h.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},h.prototype._after=function(){if(this._checkError()){var _=this.strm.avail_out,E=this.strm.avail_in;this.write_in_progress=!1,this.callback(E,_),this.pending_close&&this.close()}},h.prototype._error=function(_){this.strm.msg&&(_=this.strm.msg),this.onerror(_,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},h.prototype.init=function(_,E,v,y,B){t(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),t(_>=8&&_<=15,"invalid windowBits"),t(E>=-1&&E<=9,"invalid compression level"),t(v>=1&&v<=9,"invalid memlevel"),t(y===e.Z_FILTERED||y===e.Z_HUFFMAN_ONLY||y===e.Z_RLE||y===e.Z_FIXED||y===e.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(E,_,v,y,B),this._setDictionary()},h.prototype.params=function(){throw new Error("deflateParams Not supported")},h.prototype.reset=function(){this._reset(),this._setDictionary()},h.prototype._init=function(_,E,v,y,B){switch(this.level=_,this.windowBits=E,this.memLevel=v,this.strategy=y,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 n,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=o.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=a.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=B,this.write_in_progress=!1,this.init_done=!0},h.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==e.Z_OK&&this._error("Failed to set dictionary")}},h.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=o.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=a.inflateReset(this.strm);break}this.err!==e.Z_OK&&this._error("Failed to reset stream")},e.Zlib=h}(Il)),Il}var G_;function UL(){return G_||(G_=1,function(e){var t=V.bufferPolyfill.Buffer,n=V.requireStreamBrowserify().Transform,o=FL(),a=wr.util,f=wr.requireAssert().ok,u=V.bufferPolyfill.kMaxLength,g="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16*1024,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var d=Object.keys(o),h=0;h<d.length;h++){var _=d[h];_.match(/^Z/)&&Object.defineProperty(e,_,{enumerable:!0,value:o[_],writable:!1})}for(var E={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},v=Object.keys(E),y=0;y<v.length;y++){var B=v[y];E[E[B]]=B}Object.defineProperty(e,"codes",{enumerable:!0,value:Object.freeze(E),writable:!1}),e.Deflate=q,e.Inflate=H,e.Gzip=L,e.Gunzip=P,e.DeflateRaw=K,e.InflateRaw=ae,e.Unzip=oe,e.createDeflate=function(R){return new q(R)},e.createInflate=function(R){return new H(R)},e.createDeflateRaw=function(R){return new K(R)},e.createInflateRaw=function(R){return new ae(R)},e.createGzip=function(R){return new L(R)},e.createGunzip=function(R){return new P(R)},e.createUnzip=function(R){return new oe(R)},e.deflate=function(R,T,I){return typeof T=="function"&&(I=T,T={}),D(new q(T),R,I)},e.deflateSync=function(R,T){return j(new q(T),R)},e.gzip=function(R,T,I){return typeof T=="function"&&(I=T,T={}),D(new L(T),R,I)},e.gzipSync=function(R,T){return j(new L(T),R)},e.deflateRaw=function(R,T,I){return typeof T=="function"&&(I=T,T={}),D(new K(T),R,I)},e.deflateRawSync=function(R,T){return j(new K(T),R)},e.unzip=function(R,T,I){return typeof T=="function"&&(I=T,T={}),D(new oe(T),R,I)},e.unzipSync=function(R,T){return j(new oe(T),R)},e.inflate=function(R,T,I){return typeof T=="function"&&(I=T,T={}),D(new H(T),R,I)},e.inflateSync=function(R,T){return j(new H(T),R)},e.gunzip=function(R,T,I){return typeof T=="function"&&(I=T,T={}),D(new P(T),R,I)},e.gunzipSync=function(R,T){return j(new P(T),R)},e.inflateRaw=function(R,T,I){return typeof T=="function"&&(I=T,T={}),D(new ae(T),R,I)},e.inflateRawSync=function(R,T){return j(new ae(T),R)};function D(R,T,I){var M=[],X=0;R.on("error",J),R.on("end",x),R.end(T),k();function k(){for(var z;(z=R.read())!==null;)M.push(z),X+=z.length;R.once("readable",k)}function J(z){R.removeListener("end",x),R.removeListener("readable",k),I(z)}function x(){var z,re=null;X>=u?re=new RangeError(g):z=t.concat(M,X),M=[],R.close(),I(re,z)}}function j(R,T){if(typeof T=="string"&&(T=t.from(T)),!t.isBuffer(T))throw new TypeError("Not a string or buffer");var I=R._finishFlushFlag;return R._processChunk(T,I)}function q(R){if(!(this instanceof q))return new q(R);de.call(this,R,o.DEFLATE)}function H(R){if(!(this instanceof H))return new H(R);de.call(this,R,o.INFLATE)}function L(R){if(!(this instanceof L))return new L(R);de.call(this,R,o.GZIP)}function P(R){if(!(this instanceof P))return new P(R);de.call(this,R,o.GUNZIP)}function K(R){if(!(this instanceof K))return new K(R);de.call(this,R,o.DEFLATERAW)}function ae(R){if(!(this instanceof ae))return new ae(R);de.call(this,R,o.INFLATERAW)}function oe(R){if(!(this instanceof oe))return new oe(R);de.call(this,R,o.UNZIP)}function be(R){return R===o.Z_NO_FLUSH||R===o.Z_PARTIAL_FLUSH||R===o.Z_SYNC_FLUSH||R===o.Z_FULL_FLUSH||R===o.Z_FINISH||R===o.Z_BLOCK}function de(R,T){var I=this;if(this._opts=R=R||{},this._chunkSize=R.chunkSize||e.Z_DEFAULT_CHUNK,n.call(this,R),R.flush&&!be(R.flush))throw new Error("Invalid flush flag: "+R.flush);if(R.finishFlush&&!be(R.finishFlush))throw new Error("Invalid flush flag: "+R.finishFlush);if(this._flushFlag=R.flush||o.Z_NO_FLUSH,this._finishFlushFlag=typeof R.finishFlush<"u"?R.finishFlush:o.Z_FINISH,R.chunkSize&&(R.chunkSize<e.Z_MIN_CHUNK||R.chunkSize>e.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+R.chunkSize);if(R.windowBits&&(R.windowBits<e.Z_MIN_WINDOWBITS||R.windowBits>e.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+R.windowBits);if(R.level&&(R.level<e.Z_MIN_LEVEL||R.level>e.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+R.level);if(R.memLevel&&(R.memLevel<e.Z_MIN_MEMLEVEL||R.memLevel>e.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+R.memLevel);if(R.strategy&&R.strategy!=e.Z_FILTERED&&R.strategy!=e.Z_HUFFMAN_ONLY&&R.strategy!=e.Z_RLE&&R.strategy!=e.Z_FIXED&&R.strategy!=e.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+R.strategy);if(R.dictionary&&!t.isBuffer(R.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(T);var M=this;this._hadError=!1,this._handle.onerror=function(J,x){Oe(M),M._hadError=!0;var z=new Error(J);z.errno=x,z.code=e.codes[x],M.emit("error",z)};var X=e.Z_DEFAULT_COMPRESSION;typeof R.level=="number"&&(X=R.level);var k=e.Z_DEFAULT_STRATEGY;typeof R.strategy=="number"&&(k=R.strategy),this._handle.init(R.windowBits||e.Z_DEFAULT_WINDOWBITS,X,R.memLevel||e.Z_DEFAULT_MEMLEVEL,k,R.dictionary),this._buffer=t.allocUnsafe(this._chunkSize),this._offset=0,this._level=X,this._strategy=k,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!I._handle},configurable:!0,enumerable:!0})}a.inherits(de,n),de.prototype.params=function(R,T,I){if(R<e.Z_MIN_LEVEL||R>e.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+R);if(T!=e.Z_FILTERED&&T!=e.Z_HUFFMAN_ONLY&&T!=e.Z_RLE&&T!=e.Z_FIXED&&T!=e.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+T);if(this._level!==R||this._strategy!==T){var M=this;this.flush(o.Z_SYNC_FLUSH,function(){f(M._handle,"zlib binding closed"),M._handle.params(R,T),M._hadError||(M._level=R,M._strategy=T,I&&I())})}else V.dist.process.nextTick(I)},de.prototype.reset=function(){return f(this._handle,"zlib binding closed"),this._handle.reset()},de.prototype._flush=function(R){this._transform(t.alloc(0),"",R)},de.prototype.flush=function(R,T){var I=this,M=this._writableState;(typeof R=="function"||R===void 0&&!T)&&(T=R,R=o.Z_FULL_FLUSH),M.ended?T&&V.dist.process.nextTick(T):M.ending?T&&this.once("end",T):M.needDrain?T&&this.once("drain",function(){return I.flush(R,T)}):(this._flushFlag=R,this.write(t.alloc(0),"",T))},de.prototype.close=function(R){Oe(this,R),V.dist.process.nextTick(ve,this)};function Oe(R,T){T&&V.dist.process.nextTick(T),R._handle&&(R._handle.close(),R._handle=null)}function ve(R){R.emit("close")}de.prototype._transform=function(R,T,I){var M,X=this._writableState,k=X.ending||X.ended,J=k&&(!R||X.length===R.length);if(R!==null&&!t.isBuffer(R))return I(new Error("invalid input"));if(!this._handle)return I(new Error("zlib binding closed"));J?M=this._finishFlushFlag:(M=this._flushFlag,R.length>=X.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),this._processChunk(R,M,I)},de.prototype._processChunk=function(R,T,I){var M=R&&R.length,X=this._chunkSize-this._offset,k=0,J=this,x=typeof I=="function";if(!x){var z=[],re=0,he;this.on("error",function(Fe){he=Fe}),f(this._handle,"zlib binding closed");do var ee=this._handle.writeSync(T,R,k,M,this._buffer,this._offset,X);while(!this._hadError&&Re(ee[0],ee[1]));if(this._hadError)throw he;if(re>=u)throw Oe(this),new RangeError(g);var ye=t.concat(z,re);return Oe(this),ye}f(this._handle,"zlib binding closed");var _e=this._handle.write(T,R,k,M,this._buffer,this._offset,X);_e.buffer=R,_e.callback=Re;function Re(Fe,Le){if(this&&(this.buffer=null,this.callback=null),!J._hadError){var $e=X-Le;if(f($e>=0,"have should not go down"),$e>0){var Qe=J._buffer.slice(J._offset,J._offset+$e);J._offset+=$e,x?J.push(Qe):(z.push(Qe),re+=Qe.length)}if((Le===0||J._offset>=J._chunkSize)&&(X=J._chunkSize,J._offset=0,J._buffer=t.allocUnsafe(J._chunkSize)),Le===0){if(k+=M-Fe,M=Fe,!x)return!0;var Ke=J._handle.write(T,R,k,M,J._buffer,J._offset,J._chunkSize);Ke.callback=Re,Ke.buffer=R;return}if(!x)return!1;I()}}},a.inherits(q,de),a.inherits(H,de),a.inherits(L,de),a.inherits(P,de),a.inherits(K,de),a.inherits(ae,de),a.inherits(oe,de)}(Al)),Al}Object.defineProperty(Ii,"__esModule",{value:!0});Ii.InvalidStatusCodeError=Ii.InvalidCertError=void 0;const yb=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class sc extends Error{constructor(t,n){super(t),this.fingerprint256=n}}Ii.InvalidCertError=sc;class Qc extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}Ii.InvalidStatusCodeError=Qc;function mb(e,t){if(!t||t==="text"||t==="json")try{let n=new TextDecoder("utf8",{fatal:!0}).decode(e);if(t==="text")return n;try{return JSON.parse(n)}catch(o){if(t==="json")throw o;return n}}catch(n){if(t==="text"||t==="json")throw n}return e}let V_={};function ac(e,t){var v;let n={...yb,...t};const o=wr.streamHttp,a=wr.httpsBrowserifyExports,f=UL(),{promisify:u}=wr.util,{resolve:g}=wr.urlExports,d=!!/^https/.test(e);let h={method:n.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const _=y=>y.replace(/:| /g,"").toLowerCase();if(n.keepAlive){const y={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},B=[d,d&&((v=n.sslPinnedCertificates)==null?void 0:v.map(D=>_(D)).sort())].join();h.agent=V_[B]||(V_[B]=new(d?a:o).Agent(y))}n.type==="json"&&(h.headers["Content-Type"]="application/json"),n.data&&(n.method||(h.method="POST"),h.body=n.type==="json"?JSON.stringify(n.data):n.data),h.headers={...h.headers,...n.headers},n.sslAllowSelfSigned&&(h.rejectUnauthorized=!1);const E=async y=>{const B=y.statusCode;if(n.redirect&&300<=B&&B<400&&y.headers.location){if(n._redirectCount==10)throw new Error("Request failed. Too much redirects.");return n._redirectCount+=1,await ac(g(e,y.headers.location),n)}if(n.expectStatusCode&&B!==n.expectStatusCode)throw y.resume(),new Qc(B);let D=[];for await(const L of y)D.push(L);let j=V.dist.Buffer.concat(D);const q=y.headers["content-encoding"];q==="br"&&(j=await u(f.brotliDecompress)(j)),(q==="gzip"||q==="deflate")&&(j=await u(f.unzip)(j));const H=mb(j,n.type);return n.full?{headers:y.headers,status:B,body:H}:H};return new Promise((y,B)=>{var L;const D=async P=>{if(P&&P.code==="DEPTH_ZERO_SELF_SIGNED_CERT")try{await ac(e,{...n,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(K){K&&K.fingerprint256&&(P=new sc(`Self-signed SSL certificate: ${K.fingerprint256}`,K.fingerprint256))}B(P)},j=(d?a:o).request(e,h,P=>{P.on("error",D),(async()=>{try{y(await E(P))}catch(K){B(K)}})()});j.on("error",D);const q=(L=n.sslPinnedCertificates)==null?void 0:L.map(P=>_(P)),H=P=>{var ae;const K=_(((ae=P.getPeerCertificate())==null?void 0:ae.fingerprint256)||"");if(!(!K&&P.isSessionReused())&&!q.includes(K))return j.emit("error",new sc(`Invalid SSL certificate: ${K} Expected: ${q}`,K)),j.abort()};n.sslPinnedCertificates&&j.on("socket",P=>{P.listeners("secureConnect").map(ae=>(ae.name||"").replace("bound ","")).includes("mfetchSecureConnect")||P.on("secureConnect",H.bind(null,P))}),n.keepAlive&&j.setNoDelay(!0),h.body&&j.write(h.body),j.end()})}const jL=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map(e=>e.toLowerCase())),HL=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 WL(e,t){let n={...yb,...t};const o=new Headers;n.type==="json"&&o.set("Content-Type","application/json");let a=new URL(e);if(a.username){const d=btoa(`${a.username}:${a.password}`);o.set("Authorization",`Basic ${d}`),a.username="",a.password=""}e=""+a;for(let d in n.headers){const h=d.toLowerCase();(jL.has(h)||n.cors&&!HL.has(h))&&o.set(d,n.headers[d])}let f={headers:o,redirect:n.redirect?"follow":"manual"};n.referrer||(f.referrerPolicy="no-referrer"),n.cors&&(f.mode="cors"),n.data&&(n.method||(f.method="POST"),f.body=n.type==="json"?JSON.stringify(n.data):n.data);const u=await fetch(e,f);if(n.expectStatusCode&&u.status!==n.expectStatusCode)throw new Qc(u.status);const g=mb(new Uint8Array(await u.arrayBuffer()),n.type);return n.full?{headers:Object.fromEntries(u.headers.entries()),status:u.status,body:g}:g}const zL=!!(typeof V.dist.process=="object"&&V.dist.process.versions&&V.dist.process.versions.node&&V.dist.process.versions.v8);function qL(e,t){return(zL?ac:WL)(e,t)}Ii.default=qL;Object.defineProperty(ho,"__esModule",{value:!0});ho.getProvider=ho.fetchFromProvider=void 0;const GL=Ii,VL=async(e,t)=>(await(0,GL.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result;ho.fetchFromProvider=VL;const ZL=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")};ho.getProvider=ZL;(function(e){var t=V.commonjsGlobal&&V.commonjsGlobal.__createBinding||(Object.create?function(a,f,u,g){g===void 0&&(g=u);var d=Object.getOwnPropertyDescriptor(f,u);(!d||("get"in d?!f.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return f[u]}}),Object.defineProperty(a,g,d)}:function(a,f,u,g){g===void 0&&(g=u),a[g]=f[u]}),n=V.commonjsGlobal&&V.commonjsGlobal.__exportStar||function(a,f){for(var u in a)u!=="default"&&!Object.prototype.hasOwnProperty.call(f,u)&&t(f,a,u)};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,n(bf,e),n(Af,e),n(Jc,e),n(gs,e),n(Tf,e),n(dr,e),n(Bi,e),n(Yc,e),n(pb,e),n(Pf,e);var o=Ct;Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return o.isHexString}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),n(Lf,e),n(ho,e)})(hP);var vb={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.log=n()})(V.commonjsGlobal,function(){var t=function(){},n="undefined",o=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),a=["trace","debug","info","warn","error"],f={},u=null;function g(D,j){var q=D[j];if(typeof q.bind=="function")return q.bind(D);try{return Function.prototype.bind.call(q,D)}catch{return function(){return Function.prototype.apply.apply(q,[D,arguments])}}}function d(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function h(D){return D==="debug"&&(D="log"),typeof console===n?!1:D==="trace"&&o?d:console[D]!==void 0?g(console,D):console.log!==void 0?g(console,"log"):t}function _(){for(var D=this.getLevel(),j=0;j<a.length;j++){var q=a[j];this[q]=j<D?t:this.methodFactory(q,D,this.name)}if(this.log=this.debug,typeof console===n&&D<this.levels.SILENT)return"No console available for logging"}function E(D){return function(){typeof console!==n&&(_.call(this),this[D].apply(this,arguments))}}function v(D,j,q){return h(D)||E.apply(this,arguments)}function y(D,j){var q=this,H,L,P,K="loglevel";typeof D=="string"?K+=":"+D:typeof D=="symbol"&&(K=void 0);function ae(ve){var R=(a[ve]||"silent").toUpperCase();if(!(typeof window===n||!K)){try{window.localStorage[K]=R;return}catch{}try{window.document.cookie=encodeURIComponent(K)+"="+R+";"}catch{}}}function oe(){var ve;if(!(typeof window===n||!K)){try{ve=window.localStorage[K]}catch{}if(typeof ve===n)try{var R=window.document.cookie,T=encodeURIComponent(K),I=R.indexOf(T+"=");I!==-1&&(ve=/^([^;]+)/.exec(R.slice(I+T.length+1))[1])}catch{}return q.levels[ve]===void 0&&(ve=void 0),ve}}function be(){if(!(typeof window===n||!K)){try{window.localStorage.removeItem(K)}catch{}try{window.document.cookie=encodeURIComponent(K)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function de(ve){var R=ve;if(typeof R=="string"&&q.levels[R.toUpperCase()]!==void 0&&(R=q.levels[R.toUpperCase()]),typeof R=="number"&&R>=0&&R<=q.levels.SILENT)return R;throw new TypeError("log.setLevel() called with invalid level: "+ve)}q.name=D,q.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},q.methodFactory=j||v,q.getLevel=function(){return P??L??H},q.setLevel=function(ve,R){return P=de(ve),R!==!1&&ae(P),_.call(q)},q.setDefaultLevel=function(ve){L=de(ve),oe()||q.setLevel(ve,!1)},q.resetLevel=function(){P=null,be(),_.call(q)},q.enableAll=function(ve){q.setLevel(q.levels.TRACE,ve)},q.disableAll=function(ve){q.setLevel(q.levels.SILENT,ve)},q.rebuild=function(){if(u!==q&&(H=de(u.getLevel())),_.call(q),u===q)for(var ve in f)f[ve].rebuild()},H=de(u?u.getLevel():"WARN");var Oe=oe();Oe!=null&&(P=de(Oe)),_.call(q)}u=new y,u.getLogger=function(j){if(typeof j!="symbol"&&typeof j!="string"||j==="")throw new TypeError("You must supply a name when creating a logger.");var q=f[j];return q||(q=f[j]=new y(j,u.methodFactory)),q};var B=typeof window!==n?window.log:void 0;return u.noConflict=function(){return typeof window!==n&&window.log===u&&(window.log=B),u},u.getLoggers=function(){return f},u.default=u,u})})(vb);var Eb=vb.exports;const qa=V.getDefaultExportFromCjs(Eb);var Ga={exports:{}};Ga.exports;(function(e,t){var n=200,o="__lodash_hash_undefined__",a=800,f=16,u=9007199254740991,g="[object Arguments]",d="[object Array]",h="[object AsyncFunction]",_="[object Boolean]",E="[object Date]",v="[object Error]",y="[object Function]",B="[object GeneratorFunction]",D="[object Map]",j="[object Number]",q="[object Null]",H="[object Object]",L="[object Proxy]",P="[object RegExp]",K="[object Set]",ae="[object String]",oe="[object Undefined]",be="[object WeakMap]",de="[object ArrayBuffer]",Oe="[object DataView]",ve="[object Float32Array]",R="[object Float64Array]",T="[object Int8Array]",I="[object Int16Array]",M="[object Int32Array]",X="[object Uint8Array]",k="[object Uint8ClampedArray]",J="[object Uint16Array]",x="[object Uint32Array]",z=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,he=/^(?:0|[1-9]\d*)$/,ee={};ee[ve]=ee[R]=ee[T]=ee[I]=ee[M]=ee[X]=ee[k]=ee[J]=ee[x]=!0,ee[g]=ee[d]=ee[de]=ee[_]=ee[Oe]=ee[E]=ee[v]=ee[y]=ee[D]=ee[j]=ee[H]=ee[P]=ee[K]=ee[ae]=ee[be]=!1;var ye=typeof V.commonjsGlobal=="object"&&V.commonjsGlobal&&V.commonjsGlobal.Object===Object&&V.commonjsGlobal,_e=typeof self=="object"&&self&&self.Object===Object&&self,Re=ye||_e||Function("return this")(),Fe=t&&!t.nodeType&&t,Le=Fe&&!0&&e&&!e.nodeType&&e,$e=Le&&Le.exports===Fe,Qe=$e&&ye.process,Ke=function(){try{var N=Le&&Le.require&&Le.require("util").types;return N||Qe&&Qe.binding&&Qe.binding("util")}catch{}}(),We=Ke&&Ke.isTypedArray;function $(N,Y,le){switch(le.length){case 0:return N.call(Y);case 1:return N.call(Y,le[0]);case 2:return N.call(Y,le[0],le[1]);case 3:return N.call(Y,le[0],le[1],le[2])}return N.apply(Y,le)}function U(N,Y){for(var le=-1,je=Array(N);++le<N;)je[le]=Y(le);return je}function ne(N){return function(Y){return N(Y)}}function Ie(N,Y){return N==null?void 0:N[Y]}function we(N,Y){return function(le){return N(Y(le))}}var Ne=Array.prototype,qe=Function.prototype,He=Object.prototype,et=Re["__core-js_shared__"],xe=qe.toString,st=He.hasOwnProperty,xt=function(){var N=/[^.]+$/.exec(et&&et.keys&&et.keys.IE_PROTO||"");return N?"Symbol(src)_1."+N:""}(),gt=He.toString,ir=xe.call(Object),St=RegExp("^"+xe.call(st).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ft=$e?Re.Buffer:void 0,Nt=Re.Symbol,Dt=Re.Uint8Array;ft&&ft.allocUnsafe;var A=we(Object.getPrototypeOf,Object),me=Object.create,Ce=He.propertyIsEnumerable,De=Ne.splice,Z=Nt?Nt.toStringTag:void 0,ce=function(){try{var N=Eo(Object,"defineProperty");return N({},"",{}),N}catch{}}(),b=ft?ft.isBuffer:void 0,Ae=Math.max,Ge=Date.now,l=Eo(Re,"Map"),se=Eo(Object,"create"),fe=function(){function N(){}return function(Y){if(!In(Y))return{};if(me)return me(Y);N.prototype=Y;var le=new N;return N.prototype=void 0,le}}();function m(N){var Y=-1,le=N==null?0:N.length;for(this.clear();++Y<le;){var je=N[Y];this.set(je[0],je[1])}}function W(){this.__data__=se?se(null):{},this.size=0}function ie(N){var Y=this.has(N)&&delete this.__data__[N];return this.size-=Y?1:0,Y}function Ue(N){var Y=this.__data__;if(se){var le=Y[N];return le===o?void 0:le}return st.call(Y,N)?Y[N]:void 0}function w(N){var Y=this.__data__;return se?Y[N]!==void 0:st.call(Y,N)}function C(N,Y){var le=this.__data__;return this.size+=this.has(N)?0:1,le[N]=se&&Y===void 0?o:Y,this}m.prototype.clear=W,m.prototype.delete=ie,m.prototype.get=Ue,m.prototype.has=w,m.prototype.set=C;function ge(N){var Y=-1,le=N==null?0:N.length;for(this.clear();++Y<le;){var je=N[Y];this.set(je[0],je[1])}}function Pe(){this.__data__=[],this.size=0}function Be(N){var Y=this.__data__,le=xi(Y,N);if(le<0)return!1;var je=Y.length-1;return le==je?Y.pop():De.call(Y,le,1),--this.size,!0}function Ve(N){var Y=this.__data__,le=xi(Y,N);return le<0?void 0:Y[le][1]}function at(N){return xi(this.__data__,N)>-1}function Mt(N,Y){var le=this.__data__,je=xi(le,N);return je<0?(++this.size,le.push([N,Y])):le[je][1]=Y,this}ge.prototype.clear=Pe,ge.prototype.delete=Be,ge.prototype.get=Ve,ge.prototype.has=at,ge.prototype.set=Mt;function _t(N){var Y=-1,le=N==null?0:N.length;for(this.clear();++Y<le;){var je=N[Y];this.set(je[0],je[1])}}function Yr(){this.size=0,this.__data__={hash:new m,map:new(l||ge),string:new m}}function cn(N){var Y=fi(this,N).delete(N);return this.size-=Y?1:0,Y}function Rt(N){return fi(this,N).get(N)}function Vt(N){return fi(this,N).has(N)}function Bt(N,Y){var le=fi(this,N),je=le.size;return le.set(N,Y),this.size+=le.size==je?0:1,this}_t.prototype.clear=Yr,_t.prototype.delete=cn,_t.prototype.get=Rt,_t.prototype.has=Vt,_t.prototype.set=Bt;function Ut(N){var Y=this.__data__=new ge(N);this.size=Y.size}function Zt(){this.__data__=new ge,this.size=0}function kr(N){var Y=this.__data__,le=Y.delete(N);return this.size=Y.size,le}function Qr(N){return this.__data__.get(N)}function Or(N){return this.__data__.has(N)}function xf(N,Y){var le=this.__data__;if(le instanceof ge){var je=le.__data__;if(!l||je.length<n-1)return je.push([N,Y]),this.size=++le.size,this;le=this.__data__=new _t(je)}return le.set(N,Y),this.size=le.size,this}Ut.prototype.clear=Zt,Ut.prototype.delete=kr,Ut.prototype.get=Qr,Ut.prototype.has=Or,Ut.prototype.set=xf;function Df(N,Y){var le=Io(N),je=!le&&Ao(N),lt=!le&&!je&&$s(N),bt=!le&&!je&&!lt&&Ds(N),Ot=le||je||lt||bt,Ye=Ot?U(N.length,String):[],Et=Ye.length;for(var Kt in N)Ot&&(Kt=="length"||lt&&(Kt=="offset"||Kt=="parent")||bt&&(Kt=="buffer"||Kt=="byteLength"||Kt=="byteOffset")||ki(Kt,Et))||Ye.push(Kt);return Ye}function mo(N,Y,le){(le!==void 0&&!ui(N[Y],le)||le===void 0&&!(Y in N))&&zn(N,Y,le)}function $i(N,Y,le){var je=N[Y];(!(st.call(N,Y)&&ui(je,le))||le===void 0&&!(Y in N))&&zn(N,Y,le)}function xi(N,Y){for(var le=N.length;le--;)if(ui(N[le][0],Y))return le;return-1}function zn(N,Y,le){Y=="__proto__"&&ce?ce(N,Y,{configurable:!0,enumerable:!0,value:le,writable:!0}):N[Y]=le}var Mf=Mi();function Di(N){return N==null?N===void 0?oe:q:Z&&Z in Object(N)?As(N):Os(N)}function ps(N){return Tn(N)&&Di(N)==g}function bs(N){if(!In(N)||So(N))return!1;var Y=Oo(N)?St:re;return Y.test(Ns(N))}function ws(N){return Tn(N)&&xs(N.length)&&!!ee[Di(N)]}function ys(N){if(!In(N))return qn(N);var Y=Fi(N),le=[];for(var je in N)je=="constructor"&&(Y||!st.call(N,je))||le.push(je);return le}function ms(N,Y,le,je,lt){N!==Y&&Mf(Y,function(bt,Ot){if(lt||(lt=new Ut),In(bt))kf(N,Y,Ot,le,ms,je,lt);else{var Ye=je?je(Ro(N,Ot),bt,Ot+"",N,Y,lt):void 0;Ye===void 0&&(Ye=bt),mo(N,Ot,Ye)}},Ms)}function kf(N,Y,le,je,lt,bt,Ot){var Ye=Ro(N,le),Et=Ro(Y,le),Kt=Ot.get(Et);if(Kt){mo(N,le,Kt);return}var or=bt?bt(Ye,Et,le+"",N,Y,Ot):void 0,On=or===void 0;if(On){var sr=Io(Et),Ui=!sr&&$s(Et),Co=!sr&&!Ui&&Ds(Et);or=Et,sr||Ui||Co?Io(Ye)?or=Ye:Bs(Ye)?or=vo(Ye):Ui?(On=!1,or=vs(Et)):Co?(On=!1,or=Ss(Et)):or=[]:Wf(Et)||Ao(Et)?(or=Ye,Ao(Ye)?or=zf(Ye):(!In(Ye)||Oo(Ye))&&(or=Is(Et))):On=!1}On&&(Ot.set(Et,or),lt(or,Et,je,bt,Ot),Ot.delete(Et)),mo(N,le,or)}function Ff(N,Y){return Ps(Cs(N,Y,yt),N+"")}var Uf=ce?function(N,Y){return ce(N,"toString",{configurable:!0,enumerable:!1,value:At(Y),writable:!0})}:yt;function vs(N,Y){return N.slice()}function Es(N){var Y=new N.constructor(N.byteLength);return new Dt(Y).set(new Dt(N)),Y}function Ss(N,Y){var le=Es(N.buffer);return new N.constructor(le,N.byteOffset,N.length)}function vo(N,Y){var le=-1,je=N.length;for(Y||(Y=Array(je));++le<je;)Y[le]=N[le];return Y}function jf(N,Y,le,je){var lt=!le;le||(le={});for(var bt=-1,Ot=Y.length;++bt<Ot;){var Ye=Y[bt],Et=void 0;Et===void 0&&(Et=N[Ye]),lt?zn(le,Ye,Et):$i(le,Ye,Et)}return le}function Rs(N){return Ff(function(Y,le){var je=-1,lt=le.length,bt=lt>1?le[lt-1]:void 0,Ot=lt>2?le[2]:void 0;for(bt=N.length>3&&typeof bt=="function"?(lt--,bt):void 0,Ot&&Hf(le[0],le[1],Ot)&&(bt=lt<3?void 0:bt,lt=1),Y=Object(Y);++je<lt;){var Ye=le[je];Ye&&N(Y,Ye,je,bt)}return Y})}function Mi(N){return function(Y,le,je){for(var lt=-1,bt=Object(Y),Ot=je(Y),Ye=Ot.length;Ye--;){var Et=Ot[++lt];if(le(bt[Et],Et,bt)===!1)break}return Y}}function fi(N,Y){var le=N.__data__;return Ts(Y)?le[typeof Y=="string"?"string":"hash"]:le.map}function Eo(N,Y){var le=Ie(N,Y);return bs(le)?le:void 0}function As(N){var Y=st.call(N,Z),le=N[Z];try{N[Z]=void 0;var je=!0}catch{}var lt=gt.call(N);return je&&(Y?N[Z]=le:delete N[Z]),lt}function Is(N){return typeof N.constructor=="function"&&!Fi(N)?fe(A(N)):{}}function ki(N,Y){var le=typeof N;return Y=Y??u,!!Y&&(le=="number"||le!="symbol"&&he.test(N))&&N>-1&&N%1==0&&N<Y}function Hf(N,Y,le){if(!In(le))return!1;var je=typeof Y;return(je=="number"?To(le)&&ki(Y,le.length):je=="string"&&Y in le)?ui(le[Y],N):!1}function Ts(N){var Y=typeof N;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?N!=="__proto__":N===null}function So(N){return!!xt&&xt in N}function Fi(N){var Y=N&&N.constructor,le=typeof Y=="function"&&Y.prototype||He;return N===le}function qn(N){var Y=[];if(N!=null)for(var le in Object(N))Y.push(le);return Y}function Os(N){return gt.call(N)}function Cs(N,Y,le){return Y=Ae(Y===void 0?N.length-1:Y,0),function(){for(var je=arguments,lt=-1,bt=Ae(je.length-Y,0),Ot=Array(bt);++lt<bt;)Ot[lt]=je[Y+lt];lt=-1;for(var Ye=Array(Y+1);++lt<Y;)Ye[lt]=je[lt];return Ye[Y]=le(Ot),$(N,this,Ye)}}function Ro(N,Y){if(!(Y==="constructor"&&typeof N[Y]=="function")&&Y!="__proto__")return N[Y]}var Ps=Ls(Uf);function Ls(N){var Y=0,le=0;return function(){var je=Ge(),lt=f-(je-le);if(le=je,lt>0){if(++Y>=a)return arguments[0]}else Y=0;return N.apply(void 0,arguments)}}function Ns(N){if(N!=null){try{return xe.call(N)}catch{}try{return N+""}catch{}}return""}function ui(N,Y){return N===Y||N!==N&&Y!==Y}var Ao=ps(function(){return arguments}())?ps:function(N){return Tn(N)&&st.call(N,"callee")&&!Ce.call(N,"callee")},Io=Array.isArray;function To(N){return N!=null&&xs(N.length)&&!Oo(N)}function Bs(N){return Tn(N)&&To(N)}var $s=b||Gf;function Oo(N){if(!In(N))return!1;var Y=Di(N);return Y==y||Y==B||Y==h||Y==L}function xs(N){return typeof N=="number"&&N>-1&&N%1==0&&N<=u}function In(N){var Y=typeof N;return N!=null&&(Y=="object"||Y=="function")}function Tn(N){return N!=null&&typeof N=="object"}function Wf(N){if(!Tn(N)||Di(N)!=H)return!1;var Y=A(N);if(Y===null)return!0;var le=st.call(Y,"constructor")&&Y.constructor;return typeof le=="function"&&le instanceof le&&xe.call(le)==ir}var Ds=We?ne(We):ws;function zf(N){return jf(N,Ms(N))}function Ms(N){return To(N)?Df(N):ys(N)}var qf=Rs(function(N,Y,le){ms(N,Y,le)});function At(N){return function(){return N}}function yt(N){return N}function Gf(){return!1}e.exports=qf})(Ga,Ga.exports);Ga.exports;const KL=qa.getLogger("http-helpers");KL.setLevel(Eb.levels.INFO);var Va={exports:{}};/**
|
|
4
4
|
* @license
|