evm-chains-info 0.0.25 → 0.0.27

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.
@@ -0,0 +1,2 @@
1
+ /*! For license information please see evm-chains-info.js.LICENSE.txt */
2
+ (()=>{var e={4032(e,t,r){const n=r(8368),i=n._argv_get,s=n._argv_url_get,o=n._cmdline_check,a=n._get_date_human,c=n._msg_info,u=n._msg_error,l=n._process_exit,d=r(2495),f=(d._evm_chains_db_path_get,d._evm_chain_info_get,d._rpc_backend_get,d._evm_chains_info),h=d._db_paths_auto_detect,p=d._db_types_auto_detect,g=d._input_type_auto_detect;function m(){""==call_date&&(call_date=a()),""==target_command&&(target_command="get"),g(),""==output_type&&(output_type="name"),""==retrieval_mode&&(retrieval_mode="offline"),""==selection_method&&(selection_method="kirsh"),""==api_key&&(api_key="n"),""==user_level&&(user_level="y"),""==networks_all&&(networks_all="n"),h(target_chain),p()}function y(e){let t;const r=["Returns info about EVM blockchains.","","Usage:",""," evm-chains-info.js"," [options]"," <target-chain>",""," options:",""," -C --command Target command. Can be 'get' or 'set'"," or 'check'.",` <target-command> Default: '${target_command}`,""," -i --input-type Input type. It can be 'id' or 'name'.",` <input-type> Default: '${input_type}'`,""," -o --output-type Output type. It can be 'id', 'name',"," <output-type> 'rpc', 'explorers'.",` Default: '${output_type}'`,""," -m --retrieval-mode It can be 'offline'.",` <retrieval-mode> Default: '${retrieval_mode}'`,""," -t --db-type It can be 'node', 'system'.",` <db-type> Default: '${retrieval_mode}'`,""," -u --user-level It can be 'y' or 'n'.",` <user-level> Default: '${user_level}'`,""," -d --db-path Path of the chains' info json file"," <db-path> to be used for 'offline' retrieval.",` Default: '${db_paths}'`,""," -s --selection-method When output type is 'rpc',"," <selection-method> selection criterion to use when"," more than one is available."," It can be 'kirsh', 'random' or 'all'.",` Default: '${selection_method}'`,""," -k If selected, when output type is 'rpc',"," includes the ones requiring an API key.",` Default: '${api_key}'`," -a --all Whether to show results for all networks.",` Default: '${networks_all}'`,""," -h --help This message."," -v --verbose Enable verbose output."];for(t of r)console.log(t);l(e)}app_name="evm-chains-info.js",app_opts=[],runtime_environment="",call_date="",target_command="",input_type="",output_type="",retrieval_mode="",db_types=[],user_level="",db_paths=[],selection_method="",api_key="",target_chain="",networks_all="",quiet="",verbose="",1==o("evm-chains-info.js")||1==o("evm-chains-info")?function(){let e,t;const r=i({booleans:["h","help","v","verbose"]}),n=r._;quiet="y",e=!1,runtime_environment="node",1==r.h&&(e=!0),1==r.help&&(e=!0),(n.indexOf("--help")>-1||n.indexOf("-h")>-1)&&(e=!0),e&&(quiet="n",m(),y(0)),void 0===r||r._.length<1&&0==e?(t="Target chain argument required.",u("Target chain argument required.",0),y(1)):1==e&&y(0),target_chain=r._[0],"C"in r&&(target_command=r.C),"command"in r&&(target_command=r.command),"i"in r&&(input_type=r.i),"input-type"in r&&(input_type=r["input-type"]),"o"in r&&(output_type=r.o),"output-type"in r&&(output_type=r["output-type"]),"m"in r&&(retrieval_mode=r.m),"retrieval-mode"in r&&(retrieval_mode=r["retrieval-mode"]),"u"in r&&(user_level=r.u),"user-level"in r&&(user_level=r["user-level"]),"d"in r&&db_paths.push(r.d),"db-path"in r&&db_paths.push(r["db-paths"]),"t"in r&&db_types.push(r.t),"db-types"in r&&db_types.push(r["db-types"]),"s"in r&&(selection_method=r.s),"selection-method"in r&&(selection_method=r["selection-method"]),"k"in r&&(api_key="y"),"api-key"in r&&(api_key="y"),"a"in r&&(networks_all="y"),"networks-all"in r&&(networks_all="y"),(r.v||r.verbose)&&(verbose=!0),verbose&&(quiet="n")}():(runtime_environment="browser",target_chain=s("chain")[0],target_command=s("command")[0],input_type=s("input_type")[0],output_type=s("output_type")[0],input_type=s("input_type")[0],retrieval_mode=s("retrieval_mode")[0],user_level=s("user_level")[0],db_paths.push(s("db_path")[0]),selection_method=s("selection_method")[0],api_key=s("api_key")[0],networks_all=s("networks_all")[0],quiet=s("quiet"),0===quiet.length&&(quiet="n")),m(),function(){let e;const t=[`${app_name} configuration:`,` Call date: ${call_date}`,` Runtime environment: ${runtime_environment}`,` Target command: ${target_command}`,` Input type: ${input_type}`,` Output type: ${output_type}`,` Retrieval mode: ${retrieval_mode}`,` Database types: ${db_types}`,` User-level database: ${user_level}`,` API key: ${api_key}`,` RPC selection method: ${selection_method}`,` All networks: ${networks_all}`,` Target chain: ${target_chain}`,` Database paths: ${db_paths}`];for(e of t)c(e)}(),app_opts=[target_command,input_type,output_type,retrieval_mode,db_types,selection_method,api_key,networks_all,target_chain,db_paths],async function(){let e;const t=await f.apply(null,app_opts);for(e of t)console.log(e);l(0)}(app_opts)},2495(e,t,r){const n=r(8368),i=n._homedir_get,s=n._file_exists,o=n._file_read,a=n._file_write,c=n._json_read,u=n._lib_get,l=n._mkdir,d=n._msg_info,f=n._msg_error,h=n._path_join,p=(n._range,n._rm),g=r(7511)._data_get;async function m(e,t,r){let n,o,a;if(void 0!==e&&""!=e||(e="n"),void 0!==t&&""!=t||(t=""),void 0!==r&&""!=r||(""!=t?r="split":""==t&&(r="unified")),a=`Getting path for chain with chain id '${t}' with privilege user set to '${e}' in format '${r}'.`,d(a),"unified"==r?n="chains.json":"split"==r&&(n=`${t}.json`),"y"==e){const e=i();o=h([e,".config","evm-chains",n]);const t=s(o);1==t?(a=`Found database '${o}'.`,d(a)):0==t?(a=`Database '${o}' not found`,d(a)):(a="wat",f(a))}else if("n"==e){const e=await u();a=`Found system libraries directory '${e}'.`,o=h([e,"evm-chains",n])}else a=`Input variable '_user' must be a boolean. _user value is '${e}'.`,f(a,0);return o}async function y(e,t,r,n,i){let o;void 0!==e&&""!=e||f("Network's ChainID not specified.",1),void 0!==t&&""!=t||(t="kirsh"),void 0!==r&&""!=r||(r=await m("n")),void 0===i&&(i=["node","system"]),void 0!==n&&""!=n||(n="y");const a=Number(e),u=await async function(e,t,r,n,i){let o,a,u,l;for(u of(void 0!==i&&i!=[]&&""!=i||(i=["node","system"]),void 0!==r&&""!=r||(r="n"),void 0!==n&&""!=n||(n="split"),void 0!==t&&""!=t||(t=await m(r,e,n)),i))if("node"==u){for(o of(l="Getting data from 'ethereum-data' module.",d(l),a=g(e),l=`Displaying data for chain '${e}' of type '${i}'.`,d(l),a))if(o.chainId==e)return o}else if("system"==u){s(t);const r=c(t);for(o of(l=`Displaying data for chain '${e}' of type '${i}'.`,d(l),r))if(o.chainId==e)return o;l=`Network '${e}' not found.`,f(l,1)}}(a,r,n,i);if("kirsh"==t)return u.rpc[0];o="Unknown selection method.",f("Unknown selection method.",1)}function b(e){s(e)||f(`Database at '${e}' does not exist.`,1)}function w(e,t,r,n,i,s,o){let a,u,l,f,h,p,g,m;if(h=r,"id"==t?(f="chainId",p=o,m=`Getting data for filter key: '${f}' and value '${p}'.`,d(m)):"testnet"==t&&(m="Like I have to agg a tag.",d(m)),"id"==r?h="chainId":"rpc"==r&&(h=r),"y"==s)return l=function(e){console.log(e)}(h),m=`Showing results for all networks with filter '${l}'.`,d(m),a=c(e),m=`Showing results for all networks with filter '${l}'.`,d(m),a;if("n"==s){for(u of(g=[],m=`Showing results for chain '${o}' in database '${e}' with filter '${h}'.`,d(m),a=c(e),m=`Database '${e}' contains '${a.length}' items.`,d(m),a))if(u[f]==o&&(g.push(u),"kirsh"==n))break;return m=`Total results returned for '${e}' are '${g.length}'.`,d(m),g}}function _(e,t,r,n,i,s,o,a,u){let l,h,p,m,y,_,v;if(_=0,"offline"==t){for(p of r)if("node"==p){for(m of(l=[],v=g(e),v))if(m.chainId==e&&(l.push(m),"kirsh"==s))break}else if("system"==p){for(h of(y=`Getting data from databases '${u}'`,d(y),u))if(y=`Looking in '${h}'.`,d(y),b(h),"amount"!=n)l=w(h,n,i,s,0,a,e);else if("amount"==n&&(l=c(h),_=l.length,"kirsh"==s))break;if("amount"!=n)_=l.length,0==l.length&&(y=`No results found for network '${e}'.`,f(y,0));else if("amount"==n)return y=`Found '${_}' networks.`,d(y),_}for(m of(v=[],l))if(m.chainId==e&&(v.push(m[i]),"all"!=s))break;l=v,_=l.length,y=`Found '${_}' networks in database '${h}'.`,d(y)}else"online"==t&&(y="About to implement it probably.",f(y,1));return l}function v(e){"id"==e&&d(`Setting value for type '${e}'.`)}async function A(e,t){let n,c;const u=r(3182)._block_number_get,g=[t,"","","3","10000"];try{c=`Testing connectivity for RPC '${t}' for network '${e}'.`,d(c),n=await u.apply(null,g),console.log(n),0<n&&(c=`RPC '${t}' for network '${e}' online.`,d(c),function(e,t){"number"==typeof e&&(e=e.toFixed(0));const r=i(),n=h([r,".cache","evm-chains",e,"rpc",t]),o=h([n,"offline"]);s(o)&&(p(o),d(`Deleting offline score for RPC '${t}'`))}(e,t))}catch(r){return console.error(r),c=`RPC '${t}' for network '${e}' offline.`,f(c,0),function(e,t){let r;const n=i(),c=h([n,".cache","evm-chains",e,"rpc",t]),u=h([c,"offline"]);console.log(c),s(c)?r=s(u)?o(u):0:(l(c),d(`Creating directory +'${c}'.`)),r+=1,a(u,r)}(e,t),n=0,n}return n}e.exports={_data_get:g,_db_paths_auto_detect:async function(e){let t,r,n;"y"==user_level?(t="y",r="n"):"n"==user_level&&(t="n",r="y");const i=await m(t,"","unified"),o=await m(t,e,"split"),a=await m(r,"","unified"),c=await m(r,e,"split");s(o)?(db_paths.push(o),n=`Found database '${o}', adding.`,d(n)):s(o)?(n="wat",f(n,1)):(n=`Default per-network database '${o}' not found, trying '${i}'.`,d(n)),s(i)?(db_paths.push(i),n=`Found database '${i}', adding.`,d(n)):(n=`Default unified database '${o}' not found, trying '${i}'.`,d(n)),s(c)?(db_paths.push(c),n=`Found database '${c}', adding.`,d(n)):(n=`Fallback per-network database '${c}' not found, trying '${a}'.`,d(n)),s(a)?(db_paths.push(a),n=`Found database '${a}', adding.`,d(n)):(n=`Fallback database '${c}' does not exist.`,f(n,0)),0==db_paths.length&&(n="Found no databases!",d(n))},_db_types_auto_detect:function(e){0==db_types.length&&db_types.push("node"),db_paths.length>0&&db_types.push("system")},_evm_chains_db_path_get:m,_evm_chains_info:async function(e,t,r,n,i,s,o,a,c,u){let l,d,h;if("get"==e){const e=[],a=_(c,n,i,t,r,s,0,o,u);if("rpc"==r){for(d of a)for(h of d)if("y"==o?e.push(h):"n"==o&&(h.includes("API_KEY")||e.push(h)),"kirsh"==s)break;return e}if("name"==r)return a;if("id"==r)return a;if("explorers"==r){for(d of a)for(l of d)if(e.push(l.url),"kirsh"==s)break;return e}}else if("set"==e)v(t);else{if("check"==e){const e=await async function(e,t,r,n,i,s){let o,a,c;const u={},l=await _(e,t,r,n,"rpc","all",0,i,s);for(o of l)for(a of o)try{c=await A(e,a),u[a]=!0}catch(e){c=0,u[a]=!1}return u}(c,n,i,t,o,u);return console.log(e),e}f(`Unknown command '${e}'.`,1)}},_evm_chains_info_get:_,_evm_chains_info_set:v,_input_type_auto_detect:function(){const e=typeof target_chain;"number"==e?input_type="id":"string"==e&&target_chain.startsWith("https://")&&(input_type="rpc"),""==input_type&&(isNaN(target_chain)?input_type="name":input_type="id")},_rpc_backend_get:y,_rpc_backends_get:async function(e,t,r){let n,i,s;null==t&&(t="kirsh"),null==r&&(r=await m("n"));const o=[];for(n of e)i=[n,t,r],s=await y.apply(null,i),o.push(s);return o}}},3562(e,t,r){"use strict";t.createCurve=void 0;const n=r(9615),i=r(9175),s=r(1705);function o(e){return{hash:e,hmac:(t,...r)=>(0,n.hmac)(e,t,(0,i.concatBytes)(...r)),randomBytes:i.randomBytes}}t.createCurve=function(e,t){const r=t=>(0,s.weierstrass)({...e,...o(t)});return Object.freeze({...r(t),create:r})}},2422(e,t,r){"use strict";t.validateBasic=t.wNAF=void 0;const n=r(4967),i=r(1484),s=BigInt(0),o=BigInt(1);t.wNAF=function(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>s;)r&o&&(n=n.add(i)),i=i.double(),r>>=o;return n},precomputeWindow(e,t){const{windows:r,windowSize:i}=n(t),s=[];let o=e,a=o;for(let e=0;e<r;e++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(t,i,s){const{windows:a,windowSize:c}=n(t);let u=e.ZERO,l=e.BASE;const d=BigInt(2**t-1),f=2**t,h=BigInt(t);for(let e=0;e<a;e++){const t=e*c;let n=Number(s&d);s>>=h,n>c&&(n-=f,s+=o);const a=t,p=t+Math.abs(n)-1,g=e%2!=0,m=n<0;0===n?l=l.add(r(g,i[a])):u=u.add(r(m,i[p]))}return{p:u,f:l}},wNAFCached(e,t,r,n){const i=e._WINDOW_SIZE||1;let s=t.get(e);return s||(s=this.precomputeWindow(e,i),1!==i&&t.set(e,n(s))),this.wNAF(i,s,r)}}},t.validateBasic=function(e){return(0,n.validateField)(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}},1761(e,t,r){"use strict";t.createHasher=t.isogenyMap=void 0;const n=r(4967),i=r(1484),s=i.bytesToNumberBE;function o(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function a(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function c(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected")}function u(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function l(e,t,r){(0,i.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:l,k:d,m:f,hash:h,expand:p,DST:g}=r;c(e),u(t);const m=function(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return(0,i.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}(g),y=l.toString(2).length,b=Math.ceil((y+d)/8),w=t*f*b;let _;if("xmd"===p)_=function(e,t,r,n){c(e),c(t),u(r),t.length>255&&(t=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:s,blockLen:l}=n,d=Math.ceil(r/s);if(d>255)throw new Error("Invalid xmd length");const f=(0,i.concatBytes)(t,o(t.length,1)),h=o(0,l),p=o(r,2),g=new Array(d),m=n((0,i.concatBytes)(h,e,p,o(0,1),f));g[0]=n((0,i.concatBytes)(m,o(1,1),f));for(let e=1;e<=d;e++){const t=[a(m,g[e-1]),o(e+1,1),f];g[e]=n((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...g).slice(0,r)}(e,m,w,h);else if("xof"===p)_=function(e,t,r,n,s){if(c(e),c(t),u(r),t.length>255){const e=Math.ceil(2*n/8);t=s.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:r}).update(e).update(o(r,2)).update(t).update(o(t.length,1)).digest()}(e,m,w,d,h);else{if("_internal_pass"!==p)throw new Error('expand must be "xmd" or "xof"');_=e}const v=new Array(t);for(let e=0;e<t;e++){const t=new Array(f);for(let r=0;r<f;r++){const i=b*(r+e*f),o=_.subarray(i,i+b);t[r]=(0,n.mod)(s(o),l)}v[e]=t}return v}t.isogenyMap=function(e,t){const r=t.map(e=>Array.from(e).reverse());return(t,n)=>{const[i,s,o,a]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n)));return t=e.div(i,s),n=e.mul(n,e.div(o,a)),{x:t,y:n}}},t.createHasher=function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const s=l(n,2,{...r,DST:r.DST,...i}),o=e.fromAffine(t(s[0])),a=e.fromAffine(t(s[1])),c=o.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,i){const s=l(n,1,{...r,DST:r.encodeDST,...i}),o=e.fromAffine(t(s[0])).clearCofactor();return o.assertValidity(),o}}}},4967(e,t,r){"use strict";t.mapHashToField=t.getMinHashLength=t.Field=t.nLength=t.validateField=t.invert=t.pow2=t.mod=void 0;const n=r(1484),i=BigInt(0),s=BigInt(1),o=BigInt(2),a=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);function d(e,t){const r=e%t;return r>=i?r:t+r}function f(e,t,r){if(r<=i||t<i)throw new Error("Expected power/modulo > 0");if(r===s)return i;let n=s;for(;t>i;)t&s&&(n=n*e%r),e=e*e%r,t>>=s;return n}function h(e,t){if(e===i||t<=i)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=d(e,t),n=t,o=i,a=s,c=s,u=i;for(;r!==i;){const e=n/r,t=n%r,i=o-c*e,s=a-u*e;n=r,r=t,o=c,a=u,c=i,u=s}if(n!==s)throw new Error("invert: does not exist");return d(o,t)}function p(e){if(e%c===a){const t=(e+s)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%l===u){const t=(e-u)/l;return function(e,r){const n=e.mul(r,o),i=e.pow(n,t),s=e.mul(r,i),a=e.mul(e.mul(s,o),i),c=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(c),r))throw new Error("Cannot find square root");return c}}return function(e){const t=(e-s)/o;let r,n,a;for(r=e-s,n=0;r%o===i;r/=o,n++);for(a=o;a<e&&f(a,t,e)!==e-s;a++);if(1===n){const t=(e+s)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const u=(r+s)/o;return function(e,i){if(e.pow(i,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let o=n,c=e.pow(e.mul(e.ONE,a),r),l=e.pow(i,u),d=e.pow(i,r);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(d);t<o&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,s<<BigInt(o-t-1));c=e.sqr(r),l=e.mul(l,r),d=e.mul(d,c),o=t}return l}}(e)}BigInt(9),BigInt(16),t.mod=d,t.pow2=function(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n},t.invert=h;const g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function y(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function b(e){const t=y(e);return t+Math.ceil(t/2)}t.validateField=function(e){const t=g.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.validateObject)(e,t)},t.nLength=m,t.Field=function(e,t,r=!1,o={}){if(e<=i)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:a,nByteLength:c}=m(e,t);if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");const u=p(e),l=Object.freeze({ORDER:e,BITS:a,BYTES:c,MASK:(0,n.bitMask)(a),ZERO:i,ONE:s,create:t=>d(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return i<=t&&t<e},is0:e=>e===i,isOdd:e=>(e&s)===s,neg:t=>d(-t,e),eql:(e,t)=>e===t,sqr:t=>d(t*t,e),add:(t,r)=>d(t+r,e),sub:(t,r)=>d(t-r,e),mul:(t,r)=>d(t*r,e),pow:(e,t)=>function(e,t,r){if(r<i)throw new Error("Expected power > 0");if(r===i)return e.ONE;if(r===s)return t;let n=e.ONE,o=t;for(;r>i;)r&s&&(n=e.mul(n,o)),o=e.sqr(o),r>>=s;return n}(l,e,t),div:(t,r)=>d(t*h(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>h(t,e),sqrt:o.sqrt||(e=>u(l,e)),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}(l,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.numberToBytesLE)(e,c):(0,n.numberToBytesBE)(e,c),fromBytes:e=>{if(e.length!==c)throw new Error(`Fp.fromBytes: expected ${c}, got ${e.length}`);return r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(l)},t.getMinHashLength=b,t.mapHashToField=function(e,t,r=!1){const i=e.length,o=y(t),a=b(t);if(i<16||i<a||i>1024)throw new Error(`expected ${a}-1024 bytes of input, got ${i}`);const c=d(r?(0,n.bytesToNumberBE)(e):(0,n.bytesToNumberLE)(e),t-s)+s;return r?(0,n.numberToBytesLE)(c,o):(0,n.numberToBytesBE)(c,o)}},1484(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateObject=t.createHmacDrbg=t.bitMask=t.bitSet=t.bitGet=t.bitLen=t.utf8ToBytes=t.equalBytes=t.concatBytes=t.ensureBytes=t.numberToVarBytesBE=t.numberToBytesLE=t.numberToBytesBE=t.bytesToNumberLE=t.bytesToNumberBE=t.hexToBytes=t.hexToNumber=t.numberToHexUnpadded=t.bytesToHex=void 0;const r=BigInt(0),n=BigInt(1),i=BigInt(2),s=e=>e instanceof Uint8Array,o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e){if(!s(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t}function c(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function u(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function l(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),s=Number.parseInt(i,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");r[t]=s}return r}function d(e,t){return l(e.toString(16).padStart(2*t,"0"))}function f(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let r=0;return e.forEach(e=>{if(!s(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length}),t}t.bytesToHex=a,t.numberToHexUnpadded=c,t.hexToNumber=u,t.hexToBytes=l,t.bytesToNumberBE=function(e){return u(a(e))},t.bytesToNumberLE=function(e){if(!s(e))throw new Error("Uint8Array expected");return u(a(Uint8Array.from(e).reverse()))},t.numberToBytesBE=d,t.numberToBytesLE=function(e,t){return d(e,t).reverse()},t.numberToVarBytesBE=function(e){return l(c(e))},t.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=l(t)}catch(r){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!s(t))throw new Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n},t.concatBytes=f,t.equalBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))},t.bitLen=function(e){let t;for(t=0;e>r;e>>=n,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&n},t.bitSet=(e,t,i)=>e|(i?n:r)<<BigInt(t),t.bitMask=e=>(i<<BigInt(e-1))-n;const h=e=>new Uint8Array(e),p=e=>Uint8Array.from(e);t.createHmacDrbg=function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=h(e),i=h(e),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...e)=>r(i,n,...e),c=(e=h())=>{i=a(p([0]),e),n=a(),0!==e.length&&(i=a(p([1]),e),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=a();const t=n.slice();r.push(t),e+=n.length}return f(...r)};return(e,t)=>{let r;for(o(),c(e);!(r=t(u()));)c();return o(),r}};const g={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};t.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=g[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const s=e[t];if(!(n&&void 0===s||i(s,e)))throw new Error(`Invalid param ${String(t)}=${s} (${typeof s}), expected ${r}`)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}},1705(e,t,r){"use strict";t.mapToCurveSimpleSWU=t.weierstrass=t.Wi=void 0;const n=r(4967),i=r(1484),s=r(1484),o=r(2422),{bytesToNumberBE:a,hexToBytes:c}=i;t.Wi={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:r}=t.Wi;if(e.length<2||2!==e[0])throw new r("Invalid signature integer tag");const n=e[1],i=e.subarray(2,n+2);if(!n||i.length!==n)throw new r("Invalid signature integer: wrong length");if(128&i[0])throw new r("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new r("Invalid signature integer: unnecessary leading zero");return{d:a(i),l:e.subarray(n+2)}},toSig(e){const{Err:r}=t.Wi,n="string"==typeof e?c(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let i=n.length;if(i<2||48!=n[0])throw new r("Invalid signature tag");if(n[1]!==i-2)throw new r("Invalid signature: incorrect length");const{d:s,l:o}=t.Wi._parseInt(n.subarray(2)),{d:a,l:u}=t.Wi._parseInt(o);if(u.length)throw new r("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),s=n.length/2,o=i.length/2,a=r(s),c=r(o);return`30${r(o+s+4)}02${c}${i}02${a}${n}`}};const u=BigInt(0),l=BigInt(1),d=BigInt(2),f=BigInt(3),h=BigInt(4);t.weierstrass=function(e){const r=function(e){const t=(0,o.validateBasic)(e);return i.validateObject(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:a,n:c}=r,d=a.BYTES+1,h=2*a.BYTES+1;function p(e){return n.mod(e,c)}function g(e){return n.invert(e,c)}const{ProjectivePoint:m,normPrivateKeyToScalar:y,weierstrassEquation:b,isWithinCurveOrder:w}=function(e){const t=function(e){const t=(0,o.validateBasic)(e);i.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:s}=t;if(r){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,a=t.toBytes||((e,t,n)=>{const s=t.toAffine();return i.concatBytes(Uint8Array.from([4]),r.toBytes(s.x),r.toBytes(s.y))}),c=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function d(e){const{a:n,b:i}=t,s=r.sqr(e),o=r.mul(s,e);return r.add(r.add(o,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),d(t.Gx)))throw new Error("bad generator point: equation left != right");function h(e){return"bigint"==typeof e&&u<e&&e<t.n}function p(e){if(!h(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function g(e){const{allowedPrivateKeyLengths:r,nByteLength:o,wrapPrivateKey:a,n:c}=t;if(r&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=i.bytesToHex(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*o,"0")}let u;try{u="bigint"==typeof e?e:i.bytesToNumberBE((0,s.ensureBytes)("private key",e,o))}catch(t){throw new Error(`private key must be ${o} bytes, hex or bigint, not ${typeof e}`)}return a&&(u=n.mod(u,c)),p(u),u}const m=new Map;function y(e){if(!(e instanceof b))throw new Error("ProjectivePoint expected")}class b{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof b)throw new Error("projective point not allowed");const i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?b.ZERO:new b(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(b.fromAffine)}static fromHex(e){const t=b.fromAffine(c((0,s.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return b.BASE.multiply(g(e))}_setWindowSize(e){this._WINDOW_SIZE=e,m.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw new Error("bad point: x or y not FE");const i=r.sqr(n),s=d(e);if(!r.eql(i,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){y(e);const{px:t,py:n,pz:i}=this,{px:s,py:o,pz:a}=e,c=r.eql(r.mul(t,a),r.mul(s,i)),u=r.eql(r.mul(n,a),r.mul(o,i));return c&&u}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,i=r.mul(n,f),{px:s,py:o,pz:a}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,d=r.mul(s,s),h=r.mul(o,o),p=r.mul(a,a),g=r.mul(s,o);return g=r.add(g,g),l=r.mul(s,a),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,p),u=r.add(c,u),c=r.sub(h,u),u=r.add(h,u),u=r.mul(c,u),c=r.mul(g,c),l=r.mul(i,l),p=r.mul(e,p),g=r.sub(d,p),g=r.mul(e,g),g=r.add(g,l),l=r.add(d,d),d=r.add(l,d),d=r.add(d,p),d=r.mul(d,g),u=r.add(u,d),p=r.mul(o,a),p=r.add(p,p),d=r.mul(p,g),c=r.sub(c,d),l=r.mul(p,h),l=r.add(l,l),l=r.add(l,l),new b(c,u,l)}add(e){y(e);const{px:n,py:i,pz:s}=this,{px:o,py:a,pz:c}=e;let u=r.ZERO,l=r.ZERO,d=r.ZERO;const h=t.a,p=r.mul(t.b,f);let g=r.mul(n,o),m=r.mul(i,a),w=r.mul(s,c),_=r.add(n,i),v=r.add(o,a);_=r.mul(_,v),v=r.add(g,m),_=r.sub(_,v),v=r.add(n,s);let A=r.add(o,c);return v=r.mul(v,A),A=r.add(g,w),v=r.sub(v,A),A=r.add(i,s),u=r.add(a,c),A=r.mul(A,u),u=r.add(m,w),A=r.sub(A,u),d=r.mul(h,v),u=r.mul(p,w),d=r.add(u,d),u=r.sub(m,d),d=r.add(m,d),l=r.mul(u,d),m=r.add(g,g),m=r.add(m,g),w=r.mul(h,w),v=r.mul(p,v),m=r.add(m,w),w=r.sub(g,w),w=r.mul(h,w),v=r.add(v,w),g=r.mul(m,v),l=r.add(l,g),g=r.mul(A,v),u=r.mul(_,u),u=r.sub(u,g),g=r.mul(_,m),d=r.mul(A,d),d=r.add(d,g),new b(u,l,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(b.ZERO)}wNAF(e){return _.wNAFCached(this,m,e,e=>{const t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(b.fromAffine)})}multiplyUnsafe(e){const n=b.ZERO;if(e===u)return n;if(p(e),e===l)return this;const{endo:i}=t;if(!i)return _.unsafeLadder(this,e);let{k1neg:s,k1:o,k2neg:a,k2:c}=i.splitScalar(e),d=n,f=n,h=this;for(;o>u||c>u;)o&l&&(d=d.add(h)),c&l&&(f=f.add(h)),h=h.double(),o>>=l,c>>=l;return s&&(d=d.negate()),a&&(f=f.negate()),f=new b(r.mul(f.px,i.beta),f.py,f.pz),d.add(f)}multiply(e){p(e);let n,i,s=e;const{endo:o}=t;if(o){const{k1neg:e,k1:t,k2neg:a,k2:c}=o.splitScalar(s);let{p:u,f:l}=this.wNAF(t),{p:d,f}=this.wNAF(c);u=_.constTimeNegate(e,u),d=_.constTimeNegate(a,d),d=new b(r.mul(d.px,o.beta),d.py,d.pz),n=u.add(d),i=l.add(f)}else{const{p:e,f:t}=this.wNAF(s);n=e,i=t}return b.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){const n=b.BASE,i=(e,t)=>t!==u&&t!==l&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){const{px:t,py:n,pz:i}=this,s=this.is0();null==e&&(e=s?r.ONE:r.inv(i));const o=r.mul(t,e),a=r.mul(n,e),c=r.mul(i,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw new Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===l)return!0;if(r)return r(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===l?this:r?r(b,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),a(b,this,e)}toHex(e=!0){return i.bytesToHex(this.toRawBytes(e))}}b.BASE=new b(t.Gx,t.Gy,r.ONE),b.ZERO=new b(r.ZERO,r.ONE,r.ZERO);const w=t.nBitLength,_=(0,o.wNAF)(b,t.endo?Math.ceil(w/2):w);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:g,weierstrassEquation:d,isWithinCurveOrder:h}}({...r,toBytes(e,t,r){const n=t.toAffine(),s=a.toBytes(n.x),o=i.concatBytes;return r?o(Uint8Array.from([t.hasEvenY()?2:3]),s):o(Uint8Array.from([4]),s,a.toBytes(n.y))},fromBytes(e){const t=e.length,r=e[0],n=e.subarray(1);if(t!==d||2!==r&&3!==r){if(t===h&&4===r)return{x:a.fromBytes(n.subarray(0,a.BYTES)),y:a.fromBytes(n.subarray(a.BYTES,2*a.BYTES))};throw new Error(`Point of length ${t} was invalid. Expected ${d} compressed bytes or ${h} uncompressed bytes`)}{const e=i.bytesToNumberBE(n);if(!(u<(s=e)&&s<a.ORDER))throw new Error("Point is not on curve");const t=b(e);let o=a.sqrt(t);return!(1&~r)!=((o&l)===l)&&(o=a.neg(o)),{x:e,y:o}}var s}}),_=e=>i.bytesToHex(i.numberToBytesBE(e,r.nByteLength));function v(e){return e>c>>l}const A=(e,t,r)=>i.bytesToNumberBE(e.slice(t,r));class k{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const t=r.nByteLength;return e=(0,s.ensureBytes)("compactSignature",e,2*t),new k(A(e,0,t),A(e,t,2*t))}static fromDER(e){const{r,s:n}=t.Wi.toSig((0,s.ensureBytes)("DER",e));return new k(r,n)}assertValidity(){if(!w(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new k(this.r,this.s,e)}recoverPublicKey(e){const{r:t,s:n,recovery:i}=this,o=O((0,s.ensureBytes)("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const c=2===i||3===i?t+r.n:t;if(c>=a.ORDER)throw new Error("recovery id 2 or 3 invalid");const u=1&i?"03":"02",l=m.fromHex(u+_(c)),d=g(c),f=p(-o*d),h=p(n*d),y=m.BASE.multiplyAndAddUnsafe(l,f,h);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new k(this.r,p(-this.s),this.recovery):this}toDERRawBytes(){return i.hexToBytes(this.toDERHex())}toDERHex(){return t.Wi.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return i.hexToBytes(this.toCompactHex())}toCompactHex(){return _(this.r)+_(this.s)}}const P={isValidPrivateKey(e){try{return y(e),!0}catch(e){return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{const e=n.getMinHashLength(r.n);return n.mapHashToField(r.randomBytes(e),r.n)},precompute:(e=8,t=m.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function E(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===d||n===h:r?n===2*d||n===2*h:e instanceof m}const x=r.bits2int||function(e){const t=i.bytesToNumberBE(e),n=8*e.length-r.nBitLength;return n>0?t>>BigInt(n):t},O=r.bits2int_modN||function(e){return p(x(e))},S=i.bitMask(r.nBitLength);function T(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(u<=e&&e<S))throw new Error(`bigint expected < 2^${r.nBitLength}`);return i.numberToBytesBE(e,r.nByteLength)}const B={lowS:r.lowS,prehash:!1},R={lowS:r.lowS,prehash:!1};return m.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(e,t=!0){return m.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(E(e))throw new Error("first arg must be private key");if(!E(t))throw new Error("second arg must be public key");return m.fromHex(t).multiply(y(e)).toRawBytes(r)},sign:function(e,t,n=B){const{seed:o,k2sig:c}=function(e,t,n=B){if(["recovered","canonical"].some(e=>e in n))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:c}=r;let{lowS:d,prehash:f,extraEntropy:h}=n;null==d&&(d=!0),e=(0,s.ensureBytes)("msgHash",e),f&&(e=(0,s.ensureBytes)("prehashed msgHash",o(e)));const b=O(e),_=y(t),A=[T(_),T(b)];if(null!=h){const e=!0===h?c(a.BYTES):h;A.push((0,s.ensureBytes)("extraEntropy",e))}const P=i.concatBytes(...A),E=b;return{seed:P,k2sig:function(e){const t=x(e);if(!w(t))return;const r=g(t),n=m.BASE.multiply(t).toAffine(),i=p(n.x);if(i===u)return;const s=p(r*p(E+i*_));if(s===u)return;let o=(n.x===i?0:2)|Number(n.y&l),a=s;return d&&v(s)&&(a=function(e){return v(e)?p(-e):e}(s),o^=1),new k(i,a,o)}}}(e,t,n),d=r;return i.createHmacDrbg(d.hash.outputLen,d.nByteLength,d.hmac)(o,c)},verify:function(e,n,i,o=R){const a=e;if(n=(0,s.ensureBytes)("msgHash",n),i=(0,s.ensureBytes)("publicKey",i),"strict"in o)throw new Error("options.strict was renamed to lowS");const{lowS:c,prehash:u}=o;let l,d;try{if("string"==typeof a||a instanceof Uint8Array)try{l=k.fromDER(a)}catch(e){if(!(e instanceof t.Wi.Err))throw e;l=k.fromCompact(a)}else{if("object"!=typeof a||"bigint"!=typeof a.r||"bigint"!=typeof a.s)throw new Error("PARSE");{const{r:e,s:t}=a;l=new k(e,t)}}d=m.fromHex(i)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&l.hasHighS())return!1;u&&(n=r.hash(n));const{r:f,s:h}=l,y=O(n),b=g(h),w=p(y*b),_=p(f*b),v=m.BASE.multiplyAndAddUnsafe(d,w,_)?.toAffine();return!!v&&p(v.x)===f},ProjectivePoint:m,Signature:k,utils:P}},t.mapToCurveSimpleSWU=function(e,t){if(n.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const r=function(e,t){const r=e.ORDER;let n=u;for(let e=r-l;e%d===u;e/=d)n+=l;const i=n,s=d<<i-l-l,o=s*d,a=(r-l)/o,c=(a-l)/d,p=o-l,g=s,m=e.pow(t,a),y=e.pow(t,(a+l)/d);let b=(t,r)=>{let n=m,s=e.pow(r,p),o=e.sqr(s);o=e.mul(o,r);let a=e.mul(t,o);a=e.pow(a,c),a=e.mul(a,s),s=e.mul(a,r),o=e.mul(a,t);let u=e.mul(o,s);a=e.pow(u,g);let f=e.eql(a,e.ONE);s=e.mul(o,y),a=e.mul(u,n),o=e.cmov(s,o,f),u=e.cmov(a,u,f);for(let t=i;t>l;t--){let r=t-d;r=d<<r-l;let i=e.pow(u,r);const a=e.eql(i,e.ONE);s=e.mul(o,n),n=e.mul(n,n),i=e.mul(u,n),o=e.cmov(s,o,a),u=e.cmov(i,u,a)}return{isValid:f,value:o}};if(e.ORDER%h===f){const r=(e.ORDER-f)/h,n=e.sqrt(e.neg(t));b=(t,i)=>{let s=e.sqr(i);const o=e.mul(t,i);s=e.mul(s,o);let a=e.pow(s,r);a=e.mul(a,o);const c=e.mul(a,n),u=e.mul(e.sqr(a),i),l=e.eql(u,t);return{isValid:l,value:e.cmov(c,a,l)}}}return b}(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let i,s,o,a,c,u,l,d;i=e.sqr(n),i=e.mul(i,t.Z),s=e.sqr(i),s=e.add(s,i),o=e.add(s,e.ONE),o=e.mul(o,t.B),a=e.cmov(t.Z,e.neg(s),!e.eql(s,e.ZERO)),a=e.mul(a,t.A),s=e.sqr(o),u=e.sqr(a),c=e.mul(u,t.A),s=e.add(s,c),s=e.mul(s,o),u=e.mul(u,a),c=e.mul(u,t.B),s=e.add(s,c),l=e.mul(i,o);const{isValid:f,value:h}=r(s,u);d=e.mul(i,n),d=e.mul(d,h),l=e.cmov(l,o,f),d=e.cmov(d,h,f);const p=e.isOdd(n)===e.isOdd(d);return d=e.cmov(e.neg(d),d,p),l=e.div(l,a),{x:l,y:d}}}},8510(e,t,r){"use strict";t.secp256k1=void 0;const n=r(2623),i=(r(9175),r(4967)),s=r(1705),o=r(1484),a=r(1761),c=r(3562),u=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),l=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),d=BigInt(1),f=BigInt(2),h=(e,t)=>(e+t/f)/t;function p(e){const t=u,r=BigInt(3),n=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),d=e*e*e%t,h=d*d*e%t,p=(0,i.pow2)(h,r,t)*h%t,m=(0,i.pow2)(p,r,t)*h%t,y=(0,i.pow2)(m,f,t)*d%t,b=(0,i.pow2)(y,s,t)*y%t,w=(0,i.pow2)(b,o,t)*b%t,_=(0,i.pow2)(w,c,t)*w%t,v=(0,i.pow2)(_,l,t)*_%t,A=(0,i.pow2)(v,c,t)*w%t,k=(0,i.pow2)(A,r,t)*h%t,P=(0,i.pow2)(k,a,t)*b%t,E=(0,i.pow2)(P,n,t)*d%t,x=(0,i.pow2)(E,f,t);if(!g.eql(g.sqr(x),e))throw new Error("Cannot find square root");return x}const g=(0,i.Field)(u,void 0,void 0,{sqrt:p});t.secp256k1=(0,c.createCurve)({a:BigInt(0),b:BigInt(7),Fp:g,n:l,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=l,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-d*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=h(o*e,t),u=h(-n*e,t);let f=(0,i.mod)(e-c*r-u*s,t),p=(0,i.mod)(-c*n-u*o,t);const g=f>a,m=p>a;if(g&&(f=t-f),m&&(p=t-p),f>a||p>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:g,k1:f,k2neg:m,k2:p}}}},n.sha256);BigInt(0);t.secp256k1.ProjectivePoint;t.secp256k1.utils.randomPrivateKey,o.numberToBytesBE,o.bytesToNumberBE,i.mod;const m=(()=>(0,a.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>BigInt(e)))))(),y=(()=>(0,s.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))}))(),b=(()=>(0,a.createHasher)(t.secp256k1.ProjectivePoint,e=>{const{x:t,y:r}=y(g.create(e[0]));return m(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:n.sha256}))();b.hashToCurve,b.encodeToCurve},7557(e,t){"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}t.output=t.exists=t.hash=t.bytes=t.number=void 0,t.number=r,t.bytes=n,t.hash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)},t.exists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},t.output=function(e,t){n(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}},915(e,t,r){"use strict";t.SHA2=void 0;const n=r(7557),i=r(9175);class s extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){(0,n.exists)(this);const{view:t,buffer:r,blockLen:s}=this,o=(e=(0,i.toBytes)(e)).length;for(let n=0;n<o;){const a=Math.min(s-this.pos,o-n);if(a===s){const t=(0,i.createView)(e);for(;s<=o-n;n+=s)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:o}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(r,0),a=0);for(let e=a;e<s;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,u=n?0:4;e.setUint32(t+c,o,n),e.setUint32(t+u,a,n)}(r,s-8,BigInt(8*this.length),o),this.process(r,0);const c=(0,i.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,d=this.get();if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)c.setUint32(4*e,d[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.length=n,e.pos=o,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}t.SHA2=s},2318(e,t){"use strict";t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.split=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function s(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:o,l:a}=i(e[s],t);[r[s],n[s]]=[o,a]}return[r,n]}t.split=s;const o=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=o;const a=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=a;const c=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=c;const u=(e,t,r)=>e<<r-32|t>>>64-r;t.rotlBL=u;const l={fromBig:i,split:s,toBig:(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:o,rotlSL:a,rotlBH:c,rotlBL:u,add:function(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,s)=>t+r+n+i+s+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};t.default=l},5145(e,t){"use strict";t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},9615(e,t,r){"use strict";t.hmac=void 0;const n=r(7557),i=r(9175);class s extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.hash)(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(r.length>s?e.create().update(r).digest():r);for(let e=0;e<o.length;e++)o[e]^=54;this.iHash.update(o),this.oHash=e.create();for(let e=0;e<o.length;e++)o[e]^=106;this.oHash.update(o),o.fill(0)}update(e){return(0,n.exists)(this),this.iHash.update(e),this}digestInto(e){(0,n.exists)(this),(0,n.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:o}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.hmac=(e,t,r)=>new s(e,t).update(r).digest(),t.hmac.create=(e,t)=>new s(e,t)},8941(e,t,r){"use strict";t.pbkdf2=void 0;const n=r(7557),i=r(9615),s=r(9175);t.pbkdf2=function(e,t,r,o){const{c:a,dkLen:c,DK:u,PRF:l,PRFSalt:d}=function(e,t,r,o){(0,n.hash)(e);const a=(0,s.checkOpts)({dkLen:32,asyncTick:10},o),{c,dkLen:u,asyncTick:l}=a;if((0,n.number)(c),(0,n.number)(u),(0,n.number)(l),c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const d=(0,s.toBytes)(t),f=(0,s.toBytes)(r),h=new Uint8Array(u),p=i.hmac.create(e,d),g=p._cloneInto().update(f);return{c,dkLen:u,asyncTick:l,DK:h,PRF:p,PRFSalt:g}}(e,t,r,o);let f;const h=new Uint8Array(4),p=(0,s.createView)(h),g=new Uint8Array(l.outputLen);for(let e=1,t=0;t<c;e++,t+=l.outputLen){const r=u.subarray(t,t+l.outputLen);p.setInt32(0,e,!1),(f=d._cloneInto(f)).update(h).digestInto(g),r.set(g.subarray(0,r.length));for(let e=1;e<a;e++){l._cloneInto(f).update(g).digestInto(g);for(let e=0;e<r.length;e++)r[e]^=g[e]}}return function(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}(l,d,u,f,g)}},3238(e,t,r){"use strict";t.ripemd160=void 0;const n=r(915),i=r(9175),s=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),o=Uint8Array.from({length:16},(e,t)=>t);let a=[o],c=[o.map(e=>(9*e+5)%16)];for(let e=0;e<4;e++)for(let t of[a,c])t.push(t[e].map(e=>s[e]));const u=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),l=a.map((e,t)=>e.map(e=>u[t][e])),d=c.map((e,t)=>e.map(e=>u[t][e])),f=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),h=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),p=(e,t)=>e<<t|e>>>32-t;function g(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const m=new Uint32Array(16);class y extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)m[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,s=i,o=0|this.h2,u=o,y=0|this.h3,b=y,w=0|this.h4,_=w;for(let e=0;e<5;e++){const t=4-e,v=f[e],A=h[e],k=a[e],P=c[e],E=l[e],x=d[e];for(let t=0;t<16;t++){const n=p(r+g(e,i,o,y)+m[k[t]]+v,E[t])+w|0;r=w,w=y,y=0|p(o,10),o=i,i=n}for(let e=0;e<16;e++){const r=p(n+g(t,s,u,b)+m[P[e]]+A,x[e])+_|0;n=_,_=b,b=0|p(u,10),u=s,s=r}}this.set(this.h1+o+b|0,this.h2+y+_|0,this.h3+w+n|0,this.h4+r+s|0,this.h0+i+u|0)}roundClean(){m.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.ripemd160=(0,i.wrapConstructor)(()=>new y)},5663(e,t,r){"use strict";t.scryptAsync=t.scrypt=void 0;const n=r(7557),i=r(2623),s=r(8941),o=r(9175),a=(e,t)=>e<<t|e>>>32-t;function c(e,t,r,n,i,s){let o=e[t++]^r[n++],c=e[t++]^r[n++],u=e[t++]^r[n++],l=e[t++]^r[n++],d=e[t++]^r[n++],f=e[t++]^r[n++],h=e[t++]^r[n++],p=e[t++]^r[n++],g=e[t++]^r[n++],m=e[t++]^r[n++],y=e[t++]^r[n++],b=e[t++]^r[n++],w=e[t++]^r[n++],_=e[t++]^r[n++],v=e[t++]^r[n++],A=e[t++]^r[n++],k=o,P=c,E=u,x=l,O=d,S=f,T=h,B=p,R=g,N=m,C=y,I=b,F=w,U=_,j=v,L=A;for(let e=0;e<8;e+=2)O^=a(k+F|0,7),R^=a(O+k|0,9),F^=a(R+O|0,13),k^=a(F+R|0,18),N^=a(S+P|0,7),U^=a(N+S|0,9),P^=a(U+N|0,13),S^=a(P+U|0,18),j^=a(C+T|0,7),E^=a(j+C|0,9),T^=a(E+j|0,13),C^=a(T+E|0,18),x^=a(L+I|0,7),B^=a(x+L|0,9),I^=a(B+x|0,13),L^=a(I+B|0,18),P^=a(k+x|0,7),E^=a(P+k|0,9),x^=a(E+P|0,13),k^=a(x+E|0,18),T^=a(S+O|0,7),B^=a(T+S|0,9),O^=a(B+T|0,13),S^=a(O+B|0,18),I^=a(C+N|0,7),R^=a(I+C|0,9),N^=a(R+I|0,13),C^=a(N+R|0,18),F^=a(L+j|0,7),U^=a(F+L|0,9),j^=a(U+F|0,13),L^=a(j+U|0,18);i[s++]=o+k|0,i[s++]=c+P|0,i[s++]=u+E|0,i[s++]=l+x|0,i[s++]=d+O|0,i[s++]=f+S|0,i[s++]=h+T|0,i[s++]=p+B|0,i[s++]=g+R|0,i[s++]=m+N|0,i[s++]=y+C|0,i[s++]=b+I|0,i[s++]=w+F|0,i[s++]=_+U|0,i[s++]=v+j|0,i[s++]=A+L|0}function u(e,t,r,n,i){let s=n+0,o=n+16*i;for(let n=0;n<16;n++)r[o+n]=e[t+16*(2*i-1)+n];for(let n=0;n<i;n++,s+=16,t+=16)c(r,o,e,t,r,s),n>0&&(o+=16),c(r,s,e,t+=16,r,o)}function l(e,t,r){const a=(0,o.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:c,r:u,p:l,dkLen:d,asyncTick:f,maxmem:h,onProgress:p}=a;if((0,n.number)(c),(0,n.number)(u),(0,n.number)(l),(0,n.number)(d),(0,n.number)(f),(0,n.number)(h),void 0!==p&&"function"!=typeof p)throw new Error("progressCb should be function");const g=128*u,m=g/4;if(c<=1||c&c-1||c>=2**(g/8)||c>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(l<0||l>137438953440/g)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(d<0||d>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const y=g*(c+l);if(y>h)throw new Error(`Scrypt: parameters too large, ${y} (128 * r * (N + p)) > ${h} (maxmem)`);const b=(0,s.pbkdf2)(i.sha256,e,t,{c:1,dkLen:g*l}),w=(0,o.u32)(b),_=(0,o.u32)(new Uint8Array(g*c)),v=(0,o.u32)(new Uint8Array(g));let A=()=>{};if(p){const e=2*c*l,t=Math.max(Math.floor(e/1e4),1);let r=0;A=()=>{r++,!p||r%t&&r!==e||p(r/e)}}return{N:c,r:u,p:l,dkLen:d,blockSize32:m,V:_,B32:w,B:b,tmp:v,blockMixCb:A,asyncTick:f}}function d(e,t,r,n,o){const a=(0,s.pbkdf2)(i.sha256,e,r,{c:1,dkLen:t});return r.fill(0),n.fill(0),o.fill(0),a}t.scrypt=function(e,t,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:a,V:c,B32:f,B:h,tmp:p,blockMixCb:g}=l(e,t,r);for(let e=0;e<s;e++){const t=a*e;for(let e=0;e<a;e++)c[e]=f[t+e];for(let e=0,t=0;e<n-1;e++)u(c,t,c,t+=a,i),g();u(c,(n-1)*a,f,t,i),g();for(let e=0;e<n;e++){const e=f[t+a-16]%n;for(let r=0;r<a;r++)p[r]=f[t+r]^c[e*a+r];u(p,0,f,t,i),g()}}return d(e,o,h,c,p)},t.scryptAsync=async function(e,t,r){const{N:n,r:i,p:s,dkLen:a,blockSize32:c,V:f,B32:h,B:p,tmp:g,blockMixCb:m,asyncTick:y}=l(e,t,r);for(let e=0;e<s;e++){const t=c*e;for(let e=0;e<c;e++)f[e]=h[t+e];let r=0;await(0,o.asyncLoop)(n-1,y,()=>{u(f,r,f,r+=c,i),m()}),u(f,(n-1)*c,h,t,i),m(),await(0,o.asyncLoop)(n,y,()=>{const e=h[t+c-16]%n;for(let r=0;r<c;r++)g[r]=h[t+r]^f[e*c+r];u(g,0,h,t,i),m()})}return d(e,a,p,f,g)}},2623(e,t,r){"use strict";t.sha256=void 0;const n=r(915),i=r(9175),s=(e,t,r)=>e&t^~e&r,o=(e,t,r)=>e&t^e&r^t&r,a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),c=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class l extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[e,t,r,n,i,s,o,a]}set(e,t,r,n,i,s,o,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,s=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=s+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:c,D:l,E:d,F:f,G:h,H:p}=this;for(let e=0;e<64;e++){const t=p+((0,i.rotr)(d,6)^(0,i.rotr)(d,11)^(0,i.rotr)(d,25))+s(d,f,h)+a[e]+u[e]|0,g=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,c)|0;p=h,h=f,f=d,d=l+t|0,l=c,c=n,n=r,r=t+g|0}r=r+this.A|0,n=n+this.B|0,c=c+this.C|0,l=l+this.D|0,d=d+this.E|0,f=f+this.F|0,h=h+this.G|0,p=p+this.H|0,this.set(r,n,c,l,d,f,h,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class d extends l{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new l),(0,i.wrapConstructor)(()=>new d)},5336(e,t,r){"use strict";t.keccak_256=void 0;const n=r(7557),i=r(2318),s=r(9175),[o,a,c]=[[],[],[]],u=BigInt(0),l=BigInt(1),d=BigInt(2),f=BigInt(7),h=BigInt(256),p=BigInt(113);for(let e=0,t=l,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],o.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let i=u;for(let e=0;e<7;e++)t=(t<<l^(t>>f)*p)%h,t&d&&(i^=l<<(l<<BigInt(e))-l);c.push(i)}const[g,m]=(0,i.split)(c,!0),y=(e,t,r)=>r>32?(0,i.rotlBH)(e,t,r):(0,i.rotlSH)(e,t,r),b=(e,t,r)=>r>32?(0,i.rotlBL)(e,t,r):(0,i.rotlSL)(e,t,r);class w extends s.Hash{constructor(e,t,r,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.number)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,s.u32)(this.state)}keccak(){(function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,s=r[i],o=r[i+1],a=y(s,o,1)^r[n],c=b(s,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=a[r],s=y(t,i,n),c=b(t,i,n),u=o[r];t=e[u],i=e[u+1],e[u]=s,e[u+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=g[n],e[1]^=m[n]}r.fill(0)})(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,n.exists)(this);const{blockLen:t,state:r}=this,i=(e=(0,s.toBytes)(e)).length;for(let n=0;n<i;){const s=Math.min(t-this.pos,i-n);for(let t=0;t<s;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,n.exists)(this,!1),(0,n.bytes)(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,n.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new w(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}const _=(e,t,r)=>(0,s.wrapConstructor)(()=>new w(t,e,r));_(6,144,28),_(6,136,32),_(6,104,48),_(6,72,64),_(1,144,28),t.keccak_256=_(1,136,32),_(1,104,48),_(1,72,64);const v=(e,t,r)=>(0,s.wrapXOFConstructorWithOpts)((n={})=>new w(t,e,void 0===n.dkLen?r:n.dkLen,!0));v(31,168,16),v(31,136,32)},102(e,t,r){"use strict";t.sha512=void 0;const n=r(915),i=r(2318),s=r(9175),[o,a]=(()=>i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),c=new Uint32Array(80),u=new Uint32Array(80);class l extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:o,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:g}=this;return[e,t,r,n,i,s,o,a,c,u,l,d,f,h,p,g]}set(e,t,r,n,i,s,o,a,c,u,l,d,f,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|o,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t),u[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],r=0|u[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),s=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),o=0|c[e-2],a=0|u[e-2],l=i.default.rotrSH(o,a,19)^i.default.rotrBH(o,a,61)^i.default.shrSH(o,a,6),d=i.default.rotrSL(o,a,19)^i.default.rotrBL(o,a,61)^i.default.shrSL(o,a,6),f=i.default.add4L(s,d,u[e-7],u[e-16]),h=i.default.add4H(f,n,l,c[e-7],c[e-16]);c[e]=0|h,u[e]=0|f}let{Ah:r,Al:n,Bh:s,Bl:l,Ch:d,Cl:f,Dh:h,Dl:p,Eh:g,El:m,Fh:y,Fl:b,Gh:w,Gl:_,Hh:v,Hl:A}=this;for(let e=0;e<80;e++){const t=i.default.rotrSH(g,m,14)^i.default.rotrSH(g,m,18)^i.default.rotrBH(g,m,41),k=i.default.rotrSL(g,m,14)^i.default.rotrSL(g,m,18)^i.default.rotrBL(g,m,41),P=g&y^~g&w,E=m&b^~m&_,x=i.default.add5L(A,k,E,a[e],u[e]),O=i.default.add5H(x,v,t,P,o[e],c[e]),S=0|x,T=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),B=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),R=r&s^r&d^s&d,N=n&l^n&f^l&f;v=0|w,A=0|_,w=0|y,_=0|b,y=0|g,b=0|m,({h:g,l:m}=i.default.add(0|h,0|p,0|O,0|S)),h=0|d,p=0|f,d=0|s,f=0|l,s=0|r,l=0|n;const C=i.default.add3L(S,B,N);r=i.default.add3H(C,O,T,R),n=0|C}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:s,l}=i.default.add(0|this.Bh,0|this.Bl,0|s,0|l)),({h:d,l:f}=i.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:g,l:m}=i.default.add(0|this.Eh,0|this.El,0|g,0|m)),({h:y,l:b}=i.default.add(0|this.Fh,0|this.Fl,0|y,0|b)),({h:w,l:_}=i.default.add(0|this.Gh,0|this.Gl,0|w,0|_)),({h:v,l:A}=i.default.add(0|this.Hh,0|this.Hl,0|v,0|A)),this.set(r,n,s,l,d,f,h,p,g,m,y,b,w,_,v,A)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class d extends l{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class f extends l{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class h extends l{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,s.wrapConstructor)(()=>new l),(0,s.wrapConstructor)(()=>new d),(0,s.wrapConstructor)(()=>new f),(0,s.wrapConstructor)(()=>new h)},9175(e,t,r){"use strict";t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.asyncLoop=t.dY=t.qv=t.rotr=t.createView=t.u32=void 0;const n=r(5145),i=e=>e instanceof Uint8Array;if(t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.qv=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.qv)throw new Error("Non little-endian hardware is not supported");function s(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!i(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.dY=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let s=0;s<e;s++){n(s);const e=Date.now()-i;e>=0&&e<r||(await(0,t.dY)(),i+=e)}},t.toBytes=s,t.concatBytes=function(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let r=0;return e.forEach(e=>{if(!i(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length}),t},t.Hash=class{clone(){return this._cloneInto()}};const o={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==o.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},7526(e,t){"use strict";t.toByteArray=function(e){var t,r,s=function(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}(e),o=s[0],a=s[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,a)),u=0,l=a>0?o-4:o;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=16383,a=0,u=n-i;a<u;a+=o)s.push(c(e,a,a+o>u?u:a+o));return 1===i?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function a(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(a(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8287(e,t,r){"use strict";const n=r(7526),i=r(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?a(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),a(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let s,o=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(s=r;s<a;s++)if(u(e,s)===u(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===c)return n*o}else-1!==n&&(s-=s-n),n=-1}else for(r+c>a&&(r=a-c),s=r;s>=0;s--){let r=!0;for(let n=0;n<c;n++)if(u(e,s+n)!==u(t,n)){r=!1;break}if(r)return s}return-1}function _(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const s=t.length;let o;for(n>s/2&&(n=s/2),o=0;o<n;++o){const n=parseInt(t.substr(2*o,2),16);if(Q(n))return o;e[r+o]=n}return o}function v(e,t,r,n){return K(z(t,e.length-r),e,r,n)}function A(e,t,r,n){return K(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return K(V(t),e,r,n)}function P(e,t,r,n){return K(function(e,t){let r,n,i;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,c;switch(o){case 1:t<128&&(s=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(s=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(J(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0);const a=Math.min(s,o),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==l[e]){s=u[e],o=l[e];break}return s<o?-1:o<s?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return A(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function S(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,i,s){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i){G(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function F(e,t,r,n,i){G(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function U(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,s){return t=+t,r>>>=0,s||U(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,s){return t=+t,r>>>=0,s||U(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),c.prototype.readBigUInt64BE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},c.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||q(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Y(function(e,t=0){return I(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Y(function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Y(function(e,t=0){return I(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Y(function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const s=c.isBuffer(e)?e:c.from(e,n),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%o]}return this};const D={};function M(e,t,r){D[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function $(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function G(e,t,r,n,i,s){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new D.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||q(t,e.length-(r+1))}(n,i,s)}function H(e,t){if("number"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,"number",e)}function q(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}M("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),M("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const s=[];for(let o=0;o<n;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function V(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},8368(e,t,r){const n=r(6070),i=n._argv_get,s=n._argv_url_get,o=n._child_process_spawn_get,a=o(),c=o("async"),u=(0,n._process_exit_get)(),l=(0,n._process_cwd_get)(),d=l,f=n._yargv_get,h=r(6314),p=h._basename,g=h._dirname,m=(h._file_append,h._file_exists,h._path_join),y=h._stat;function b(e,t){let r;return void 0===t||""==t?r=`${e}: {_msg}`:"string"!=typeof t&&""==t||(r=`[${t}] ${e}: {_msg}`),r}function w(e){let t;"n"==quiet&&(_template=b("WARNING",app_name),t=_template.replaceAll("{_msg}",e),console.warn(t))}function _(e){let t;"undefined"!=typeof quiet&&""!=quiet||(quiet="y"),"n"==quiet&&(t=b("INFO",app_name).replaceAll("{_msg}",e),console.log(t))}function v(e,t){let r,n;"undefined"==typeof app_name||app_name,t=String(t),r=b("ERROR",app_name),n=r.replaceAll("{_msg}",e),"1"===t?(console.error(n),u(1)):"0"===t&&console.warn(n)}function A(e,t){let r;return void 0===t&&(t=e,e=0),r=t-e,r<0?(_msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),[]):Array(r).keys().map(t=>t+e)}function k(e){return new Promise(t=>setTimeout(t,e))}e.exports={_argv_get:i,_argv_url_get:s,_app_name_get:function(){let e;return e=p("/index.js"),e},_basename:h._basename,_cat:h._cat,_cmdline_check:function(e){let t,r,n;return"undefined"==typeof window&&(t=i(),r=t[1],void 0===r&&(r=t.$0),n=p(r),n==e)},_dirname:g,_echo:function(e){console.log(e)},_error_display:function(e){let t;"object"==typeof error?(t="error"in e&&null!=e.error&&"message"in e.error?e.error.message:"shortMessage"in e?e.shortMessage:e,console.error(e)):(t=e,console.error(e)),v(t,0)},_ext_rm:h._ext_rm,_dir_exists:h._dir_exists,_file_append:h._file_append,_file_exists:h._file_exists,_file_read:h._file_read,_file_write:h._file_write,_fs_worker_new:h._fs_worker_new,_fs_worker_start:h._fs_worker_start,_get_date_human:function(){const e=new Date;return`${e.getFullYear()}-${e.getMonth()}-${e.getDay()}T${e.getHours()}:${e.getMinutes()}+0000`},_globals:function(){app_name="",quiet="y"},_homedir_get:function(){let e;return"undefined"==typeof window&&void 0!==r.g&&(r.g.global,r.g),"undefined"!=typeof window&&(e="/home/user"),e},_json_display:h._json_display,_json_read:h._json_read,_lib_get:async function(){let e;return new Set,"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e="/usr/lib"),e},_ls:h._ls,_mkdir:h._mkdir,_mktemp:h._mktemp,_msg_info:_,_msg_error:v,_msg_warning:w,_msg_info_obj:function(e,t){let r;r=`${e}: '${t}'`,_(r)},_mv:h._mv,_path_join:m,_printf:function(e){"undefined"==typeof window&&(_stdout=process.stdout),"undefined"!=typeof window&&(_stdout=r(8310)),_stdout.write(e)},_process_exit:u,_process_cwd:l,_pwd:d,_range:A,_rm:h._rm,_run:async function(e,t,r,n,i,s){let o,u,l;void 0!==t&&""!=t&&t!=[]||(u="No command given in input.",v(u,1));const d=t[0],f=t.slice(1,t.length);if(void 0!==e&&""!=e||(e="sync"),void 0!==r&&""!=r||(r=""),void 0!==n&&""!=n||(n="0"),void 0!==i&&""!=i||(i="spawn"),void 0!==s&&""!=s||(s=""),u=`Running '${d}' with arguments '${f}'.`,_(u),l="","async"==e){const e=function(e){l+=e.toString()},t=function(e){let t,r;return 0!=e?(r=`Process exited with code '${e}'`,v(r,1)):(r="Process exited normally.",_(r)),t=l.split("\n"),t},r=c(d,f);return r.stdout.on("data",e),r.on("close",t),o=l.split("\n"),_(o.length),o}if("sync"==e){if("spawn"==i)return o=a(d,f,{encoding:"utf-8"}).stdout.split("\n"),o;if("native"==i){if(0<n){_msg_timeout=`Timeout of length '${n}' ms reached for task '${r}'.`,_time_over=!1;try{if(new Promise((e,t)=>{setTimeout(()=>{},n,"hurr")}),""!=s){if(l=await Promise.race([k(n),d[s].apply(d,f)]),void 0===l)throw _msg_timeout}else l=await d.apply(d,f)}catch(e){_time_over=!0}return _time_over?void w(_msg_timeout):l}l=await d[s].apply(d,f)}}},_seq:function(e,t){let r,n;if(n=[],t<e)return _msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),n;for(r of(void 0===t&&(t=e,e=1),A(e,t+1)))n.push(r);return n},_sleep:k,_stat:y,_yargv_get:f}},6314(e,t,r){const n=r(6070),i=n._os_tmpdir_get,s=(0,n._process_exit_get)(),o=r(4962),a=o.readdirSync,c=o.existsSync,u=o.appendFileSync,l=o.readFileSync,d=o.writeFileSync,f=(o.isDir,o.fsWorkerNew),h=o.fsWorkerStart,p=o.mkdtempSync,g=o.statSync,m=JSON.parse,y=JSON.stringify,b=r(8843),w=b.basename,_=b.dirname,v=b.join,A=b.parse;function k(e,t){return void 0!==t&&t!={}&&""!=t||(t={encoding:"utf8",flag:"r"}),l(e,t)}function P(e){let t;return t=v.apply(null,e),t}e.exports={_basename:function(e){let t;return t=w(e),t},_cat:k,_dirname:function(e){let t;return t=_(e),t},_ext_rm:function(e){let t,r,n;return t=A(e).dir,r=A(e).name,n=[t,r],P(n)},_dir_exists:o.isDir,_file_append:function(e,t,r){const n=[e,t];void 0!==r&&r!={}&&""!=r&&n.push(r),u.apply(null,n)},_file_exists:function(e){let t,r;return r=!1,t=c(e),t&&(r=!0),r},_file_read:k,_file_write:function(e,t,r){d(e,t)},_fs_worker_new:f,_fs_worker_start:h,_json_display:y,_json_read:function(e){let t,r;return t=k(e),r=m(t),r},_ls:function(e){return a.apply(null,[e])},_mkdir:o.mkdirSync,_mktemp:async function(e,t){const r=typeof t;if(void 0!==e&&""!=e||(e=`${i()}/tmp.`),"undefined"!=r&&""!=t&&"true"!=t||(t=!0),"false"==t&&(t=!1),t)try{return p(e)}catch(e){throw e}else _msg="It only supports creating temporary directories.",console.error(_msg),s(1)},_mv:o.renameSync,_path_join:P,_rm:o.rmSync,_stat:g}},6070(e,t,r){function n(e){let t,r,n,i,s,o,a,c,u;void 0===e&&(a="Getting all values.",_msg_info("Getting all values."),e=""),t=[],o=window.location,c=o.search.substring(1),n=c.split("&");for(let o=0;o<n.length;o++)r=n[o],s=r.split("="),i=s[0],i!=e&&""!=e||(u=s[1],t.push(u));return t}e.exports={_argv_get:function(e){let t;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(t=n()),t},_argv_url_get:n,_child_process_spawn_get:function(e){let t;return void 0!==e&&""!=e||(e="sync"),"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(t=function(e,t,r){return r}),t},_os_tmpdir_get:function(){let e;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e=function(){return"/tmp"}),e},_process_exit_get:function(){let e;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e=function(e){return e}),e},_process_cwd_get:function(){let e;return e="undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"==typeof r?process.cwd:function(){return"."},e},_yargv_get:function(e){let t;const n={},i={};void 0!==e&&e!={}&&""!=e||(e={booleans:[],string:!0});const s=e.booleans;if("undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g){const o=r(Object(function(){const e=new Error("Cannot find module 'yargs'");throw e.code="MODULE_NOT_FOUND",e}()));_yargs_helpers_module=r(Object(function(){const e=new Error("Cannot find module 'yargs/helpers'");throw e.code="MODULE_NOT_FOUND",e}()));const a=_yargs_helpers_module.hideBin;if("string"in e&&e.string&&(n._={type:"string",string:!0},i["parse-numbers"]=!1,i["parse-positional-numbers"]=!1),s.length>0)for(t of s)n[t]={demand:!1,default:!1,type:"boolean"};return 0<s.length||e.string?o(a(process.argv)).parserConfiguration(i).options(n).string("_").parse():o(a(process.argv))}}}},3331(e,t,r){var n="/";const i=r(1130);_file_read=i._file_read,_json_read=i._json_read,_path_join=i._path_join,e.exports={_data_get:function(e,t,r){let i,s;return void 0!==e&&""!=e||(e="Token"),void 0!==t&&""!=t||(t="abi"),void 0!==r&&""!=r||(r="path"),"abi"==t?s=_path_join([n,`${e}.abi.json`]):"source"==t?s=_path_join([n,`${e}.sol`]):"bytecode"==t?s=_path_join([n,`${e}.bin`]):"compiler-output"==t?s=_path_join([n,`${e}.json`]):_msg_error(`Unknown data type '${t}'.`,1),"path"==r?i=s:"object"==r&&("abi"==t?i=_json_read(s):"source"==t||"bytecode"==t?i=_file_read(s):"compiler-output"==t?i=_json_read(s):(_msg=`Uknown data type '${t}'.`,_msg_info(_msg,1))),i}}},1130(e,t,r){const n=r(3460),i=n._argv_get,s=n._argv_url_get,o=n._child_process_spawn_get,a=o(),c=o("async"),u=(0,n._process_exit_get)(),l=(0,n._process_cwd_get)(),d=l,f=n._yargv_get,h=r(8716),p=h._basename,g=h._dirname,m=(h._file_append,h._file_exists,h._path_join),y=h._stat;function b(e,t){let r;return void 0===t||""==t?r=`${e}: {_msg}`:"string"!=typeof t&&""==t||(r=`[${t}] ${e}: {_msg}`),r}function w(e){let t;"n"==quiet&&(_template=b("WARNING",app_name),t=_template.replaceAll("{_msg}",e),console.warn(t))}function _(e){let t;"undefined"!=typeof quiet&&""!=quiet||(quiet="y"),"n"==quiet&&(t=b("INFO",app_name).replaceAll("{_msg}",e),console.log(t))}function v(e,t){let r,n;"undefined"==typeof app_name||app_name,t=String(t),r=b("ERROR",app_name),n=r.replaceAll("{_msg}",e),"1"===t?(console.error(n),u(1)):"0"===t&&console.warn(n)}function A(e,t){let r;return void 0===t&&(t=e,e=0),r=t-e,r<0?(_msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),[]):Array(r).keys().map(t=>t+e)}function k(e){return new Promise(t=>setTimeout(t,e))}e.exports={_argv_get:i,_argv_url_get:s,_app_name_get:function(){let e;return e=p("/index.js"),e},_basename:h._basename,_cat:h._cat,_cmdline_check:function(e){let t,r,n;return"undefined"==typeof window&&(t=i(),r=t[1],void 0===r&&(r=t.$0),n=p(r),n==e)},_dirname:g,_echo:function(e){console.log(e)},_error_display:function(e){let t;"object"==typeof error?(t="error"in e&&null!=e.error&&"message"in e.error?e.error.message:"shortMessage"in e?e.shortMessage:e,console.error(e)):(t=e,console.error(e)),v(t,0)},_ext_rm:h._ext_rm,_dir_exists:h._dir_exists,_file_append:h._file_append,_file_exists:h._file_exists,_file_read:h._file_read,_file_write:h._file_write,_fs_worker_new:h._fs_worker_new,_fs_worker_start:h._fs_worker_start,_get_date_human:function(){const e=new Date;return`${e.getFullYear()}-${e.getMonth()}-${e.getDay()}T${e.getHours()}:${e.getMinutes()}+0000`},_globals:function(){app_name="",quiet="y"},_homedir_get:function(){let e;return"undefined"==typeof window&&void 0!==r.g&&(r.g.global,r.g),"undefined"!=typeof window&&(e="/home/user"),e},_json_display:h._json_display,_json_read:h._json_read,_lib_get:async function(){let e;return new Set,"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e="/usr/lib"),e},_ls:h._ls,_mkdir:h._mkdir,_mktemp:h._mktemp,_msg_info:_,_msg_error:v,_msg_warning:w,_msg_info_obj:function(e,t){let r;r=`${e}: '${t}'`,_(r)},_mv:h._mv,_path_join:m,_printf:function(e){"undefined"==typeof window&&(_stdout=process.stdout),"undefined"!=typeof window&&(_stdout=r(8310)),_stdout.write(e)},_process_exit:u,_process_cwd:l,_pwd:d,_range:A,_rm:h._rm,_run:async function(e,t,r,n,i,s){let o,u,l;void 0!==t&&""!=t&&t!=[]||(u="No command given in input.",v(u,1));const d=t[0],f=t.slice(1,t.length);if(void 0!==e&&""!=e||(e="sync"),void 0!==r&&""!=r||(r=""),void 0!==n&&""!=n||(n="0"),void 0!==i&&""!=i||(i="spawn"),void 0!==s&&""!=s||(s=""),u=`Running '${d}' with arguments '${f}'.`,_(u),l="","async"==e){const e=function(e){l+=e.toString()},t=function(e){let t,r;return 0!=e?(r=`Process exited with code '${e}'`,v(r,1)):(r="Process exited normally.",_(r)),t=l.split("\n"),t},r=c(d,f);return r.stdout.on("data",e),r.on("close",t),o=l.split("\n"),_(o.length),o}if("sync"==e){if("spawn"==i)return o=a(d,f,{encoding:"utf-8"}).stdout.split("\n"),o;if("native"==i){if(0<n){_msg_timeout=`Timeout of length '${n}' ms reached for task '${r}'.`,_time_over=!1;try{if(new Promise((e,t)=>{setTimeout(()=>{},n,"hurr")}),""!=s){if(l=await Promise.race([k(n),d[s].apply(d,f)]),void 0===l)throw _msg_timeout}else l=await d.apply(d,f)}catch(e){_time_over=!0}return _time_over?void w(_msg_timeout):l}l=await d[s].apply(d,f)}}},_seq:function(e,t){let r,n;if(n=[],t<e)return _msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),n;for(r of(void 0===t&&(t=e,e=1),A(e,t+1)))n.push(r);return n},_sleep:k,_stat:y,_yargv_get:f}},8716(e,t,r){const n=r(3460),i=n._os_tmpdir_get,s=(0,n._process_exit_get)(),o=r(4962),a=o.readdirSync,c=o.existsSync,u=o.appendFileSync,l=o.readFileSync,d=o.writeFileSync,f=(o.isDir,o.fsWorkerNew),h=o.fsWorkerStart,p=o.mkdtempSync,g=o.statSync,m=JSON.parse,y=JSON.stringify,b=r(8843),w=b.basename,_=b.dirname,v=b.join,A=b.parse;function k(e,t){return void 0!==t&&t!={}&&""!=t||(t={encoding:"utf8",flag:"r"}),l(e,t)}function P(e){let t;return t=v.apply(null,e),t}e.exports={_basename:function(e){let t;return t=w(e),t},_cat:k,_dirname:function(e){let t;return t=_(e),t},_ext_rm:function(e){let t,r,n;return t=A(e).dir,r=A(e).name,n=[t,r],P(n)},_dir_exists:fs_module.isDir,_file_append:function(e,t,r){const n=[e,t];void 0!==r&&r!={}&&""!=r&&n.push(r),u.apply(null,n)},_file_exists:function(e){let t,r;return r=!1,t=c(e),t&&(r=!0),r},_file_read:k,_file_write:function(e,t,r){d(e,t)},_fs_worker_new:f,_fs_worker_start:h,_json_display:y,_json_read:function(e){let t,r;return t=k(e),r=m(t),r},_ls:function(e){return a.apply(null,[e])},_mkdir:o.mkdirSync,_mktemp:async function(e,t){const r=typeof t;if(void 0!==e&&""!=e||(e=`${i()}/tmp.`),"undefined"!=r&&""!=t&&"true"!=t||(t=!0),"false"==t&&(t=!1),t)try{return p(e)}catch(e){throw e}else _msg="It only supports creating temporary directories.",console.error(_msg),s(1)},_mv:o.renameSync,_path_join:P,_rm:o.rmSync,_stat:g}},3460(e,t,r){function n(e){let t,r,n,i,s,o,a,c,u;void 0===e&&(a="Getting all values.",_msg_info("Getting all values."),e=""),t=[],o=window.location,c=o.search.substring(1),n=c.split("&");for(let o=0;o<n.length;o++)r=n[o],s=r.split("="),i=s[0],i!=e&&""!=e||(u=s[1],t.push(u));return t}e.exports={_argv_get:function(e){let t;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(t=n()),t},_argv_url_get:n,_child_process_spawn_get:function(e){let t;return void 0!==e&&""!=e||(e="sync"),"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(t=function(e,t,r){return r}),t},_os_tmpdir_get:function(){let e;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e=function(){return"/tmp"}),e},_process_exit_get:function(){let e;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e=function(e){return e}),e},_process_cwd_get:function(){let e;return e="undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"==typeof r?process.cwd:function(){return"."},e},_yargv_get:function(e){let t;const n={},i={};void 0!==e&&e!={}&&""!=e||(e={booleans:[],string:!0});const s=e.booleans;if("undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g){const o=r(Object(function(){const e=new Error("Cannot find module 'yargs'");throw e.code="MODULE_NOT_FOUND",e}()));_yargs_helpers_module=r(Object(function(){const e=new Error("Cannot find module 'yargs/helpers'");throw e.code="MODULE_NOT_FOUND",e}()));const a=_yargs_helpers_module.hideBin;if("string"in e&&e.string&&(n._={type:"string",string:!0},i["parse-numbers"]=!1,i["parse-positional-numbers"]=!1),s.length>0)for(t of s)n[t]={demand:!1,default:!1,type:"boolean"};return 0<s.length||e.string?o(a(process.argv)).parserConfiguration(i).options(n).string("_").parse():o(a(process.argv))}}}},7163(e,t,r){const n=r(1426)._token_send;e.exports={_token_send:n}},1426(e,t,r){const n=r(8368),i=n._argv_get,s=n._basename,o=n._cmdline_check,a=(n._file_read,n._file_write),c=n._json_display,u=n._msg_info,l=n._msg_error,{ethers:d}=r(4193),f=d,h=(f.formatEther,f.parseUnits),p=r(4660);_contract_run=p._contract_run;const g=r(3331);async function m(e,t,r,n,i,s,o,u,d,f,p,g,m){let y,b,w,_,v,A,k;void 0!==o&&""!=o||(o=_data_get("Token","abi","path")),void 0!==u&&""!=u||(u=_data_get("Token","bytecode","path")),void 0!==d&&""!=d||(d=_data_get("Token","compiler-output","path")),void 0!==m&&""!=m||(y="Amount must be a number greater than zero.",l(y,1)),null==p&&(p=""),""==t&&(t=3e5),t=Number(t),"ether"==f&&(m=function(e){return h(e,"ether")}(m)),k="",_=[e,t,r,"",n,"",0,"ether",i,s,o,u,d,"transfer"],A=[g,m=BigInt(m)],v=_.concat([A]);try{b=await async function(e){let t;try{t=await _contract_run.apply(null,e)}catch(e){const t="Error sending the amount.";throw _error_display(e),l(t,0),e}return t}(v)}catch(e){throw _error_display(e),y="Error sending the intended token amount.",l(y,0),e}return""!=p&&(w=c(b),a(p,w)),b}function y(e){let t,r;void 0!==e&&""!=e||(e=0);const n=i(),o=s(n.$0);for(t of(r=["Send ERC-20 tokens.","","Usage:",` ${o}`," <quiet>"," <retries-max>"," <call-timeout>"," <wallet-seed-path>"," <api-key-path>"," <target-network>"," <token-address>"," <token-abi-path>"," <token-bytecode-path>"," <token-compiler-output-path>"," <measure-unit>"," <receipt-file-path>"," <target-recipient>"," <target-amount>","","Args:",""," <quiet> Can be 'y' or 'n'",` Default: ${quiet}`,""," <retries-max> Maximum number of retries before"," failing.",` Default: ${retries_max}`,""," <call-timeout> How many milliseconds to wait for a return"," before declaring the call failed.",` Default: ${call_timeout}`,""," <wallet-seed-path> Path of the file containing"," the seed phrase.",` Default: ${wallet_seed_path}`,""," <api-key-path> Path of the API key for the"," contract ABI provider service.",""," <target-network> Network on which the contract"," resides.",""," <token-address> Address of the token contract.",""," <token-abi-path> Token ABI path.",` Default: ${token_abi_path}`,""," <token-bytecode-path> Path for the token bytecode.",` Default: ${token_bytecode_path}`,""," <token-compiler-output-path> Path for the token compiler"," output path (the hardhat artifact).",` Default: ${token_compiler_output_path}`,""," <measure-unit> Measure unit for the transaction"," value. It can be 'wei' or 'ether'",` Default: ${measure_unit}`,""," <receipt-file-path> If specified, will save the transaction"," receipt at the path.","",` <target-amount> How much '${measure_unit}' of the specified`," token to send."],r))console.log(t);process.exit(e)}function b(){let e,t;if(e=!1,t=typeof target_network,"undefined"!=t&&""!=target_network||(target_network=100,t=typeof target_network),"number"==t?e=!0:"string"==t?target_network.startsWith("https://")||(e=!0):l(`Unknown type '${t}' for network variable.`,1),e){const e=r(4136)._rpc_get;target_network=e([target_network])[target_network]}"undefined"!=typeof token_abi_path&&""!=token_abi_path||(token_abi_path=_data_get("Token","abi","path")),"undefined"!=typeof token_bytecode_path&&""!=token_bytecode_path||(token_bytecode_path=_data_get("Token","bytecode","path")),"undefined"!=typeof token_compiler_output_path&&""!=token_compiler_output_path||(token_compiler_output_path=_data_get("Token","compiler-output","path")),"undefined"!=typeof call_timeout&&""!=call_timeout||(call_timeout=3e5),"undefined"!=typeof measure_unit&&""!=measure_unit||(measure_unit="ether")}_data_get=g._data_get,1!=o("token-send")&&1!=o("erc20-token-send")||(app_name="token-send",retries_max="",call_timeout="",wallet_seed_path="",api_key_path="",target_network="",token_address="",token_abi_path="",token_bytecode_path="",token_compiler_output_path="",measure_unit="",target_recipient="",target_amount="",receipt_file_path="",quiet="",function(){let e;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(retries_max=e),4==t&&(call_timeout=e),5==t&&(wallet_seed_path=e),6==t&&(api_key_path=e),7==t&&(target_network=e),8==t&&(token_address=e),9==t&&(token_abi_path=e),10==t&&(token_bytecode_path=e),11==t&&(token_compiler_output_path=e),12==t&&(measure_unit=e),13==t&&(receipt_file_path=e),14==t&&(target_recipient=e),15==t&&(target_amount=e),"-h"!=e&&"--help"!=e||(b(),quiet="n",y(0))}),""==target_recipient&&(b(),quiet="n",e="No input recipient.",l(e,0),y(1)),""==token_address&&(b(),quiet="n",e="No token address specified.",l(e,0),y(1)),""==target_amount&&(quiet="n",e="No amount specified.",l(e,0),y(1)),"0"!=target_amount&&0!=target_amount||(b(),quiet="n",e="Amount specified is zero.",l(e,0),y(1))}(),b(),function(){let e;const t=[` Maximum retries: ${retries_max}`,` Call timeout: ${call_timeout}`,` Wallet seed: ${wallet_seed_path}`,` API Key: ${api_key_path}`,` Target network: ${target_network}`,` Token address: ${token_address}`,` Token ABI: ${token_abi_path}`,` Token bytecode: ${token_bytecode_path}`,` Token compiler output: ${token_compiler_output_path}`,` Measure unit: ${measure_unit}`,` Receipt file path: ${receipt_file_path}`,` Target recipient: ${target_recipient}`,` Target amount: ${target_amount}`];for(e in t)u(t[e])}(),app_opts=[retries_max,call_timeout,wallet_seed_path,api_key_path,target_network,token_address,token_abi_path,token_bytecode_path,token_compiler_output_path,measure_unit,receipt_file_path,target_recipient,target_amount],async function(e){let t,r;try{if(r=await m.apply(null,e),null==r)throw t="Error sending the amount.",{error:{message:t}};console.log(r)}catch(e){t="Transfer error.",_error_display(e),l(t,1)}}(app_opts)),e.exports={_token_send:m}},7511(e,t,r){const n=r(8368);function i(e){const t=_path_join(["/","chains",`${e}.json`]);return _json_read(t)}function s(){const e=_path_join(["/","chains","chains.json"]);return _json_read(e)}_json_read=n._json_read,_path_join=n._path_join,e.exports={_data_get:function(e){let t;return t=void 0===e||""==e?s():i(e),t},_data_split_get:i,_data_unified_get:s}},7007(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,s,o,u;if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(s){n.once&&e.removeEventListener(t,i),r(s)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=p(c,u);for(r=0;r<u;++r)n(l[r],this,t)}return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,s,o;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},5515(e,t,r){const n=r(8368),i=n._homedir_get,s=n._file_exists,o=n._file_read,a=n._file_write,c=n._json_read,u=n._lib_get,l=n._mkdir,d=n._msg_info,f=n._msg_error,h=n._path_join,p=(n._range,n._rm),g=r(619)._data_get;async function m(e,t,r){let n,o,a;if(void 0!==e&&""!=e||(e="n"),void 0!==t&&""!=t||(t=""),void 0!==r&&""!=r||(""!=t?r="split":""==t&&(r="unified")),a=`Getting path for chain with chain id '${t}' with privilege user set to '${e}' in format '${r}'.`,d(a),"unified"==r?n="chains.json":"split"==r&&(n=`${t}.json`),"y"==e){const e=i();o=h([e,".config","evm-chains",n]);const t=s(o);1==t?(a=`Found database '${o}'.`,d(a)):0==t?(a=`Database '${o}' not found`,d(a)):(a="wat",f(a))}else if("n"==e){const e=await u();a=`Found system libraries directory '${e}'.`,o=h([e,"evm-chains",n])}else a=`Input variable '_user' must be a boolean. _user value is '${e}'.`,f(a,0);return o}async function y(e,t,r,n,i){let o;void 0!==e&&""!=e||f("Network's ChainID not specified.",1),void 0!==t&&""!=t||(t="kirsh"),void 0!==r&&""!=r||(r=await m("n")),void 0===i&&(i=["node","system"]),void 0!==n&&""!=n||(n="y");const a=Number(e),u=await async function(e,t,r,n,i){let o,a,u,l;for(u of(void 0!==i&&i!=[]&&""!=i||(i=["node","system"]),void 0!==r&&""!=r||(r="n"),void 0!==n&&""!=n||(n="split"),void 0!==t&&""!=t||(t=await m(r,e,n)),i))if("node"==u){for(o of(l="Getting data from 'ethereum-data' module.",d(l),a=g(e),l=`Displaying data for chain '${e}' of type '${i}'.`,d(l),a))if(o.chainId==e)return o}else if("system"==u){s(t);const r=c(t);for(o of(l=`Displaying data for chain '${e}' of type '${i}'.`,d(l),r))if(o.chainId==e)return o;l=`Network '${e}' not found.`,f(l,1)}}(a,r,n,i);if("kirsh"==t)return u.rpc[0];o="Unknown selection method.",f("Unknown selection method.",1)}function b(e){s(e)||f(`Database at '${e}' does not exist.`,1)}function w(e,t,r,n,i,s,o){let a,u,l,f,h,p,g,m;if(h=r,"id"==t?(f="chainId",p=o,m=`Getting data for filter key: '${f}' and value '${p}'.`,d(m)):"testnet"==t&&(m="Like I have to agg a tag.",d(m)),"id"==r?h="chainId":"rpc"==r&&(h=r),"y"==s)return l=function(e){console.log(e)}(h),m=`Showing results for all networks with filter '${l}'.`,d(m),a=c(e),m=`Showing results for all networks with filter '${l}'.`,d(m),a;if("n"==s){for(u of(g=[],m=`Showing results for chain '${o}' in database '${e}' with filter '${h}'.`,d(m),a=c(e),m=`Database '${e}' contains '${a.length}' items.`,d(m),a))if(u[f]==o&&(g.push(u),"kirsh"==n))break;return m=`Total results returned for '${e}' are '${g.length}'.`,d(m),g}}function _(e,t,r,n,i,s,o,a,u){let l,h,p,m,y,_,v;if(_=0,"offline"==t){for(p of r)if("node"==p){for(m of(l=[],v=g(e),v))if(m.chainId==e&&(l.push(m),"kirsh"==s))break}else if("system"==p){for(h of(y=`Getting data from databases '${u}'`,d(y),u))if(y=`Looking in '${h}'.`,d(y),b(h),"amount"!=n)l=w(h,n,i,s,0,a,e);else if("amount"==n&&(l=c(h),_=l.length,"kirsh"==s))break;if("amount"!=n)_=l.length,0==l.length&&(y=`No results found for network '${e}'.`,f(y,0));else if("amount"==n)return y=`Found '${_}' networks.`,d(y),_}for(m of(v=[],l))if(m.chainId==e&&(v.push(m[i]),"all"!=s))break;l=v,_=l.length,y=`Found '${_}' networks in database '${h}'.`,d(y)}else"online"==t&&(y="About to implement it probably.",f(y,1));return l}function v(e){"id"==e&&d(`Setting value for type '${e}'.`)}async function A(e,t){let n,c;const u=r(3182)._block_number_get,g=[t,"","","3","10000"];try{c=`Testing connectivity for RPC '${t}' for network '${e}'.`,d(c),n=await u.apply(null,g),console.log(n),0<n&&(c=`RPC '${t}' for network '${e}' online.`,d(c),function(e,t){"number"==typeof e&&(e=e.toFixed(0));const r=i(),n=h([r,".cache","evm-chains",e,"rpc",t]),o=h([n,"offline"]);s(o)&&(p(o),d(`Deleting offline score for RPC '${t}'`))}(e,t))}catch(r){return console.error(r),c=`RPC '${t}' for network '${e}' offline.`,f(c,0),function(e,t){let r;const n=i(),c=h([n,".cache","evm-chains",e,"rpc",t]),u=h([c,"offline"]);console.log(c),s(c)?r=s(u)?o(u):0:(l(c),d(`Creating directory +'${c}'.`)),r+=1,a(u,r)}(e,t),n=0,n}return n}e.exports={_data_get:g,_db_paths_auto_detect:async function(e){let t,r,n;"y"==user_level?(t="y",r="n"):"n"==user_level&&(t="n",r="y");const i=await m(t,"","unified"),o=await m(t,e,"split"),a=await m(r,"","unified"),c=await m(r,e,"split");s(o)?(db_paths.push(o),n=`Found database '${o}', adding.`,d(n)):s(o)?(n="wat",f(n,1)):(n=`Default per-network database '${o}' not found, trying '${i}'.`,d(n)),s(i)?(db_paths.push(i),n=`Found database '${i}', adding.`,d(n)):(n=`Default unified database '${o}' not found, trying '${i}'.`,d(n)),s(c)?(db_paths.push(c),n=`Found database '${c}', adding.`,d(n)):(n=`Fallback per-network database '${c}' not found, trying '${a}'.`,d(n)),s(a)?(db_paths.push(a),n=`Found database '${a}', adding.`,d(n)):(n=`Fallback database '${c}' does not exist.`,f(n,0)),0==db_paths.length&&(n="Found no databases!",d(n))},_db_types_auto_detect:function(e){0==db_types.length&&db_types.push("node"),db_paths.length>0&&db_types.push("system")},_evm_chains_db_path_get:m,_evm_chains_info:async function(e,t,r,n,i,s,o,a,c,u){let l,d,h;if("get"==e){const e=[],a=_(c,n,i,t,r,s,0,o,u);if("rpc"==r){for(d of a)for(h of d)if("y"==o?e.push(h):"n"==o&&(h.includes("API_KEY")||e.push(h)),"kirsh"==s)break;return e}if("name"==r)return a;if("id"==r)return a;if("explorers"==r){for(d of a)for(l of d)if(e.push(l.url),"kirsh"==s)break;return e}}else if("set"==e)v(t);else{if("check"==e){const e=await async function(e,t,r,n,i,s){let o,a,c;const u={},l=await _(e,t,r,n,"rpc","all",0,i,s);for(o of l)for(a of o)try{c=await A(e,a),u[a]=!0}catch(e){c=0,u[a]=!1}return u}(c,n,i,t,o,u);return console.log(e),e}f(`Unknown command '${e}'.`,1)}},_evm_chains_info_get:_,_evm_chains_info_set:v,_input_type_auto_detect:function(){const e=typeof target_chain;"number"==e?input_type="id":"string"==e&&target_chain.startsWith("https://")&&(input_type="rpc"),""==input_type&&(isNaN(target_chain)?input_type="name":input_type="id")},_rpc_backend_get:y,_rpc_backends_get:async function(e,t,r){let n,i,s;null==t&&(t="kirsh"),null==r&&(r=await m("n"));const o=[];for(n of e)i=[n,t,r],s=await y.apply(null,i),o.push(s);return o}}},619(e,t,r){const n=r(5234);function i(e){const t=_path_join(["/","chains",`${e}.json`]);return _json_read(t)}function s(){const e=_path_join(["/","chains","chains.json"]);return _json_read(e)}_json_read=n._json_read,_path_join=n._path_join,e.exports={_data_get:function(e){let t;return t=void 0===e||""==e?s():i(e),t},_data_split_get:i,_data_unified_get:s}},5234(e,t,r){const n=r(7932),i=n._argv_get,s=n._argv_url_get,o=n._child_process_spawn_get,a=o(),c=o("async"),u=(0,n._process_exit_get)(),l=(0,n._process_cwd_get)(),d=l,f=n._yargv_get,h=r(7588),p=h._basename,g=h._dirname,m=(h._file_append,h._file_exists,h._path_join),y=h._stat;function b(e,t){let r;return void 0===t||""==t?r=`${e}: {_msg}`:"string"!=typeof t&&""==t||(r=`[${t}] ${e}: {_msg}`),r}function w(e){let t;"n"==quiet&&(_template=b("WARNING",app_name),t=_template.replaceAll("{_msg}",e),console.warn(t))}function _(e){let t;"undefined"!=typeof quiet&&""!=quiet||(quiet="y"),"n"==quiet&&(t=b("INFO",app_name).replaceAll("{_msg}",e),console.log(t))}function v(e,t){let r,n;"undefined"==typeof app_name||app_name,t=String(t),r=b("ERROR",app_name),n=r.replaceAll("{_msg}",e),"1"===t?(console.error(n),u(1)):"0"===t&&console.warn(n)}function A(e,t){let r;return void 0===t&&(t=e,e=0),r=t-e,r<0?(_msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),[]):Array(r).keys().map(t=>t+e)}function k(e){return new Promise(t=>setTimeout(t,e))}e.exports={_argv_get:i,_argv_url_get:s,_app_name_get:function(){let e;return e=p("/index.js"),e},_basename:h._basename,_cat:h._cat,_cmdline_check:function(e){let t,r,n;return"undefined"==typeof window&&(t=i(),r=t[1],void 0===r&&(r=t.$0),n=p(r),n==e)},_dirname:g,_echo:function(e){console.log(e)},_error_display:function(e){let t;"object"==typeof error?(t="error"in e&&null!=e.error&&"message"in e.error?e.error.message:"shortMessage"in e?e.shortMessage:e,console.error(e)):(t=e,console.error(e)),v(t,0)},_ext_rm:h._ext_rm,_dir_exists:h._dir_exists,_file_append:h._file_append,_file_exists:h._file_exists,_file_read:h._file_read,_file_write:h._file_write,_fs_worker_new:h._fs_worker_new,_fs_worker_start:h._fs_worker_start,_get_date_human:function(){const e=new Date;return`${e.getFullYear()}-${e.getMonth()}-${e.getDay()}T${e.getHours()}:${e.getMinutes()}+0000`},_globals:function(){app_name="",quiet="y"},_homedir_get:function(){let e;return"undefined"==typeof window&&void 0!==r.g&&(r.g.global,r.g),"undefined"!=typeof window&&(e="/home/user"),e},_json_display:h._json_display,_json_read:h._json_read,_lib_get:async function(){let e;return new Set,"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e="/usr/lib"),e},_ls:h._ls,_mkdir:h._mkdir,_mktemp:h._mktemp,_msg_info:_,_msg_error:v,_msg_warning:w,_msg_info_obj:function(e,t){let r;r=`${e}: '${t}'`,_(r)},_mv:h._mv,_path_join:m,_printf:function(e){"undefined"==typeof window&&(_stdout=process.stdout),"undefined"!=typeof window&&(_stdout=r(8310)),_stdout.write(e)},_process_exit:u,_process_cwd:l,_pwd:d,_range:A,_rm:h._rm,_run:async function(e,t,r,n,i,s){let o,u,l;void 0!==t&&""!=t&&t!=[]||(u="No command given in input.",v(u,1));const d=t[0],f=t.slice(1,t.length);if(void 0!==e&&""!=e||(e="sync"),void 0!==r&&""!=r||(r=""),void 0!==n&&""!=n||(n="0"),void 0!==i&&""!=i||(i="spawn"),void 0!==s&&""!=s||(s=""),u=`Running '${d}' with arguments '${f}'.`,_(u),l="","async"==e){const e=function(e){l+=e.toString()},t=function(e){let t,r;return 0!=e?(r=`Process exited with code '${e}'`,v(r,1)):(r="Process exited normally.",_(r)),t=l.split("\n"),t},r=c(d,f);return r.stdout.on("data",e),r.on("close",t),o=l.split("\n"),_(o.length),o}if("sync"==e){if("spawn"==i)return o=a(d,f,{encoding:"utf-8"}).stdout.split("\n"),o;if("native"==i){if(0<n){_msg_timeout=`Timeout of length '${n}' ms reached for task '${r}'.`,_time_over=!1;try{if(new Promise((e,t)=>{setTimeout(()=>{},n,"hurr")}),""!=s){if(l=await Promise.race([k(n),d[s].apply(d,f)]),void 0===l)throw _msg_timeout}else l=await d.apply(d,f)}catch(e){_time_over=!0}return _time_over?void w(_msg_timeout):l}l=await d[s].apply(d,f)}}},_seq:function(e,t){let r,n;if(n=[],t<e)return _msg="Second argument 'end' is greater than first argument 'start', returning empty list.",w(_msg),n;for(r of(void 0===t&&(t=e,e=1),A(e,t+1)))n.push(r);return n},_sleep:k,_stat:y,_yargv_get:f}},7588(e,t,r){const n=r(7932),i=n._os_tmpdir_get,s=(0,n._process_exit_get)(),o=r(4962),a=o.readdirSync,c=o.existsSync,u=o.appendFileSync,l=o.readFileSync,d=o.writeFileSync,f=(o.isDir,o.fsWorkerNew),h=o.fsWorkerStart,p=o.mkdtempSync,g=o.statSync,m=JSON.parse,y=JSON.stringify,b=r(8843),w=b.basename,_=b.dirname,v=b.join,A=b.parse;function k(e,t){return void 0!==t&&t!={}&&""!=t||(t={encoding:"utf8",flag:"r"}),l(e,t)}function P(e){let t;return t=v.apply(null,e),t}e.exports={_basename:function(e){let t;return t=w(e),t},_cat:k,_dirname:function(e){let t;return t=_(e),t},_ext_rm:function(e){let t,r,n;return t=A(e).dir,r=A(e).name,n=[t,r],P(n)},_dir_exists:fs_module.isDir,_file_append:function(e,t,r){const n=[e,t];void 0!==r&&r!={}&&""!=r&&n.push(r),u.apply(null,n)},_file_exists:function(e){let t,r;return r=!1,t=c(e),t&&(r=!0),r},_file_read:k,_file_write:function(e,t,r){d(e,t)},_fs_worker_new:f,_fs_worker_start:h,_json_display:y,_json_read:function(e){let t,r;return t=k(e),r=m(t),r},_ls:function(e){return a.apply(null,[e])},_mkdir:o.mkdirSync,_mktemp:async function(e,t){const r=typeof t;if(void 0!==e&&""!=e||(e=`${i()}/tmp.`),"undefined"!=r&&""!=t&&"true"!=t||(t=!0),"false"==t&&(t=!1),t)try{return p(e)}catch(e){throw e}else _msg="It only supports creating temporary directories.",console.error(_msg),s(1)},_mv:o.renameSync,_path_join:P,_rm:o.rmSync,_stat:g}},7932(e,t,r){function n(e){let t,r,n,i,s,o,a,c,u;void 0===e&&(a="Getting all values.",_msg_info("Getting all values."),e=""),t=[],o=window.location,c=o.search.substring(1),n=c.split("&");for(let o=0;o<n.length;o++)r=n[o],s=r.split("="),i=s[0],i!=e&&""!=e||(u=s[1],t.push(u));return t}e.exports={_argv_get:function(e){let t;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(t=n()),t},_argv_url_get:n,_child_process_spawn_get:function(e){let t;return void 0!==e&&""!=e||(e="sync"),"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(t=function(e,t,r){return r}),t},_os_tmpdir_get:function(){let e;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e=function(){return"/tmp"}),e},_process_exit_get:function(){let e;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e=function(e){return e}),e},_process_cwd_get:function(){let e;return e="undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"==typeof r?process.cwd:function(){return"."},e},_yargv_get:function(e){let t;const n={},i={};void 0!==e&&e!={}&&""!=e||(e={booleans:[],string:!0});const s=e.booleans;if("undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g){const o=r(Object(function(){const e=new Error("Cannot find module 'yargs'");throw e.code="MODULE_NOT_FOUND",e}()));_yargs_helpers_module=r(Object(function(){const e=new Error("Cannot find module 'yargs/helpers'");throw e.code="MODULE_NOT_FOUND",e}()));const a=_yargs_helpers_module.hideBin;if("string"in e&&e.string&&(n._={type:"string",string:!0},i["parse-numbers"]=!1,i["parse-positional-numbers"]=!1),s.length>0)for(t of s)n[t]={demand:!1,default:!1,type:"boolean"};return 0<s.length||e.string?o(a(process.argv)).parserConfiguration(i).options(n).string("_").parse():o(a(process.argv))}}}},4660(e,t,r){r(8368);const n=r(7725)._address_check,i=r(7600)._bytecode_creation_get,s=r(711)._bytecode_runtime_get,o=r(907)._contract_get,a=r(2189)._deployer_get,c=r(852)._deployer_verify,u=r(524),l=u._contract_call_dynamic,d=u._contract_run,f=r(4543)._contract_call_static;e.exports={_address_check:n,_bytecode_creation_get:i,_bytecode_runtime_get:s,_contract_call_dynamic:l,_contract_call_static:f,_contract_get:o,_contract_run:d,_deployer_get:a,_deployer_verify:c}},7725(e,t,r){const n=r(8368),i=n._argv_get,s=n._basename,o=n._cmdline_check,a=n._msg_info,c=n._msg_error,u=n._process_exit,{ethers:l}=r(4193),d=l.isAddress;function f(e){let t;const r=i(),n=["Checks whether an address is valid.","","usage:",` ${s(r.$0)}`," <target-address>"," [options]","","args:"," <target-address> Address to check.",""," options:"," -v --verbose Extended output."," -h --help This help."];for(t of n)a(t);u(e)}(o("address-check")||o("ethereum-address-validate"))&&(app_name="address-check",target_address="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t?target_address=e:"-v"==e||"--verbose"==e?quiet="n":"-h"!=e&&"--help"!=e||(quiet="n",f(0))}),""==target_address&&(c("No target address specified.",0),quiet="n",f(1)),function(){let e;const t=i(),r=[`${s(t.$0)} configuration:`,` Target address: ${target_address}`];for(e of r)a(e)}(),app_opts=[target_address],async function(e){let t,r;try{if(t=await d.apply(null,e),void 0===t)r="Big error.",c(r,1);else if(!t)throw r=`Address '${target_address}' not is valid.'`,r}catch(e){c(e,1)}}(app_opts)),e.exports={_address_check:d}},7600(e,t,r){const n=r(8368),i=n._cmdline_check,s=n._error_display,o=n._msg_info,a=n._msg_error,c=(n._printf,n._process_exit),{ethers:u}=r(4193),l=(u.formatEther,r(1326)),d=l._transaction_get;function f(e){return new Promise(t=>setTimeout(t,e))}async function h(e,t,r,n,i,o,c,u,l){let h,p,g,m,y;for(null==l&&(l=""),null==c&&(c=""),c=c.toLowerCase(),h=1,y="",_output_path="",g=[t,e,"",n,i,o,r,_output_path,u],_transaction_receipt_get_opts=[t,e,"",n,i,o,r,_output_path,u];h<=t;)try{if(m=await d.apply(null,g),null==m)throw{error:{message:"Undefined transaction."}};null!=m&&(p=m.data,_file_write(l,p));break}catch(e){s(e),h+=1,a("Increasing retry and waiting 3 seconds.",0),await f(3e3)}if(h>t)throw"Maximum number of retries reached.";return p}function p(e){let t,r;for(t of(r=["Returns the creation bytecode for a contract given its deployment transaction hash.","","Usage:"," bytecode-creation-get"," <quiet>"," <wallet_seed>"," <retries_max>"," <api_key_path>"," <chain_id>"," <chain_name>"," <target_network>"," <contract_address>"," <transaction_deployment>"," <contract_bytecode_path>","","Args:"," <quiet> Can be 'y' or 'n'"," Default: y"," <wallet_seed> Path of the file containing"," the seed phrase."," <retries_max> Maximum number of retries before"," failing."," <api_key_path> Path of the API key for the"," contract ABI provider service"," <chain_id> Chain ID for the network."," <chain_name> Name for the network."," <target_network> Network on which the contract"," resides."," <contract_address> Address of the contract"," <transaction_deployment> Contract deployment transaction."," <contract_bytecode_path> Where to save contract bytecode.",""," Options:"," -h This help."],r))o(t);c(e)}l._transaction_receipt_get,r(2189)._deployer_get,i("bytecode-creation-get")&&(app_name="bytecode-creation-get",wallet_seed="",retries_max="",api_key_path="",chain_id="",chain_name="",target_network="",contract_address="",transaction_deployment="",contract_bytecode_path="",quiet="",function(){let e,t;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(retries_max=e),5==t&&(api_key_path=e),6==t&&(chain_id=e),7==t&&(chain_name=e),8==t&&(target_network=e),9==t&&(contract_address=e),10==t&&(transaction_deployment=e),11==t&&(contract_bytecode_path=e),"-h"!=e&&"--help"!=e||(quiet="n",p(0))}),e=!1,""==transaction_deployment&&(t="No deployment transaction specified.",e=!0),""==contract_bytecode_path&&(t="No contract bytecode path specified.",e=!0),e&&(a(t,0),quiet="n",p(1))}(),""==retries_max&&(retries_max=10),function(){let e,t;for(e of(t=[],t.push("bytecode-creation-get configuration:"),t.push(" Wallet seed: {wallet_seed}".replace("{wallet_seed}",wallet_seed)),t.push(" Max retries: {retries_max}".replace("{retries_max}",retries_max)),t.push(" API Key path: {api_key_path}".replace("{api_key_path}",api_key_path)),t.push(" Chain ID: {chain_id}".replace("{chain_id}",chain_id)),t.push(" Chain Name: {chain_name}".replace("{chain_name}",chain_name)),t.push(" Target network: {target_network}".replace("{target_network}",target_network)),t.push(" Contract address: {contract_address}".replace("{contract_address}",contract_address)),t.push(" Deployment transaction: {transaction_deployment}".replace("{transaction_deployment}",transaction_deployment)),t))o(e)}(),app_opts=[wallet_seed,retries_max,api_key_path,chain_id,chain_name,target_network,contract_address,transaction_deployment,contract_bytecode_path],async function(e){let t,r;try{if(t=await h.apply(null,e),null==t)throw r="It has not been possible to retrieve the bytecode from the transaction.","It has not been possible to retrieve the bytecode from the transaction.";o(`Bytecode has length '${t.length}'`)}catch(e){a(e,1)}}(app_opts)),e.exports={_bytecode_creation_get:h}},711(e,t,r){const n=r(8368),i=n._cmdline_check,s=n._error_display,o=n._file_read,a=n._file_write,c=n._msg_info,u=n._msg_error,l=n._printf,d=(n._process_exit,r(907)._contract_get,r(3182)._provider_get);function f(e){return new Promise(t=>setTimeout(t,e))}async function h(e,t,r,n,i,l){let h,p,g,m,y,b;for(""!=r?h=o(r):""==r&&(h=""),_retry=1,b="",y=!1;_retry<=t&&0==y;)try{if(m=await d(n,h),p=await m.getCode(i),null!=p)g=`Bytecode length: ${p.length}`,c(g),a(l,p),y=!0;else if(null==p)throw g="Code not retrieved.",{error:{message:g}}}catch(e){s(e),_retry+=1,g="Increasing retry and waiting 3 seconds.",u(g,0),await f(3e3)}if(_retry>t)throw"Maximum number of retries reached.";return p}function p(e){let t,r;for(t of(r=["Retrieves the runtime bytecode for an address.","","Usage:"," bytecode-runtime-get"," <quiet>"," <wallet-seed>"," <retries-max>"," <api-key-path>"," <target-network>"," <contract-address>"," <contract-bytecode_path>","","Args:"," <quiet> Can be 'y' or 'n'",` Default: ${quiet}`," <wallet-seed> Path of the file containing"," the seed phrase."," <retries-max> Maximum number of retries before"," failing.",` Default: ${retries_max}`," <api-key-path> Path of the API key for the"," contract ABI provider service"," <target-network> Network on which the contract"," resides."," <contract-address> Address of the contract"," <contract-bytecode-path> Path in which to save"," the runtime bytecode.",""," Options:"," -h This help."],r))c(t);process.exit(e)}function g(){""==retries_max&&(retries_max=100)}i("bytecode-runtime-get")&&(app_name="bytecode-runtime-get",wallet_seed="",retries_max="",api_key_path="",target_network="",contract_address="",contract_abi_path="",contract_bytecode_path="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(retries_max=e),5==t&&(api_key_path=e),6==t&&(target_network=e),7==t&&(contract_address=e),8==t&&(contract_bytecode_path=e),"-h"!=e&&"--help"!=e||p(0)}),""==contract_address&&(u("It is required to set a contract address.",0),quiet="n",g(),p(1)),""==target_network&&(u("It is required to set a network.",0),quiet="n",p(1)),""==contract_bytecode_path&&(u("It is required to set a path in which to save the bytecode.",0),quiet="n",p(1)),g(),function(){let e;const t=[" bytecode-runtime-get configuration:",` Contract address: ${contract_address}`,` Contract bytecode: ${contract_bytecode_path}`,` Max retries: ${retries_max}`," Credentials options:",` Wallet seed: ${wallet_seed}`,` API Key path: ${api_key_path}`," Network options:",` Target network: ${target_network}`];for(e of t)c(e)}(),app_opts=[wallet_seed,retries_max,api_key_path,target_network,contract_address,contract_bytecode_path],async function(e){let t;try{if(t=await h.apply(null,e),null==t)throw"Bytecode runtime retrieval failed.";l(typeof t)}catch(e){u(e,1)}}(app_opts)),e.exports={_bytecode_runtime_get:h}},907(e,t,r){const{ethers:n}=r(4193),i=n,s=i.ContractFactory,o=i.BaseContract,a=r(8368),c=a._cmdline_check,u=a._dirname,l=a._file_exists,d=a._file_read,f=a._json_read,h=a._path_join,p=a._msg_info,g=a._msg_error,m=r(3182),y=m._wallet_get,b=m._provider_get;async function w(e,t,r){const n=f(r);return new o(t,n,runner=e)}async function _(e,t,r,n){let i,o,a;""==r?o=[]:""!=r&&(o=f(r)),""!=n&&(a=d(n));const c=new s(o,a,e);if(""!=t)i=c.attach(t);else if(""==t)try{i=c.getDeployTransaction()}catch(e){const t="Encountered the above error.";console.error(e),g(t,0)}return i}async function v(e,t,r){let n,i;void 0!==r&&""!=r||(i="No contract compiler output path given in input.",g(i,1)),l(r)||(i=`No contract compiler output found at path '${r}'.`,g(i,1));const o=d(r),a=s.fromSolidity(o,e);return""!=t?n=a.attach(t):""==t&&(n=await a.getDeployTransaction()),n}async function A(e,t,r,n,i,s,o,a){let c,l,f,m,A,k,P,E;""!=a&&(c=d(a)),m=b(o,c),f=[],""!=e?(P=[u(e),"wallet.dat"],E=h(P),k=[E,t,e,m],A=y.apply(null,k),function(e){p(`Wallet is '${e}'.`)}(A),f.push(A)):f.push(m),f.push(r),""!=i?(f.push(n,i),_contract_get_fun=_):""!=s?(f.push(s),_contract_get_fun=v):""==i&&""!=n?(f.push(n),_contract_get_fun=w):""==i&&""==n&&""==s&&function(){const e=["You need to provide either","the bytecode or the data"].join(" ");g(e,1)}();try{l=await _contract_get_fun.apply(null,f)}catch(e){console.error(e)}return l}function k(){let e,t;for(e of(t=["Usage:"," contract-get"," <quiet>"," <wallet_seed>"," <wallet_password_path>"," <contract_address>"," <contract_abi_path>"," <contract_bytecode_path>"," <contract_compiler_output_path>"," <target_network>"," (<api_key_path>)","","Args:"," <quiet> Can be 'y' or 'n'"," Default: y"," <wallet_seed> Path of the seed phrase."," <wallet_password_path> Wallet password path."," <contract_address> Contract of the address one is"," getting the contract of."," <contract_abi_path> Path of the contract ABI."," <contract_bytecode_path> Path for the contract bytecode."," <contract_compiler_output_path> Path for the contract compiler"," output path (the hardhat artifact)."," <target_network> Network on which the contract"," resides."," <api_key_path> Path of the API key for the"," contract ABI provider service.",""," Options:"," -h This help."],t))p(e);process.exit()}c("contract-get")&&(app_name="contract-get",wallet_seed="",wallet_password_path="",contract_address="",contract_abi_path="",contract_bytecode_path="",contract_compiler_output_path="",target_network="",api_key_path="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(wallet_password_path=e),5==t&&(contract_address=e),6==t&&(contract_abi_path=e),7==t&&(contract_bytecode_path=e),8==t&&(contract_compiler_output_path=e),9==t&&(target_network=e),10==t&&(api_key_path=e),"-h"!=e&&"--help"!=e||k()}),""==contract_abi_path&&""==contract_bytecode_path&&""==contract_compiler_output_path&&k(),function(){let e,t;for(e of(t=[],t.push(" Wallet seed: {wallet_seed}".replace("{wallet_seed}",wallet_seed)),t.push(" Wallet password: {wallet_password_path}".replace("{wallet_password_path}",wallet_password_path)),t.push(" Contract address: {contract_address}".replace("{contract_address}",contract_address)),t.push(" Contract ABI path: {contract_abi_path}".replace("{contract_abi_path}",contract_abi_path)),t.push(" Contract bytecode: {contract_bytecode_path}".replace("{contract_bytecode_path}",contract_bytecode_path)),t.push("Contract compiler output: {contract_compiler_output_path}".replace("{contract_compiler_output_path}",contract_compiler_output_path)),t.push(" Target network: {target_network}".replace("{target_network}",target_network)),t.push(" API Key: {api_key_path}".replace("{api_key_path}",api_key_path)),t))p(e)}(),app_opts=[wallet_seed,wallet_password_path,contract_address,contract_abi_path,contract_bytecode_path,contract_compiler_output_path,target_network,api_key_path],A.apply(null,app_opts)),e.exports={_contract_get:A}},2189(e,t,r){const n=r(8368),i=n._cmdline_check,s=n._error_display,o=n._msg_info,a=n._msg_error,c=n._printf,{ethers:u}=r(4193),l=(u.formatEther,r(1326)),d=l._transaction_get,f=l._transaction_receipt_get;function h(e){return new Promise(t=>setTimeout(t,e))}async function p(e,t,r,n,i,o,c,u){let l,p,g,m,y,b,w,_,v,A;for(c=c.toLowerCase(),l=1,A="",_output_path="",b=[t,e,"",n,i,o,r,_output_path,u],w=[t,e,"",n,i,o,r,_output_path,u];l<=t;)try{if(v=await d.apply(null,b),null==v)throw{error:{message:"Undefined transaction."}};if(null!=v&&(p=v.from,y=v.to),null!=y)throw{error:{message:"The transaction is not a deployment."}};if(m=await f.apply(null,w),null==m)throw{error:{message:"Undefined transaction receipt."}};if(null!=m&&(_=m.contractAddress.toLowerCase()),_!=c)throw console.error(m),console.error("Contract address:",c),console.error("Transaction contract:",_),{error:{message:"The transaction does not deploy input contract."}};g=p;break}catch(e){s(e),l+=1,a("Increasing retry and waiting 3 seconds.",0),await h(3e3)}if(l>t)throw"Maximum number of retries reached.";return g}function g(e){let t,r;for(t of(r=["Returns the deployer address for a contract.","","Usage:"," deployer-get"," <quiet>"," <wallet_seed>"," <retries_max>"," <api_key_path>"," <chain_id>"," <chain_name>"," <target_network>"," <contract_address>"," <transaction_deployment>","","Args:"," <quiet> Can be 'y' or 'n'"," Default: y"," <wallet_seed> Path of the file containing"," the seed phrase."," <retries_max> Maximum number of retries before"," failing."," <api_key_path> Path of the API key for the"," contract ABI provider service"," <chain_id> Chain ID for the network."," <chain_name> Name for the network."," <target_network> Network on which the contract"," resides."," <contract_address> Address of the contract"," <transaction_deployment> Contract deployment transaction.",""," Options:"," -h This help."],r))o(t);process.exit(e)}i("deployer-get")&&(app_name="deployer-get",wallet_seed="",retries_max="",api_key_path="",chain_id="",chain_name="",target_network="",contract_address="",transaction_deployment="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(retries_max=e),5==t&&(api_key_path=e),6==t&&(chain_id=e),7==t&&(chain_name=e),8==t&&(target_network=e),9==t&&(contract_address=e),10==t&&(transaction_deployment=e),"-h"!=e&&"--help"!=e||(quiet="n",g(0))}),""==contract_address&&(a("No contract address specified.",0),quiet="n",g(1)),""==transaction_deployment&&(a("No deployment transaction specified.",0),quiet="n",g(1)),""==retries_max&&(retries_max=10),function(){let e,t;for(e of(t=[],t.push("deployer-get configuration:"),t.push(" Wallet seed: {wallet_seed}".replace("{wallet_seed}",wallet_seed)),t.push(" Max retries: {retries_max}".replace("{retries_max}",retries_max)),t.push(" API Key path: {api_key_path}".replace("{api_key_path}",api_key_path)),t.push(" Chain ID: {chain_id}".replace("{chain_id}",chain_id)),t.push(" Chain Name: {chain_name}".replace("{chain_name}",chain_name)),t.push(" Target network: {target_network}".replace("{target_network}",target_network)),t.push(" Contract address: {contract_address}".replace("{contract_address}",contract_address)),t.push(" Deployment transaction: {transaction_deployment}".replace("{transaction_deployment}",transaction_deployment)),t))o(e)}(),app_opts=[wallet_seed,retries_max,api_key_path,chain_id,chain_name,target_network,contract_address,transaction_deployment],async function(e){let t,r;try{if(t=await p.apply(null,e),null==t)throw r="It has not been possible to determine the deployer from the transaction.","It has not been possible to determine the deployer from the transaction.";c(t.toString())}catch(e){a(e,1)}}(app_opts)),e.exports={_deployer_get:p}},852(e,t,r){const n=r(8368),i=n._cmdline_check,s=n._msg_info,o=n._msg_error,a=n._printf,c=n._process_exit,u=r(2189)._deployer_get;async function l(e,t,r,n,i,s,o,a,c){let l;const d=[e,t,r,n,i,s,o,c],f=await u.apply(null,d);if(void 0===f)throw"Error obtaining the deployer from input data.";return a==f?l=!0:a!=f&&(l=!1),l}function d(e){let t,r;for(t of(r=["Given a deployment transaction hash","and a contract address, determines","if an input address is the","contract deployer.","","Usage:"," deployer-verify"," <quiet>"," <wallet-seed>"," <retries-max>"," <api-key-path>"," <chain-id>"," <chain-name>"," <target-network>"," <contract-address>"," <contract-deployer>"," <transaction-deployment>","","Args:"," <quiet> Can be 'y' or 'n'"," Default: y"," <wallet-seed> Path of the file containing"," the seed phrase."," <retries-max> Maximum number of retries before"," failing."," <api-key-path> Path of the API key for the"," contract ABI provider service"," <target-network> Network on which the contract"," resides."," <contract-address> Address of the contract."," <contract-deployer> Address of the supposed deployer."," <transaction-deployment> Contract deployment transaction.",""," Options:"," -h This help."],r))s(t);c(e)}function f(){""==retries_max&&(retries_max=10)}i("deployer-verify")&&(app_name="deployer-verify",wallet_seed="",retries_max="",api_key_path="",chain_id="",chain_name="",target_network="",contract_address="",contract_deployer="",transaction_deployment="",quiet="",function(){let e;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(retries_max=e),5==t&&(api_key_path=e),6==t&&(chain_id=e),7==t&&(chain_name=e),8==t&&(target_network=e),9==t&&(contract_address=e),10==t&&(contract_deployer=e),11==t&&(transaction_deployment=e),"-h"!=e&&"--help"!=e||d(0)}),""==contract_address&&(e="No contract address specified.",o(e,0),quiet="n",f(),d(1)),""==contract_deployer&&(e="No contract deployer specified.",o(e,0),quiet="n",f(),d(1)),""==transaction_deployment&&(e="No deployement transaction specified.",o(e,0),quiet="n",f(),d(1))}(),f(),function(){let e;const t=["deployer-get configuration:",` Wallet seed: ${wallet_seed}`,` Max retries: ${retries_max}`,` API Key path: ${api_key_path}`,` Chain ID: ${chain_id}`,` Chain Name: ${chain_name}`,` Target network: ${target_network}`,` Contract address: ${contract_address}`,` Contract deployer: ${contract_deployer}`,` Deployment transaction: ${transaction_deployment}`];for(e of t)s(e)}(),app_opts=[wallet_seed,retries_max,api_key_path,chain_id,chain_name,target_network,contract_address,contract_deployer,transaction_deployment],async function(e){let t;try{if(t=await l.apply(null,e),void 0===t)throw"It has not been possile to discern from input data whether the candidate deployer is the contract actual deployer.";a(t.toString())}catch(e){o(e,1)}}(app_opts)),e.exports={_deployer_verify:l}},524(e,t,r){const n=r(8368),i=n._cmdline_check,s=n._dirname,o=n._error_display,a=n._msg_info,c=n._msg_error,u=n._path_join,l=n._sleep,{ethers:d}=r(4193),f=d,h=f.formatEther,p=f.parseUnits,g=r(3182)._price_gas_transaction_get,m=r(907);function y(e){c(`Transaction undefined at attempt '${e}'.`,0)}function b(e){c(`Transaction failed at attempt '${e}'.`,0)}function w(e){return p(e,"ether")}async function _(e,t,r,n,i,s,u,d,f,h,p,m,y,b,_){let v,A,k,P,E,x,O,S,T,B,R,N,C,I,F,U,j;S=!0,R=1e8,F={},void 0!==u&&""!=u||(u="wei"),void 0!==i&&""!=i||(i=0),"auto"==i||"fast"==i||"nextblock"==i?i=async function(e,t,r,n){let i,s,o,c,u,l,d;return o="Auto-detecting gas price.",a(o),c=3,l=n,d=3,u=[e,l,t,r,"","","price","",3],n=await g.apply(null,u),u=[e,l,t,r,"","","fee","",3],i=await g.apply(null,u),u=[e,l,t,r,"","","priority","",3],s=await g.apply(null,u),o=`Got gas price '${n}' ${r} with '${i}' '${r}' with priority fee '${s}' '${r}' from rpc '${e}' using selection mode '${l}'.`,a(o),n}(d,n,u,i):(O=`Setting gas price '${i}'.`,a(O)),i=Number(i),void 0===s&&(s=0),s=BigInt(s),void 0===e||""==e?(a("Setting timeout to '300' seconds."),e=3e5):e=Number(e),void 0!==u&&""!=u||(u="wei"),void 0!==_&&""!=_||(_="n"),k=[t,r,f,h,p,m,d,n];try{if(A=await _contract_get.apply(null,k),await async function(){a("Contract object obtained.")}(),x=await A.getFunction(y),a("Method obtained."),i>0){try{j=await x.populateTransaction.apply(null,b)}catch(e){O="Error populating transaction.",o(e),c(O,0)}for(_gas_limit=Math.floor(18964174.8),O=`Setting gas price '${i}' ${u}, gas limit '${_gas_limit}' '${u}' gas fee '${E}' ${u}' and fee priority '${P}' '${u}'.`,a(O),T=0;R<Number(i)&&T<=B;)T+=1,O=`Current gas price '${i}', maximum gas price '${R}'. Waiting 30 seconds before retrying.`,a(O),await l(3e4),N=[d,I,n,u,"","","price","",C],i=await g.apply(null,N),Number(i)<=R&&(E=await g.apply(null,N),N=[d,I,n,u,"","","priority","",C],P=await g.apply(null,N));B<T&&(O=`Setting price to max price '${R}'`,a(O),i=R),T+=1,R=Math.max(R,E,P,i),j.maxFeePerGas=E,j.maxPriorityFeePerGas=P,s>0&&("ether"==u?v=w(s):"wei"==u||""==u?v=s:(O=`Unknown measure unit '${u}'.`,c(O,1)),j.value=v),j=await A.runner.sendTransaction(j)}else O="Setting no gas price.",a(O),s>0&&("ether"==u?v=w(s):"wei"==u||""==u?v=s:(O=`Unknown measure unit '${u}'.`,c(O,1)),F.value=v,b.push(F)),j=await x.send.apply(null,b);if(void 0===j)throw O={code:444444,message:"Transaction response undefined."},O;O=`Transaction no. '${j.nonce}' sent to network.`,a(O),"y"==_&&console.log(j),U=await j.wait(1,e)}catch(e){throw"code"in e&&(-32010==e.code?a(e.message):(O="Unknown error.",c(O,0),o(e))),a(e.code),O="Dynamic contract call crashed.",a(O),e}return[j,U]}async function v(e,t,r,n,i,c,d,f,p,g,m,w,v,A,k,P,E){let x,O,S,T,B,R,N;for(void 0!==c&&""!=c||(x="Setting no gas price.",a(x),c=""),void 0!==e&&""!=e||(x="Setting maximum call retries to '100'.",a(x),e=100),e=Number(e),void 0!==t&&""!=t||(x="Setting timeout to '300' seconds.",a(x),t=3e5),t=Number(t),void 0!==d&&""!=d||(x="Setting transaction value '0'.",a(x),d=0),d=BigInt(d),void 0!==typeof f&&""!=f||(x="Setting measure unit to 'wei'.",a(x),f="wei"),void 0!==n&&""!=n||(x="Wallet without password.",a(x)),N="",void 0!==N&&""!=N||(R=[s(r),"wallet.dat"],N=u(R),function(e){a(`Selecting '${e}'.`)}(N)),void 0!==E&&""!=E||(E="n"),B=[t,r,n,i,c,d,f,p,g,m,w,v,A,k],_attempt=1;_attempt<=e;)try{if([S,O]=await _.apply(null,B),void 0===O)throw y(_attempt),x="No receipt, transaction may have failed.",x;if(void 0!==O){if(x=`Transaction no. '${S.nonce}'.`,a(x),"y"==E&&(x="Transaction response:",a(x),console.log(S),x="Transaction receipt:",a(x),console.log(O)),null!=O.hash){x=`Transaction hash: '${O.hash}'.`,a(x),T=O.gasUsed*O.gasPrice,"ether"==f&&(T=h(T)),x=`Transaction cost: '${T}'.`,a(x);break}throw null==O.hash?(b(_attempt),x="Transaction hash undefined.",x):(b(_attempt),x="Unknown transaction error.",x)}}catch(e){o(e),x="Waiting 3 seconds before retrying.",a(x),await l(3e3),_attempt+=1}if(_attempt>e)throw x="Maximum number of retries reached.",x;return[S,O]}function A(e){let t;t=["Execute a dynamic call to an EVM network's contract method.","","Usage:"," evm-contract-call-dynamic"," <quiet>"," <retries-max>"," <call-timeout>"," <wallet-seed>"," <wallet-password>"," <api-key-path>"," <price-gas>"," <msg-value>"," <measure-unit>"," <target-network>"," <contract-address>"," <contract-abi_path>"," <contract-bytecode_path>"," <contract-compiler-output_path>"," <contract-method>"," [method-args]","","Args:",""," <quiet> Can be 'y' or 'n'"," Default: y",""," <retries-max> Maximum number of retries before"," failing.",""," <call-timeout> How many milliseconds to wait for a return"," before declaring the call failed.",""," <wallet-seed> Path of the file containing"," the seed phrase.",""," <wallet-password> Password of the wallet.",""," <api-key-path> Path of the API key for the"," contract ABI provider service.",""," <target-network> Network on which the contract"," resides.",""," <price-gas> Gas price for the transaction.",""," <msg-value> How much <measure-unit> attach"," to the transaction.",` Default: ${msg_value}`,""," <measure-unit> Measure unit for the transaction"," value. It can be 'wei' or 'ether'",` Default: ${measure_unit}`,""," <contract-address> Address of the contract.",""," <contract-abi_path> Contract ABI path.",""," <contract-bytecode-path> Path for the contract bytecode.",""," <contract-compiler-output-path> Path for the contract compiler"," output path (the hardhat artifact).",""," <contract-method> Contract method to execute.",""," [method-args] Arguments to pass to the method.",""," Options:"," -h (--help) This help."];for(let e=0;e<t.length;e++)a(_msgs[e]);process.exit(e)}_contract_get=m._contract_get,(i("evm-contract-call-dynamic")||i("contract-run"))&&(app_name="evm-contract-call-dynamic",retries_max="",call_timeout="",wallet_seed="",wallet_password="",api_key_path="",price_gas="",msg_value="",measure_unit="",target_network="",contract_address="",contract_abi_path="",contract_bytecode_path="",contract_compiler_output_path="",contract_method="",method_args=[],quiet="",function(){let e;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(retries_max=e),4==t&&(call_timeout=e),5==t&&(wallet_seed=e),6==t&&(wallet_password=e),7==t&&(api_key_path=e),8==t&&(price_gas=e),9==t&&(msg_value=e),10==t&&(measure_unit=e),11==t&&(target_network=e),12==t&&(contract_address=e),13==t&&(contract_abi_path=e),14==t&&(contract_bytecode_path=e),15==t&&(contract_compiler_output_path=e),16==t&&(contract_method=e),16<t&&method_args.push(e),"-h"!=e&&"--help"!=e||(quiet="n",A(0))}),""==contract_address&&(e="No contract address specified.",c("No contract address specified.",0),quiet="n",A(1))}(),function(){let e,t,r,n;for(t of(e=300,r=method_args.join(" "),300<r.length&&(r=r.substring(0,300)),n=["Dynamic call configuration:",` Measure unit: ${measure_unit}`,` Max retries: ${retries_max}`," Network settings:",` Target network: ${target_network}`,` API Key path: ${api_key_path}`,` Call timeout: ${call_timeout}`,` Gas price: ${price_gas}`," Credentials settings:",` Wallet seed: ${wallet_seed}`,` Wallet password: ${wallet_password}`," Contract settings:",` Contract address: ${contract_address}`,` Contract ABI: ${contract_abi_path}`,` Contract Bytecode: ${contract_bytecode_path}`,`Contract compiler output: ${contract_compiler_output_path}`," Call settings:",` Transaction value: ${msg_value}`,` Contract method: ${contract_method}`,` Method args: ${r}`],n))a(t)}(),""==retries_max&&(retries_max=100),""==call_timeout&&(call_timeout=3e5),""==msg_value&&(msg_value=0),""==measure_unit&&(measure_unit="wei"),app_opts=[retries_max,call_timeout,wallet_seed,wallet_password,api_key_path,price_gas,msg_value,measure_unit,target_network,contract_address,contract_abi_path,contract_bytecode_path,contract_compiler_output_path,contract_method,method_args],async function(e){let t,r;[r,t]=await v.apply(null,e),_msg="Transaction response:",console.log(r),_msg="Transaction receipt:",console.log(t)}(app_opts)),e.exports={_contract_call_dynamic:_,_contract_run:v}},4543(e,t,r){const n=r(8368);_cmdline_check=n._cmdline_check,_error_display=n._error_display,_msg_info=n._msg_info,_msg_error=n._msg_error,_printf=n._printf,_sleep=n._sleep;const i=r(907);function s(e){let t,r;r="Contract '{_contract}' obtained.",t="Contract '{_contract}' obtained.".replaceAll("{_contract}",e),_msg_info(t)}function o(e){let t;t="Method obtained.",_msg_info("Method obtained.")}async function a(e,t,r,n,i,a,c,u,l,d,f){let h,p,g,m,y,b;for(null==u&&(u=""),_retry=1,b="",p=[e,"",l,i,a,c,n,r],m=!1;_retry<=t&&0==m;)try{if(""==u||null==u?(h=await _contract_get.apply(null,p),s(h),g=await h.getFunction(d),o()):""==u&&null==u||(_msg_info("Re-using contract method."),g=u),y=await g.staticCall.apply(null,f),null!=y)m=!0;else if(null==y)throw{error:{message:"Value undefined, static call error"}}}catch(e){_error_display(e),_retry+=1,_msg_error("Increasing retry and waiting 3 seconds.",0),await _sleep(3e3)}if(_retry>t)throw{error:{message:"Maximum number of retries reached."}};return[y,g]}function c(e){let t,r;for(t of(r=["Execute a static call to an EVM network's contract method","","Usage:"," evm-contract-call-static"," <quiet>"," <wallet_seed>"," <retries_max>"," <api_key_path>"," <target_network>"," <contract_abi_path>"," <contract_bytecode_path>"," <contract_compiler_output_path>"," <contract_address>"," <contract_method>"," <method_args>","","Args:"," <quiet> Can be 'y' or 'n'"," Default: y"," <wallet_seed> Path of the file containing"," the seed phrase."," <retries_max> Maximum number of retries before"," failing."," <api_key_path> Path of the API key for the"," contract ABI provider service"," <target_network> Network on which the contract"," resides."," <contract_abi_path> Path of the contract ABI"," <contract_bytecode_path> Path for the contract bytecode"," <contract_compiler_output_path> Path for the contract compiler"," output path (the hardhat artifact)."," <contract_address> Address of the contract"," <contract_method> Contract method to execute"," [method_args] Arguments to pass to the method",""," Options:"," -h This help."],r))_msg_info(t);process.exit(e)}_contract_get=i._contract_get,_cmdline_check("evm-contract-call-static")&&(app_name="evm-contract-call-static",wallet_seed="",retries_max="",api_key_path="",target_network="",contract_address="",contract_abi_path="",contract_bytecode_path="",contract_compiler_output_path="",method_object="",contract_method="",method_args=[],quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(retries_max=e),5==t&&(api_key_path=e),6==t&&(target_network=e),7==t&&(contract_abi_path=e),8==t&&(contract_bytecode_path=e),9==t&&(contract_compiler_output_path=e),10==t&&(contract_address=e),11==t&&(contract_method=e),11<t&&method_args.push(e),"-h"!=e&&"--help"!=e||c(0)}),""==contract_address&&c(1),""==retries_max&&(retries_max=100),function(){let e,t,r;for(e of(r=[],r.push("Static call configuration:"),r.push(" evm-contract-call-static configuration:"),r.push(" Wallet seed: {wallet_seed}".replace("{wallet_seed}",wallet_seed)),r.push(" Max retries: {retries_max}".replace("{retries_max}",retries_max)),r.push(" API Key path: {api_key_path}".replace("{api_key_path}",api_key_path)),r.push(" Target network: {target_network}".replace("{target_network}",target_network)),r.push(" Contract ABI: {contract_abi_path}".replace("{contract_abi_path}",contract_abi_path)),r.push(" Contract bytecode: {contract_bytecode_path}".replace("{contract_bytecode_path}",contract_bytecode_path)),r.push("Contract compiler output: {contract_compiler_output_path}".replace("{contract_compiler_output_path}",contract_compiler_output_path)),r.push(" Contract address: {contract_address}".replace("{contract_address}",contract_address)),r.push(" Contract method: {contract_method}".replace("{contract_method}",contract_method)),t=method_args.join(" "),r.push(" Method args: {method_args}".replace("{method_args}",t)),r))_msg_info(e)}(),app_opts=[wallet_seed,retries_max,api_key_path,target_network,contract_abi_path,contract_bytecode_path,contract_compiler_output_path,method_object,contract_address,contract_method,method_args],async function(e){let t,r;try{if([r,t]=await a.apply(null,e),null==r)throw{error:{message:"Static contract call returned undefined value."}};_printf(r.toString())}catch(e){_error_display(e),_msg_error("Error while running static call.",1)}}(app_opts)),e.exports={_contract_call_static:a}},1326(e,t,r){const n=r(4015)._transaction_get,i=r(1332)._transaction_receipt_get;e.exports={_transaction_get:n,_transaction_receipt_get:i}},4015(e,t,r){const n=r(8368);_cmdline_check=n._cmdline_check,_dirname=n._dirname,_file_read=n._file_read,_file_write=n._file_write,_json_display=n._json_display,_path_join=n._path_join,_msg_info=n._msg_info,_msg_error=n._msg_error,_printf=n._printf;const i=r(3182);async function s(e,t,r,n,i,s,o,a,c){let u,l,d,f,h,p,g,m;d=[s],null==a&&(a=""),""!=o?u=_file_read(o):null==o&&(u=""),d.push(u),null==n&&(n=""),d.push(n),null==i&&(i=""),d.push(i),l=await _provider_get.apply(null,d),""!=t&&null!=t&&(g=[_dirname(t),"wallet.dat"],m=_path_join(g),p=[m,r,t,l],h=_wallet_get.apply(null,p),function(e){let t,r;r="Wallet is '{_wallet}'.",t="Wallet is '{_wallet}'.".replaceAll("{_wallet}",e),_msg_info(t)}(h),l=h);try{f=await l.getTransaction(c),""!=a&&(_json=_json_display(f),_file_write(a,_json))}catch(e){console.error(e)}return f}function o(e){let t,r;for(t of(r=["Usage:"," contract-get"," <quiet>"," <retries_max>"," <wallet_seed>"," <wallet_password_path>"," <chain_id>"," <chain_name>"," <target_network>"," <api_key_path>"," <output_path>"," <transaction_address>","","Args:"," <quiet> Can be 'y' or 'n'"," Default: y"," <retries_max> Maximum number of retries before"," failing."," <wallet_seed> Path of the seed phrase."," <wallet_password_path> Wallet password path."," <chain_id> Chain ID for the network."," <chain_name> Name for the network."," <target_network> Network on which the transaction"," resides."," <api_key_path> Path of the API key for the"," network provider service."," <output_path> File on which to optionally save"," the output."," <transaction_address> Transaction one wants to retrieve.",""," Options:"," -h This help."],r))_msg_info(t);process.exit(e)}_wallet_get=i._wallet_get,_provider_get=i._provider_get,_cmdline_check("transaction-get")&&(app_name="transaction-get",retries_max="",wallet_seed="",wallet_password_path="",transaction_address="",chain_id="",chain_name="",target_network="",api_key_path="",output_path="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(retries_max=e),4==t&&(wallet_seed=e),5==t&&(wallet_password_path=e),6==t&&(chain_id=e),7==t&&(chain_name=e),8==t&&(target_network=e),9==t&&(api_key_path=e),10==t&&(output_path=e),11==t&&(transaction_address=e),"-h"!=e&&"--help"!=e||(quiet="n",o(0))}),""==transaction_address&&(quiet="n",o(1)),""==retries_max&&(retries_max=100),""==chain_id&&_msg_info("TODO: use evm_chains_info_module"),""==chain_name&&_msg_info("TODO: use evm_chains_info_module"),function(){let e,t;for(e of(t=[],t.push(" Maximum retries: {retries_max}".replace("{retries_max}",retries_max)),t.push(" Wallet seed: {wallet_seed}".replace("{wallet_seed}",wallet_seed)),t.push(" Chain ID: {chain_id}".replace("{chain_id}",chain_id)),t.push(" Chain Name: {chain_name}".replace("{chain_name}",chain_name)),t.push(" Target network: {target_network}".replace("{target_network}",target_network)),t.push(" API Key: {api_key_path}".replace("{api_key_path}",api_key_path)),t.push(" Output path: {output_path}".replace("{output_path}",output_path)),t.push(" Transaction address: {transaction_address}".replace("{transaction_address}",transaction_address)),t))_msg_info(e)}(),app_opts=[retries_max,wallet_seed,wallet_password_path,chain_id,chain_name,target_network,api_key_path,output_path,transaction_address],async function(e){let t,r;try{if(r=await s.apply(null,e),null==r)throw"Transaction Get returned undefined value.";t=_json_display(r),_printf(t)}catch(e){_msg_error(e,1)}}(app_opts)),e.exports={_transaction_get:s}},1332(e,t,r){const n=r(8368);_cmdline_check=n._cmdline_check,_dirname=n._dirname,_file_read=n._file_read,_file_write=n._file_write,_json_display=n._json_display,_path_join=n._path_join,_msg_info=n._msg_info,_msg_error=n._msg_error,_printf=n._printf;const i=r(3182);async function s(e,t,r,n,i,s,o,a,c){let u,l,d,f,h,p,g,m,y;f=[s],null==a&&(a=""),""!=o?u=_file_read(o):null==o&&(u=""),f.push(u),null==n&&(n=""),f.push(n),null==i&&(i=""),f.push(i),d=await _provider_get.apply(null,f),""!=t&&null!=t&&(m=[_dirname(t),"wallet.dat"],y=_path_join(m),g=[y,r,t,d],p=_wallet_get.apply(null,g),function(e){let t,r;r="Wallet is '{_wallet}'.",t="Wallet is '{_wallet}'.".replaceAll("{_wallet}",e),_msg_info(t)}(p),d=p);try{h=await d.getTransactionReceipt(c),""!=a&&(l=_json_display(h),_file_write(a,l))}catch(e){console.error(e)}return h}function o(e){let t,r;for(t of(r=["Usage:"," transaction-receipt-get"," <quiet>"," <retries-max>"," <wallet-seed>"," <wallet-password-path>"," <chain-id>"," <chain_-ame>"," <target-network>"," <api-key-path>"," <output-path>"," <transaction-address>","","Args:"," <quiet> Can be 'y' or 'n'"," Default: y"," <retries-max> Maximum number of retries before"," failing."," <wallet-seed> Path of the seed phrase."," <wallet-password_path> Wallet password path."," <chain-id> Chain ID for the network."," <chain-name> Name for the network."," <target-network> Network on which the transaction"," resides."," <api-key-path> Path of the API key for the"," contract ABI provider service."," <output-path> File on which to optionally save"," the output."," <transaction-address> Transaction one wants to retrieve.",""," Options:"," -h This help."],r))_msg_info(t);process.exit(e)}_wallet_get=i._wallet_get,_provider_get=i._provider_get,_cmdline_check("transaction-receipt-get")&&(app_name="transaction-receipt-get",retries_max="",wallet_seed="",wallet_password_path="",transaction_address="",chain_id="",chain_name="",target_network="",api_key_path="",output_path="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(retries_max=e),4==t&&(wallet_seed=e),5==t&&(wallet_password_path=e),6==t&&(chain_id=e),7==t&&(chain_name=e),8==t&&(target_network=e),9==t&&(api_key_path=e),10==t&&(output_path=e),11==t&&(transaction_address=e),"-h"!=e&&"--help"!=e||(quiet="n",o(0))}),""==transaction_address&&(quiet="n",o(1)),""==retries_max&&(retries_max=100),""==chain_id&&_msg_info("TODO: use evm_chains_info_module"),""==chain_name&&_msg_info("TODO: use evm_chains_info_module"),function(){let e,t;for(e of(t=[` Maximum retries: ${retries_max}`,` Wallet seed: ${wallet_seed}`,` Chain ID: ${chain_id}`,` Chain Name: ${chain_name}`,` Target network: ${target_network}`,` API Key: ${api_key_path}`,` Output path: ${output_path}`,` Transaction address: ${transaction_address}`],t))_msg_info(e)}(),app_opts=[retries_max,wallet_seed,wallet_password_path,chain_id,chain_name,target_network,api_key_path,output_path,transaction_address],async function(e){let t,r;try{if(r=await s.apply(null,e),null==r)throw"'Transaction Receipt Get' returned undefined value.";t=_json_display(r),_printf(t)}catch(e){_msg_error(e,1)}}(app_opts)),e.exports={_transaction_receipt_get:s}},2768(e,t,r){const{ethers:n}=r(4193),i=r(8368),s=i._argv_get,o=i._basename,a=i._cmdline_check,c=i._dirname,u=i._file_read,l=i._file_write,d=i._msg_info,f=(i._msg_info_obj,i._msg_error),h=i._path_join,p=i._process_exit,g=r(7785)._wallet_get,m=r(9341),y=m._provider_get,b=m._msg_info_provider_generated;async function w(e,t,r,n,i,s){let o,a,d,p,m,w;return void 0!==e&&""!=e&&e!=[]||(_msg="No input seed file or phrase.",f(_msg,1)),m="",p=c(e),w=[p,"wallet.dat"],_wallet_path=h(w),a="",""!=r&&(a=u(r)),d=[t,a,n,i],_provider=y.apply(null,d),b(_provider),_wallet_get_opts=[_wallet_path,"",e,_provider],_wallet=g.apply(null,_wallet_get_opts),o=_wallet.address,null!=s&&""!=s&&l(s,o),o}function _(e){let t;void 0!==e&&""!=e||(e=0);const r=s(),n=["Returns the EOA fingerprint of a seed (the address)","","usage:",` ${o(r.$0)}`," <quiet>"," <seed>"," (<target-network>)"," (<api-key-path>)"," (<output-file>)","","args:",""," quiet It can be 'y' or 'n'.",""," seed A seed path or a seed phrase",""," target-network Chain ID or RPC address, optional.",""," api-key-path Etherscan-like service API key, optional.",""," output-file If specified will save the output"," to a file, otherwise will print it.","","options:",""," -h, --help Displays this help.",""];for(t of n)console.log(t);p(e)}function v(){"undefined"!=typeof chain_id&&""!=chain_id||(chain_id="100")}(a("address-get")||a("eoa-fingerprint"))&&(app_name="address-get",wallet_seed="",target_network="",api_key_path="",chain_id="",chain_name="",output_file="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(target_network=e),5==t&&(api_key_path=e),6==t&&(output_file=e),"-h"!=e&&"--help"!=e||(v(),quiet="n",_(0))}),""==wallet_seed&&(v(),quiet="n",f("No arguments given.",0),_(0)),v(),function(){let e,t;for(e of(t=[` ${app_name} configuration:`,` Wallet seed: ${wallet_seed}`,` Target network: ${target_network}`,` API key: ${api_key_path}`,` Output file: ${output_file}`],t))d(e)}(),app_opts=[wallet_seed,target_network,api_key_path,chain_id,chain_name,output_file],async function(e){const t=await w.apply(null,e);console.log(t)}(app_opts)),e.exports={_address_get:w}},6500(e,t,r){const{ethers:n}=r(4193),i=n,s=(i.formatEther,i.parseUnits,r(8368)),o=s._dirname,a=s._file_read,c=s._path_join,u=s._msg_info,l=(s._msg_info_obj,s._msg_error),d=(s._sleep,r(7785)._wallet_get),f=r(9712)._balance_get,h=r(9341),p=h._provider_get,g=h._msg_info_provider_generated;async function m(e,t,r,n,i,s){let u,h,m,y,b,w,_,v,A,k;for(s=void 0===s||""==s?3:Number(s),t=Number(t),b=0,_=!1,A="",v=o(e),k=[v,"wallet.dat"],_wallet_path=c(k),y=[r],""!=n&&(u=a(n),y.push(u)),_provider=await p.apply(null,y),g(_provider),_wallet_get_opts=[_wallet_path,"",e,_provider],_wallet=d.apply(null,_wallet_get_opts),w=_wallet.address,""==i&&(i="ether"),_balance_get_opts=[e,r,n,w,i];0==_&&b<s;)try{if(h=await f.apply(null,_balance_get_opts),h=Number(h),_=!0,h<=t)return m=`Balance is '${h}', requiring '${t}'.`,l(m,0),!1;if(h>t)return!0}catch(e){b+=1,m=`Error checking balance, retrying (${b} of ${s})`,console.error(e),l(m,0)}if(b==s&&0==_)throw"Failing checking the balance."}function y(){""==measure_unit&&(measure_unit="ether"),""==retries_max&&(retries_max="3")}function b(e){let t,r;for(t of(r=["Checks if wallet balance is more or less than a given amount.","","Usage:"," balance-check"," <quiet>"," <seed-path>"," <amount>"," (<target-network>)"," (<api-key>)"," (<measure-unit>)","","Arguments:"," <seed-path> Path on disk of the file"," containing the seed phrase."," <amount> How much balance to send.","","Optional arguments:"," <target-network> Name of the network to connect to."," <api-key> Path on disk of the API key for"," the network service provider."," Default: the wallet address."," corresponding to the seed."," <measure-unit> Can be 'wei' or 'ether'.",` Default: '${display_unit}'`," <retries-max> Maximum number of retries.",` Default: ${retries_max}`],r))console.log(t);process.exit(e)}_cmdline_check("balance-check")&&(app_name="balance-check",wallet_seed="",target_address="",target_amount="",target_network="",api_key="",measure_unit="",retries_max="",quiet="",function(){let e;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(target_amount=e),5==t&&(target_network=e),6==t&&(api_key=e),7==t&&(measure_unit=e),8==t&&(retries_max=e)}),""==wallet_seed&&(e="No input seed file path.",y(),b(1)),""==target_amount&&(e="No input amount.",y(),b(1))}(),function(){let e,t;for(e of(t=[` Target amount: ${target_amount}`,` Measure unit: ${measure_unit}`` Network options:`,` Target network: ${target_network}`,` API Key: ${api_key}`,"Credentials options:",` Wallet seed: ${wallet_seed}`],t))u(e)}(),app_opts=[wallet_seed,target_amount,target_network,api_key,measure_unit,retries_max],async function(e){let t;try{t=await m.apply(null,e),process.stdout.write(t.toString())}catch(e){l(e,1)}}(app_opts)),e.exports={_balance_check:m,_msg_error_balance_insufficient:function(e,t){let r;r=`Amount $'{_amount}' '${t}' requested to send is less than balance.`,l(r,1)}}},9712(e,t,r){const{ethers:n}=r(4193),i=n.formatEther,s=r(8368),o=s._argv_get,a=s._basename,c=s._dirname,u=s._file_read,l=s._file_write,d=s._msg_info,f=(s._msg_info_obj,s._msg_error),h=s._path_join,p=s._process_exit,g=s._run,m=s._sleep,y=r(7785)._wallet_get,b=r(9341),w=b._provider_get,_=b._msg_info_provider_generated;async function v(e,t,r,n,s,o,a,p){let b,v,A,k,P,E,x,O,S,T;for(a=void 0===a||""==a?3:Number(a),void 0!==p&&""!=p||(p=1e5),E=0,x=!1,S="",""!=e&&(O=c(e),T=[O,"wallet.dat"],_wallet_path=h(T)),P=[t],null==o&&(o=""),""!=r&&(_api_key=u(r),P.push(_api_key)),P.push(p),_provider=await w.apply(null,P),_(_provider),""==n&&(_wallet_get_opts=[_wallet_path,"",e,_provider],_wallet=y.apply(null,_wallet_get_opts),n=_wallet.address),k=`Retrieving balance for address '${n}' on network '${t}'.`,d(k);0==x&&E<a;)try{const e=[_provider,n];A=await g("sync",e,"_provider_get_balance",p,"native","getBalance"),""==s&&(s="ether"),"wei"==s?b=A:"ether"==s&&(v=i(A),b=v),""!=o&&l(o,b.toString()),x=!0}catch(e){E+=1,k=`Error retrieving balance, retrying (${E} of ${a})`,console.error(e),f(k,0),await m(3e3)}if(0==x&&E==a)throw k="Error retrieving balance.",k;return b}function A(){let e,t;if(e=!1,t=typeof target_network,"undefined"!=t&&""!=target_network||(target_network=100,t=typeof target_network),"number"==t?e=!0:"string"==t?target_network.startsWith("https://")||(e=!0):f(`Unknown type '${t}' for network variable.`,1),e){const e=r(4136)._rpc_get;target_network=e([target_network])[target_network]}"undefined"!=typeof display_unit&&""!=display_unit||(display_unit="ether"),"undefined"!=typeof retries_max&&""!=retries_max||(retries_max="1"),"undefined"!=typeof call_timeout&&""!=call_timeout||(call_timeout="30000")}function k(e){let t;void 0!==e&&""!=e||(e=0);const r=o(),n=["Usage:",` ${a(r.$0)}`," <quiet>"," <seed-path>"," <target-network>"," (<api-keys-path)"," (<target-address>)"," (<display-unit>)"," (<output-file>)"," (<retries-max>)"," (<call-timeout>)","","Arguments:",""," <seed-path> Path on disk of the file"," containing the seed phrase.",""," <target-network> Name, chain ID or RPC address"," of the network to connect to.","","Optional arguments:",""," <api-key-path> Path on disk of the API key for"," the network service provider.",""," <target-address> Address of which to return"," the balance of."," Default: the wallet address."," corresponding to the seed.",""," <display-unit> Can be 'wei' or 'ether'.",` Default: '${display_unit}'`,""," <output-file> File in which to save the balance.",` Default: '${output_file}'`,""," <retries-max> Maximum number of retries.",` Default: ${retries_max}`,""," <call-timeout> Timeout before declaring the call failed.",` Default: ${call_timeout}`];for(t of n)console.log(t);p(e)}(_cmdline_check("balance-get")||_cmdline_check("gas-balance"))&&(app_name="balance-get",wallet_seed="",target_network="",api_key="",target_address="",display_unit="",output_file="",retries_max="",quiet="",function(){let e;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(target_network=e),5==t&&(api_key=e),6==t&&(target_address=e),7==t&&(display_unit=e),8==t&&(output_file=e),9==t&&(retries_max=e),10==t&&(call_timeout=e),"-h"!=e&&"--help"!=e||(A(),quiet="n",k(0))}),""==wallet_seed&&""==target_address&&(e="You need to input either a seed file path or a target address.",f("You need to input either a seed file path or a target address.",0),A(),k(1))}(),function(){let e;const t=o(),r=[` ${a(t.$0)} configuration:`,` Wallet seed: ${wallet_seed}`,` Target network: ${target_network}`,` API Key: ${api_key}`,` Target address: ${target_address}`,` Display unit: ${display_unit}`,` Output file: ${output_file}`,` Maximum retries: ${retries_max}`` Call timeout: ${call_timeout}`];for(e of r)d(e)}(),app_opts=[wallet_seed,target_network,api_key,target_address,display_unit,output_file,retries_max,call_timeout],async function(e){let t;try{t=await v.apply(null,e),console.log(t.toString()),p(0)}catch(e){f(e,1),_process.exit(0)}}(app_opts)),e.exports={_balance_get:v}},7838(e,t,r){const{ethers:n}=r(4193),i=n,s=(i.formatEther,i.parseUnits),o=r(8368),a=o._argv_get,c=o._basename,u=o._dirname,l=o._file_read,d=o._path_join,f=o._msg_info,h=(o._msg_info_obj,o._msg_error),p=o._process_exit,g=r(7785)._wallet_get,m=r(6500),y=m._balance_check,b=m._msg_error_balance_insufficient,w=r(9341),_=w._provider_get,v=w._msg_info_provider_generated;async function A(e,t,r,n,i,o,a,c){let h,p,m,w,A,k;void 0!==a&&""!=a||(a=3e5),void 0!==o&&""!=o||(o="ether"),void 0!==c&&""!=c||(c="n");const P=u(e),E=d([P,"wallet.dat"]);if(A=[n],""!=i){const e=l(i);A.push(e)}const x=await _.apply(null,A);v(x);const O=[E,"",e,x],S=g.apply(null,O);S.address,p=[e,r,n,i,o],_check=await y.apply(null,p),0==_check&&b(r,o),m=o,"wei"==o?h=r:"ether"==o&&(h=function(e){return s(e,"ether")}(r),m="wei"),function(e,t,r,n,i){let s;s=`Sending '${e}' '${r}' `,n!=r&&(s=s+`('${t}' `+`'${n}') `),s+=`to address '${i}'.`,f(s)}(r,h,o,m,t),k={to:t,value:h};const T=await S.sendTransaction(k);"y"==c&&(w="Transaction response:",f(w),console.log(T));const B=await T.wait(1,a);return"y"==c&&(w="Transaction receipt:",f(w),console.log(B)),[T,B]}function k(){let e,t;if(e=!1,t=typeof target_network,"undefined"!=t&&""!=target_network||(target_network=100,t=typeof target_network),"number"==t?e=!0:"string"==t?target_network.startsWith("https://")||(e=!0):h(`Unknown type '${t}' for network variable.`,1),e){const e=r(4136)._rpc_get;target_network=e([target_network])[target_network]}"undefined"!=typeof measure_unit&&""!=measure_unit||(measure_unit="ether"),"undefined"!=typeof call_timeout&&""!=call_timeout||(call_timeout="ether")}function P(){let e;const t=a(),r=["Transfer gas from an address to another.","","Usage:",` ${c(t.$0)}`," <quiet>"," <seed-path>"," <target-address>"," <amount>"," ( <target-network>"," <api-key>"," <measure-unit>"," <call-timeout> )","","Args:",""," <seed-path> Path on disk of the file"," containing the seed phrase.",""," <target-address> Address to send some balance to.",""," <amount> How much balance to send.",""," <target-network> Name of the network to connect to.",` Default: ${target_network}`,""," <api-key> Path on disk of the API key for"," the network service provider."," Default: the wallet address.",""," <measure-unit> Can be 'wei' or 'ether'.",` Default: ${measure_unit}`,""," <call-timeout> Timeout before declaring the call failed.",` Default: ${call_timeout}`];for(e of r)console.log(e);p()}(_cmdline_check("balance-send")||_cmdline_check("gas-transfer"))&&(app_name="balance-send",app_opts=[],method_args=[],wallet_seed="",target_address="",target_amount="",target_network="",api_key="",measure_unit="",call_timeout="",quiet="",function(){let e;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(wallet_seed=e),4==t&&(target_address=e),5==t&&(target_amount=e),6==t&&(target_network=e),7==t&&(api_key=e),8==t&&(measure_unit=e),9==t&&(call_timeout=e),"-h"!=e&&"--help"!=e||(k(),quiet="n",P())}),"undefined"!=typeof wallet_seed&&""!=wallet_seed||(e="No seed phrase given in input.",h(e,0),P()),"undefined"!=typeof target_address&&""!=target_address||(k(),quiet="n",e="No target address given in input.",h(e,0),P()),"undefined"!=typeof target_amount&&""!=target_amount||(k(),e="No target address given in input.",h(e,0),P())}(),k(),function(){let e;const t=a(),r=[` ${c(t.$0)} configuration:`,` Wallet seed: ${wallet_seed}`,` Target address: ${target_address}`,` Target amount: ${target_amount}`,` Target network: ${target_network}`,` API Key: ${api_key}`,` Measure unit: ${measure_unit}`,` Call timeout: ${call_timeout}`];for(e of r)f(e)}(),app_opts=[wallet_seed,target_address,target_amount,target_network,api_key,measure_unit,call_timeout],async function(e){let t,r;[r,t]=await A.apply(null,e),console.log("Transaction response:"),console.log(r),console.log("Transaction receipt:"),console.log(t)}.apply(null,app_opts)),e.exports={_balance_send:A}},8605(e,t,r){const{ethers:n}=r(4193),i=(n.formatEther,r(8368)),s=i._argv_get,o=i._basename,a=(i._dirname,i._file_read),c=i._file_write,u=i._msg_info,l=(i._msg_info_obj,i._msg_error),d=(i._path_join,i._process_exit),f=i._run,h=i._sleep,p=(r(7785)._wallet_get,r(9341)),g=p._provider_get,m=p._msg_info_provider_generated;async function y(e,t,r,n,i){let s,o,d,p,y;for(n=void 0===n||""==n?3:Number(n),void 0!==i&&""!=i||(i=1e5),p=0,y=!1,d=[e],null==r&&(r=""),""!=t&&(_api_key=a(t),d.push(_api_key)),d.push(i),_provider=await g.apply(null,d),m(_provider),o=`Retrieving block number for network '${e}'.`,u(o);0==y&&p<n;)try{const e=[_provider];if(s=await f("sync",e,"_provider_get_block_number",i,"native","getBlockNumber"),void 0===s)throw{message:"Timeout reached for block number retrieval."};""!=r&&c(r,s.toString()),y=!0}catch(t){p+=1,o=`Error retrieving block number from network/rpc '${e}', retrying (${p} of ${n})`,console.error(t),l(o,0),await _provider.destroy(),await h(3e3),_provider=await g.apply(null,d)}if(0==y&&p==n)throw _provider.destroy(),o=`Failed retrieving block numberfrom network '${e}'.`,o;return s}function b(){let e;e=!1;const t=typeof target_network;if("number"==t?e=!0:"string"==t?target_network.startsWith("https://")||(e=!0):l(`Unknown type '${t}' for network variable.`,1),e){const e=r(4136)._rpc_get;target_network=e([target_network])[target_network]}"undefined"!=typeof retries_max&&""!=retries_max||(retries_max="1"),"undefined"!=typeof call_timeout&&""!=call_timeout||(call_timeout="30000")}function w(e){let t;void 0!==e&&""!=e||(e=0);const r=s(),n=["Returns current block number for a blockchain network","","Usage:",` ${o(r.$0)}`," <quiet>"," <target-network>"," ( <api-key-path"," <output-file>"," <retries-max>"," <call-timeout> )","","Arguments:",""," <target-network> Name, chain ID or RPC address"," of the network to connect to.","","Optional arguments:",""," <api-key-path> Path on disk of the API key for"," the network service provider.",""," <output-file> File in which to save the block number.",` Default: '${output_file}'`,""," <retries-max> Maximum number of retries.",` Default: ${retries_max}`,""," <call-timeout> Timeout before declaring the call failed.",` Default: ${call_timeout}`];for(t of n)console.log(t);d(e)}(_cmdline_check("block-number-get")||_cmdline_check("block-number"))&&(app_name="block-number-get",wallet_seed="",target_network="",api_key="",target_address="",output_file="",retries_max="",call_timeout="",quiet="",function(){let e;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(target_network=e),4==t&&(api_key=e),5==t&&(output_file=e),6==t&&(retries_max=e),7==t&&(call_timeout=e),"-h"!=e&&"--help"!=e||(b(),quiet="n",w(0))}),""==target_network&&(e="No network given in input.",l("No network given in input.",0),b(),w(1))}(),b(),function(){let e;const t=s(),r=[` ${o(t.$0)} configuration:`,` Target network: ${target_network}`,` API Key: ${api_key}`,` Output file: ${output_file}`,` Maximum retries: ${retries_max}`,` Call timeout: ${call_timeout}`];for(e of r)u(e)}(),app_opts=[target_network,api_key,output_file,retries_max,call_timeout],async function(e){let t;try{t=await y.apply(null,e),console.log(t.toString()),d(0)}catch(e){l(e,1),d(1)}}(app_opts)),e.exports={_block_number_get:y}},2574(e,t,r){const{ethers:n}=r(4193),i=n,s=(i.formatEther,i.parseUnits),o=r(8368),a=o._cmdline_check,c=o._msg_info,u=o._msg_error;function l(e){let t;return t=String(e),s(t,"ether")}function d(e){let t,r;for(t of(r=["Usage:"," ethers-to-wei"," <ethers-input>"],r))c(t);process.exit(e)}a("ethers-to-wei")&&(app_name="ethers-to-wei",ethers_input="",quiet="",function(){let e;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(ethers_input=e),"-h"!=e&&"--help"!=e||(quiet="n",d(0))}),""==ethers_input&&(e="No arguments given.",u("No arguments given.",0),quiet="n",d(0))}(),function(){let e,t;for(e of(t=[" Input ethers: {ethers_input}".replaceAll("{ethers_input}",ethers_input)],t))c(e)}(),_wei=String(l(ethers_input)),console.log(_wei)),e.exports={_ethers_to_wei:l}},9341(e,t,r){const{ethers:n}=r(4193),i=n,s=i.FetchRequest,o=i.getDefaultProvider,a=i.JsonRpcProvider,c=i.Network,u=r(8368),l=u._cmdline_check,d=u._msg_info;function f(e){let t,r,n,i;const s=typeof e;if("undefined"==s)throw i="Provider undefined.",_error={error:i},_error;if("object"==s)if(t=typeof e._getConnection,"undefined"==t)i="Probably a dummy connection method",d(i);else if("JsonRpcProvider"==t)t=typeof e._getConnection,i="Json RPC provider.",d(i),"undefined"!=t&&(n=e._getConnection().timeout),i=`Provider '${e}' with timeout '${n}' generated.`,d(i);else for(r in e)i=`Provider key: ${r}, value '${e[r]}'`,d(i)}function h(e){let t,r;if(void 0!==e&&e!=[]&&""!=e||(e=[]),0<e.length?(t=e[0],r=typeof t,"object"==r&&(e=t)):t="",1==e.length&&(t=e[0],r=typeof t,"string"==r&&t.includes(","))){const r=t.split(",");1<r.length&&(e=r)}return[e,t]}function p(e){let t;const n=r(4136)._rpc_get;return t=[e],[t,_target_network]=h(t),n(t)[e]}async function g(e,t,r,n,i,u){let l,h,g,m,y,b,w,_;return void 0!==e&&""!=e||(void 0!==r&&""!=r?(g=`Getting RPC for network with chain ID '${r}'.`,d(g),e=p(r)):(g="No network or chain id given in input, will return empty provider.",d(g))),e.startsWith("https://")||e.startsWith("wss://")||(g=`Given chain ID as a network url, obtaining an RPC url for the network with chain ID '${r}'.`,d(g),e=p(e)),void 0===i||""==i?(i=300,u=!1):u=!0,i=Number(i),h=[],y=[null],w={},"gnosis"==e?(_="https://rpc.gnosischain.com",l=_):"ethereum"==e?""!=t?(l="etherscan",w={etherscan:t,exclusive:["etherscan","infura"]}):(_="https://rpc.ankr.com/eth",l=_):l=e,""==l&&(l="mainnet"),h.push(l),""!=n&&null!=n&&null!=n||(n=""),y.push(n),""==r||null==r||null==r||isNaN(r)||(r=Number(r),y.push(r)),2<y.length&&(m=new(Function.prototype.bind.apply(c,y)),h.push(m)),1==u?l.startsWith("http")&&(_request=new s(l),_request._getConnection().timeout=i,b=await new a(_request)):0==u&&h.push(w),b=await o.apply(null,h),f(b),b}function m(e){let t,r;for(t of(r=["Usage:"," network-provider"," <target-network>"," <api-key-path>"," (<chain-id>)"," (<chain-name>)","","Args:"," <target-network> Network on which the transaction"," resides."," <api-key-path> Path of the API key for the"," contract ABI provider service."," <chain-id> Chain ID for the network."," <chain-name> Name for the network.",""," Options:"," -h This help."],r))console.log(t);-1<e&&process.exit(e)}u._msg_error,l("network-provider")&&(app_name="network-provider",target_network="",api_key="",chain_id="",chain_name="",connection_timeout="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(target_network=e),3==t&&(api_key=e),4==t&&(chain_id=e),5==t&&(chain_name=e),"-h"!=e&&"--help"!=e||(quiet="n",m(0))}),""==target_network&&(quiet="n",m(1)),""==target_network&&(target_network="gnosis"),""==connection_timeout&&(connection_timeout="300000"),function(){let e,t;for(e of(t=[` Target network: ${target_network}`,` API Key: ${api_key}`,` Chain ID: ${chain_id}`,` Chain Name: ${chain_name}`," Timeout: "+(connection-timeout)],t))d(e)}(),app_opts=[target_network,api_key,chain_id,chain_name,connection_timeout],g.apply(null,app_opts)),e.exports={_provider_get:g,_msg_info_provider_generated:f,_target_networks_check:h}},8119(e,t,r){const{ethers:n}=r(4193),i=n,s=i.formatEther,o=(i.FetchRequest,r(8368)),a=o._dirname,c=o._file_read,u=o._file_write,l=o._path_join,d=o._msg_info,f=(o._msg_info_obj,o._msg_error),h=o._sleep,p=(r(7785)._wallet_get,r(9341)),g=p._provider_get,m=p._msg_info_provider_generated;async function y(e,t,r,n,i,o,d,p,y){let b,w,_,v,A,k,P,E,x,O,S;for(void 0!==y&&""!=y||(y="n"),void 0!==o&&""!=o||(o="price"),void 0!==p&&""!=p||(p=3),p=Number(p),void 0!==r&&""!=r||(r="wei"),_timeout=1e5,P=0,E=!1,O="",x=a(n),S=[x,"wallet.dat"],_wallet_path=l(S),k=[e],null==d&&(d=""),""!=t&&(_api_key=c(t),k.push(_api_key)),k.push(_timeout),_provider=await g.apply(null,k),m(_provider);0==E&&P<p;)try{b=await _provider.getFeeData(),"y"==y&&console.log(b),"price"==o?A=b.gasPrice:"fee"==o?A=b.maxFeePerGas:"priority"==o&&(A=b.maxPriorityFeePerGas),"wei"==r?_=A:"ether"==r&&(v=s(A),_=v),""!=d&&u(d,_.toString()),E=!0}catch(e){P+=1,w=`Error retrieving gas price, retrying (${P} of ${p})`,console.error(e),f(w,0),await h(3e3)}if(0==E&&P==p)throw"Error retrieving balance.";return _}function b(e){let t,r;for(t of(r=["Usage:"," price-gas-get"," <quiet>"," <target-network>"," (<api-keys-path)"," (<display-unit>)"," (<seed-path>)"," (<target-address>)"," (<output-type>)"," (<output-file>)"," (<retries-max>)","","Arguments:"," <target-network> Name of the network to connect to.","","Optional arguments:"," <api-key-path> Path on disk of the API key for"," the network service provider."," <display-unit> Can be 'wei' or 'ether'.",` Default: '${display_unit}'`," <seed-path> Path on disk of the file"," containing the seed phrase."," <target-address> Address for which to return"," the gas price (not used)."," Default: the wallet address."," corresponding to the seed."," <output-type> Type of price output to return.",` Default: '${output_type}'`," <output-file> File in which to save the balance.",` Default: '${output_file}'`," <retries-max> Maximum number of retries.",` Default: ${retries_max}`],r))console.log(t);process.exit(e)}_cmdline_check("price-gas-get")&&(app_name="price-gas-get",wallet_seed="",target_network="",api_key="",target_address="",display_unit="",output_type="",output_file="",retries_max="",quiet="",function(){let e;quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(target_network=e),4==t&&(api_key=e),5==t&&(display_unit=e),6==t&&(target_address=e),7==t&&(wallet_seed=e),8==t&&(output_type=e),9==t&&(output_file=e),10==t&&(retries_max=e),"-h"!=e&&"--help"!=e||(quiet="n",b(0))}),""==target_network&&(e="No input network given.",f("No input network given.",1),""==display_unit&&(display_unit="wei"),""==output_type&&(output_type="price"),""==retries_max&&(retries_max="1"),b(1))}(),function(){let e,t;for(e of(t=[` Wallet seed: ${wallet_seed}`,` Target network: ${target_network}`,` API Key: ${api_key}`,` Target address: ${target_address}`,` Display unit: ${display_unit}`,` Output type: ${output_type}`,` Output file: ${output_file}`,` Maximum retries: ${retries_max}`],t))d(e)}(),app_opts=[target_network,api_key,display_unit,wallet_seed,target_address,output_type,output_file,retries_max],async function(e){let t;try{t=await y.apply(null,e)}catch(e){f(e,1),process.exit(1)}}(app_opts)),e.exports={_price_gas_get:y}},108(e,t,r){const{ethers:n}=r(4193),i=n,s=(i.formatEther,i.FetchRequest,r(8368)),o=s._dirname,a=s._file_read,c=s._file_write,u=s._path_join,l=s._msg_info,d=(s._msg_info_obj,s._msg_error),f=s._sleep,h=r(9341)._provider_get,p=(r(7785)._wallet_get,r(8119)._price_gas_get);async function g(e,t,r,n,i,s,g,m){let y,b,w,_,v,A,k,P,E,x;for(_=[],void 0!==t&&""!=t||(y=`No selection mode set. Setting '${t="auto"}'.`,l(y)),"undefined"!=typeof _output_type&&""!=_output_type||(_output_type="price"),m=void 0===m||""==m?3:Number(m),void 0!==n&&""!=n||(n="ether"),_timeout=1e5,A=0,k=!1,E="",P=o(i),x=[P,"wallet.dat"],_wallet_path=u(x),v=[e],null==g&&(g=""),""!=r&&(_api_key=a(r),v.push(_api_key)),v.push(_timeout),_provider=await h.apply(null,v),_msg_info_provider_generated(_provider);0==k&&A<m;)try{_.push(e,r,n,i,s,_output_type,"",m),b=await p.apply(null,_),y=`Got gas price '${b}' ${n} of output type '${_output_type}' for network '${e}'.`,l(y),b=Number(b),"auto"==t&&(t="rpc"),"simple"==t?w=Math.floor(12*b/10):"fast"==t?w=Math.floor(20*b/10):"nextblock"==t?w=Math.floor(50*b/10):"rpc"==t?w=b:(y=`Unknown selection mode '${t}'.`,d(y,1)),""!=g&&c(g,w.toString()),k=!0}catch(e){A+=1,y=`Error retrieving gas price, retrying (${A} of ${m})`,console.error(e),d(y,0),await f(3e3)}if(0==k&&A==m)throw"Error retrieving balance.";return w}function m(e){let t,r;for(t of(r=["Usage:"," price-gas-transaction-get"," <quiet>"," <target-network>"," (<selection-mode>)"," (<api-keys-path)"," (<display-unit>)"," (<seed-path>)"," (<target-address>)"," (<output-type>)"," (<output-file>)"," (<retries-max>)","","Arguments:"," <target-network> Name of the network to connect to."," <selection-mode> Can be 'simple'.",` Default: '${selection_mode}'`,"","Optional arguments:"," <api-key-path> Path on disk of the API key for"," the network service provider."," <display-unit> Can be 'wei' or 'ether'.",` Default: '${display_unit}'`," <seed-path> Path on disk of the file"," containing the seed phrase."," <target-address> Address for which to return"," the gas price (not used)."," Default: the wallet address."," corresponding to the seed."," <output-type> Type of price output to return.",` Default: '${output_type}'`," <output-file> File in which to save the balance.",` Default: '${output_file}'`," <retries-max> Maximum number of retries.",` Default: ${retries_max}`],r))console.log(t);process.exit(e)}_cmdline_check("price-gas-transaction-get")&&(app_name="price-gas-transaction-get",selection_mode="",wallet_seed="",target_network="",api_key="",target_address="",display_unit="",output_type="",output_file="",retries_max="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(quiet=e),3==t&&(target_network=e),4==t&&(selection_mode=e),5==t&&(api_key=e),6==t&&(display_unit=e),7==t&&(target_address=e),8==t&&(wallet_seed=e),9==t&&(output_type=e),10==t&&(output_file=e),11==t&&(retries_max=e),"-h"!=e&&"--help"!=e||(quiet="n",m(0))}),""==target_network&&(_msg="No input network given.",d(_msg,1),""==selection_mode&&(selection_mode="simple"),""==display_unit&&(display_unit="wei"),""==output_type&&(output_type="price"),""==retries_max&&(retries_max="1"),m(1)),function(){let e,t;for(e of(t=[` Display unit: ${display_unit}`,` Selection mode: ${selection_mode}`,` Output type: ${output_type}`,` Output file: ${output_file}`,"Credentials options:",` Wallet seed: ${wallet_seed}`,` Target address: ${target_address}`," Network options:",` Target network: ${target_network}`,` API Key: ${api_key}`,` Maximum retries: ${retries_max}`],t))l(e)}(),app_opts=[target_network,selection_mode,api_key,display_unit,wallet_seed,target_address,output_type,output_file,retries_max],async function(e){let t;try{t=await g.apply(null,e),console.log(t.toString())}catch(e){d(e,1),process.exit(1)}}(app_opts)),e.exports={_price_gas_transaction_get:g}},7439(e,t,r){e=r.nmd(e);const{ethers:n}=r(4193);_ethers=n,_Wallet=_ethers.Wallet;const i=r(8368);function s(e){let t,r,n,i;i=_Wallet.createRandom(),n=i.mnemonic.phrase,""!=e?(t=_dirname(e),r=_file_exists(t),r?"y"!=quiet&&function(e){let t,r;r="writing seed to '{_path}'.",t="writing seed to '{_path}'.".replaceAll("{_path}",e),_msg_info(t)}(e):function(e){let t,r;r="the directory '{_dir}' does not exist.",t="the directory '{_dir}' does not exist.".replaceAll("{_dir}",e),_msg_error(t,1)}(t),_file_write(e,n),"y"!=quiet&&function(e){let t,r;r="seed written to '{_path}'.",t="seed written to '{_path}'.".replaceAll("{_path}",e),_msg_info(t)}(e)):console.log(n)}_app_name_get=i._app_name_get,_msg_info=i._msg_info,_msg_info_obj=i._msg_info_obj,_msg_error=i._msg_error,_dirname=i._dirname,_file_exists=i._file_exists,_file_write=i._file_write,r.c[r.s]==e&&(app_name="seed-new",seed_path="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(seed_path=e),3==t&&(quiet=e)}),"-h"==seed_path&&function(){let e,t;for(e of(t=["Usage:"," mkseed"," (<path>)"," (<verbose>)"],t))_msg_info(e);process.exit()}(),app_opts=[seed_path],s.apply(null,app_opts)),e.exports={_mkseed:s}},7785(e,t,r){const{ethers:n}=r(4193);_ethers=n,_hdnode_wallet=_ethers.HDNodeWallet;const i=r(8368);function s(e){const t={error:`Seed has unspecified value '${e}'.`};throw function(){let e;const t=["Returns a wallet object.",""," usage:"," await _wallet_get("," _path"," _password,"," _seed,"," _provider,"," _wallet,"," _verbose);",""];for(e of t)console.log(e)}(),t}function o(e){let t,r;if(t=typeof e,"undefined"==t||""==e||e==[])s(e);else if(_file_exists(e))t="file",_phrase=_file_read(e),r=_phrase.split(" "),_seed_is_phrase=12==r.length||24==r.length,_seed_is_phrase||(_msg="The seed phrase is encrypted, OpenPGP on Ethereum decryption not implemented.",_msg_error(_msg,1));else{"string"==t?r=e.split(" "):"object"==t?r=e:(_msg=`Unknown seed type '${t}'.`,_msg_error(_msg,1));const n=12==r.length||24==r.length;if("string"==t&&n)_phrase=e;else{if("object"!=t||!n)throw _msg=`The seed '${e}' has type '${t}', it's not a valid path and it does not contain a valid phrase.`,{error:_msg};_phrase=e.join(" ")}}return function(e,t){let r,n;"file"==t?(r="Seed file",n=e):"string"!=t&&"array"!=t||(r="Seed phrase",n="****"),_msg_info_obj(r,n)}(e,t),_phrase}_cmdline_check=i._cmdline_check,_msg_info=i._msg_info,_msg_info_obj=i._msg_info_obj,_msg_error=i._msg_error,_file_exists=i._file_exists,_file_read=i._file_read,_cmdline_check("wallet-get")&&(app_name="wallet-get"),e.exports={_wallet_get:function(e,t,r,n,i,a){let c;c="",void 0!==a&&""!=a||(a="n"),void 0!==t&&""==t||(c="****"),void 0!==r&&""!=r&&r!=[]||void 0!==i&&""!=i&&i!={}||s(r),"y"==a&&(_msg_info_obj("Wallet path",e),""!=c&&_msg_info_obj("Wallet password",c)),function(e){let t;if(t=_file_exists(e),1==t)throw{error:`Wallet '${e}' already exists.`}}(e);const u=o(r);return(i=_hdnode_wallet.fromPhrase(u)).provider=n,_signer=i.connect(n),_signer}}},263(e,t,r){const{ethers:n}=r(4193);_ethers=n;const i=r(8368);_cmdline_check=i._cmdline_check,_msg_info=i._msg_info,_msg_info_obj=i._msg_info_obj,_msg_error=i._msg_error;const s=r(9341);_provider_get=s._provider_get;const o=r(7785);async function a(e,t,r,n,i){let s,o;if(o=await _provider_get(n,i),"string"==typeof r){const e=r.split(" ").length;12!=e&&24!=e&&_msg_info_obj("Seed path",r)}return""!=e&&_msg_info_obj("Wallet path",e),s="",""!=t&&(s="****",_msg_info_obj("Wallet password",s)),_wallet=_wallet_get(e,t,r,o),_wallet}_wallet_get=o._wallet_get,_cmdline_check("wallet-new")&&(app_name="wallet-new",app_opts=[],wallet_path="",wallet_password="",wallet_seed="",target_network="",api_key_path="",quiet="",quiet="y",process.argv.forEach(function(e,t,r){2==t&&(wallet_path=e),3==t&&(wallet_password=e),4==t&&(wallet_seed=e),5==t&&(target_network=e),6==t&&(api_key_path=e),6==t&&(quiet=e)}),""==wallet_path&&function(){let e,t;for(e of(t=["Usage:"," Returns a Wallet object.",""," wallet-new"," <path>"," <password>"," <seed>"," <network>"," <api-key-path>"," <quiet>","","Arguments:"," <path> Wallet path."," <password> Wallet password path"," <seed> Seed file path."," <network> Network RPC."," <api-key-path> Path on disk of the API key for"," the network service provider."," <quiet> Whether to display additional output.",` Default: ${quiet}`,""],t))_msg_info(e);_process_exit(1)}(),""==target_network&&(target_network="gnosis"),app_opts=[wallet_path,wallet_password,wallet_seed,target_network,api_key_path,quiet],async function(e){let t;t=await a.apply(null,e),console.log(t)}(app_opts)),e.exports={_wallet_new:a}},3182(e,t,r){const n=r(8368),i=n._cat,s=n._file_exists,o=n._mkdir,a=n._msg_info,c=n._msg_error,u=n._path_join,l=n._stat,d=(r(5515)._evm_chains_info,r(2768)._address_get),f=r(6500),h=f._balance_check,p=f._msg_error_balance_insufficient,g=r(9712)._balance_get,m=r(7838)._balance_send,y=r(8605)._block_number_get,b=r(2574)._ethers_to_wei,w=r(9341),_=w._msg_info_provider_generated,v=w._provider_get,A=w._target_networks_check,k=r(8119)._price_gas_get,P=r(108)._price_gas_transaction_get,E=r(7439)._seed_new,x=r(7785)._wallet_get,O=r(263)._wallet_new;async function S(e,t,r,n,a,c,d,f,h,p){let m;const y={};for(m of n){const n=u([e,t,m.toString()]),b=u([n,"balance"]),w=[r,a[m],c,"",d,b,f,p];if(s(n)||o(n,{recursive:!0}),s(b)){const e=l(b).mtimeMs,t=Date.now()-e;y[m]=h<t?await g.apply(null,w):i(b)}else y[m]=await g.apply(null,w)}return y}e.exports={_address_get:d,_balance_check:h,_msg_error_balance_insufficient:p,_balance_get:g,_balance_send:m,_block_number_get:y,_evm_wallet:async function(e,t,n,i,s,o,u,l,f,h,p,g,b,w,_,v,P,E,x,O,T,B){let R,N,C,I;const F=r(4136)._rpc_get;[B,N]=A(B);const U=F(B);if(R="Using RPC address:",a(R),"n"==quiet&&console.log(U),"blocknumber"==e){const e=[U[N],p,"",g,w];return await y.apply(null,e)}if("gas"==e){const e=[U[N],p,_,"","","",g];return await k.apply(null,e)}if("get"==e){if("balance"==O){const e=[l,t,s,B,U,p,_,g,v,w];return await S.apply(null,e)}if("address"==O){const e=[s,"","","","",""];return d.apply(null,e)}R=`Unknown key '${O}'.`,a(R)}else if("send"==e){const e=O,t=T;if("gas"==P){const r=[s,e,t,U[N],p,_];return[C,I]=await m.apply(null,r),[C,I]}if("erc20"==P)try{const n=r(7163)._token_send,i=[g,w,s,p,U,E,"","","",_,"",e,t];return R=`Running '_token_send' with arguments '${i}'.`,a(R),await n.apply(null,i)}catch(e){R="Install ERC-20 Tools ('ur erc20-tools')",c(R,1)}else R=`Unknown currency type '${P}'.`,c(R,1)}else"run"==e||(R=`Unknown command '${e}'.`,c(R,1))},_ethers_to_wei:b,_provider_get:v,_msg_info_provider_generated:_,_price_gas_get:k,_price_gas_transaction_get:P,_seed_new:E,_wallet_get:x,_wallet_new:O}},251(e,t){t.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-l)-1,h>>=-l,l+=a;l>0;s=256*s+e[t+d],d+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+d],d+=f,l-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),s-=u}return(h?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,a,c,u=8*s-i-1,l=(1<<u)-1,d=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:s-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(a=0,o=l):o+d>=1?(a=(t*c-1)*Math.pow(2,i),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;e[r+h]=255&o,h+=p,o/=256,u-=8);e[r+h-p]|=128*g}},6698(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},4136(e,t,r){const n=r(8368);_homedir_get=n._homedir_get,_msg_error=n._msg_error,_msg_info=n._msg_info,_path_join=n._path_join;const i=r(5515);function s(e,t,r,n,i){void 0!==e&&""!=e||(e="seed"),void 0!==r&&""!=r||(r="evm-wallet"),void 0!==n&&""!=n||(n="default"),void 0!==i&&""!=i||(i="n");const s=function(e,t,r,n){let i;return void 0!==e&&""!=e||(e="seed"),void 0!==t&&""!=t||(t="evm-wallet"),void 0!==r&&""!=r||(r="default"),void 0!==n&&""!=n||(n="n"),i=_path_join([_homedir_get(),".config",t]),"y"==n&&(i=_path_join([i,"qr"])),_path_join([i,`${r}-${e}.txt`])}(e,r,n,i);return s}_evm_chains_db_path_get=i._evm_chains_db_path_get,_rpc_backend_get=i._rpc_backend_get,_evm_chain_info_get=i._evm_chain_info_get,_evm_chains_info=i._evm_chains_info,e.exports={_contract_abi_get:function(e,t,r,n){const i=t.concat(".abi.json");return _path_join([e,t,r,n,i])},_contract_bytecode_get:function(e,t,r,n){const i=t.concat(".bin");return _path_join([e,t,r,n,i])},_contract_compiler_output_get:function(e,t,r,n){const i=t.concat(".json");return _path_join([e,t,r,n,i])},_evm_chains_db_path_get,_evm_chain_info_get,_libevm_app_cmdline_parse:function(e){"u"in e&&(user_level=e.u),"user-level"in e&&(user_level=e.user_level),"d"in e&&(deployments_dir=e.d),"deployments-dir"in e&&(deployments_dir=e.deployments_dir)},_libevm_cmdline_parse:function(e){"N"in e&&(wallet_name=e.N),"wallet-name"in e&&(wallet_name=e["wallet-name"]),"w"in e&&(wallet_path=e.w),"wallet-path"in e&&(wallet_path=e["wallet-path"]),"p"in e&&(wallet_password=e.p),"wallet-password"in e&&(wallet_path=e["wallet-password"]),"s"in e&&(wallet_seed=e.s),"wallet-seed"in e&&(wallet_seed=e["wallet-seed"]),"k"in e&&(api_key=e.k),"api-key"in e&&(api_key=e["api-key"]),"T"in e&&(api_key=e.T),"call-timeout"in e&&(call_timeout=e["call-timeout"]),"n"in e&&target_networks.push(e.n),"network"in e&&target_networks.push(e.network)},_libevm_app_global_variables:function(){deployments_dir="",user_level=""},_libevm_global_variables:function(){call_auth="",wallet_name="",wallet_path="",wallet_password="",wallet_address="",wallet_seed="",api_key="",networks_amount="",target_network="",target_networks=[],rpc_selection="",retries_max="",call_timeout="",msg_value=""},_libevm_url_parse:function(){wallet_path=_argv_url_get("wallet_path")[0],wallet_password=_argv_url_get("wallet_password")[0],wallet_seed=_argv_url_get("wallet_seed")[0],api_key=_argv_url_get("api_key")[0],target_networks.push(_argv_url_get("network")[0])},_rpc_backend_get,_rpc_get:function(e){let t,r,n,i,s;const o={};for(i of e)s=typeof i,"string"==s?i.startsWith("https://")?(o[i]=i,r="n"):r="y":"number"==s?r="y":(n=`Unknown type '${s}' for network variable.`,_msg_error(n,1)),"y"==r&&(t=["get","id","rpc","offline",["node","system"],"kirsh","n","n",i,[]],o[i]=_evm_chains_info.apply(null,t)[0]);return o},_wallet_overrides_set:async function(e,t,n,i){let o,a,c,u;a="";const l=r(3182)._address_get;return void 0!==e&&""!=e||(e="evm-wallet"),void 0!==t&&""!=t||(t="default"),void 0!==n&&""!=n||(n="y"),void 0!==i&&""!=i||(i="n"),o="","y"==n?(u=function(e,t,r){let n;void 0!==e&&""!=e||(e="evm-wallet"),void 0!==t&&""!=t||(t="default"),void 0!==r&&""!=r||(r="n");const i=_homedir_get();return n=_path_join([i,".config",e]),"y"==r&&(n=_path_join([n,"qr"])),_path_join([n,`${t}.dat`])}(e,t,i),a=s("seed",0,e,t,i),c=s("password",0,e,t,i),o=await l(a,"","","","","")):"n"==n&&("undefined"==typeof wallet_seed&&(wallet_seed=""),"undefined"==typeof wallet_password&&(wallet_password="")),"undefined"!=typeof wallet_name&&""!=wallet_name||(wallet_name=t),"undefined"!=typeof wallet_path&&""!=wallet_path||(wallet_path=u),"undefined"!=typeof wallet_address&&""!=wallet_address||(wallet_address=o),"undefined"!=typeof wallet_seed&&""!=wallet_seed&&wallet_seed!=[]||(wallet_seed=a),!0}}},6010(e,t,r){const n=r(7516),i=r(7866),s=r(9012);function o(e){let t;return void 0===e&&(e="fs-worker.js"),t=new i(e),t}_file=s.file,_read_stream_create=function(e,t){return _file(e).createReader()},e.exports=n,e.exports.fsWorkerNew=o,e.exports.fsWorkerStart=async function(e,t,r){let n,i,s,a;return void 0===e&&(e="fs-worker.js"),"Number"!=typeof t&&(t=10485760),"Number"!=typeof t&&(r=10485760),i=_fs.connectSyncAgent,a=o(e),s={worker:a,bufferLength:t,opTimeout:r},n=i(s),n},e.exports.createReadStream=_read_stream_create,e.exports.createWriteStream=function(e,t){return _file(e).createWriter()},e.exports.mkdtemp=n.mkTemp,e.exports.mkdtempSync=n.mkTempSync,e.exports.readdirSync=function(e){const t=_fs.readDirSync;return _return=t.apply(null,[e]).unwrap(),_return},e.exports.renameSync=function(e){const t=_fs.moveSync;return _return=t.apply(null,e).unwrap(),_return},e.exports.rmSync=function(e){const t=_fs.removeSync;return _return=t.apply(null,e).unwrap(),_return}},6048(e){"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,s,o,a,c;if("string"==typeof t&&(s="not ",t.substr(0,4)===s)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))o="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var u=("number"!=typeof c&&(c=0),c+1>(a=e).length||-1===a.indexOf(".",c)?"argument":"property");o='The "'.concat(e,'" ').concat(u," ").concat(i," ").concat(n(t,"type"))}return o+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},5382(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=r(5412),s=r(6708);r(6698)(u,i);for(var o=n(s.prototype),a=0;a<o.length;a++){var c=o[a];u.prototype[c]||(u.prototype[c]=s.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||process.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},3600(e,t,r){"use strict";e.exports=i;var n=r(4610);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(6698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},5412(e,t,r){"use strict";var n;e.exports=P,P.ReadableState=k,r(7007).EventEmitter;var i,s=function(e,t){return e.listeners(t).length},o=r(345),a=r(8287).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(9838);i=u&&u.debuglog?u.debuglog("stream"):function(){};var l,d,f,h=r(2726),p=r(5896),g=r(5291).getHighWaterMark,m=r(6048).F,y=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(P,o);var v=p.errorOrDestroy,A=["error","close","destroy","pause","resume"];function k(e,t,i){n=n||r(5382),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(3141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function P(e){if(n=n||r(5382),!(this instanceof P))return new P(e);var t=this instanceof n;this._readableState=new k(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function E(e,t,r,n,s){i("readableAddChunk",t);var o,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,B(e)))}}(e,u);else if(s||(o=function(e,t){var r,n;return n=t,a.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t)),r}(u,t)),o)v(e,o);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)u.endEmitted?v(e,new _):x(e,u,t,!0);else if(u.ended)v(e,new b);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?x(e,u,t,!1):R(e,u)):x(e,u,t,!1)}else n||(u.reading=!1,R(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function x(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),R(e,t)}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),P.prototype.destroy=p.destroy,P.prototype._undestroy=p.undestroy,P.prototype._destroy=function(e,t){t(e)},P.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=a.from(e,t),t=""),r=!0),E(this,e,t,!1,r)},P.prototype.unshift=function(e){return E(this,e,null,!0,!1)},P.prototype.isPaused=function(){return!1===this._readableState.flowing},P.prototype.setEncoding=function(e){l||(l=r(3141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var O=1073741824;function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(B,e))}function B(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function R(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function C(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){i("readable nexttick read 0"),e.read(0)}function F(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function L(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(D,t,e))}function D(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}P.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):T(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&L(this),null;var n,s=t.needReadable;return i("need readable",s),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",s=!0),t.ended||t.reading?i("reading or ended",s=!1):s&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?j(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&L(this)),null!==n&&this.emit("data",n),n},P.prototype._read=function(e){v(this,new w("_read()"))},P.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,t);var o=t&&!1===t.end||e===process.stdout||e===process.stderr?p:a;function a(){i("onend"),e.end()}n.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",function t(s,o){i("onunpipe"),s===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",l),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,U(e))}}(r);e.on("drain",c);var u=!1;function l(t){i("ondata");var s=e.write(t);i("dest.write",s),!1===s&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==M(n.pipes,e))&&!u&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){i("onerror",t),p(),e.removeListener("error",d),0===s(e,"error")&&v(e,t)}function f(){e.removeListener("finish",h),p()}function h(){i("onfinish"),e.removeListener("close",f),p()}function p(){i("unpipe"),r.unpipe(e)}return r.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",f),e.once("finish",h),e.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),e},P.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=M(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},P.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?T(this):n.reading||process.nextTick(I,this))),r},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(C,this),r},P.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(C,this),t},P.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(F,e,t))}(this,e)),e.paused=!1,this},P.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},P.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var s in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(s){i("wrapped data"),r.decoder&&(s=r.decoder.write(s)),r.objectMode&&null==s||(r.objectMode||s&&s.length)&&(t.push(s)||(n=!0,e.pause()))}),e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var o=0;o<A.length;o++)e.on(A[o],this.emit.bind(this,A[o]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(P.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(2955)),d(this)}),Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),P._fromList=j,Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(P.from=function(e,t){return void 0===f&&(f=r(5157)),f(P,e,t)})},4610(e,t,r){"use strict";e.exports=l;var n=r(6048).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,s=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(5382);function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);c.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush(function(t,r){f(e,t,r)})}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new o;return e.push(null)}r(6698)(l,c),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},6708(e,t,r){"use strict";function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(void 0),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=P,P.WritableState=k;var s,o={deprecate:r(4643)},a=r(345),c=r(8287).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=r(5896),d=r(5291).getHighWaterMark,f=r(6048).F,h=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,b=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,v=l.errorOrDestroy;function A(){}function k(e,t,s){i=i||r(5382),e=e||{},"boolean"!=typeof s&&(s=t instanceof i),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(B,e,t),e._writableState.errorEmitted=!0,v(e,n)):(i(n),e._writableState.errorEmitted=!0,v(e,n),B(e,t))}(e,r,n,t,i);else{var s=S(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||O(e,r),n?process.nextTick(x,e,r,s,i):x(e,r,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function P(e){var t=this instanceof(i=i||r(5382));if(!t&&!s.call(P,this))return new P(e);this._writableState=new k(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function E(e,t,r,n,i,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function x(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),B(e,t)}function O(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,s=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,c=!0;r;)s[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;s.allBuffers=c,E(e,t,!0,t.length,s,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,d=r.callback;if(E(e,t,!1,t.objectMode?1:u.length,u,l,d),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final(function(r){t.pendingcb--,r&&v(e,r),t.prefinished=!0,e.emit("prefinish"),B(e,t)})}function B(e,t){var r=S(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(P,a),k.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(k.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(P,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===P&&e&&e._writableState instanceof k}})):s=function(e){return e instanceof this},P.prototype.pipe=function(){v(this,new m)},P.prototype.write=function(e,t,r){var n,i=this._writableState,s=!1,o=!i.objectMode&&(n=e,c.isBuffer(n)||n instanceof u);return o&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=A),i.ending?function(e,t){var r=new w;v(e,r),process.nextTick(t,r)}(this,r):(o||function(e,t,r,n){var i;return null===r?i=new b:"string"==typeof r||t.objectMode||(i=new h("chunk",["string","Buffer"],r)),!i||(v(e,i),process.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,s=function(e,t,r,n,i,s){if(!r){var o=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,a,n,i,s);return u}(this,i,o,e,t,r)),s},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||O(this,e))},P.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(P.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(P.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),P.prototype._write=function(e,t,r){r(new p("_write()"))},P.prototype._writev=null,P.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,B(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(P.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),P.prototype.destroy=l.destroy,P.prototype._undestroy=l.undestroy,P.prototype._destroy=function(e,t){t(e)}},2955(e,t,r){"use strict";var n;function i(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(6238),o=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var r=e[f].read();null!==r&&(e[l]=null,e[o]=null,e[a]=null,t(h(r,!1)))}}function g(e){process.nextTick(p,e)}var m=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((i(n={get stream(){return this[f]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(t,r){process.nextTick(function(){e[c]?r(e[c]):t(h(void 0,!0))})});var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[u]?r(h(void 0,!0)):t[d](r,n)},n)}}(n,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(h(i,!1));r=new Promise(this[d])}return this[l]=r,r}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[f].destroy(null,function(e){e?r(e):t(h(void 0,!0))})})}),n),m);e.exports=function(e){var t,r=Object.create(y,(i(t={},f,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[f].read();n?(r[l]=null,r[o]=null,r[a]=null,e(h(n,!1))):(r[o]=e,r[a]=t)},writable:!0}),t));return r[l]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[l]=null,r[o]=null,r[a]=null,t(e)),void(r[c]=e)}var n=r[o];null!==n&&(r[l]=null,r[o]=null,r[a]=null,n(h(void 0,!0))),r[u]=!0}),e.on("readable",g.bind(null,r)),r}},2726(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var c=r(8287).Buffer,u=r(5340).inspect,l=u&&u.custom||"inspect";function d(e,t,r){c.prototype.copy.call(e,t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),r=this.head,n=0;r;)d(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,s=e>i.length?i.length:e;if(s===i.length?n+=i:n+=i.slice(0,e),0===(e-=s)){s===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0===(e-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5896(e){"use strict";function t(e,t){n(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,e)):process.nextTick(n,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!i&&e?s._writableState?s._writableState.errorEmitted?process.nextTick(r,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,e)):process.nextTick(t,s,e):i?(process.nextTick(r,s),i(e)):process.nextTick(r,s)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},6238(e,t,r){"use strict";var n=r(6048).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,s){if("function"==typeof r)return e(t,null,r);r||(r={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(s||i);var o=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||l()},u=t._writableState&&t._writableState.finished,l=function(){a=!1,u=!0,o||s.call(t)},d=t._readableState&&t._readableState.endEmitted,f=function(){o=!1,d=!0,a||s.call(t)},h=function(e){s.call(t,e)},p=function(){var e;return o&&!d?(t._readableState&&t._readableState.ended||(e=new n),s.call(t,e)):a&&!u?(t._writableState&&t._writableState.ended||(e=new n),s.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",l),t.on("abort",p),t.req?g():t.on("request",g)):a&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",f),t.on("finish",l),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",l),t.removeListener("end",f),t.removeListener("error",h),t.removeListener("close",p)}}},5157(e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7758(e,t,r){"use strict";var n,i=r(6048).F,s=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,d=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new s("streams");var f=t.map(function(e,i){var s=i<t.length-1;return function(e,t,i,s){s=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(s);var a=!1;e.on("close",function(){a=!0}),void 0===n&&(n=r(6238)),n(e,{readable:t,writable:i},function(e){if(e)return s(e);a=!0,s()});var c=!1;return function(t){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new o("pipe"))}}(e,s,i>0,function(e){l||(l=e),e&&f.forEach(c),s||(f.forEach(c),d(l))})});return t.reduce(u)}},5291(e,t,r){"use strict";var n=r(6048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(i?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},345(e,t,r){e.exports=r(7007).EventEmitter},2861(e,t,r){var n=r(8287),i=n.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(s(n,t),t.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},8310(e,t,r){e.exports=i;var n=r(7007).EventEmitter;function i(){n.call(this)}r(6698)(i,n),i.Readable=r(5412),i.Writable=r(6708),i.Duplex=r(5382),i.Transform=r(4610),i.PassThrough=r(3600),i.finished=r(6238),i.pipeline=r(7758),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function s(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",s),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",c));var o=!1;function a(){o||(o=!0,e.end())}function c(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",u),e.on("error",u),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},3141(e,t,r){"use strict";var n=r(2861).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.I=s,s.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=o(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=o(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},4962(e,t,r){function n(){let e;return"undefined"==typeof window&&void 0!==r.g&&r.g.global===r.g&&"function"!=typeof r||(e=function(){let e;try{e=r(6010)}catch(e){console.log(e);const t="Error importing the '@themartiancompany/opfs' module as 'opfs'. If you got this error while bundling a webpack for a project depending on this module double check its 'webpack.config.js' file or whether the 'opfs' module is listed in developer dependencies and install them.I'm sorry for this inconvenience but Node packagement system does not currently distinguish 'development' from 'build' dependencies.";throw console.error(t),e}return e}()),e}const i=n();i.isDirSync=function(e){return!(void 0).statSync(e).isFile()},i.isDir=i.isDirSync,e.exports=i,e.exports.getModule=function(e){let t;if(""==_module_name||"undefined"==typeof _module_name)t=n();else if("opfs"==_module_name)t=_opfs_module_auto_detect();else{if("fs"!=_module_name){const e="Unknown file system module "+`'${_module_name}'.`.const;throw _error={msg:e},console.error(e),_error}t=r(Object(function(){const e=new Error("Cannot find module 'node:fs'");throw e.code="MODULE_NOT_FOUND",e}())),t.fsWorkerStart=function(e){let t;return t=e.fsWorkerStart,void 0===t&&(t=function(){}),t}(t)}return t}},4643(e,t,r){function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},7866(){},5340(){},9838(){},3514(e,t){"use strict";const r=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function n(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,s=[0,1];for(let e=1;e<n;e++)s.push(i+=r());let o=r(),a=t;t+=o;let c=0,u=0;function l(){return 0==c&&(u=u<<8|e[t++],c=8),u>>--c&1}const d=2**31,f=d>>>1,h=f>>1,p=d-1;let g=0;for(let e=0;e<31;e++)g=g<<1|l();let m=[],y=0,b=d;for(;;){let e=Math.floor(((g-y+1)*i-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<s[n]?r=n:t=n}if(0==t)break;m.push(t);let o=y+Math.floor(b*s[t]/i),a=y+Math.floor(b*s[t+1]/i)-1;for(;0==((o^a)&f);)g=g<<1&p|l(),o=o<<1&p,a=a<<1&p|1;for(;o&~a&h;)g=g&f|g<<1&p>>>1|l(),o=o<<1^f,a=(a^f)<<1|f|1;y=o,b=1+a-o}let w=n-4;return m.map(t=>{switch(t-w){case 3:return w+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return w+256+(e[a++]<<8|e[a++]);case 1:return w+e[a++];default:return t-1}})}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((e,r)=>t[e.charCodeAt(0)]=r);let r=e.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i<r;i++)a=a<<6|t[e.charCodeAt(i)],o+=6,o>=8&&(n[s++]=a>>(o-=8));return n}(e)))}function i(e){return 1&e?~e>>1:e>>1}function s(e,t){let r=Array(e);for(let n=0,s=0;n<e;n++)r[n]=s+=i(t());return r}function o(e,t=0){let r=[];for(;;){let n=e(),i=e();if(!i)break;t+=n;for(let e=0;e<i;e++)r.push(t+e);t+=i+1}return r}function a(e){return u(()=>{let t=o(e);if(t.length)return t})}function c(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(d(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(f(r,e))}return t.flat()}function u(e){let t=[];for(;;){let r=e(t.length);if(!r)break;t.push(r)}return t}function l(e,t,r){let n=Array(e).fill().map(()=>[]);for(let i=0;i<t;i++)s(e,r).forEach((e,t)=>n[t].push(e));return n}function d(e,t){let r=1+t(),n=t(),i=u(t);return l(i.length,1+e,t).flatMap((e,t)=>{let[s,...o]=e;return Array(i[t]).fill().map((e,t)=>{let i=t*n;return[s+t*r,o.map(e=>e+i)]})})}function f(e,t){return l(1+t(),1+e,t).map(e=>[e[0],e.slice(1)])}function h(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function p(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let r=[];for(let n=0;n<t;)r.push(String.fromCodePoint(...e.slice(n,n+=4096)));return r.join("")}function g(e,t){let r=e.length,n=r-t.length;for(let i=0;0==n&&i<r;i++)n=e[i]-t[i];return n}const m=44032,y=4352,b=4449,w=4519;function _(e){return e>>24&255}function v(e){return 16777215&e}let A,k,P,E;function x(e){return e>=m&&e<55204}function O(e,t){if(e>=y&&e<4371&&t>=b&&t<4470)return m+588*(e-y)+28*(t-b);if(x(e)&&t>w&&t<4547&&(e-m)%28==0)return e+(t-w);{let r=E.get(e);return r&&(r=r.get(t),r)?r:-1}}function S(e){A||function(){let e=n("AEUDWAHSCGYATwDVADIAdgAiADQAFAAtABQAIQAPACcADQASAAsAGQAJABIACQARAAUACwAFAAwABQAQAAMABwAEAAoABQAJAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACwANAA0AAwAKAAkABAAdAAYAZwDTAecDNACxCmIB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgPi89uj00MsvBXxEPAGPCDwBnQKoEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJEMAJpIBpob5AERSMAKNoAXqaQLRBMCzEiC+AZ4EWRJJFbEu7QDQLARtEbgECxDwAb/RyAk1AV4nD2cEQQKTAzsAGpobPgAahAGPCrysdy0OAKwAfFIcBAQFUmoA/PtZADkBIadVj2UMUgx5Il4ANQC9vLIBDAHUGVsQ8wCzfQIbGVcCHBZHAZ8CBAgXOhG7AqMZ4M7+1M0UAPDNAWsC+mcJDe8AAQA99zkEXLICyQozAo6lAobcP5JvjQLFzwKD9gU/OD8FEQCtEQL6bW+nAKUEvzjDHsuRyUvOFHcacUz5AqIFRSE2kzsBEQCuaQL5DQTlcgO6twSpTiUgCwIFCAUXBHQEqQV6swAVxUlmTmsCwjqsP/wKJQmXb793UgZBEBsnpRD3DDMBtQE7De1L2ATxBjsEyR99GRkPzZWcCKUt3QztJuMuoYBaI/UqgwXtS/Q83QtNUWgPWQtlCeM6Y4FOAyEBDSKLCt0NOQhtEPMKyWsN5RFFBzkD1UmaAKUHAQsRHTUVtSYQYqwLCTl3Bvsa9guPJq8TKXr8BdMaIQZNASka/wDPLueFsFoxXBxPXwYDCyUjxxSoUCANJUC3eEgaGwcVJakCkUNwSodRNh6TIfY8PQ1mLhNRfAf1PAUZTwuBPJ5Gq0UOEdI+jT1IIklMLAQ1fywvJ4sJzw+FDLl8cgFZCSEJsQxxEzERFzfFCDkHGS2XJCcVCCFGlWCaBPefA/MT0QMLBT8JQQcTA7UcLRMuFSkFDYEk1wLzNtUuswKPVoABFwXLDyUf3xBQR+AO6QibAmUDgyXrAC0VIQAXIpsIQ2MAX4/YUwUuywjHamwjdANnFOdhEXMHkQ5XB6ccMxW/HOFwyF4Lhggoo68JWwF1CZkBXwTjCAk1W4ygIEFnU4tYGJsgYUE/XfwCMQxlFZ9EvYd4AosPaxIbATUBcwc5DQECdxHtEWsQlQjrhgQ1tTP4OiUETyGDIBEKJwNPbM4LJyb5DPhpAaMSYgMMND137merYLYkF/0HGTLFQWAh8QuST80MnBrBGEJULhnkB78D8xrzJ+pBVwX/A6MDEzpNM+4EvQtpCIsJPwBJDqMXB9cYagpxjNABMYsBt5kDV5GDAm+PBjcHCwBnC4cFeeUAHQKnCKMABQDPA1cAOQKtB50AGQCFQQE9AycvASHlAo8DkwgxywGVLwHzKQQbwwwVAPc3bkoCw7ECgGpmogXdWAKOAkk1AU0lBAVOR1EDr3HhANsASwYT30cBFatKyxrjQwHfbysAxwD7AAU1BwVBAc0B820AtwFfCzEJorO1AU3pKQCDABVrAdcCiQDdADUAf/EBUwBNBVn5BdMCT0kBETEYK1dhAbsDHwEzAQ0AeQbLjaXJBx8EbQfTAhAbFeEC7y4HtQEDIt8TzULFAr3eVaFgAmSBAmJCW02vWzcgAqH3AmiYAmYJAp+EOBsLAmY7AmYmBG4EfwN/EwN+kjkGOXcXOYI6IyMCbB0CMjY4CgJtxwJtru+KM2dFKwFnAN4A4QBKBQeYDI0A/gvCAA21AncvAnaiPwJ5S0MCeLodXNtFrkbXAnw/AnrIAn0JAnzwBVkFIEgASH1jJAKBbQKAAAKABQJ/rklYSlsVF0rMAtEBAtDMSycDiE8Dh+ZExZEyAvKhXQMDA65LzkwtJQPPTUxNrwKLPwKK2MEbBx1DZwW3Ao43Ao5cQJeBAo7ZAo5ceFG0UzUKUtRUhQKT+wKTDADpABxVHlWvVdAGLBsplYYy4XhmRTs5ApefAu+yWCGoAFklApaPApZ8nACpWaxaCYFNADsClrUClk5cRFzRApnLAplkXMpdBxkCnJs5wjqdApwWAp+bAp64igAdDzEqDwKd8QKekgC1PWE0Ye8CntMCoG4BqQKenx8Cnk6lY8hkJyUrAievAiZ+AqD7AqBMAqLdAqHEAqYvAqXOAqf/AH0Cp/JofGixAANJahxq0QKs4wKsrgKtZwKtAgJXHQJV3AKx4dcDH05slwKyvQ0CsugXbOBtY21IXwMlzQK2XDs/bpADKUUCuF4CuUcVArkqd3A2cOECvRkCu9pwlgMyEQK+iHICAzNxAr4acyJzTwLDywLDBHOCdEs1RXTgAzynAzyaAz2/AsV8AsZHAsYQiQLIaVECyEQCyU8CyS4CZJ0C3dJ4eWF4rnklS9ADGKNnAgJh9BnzlSR7C16SXrsRAs9rAs9sL0tT0vMTnwDGrQLPcwEp6gNOEn5LBQLcJwLbigLSTwNSXANTXwEBA1WMgIk/AMsW7WBFghyC04LOg40C2scC2d6EEIRJpzwDhqUALwNkDoZxWfkAVQLfZQLeuHN3AuIv7RQB8zAnAfSbAfLShwLr8wLpcHkC6vkC6uQA+UcBuQLuiQLrnJaqlwMC7j8DheCYeXDgcaEC8wMAaQOOFpmTAvcTA5FuA5KHAveYAvnZAvhmmhyaq7s3mx4DnYMC/voBGwA5nxyfswMFjQOmagOm2QDRxQMGaqGIogUJAwxJAtQAPwMA4UEXUwER8wNrB5dnBQCTLSu3r73bAYmZFH8RBDkB+ykFIQ6dCZ8Akv0TtRQrxQL3LScApQC3BbmOkRc/xqdtQS4UJo0uAUMBgPwBtSYAdQMOBG0ALAIWDKEAAAoCPQJqA90DfgSRASBFBSF8CgAFAEQAEwA2EgJ3AQAF1QNr7wrFAgD3Cp8nv7G35QGRIUFCAekUfxE0wIkABAAbAFoCRQKEiwAGOlM6lI1tALg6jzrQAI04wTrcAKUA6ADLATqBOjs5/Dn5O3aJOls7nok6bzkYAVYBMwFsBS81XTWeNa01ZjV1NbY1xTWCNZE10jXhNZ41rTXuNf01sjXBNgI2ETXGNdU2FjYnNd417TYuNj02LjUtITY6Nj02PDbJNwgEkDxXNjg23TcgNw82yiA3iTcwCgSwPGc2JDcZN2w6jTchQtRDB0LgQwscDw8JmyhtKFFVBgDpfwDpsAD+mxQ91wLpNSMArQC9BbeOkRdLxptzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgELgEaJZkC7aMAoQCjBcGOmxdNxrsBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUHqSvAj5Gqwr7YrMUACT9AN3rpF27H7fsd/twPt4l+UW1yQYKBt2Cgy7qJpGiLcdE2P1cQSImUbqJ6ICH27H4knQMIRMrFkHu3sx6tC35Y+eLIh4e4CMKJ4DfyV+8mfta499RCAJ0xfeZR8PsoYOApva9pjGn4PhvyZS7/h5JLuhaucfjuU+Z584wwqNO4hWYmaBCcjgQPale1bjoHzMUbut/zTgxHxBnAyrdKpF4IRMASLBtD/jviyLeCgj8twWjAd3HchN/uqaeRYeHJgl7JEY9/cTrvtfybx/r3Y/NtxJ9dp+MTVmiS9bwBH73s8Di56/Ma+mTPMHq4T1yEG1fWcqr0u+hrGnJEvU1JJAm/maQSrKrazIyvSkDFkj8UUlfBq8baniTGPng6YZRL661rDNw4w/1g2figG0IhXnL7wosd/sVNo5dYSmMBTP5c7rYLjRdCwg8quwljOMPf63D8ICAL0r71XRiyFHdgwHbwfgnPOf4Lzjf2v+j+IiDHG2isp5yUnzSDyDRb4i/Vs0qHSHq8PiEQ/JnBP7PxnjN0j6gT4AVAeRx/1o9VnEUlUwvFrzJqHk9jxAw4sYxCnrxaeBdCFFKbnE7z+x54F5W7ZZsU6kx8Qocul6FoAHHy01FGL/nne61mn4+uYXfQ1Uccn+HMLKE+cZzT8BB1E3FRskOgJrRsq25rauLm8+uamXpkS/bTy6y1wDbCrW4eD532kTWrtNUmVVZOIn/C+/JR9KVR5iG9TY8iaT67ubm/whL1xbKZoqtY+a6fNxMJrg211bGYJDUkYMNWA0BMB++9zOm6Eik4roqs9CCEFW0lyAK0PbvlzvoxrZuY/OEhNW/l/63U15Od/RSvmDvXpGLiVmeGi5PDSH2bYz5o2g6wFDQ2FbZgYgTF8rPlvA1ifjZD3NLtFdXdpSIJvgKR7GpjJWG7GZGawPomIH8B5tUmtHH9LpM+/KQKunEPa1GiQkCXv4Cnm9DLORo2joicHdPDZ64obQrPZ5bgqckkj0G6/NEiPYBY4bCkL7W8G5YzsUb6GakFjykSPkT7JGeLeB6uJOGMm+x7N381BCDfbJFx0dtLgV9Q477BfL1fvitX5anV/oYfxeYl+eF5x5bB8+Ep/L2nsmd56aKF4aAD4GbJWsdKyBW22xEmAD3XdbtsMyAFoR5mOla0gEd9U/YVB7zvHGpHbQonay9Sv0bQ8iZ8piaXVrKc5AG1AmqqgaEvzHSP2Wux7aZTWh6quVDVU01JtMIVRdCFwlSbbqqhoFlyzsotQzRexFvZ/MqUSFu3OhRIuNBbufvBpdVgb8XdGJ48/lJPCZ7dsOujTTbKPSEvGXkOnG2Xdi8/nM3EMRqITd5QeU7iOjKqC7URJY6TnLsHij22xAHKnVRD5MDtBYnoGFqZGMDmXCW6Oj+BAWw14hESY/xLF6bLku06AHkiXTHPCFZ0f9YSqqo27eAhhS67OrA2Het4M9JM3jm/yRX6bYxnfmzYl5qQdHxN08FsNuWDrWd4vMUY2QD3hr8vS73SCTkFoXZR3xNzOQt8d/6HfjBmXqvrE6EGkLzK6YK2U2/ksU/iUH+LvVIsJI+ri2AL/klo+ShdDyfs5A83i2prkMs51IKR7ZcqjZJi5X3+bd8GlyWvtddxKEoEqSgEO7A8jIgf2nH0h8FjM7oB6yte3X5mpL0i/E4Rx0CotKnILJj/vJqo4VkPQ93jRtRVfaitQPqldl5xRYPq8387Z0DcnZvOeION0Ht1+P27kFLGQIcLBX4FG3sffccNHh5cPfzp9INoRtqVtdViJfg8RjnXiIz/MNqEN6zvzX3hMzyWC7oSoXIT14ubc0abPX8Rp9GVa5NI/8iv+6ela1oTncbdimRKnrbRffDR/X4nH+bgqAuHWl7hOaeXPWVzIeRl7ga+JzD4Sx3mlj/q6Ra/E2HhDf21eEzTLNGfCZsY+/yxZzQzIAuijG65ii4O/waAJCrEJaWd/DRAKMQ5678Dw5AT7RCKzdadIwd8LsD+DgPBASmWsUlf8R0k1w/2k4lO2Wpb4zMI6EJVJs0xk/wn8/fRUPqrDKhbjHR41SqgFMx5RGMPuduFwlu5lK89tW11sTqiX/5EfGs5nO+y9FKvgXKPOEmgE05EKNL6Sjb3xS40H3BVPhm0ESOZgAjZoymc8be0inDVo4JdJVf+NKd3tN/CaB7GShhH27qf95NoFZVX/6ZkR2lX+CgWrQ2INgkh+bbMz68+uJ3Clsh8HSMPEQtAt+BBE6fXDab7KIlsKxU1lIXW/KWVstpdPanJ0pdXpQinDyUQjtY7ZVcfiecRxRDMAUhHFU2cEaciQ+htiPMPx1kdvtWG9T44w3r037ljHBFJdYR0r55qvMRixtAEFJAqA4T1ES87FAx7UozXasytg8MftZYt0rjYgLe6EJ5aWvy2qscBSBQ7yehoJIA3wIIZ9ukfkyBb6qnue5ko8W50rpV4kXqWjI5nbGRXrNW0tBZHXlY48nSgcUXBHWT4GcgLZJoLlKJnV96kCYpq9eWHh7xJzkCAyrQuQ5AJ0qq/uZ3toJglNterev+Qm0KXxPg/+YbFRJdfhbp1wOnVOEYdVHTya6CtO0afhEaBhx3oHwCb5Kq6RwHDzFMl2vfjL8GwzcCoTj7wZe+UFnYDV2yKpPU9dba29gYBdNqJg/KXozO+CJTlKmlKhnqTf5doeS35DZFV+cYJQVjd+oVY/Gtc/6XPzUxb1gMqf6cEjNNoRC8AObrp+fx0cVtGu4ffC2TgXRC8zPl8moUHCB5HZ25d87mlsiiK0aNwBtcEQjRNBT/QrXbw/8aVXdKMHn9EqYEKEyxSGTpYQOaes1G1Qq8pDgqkZtlO2HRyCXpmeM7TSrRPkAh004BfisVpF6zP44n2Jvxz/gOVocNCyy9V6lkod28QM4pbaMvVJigD/w3BrsjSJrXlqc4ulBYOCceiBN4b/gHajYyupbhEt63a619Ay4wsL6a6w6B+A7TnoyE7BliWHJfzVxxIKM/W3M/J8Bx99Op863Q8eNuIMGRx++VbYfjm+VGYBA3Ap/KEu/wxBNBpJJncwHPG45V8Gh98ZIrGCc20MwijGowZbcS7d1nEgcOW5cddZpHL2XPAIRbColiheZzXTvBxZOY3iMSDSKDrICyJ/iQs1vdplVdH/JrLJsQ2jtTnfCrITIghq3KFX3qAgLWAIp8IffNSdTYptnbGfc8s+qcr3zyzyHp1aJg+jxTF4kD1ry5Wauv5V3xnOGwTFecNzXSLHBW20/pCQjk4uorD0plIhMSTc79+/r4RKPClRYTBYex1Ob5crtfvRQBBv6re/6FhtCqtduag67glqRA77/3ulblh9YRtMdDxkCyJDeNnAuCLPQFmdRRWJtH20Z8DstfJf+5oj5SSB64d0iF5/Ya4KfTWxfivj9Ap2/zbYaTo/1gO3tM6RYsCZharMBFr7Fm61mLSrQnEI4OF1gbVS4k/JE9UotOrnLJZuswoWodCSV8zbybkJSVIP7n8UaE9xCR39rJZmf27HOAPVOGc9pdkQUcRrI0qyVF9Z3j1RHDbxIfwbWzmPVjwIdPJvtmBYwEQIUsIW1S939hcVikK00ozPRI02cqhzVUNzpOxVdrwRPvlh1aIOf0xFEqD3YkGnCnFah/cFN3J2gB7N+bZSGawwkKFu1tpQMrp1W+27YNkyT0TpcFpTqgOqqLabrgcCUPxh97mREOGy4xItzQ9xSl6rq+8BZsHcrQFReS+QeMxJ3P6CnL9EP/eOLDjumLhvrcQrpPiknsofbzBv9gTP0lU+TIVwE6E7CcKfT36q+ZiEOHJ9ayf0dyUJLezAb2M8aNHwd0+OJmsVgTzRWA");A=new Map(a(e).flatMap((e,t)=>e.map(e=>[e,t+1<<24]))),k=new Set(o(e)),P=new Map,E=new Map;for(let[t,r]of c(e)){if(!k.has(t)&&2==r.length){let[e,n]=r,i=E.get(e);i||(i=new Map,E.set(e,i)),i.set(n,t)}P.set(t,r.reverse())}}();let t=[],r=[],i=!1;function s(e){let r=A.get(e);r&&(i=!0,e|=r),t.push(e)}for(let n of e)for(;;){if(n<128)t.push(n);else if(x(n)){let e=n-m,t=e%588/28|0,r=e%28;s(y+(e/588|0)),s(b+t),r>0&&s(w+r)}else{let e=P.get(n);e?r.push(...e):s(n)}if(!r.length)break;n=r.pop()}if(i&&t.length>1){let e=_(t[0]);for(let r=1;r<t.length;r++){let n=_(t[r]);if(0==n||e<=n){e=n;continue}let i=r-1;for(;;){let r=t[i+1];if(t[i+1]=t[i],t[i]=r,!i)break;if(e=_(t[--i]),e<=n)break}e=_(t[r])}}return t}function T(e){return S(e).map(v)}function B(e){return function(e){let t=[],r=[],n=-1,i=0;for(let s of e){let e=_(s),o=v(s);if(-1==n)0==e?n=o:t.push(o);else if(i>0&&i>=e)0==e?(t.push(n,...r),r.length=0,n=o):r.push(o),i=e;else{let s=O(n,o);s>=0?n=s:0==i&&0==e?(t.push(n),n=o):(r.push(o),i=e)}}return n>=0&&t.push(n,...r),t}(S(e))}const R=e=>Array.from(e);function N(e,t){return e.P.has(t)||e.Q.has(t)}class C extends Array{get is_emoji(){return!0}}let I,F,U,j,L,D,M,$,G,H,q,W;function z(){if(I)return;let e=n("AEkVMQnvDV0B0wKWAQYBQgDpATQAoQDcAIUApwBsAOMAcACTAEUAigBRAHkAPgA/ACwANwAoAGIAHgAvACsAJQAXAC8AHAAhACIALwAVACsAEQAiAAsAGwARABgAFwA7ACoAKwAsADQAFgAtABIAHAAhAA4AHQAdABUAFgAZAA0ADgAXABAAGQAUABIEtAYQASIUOjfDBdMAsQCuPwFnAKUBA10jAK5/Ly8vLwE/pwUJ6/0HPwbkMQVXBVgAPSs5APa2EQbIwQuUCkEDyJ4zAsUKLwKOoQKG2D+Ob4kCxcsCg/IBH98JAPKtAUECLY0KP48A4wDiChUAF9S5yAwLPZ0EG3cA/QI5GL0P6wkGKekFBIFnDRsHLQCrAGmR76WcfwBbBpMjBukAGwA7DJMAWxVbqft7uycM2yDPCLspA7EUOwD3LWujAKF9GAAXBCXXFgEdALkZzQT6CSBMNwmXCYgeG1ZZTOODQgATAAwAFQAOa1QAIQAOAEfuFdg98zlYypXmLgoQHV9NWD3sABMADAAVAA5rIFxAlwDD6wAbADkMxQAbFVup+3EB224cHQVbBeIC0J8CxLAKTBykZRRzGm1M9QC7DWcC4QALLTSJF8mRAoF7ARMbAL0NZwLhAAstAUhQJZFMCgMt+wUyCddpF60B10MASSsSdwIxFiEC6ye5N2sAOeEB9SUAxw7LtQEbY4EAsQUABQCK00kFG8MfBxcAqCfRAaErLQObAGcBChk+7Td0BBgXAKoBxwIhANMrEnM681CwBZA6dyc1SAX6JwVZBVivuAVpO11CEjpYQZd7k2ZfofgLEwPFByXxdyMEo0sCU1MCdRurJwGPo6U1WwNFFwSDYQkA0QarPy8jBykCOV0AawFhH3EAgx0ZAJUBSbcAJ2kXAa/FAzctIUNTAW9ZBmUCZQDxSRcDKQEFAElBAKsAXQBzACu1Bgfz7xmNfwAJIQApALMbRwHRAdsHCzGXeIHoAAoAEQA0AD0AODN3edPAEF8QXAFNCUxsOhULAqwPpgvlERUM0SrL09gANKkH6wNTB+sDUwNTB+sH6wNTB+sDUwNTA1MDUxwK8BrTwBBfD0gEbQWOBYsE1giDJkkRgQcoCNJUDXQeHEcDRQD8IyVJHDuTMwslQkwMTQMH/DZCbKd9OANHMatU9ZCiA8syTzlsAR5xEqAAKg9zHDW1Tn56R3GgCktPrrV/SWJOZwK+Oqg/+AohCZNvu3dOBj0QFyehEPMMLwGxATcN6UvUBO0GNwTFH3kZFQ/JlZgIoS3ZDOkm3y6dgFYj8Sp/BelL8DzZC0lRZA9VC2EJ3zpfgUoDHQEJIocK2Q01CGkQ7wrFZw3hEUEHNQPRSZYAoQb9Cw0dMRWxJgxiqAsFOXMG9xryC4smqxMlevgFzxodBkkBJRr7AMsu44WsWi1cGE9bBf8LISPDFKRQHA0hQLN4RBoXBxElpQKNQ2xKg1EyHo8h8jw5DWIuD1F4B/E8ARlLC308mkanRQoRzj6JPUQiRUwoBDF7LCsnhwnLD4EMtXxuAVUJHQmtDG0TLRETN8EINQcVKZcgJxEIHUaRYJYE85sD7xPNAwcFOwk9Bw8DsRwpEyoVJQUJgSDTAu820S6vAotWfAETBccPIR/bEExH3A7lCJcCYQN/JecAKRUdABMilwg/XwBbj9RTAS7HCMNqaCNwA2MU410RbweNDlMHoxwvFbsc3XDEXgeGBCifqwlXAXEJlQFbBN8IBTVXjJwgPWdPi1QYlyBdQTtd+AItDGEVm0S5h3QChw9nEhcBMQFvBzUM/QJzEekRZxCRCOeGADWxM/Q6IQRLIX8gDQojA0tsygsjJvUM9GUBnxJeAwg0OXfqZ6dgsiAX+QcVMsFBXCHtC45PyQyYGr0YPlQqGeAHuwPvGu8n5kFTBfsDnw86STPqBLkLZQiHCTsARQ6fEwfTGGYKbYzMAS2HAbOVA1ONfwJriwYzBwcAYweDBXXhABkCowifAAEAywNTADUCqQeZABUAgT0BOQMjKwEd4QKLA48ILccBkSsB7yUEF78MEQDzM25GAsOtAoBmZp4F2VQCigJFMQFJIQQBSkNNA6tt3QDXAEcGD9tDARGnRscW3z8B22snAMMA9wABMQcBPQHJAe9pALMBWwstCZ6vsQFJ5SUAfwARZwHTAoUA2QAxAHvtAU8ASQVV9QXPAktFAQ0tFCdTXQG3AxsBLwEJAHUGx4mhxQMbBGkHzwIQFxXdAu8qB7EDItsTyULBAr3aUQAyEgo0CrUKtB9f81wvAi1uPUwACh+kPsM/SgVNO087VDtPO1Q7TztUO087VDtPO1QDk7veu94KaF9BYecMog3QRMQ6RRPXYE1gLhPELbMUvRXKJVIZORq4JwEl4FUFDwAtz2YsCCg0cRe4ADspZIM9Y4IeLApHHONTjVT0LRcArUueM6sNqBsRRDwFQ3XpYiYWCgoeAmR9AmI+V0mrVzccAqHzAmiUAmYFAp+AOBcHAmY3AmYiBGoEewN/DwN+jjkCOXMTOX46Hx8CbBkCMjI4BgJtwwJtquuGL2NBJwFjANoA3QBGAQeUDIkA+ge+AAmxAncrAnaeOwJ5Rz8CeLYZWNdFqkbTAnw7AnrEAn0FAnzsBVUFHEf8SHlfIAAnEUlUSlcRE0rIAtD9AtDISyMDiEsDh+JEwZEuAvKdXP8DA6pLykwpIctNSE2rAos7AorUvRcDGT9jAbMCjjMCjlg8k30CjtUCjlh0UbBTMQZS0FSBApP3ApMIAOUAGFUaVatVzAIsFymRgjLdeGJFNzUCl5sC765YHaQAVSEClosClniYAKVZqFoFfUkANwKWsQKWSlxAXM0CmccCmWBcxl0DFQKclzm+OpkCnBICn5cCnrSGABkLLSYLAp3tAp6OALE5YTBh6wKezwKgagGlAp6bGwKeSqFjxGQjIScCJ6sCJnoCoPcCoEgCotkCocACpisCpcoCp/sAeQKn7mh4aK3/RWoYas0CrN8CrKoCrWMCrP4CVxkCVdgCsd3TAx9KbJMCsrkJArLkE2zcbV9tRFsDJckCtlg3O26MAylBArhaArlDEQK5JnNwMnDdAr0VArvWcJIDMg0CvoRx/gMzbQK+FnMec0sCw8cCwwBzfnRHMUF03AM8owM8lgM9uwLFeALGQwLGDIUCyGVNAshAAslLAskqAmSZAt3OeHVdeKp5IUvMAxifZv4CYfAZ75Ugewdejl63DQLPZwLPaCtHT87vD5sAwqkCz28BJeYDTg5+RwEC3CMC24YC0ksDUlgDU1sA/QNViICFO8cS6VxBghiCz4LKg4kC2sMC2dqEDIRFpzgDhqEAKwNkCoZtVfUAUQLfYQLetG9zAuIr7RAB8ywjAfSXAfLOgwLr7wLpbHUC6vUC6uAA9UMBtQLuhQLrmJamlv8C7jsDhdyYdXDccZ0C8v8AZQOOEpmPAvcPA5FqA5KDAveUAvnVAvhimhiap7czmxoDnX8C/vYBFwA1nxifrwMFiQOmZgOm1QDNwQMGZqGEogEFAwxFAQsBGwdpBl21YwEAtwRnuw2HHq8JABNxNQAfAy8SSQOFewFfIx0AjOsAHQDmnwObjQizBhufwQCnBRG76R09PhZ4BWg3PkArQiFCtF9xEV+8AJbFBTIAkEwZm7k7JmAyEbrPDi8YxhiJyfYFVwVYBVcFWAVjBVgFVwVYBVcFWAVXBVgFVwVYRhUI14VnAgICCmRe6SsEyQOxBi+7uwC7BKe7AOdAKRayBUY+aT5wQj9Ctl91N1/oAFgRM6sAjP7Ma8v8pudGej0mIwQrFic2NX5t32rB8RnCLGkBa9duMBcFXwVqycHJuAjPSVsAAAAKfF59i74AMz+BAAMW0QblrSMFAIzDCwMBDQDlZR09JB9KQrFCvEE4I18nYDYnOCMJwT0KRD9DPng+gT5wPnECiUK8SUI7X8tOT2pNCixrVC9qC24fX+AzOhsJZ5sKYiMrPB0mQqtCvCvMAcv8X8kOHy4JCAkifp3fajotShfJq8msCWXBy8wKYEFfD+UQoxEAk40dRUIlG6ltOc44CjM/Qz5wQj8cBwodTEdsWywtWuG8Egp97R0rQj8cXQhKCQ4zVENCNwQ7Q5wsCoEbLUI/G/UIUyIjGDAxAAWPYfBeCnFkyWALYC0jbkNgGTkCGx5gswYCaxBlTmBNEQFk52AVYJVgfWCzYEtgkWgWFwa1DtxVqbxaC0MWqwG7K83BAh8VABwDHgF5AmwvMJVSgAGKCrhHGgDkI3SOCsoNpk3qAZsCh5xPBUBfAPf3BwA0FlcMC6UMJB+6r0eAgQw0ABUTnyuCCHoC0gtLZREbANhOBnUECh5aADEAtritAJQnCxZvqyQ4nxkBWwGGCfwD2e0PBqoGSga5AB3LValaCbthE4kLLT8OuwG7ASICR1ooKCggHh8hLBImBiEMjQBUAm5XkEmVAW4fD3FHAdN1D85RIBmpsE3qBxEFTF8A9/cHAHoGJGwKKwulODAtx69WDQsAX7wLAGNAlQh6AOpN7yIbvwAxALa4rQCUJy07Ds4CkBh7ULtYyHRyjsOlmw/ZFUkb7AEpEFwSBh/lAccJOhCTBQ8rDDYLABEAs+AiAQIApADhAJiCCrJrOS8AFABbG8YubHYqDcEQAjskHNPhHB4LG30CewTBCqrxbAAnLQ6mLs6hHAe7CQAQOg+7GkcczaF3HgE9Kl8cLs4RGQB9q9ocAuugCAHCAULz5B9lAb4Jtwz6CDwKPgAFwAs9AksNuwi8DTwKvAk8DrsFmAEbawouzqEqD4sa4QHDAREWOwCgCzsLuxC7BBiqe9wAO2sMPAACpgm8BRvQ9QUBvgH6bsoGewG7D00RErwBAQDqAQAAdBVbBhbLFPxvF7sYOxjbL7ZtvgNIqLsAB7sALrsC6w5WAAq7BAAeuwJVICp/FTwVuwG+J+QAsloBvSjgo7vIAAFbAAG7AAJbAALjAAg7AA67AgAbu6VbDr/EAPQAaPuoOwMBu5UnSwDn3Rm7CBp7CKEFCv9wAN+7p7sau6OLeXIG+6mbgwASuwYbCwG8AACGAG27BgALu6c7ARo7ugihnMoBuwvtB8CpOwDhewG/AADlABW7AAb7AAm7AGmLABq7GLuOaRX7AA5rAC5LHgAGuwAXuwghAA1KAcIAt68mAcAAALQADpsAHBsBv/7hCqEABcYLFRXbAAebAEK7AQIAabsAC3sAHbsACLsJoQAFygBunxnVAJEIIQAFygABOwAH2wAdmwghAAaaAAl7ABsrAG0bAOa7gAAIWwAUuwkhAAbKAOOLAAk7C6EOxPtfAAc7AG6cQEgARwADOwAJrQM3AAcbABl7Abv/Aab7AAobAAo7AAn7p+sGuwAJGwADCwAQOwAIPAAUOwARawAPiwAN6wANuwAZCwYWGwAVOwBumxm7ALobLgATOwMAaSsKAOFLAAI7AARSABd7BRsABtAAGLsAC/sAX7sAa/sA5IsBuwAXdgG8AAFyC6EABUoAbXYAB/sA5XsAHGseAXsoUgA5RQD+Bw0McgAoKnABpAUIXgG8XiMMCQdvS2xfKokfPBRiLTYDoQq0AdgAFgLRA24BdnJHUhQhA08CFT4BLAYDc0a8e1J6QAApADEB+wBTCtsAe5AsASsAduUNETJGAUoAVwUAAVABB4rMAHg7BCClAFoA1hUAlWg3H4sAzWuxAM/UFgjCdXMbGFYdCdEBiJCrIlNTTUgSPMKJ+QB/HDdAKSvgEZdPAHIBKSwwKUIZDwMwVQT3xe4AS2XcAGoCcQI/EXo6x3guNdUGBQAQGx0KCAwqBB8dKU5TTgi5ugAKEs0AJgABGgCGAIkAjjUA7gC0AOAAnTwAuwCrAKYAoQDyAJ8A0wCcAOsBDAEHAMAAeQBaAMsAzQEHANcA6wCIAKIBNQDjANgA1QMBByoz1NTU1LbA3M3QzkMyFwFNAVcvRwFVAWQBYwFWAUdLQ0VoDQFOFQcIAzI2DAcAIg0kJiksODo6PT09Pj8OQB5RUVFRU1NSUylUVVdWVhxdYWFgYmEjZmhwb3JycnJycnR0dHR0dHR0dHR0dnZ3dnVbAEDsAEUAlgB0AC4AYvIAigBTAFMAMwJz6QCH//LyAGAAj+wAmwBLAF4AYPn5qgCBAIEAZQBSAK0AHgCyAH8CPAI/APgA4wD6APoA5AD7AOUA5QDkAOIAKQJ3AU0BPAE6AVABOgE6AToBNQE0ATQBNAEYAVQPACsIAABNFwoWAxUWDgCKAJIAogBLAGQYAi0AcABpAJEDEgMkKgMeQT5HKQCLAksAwwJTAqAAugKSApICkgKSApICkgKHApICkgKSApICkgKSApECkQKUApwCkwKSApICkAKQApACkAKOApECcQHQApMCmwKSApICkRZ5CwD6BQOnAl0CNhcBUBA1At4RCisTAUo3E02RAXekPAFlWQD/Az1HAQAAkykeGI9qAClgAGkALgCJA5TMi/CuhFoFuisOwhEBndV0KgsEIzFsATNabAGyAN5+gH9+gH6BgoJ+g4aEfoWIhoCHgoiCiX6Kfot+jIqNfo5+j4KQfpF+kn6TfpSDlYiWgpd+2gLabOEC2GwAgmwkbKAAg2xsBEkERgRIBEsESQRPBEwERwRNBE8ETgRKBEwETwCWZmwAowOIbAC0ZgEFbADJUWxsAM9sAgxsAPZabAD2ARkA9gD0APQA9QD0A31ebNSEI2XAAPYA9AD0APUA9BxsbACJWmwA9gCJARkA9gCJAL4A6AAIAPYAiQN9XmzUhCNlwBxsAPdabAEZAPYA9gD0APQA9QD0APcA9AD0APUA9AN9XmzUhCNlwBxsbACJWmwBGQD2AIkA9gCJAu0A9gCJAL4CNwD3AIkDfV5s1IQjZcAcbAJDATZsAkoBOWwCS8FsbAJXbGwDnwLtA58DnwOgA6ADoAOg1IQjZcAGA31ebBxsbACJWmwBGQOfAIkDnwCJAu0DnwCJAL4CNwOfAInUhCNlwAYDfV5sHGwEPmwAiQQ/AIkGjTFtIDFs1m4DKGwDrAJsbABVWv4VMgJsbACJAmwAVAEAul5sAmxebGwAiV5sAmxebD3YAEls1gJsbEbCxxP/x5BApA0KYFA89AsjTx97EHmJQPyocItC2JnNFRCEnFU6SFTDoI0PxeRNRoNRWkpzVnWW8pTagkNmgf+jGupqZ3eu50LAFnc+OzfJwdub1AdpOy76VnijWNR/CMEevikQkFyQuLuPajxWi9chqOoMJ7qpCN4sx3LJG4Myu8kD68wC6+iAwt+pU1JEeY13rpCVkXSZfinVKn4xZpxsI3Lp8bJLrJ9ujkrIalMRBAcv/GSKEtowzcEn5XmJw2BagB8V2UWJoJHZ14SXhM7p0XeGFOuw6mlvyq99WYp5XxrO6ru9nn4RHcOkJ7hx5UqWtman7yVMLzYXQefQRUdIY70RYQE8+aAzCNSGQkXiHfnHYRMi+xczKDdZLk3AV1gzxkkSHLjBwuq8shIJ+/RAbqjqQbugFhe0rqklu432EERkM5k9y1DXzds46oLqKAx6OhPT2WiqEfhaITn7OF9Y694AmKmUvbpWp0xJqDaf3jeNJXnK6NpnGcFOmbclbARC+5+5U52ufw5b0Hh+2LrrNimvZe4eYmApRsZnJE310SqB+1xB6rSJfnV1f2D0awB18Oc0sXAFqIlgHgWiaZGdvP5CJUSsCTCQUC335+iSkwPlLJJ5lwjTSn9Lw22NbK1Tu8w+bUpHtDRDPho7Gun8aw2Jzu9i+N0Ot/kPMbLAb/rUQ82kfpk85qLDkfxLl39QPDngo72GYh/Xigbpcm1pA23D2ywt3D8GgMOao040wDqkHxOEx0OhC+ZmHiIdjK7yRbfJD2ouZbAedhD3p7s8WDmCJfNforgDYPGAXSI08fTjPZ5B37lc5VXGzc1vJmibDwBNVzXuaUzg7N5H4BxqjhJ+kz9HLUJys7bpBDYAPvbut13AwJCWd059tS8YTYgC8HwrkewBfa1LSSpmMr9uR2EekTiAMH+Mx4AGzgbquccwBDlLmRhgXL/YiLPCEb6d2k5qJ6o800qddABkpqt7NG+sc2uvHZwZs57W1AHTFM1KkMShasADAh2FvzbzJOzVDMS3ZlT2BSFKdnkZFB6JyqJbhm6XANis9TrtzJdlPVp+rl8v3nIke6Jou7m2TKu53Vounupgkz2LzrQPhhatLIG7rfF/gUKWp15X3LKt+ZvuCDSqPUigF9yJntimC1HJR7Yj/dUrLAXWrT+1tnwPJJLGKAlQ5VeNDWRKCTt2vz3rJuo4+gIt75/Mkfl/gSZblZ9r/SEeeosZXneli/xNh1WVCvkRt2RnyyjtMkMqhzXh1PVOCbILqv0r7rGYm0CHIyKdhHL90cl9E1I6eEtQTCt6RXj8M0HHrHCHLVRpNM6WIbT5BCMGVnL0o5895qSRbCJz+5I8PGMhAN/Xrj4BgIdlKqlHtBHqTJwmK169toZ2IWxNzrAbIG7zh85Q/LG2A4yBcaBel52zdunokB0lv3A7kXnTI7M6ZnfZ7nwuj5lkGhqSpW+w5CI/FmRlplBEbnZy1ZxS3DL8rf1YWhO5XivWZBSRh1gFsjjyj3qRG1cm/6ors7WsEif6WRxns1MKDZa6KrbfMQ/swIb+2nb0tqxHeii6FcgVeAjE/Xwac1owx04dJKG8R5YQgHNnEfHf0qb8WOnU0eQSjazq+IK7cSuCqYzPEUB/x+QgGZqM3dBoYvNvZVOHDkbgdilWdagqO5bkybXfLpyMPuGq8mvAAEZGbR6RwXGlW9ErOWTfnjfx6dXFJqBj0OBSGFz4lWQasNOmVJeN4SFWSLfOGB/7ehV5YuoNNROHZEG9ElVuMnqbDMMuDleOt/cN/gsWxGw128mwU8/HxkOKqdTZnI7dHka67WCTf/FmBrxpNCaKJ1GxBTCSS7MNfhNj8S4Gtotg6Z3AM9cAeVROnppUMaiV5jjudLnNqoVrKO1/FijLlAc74kxydxKX1RQuMqHR63eecYr5o6MJ+B78VsLlCrpelWh6GOrCOBIoQmIcdpJL1pwE2zzZqBkecGTdK8KMOB6r1eNRURyrz6M899TZaoS/vNOxHf+5gORU+OyYIcIW6diP25GHF6u8TNjuL/GJzCnLLXd01KrsjRa51v4+O/VIAWXESJxfxWjv628J+cWUQpoD+Yytzs3jSMRJ23/XT+vUdtUMLDQq1vnIoeg/GjWh88MT6k9dRqDaQ+vodilFgvjuNw5pJpId9mfwyYeLCGb3BmHXdfQfhfPRQaupe/f8TG4Bk3eDKlYBaEK3kZYNN2Sdxz47m/vYBxvIOKtnqplB1pebzuXmAr/MuzQCknKe653dzaWQQ7MUhWYWvzIZwLe1v0rXxImLaz+AkAu+sYikhouNF3EW6w4crZ6MuUiDbIAx8XhAfegcvW6x9BPb3/sCxGWu9YyatqExB+TSm69qIkI9IwhjrcnzME+jWBx4mNQm5WwLzUjSyY4FZ0aMF5YFlXUD4hL4XfOeYv5rDe2s2D/Cn+28fZ9UCnOQvXFMnQqfc0G+ZqOWWD9l/liqUPaNQzZjxCHpUAD8Rcc90MniQ02ugHWsUupFUvhC9usY7zNPt5F2jO7qgzhafsQSd50jgLrC6Qx6bpHbXR3WNAu1BzGmwbz+ebGmwTjdy006Y6zipP7n/OJlvSmbq+SY+nefAVKK6EBMPbce5n3IdRI8+vbxCpN53rw3TvgNds1SuMiuLGxt89L71mxPDeanGhyHvOjmO56tnVpoHalQnL6TqNuqKsHjHCIKB4pCgj4WyYPvRvYvqi5EMr7lN3MotPR/KH7JUD1lZbU0QzfbrEBJnuQiVAyAC9vwXWp2TRU1/0aapyAH2cbglEHVAdl+1rb1u147uV0td1eNoQZsqHrIMIYVPXtLk2TIU3cJE08PjoYNDpfF/IcJnYQHl6nsplczX3Rgah4NbJJHl//5scUufqsSd//kbIS406ZWoMP//+jhGUswX/5nVNz/jAj9KmXPtAmMiK+khhbn1w/mELzZMT/WxcW//y/jsHaOM/61oAW/CjYhJtY622/TtMYuP7bilBvbiT3vB9n8IcFPnwM78H0KfhYDRdY5PhWJ4jWRQzB+HT5NVZV56LG82hcQms+jOTT/c9Y9sx5rPi1/wB7f/+c5UfUCKk3iwwCuywUc2MGnAwsXf1E5hoI55x1Q/Qby+sWH8NRjavZ8VaDsdi1NUVhH86BJHX1yaFt1w1OYeL5LVmdN+5Q+KuTvXEPDzUCg6xp0HhsUhTWSe7MZMM/6rsTUb0/nbUE3YQlGGt48kT1/6cnf6yHnvHtQx9EosOXN077yyEq/jE3YTiG/5SEJmXFeocJJ1EAd6vKeK6VEdJLOZ1km/EwOnZWCQpzCLKPHxrfh4yJhGq//2dos2E/3+MOcdW5EsgIdmTQUQetzRy5fQHhDBl37XbWzsqO/cASEDjyst1/8NEROqVAxWnddQV+umJ8IrKVgKvGaTc0GsQ4s8h0Osql5QKwlddPDjJhKInyWqYUKmmlIts+FIcXZ6yM6cljbsjUG2ksSOkuIw4sYHffRNgBOLApvD6XrR6Rt0rV2Uf8IpnIUVnb9Twt91QjAaD/dStSWDxg7aYY+VXIgnuowYdOkjywa2hlgrnI6PjaU3e3UjQ5Yk5mdIJGyHnv3/P+1EkMav1yFyF+FeJE/RXnWBw+Nh0aOo6TGlKX7d+dkP9+brvr79SdtXJtcD/aXBGiMNfG6/NQniQHYQlK78FEHDqOh+bDI0o+2Ub0h53EL/vlzjrBczVEZz2bOtvIL+DIzDkk9nCWt7tlqsq3l9JMtJk3r5HG2iJ9b/X11TG6wwMAjHLQ2oasaMEsydh88QPvI+hmqIHhvalpKoKOueJR0eZ9J8G2alNOIOy98jwvbc87Ewk9d+5G/tUijTmlbjFlDKXV05HalKxaRTrucc73On7yzAPS6f2v4ogiaWyWeV73dv/MsQT5HjRrsYV9dLAcI3T+zC2qEVINyNpEhoKV+xVSuWtT4AhBfpnZ7unIM+HX3msI0HiI+P+z2PFgkjGi5PqEbG/wNIWeRUjPtDEgbbubN+I4JaDLrW9borRBDob7ZFx+JdKeFVUKVeWqb/c88Ol7DhM0suLtuEd8tkDSMTD3DFx8UphPINHMHi51hAPttXL4Ektt/lKEUG/R4qZKohHjVpAcPIMiHyWr6xR8/EWnNJvBFET76yCdk5er7ADB/1bgoImhpSiZ/omZjPKPCEeZsOwvPmXL+1vlJNeGO3TzySmGA1X6e58gLrazDM71jywM1XL8zKHN6G3kB31Y8vLtP982N975SZXk2JwDvmv7AY/aDsFFk1v+nE7/hbvuOWhBH4kuemeYozPk2K22Vx/YGiDTLU7YilpOt29u3RZMBh4UJjlTP5ItxTzWv6ebL9b+GSU1Vsm2S8LMfVfJczaBSqE8J1A4YUjpsALL7++bwCPXFhaufdpDFtBlHb9makeYbqdg9ltvK/HwF/rNE6KrtWUkEcxmTB7Iyu5TiVaIgW/YxzQhpArliIMkOoK5L7ShVtF+DYqV01mk7fwop04hQRwg4KFmr5z9nYf05VVqkSe7gfnx5bxxlQ0qEV0jiwzf064qG11iEqjHcUgDWWsDs/LEGlzX31T5KVL+7D4EoKim7HBagiqRo5JI3WfDBgpKIruWz9j/J6Hp5Q/EJbMWB8NeSMuFarNw3AEYPBJtYQO/4oD/ZgPTSQ06di0EeumX5EbrdThO+fvYEVSxLtZ3AJkee0Xn0sDwNtiiZhJjJRDuG1YRKB1vOulfd9JjHeyu+UHTmrtra/pm+8Rixh4WKiLaLOCxIbZNoWRZSyyUGLPjAaAo+SQBpfO2uruWrzFxLlpvrXJNMCWtlJDKGAnlWK5xpU2tcxXbeD+sbdfwYXt/qTwDk6UqXR/aUt099DhSNl4Nk8mXwpw+b0nvjKOG6Mg1PRXjrMUMANvNgEArv8nMJs3vj1aHi8MHz/UfJWWzkcrSpZTNBhduXlGR7i+ip/THDp5R9KRNcDKECgtwgXg4EFN5HHfikP/XvsoCkHTg+NbsD8Gl6eknk4Arwn/BWGJ0hgW0/gUKrzuGZhub7igRP3abetpIm+24xEOlWl3YKpm2qTBFvX8ddDRvm1LcwnCJuEfZx12qPY9TrntMIQsv316zvpyWnyStX8VU4j6tQk+CWlLBUCJR6MdH9Cp7g2qdn2WM9qFbREmejH09dlWEPm8hPF0L7RxwRRdiCs0DP8ewk6ApoELkKU9hckSdbnXm8UHJmaNXjxv/q0fTTpu8rnl9lN0vQCpDRbCtcz12rGRFEA7Cfg7FhZn5QFkNmv1ZURKEsiZce1nS9K7HrwpC7yJV4Xt3eAVbLJfoXHrtwG60Z8gwaSnmxoL3s2ZlRqggZN/MHo1oUS4L+GwObFI596Ld4Mvi8l+cQmF1gJpkpnDio7TuO35npaMHiWzFqPSX3qNgkIPGuX0qGYnPIVsM901Yu8oZnOZOY1TbtIdFUNKNq2dP8SJ4F/VCEzIjF0/Rh+7UrZj80tC6rognVH3mqa8eCs/lcQU1Pjj98kBmAKDbZUTwosv02UunRR3n0X6c+f73mtwB7/WbQ16gO431EtwZbNG1SM4TZPBnsQSESlsfG2JLQXx5xWf4bmQ/xcVCPISAX5897JxHKLD/Xkgu57+ABR2+MMtEbX64+MNlBHpKC7sjlWVEShf5qA+dGc59LFVlZrX/Enq9z/v+wnZ1HErmxmjJjxOA+hAjVUWgtq6ygAi/8ewJDjUMFw3zhQFtbyTLDPFd21Ji5S5QPZo9nMSxdg1+DGFSN0wlWt7XeYPbHqLfliV0J1kOhQNp0VbUPy0MS2Ms66OxtSWvaULaWHnfAA+sieVVgtjDwN3nKonWapkSKRN8BKKJQpCfqo8RQI5udhfu5s5+7vwsppmAJDgz2GNA7d43VdbV2l/SrvEu4RYslmNJmfSOVbssxAhSYy6WxpIQdDB0FVBpZ6IM8yr81QN+XLZ3n/wed/R+s6LslkxKbzzst/GkRbe6rFmtvJCwr1T44ETM+IMgOnjUO0eG6a1n2w7lwM1oFBvzMUWRkNFOvKcx3oSb5XdenZ5dXsute6nkRypBiSdAtA2fxAd8UdLOZW/MB7fZoEuFheQXijdaF8kuaRZoSeWdKOkKsGYEGaXfaDKTu0WMTcLniQs7KRCz9iK3SP+Y2xIjkfVGqFLSQ6vh+A1u6FdfwXsv1VPMfi2cxmdM+/xTgMXEyo2ZGcQ2YmPsghnYdv2+z48JpGZA4tUK1p1q2VdVxyfypXEXcrxKKtmt8UdW7sHWmKMqDuBBM3J/JUQx8eUYN4pJ5oRqvdiPHU1o/WPjiKvnlCqOdyxlxF54L9PrtLD1NejZ9aZDivVr6ZfMFK1/psVygoPIAnphcJWWb9+5IKMKmgRQULsTPZi6Bw4wP32zVEoKcHpP73CkFAqS98nSaGoWDjDJiaACJn4p5o1jq9R4Q4VcibhXF//LHP0bdf63kRVZdRbbhGe7sDQcyWS5tpkfeYHnff25WK+4FpzLlAcbaKmHdIBqOw3fImx1uqQIADH0TyHzFlqTG6nMoY81svP0T6BIyELMS8tMe+E1p6TFP6sVpZa6VNaTumufD5aj9goRa9SAmdJT4HhI2r0egj8UrgFb8L59wGLnYlzkLAiUd3m/WWIIEU61kPoEjd3gIVy/fiBcgqQqHnoXpL0SqLGdGGgn7DQeVMSYWHfjno1FngIKP9cjYaTlcRP6bZunjHP13/lbVm4awti894pTf/ZNNqr4OR+tDVie/m+rC8QpVnRbsCMPukOH87B2jM4AG6pHuXl1x9SiKdhYJVOhfo/+SCaGjUW2CoogL1FFhFGN9o+acoVLl0SXs/3vrSccmZeAF3NewFuOg/P12QYKQF+SH+KYcNnsAhIAELPBUgre/KRUJEA+KPD0MHRjv+3J/j2Z23MuJmkfy7leWcMsti8wXLSHgXFJTaksx1Woi6oljwxFVIJG12SBSZLNJDbXMYPekmiXT4FclKI35BFgqnYpKfcsr+f8HUXQoHJ9UYZ4J5YMiHHyAxg6eidhodgqJ2Htf/xYEx+G0zXchuzlt8hcAl+AT8NCQ4orFc4DerabF1enA7NTLnvtZh3FUwqIOvY7Q4DYmoDHwXTSw5UNNh6r7j0B/ezMYJMDcw4+6gCTZX4YQ+7Xs8de72vsR3cmfpxIX64/6KR1p3VX4F6vfHEzxzarh8aDH4G1DFoBBM6npXFpK+Rh+WrcFclAeAxi0PoaR9CpOxxGLSdvxKVSw8oOOanG/soKImRopN38AdcUhhM2GT/PgQeSQrG12njuJJD5Z7vWfAZmFybYLdSA91kB4aoBhoj1Z//KNIVVujqaLLRwCkbyn4vh0739C9V9iSjybeOIeSOvNs7LW1a7EUtNoKAnOGML4U8KBXpfrw73WjAszJG4Qscq+Xr3kZWR4Omm0xT6qE9y6FNSpstV4onMZSqCEJ+3VX9qjvdx5QVrM0WXxmPZxejdfnihcFAjzv5PjlTl6ickDbHe6+Lch52pjOPqk+m3RZ+bh2JSMGtFBuODbMchrpRVlt16NTQ05Ps0IDtWlUmWfP2vX8M4YDynIuOZ4Ck91+591B98Gw9fw+yQogTR8CSg0zaJu+rlBo/mr3A+1NziF+kdubz+whc857AZt6DwIBIF5+5yiaaf3ByQp1Fm3sOkZDAzwsYSQTM/Kv6idkugF63FDobDdUY3huruU+sCaBuRR+HmOowvmZoBjZHNh77SXFtmY/oOUE7ifN7nBHAo83S/xvcS6H4Ci2u/9Id62Wv6Ui+zMNLAzhfkTkVcW2BwrnYvpur0ZDlzs+ZLsmGTWvd1892t78gx1YjEJusGcxphjLkV0UfAKlekfSBVWHE2ahk4AbbRmHyL7GYdtKfdlINwrcdJuf3Cee1nfUojDQn/YmItESOFhtLzrkEv4k2XpMU9oaJQ3VUC+1INh6BE68pkHameGJm4Gvdb24Q0fXWxd9Tp3A9mzFSe4qXDGGDIV4AAGV1jIDfveknH1TwWpUT6HiQxKP3AAHJNkJeRlj/mXBmS4S1j8FK6YmpK7jyyAiRbsMCCLoJcx01fvgpMvKQRxu9IOwymconQjD56g7ksOrcOeoTbius4JnGesAS1DtgdaophYsw1wGIsMS3P7K6doE3K5czznqPQLSRRF/Ylzb5NtSKsL33SgskFNCF4khn5LWaDxI23ZRi2hzqN8uW8UzZEBYy68+VtGLSymQrXGUlr2nO2BbBIT5Vh1RmGAyDXaW0FPrpx3wv2UYdFk9tSl+906bMxCuXQaKDQP/U19UEcVGK4gmksL8lAorxQSAOwpeYX9xrZsh6yoGaL/X5O3tgQC8OM+/GvxnW9XvAtu/JxAigydfSmZfqZfg1XOcHNOpLlN8j64OZ36l5qawDBJ62YaTvxeNmm5gowCdBosgcpHOgNgwA+sknN8XmsR2IYChcafl9bGNMZ/nB5guWuvEziv6QI2bP2DtyKWG/qUjZMaxy+wASkkVGtuwGtywkTYG6MYrZBo18vYcww48G/+f+eITA/qMwbLlJC0S3+/ai2pPvkOhRRVmGTuSupaxhIk0xoXLtixCxSAn4Z3OnUS3wBqVscLI4P3GP7i/6gxYsswsVmkvDXFLhO/OKcur8flegCSKiqmVpIRvCzgbjEA0mXPn+RExXY/2OE1f/BYuWpRQY8gCDpMOYBx9Gn4tL3hihSIR1ixh2PIIT7cr2gUJbfs76EKYG52Jk0UZF/PQkBxGuFCEWXnG6ue/hTIqjTRq1sotVrKrwIGHDrITyuanUzbIYdgdEeV88K1VD82TYB2B61Ft+tB1KqHPmT9+hWoaV+iF3SuvtJqvnoLaA8wxrD56AUMULEgzO9SvBcBAfqz/dzMYzwMt/YLszDbmGe1bcHHfFMcvGql9bf/tp+Hrj4q18aNnftGjmXTfws39emn7/5IBxog9MrmftAA5Oq4awenm8HimWO72dwVlHcHmutVMdrMHw+p2vzpzT+B0iIZ+IEpplwWhClcXlxhxAsF3CHRnnaUEqq3ByQ+cqhe5SvR4SFxh/LZoQwtj8QZQGT1BzY2EMpYnUcZWQEPlwFZw+7UryK9qV8KgruYsvyMoK16KI2sN4SOblrVwhyiL8+IBZ8cpUhsJQSU7TFHAi+L2F0sn0y+FtDODlnuif2Mba8QddPZYYxjTsIgkMe3M6+7kXxUfZvbCUlyq71J1eNczGk6Vqw6rSx2K3vM+DjLxDRGzWepTO2qTT/W8S7u0QXcyFUahcB4vq8xCYTpy8iswtnyz7Kx6lgTEQJ9RqkgEIN6DOUqB0uRdeYuDa7AP7Zy9z+ZlTsmVR5vtV71m3dmdtNeWghbr5PnPJtjXAzcvZjxyV96VEx/B1TA0IEQSI50ywGuIbmAYdQg/l/rxhQLX+6uOLyFsaUt6mtjpAJkLfehnB6MlOHnNOrWLvCBqVBS07jcM+4RzLEed3f3/0Xwp92U+nataNHyEgnnuYR6PXEjRLETz0xrt3UglfK7Bn4aNlXG7cZco4lMziLv5+Mh2JCww3mz69Z9ZMRR/xv5EKJ38IFxKd9dw5CgPIXja/gzAshMbF14/qBIgNkdUQeP8YE7SrICGtiTnAKTyA9cXa3OauDHxZOdTP7yuYBzD1UcHstIO16FxF1bRUAlSkszI83YufTchU8OPnnozDl9bS0y6CnnjGwgj9M61cXcZsljjhLeT/Vq+30ScN2PcT/dOoxUDqDS38+OpCCzLDdnwHQc3ECQVIkaxmdPaZTSdfp2jjGzSdNLM5yPQsgJDl+ZnhclDQi8ltUnkqWJ323IvTZPN8rn0+EshL1cx9PiaLTzUsryn9Zp2Nt/detUAh4N/2I3dlMQqjHFxSihv0uykzflq5clMy2ZBaxoEb0/QMp03IQQus3vnZd/NOmSsmgqXqKFP3ozyDgY7RQS+npabe/hNG+5sa5FtvL8v0uYuag2NewYkcol3TOTadpuncCnDgOGpmLnTQ1PEPUN2cNsrW8LYfIv+hzfb7vod+ipXHzmbgj5Fzc6RcT/5PD7VQ8nTJBNj1urkVUx9uJvTWmqY08OC80rGDLaWXv243VB16gjt4Xtwp5H2UDR0LiKW24Ed/sOO8jl1yEU/XAb3h7ScKnCFy/V3sICrkY1D0K9fSokHIL0s5/7DLShLAPXRbV7fbv4qj6OwHC9d5PlEOX3LRpQ3P7hcSAKlIKPDM83ypz56U5+rJeo0cyUtC7wltL8wqEiNSgZsDWzACc7RFoZqhlD0+sihIBQlkQTXmvUyIOZhkQX2zqME5VRC7ms1sa3CY+odMn3mMBiTvCMKnnCxg5ZPLq4GUDB4jF8Br2K4x4sxfWjGXQatJ25I1JyrIv2Z4bP1jKw5C+B2/s0v4dGUOsaS6IPIQV3ETQ+F2fSl2BPBXHzyYN8VmwWIrKeMX9pyGWuAOVXwkxJsRBaBVzLhZDP8ONGncknL5DpTxHN32GgFWMwsc0GmL0oRDmRT8u2lvjAKUIi0MmXhIHSlFeh3Qh5pP6ap4YUd6b569ZIaHgya2AyD12cPxY0In/PBjzDctTaKJCU+xc6m9RkNLDEE8guvxtJP8sl8N9bLqw0F/qejaBlcHYqw31zYpsutQp07hsP1vhGdl4hJ1wA7OCsAHnKj9879uSHILEmuZ6vI1lT4tvnWCVKZhhYrWHW9oPKPKpbOC6FTjf/OtUvwmiXr2ykvyLzHGQeyS7BenZpL3N/CaF5T7Gkml7JXN5cj0PKaDpZVImD61FuMgFHPqSHvt4Ej4KBdAfdcoO3AjQPLwwtKsgGM+ty4lNZMBEItJSRLunG5ckrM/BeoXWoPZVvEoIzLgFQYPupMwZCXis4W2SCJ2zsefZqCj+aTfSq1FYdUj2UeJALvVTf7vuuikOE1Hit3UIAGUi/sqgMum9vw218y1FlY/9XnOji9nqhGAcMYICc7BiqLZj5N+cKEuSAuiyWbMg81ZD1lHovy/we2eaCcCv4MzEW3O0mVA/t2xdA0cxTVbXmFhn+tARDpvDz5ftLr15OAAmvo2QiAky+feVO4bGibv2nlBmBzqx0lEDfEm4UnEs11pbnwZlJ/0Y73/wBPYfTNZiJKR73TzdCW1BffiJq9bLjQmaKnU0+gN8sfe25IKSUCooQwxePDrFn3a/zUgWxvPoTYVXfobY/GV2qqTkeVDV9D8657fhY0/wiaJ5NfLxhXbE/naxs34N0hd6vxNfdm1TCnozm/NKSCThchoYgMF7Z2tzXFovRfsNVkf86JjrM60r7UIuV3bsmfrMOqzjXjN6HPBG25zCJ3QLueySbj9oFvX/HxWBqh31PBPxduCVAxMqC9HK+YL3oBZqBruoh6LKvdMqoz0PYXUBrwbiioyE8Tj5ImjJmiOOWLbAZvIZ/l9rIPljx3T5glJ2ewlfuIT5GlodQsAf/IEtmYkML5SRQGxxwW+rlZkD8belJNu09Itwx9xDULTnemVDeojdbgcd2gKGM9aO00Jivtbs7ZyOSE8IPh98GfvatD8Ud5uHcZfAfMiPSlIxd4UqeSDzuNfbKDuFepkyC/s3j9fawmhY1b9NqDi0ZS5eP35l7rL2eK5QlWLlyCmxx8AFaFiTuD2pMUxZV5mBSJuJduOaq2ZrWpu28DE8jl/hisBz7bGWH6qLF0ayWNq1Sejtcs8KQrQqJk5P9QHDYHOIolgNsMDmEaWcTelghbfFCDqWrq6YLwDWy+m68ec5nShgq2fduUBpQUuKKKgnttaUX9PRfMmxqJyU7e0RLr1bev+ge1KK0bZyhHKKDE8gQX9Vf7rNHWOxBtZcxwwGusyMpH77qWZxXsQmbgIGhtiO+gSSRCyu/ek+OFsz1HMiQH0IHV7PjJi3dszYfFp8ue9h4+AfKte4MTiehPvxNcm/T1t9vsFZx8rHN5ie77r2jzZOq/Em4Q+H9sNcZakf9HnzCc1fJixppxP8FQABmVnqa6GbJhwaka7WH7Wdoz1WxOjSNV8N9sgW5S3Ppgkut+TTCkjA+AodUOk1KIR+8G8S3WrSZG4nyqfJ6FEjXl6a/LEoRMHZUqfPRWvwqrtXYy9IUsmUGzkqi76ib4NANCe5DnyOxnFRZ9d8FdBVBjra3iNuZhJuWW5Omi/hBigqDsg0mu2AhfJDXdwyMIJ33HHHPfS2JtjegRejX11m41TbNL+Qp7mR0g9CPKTj9PIjuSycGN/YPozXI4zarXuAeLv5CHKtKcJKRbd6R2oLNiEt0T8+QIVJH7zt9ncKMgd49vV2P1AyScZ9Qzbu3m3LBnuu6dw7aE0b6r4kzVkI/GUS88mA53L/rLtntkFlZXGtIoqNP2mD3eVv08AVVPT3wJn81zpbJV9SuqZ6Pd1ge0Zz2RFHeCdV5CLPftH9V5o9+VzFu4R0QeumqDwUhXn3IyYotdJnxr1l3BqWnQVAeDBEOtPyJQx1q5+mODiClXtYeBLTWtsJ42AMBcf/IFIhpfhYO08hsg0Ik+DpQFNOKReK3o3cudkxWX0soPtI5eSFOA6yNylS+IQjrQtYQ/5s4UcixJfokumBUjpH9ofSjUTwPCapGFndfqqG5IHeMMvfg+88SXm7bNyjk6pGKzL+WxDAdqKtQ72WWVbOk3I+ueGuammmB2pvFZvqIcU/lvW3n9+r2lycnQLE4OX9R1jIgW4cDjJ3v8dAa66mVcfC7ptCr5io6mCaA9qI9T9FFWqo1ZAaMxgxAu8aXqmaOYryMND2sTUfoHvxcYK7hEiJhCLYFDx3PBhE97c2a0ub1/ePJcyJOqr7UaTAPTJ+xvZtjb/40sloY1ltRnTkWILmIP2b7S3AdXCR+YiArMUHwdncpjpyDGfzqGOUoAuaamWzAMacQtb34/M32FEgR5lUEf8fRzFrZUhzQj0fR7/6gdzdnVVvcSneLmtqJ930VCCDORY8CVdQWdo/S3PNkX3pQsPVKWIYGAMrFZoq8bQ/OJBDSXP7KSBdL3QN0Zqd393p6VFc7DnlnFiN00SY5Nux7yadeIM0Upl2rVsu8/VAI");const t=()=>o(e),r=()=>new Set(t()),i=(e,t)=>t.forEach(t=>e.add(t));I=new Map(c(e)),F=r(),U=t(),j=new Set(t().map(e=>U[e])),U=new Set(U),L=r(),D=r();let s=a(e),l=e();const d=()=>{let e=new Set;return t().forEach(t=>i(e,s[t])),i(e,t()),e};M=u(t=>{let r=u(e).map(e=>e+96);if(r.length){let n=t>=l;return r[0]-=32,r=p(r),n&&(r=`Restricted[${r}]`),{N:r,P:d(),Q:d(),M:!e(),R:n}}}),$=r(),G=new Map;let f=t().concat(R($)).sort((e,t)=>e-t);f.forEach((t,r)=>{let n=e(),i=f[r]=n?f[r-n]:{V:[],M:new Map};i.V.push(t),$.has(t)||G.set(t,i)});for(let{V:e,M:t}of new Set(G.values())){let r=[];for(let t of e){let e=M.filter(e=>N(e,t)),n=r.find(({G:t})=>e.some(e=>t.has(e)));n||(n={G:new Set,V:[]},r.push(n)),n.V.push(t),i(n.G,e)}let n=r.flatMap(e=>R(e.G));for(let{G:e,V:i}of r){let r=new Set(n.filter(t=>!e.has(t)));for(let e of i)t.set(e,r)}}H=new Set;let h=new Set;const m=e=>H.has(e)?h.add(e):H.add(e);for(let e of M){for(let t of e.P)m(t);for(let t of e.Q)m(t)}for(let e of H)G.has(e)||h.has(e)||G.set(e,1);i(H,T(H)),q=function(e){let t=[],r=o(e);return function e({S:r,B:n},i,s){if(!(4&r&&s===i[i.length-1])){2&r&&(s=i[i.length-1]),1&r&&t.push(i);for(let t of n)for(let r of t.Q)e(t,[...i,r],s)}}(function t(n){return{S:e(),B:u(()=>{let n=o(e).map(e=>r[e]);if(n.length)return t(n)}),Q:n}}([]),[]),t}(e).map(e=>C.from(e)).sort(g),W=new Map;for(let e of q){let t=[W];for(let r of e){let e=t.map(e=>{let t=e.get(r);return t||(t=new Map,e.set(r,t)),t});65039===r?t.push(...e):t=e}for(let r of t)r.V=e}}function V(e){return(Q(e)?"":`${K(J([e]))} `)+h(e)}function K(e){return`"${e}"‎`}function J(e,t=1/0,r=h){let n=[];var i,s;i=e[0],z(),(s?j.has(i):U.has(i))&&n.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let o=0,a=e.length;for(let t=0;t<a;t++){let i=e[t];Q(i)&&(n.push(p(e.slice(o,t))),n.push(r(i)),o=t+1)}return n.push(p(e.slice(o,a))),n.join("")}function Q(e){return z(),L.has(e)}function Z(e,t,n){if(!e)return[];z();let i=0;return e.split(".").map(e=>{let s=function(e){let t=[];for(let r=0,n=e.length;r<n;){let n=e.codePointAt(r);r+=n<65536?1:2,t.push(n)}return t}(e),o={input:s,offset:i};i+=s.length+1;try{let e,i=o.tokens=function(e,t,r){let n=[],i=[];for(e=e.slice().reverse();e.length;){let s=re(e);if(s)i.length&&(n.push(t(i)),i=[]),n.push(r(s));else{let t=e.pop();if(H.has(t))i.push(t);else{let e=I.get(t);if(e)i.push(...e);else if(!F.has(t))throw Y(t)}}}return i.length&&n.push(t(i)),n}(s,t,n),a=i.length;if(!a)throw new Error("empty label");let c=o.output=i.flat();if(function(e){for(let t=e.lastIndexOf(95);t>0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}(c),!(o.emoji=a>1||i[0].is_emoji)&&c.every(e=>e<128))!function(e){if(e.length>=4&&45==e[2]&&45==e[3])throw new Error(`invalid label extension: "${p(e.slice(0,4))}"`)}(c),e="ASCII";else{let t=i.flatMap(e=>e.is_emoji?[]:e);if(t.length){if(U.has(c[0]))throw ee("leading combining mark");for(let e=1;e<a;e++){let t=i[e];if(!t.is_emoji&&U.has(t[0]))throw ee(`emoji + combining mark: "${p(i[e-1])} + ${J([t[0]])}"`)}!function(e){let t=e[0],n=r.get(t);if(n)throw ee(`leading ${n}`);let i=e.length,s=-1;for(let o=1;o<i;o++){t=e[o];let i=r.get(t);if(i){if(s==o)throw ee(`${n} + ${i}`);s=o+1,n=i}}if(s==i)throw ee(`trailing ${n}`)}(c);let n=R(new Set(t)),[s]=function(e){let t=M;for(let r of e){let e=t.filter(e=>N(e,r));if(!e.length)throw M.some(e=>N(e,r))?X(t[0],r):Y(r);if(t=e,1==e.length)break}return t}(n);!function(e,t){for(let r of t)if(!N(e,r))throw X(e,r);if(e.M){let e=T(t);for(let t=1,r=e.length;t<r;t++)if(j.has(e[t])){let n=t+1;for(let i;n<r&&j.has(i=e[n]);n++)for(let r=t;r<n;r++)if(e[r]==i)throw new Error(`duplicate non-spacing marks: ${V(i)}`);if(n-t>4)throw new Error(`excessive non-spacing marks: ${K(J(e.slice(t-1,n)))} (${n-t}/4)`);t=n}}}(s,t),function(e,t){let r,n=[];for(let e of t){let t=G.get(e);if(1===t)return;if(t){let n=t.M.get(e);if(r=r?r.filter(e=>n.has(e)):R(n),!r.length)return}else n.push(e)}if(r)for(let t of r)if(n.every(e=>N(t,e)))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(s,n),e=s.N}else e="Emoji"}o.type=e}catch(e){o.error=e}return o})}function Y(e){return new Error(`disallowed character: ${V(e)}`)}function X(e,t){let r=V(t),n=M.find(e=>e.P.has(t));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${e.N} + ${r}`)}function ee(e){return new Error(`illegal placement: ${e}`)}function te(e){return e.filter(e=>65039!=e)}function re(e,t){let r,n=W,i=e.length;for(;i&&(n=n.get(e[--i]),n);){let{V:s}=n;s&&(r=s,t&&t.push(...e.slice(i).reverse()),e.length=i)}return r}t.ens_normalize=function(e){return function(e){return e.map(({input:t,error:r,output:n})=>{if(r){let n=r.message;throw new Error(1==e.length?n:`Invalid label ${K(J(t,63))}: ${n}`)}return p(n)}).join(".")}(Z(e,B,te))}},6013(e,t){"use strict";var r,n,i,s=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},o=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};Object.defineProperty(t,"__esModule",{value:!0}),t.AES=void 0;const a={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],u=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],f=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],h=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],p=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],m=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],y=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],b=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],w=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],_=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],v=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],A=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function k(e){const t=[];for(let r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}class P{get key(){return s(this,r,"f").slice()}constructor(e){if(r.set(this,void 0),n.set(this,void 0),i.set(this,void 0),!(this instanceof P))throw Error("AES must be instanitated with `new`");o(this,r,new Uint8Array(e),"f");const t=a[this.key.length];if(null==t)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");o(this,i,[],"f"),o(this,n,[],"f");for(let e=0;e<=t;e++)s(this,i,"f").push([0,0,0,0]),s(this,n,"f").push([0,0,0,0]);const l=4*(t+1),d=this.key.length/4,f=k(this.key);let h;for(let e=0;e<d;e++)h=e>>2,s(this,i,"f")[h][e%4]=f[e],s(this,n,"f")[t-h][e%4]=f[e];let p,g=0,m=d;for(;m<l;){if(p=f[d-1],f[0]^=u[p>>16&255]<<24^u[p>>8&255]<<16^u[255&p]<<8^u[p>>24&255]^c[g]<<24,g+=1,8!=d)for(let e=1;e<d;e++)f[e]^=f[e-1];else{for(let e=1;e<d/2;e++)f[e]^=f[e-1];p=f[d/2-1],f[d/2]^=u[255&p]^u[p>>8&255]<<8^u[p>>16&255]<<16^u[p>>24&255]<<24;for(let e=d/2+1;e<d;e++)f[e]^=f[e-1]}let e,r,o=0;for(;o<d&&m<l;)e=m>>2,r=m%4,s(this,i,"f")[e][r]=f[o],s(this,n,"f")[t-e][r]=f[o++],m++}for(let e=1;e<t;e++)for(let t=0;t<4;t++)p=s(this,n,"f")[e][t],s(this,n,"f")[e][t]=w[p>>24&255]^_[p>>16&255]^v[p>>8&255]^A[255&p]}encrypt(e){if(16!=e.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const t=s(this,i,"f").length-1,r=[0,0,0,0];let n=k(e);for(let e=0;e<4;e++)n[e]^=s(this,i,"f")[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)r[t]=d[n[t]>>24&255]^f[n[(t+1)%4]>>16&255]^h[n[(t+2)%4]>>8&255]^p[255&n[(t+3)%4]]^s(this,i,"f")[e][t];n=r.slice()}const o=new Uint8Array(16);let a=0;for(let e=0;e<4;e++)a=s(this,i,"f")[t][e],o[4*e]=255&(u[n[e]>>24&255]^a>>24),o[4*e+1]=255&(u[n[(e+1)%4]>>16&255]^a>>16),o[4*e+2]=255&(u[n[(e+2)%4]>>8&255]^a>>8),o[4*e+3]=255&(u[255&n[(e+3)%4]]^a);return o}decrypt(e){if(16!=e.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const t=s(this,n,"f").length-1,r=[0,0,0,0];let i=k(e);for(let e=0;e<4;e++)i[e]^=s(this,n,"f")[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)r[t]=g[i[t]>>24&255]^m[i[(t+3)%4]>>16&255]^y[i[(t+2)%4]>>8&255]^b[255&i[(t+1)%4]]^s(this,n,"f")[e][t];i=r.slice()}const o=new Uint8Array(16);let a=0;for(let e=0;e<4;e++)a=s(this,n,"f")[t][e],o[4*e]=255&(l[i[e]>>24&255]^a>>24),o[4*e+1]=255&(l[i[(e+3)%4]>>16&255]^a>>16),o[4*e+2]=255&(l[i[(e+2)%4]>>8&255]^a>>8),o[4*e+3]=255&(l[255&i[(e+1)%4]]^a);return o}}t.AES=P,r=new WeakMap,n=new WeakMap,i=new WeakMap},8165(e,t,r){"use strict";t.pkcs7Strip=t.CTR=t.CBC=void 0;r(6013),r(6342);var n=r(2977);Object.defineProperty(t,"CBC",{enumerable:!0,get:function(){return n.CBC}});r(9990);var i=r(4164);Object.defineProperty(t,"CTR",{enumerable:!0,get:function(){return i.CTR}});r(1485),r(226);var s=r(8420);Object.defineProperty(t,"pkcs7Strip",{enumerable:!0,get:function(){return s.pkcs7Strip}})},2977(e,t,r){"use strict";var n,i,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.CBC=void 0;const a=r(6342);class c extends a.ModeOfOperation{constructor(e,t){if(super("ECC",e,c),n.set(this,void 0),i.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");s(this,n,new Uint8Array(t),"f")}else s(this,n,new Uint8Array(16),"f");s(this,i,this.iv,"f")}get iv(){return new Uint8Array(o(this,n,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16){for(let t=0;t<16;t++)o(this,i,"f")[t]^=e[r+t];s(this,i,this.aes.encrypt(o(this,i,"f")),"f"),t.set(o(this,i,"f"),r)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16){const n=this.aes.decrypt(e.subarray(r,r+16));for(let s=0;s<16;s++)t[r+s]=n[s]^o(this,i,"f")[s],o(this,i,"f")[s]=e[r+s]}return t}}t.CBC=c,n=new WeakMap,i=new WeakMap},9990(e,t,r){"use strict";var n,i,s,o,a=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},c=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.CFB=void 0;const u=r(6342);class l extends u.ModeOfOperation{constructor(e,t,r=8){if(super("CFB",e,l),n.add(this),i.set(this,void 0),s.set(this,void 0),!Number.isInteger(r)||r%8)throw new TypeError("invalid segmentSize");if(Object.defineProperties(this,{segmentSize:{enumerable:!0,value:r}}),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");a(this,i,new Uint8Array(t),"f")}else a(this,i,new Uint8Array(16),"f");a(this,s,this.iv,"f")}get iv(){return new Uint8Array(c(this,i,"f"))}encrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)");const t=this.segmentSize/8,r=new Uint8Array(e);for(let e=0;e<r.length;e+=t){const i=this.aes.encrypt(c(this,s,"f"));for(let n=0;n<t;n++)r[e+n]^=i[n];c(this,n,"m",o).call(this,r.subarray(e))}return r}decrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)");const t=this.segmentSize/8,r=new Uint8Array(e);for(let i=0;i<r.length;i+=t){const a=this.aes.encrypt(c(this,s,"f"));for(let e=0;e<t;e++)r[i+e]^=a[e];c(this,n,"m",o).call(this,e.subarray(i))}return r}}t.CFB=l,i=new WeakMap,s=new WeakMap,n=new WeakSet,o=function(e){const t=this.segmentSize/8;c(this,s,"f").set(c(this,s,"f").subarray(t)),c(this,s,"f").set(e.subarray(0,t),16-t)}},4164(e,t,r){"use strict";var n,i,s,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.CTR=void 0;const c=r(6342);class u extends c.ModeOfOperation{constructor(e,t){super("CTR",e,u),n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),o(this,s,new Uint8Array(16),"f"),a(this,s,"f").fill(0),o(this,n,a(this,s,"f"),"f"),o(this,i,16,"f"),null==t&&(t=1),"number"==typeof t?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(a(this,s,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)a(this,s,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(16!==e.length)throw new TypeError("invalid counter initial Uint8Array value length");a(this,s,"f").set(e)}increment(){for(let e=15;e>=0;e--){if(255!==a(this,s,"f")[e]){a(this,s,"f")[e]++;break}a(this,s,"f")[e]=0}}encrypt(e){var t,r;const c=new Uint8Array(e);for(let e=0;e<c.length;e++)16===a(this,i,"f")&&(o(this,n,this.aes.encrypt(a(this,s,"f")),"f"),o(this,i,0,"f"),this.increment()),c[e]^=a(this,n,"f")[o(this,i,(r=a(this,i,"f"),t=r++,r),"f"),t];return c}decrypt(e){return this.encrypt(e)}}t.CTR=u,n=new WeakMap,i=new WeakMap,s=new WeakMap},1485(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ECB=void 0;const n=r(6342);class i extends n.ModeOfOperation{constructor(e){super("ECB",e,i)}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16)t.set(this.aes.encrypt(e.subarray(r,r+16)),r);return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16)t.set(this.aes.decrypt(e.subarray(r,r+16)),r);return t}}t.ECB=i},226(e,t,r){"use strict";var n,i,s,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.OFB=void 0;const c=r(6342);class u extends c.ModeOfOperation{constructor(e,t){if(super("OFB",e,u),n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");o(this,n,new Uint8Array(t),"f")}else o(this,n,new Uint8Array(16),"f");o(this,i,this.iv,"f"),o(this,s,16,"f")}get iv(){return new Uint8Array(a(this,n,"f"))}encrypt(e){var t,r;if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const n=new Uint8Array(e);for(let e=0;e<n.length;e++)16===a(this,s,"f")&&(o(this,i,this.aes.encrypt(a(this,i,"f")),"f"),o(this,s,0,"f")),n[e]^=a(this,i,"f")[o(this,s,(r=a(this,s,"f"),t=r++,r),"f"),t];return n}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");return this.encrypt(e)}}t.OFB=u,n=new WeakMap,i=new WeakMap,s=new WeakMap},6342(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModeOfOperation=void 0;const n=r(6013);t.ModeOfOperation=class{constructor(e,t,r){if(r&&!(this instanceof r))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new n.AES(t)},name:{enumerable:!0,value:e}})}}},8420(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pkcs7Strip=t.pkcs7Pad=void 0,t.pkcs7Pad=function(e){const t=16-e.length%16,r=new Uint8Array(e.length+t);r.set(e);for(let n=e.length;n<r.length;n++)r[n]=t;return r},t.pkcs7Strip=function(e){if(e.length<16)throw new TypeError("PKCS#7 invalid length");const t=e[e.length-1];if(t>16)throw new TypeError("PKCS#7 padding byte out of range");const r=e.length-t;for(let n=0;n<t;n++)if(e[r+n]!==t)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(e.subarray(0,r))}},4586(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="6.17.0"},954(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbiCoder=void 0;const n=r(5347),i=r(8869),s=r(1355),o=r(3178),a=r(8719),c=r(2348),u=r(9095),l=r(8026),d=r(7398),f=r(8766),h=r(1693),p=r(189),g=r(646),m=r(5347),y=new Map;y.set(0,"GENERIC_PANIC"),y.set(1,"ASSERT_FALSE"),y.set(17,"OVERFLOW"),y.set(18,"DIVIDE_BY_ZERO"),y.set(33,"ENUM_RANGE_ERROR"),y.set(34,"BAD_STORAGE_DATA"),y.set(49,"STACK_UNDERFLOW"),y.set(50,"ARRAY_RANGE_ERROR"),y.set(65,"OUT_OF_MEMORY"),y.set(81,"UNINITIALIZED_FUNCTION_CALL");const b=new RegExp(/^bytes([0-9]*)$/),w=new RegExp(/^(u?int)([0-9]*)$/);let _=null,v=1024;class A{#e(e){if(e.isArray())return new o.ArrayCoder(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new h.TupleCoder(e.components.map(e=>this.#e(e)),e.name);switch(e.baseType){case"address":return new s.AddressCoder(e.name);case"bool":return new a.BooleanCoder(e.name);case"string":return new f.StringCoder(e.name);case"bytes":return new c.BytesCoder(e.name);case"":return new l.NullCoder(e.name)}let t=e.type.match(w);if(t){let r=parseInt(t[2]||"256");return(0,n.assertArgument)(0!==r&&r<=256&&r%8==0,"invalid "+t[1]+" bit length","param",e),new d.NumberCoder(r/8,"int"===t[1],e.name)}if(t=e.type.match(b),t){let r=parseInt(t[1]);return(0,n.assertArgument)(0!==r&&r<=32,"invalid bytes length","param",e),new u.FixedBytesCoder(r,e.name)}(0,n.assertArgument)(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map(e=>this.#e(p.ParamType.from(e)));return new h.TupleCoder(t,"_").defaultValue()}encode(e,t){(0,n.assertArgumentCount)(t.length,e.length,"types/values length mismatch");const r=e.map(e=>this.#e(p.ParamType.from(e))),s=new h.TupleCoder(r,"_"),o=new i.Writer;return s.encode(o,t),o.data}decode(e,t,r){const n=e.map(e=>this.#e(p.ParamType.from(e)));return new h.TupleCoder(n,"_").decode(new i.Reader(t,r,v))}static _setDefaultMaxInflation(e){(0,n.assertArgument)("number"==typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),v=e}static defaultAbiCoder(){return null==_&&(_=new A),_}static getBuiltinCallException(e,t,r){return function(e,t,r,n){let i="missing revert data",s=null,o=null;if(r){i="execution reverted";const e=(0,m.getBytes)(r);if(r=(0,m.hexlify)(r),0===e.length)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(e.length%32!=4)i+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===(0,m.hexlify)(e.slice(0,4)))try{s=n.decode(["string"],e.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch(e){i+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===(0,m.hexlify)(e.slice(0,4)))try{const t=Number(n.decode(["uint256"],e.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[t]},s=`Panic due to ${y.get(t)||"UNKNOWN"}(${t})`,i+=`: ${s}`}catch(e){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const a={to:t.to?(0,g.getAddress)(t.to):null,data:t.data||"0x"};return t.from&&(a.from=(0,g.getAddress)(t.from)),(0,m.makeError)(i,"CALL_EXCEPTION",{action:e,data:r,reason:s,transaction:a,invocation:null,revert:o})}(e,t,r,A.defaultAbiCoder())}}t.AbiCoder=A},9414(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBytes32String=t.encodeBytes32String=void 0;const n=r(5347);t.encodeBytes32String=function(e){const t=(0,n.toUtf8Bytes)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,n.zeroPadBytes)(t,32)},t.decodeBytes32String=function(e){const t=(0,n.getBytes)(e,"bytes");if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,n.toUtf8String)(t.slice(0,r))}},8869(e,t,r){"use strict";t.Reader=t.Writer=t.Coder=t.checkResultErrors=t.Result=t.WordSize=void 0;const n=r(5347);t.WordSize=32;const i=new Uint8Array(t.WordSize),s=["then"],o={},a=new WeakMap;function c(e){return a.get(e)}function u(e,t){a.set(e,t)}function l(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw r.error=t,r}function d(e,t,r){return e.indexOf(null)>=0?t.map((e,t)=>e instanceof f?d(c(e),e,r):e):e.reduce((e,n,i)=>{let s=t.getValue(n);return n in e||(r&&s instanceof f&&(s=d(c(s),s,r)),e[n]=s),e},{})}class f extends Array{#t;constructor(...e){const t=e[0];let r=e[1],i=(e[2]||[]).slice(),a=!0;t!==o&&(r=e,i=[],a=!1),super(r.length),r.forEach((e,t)=>{this[t]=e});const d=i.reduce((e,t)=>("string"==typeof t&&e.set(t,(e.get(t)||0)+1),e),new Map);if(u(this,Object.freeze(r.map((e,t)=>{const r=i[t];return null!=r&&1===d.get(r)?r:null}))),this.#t=[],null==this.#t&&this.#t,!a)return;Object.freeze(this);const f=new Proxy(this,{get:(e,t,r)=>{if("string"==typeof t){if(t.match(/^[0-9]+$/)){const r=(0,n.getNumber)(t,"%index");if(r<0||r>=this.length)throw new RangeError("out of result range");const i=e[r];return i instanceof Error&&l(`index ${r}`,i),i}if(s.indexOf(t)>=0)return Reflect.get(e,t,r);const i=e[t];if(i instanceof Function)return function(...t){return i.apply(this===r?e:this,t)};if(!(t in e))return e.getValue.apply(this===r?e:this,[t])}return Reflect.get(e,t,r)}});return u(f,c(this)),f}toArray(e){const t=[];return this.forEach((r,n)=>{r instanceof Error&&l(`index ${n}`,r),e&&r instanceof f&&(r=r.toArray(e)),t.push(r)}),t}toObject(e){const t=c(this);return t.reduce((r,i,s)=>((0,n.assert)(null!=i,`value at index ${s} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),d(t,this,e)),{})}slice(e,t){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==t&&(t=this.length),t<0&&(t+=this.length)<0&&(t=0),t>this.length&&(t=this.length);const r=c(this),n=[],i=[];for(let s=e;s<t;s++)n.push(this[s]),i.push(r[s]);return new f(o,n,i)}filter(e,t){const r=c(this),n=[],i=[];for(let s=0;s<this.length;s++){const o=this[s];o instanceof Error&&l(`index ${s}`,o),e.call(t,o,s,this)&&(n.push(o),i.push(r[s]))}return new f(o,n,i)}map(e,t){const r=[];for(let n=0;n<this.length;n++){const i=this[n];i instanceof Error&&l(`index ${n}`,i),r.push(e.call(t,i,n,this))}return r}getValue(e){const t=c(this).indexOf(e);if(-1===t)return;const r=this[t];return r instanceof Error&&l(`property ${JSON.stringify(e)}`,r.error),r}static fromItems(e,t){return new f(o,e,t)}}function h(e){let r=(0,n.toBeArray)(e);return(0,n.assert)(r.length<=t.WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:r,length:t.WordSize,offset:r.length}),r.length!==t.WordSize&&(r=(0,n.getBytesCopy)((0,n.concat)([i.slice(r.length%t.WordSize),r]))),r}t.Result=f,t.checkResultErrors=function(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const s=e.slice();s.push(i);try{r(s,n[i])}catch(e){t.push({path:s,error:e})}}};return r([],e),t},t.Coder=class{name;type;localName;dynamic;constructor(e,t,r,i){(0,n.defineProperties)(this,{name:e,type:t,localName:r,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){(0,n.assertArgument)(!1,e,this.localName,t)}},t.Writer=class{#r;#n;constructor(){this.#r=[],this.#n=0}get data(){return(0,n.concat)(this.#r)}get length(){return this.#n}#i(e){return this.#r.push(e),this.#n+=e.length,e.length}appendWriter(e){return this.#i((0,n.getBytesCopy)(e.data))}writeBytes(e){let r=(0,n.getBytesCopy)(e);const s=r.length%t.WordSize;return s&&(r=(0,n.getBytesCopy)((0,n.concat)([r,i.slice(s)]))),this.#i(r)}writeValue(e){return this.#i(h(e))}writeUpdatableValue(){const e=this.#r.length;return this.#r.push(i),this.#n+=t.WordSize,t=>{this.#r[e]=h(t)}}};class p{allowLoose;#r;#s;#o;#a;#c;constructor(e,t,r){(0,n.defineProperties)(this,{allowLoose:!!t}),this.#r=(0,n.getBytesCopy)(e),this.#o=0,this.#a=null,this.#c=null!=r?r:1024,this.#s=0}get data(){return(0,n.hexlify)(this.#r)}get dataLength(){return this.#r.length}get consumed(){return this.#s}get bytes(){return new Uint8Array(this.#r)}#u(e){if(this.#a)return this.#a.#u(e);this.#o+=e,(0,n.assert)(this.#c<1||this.#o<=this.#c*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#c} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,n.getBytesCopy)(this.#r),offset:this.#s,length:e,info:{bytesRead:this.#o,dataLength:this.dataLength}})}#l(e,r,i){let s=Math.ceil(r/t.WordSize)*t.WordSize;return this.#s+s>this.#r.length&&(this.allowLoose&&i&&this.#s+r<=this.#r.length?s=r:(0,n.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,n.getBytesCopy)(this.#r),length:this.#r.length,offset:this.#s+s})),this.#r.slice(this.#s,this.#s+s)}subReader(e){const t=new p(this.#r.slice(this.#s+e),this.allowLoose,this.#c);return t.#a=this,t}readBytes(e,t){let r=this.#l(0,e,!!t);return this.#u(e),this.#s+=r.length,r.slice(0,e)}readValue(){return(0,n.toBigInt)(this.readBytes(t.WordSize))}readIndex(){return(0,n.toNumber)(this.readBytes(t.WordSize))}}t.Reader=p},1355(e,t,r){"use strict";t.AddressCoder=void 0;const n=r(646),i=r(6508),s=r(9976),o=r(8869);class a extends o.Coder{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let r=s.Typed.dereference(t,"string");try{r=(0,n.getAddress)(r)}catch(e){return this._throwError(e.message,t)}return e.writeValue(r)}decode(e){return(0,n.getAddress)((0,i.toBeHex)(e.readValue(),20))}}t.AddressCoder=a},5754(e,t,r){"use strict";t.AnonymousCoder=void 0;const n=r(8869);class i extends n.Coder{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}t.AnonymousCoder=i},3178(e,t,r){"use strict";t.ArrayCoder=t.unpack=t.pack=void 0;const n=r(5347),i=r(9976),s=r(8869),o=r(5754);function a(e,t,r){let i=[];if(Array.isArray(r))i=r;else if(r&&"object"==typeof r){let e={};i=t.map(t=>{const i=t.localName;return(0,n.assert)(i,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),(0,n.assert)(!e[i],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),e[i]=!0,r[i]})}else(0,n.assertArgument)(!1,"invalid tuple value","tuple",r);(0,n.assertArgument)(t.length===i.length,"types/value length mismatch","tuple",r);let o=new s.Writer,a=new s.Writer,c=[];t.forEach((e,t)=>{let r=i[t];if(e.dynamic){let t=a.length;e.encode(a,r);let n=o.writeUpdatableValue();c.push(e=>{n(e+t)})}else e.encode(o,r)}),c.forEach(e=>{e(o.length)});let u=e.appendWriter(o);return u+=e.appendWriter(a),u}function c(e,t){let r=[],i=[],o=e.subReader(0);return t.forEach(t=>{let s=null;if(t.dynamic){let r=e.readIndex(),i=o.subReader(r);try{s=t.decode(i)}catch(e){if((0,n.isError)(e,"BUFFER_OVERRUN"))throw e;s=e,s.baseType=t.name,s.name=t.localName,s.type=t.type}}else try{s=t.decode(e)}catch(e){if((0,n.isError)(e,"BUFFER_OVERRUN"))throw e;s=e,s.baseType=t.name,s.name=t.localName,s.type=t.type}if(null==s)throw new Error("investigate");r.push(s),i.push(t.localName||null)}),s.Result.fromItems(r,i)}t.pack=a,t.unpack=c;class u extends s.Coder{coder;length;constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),(0,n.defineProperties)(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){const r=i.Typed.dereference(t,"array");Array.isArray(r)||this._throwError("expected array value",r);let s=this.length;-1===s&&(s=r.length,e.writeValue(r.length)),(0,n.assertArgumentCount)(r.length,s,"coder array"+(this.localName?" "+this.localName:""));let o=[];for(let e=0;e<r.length;e++)o.push(this.coder);return a(e,o,r)}decode(e){let t=this.length;-1===t&&(t=e.readIndex(),(0,n.assert)(t*s.WordSize<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*s.WordSize,length:e.dataLength}));let r=[];for(let e=0;e<t;e++)r.push(new o.AnonymousCoder(this.coder));return c(e,r)}}t.ArrayCoder=u},8719(e,t,r){"use strict";t.BooleanCoder=void 0;const n=r(9976),i=r(8869);class s extends i.Coder{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const r=n.Typed.dereference(t,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}t.BooleanCoder=s},2348(e,t,r){"use strict";t.BytesCoder=t.DynamicBytesCoder=void 0;const n=r(5347),i=r(8869);class s extends i.Coder{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,n.getBytesCopy)(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readIndex(),!0)}}t.DynamicBytesCoder=s,t.BytesCoder=class extends s{constructor(e){super("bytes",e)}decode(e){return(0,n.hexlify)(super.decode(e))}}},9095(e,t,r){"use strict";t.FixedBytesCoder=void 0;const n=r(5347),i=r(9976),s=r(8869);class o extends s.Coder{size;constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),(0,n.defineProperties)(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=(0,n.getBytesCopy)(i.Typed.dereference(t,this.type));return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return(0,n.hexlify)(e.readBytes(this.size))}}t.FixedBytesCoder=o},8026(e,t,r){"use strict";t.NullCoder=void 0;const n=r(8869),i=new Uint8Array([]);class s extends n.Coder{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes(i)}decode(e){return e.readBytes(0),null}}t.NullCoder=s},7398(e,t,r){"use strict";t.NumberCoder=void 0;const n=r(5347),i=r(9976),s=r(8869),o=BigInt(0),a=BigInt(1),c=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class u extends s.Coder{size;signed;constructor(e,t,r){const i=(t?"int":"uint")+8*e;super(i,i,r,!1),(0,n.defineProperties)(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let r=(0,n.getBigInt)(i.Typed.dereference(t,this.type)),u=(0,n.mask)(c,8*s.WordSize);if(this.signed){let e=(0,n.mask)(u,8*this.size-1);(r>e||r<-(e+a))&&this._throwError("value out-of-bounds",t),r=(0,n.toTwos)(r,8*s.WordSize)}else(r<o||r>(0,n.mask)(u,8*this.size))&&this._throwError("value out-of-bounds",t);return e.writeValue(r)}decode(e){let t=(0,n.mask)(e.readValue(),8*this.size);return this.signed&&(t=(0,n.fromTwos)(t,8*this.size)),t}}t.NumberCoder=u},8766(e,t,r){"use strict";t.StringCoder=void 0;const n=r(3948),i=r(9976),s=r(2348);class o extends s.DynamicBytesCoder{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,n.toUtf8Bytes)(i.Typed.dereference(t,"string")))}decode(e){return(0,n.toUtf8String)(super.decode(e))}}t.StringCoder=o},1693(e,t,r){"use strict";t.TupleCoder=void 0;const n=r(8166),i=r(9976),s=r(8869),o=r(3178);class a extends s.Coder{coders;constructor(e,t){let r=!1;const i=[];e.forEach(e=>{e.dynamic&&(r=!0),i.push(e.type)}),super("tuple","tuple("+i.join(",")+")",t,r),(0,n.defineProperties)(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(t=>{e.push(t.defaultValue())});const t=this.coders.reduce((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});return this.coders.forEach((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))}),Object.freeze(e)}encode(e,t){const r=i.Typed.dereference(t,"tuple");return(0,o.pack)(e,this.coders,r)}decode(e){return(0,o.unpack)(e,this.coders)}}t.TupleCoder=a},189(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StructFragment=t.FunctionFragment=t.FallbackFragment=t.ConstructorFragment=t.EventFragment=t.ErrorFragment=t.NamedFragment=t.Fragment=t.ParamType=void 0;const n=r(5347),i=r(1181);function s(e){const t=new Set;return e.forEach(e=>t.add(e)),Object.freeze(t)}const o=s("external public payable override".split(" ")),a="constant external internal payable private public pure view override",c=s(a.split(" ")),u="constructor error event fallback function receive struct",l=s(u.split(" ")),d="calldata memory storage payable indexed",f=s(d.split(" ")),h=s([u,d,"tuple returns",a].join(" ").split(" ")),p={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},g=new RegExp("^(\\s*)"),m=new RegExp("^([0-9]+)"),y=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),b=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),w=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class _{#s;#d;get offset(){return this.#s}get length(){return this.#d.length-this.#s}constructor(e){this.#s=0,this.#d=e.slice()}clone(){return new _(this.#d)}reset(){this.#s=0}#f(e=0,t=0){return new _(this.#d.slice(e,t).map(t=>Object.freeze(Object.assign({},t,{match:t.match-e,linkBack:t.linkBack-e,linkNext:t.linkNext-e}))))}popKeyword(e){const t=this.peek();if("KEYWORD"!==t.type||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=this.#f(this.#s+1,e.match+1);return this.#s=e.match+1,t}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=[];for(;this.#s<e.match-1;){const e=this.peek().linkNext;t.push(this.#f(this.#s+1,e)),this.#s=e}return this.#s=e.match+1,t}peek(){if(this.#s>=this.#d.length)throw new Error("out-of-bounds");return this.#d[this.#s]}peekKeyword(e){const t=this.peekType("KEYWORD");return null!=t&&e.has(t)?t:null}peekType(e){if(0===this.length)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#s++,e}toString(){const e=[];for(let t=this.#s;t<this.#d.length;t++){const r=this.#d[t];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}}function v(e){const t=[],r=t=>{const r=o<e.length?JSON.stringify(e[o]):"$EOI";throw new Error(`invalid token ${r} at ${o}: ${t}`)};let i=[],s=[],o=0;for(;o<e.length;){let a=e.substring(o),c=a.match(g);c&&(o+=c[1].length,a=e.substring(o));const u={depth:i.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:o,value:-1};t.push(u);let l=p[a[0]]||"";if(l){if(u.type=l,u.text=a[0],o++,"OPEN_PAREN"===l)i.push(t.length-1),s.push(t.length-1);else if("CLOSE_PAREN"==l)0===i.length&&r("no matching open bracket"),u.match=i.pop(),t[u.match].match=t.length-1,u.depth--,u.linkBack=s.pop(),t[u.linkBack].linkNext=t.length-1;else if("COMMA"===l)u.linkBack=s.pop(),t[u.linkBack].linkNext=t.length-1,s.push(t.length-1);else if("OPEN_BRACKET"===l)u.type="BRACKET";else if("CLOSE_BRACKET"===l){let e=t.pop().text;if(t.length>0&&"NUMBER"===t[t.length-1].type){const r=t.pop().text;e=r+e,t[t.length-1].value=(0,n.getNumber)(r)}if(0===t.length||"BRACKET"!==t[t.length-1].type)throw new Error("missing opening bracket");t[t.length-1].text+=e}}else if(c=a.match(y),c){if(u.text=c[1],o+=u.text.length,h.has(u.text)){u.type="KEYWORD";continue}if(u.text.match(w)){u.type="TYPE";continue}u.type="ID"}else{if(c=a.match(m),!c)throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${o}`);u.text=c[1],u.type="NUMBER",o+=u.text.length}}return new _(t.map(e=>Object.freeze(e)))}function A(e,t){let r=[];for(const n in t.keys())e.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function k(e,t){if(t.peekKeyword(l)){const r=t.pop().text;if(r!==e)throw new Error(`expected ${e}, got ${r}`)}return t.popType("ID")}function P(e,t){const r=new Set;for(;;){const n=e.peekType("KEYWORD");if(null==n||t&&!t.has(n))break;if(e.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function E(e){let t=P(e,c);return A(t,s("constant payable nonpayable".split(" "))),A(t,s("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function x(e,t){return e.popParams().map(e=>M.from(e,t))}function O(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return(0,n.getBigInt)(e.pop().text);throw new Error("invalid gas")}return null}function S(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const T=new RegExp(/^(.*)\[([0-9]*)\]$/);function B(e){const t=e.match(w);if((0,n.assertArgument)(t,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(t[2]){const r=parseInt(t[2]);(0,n.assertArgument)(0!==r&&r<=32,"invalid bytes length","type",e)}else if(t[3]){const r=parseInt(t[3]);(0,n.assertArgument)(0!==r&&r<=256&&r%8==0,"invalid numeric width","type",e)}return e}const R={},N=Symbol.for("_ethers_internal"),C="_ParamTypeInternal",I="_ErrorInternal",F="_EventInternal",U="_ConstructorInternal",j="_FallbackInternal",L="_FunctionInternal",D="_StructInternal";class M{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,r,i,s,o,a,c){if((0,n.assertPrivate)(e,R,"ParamType"),Object.defineProperty(this,N,{value:C}),o&&(o=Object.freeze(o.slice())),"array"===i){if(null==a||null==c)throw new Error("")}else if(null!=a||null!=c)throw new Error("");if("tuple"===i){if(null==o)throw new Error("")}else if(null!=o)throw new Error("");(0,n.defineProperties)(this,{name:t,type:r,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:c})}format(e){if(null==e&&(e="sighash"),"json"===e){const t=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=t,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const r={type:"tuple"===this.baseType?"tuple":this.type,name:t};return"boolean"==typeof this.indexed&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(r)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(t=>t.format(e)).join("full"===e?", ":",")+")":t+=this.type,"sighash"!==e&&(!0===this.indexed&&(t+=" indexed"),"full"===e&&this.name&&(t+=" "+this.name)),t}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(e=>r.arrayChildren.walk(e,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((e,n)=>r.components[n].walk(e,t))}return t(this.type,e)}#h(e,t,r,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,s=t.slice();return s.forEach((t,n)=>{i.#h(e,t,r,e=>{s[n]=e})}),void n(s)}if(this.isTuple()){const i=this.components;let s;if(Array.isArray(t))s=t.slice();else{if(null==t||"object"!=typeof t)throw new Error("invalid tuple value");s=i.map(e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in t))throw new Error(`missing value for component ${e.name}`);return t[e.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");return s.forEach((t,n)=>{i[n].#h(e,t,r,e=>{s[n]=e})}),void n(s)}const i=r(this.type,t);i.then?e.push(async function(){n(await i)}()):n(i)}async walkAsync(e,t){const r=[],n=[e];return this.#h(r,e,t,e=>{n[0]=e}),r.length&&await Promise.all(r),n[0]}static from(e,t){if(M.isParamType(e))return e;if("string"==typeof e)try{return M.from(v(e),t)}catch(t){(0,n.assertArgument)(!1,"invalid param type","obj",e)}else if(e instanceof _){let r="",n="",i=null;P(e,s(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(n="tuple",i=e.popParams().map(e=>M.from(e)),r=`tuple(${i.map(e=>e.format()).join(",")})`):(r=B(e.popType("TYPE")),n=r);let o=null,a=null;for(;e.length&&e.peekType("BRACKET");){const t=e.pop();o=new M(R,"",r,n,null,i,a,o),a=t.value,r+=t.text,n="array",i=null}let c=null;if(P(e,f).has("indexed")){if(!t)throw new Error("");c=!0}const u=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new M(R,u,r,n,c,i,a,o)}const r=e.name;(0,n.assertArgument)(!r||"string"==typeof r&&r.match(b),"invalid name","obj.name",r);let i=e.indexed;null!=i&&((0,n.assertArgument)(t,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let o=e.type,a=o.match(T);if(a){const t=parseInt(a[2]||"-1"),n=M.from({type:a[1],components:e.components});return new M(R,r||"",o,"array",i,null,t,n)}if("tuple"===o||o.startsWith("tuple(")||o.startsWith("(")){const t=null!=e.components?e.components.map(e=>M.from(e)):null;return new M(R,r||"",o,"tuple",i,t,null,null)}return o=B(e.type),new M(R,r||"",o,o,i,null,null,null)}static isParamType(e){return e&&e[N]===C}}t.ParamType=M;class ${type;inputs;constructor(e,t,r){(0,n.assertPrivate)(e,R,"Fragment"),r=Object.freeze(r.slice()),(0,n.defineProperties)(this,{type:t,inputs:r})}static from(e){if("string"==typeof e){try{$.from(JSON.parse(e))}catch(e){}return $.from(v(e))}if(e instanceof _)switch(e.peekKeyword(l)){case"constructor":return z.from(e);case"error":return q.from(e);case"event":return W.from(e);case"fallback":case"receive":return V.from(e);case"function":return K.from(e);case"struct":return J.from(e)}else if("object"==typeof e){switch(e.type){case"constructor":return z.from(e);case"error":return q.from(e);case"event":return W.from(e);case"fallback":case"receive":return V.from(e);case"function":return K.from(e);case"struct":return J.from(e)}(0,n.assert)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,n.assertArgument)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return z.isFragment(e)}static isError(e){return q.isFragment(e)}static isEvent(e){return W.isFragment(e)}static isFunction(e){return K.isFragment(e)}static isStruct(e){return J.isFragment(e)}}t.Fragment=$;class G extends ${name;constructor(e,t,r,i){super(e,t,i),(0,n.assertArgument)("string"==typeof r&&r.match(b),"invalid identifier","name",r),i=Object.freeze(i.slice()),(0,n.defineProperties)(this,{name:r})}}function H(e,t){return"("+t.map(t=>t.format(e)).join("full"===e?", ":",")+")"}t.NamedFragment=G;class q extends G{constructor(e,t,r){super(e,"error",t,r),Object.defineProperty(this,N,{value:I})}get selector(){return(0,i.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("error"),t.push(this.name+H(e,this.inputs)),t.join(" ")}static from(e){if(q.isFragment(e))return e;if("string"==typeof e)return q.from(v(e));if(e instanceof _){const t=k("error",e),r=x(e);return S(e),new q(R,t,r)}return new q(R,e.name,e.inputs?e.inputs.map(M.from):[])}static isFragment(e){return e&&e[N]===I}}t.ErrorFragment=q;class W extends G{anonymous;constructor(e,t,r,i){super(e,"event",t,r),Object.defineProperty(this,N,{value:F}),(0,n.defineProperties)(this,{anonymous:i})}get topicHash(){return(0,i.id)(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("event"),t.push(this.name+H(e,this.inputs)),"sighash"!==e&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map(e=>M.from(e)),new W(R,e,t,!1).topicHash}static from(e){if(W.isFragment(e))return e;if("string"==typeof e)try{return W.from(v(e))}catch(t){(0,n.assertArgument)(!1,"invalid event fragment","obj",e)}else if(e instanceof _){const t=k("event",e),r=x(e,!0),n=!!P(e,s(["anonymous"])).has("anonymous");return S(e),new W(R,t,r,n)}return new W(R,e.name,e.inputs?e.inputs.map(e=>M.from(e,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[N]===F}}t.EventFragment=W;class z extends ${payable;gas;constructor(e,t,r,i,s){super(e,t,r),Object.defineProperty(this,N,{value:U}),(0,n.defineProperties)(this,{payable:i,gas:s})}format(e){if((0,n.assert)(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[`constructor${H(e,this.inputs)}`];return this.payable&&t.push("payable"),null!=this.gas&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(z.isFragment(e))return e;if("string"==typeof e)try{return z.from(v(e))}catch(t){(0,n.assertArgument)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof _){P(e,s(["constructor"]));const t=x(e),r=!!P(e,o).has("payable"),n=O(e);return S(e),new z(R,"constructor",t,r,n)}return new z(R,"constructor",e.inputs?e.inputs.map(M.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[N]===U}}t.ConstructorFragment=z;class V extends ${payable;constructor(e,t,r){super(e,"fallback",t),Object.defineProperty(this,N,{value:j}),(0,n.defineProperties)(this,{payable:r})}format(e){const t=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:e})}return`${t}()${this.payable?" payable":""}`}static from(e){if(V.isFragment(e))return e;if("string"==typeof e)try{return V.from(v(e))}catch(t){(0,n.assertArgument)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof _){const t=e.toString(),r=e.peekKeyword(s(["fallback","receive"]));if((0,n.assertArgument)(r,"type must be fallback or receive","obj",t),"receive"===e.popKeyword(s(["fallback","receive"]))){const t=x(e);return(0,n.assertArgument)(0===t.length,"receive cannot have arguments","obj.inputs",t),P(e,s(["payable"])),S(e),new V(R,[],!0)}let i=x(e);i.length?(0,n.assertArgument)(1===i.length&&"bytes"===i[0].type,"invalid fallback inputs","obj.inputs",i.map(e=>e.format("minimal")).join(", ")):i=[M.from("bytes")];const o=E(e);if((0,n.assertArgument)("nonpayable"===o||"payable"===o,"fallback cannot be constants","obj.stateMutability",o),P(e,s(["returns"])).has("returns")){const t=x(e);(0,n.assertArgument)(1===t.length&&"bytes"===t[0].type,"invalid fallback outputs","obj.outputs",t.map(e=>e.format("minimal")).join(", "))}return S(e),new V(R,i,"payable"===o)}if("receive"===e.type)return new V(R,[],!0);if("fallback"===e.type){const t=[M.from("bytes")],r="payable"===e.stateMutability;return new V(R,t,r)}(0,n.assertArgument)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[N]===j}}t.FallbackFragment=V;class K extends G{constant;outputs;stateMutability;payable;gas;constructor(e,t,r,i,s,o){super(e,"function",t,i),Object.defineProperty(this,N,{value:L}),s=Object.freeze(s.slice());const a="view"===r||"pure"===r,c="payable"===r;(0,n.defineProperties)(this,{constant:a,gas:o,outputs:s,payable:c,stateMutability:r})}get selector(){return(0,i.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e))),outputs:this.outputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("function"),t.push(this.name+H(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(H(e,this.outputs))),null!=this.gas&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map(e=>M.from(e)),new K(R,e,"view",t,[],null).selector}static from(e){if(K.isFragment(e))return e;if("string"==typeof e)try{return K.from(v(e))}catch(t){(0,n.assertArgument)(!1,"invalid function fragment","obj",e)}else if(e instanceof _){const t=k("function",e),r=x(e),n=E(e);let i=[];P(e,s(["returns"])).has("returns")&&(i=x(e));const o=O(e);return S(e),new K(R,t,n,r,i,o)}let t=e.stateMutability;return null==t&&(t="payable","boolean"==typeof e.constant?(t="view",e.constant||(t="payable","boolean"!=typeof e.payable||e.payable||(t="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(t="nonpayable")),new K(R,e.name,t,e.inputs?e.inputs.map(M.from):[],e.outputs?e.outputs.map(M.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[N]===L}}t.FunctionFragment=K;class J extends G{constructor(e,t,r){super(e,"struct",t,r),Object.defineProperty(this,N,{value:D})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return J.from(v(e))}catch(t){(0,n.assertArgument)(!1,"invalid struct fragment","obj",e)}else if(e instanceof _){const t=k("struct",e),r=x(e);return S(e),new J(R,t,r)}return new J(R,e.name,e.inputs?e.inputs.map(M.from):[])}static isFragment(e){return e&&e[N]===D}}t.StructFragment=J},8456(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Typed=t.Result=t.TransactionDescription=t.LogDescription=t.ErrorDescription=t.Interface=t.Indexed=t.checkResultErrors=t.StructFragment=t.ParamType=t.NamedFragment=t.FunctionFragment=t.Fragment=t.FallbackFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.encodeBytes32String=t.decodeBytes32String=t.AbiCoder=void 0;var n=r(954);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return n.AbiCoder}});var i=r(9414);Object.defineProperty(t,"decodeBytes32String",{enumerable:!0,get:function(){return i.decodeBytes32String}}),Object.defineProperty(t,"encodeBytes32String",{enumerable:!0,get:function(){return i.encodeBytes32String}});var s=r(189);Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(t,"FallbackFragment",{enumerable:!0,get:function(){return s.FallbackFragment}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(t,"NamedFragment",{enumerable:!0,get:function(){return s.NamedFragment}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(t,"StructFragment",{enumerable:!0,get:function(){return s.StructFragment}});var o=r(5863);Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return o.checkResultErrors}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return o.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return o.Interface}}),Object.defineProperty(t,"ErrorDescription",{enumerable:!0,get:function(){return o.ErrorDescription}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return o.LogDescription}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return o.TransactionDescription}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return o.Result}});var a=r(9976);Object.defineProperty(t,"Typed",{enumerable:!0,get:function(){return a.Typed}})},5863(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Interface=t.Indexed=t.ErrorDescription=t.TransactionDescription=t.LogDescription=t.Result=t.checkResultErrors=void 0;const n=r(2291),i=r(1181),s=r(5347),o=r(954),a=r(8869);Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return a.checkResultErrors}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return a.Result}});const c=r(189),u=r(9976);class l{fragment;name;signature;topic;args;constructor(e,t,r){const n=e.name,i=e.format();(0,s.defineProperties)(this,{fragment:e,name:n,signature:i,topic:t,args:r})}}t.LogDescription=l;class d{fragment;name;args;signature;selector;value;constructor(e,t,r,n){const i=e.name,o=e.format();(0,s.defineProperties)(this,{fragment:e,name:i,args:r,signature:o,selector:t,value:n})}}t.TransactionDescription=d;class f{fragment;name;args;signature;selector;constructor(e,t,r){const n=e.name,i=e.format();(0,s.defineProperties)(this,{fragment:e,name:n,args:r,signature:i,selector:t})}}t.ErrorDescription=f;class h{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){(0,s.defineProperties)(this,{hash:e,_isIndexed:!0})}}t.Indexed=h;const p={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},g={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&p[e.toString()]&&(t=p[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};class m{fragments;deploy;fallback;receive;#p;#g;#m;#y;constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,this.#m=new Map,this.#p=new Map,this.#g=new Map;const r=[];for(const e of t)try{r.push(c.Fragment.from(e))}catch(t){console.log(`[Warning] Invalid Fragment ${JSON.stringify(e)}:`,t.message)}(0,s.defineProperties)(this,{fragments:Object.freeze(r)});let n=null,i=!1;this.#y=this.getAbiCoder(),this.fragments.forEach((e,t)=>{let r;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void(0,s.defineProperties)(this,{deploy:e});case"fallback":return void(0===e.inputs.length?i=!0:((0,s.assertArgument)(!n||e.payable!==n.payable,"conflicting fallback fragments",`fragments[${t}]`,e),n=e,i=n.payable));case"function":r=this.#m;break;case"event":r=this.#g;break;case"error":r=this.#p;break;default:return}const o=e.format();r.has(o)||r.set(o,e)}),this.deploy||(0,s.defineProperties)(this,{deploy:c.ConstructorFragment.from("constructor()")}),(0,s.defineProperties)(this,{fallback:n,receive:i})}format(e){const t=e?"minimal":"full";return this.fragments.map(e=>e.format(t))}formatJson(){const e=this.fragments.map(e=>e.format("json"));return JSON.stringify(e.map(e=>JSON.parse(e)))}getAbiCoder(){return o.AbiCoder.defaultAbiCoder()}#b(e,t,r){if((0,s.isHexString)(e)){const t=e.toLowerCase();for(const e of this.#m.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#m)t.split("(")[0]===e&&n.push(r);if(t){const e=t.length>0?t[t.length-1]:null;let r=t.length,i=!0;u.Typed.isTyped(e)&&"overrides"===e.type&&(i=!1,r--);for(let e=n.length-1;e>=0;e--){const t=n[e].inputs.length;t===r||i&&t===r-1||n.splice(e,1)}for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let i=0;i<t.length;i++)if(u.Typed.isTyped(t[i])){if(i>=r.length){if("overrides"===t[i].type)continue;n.splice(e,1);break}if(t[i].type!==r[i].baseType){n.splice(e,1);break}}}}if(1===n.length&&t&&t.length!==n[0].inputs.length){const e=t[t.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&n.splice(0,1)}if(0===n.length)return null;if(n.length>1&&r){const t=n.map(e=>JSON.stringify(e.format())).join(", ");(0,s.assertArgument)(!1,`ambiguous function description (i.e. matches ${t})`,"key",e)}return n[0]}return this.#m.get(c.FunctionFragment.from(e).format())||null}getFunctionName(e){const t=this.#b(e,null,!1);return(0,s.assertArgument)(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#b(e,null,!1)}getFunction(e,t){return this.#b(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#m.keys());t.sort((e,t)=>e.localeCompare(t));for(let r=0;r<t.length;r++){const n=t[r];e(this.#m.get(n),r)}}#w(e,t,r){if((0,s.isHexString)(e)){const t=e.toLowerCase();for(const e of this.#g.values())if(t===e.topicHash)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#g)t.split("(")[0]===e&&n.push(r);if(t){for(let e=n.length-1;e>=0;e--)n[e].inputs.length<t.length&&n.splice(e,1);for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let i=0;i<t.length;i++)if(u.Typed.isTyped(t[i])&&t[i].type!==r[i].baseType){n.splice(e,1);break}}}if(0===n.length)return null;if(n.length>1&&r){const t=n.map(e=>JSON.stringify(e.format())).join(", ");(0,s.assertArgument)(!1,`ambiguous event description (i.e. matches ${t})`,"key",e)}return n[0]}return this.#g.get(c.EventFragment.from(e).format())||null}getEventName(e){const t=this.#w(e,null,!1);return(0,s.assertArgument)(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#w(e,null,!1)}getEvent(e,t){return this.#w(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#g.keys());t.sort((e,t)=>e.localeCompare(t));for(let r=0;r<t.length;r++){const n=t[r];e(this.#g.get(n),r)}}getError(e,t){if((0,s.isHexString)(e)){const t=e.toLowerCase();if(g[t])return c.ErrorFragment.from(g[t].signature);for(const e of this.#p.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const t=[];for(const[r,n]of this.#p)r.split("(")[0]===e&&t.push(n);if(0===t.length)return"Error"===e?c.ErrorFragment.from("error Error(string)"):"Panic"===e?c.ErrorFragment.from("error Panic(uint256)"):null;if(t.length>1){const r=t.map(e=>JSON.stringify(e.format())).join(", ");(0,s.assertArgument)(!1,`ambiguous error description (i.e. ${r})`,"name",e)}return t[0]}if("Error(string)"===(e=c.ErrorFragment.from(e).format()))return c.ErrorFragment.from("error Error(string)");if("Panic(uint256)"===e)return c.ErrorFragment.from("error Panic(uint256)");return this.#p.get(e)||null}forEachError(e){const t=Array.from(this.#p.keys());t.sort((e,t)=>e.localeCompare(t));for(let r=0;r<t.length;r++){const n=t[r];e(this.#p.get(n),r)}}_decodeParams(e,t){return this.#y.decode(e,t)}_encodeParams(e,t){return this.#y.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);(0,s.assertArgument)(t,"unknown error","fragment",e),e=t}return(0,s.assertArgument)((0,s.dataSlice)(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,s.dataSlice)(t,4))}encodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);(0,s.assertArgument)(t,"unknown error","fragment",e),e=t}return(0,s.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);(0,s.assertArgument)(t,"unknown function","fragment",e),e=t}return(0,s.assertArgument)((0,s.dataSlice)(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,s.dataSlice)(t,4))}encodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);(0,s.assertArgument)(t,"unknown function","fragment",e),e=t}return(0,s.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);(0,s.assertArgument)(t,"unknown function","fragment",e),e=t}let r="invalid length for result data";const n=(0,s.getBytesCopy)(t);if(n.length%32==0)try{return this.#y.decode(e.outputs,n)}catch(e){r="could not decode result data"}(0,s.assert)(!1,r,"BAD_DATA",{value:(0,s.hexlify)(n),info:{method:e.name,signature:e.format()}})}makeError(e,t){const r=(0,s.getBytes)(e,"data"),n=o.AbiCoder.getBuiltinCallException("call",t,r);if(n.message.startsWith("execution reverted (unknown custom error)")){const e=(0,s.hexlify)(r.slice(0,4)),t=this.getError(e);if(t)try{const e=this.#y.decode(t.inputs,r.slice(4));n.revert={name:t.name,signature:t.format(),args:e},n.reason=n.revert.signature,n.message=`execution reverted: ${n.reason}`}catch(e){n.message="execution reverted (coult not decode custom error)"}}const i=this.parseTransaction(t);return i&&(n.invocation={method:i.name,signature:i.signature,args:i.args}),n}encodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);(0,s.assertArgument)(t,"unknown function","fragment",e),e=t}return(0,s.hexlify)(this.#y.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if("string"==typeof e){const t=this.getEvent(e);(0,s.assertArgument)(t,"unknown event","eventFragment",e),e=t}(0,s.assert)(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const o=(e,t)=>"string"===e.type?(0,i.id)(t):"bytes"===e.type?(0,n.keccak256)((0,s.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t?t=t?"0x01":"0x00":e.type.match(/^u?int/)?t=(0,s.toBeHex)(t):e.type.match(/^bytes/)?t=(0,s.zeroPadBytes)(t,32):"address"===e.type&&this.#y.encode(["address"],[t]),(0,s.zeroPadValue)((0,s.hexlify)(t),32));for(t.forEach((t,n)=>{const i=e.inputs[n];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?(0,s.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map(e=>o(i,e))):r.push(o(i,t)):(0,s.assertArgument)(null==t,"cannot filter non-indexed parameters; must be null","contract."+i.name,t)});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){if("string"==typeof e){const t=this.getEvent(e);(0,s.assertArgument)(t,"unknown event","eventFragment",e),e=t}const r=[],o=[],a=[];return e.anonymous||r.push(e.topicHash),(0,s.assertArgument)(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((e,s)=>{const c=t[s];if(e.indexed)if("string"===e.type)r.push((0,i.id)(c));else if("bytes"===e.type)r.push((0,n.keccak256)(c));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this.#y.encode([e.type],[c]))}else o.push(e),a.push(c)}),{data:this.#y.encode(o,a),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e){const t=this.getEvent(e);(0,s.assertArgument)(t,"unknown event","eventFragment",e),e=t}if(null!=r&&!e.anonymous){const t=e.topicHash;(0,s.assertArgument)((0,s.isHexString)(r[0],32)&&r[0].toLowerCase()===t,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const n=[],i=[],o=[];e.inputs.forEach((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(c.ParamType.from({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))});const u=null!=r?this.#y.decode(n,(0,s.concat)(r)):null,l=this.#y.decode(i,t,!0),d=[],f=[];let p=0,g=0;return e.inputs.forEach((e,t)=>{let r=null;if(e.indexed)if(null==u)r=new h(null);else if(o[t])r=new h(u[g++]);else try{r=u[g++]}catch(e){r=e}else try{r=l[p++]}catch(e){r=e}d.push(r),f.push(e.name||null)}),a.Result.fromItems(d,f)}parseTransaction(e){const t=(0,s.getBytes)(e.data,"tx.data"),r=(0,s.getBigInt)(null!=e.value?e.value:0,"tx.value"),n=this.getFunction((0,s.hexlify)(t.slice(0,4)));if(!n)return null;const i=this.#y.decode(n.inputs,t.slice(4));return new d(n,n.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new l(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=(0,s.hexlify)(e),r=this.getError((0,s.dataSlice)(t,0,4));if(!r)return null;const n=this.#y.decode(r.inputs,(0,s.dataSlice)(t,4));return new f(r,r.selector,n)}static from(e){return e instanceof m?e:"string"==typeof e?new m(JSON.parse(e)):"function"==typeof e.formatJson?new m(e.formatJson()):"function"==typeof e.format?new m(e.format("json")):new m(e)}}t.Interface=m},9976(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Typed=void 0;const n=r(5347),i={};function s(e,t){let r=!1;return t<0&&(r=!0,t*=-1),new c(i,`${r?"":"u"}int${t}`,e,{signed:r,width:t})}function o(e,t){return new c(i,`bytes${t||""}`,e,{size:t})}const a=Symbol.for("_ethers_typed");class c{type;value;#_;_typedSymbol;constructor(e,t,r,s){null==s&&(s=null),(0,n.assertPrivate)(i,e,"Typed"),(0,n.defineProperties)(this,{_typedSymbol:a,type:t,value:r}),this.#_=s,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#_}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#_?-1:!1===this.#_?this.value.length:null}static from(e,t){return new c(i,e,t)}static uint8(e){return s(e,8)}static uint16(e){return s(e,16)}static uint24(e){return s(e,24)}static uint32(e){return s(e,32)}static uint40(e){return s(e,40)}static uint48(e){return s(e,48)}static uint56(e){return s(e,56)}static uint64(e){return s(e,64)}static uint72(e){return s(e,72)}static uint80(e){return s(e,80)}static uint88(e){return s(e,88)}static uint96(e){return s(e,96)}static uint104(e){return s(e,104)}static uint112(e){return s(e,112)}static uint120(e){return s(e,120)}static uint128(e){return s(e,128)}static uint136(e){return s(e,136)}static uint144(e){return s(e,144)}static uint152(e){return s(e,152)}static uint160(e){return s(e,160)}static uint168(e){return s(e,168)}static uint176(e){return s(e,176)}static uint184(e){return s(e,184)}static uint192(e){return s(e,192)}static uint200(e){return s(e,200)}static uint208(e){return s(e,208)}static uint216(e){return s(e,216)}static uint224(e){return s(e,224)}static uint232(e){return s(e,232)}static uint240(e){return s(e,240)}static uint248(e){return s(e,248)}static uint256(e){return s(e,256)}static uint(e){return s(e,256)}static int8(e){return s(e,-8)}static int16(e){return s(e,-16)}static int24(e){return s(e,-24)}static int32(e){return s(e,-32)}static int40(e){return s(e,-40)}static int48(e){return s(e,-48)}static int56(e){return s(e,-56)}static int64(e){return s(e,-64)}static int72(e){return s(e,-72)}static int80(e){return s(e,-80)}static int88(e){return s(e,-88)}static int96(e){return s(e,-96)}static int104(e){return s(e,-104)}static int112(e){return s(e,-112)}static int120(e){return s(e,-120)}static int128(e){return s(e,-128)}static int136(e){return s(e,-136)}static int144(e){return s(e,-144)}static int152(e){return s(e,-152)}static int160(e){return s(e,-160)}static int168(e){return s(e,-168)}static int176(e){return s(e,-176)}static int184(e){return s(e,-184)}static int192(e){return s(e,-192)}static int200(e){return s(e,-200)}static int208(e){return s(e,-208)}static int216(e){return s(e,-216)}static int224(e){return s(e,-224)}static int232(e){return s(e,-232)}static int240(e){return s(e,-240)}static int248(e){return s(e,-248)}static int256(e){return s(e,-256)}static int(e){return s(e,-256)}static bytes1(e){return o(e,1)}static bytes2(e){return o(e,2)}static bytes3(e){return o(e,3)}static bytes4(e){return o(e,4)}static bytes5(e){return o(e,5)}static bytes6(e){return o(e,6)}static bytes7(e){return o(e,7)}static bytes8(e){return o(e,8)}static bytes9(e){return o(e,9)}static bytes10(e){return o(e,10)}static bytes11(e){return o(e,11)}static bytes12(e){return o(e,12)}static bytes13(e){return o(e,13)}static bytes14(e){return o(e,14)}static bytes15(e){return o(e,15)}static bytes16(e){return o(e,16)}static bytes17(e){return o(e,17)}static bytes18(e){return o(e,18)}static bytes19(e){return o(e,19)}static bytes20(e){return o(e,20)}static bytes21(e){return o(e,21)}static bytes22(e){return o(e,22)}static bytes23(e){return o(e,23)}static bytes24(e){return o(e,24)}static bytes25(e){return o(e,25)}static bytes26(e){return o(e,26)}static bytes27(e){return o(e,27)}static bytes28(e){return o(e,28)}static bytes29(e){return o(e,29)}static bytes30(e){return o(e,30)}static bytes31(e){return o(e,31)}static bytes32(e){return o(e,32)}static address(e){return new c(i,"address",e)}static bool(e){return new c(i,"bool",!!e)}static bytes(e){return new c(i,"bytes",e)}static string(e){return new c(i,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new c(i,"overrides",Object.assign({},e))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===a}static dereference(e,t){if(c.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}t.Typed=c},7262(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIcapAddress=t.getAddress=void 0;const n=r(2291),i=r(5347),s=BigInt(0),o=BigInt(36);function a(e){const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const s=(0,i.getBytes)((0,n.keccak256)(r));for(let e=0;e<40;e+=2)s[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&s[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const c={};for(let e=0;e<10;e++)c[String(e)]=String(e);for(let e=0;e<26;e++)c[String.fromCharCode(65+e)]=String(10+e);function u(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>c[e]).join("");for(;t.length>=15;){let e=t.substring(0,15);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}const l=function(){const e={};for(let t=0;t<36;t++)e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t);return e}();function d(e){if((0,i.assertArgument)("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=a(e);return(0,i.assertArgument)(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,i.assertArgument)(e.substring(2,4)===u(e),"bad icap checksum","address",e);let t=function(e){e=e.toLowerCase();let t=s;for(let r=0;r<e.length;r++)t=t*o+l[e[r]];return t}(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return a("0x"+t)}(0,i.assertArgument)(!1,"invalid address","address",e)}t.getAddress=d,t.getIcapAddress=function(e){let t=BigInt(d(e)).toString(36).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+u("XE00"+t)+t}},5107(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveAddress=t.isAddress=t.isAddressable=void 0;const n=r(5347),i=r(7262);function s(e){return e&&"function"==typeof e.getAddress}async function o(e,t){const r=await t;return null!=r&&"0x0000000000000000000000000000000000000000"!==r||((0,n.assert)("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),(0,n.assertArgument)(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),(0,i.getAddress)(r)}t.isAddressable=s,t.isAddress=function(e){try{return(0,i.getAddress)(e),!0}catch(e){}return!1},t.resolveAddress=function(e,t){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?(0,i.getAddress)(e):((0,n.assert)(null!=t,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),o(e,t.resolveName(e))):s(e)?o(e,e.getAddress()):e&&"function"==typeof e.then?o(e,e):void(0,n.assertArgument)(!1,"unsupported addressable value","target",e)}},1891(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCreate2Address=t.getCreateAddress=void 0;const n=r(2291),i=r(5347),s=r(7262);t.getCreateAddress=function(e){const t=(0,s.getAddress)(e.from);let r=(0,i.getBigInt)(e.nonce,"tx.nonce").toString(16);return r="0"===r?"0x":r.length%2?"0x0"+r:"0x"+r,(0,s.getAddress)((0,i.dataSlice)((0,n.keccak256)((0,i.encodeRlp)([t,r])),12))},t.getCreate2Address=function(e,t,r){const o=(0,s.getAddress)(e),a=(0,i.getBytes)(t,"salt"),c=(0,i.getBytes)(r,"initCodeHash");return(0,i.assertArgument)(32===a.length,"salt must be 32 bytes","salt",t),(0,i.assertArgument)(32===c.length,"initCodeHash must be 32 bytes","initCodeHash",r),(0,s.getAddress)((0,i.dataSlice)((0,n.keccak256)((0,i.concat)(["0xff",o,a,c])),12))}},646(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveAddress=t.isAddress=t.isAddressable=t.getCreate2Address=t.getCreateAddress=t.getIcapAddress=t.getAddress=void 0;var n=r(7262);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return n.getAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return n.getIcapAddress}});var i=r(1891);Object.defineProperty(t,"getCreateAddress",{enumerable:!0,get:function(){return i.getCreateAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return i.getCreate2Address}});var s=r(5107);Object.defineProperty(t,"isAddressable",{enumerable:!0,get:function(){return s.isAddressable}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}}),Object.defineProperty(t,"resolveAddress",{enumerable:!0,get:function(){return s.resolveAddress}})},5239(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZeroAddress=void 0,t.ZeroAddress="0x0000000000000000000000000000000000000000"},5255(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZeroHash=void 0,t.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"},1295(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagePrefix=t.EtherSymbol=t.MaxInt256=t.MinInt256=t.MaxUint256=t.WeiPerEther=t.N=t.ZeroHash=t.ZeroAddress=void 0;var n=r(5239);Object.defineProperty(t,"ZeroAddress",{enumerable:!0,get:function(){return n.ZeroAddress}});var i=r(5255);Object.defineProperty(t,"ZeroHash",{enumerable:!0,get:function(){return i.ZeroHash}});var s=r(9197);Object.defineProperty(t,"N",{enumerable:!0,get:function(){return s.N}}),Object.defineProperty(t,"WeiPerEther",{enumerable:!0,get:function(){return s.WeiPerEther}}),Object.defineProperty(t,"MaxUint256",{enumerable:!0,get:function(){return s.MaxUint256}}),Object.defineProperty(t,"MinInt256",{enumerable:!0,get:function(){return s.MinInt256}}),Object.defineProperty(t,"MaxInt256",{enumerable:!0,get:function(){return s.MaxInt256}});var o=r(6245);Object.defineProperty(t,"EtherSymbol",{enumerable:!0,get:function(){return o.EtherSymbol}}),Object.defineProperty(t,"MessagePrefix",{enumerable:!0,get:function(){return o.MessagePrefix}})},9197(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MaxInt256=t.MinInt256=t.MaxUint256=t.WeiPerEther=t.N=void 0,t.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),t.WeiPerEther=BigInt("1000000000000000000"),t.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),t.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1),t.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},6245(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagePrefix=t.EtherSymbol=void 0,t.EtherSymbol="Ξ",t.MessagePrefix="Ethereum Signed Message:\n"},1008(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=t.BaseContract=t.resolveArgs=t.copyOverrides=void 0;const n=r(8456),i=r(646),s=r(3807),o=r(5347),a=r(6526),c=BigInt(0);function u(e){return e&&"function"==typeof e.call}function l(e){return e&&"function"==typeof e.estimateGas}function d(e){return e&&"function"==typeof e.resolveName}function f(e){return e&&"function"==typeof e.sendTransaction}function h(e){if(null!=e){if(d(e))return e;if(e.provider)return e.provider}}class p{#v;fragment;constructor(e,t,r){if((0,o.defineProperties)(this,{fragment:t}),t.inputs.length<r.length)throw new Error("too many arguments");const n=g(e.runner,"resolveName"),s=d(n)?n:null;this.#v=async function(){const n=await Promise.all(t.inputs.map((e,t)=>null==r[t]?null:e.walkAsync(r[t],(e,t)=>"address"===e?Array.isArray(t)?Promise.all(t.map(e=>(0,i.resolveAddress)(e,s))):(0,i.resolveAddress)(t,s):t)));return e.interface.encodeFilterTopics(t,n)}()}getTopicFilter(){return this.#v}}function g(e,t){return null==e?null:"function"==typeof e[t]?e:e.provider&&"function"==typeof e.provider[t]?e.provider:null}function m(e){return null==e?null:e.provider||null}async function y(e,t){const r=n.Typed.dereference(e,"overrides");(0,o.assertArgument)("object"==typeof r,"invalid overrides parameter","overrides",e);const i=(0,s.copyRequest)(r);return(0,o.assertArgument)(null==i.to||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",i.to),(0,o.assertArgument)(null==i.data||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",i.data),i.from&&(i.from=i.from),i}async function b(e,t,r){const s=g(e,"resolveName"),o=d(s)?s:null;return await Promise.all(t.map((e,t)=>e.walkAsync(r[t],(e,t)=>(t=n.Typed.dereference(t,e),"address"===e?(0,i.resolveAddress)(t,o):t))))}function w(e){const t=async function(t){const r=await y(t,["data"]);r.to=await e.getAddress(),r.from&&(r.from=await(0,i.resolveAddress)(r.from,h(e.runner)));const n=e.interface,s=(0,o.getBigInt)(r.value||c,"overrides.value")===c,a="0x"===(r.data||"0x");!n.fallback||n.fallback.payable||!n.receive||a||s||(0,o.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",t),(0,o.assertArgument)(n.fallback||a,"cannot send data to receive-only contract","overrides.data",r.data);const u=n.receive||n.fallback&&n.fallback.payable;return(0,o.assertArgument)(u||s,"cannot send value to non-payable fallback","overrides.value",r.value),(0,o.assertArgument)(n.fallback||a,"cannot send data to receive-only contract","overrides.data",r.data),r},r=async function(r){const n=e.runner;(0,o.assert)(f(n),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const i=await n.sendTransaction(await t(r)),s=m(e.runner);return new a.ContractTransactionResponse(e.interface,s,i)},n=async e=>await r(e);return(0,o.defineProperties)(n,{_contract:e,estimateGas:async function(r){const n=g(e.runner,"estimateGas");return(0,o.assert)(l(n),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await n.estimateGas(await t(r))},populateTransaction:t,send:r,staticCall:async function(r){const n=g(e.runner,"call");(0,o.assert)(u(n),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const i=await t(r);try{return await n.call(i)}catch(t){if((0,o.isCallException)(t)&&t.data)throw e.interface.makeError(t.data,i);throw t}}}),n}t.copyOverrides=y,t.resolveArgs=b;const _=Symbol.for("_ethersInternal_contract"),v=new WeakMap;function A(e){return v.get(e[_])}async function k(e,t){let r,n=null;if(Array.isArray(t)){const n=function(t){if((0,o.isHexString)(t,32))return t;const r=e.interface.getEvent(t);return(0,o.assertArgument)(r,"unknown fragment","name",t),r.topicHash};r=t.map(e=>null==e?null:Array.isArray(e)?e.map(n):n(e))}else"*"===t?r=[null]:"string"==typeof t?(0,o.isHexString)(t,32)?r=[t]:(n=e.interface.getEvent(t),(0,o.assertArgument)(n,"unknown fragment","event",t),r=[n.topicHash]):(i=t)&&"object"==typeof i&&"getTopicFilter"in i&&"function"==typeof i.getTopicFilter&&i.fragment?r=await t.getTopicFilter():"fragment"in t?(n=t.fragment,r=[n.topicHash]):(0,o.assertArgument)(!1,"unknown event name","event",t);var i;return r=r.map(e=>{if(null==e)return null;if(Array.isArray(e)){const t=Array.from(new Set(e.map(e=>e.toLowerCase())).values());return 1===t.length?t[0]:(t.sort(),t)}return e.toLowerCase()}),{fragment:n,tag:r.map(e=>null==e?"null":Array.isArray(e)?e.join("|"):e).join("&"),topics:r}}async function P(e,t){const{subs:r}=A(e);return r.get((await k(e,t)).tag)||null}async function E(e,t,r){const n=m(e.runner);(0,o.assert)(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:i,tag:s,topics:c}=await k(e,r),{addr:u,subs:l}=A(e);let d=l.get(s);if(!d){const t={address:u||e,topics:c},o=t=>{let n=i;if(null==n)try{n=e.interface.getEvent(t.topics[0])}catch(e){}if(n){const s=n,o=i?e.interface.decodeEventLog(i,t.data,t.topics):[];O(e,r,o,n=>new a.ContractEventPayload(e,n,r,s,t))}else O(e,r,[],n=>new a.ContractUnknownEventPayload(e,n,r,t))};let f=[];d={tag:s,listeners:[],start:()=>{f.length||f.push(n.on(t,o))},stop:async()=>{if(0==f.length)return;let e=f;f=[],await Promise.all(e),n.off(t,o)}},l.set(s,d)}return d}let x=Promise.resolve();async function O(e,t,r,n){try{await x}catch(e){}const i=async function(e,t,r,n){await x;const i=await P(e,t);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:t,once:i})=>{const s=Array.from(r);n&&s.push(n(i?null:t));try{t.call(e,...s)}catch(e){}return!i}),0===i.listeners.length&&(i.stop(),A(e).subs.delete(i.tag)),s>0}(e,t,r,n);return x=i,await i}const S=["then"];class T{target;interface;runner;filters;[_];fallback;constructor(e,t,r,s){(0,o.assertArgument)("string"==typeof e||(0,i.isAddressable)(e),"invalid value for Contract target","target",e),null==r&&(r=null);const c=n.Interface.from(t);let u;(0,o.defineProperties)(this,{target:e,runner:r,interface:c}),Object.defineProperty(this,_,{value:{}});let l=null,f=null;if(s){const e=m(r);f=new a.ContractTransactionResponse(this.interface,e,s)}let h=new Map;if("string"==typeof e)if((0,o.isHexString)(e))l=e,u=Promise.resolve(e);else{const t=g(r,"resolveName");if(!d(t))throw(0,o.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});u=t.resolveName(e).then(t=>{if(null==t)throw(0,o.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return A(this).addr=t,t})}else u=e.getAddress().then(e=>{if(null==e)throw new Error("TODO");return A(this).addr=e,e});var p;p={addrPromise:u,addr:l,deployTx:f,subs:h},v.set(this[_],p);const y=new Proxy({},{get:(e,t,r)=>{if("symbol"==typeof t||S.indexOf(t)>=0)return Reflect.get(e,t,r);try{return this.getEvent(t)}catch(e){if(!(0,o.isError)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>S.indexOf(t)>=0?Reflect.has(e,t):Reflect.has(e,t)||this.interface.hasEvent(String(t))});return(0,o.defineProperties)(this,{filters:y}),(0,o.defineProperties)(this,{fallback:c.receive||c.fallback?w(this):null}),new Proxy(this,{get:(e,t,r)=>{if("symbol"==typeof t||t in e||S.indexOf(t)>=0)return Reflect.get(e,t,r);try{return e.getFunction(t)}catch(e){if(!(0,o.isError)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>"symbol"==typeof t||t in e||S.indexOf(t)>=0?Reflect.has(e,t):e.interface.hasFunction(t)})}connect(e){return new T(this.target,this.interface,e)}attach(e){return new T(e,this.interface,this.runner)}async getAddress(){return await A(this).addrPromise}async getDeployedCode(){const e=m(this.runner);(0,o.assert)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return"0x"===t?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const t=m(this.runner);return(0,o.assert)(null!=t,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((e,r)=>{const n=async()=>{try{if(null!=await this.getDeployedCode())return e(this);t.once("block",n)}catch(e){r(e)}};n()})}deploymentTransaction(){return A(this).deployTx}getFunction(e){"string"!=typeof e&&(e=e.format());const t=function(e,t){const r=function(...r){const n=e.interface.getFunction(t,r);return(0,o.assert)(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=async function(...t){const n=r(...t);let s={};if(n.inputs.length+1===t.length&&(s=await y(t.pop()),s.from&&(s.from=await(0,i.resolveAddress)(s.from,h(e.runner)))),n.inputs.length!==t.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const a=await b(e.runner,n.inputs,t);return Object.assign({},s,await(0,o.resolveProperties)({to:e.getAddress(),data:e.interface.encodeFunctionData(n,a)}))},s=async function(...e){const t=await d(...e);return 1===t.length?t[0]:t},c=async function(...t){const r=e.runner;(0,o.assert)(f(r),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const i=await r.sendTransaction(await n(...t)),s=m(e.runner);return new a.ContractTransactionResponse(e.interface,s,i)},d=async function(...t){const i=g(e.runner,"call");(0,o.assert)(u(i),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const s=await n(...t);let a="0x";try{a=await i.call(s)}catch(t){if((0,o.isCallException)(t)&&t.data)throw e.interface.makeError(t.data,s);throw t}const c=r(...t);return e.interface.decodeFunctionResult(c,a)},p=async(...e)=>r(...e).constant?await s(...e):await c(...e);return(0,o.defineProperties)(p,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:r,estimateGas:async function(...t){const r=g(e.runner,"estimateGas");return(0,o.assert)(l(r),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await r.estimateGas(await n(...t))},populateTransaction:n,send:c,staticCall:s,staticCallResult:d}),Object.defineProperty(p,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getFunction(t);return(0,o.assert)(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),p}(this,e);return t}getEvent(e){return"string"!=typeof e&&(e=e.format()),function(e,t){const r=function(...r){const n=e.interface.getEvent(t,r);return(0,o.assert)(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=function(...t){return new p(e,r(...t),t)};return(0,o.defineProperties)(n,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getEvent(t);return(0,o.assert)(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),n}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,r){null==t&&(t=0),null==r&&(r="latest");const{addr:n,addrPromise:i}=A(this),c=n||await i,{fragment:u,topics:l}=await k(this,e),d={address:c,topics:l,fromBlock:t,toBlock:r},f=m(this.runner);return(0,o.assert)(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(d)).map(e=>{let t=u;if(null==t)try{t=this.interface.getEvent(e.topics[0])}catch(e){}if(t)try{return new a.EventLog(e,this.interface,t)}catch(t){return new a.UndecodedEventLog(e,t)}return new s.Log(e,f)})}async on(e,t){const r=await E(this,"on",e);return r.listeners.push({listener:t,once:!1}),r.start(),this}async once(e,t){const r=await E(this,"once",e);return r.listeners.push({listener:t,once:!0}),r.start(),this}async emit(e,...t){return await O(this,e,t,null)}async listenerCount(e){if(e){const t=await P(this,e);return t?t.listeners.length:0}const{subs:t}=A(this);let r=0;for(const{listeners:e}of t.values())r+=e.length;return r}async listeners(e){if(e){const t=await P(this,e);return t?t.listeners.map(({listener:e})=>e):[]}const{subs:t}=A(this);let r=[];for(const{listeners:e}of t.values())r=r.concat(e.map(({listener:e})=>e));return r}async off(e,t){const r=await P(this,e);if(!r)return this;if(t){const e=r.listeners.map(({listener:e})=>e).indexOf(t);e>=0&&r.listeners.splice(e,1)}return null!=t&&0!==r.listeners.length||(r.stop(),A(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const t=await P(this,e);if(!t)return this;t.stop(),A(this).subs.delete(t.tag)}else{const{subs:e}=A(this);for(const{tag:t,stop:r}of e.values())r(),e.delete(t)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){return class extends T{constructor(t,r=null){super(t,e,r)}}}static from(e,t,r){return null==r&&(r=null),new this(e,t,r)}}t.BaseContract=T;class B extends(function(){return T}()){}t.Contract=B},406(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractFactory=void 0;const n=r(8456),i=r(646),s=r(5347),o=r(1008);class a{interface;bytecode;runner;constructor(e,t,r){const i=n.Interface.from(e);t instanceof Uint8Array||("object"==typeof t&&(t=t.object),t.startsWith("0x")||(t="0x"+t)),t=(0,s.hexlify)((0,s.getBytes)(t)),(0,s.defineProperties)(this,{bytecode:t,interface:i,runner:r||null})}attach(e){return new o.BaseContract(e,this.interface,this.runner)}async getDeployTransaction(...e){let t={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(t=await(0,o.copyOverrides)(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const n=await(0,o.resolveArgs)(this.runner,r.inputs,e),i=(0,s.concat)([this.bytecode,this.interface.encodeDeploy(n)]);return Object.assign({},t,{data:i})}async deploy(...e){const t=await this.getDeployTransaction(...e);(0,s.assert)(this.runner&&"function"==typeof this.runner.sendTransaction,"factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const r=await this.runner.sendTransaction(t),n=(0,i.getCreateAddress)(r);return new o.BaseContract(n,this.interface,this.runner,r)}connect(e){return new a(this.interface,this.bytecode,e)}static fromSolidity(e,t){(0,s.assertArgument)(null!=e,"bad compiler output","output",e),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n="";return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}}t.ContractFactory=a},9288(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UndecodedEventLog=t.EventLog=t.ContractTransactionResponse=t.ContractTransactionReceipt=t.ContractUnknownEventPayload=t.ContractEventPayload=t.ContractFactory=t.Contract=t.BaseContract=void 0;var n=r(1008);Object.defineProperty(t,"BaseContract",{enumerable:!0,get:function(){return n.BaseContract}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return n.Contract}});var i=r(406);Object.defineProperty(t,"ContractFactory",{enumerable:!0,get:function(){return i.ContractFactory}});var s=r(6526);Object.defineProperty(t,"ContractEventPayload",{enumerable:!0,get:function(){return s.ContractEventPayload}}),Object.defineProperty(t,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return s.ContractUnknownEventPayload}}),Object.defineProperty(t,"ContractTransactionReceipt",{enumerable:!0,get:function(){return s.ContractTransactionReceipt}}),Object.defineProperty(t,"ContractTransactionResponse",{enumerable:!0,get:function(){return s.ContractTransactionResponse}}),Object.defineProperty(t,"EventLog",{enumerable:!0,get:function(){return s.EventLog}}),Object.defineProperty(t,"UndecodedEventLog",{enumerable:!0,get:function(){return s.UndecodedEventLog}})},6526(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractEventPayload=t.ContractUnknownEventPayload=t.ContractTransactionResponse=t.ContractTransactionReceipt=t.UndecodedEventLog=t.EventLog=void 0;const n=r(3807),i=r(5347);class s extends n.Log{interface;fragment;args;constructor(e,t,r){super(e,e.provider);const n=t.decodeEventLog(r,e.data,e.topics);(0,i.defineProperties)(this,{args:n,fragment:r,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}t.EventLog=s;class o extends n.Log{error;constructor(e,t){super(e,e.provider),(0,i.defineProperties)(this,{error:t})}}t.UndecodedEventLog=o;class a extends n.TransactionReceipt{#A;constructor(e,t,r){super(r,t),this.#A=e}get logs(){return super.logs.map(e=>{const t=e.topics.length?this.#A.getEvent(e.topics[0]):null;if(t)try{return new s(e,this.#A,t)}catch(t){return new o(e,t)}return e})}}t.ContractTransactionReceipt=a;class c extends n.TransactionResponse{#A;constructor(e,t,r){super(r,t),this.#A=e}async wait(e,t){const r=await super.wait(e,t);return null==r?null:new a(this.#A,this.provider,r)}}t.ContractTransactionResponse=c;class u extends i.EventPayload{log;constructor(e,t,r,n){super(e,t,r),(0,i.defineProperties)(this,{log:n})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}t.ContractUnknownEventPayload=u,t.ContractEventPayload=class extends u{constructor(e,t,r,n,o){super(e,t,r,new s(o,e.interface,n));const a=e.interface.decodeEventLog(n,this.log.data,this.log.topics);(0,i.defineProperties)(this,{args:a,fragment:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}},7155(e,t,r){"use strict";t.randomBytes=t.pbkdf2Sync=t.createHmac=t.createHash=void 0;const n=r(9615),i=r(8941),s=r(2623),o=r(102),a=r(5347),c=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}(),u=c.crypto||c.msCrypto;t.createHash=function(e){switch(e){case"sha256":return s.sha256.create();case"sha512":return o.sha512.create()}(0,a.assertArgument)(!1,"invalid hashing algorithm name","algorithm",e)},t.createHmac=function(e,t){const r={sha256:s.sha256,sha512:o.sha512}[e];return(0,a.assertArgument)(null!=r,"invalid hmac algorithm","algorithm",e),n.hmac.create(r,t)},t.pbkdf2Sync=function(e,t,r,n,c){const u={sha256:s.sha256,sha512:o.sha512}[c];return(0,a.assertArgument)(null!=u,"invalid pbkdf2 algorithm","algorithm",c),(0,i.pbkdf2)(u,e,t,{c:r,dkLen:n})},t.randomBytes=function(e){(0,a.assert)(null!=u,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,a.assertArgument)(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const t=new Uint8Array(e);return u.getRandomValues(t),t}},3192(e,t,r){"use strict";t.computeHmac=void 0;const n=r(7155),i=r(5347);let s=!1;const o=function(e,t,r){return(0,n.createHmac)(e,t).update(r).digest()};let a=o;function c(e,t,r){const n=(0,i.getBytes)(t,"key"),s=(0,i.getBytes)(r,"data");return(0,i.hexlify)(a(e,n,s))}t.computeHmac=c,c._=o,c.lock=function(){s=!0},c.register=function(e){if(s)throw new Error("computeHmac is locked");a=e},Object.freeze(c)},2291(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lock=t.Signature=t.SigningKey=t.scryptSync=t.scrypt=t.pbkdf2=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.randomBytes=t.computeHmac=void 0;const n=r(3192);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return n.computeHmac}});const i=r(3905);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return i.keccak256}});const s=r(7307);Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return s.ripemd160}});const o=r(2862);Object.defineProperty(t,"pbkdf2",{enumerable:!0,get:function(){return o.pbkdf2}});const a=r(8964);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return a.randomBytes}});const c=r(5456);Object.defineProperty(t,"scrypt",{enumerable:!0,get:function(){return c.scrypt}}),Object.defineProperty(t,"scryptSync",{enumerable:!0,get:function(){return c.scryptSync}});const u=r(5059);Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return u.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return u.sha512}});var l=r(4534);Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return l.SigningKey}});var d=r(7005);Object.defineProperty(t,"Signature",{enumerable:!0,get:function(){return d.Signature}}),t.lock=function(){n.computeHmac.lock(),i.keccak256.lock(),o.pbkdf2.lock(),a.randomBytes.lock(),s.ripemd160.lock(),c.scrypt.lock(),c.scryptSync.lock(),u.sha256.lock(),u.sha512.lock(),a.randomBytes.lock()}},3905(e,t,r){"use strict";t.keccak256=void 0;const n=r(5336),i=r(5347);let s=!1;const o=function(e){return(0,n.keccak_256)(e)};let a=o;function c(e){const t=(0,i.getBytes)(e,"data");return(0,i.hexlify)(a(t))}t.keccak256=c,c._=o,c.lock=function(){s=!0},c.register=function(e){if(s)throw new TypeError("keccak256 is locked");a=e},Object.freeze(c)},2862(e,t,r){"use strict";t.pbkdf2=void 0;const n=r(7155),i=r(5347);let s=!1;const o=function(e,t,r,i,s){return(0,n.pbkdf2Sync)(e,t,r,i,s)};let a=o;function c(e,t,r,n,s){const o=(0,i.getBytes)(e,"password"),c=(0,i.getBytes)(t,"salt");return(0,i.hexlify)(a(o,c,r,n,s))}t.pbkdf2=c,c._=o,c.lock=function(){s=!0},c.register=function(e){if(s)throw new Error("pbkdf2 is locked");a=e},Object.freeze(c)},8964(e,t,r){"use strict";t.randomBytes=void 0;const n=r(7155);let i=!1;const s=function(e){return new Uint8Array((0,n.randomBytes)(e))};let o=s;function a(e){return o(e)}t.randomBytes=a,a._=s,a.lock=function(){i=!0},a.register=function(e){if(i)throw new Error("randomBytes is locked");o=e},Object.freeze(a)},7307(e,t,r){"use strict";t.ripemd160=void 0;const n=r(3238),i=r(5347);let s=!1;const o=function(e){return(0,n.ripemd160)(e)};let a=o;function c(e){const t=(0,i.getBytes)(e,"data");return(0,i.hexlify)(a(t))}t.ripemd160=c,c._=o,c.lock=function(){s=!0},c.register=function(e){if(s)throw new TypeError("ripemd160 is locked");a=e},Object.freeze(c)},5456(e,t,r){"use strict";t.scryptSync=t.scrypt=void 0;const n=r(5663),i=r(5347);let s=!1,o=!1;const a=async function(e,t,r,i,s,o,a){return await(0,n.scryptAsync)(e,t,{N:r,r:i,p:s,dkLen:o,onProgress:a})},c=function(e,t,r,i,s,o){return(0,n.scrypt)(e,t,{N:r,r:i,p:s,dkLen:o})};let u=a,l=c;async function d(e,t,r,n,s,o,a){const c=(0,i.getBytes)(e,"passwd"),l=(0,i.getBytes)(t,"salt");return(0,i.hexlify)(await u(c,l,r,n,s,o,a))}function f(e,t,r,n,s,o){const a=(0,i.getBytes)(e,"passwd"),c=(0,i.getBytes)(t,"salt");return(0,i.hexlify)(l(a,c,r,n,s,o))}t.scrypt=d,d._=a,d.lock=function(){o=!0},d.register=function(e){if(o)throw new Error("scrypt is locked");u=e},Object.freeze(d),t.scryptSync=f,f._=c,f.lock=function(){s=!0},f.register=function(e){if(s)throw new Error("scryptSync is locked");l=e},Object.freeze(f)},5059(e,t,r){"use strict";t.sha512=t.sha256=void 0;const n=r(7155),i=r(5347),s=function(e){return(0,n.createHash)("sha256").update(e).digest()},o=function(e){return(0,n.createHash)("sha512").update(e).digest()};let a=s,c=o,u=!1,l=!1;function d(e){const t=(0,i.getBytes)(e,"data");return(0,i.hexlify)(a(t))}function f(e){const t=(0,i.getBytes)(e,"data");return(0,i.hexlify)(c(t))}t.sha256=d,d._=s,d.lock=function(){u=!0},d.register=function(e){if(u)throw new Error("sha256 is locked");a=e},Object.freeze(d),t.sha512=f,f._=o,f.lock=function(){l=!0},f.register=function(e){if(l)throw new Error("sha512 is locked");c=e},Object.freeze(d)},7005(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signature=void 0;const n=r(1295),i=r(5347),s=BigInt(0),o=BigInt(1),a=BigInt(2),c=BigInt(27),u=BigInt(28),l=BigInt(35),d=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),f=d/a,h=Symbol.for("nodejs.util.inspect.custom"),p={};function g(e){return(0,i.zeroPadValue)((0,i.toBeArray)(e),32)}class m{#k;#P;#E;#x;get r(){return this.#k}set r(e){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid r","value",e),this.#k=(0,i.hexlify)(e)}get s(){return(0,i.assertArgument)(parseInt(this.#P.substring(0,3))<8,"non-canonical s; use ._s","s",this.#P),this.#P}set s(e){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid s","value",e),this.#P=(0,i.hexlify)(e)}get _s(){return this.#P}isValid(){return BigInt(this.#P)<=f}get v(){return this.#E}set v(e){const t=(0,i.getNumber)(e,"value");(0,i.assertArgument)(27===t||28===t,"invalid v","v",e),this.#E=t}get networkV(){return this.#x}get legacyChainId(){const e=this.networkV;return null==e?null:m.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=(0,i.getBytes)(this.s);return this.yParity&&(e[0]|=128),(0,i.hexlify)(e)}get compactSerialized(){return(0,i.concat)([this.r,this.yParityAndS])}get serialized(){return(0,i.concat)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,r,n){(0,i.assertPrivate)(e,p,"Signature"),this.#k=t,this.#P=r,this.#E=n,this.#x=null}getCanonical(){if(this.isValid())return this;const e=d-BigInt(this._s),t=55-this.v,r=new m(p,this.r,g(e),t);return this.networkV&&(r.#x=this.networkV),r}clone(){const e=new m(p,this.r,this._s,this.v);return this.networkV&&(e.#x=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this._s,v:this.v}}[h](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(e){const t=(0,i.getBigInt)(e,"v");return t==c||t==u?s:((0,i.assertArgument)(t>=l,"invalid EIP-155 v","v",e),(t-l)/a)}static getChainIdV(e,t){return(0,i.getBigInt)(e)*a+BigInt(35+t-27)}static getNormalizedV(e){const t=(0,i.getBigInt)(e);return t===s||t===c?27:t===o||t===u?28:((0,i.assertArgument)(t>=l,"invalid v","v",e),t&o?27:28)}static from(e){function t(t,r){(0,i.assertArgument)(t,r,"signature",e)}if(null==e)return new m(p,n.ZeroHash,n.ZeroHash,27);if("string"==typeof e){const r=(0,i.getBytes)(e,"signature");if(64===r.length){const e=(0,i.hexlify)(r.slice(0,32)),t=r.slice(32,64),n=128&t[0]?28:27;return t[0]&=127,new m(p,e,(0,i.hexlify)(t),n)}if(65===r.length){const e=(0,i.hexlify)(r.slice(0,32)),t=(0,i.hexlify)(r.slice(32,64)),n=m.getNormalizedV(r[64]);return new m(p,e,t,n)}t(!1,"invalid raw signature length")}if(e instanceof m)return e.clone();const r=e.r;t(null!=r,"missing r");const s=g(r),o=function(e,r){if(null!=e)return g(e);if(null!=r){t((0,i.isHexString)(r,32),"invalid yParityAndS");const e=(0,i.getBytes)(r);return e[0]&=127,(0,i.hexlify)(e)}t(!1,"missing s")}(e.s,e.yParityAndS),{networkV:a,v:c}=function(e,r,n){if(null!=e){const t=(0,i.getBigInt)(e);return{networkV:t>=l?t:void 0,v:m.getNormalizedV(t)}}if(null!=r)return t((0,i.isHexString)(r,32),"invalid yParityAndS"),{v:128&(0,i.getBytes)(r)[0]?28:27};if(null!=n){switch((0,i.getNumber)(n,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),u=new m(p,s,o,c);return a&&(u.#x=a),t(null==e.yParity||(0,i.getNumber)(e.yParity,"sig.yParity")===u.yParity,"yParity mismatch"),t(null==e.yParityAndS||e.yParityAndS===u.yParityAndS,"yParityAndS mismatch"),u}}t.Signature=m},4534(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigningKey=void 0;const n=r(8510),i=r(5347),s=r(7005);class o{#O;constructor(e){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid private key","privateKey","[REDACTED]"),this.#O=(0,i.hexlify)(e)}get privateKey(){return this.#O}get publicKey(){return o.computePublicKey(this.#O)}get compressedPublicKey(){return o.computePublicKey(this.#O,!0)}sign(e){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid digest length","digest",e);const t=n.secp256k1.sign((0,i.getBytesCopy)(e),(0,i.getBytesCopy)(this.#O),{lowS:!0});return s.Signature.from({r:(0,i.toBeHex)(t.r,32),s:(0,i.toBeHex)(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=o.computePublicKey(e);return(0,i.hexlify)(n.secp256k1.getSharedSecret((0,i.getBytesCopy)(this.#O),(0,i.getBytes)(t),!1))}static computePublicKey(e,t){let r=(0,i.getBytes)(e,"key");if(32===r.length){const e=n.secp256k1.getPublicKey(r,!!t);return(0,i.hexlify)(e)}if(64===r.length){const e=new Uint8Array(65);e[0]=4,e.set(r,1),r=e}const s=n.secp256k1.ProjectivePoint.fromHex(r);return(0,i.hexlify)(s.toRawBytes(t))}static recoverPublicKey(e,t){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid digest length","digest",e);const r=s.Signature.from(t);let o=n.secp256k1.Signature.fromCompact((0,i.getBytesCopy)((0,i.concat)([r.r,r.s])));o=o.addRecoveryBit(r.yParity);const a=o.recoverPublicKey((0,i.getBytesCopy)(e));return(0,i.assertArgument)(null!=a,"invalid signature for digest","signature",t),"0x"+a.toHex(!1)}static addPoints(e,t,r){const i=n.secp256k1.ProjectivePoint.fromHex(o.computePublicKey(e).substring(2)),s=n.secp256k1.ProjectivePoint.fromHex(o.computePublicKey(t).substring(2));return"0x"+i.add(s).toHex(!!r)}}t.SigningKey=o},1752(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.keccak256=t.randomBytes=t.computeHmac=t.UndecodedEventLog=t.EventLog=t.ContractUnknownEventPayload=t.ContractTransactionResponse=t.ContractTransactionReceipt=t.ContractEventPayload=t.ContractFactory=t.Contract=t.BaseContract=t.MessagePrefix=t.EtherSymbol=t.ZeroHash=t.N=t.MaxInt256=t.MinInt256=t.MaxUint256=t.WeiPerEther=t.ZeroAddress=t.resolveAddress=t.isAddress=t.isAddressable=t.getCreate2Address=t.getCreateAddress=t.getIcapAddress=t.getAddress=t.Typed=t.TransactionDescription=t.Result=t.LogDescription=t.Interface=t.Indexed=t.ErrorDescription=t.checkResultErrors=t.StructFragment=t.ParamType=t.NamedFragment=t.FunctionFragment=t.FallbackFragment=t.Fragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.AbiCoder=t.encodeBytes32String=t.decodeBytes32String=t.version=void 0,t.WebSocketProvider=t.SocketProvider=t.IpcSocketProvider=t.QuickNodeProvider=t.PocketProvider=t.InfuraWebSocketProvider=t.InfuraProvider=t.EtherscanProvider=t.CloudflareProvider=t.ChainstackProvider=t.BlockscoutProvider=t.AnkrProvider=t.AlchemyProvider=t.BrowserProvider=t.JsonRpcSigner=t.JsonRpcProvider=t.JsonRpcApiProvider=t.FallbackProvider=t.AbstractProvider=t.VoidSigner=t.NonceManager=t.AbstractSigner=t.TransactionResponse=t.TransactionReceipt=t.Log=t.FeeData=t.Block=t.getDefaultProvider=t.verifyTypedData=t.TypedDataEncoder=t.solidityPackedSha256=t.solidityPackedKeccak256=t.solidityPacked=t.verifyMessage=t.hashMessage=t.verifyAuthorization=t.hashAuthorization=t.dnsEncode=t.namehash=t.isValidName=t.ensNormalize=t.id=t.SigningKey=t.Signature=t.lock=t.scryptSync=t.scrypt=t.pbkdf2=t.sha512=t.sha256=void 0,t.FetchCancelSignal=t.FetchResponse=t.FetchRequest=t.EventPayload=t.isError=t.isCallException=t.makeError=t.assertPrivate=t.assertNormalize=t.assertArgumentCount=t.assertArgument=t.assert=t.resolveProperties=t.defineProperties=t.zeroPadValue=t.zeroPadBytes=t.stripZerosLeft=t.isBytesLike=t.isHexString=t.hexlify=t.getBytesCopy=t.getBytes=t.dataSlice=t.dataLength=t.concat=t.encodeBase64=t.decodeBase64=t.encodeBase58=t.decodeBase58=t.Transaction=t.recoverAddress=t.computeAddress=t.authorizationify=t.accessListify=t.showThrottleMessage=t.copyRequest=t.UnmanagedSubscriber=t.SocketSubscriber=t.SocketPendingSubscriber=t.SocketEventSubscriber=t.SocketBlockSubscriber=t.MulticoinProviderPlugin=t.NetworkPlugin=t.GasCostPlugin=t.FetchUrlFeeDataNetworkPlugin=t.FeeDataNetworkPlugin=t.EtherscanPlugin=t.EnsPlugin=t.Network=t.EnsResolver=void 0,t.wordlists=t.WordlistOwlA=t.WordlistOwl=t.LangEn=t.Wordlist=t.encryptKeystoreJsonSync=t.encryptKeystoreJson=t.decryptKeystoreJson=t.decryptKeystoreJsonSync=t.decryptCrowdsaleJson=t.isKeystoreJson=t.isCrowdsaleJson=t.getIndexedAccountPath=t.getAccountPath=t.defaultPath=t.Wallet=t.HDNodeVoidWallet=t.HDNodeWallet=t.BaseWallet=t.Mnemonic=t.uuidV4=t.encodeRlp=t.decodeRlp=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.mask=t.toTwos=t.fromTwos=t.toQuantity=t.toNumber=t.toBeHex=t.toBigInt=t.toBeArray=t.getUint=t.getNumber=t.getBigInt=t.FixedNumber=void 0;var n=r(4586);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return n.version}});var i=r(8456);Object.defineProperty(t,"decodeBytes32String",{enumerable:!0,get:function(){return i.decodeBytes32String}}),Object.defineProperty(t,"encodeBytes32String",{enumerable:!0,get:function(){return i.encodeBytes32String}}),Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(t,"FallbackFragment",{enumerable:!0,get:function(){return i.FallbackFragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(t,"NamedFragment",{enumerable:!0,get:function(){return i.NamedFragment}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(t,"StructFragment",{enumerable:!0,get:function(){return i.StructFragment}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(t,"ErrorDescription",{enumerable:!0,get:function(){return i.ErrorDescription}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return i.Result}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}}),Object.defineProperty(t,"Typed",{enumerable:!0,get:function(){return i.Typed}});var s=r(646);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return s.getAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return s.getIcapAddress}}),Object.defineProperty(t,"getCreateAddress",{enumerable:!0,get:function(){return s.getCreateAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}}),Object.defineProperty(t,"isAddressable",{enumerable:!0,get:function(){return s.isAddressable}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}}),Object.defineProperty(t,"resolveAddress",{enumerable:!0,get:function(){return s.resolveAddress}});var o=r(1295);Object.defineProperty(t,"ZeroAddress",{enumerable:!0,get:function(){return o.ZeroAddress}}),Object.defineProperty(t,"WeiPerEther",{enumerable:!0,get:function(){return o.WeiPerEther}}),Object.defineProperty(t,"MaxUint256",{enumerable:!0,get:function(){return o.MaxUint256}}),Object.defineProperty(t,"MinInt256",{enumerable:!0,get:function(){return o.MinInt256}}),Object.defineProperty(t,"MaxInt256",{enumerable:!0,get:function(){return o.MaxInt256}}),Object.defineProperty(t,"N",{enumerable:!0,get:function(){return o.N}}),Object.defineProperty(t,"ZeroHash",{enumerable:!0,get:function(){return o.ZeroHash}}),Object.defineProperty(t,"EtherSymbol",{enumerable:!0,get:function(){return o.EtherSymbol}}),Object.defineProperty(t,"MessagePrefix",{enumerable:!0,get:function(){return o.MessagePrefix}});var a=r(9288);Object.defineProperty(t,"BaseContract",{enumerable:!0,get:function(){return a.BaseContract}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return a.Contract}}),Object.defineProperty(t,"ContractFactory",{enumerable:!0,get:function(){return a.ContractFactory}}),Object.defineProperty(t,"ContractEventPayload",{enumerable:!0,get:function(){return a.ContractEventPayload}}),Object.defineProperty(t,"ContractTransactionReceipt",{enumerable:!0,get:function(){return a.ContractTransactionReceipt}}),Object.defineProperty(t,"ContractTransactionResponse",{enumerable:!0,get:function(){return a.ContractTransactionResponse}}),Object.defineProperty(t,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return a.ContractUnknownEventPayload}}),Object.defineProperty(t,"EventLog",{enumerable:!0,get:function(){return a.EventLog}}),Object.defineProperty(t,"UndecodedEventLog",{enumerable:!0,get:function(){return a.UndecodedEventLog}});var c=r(2291);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return c.computeHmac}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return c.randomBytes}}),Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return c.keccak256}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return c.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return c.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return c.sha512}}),Object.defineProperty(t,"pbkdf2",{enumerable:!0,get:function(){return c.pbkdf2}}),Object.defineProperty(t,"scrypt",{enumerable:!0,get:function(){return c.scrypt}}),Object.defineProperty(t,"scryptSync",{enumerable:!0,get:function(){return c.scryptSync}}),Object.defineProperty(t,"lock",{enumerable:!0,get:function(){return c.lock}}),Object.defineProperty(t,"Signature",{enumerable:!0,get:function(){return c.Signature}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return c.SigningKey}});var u=r(1181);Object.defineProperty(t,"id",{enumerable:!0,get:function(){return u.id}}),Object.defineProperty(t,"ensNormalize",{enumerable:!0,get:function(){return u.ensNormalize}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return u.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return u.namehash}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return u.dnsEncode}}),Object.defineProperty(t,"hashAuthorization",{enumerable:!0,get:function(){return u.hashAuthorization}}),Object.defineProperty(t,"verifyAuthorization",{enumerable:!0,get:function(){return u.verifyAuthorization}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return u.hashMessage}}),Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return u.verifyMessage}}),Object.defineProperty(t,"solidityPacked",{enumerable:!0,get:function(){return u.solidityPacked}}),Object.defineProperty(t,"solidityPackedKeccak256",{enumerable:!0,get:function(){return u.solidityPackedKeccak256}}),Object.defineProperty(t,"solidityPackedSha256",{enumerable:!0,get:function(){return u.solidityPackedSha256}}),Object.defineProperty(t,"TypedDataEncoder",{enumerable:!0,get:function(){return u.TypedDataEncoder}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return u.verifyTypedData}});var l=r(3996);Object.defineProperty(t,"getDefaultProvider",{enumerable:!0,get:function(){return l.getDefaultProvider}}),Object.defineProperty(t,"Block",{enumerable:!0,get:function(){return l.Block}}),Object.defineProperty(t,"FeeData",{enumerable:!0,get:function(){return l.FeeData}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}}),Object.defineProperty(t,"TransactionReceipt",{enumerable:!0,get:function(){return l.TransactionReceipt}}),Object.defineProperty(t,"TransactionResponse",{enumerable:!0,get:function(){return l.TransactionResponse}}),Object.defineProperty(t,"AbstractSigner",{enumerable:!0,get:function(){return l.AbstractSigner}}),Object.defineProperty(t,"NonceManager",{enumerable:!0,get:function(){return l.NonceManager}}),Object.defineProperty(t,"VoidSigner",{enumerable:!0,get:function(){return l.VoidSigner}}),Object.defineProperty(t,"AbstractProvider",{enumerable:!0,get:function(){return l.AbstractProvider}}),Object.defineProperty(t,"FallbackProvider",{enumerable:!0,get:function(){return l.FallbackProvider}}),Object.defineProperty(t,"JsonRpcApiProvider",{enumerable:!0,get:function(){return l.JsonRpcApiProvider}}),Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return l.JsonRpcProvider}}),Object.defineProperty(t,"JsonRpcSigner",{enumerable:!0,get:function(){return l.JsonRpcSigner}}),Object.defineProperty(t,"BrowserProvider",{enumerable:!0,get:function(){return l.BrowserProvider}}),Object.defineProperty(t,"AlchemyProvider",{enumerable:!0,get:function(){return l.AlchemyProvider}}),Object.defineProperty(t,"AnkrProvider",{enumerable:!0,get:function(){return l.AnkrProvider}}),Object.defineProperty(t,"BlockscoutProvider",{enumerable:!0,get:function(){return l.BlockscoutProvider}}),Object.defineProperty(t,"ChainstackProvider",{enumerable:!0,get:function(){return l.ChainstackProvider}}),Object.defineProperty(t,"CloudflareProvider",{enumerable:!0,get:function(){return l.CloudflareProvider}}),Object.defineProperty(t,"EtherscanProvider",{enumerable:!0,get:function(){return l.EtherscanProvider}}),Object.defineProperty(t,"InfuraProvider",{enumerable:!0,get:function(){return l.InfuraProvider}}),Object.defineProperty(t,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return l.InfuraWebSocketProvider}}),Object.defineProperty(t,"PocketProvider",{enumerable:!0,get:function(){return l.PocketProvider}}),Object.defineProperty(t,"QuickNodeProvider",{enumerable:!0,get:function(){return l.QuickNodeProvider}}),Object.defineProperty(t,"IpcSocketProvider",{enumerable:!0,get:function(){return l.IpcSocketProvider}}),Object.defineProperty(t,"SocketProvider",{enumerable:!0,get:function(){return l.SocketProvider}}),Object.defineProperty(t,"WebSocketProvider",{enumerable:!0,get:function(){return l.WebSocketProvider}}),Object.defineProperty(t,"EnsResolver",{enumerable:!0,get:function(){return l.EnsResolver}}),Object.defineProperty(t,"Network",{enumerable:!0,get:function(){return l.Network}}),Object.defineProperty(t,"EnsPlugin",{enumerable:!0,get:function(){return l.EnsPlugin}}),Object.defineProperty(t,"EtherscanPlugin",{enumerable:!0,get:function(){return l.EtherscanPlugin}}),Object.defineProperty(t,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FeeDataNetworkPlugin}}),Object.defineProperty(t,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FetchUrlFeeDataNetworkPlugin}}),Object.defineProperty(t,"GasCostPlugin",{enumerable:!0,get:function(){return l.GasCostPlugin}}),Object.defineProperty(t,"NetworkPlugin",{enumerable:!0,get:function(){return l.NetworkPlugin}}),Object.defineProperty(t,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return l.MulticoinProviderPlugin}}),Object.defineProperty(t,"SocketBlockSubscriber",{enumerable:!0,get:function(){return l.SocketBlockSubscriber}}),Object.defineProperty(t,"SocketEventSubscriber",{enumerable:!0,get:function(){return l.SocketEventSubscriber}}),Object.defineProperty(t,"SocketPendingSubscriber",{enumerable:!0,get:function(){return l.SocketPendingSubscriber}}),Object.defineProperty(t,"SocketSubscriber",{enumerable:!0,get:function(){return l.SocketSubscriber}}),Object.defineProperty(t,"UnmanagedSubscriber",{enumerable:!0,get:function(){return l.UnmanagedSubscriber}}),Object.defineProperty(t,"copyRequest",{enumerable:!0,get:function(){return l.copyRequest}}),Object.defineProperty(t,"showThrottleMessage",{enumerable:!0,get:function(){return l.showThrottleMessage}});var d=r(7778);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return d.accessListify}}),Object.defineProperty(t,"authorizationify",{enumerable:!0,get:function(){return d.authorizationify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return d.computeAddress}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return d.recoverAddress}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return d.Transaction}});var f=r(5347);Object.defineProperty(t,"decodeBase58",{enumerable:!0,get:function(){return f.decodeBase58}}),Object.defineProperty(t,"encodeBase58",{enumerable:!0,get:function(){return f.encodeBase58}}),Object.defineProperty(t,"decodeBase64",{enumerable:!0,get:function(){return f.decodeBase64}}),Object.defineProperty(t,"encodeBase64",{enumerable:!0,get:function(){return f.encodeBase64}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return f.concat}}),Object.defineProperty(t,"dataLength",{enumerable:!0,get:function(){return f.dataLength}}),Object.defineProperty(t,"dataSlice",{enumerable:!0,get:function(){return f.dataSlice}}),Object.defineProperty(t,"getBytes",{enumerable:!0,get:function(){return f.getBytes}}),Object.defineProperty(t,"getBytesCopy",{enumerable:!0,get:function(){return f.getBytesCopy}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return f.hexlify}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return f.isHexString}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return f.isBytesLike}}),Object.defineProperty(t,"stripZerosLeft",{enumerable:!0,get:function(){return f.stripZerosLeft}}),Object.defineProperty(t,"zeroPadBytes",{enumerable:!0,get:function(){return f.zeroPadBytes}}),Object.defineProperty(t,"zeroPadValue",{enumerable:!0,get:function(){return f.zeroPadValue}}),Object.defineProperty(t,"defineProperties",{enumerable:!0,get:function(){return f.defineProperties}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return f.resolveProperties}}),Object.defineProperty(t,"assert",{enumerable:!0,get:function(){return f.assert}}),Object.defineProperty(t,"assertArgument",{enumerable:!0,get:function(){return f.assertArgument}}),Object.defineProperty(t,"assertArgumentCount",{enumerable:!0,get:function(){return f.assertArgumentCount}}),Object.defineProperty(t,"assertNormalize",{enumerable:!0,get:function(){return f.assertNormalize}}),Object.defineProperty(t,"assertPrivate",{enumerable:!0,get:function(){return f.assertPrivate}}),Object.defineProperty(t,"makeError",{enumerable:!0,get:function(){return f.makeError}}),Object.defineProperty(t,"isCallException",{enumerable:!0,get:function(){return f.isCallException}}),Object.defineProperty(t,"isError",{enumerable:!0,get:function(){return f.isError}}),Object.defineProperty(t,"EventPayload",{enumerable:!0,get:function(){return f.EventPayload}}),Object.defineProperty(t,"FetchRequest",{enumerable:!0,get:function(){return f.FetchRequest}}),Object.defineProperty(t,"FetchResponse",{enumerable:!0,get:function(){return f.FetchResponse}}),Object.defineProperty(t,"FetchCancelSignal",{enumerable:!0,get:function(){return f.FetchCancelSignal}}),Object.defineProperty(t,"FixedNumber",{enumerable:!0,get:function(){return f.FixedNumber}}),Object.defineProperty(t,"getBigInt",{enumerable:!0,get:function(){return f.getBigInt}}),Object.defineProperty(t,"getNumber",{enumerable:!0,get:function(){return f.getNumber}}),Object.defineProperty(t,"getUint",{enumerable:!0,get:function(){return f.getUint}}),Object.defineProperty(t,"toBeArray",{enumerable:!0,get:function(){return f.toBeArray}}),Object.defineProperty(t,"toBigInt",{enumerable:!0,get:function(){return f.toBigInt}}),Object.defineProperty(t,"toBeHex",{enumerable:!0,get:function(){return f.toBeHex}}),Object.defineProperty(t,"toNumber",{enumerable:!0,get:function(){return f.toNumber}}),Object.defineProperty(t,"toQuantity",{enumerable:!0,get:function(){return f.toQuantity}}),Object.defineProperty(t,"fromTwos",{enumerable:!0,get:function(){return f.fromTwos}}),Object.defineProperty(t,"toTwos",{enumerable:!0,get:function(){return f.toTwos}}),Object.defineProperty(t,"mask",{enumerable:!0,get:function(){return f.mask}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return f.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return f.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return f.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return f.parseUnits}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return f.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return f.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return f.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return f.Utf8ErrorFuncs}}),Object.defineProperty(t,"decodeRlp",{enumerable:!0,get:function(){return f.decodeRlp}}),Object.defineProperty(t,"encodeRlp",{enumerable:!0,get:function(){return f.encodeRlp}}),Object.defineProperty(t,"uuidV4",{enumerable:!0,get:function(){return f.uuidV4}});var h=r(3279);Object.defineProperty(t,"Mnemonic",{enumerable:!0,get:function(){return h.Mnemonic}}),Object.defineProperty(t,"BaseWallet",{enumerable:!0,get:function(){return h.BaseWallet}}),Object.defineProperty(t,"HDNodeWallet",{enumerable:!0,get:function(){return h.HDNodeWallet}}),Object.defineProperty(t,"HDNodeVoidWallet",{enumerable:!0,get:function(){return h.HDNodeVoidWallet}}),Object.defineProperty(t,"Wallet",{enumerable:!0,get:function(){return h.Wallet}}),Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return h.defaultPath}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return h.getAccountPath}}),Object.defineProperty(t,"getIndexedAccountPath",{enumerable:!0,get:function(){return h.getIndexedAccountPath}}),Object.defineProperty(t,"isCrowdsaleJson",{enumerable:!0,get:function(){return h.isCrowdsaleJson}}),Object.defineProperty(t,"isKeystoreJson",{enumerable:!0,get:function(){return h.isKeystoreJson}}),Object.defineProperty(t,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return h.decryptCrowdsaleJson}}),Object.defineProperty(t,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return h.decryptKeystoreJsonSync}}),Object.defineProperty(t,"decryptKeystoreJson",{enumerable:!0,get:function(){return h.decryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJson",{enumerable:!0,get:function(){return h.encryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return h.encryptKeystoreJsonSync}});var p=r(6591);Object.defineProperty(t,"Wordlist",{enumerable:!0,get:function(){return p.Wordlist}}),Object.defineProperty(t,"LangEn",{enumerable:!0,get:function(){return p.LangEn}}),Object.defineProperty(t,"WordlistOwl",{enumerable:!0,get:function(){return p.WordlistOwl}}),Object.defineProperty(t,"WordlistOwlA",{enumerable:!0,get:function(){return p.WordlistOwlA}}),Object.defineProperty(t,"wordlists",{enumerable:!0,get:function(){return p.wordlists}})},4027(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyAuthorization=t.hashAuthorization=void 0;const n=r(646),i=r(2291),s=r(7778),o=r(5347);function a(e){return(0,o.assertArgument)("string"==typeof e.address,"invalid address for hashAuthorization","auth.address",e),(0,i.keccak256)((0,o.concat)(["0x05",(0,o.encodeRlp)([null!=e.chainId?(0,o.toBeArray)(e.chainId):"0x",(0,n.getAddress)(e.address),null!=e.nonce?(0,o.toBeArray)(e.nonce):"0x"])]))}t.hashAuthorization=a,t.verifyAuthorization=function(e,t){return(0,s.recoverAddress)(a(e),t)}},1993(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.id=void 0;const n=r(2291),i=r(5347);t.id=function(e){return(0,n.keccak256)((0,i.toUtf8Bytes)(e))}},1181(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyTypedData=t.TypedDataEncoder=t.solidityPackedSha256=t.solidityPackedKeccak256=t.solidityPacked=t.verifyMessage=t.hashMessage=t.dnsEncode=t.namehash=t.isValidName=t.ensNormalize=t.id=t.verifyAuthorization=t.hashAuthorization=void 0;var n=r(4027);Object.defineProperty(t,"hashAuthorization",{enumerable:!0,get:function(){return n.hashAuthorization}}),Object.defineProperty(t,"verifyAuthorization",{enumerable:!0,get:function(){return n.verifyAuthorization}});var i=r(1993);Object.defineProperty(t,"id",{enumerable:!0,get:function(){return i.id}});var s=r(3239);Object.defineProperty(t,"ensNormalize",{enumerable:!0,get:function(){return s.ensNormalize}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return s.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return s.namehash}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return s.dnsEncode}});var o=r(8717);Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return o.hashMessage}}),Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return o.verifyMessage}});var a=r(6065);Object.defineProperty(t,"solidityPacked",{enumerable:!0,get:function(){return a.solidityPacked}}),Object.defineProperty(t,"solidityPackedKeccak256",{enumerable:!0,get:function(){return a.solidityPackedKeccak256}}),Object.defineProperty(t,"solidityPackedSha256",{enumerable:!0,get:function(){return a.solidityPackedSha256}});var c=r(7215);Object.defineProperty(t,"TypedDataEncoder",{enumerable:!0,get:function(){return c.TypedDataEncoder}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return c.verifyTypedData}})},8717(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyMessage=t.hashMessage=void 0;const n=r(2291),i=r(1295),s=r(7778),o=r(5347);function a(e){return"string"==typeof e&&(e=(0,o.toUtf8Bytes)(e)),(0,n.keccak256)((0,o.concat)([(0,o.toUtf8Bytes)(i.MessagePrefix),(0,o.toUtf8Bytes)(String(e.length)),e]))}t.hashMessage=a,t.verifyMessage=function(e,t){const r=a(e);return(0,s.recoverAddress)(r,t)}},3239(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dnsEncode=t.namehash=t.isValidName=t.ensNormalize=void 0;const n=r(2291),i=r(5347),s=r(3514),o=new Uint8Array(32);function a(e){return(0,i.assertArgument)(0!==e.length,"invalid ENS name; empty component","comp",e),e}function c(e){const t=(0,i.toUtf8Bytes)(u(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++)46===t[e]&&(r.push(a(t.slice(n,e))),n=e+1);return(0,i.assertArgument)(n<t.length,"invalid ENS name; empty component","name",e),r.push(a(t.slice(n))),r}function u(e){try{if(0===e.length)throw new Error("empty label");return(0,s.ens_normalize)(e)}catch(t){(0,i.assertArgument)(!1,`invalid ENS name (${t.message})`,"name",e)}}o.fill(0),t.ensNormalize=u,t.isValidName=function(e){try{return 0!==c(e).length}catch(e){}return!1},t.namehash=function(e){(0,i.assertArgument)("string"==typeof e,"invalid ENS name; not a string","name",e),(0,i.assertArgument)(e.length,"invalid ENS name (empty label)","name",e);let t=o;const r=c(e);for(;r.length;)t=(0,n.keccak256)((0,i.concat)([t,(0,n.keccak256)(r.pop())]));return(0,i.hexlify)(t)},t.dnsEncode=function(e,t){const r=null!=t?t:63;return(0,i.assertArgument)(r<=255,"DNS encoded label cannot exceed 255","length",r),(0,i.hexlify)((0,i.concat)(c(e).map(t=>{(0,i.assertArgument)(t.length<=r,`label ${JSON.stringify(e)} exceeds ${r} bytes`,"name",e);const n=new Uint8Array(t.length+1);return n.set(t,1),n[0]=n.length-1,n})))+"00"}},6065(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.solidityPackedSha256=t.solidityPackedKeccak256=t.solidityPacked=void 0;const n=r(646),i=r(2291),s=r(5347),o=new RegExp("^bytes([0-9]+)$"),a=new RegExp("^(u?int)([0-9]*)$"),c=new RegExp("^(.*)\\[([0-9]*)\\]$");function u(e,t,r){switch(e){case"address":return r?(0,s.getBytes)((0,s.zeroPadValue)(t,32)):(0,s.getBytes)((0,n.getAddress)(t));case"string":return(0,s.toUtf8Bytes)(t);case"bytes":return(0,s.getBytes)(t);case"bool":return t=t?"0x01":"0x00",r?(0,s.getBytes)((0,s.zeroPadValue)(t,32)):(0,s.getBytes)(t)}let i=e.match(a);if(i){let n="int"===i[1],o=parseInt(i[2]||"256");return(0,s.assertArgument)((!i[2]||i[2]===String(o))&&o%8==0&&0!==o&&o<=256,"invalid number type","type",e),r&&(o=256),n&&(t=(0,s.toTwos)(t,o)),(0,s.getBytes)((0,s.zeroPadValue)((0,s.toBeArray)(t),o/8))}if(i=e.match(o),i){const n=parseInt(i[1]);return(0,s.assertArgument)(String(n)===i[1]&&0!==n&&n<=32,"invalid bytes type","type",e),(0,s.assertArgument)((0,s.dataLength)(t)===n,`invalid value for ${e}`,"value",t),r?(0,s.getBytes)((0,s.zeroPadBytes)(t,32)):t}if(i=e.match(c),i&&Array.isArray(t)){const r=i[1],n=parseInt(i[2]||String(t.length));(0,s.assertArgument)(n===t.length,`invalid array length for ${e}`,"value",t);const o=[];return t.forEach(function(e){o.push(u(r,e,!0))}),(0,s.getBytes)((0,s.concat)(o))}(0,s.assertArgument)(!1,"invalid type","type",e)}function l(e,t){(0,s.assertArgument)(e.length===t.length,"wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach(function(e,n){r.push(u(e,t[n]))}),(0,s.hexlify)((0,s.concat)(r))}t.solidityPacked=l,t.solidityPackedKeccak256=function(e,t){return(0,i.keccak256)(l(e,t))},t.solidityPackedSha256=function(e,t){return(0,i.sha256)(l(e,t))}},7215(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyTypedData=t.TypedDataEncoder=void 0;const n=r(646),i=r(2291),s=r(7778),o=r(5347),a=r(1993),c=new Uint8Array(32);c.fill(0);const u=BigInt(-1),l=BigInt(0),d=BigInt(1),f=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),h=(0,o.toBeHex)(d,32),p=(0,o.toBeHex)(l,32),g={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},m=["name","version","chainId","verifyingContract","salt"];function y(e){return function(t){return(0,o.assertArgument)("string"==typeof t,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const b={name:y("name"),version:y("version"),chainId:function(e){const t=(0,o.getBigInt)(e,"domain.chainId");return(0,o.assertArgument)(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):(0,o.toQuantity)(t)},verifyingContract:function(e){try{return(0,n.getAddress)(e).toLowerCase()}catch(e){}(0,o.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=(0,o.getBytes)(e,"domain.salt");return(0,o.assertArgument)(32===t.length,'invalid domain value "salt"',"domain.salt",e),(0,o.hexlify)(t)}};function w(e){{const t=e.match(/^(u?)int(\d+)$/);if(t){const r=""===t[1],n=parseInt(t[2]);(0,o.assertArgument)(n%8==0&&0!==n&&n<=256&&t[2]===String(n),"invalid numeric width","type",e);const i=(0,o.mask)(f,r?n-1:n),s=r?(i+d)*u:l;return function(t){const n=(0,o.getBigInt)(t,"value");return(0,o.assertArgument)(n>=s&&n<=i,`value out-of-bounds for ${e}`,"value",n),(0,o.toBeHex)(r?(0,o.toTwos)(n,256):n,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0,o.assertArgument)(0!==r&&r<=32&&t[1]===String(r),"invalid bytes width","type",e),function(t){const n=(0,o.getBytes)(t);return(0,o.assertArgument)(n.length===r,`invalid length for ${e}`,"value",t),function(e){const t=(0,o.getBytes)(e),r=t.length%32;return r?(0,o.concat)([t,c.slice(r)]):(0,o.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,o.zeroPadValue)((0,n.getAddress)(e),32)};case"bool":return function(e){return e?h:p};case"bytes":return function(e){return(0,i.keccak256)(e)};case"string":return function(e){return(0,a.id)(e)}}return null}function _(e,t){return`${e}(${t.map(({name:e,type:t})=>t+" "+e).join(",")})`}function v(e){const t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}class A{primaryType;#S;get types(){return JSON.parse(this.#S)}#T;#B;constructor(e){this.#T=new Map,this.#B=new Map;const t=new Map,r=new Map,n=new Map,i={};Object.keys(e).forEach(s=>{i[s]=e[s].map(({name:t,type:r})=>{let{base:n,index:i}=v(r);return"int"!==n||e.int||(n="int256"),"uint"!==n||e.uint||(n="uint256"),{name:t,type:n+(i||"")}}),t.set(s,new Set),r.set(s,[]),n.set(s,new Set)}),this.#S=JSON.stringify(i);for(const n in i){const s=new Set;for(const a of i[n]){(0,o.assertArgument)(!s.has(a.name),`duplicate variable name ${JSON.stringify(a.name)} in ${JSON.stringify(n)}`,"types",e),s.add(a.name);const i=v(a.type).base;(0,o.assertArgument)(i!==n,`circular type reference to ${JSON.stringify(i)}`,"types",e),w(i)||((0,o.assertArgument)(r.has(i),`unknown type ${JSON.stringify(i)}`,"types",e),r.get(i).push(n),t.get(n).add(i))}}const s=Array.from(r.keys()).filter(e=>0===r.get(e).length);(0,o.assertArgument)(0!==s.length,"missing primary type","types",e),(0,o.assertArgument)(1===s.length,`ambiguous primary types or unused types: ${s.map(e=>JSON.stringify(e)).join(", ")}`,"types",e),(0,o.defineProperties)(this,{primaryType:s[0]}),function i(s,a){(0,o.assertArgument)(!a.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),a.add(s);for(const e of t.get(s))if(r.has(e)){i(e,a);for(const t of a)n.get(t).add(e)}a.delete(s)}(this.primaryType,new Set);for(const[e,t]of n){const r=Array.from(t);r.sort(),this.#T.set(e,_(e,i[e])+r.map(e=>_(e,i[e])).join(""))}}getEncoder(e){let t=this.#B.get(e);return t||(t=this.#R(e),this.#B.set(e,t)),t}#R(e){{const t=w(e);if(t)return t}const t=v(e).array;if(t){const e=t.prefix,r=this.getEncoder(e);return n=>{(0,o.assertArgument)(-1===t.count||t.count===n.length,`array length mismatch; expected length ${t.count}`,"value",n);let s=n.map(r);return this.#T.has(e)&&(s=s.map(i.keccak256)),(0,i.keccak256)((0,o.concat)(s))}}const r=this.types[e];if(r){const t=(0,a.id)(this.#T.get(e));return e=>{const n=r.map(({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this.#T.has(r)?(0,i.keccak256)(n):n});return n.unshift(t),(0,o.concat)(n)}}(0,o.assertArgument)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#T.get(e);return(0,o.assertArgument)(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,i.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(w(e))return r(e,t);const n=v(e).array;if(n)return(0,o.assertArgument)(-1===n.count||n.count===t.length,`array length mismatch; expected length ${n.count}`,"value",t),t.map(e=>this._visit(n.prefix,e,r));const i=this.types[e];if(i)return i.reduce((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e),{});(0,o.assertArgument)(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new A(e)}static getPrimaryType(e){return A.from(e).primaryType}static hashStruct(e,t,r){return A.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){if(null==e[r])continue;const n=g[r];(0,o.assertArgument)(n,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort((e,t)=>m.indexOf(e.name)-m.indexOf(t.name)),A.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,o.concat)(["0x1901",A.hashDomain(e),A.from(t).hash(r)])}static hash(e,t,r){return(0,i.keccak256)(A.encode(e,t,r))}static async resolveNames(e,t,r,n){e=Object.assign({},e);for(const t in e)null==e[t]&&delete e[t];const i={};e.verifyingContract&&!(0,o.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const s=A.from(t);s.visit(r,(e,t)=>("address"!==e||(0,o.isHexString)(t,20)||(i[t]="0x"),t));for(const e in i)i[e]=await n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),{domain:e,value:r=s.visit(r,(e,t)=>"address"===e&&i[t]?i[t]:t)}}static getPayload(e,t,r){A.hashDomain(e);const n={},i=[];m.forEach(t=>{const r=e[t];null!=r&&(n[t]=b[t](r),i.push({name:t,type:g[t]}))});const s=A.from(t);t=s.types;const a=Object.assign({},t);return(0,o.assertArgument)(null==a.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",t),a.EIP712Domain=i,s.encode(r),{types:a,domain:n,primaryType:s.primaryType,message:s.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return(0,o.hexlify)((0,o.getBytes)(t));if(e.match(/^u?int/))return(0,o.getBigInt)(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return(0,o.assertArgument)("string"==typeof t,"invalid string","value",t),t}(0,o.assertArgument)(!1,"unsupported type","type",e)})}}}t.TypedDataEncoder=A,t.verifyTypedData=function(e,t,r,n){return(0,s.recoverAddress)(A.hash(e,t,r),n)}},4193(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethers=void 0;const n=r(1635),i=n.__importStar(r(1752));t.ethers=i,n.__exportStar(r(1752),t)},8672(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractProvider=t.UnmanagedSubscriber=void 0;const n=r(646),i=r(7778),s=r(5347),o=r(1691),a=r(5601),c=r(5317),u=r(3807),l=r(4338),d=BigInt(2);function f(e){return new Promise(t=>{setTimeout(t,e)})}function h(e){return e&&"function"==typeof e.then}function p(e,t){return e+":"+JSON.stringify(t,(e,t)=>{if(null==t)return"null";if("bigint"==typeof t)return`bigint:${t.toString()}`;if("string"==typeof t)return t.toLowerCase();if("object"==typeof t&&!Array.isArray(t)){const e=Object.keys(t);return e.sort(),e.reduce((e,r)=>(e[r]=t[r],e),{})}return t})}class g{name;constructor(e){(0,s.defineProperties)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function m(e){return(e=Array.from(new Set(e).values())).sort(),e}async function y(e,t){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if((0,s.isHexString)(e,32)){const t=e.toLowerCase();return{type:"transaction",tag:p("tx",{hash:t}),hash:t}}if(e.orphan){const t=e;return{type:"orphan",tag:p("orphan",t),filter:(r=t,JSON.parse(JSON.stringify(r)))}}var r;if(e.address||e.topics){const r=e,i={topics:(r.topics||[]).map(e=>null==e?null:Array.isArray(e)?m(e.map(e=>e.toLowerCase())):e.toLowerCase())};if(r.address){const e=[],o=[],a=r=>{(0,s.isHexString)(r)?e.push(r):o.push((async()=>{e.push(await(0,n.resolveAddress)(r,t))})())};Array.isArray(r.address)?r.address.forEach(a):a(r.address),o.length&&await Promise.all(o),i.address=m(e.map(e=>e.toLowerCase()))}return{filter:i,tag:p("event",i),type:"event"}}(0,s.assertArgument)(!1,"unknown ProviderEvent","event",e)}function b(){return(new Date).getTime()}t.UnmanagedSubscriber=g;const w={cacheTimeout:250,pollingInterval:4e3};function _(e,t){try{const r=v(e,t);if(r)return(0,s.toUtf8String)(r)}catch(e){}return null}function v(e,t){if("0x"===e)return null;try{const r=(0,s.getNumber)((0,s.dataSlice)(e,t,t+32)),n=(0,s.getNumber)((0,s.dataSlice)(e,r,r+32));return(0,s.dataSlice)(e,r+32,r+32+n)}catch(e){}return null}function A(e){const t=(0,s.toBeArray)(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function k(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}t.AbstractProvider=class{#N;#C;#I;#F;#U;#j;#L;#D;#M;#$;#G;#H;#q;#_;constructor(e,t){if(this.#_=Object.assign({},w,t||{}),"any"===e)this.#j=!0,this.#U=null;else if(e){const t=c.Network.from(e);this.#j=!1,this.#U=Promise.resolve(t),setTimeout(()=>{this.emit("network",t,null)},0)}else this.#j=!1,this.#U=null;this.#D=-1,this.#L=new Map,this.#N=new Map,this.#C=new Map,this.#I=null,this.#F=!1,this.#M=1,this.#$=new Map,this.#G=!1,this.#H=0,this.#q=[]}get _requestRate(){const e=this.#H;return 0==e?null:e}set _requestRate(e){(null==e||e<0)&&(e=0),this.#H=(0,s.getNumber)(e)}get pollingInterval(){return this.#_.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#C.values())}attachPlugin(e){if(this.#C.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#C.set(e.name,e.connect(this)),this}getPlugin(e){return this.#C.get(e)||null}get disableCcipRead(){return this.#G}set disableCcipRead(e){this.#G=!!e}#W(){let e=this.#H;if(0===e)return 0;const t=this.#q,r=b();t.push(r);const n=r-1e3;for(;t.length&&t[0]<n;)t.shift();return t.length<e?0:t[0]+1e3-r}async#z(e){const t=this.#_.cacheTimeout;if(t<0){const t=this.#W();return t&&await f(t),await this._perform(e)}const r=p(e.method,e);let n=this.#L.get(r);if(!n){const i=this.#W();i&&await f(i),n=this._perform(e),this.#L.set(r,n),setTimeout(()=>{this.#L.get(r)===n&&this.#L.delete(r)},t)}return await n}async ccipReadFetch(e,t,r){if(this.disableCcipRead||0===r.length||null==e.to)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let t=0;t<r.length;t++){const a=r[t],c=a.replace("{sender}",n).replace("{data}",i),u=new s.FetchRequest(c);-1===a.indexOf("{data}")&&(u.body={data:i,sender:n}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:u,index:t,urls:r});let l,d="unknown error";try{l=await u.send()}catch(e){o.push(e.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:{error:e}});continue}try{const e=l.bodyJson;if(e.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:u,result:e}),e.data;e.message&&(d=e.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:e})}catch(e){}(0,s.assert)(l.statusCode<400||l.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:a,errorMessage:d}}),o.push(d)}(0,s.assert)(!1,`error encountered during CCIP fetch: ${o.map(e=>JSON.stringify(e)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,t){return new u.Block((0,a.formatBlock)(e),this)}_wrapLog(e,t){return new u.Log((0,a.formatLog)(e),this)}_wrapTransactionReceipt(e,t){return new u.TransactionReceipt((0,a.formatTransactionReceipt)(e),this)}_wrapTransactionResponse(e,t){return new u.TransactionResponse((0,a.formatTransactionResponse)(e),this)}_detectNetwork(){(0,s.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,s.assert)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=(0,s.getNumber)(await this.#z({method:"getBlockNumber"}),"%response");return this.#D>=0&&(this.#D=e),e}_getAddress(e){return(0,n.resolveAddress)(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}return(0,s.isHexString)(e)?(0,s.isHexString)(e,32)?e:(0,s.toQuantity)(e):("bigint"==typeof e&&(e=(0,s.getNumber)(e,"blockTag")),"number"==typeof e?e>=0?(0,s.toQuantity)(e):this.#D>=0?(0,s.toQuantity)(this.#D+e):this.getBlockNumber().then(t=>(0,s.toQuantity)(t+e)):void(0,s.assertArgument)(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const t=(e.topics||[]).map(e=>null==e?null:Array.isArray(e)?m(e.map(e=>e.toLowerCase())):e.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,n=(e,n,i)=>{let s;switch(e.length){case 0:break;case 1:s=e[0];break;default:e.sort(),s=e}if(r&&(null!=n||null!=i))throw new Error("invalid filter");const o={};return s&&(o.address=s),t.length&&(o.topics=t),n&&(o.fromBlock=n),i&&(o.toBlock=i),r&&(o.blockHash=r),o};let i,s,o=[];if(e.address)if(Array.isArray(e.address))for(const t of e.address)o.push(this._getAddress(t));else o.push(this._getAddress(e.address));return"fromBlock"in e&&(i=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),o.filter(e=>"string"!=typeof e).length||null!=i&&"string"!=typeof i||null!=s&&"string"!=typeof s?Promise.all([Promise.all(o),i,s]).then(e=>n(e[0],e[1],e[2])):n(o,i,s)}_getTransactionRequest(e){const t=(0,u.copyRequest)(e),r=[];if(["to","from"].forEach(e=>{if(null==t[e])return;const i=(0,n.resolveAddress)(t[e],this);h(i)?r.push(async function(){t[e]=await i}()):t[e]=i}),null!=t.blockTag){const e=this._getBlockTag(t.blockTag);h(e)?r.push(async function(){t.blockTag=await e}()):t.blockTag=e}return r.length?async function(){return await Promise.all(r),t}():t}async getNetwork(){if(null==this.#U){const e=(async()=>{try{const e=await this._detectNetwork();return this.emit("network",e,null),e}catch(t){throw this.#U===e&&(this.#U=null),t}})();return this.#U=e,(await e).clone()}const e=this.#U,[t,r]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==r.chainId&&(this.#j?(this.emit("network",r,t),this.#U===e&&(this.#U=Promise.resolve(r))):(0,s.assert)(!1,`network changed: ${t.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:t,gasPrice:r,priorityFee:n}=await(0,s.resolveProperties)({_block:this.#V("latest",!1),gasPrice:(async()=>{try{const e=await this.#z({method:"getGasPrice"});return(0,s.getBigInt)(e,"%response")}catch(e){}return null})(),priorityFee:(async()=>{try{const e=await this.#z({method:"getPriorityFee"});return(0,s.getBigInt)(e,"%response")}catch(e){}return null})()});let i=null,o=null;const a=this._wrapBlock(t,e);return a&&a.baseFeePerGas&&(o=null!=n?n:BigInt("1000000000"),i=a.baseFeePerGas*d+o),new u.FeeData(r,i,o)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const e=new s.FetchRequest(r.url),n=await r.processFunc(t,this,e);return new u.FeeData(n.gasPrice,n.maxFeePerGas,n.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return h(t)&&(t=await t),(0,s.getBigInt)(await this.#z({method:"estimateGas",transaction:t}),"%response")}async#K(e,t,r){(0,s.assert)(r<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const i=(0,u.copyRequest)(e);try{const e=this.#W();return e&&await f(e),(0,s.hexlify)(await this._perform({method:"call",transaction:i,blockTag:t}))}catch(e){if(!this.disableCcipRead&&(0,s.isCallException)(e)&&e.data&&r>=0&&"latest"===t&&null!=i.to&&"0x556f1830"===(0,s.dataSlice)(e.data,0,4)){const o=e.data,a=await(0,n.resolveAddress)(i.to,this);let c;try{c=function(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,s.assert)((0,s.dataLength)(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=(0,s.dataSlice)(e,0,32);(0,s.assert)((0,s.dataSlice)(r,0,12)===(0,s.dataSlice)(x,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=(0,s.dataSlice)(r,12);try{const r=[],n=(0,s.getNumber)((0,s.dataSlice)(e,32,64)),i=(0,s.getNumber)((0,s.dataSlice)(e,n,n+32)),o=(0,s.dataSlice)(e,n+32);for(let e=0;e<i;e++){const t=_(o,32*e);if(null==t)throw new Error("abort");r.push(t)}t.urls=r}catch(e){(0,s.assert)(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=v(e,64);if(null==r)throw new Error("abort");t.calldata=r}catch(e){(0,s.assert)(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}(0,s.assert)((0,s.dataSlice)(e,100,128)===(0,s.dataSlice)(x,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=(0,s.dataSlice)(e,96,100);try{const r=v(e,128);if(null==r)throw new Error("abort");t.extraData=r}catch(e){(0,s.assert)(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(e=>t[e]),t}((0,s.dataSlice)(e.data,4))}catch(e){(0,s.assert)(!1,e.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}(0,s.assert)(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const u=await this.ccipReadFetch(i,c.calldata,c.urls);(0,s.assert)(null!=u,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:e.data,errorArgs:c.errorArgs}});const l={to:a,data:(0,s.concat)([c.selector,E([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{const e=await this.#K(l,t,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:e}),e}catch(e){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:e}),e}}throw e}}async#J(e){const{value:t}=await(0,s.resolveProperties)({network:this.getNetwork(),value:e});return t}async call(e){const{tx:t,blockTag:r}=await(0,s.resolveProperties)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#J(this.#K(t,r,e.enableCcipRead?0:-1))}async#Q(e,t,r){let n=this._getAddress(t),i=this._getBlockTag(r);return"string"==typeof n&&"string"==typeof i||([n,i]=await Promise.all([n,i])),await this.#J(this.#z(Object.assign(e,{address:n,blockTag:i})))}async getBalance(e,t){return(0,s.getBigInt)(await this.#Q({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return(0,s.getNumber)(await this.#Q({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return(0,s.hexlify)(await this.#Q({method:"getCode"},e,t))}async getStorage(e,t,r){const n=(0,s.getBigInt)(t,"position");return(0,s.hexlify)(await this.#Q({method:"getStorage",position:n},e,r))}async broadcastTransaction(e){const{blockNumber:t,hash:r,network:n}=await(0,s.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),o=i.Transaction.from(e);if(o.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(o,n).replaceableTransaction(t)}async#V(e,t){if((0,s.isHexString)(e,32))return await this.#z({method:"getBlock",blockHash:e,includeTransactions:t});let r=this._getBlockTag(e);return"string"!=typeof r&&(r=await r),await this.#z({method:"getBlock",blockTag:r,includeTransactions:t})}async getBlock(e,t){const{network:r,params:n}=await(0,s.resolveProperties)({network:this.getNetwork(),params:this.#V(e,!!t)});return null==n?null:this._wrapBlock(n,r)}async getTransaction(e){const{network:t,params:r}=await(0,s.resolveProperties)({network:this.getNetwork(),params:this.#z({method:"getTransaction",hash:e})});return null==r?null:this._wrapTransactionResponse(r,t)}async getTransactionReceipt(e){const{network:t,params:r}=await(0,s.resolveProperties)({network:this.getNetwork(),params:this.#z({method:"getTransactionReceipt",hash:e})});if(null==r)return null;if(null==r.gasPrice&&null==r.effectiveGasPrice){const t=await this.#z({method:"getTransaction",hash:e});if(null==t)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=t.gasPrice}return this._wrapTransactionReceipt(r,t)}async getTransactionResult(e){const{result:t}=await(0,s.resolveProperties)({network:this.getNetwork(),result:this.#z({method:"getTransactionResult",hash:e})});return null==t?null:(0,s.hexlify)(t)}async getLogs(e){let t=this._getFilter(e);h(t)&&(t=await t);const{network:r,params:n}=await(0,s.resolveProperties)({network:this.getNetwork(),params:this.#z({method:"getLogs",filter:t})});return n.map(e=>this._wrapLog(e,r))}_getProvider(e){(0,s.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await o.EnsResolver.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e,t){const r=await this.getResolver(e);return r?await r.getAddress(t):null}async lookupAddress(e,t){return await o.EnsResolver.lookupAddress(this,e,t)}async waitForTransaction(e,t,r){const n=null!=t?t:1;return 0===n?this.getTransactionReceipt(e):new Promise(async(t,i)=>{let o=null;const a=async r=>{try{const i=await this.getTransactionReceipt(e);if(null!=i&&r-i.blockNumber+1>=n)return t(i),void(o&&(clearTimeout(o),o=null))}catch(e){console.log("EEE",e)}this.once("block",a)};null!=r&&(o=setTimeout(()=>{null!=o&&(o=null,this.off("block",a),i((0,s.makeError)("timeout","TIMEOUT",{reason:"timeout"})))},r)),a(await this.getBlockNumber())})}async waitForBlock(e){(0,s.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=this.#$.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#$.delete(e))}_setTimeout(e,t){null==t&&(t=0);const r=this.#M++,n=()=>{this.#$.delete(r),e()};if(this.paused)this.#$.set(r,{timer:null,func:n,time:t});else{const e=setTimeout(n,t);this.#$.set(r,{timer:e,func:n,time:b()})}return r}_forEachSubscriber(e){for(const t of this.#N.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new g(e.type);case"block":{const e=new l.PollingBlockSubscriber(this);return e.pollingInterval=this.pollingInterval,e}case"safe":case"finalized":return new l.PollingBlockTagSubscriber(this,e.type);case"event":return new l.PollingEventSubscriber(this,e.filter);case"transaction":return new l.PollingTransactionSubscriber(this,e.hash);case"orphan":return new l.PollingOrphanSubscriber(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const r of this.#N.values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=t,r.started&&t.start(),null!=this.#I&&t.pause(this.#I);break}}async#Z(e,t){let r=await y(e,this);return"event"===r.type&&t&&t.length>0&&!0===t[0].removed&&(r=await y({orphan:"drop-log",log:t[0]},this)),this.#N.get(r.tag)||null}async#Y(e){const t=await y(e,this),r=t.tag;let n=this.#N.get(r);return n||(n={subscriber:this._getSubscriber(t),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#N.set(r,n)),n}async on(e,t){const r=await this.#Y(e);return r.listeners.push({listener:t,once:!1}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#I&&r.subscriber.pause(this.#I)),this}async once(e,t){const r=await this.#Y(e);return r.listeners.push({listener:t,once:!0}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#I&&r.subscriber.pause(this.#I)),this}async emit(e,...t){const r=await this.#Z(e,t);if(!r||0===r.listeners.length)return!1;const n=r.listeners.length;return r.listeners=r.listeners.filter(({listener:r,once:n})=>{const i=new s.EventPayload(this,n?null:r,e);try{r.call(this,...t,i)}catch(e){}return!n}),0===r.listeners.length&&(r.started&&r.subscriber.stop(),this.#N.delete(r.tag)),n>0}async listenerCount(e){if(e){const t=await this.#Z(e);return t?t.listeners.length:0}let t=0;for(const{listeners:e}of this.#N.values())t+=e.length;return t}async listeners(e){if(e){const t=await this.#Z(e);return t?t.listeners.map(({listener:e})=>e):[]}let t=[];for(const{listeners:e}of this.#N.values())t=t.concat(e.map(({listener:e})=>e));return t}async off(e,t){const r=await this.#Z(e);if(!r)return this;if(t){const e=r.listeners.map(({listener:e})=>e).indexOf(t);e>=0&&r.listeners.splice(e,1)}return t&&0!==r.listeners.length||(r.started&&r.subscriber.stop(),this.#N.delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:r,subscriber:n}=await this.#Y(e);r&&n.stop(),this.#N.delete(t)}else for(const[e,{started:t,subscriber:r}]of this.#N)t&&r.stop(),this.#N.delete(e);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#F}destroy(){this.removeAllListeners();for(const e of this.#$.keys())this._clearTimeout(e);this.#F=!0}get paused(){return null!=this.#I}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#D=-1,null!=this.#I){if(this.#I==!!e)return;(0,s.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#I=!!e;for(const e of this.#$.values())e.timer&&clearTimeout(e.timer),e.time=b()-e.time}resume(){if(null!=this.#I){this._forEachSubscriber(e=>e.resume()),this.#I=null;for(const e of this.#$.values()){let t=e.time;t<0&&(t=0),e.time=b(),setTimeout(e.func,t)}}}};const P=new Uint8Array([]);function E(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(P),r+=32;for(let n=0;n<e.length;n++){const i=(0,s.getBytes)(e[n]);t[n]=A(r),t.push(A(i.length)),t.push(k(i)),r+=32+32*Math.ceil(i.length/32)}return(0,s.concat)(t)}const x="0x0000000000000000000000000000000000000000000000000000000000000000"},3071(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoidSigner=t.AbstractSigner=void 0;const n=r(646),i=r(7778),s=r(5347),o=r(3807);function a(e,t){if(e.provider)return e.provider;(0,s.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function c(e,t){let r=(0,o.copyRequest)(t);if(null!=r.to&&(r.to=(0,n.resolveAddress)(r.to,e)),null!=r.from){const t=r.from;r.from=Promise.all([e.getAddress(),(0,n.resolveAddress)(t,e)]).then(([e,t])=>((0,s.assertArgument)(e.toLowerCase()===t.toLowerCase(),"transaction from mismatch","tx.from",t),e))}else r.from=e.getAddress();return await(0,s.resolveProperties)(r)}class u{provider;constructor(e){(0,s.defineProperties)(this,{provider:e||null})}async getNonce(e){return a(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await c(this,e)}async populateTransaction(e){const t=a(this,"populateTransaction"),r=await c(this,e);null==r.nonce&&(r.nonce=await this.getNonce("pending")),null==r.gasLimit&&(r.gasLimit=await this.estimateGas(r));const n=await this.provider.getNetwork();if(null!=r.chainId){const t=(0,s.getBigInt)(r.chainId);(0,s.assertArgument)(t===n.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=n.chainId;const i=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas;if(null==r.gasPrice||2!==r.type&&!i?0!==r.type&&1!==r.type||!i||(0,s.assertArgument)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):(0,s.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas)if(0===r.type||1===r.type){const e=await t.getFeeData();(0,s.assert)(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice)}else{const e=await t.getFeeData();if(null==r.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(r.authorizationList&&r.authorizationList.length?r.type=4:r.type=2,null!=r.gasPrice){const e=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=e,r.maxPriorityFeePerGas=e}else null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?((0,s.assert)(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice),r.type=0):(0,s.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==r.type&&3!==r.type&&4!==r.type||(null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else r.type=2;return await(0,s.resolveProperties)(r)}async populateAuthorization(e){const t=Object.assign({},e);return null==t.chainId&&(t.chainId=(await a(this,"getNetwork").getNetwork()).chainId),null==t.nonce&&(t.nonce=await this.getNonce()),t}async estimateGas(e){return a(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return a(this,"call").call(await this.populateCall(e))}async resolveName(e){const t=a(this,"resolveName");return await t.resolveName(e)}async sendTransaction(e){const t=a(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const n=i.Transaction.from(r);return await t.broadcastTransaction(await this.signTransaction(n))}authorize(e){(0,s.assert)(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}t.AbstractSigner=u;class l extends u{address;constructor(e,t){super(t),(0,s.defineProperties)(this,{address:e})}async getAddress(){return this.address}connect(e){return new l(this.address,e)}#X(e,t){(0,s.assert)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#X("transactions","signTransaction")}async signMessage(e){this.#X("messages","signMessage")}async signTypedData(e,t,r){this.#X("typed-data","signTypedData")}}t.VoidSigner=l},9973(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showThrottleMessage=void 0;const r=new Set;t.showThrottleMessage=function(e){r.has(e)||(r.add(e),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${e} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}},2347(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultProvider=void 0;const n=r(5347),i=r(6806),s=r(7841),o=r(8907),a=r(2271),c=r(5047),u=r(5855),l=r(8817),d=r(9902),f=r(2371),h=r(5317),p=r(873),g="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");t.getDefaultProvider=function(e,t){null==t&&(t={});const r=e=>"-"!==t[e]&&("string"==typeof t.exclusive?e===t.exclusive:!Array.isArray(t.exclusive)||-1!==t.exclusive.indexOf(e));if("string"==typeof e&&e.match(/^https?:/))return new f.JsonRpcProvider(e);if("string"==typeof e&&e.match(/^wss?:/)||(m=e)&&"function"==typeof m.send&&"function"==typeof m.close)return new p.WebSocketProvider(e);var m;let y=null;try{y=h.Network.from(e)}catch(e){}const b=[];if(r("publicPolygon")&&y&&("matic"===y.name?b.push(new f.JsonRpcProvider("https://polygon-rpc.com/",y,{staticNetwork:y})):"matic-amoy"===y.name&&b.push(new f.JsonRpcProvider("https://rpc-amoy.polygon.technology/",y,{staticNetwork:y}))),r("alchemy"))try{b.push(new s.AlchemyProvider(e,t.alchemy))}catch(e){}if(r("ankr")&&null!=t.ankr)try{b.push(new i.AnkrProvider(e,t.ankr))}catch(e){}if(r("chainstack"))try{b.push(new o.ChainstackProvider(e,t.chainstack))}catch(e){}if(r("cloudflare"))try{b.push(new a.CloudflareProvider(e))}catch(e){}if(r("etherscan"))try{b.push(new c.EtherscanProvider(e,t.etherscan))}catch(e){}if(r("infura"))try{let r,n=t.infura;"object"==typeof n&&(r=n.projectSecret,n=n.projectId),b.push(new u.InfuraProvider(e,n,r))}catch(e){}if(r("quicknode"))try{let r=t.quicknode;b.push(new l.QuickNodeProvider(e,r))}catch(e){}if((0,n.assert)(b.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),1===b.length)return b[0];let w=Math.floor(b.length/2);return w>2&&(w=2),y&&-1!==g.indexOf(y.name)&&(w=1),t&&t.quorum&&(w=t.quorum),new d.FallbackProvider(b,void 0,{quorum:w})}},1691(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnsResolver=t.BasicMulticoinProviderPlugin=t.MulticoinProviderPlugin=void 0;const n=r(646),i=r(1295),s=r(9288),o=r(1181),a=r(5347),c=BigInt(60);function u(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):(0,a.assertArgument)(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class l{name;constructor(e){(0,a.defineProperties)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}t.MulticoinProviderPlugin=l,t.BasicMulticoinProviderPlugin=class extends l{constructor(){super("org.ethers.plugins.provider.BasicMulticoin")}};const d=new RegExp("^(ipfs)://(.*)$","i"),f=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),d,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function h(e){return e===c||e>=2147483648&&e<=4294967295}class p{provider;address;name;#ee;#te;constructor(e,t,r,n){(0,a.defineProperties)(this,{provider:e,address:t,name:r}),this.#ee=null!=n?Promise.resolve(n):null,this.#te=new s.Contract(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)","function name(bytes32) view returns (string)"],e)}async supportsWildcard(){return null==this.#ee&&(this.#ee=(async()=>{try{return await this.#te.supportsInterface("0x9061b923")}catch(e){if((0,a.isError)(e,"CALL_EXCEPTION"))return!1;throw this.#ee=null,e}})()),await this.#ee}async#re(e,t){t=(t||[]).slice();const r=this.#te.interface;t.unshift((0,o.namehash)(this.name));let n=null;await this.supportsWildcard()&&(n=r.getFunction(e),(0,a.assert)(n,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[(0,o.dnsEncode)(this.name,255),r.encodeFunctionData(n,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const i=await this.#te[e](...t);return n?r.decodeFunctionResult(n,i)[0]:i}catch(e){if(!(0,a.isError)(e,"CALL_EXCEPTION"))throw e}return null}async getAddress(e){const t=null==e?c:(0,a.getBigInt)(e);if(t===c)try{const e=await this.#re("addr(bytes32)");return null==e||e===i.ZeroAddress?null:e}catch(e){if((0,a.isError)(e,"CALL_EXCEPTION"))return null;throw e}if(h(t)){const e=await this.#re("addr(bytes32,uint)",[t]);return(0,a.isHexString)(e,20)?(0,n.getAddress)(e):null}if(t>=0&&t<2147483648){let e=t+BigInt(2147483648);const r=await this.#re("addr(bytes32,uint)",[e]);if((0,a.isHexString)(r,20))return(0,n.getAddress)(r)}let r=null;for(const e of this.provider.plugins)if(e instanceof l&&t<=2147483648&&e.supportsCoinType(Number(t))){r=e;break}if(null==r)return null;const s=await this.#re("addr(bytes32,uint)",[t]);if(null==s||"0x"===s)return null;if(t<2147483648){const e=await r.decodeAddress(Number(t),s);if(null!=e)return e}(0,a.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${t})`,info:{coinType:t,data:s}})}async getText(e){const t=await this.#re("text(bytes32,string)",[e]);return null==t||"0x"===t?null:t}async getContentHash(){const e=await this.#re("contenthash(bytes32)");if(null==e||"0x"===e)return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e="e3010170"===t[1]?"ipfs":"ipns",r=parseInt(t[4],16);if(t[5].length===2*r)return`${e}://${(0,a.encodeBase58)("0x"+t[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return`bzz://${r[1]}`;(0,a.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getName(){return await this.#re("name(bytes32)")}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(null==t)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let r=0;r<f.length;r++){const n=t.match(f[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{const r=u(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:r}),{linkage:e,url:r}}case"erc721":case"erc1155":{const r="erc721"===i?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:t});const o=await this.getAddress();if(null==o)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const c=(n[2]||"").split("/");if(2!==c.length)return e.push({type:`!${i}caip`,value:n[2]||""}),{url:null,linkage:e};const l=c[1],f=new s.Contract(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if("erc721"===i){const t=await f.ownerOf(l);if(o!==t)return e.push({type:"!owner",value:t}),{url:null,linkage:e};e.push({type:"owner",value:t})}else if("erc1155"===i){const t=await f.balanceOf(o,l);if(!t)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:t.toString()})}let h=await f[r](l);if(null==h||"0x"===h)return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:h}),"erc1155"===i&&(h=h.replace("{id}",(0,a.toBeHex)(l,32).substring(2)),e.push({type:"metadata-url-expanded",value:h})),h.match(/^ipfs:/i)&&(h=u(h)),e.push({type:"metadata-url",value:h});let p={};const g=await new a.FetchRequest(h).send();g.assertOk();try{p=g.bodyJson}catch(t){try{e.push({type:"!metadata",value:g.bodyText})}catch(t){const r=g.body;return r&&e.push({type:"!metadata",value:(0,a.hexlify)(r)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!p)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(p)});let m=p.image;if("string"!=typeof m)return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(m.match(/^(https:\/\/|data:)/i));else{if(null==m.match(d))return e.push({type:"!imageUrl-ipfs",value:m}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:m}),m=u(m)}return e.push({type:"url",value:m}),{linkage:e,url:m}}}}}catch(e){}return{linkage:e,url:null}}static async getEnsAddress(e){const t=await e.getNetwork(),r=t.getPlugin("org.ethers.plugins.network.Ens");return(0,a.assert)(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),r.address}static async getUniversalResolverAddress(e){const t=(await e.getNetwork()).getPlugin("org.ethers.plugins.network.Ens");return t&&t.universalResolver?t.universalResolver:null}static async#ne(e,t){const r=await p.getEnsAddress(e);try{const n=new s.Contract(r,["function resolver(bytes32) view returns (address)"],e),a=await n.resolver((0,o.namehash)(t),{enableCcipRead:!0});return a===i.ZeroAddress?null:a}catch(e){throw e}}static async lookupAddress(e,t,r){const i=null==r?c:(0,a.getBigInt)(r);h(i)&&(t=(0,n.getAddress)(t));const s=await g(e);if(s)try{const e=(await s.reverse(t,i,{enableCcipRead:!0})).primary;return(0,o.isValidName)(e)?e:null}catch(e){if((0,a.isError)(e,"CALL_EXCEPTION")&&"ResolverNotFound(bytes)"===e.reason)return null;throw e}(0,a.assert)(i===c,"lookupAddress coinType requires ENS Universal Resolver","UNSUPPORTED_OPERATION",{operation:"lookupAddress"});try{const r=await p.fromName(e,`${t.toLowerCase().substring(2)}.addr.reverse`);if(!r)return null;const n=await r.getName();return null!=n&&(0,o.isValidName)(n)?await e.resolveName(n)!==t?null:n:null}catch(e){if((0,a.isError)(e,"BAD_DATA")&&"0x"===e.value)return null;if((0,a.isError)(e,"CALL_EXCEPTION"))return null;throw e}}static async fromName(e,t){const r=await g(e);if(r){let n;try{n=(0,o.dnsEncode)((0,o.ensNormalize)(t),255)}catch(e){return null}const i=await r.requireResolver(n);return new p(e,i.resolver,t,i.extended)}let n=t;for(;;){if(""===n||"."===n)return null;if("eth"!==t&&"eth"===n)return null;const r=await p.#ne(e,n);if(null!=r){const i=new p(e,r,t);return n===t||await i.supportsWildcard()?i:null}n=n.split(".").slice(1).join(".")}}}async function g(e){const t=await p.getUniversalResolverAddress(e);return t?new s.Contract(t,["function requireResolver(bytes) view returns ((bytes name, uint256 offset, bytes32 node, address resolver, bool extended))","function findResolver(bytes) view returns (address resolver, bytes32 node, uint offset)","function resolve(bytes name, bytes data) view returns (bytes result, address resolver)","function reverse(bytes name, uint coinType) view returns (string primary, address resolver, address reverseResolver)","error ResolverNotFound(bytes name)","error ResolverNotContract(bytes name, address resolver)","error ReverseAddressMismatch(string primary, bytes primaryAddress)","error HttpError(uint16 statusCode, string statusMessage)"],e):null}t.EnsResolver=p},5601(e,t,r){"use strict";t.formatTransactionResponse=t.formatTransactionReceipt=t.formatBlock=t.formatLog=void 0;const n=r(646),i=r(2291),s=r(7778),o=r(5347),a=BigInt(0);function c(e,t){return function(r){return null==r?t:e(r)}}function u(e,t){return r=>{if(t&&null==r)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(t=>e(t))}}function l(e,t){return r=>{const n={};for(const i in e){let s=i;if(t&&i in t&&!(s in r))for(const e of t[i])if(e in r){s=e;break}try{const t=e[i](r[s]);void 0!==t&&(n[i]=t)}catch(e){const t=e instanceof Error?e.message:"not-an-error";(0,o.assert)(!1,`invalid value for value.${i} (${t})`,"BAD_DATA",{value:r})}}return n}}function d(e){return(0,o.assertArgument)((0,o.isHexString)(e,!0),"invalid data","value",e),e}function f(e){return(0,o.assertArgument)((0,o.isHexString)(e,32),"invalid hash","value",e),e}const h=l({address:n.getAddress,blockHash:f,blockNumber:o.getNumber,data:d,index:o.getNumber,removed:c(function(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}(0,o.assertArgument)(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)},!1),topics:u(f),transactionHash:f,transactionIndex:o.getNumber},{index:["logIndex"]});t.formatLog=function(e){return h(e)};const p=l({hash:c(f),parentHash:f,parentBeaconBlockRoot:c(f,null),number:o.getNumber,timestamp:o.getNumber,nonce:c(d),difficulty:o.getBigInt,gasLimit:o.getBigInt,gasUsed:o.getBigInt,stateRoot:c(f,null),receiptsRoot:c(f,null),transactionsRoot:c(f,null),blobGasUsed:c(o.getBigInt,null),excessBlobGas:c(o.getBigInt,null),miner:c(n.getAddress),prevRandao:c(f,null),extraData:d,baseFeePerGas:c(o.getBigInt)},{prevRandao:["mixHash"]});t.formatBlock=function(e){const t=p(e);return t.transactions=e.transactions.map(e=>"string"==typeof e?e:y(e)),t};const g=l({transactionIndex:o.getNumber,blockNumber:o.getNumber,transactionHash:f,address:n.getAddress,topics:u(f),data:d,index:o.getNumber,blockHash:f},{index:["logIndex"]});const m=l({to:c(n.getAddress,null),from:c(n.getAddress,null),contractAddress:c(n.getAddress,null),index:o.getNumber,root:c(o.hexlify),gasUsed:o.getBigInt,blobGasUsed:c(o.getBigInt,null),logsBloom:c(d),blockHash:f,hash:f,logs:u(function(e){return g(e)}),blockNumber:o.getNumber,cumulativeGasUsed:o.getBigInt,effectiveGasPrice:c(o.getBigInt),blobGasPrice:c(o.getBigInt,null),status:c(o.getNumber),type:c(o.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function y(e){e.to&&(0,o.getBigInt)(e.to)===a&&(e.to="0x0000000000000000000000000000000000000000");const t=l({hash:f,index:c(o.getNumber,void 0),type:e=>"0x"===e||null==e?0:(0,o.getNumber)(e),accessList:c(s.accessListify,null),blobVersionedHashes:c(u(f,!0),null),authorizationList:c(u(e=>{let t;if(e.signature)t=e.signature;else{let r=e.yParity;"0x1b"===r?r=0:"0x1c"===r&&(r=1),t=Object.assign({},e,{yParity:r})}return{address:(0,n.getAddress)(e.address),chainId:(0,o.getBigInt)(e.chainId),nonce:(0,o.getBigInt)(e.nonce),signature:i.Signature.from(t)}},!1),null),blockHash:c(f,null),blockNumber:c(o.getNumber,null),transactionIndex:c(o.getNumber,null),from:n.getAddress,gasPrice:c(o.getBigInt),maxPriorityFeePerGas:c(o.getBigInt),maxFeePerGas:c(o.getBigInt),maxFeePerBlobGas:c(o.getBigInt,null),gasLimit:o.getBigInt,to:c(n.getAddress,null),value:o.getBigInt,nonce:o.getNumber,data:d,creates:c(n.getAddress,null),chainId:c(o.getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(null==t.to&&null==t.creates&&(t.creates=(0,n.getCreateAddress)(t)),1!==e.type&&2!==e.type||null!=e.accessList||(t.accessList=[]),e.signature?t.signature=i.Signature.from(e.signature):t.signature=i.Signature.from(e),null==t.chainId){const e=t.signature.legacyChainId;null!=e&&(t.chainId=e)}return t.blockHash&&(0,o.getBigInt)(t.blockHash)===a&&(t.blockHash=null),t}t.formatTransactionReceipt=function(e){return m(e)},t.formatTransactionResponse=y},3996(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocketEventSubscriber=t.SocketPendingSubscriber=t.SocketBlockSubscriber=t.SocketSubscriber=t.WebSocketProvider=t.SocketProvider=t.IpcSocketProvider=t.QuickNodeProvider=t.PocketProvider=t.InfuraWebSocketProvider=t.InfuraProvider=t.EtherscanPlugin=t.EtherscanProvider=t.ChainstackProvider=t.CloudflareProvider=t.AnkrProvider=t.BlockscoutProvider=t.AlchemyProvider=t.BrowserProvider=t.JsonRpcSigner=t.JsonRpcProvider=t.JsonRpcApiProvider=t.FallbackProvider=t.copyRequest=t.TransactionResponse=t.TransactionReceipt=t.Log=t.FeeData=t.Block=t.FetchUrlFeeDataNetworkPlugin=t.FeeDataNetworkPlugin=t.EnsPlugin=t.GasCostPlugin=t.NetworkPlugin=t.NonceManager=t.Network=t.MulticoinProviderPlugin=t.EnsResolver=t.getDefaultProvider=t.showThrottleMessage=t.VoidSigner=t.AbstractSigner=t.UnmanagedSubscriber=t.AbstractProvider=void 0;var n=r(8672);Object.defineProperty(t,"AbstractProvider",{enumerable:!0,get:function(){return n.AbstractProvider}}),Object.defineProperty(t,"UnmanagedSubscriber",{enumerable:!0,get:function(){return n.UnmanagedSubscriber}});var i=r(3071);Object.defineProperty(t,"AbstractSigner",{enumerable:!0,get:function(){return i.AbstractSigner}}),Object.defineProperty(t,"VoidSigner",{enumerable:!0,get:function(){return i.VoidSigner}});var s=r(9973);Object.defineProperty(t,"showThrottleMessage",{enumerable:!0,get:function(){return s.showThrottleMessage}});var o=r(2347);Object.defineProperty(t,"getDefaultProvider",{enumerable:!0,get:function(){return o.getDefaultProvider}});var a=r(1691);Object.defineProperty(t,"EnsResolver",{enumerable:!0,get:function(){return a.EnsResolver}}),Object.defineProperty(t,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return a.MulticoinProviderPlugin}});var c=r(5317);Object.defineProperty(t,"Network",{enumerable:!0,get:function(){return c.Network}});var u=r(9596);Object.defineProperty(t,"NonceManager",{enumerable:!0,get:function(){return u.NonceManager}});var l=r(4491);Object.defineProperty(t,"NetworkPlugin",{enumerable:!0,get:function(){return l.NetworkPlugin}}),Object.defineProperty(t,"GasCostPlugin",{enumerable:!0,get:function(){return l.GasCostPlugin}}),Object.defineProperty(t,"EnsPlugin",{enumerable:!0,get:function(){return l.EnsPlugin}}),Object.defineProperty(t,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FeeDataNetworkPlugin}}),Object.defineProperty(t,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FetchUrlFeeDataNetworkPlugin}});var d=r(3807);Object.defineProperty(t,"Block",{enumerable:!0,get:function(){return d.Block}}),Object.defineProperty(t,"FeeData",{enumerable:!0,get:function(){return d.FeeData}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return d.Log}}),Object.defineProperty(t,"TransactionReceipt",{enumerable:!0,get:function(){return d.TransactionReceipt}}),Object.defineProperty(t,"TransactionResponse",{enumerable:!0,get:function(){return d.TransactionResponse}}),Object.defineProperty(t,"copyRequest",{enumerable:!0,get:function(){return d.copyRequest}});var f=r(9902);Object.defineProperty(t,"FallbackProvider",{enumerable:!0,get:function(){return f.FallbackProvider}});var h=r(2371);Object.defineProperty(t,"JsonRpcApiProvider",{enumerable:!0,get:function(){return h.JsonRpcApiProvider}}),Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return h.JsonRpcProvider}}),Object.defineProperty(t,"JsonRpcSigner",{enumerable:!0,get:function(){return h.JsonRpcSigner}});var p=r(254);Object.defineProperty(t,"BrowserProvider",{enumerable:!0,get:function(){return p.BrowserProvider}});var g=r(7841);Object.defineProperty(t,"AlchemyProvider",{enumerable:!0,get:function(){return g.AlchemyProvider}});var m=r(9349);Object.defineProperty(t,"BlockscoutProvider",{enumerable:!0,get:function(){return m.BlockscoutProvider}});var y=r(6806);Object.defineProperty(t,"AnkrProvider",{enumerable:!0,get:function(){return y.AnkrProvider}});var b=r(2271);Object.defineProperty(t,"CloudflareProvider",{enumerable:!0,get:function(){return b.CloudflareProvider}});var w=r(8907);Object.defineProperty(t,"ChainstackProvider",{enumerable:!0,get:function(){return w.ChainstackProvider}});var _=r(5047);Object.defineProperty(t,"EtherscanProvider",{enumerable:!0,get:function(){return _.EtherscanProvider}}),Object.defineProperty(t,"EtherscanPlugin",{enumerable:!0,get:function(){return _.EtherscanPlugin}});var v=r(5855);Object.defineProperty(t,"InfuraProvider",{enumerable:!0,get:function(){return v.InfuraProvider}}),Object.defineProperty(t,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return v.InfuraWebSocketProvider}});var A=r(2398);Object.defineProperty(t,"PocketProvider",{enumerable:!0,get:function(){return A.PocketProvider}});var k=r(8817);Object.defineProperty(t,"QuickNodeProvider",{enumerable:!0,get:function(){return k.QuickNodeProvider}});const P=r(4584);Object.defineProperty(t,"IpcSocketProvider",{enumerable:!0,get:function(){return P.IpcSocketProvider}});var E=r(4945);Object.defineProperty(t,"SocketProvider",{enumerable:!0,get:function(){return E.SocketProvider}});var x=r(873);Object.defineProperty(t,"WebSocketProvider",{enumerable:!0,get:function(){return x.WebSocketProvider}});var O=r(4945);Object.defineProperty(t,"SocketSubscriber",{enumerable:!0,get:function(){return O.SocketSubscriber}}),Object.defineProperty(t,"SocketBlockSubscriber",{enumerable:!0,get:function(){return O.SocketBlockSubscriber}}),Object.defineProperty(t,"SocketPendingSubscriber",{enumerable:!0,get:function(){return O.SocketPendingSubscriber}}),Object.defineProperty(t,"SocketEventSubscriber",{enumerable:!0,get:function(){return O.SocketEventSubscriber}})},5317(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Network=void 0;const n=r(7778),i=r(5347),s=r(4491),o=Symbol.for("nodejs.util.inspect.custom"),a=new Map;class c{#ie;#se;#C;constructor(e,t){this.#ie=e,this.#se=(0,i.getBigInt)(t),this.#C=new Map}[o](){return this.toString()}toString(){const e=[];for(const t of this.#C.values())e.push(t.toString());return`Network { name: ${this.name}, chainId: ${this.chainId}, plugins: [ ${e.join(", ")} ] }`}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#ie}set name(e){this.#ie=e}get chainId(){return this.#se}set chainId(e){this.#se=(0,i.getBigInt)(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===(0,i.getBigInt)(e)}catch(e){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===(0,i.getBigInt)(e)}catch(e){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===(0,i.getBigInt)(e.chainId)}catch(e){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#C.values())}attachPlugin(e){if(this.#C.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#C.set(e.name,e.clone()),this}getPlugin(e){return this.#C.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new c(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new s.GasCostPlugin;let r=t.txBase;if(null==e.to&&(r+=t.txCreate),e.data)for(let n=2;n<e.data.length;n+=2)"00"===e.data.substring(n,n+2)?r+=t.txDataZero:r+=t.txDataNonzero;if(e.accessList){const i=(0,n.accessListify)(e.accessList);for(const e in i)r+=t.txAccessListAddress+t.txAccessListStorageKey*i[e].storageKeys.length}return r}static from(e){if(function(){if(d)return;function e(e,t,r){const n=function(){const n=new c(e,t);return null!=r.ensNetwork&&n.attachPlugin(new s.EnsPlugin(null,r.ensNetwork,r.ensUniversalResolver)),n.attachPlugin(new s.GasCostPlugin),(r.plugins||[]).forEach(e=>{n.attachPlugin(e)}),n};c.register(e,n),c.register(t,n),r.altNames&&r.altNames.forEach(e=>{c.register(e,n)})}d=!0;const t="0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe";e("mainnet",1,{ensUniversalResolver:t,ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensUniversalResolver:t,ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("filecoin",314,{}),e("filecoin-calibration",314159,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[l("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[l("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1})}(),null==e)return c.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const t=a.get(e);if(t)return t();if("bigint"==typeof e)return new c("unknown",e);(0,i.assertArgument)(!1,"unknown network","network",e)}if("function"==typeof e.clone)return e.clone();if("object"==typeof e){(0,i.assertArgument)("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const t=new c(e.name,e.chainId),r=e;return(r.ensAddress||null!=r.ensNetwork||r.ensUniversalResolver)&&t.attachPlugin(new s.EnsPlugin(r.ensAddress,r.ensNetwork,r.ensUniversalResolver)),t}(0,i.assertArgument)(!1,"invalid network","network",e)}static register(e,t){"number"==typeof e&&(e=BigInt(e));const r=a.get(e);r&&(0,i.assertArgument)(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),a.set(e,t)}}function u(e,t){const r=String(e);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const n=r.split(".");if(1===n.length&&n.push(""),2!==n.length)throw new Error(`invalid gwei value: ${e}`);for(;n[1].length<t;)n[1]+="0";if(n[1].length>9){let e=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||e++,n[1]=e.toString()}return BigInt(n[0]+n[1])}function l(e){return new s.FetchUrlFeeDataNetworkPlugin(e,async(e,t,r)=>{let n;r.setHeader("User-Agent","ethers");try{const[t,i]=await Promise.all([r.send(),e()]);n=t;const s=n.bodyJson.standard;return{gasPrice:i.gasPrice,maxFeePerGas:u(s.maxFee,9),maxPriorityFeePerGas:u(s.maxPriorityFee,9)}}catch(e){(0,i.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:n,error:e})}})}t.Network=c;let d=!1},4491(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchUrlFeeDataNetworkPlugin=t.FeeDataNetworkPlugin=t.EnsPlugin=t.GasCostPlugin=t.NetworkPlugin=void 0;const n=r(8166),i=r(5347),s=Symbol.for("nodejs.util.inspect.custom");class o{name;constructor(e){(0,n.defineProperties)(this,{name:e})}[s](){return this.toString()}toString(){return`${this.name} { }`}clone(){return new o(this.name)}}t.NetworkPlugin=o;class a extends o{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const r={effectiveBlock:e};function s(e,n){let s=(t||{})[e];null==s&&(s=n),(0,i.assertArgument)("number"==typeof s,`invalud value for ${e}`,"costs",t),r[e]=s}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),(0,n.defineProperties)(this,r)}toString(){return`${this.name} { txBase: ${this.txBase}, txCreate: ${this.txCreate}, txDataZero: ${this.txDataZero}, txAccessListStorageKey: ${this.txAccessListStorageKey}, txAccessListAddress: ${this.txAccessListAddress} }`}clone(){return new a(this.effectiveBlock,this)}}t.GasCostPlugin=a;class c extends o{address;targetNetwork;universalResolver;constructor(e,t,r){super("org.ethers.plugins.network.Ens"),(0,n.defineProperties)(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:t??1,universalResolver:r})}toString(){return`${this.name} { address: ${this.address}, targetNetwork: ${this.targetNetwork}, universalResolver: ${this.universalResolver} }`}clone(){return new c(this.address,this.targetNetwork,this.universalResolver)}}t.EnsPlugin=c;class u extends o{#oe;get feeDataFunc(){return this.#oe}constructor(e){super("org.ethers.plugins.network.FeeData"),this.#oe=e}async getFeeData(e){return await this.#oe(e)}clone(){return new u(this.#oe)}}t.FeeDataNetworkPlugin=u,t.FetchUrlFeeDataNetworkPlugin=class extends o{#ae;#ce;get url(){return this.#ae}get processFunc(){return this.#ce}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#ae=e,this.#ce=t}toString(){return`${this.name} { url: ${this.url} }`}clone(){return this}}},7841(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlchemyProvider=void 0;const n=r(5347),i=r(9973),s=r(5317),o=r(2371),a="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class c extends o.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=s.Network.from(e);null==t&&(t=a),super(c.getRequest(r,t),r,{staticNetwork:r}),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new c(e,this.apiKey)}catch(e){}return super._getProvider(e)}async _perform(e){if("getTransactionResult"===e.method){const{trace:t,tx:r}=await(0,n.resolveProperties)({trace:this.send("trace_transaction",[e.hash]),tx:this.getTransaction(e.hash)});if(null==t||null==r)return null;let i,s=!1;try{i=t[0].result.output,s="Reverted"===t[0].error}catch(e){}if(i)return(0,n.assert)(!s,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:r,invocation:null,revert:null}),i;(0,n.assert)(!1,"could not parse trace result","BAD_DATA",{value:t})}return await super._perform(e)}isCommunityResource(){return this.apiKey===a}static getRequest(e,t){null==t&&(t=a);const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"eth-mainnet.g.alchemy.com";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"bnb":return"bnb-mainnet.g.alchemy.com";case"bnbt":return"bnb-testnet.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/v2/${t}`);return r.allowGzip=!0,t===a&&(r.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("alchemy"),!0)),r}}t.AlchemyProvider=c},6806(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnkrProvider=void 0;const n=r(5347),i=r(9973),s=r(5317),o=r(2371),a="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class c extends o.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=s.Network.from(e);null==t&&(t=a);const i={polling:!0,staticNetwork:r};super(c.getRequest(r,t),r,i),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new c(e,this.apiKey)}catch(e){}return super._getProvider(e)}static getRequest(e,t){null==t&&(t=a);const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"filecoin":return"rpc.ankr.com/filecoin";case"filecoin-calibration":return"rpc.ankr.com/filecoin_testnet";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/${t}`);return r.allowGzip=!0,t===a&&(r.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("AnkrProvider"),!0)),r}getRpcError(e,t){return"eth_sendRawTransaction"===e.method&&t&&t.error&&"INTERNAL_ERROR: could not replace existing tx"===t.error.message&&(t.error.message="replacement transaction underpriced"),super.getRpcError(e,t)}isCommunityResource(){return this.apiKey===a}}t.AnkrProvider=c},9349(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlockscoutProvider=void 0;const n=r(5347),i=r(5317),s=r(2371);class o extends s.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=i.Network.from(e);null==t&&(t="proapi_gwcAAagyQKJ4r2KrAATyyCshiyUEpWfr2x7aKDOWFc56ZY8mBFcT9KZuP5Ce2jIfr_kHzUm"),super(o.getRequest(r),r,{staticNetwork:r}),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new o(e,this.apiKey)}catch(e){}return super._getProvider(e)}isCommunityResource(){return null===this.apiKey}getRpcRequest(e){const t=super.getRpcRequest(e);return t&&"eth_estimateGas"===t.method&&1==t.args.length&&(t.args=t.args.slice(),t.args.push("latest")),t}getRpcError(e,t){const r=t?t.error:null;if(r&&-32015===r.code&&!(0,n.isHexString)(r.data||"",!0)){const e={"assert(false)":"01","arithmetic underflow or overflow":"11","division or modulo by zero":"12","out-of-bounds array access; popping on an empty array":"31","out-of-bounds access of an array or bytesN":"32"};let t="";"VM execution error."===r.message?t=e[r.data]||"":e[r.message||""]&&(t=e[r.message||""]),t&&(r.message+=` (reverted: ${r.data})`,r.data="0x4e487b7100000000000000000000000000000000000000000000000000000000000000"+t)}else r&&-32e3===r.code&&"wrong transaction nonce"===r.message&&(r.message+=" (nonce too low)");return super.getRpcError(e,t)}static getRequest(e){const t=new n.FetchRequest(function(e){switch(e){case"mainnet":return"https://eth.blockscout.com/api/eth-rpc";case"sepolia":return"https://eth-sepolia.blockscout.com/api/eth-rpc";case"holesky":return"https://eth-holesky.blockscout.com/api/eth-rpc";case"classic":return"https://etc.blockscout.com/api/eth-rpc";case"arbitrum":return"https://arbitrum.blockscout.com/api/eth-rpc";case"base":return"https://base.blockscout.com/api/eth-rpc";case"base-sepolia":return"https://base-sepolia.blockscout.com/api/eth-rpc";case"matic":return"https://polygon.blockscout.com/api/eth-rpc";case"optimism":return"https://optimism.blockscout.com/api/eth-rpc";case"optimism-sepolia":return"https://optimism-sepolia.blockscout.com/api/eth-rpc";case"xdai":return"https://gnosis.blockscout.com/api/eth-rpc"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name));return t.allowGzip=!0,t}}t.BlockscoutProvider=o},254(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserProvider=void 0;const n=r(5347),i=r(2371);class s extends i.JsonRpcApiPollingProvider{#ue;#le;constructor(e,t,r){const i=Object.assign({},null!=r?r:{},{batchMaxCount:1});(0,n.assertArgument)(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(t,i),this.#le=null,r&&r.providerInfo&&(this.#le=r.providerInfo),this.#ue=async(t,r)=>{const n={method:t,params:r};this.emit("debug",{action:"sendEip1193Request",payload:n});try{const t=await e.request(n);return this.emit("debug",{action:"receiveEip1193Result",result:t}),t}catch(e){const t=new Error(e.message);throw t.code=e.code,t.data=e.data,t.payload=n,this.emit("debug",{action:"receiveEip1193Error",error:t}),t}}}get providerInfo(){return this.#le}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){(0,n.assertArgument)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const t=await this.#ue(e.method,e.params||[]);return[{id:e.id,result:t}]}catch(t){return[{id:e.id,error:{code:t.code,data:t.data,message:t.message}}]}}getRpcError(e,t){switch((t=JSON.parse(JSON.stringify(t))).error.code||-1){case 4001:t.error.message=`ethers-user-denied: ${t.error.message}`;break;case 4200:t.error.message=`ethers-unsupported: ${t.error.message}`}return super.getRpcError(e,t)}async hasSigner(e){null==e&&(e=0);const t=await this.send("eth_accounts",[]);return"number"==typeof e?t.length>e:(e=e.toLowerCase(),0!==t.filter(t=>t.toLowerCase()===e).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await this.#ue("eth_requestAccounts",[])}catch(e){const t=e.payload;throw this.getRpcError(t,{id:t.id,error:e})}return await super.getSigner(e)}static async discover(e){if(null==e&&(e={}),e.provider)return new s(e.provider);const t=e.window?e.window:"undefined"!=typeof window?window:null;if(null==t)return null;const r=e.anyProvider;if(r&&t.ethereum)return new s(t.ethereum);if(!("addEventListener"in t&&"dispatchEvent"in t&&"removeEventListener"in t))return null;const i=e.timeout?e.timeout:300;return 0===i?null:await new Promise((o,a)=>{let c=[];const u=e=>{c.push(e.detail),r&&l()},l=()=>{if(clearTimeout(d),c.length)if(e&&e.filter){const t=e.filter(c.map(e=>Object.assign({},e.info)));if(null==t)o(null);else if(t instanceof s)o(t);else{let e=null;if(t.uuid&&(e=c.filter(e=>t.uuid===e.info.uuid)[0]),e){const{provider:t,info:r}=e;o(new s(t,void 0,{providerInfo:r}))}else a((0,n.makeError)("filter returned unknown info","UNSUPPORTED_OPERATION",{value:t}))}}else{const{provider:e,info:t}=c[0];o(new s(e,void 0,{providerInfo:t}))}else o(null);t.removeEventListener("eip6963:announceProvider",u)},d=setTimeout(()=>{l()},i);t.addEventListener("eip6963:announceProvider",u),t.dispatchEvent(new Event("eip6963:requestProvider"))})}}t.BrowserProvider=s},8907(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChainstackProvider=void 0;const n=r(5347),i=r(9973),s=r(5317),o=r(2371);function a(e){switch(e){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}(0,n.assertArgument)(!1,"unsupported network","network",e)}class c extends o.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=s.Network.from(e);null==t&&(t=a(r.name)),super(c.getRequest(r,t),r,{staticNetwork:r}),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new c(e,this.apiKey)}catch(e){}return super._getProvider(e)}isCommunityResource(){return this.apiKey===a(this._network.name)}static getRequest(e,t){null==t&&(t=a(e.name));const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/${t}`);return r.allowGzip=!0,t===a(e.name)&&(r.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("ChainstackProvider"),!0)),r}}t.ChainstackProvider=c},2271(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CloudflareProvider=void 0;const n=r(5347),i=r(5317),s=r(2371);class o extends s.JsonRpcProvider{constructor(e){null==e&&(e="mainnet");const t=i.Network.from(e);(0,n.assertArgument)("mainnet"===t.name,"unsupported network","network",e),super("https://cloudflare-eth.com/",t,{staticNetwork:t})}}t.CloudflareProvider=o},5047(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EtherscanProvider=t.EtherscanPlugin=void 0;const n=r(8456),i=r(9288),s=r(7778),o=r(5347),a=r(8672),c=r(5317),u=r(4491),l=r(9973),d="1 11155111 17000 560048 2741 11124 33111 33139 42170 42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300".split(/ /g),f="org.ethers.plugins.provider.Etherscan";class h extends u.NetworkPlugin{baseUrl;constructor(e){super(f),(0,o.defineProperties)(this,{baseUrl:e})}clone(){return new h(this.baseUrl)}}t.EtherscanPlugin=h;const p=["enableCcipRead"];let g=1;class m extends a.AbstractProvider{network;apiKey;#de;constructor(e,t){const r=null!=t?t:null;super();const n=c.Network.from(e);(0,o.assertArgument)(d.indexOf(`${n.chainId}`)>=0,"unsupported network","network",n),this.#de=n.getPlugin(f),(0,o.defineProperties)(this,{apiKey:r,network:n})}getBaseUrl(){if(this.#de)return this.#de.baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}(0,o.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(e,t){let r=Object.keys(t).reduce((e,r)=>{const n=t[r];return null!=n&&(e+=`&${r}=${n}`),e},"");return this.apiKey&&(r+=`&apikey=${this.apiKey}`),`https://api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${e}${r}`}getPostUrl(){return`https://api.etherscan.io/v2/api?chainid=${this.network.chainId}`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t.chainid=this.network.chainId,t}async detectNetwork(){return this.network}async fetch(e,t,r){const n=g++,i=r?this.getPostUrl():this.getUrl(e,t),s=r?this.getPostData(e,t):null;this.emit("debug",{action:"sendRequest",id:n,url:i,payload:s});const a=new o.FetchRequest(i);a.setThrottleParams({slotInterval:1e3}),a.retryFunc=(e,t,r)=>(this.isCommunityResource()&&(0,l.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),a.processFunc=async(t,r)=>{const i=r.hasBody()?JSON.parse((0,o.toUtf8String)(r.body)):{},s=("string"==typeof i.result?i.result:"").toLowerCase().indexOf("rate limit")>=0;return"proxy"===e?i&&0==i.status&&"NOTOK"==i.message&&s&&(this.emit("debug",{action:"receiveError",id:n,reason:"proxy-NOTOK",error:i}),r.throwThrottleError(i.result,2e3)):s&&(this.emit("debug",{action:"receiveError",id:n,reason:"null result",error:i.result}),r.throwThrottleError(i.result,2e3)),r},s&&(a.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),a.body=Object.keys(s).map(e=>`${e}=${s[e]}`).join("&"));const c=await a.send();try{c.assertOk()}catch(e){this.emit("debug",{action:"receiveError",id:n,error:e,reason:"assertOk"}),(0,o.assert)(!1,"response error","SERVER_ERROR",{request:a,response:c})}c.hasBody()||(this.emit("debug",{action:"receiveError",id:n,error:"missing body",reason:"null body"}),(0,o.assert)(!1,"missing response","SERVER_ERROR",{request:a,response:c}));const u=JSON.parse((0,o.toUtf8String)(c.body));return"proxy"===e?("2.0"!=u.jsonrpc&&(this.emit("debug",{action:"receiveError",id:n,result:u,reason:"invalid JSON-RPC"}),(0,o.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:a,response:c,info:{result:u}})),u.error&&(this.emit("debug",{action:"receiveError",id:n,result:u,reason:"JSON-RPC error"}),(0,o.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:n,result:u}),u.result):0!=u.status||"No records found"!==u.message&&"No transactions found"!==u.message?((1!=u.status||"string"==typeof u.message&&!u.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:n,result:u}),(0,o.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:n,result:u}),u.result):(this.emit("debug",{action:"receiveRequest",id:n,result:u}),u.result)}_getTransactionPostData(e){const t={};for(let r in e){if(p.indexOf(r)>=0)continue;if(null==e[r])continue;let n=e[r];if(!("type"===r&&0===n||"blockTag"===r&&"latest"===n)){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r])n=(0,o.toQuantity)(n);else if("accessList"===r)n="["+(0,s.accessListify)(n).map(e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`).join(",")+"]";else if("blobVersionedHashes"===r){if(0===n.length)continue;(0,o.assert)(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:e}})}else n=(0,o.hexlify)(n);t[r]=n}}return t}_checkError(e,t,r){let i="";if((0,o.isError)(t,"SERVER_ERROR")){try{i=t.info.result.error.message}catch(e){}if(!i)try{i=t.info.message}catch(e){}}if("estimateGas"===e.method&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&(0,o.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.transaction}),("call"===e.method||"estimateGas"===e.method)&&i.match(/execution reverted/i)){let r="";try{r=t.info.result.error.data}catch(t){}const i=n.AbiCoder.getBuiltinCallException(e.method,e.transaction,r);throw i.info={request:e,error:t},i}if(i&&"broadcastTransaction"===e.method){const t=s.Transaction.from(e.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&(0,o.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:t}),i.match(/insufficient funds/)&&(0,o.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:t}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,o.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:t})}throw t}async _detectNetwork(){return this.network}async _perform(e){switch(e.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if("mainnet"===this.network.name)return"1000000000";if("optimism"===this.network.name)return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(t=>this._checkError(e,t,e.signedTransaction));case"getBlock":if("blockTag"in e)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});(0,o.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.hash});case"call":{if("latest"!==e.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_call";try{return await this.fetch("proxy",t,!0)}catch(t){return this._checkError(e,t,e.transaction)}}case"estimateGas":{const t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return await this.fetch("proxy",t,!0)}catch(t){return this._checkError(e,t,e.transaction)}}}return super._perform(e)}async getNetwork(){return this.network}async getEtherPrice(){return"mainnet"!==this.network.name?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(e){let t=this._getAddress(e);var r;(r=t)&&"function"==typeof r.then&&(t=await t);try{const e=await this.fetch("contract",{action:"getabi",address:t}),r=JSON.parse(e);return new i.Contract(t,r,this)}catch(e){return null}}isCommunityResource(){return null==this.apiKey}}t.EtherscanProvider=m},9902(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FallbackProvider=void 0;const n=r(5347),i=r(8672),s=r(5317),o=BigInt("1"),a=BigInt("2");function c(){return(new Date).getTime()}function u(e){return JSON.stringify(e,(e,t)=>"bigint"==typeof t?{type:"bigint",value:t.toString()}:t)}const l={stallTimeout:400,priority:1,weight:1},d={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};function f(e){if(null==e)return"null";if(Array.isArray(e))return"["+e.map(f).join(",")+"]";if("object"==typeof e&&"function"==typeof e.toJSON)return f(e.toJSON());switch(typeof e){case"boolean":case"symbol":return e.toString();case"bigint":case"number":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const t=Object.keys(e);return t.sort(),"{"+t.map(t=>`${JSON.stringify(t)}:${f(e[t])}`).join(",")+"}"}}throw console.log("Could not serialize",e),new Error("Hmm...")}function h(e,t){if("error"in t){const e=t.error;let r;return r=(0,n.isError)(e,"CALL_EXCEPTION")?f(Object.assign({},e,{shortMessage:void 0,reason:void 0,info:void 0})):f(e),{tag:r,value:e}}const r=t.result;return{tag:f(r),value:r}}function p(e,t){const r=new Map;for(const{value:e,tag:n,weight:i}of t){const t=r.get(n)||{value:e,weight:0};t.weight+=i,r.set(n,t)}let n=null;for(const t of r.values())t.weight>=e&&(!n||t.weight>n.weight)&&(n=t);if(n)return n.value}function g(e,t){let r=0;const n=new Map;let i=null;const s=[];for(const{value:e,tag:o,weight:a}of t)if(e instanceof Error){const t=n.get(o)||{value:e,weight:0};t.weight+=a,n.set(o,t),(null==i||t.weight>i.weight)&&(i=t)}else s.push(BigInt(e)),r+=a;if(r<e)return i&&i.weight>=e?i.value:void 0;s.sort((e,t)=>e<t?-1:t>e?1:0);const c=Math.floor(s.length/2);return s.length%2?s[c]:(s[c-1]+s[c]+o)/a}function m(e,t){const r=p(e,t);if(void 0!==r)return r;for(const e of t)if(e.value)return e.value}class y extends i.AbstractProvider{quorum;eventQuorum;eventWorkers;#fe;#he;#pe;constructor(e,t,r){super(t,r),this.#fe=e.map(e=>e instanceof i.AbstractProvider?Object.assign({provider:e},l,d):Object.assign({},l,e,d)),this.#he=-2,this.#pe=null,r&&null!=r.quorum?this.quorum=r.quorum:this.quorum=Math.ceil(this.#fe.reduce((e,t)=>e+t.weight,0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,n.assertArgument)(this.quorum<=this.#fe.reduce((e,t)=>e+t.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return this.#fe.map(e=>{const t=Object.assign({},e);for(const e in t)"_"===e[0]&&delete t[e];return t})}async _detectNetwork(){return s.Network.from((0,n.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(e,t){switch(t.method){case"broadcastTransaction":return await e.broadcastTransaction(t.signedTransaction);case"call":return await e.call(Object.assign({},t.transaction,{blockTag:t.blockTag}));case"chainId":return(await e.getNetwork()).chainId;case"estimateGas":return await e.estimateGas(t.transaction);case"getBalance":return await e.getBalance(t.address,t.blockTag);case"getBlock":{const r="blockHash"in t?t.blockHash:t.blockTag;return await e.getBlock(r,t.includeTransactions)}case"getBlockNumber":return await e.getBlockNumber();case"getCode":return await e.getCode(t.address,t.blockTag);case"getGasPrice":return(await e.getFeeData()).gasPrice;case"getPriorityFee":return(await e.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await e.getLogs(t.filter);case"getStorage":return await e.getStorage(t.address,t.position,t.blockTag);case"getTransaction":return await e.getTransaction(t.hash);case"getTransactionCount":return await e.getTransactionCount(t.address,t.blockTag);case"getTransactionReceipt":return await e.getTransactionReceipt(t.hash);case"getTransactionResult":return await e.getTransactionResult(t.hash)}}#ge(e){const t=Array.from(e).map(e=>e.config),r=this.#fe.slice();!function(e){for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}}(r),r.sort((e,t)=>e.priority-t.priority);for(const e of r)if(!e._lastFatalError&&-1===t.indexOf(e))return e;return null}#me(e,t){const r=this.#ge(e);if(null==r)return null;const n={config:r,result:null,didBump:!1,perform:null,staller:null},i=c();return n.perform=(async()=>{try{r.requests++;const e=await this._translatePerform(r.provider,t);n.result={result:e}}catch(e){r.errorResponses++,n.result={error:e}}const e=c()-i;r._totalTime+=e,r.rollingDuration=.95*r.rollingDuration+.05*e,n.perform=null})(),n.staller=(async()=>{var e;await(e=r.stallTimeout,new Promise(t=>{setTimeout(t,e)})),n.staller=null})(),e.add(n),n}async#ye(){let e=this.#pe;if(!e){const t=[];this.#fe.forEach(e=>{t.push((async()=>{await async function(e){for(;(e.blockNumber<0||e.blockNumber<0)&&(e._updateNumber||(e._updateNumber=(async()=>{try{const t=await e.provider.getBlockNumber();t>e.blockNumber&&(e.blockNumber=t)}catch(t){e.blockNumber=-2,e._lastFatalError=t,e._lastFatalErrorTimestamp=c()}e._updateNumber=null})()),await e._updateNumber,e.outOfSync++,!e._lastFatalError););}(e),e._lastFatalError||(e._network=await e.provider.getNetwork())})())}),this.#pe=e=(async()=>{await Promise.all(t);let e=null;for(const t of this.#fe){if(t._lastFatalError)continue;const r=t._network;null==e?e=r.chainId:r.chainId!==e&&(0,n.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})()}await e}async#be(e,t){const r=[];for(const n of e)if(null!=n.result){const{tag:e,value:i}=h(t.method,n.result);r.push({tag:e,value:i,weight:n.config.weight})}if(!(r.reduce((e,t)=>e+t.weight,0)<this.quorum)){switch(t.method){case"getBlockNumber":{-2===this.#he&&(this.#he=Math.ceil((0,n.getNumber)(g(this.quorum,this.#fe.filter(e=>!e._lastFatalError).map(e=>({value:e.blockNumber,tag:(0,n.getNumber)(e.blockNumber).toString(),weight:e.weight}))))));const e=function(e,t){if(1===e)return(0,n.getNumber)(g(e,t),"%internal");const r=new Map,i=(e,t)=>{const n=r.get(e)||{result:e,weight:0};n.weight+=t,r.set(e,n)};for(const{weight:e,value:r}of t){const t=(0,n.getNumber)(r);i(t-1,e),i(t,e),i(t+1,e)}let s,o=0;for(const{weight:t,result:n}of r.values())t>=e&&(t>o||null!=s&&t===o&&n>s)&&(o=t,s=n);return s}(this.quorum,r);if(void 0===e)return;return e>this.#he&&(this.#he=e),this.#he}case"getGasPrice":case"getPriorityFee":case"estimateGas":return g(this.quorum,r);case"getBlock":return"blockTag"in t&&"pending"===t.blockTag?m(this.quorum,r):p(this.quorum,r);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return p(this.quorum,r);case"broadcastTransaction":return m(this.quorum,r)}(0,n.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${u(t.method)})`})}}async#we(e,t){if(0===e.size)throw new Error("no runners?!");const r=[];let i=0;for(const t of e)t.perform&&r.push(t.perform),t.staller?r.push(t.staller):t.didBump||(t.didBump=!0,i++);const s=await this.#be(e,t);if(void 0!==s){if(s instanceof Error)throw s;return s}for(let r=0;r<i;r++)this.#me(e,t);return(0,n.assert)(r.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:t,results:Array.from(e).map(e=>u(e.result))}}),await Promise.race(r),await this.#we(e,t)}async _perform(e){if("broadcastTransaction"===e.method){const t=this.#fe.map(e=>null),r=this.#fe.map(async({provider:r,weight:n},i)=>{try{const s=await r._perform(e);t[i]=Object.assign(h(e.method,{result:s}),{weight:n})}catch(r){t[i]=Object.assign(h(e.method,{error:r}),{weight:n})}});for(;;){const e=t.filter(e=>null!=e);for(const{value:t}of e)if(!(t instanceof Error))return t;const i=p(this.quorum,t.filter(e=>null!=e));if((0,n.isError)(i,"INSUFFICIENT_FUNDS"))throw i;const s=r.filter((e,r)=>null==t[r]);if(0===s.length)break;await Promise.race(s)}const i=m(this.quorum,t);if((0,n.assert)(void 0!==i,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:t.map(u)}}),i instanceof Error)throw i;return i}await this.#ye();const t=new Set;let r=0;for(;;){const n=this.#me(t,e);if(null==n)break;if(r+=n.config.weight,r>=this.quorum)break}const i=await this.#we(t,e);for(const e of t)e.perform&&null==e.result&&e.config.lateResponses++;return i}async destroy(){for(const{provider:e}of this.#fe)e.destroy();super.destroy()}}t.FallbackProvider=y},5855(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfuraProvider=t.InfuraWebSocketProvider=void 0;const n=r(5347),i=r(9973),s=r(5317),o=r(2371),a=r(873),c="84842078b09946638c03157f83405213";class u extends a.WebSocketProvider{projectId;projectSecret;constructor(e,t){const r=new l(e,t),i=r._getConnection();(0,n.assert)(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"}),super(i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),r._network),(0,n.defineProperties)(this,{projectId:r.projectId,projectSecret:r.projectSecret})}isCommunityResource(){return this.projectId===c}}t.InfuraWebSocketProvider=u;class l extends o.JsonRpcProvider{projectId;projectSecret;constructor(e,t,r){null==e&&(e="mainnet");const i=s.Network.from(e);null==t&&(t=c),null==r&&(r=null),super(l.getRequest(i,t,r),i,{staticNetwork:i}),(0,n.defineProperties)(this,{projectId:t,projectSecret:r})}_getProvider(e){try{return new l(e,this.projectId,this.projectSecret)}catch(e){}return super._getProvider(e)}isCommunityResource(){return this.projectId===c}static getWebSocketProvider(e,t){return new u(e,t)}static getRequest(e,t,r){null==t&&(t=c),null==r&&(r=null);const s=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":case"base-goerli":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bsc-mainnet.infura.io";case"bnbt":return"bsc-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/v3/${t}`);return s.allowGzip=!0,r&&s.setCredentials("",r),t===c&&(s.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("InfuraProvider"),!0)),s}}t.InfuraProvider=l},4584(e,t){"use strict";t.IpcSocketProvider=void 0,t.IpcSocketProvider=void 0},2371(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=t.JsonRpcApiPollingProvider=t.JsonRpcApiProvider=t.JsonRpcSigner=void 0;const n=r(8456),i=r(646),s=r(1181),o=r(7778),a=r(5347),c=r(8672),u=r(3071),l=r(5317),d=r(7966),f=r(4338),h="bigint,boolean,function,number,string,symbol".split(/,/g);function p(e){if(null==e||h.indexOf(typeof e)>=0)return e;if("function"==typeof e.getAddress)return e;if(Array.isArray(e))return e.map(p);if("object"==typeof e)return Object.keys(e).reduce((t,r)=>(t[r]=e[r],t),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function g(e){return new Promise(t=>{setTimeout(t,e)})}function m(e){return e?e.toLowerCase():e}function y(e){return e&&"number"==typeof e.pollingInterval}const b={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class w extends u.AbstractSigner{address;constructor(e,t){super(e),t=(0,i.getAddress)(t),(0,a.defineProperties)(this,{address:t})}connect(e){(0,a.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=p(e),r=[];if(t.from){const n=t.from;r.push((async()=>{const r=await(0,i.resolveAddress)(n,this.provider);(0,a.assertArgument)(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r})())}else t.from=this.address;if(null==t.gasLimit&&r.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),null!=t.to){const e=t.to;r.push((async()=>{t.to=await(0,i.resolveAddress)(e,this.provider)})())}r.length&&await Promise.all(r);const n=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[n])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(e);return await new Promise((e,n)=>{const i=[1e3,100];let s=0;const o=async()=>{try{const n=await this.provider.getTransaction(r);if(null!=n)return void e(n.replaceableTransaction(t))}catch(e){if((0,a.isError)(e,"CANCELLED")||(0,a.isError)(e,"BAD_DATA")||(0,a.isError)(e,"NETWORK_ERROR")||(0,a.isError)(e,"UNSUPPORTED_OPERATION"))return null==e.info&&(e.info={}),e.info.sendTransactionHash=r,void n(e);if((0,a.isError)(e,"INVALID_ARGUMENT")&&(s++,null==e.info&&(e.info={}),e.info.sendTransactionHash=r,s>10))return void n(e);this.provider.emit("error",(0,a.makeError)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:e}))}this.provider._setTimeout(()=>{o()},i.pop()||4e3)};o()})}async signTransaction(e){const t=p(e);if(t.from){const r=await(0,i.resolveAddress)(t.from,this.provider);(0,a.assertArgument)(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r}else t.from=this.address;const r=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[r])}async signMessage(e){const t="string"==typeof e?(0,a.toUtf8Bytes)(e):e;return await this.provider.send("personal_sign",[(0,a.hexlify)(t),this.address.toLowerCase()])}async signTypedData(e,t,r){const n=p(r),o=await s.TypedDataEncoder.resolveNames(e,t,n,async e=>{const t=await(0,i.resolveAddress)(e);return(0,a.assertArgument)(null!=t,"TypedData does not support null address","value",e),t});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(s.TypedDataEncoder.getPayload(o.domain,t,o.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t="string"==typeof e?(0,a.toUtf8Bytes)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,a.hexlify)(t)])}}t.JsonRpcSigner=w;class _ extends c.AbstractProvider{#_;#_e;#ve;#Ae;#ke;#Pe;#Ee;#xe(){if(this.#Ae)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#Ae=setTimeout(()=>{this.#Ae=null;const e=this.#ve;for(this.#ve=[];e.length;){const t=[e.shift()];for(;e.length&&t.length!==this.#_.batchMaxCount;)if(t.push(e.shift()),JSON.stringify(t.map(e=>e.payload)).length>this.#_.batchMaxSize){e.unshift(t.pop());break}(async()=>{const e=1===t.length?t[0].payload:t.map(e=>e.payload);this.emit("debug",{action:"sendRpcPayload",payload:e});try{const r=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:r});for(const{resolve:e,reject:n,payload:i}of t){if(this.destroyed){n((0,a.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:i.method}));continue}const t=r.filter(e=>e.id===i.id)[0];if(null==t){const e=(0,a.makeError)("missing response for request","BAD_DATA",{value:r,info:{payload:i}});this.emit("error",e),n(e);continue}"error"in t?n(this.getRpcError(i,t)):e(t.result)}}catch(e){this.emit("debug",{action:"receiveRpcError",error:e});for(const{reject:r}of t)r(e)}})()}},e)}constructor(e,t){super(e,t),this.#_e=1,this.#_=Object.assign({},b,t||{}),this.#ve=[],this.#Ae=null,this.#Pe=null,this.#Ee=null;{let e=null;const t=new Promise(t=>{e=t});this.#ke={promise:t,resolve:e}}const r=this._getOption("staticNetwork");"boolean"==typeof r?((0,a.assertArgument)(!r||"any"!==e,"staticNetwork cannot be used on special network 'any'","options",t),r&&null!=e&&(this.#Pe=l.Network.from(e))):r&&((0,a.assertArgument)(null==e||r.matches(e),"staticNetwork MUST match network object","options",t),this.#Pe=r)}_getOption(e){return this.#_[e]}get _network(){return(0,a.assert)(this.#Pe,"network is not available yet","NETWORK_ERROR"),this.#Pe}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let t=e.transaction;if(t&&null!=t.type&&(0,a.getBigInt)(t.type)&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=await this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},t,{type:void 0})}))}}const t=this.getRpcRequest(e);return null!=t?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e){if(!0!==e)return e;if(this.#Pe)return this.#Pe}return this.#Ee?await this.#Ee:this.ready?(this.#Ee=(async()=>{try{const e=l.Network.from((0,a.getBigInt)(await this.send("eth_chainId",[])));return this.#Ee=null,e}catch(e){throw this.#Ee=null,e}})(),await this.#Ee):(this.#Ee=(async()=>{const e={id:this.#_e++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let t;this.emit("debug",{action:"sendRpcPayload",payload:e});try{t=(await this._send(e))[0],this.#Ee=null}catch(e){throw this.#Ee=null,this.emit("debug",{action:"receiveRpcError",error:e}),e}if(this.emit("debug",{action:"receiveRpcResult",result:t}),"result"in t)return l.Network.from((0,a.getBigInt)(t.result));throw this.getRpcError(e,t)})(),await this.#Ee)}_start(){null!=this.#ke&&null!=this.#ke.resolve&&(this.#ke.resolve(),this.#ke=null,(async()=>{for(;null==this.#Pe&&!this.destroyed;)try{this.#Pe=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,a.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await g(1e3)}this.#xe()})())}async _waitUntilReady(){if(null!=this.#ke)return await this.#ke.promise}_getSubscriber(e){return"pending"===e.type?new d.FilterIdPendingSubscriber(this):"event"===e.type?this._getOption("polling")?new f.PollingEventSubscriber(this,e.filter):new d.FilterIdEventSubscriber(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new c.UnmanagedSubscriber("orphan"):super._getSubscriber(e)}get ready(){return null==this.#ke}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(r=>{if(null==e[r])return;let n=r;"gasLimit"===r&&(n="gas"),t[n]=(0,a.toQuantity)((0,a.getBigInt)(e[r],`tx.${r}`))}),["from","to","data"].forEach(r=>{null!=e[r]&&(t[r]=(0,a.hexlify)(e[r]))}),e.accessList&&(t.accessList=(0,o.accessListify)(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(e=>e.toLowerCase())),e.authorizationList&&(t.authorizationList=e.authorizationList.map(e=>{const t=(0,o.authorizationify)(e);return{address:t.address,nonce:(0,a.toQuantity)(t.nonce),chainId:(0,a.toQuantity)(t.chainId),yParity:(0,a.toQuantity)(t.signature.yParity),r:(0,a.toQuantity)(t.signature.r),s:(0,a.toQuantity)(t.signature.s)}})),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[m(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[m(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[m(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[m(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(m):e.filter.address=m(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:r}=e,{error:i}=t;if("eth_estimateGas"===r&&i.message){const t=i.message;if(!t.match(/revert/i)&&t.match(/insufficient funds/i))return(0,a.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:i}});if(t.match(/nonce/i)&&t.match(/too low/i))return(0,a.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:i}})}if("eth_call"===r||"eth_estimateGas"===r){const t=A(i),s=n.AbiCoder.getBuiltinCallException("eth_call"===r?"call":"estimateGas",e.params[0],t?t.data:null);return s.info={error:i,payload:e},s}const s=JSON.stringify(function(e){const t=[];return k(e,t),t}(i));if("string"==typeof i.message&&i.message.match(/user denied|ethers-user-denied/i)){const t={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,a.makeError)("user rejected action","ACTION_REJECTED",{action:t[r]||"unknown",reason:"rejected",info:{payload:e,error:i}})}if("eth_sendRawTransaction"===r||"eth_sendTransaction"===r){const t=e.params[0];if(s.match(/insufficient funds|base fee exceeds gas limit/i))return(0,a.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:t,info:{error:i}});if(s.match(/nonce/i)&&s.match(/too low/i))return(0,a.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:t,info:{error:i}});if(s.match(/replacement transaction/i)&&s.match(/underpriced/i))return(0,a.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:t,info:{error:i}});if(s.match(/only replay-protected/i))return(0,a.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:t,info:{error:i}}})}let o=!!s.match(/the method .* does not exist/i);return o||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(o=!0),o?(0,a.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:i,payload:e}}):(0,a.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:e})}send(e,t){if(this.destroyed)return Promise.reject((0,a.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const r=this.#_e++,n=new Promise((n,i)=>{this.#ve.push({resolve:n,reject:i,payload:{method:e,params:t,id:r,jsonrpc:"2.0"}})});return this.#xe(),n}async getSigner(e){null==e&&(e=0);const t=this.send("eth_accounts",[]);if("number"==typeof e){const r=await t;if(e>=r.length)throw new Error("no such account");return new w(this,r[e])}const{accounts:r}=await(0,a.resolveProperties)({network:this.getNetwork(),accounts:t});e=(0,i.getAddress)(e);for(const t of r)if((0,i.getAddress)(t)===e)return new w(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(e=>new w(this,e))}destroy(){this.#Ae&&(clearTimeout(this.#Ae),this.#Ae=null);for(const{payload:e,reject:t}of this.#ve)t((0,a.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#ve=[],super.destroy()}}t.JsonRpcApiProvider=_;class v extends _{#Oe;constructor(e,t){super(e,t);let r=this._getOption("pollingInterval");null==r&&(r=b.pollingInterval),this.#Oe=r}_getSubscriber(e){const t=super._getSubscriber(e);return y(t)&&(t.pollingInterval=this.#Oe),t}get pollingInterval(){return this.#Oe}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#Oe=e,this._forEachSubscriber(e=>{y(e)&&(e.pollingInterval=this.#Oe)})}}function A(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&(0,a.isHexString)(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const t in e){const r=A(e[t]);if(r)return r}return null}if("string"==typeof e)try{return A(JSON.parse(e))}catch(e){}return null}function k(e,t){if(null!=e){if("string"==typeof e.message&&t.push(e.message),"object"==typeof e)for(const r in e)k(e[r],t);if("string"==typeof e)try{return k(JSON.parse(e),t)}catch(e){}}}t.JsonRpcApiPollingProvider=v,t.JsonRpcProvider=class extends v{#Se;constructor(e,t,r){null==e&&(e="http://localhost:8545"),super(t,r),this.#Se="string"==typeof e?new a.FetchRequest(e):e.clone()}_getConnection(){return this.#Se.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){const t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");const r=await t.send();r.assertOk();let n=r.bodyJson;return Array.isArray(n)||(n=[n]),n}}},2398(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PocketProvider=void 0;const n=r(5347),i=r(9973),s=r(5317),o=r(2371),a="62e1ad51b37b8e00394bda3b";class c extends o.JsonRpcProvider{applicationId;applicationSecret;constructor(e,t,r){null==e&&(e="mainnet");const i=s.Network.from(e);null==t&&(t=a),null==r&&(r=null);const o={staticNetwork:i};super(c.getRequest(i,t,r),i,o),(0,n.defineProperties)(this,{applicationId:t,applicationSecret:r})}_getProvider(e){try{return new c(e,this.applicationId,this.applicationSecret)}catch(e){}return super._getProvider(e)}static getRequest(e,t,r){null==t&&(t=a);const s=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/v1/lb/${t}`);return s.allowGzip=!0,r&&s.setCredentials("",r),t===a&&(s.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("PocketProvider"),!0)),s}isCommunityResource(){return this.applicationId===a}}t.PocketProvider=c},8817(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickNodeProvider=void 0;const n=r(5347),i=r(9973),s=r(5317),o=r(2371),a="919b412a057b5e9c9b6dce193c5a60242d6efadb";class c extends o.JsonRpcProvider{token;constructor(e,t){null==e&&(e="mainnet");const r=s.Network.from(e);null==t&&(t=a),super(c.getRequest(r,t),r,{staticNetwork:r}),(0,n.defineProperties)(this,{token:t})}_getProvider(e){try{return new c(e,this.token)}catch(e){}return super._getProvider(e)}isCommunityResource(){return this.token===a}static getRequest(e,t){null==t&&(t=a);const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/${t}`);return r.allowGzip=!0,t===a&&(r.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("QuickNodeProvider"),!0)),r}}t.QuickNodeProvider=c},4945(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocketProvider=t.SocketEventSubscriber=t.SocketPendingSubscriber=t.SocketBlockSubscriber=t.SocketSubscriber=void 0;const n=r(8672),i=r(5347),s=r(2371);class o{#Te;#v;get filter(){return JSON.parse(this.#v)}#Be;#Re;#Ne;constructor(e,t){this.#Te=e,this.#v=JSON.stringify(t),this.#Be=null,this.#Re=null,this.#Ne=null}start(){this.#Be=this.#Te.send("eth_subscribe",this.filter).then(e=>(this.#Te._register(e,this),e))}stop(){this.#Be.then(e=>{this.#Te.destroyed||this.#Te.send("eth_unsubscribe",[e])}),this.#Be=null}pause(e){(0,i.assert)(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),this.#Re=!!e}resume(){this.#Re=null}_handleMessage(e){if(null!=this.#Be&&null===this.#Re){let t=this.#Ne;t=null==t?this._emit(this.#Te,e):t.then(async()=>{await this._emit(this.#Te,e)}),this.#Ne=t.then(()=>{this.#Ne===t&&(this.#Ne=null)})}}async _emit(e,t){throw new Error("sub-classes must implemente this; _emit")}}t.SocketSubscriber=o;class a extends o{constructor(e){super(e,["newHeads"])}async _emit(e,t){e.emit("block",parseInt(t.number))}}t.SocketBlockSubscriber=a;class c extends o{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,t){e.emit("pending",t)}}t.SocketPendingSubscriber=c;class u extends o{#Ce;get logFilter(){return JSON.parse(this.#Ce)}constructor(e,t){super(e,["logs",t]),this.#Ce=JSON.stringify(t)}async _emit(e,t){e.emit(this.logFilter,e._wrapLog(t,e._network))}}t.SocketEventSubscriber=u;class l extends s.JsonRpcApiProvider{#Ie;#N;#Fe;constructor(e,t){const r=Object.assign({},null!=t?t:{});(0,i.assertArgument)(null==r.batchMaxCount||1===r.batchMaxCount,"sockets-based providers do not support batches","options.batchMaxCount",t),r.batchMaxCount=1,null==r.staticNetwork&&(r.staticNetwork=!0),super(e,r),this.#Ie=new Map,this.#N=new Map,this.#Fe=new Map}_getSubscriber(e){switch(e.type){case"close":return new n.UnmanagedSubscriber("close");case"block":return new a(this);case"pending":return new c(this);case"event":return new u(this,e.filter);case"orphan":if("drop-log"===e.filter.orphan)return new n.UnmanagedSubscriber("drop-log")}return super._getSubscriber(e)}_register(e,t){this.#N.set(e,t);const r=this.#Fe.get(e);if(r){for(const e of r)t._handleMessage(e);this.#Fe.delete(e)}}async _send(e){(0,i.assertArgument)(!Array.isArray(e),"WebSocket does not support batch send","payload",e);const t=new Promise((t,r)=>{this.#Ie.set(e.id,{payload:e,resolve:t,reject:r})});return await this._waitUntilReady(),await this._write(JSON.stringify(e)),[await t]}async _processMessage(e){const t=JSON.parse(e);if(t&&"object"==typeof t&&"id"in t){const e=this.#Ie.get(t.id);if(null==e)return void this.emit("error",(0,i.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:t}));this.#Ie.delete(t.id),e.resolve(t)}else{if(!t||"eth_subscription"!==t.method)return void this.emit("error",(0,i.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:t}));{const e=t.params.subscription,r=this.#N.get(e);if(r)r._handleMessage(t.params.result);else{let r=this.#Fe.get(e);null==r&&(r=[],this.#Fe.set(e,r)),r.push(t.params.result)}}}}async _write(e){throw new Error("sub-classes must override this")}}t.SocketProvider=l},873(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketProvider=void 0;const n=r(3913),i=r(4945);class s extends i.SocketProvider{#Se;#Ue;get websocket(){if(null==this.#Ue)throw new Error("websocket closed");return this.#Ue}constructor(e,t,r){super(t,r),"string"==typeof e?(this.#Se=()=>new n.WebSocket(e),this.#Ue=this.#Se()):"function"==typeof e?(this.#Se=e,this.#Ue=e()):(this.#Se=null,this.#Ue=e),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(e){console.log("failed to start WebsocketProvider",e)}},this.websocket.onmessage=e=>{this._processMessage(e.data)}}async _write(e){this.websocket.send(e)}async destroy(){null!=this.#Ue&&(this.#Ue.close(),this.#Ue=null),super.destroy()}}t.WebSocketProvider=s},3807(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionResponse=t.TransactionReceipt=t.Log=t.Block=t.copyRequest=t.FeeData=void 0;const n=r(5347),i=r(7778),s=BigInt(0);function o(e){return e??null}function a(e){return null==e?null:e.toString()}t.FeeData=class{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,r){(0,n.defineProperties)(this,{gasPrice:o(e),maxFeePerGas:o(t),maxPriorityFeePerGas:o(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:a(e),maxFeePerGas:a(t),maxPriorityFeePerGas:a(r)}}},t.copyRequest=function(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=(0,n.hexlify)(e.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)i in e&&null!=e[i]&&(t[i]=(0,n.getBigInt)(e[i],`request.${i}`));const s="type,nonce".split(/,/);for(const r of s)r in e&&null!=e[r]&&(t[r]=(0,n.getNumber)(e[r],`request.${r}`));return e.accessList&&(t.accessList=(0,i.accessListify)(e.accessList)),e.authorizationList&&(t.authorizationList=e.authorizationList.slice()),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(t.kzg=e.kzg),"blobWrapperVersion"in e&&(t.blobWrapperVersion=e.blobWrapperVersion),"blobs"in e&&e.blobs&&(t.blobs=e.blobs.map(e=>(0,n.isBytesLike)(e)?(0,n.hexlify)(e):Object.assign({},e))),t};class c{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;transactionsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#je;constructor(e,t){this.#je=e.transactions.map(e=>"string"!=typeof e?new d(e,t):e),(0,n.defineProperties)(this,{provider:t,hash:o(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:o(e.prevRandao),extraData:e.extraData,baseFeePerGas:o(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot,transactionsRoot:e.transactionsRoot})}get transactions(){return this.#je.map(e=>"string"==typeof e?e:e.hash)}get prefetchedTransactions(){const e=this.#je.slice();return 0===e.length?[]:((0,n.assert)("object"==typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:r,gasLimit:n,gasUsed:i,hash:s,miner:o,prevRandao:c,nonce:u,number:l,parentHash:d,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:p,transactionsRoot:g,timestamp:m,transactions:y}=this;return{_type:"Block",baseFeePerGas:a(e),difficulty:a(t),extraData:r,gasLimit:a(n),gasUsed:a(i),blobGasUsed:a(this.blobGasUsed),excessBlobGas:a(this.excessBlobGas),hash:s,miner:o,prevRandao:c,nonce:u,number:l,parentHash:d,timestamp:m,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:p,transactionsRoot:g,transactions:y}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#je.length}get date(){return null==this.timestamp?null:new Date(1e3*this.timestamp)}async getTransaction(e){let t;if("number"==typeof e)t=this.#je[e];else{const r=e.toLowerCase();for(const e of this.#je){if("string"==typeof e){if(e!==r)continue;t=e;break}if(e.hash===r){t=e;break}}}if(null==t)throw new Error("no such tx");return"string"==typeof t?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){const t=this.prefetchedTransactions;if("number"==typeof e)return t[e];e=e.toLowerCase();for(const r of t)if(r.hash===e)return r;(0,n.assertArgument)(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return{orphan:"drop-block",hash:this.hash,number:this.number}}}t.Block=c;class u{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;const r=Object.freeze(e.topics.slice());(0,n.defineProperties)(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:r,data:n,index:i,removed:s,topics:o,transactionHash:a,transactionIndex:c}=this;return{_type:"log",address:e,blockHash:t,blockNumber:r,data:n,index:i,removed:s,topics:o,transactionHash:a,transactionIndex:c}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return(0,n.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return(0,n.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return(0,n.assert)(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return{orphan:"drop-log",log:{transactionHash:(e=this).transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,address:e.address,data:e.data,topics:Object.freeze(e.topics.slice()),index:e.index}};var e}}t.Log=u;class l{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#Le;constructor(e,t){this.#Le=Object.freeze(e.logs.map(e=>new u(e,t)));let r=s;null!=e.effectiveGasPrice?r=e.effectiveGasPrice:null!=e.gasPrice&&(r=e.gasPrice),(0,n.defineProperties)(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#Le}toJSON(){const{to:e,from:t,contractAddress:r,hash:n,index:i,blockHash:s,blockNumber:o,logsBloom:c,logs:u,status:l,root:d}=this;return{_type:"TransactionReceipt",blockHash:s,blockNumber:o,contractAddress:r,cumulativeGasUsed:a(this.cumulativeGasUsed),from:t,gasPrice:a(this.gasPrice),blobGasUsed:a(this.blobGasUsed),blobGasPrice:a(this.blobGasPrice),gasUsed:a(this.gasUsed),hash:n,index:i,logs:u,logsBloom:c,root:d,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(null==e)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(null==e)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return h(this)}reorderedEvent(e){return(0,n.assert)(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),f(this,e)}}t.TransactionReceipt=l;class d{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#De;constructor(e,t){this.provider=t,this.blockNumber=null!=e.blockNumber?e.blockNumber:null,this.blockHash=null!=e.blockHash?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=null!=e.maxPriorityFeePerGas?e.maxPriorityFeePerGas:null,this.maxFeePerGas=null!=e.maxFeePerGas?e.maxFeePerGas:null,this.maxFeePerBlobGas=null!=e.maxFeePerBlobGas?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=null!=e.accessList?e.accessList:null,this.blobVersionedHashes=null!=e.blobVersionedHashes?e.blobVersionedHashes:null,this.authorizationList=null!=e.authorizationList?e.authorizationList:null,this.#De=-1}toJSON(){const{blockNumber:e,blockHash:t,index:r,hash:n,type:i,to:s,from:o,nonce:c,data:u,signature:l,accessList:d,blobVersionedHashes:f}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:e,blockHash:t,blobVersionedHashes:f,chainId:a(this.chainId),data:u,from:o,gasLimit:a(this.gasLimit),gasPrice:a(this.gasPrice),hash:n,maxFeePerGas:a(this.maxFeePerGas),maxPriorityFeePerGas:a(this.maxPriorityFeePerGas),maxFeePerBlobGas:a(this.maxFeePerBlobGas),nonce:c,signature:l,to:s,index:r,type:i,value:a(this.value)}}async getBlock(){let e=this.blockNumber;if(null==e){const t=await this.getTransaction();t&&(e=t.blockNumber)}if(null==e)return null;const t=this.provider.getBlock(e);if(null==t)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(null==this.blockNumber){const{tx:e,blockNumber:t}=await(0,n.resolveProperties)({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return null==e||null==e.blockNumber?0:t-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){const r=e??1,i=t??0;let o=this.#De,a=-1,c=-1===o;const u=async()=>{if(c)return null;const{blockNumber:e,nonce:t}=await(0,n.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(t<this.nonce)return void(o=e);if(c)return null;const i=await this.getTransaction();if(!i||null==i.blockNumber)for(-1===a&&(a=o-3,a<this.#De&&(a=this.#De));a<=e;){if(c)return null;const t=await this.provider.getBlock(a,!0);if(null==t)return;for(const e of t)if(e===this.hash)return;for(let i=0;i<t.length;i++){const a=await t.getTransaction(i);if(a.from===this.from&&a.nonce===this.nonce){if(c)return null;const t=await this.provider.getTransactionReceipt(a.hash);if(null==t)return;if(e-t.blockNumber+1<r)return;let i="replaced";a.data===this.data&&a.to===this.to&&a.value===this.value?i="repriced":"0x"===a.data&&a.from===a.to&&a.value===s&&(i="cancelled"),(0,n.assert)(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:a.replaceableTransaction(o),hash:a.hash,receipt:t})}}a++}},l=e=>{if(null==e||0!==e.status)return e;(0,n.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},d=await this.provider.getTransactionReceipt(this.hash);if(0===r)return l(d);if(d){if(1===r||await d.confirmations()>=r)return l(d)}else if(await u(),0===r)return null;const f=new Promise((e,t)=>{const s=[],a=()=>{s.forEach(e=>e())};if(s.push(()=>{c=!0}),i>0){const e=setTimeout(()=>{a(),t((0,n.makeError)("wait for transaction timeout","TIMEOUT"))},i);s.push(()=>{clearTimeout(e)})}const d=async n=>{if(await n.confirmations()>=r){a();try{e(l(n))}catch(e){t(e)}}};if(s.push(()=>{this.provider.off(this.hash,d)}),this.provider.on(this.hash,d),o>=0){const e=async()=>{try{await u()}catch(e){if((0,n.isError)(e,"TRANSACTION_REPLACED"))return a(),void t(e)}c||this.provider.once("block",e)};s.push(()=>{this.provider.off("block",e)}),this.provider.once("block",e)}});return await f}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return(0,n.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),h(this)}reorderedEvent(e){return(0,n.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,n.assert)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),f(this,e)}replaceableTransaction(e){(0,n.assertArgument)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new d(this,this.provider);return t.#De=e,t}}function f(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function h(e){return{orphan:"drop-transaction",tx:e}}t.TransactionResponse=d},9596(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonceManager=void 0;const n=r(5347),i=r(3071);class s extends i.AbstractSigner{signer;#Me;#$e;constructor(e){super(e.provider),(0,n.defineProperties)(this,{signer:e}),this.#Me=null,this.#$e=0}async getAddress(){return this.signer.getAddress()}connect(e){return new s(this.signer.connect(e))}async getNonce(e){if("pending"===e){null==this.#Me&&(this.#Me=super.getNonce("pending"));const e=this.#$e;return await this.#Me+e}return super.getNonce(e)}increment(){this.#$e++}reset(){this.#$e=0,this.#Me=null}async sendTransaction(e){const t=this.getNonce("pending");return this.increment(),(e=await this.signer.populateTransaction(e)).nonce=await t,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,t,r){return this.signer.signTypedData(e,t,r)}}t.NonceManager=s},7966(e,t,r){"use strict";t.FilterIdPendingSubscriber=t.FilterIdEventSubscriber=void 0;const n=r(5347),i=r(4338);class s{#Te;#Ge;#He;#qe;#Pe;#We;constructor(e){this.#Te=e,this.#Ge=null,this.#He=this.#ze.bind(this),this.#qe=!1,this.#Pe=null,this.#We=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#ze(e){try{null==this.#Ge&&(this.#Ge=this._subscribe(this.#Te));let e=null;try{e=await this.#Ge}catch(e){if(!(0,n.isError)(e,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==e.operation)throw e}if(null==e)return this.#Ge=null,void this.#Te._recoverSubscriber(this,this._recover(this.#Te));const t=await this.#Te.getNetwork();if(this.#Pe||(this.#Pe=t),this.#Pe.chainId!==t.chainId)throw new Error("chaid changed");if(this.#We)return;const r=await this.#Te.send("eth_getFilterChanges",[e]);await this._emitResults(this.#Te,r)}catch(e){console.log("@TODO",e)}this.#Te.once("block",this.#He)}#Ve(){const e=this.#Ge;e&&(this.#Ge=null,e.then(e=>{this.#Te.destroyed||this.#Te.send("eth_uninstallFilter",[e])}))}start(){this.#qe||(this.#qe=!0,this.#ze(-2))}stop(){this.#qe&&(this.#qe=!1,this.#We=!0,this.#Ve(),this.#Te.off("block",this.#He))}pause(e){e&&this.#Ve(),this.#Te.off("block",this.#He)}resume(){this.start()}}t.FilterIdEventSubscriber=class extends s{#Ke;constructor(e,t){var r;super(e),this.#Ke=(r=t,JSON.parse(JSON.stringify(r)))}_recover(e){return new i.PollingEventSubscriber(e,this.#Ke)}async _subscribe(e){return await e.send("eth_newFilter",[this.#Ke])}async _emitResults(e,t){for(const r of t)e.emit(this.#Ke,e._wrapLog(r,e._network))}},t.FilterIdPendingSubscriber=class extends s{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const r of t)e.emit("pending",r)}}},4338(e,t,r){"use strict";t.PollingEventSubscriber=t.PollingTransactionSubscriber=t.PollingOrphanSubscriber=t.PollingBlockTagSubscriber=t.PollingBlockSubscriber=void 0;r(5347);function n(e){return JSON.parse(JSON.stringify(e))}t.PollingBlockSubscriber=class{#Te;#He;#Je;#Qe;constructor(e){this.#Te=e,this.#He=null,this.#Je=4e3,this.#Qe=-2}get pollingInterval(){return this.#Je}set pollingInterval(e){this.#Je=e}async#ze(){try{const e=await this.#Te.getBlockNumber();if(-2===this.#Qe)return void(this.#Qe=e);if(e!==this.#Qe){for(let t=this.#Qe+1;t<=e;t++){if(null==this.#He)return;await this.#Te.emit("block",t)}this.#Qe=e}}catch(e){}null!=this.#He&&(this.#He=this.#Te._setTimeout(this.#ze.bind(this),this.#Je))}start(){this.#He||(this.#He=this.#Te._setTimeout(this.#ze.bind(this),this.#Je),this.#ze())}stop(){this.#He&&(this.#Te._clearTimeout(this.#He),this.#He=null)}pause(e){this.stop(),e&&(this.#Qe=-2)}resume(){this.start()}};class i{#Te;#ze;#qe;constructor(e){this.#Te=e,this.#qe=!1,this.#ze=e=>{this._poll(e,this.#Te)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#qe||(this.#qe=!0,this.#ze(-2),this.#Te.on("block",this.#ze))}stop(){this.#qe&&(this.#qe=!1,this.#Te.off("block",this.#ze))}pause(e){this.stop()}resume(){this.start()}}t.PollingBlockTagSubscriber=class extends i{#Ze;#Ye;constructor(e,t){super(e),this.#Ze=t,this.#Ye=-2}pause(e){e&&(this.#Ye=-2),super.pause(e)}async _poll(e,t){const r=await t.getBlock(this.#Ze);null!=r&&(-2===this.#Ye?this.#Ye=r.number:r.number>this.#Ye&&(t.emit(this.#Ze,r.number),this.#Ye=r.number))}},t.PollingOrphanSubscriber=class extends i{#v;constructor(e,t){super(e),this.#v=n(t)}async _poll(e,t){throw new Error("@TODO")}};t.PollingTransactionSubscriber=class extends i{#Xe;constructor(e,t){super(e),this.#Xe=t}async _poll(e,t){const r=await t.getTransactionReceipt(this.#Xe);r&&t.emit(this.#Xe,r)}},t.PollingEventSubscriber=class{#Te;#v;#He;#qe;#Qe;constructor(e,t){this.#Te=e,this.#v=n(t),this.#He=this.#ze.bind(this),this.#qe=!1,this.#Qe=-2}async#ze(e){if(-2===this.#Qe)return;const t=n(this.#v);t.fromBlock=this.#Qe+1,t.toBlock=e;const r=await this.#Te.getLogs(t);if(0!==r.length)for(const e of r)this.#Te.emit(this.#v,e),this.#Qe=e.blockNumber;else this.#Qe<e-60&&(this.#Qe=e-60)}start(){this.#qe||(this.#qe=!0,-2===this.#Qe&&this.#Te.getBlockNumber().then(e=>{this.#Qe=e}),this.#Te.on("block",this.#He))}stop(){this.#qe&&(this.#qe=!1,this.#Te.off("block",this.#He))}pause(e){this.stop(),e&&(this.#Qe=-2)}resume(){this.start()}}},3913(e,t,r){"use strict";t.WebSocket=void 0;const n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}().WebSocket;t.WebSocket=n},7918(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accessListify=void 0;const n=r(646),i=r(5347);function s(e,t){return{address:(0,n.getAddress)(e),storageKeys:t.map((e,t)=>((0,i.assertArgument)((0,i.isHexString)(e,32),"invalid slot",`storageKeys[${t}]`,e),e.toLowerCase()))}}t.accessListify=function(e){if(Array.isArray(e))return e.map((t,r)=>Array.isArray(t)?((0,i.assertArgument)(2===t.length,"invalid slot set",`value[${r}]`,t),s(t[0],t[1])):((0,i.assertArgument)(null!=t&&"object"==typeof t,"invalid address-slot set","value",e),s(t.address,t.storageKeys)));(0,i.assertArgument)(null!=e&&"object"==typeof e,"invalid access list","value",e);const t=Object.keys(e).map(t=>{const r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return s(t,Object.keys(r).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}},778(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.recoverAddress=t.computeAddress=void 0;const n=r(646),i=r(2291);function s(e){let t;return t="string"==typeof e?i.SigningKey.computePublicKey(e,!1):e.publicKey,(0,n.getAddress)((0,i.keccak256)("0x"+t.substring(4)).substring(26))}t.computeAddress=s,t.recoverAddress=function(e,t){return s(i.SigningKey.recoverPublicKey(e,t))}},2963(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authorizationify=void 0;const n=r(646),i=r(2291),s=r(5347);t.authorizationify=function(e){return{address:(0,n.getAddress)(e.address),nonce:(0,s.getBigInt)(null!=e.nonce?e.nonce:0),chainId:(0,s.getBigInt)(null!=e.chainId?e.chainId:0),signature:i.Signature.from(e.signature)}}},7778(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=t.recoverAddress=t.computeAddress=t.authorizationify=t.accessListify=void 0;var n=r(7918);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return n.accessListify}});var i=r(2963);Object.defineProperty(t,"authorizationify",{enumerable:!0,get:function(){return i.authorizationify}});var s=r(778);Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return s.computeAddress}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return s.recoverAddress}});var o=r(1398);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return o.Transaction}})},1398(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=t.splitBlobCells=void 0;const n=r(646),i=r(5239),s=r(2291),o=r(5347),a=r(7918),c=r(2963),u=r(778),l=BigInt(0),d=BigInt(2),f=BigInt(27),h=BigInt(28),p=BigInt(35),g=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),m=Symbol.for("nodejs.util.inspect.custom"),y=131072,b=128;function w(e,t){let r=e.toString(16);for(;r.length<2;)r="0"+r;return r+=(0,s.sha256)(t).substring(4),"0x"+r}function _(e){return"0x"===e?null:(0,n.getAddress)(e)}function v(e,t){try{return(0,a.accessListify)(e)}catch(r){(0,o.assertArgument)(!1,r.message,t,e)}}function A(e,t){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(!Array.isArray(n))throw new Error(`authorization[${r}]: invalid array`);if(6!==n.length)throw new Error(`authorization[${r}]: wrong length`);if(!n[1])throw new Error(`authorization[${r}]: null address`);t.push({address:_(n[1]),nonce:P(n[2],"nonce"),chainId:P(n[0],"chainId"),signature:s.Signature.from({yParity:k(n[3],"yParity"),r:(0,o.zeroPadValue)(n[4],32),s:(0,o.zeroPadValue)(n[5],32)})})}return t}catch(r){(0,o.assertArgument)(!1,r.message,t,e)}}function k(e,t){return"0x"===e?0:(0,o.getNumber)(e,t)}function P(e,t){if("0x"===e)return l;const r=(0,o.getBigInt)(e,t);return(0,o.assertArgument)(r<=g,"value exceeds uint size",t,r),r}function E(e,t){const r=(0,o.getBigInt)(e,"value"),n=(0,o.toBeArray)(r);return(0,o.assertArgument)(n.length<=32,"value too large",`tx.${t}`,r),n}function x(e){return(0,a.accessListify)(e).map(e=>[e.address,e.storageKeys])}function O(e,t){(0,o.assertArgument)(Array.isArray(e),`invalid ${t}`,"value",e);for(let t=0;t<e.length;t++)(0,o.assertArgument)((0,o.isHexString)(e[t],32),"invalid ${ param } hash",`value[${t}]`,e[t]);return e}function S(e,t){let r;try{if(r=k(t[0],"yParity"),0!==r&&1!==r)throw new Error("bad yParity")}catch(e){(0,o.assertArgument)(!1,"invalid yParity","yParity",t[0])}const n=(0,o.zeroPadValue)(t[1],32),i=(0,o.zeroPadValue)(t[2],32),a=s.Signature.from({r:n,s:i,yParity:r});e.signature=a}t.splitBlobCells=function(e,t){null==t&&(t=b);const r=[],n=(0,o.getBytes)(e),i=n.length/t;for(let e=0;e<n.length;e+=i)r.push((0,o.hexlify)(n.subarray(e,e+i)));return r};class T{#et;#tt;#r;#rt;#nt;#it;#st;#ot;#at;#se;#ct;#ut;#lt;#dt;#ft;#ht;#pt;#gt;get type(){return this.#et}set type(e){switch(e){case null:this.#et=null;break;case 0:case"legacy":this.#et=0;break;case 1:case"berlin":case"eip-2930":this.#et=1;break;case 2:case"london":case"eip-1559":this.#et=2;break;case 3:case"cancun":case"eip-4844":this.#et=3;break;case 4:case"pectra":case"eip-7702":this.#et=4;break;default:(0,o.assertArgument)(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=this.#tt;return null==e&&3===this.type?i.ZeroAddress:e}set to(e){this.#tt=null==e?null:(0,n.getAddress)(e)}get nonce(){return this.#rt}set nonce(e){this.#rt=(0,o.getNumber)(e,"value")}get gasLimit(){return this.#nt}set gasLimit(e){this.#nt=(0,o.getBigInt)(e)}get gasPrice(){const e=this.#it;return null!=e||0!==this.type&&1!==this.type?e:l}set gasPrice(e){this.#it=null==e?null:(0,o.getBigInt)(e,"gasPrice")}get maxPriorityFeePerGas(){return this.#st??(2===this.type||3===this.type?l:null)}set maxPriorityFeePerGas(e){this.#st=null==e?null:(0,o.getBigInt)(e,"maxPriorityFeePerGas")}get maxFeePerGas(){return this.#ot??(2===this.type||3===this.type?l:null)}set maxFeePerGas(e){this.#ot=null==e?null:(0,o.getBigInt)(e,"maxFeePerGas")}get data(){return this.#r}set data(e){this.#r=(0,o.hexlify)(e)}get value(){return this.#at}set value(e){this.#at=(0,o.getBigInt)(e,"value")}get chainId(){return this.#se}set chainId(e){this.#se=(0,o.getBigInt)(e)}get signature(){return this.#ct||null}set signature(e){this.#ct=null==e?null:s.Signature.from(e)}isValid(){const e=this.signature;if(e&&!e.isValid())return!1;const t=this.authorizationList;if(t)for(const e of t)if(!e.signature.isValid())return!1;return!0}get accessList(){return(this.#ut||null)??(1===this.type||2===this.type||3===this.type?[]:null)}set accessList(e){this.#ut=null==e?null:(0,a.accessListify)(e)}get authorizationList(){const e=this.#pt||null;return null==e&&4===this.type?[]:e}set authorizationList(e){this.#pt=null==e?null:e.map(e=>(0,c.authorizationify)(e))}get maxFeePerBlobGas(){const e=this.#lt;return null==e&&3===this.type?l:e}set maxFeePerBlobGas(e){this.#lt=null==e?null:(0,o.getBigInt)(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#dt;return null==e&&3===this.type?[]:e}set blobVersionedHashes(e){if(null!=e){(0,o.assertArgument)(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)(0,o.assertArgument)((0,o.isHexString)(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#dt=e}get blobs(){return null==this.#ht?null:this.#ht.map(e=>Object.assign({},e))}set blobs(e){if(null==e)return void(this.#ht=null);const t=[],r=[];for(let n=0;n<e.length;n++){const i=e[n];if((0,o.isBytesLike)(i)){(0,o.assert)(this.#ft,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let e=(0,o.getBytes)(i);if((0,o.assertArgument)(e.length<=y,"blob is too large",`blobs[${n}]`,i),e.length!==y){const t=new Uint8Array(y);t.set(e),e=t}const s=this.#ft.blobToKzgCommitment(e),a=(0,o.hexlify)(this.#ft.computeBlobKzgProof(e,s));t.push({data:(0,o.hexlify)(e),commitment:(0,o.hexlify)(s),proof:a}),r.push(w(1,s))}else{const e=(0,o.hexlify)(i.data),n=(0,o.hexlify)(i.commitment),s=(0,o.hexlify)(i.proof);t.push({data:e,commitment:n,proof:s}),r.push(w(1,n))}}this.#ht=t,this.#dt=r}get kzg(){return this.#ft}set kzg(e){this.#ft=null==e?null:function(e){return{blobToKzgCommitment:t=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return(0,o.getBytes)(e.blobToKzgCommitment((0,o.hexlify)(t)))}else if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return(0,o.getBytes)(e.blobToKzgCommitment(t));if("blobToKZGCommitment"in e&&"function"==typeof e.blobToKZGCommitment)return(0,o.getBytes)(e.blobToKZGCommitment((0,o.hexlify)(t)));(0,o.assertArgument)(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(t,r)=>"computeBlobProof"in e&&"function"==typeof e.computeBlobProof?(0,o.getBytes)(e.computeBlobProof((0,o.hexlify)(t),(0,o.hexlify)(r))):"computeBlobKzgProof"in e&&"function"==typeof e.computeBlobKzgProof?e.computeBlobKzgProof(t,r):"computeBlobKZGProof"in e&&"function"==typeof e.computeBlobKZGProof?(0,o.getBytes)(e.computeBlobKZGProof((0,o.hexlify)(t),(0,o.hexlify)(r))):void(0,o.assertArgument)(!1,"unsupported KZG library","kzg",e)}}(e)}get blobWrapperVersion(){return this.#gt}set blobWrapperVersion(e){this.#gt=e}constructor(){this.#et=null,this.#tt=null,this.#rt=0,this.#nt=l,this.#it=null,this.#st=null,this.#ot=null,this.#r="0x",this.#at=l,this.#se=l,this.#ct=null,this.#ut=null,this.#lt=null,this.#dt=null,this.#ft=null,this.#ht=null,this.#pt=null,this.#gt=null}get hash(){return null==this.signature?null:(0,s.keccak256)(this.#mt(!0,!1))}get unsignedHash(){return(0,s.keccak256)(this.unsignedSerialized)}get from(){return null==this.signature?null:(0,u.recoverAddress)(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return null==this.signature?null:s.SigningKey.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return null!=this.signature}#mt(e,t){(0,o.assert)(!e||null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=e?this.signature:null;switch(this.inferType()){case 0:return function(e,t){const r=[E(e.nonce,"nonce"),E(e.gasPrice||0,"gasPrice"),E(e.gasLimit,"gasLimit"),e.to||"0x",E(e.value,"value"),e.data];let n=l;if(e.chainId!=l)n=(0,o.getBigInt)(e.chainId,"tx.chainId"),(0,o.assertArgument)(!t||null==t.networkV||t.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const t=e.signature.legacyChainId;null!=t&&(n=t)}if(!t)return n!==l&&(r.push((0,o.toBeArray)(n)),r.push("0x"),r.push("0x")),(0,o.encodeRlp)(r);let i=BigInt(27+t.yParity);return n!==l?i=s.Signature.getChainIdV(n,t.v):BigInt(t.v)!==i&&(0,o.assertArgument)(!1,"tx.chainId/sig.v mismatch","sig",t),r.push((0,o.toBeArray)(i)),r.push((0,o.toBeArray)(t.r)),r.push((0,o.toBeArray)(t._s)),(0,o.encodeRlp)(r)}(this,r);case 1:return function(e,t){const r=[E(e.chainId,"chainId"),E(e.nonce,"nonce"),E(e.gasPrice||0,"gasPrice"),E(e.gasLimit,"gasLimit"),e.to||"0x",E(e.value,"value"),e.data,x(e.accessList||[])];return t&&(r.push(E(t.yParity,"recoveryParam")),r.push((0,o.toBeArray)(t.r)),r.push((0,o.toBeArray)(t.s))),(0,o.concat)(["0x01",(0,o.encodeRlp)(r)])}(this,r);case 2:return function(e,t){const r=[E(e.chainId,"chainId"),E(e.nonce,"nonce"),E(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),E(e.maxFeePerGas||0,"maxFeePerGas"),E(e.gasLimit,"gasLimit"),e.to||"0x",E(e.value,"value"),e.data,x(e.accessList||[])];return t&&(r.push(E(t.yParity,"yParity")),r.push((0,o.toBeArray)(t.r)),r.push((0,o.toBeArray)(t.s))),(0,o.concat)(["0x02",(0,o.encodeRlp)(r)])}(this,r);case 3:return function(e,t,r){const n=[E(e.chainId,"chainId"),E(e.nonce,"nonce"),E(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),E(e.maxFeePerGas||0,"maxFeePerGas"),E(e.gasLimit,"gasLimit"),e.to||i.ZeroAddress,E(e.value,"value"),e.data,x(e.accessList||[]),E(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),O(e.blobVersionedHashes||[],"blobVersionedHashes")];if(t&&(n.push(E(t.yParity,"yParity")),n.push((0,o.toBeArray)(t.r)),n.push((0,o.toBeArray)(t.s)),r)){if(null!=e.blobWrapperVersion){const t=(0,o.toBeArray)(e.blobWrapperVersion),i=[];for(const{proof:e}of r){const t=(0,o.getBytes)(e),r=t.length/b;for(let e=0;e<t.length;e+=r)i.push(t.subarray(e,e+r))}return(0,o.concat)(["0x03",(0,o.encodeRlp)([n,t,r.map(e=>e.data),r.map(e=>e.commitment),i])])}return(0,o.concat)(["0x03",(0,o.encodeRlp)([n,r.map(e=>e.data),r.map(e=>e.commitment),r.map(e=>e.proof)])])}return(0,o.concat)(["0x03",(0,o.encodeRlp)(n)])}(this,r,t?this.blobs:null);case 4:return function(e,t){const r=[E(e.chainId,"chainId"),E(e.nonce,"nonce"),E(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),E(e.maxFeePerGas||0,"maxFeePerGas"),E(e.gasLimit,"gasLimit"),e.to||"0x",E(e.value,"value"),e.data,x(e.accessList||[]),(n=e.authorizationList||[],n.map(e=>[E(e.chainId,"chainId"),e.address,E(e.nonce,"nonce"),E(e.signature.yParity,"yParity"),(0,o.toBeArray)(e.signature.r),(0,o.toBeArray)(e.signature._s)]))];var n;return t&&(r.push(E(t.yParity,"yParity")),r.push((0,o.toBeArray)(t.r)),r.push((0,o.toBeArray)(t.s))),(0,o.concat)(["0x04",(0,o.encodeRlp)(r)])}(this,r)}(0,o.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#mt(!0,!0)}get unsignedSerialized(){return this.#mt(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,t=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,r=null!=this.accessList,n=null!=this.#lt||this.#dt;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&(0,o.assert)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,o.assert)(!t||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,o.assert)(0!==this.type||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return null!=this.type?i.push(this.type):this.authorizationList&&this.authorizationList.length?i.push(4):t?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(n&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return T.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[m](){return this.toString()}toString(){const e=[],t=t=>{let r=this[t];"string"==typeof r&&(r=JSON.stringify(r)),e.push(`${t}: ${r}`)};this.type&&t("type"),t("to"),t("data"),t("nonce"),t("gasLimit"),t("value"),null!=this.chainId&&t("chainId"),this.signature&&(t("from"),e.push(`signature: ${this.signature.toString()}`));const r=this.authorizationList;if(r){const t=[];for(const e of r){const r=[];r.push(`address: ${JSON.stringify(e.address)}`),null!=e.nonce&&r.push(`nonce: ${e.nonce}`),null!=e.chainId&&r.push(`chainId: ${e.chainId}`),e.signature&&r.push(`signature: ${e.signature.toString()}`),t.push(`Authorization { ${r.join(", ")} }`)}e.push(`authorizations: [ ${t.join(", ")} ]`)}return`Transaction { ${e.join(", ")} }`}static from(e){if(null==e)return new T;if("string"==typeof e){const t=(0,o.getBytes)(e);if(t[0]>=127)return T.from(function(e){const t=(0,o.decodeRlp)(e);(0,o.assertArgument)(Array.isArray(t)&&(9===t.length||6===t.length),"invalid field count for legacy transaction","data",e);const r={type:0,nonce:k(t[0],"nonce"),gasPrice:P(t[1],"gasPrice"),gasLimit:P(t[2],"gasLimit"),to:_(t[3]),value:P(t[4],"value"),data:(0,o.hexlify)(t[5]),chainId:l};if(6===t.length)return r;const n=P(t[6],"v"),i=P(t[7],"r"),a=P(t[8],"s");if(i===l&&a===l)r.chainId=n;else{let e=(n-p)/d;e<l&&(e=l),r.chainId=e,(0,o.assertArgument)(e!==l||n===f||n===h,"non-canonical legacy v","v",t[6]),r.signature=s.Signature.from({r:(0,o.zeroPadValue)(t[7],32),s:(0,o.zeroPadValue)(t[8],32),v:n})}return r}(t));switch(t[0]){case 1:return T.from(function(e){const t=(0,o.decodeRlp)((0,o.getBytes)(e).slice(1));(0,o.assertArgument)(Array.isArray(t)&&(8===t.length||11===t.length),"invalid field count for transaction type: 1","data",(0,o.hexlify)(e));const r={type:1,chainId:P(t[0],"chainId"),nonce:k(t[1],"nonce"),gasPrice:P(t[2],"gasPrice"),gasLimit:P(t[3],"gasLimit"),to:_(t[4]),value:P(t[5],"value"),data:(0,o.hexlify)(t[6]),accessList:v(t[7],"accessList")};return 8===t.length||S(r,t.slice(8)),r}(t));case 2:return T.from(function(e){const t=(0,o.decodeRlp)((0,o.getBytes)(e).slice(1));(0,o.assertArgument)(Array.isArray(t)&&(9===t.length||12===t.length),"invalid field count for transaction type: 2","data",(0,o.hexlify)(e));const r={type:2,chainId:P(t[0],"chainId"),nonce:k(t[1],"nonce"),maxPriorityFeePerGas:P(t[2],"maxPriorityFeePerGas"),maxFeePerGas:P(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:P(t[4],"gasLimit"),to:_(t[5]),value:P(t[6],"value"),data:(0,o.hexlify)(t[7]),accessList:v(t[8],"accessList")};return 9===t.length||S(r,t.slice(9)),r}(t));case 3:return T.from(function(e){let t=(0,o.decodeRlp)((0,o.getBytes)(e).slice(1)),r="3",n=null,i=null;if(4===t.length&&Array.isArray(t[0])){r="3 (network format)";const e=t[1],n=t[2],s=t[3];(0,o.assertArgument)(Array.isArray(e),"invalid network format: blobs not an array","fields[1]",e),(0,o.assertArgument)(Array.isArray(n),"invalid network format: commitments not an array","fields[2]",n),(0,o.assertArgument)(Array.isArray(s),"invalid network format: proofs not an array","fields[3]",s),(0,o.assertArgument)(e.length===n.length,"invalid network format: blobs/commitments length mismatch","fields",t),(0,o.assertArgument)(e.length===s.length,"invalid network format: blobs/proofs length mismatch","fields",t),i=[];for(let r=0;r<t[1].length;r++)i.push({data:e[r],commitment:n[r],proof:s[r]});t=t[0]}else if(5===t.length&&Array.isArray(t[0])){r="3 (EIP-7594 network format)",n=(0,o.getNumber)(t[1]);const e=t[2],s=t[3],a=t[4];(0,o.assertArgument)(1===n,`unsupported EIP-7594 network format version: ${n}`,"fields[1]",n),(0,o.assertArgument)(Array.isArray(e),"invalid EIP-7594 network format: blobs not an array","fields[2]",e),(0,o.assertArgument)(Array.isArray(s),"invalid EIP-7594 network format: commitments not an array","fields[3]",s),(0,o.assertArgument)(Array.isArray(a),"invalid EIP-7594 network format: proofs not an array","fields[4]",a),(0,o.assertArgument)(e.length===s.length,"invalid network format: blobs/commitments length mismatch","fields",t),(0,o.assertArgument)(e.length*b===a.length,"invalid network format: blobs/proofs length mismatch","fields",t),i=[];for(let t=0;t<e.length;t++){const r=[];for(let e=0;e<b;e++)r.push(a[t*b+e]);i.push({data:e[t],commitment:s[t],proof:(0,o.concat)(r)})}t=t[0]}(0,o.assertArgument)(Array.isArray(t)&&(11===t.length||14===t.length),`invalid field count for transaction type: ${r}`,"data",(0,o.hexlify)(e));const s={type:3,chainId:P(t[0],"chainId"),nonce:k(t[1],"nonce"),maxPriorityFeePerGas:P(t[2],"maxPriorityFeePerGas"),maxFeePerGas:P(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:P(t[4],"gasLimit"),to:_(t[5]),value:P(t[6],"value"),data:(0,o.hexlify)(t[7]),accessList:v(t[8],"accessList"),maxFeePerBlobGas:P(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10],blobWrapperVersion:n};i&&(s.blobs=i),(0,o.assertArgument)(null!=s.to,`invalid address for transaction type: ${r}`,"data",e),(0,o.assertArgument)(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let t=0;t<s.blobVersionedHashes.length;t++)(0,o.assertArgument)((0,o.isHexString)(s.blobVersionedHashes[t],32),`invalid blobVersionedHash at index ${t}: must be length 32`,"data",e);return 11===t.length||S(s,t.slice(11)),s}(t));case 4:return T.from(function(e){const t=(0,o.decodeRlp)((0,o.getBytes)(e).slice(1));(0,o.assertArgument)(Array.isArray(t)&&(10===t.length||13===t.length),"invalid field count for transaction type: 4","data",(0,o.hexlify)(e));const r={type:4,chainId:P(t[0],"chainId"),nonce:k(t[1],"nonce"),maxPriorityFeePerGas:P(t[2],"maxPriorityFeePerGas"),maxFeePerGas:P(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:P(t[4],"gasLimit"),to:_(t[5]),value:P(t[6],"value"),data:(0,o.hexlify)(t[7]),accessList:v(t[8],"accessList"),authorizationList:A(t[9],"authorizationList")};return 10===t.length||S(r,t.slice(10)),r}(t))}(0,o.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new T;return null!=e.type&&(t.type=e.type),null!=e.to&&(t.to=e.to),null!=e.nonce&&(t.nonce=e.nonce),null!=e.gasLimit&&(t.gasLimit=e.gasLimit),null!=e.gasPrice&&(t.gasPrice=e.gasPrice),null!=e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),null!=e.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null!=e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),null!=e.data&&(t.data=e.data),null!=e.value&&(t.value=e.value),null!=e.chainId&&(t.chainId=e.chainId),null!=e.signature&&(t.signature=s.Signature.from(e.signature)),null!=e.accessList&&(t.accessList=e.accessList),null!=e.authorizationList&&(t.authorizationList=e.authorizationList),null!=e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),null!=e.kzg&&(t.kzg=e.kzg),null!=e.blobWrapperVersion&&(t.blobWrapperVersion=e.blobWrapperVersion),null!=e.blobs&&(t.blobs=e.blobs),null!=e.hash&&((0,o.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),(0,o.assertArgument)(t.hash===e.hash,"hash mismatch","tx",e)),null!=e.from&&((0,o.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),(0,o.assertArgument)(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}t.Transaction=T},8567(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBase58=t.encodeBase58=void 0;const n=r(7415),i=r(1500),s=r(6508),o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let a=null;function c(e){if(null==a){a={};for(let e=0;e<58;e++)a[o[e]]=BigInt(e)}const t=a[e];return(0,i.assertArgument)(null!=t,"invalid base58 value","letter",e),t}const u=BigInt(0),l=BigInt(58);t.encodeBase58=function(e){const t=(0,n.getBytes)(e);let r=(0,s.toBigInt)(t),i="";for(;r;)i=o[Number(r%l)]+i,r/=l;for(let e=0;e<t.length&&!t[e];e++)i=o[0]+i;return i},t.decodeBase58=function(e){let t=u;for(let r=0;r<e.length;r++)t*=l,t+=c(e[r]);return t}},1949(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBase64=t.decodeBase64=void 0;const n=r(7415);t.decodeBase64=function(e){e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return(0,n.getBytes)(t)},t.encodeBase64=function(e){const t=(0,n.getBytes)(e);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}},7415(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zeroPadBytes=t.zeroPadValue=t.stripZerosLeft=t.dataSlice=t.dataLength=t.concat=t.hexlify=t.isBytesLike=t.isHexString=t.getBytesCopy=t.getBytes=void 0;const n=r(1500);function i(e,t,r){if(e instanceof Uint8Array)return r?new Uint8Array(e):e;if("string"==typeof e&&e.length%2==0&&e.match(/^0x[0-9a-f]*$/i)){const t=new Uint8Array((e.length-2)/2);let r=2;for(let n=0;n<t.length;n++)t[n]=parseInt(e.substring(r,r+2),16),r+=2;return t}(0,n.assertArgument)(!1,"invalid BytesLike value",t||"value",e)}function s(e,t){return i(e,t,!1)}function o(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||"number"==typeof t&&e.length!==2+2*t||!0===t&&e.length%2!=0)}t.getBytes=s,t.getBytesCopy=function(e,t){return i(e,t,!0)},t.isHexString=o,t.isBytesLike=function(e){return o(e,!0)||e instanceof Uint8Array};const a="0123456789abcdef";function c(e){const t=s(e);let r="0x";for(let e=0;e<t.length;e++){const n=t[e];r+=a[(240&n)>>4]+a[15&n]}return r}function u(e,t,r){const i=s(e);(0,n.assert)(t>=i.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(i),length:t,offset:t+1});const o=new Uint8Array(t);return o.fill(0),r?o.set(i,t-i.length):o.set(i,0),c(o)}t.hexlify=c,t.concat=function(e){return"0x"+e.map(e=>c(e).substring(2)).join("")},t.dataLength=function(e){return o(e,!0)?(e.length-2)/2:s(e).length},t.dataSlice=function(e,t,r){const i=s(e);return null!=r&&r>i.length&&(0,n.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:i,length:i.length,offset:r}),c(i.slice(t??0,r??i.length))},t.stripZerosLeft=function(e){let t=c(e).substring(2);for(;t.startsWith("00");)t=t.substring(2);return"0x"+t},t.zeroPadValue=function(e,t){return u(e,t,!0)},t.zeroPadBytes=function(e,t){return u(e,t,!1)}},1500(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertPrivate=t.assertNormalize=t.assertArgumentCount=t.assertArgument=t.assert=t.makeError=t.isCallException=t.isError=void 0;const n=r(4586),i=r(8166);function s(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(e=>s(e,t)).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let r="0x";for(let n=0;n<e.length;n++)r+=t[e[n]>>4],r+=t[15&e[n]];return r}if("object"==typeof e&&"function"==typeof e.toJSON)return s(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const r=Object.keys(e);return r.sort(),"{ "+r.map(r=>`${s(r,t)}: ${s(e[r],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function o(e,t){return e&&e.code===t}function a(e,t,r){let o,a=e;{const i=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${s(r)}`);for(const e in r){if("shortMessage"===e)continue;const t=r[e];i.push(e+"="+s(t))}}i.push(`code=${t}`),i.push(`version=${n.version}`),i.length&&(e+=" ("+i.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":o=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(e);break;default:o=new Error(e)}return(0,i.defineProperties)(o,{code:t}),r&&Object.assign(o,r),null==o.shortMessage&&(0,i.defineProperties)(o,{shortMessage:a}),o}function c(e,t,r,n){if(!e)throw a(t,r,n)}t.isError=o,t.isCallException=function(e){return o(e,"CALL_EXCEPTION")},t.makeError=a,t.assert=c,t.assertArgument=function(e,t,r,n){c(e,t,"INVALID_ARGUMENT",{argument:r,value:n})},t.assertArgumentCount=function(e,t,r){null==r&&(r=""),r&&(r=": "+r),c(e>=t,"missing argument"+r,"MISSING_ARGUMENT",{count:e,expectedCount:t}),c(e<=t,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})};const u=["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e},[]);t.assertNormalize=function(e){c(u.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})},t.assertPrivate=function(e,t,r){if(null==r&&(r=""),e!==t){let e=r,t="new";r&&(e+=".",t+=" "+r),c(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}},7698(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventPayload=void 0;const n=r(8166);t.EventPayload=class{filter;emitter;#yt;constructor(e,t,r){this.#yt=t,(0,n.defineProperties)(this,{emitter:e,filter:r})}async removeListener(){null!=this.#yt&&await this.emitter.off(this.filter,this.#yt)}}},5191(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchResponse=t.FetchRequest=t.FetchCancelSignal=void 0;const n=r(1949),i=r(7415),s=r(1500),o=r(8166),a=r(3948),c=r(3271);let u=(0,c.createGetUrl)();const l=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),d=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let f=!1;async function h(e,t){try{const t=e.match(l);if(!t)throw new Error("invalid data");return new _(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?(0,n.decodeBase64)(t[3]):(r=t[3],(0,a.toUtf8Bytes)(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))}catch(t){return new _(599,"BAD REQUEST (invalid data: URI)",{},null,new w(e))}var r}function p(e){return async function(t,r){try{const r=t.match(d);if(!r)throw new Error("invalid link");return new w(`${e}${r[2]}`)}catch(e){return new _(599,"BAD REQUEST (invalid IPFS URI)",{},null,new w(t))}}}const g={data:h,ipfs:p("https://gateway.ipfs.io/ipfs/")},m=new WeakMap;class y{#bt;#wt;constructor(e){this.#bt=[],this.#wt=!1,m.set(e,()=>{if(!this.#wt){this.#wt=!0;for(const e of this.#bt)setTimeout(()=>{e()},0);this.#bt=[]}})}addListener(e){(0,s.assert)(!this.#wt,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#bt.push(e)}get cancelled(){return this.#wt}checkSignal(){(0,s.assert)(!this.cancelled,"cancelled","CANCELLED",{})}}function b(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}t.FetchCancelSignal=y;class w{#_t;#vt;#At;#kt;#Pt;#ae;#Et;#xt;#Ot;#St;#Tt;#Bt;#Rt;#Nt;#Ct;get url(){return this.#ae}set url(e){this.#ae=String(e)}get body(){return null==this.#Et?null:new Uint8Array(this.#Et)}set body(e){if(null==e)this.#Et=void 0,this.#xt=void 0;else if("string"==typeof e)this.#Et=(0,a.toUtf8Bytes)(e),this.#xt="text/plain";else if(e instanceof Uint8Array)this.#Et=e,this.#xt="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#Et=(0,a.toUtf8Bytes)(JSON.stringify(e)),this.#xt="application/json"}}hasBody(){return null!=this.#Et}get method(){return this.#kt?this.#kt:this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),this.#kt=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#At);return this.#Ot&&(e.authorization=`Basic ${(0,n.encodeBase64)((0,a.toUtf8Bytes)(this.#Ot))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),null==e["content-type"]&&this.#xt&&(e["content-type"]=this.#xt),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#At[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#At={}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r<t.length){const n=t[r++];return{value:[n,e[n]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#Ot||null}setCredentials(e,t){(0,s.assertArgument)(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#Ot=`${e}:${t}`}get allowGzip(){return this.#vt}set allowGzip(e){this.#vt=!!e}get allowInsecureAuthentication(){return!!this.#_t}set allowInsecureAuthentication(e){this.#_t=!!e}get timeout(){return this.#Pt}set timeout(e){(0,s.assertArgument)(e>=0,"timeout must be non-zero","timeout",e),this.#Pt=e}get preflightFunc(){return this.#St||null}set preflightFunc(e){this.#St=e}get processFunc(){return this.#Tt||null}set processFunc(e){this.#Tt=e}get retryFunc(){return this.#Bt||null}set retryFunc(e){this.#Bt=e}get getUrlFunc(){return this.#Ct||u}set getUrlFunc(e){this.#Ct=e}constructor(e){this.#ae=String(e),this.#_t=!1,this.#vt=!0,this.#At={},this.#kt="",this.#Pt=3e5,this.#Nt={slotInterval:250,maxAttempts:12},this.#Ct=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#Et?(0,i.hexlify)(this.#Et):"null"}>`}setThrottleParams(e){null!=e.slotInterval&&(this.#Nt.slotInterval=e.slotInterval),null!=e.maxAttempts&&(this.#Nt.maxAttempts=e.maxAttempts)}async#It(e,t,r,n,i){if(e>=this.#Nt.maxAttempts)return i.makeServerError("exceeded maximum retry limit");(0,s.assert)(v()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:n}),r>0&&await function(e){return new Promise(t=>setTimeout(t,e))}(r);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in g){const e=await g[a](o.url,b(n.#Rt));if(e instanceof _){let t=e;if(this.processFunc){b(n.#Rt);try{t=await this.processFunc(o,t)}catch(e){null!=e.throttle&&"number"==typeof e.stall||t.makeServerError("error in post-processing function",e).assertOk()}}return t}o=e}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,b(n.#Rt));let u=new _(c.statusCode,c.statusMessage,c.headers,c.body,n);if([301,302,307,308].indexOf(u.statusCode)>=0){try{const r=u.headers.location||"";return o.redirect(r).#It(e+1,t,0,n,u)}catch(e){}return u}if(429===u.statusCode&&(null==this.retryFunc||await this.retryFunc(o,u,e))){const r=u.headers["retry-after"];let i=this.#Nt.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof r&&r.match(/^[1-9][0-9]*$/)&&(i=parseInt(r)),o.clone().#It(e+1,t,i,n,u)}if(this.processFunc){b(n.#Rt);try{u=await this.processFunc(o,u)}catch(r){null!=r.throttle&&"number"==typeof r.stall||u.makeServerError("error in post-processing function",r).assertOk();let i=this.#Nt.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return r.stall>=0&&(i=r.stall),o.clone().#It(e+1,t,i,n,u)}}return u}send(){return(0,s.assert)(null==this.#Rt,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#Rt=new y(this),this.#It(0,v()+this.timeout,0,this,new _(0,"",{},null,this))}cancel(){(0,s.assert)(null!=this.#Rt,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=m.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();(0,s.assert)(("https"!==t||"http"!==r)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const n=new w(e);return n.method=this.method,n.allowGzip=this.allowGzip,n.timeout=this.timeout,n.#At=Object.assign({},this.#At),this.#Et&&(n.#Et=new Uint8Array(this.#Et)),n.#xt=this.#xt,n}clone(){const e=new w(this.url);return e.#kt=this.#kt,this.#Et&&(e.#Et=this.#Et),e.#xt=this.#xt,e.#At=Object.assign({},this.#At),e.#Ot=this.#Ot,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#St=this.#St,e.#Tt=this.#Tt,e.#Bt=this.#Bt,e.#Nt=Object.assign({},this.#Nt),e.#Ct=this.#Ct,e}static lockConfig(){f=!0}static getGateway(e){return g[e.toLowerCase()]||null}static registerGateway(e,t){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(f)throw new Error("gateways locked");g[e]=t}static registerGetUrl(e){if(f)throw new Error("gateways locked");u=e}static createGetUrlFunc(e){return(0,c.createGetUrl)(e)}static createDataGateway(){return h}static createIpfsGatewayFunc(e){return p(e)}}t.FetchRequest=w;class _{#Ft;#Ut;#At;#Et;#ue;#jt;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#Et?(0,i.hexlify)(this.#Et):"null"}>`}get statusCode(){return this.#Ft}get statusMessage(){return this.#Ut}get headers(){return Object.assign({},this.#At)}get body(){return null==this.#Et?null:new Uint8Array(this.#Et)}get bodyText(){try{return null==this.#Et?"":(0,a.toUtf8String)(this.#Et)}catch(e){(0,s.assert)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){(0,s.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r<t.length){const n=t[r++];return{value:[n,e[n]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,r,n,i){this.#Ft=e,this.#Ut=t,this.#At=Object.keys(r).reduce((e,t)=>(e[t.toLowerCase()]=String(r[t]),e),{}),this.#Et=null==n?null:new Uint8Array(n),this.#ue=i||null,this.#jt={message:""}}makeServerError(e,t){let r;r=e?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:`CLIENT ESCALATED SERVER ERROR (${e=`${this.statusCode} ${this.statusMessage}`})`;const n=new _(599,r,this.headers,this.body,this.#ue||void 0);return n.#jt={message:e,error:t},n}throwThrottleError(e,t){null==t?t=-1:(0,s.assertArgument)(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const r=new Error(e||"throttling requests");throw(0,o.defineProperties)(r,{stall:t,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=this.#Et}get request(){return this.#ue}ok(){return""===this.#jt.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#jt;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let n=null;try{this.#Et&&(n=(0,a.toUtf8String)(this.#Et))}catch(e){}(0,s.assert)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:r,responseBody:n,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function v(){return(new Date).getTime()}t.FetchResponse=_},9412(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedNumber=void 0;const n=r(7415),i=r(1500),s=r(6508),o=r(8166),a=BigInt(-1),c=BigInt(0),u=BigInt(1),l=BigInt(5),d={};let f="0000";for(;f.length<80;)f+=f;function h(e){let t=f;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function p(e,t,r){const n=BigInt(t.width);if(t.signed){const t=u<<n-u;(0,i.assert)(null==r||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:e}),e=e>c?(0,s.fromTwos)((0,s.mask)(e,n),n):-(0,s.fromTwos)((0,s.mask)(-e,n),n)}else{const t=u<<n;(0,i.assert)(null==r||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:e}),e=(e%t+t)%t&t-u}return e}function g(e){"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const s=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);(0,i.assertArgument)(s,"invalid fixed format","format",e),t="u"!==s[1],r=parseInt(s[2]),n=parseInt(s[3])}else if(e){const s=e,o=(e,t,r)=>null==s[e]?r:((0,i.assertArgument)(typeof s[e]===t,"invalid fixed format ("+e+" not "+t+")","format."+e,s[e]),s[e]);t=o("signed","boolean",t),r=o("width","number",r),n=o("decimals","number",n)}return(0,i.assertArgument)(r%8==0,"invalid FixedNumber width (not byte aligned)","format.width",r),(0,i.assertArgument)(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n),{signed:t,width:r,decimals:n,name:(t?"":"u")+"fixed"+String(r)+"x"+String(n)}}class m{format;#Lt;#Dt;#Mt;_value;constructor(e,t,r){(0,i.assertPrivate)(e,d,"FixedNumber"),this.#Dt=t,this.#Lt=r;const n=function(e,t){let r="";e<c&&(r="-",e*=a);let n=e.toString();if(0===t)return r+n;for(;n.length<=t;)n=f+n;const i=n.length-t;for(n=n.substring(0,i)+"."+n.substring(i);"0"===n[0]&&"."!==n[1];)n=n.substring(1);for(;"0"===n[n.length-1]&&"."!==n[n.length-2];)n=n.substring(0,n.length-1);return r+n}(t,r.decimals);(0,o.defineProperties)(this,{format:r.name,_value:n}),this.#Mt=h(r.decimals)}get signed(){return this.#Lt.signed}get width(){return this.#Lt.width}get decimals(){return this.#Lt.decimals}get value(){return this.#Dt}#$t(e){(0,i.assertArgument)(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#Gt(e,t){return e=p(e,this.#Lt,t),new m(d,e,this.#Lt)}#Ht(e,t){return this.#$t(e),this.#Gt(this.#Dt+e.#Dt,t)}addUnsafe(e){return this.#Ht(e)}add(e){return this.#Ht(e,"add")}#qt(e,t){return this.#$t(e),this.#Gt(this.#Dt-e.#Dt,t)}subUnsafe(e){return this.#qt(e)}sub(e){return this.#qt(e,"sub")}#Wt(e,t){return this.#$t(e),this.#Gt(this.#Dt*e.#Dt/this.#Mt,t)}mulUnsafe(e){return this.#Wt(e)}mul(e){return this.#Wt(e,"mul")}mulSignal(e){this.#$t(e);const t=this.#Dt*e.#Dt;return(0,i.assert)(t%this.#Mt===c,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#Gt(t/this.#Mt,"mulSignal")}#zt(e,t){return(0,i.assert)(e.#Dt!==c,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#$t(e),this.#Gt(this.#Dt*this.#Mt/e.#Dt,t)}divUnsafe(e){return this.#zt(e)}div(e){return this.#zt(e,"div")}divSignal(e){(0,i.assert)(e.#Dt!==c,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#$t(e);const t=this.#Dt*this.#Mt;return(0,i.assert)(t%e.#Dt===c,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#Gt(t/e.#Dt,"divSignal")}cmp(e){let t=this.value,r=e.value;const n=this.decimals-e.decimals;return n>0?r*=h(n):n<0&&(t*=h(-n)),t<r?-1:t>r?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#Dt;return this.#Dt<c&&(e-=this.#Mt-u),e=this.#Dt/this.#Mt*this.#Mt,this.#Gt(e,"floor")}ceiling(){let e=this.#Dt;return this.#Dt>c&&(e+=this.#Mt-u),e=this.#Dt/this.#Mt*this.#Mt,this.#Gt(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const t=this.decimals-e,r=l*h(t-1);let n=this.value+r;const i=h(t);return n=n/i*i,p(n,this.#Lt,"round"),new m(d,n,this.#Lt)}isZero(){return this.#Dt===c}isNegative(){return this.#Dt<c}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return m.fromString(this.toString(),e)}static fromValue(e,t,r){const n=null==t?0:(0,s.getNumber)(t),o=g(r);let a=(0,s.getBigInt)(e,"value");const u=n-o.decimals;if(u>0){const t=h(u);(0,i.assert)(a%t===c,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),a/=t}else u<0&&(a*=h(-u));return p(a,o,"fromValue"),new m(d,a,o)}static fromString(e,t){const r=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,i.assertArgument)(r&&r[2].length+r[3].length>0,"invalid FixedNumber string value","value",e);const n=g(t);let s=r[2]||"0",o=r[3]||"";for(;o.length<n.decimals;)o+=f;(0,i.assert)(o.substring(n.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),o=o.substring(0,n.decimals);const a=BigInt(r[1]+s+o);return p(a,n,"fromString"),new m(d,a,n)}static fromBytes(e,t){let r=(0,s.toBigInt)((0,n.getBytes)(e,"value"));const i=g(t);return i.signed&&(r=(0,s.fromTwos)(r,i.width)),p(r,i,"fromBytes"),new m(d,r,i)}}t.FixedNumber=m},3271(e,t,r){"use strict";t.createGetUrl=void 0;const n=r(1500);function i(e){return async function(t,r){(0,n.assert)(null==r||!r.cancelled,"request cancelled before sending","CANCELLED");const i=t.url.split(":")[0].toLowerCase();(0,n.assert)("http"===i||"https"===i,`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),(0,n.assert)("https"===i||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=null;const o=new AbortController,a=setTimeout(()=>{s=(0,n.makeError)("request timeout","TIMEOUT"),o.abort()},t.timeout);r&&r.addListener(()=>{s=(0,n.makeError)("request cancelled","CANCELLED"),o.abort()});const c=Object.assign({},e,{method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:o.signal});let u;try{u=await fetch(t.url,c)}catch(e){if(clearTimeout(a),s)throw s;throw e}clearTimeout(a);const l={};u.headers.forEach((e,t)=>{l[t.toLowerCase()]=e});const d=await u.arrayBuffer(),f=null==d?null:new Uint8Array(d);return{statusCode:u.status,statusMessage:u.statusText,headers:l,body:f}}}t.createGetUrl=i;i({})},5347(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.encodeRlp=t.decodeRlp=t.defineProperties=t.resolveProperties=t.toQuantity=t.toBeArray=t.toBeHex=t.toNumber=t.toBigInt=t.getUint=t.getNumber=t.getBigInt=t.mask=t.toTwos=t.fromTwos=t.FixedNumber=t.FetchCancelSignal=t.FetchResponse=t.FetchRequest=t.EventPayload=t.makeError=t.assertNormalize=t.assertPrivate=t.assertArgumentCount=t.assertArgument=t.assert=t.isError=t.isCallException=t.zeroPadBytes=t.zeroPadValue=t.stripZerosLeft=t.dataSlice=t.dataLength=t.concat=t.hexlify=t.isBytesLike=t.isHexString=t.getBytesCopy=t.getBytes=t.encodeBase64=t.decodeBase64=t.encodeBase58=t.decodeBase58=void 0,t.uuidV4=t.Utf8ErrorFuncs=void 0;var n=r(8567);Object.defineProperty(t,"decodeBase58",{enumerable:!0,get:function(){return n.decodeBase58}}),Object.defineProperty(t,"encodeBase58",{enumerable:!0,get:function(){return n.encodeBase58}});var i=r(1949);Object.defineProperty(t,"decodeBase64",{enumerable:!0,get:function(){return i.decodeBase64}}),Object.defineProperty(t,"encodeBase64",{enumerable:!0,get:function(){return i.encodeBase64}});var s=r(7415);Object.defineProperty(t,"getBytes",{enumerable:!0,get:function(){return s.getBytes}}),Object.defineProperty(t,"getBytesCopy",{enumerable:!0,get:function(){return s.getBytesCopy}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return s.isHexString}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return s.isBytesLike}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return s.hexlify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return s.concat}}),Object.defineProperty(t,"dataLength",{enumerable:!0,get:function(){return s.dataLength}}),Object.defineProperty(t,"dataSlice",{enumerable:!0,get:function(){return s.dataSlice}}),Object.defineProperty(t,"stripZerosLeft",{enumerable:!0,get:function(){return s.stripZerosLeft}}),Object.defineProperty(t,"zeroPadValue",{enumerable:!0,get:function(){return s.zeroPadValue}}),Object.defineProperty(t,"zeroPadBytes",{enumerable:!0,get:function(){return s.zeroPadBytes}});var o=r(1500);Object.defineProperty(t,"isCallException",{enumerable:!0,get:function(){return o.isCallException}}),Object.defineProperty(t,"isError",{enumerable:!0,get:function(){return o.isError}}),Object.defineProperty(t,"assert",{enumerable:!0,get:function(){return o.assert}}),Object.defineProperty(t,"assertArgument",{enumerable:!0,get:function(){return o.assertArgument}}),Object.defineProperty(t,"assertArgumentCount",{enumerable:!0,get:function(){return o.assertArgumentCount}}),Object.defineProperty(t,"assertPrivate",{enumerable:!0,get:function(){return o.assertPrivate}}),Object.defineProperty(t,"assertNormalize",{enumerable:!0,get:function(){return o.assertNormalize}}),Object.defineProperty(t,"makeError",{enumerable:!0,get:function(){return o.makeError}});var a=r(7698);Object.defineProperty(t,"EventPayload",{enumerable:!0,get:function(){return a.EventPayload}});var c=r(5191);Object.defineProperty(t,"FetchRequest",{enumerable:!0,get:function(){return c.FetchRequest}}),Object.defineProperty(t,"FetchResponse",{enumerable:!0,get:function(){return c.FetchResponse}}),Object.defineProperty(t,"FetchCancelSignal",{enumerable:!0,get:function(){return c.FetchCancelSignal}});var u=r(9412);Object.defineProperty(t,"FixedNumber",{enumerable:!0,get:function(){return u.FixedNumber}});var l=r(6508);Object.defineProperty(t,"fromTwos",{enumerable:!0,get:function(){return l.fromTwos}}),Object.defineProperty(t,"toTwos",{enumerable:!0,get:function(){return l.toTwos}}),Object.defineProperty(t,"mask",{enumerable:!0,get:function(){return l.mask}}),Object.defineProperty(t,"getBigInt",{enumerable:!0,get:function(){return l.getBigInt}}),Object.defineProperty(t,"getNumber",{enumerable:!0,get:function(){return l.getNumber}}),Object.defineProperty(t,"getUint",{enumerable:!0,get:function(){return l.getUint}}),Object.defineProperty(t,"toBigInt",{enumerable:!0,get:function(){return l.toBigInt}}),Object.defineProperty(t,"toNumber",{enumerable:!0,get:function(){return l.toNumber}}),Object.defineProperty(t,"toBeHex",{enumerable:!0,get:function(){return l.toBeHex}}),Object.defineProperty(t,"toBeArray",{enumerable:!0,get:function(){return l.toBeArray}}),Object.defineProperty(t,"toQuantity",{enumerable:!0,get:function(){return l.toQuantity}});var d=r(8166);Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return d.resolveProperties}}),Object.defineProperty(t,"defineProperties",{enumerable:!0,get:function(){return d.defineProperties}});var f=r(7780);Object.defineProperty(t,"decodeRlp",{enumerable:!0,get:function(){return f.decodeRlp}});var h=r(5212);Object.defineProperty(t,"encodeRlp",{enumerable:!0,get:function(){return h.encodeRlp}});var p=r(436);Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return p.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return p.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return p.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return p.parseUnits}});var g=r(3948);Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return g.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return g.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return g.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return g.Utf8ErrorFuncs}});var m=r(7744);Object.defineProperty(t,"uuidV4",{enumerable:!0,get:function(){return m.uuidV4}})},6508(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toQuantity=t.toBeArray=t.toBeHex=t.toNumber=t.getNumber=t.toBigInt=t.getUint=t.getBigInt=t.mask=t.toTwos=t.fromTwos=void 0;const n=r(7415),i=r(1500),s=BigInt(0),o=BigInt(1),a=9007199254740991;function c(e,t){switch(typeof e){case"bigint":return e;case"number":return(0,i.assertArgument)(Number.isInteger(e),"underflow",t||"value",e),(0,i.assertArgument)(e>=-a&&e<=a,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(r){(0,i.assertArgument)(!1,`invalid BigNumberish string: ${r.message}`,t||"value",e)}}(0,i.assertArgument)(!1,"invalid BigNumberish value",t||"value",e)}function u(e,t){const r=c(e,t);return(0,i.assert)(r>=s,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),r}t.fromTwos=function(e,t){const r=u(e,"value"),n=BigInt(f(t,"width"));return(0,i.assert)(r>>n===s,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),r>>n-o?-((~r&(o<<n)-o)+o):r},t.toTwos=function(e,t){let r=c(e,"value");const n=BigInt(f(t,"width")),a=o<<n-o;return r<s?(r=-r,(0,i.assert)(r<=a,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),(~r&(o<<n)-o)+o):((0,i.assert)(r<a,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),r)},t.mask=function(e,t){const r=u(e,"value"),n=BigInt(f(t,"bits"));return r&(o<<n)-o},t.getBigInt=c,t.getUint=u;const l="0123456789abcdef";function d(e){if(e instanceof Uint8Array){let t="0x0";for(const r of e)t+=l[r>>4],t+=l[15&r];return BigInt(t)}return c(e)}function f(e,t){switch(typeof e){case"bigint":return(0,i.assertArgument)(e>=-a&&e<=a,"overflow",t||"value",e),Number(e);case"number":return(0,i.assertArgument)(Number.isInteger(e),"underflow",t||"value",e),(0,i.assertArgument)(e>=-a&&e<=a,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return f(BigInt(e),t)}catch(r){(0,i.assertArgument)(!1,`invalid numeric string: ${r.message}`,t||"value",e)}}(0,i.assertArgument)(!1,"invalid numeric value",t||"value",e)}function h(e,t){const r=u(e,"value");if(r===s){const e=null!=t?f(t,"width"):0;return new Uint8Array(e)}let n=r.toString(16);if(n.length%2&&(n="0"+n),null!=t){const r=f(t,"width");for(;n.length<2*r;)n="00"+n;(0,i.assert)(2*r===n.length,`value exceeds width (${r} bytes)`,"NUMERIC_FAULT",{operation:"toBeArray",fault:"overflow",value:e})}const o=new Uint8Array(n.length/2);for(let e=0;e<o.length;e++){const t=2*e;o[e]=parseInt(n.substring(t,t+2),16)}return o}t.toBigInt=d,t.getNumber=f,t.toNumber=function(e){return f(d(e))},t.toBeHex=function(e,t){const r=u(e,"value");let n=r.toString(16);if(null==t)n.length%2&&(n="0"+n);else{const o=f(t,"width");if(0===o&&r===s)return"0x";for((0,i.assert)(2*o>=n.length,`value exceeds width (${o} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});n.length<2*o;)n="0"+n}return"0x"+n},t.toBeArray=h,t.toQuantity=function(e){let t=(0,n.hexlify)((0,n.isBytesLike)(e)?e:h(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return""===t&&(t="0"),"0x"+t}},8166(e,t){"use strict";function r(e,t,r){const n=t.split("|").map(e=>e.trim());for(let r=0;r<n.length;r++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const i=new Error(`invalid value for type ${t}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=e,i}Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=t.resolveProperties=void 0,t.resolveProperties=async function(e){const t=Object.keys(e);return(await Promise.all(t.map(t=>Promise.resolve(e[t])))).reduce((e,r,n)=>(e[t[n]]=r,e),{})},t.defineProperties=function(e,t,n){for(let i in t){let s=t[i];const o=n?n[i]:null;o&&r(s,o,i),Object.defineProperty(e,i,{enumerable:!0,value:s,writable:!1})}}},7780(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeRlp=void 0;const n=r(7415),i=r(1500),s=r(7415);function o(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function a(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function c(e,t,r,n){const s=[];for(;r<t+1+n;){const o=u(e,r);s.push(o.result),r+=o.consumed,(0,i.assert)(r<=t+1+n,"child data too short","BUFFER_OVERRUN",{buffer:e,length:n,offset:t})}return{consumed:1+n,result:s}}function u(e,t){(0,i.assert)(0!==e.length,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const r=t=>{(0,i.assert)(t<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:t})};if(e[t]>=248){const n=e[t]-247;r(t+1+n);const i=a(e,t+1,n);return r(t+1+n+i),c(e,t,t+1+n,n+i)}if(e[t]>=192){const n=e[t]-192;return r(t+1+n),c(e,t,t+1,n)}if(e[t]>=184){const i=e[t]-183;r(t+1+i);const s=a(e,t+1,i);return r(t+1+i+s),{consumed:1+i+s,result:(0,n.hexlify)(e.slice(t+1+i,t+1+i+s))}}if(e[t]>=128){const i=e[t]-128;return r(t+1+i),{consumed:1+i,result:(0,n.hexlify)(e.slice(t+1,t+1+i))}}return{consumed:1,result:o(e[t])}}t.decodeRlp=function(e){const t=(0,s.getBytes)(e,"data"),r=u(t,0);return(0,i.assertArgument)(r.consumed===t.length,"unexpected junk after rlp payload","data",e),r.result}},5212(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeRlp=void 0;const n=r(7415);function i(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function s(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(s(e))}),t.length<=55)return t.unshift(192+t.length),t;const r=i(t.length);return r.unshift(247+r.length),r.concat(t)}const t=Array.prototype.slice.call((0,n.getBytes)(e,"object"));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=i(t.length);return r.unshift(183+r.length),r.concat(t)}const o="0123456789abcdef";t.encodeRlp=function(e){let t="0x";for(const r of s(e))t+=o[r>>4],t+=o[15&r];return t}},436(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseEther=t.formatEther=t.parseUnits=t.formatUnits=void 0;const n=r(1500),i=r(9412),s=r(6508),o=["wei","kwei","mwei","gwei","szabo","finney","ether"];function a(e,t){let r=18;if("string"==typeof t){const e=o.indexOf(t);(0,n.assertArgument)(e>=0,"invalid unit","unit",t),r=3*e}else null!=t&&(r=(0,s.getNumber)(t,"unit"));return i.FixedNumber.fromValue(e,r,{decimals:r,width:512}).toString()}function c(e,t){(0,n.assertArgument)("string"==typeof e,"value must be a string","value",e);let r=18;if("string"==typeof t){const e=o.indexOf(t);(0,n.assertArgument)(e>=0,"invalid unit","unit",t),r=3*e}else null!=t&&(r=(0,s.getNumber)(t,"unit"));return i.FixedNumber.fromString(e,{decimals:r,width:512}).value}t.formatUnits=a,t.parseUnits=c,t.formatEther=function(e){return a(e,18)},t.parseEther=function(e){return c(e,18)}},3948(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUtf8CodePoints=t.toUtf8String=t.toUtf8Bytes=t.Utf8ErrorFuncs=void 0;const n=r(7415),i=r(1500);function s(e,t,r,n,i){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return"OVERRUN"===e?r.length-t-1:0}function o(e,r){null==r&&(r=t.Utf8ErrorFuncs.error);const i=(0,n.getBytes)(e,"bytes"),s=[];let o=0;for(;o<i.length;){const e=i[o++];if(!(e>>7)){s.push(e);continue}let t=null,n=null;if(192==(224&e))t=1,n=127;else if(224==(240&e))t=2,n=2047;else{if(240!=(248&e)){o+=r(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",o-1,i,s);continue}t=3,n=65535}if(o-1+t>=i.length){o+=r("OVERRUN",o-1,i,s);continue}let a=e&(1<<8-t-1)-1;for(let e=0;e<t;e++){let e=i[o];if(128!=(192&e)){o+=r("MISSING_CONTINUE",o,i,s),a=null;break}a=a<<6|63&e,o++}null!==a&&(a>1114111?o+=r("OUT_OF_RANGE",o-1-t,i,s,a):a>=55296&&a<=57343?o+=r("UTF16_SURROGATE",o-1-t,i,s,a):a<=n?o+=r("OVERLONG",o-1-t,i,s,a):s.push(a))}return s}function a(e,t){(0,i.assertArgument)("string"==typeof e,"invalid string value","str",e),null!=t&&((0,i.assertNormalize)(t),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const s=e.charCodeAt(t);(0,i.assertArgument)(t<e.length&&56320==(64512&s),"invalid surrogate pair","str",e);const o=65536+((1023&n)<<10)+(1023&s);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return new Uint8Array(r)}t.Utf8ErrorFuncs=Object.freeze({error:function(e,t,r,n,s){(0,i.assertArgument)(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:s,replace:function(e,t,r,n,o){return"OVERLONG"===e?((0,i.assertArgument)("number"==typeof o,"invalid bad code point for replacement","badCodepoint",o),n.push(o),0):(n.push(65533),s(e,t,r))}}),t.toUtf8Bytes=a,t.toUtf8String=function(e,t){return o(e,t).map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))).join("")},t.toUtf8CodePoints=function(e,t){return o(a(e,t))}},7744(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidV4=void 0;const n=r(7415);t.uuidV4=function(e){const t=(0,n.getBytes)(e,"randomBytes");t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=(0,n.hexlify)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}},8394(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseWallet=void 0;const n=r(646),i=r(1181),s=r(3996),o=r(7778),a=r(5347);class c extends s.AbstractSigner{address;#Vt;constructor(e,t){super(t),(0,a.assertArgument)(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#Vt=e;const r=(0,o.computeAddress)(this.signingKey.publicKey);(0,a.defineProperties)(this,{address:r})}get signingKey(){return this.#Vt}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new c(this.#Vt,e)}async signTransaction(e){e=(0,s.copyRequest)(e);const{to:t,from:r}=await(0,a.resolveProperties)({to:e.to?(0,n.resolveAddress)(e.to,this):void 0,from:e.from?(0,n.resolveAddress)(e.from,this):void 0});null!=t&&(e.to=t),null!=r&&(e.from=r),null!=e.from&&((0,a.assertArgument)((0,n.getAddress)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const i=o.Transaction.from(e);return i.signature=this.signingKey.sign(i.unsignedHash),i.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign((0,i.hashMessage)(e)).serialized}authorizeSync(e){(0,a.assertArgument)("string"==typeof e.address,"invalid address for authorizeSync","auth.address",e);const t=this.signingKey.sign((0,i.hashAuthorization)(e));return Object.assign({},{address:(0,n.getAddress)(e.address),nonce:(0,a.getBigInt)(e.nonce||0),chainId:(0,a.getBigInt)(e.chainId||0)},{signature:t})}async authorize(e){return e=Object.assign({},e,{address:await(0,n.resolveAddress)(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,t,r){const n=await i.TypedDataEncoder.resolveNames(e,t,r,async e=>{(0,a.assert)(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const t=await this.provider.resolveName(e);return(0,a.assert)(null!=t,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),t});return this.signingKey.sign(i.TypedDataEncoder.hash(n.domain,t,n.value)).serialized}}t.BaseWallet=c},22(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIndexedAccountPath=t.getAccountPath=t.HDNodeVoidWallet=t.HDNodeWallet=t.defaultPath=void 0;const n=r(2291),i=r(3996),s=r(7778),o=r(5347),a=r(9943),c=r(8394),u=r(2931),l=r(1650);t.defaultPath="m/44'/60'/0'/0/0";const d=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),f=2147483648,h=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function p(e,t){let r="";for(;e;)r="0123456789abcdef"[e%16]+r,e=Math.trunc(e/16);for(;r.length<2*t;)r="0"+r;return"0x"+r}function g(e){const t=(0,o.getBytes)(e),r=(0,o.dataSlice)((0,n.sha256)((0,n.sha256)(t)),0,4),i=(0,o.concat)([t,r]);return(0,o.encodeBase58)(i)}const m={};function y(e,t,r,i){const s=new Uint8Array(37);e&f?((0,o.assert)(null!=i,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set((0,o.getBytes)(i),1)):s.set((0,o.getBytes)(r));for(let t=24;t>=0;t-=8)s[33+(t>>3)]=e>>24-t&255;const a=(0,o.getBytes)((0,n.computeHmac)("sha512",t,s));return{IL:a.slice(0,32),IR:a.slice(32)}}function b(e,t){const r=t.split("/");(0,o.assertArgument)(r.length>0,"invalid path","path",t),"m"===r[0]&&((0,o.assertArgument)(0===e.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",t),r.shift());let n=e;for(let e=0;e<r.length;e++){const t=r[e];if(t.match(/^[0-9]+'$/)){const r=parseInt(t.substring(0,t.length-1));(0,o.assertArgument)(r<f,"invalid path index",`path[${e}]`,t),n=n.deriveChild(f+r)}else if(t.match(/^[0-9]+$/)){const r=parseInt(t);(0,o.assertArgument)(r<f,"invalid path index",`path[${e}]`,t),n=n.deriveChild(r)}else(0,o.assertArgument)(!1,"invalid path component",`path[${e}]`,t)}return n}class w extends c.BaseWallet{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,r,i,s,a,c,u,l){super(t,l),(0,o.assertPrivate)(e,m,"HDNodeWallet"),(0,o.defineProperties)(this,{publicKey:t.compressedPublicKey});const d=(0,o.dataSlice)((0,n.ripemd160)((0,n.sha256)(this.publicKey)),0,4);(0,o.defineProperties)(this,{parentFingerprint:r,fingerprint:d,chainCode:i,path:s,index:a,depth:c}),(0,o.defineProperties)(this,{mnemonic:u})}connect(e){return new w(m,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,e)}#Kt(){const e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&"en"===t.wordlist.locale&&""===t.password&&(e.mnemonic={path:this.path,locale:"en",entropy:t.entropy}),e}async encrypt(e,t){return await(0,l.encryptKeystoreJson)(this.#Kt(),e,{progressCallback:t})}encryptSync(e){return(0,l.encryptKeystoreJsonSync)(this.#Kt(),e)}get extendedKey(){return(0,o.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),g((0,o.concat)(["0x0488ADE4",p(this.depth,1),this.parentFingerprint,p(this.index,4),this.chainCode,(0,o.concat)(["0x00",this.privateKey])]))}hasPath(){return null!=this.path}neuter(){return new _(m,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){const t=(0,o.getNumber)(e,"index");(0,o.assertArgument)(t<=4294967295,"invalid index","index",t);let r=this.path;r&&(r+="/"+(2147483647&t),t&f&&(r+="'"));const{IR:i,IL:s}=y(t,this.chainCode,this.publicKey,this.privateKey),a=new n.SigningKey((0,o.toBeHex)(((0,o.toBigInt)(s)+BigInt(this.privateKey))%h,32));return new w(m,a,this.fingerprint,(0,o.hexlify)(i),r,t,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return b(this,e)}static#Jt(e,t){(0,o.assertArgument)((0,o.isBytesLike)(e),"invalid seed","seed","[REDACTED]");const r=(0,o.getBytes)(e,"seed");(0,o.assertArgument)(r.length>=16&&r.length<=64,"invalid seed","seed","[REDACTED]");const i=(0,o.getBytes)((0,n.computeHmac)("sha512",d,r)),s=new n.SigningKey((0,o.hexlify)(i.slice(0,32)));return new w(m,s,"0x00000000",(0,o.hexlify)(i.slice(32)),"m",0,0,t,null)}static fromExtendedKey(e){const t=(0,o.toBeArray)((0,o.decodeBase58)(e));(0,o.assertArgument)(82===t.length||g(t.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const r=t[4],i=(0,o.hexlify)(t.slice(5,9)),a=parseInt((0,o.hexlify)(t.slice(9,13)).substring(2),16),c=(0,o.hexlify)(t.slice(13,45)),u=t.slice(45,78);switch((0,o.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const e=(0,o.hexlify)(u);return new _(m,(0,s.computeAddress)(e),e,i,c,null,a,r,null)}case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new w(m,new n.SigningKey(u.slice(1)),i,c,null,a,r,null,null)}(0,o.assertArgument)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,r,i){null==e&&(e=""),null==r&&(r=t.defaultPath),null==i&&(i=a.LangEn.wordlist());const s=u.Mnemonic.fromEntropy((0,n.randomBytes)(16),e,i);return w.#Jt(s.computeSeed(),s).derivePath(r)}static fromMnemonic(e,r){return r||(r=t.defaultPath),w.#Jt(e.computeSeed(),e).derivePath(r)}static fromPhrase(e,r,n,i){null==r&&(r=""),null==n&&(n=t.defaultPath),null==i&&(i=a.LangEn.wordlist());const s=u.Mnemonic.fromPhrase(e,r,i);return w.#Jt(s.computeSeed(),s).derivePath(n)}static fromSeed(e){return w.#Jt(e,null)}}t.HDNodeWallet=w;class _ extends i.VoidSigner{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,r,i,s,a,c,u,l){super(t,l),(0,o.assertPrivate)(e,m,"HDNodeVoidWallet"),(0,o.defineProperties)(this,{publicKey:r});const d=(0,o.dataSlice)((0,n.ripemd160)((0,n.sha256)(r)),0,4);(0,o.defineProperties)(this,{publicKey:r,fingerprint:d,parentFingerprint:i,chainCode:s,path:a,index:c,depth:u})}connect(e){return new _(m,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return(0,o.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),g((0,o.concat)(["0x0488B21E",p(this.depth,1),this.parentFingerprint,p(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(e){const t=(0,o.getNumber)(e,"index");(0,o.assertArgument)(t<=4294967295,"invalid index","index",t);let r=this.path;r&&(r+="/"+(2147483647&t),t&f&&(r+="'"));const{IR:i,IL:a}=y(t,this.chainCode,this.publicKey,null),c=n.SigningKey.addPoints(a,this.publicKey,!0),u=(0,s.computeAddress)(c);return new _(m,u,c,this.fingerprint,(0,o.hexlify)(i),r,t,this.depth+1,this.provider)}derivePath(e){return b(this,e)}}t.HDNodeVoidWallet=_,t.getAccountPath=function(e){const t=(0,o.getNumber)(e,"index");return(0,o.assertArgument)(t>=0&&t<f,"invalid account index","index",t),`m/44'/60'/${t}'/0/0`},t.getIndexedAccountPath=function(e){const t=(0,o.getNumber)(e,"index");return(0,o.assertArgument)(t>=0&&t<f,"invalid account index","index",t),`m/44'/60'/0'/0/${t}`}},3279(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=t.Mnemonic=t.encryptKeystoreJsonSync=t.encryptKeystoreJson=t.decryptKeystoreJson=t.decryptKeystoreJsonSync=t.isKeystoreJson=t.decryptCrowdsaleJson=t.isCrowdsaleJson=t.HDNodeVoidWallet=t.HDNodeWallet=t.getIndexedAccountPath=t.getAccountPath=t.defaultPath=t.BaseWallet=void 0;var n=r(8394);Object.defineProperty(t,"BaseWallet",{enumerable:!0,get:function(){return n.BaseWallet}});var i=r(22);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return i.defaultPath}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return i.getAccountPath}}),Object.defineProperty(t,"getIndexedAccountPath",{enumerable:!0,get:function(){return i.getIndexedAccountPath}}),Object.defineProperty(t,"HDNodeWallet",{enumerable:!0,get:function(){return i.HDNodeWallet}}),Object.defineProperty(t,"HDNodeVoidWallet",{enumerable:!0,get:function(){return i.HDNodeVoidWallet}});var s=r(7570);Object.defineProperty(t,"isCrowdsaleJson",{enumerable:!0,get:function(){return s.isCrowdsaleJson}}),Object.defineProperty(t,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return s.decryptCrowdsaleJson}});var o=r(1650);Object.defineProperty(t,"isKeystoreJson",{enumerable:!0,get:function(){return o.isKeystoreJson}}),Object.defineProperty(t,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return o.decryptKeystoreJsonSync}}),Object.defineProperty(t,"decryptKeystoreJson",{enumerable:!0,get:function(){return o.decryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJson",{enumerable:!0,get:function(){return o.encryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return o.encryptKeystoreJsonSync}});var a=r(2931);Object.defineProperty(t,"Mnemonic",{enumerable:!0,get:function(){return a.Mnemonic}});var c=r(6930);Object.defineProperty(t,"Wallet",{enumerable:!0,get:function(){return c.Wallet}})},7570(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decryptCrowdsaleJson=t.isCrowdsaleJson=void 0;const n=r(8165),i=r(646),s=r(2291),o=r(1181),a=r(5347),c=r(8634);t.isCrowdsaleJson=function(e){try{if(JSON.parse(e).encseed)return!0}catch(e){}return!1},t.decryptCrowdsaleJson=function(e,t){const r=JSON.parse(e),u=(0,c.getPassword)(t),l=(0,i.getAddress)((0,c.spelunk)(r,"ethaddr:string!")),d=(0,c.looseArrayify)((0,c.spelunk)(r,"encseed:string!"));(0,a.assertArgument)(d&&d.length%16==0,"invalid encseed","json",e);const f=(0,a.getBytes)((0,s.pbkdf2)(u,u,2e3,32,"sha256")).slice(0,16),h=d.slice(0,16),p=d.slice(16),g=new n.CBC(f,h),m=(0,n.pkcs7Strip)((0,a.getBytes)(g.decrypt(p)));let y="";for(let e=0;e<m.length;e++)y+=String.fromCharCode(m[e]);return{address:l,privateKey:(0,o.id)(y)}}},1650(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encryptKeystoreJson=t.encryptKeystoreJsonSync=t.decryptKeystoreJson=t.decryptKeystoreJsonSync=t.isKeystoreJson=void 0;const n=r(8165),i=r(646),s=r(2291),o=r(7778),a=r(5347),c=r(8634),u=r(4586),l="m/44'/60'/0'/0/0";function d(e,t){const r=(0,a.getBytes)(t),u=(0,c.spelunk)(e,"crypto.ciphertext:data!"),d=(0,a.hexlify)((0,s.keccak256)((0,a.concat)([r.slice(16,32),u]))).substring(2);(0,a.assertArgument)(d===(0,c.spelunk)(e,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const f=function(e,t,r){if("aes-128-ctr"===(0,c.spelunk)(e,"crypto.cipher:string")){const i=(0,c.spelunk)(e,"crypto.cipherparams.iv:data!"),s=new n.CTR(t,i);return(0,a.hexlify)(s.decrypt(r))}(0,a.assert)(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}(e,r.slice(0,16),u),h=(0,o.computeAddress)(f);if(e.address){let t=e.address.toLowerCase();t.startsWith("0x")||(t="0x"+t),(0,a.assertArgument)((0,i.getAddress)(t)===h,"keystore address/privateKey mismatch","address",e.address)}const p={address:h,privateKey:f};if("0.1"===(0,c.spelunk)(e,"x-ethers.version:string")){const t=r.slice(32,64),i=(0,c.spelunk)(e,"x-ethers.mnemonicCiphertext:data!"),s=(0,c.spelunk)(e,"x-ethers.mnemonicCounter:data!"),o=new n.CTR(t,s);p.mnemonic={path:(0,c.spelunk)(e,"x-ethers.path:string")||l,locale:(0,c.spelunk)(e,"x-ethers.locale:string")||"en",entropy:(0,a.hexlify)((0,a.getBytes)(o.decrypt(i)))}}return p}function f(e){const t=(0,c.spelunk)(e,"crypto.kdf:string");if(t&&"string"==typeof t){if("scrypt"===t.toLowerCase()){const r=(0,c.spelunk)(e,"crypto.kdfparams.salt:data!"),n=(0,c.spelunk)(e,"crypto.kdfparams.n:int!"),i=(0,c.spelunk)(e,"crypto.kdfparams.r:int!"),s=(0,c.spelunk)(e,"crypto.kdfparams.p:int!");(0,a.assertArgument)(n>0&&!(n&n-1),"invalid kdf.N","kdf.N",n),(0,a.assertArgument)(i>0&&s>0,"invalid kdf","kdf",t);const o=(0,c.spelunk)(e,"crypto.kdfparams.dklen:int!");return(0,a.assertArgument)(32===o,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:r,N:n,r:i,p:s,dkLen:64}}if("pbkdf2"===t.toLowerCase()){const t=(0,c.spelunk)(e,"crypto.kdfparams.salt:data!"),r=(0,c.spelunk)(e,"crypto.kdfparams.prf:string!"),n=r.split("-").pop();(0,a.assertArgument)("sha256"===n||"sha512"===n,"invalid kdf.pdf","kdf.pdf",r);const i=(0,c.spelunk)(e,"crypto.kdfparams.c:int!"),s=(0,c.spelunk)(e,"crypto.kdfparams.dklen:int!");return(0,a.assertArgument)(32===s,"invalid kdf.dklen","kdf.dklen",s),{name:"pbkdf2",salt:t,count:i,dkLen:s,algorithm:n}}}(0,a.assertArgument)(!1,"unsupported key-derivation function","kdf",t)}function h(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function p(e){const t=null!=e.salt?(0,a.getBytes)(e.salt,"options.salt"):(0,s.randomBytes)(32);let r=1<<17,n=8,i=1;return e.scrypt&&(e.scrypt.N&&(r=e.scrypt.N),e.scrypt.r&&(n=e.scrypt.r),e.scrypt.p&&(i=e.scrypt.p)),(0,a.assertArgument)("number"==typeof r&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),(0,a.assertArgument)("number"==typeof n&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),(0,a.assertArgument)("number"==typeof i&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:t,N:r,r:n,p:i}}function g(e,t,r,i){const o=(0,a.getBytes)(r.privateKey,"privateKey"),d=null!=i.iv?(0,a.getBytes)(i.iv,"options.iv"):(0,s.randomBytes)(16);(0,a.assertArgument)(16===d.length,"invalid options.iv length","options.iv",i.iv);const f=null!=i.uuid?(0,a.getBytes)(i.uuid,"options.uuid"):(0,s.randomBytes)(16);(0,a.assertArgument)(16===f.length,"invalid options.uuid length","options.uuid",i.iv);const h=e.slice(0,16),p=e.slice(16,32),g=new n.CTR(h,d),m=(0,a.getBytes)(g.encrypt(o)),y=(0,s.keccak256)((0,a.concat)([p,m])),b={address:r.address.substring(2).toLowerCase(),id:(0,a.uuidV4)(f),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,a.hexlify)(d).substring(2)},ciphertext:(0,a.hexlify)(m).substring(2),kdf:"scrypt",kdfparams:{salt:(0,a.hexlify)(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:y.substring(2)}};if(r.mnemonic){const t=null!=i.client?i.client:`ethers/${u.version}`,o=r.mnemonic.path||l,d=r.mnemonic.locale||"en",f=e.slice(32,64),h=(0,a.getBytes)(r.mnemonic.entropy,"account.mnemonic.entropy"),p=(0,s.randomBytes)(16),g=new n.CTR(f,p),m=(0,a.getBytes)(g.encrypt(h)),y=new Date,w="UTC--"+y.getUTCFullYear()+"-"+(0,c.zpad)(y.getUTCMonth()+1,2)+"-"+(0,c.zpad)(y.getUTCDate(),2)+"T"+(0,c.zpad)(y.getUTCHours(),2)+"-"+(0,c.zpad)(y.getUTCMinutes(),2)+"-"+(0,c.zpad)(y.getUTCSeconds(),2)+".0Z--"+b.address;b["x-ethers"]={client:t,gethFilename:w,path:o,locale:d,mnemonicCounter:(0,a.hexlify)(p).substring(2),mnemonicCiphertext:(0,a.hexlify)(m).substring(2),version:"0.1"}}return JSON.stringify(b)}t.isKeystoreJson=function(e){try{const t=JSON.parse(e);if(3===(null!=t.version?parseInt(t.version):0))return!0}catch(e){}return!1},t.decryptKeystoreJsonSync=function(e,t){const r=JSON.parse(e),n=(0,c.getPassword)(t),i=f(r);if("pbkdf2"===i.name){const{salt:e,count:t,dkLen:o,algorithm:a}=i;return d(r,(0,s.pbkdf2)(n,e,t,o,a))}(0,a.assert)("scrypt"===i.name,"cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:o,N:u,r:l,p:h,dkLen:p}=i;return d(r,(0,s.scryptSync)(n,o,u,l,h,p))},t.decryptKeystoreJson=async function(e,t,r){const n=JSON.parse(e),i=(0,c.getPassword)(t),o=f(n);if("pbkdf2"===o.name){r&&(r(0),await h(0));const{salt:e,count:t,dkLen:a,algorithm:c}=o,u=(0,s.pbkdf2)(i,e,t,a,c);return r&&(r(1),await h(0)),d(n,u)}(0,a.assert)("scrypt"===o.name,"cannot be reached","UNKNOWN_ERROR",{params:o});const{salt:u,N:l,r:p,p:g,dkLen:m}=o;return d(n,await(0,s.scrypt)(i,u,l,p,g,m,r))},t.encryptKeystoreJsonSync=function(e,t,r){null==r&&(r={});const n=(0,c.getPassword)(t),i=p(r),o=(0,s.scryptSync)(n,i.salt,i.N,i.r,i.p,64);return g((0,a.getBytes)(o),i,e,r)},t.encryptKeystoreJson=async function(e,t,r){null==r&&(r={});const n=(0,c.getPassword)(t),i=p(r),o=await(0,s.scrypt)(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return g((0,a.getBytes)(o),i,e,r)}},2931(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Mnemonic=void 0;const n=r(2291),i=r(5347),s=r(9943);function o(e){return(1<<e)-1<<8-e&255}function a(e){return(1<<e)-1&255}function c(e,t){(0,i.assertNormalize)("NFKD"),null==t&&(t=s.LangEn.wordlist());const r=t.split(e);(0,i.assertArgument)(r.length%3==0&&r.length>=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const a=new Uint8Array(Math.ceil(11*r.length/8));let c=0;for(let e=0;e<r.length;e++){let n=t.getWordIndex(r[e].normalize("NFKD"));(0,i.assertArgument)(n>=0,`invalid mnemonic word at index ${e}`,"mnemonic","[ REDACTED ]");for(let e=0;e<11;e++)n&1<<10-e&&(a[c>>3]|=1<<7-c%8),c++}const u=32*r.length/3,l=o(r.length/3),d=(0,i.getBytes)((0,n.sha256)(a.slice(0,u/8)))[0]&l;return(0,i.assertArgument)(d===(a[a.length-1]&l),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,i.hexlify)(a.slice(0,u/8))}function u(e,t){(0,i.assertArgument)(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==t&&(t=s.LangEn.wordlist());const r=[0];let c=11;for(let t=0;t<e.length;t++)c>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],c-=8):(r[r.length-1]<<=c,r[r.length-1]|=e[t]>>8-c,r.push(e[t]&a(8-c)),c+=3);const u=e.length/4,l=parseInt((0,n.sha256)(e).substring(2,4),16)&o(u);return r[r.length-1]<<=u,r[r.length-1]|=l>>8-u,t.join(r.map(e=>t.getWord(e)))}const l={};class d{phrase;password;wordlist;entropy;constructor(e,t,r,n,o){null==n&&(n=""),null==o&&(o=s.LangEn.wordlist()),(0,i.assertPrivate)(e,l,"Mnemonic"),(0,i.defineProperties)(this,{phrase:r,password:n,wordlist:o,entropy:t})}computeSeed(){const e=(0,i.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,n.pbkdf2)((0,i.toUtf8Bytes)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,r){const n=c(e,r);return e=u((0,i.getBytes)(n),r),new d(l,n,e,t,r)}static fromEntropy(e,t,r){const n=(0,i.getBytes)(e,"entropy"),s=u(n,r);return new d(l,(0,i.hexlify)(n),s,t,r)}static entropyToPhrase(e,t){return u((0,i.getBytes)(e,"entropy"),t)}static phraseToEntropy(e,t){return c(e,t)}static isValidMnemonic(e,t){try{return c(e,t),!0}catch(e){}return!1}}t.Mnemonic=d},8634(e,t,r){"use strict";t.spelunk=t.getPassword=t.zpad=t.looseArrayify=void 0;const n=r(5347);function i(e){return"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),(0,n.getBytesCopy)(e)}t.looseArrayify=i,t.zpad=function(e,t){for(e=String(e);e.length<t;)e="0"+e;return e},t.getPassword=function(e){return"string"==typeof e?(0,n.toUtf8Bytes)(e,"NFKC"):(0,n.getBytesCopy)(e)},t.spelunk=function(e,t){const r=t.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);(0,n.assertArgument)(null!=r,"invalid path","path",t);const s=r[1],o=r[3],a="!"===r[4];let c=e;for(const e of s.toLowerCase().split(".")){if(Array.isArray(c)){if(!e.match(/^[0-9]+$/))break;c=c[parseInt(e)]}else if("object"==typeof c){let t=null;for(const r in c)if(r.toLowerCase()===e){t=c[r];break}c=t}else c=null;if(null==c)break}if((0,n.assertArgument)(!a||null!=c,"missing required value","path",s),o&&null!=c){if("int"===o){if("string"==typeof c&&c.match(/^-?[0-9]+$/))return parseInt(c);if(Number.isSafeInteger(c))return c}if("number"===o&&"string"==typeof c&&c.match(/^-?[0-9.]*$/))return parseFloat(c);if("data"===o&&"string"==typeof c)return i(c);if("array"===o&&Array.isArray(c))return c;if(o===typeof c)return c;(0,n.assertArgument)(!1,`wrong type found for ${o} `,"path",s)}return c}},6930(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=void 0;const n=r(2291),i=r(5347),s=r(8394),o=r(22),a=r(7570),c=r(1650),u=r(2931);function l(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}class d extends s.BaseWallet{constructor(e,t){"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),super("string"==typeof e?new n.SigningKey(e):e,t)}connect(e){return new d(this.signingKey,e)}async encrypt(e,t){const r={address:this.address,privateKey:this.privateKey};return await(0,c.encryptKeystoreJson)(r,e,{progressCallback:t})}encryptSync(e){const t={address:this.address,privateKey:this.privateKey};return(0,c.encryptKeystoreJsonSync)(t,e)}static#Qt(e){if((0,i.assertArgument)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&"en"===e.mnemonic.locale){const t=u.Mnemonic.fromEntropy(e.mnemonic.entropy),r=o.HDNodeWallet.fromMnemonic(t,e.mnemonic.path);if(r.address===e.address&&r.privateKey===e.privateKey)return r;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const t=new d(e.privateKey);return(0,i.assertArgument)(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t}static async fromEncryptedJson(e,t,r){let n=null;return(0,c.isKeystoreJson)(e)?n=await(0,c.decryptKeystoreJson)(e,t,r):(0,a.isCrowdsaleJson)(e)&&(r&&(r(0),await l(0)),n=(0,a.decryptCrowdsaleJson)(e,t),r&&(r(1),await l(0))),d.#Qt(n)}static fromEncryptedJsonSync(e,t){let r=null;return(0,c.isKeystoreJson)(e)?r=(0,c.decryptKeystoreJsonSync)(e,t):(0,a.isCrowdsaleJson)(e)?r=(0,a.decryptCrowdsaleJson)(e,t):(0,i.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),d.#Qt(r)}static createRandom(e){const t=o.HDNodeWallet.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){const r=o.HDNodeWallet.fromPhrase(e);return t?r.connect(t):r}}t.Wallet=d},9610(e,t){"use strict";t.decodeBits=void 0,t.decodeBits=function(e,t){const r=(1<<e)-1,n=[];let i=0,s=0,o=0;for(let a=0;a<t.length;a++)for(i=i<<6|")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".indexOf(t[a]),s+=6;s>=e;){const t=i>>s-e;i&=(1<<s-e)-1,s-=e,0===t?o+=r:(n.push(t+o),o=0)}return n}},2426(e,t,r){"use strict";t.decodeOwl=void 0;const n=r(5347),i=/^[a-z]*$/i;function s(e,t){let r=97;return e.reduce((e,n)=>(n===t?r++:n.match(i)?e.push(String.fromCharCode(r)+n):(r=97,e.push(n)),e),[])}t.decodeOwl=function(e){return(0,n.assertArgument)("0"===e[0],"unsupported auwl data","data",e),function(e,t){for(let r=28;r>=0;r--)e=e.split(" !#$%&'()*+,-./<=>?@[]^_`{|}~"[r]).join(t.substring(2*r,2*r+2));const r=[],n=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(e,t,n,i)=>{if(n)for(let e=parseInt(n);e>=0;e--)r.push(";");else r.push(t.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return s(s(r,";"),":")}(e.substring(59),e.substring(1,59))}},7703(e,t,r){"use strict";t.decodeOwlA=void 0;const n=r(5347),i=r(9610),s=r(2426);t.decodeOwlA=function(e,t){let r=(0,s.decodeOwl)(e).join(",");return t.split(/,/g).forEach(e=>{const s=e.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,n.assertArgument)(null!==s,"internal error parsing accents","accents",t);let o=0;const a=(0,i.decodeBits)(parseInt(s[3]),s[4]),c=parseInt(s[2]),u=new RegExp(`([${s[1]}])`,"g");r=r.replace(u,(e,t)=>(0===--a[o]&&(t=String.fromCharCode(t.charCodeAt(0),c),o++),t))}),r.split(",")}},6591(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlists=t.WordlistOwlA=t.WordlistOwl=t.LangEn=t.Wordlist=void 0;var n=r(9011);Object.defineProperty(t,"Wordlist",{enumerable:!0,get:function(){return n.Wordlist}});var i=r(9943);Object.defineProperty(t,"LangEn",{enumerable:!0,get:function(){return i.LangEn}});var s=r(2684);Object.defineProperty(t,"WordlistOwl",{enumerable:!0,get:function(){return s.WordlistOwl}});var o=r(8725);Object.defineProperty(t,"WordlistOwlA",{enumerable:!0,get:function(){return o.WordlistOwlA}});var a=r(2431);Object.defineProperty(t,"wordlists",{enumerable:!0,get:function(){return a.wordlists}})},9943(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LangEn=void 0;const n=r(2684);let i=null;class s extends n.WordlistOwl{constructor(){super("en","0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==i&&(i=new s),i}}t.LangEn=s},2684(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WordlistOwl=void 0;const n=r(1181),i=r(5347),s=r(2426),o=r(9011);class a extends o.Wordlist{#r;#Zt;constructor(e,t,r){super(e),this.#r=t,this.#Zt=r,this.#Yt=null}get _data(){return this.#r}_decodeWords(){return(0,s.decodeOwl)(this.#r)}#Yt;#Xt(){if(null==this.#Yt){const e=this._decodeWords();if((0,n.id)(e.join("\n")+"\n")!==this.#Zt)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#Yt=e}return this.#Yt}getWord(e){const t=this.#Xt();return(0,i.assertArgument)(e>=0&&e<t.length,`invalid word index: ${e}`,"index",e),t[e]}getWordIndex(e){return this.#Xt().indexOf(e)}}t.WordlistOwl=a},8725(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WordlistOwlA=void 0;const n=r(2684),i=r(7703);class s extends n.WordlistOwl{#er;constructor(e,t,r,n){super(e,t,n),this.#er=r}get _accent(){return this.#er}_decodeWords(){return(0,i.decodeOwlA)(this._data,this._accent)}}t.WordlistOwlA=s},9011(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wordlist=void 0;const n=r(5347);t.Wordlist=class{locale;constructor(e){(0,n.defineProperties)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}},2431(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlists=void 0;const n=r(9943);t.wordlists={en:n.LangEn.wordlist()}},9012(e,t){!function(e){"use strict";var t,r,n,i,s,o,a,c,u,l,d,f,h=e=>{throw TypeError(e)},p=(e,t,r)=>t.has(e)||h("Cannot "+r),g=(e,t,r)=>(p(e,t,"read from private field"),r?r.call(e):t.get(e)),m=(e,t,r)=>t.has(e)?h("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),y=(e,t,r,n)=>(p(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);const b="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIHUobil7aWYobj09PSIvIilyZXR1cm57cGFyZW50Om51bGwsbmFtZToiIn07Y29uc3QgZT1uLnNwbGl0KCIvIikuZmlsdGVyKGk9PmkubGVuZ3RoPjApO2lmKGUubGVuZ3RoPT09MCl0aHJvdyBFcnJvcigiSW52YWxpZCBwYXRoIik7Y29uc3QgYT1lW2UubGVuZ3RoLTFdLHI9Ii8iK2Uuc2xpY2UoMCwtMSkuam9pbigiLyIpO3JldHVybntuYW1lOmEscGFyZW50OnJ9fWFzeW5jIGZ1bmN0aW9uIHcobixlKXtjb25zdHtwYXJlbnQ6YSxuYW1lOnJ9PXUobik7aWYoYT09bnVsbClyZXR1cm4gYXdhaXQgbmF2aWdhdG9yLnN0b3JhZ2UuZ2V0RGlyZWN0b3J5KCk7Y29uc3QgaT1hLnNwbGl0KCIvIikuZmlsdGVyKHQ9PnQubGVuZ3RoPjApO3RyeXtsZXQgdD1hd2FpdCBuYXZpZ2F0b3Iuc3RvcmFnZS5nZXREaXJlY3RvcnkoKTtmb3IoY29uc3QgcyBvZiBpKXQ9YXdhaXQgdC5nZXREaXJlY3RvcnlIYW5kbGUocyx7Y3JlYXRlOmUuY3JlYXRlfSk7aWYoZS5pc0ZpbGUpcmV0dXJuIGF3YWl0IHQuZ2V0RmlsZUhhbmRsZShyLHtjcmVhdGU6ZS5jcmVhdGV9KX1jYXRjaCh0KXtpZih0Lm5hbWU9PT0iTm90Rm91bmRFcnJvciIpcmV0dXJuIG51bGw7dGhyb3cgdH19Y29uc3QgZj17fTtzZWxmLm9ubWVzc2FnZT1hc3luYyBuPT57dmFyIGk7Y29uc3R7ZXZ0VHlwZTplLGFyZ3M6YX09bi5kYXRhO2xldCByPWZbYS5maWxlSWRdO3RyeXtsZXQgdDtjb25zdCBzPVtdO2lmKGU9PT0icmVnaXN0ZXIiKXtjb25zdCBsPWF3YWl0IHcoYS5maWxlUGF0aCx7Y3JlYXRlOiEwLGlzRmlsZTohMH0pO2lmKGw9PW51bGwpdGhyb3cgRXJyb3IoYG5vdCBmb3VuZCBmaWxlOiAke2EuZmlsZUlkfWApO3I9YXdhaXQgbC5jcmVhdGVTeW5jQWNjZXNzSGFuZGxlKHttb2RlOmEubW9kZX0pLGZbYS5maWxlSWRdPXJ9ZWxzZSBpZihlPT09ImNsb3NlIilhd2FpdCByLmNsb3NlKCksZGVsZXRlIGZbYS5maWxlSWRdO2Vsc2UgaWYoZT09PSJ0cnVuY2F0ZSIpYXdhaXQgci50cnVuY2F0ZShhLm5ld1NpemUpO2Vsc2UgaWYoZT09PSJ3cml0ZSIpe2NvbnN0e2RhdGE6bCxvcHRzOm99PW4uZGF0YS5hcmdzO3Q9YXdhaXQgci53cml0ZShsLG8pfWVsc2UgaWYoZT09PSJyZWFkIil7Y29uc3R7b2Zmc2V0Omwsc2l6ZTpvfT1uLmRhdGEuYXJncyxnPW5ldyBVaW50OEFycmF5KG8pLGQ9YXdhaXQgci5yZWFkKGcse2F0Omx9KSxjPWcuYnVmZmVyO3Q9ZD09PW8/YzooKGk9Yy50cmFuc2Zlcik9PW51bGw/dm9pZCAwOmkuY2FsbChjLGQpKT8/Yy5zbGljZSgwLGQpLHMucHVzaCh0KX1lbHNlIGU9PT0iZ2V0U2l6ZSI/dD1hd2FpdCByLmdldFNpemUoKTplPT09ImZsdXNoIiYmYXdhaXQgci5mbHVzaCgpO3NlbGYucG9zdE1lc3NhZ2Uoe2V2dFR5cGU6ImNhbGxiYWNrIixjYklkOm4uZGF0YS5jYklkLHJldHVyblZhbDp0fSxzKX1jYXRjaCh0KXtjb25zdCBzPXQ7c2VsZi5wb3N0TWVzc2FnZSh7ZXZ0VHlwZToidGhyb3dFcnJvciIsY2JJZDpuLmRhdGEuY2JJZCxlcnJNc2c6cy5uYW1lKyI6ICIrcy5tZXNzYWdlK2AKYCtKU09OLnN0cmluZ2lmeShuLmRhdGEpfSl9fX0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPW9wZnMtd29ya2VyLUY0UldscWNfLmpzLm1hcAo=",w=typeof self<"u"&&self.Blob&&new Blob([(_=b,Uint8Array.from(atob(_),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var _;function v(e){let t;try{if(t=w&&(self.URL||self.webkitURL).createObjectURL(w),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+b,{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}async function A(e,t,r){const n=function(){if(k.length<3){const t=e();return k.push(t),t}{const e=k[P];return P=(P+1)%k.length,e}function e(){const e=new v;let t=0,r={};return e.onmessage=({data:e})=>{var t,n;"callback"===e.evtType?null==(t=r[e.cbId])||t.resolve(e.returnVal):"throwError"===e.evtType&&(null==(n=r[e.cbId])||n.reject(Error(e.errMsg))),delete r[e.cbId]},async function(n,i,s=[]){t+=1;const o=new Promise((e,n)=>{r[t]={resolve:e,reject:n}});return e.postMessage({cbId:t,evtType:n,args:i},s),o}}}();return await n("register",{fileId:e,filePath:t,mode:r}),{read:async(t,r)=>await n("read",{fileId:e,offset:t,size:r}),write:async(t,r)=>await n("write",{fileId:e,data:t,opts:r},[ArrayBuffer.isView(t)?t.buffer:t]),close:async()=>await n("close",{fileId:e}),truncate:async t=>await n("truncate",{fileId:e,newSize:t}),getSize:async()=>await n("getSize",{fileId:e}),flush:async()=>await n("flush",{fileId:e})}}const k=[];let P=0;function E(e){if("/"===e)return{parent:null,name:""};const t=e.split("/").filter(e=>e.length>0);if(0===t.length)throw Error("Invalid path");return{name:t[t.length-1],parent:"/"+t.slice(0,-1).join("/")}}async function x(e,t){const{parent:r,name:n}=E(e);if(null==r)return await navigator.storage.getDirectory();const i=r.split("/").filter(e=>e.length>0);try{let e=await navigator.storage.getDirectory();for(const r of i)e=await e.getDirectoryHandle(r,{create:t.create});return t.isFile?await e.getFileHandle(n,{create:t.create}):await e.getDirectoryHandle(n,{create:t.create})}catch(e){if("NotFoundError"===e.name)return null;throw e}}async function O(e){const{parent:t,name:r}=E(e);if(null==t){const e=await navigator.storage.getDirectory();for await(const t of e.keys())await e.removeEntry(t,{recursive:!0});return}const n=await x(t,{create:!1,isFile:!1});if(null!=n)try{await n.removeEntry(r,{recursive:!0})}catch(e){if("NotFoundError"===e.name)return;throw e}}function S(e,t){return`${e}/${t}`.replace("//","/")}function T(e){return new B(e)}t=new WeakMap,r=new WeakMap,n=new WeakMap;let B=class e{constructor(e){m(this,t),m(this,r),m(this,n),y(this,t,e);const{parent:i,name:s}=E(e);y(this,r,s),y(this,n,i)}get kind(){return"dir"}get name(){return g(this,r)}get path(){return g(this,t)}get parent(){return null==g(this,n)?null:T(g(this,n))}async create(){return await x(g(this,t),{create:!0,isFile:!1}),T(g(this,t))}async exists(){return await x(g(this,t),{create:!1,isFile:!1})instanceof FileSystemDirectoryHandle}async remove(e={}){for(const t of await this.children())try{await t.remove(e)}catch(e){console.warn(e)}try{await O(g(this,t))}catch(e){console.warn(e)}}async children(){const e=await x(g(this,t),{create:!1,isFile:!1});if(null==e)return[];const r=[];for await(const n of e.values())r.push(("file"===n.kind?N:T)(S(g(this,t),n.name)));return r}async copyTo(t){if(!await this.exists())throw Error(`dir ${this.path} not exists`);if(t instanceof e){const e=await t.exists()?T(S(t.path,this.name)):t;return await e.create(),await Promise.all((await this.children()).map(t=>t.copyTo(e))),e}if(t instanceof FileSystemDirectoryHandle)return await Promise.all((await this.children()).map(async e=>{"file"===e.kind?await e.copyTo(await t.getFileHandle(e.name,{create:!0})):await e.copyTo(await t.getDirectoryHandle(e.name,{create:!0}))})),null;throw Error("Illegal target type")}async moveTo(e){const t=await this.copyTo(e);return await this.remove(),t}};const R=new Map;function N(e,t="rw"){if("rw"===t){const r=R.get(e)??new F(e,t);return R.set(e,r),r}return new F(e,t)}async function C(e,t,r={overwrite:!0}){if(t instanceof F)return void await C(e,await t.stream(),r);const n=await(e instanceof F?e:N(e,"rw")).createWriter();try{if(r.overwrite&&await n.truncate(0),t instanceof ReadableStream){const e=t.getReader();for(;;){const{done:t,value:r}=await e.read();if(t)break;await n.write(r)}}else await n.write(t)}catch(e){throw e}finally{await n.close()}}let I=0;i=new WeakMap,s=new WeakMap,o=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,l=new WeakMap,d=new WeakMap,f=new WeakMap;let F=class e{constructor(e,t){m(this,i),m(this,s),m(this,o),m(this,a),m(this,c),m(this,u,0),m(this,l,async()=>{}),m(this,d,(()=>{let e=null;return()=>(y(this,u,g(this,u)+1),null!=e||(e=new Promise(async(t,r)=>{try{const r=await A(g(this,c),g(this,i),g(this,a));y(this,l,async()=>{null!=e&&(e=null,y(this,u,0),await r.close().catch(console.error))}),t([r,async()=>{y(this,u,g(this,u)-1),!(g(this,u)>0)&&(e=null,await r.close())}])}catch(e){r(e)}})),e)})()),m(this,f,!1),y(this,c,++I),y(this,i,e),y(this,a,{r:"read-only",rw:"readwrite","rw-unsafe":"readwrite-unsafe"}[t]);const{parent:r,name:n}=E(e);if(null==r)throw Error("Invalid path");y(this,o,n),y(this,s,r)}get kind(){return"file"}get path(){return g(this,i)}get name(){return g(this,o)}get parent(){return null==g(this,s)?null:T(g(this,s))}async createWriter(){if("read-only"===g(this,a))throw Error("file is read-only");if(g(this,f))throw Error("Other writer have not been closed");y(this,f,!0);try{const e=new TextEncoder,[t,r]=await g(this,d).call(this);let n=await t.getSize(),i=!1;return{write:async(r,s={})=>{if(i)throw Error("Writer is closed");const o="string"==typeof r?e.encode(r):r,a=s.at??n,c=o.byteLength;return n=a+c,await t.write(o,{at:a})},truncate:async e=>{if(i)throw Error("Writer is closed");await t.truncate(e),n>e&&(n=e)},flush:async()=>{if(i)throw Error("Writer is closed");await t.flush()},close:async()=>{if(i)throw Error("Writer is closed");i=!0,y(this,f,!1),await r()}}}catch(e){throw y(this,f,!1),e}}async createReader(){const[e,t]=await g(this,d).call(this);let r=!1,n=0;return{read:async(t,i={})=>{if(r)throw Error("Reader is closed");const s=i.at??n,o=await e.read(s,t);return n=s+o.byteLength,o},getSize:async()=>{if(r)throw Error("Reader is closed");return await e.getSize()},close:async()=>{r||(r=!0,await t())}}}async text(){return(new TextDecoder).decode(await this.arrayBuffer())}async arrayBuffer(){const e=await x(g(this,i),{create:!1,isFile:!0});return null==e?new ArrayBuffer(0):(await e.getFile()).arrayBuffer()}async stream(){const e=await this.getOriginFile();return null==e?new ReadableStream({pull:e=>{e.close()}}):e.stream()}async getOriginFile(){var e;return null==(e=await x(g(this,i),{create:!1,isFile:!0}))?void 0:e.getFile()}async getSize(){const e=await x(g(this,i),{create:!1,isFile:!0});return null==e?0:(await e.getFile()).size}async exists(){return await x(g(this,i),{create:!1,isFile:!0})instanceof FileSystemFileHandle}async remove(e={}){if(!0===e.force)return await g(this,l).call(this),await O(g(this,i)),void R.delete(g(this,i));if(g(this,u)>0)throw Error("exists unclosed reader/writer");await O(g(this,i))}async copyTo(t){if(t instanceof e)return t.path===this.path?this:(await C(t,this),t);if(t instanceof B){if(!await this.exists())throw Error(`file ${this.path} not exists`);return await this.copyTo(N(S(t.path,this.name)))}if(t instanceof FileSystemFileHandle)return await(await this.stream()).pipeTo(await t.createWritable()),null;throw Error("Illegal target type")}async moveTo(e){const t=await this.copyTo(e);return await this.remove(),t}};const U="/.opfs-tools-temp-dir";async function j(e){try{if("file"===e.kind){if(!await e.exists())return!0;const t=await e.createWriter();await t.truncate(0),await t.close(),await e.remove()}else await e.remove();return!0}catch(e){return console.warn(e),!1}}const L=[];let D=!1;(async function(){var e;!0!==globalThis.__opfs_tools_tmpfile_init__&&(globalThis.__opfs_tools_tmpfile_init__=!0,null!=globalThis.FileSystemDirectoryHandle&&null!=globalThis.FileSystemFileHandle&&null!=(null==(e=globalThis.navigator)?void 0:e.storage.getDirectory)&&(setInterval(async()=>{for(const e of await T(U).children()){const t=/^\d+-(\d+)$/.exec(e.name);(null==t||Date.now()-Number(t[1])>2592e5)&&await j(e)}},6e4),await async function(){if(null==globalThis.localStorage)return;const e="OPFS_TOOLS_EXPIRES_TMP_FILES";D||(D=!0,globalThis.addEventListener("unload",()=>{0!==L.length&&localStorage.setItem(e,`${localStorage.getItem(e)??""},${L.join(",")}`)}));let t=localStorage.getItem(e)??"";for(const e of t.split(","))0!==e.length&&await j(N(`${U}/${e}`))&&(t=t.replace(e,""));localStorage.setItem(e,t.replace(/,{2,}/g,","))}()))})(),e.dir=T,e.file=N,e.rollfile=function(e,t){let r=N(e),n=0,i=r.createWriter(),s=r.createReader();return{append:async e=>{const r=await i;n+=await r.write(e),n>=t&&await(async e=>{const t=await(await s).read(n,{at:Math.round(.3*n)});n=await e.write(t,{at:0}),await e.truncate(n)})(r)},text:r.text.bind(r),remove:async()=>{await(await s).close(),await(await i).close(),await r.remove()},getSize:async()=>n}},e.tmpfile=function(){const e=`${Math.random().toString().slice(2)}-${Date.now()}`;return L.push(e),N(`${U}/${e}`)},e.write=C,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}(t)},7516(e,t,r){"use strict";r.r(t),r.d(t,{ABORT_ERROR:()=>x,CURRENT_DIR:()=>Qe,NOT_FOUND_ERROR:()=>Ke,ROOT_DIR:()=>Je,TIMEOUT_ERROR:()=>O,TMP_DIR:()=>Ze,appendFile:()=>Et,appendFileSync:()=>br,assertAbsolutePath:()=>Ye,assertFileUrl:()=>Xe,connectSyncAgent:()=>sr,copy:()=>xt,copySync:()=>wr,createFile:()=>gt,createFileSync:()=>ur,deleteTemp:()=>It,deleteTempSync:()=>Ar,downloadFile:()=>At,emptyDir:()=>Ot,emptyDirSync:()=>_r,exists:()=>St,existsSync:()=>vr,generateTempPath:()=>ct,getFileDataByHandle:()=>pt,getSyncMessenger:()=>or,isDirectoryHandle:()=>ft,isFileHandle:()=>dt,isFileHandleLike:()=>ht,isOPFSSupported:()=>Ht,isTempPath:()=>ut,mkTemp:()=>Ct,mkTempSync:()=>kr,mkdir:()=>mt,mkdirSync:()=>lr,move:()=>Tt,moveSync:()=>dr,pruneTemp:()=>Ft,pruneTempSync:()=>Pr,readBlobFile:()=>Bt,readBlobFileSync:()=>Er,readDir:()=>yt,readDirSync:()=>fr,readFile:()=>bt,readFileSync:()=>hr,readJsonFile:()=>Rt,readJsonFileSync:()=>xr,readTextFile:()=>Nt,readTextFileSync:()=>Or,remove:()=>wt,removeSync:()=>pr,setSyncMessenger:()=>ar,startSyncAgent:()=>ir,stat:()=>_t,statSync:()=>gr,toFileSystemHandleLike:()=>lt,unzip:()=>jt,unzipFromUrl:()=>Lt,unzipSync:()=>Sr,uploadFile:()=>Dt,writeFile:()=>vt,writeFileSync:()=>yr,zip:()=>$t,zipFromUrl:()=>Gt,zipSync:()=>Tr});function n(e,t){if(!e)throw new Error("Invariant failed")}function i(e){if("string"!=typeof e)throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function s(e,t){if(e.length<=1)return e;let r=e.length;for(let n=e.length-1;n>0&&t(e.charCodeAt(n));n--)r=n;return e.slice(0,r)}function o(e){return 47===e}function a(e){return e=function(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function c(e){e instanceof URL&&(e=a(e)),function(e){i(e),e.length}(e);let t=-1,r=!1;for(let n=e.length-1;n>=1;--n)if(o(e.charCodeAt(n))){if(r){t=n;break}}else r=!0;return-1===t?o(e.charCodeAt(0))?"/":".":s(e.slice(0,t),o)}function u(e,t=""){e instanceof URL&&(e=a(e)),function(e,t){if(i(e),0===e.length)return e;if("string"!=typeof t)throw new TypeError(`Suffix must be a string, received "${JSON.stringify(t)}"`)}(e,t);const r=function(e,t,r=0){let n=!1,i=e.length;for(let s=e.length-1;s>=r;--s)if(t(e.charCodeAt(s))){if(n){r=s+1;break}}else n||(n=!0,i=s+1);return e.slice(r,i)}(e,o),n=s(r,o);return t?function(e,t){if(t.length>=e.length)return e;const r=e.length-t.length;for(let n=t.length-1;n>=0;--n)if(e.charCodeAt(r+n)!==t.charCodeAt(n))return e;return e.slice(0,-t.length)}(n,t):n}function l(e,...t){if(void 0===e)return".";e instanceof URL&&(e=a(e)),(t=e?[e,...t]:t).forEach(e=>i(e));const r=t.filter(e=>e.length>0).join("/");return""===r?".":function(e){e instanceof URL&&(e=a(e)),function(e){i(e),e.length}(e);const t=o(e.charCodeAt(0)),r=o(e.charCodeAt(e.length-1));return e=function(e,t,r,n){let i,s="",o=0,a=-1,c=0;for(let u=0;u<=e.length;++u){if(u<e.length)i=e.charCodeAt(u);else{if(n(i))break;i=47}if(n(i)){if(a===u-1||1===c);else if(a!==u-1&&2===c){if(s.length<2||2!==o||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){const e=s.lastIndexOf(r);-1===e?(s="",o=0):(s=s.slice(0,e),o=s.length-1-s.lastIndexOf(r)),a=u,c=0;continue}if(2===s.length||1===s.length){s="",o=0,a=u,c=0;continue}}t&&(s.length>0?s+=`${r}..`:s="..",o=2)}else s.length>0?s+=r+e.slice(a+1,u):s=e.slice(a+1,u),o=u-a-1;a=u,c=0}else 46===i&&-1!==c?++c:c=-1}return s}(e,!t,"/",o),0!==e.length||t||(e="."),e.length>0&&r&&(e+="/"),t?`/${e}`:e}(r)}function d(e){e instanceof URL&&(e=a(e)),i(e);let t=-1,r=0,n=-1,s=!0,c=0;for(let i=e.length-1;i>=0;--i){const a=e.charCodeAt(i);if(o(a)){if(!s){r=i+1;break}}else-1===n&&(s=!1,n=i+1),46===a?-1===t?t=i:1!==c&&(c=1):-1!==t&&(c=-1)}return-1===t||-1===n||0===c||1===c&&t===n-1&&t===r+1?"":e.slice(t,n)}const f=Symbol("Option kind"),h=Symbol("Result kind"),p=Promise.resolve(!0),g=Promise.resolve(!1);function m(e){const t=Object.freeze({[Symbol.toStringTag]:"Option",[f]:"Some",*[Symbol.iterator](){yield e},toString:()=>`Some(${e})`,isSome:()=>!0,isNone:()=>!1,isSomeAnd:t=>t(e),isSomeAndAsync:t=>Promise.resolve(t(e)),isNoneOr:t=>t(e),isNoneOrAsync:t=>Promise.resolve(t(e)),expect:t=>e,unwrap:()=>e,unwrapOr:t=>e,unwrapOrElse:t=>e,unwrapOrElseAsync:t=>Promise.resolve(e),okOr:t=>w(e),okOrElse:t=>w(e),transpose:()=>(k(e),e.isOk()?w(m(e.unwrap())):_(e.unwrapErr())),filter:r=>r(e)?t:y,flatten:()=>(A(e),e),map:t=>m(t(e)),mapOr:(t,r)=>r(e),mapOrElse:(t,r)=>r(e),zip:t=>(A(t),t.isSome()?m([e,t.unwrap()]):y),zipWith:(t,r)=>(A(t),t.isSome()?m(r(e,t.unwrap())):y),unzip(){const t=e;if(!Array.isArray(t)||2!==t.length)throw new TypeError("Option::unzip() requires a 2-element tuple, received "+(Array.isArray(t)?`array with ${t.length} elements`:typeof t));const[r,n]=t;return[m(r),m(n)]},reduce:(r,n)=>(A(r),r.isSome()?m(n(e,r.unwrap())):t),and:e=>(A(e),e),andThen:t=>t(e),andThenAsync:t=>Promise.resolve(t(e)),or:e=>t,orElse:e=>t,orElseAsync:e=>Promise.resolve(t),xor:e=>(A(e),e.isSome()?y:t),inspect:r=>(r(e),t),eq:t=>(A(t),t.isSome()&&t.unwrap()===e)});return t}const y=Object.freeze({[Symbol.toStringTag]:"Option",[f]:"None",*[Symbol.iterator](){},toString:()=>"None",isSome:()=>!1,isNone:()=>!0,isSomeAnd:e=>!1,isSomeAndAsync:e=>g,isNoneOr:e=>!0,isNoneOrAsync:e=>p,expect(e){throw new TypeError(e)},unwrap(){throw new TypeError("Option::unwrap() called on a `None` value")},unwrapOr:e=>e,unwrapOrElse:e=>e(),unwrapOrElseAsync:e=>Promise.resolve(e()),okOr:e=>_(e),okOrElse:e=>_(e()),transpose:()=>w(y),filter:e=>y,flatten:()=>y,map:e=>y,mapOr:(e,t)=>e,mapOrElse:(e,t)=>e(),zip:e=>y,zipWith:(e,t)=>y,unzip:()=>[y,y],reduce:(e,t)=>(A(e),e),and:e=>y,andThen:e=>y,andThenAsync:e=>b,or:e=>(A(e),e),orElse:e=>e(),orElseAsync:e=>Promise.resolve(e()),xor:e=>(A(e),e.isSome()?e:y),inspect:e=>y,eq:e=>(A(e),e===y)}),b=Promise.resolve(y);function w(e){const t=Object.freeze({[Symbol.toStringTag]:"Result",[h]:"Ok",*[Symbol.iterator](){yield e},toString:()=>`Ok(${e})`,isOk:()=>!0,isErr:()=>!1,isOkAnd:t=>t(e),isOkAndAsync:t=>Promise.resolve(t(e)),isErrAnd:e=>!1,isErrAndAsync:e=>g,expect:t=>e,unwrap:()=>e,unwrapOr:t=>e,unwrapOrElse:t=>e,unwrapOrElseAsync:t=>Promise.resolve(e),expectErr(t){throw new TypeError(`${t}: ${e}`)},unwrapErr(){throw new TypeError("Result::unwrapErr() called on an `Ok` value")},intoOk:()=>e,intoErr(){throw new TypeError("Result::intoErr() called on an `Ok` value")},ok:()=>m(e),err:()=>y,transpose:()=>(A(e),e.isSome()?m(w(e.unwrap())):y),map:t=>w(t(e)),mapErr:e=>t,mapOr:(t,r)=>r(e),mapOrElse:(t,r)=>r(e),flatten:()=>(k(e),e),and:e=>(k(e),e),or:e=>t,andThen:t=>t(e),andThenAsync:t=>Promise.resolve(t(e)),orElse:e=>t,orElseAsync:e=>Promise.resolve(t),inspect:r=>(r(e),t),inspectErr:e=>t,eq:t=>(k(t),t.isOk()&&t.unwrap()===e),asOk:()=>t,asErr(){throw new TypeError("Result::asErr() called on an `Ok` value")},andTryAsync(t){try{const r=t(e);return Promise.resolve(r).then(w,_)}catch(e){return Promise.resolve(_(e))}},orTryAsync:e=>Promise.resolve(t)});return t}function _(e){const t=Object.freeze({[Symbol.toStringTag]:"Result",[h]:"Err",*[Symbol.iterator](){},toString:()=>`Err(${e})`,isOk:()=>!1,isErr:()=>!0,isOkAnd:e=>!1,isOkAndAsync:e=>g,isErrAnd:t=>t(e),isErrAndAsync:t=>Promise.resolve(t(e)),expect(t){throw new TypeError(`${t}: ${e}`)},unwrap(){throw new TypeError("Result::unwrap() called on an `Err` value")},unwrapOr:e=>e,unwrapOrElse:t=>t(e),unwrapOrElseAsync:t=>Promise.resolve(t(e)),expectErr:t=>e,unwrapErr:()=>e,intoOk(){throw new TypeError("Result::intoOk() called on an `Err` value")},intoErr:()=>e,ok:()=>y,err:()=>m(e),transpose:()=>m(t),map:e=>t,mapErr:t=>_(t(e)),mapOr:(e,t)=>e,mapOrElse:(t,r)=>t(e),flatten:()=>t,and:e=>t,or:e=>(k(e),e),andThen:e=>t,andThenAsync:e=>Promise.resolve(t),orElse:t=>t(e),orElseAsync:t=>Promise.resolve(t(e)),inspect:e=>t,inspectErr:r=>(r(e),t),eq:t=>(k(t),t.isErr()&&t.unwrapErr()===e),asOk(){throw new TypeError("Result::asOk() called on an `Err` value")},asErr:()=>t,andTryAsync:e=>Promise.resolve(t),orTryAsync(t){try{const r=t(e);return Promise.resolve(r).then(w,_)}catch(e){return Promise.resolve(_(e))}}});return t}function v(e){try{return null===e?"null":void 0===e?"undefined":"object"==typeof e?Object.prototype.toString.call(e):String(e)}catch{return"[unable to stringify]"}}function A(e){if(!function(e){return null!=e&&"object"==typeof e&&f in e}(e))throw new TypeError(`Expected an Option, but received: ${v(e)}`)}function k(e){if(!function(e){return null!=e&&"object"==typeof e&&h in e}(e))throw new TypeError(`Expected a Result, but received: ${v(e)}`)}const P=w(!1),E=w(),x="AbortError",O="TimeoutError";var S=class extends Error{name="FetchError";status;constructor(e,t){super(e),this.status=t}};function T(e,t){const r=function(e){if(e instanceof URL)return e;try{return new URL(e,"undefined"!=typeof location?location.href:void 0)}catch{throw new TypeError(`Invalid URL: ${e}`)}}(e),n=t??{},{retries:i,delay:s,when:o,onRetry:a}=function(e){const{responseType:t,timeout:r,retry:n=0,onProgress:i,onChunk:s}=e;if(null!=t){const e=["text","arraybuffer","blob","json","bytes","stream"];if(!e.includes(t))throw new TypeError(`responseType must be one of ${e.join(", ")} but received ${t}`)}if(null!=r){if("number"!=typeof r)throw new TypeError("timeout must be a number but received "+typeof r);if(r<=0)throw new Error(`timeout must be a number greater than 0 but received ${r}`)}if(null!=i&&"function"!=typeof i)throw new TypeError("onProgress callback must be a function but received "+typeof i);if(null!=s&&"function"!=typeof s)throw new TypeError("onChunk callback must be a function but received "+typeof s);let o,a,c=0,u=0;if("number"==typeof n?c=n:n&&"object"==typeof n&&(c=n.retries??0,u=n.delay??0,o=n.when,a=n.onRetry),!Number.isInteger(c))throw new TypeError(`Retry count must be an integer but received ${c}`);if(c<0)throw new Error(`Retry count must be non-negative but received ${c}`);if("number"==typeof u){if(u<0)throw new Error(`Retry delay must be a non-negative number but received ${u}`)}else if("function"!=typeof u)throw new TypeError("Retry delay must be a number or a function but received "+typeof u);if(null!=o&&!Array.isArray(o)&&"function"!=typeof o)throw new TypeError("Retry when condition must be an array of status codes or a function but received "+typeof o);if(null!=a&&"function"!=typeof a)throw new TypeError("Retry onRetry callback must be a function but received "+typeof a);return{retries:c,delay:u,when:o,onRetry:a}}(n),{abortable:c=!1,responseType:u,timeout:l,onProgress:d,onChunk:f,...h}=n,p=h.signal;let g;c&&(g=new AbortController);const m=(e,t)=>"AbortError"!==e.name&&(o?Array.isArray(o)?e instanceof S&&o.includes(e.status):o(e,t):!(e instanceof S)),y=e=>"function"==typeof s?s(e):s,b=()=>{const e=[];p&&e.push(p),g&&e.push(g.signal),"number"==typeof l&&e.push(function(e){if("function"==typeof AbortSignal.timeout)return AbortSignal.timeout(e);const t=new AbortController,r=function(){const e="The operation timed out.";try{return new DOMException(e,O)}catch{const t=new Error(e);return t.name=O,t}}(),n=setTimeout(()=>{t.abort(r)},e);return"function"==typeof n?.unref&&n.unref(),t.signal}(l)),e.length>0&&(h.signal=1===e.length?e[0]:function(e){if("function"==typeof AbortSignal.any)return AbortSignal.any(e);const t=new AbortController;for(const r of e)if(r.aborted)return t.abort(r.reason),t.signal;const r=e=>{t.abort(e.target.reason)};for(const t of e)t.addEventListener("abort",r);return t.signal.addEventListener("abort",()=>{for(const t of e)t.removeEventListener("abort",r)}),t.signal}(e))},v=async()=>{b();try{const e=await fetch(r,h);return e.ok?await A(e):(e.body?.cancel().catch(()=>{}),_(new S(e.statusText,e.status)))}catch(e){return _(e instanceof Error?e:R(e))}},A=async e=>{switch(e.body&&(d||f)&&(async e=>{let t,r=0;if(d){const r=e.headers.get("content-length");if(null==r)try{d(_(new Error("No content-length in response headers")))}catch{}else t=Number.parseInt(r,10)}const n=e.clone().body;try{for await(const e of n){if(f)try{f(e)}catch{}if(d&&null!=t){r+=e.byteLength;try{d(w({totalByteLength:t,completedByteLength:r}))}catch{}}}}catch{}})(e),u){case"json":if(null==e.body)return w(null);try{return w(await e.json())}catch{return _(new Error("Response is invalid json while responseType is json"))}case"text":return w(await e.text());case"bytes":return"function"==typeof e.bytes?w(await e.bytes()):w(new Uint8Array(await e.arrayBuffer()));case"arraybuffer":return w(await e.arrayBuffer());case"blob":return w(await e.blob());case"stream":return w(e.body);default:return w(e)}},k=(async()=>{let e,t=0;do{if(t>0){if(g?.signal.aborted)return _(g.signal.reason);const r=y(t);if(r>0&&(await B(r),g?.signal.aborted))return _(g.signal.reason);try{a?.(e,t)}catch{}}const r=await v();if(r.isOk())return r;e=r.unwrapErr(),t++}while(t<=i&&m(e,t));return _(e)})();return c&&g?{abort(e){e instanceof Error?g.abort(e):null!=e?g.abort(R(e)):g.abort()},get aborted(){return g.signal.aborted},get result(){return k}}:k}function B(e){return new Promise(t=>setTimeout(t,e))}function R(e){const t=new Error("string"==typeof e?e:String(e));return t.name=x,t.cause=e,t}var N={},C=Uint8Array,I=Uint16Array,F=Int32Array,U=new C([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,0,0,0]),j=new C([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,0,0]),L=new C([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),D=function(e,t){for(var r=new I(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new F(r[30]);for(n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)i[s]=s-r[n]<<5|n;return{b:r,r:i}},M=D(U,2),$=M.b,G=M.r;$[28]=258,G[258]=28;for(var H=D(j,0),q=H.b,W=H.r,z=new I(32768),V=0;V<32768;++V){var K=(43690&V)>>1|(21845&V)<<1;K=(61680&(K=(52428&K)>>2|(13107&K)<<2))>>4|(3855&K)<<4,z[V]=((65280&K)>>8|(255&K)<<8)>>1}var J=function(e,t,r){for(var n=e.length,i=0,s=new I(t);i<n;++i)e[i]&&++s[e[i]-1];var o,a=new I(t);for(i=1;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;if(r){o=new I(1<<t);var c=15-t;for(i=0;i<n;++i)if(e[i])for(var u=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,f=d|(1<<l)-1;d<=f;++d)o[z[d]>>c]=u}else for(o=new I(n),i=0;i<n;++i)e[i]&&(o[i]=z[a[e[i]-1]++]>>15-e[i]);return o},Q=new C(288);for(V=0;V<144;++V)Q[V]=8;for(V=144;V<256;++V)Q[V]=9;for(V=256;V<280;++V)Q[V]=7;for(V=280;V<288;++V)Q[V]=8;var Z=new C(32);for(V=0;V<32;++V)Z[V]=5;var Y=J(Q,9,0),X=J(Q,9,1),ee=J(Z,5,0),te=J(Z,5,1),re=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ne=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},ie=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},se=function(e){return(e+7)/8|0},oe=function(e,t,r){return(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length),new C(e.subarray(t,r))},ae=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ce=function(e,t,r){var n=new Error(t||ae[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,ce),!r)throw n;return n},ue=function(e,t,r,n){var i=e.length,s=n?n.length:0;if(!i||t.f&&!t.l)return r||new C(0);var o=!r,a=o||2!=t.i,c=t.i;o&&(r=new C(3*i));var u=function(e){var t=r.length;if(e>t){var n=new C(Math.max(2*t,e));n.set(r),r=n}},l=t.f||0,d=t.p||0,f=t.b||0,h=t.l,p=t.d,g=t.m,m=t.n,y=8*i;do{if(!h){l=ne(e,d,1);var b=ne(e,d+1,3);if(d+=3,!b){var w=e[(B=se(d)+4)-4]|e[B-3]<<8,_=B+w;if(_>i){c&&ce(0);break}a&&u(f+w),r.set(e.subarray(B,_),f),t.b=f+=w,t.p=d=8*_,t.f=l;continue}if(1==b)h=X,p=te,g=9,m=5;else if(2==b){var v=ne(e,d,31)+257,A=ne(e,d+10,15)+4,k=v+ne(e,d+5,31)+1;d+=14;for(var P=new C(k),E=new C(19),x=0;x<A;++x)E[L[x]]=ne(e,d+3*x,7);d+=3*A;var O=re(E),S=(1<<O)-1,T=J(E,O,1);for(x=0;x<k;){var B,R=T[ne(e,d,S)];if(d+=15&R,(B=R>>4)<16)P[x++]=B;else{var N=0,I=0;for(16==B?(I=3+ne(e,d,3),d+=2,N=P[x-1]):17==B?(I=3+ne(e,d,7),d+=3):18==B&&(I=11+ne(e,d,127),d+=7);I--;)P[x++]=N}}var F=P.subarray(0,v),D=P.subarray(v);g=re(F),m=re(D),h=J(F,g,1),p=J(D,m,1)}else ce(1);if(d>y){c&&ce(0);break}}a&&u(f+131072);for(var M=(1<<g)-1,G=(1<<m)-1,H=d;;H=d){var W=(N=h[ie(e,d)&M])>>4;if((d+=15&N)>y){c&&ce(0);break}if(N||ce(2),W<256)r[f++]=W;else{if(256==W){H=d,h=null;break}var z=W-254;if(W>264){var V=U[x=W-257];z=ne(e,d,(1<<V)-1)+$[x],d+=V}var K=p[ie(e,d)&G],Q=K>>4;if(K||ce(3),d+=15&K,D=q[Q],Q>3&&(V=j[Q],D+=ie(e,d)&(1<<V)-1,d+=V),d>y){c&&ce(0);break}a&&u(f+131072);var Z=f+z;if(f<D){var Y=s-D,ee=Math.min(D,Z);for(Y+f<0&&ce(3);f<ee;++f)r[f]=n[Y+f]}for(;f<Z;++f)r[f]=r[f-D]}}t.l=h,t.p=H,t.b=f,t.f=l,h&&(l=1,t.m=g,t.d=p,t.n=m)}while(!l);return f!=r.length&&o?oe(r,0,f):r.subarray(0,f)},le=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},de=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},fe=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,s=r.slice();if(!i)return{t:we,l:0};if(1==i){var o=new C(r[0].s+1);return o[r[0].s]=1,{t:o,l:1}}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var a=r[0],c=r[1],u=0,l=1,d=2;for(r[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=r[r[u].f<r[d].f?u++:d++],c=r[u!=l&&r[u].f<r[d].f?u++:d++],r[l++]={s:-1,f:a.f+c.f,l:a,r:c};var f=s[0].s;for(n=1;n<i;++n)s[n].s>f&&(f=s[n].s);var h=new I(f+1),p=he(r[l-1],h,0);if(p>t){n=0;var g=0,m=p-t,y=1<<m;for(s.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});n<i;++n){var b=s[n].s;if(!(h[b]>t))break;g+=y-(1<<p-h[b]),h[b]=t}for(g>>=m;g>0;){var w=s[n].s;h[w]<t?g-=1<<t-h[w]++-1:++n}for(;n>=0&&g;--n){var _=s[n].s;h[_]==t&&(--h[_],++g)}p=t}return{t:new C(h),l:p}},he=function(e,t,r){return-1==e.s?Math.max(he(e.l,t,r+1),he(e.r,t,r+1)):t[e.s]=r},pe=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new I(++t),n=0,i=e[0],s=1,o=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return{c:r.subarray(0,n),n:t}},ge=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},me=function(e,t,r){var n=r.length,i=se(t+2);e[i]=255&n,e[i+1]=n>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<n;++s)e[i+s+4]=r[s];return 8*(i+4+n)},ye=function(e,t,r,n,i,s,o,a,c,u,l){le(t,l++,r),++i[256];for(var d=fe(i,15),f=d.t,h=d.l,p=fe(s,15),g=p.t,m=p.l,y=pe(f),b=y.c,w=y.n,_=pe(g),v=_.c,A=_.n,k=new I(19),P=0;P<b.length;++P)++k[31&b[P]];for(P=0;P<v.length;++P)++k[31&v[P]];for(var E=fe(k,7),x=E.t,O=E.l,S=19;S>4&&!x[L[S-1]];--S);var T,B,R,N,C=u+5<<3,F=ge(i,Q)+ge(s,Z)+o,D=ge(i,f)+ge(s,g)+o+14+3*S+ge(k,x)+2*k[16]+3*k[17]+7*k[18];if(c>=0&&C<=F&&C<=D)return me(t,l,e.subarray(c,c+u));if(le(t,l,1+(D<F)),l+=2,D<F){T=J(f,h,0),B=f,R=J(g,m,0),N=g;var M=J(x,O,0);for(le(t,l,w-257),le(t,l+5,A-1),le(t,l+10,S-4),l+=14,P=0;P<S;++P)le(t,l+3*P,x[L[P]]);l+=3*S;for(var $=[b,v],G=0;G<2;++G){var H=$[G];for(P=0;P<H.length;++P){var q=31&H[P];le(t,l,M[q]),l+=x[q],q>15&&(le(t,l,H[P]>>5&127),l+=H[P]>>12)}}}else T=Y,B=Q,R=ee,N=Z;for(P=0;P<a;++P){var W=n[P];if(W>255){de(t,l,T[257+(q=W>>18&31)]),l+=B[q+257],q>7&&(le(t,l,W>>23&31),l+=U[q]);var z=31&W;de(t,l,R[z]),l+=N[z],z>3&&(de(t,l,W>>5&8191),l+=j[z])}else de(t,l,T[W]),l+=B[W]}return de(t,l,T[256]),l+B[256]},be=new F([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),we=new C(0),_e=function(e,t,r,n,i,s){var o=s.z||e.length,a=new C(n+o+5*(1+Math.ceil(o/7e3))+i),c=a.subarray(n,a.length-i),u=s.l,l=7&(s.r||0);if(t){l&&(c[0]=s.r>>3);for(var d=be[t-1],f=d>>13,h=8191&d,p=(1<<r)-1,g=s.p||new I(32768),m=s.h||new I(p+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},_=new F(25e3),v=new I(288),A=new I(32),k=0,P=0,E=s.i||0,x=0,O=s.w||0,S=0;E+2<o;++E){var T=w(E),B=32767&E,R=m[T];if(g[B]=R,m[T]=B,O<=E){var N=o-E;if((k>7e3||x>24576)&&(N>423||!u)){l=ye(e,c,0,_,v,A,P,x,S,E-S,l),x=k=P=0,S=E;for(var L=0;L<286;++L)v[L]=0;for(L=0;L<30;++L)A[L]=0}var D=2,M=0,$=h,H=B-R&32767;if(N>2&&T==w(E-H))for(var q=Math.min(f,N)-1,z=Math.min(32767,E),V=Math.min(258,N);H<=z&&--$&&B!=R;){if(e[E+D]==e[E+D-H]){for(var K=0;K<V&&e[E+K]==e[E+K-H];++K);if(K>D){if(D=K,M=H,K>q)break;var J=Math.min(H,K-2),Q=0;for(L=0;L<J;++L){var Z=E-H+L&32767,Y=Z-g[Z]&32767;Y>Q&&(Q=Y,R=Z)}}}H+=(B=R)-(R=g[B])&32767}if(M){_[x++]=268435456|G[D]<<18|W[M];var X=31&G[D],ee=31&W[M];P+=U[X]+j[ee],++v[257+X],++A[ee],O=E+D,++k}else _[x++]=e[E],++v[e[E]]}}for(E=Math.max(E,O);E<o;++E)_[x++]=e[E],++v[e[E]];l=ye(e,c,u,_,v,A,P,x,S,E-S,l),u||(s.r=7&l|c[l/8|0]<<3,l-=7,s.h=m,s.p=g,s.i=E,s.w=O)}else{for(E=s.w||0;E<o+u;E+=65535){var te=E+65535;te>=o&&(c[l/8|0]=u,te=o),l=me(c,l+1,e.subarray(E,te))}s.i=o}return oe(a,0,n+se(l)+i)},ve=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&-306674912)^r>>>1;e[t]=r}return e}(),Ae=function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),o=new C(s.length+e.length);o.set(s),o.set(e,s.length),e=o,i.w=s.length}return _e(e,null==t.level?6:t.level,null==t.mem?i.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,r,n,i)},ke=function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},Pe=function(e,t,r){for(var n=e(),i=e.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<n.length;++o){var a=n[o],c=s[o];if("function"==typeof a){t+=";"+c+"=";var u=a.toString();if(a.prototype)if(-1!=u.indexOf("[native code]")){var l=u.indexOf(" ",8)+1;t+=u.slice(l,u.indexOf("(",l))}else for(var d in t+=u,a.prototype)t+=";"+c+".prototype."+d+"="+a.prototype[d].toString();else t+=u}else r[c]=a}return t},Ee=[],xe=function(){return[C,I,F,U,j,L,$,q,X,te,z,ae,J,re,ne,ie,se,oe,ce,ue,Ue,Se,Te]},Oe=function(){return[C,I,F,U,j,L,G,W,Y,Q,ee,Z,z,be,we,J,le,de,fe,he,pe,ge,me,ye,se,oe,_e,Ae,Fe,Se]},Se=function(e){return postMessage(e,[e.buffer])},Te=function(e){return e&&{out:e.size&&new C(e.size),dictionary:e.dictionary}},Be=function(e,t,r,n,i,s){var o=function(e,t,r,n){if(!Ee[r]){for(var i="",s={},o=e.length-1,a=0;a<o;++a)i=Pe(e[a],i,s);Ee[r]={c:Pe(e[o],i,s),e:s}}var c=ke({},Ee[r].e);return function(e,t,r,n,i){var s=new Worker(N[t]||(N[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return s.onmessage=function(e){var t=e.data,r=t.$e$;if(r){var n=new Error(r[0]);n.code=r[1],n.stack=r[2],i(n,null)}else i(null,t)},s.postMessage(r,n),s}(Ee[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,c,function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t}(c),n)}(r,n,i,function(e,t){o.terminate(),s(e,t)});return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}},Re=function(e,t){return e[t]|e[t+1]<<8},Ne=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Ce=function(e,t){return Ne(e,t)+4294967296*Ne(e,t+4)},Ie=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function Fe(e,t){return Ae(e,t||{},0,0)}function Ue(e,t){return ue(e,{i:2},t&&t.out,t&&t.dictionary)}var je=function(e,t,r,n){for(var i in e){var s=e[i],o=t+i,a=n;Array.isArray(s)&&(a=ke(n,s[1]),s=s[0]),ArrayBuffer.isView(s)?r[o]=[s,a]:(r[o+="/"]=[new C(0),a],je(s,o,r,n))}},Le="undefined"!=typeof TextEncoder&&new TextEncoder,De="undefined"!=typeof TextDecoder&&new TextDecoder;try{De.decode(we,{stream:!0})}catch(e){}function Me(e,t){if(t){for(var r=new C(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(Le)return Le.encode(e);var i=e.length,s=new C(e.length+(e.length>>1)),o=0,a=function(e){s[o++]=e};for(n=0;n<i;++n){if(o+5>s.length){var c=new C(o+8+(i-n<<1));c.set(s),s=c}var u=e.charCodeAt(n);u<128||t?a(u):u<2048?(a(192|u>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++n))>>18),a(128|u>>12&63),a(128|u>>6&63),a(128|63&u)):(a(224|u>>12),a(128|u>>6&63),a(128|63&u))}return oe(s,0,o)}function $e(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}if(De)return De.decode(e);var i=function(e){for(var t="",r=0;;){var n=e[r++],i=(n>127)+(n>223)+(n>239);if(r+i>e.length)return{s:t,r:oe(e,r-1)};i?3==i?(n=((15&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t+=String.fromCharCode(55296|n>>10,56320|1023&n)):t+=1&i?String.fromCharCode((31&n)<<6|63&e[r++]):String.fromCharCode((15&n)<<12|(63&e[r++])<<6|63&e[r++]):t+=String.fromCharCode(n)}}(e),s=i.s;return(r=i.r).length&&ce(8),s}var Ge=function(e,t,r,n,i,s,o){var a=4294967295==i,c=4294967295==s,u=4294967295==o,l=t+r;if(n&&a+c+u){for(;t+4<l;t+=4+Re(e,t+2))if(1==Re(e,t))return[a?Ce(e,t+4+8*c):i,c?Ce(e,t+4):s,u?Ce(e,t+4+8*(c+a)):o,1];n<2&&ce(13)}return[i,s,o,0]},He=function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&ce(9),t+=n+4}return t},qe=function(e,t,r,n,i,s,o,a){var c=n.length,u=r.extra,l=a&&a.length,d=He(u);Ie(e,t,null!=o?33639248:67324752),t+=4,null!=o&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(s<0&&8),e[t++]=i&&8,e[t++]=255&r.compression,e[t++]=r.compression>>8;var f=new Date(null==r.mtime?Date.now():r.mtime),h=f.getFullYear()-1980;if((h<0||h>119)&&ce(10),Ie(e,t,h<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,-1!=s&&(Ie(e,t,r.crc),Ie(e,t+4,s<0?-s-2:s),Ie(e,t+8,r.size)),Ie(e,t+12,c),Ie(e,t+14,d),t+=16,null!=o&&(Ie(e,t,l),Ie(e,t+6,r.attrs),Ie(e,t+10,o),t+=14),e.set(n,t),t+=c,d)for(var p in u){var g=u[p],m=g.length;Ie(e,t,+p),Ie(e,t+2,m),e.set(g,t+4),t+=4+m}return l&&(e.set(a,t),t+=l),t};function We(e,t,r){r||(r=t,t={}),"function"!=typeof r&&ce(7);var n={};je(e,"",n,t);var i=Object.keys(n),s=i.length,o=0,a=0,c=s,u=new Array(s),l=[],d=function(){for(var e=0;e<l.length;++e)l[e]()},f=function(e,t){ze(function(){r(e,t)})};ze(function(){f=r});var h=function(){var e=new C(a+22),t=o,r=a-o;a=0;for(var n=0;n<c;++n){var i=u[n];try{var s=i.c.length;qe(e,a,i,i.f,i.u,s);var l=30+i.f.length+He(i.extra),d=a+l;e.set(i.c,d),qe(e,o,i,i.f,i.u,s,a,i.m),o+=16+l+(i.m?i.m.length:0),a=d+s}catch(e){return f(e,null)}}(function(e,t,r,n,i){Ie(e,t,101010256),Ie(e,t+8,r),Ie(e,t+10,r),Ie(e,t+12,n),Ie(e,t+16,i)})(e,o,u.length,r,t),f(null,e)};s||h();for(var p=function(e){var t=i[e],r=n[t],c=r[0],p=r[1],g=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=ve[255&r^t[n]]^r>>>8;e=r},d:function(){return~e}}}(),m=c.length;g.p(c);var y=Me(t),b=y.length,w=p.comment,_=w&&Me(w),v=_&&_.length,A=He(p.extra),k=0==p.level?0:8,P=function(r,n){if(r)d(),f(r,null);else{var i=n.length;u[e]=ke(p,{size:m,crc:g.d(),c:n,f:y,m:_,u:b!=t.length||_&&w.length!=v,compression:k}),o+=30+b+A+i,a+=76+2*(b+A)+(v||0)+i,--s||h()}};if(b>65535&&P(ce(11,0,1),null),k)if(m<16e4)try{P(null,Fe(c,p))}catch(e){P(e,null)}else l.push(function(e,t,r){return r||(r=t,t={}),"function"!=typeof r&&ce(7),Be(e,t,[Oe],function(e){return Se(Fe(e.data[0],e.data[1]))},0,r)}(c,p,P));else P(null,c)},g=0;g<c;++g)p(g);return d}var ze="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(e){e()};class Ve{resolve;reject;promise;constructor(){if("function"==typeof Promise.withResolvers){const{promise:e,resolve:t,reject:r}=Promise.withResolvers();this.promise=e,this.resolve=t,this.reject=r}else this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}const Ke="NotFoundError",Je="/",Qe=".",Ze="/tmp";function Ye(e){n("string"==typeof e),n(e[0]===Je)}function Xe(e){n("string"==typeof e)}let et;function tt(e){return e===Je}async function rt(e,t,r){try{return w(await e.getDirectoryHandle(t,r))}catch(r){const n=r,i=new Error(`${n.name}: ${n.message} When get child directory '${t}' from directory '${e.name||Je}'.`);return i.name=n.name,_(i)}}async function nt(e,t){let r=await async function(){return et??=await navigator.storage.getDirectory(),et}();if(tt(e))return w(r);let n=e.slice(1);for(;n;){let e="";const i=n.indexOf("/");if(-1===i)e=n,n="";else if(e=n.slice(0,i),n=n.slice(i+1),0===i)continue;const s=await rt(r,e,t);if(s.isErr())return s;r=s.unwrap()}return w(r)}async function it(e,t){const r=t?.create??!1,n=c(e),i=u(e);return(await nt(n,{create:r})).andThenAsync(e=>async function(e,t,r){try{return w(await e.getFileHandle(t,r))}catch(r){const n=r,i=new Error(`${n.name}: ${n.message} When get child file '${t}' from directory '${e.name||Je}'.`);return i.name=n.name,_(i)}}(e,i,{create:r}))}function st(e){return e.name===Ke}async function ot(e){const t=(await Promise.all(e)).find(e=>e.isErr());return t??E}function at(){const e=new Error;return e.name=x,e}function ct(e){const{isDirectory:t=!1,basename:r="tmp",extname:n=""}=e??{},i=t?"":n;return l(Ze,`${r?`${r}-`:""}${crypto.randomUUID()}${i}`)}function ut(e){return e.startsWith(`${Ze}/`)}async function lt(e){const{name:t,kind:r}=e;if(dt(e)){const n=await e.getFile(),{size:i,lastModified:s,type:o}=n;return{name:t,kind:r,type:o,size:i,lastModified:s}}return{name:t,kind:r}}function dt(e){return"file"===e.kind}function ft(e){return"directory"===e.kind}function ht(e){return"file"===e.kind}async function pt(e){const t=await e.getFile(),r=await t.arrayBuffer();return new Uint8Array(r)}async function gt(e){return Ye(e),(await it(e,{create:!0})).and(E)}async function mt(e){return Ye(e),(await nt(e,{create:!0})).and(E)}async function yt(e,t){async function*r(n,i){const s=n.entries();for await(const[o,a]of s){const s=i===e?o:l(i,o);yield{path:s,handle:a},ft(a)&&t?.recursive&&(yield*r(await n.getDirectoryHandle(o),s))}}return Ye(e),(await nt(e)).andThen(t=>w(r(t,e)))}async function bt(e,t){return Ye(e),(await it(e)).andThenAsync(async e=>{const r=await e.getFile();switch(t?.encoding){case"blob":return w(r);case"utf8":return w(await r.text());default:return w(await r.arrayBuffer())}})}async function wt(e){Ye(e);const t=c(e),r=u(e),n=await nt(t);return(await n.andThenAsync(async e=>{try{tt(t)&&tt(r)?await e.remove({recursive:!0}):await e.removeEntry(r,{recursive:!0})}catch(e){return _(e)}return E})).orElse(e=>st(e)?E:_(e))}async function _t(e){Ye(e);const t=c(e),r=u(e),n=await nt(t);return r?n.andThenAsync(async t=>{for await(const[e,n]of t.entries())if(e===r)return w(n);const n=new Error(`${Ke}: '${r}' does not exist. Full path is '${e}'.`);return n.name=Ke,_(n)}):n}async function vt(e,t,r){Ye(e);const{append:n=!1,create:i=!0}=r??{};return(await it(e,{create:i})).andThenAsync(async e=>{const r=await e.createWritable({keepExistingData:n}),i={type:"write",data:t};if(n){const{size:t}=await e.getFile();i.position=t}return await r.write(i),await r.close(),E})}function At(e,t,r){let n,i;Xe(e),i=!1,"string"==typeof t?Ye(t):(r=t,t=ct({extname:d(e)}),i=!0),n=!1;const s=T(e,{redirect:"follow",...r,abortable:!0}),o=(async()=>(await s.response).andThenAsync(async e=>{const r=await e.blob();return n?_(at()):(await vt(t,r)).and(w(e))}))();return{abort(e){n=!0,s.abort(e)},get aborted(){return n},get response(){return i?o.then(e=>e.map(e=>({tempFilePath:t,rawResponse:e}))):o}}}async function kt(e,t){const r=c(t);return(await nt(r,{create:!0})).andThenAsync(async r=>{const n=u(t);try{return await e.move(r,n),E}catch(e){return _(e)}})}async function Pt(e,t,r,n=!0){return Ye(t),(await _t(e)).andThenAsync(async i=>{let s;s=!1;const o=await _t(t);if(o.isErr()){if(!st(o.unwrapErr()))return o.asErr()}else{s=!0;const e=o.unwrap();if(!(dt(i)&&dt(e)||ft(i)&&ft(e)))return _(new Error("Both 'srcPath' and 'destPath' must both be a file or directory."))}return dt(i)?n||!s?await r(i,t):E:(await yt(e,{recursive:!0})).andThenAsync(async e=>{const i=[mt(t)];for await(const{path:o,handle:a}of e){const e=l(t,o);let c=!1;if(s){const t=await St(e);if(t.isErr()){i.push(Promise.resolve(t.asErr()));continue}c=t.unwrap()}const u=dt(a)?n||!c?r(a,e):Promise.resolve(E):mt(e);i.push(u)}return ot(i)})})}function Et(e,t){return vt(e,t,{append:!0})}async function xt(e,t,r){const{overwrite:n=!0}=r??{};return Pt(e,t,async(e,t)=>await vt(t,await e.getFile()),n)}async function Ot(e){const t=await yt(e);if(t.isErr())return st(t.unwrapErr())?mt(e):t.asErr();const r=[];for await(const{path:n}of t.unwrap())r.push(wt(l(e,n)));return ot(r)}async function St(e,t){const{isDirectory:r=!1,isFile:i=!1}=t??{};n(!(r&&i));const s=await _t(e);return s.andThen(e=>w(!(r&&dt(e)||i&&ft(e)))).orElse(e=>st(e)?P:s.asErr())}async function Tt(e,t,r){const{overwrite:n=!0}=r??{};return(await Pt(e,t,kt,n)).andThenAsync(()=>wt(e))}function Bt(e){return bt(e,{encoding:"blob"})}async function Rt(e){return(await Nt(e)).andThenAsync(async e=>{try{return w(JSON.parse(e))}catch(e){return _(e)}})}function Nt(e){return bt(e,{encoding:"utf8"})}async function Ct(e){const{isDirectory:t=!1}=e??{},r=ct(e);return(await(t?mt:gt)(r)).and(w(r))}function It(){return wt(Ze)}async function Ft(e){return n(e instanceof Date),(await yt(Ze,{recursive:!0})).andThenAsync(async t=>{try{for await(const{handle:r}of t)dt(r)&&(await r.getFile()).lastModified<=e.getTime()&&await r.remove()}catch(e){return _(e)}return E})}async function Ut(e,t){const r=new Uint8Array(e),n=new Ve;return function(e,t,r){r||(r=t,t={}),"function"!=typeof r&&ce(7);var n=[],i=function(){for(var e=0;e<n.length;++e)n[e]()},s={},o=function(e,t){ze(function(){r(e,t)})};ze(function(){o=r});for(var a=e.length-22;101010256!=Ne(e,a);--a)if(!a||e.length-a>65558)return o(ce(13,0,1),null),i;var c=Re(e,a+8);if(c){var u=c,l=Ne(e,a+16),d=117853008==Ne(e,a-20);if(d){var f=Ne(e,a-12);(d=101075792==Ne(e,f))&&(u=c=Ne(e,f+32),l=Ne(e,f+48))}for(var h=t&&t.filter,p=function(t){var r=function(e,t,r){var n=Re(e,t+28),i=Re(e,t+30),s=$e(e.subarray(t+46,t+46+n),!(2048&Re(e,t+8))),o=t+46+n,a=Ge(e,o,i,r,Ne(e,t+20),Ne(e,t+24),Ne(e,t+42)),c=a[0],u=a[1],l=a[2];return[Re(e,t+10),c,u,s,o+i+Re(e,t+32),l]}(e,l,d),a=r[0],u=r[1],f=r[2],p=r[3],g=r[4],m=r[5],y=function(e,t){return t+30+Re(e,t+26)+Re(e,t+28)}(e,m);l=g;var b=function(e,t){e?(i(),o(e,null)):(t&&(s[p]=t),--c||o(null,s))};if(!h||h({name:p,size:u,originalSize:f,compression:a}))if(a)if(8==a){var w=e.subarray(y,y+u);if(f<524288||u>.8*f)try{b(null,Ue(w,{out:new C(f)}))}catch(e){b(e,null)}else n.push(function(e,t,r){return r||(r=t,t={}),"function"!=typeof r&&ce(7),Be(e,t,[xe],function(e){return Se(Ue(e.data[0],Te(e.data[1])))},1,r)}(w,{size:f},b))}else b(ce(14,"unknown compression type "+a,1),null);else b(null,oe(e,y,y+u));else b(null,null)},g=0;g<u;++g)p()}else o(null,{})}(r,async(e,r)=>{if(e)return void n.resolve(_(e));const i=[];for(const e in r)"/"!==e.at(-1)&&i.push(vt(l(t,e),r[e]));n.resolve(ot(i))}),await n.promise}async function jt(e,t){return Ye(t),(await bt(e)).andThenAsync(e=>Ut(e,t))}async function Lt(e,t,r){return Xe(e),Ye(t),(await T(e,{redirect:"follow",...r,responseType:"arraybuffer",abortable:!1})).andThenAsync(e=>Ut(e,t))}function Dt(e,t,r){let n,i;Xe(t),n=!1;const s=(async()=>(await Bt(e)).andThenAsync(async s=>{if(n)return _(at());const{filename:o=u(e),...a}=r??{},c=new FormData;return c.append(o,s,o),i=T(t,{method:"POST",...a,abortable:!0,body:c}),i.response}))();return{abort(e){n=!0,i?.abort(e)},get aborted(){return n},get response(){return s}}}async function Mt(e,t){const r=new Ve;return We(e,{consume:!0},async(e,n)=>{if(e)r.resolve(_(e));else if(t){const e=await vt(t,n);r.resolve(e)}else r.resolve(w(n))}),await r.promise}async function $t(e,t,r){return"string"==typeof t?Ye(t):(r=t,t=void 0),(await _t(e)).andThenAsync(async n=>{const i=u(e),s={};if(dt(n)){const e=await pt(n);s[i]=e}else{const t=await yt(e,{recursive:!0});if(t.isErr())return t.asErr();const n=r?.preserveRoot??!0;for await(const{path:e,handle:r}of t.unwrap())if(dt(r)){const t=n?l(i,e):e,o=await pt(r);s[t]=o}}return Mt(s,t)})}async function Gt(e,t,r){return Xe(e),"string"==typeof t?Ye(t):(r=t,t=void 0),(await T(e,{redirect:"follow",...r,responseType:"arraybuffer",abortable:!1})).andThenAsync(r=>{const n={};return n[u(e)]=new Uint8Array(r),Mt(n,t)})}function Ht(){return"function"==typeof navigator?.storage?.getDirectory}function qt(e){return e?{name:e.name,message:e.message}:e}async function Wt(e){const t=await e.arrayBuffer();return{name:e.name,type:e.type,lastModified:e.lastModified,size:t.byteLength,data:t}}let zt=1e3;var Vt=(e=>(e[e.createFile=0]="createFile",e[e.mkdir=1]="mkdir",e[e.move=2]="move",e[e.readDir=3]="readDir",e[e.remove=4]="remove",e[e.stat=5]="stat",e[e.writeFile=6]="writeFile",e[e.appendFile=7]="appendFile",e[e.copy=8]="copy",e[e.emptyDir=9]="emptyDir",e[e.exists=10]="exists",e[e.deleteTemp=11]="deleteTemp",e[e.mkTemp=12]="mkTemp",e[e.pruneTemp=13]="pruneTemp",e[e.readBlobFile=14]="readBlobFile",e[e.unzip=15]="unzip",e[e.zip=16]="zip",e))(Vt||{});let Kt,Jt;function Qt(e){const t=JSON.stringify(e);return(Kt??=new TextEncoder,Kt).encode(t)}function Zt(e){const t=Yt(e);return JSON.parse(t)}function Yt(e){return(Jt??=new TextDecoder,Jt).decode(e)}class Xt{i32a;u8a;headerLength=16;maxDataLength;constructor(e){this.i32a=new Int32Array(e),this.u8a=new Uint8Array(e),this.maxDataLength=e.byteLength-this.headerLength}}async function er(e,t){const{i32a:r,u8a:n,headerLength:i,maxDataLength:s}=e;for(;1!==Atomics.load(r,1););const o=r[2],a=n.slice(i,i+o);let c=await t(a);const u=c.byteLength;if(u>s){const e=`Response is too large: ${u} > ${s}. Consider grow the size of SharedArrayBuffer.`;if(c=Qt([{name:"RangeError",message:e}]),c.byteLength>s)throw Atomics.store(r,1,0),new RangeError(e)}r[2]=c.byteLength,n.set(c,i),Atomics.store(r,1,0),Atomics.store(r,0,0)}const tr={[Vt.createFile]:gt,[Vt.mkdir]:mt,[Vt.move]:Tt,[Vt.readDir]:yt,[Vt.remove]:wt,[Vt.stat]:_t,[Vt.writeFile]:vt,[Vt.appendFile]:Et,[Vt.copy]:xt,[Vt.emptyDir]:Ot,[Vt.exists]:St,[Vt.deleteTemp]:It,[Vt.mkTemp]:Ct,[Vt.pruneTemp]:Ft,[Vt.readBlobFile]:Bt,[Vt.unzip]:jt,[Vt.zip]:$t};let rr,nr;function ir(){if("undefined"!=typeof window)throw new Error("Only can use in worker");if(rr)throw new Error("Worker messenger already started");addEventListener("message",e=>{const t=e.data;if(!(t instanceof SharedArrayBuffer))throw new TypeError("Only can post SharedArrayBuffer to Worker");rr=new Xt(t),postMessage(!0),async function(){for(;;)try{await er(rr,async e=>{const[t,...r]=Zt(e);let n;t===Vt.writeFile||t===Vt.appendFile?Array.isArray(r[1])&&(r[1]=new Uint8Array(r[1])):t===Vt.pruneTemp&&(r[0]=new Date(r[0]));const i=tr[t];try{const e=await i(...r);if(e.isErr())n=Qt([qt(e.unwrapErr())]);else{let r;if(t===Vt.readBlobFile){const t=e.unwrap(),n=await Wt(t);r={...n,data:[...new Uint8Array(n.data)]}}else if(t===Vt.readDir){const t=e.unwrap(),n=[];for await(const{path:e,handle:r}of t){const t=await lt(r);n.push({path:e,handle:t})}r=n}else if(t===Vt.stat){const t=e.unwrap();r=await lt(t)}else if(t===Vt.zip){const t=e.unwrap();r=t instanceof Uint8Array?[...t]:t}else r=e.unwrap();n=Qt([null,r])}}catch(e){n=Qt([qt(e)])}return n})}catch(e){console.error(e instanceof Error?e.stack:e)}}()})}function sr(e){if("undefined"==typeof window)throw new Error("Only can use in main thread");if(nr)throw new Error("Main messenger already started");return new Promise(t=>{const{worker:r,bufferLength:i=1048576,opTimeout:s=1e3}=e;n(r instanceof Worker||r instanceof URL||"string"==typeof r&&r),n(i>16&&i%4==0),n(Number.isInteger(s)&&s>0),function(e){zt=e}(s);const o=r instanceof Worker?r:new Worker(r),a=new SharedArrayBuffer(i);o.addEventListener("message",e=>{e.data&&(nr=new Xt(a),t())}),o.postMessage(a)})}function or(){return nr}function ar(e){n(null!=e),nr=e}function cr(e,...t){if(!nr)return _(new Error("Worker not initialized. Come back later."));const r=Qt([e,...t]);try{const e=Zt(function(e,t){const{i32a:r,u8a:n,headerLength:i,maxDataLength:s}=e,o=t.byteLength;if(o>s)throw new RangeError(`Request is too large: ${o} > ${s}. Consider grow the size of SharedArrayBuffer.`);Atomics.store(r,0,1),r[2]=o,n.set(t,i),Atomics.store(r,1,1),function(e){const t=Date.now();for(;!e();)if(Date.now()-t>zt){const e=new Error("Operating Timeout");throw e.name=O,e}}(()=>0===Atomics.load(r,0));const a=r[2];return n.slice(i,i+a)}(nr,r)),t=e[0],n=t?_(function(e){const t=new Error(e.message);return t.name=e.name,t}(t)):w(e[1]??void 0);return n}catch(e){return _(e)}}function ur(e){return cr(Vt.createFile,e)}function lr(e){return cr(Vt.mkdir,e)}function dr(e,t,r){return cr(Vt.move,e,t,r)}function fr(e,t){return cr(Vt.readDir,e,t)}function hr(e,t){return cr(Vt.readBlobFile,e).map(e=>{const r=new Uint8Array(e.data);switch(e.data=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),t?.encoding){case"blob":return e;case"utf8":return Yt(new Uint8Array(e.data));default:return e.data}})}function pr(e){return cr(Vt.remove,e)}function gr(e){return cr(Vt.stat,e)}function mr(e){return e instanceof ArrayBuffer?[...new Uint8Array(e)]:ArrayBuffer.isView(e)?[...new Uint8Array(e.buffer)]:e}function yr(e,t,r){return cr(Vt.writeFile,e,mr(t),r)}function br(e,t){return cr(Vt.appendFile,e,mr(t))}function wr(e,t,r){return cr(Vt.copy,e,t,r)}function _r(e){return cr(Vt.emptyDir,e)}function vr(e,t){return cr(Vt.exists,e,t)}function Ar(){return cr(Vt.deleteTemp)}function kr(e){return cr(Vt.mkTemp,e)}function Pr(e){return cr(Vt.pruneTemp,e)}function Er(e){return hr(e,{encoding:"blob"})}function xr(e){return Or(e).andThen(e=>{try{return w(JSON.parse(e))}catch(e){return _(e)}})}function Or(e){return hr(e,{encoding:"utf8"})}function Sr(e,t){return cr(Vt.unzip,e,t)}function Tr(e,t,r){return cr(Vt.zip,e,t,r).map(e=>e?new Uint8Array(e):e)}},8843(e,t,r){"use strict";r.d(t,{basename:()=>m,dirname:()=>b,join:()=>v,parse:()=>A});const n=function(){const e=globalThis,t=e.Deno?.build?.os;return"string"==typeof t?"windows"===t:e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}();function i(e){if("string"!=typeof e)throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function s(e,t){if(t.length>=e.length)return e;const r=e.length-t.length;for(let n=t.length-1;n>=0;--n)if(e.charCodeAt(r+n)!==t.charCodeAt(n))return e;return e.slice(0,-t.length)}function o(e,t,r=0){let n=!1,i=e.length;for(let s=e.length-1;s>=r;--s)if(t(e.charCodeAt(s))){if(n){r=s+1;break}}else n||(n=!0,i=s+1);return e.slice(r,i)}function a(e,t){if(i(e),0===e.length)return e;if("string"!=typeof t)throw new TypeError(`Suffix must be a string, received "${JSON.stringify(t)}"`)}function c(e){if("file:"!==(e=e instanceof URL?e:new URL(e)).protocol)throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function u(e){return e=c(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function l(e,t){if(e.length<=1)return e;let r=e.length;for(let n=e.length-1;n>0&&t(e.charCodeAt(n));n--)r=n;return e.slice(0,r)}function d(e){return 47===e}function f(e){return 47===e}function h(e){return 47===e||92===e}function p(e){return e>=97&&e<=122||e>=65&&e<=90}function g(e){e=c(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return""!==e.hostname&&(t=`\\\\${e.hostname}${t}`),t}function m(e,t=""){return n?function(e,t=""){e instanceof URL&&(e=g(e)),a(e,t);let r=0;e.length>=2&&p(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(r=2);const n=l(o(e,h,r),h);return t?s(n,t):n}(e,t):function(e,t=""){e instanceof URL&&(e=u(e)),a(e,t);const r=l(o(e,d),d);return t?s(r,t):r}(e,t)}function y(e){if(i(e),0===e.length)return"."}function b(e){return n?function(e){e instanceof URL&&(e=g(e)),y(e);const t=e.length;let r=-1,n=-1,i=!0,s=0;const o=e.charCodeAt(0);if(t>1)if(h(o)){if(r=s=1,h(e.charCodeAt(1))){let n=2,i=n;for(;n<t&&!h(e.charCodeAt(n));++n);if(n<t&&n!==i){for(i=n;n<t&&h(e.charCodeAt(n));++n);if(n<t&&n!==i){for(i=n;n<t&&!h(e.charCodeAt(n));++n);if(n===t)return e;n!==i&&(r=s=n+1)}}}}else p(o)&&58===e.charCodeAt(1)&&(r=s=2,t>2&&h(e.charCodeAt(2))&&(r=s=3));else if(h(o))return e;for(let r=t-1;r>=s;--r)if(h(e.charCodeAt(r))){if(!i){n=r;break}}else i=!1;if(-1===n){if(-1===r)return".";n=r}return l(e.slice(0,n),f)}(e):function(e){e instanceof URL&&(e=u(e)),y(e);let t=-1,r=!1;for(let n=e.length-1;n>=1;--n)if(d(e.charCodeAt(n))){if(r){t=n;break}}else r=!0;return-1===t?d(e.charCodeAt(0))?"/":".":l(e.slice(0,t),d)}(e)}function w(e){if(i(e),0===e.length)return"."}function _(e,t,r,n){let i,s="",o=0,a=-1,c=0;for(let u=0;u<=e.length;++u){if(u<e.length)i=e.charCodeAt(u);else{if(n(i))break;i=47}if(n(i)){if(a===u-1||1===c);else if(a!==u-1&&2===c){if(s.length<2||2!==o||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){const e=s.lastIndexOf(r);-1===e?(s="",o=0):(s=s.slice(0,e),o=s.length-1-s.lastIndexOf(r)),a=u,c=0;continue}if(2===s.length||1===s.length){s="",o=0,a=u,c=0;continue}}t&&(s.length>0?s+=`${r}..`:s="..",o=2)}else s.length>0?s+=r+e.slice(a+1,u):s=e.slice(a+1,u),o=u-a-1;a=u,c=0}else 46===i&&-1!==c?++c:c=-1}return s}function v(e,...t){return n?function(e,...t){if(e instanceof URL&&(e=g(e)),(t=e?[e,...t]:t).forEach(e=>i(e)),t=t.filter(e=>e.length>0),0===t.length)return".";let r=!0,n=0;const s=t[0];if(h(s.charCodeAt(0))){++n;const e=s.length;e>1&&h(s.charCodeAt(1))&&(++n,e>2&&(h(s.charCodeAt(2))?++n:r=!1))}let o=t.join("\\");if(r){for(;n<o.length&&h(o.charCodeAt(n));++n);n>=2&&(o=`\\${o.slice(n)}`)}return function(e){e instanceof URL&&(e=g(e)),w(e);const t=e.length;let r,n=0,i=!1;const s=e.charCodeAt(0);if(t>1)if(h(s))if(i=!0,h(e.charCodeAt(1))){let i=2,s=i;for(;i<t&&!h(e.charCodeAt(i));++i);if(i<t&&i!==s){const o=e.slice(s,i);for(s=i;i<t&&h(e.charCodeAt(i));++i);if(i<t&&i!==s){for(s=i;i<t&&!h(e.charCodeAt(i));++i);if(i===t)return`\\\\${o}\\${e.slice(s)}\\`;i!==s&&(r=`\\\\${o}\\${e.slice(s,i)}`,n=i)}}}else n=1;else p(s)&&58===e.charCodeAt(1)&&(r=e.slice(0,2),n=2,t>2&&h(e.charCodeAt(2))&&(i=!0,n=3));else if(h(s))return"\\";let o;return o=n<t?_(e.slice(n),!i,"\\",h):"",0!==o.length||i||(o="."),o.length>0&&h(e.charCodeAt(t-1))&&(o+="\\"),void 0===r?i?o.length>0?`\\${o}`:"\\":o:i?o.length>0?`${r}\\${o}`:`${r}\\`:r+o}(o)}(e,...t):function(e,...t){if(void 0===e)return".";e instanceof URL&&(e=u(e)),(t=e?[e,...t]:t).forEach(e=>i(e));const r=t.filter(e=>e.length>0).join("/");return""===r?".":function(e){e instanceof URL&&(e=u(e)),w(e);const t=d(e.charCodeAt(0)),r=d(e.charCodeAt(e.length-1));return 0!==(e=_(e,!t,"/",d)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?`/${e}`:e}(r)}(e,...t)}function A(e){return n?function(e){i(e);const t={root:"",dir:"",base:"",ext:"",name:""},r=e.length;if(0===r)return t;let n=0,s=e.charCodeAt(0);if(r>1){if(h(s)){if(n=1,h(e.charCodeAt(1))){let t=2,i=t;for(;t<r&&!h(e.charCodeAt(t));++t);if(t<r&&t!==i){for(i=t;t<r&&h(e.charCodeAt(t));++t);if(t<r&&t!==i){for(i=t;t<r&&!h(e.charCodeAt(t));++t);t===r?n=t:t!==i&&(n=t+1)}}}}else if(p(s)&&58===e.charCodeAt(1)){if(n=2,!(r>2))return t.root=t.dir=e,t;if(h(e.charCodeAt(2))){if(3===r)return t.root=t.dir=e,t.base="\\",t;n=3}}}else if(h(s))return t.root=t.dir=e,t.base="\\",t;n>0&&(t.root=e.slice(0,n));let o=-1,a=n,c=-1,u=!0,l=e.length-1,d=0;for(;l>=n;--l)if(s=e.charCodeAt(l),h(s)){if(!u){a=l+1;break}}else-1===c&&(u=!1,c=l+1),46===s?-1===o?o=l:1!==d&&(d=1):-1!==o&&(d=-1);return-1===o||-1===c||0===d||1===d&&o===c-1&&o===a+1?-1!==c&&(t.base=t.name=e.slice(a,c)):(t.name=e.slice(a,o),t.base=e.slice(a,c),t.ext=e.slice(o,c)),t.base=t.base||"\\",t.dir=a>0&&a!==n?e.slice(0,a-1):t.root,t}(e):function(e){i(e);const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const r=d(e.charCodeAt(0));let n;r?(t.root="/",n=1):n=0;let s=-1,o=0,a=-1,c=!0,u=e.length-1,f=0;for(;u>=n;--u){const t=e.charCodeAt(u);if(d(t)){if(!c){o=u+1;break}}else-1===a&&(c=!1,a=u+1),46===t?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1)}return-1===s||-1===a||0===f||1===f&&s===a-1&&s===o+1?(-1!==a&&(t.base=t.name=0===o&&r?e.slice(1,a):e.slice(o,a)),t.base=t.base||"/"):(0===o&&r?(t.name=e.slice(1,s),t.base=e.slice(1,a)):(t.name=e.slice(o,s),t.base=e.slice(o,a)),t.ext=e.slice(s,a)),o>0?t.dir=l(e.slice(0,o-1),d):r&&(t.dir="/"),t}(e)}},1635(e,t,r){"use strict";r.d(t,{__exportStar:()=>i,__importStar:()=>o});var n=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function i(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)}var s=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t}}};const t={};function r(n){const i=t[n];if(void 0!==i)return i.exports;const s=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.loaded=!0,s.exports}r.c=t,r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var i=t[n++],s=t[n++];r.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(r.s=4032)})();