let e;function t(e){return e&&e.__esModule?e.default:e}var r={};r={Canvas:class{#e;#t;#r;#n;constructor(e,t){this.#e=e,this.#t=t,this.#r=1,this.#n=!1,e.addEventListener("click",this.#i.bind(this)),e.addEventListener("mousemove",this.#o.bind(this))}#o(e){1===e.buttons&&this.#i(e)}#i(e){if(!this.#n)return;let t=this.#s();this.#t.updatePixel(~~(e.offsetX/t),~~(e.offsetY/t),this.#r),this.draw()}#s(){return this.#e.width/this.#t.getDim()}setPaintColor(e){this.#r=e}setEditMode(e){this.#n!=e&&(e?this.#e.classList.add("editable"):this.#e.classList.remove("editable"),this.#n=e,this.draw())}draw(){let e=this.#e,t=e.getContext("2d"),r=this.#t,n=r.getBuffer(),i=this.#s(),o=8*i,s=r.getOverlay(),a=0;t.fillStyle="#000000",t.fillRect(0,0,e.width,e.height);let l=!1;t.strokeStyle="#8b6b8b";for(let o=0;o0}canRedo(){return this.#d=this.#c.length)return;let{pixelIdx:e,colorIdx:t}=this.#c[this.#d];this.#l[e]=t,this.#d++,this.#m()}updatePixel(e,t,r){let n=t*this.#u+e,i=this.#l[n];(!(this.#d>0)||this.#l[n]!=r)&&(this.#c.length=this.#d,this.#c.push({pixelIdx:n,colorIdx:r,prevColorIdx:i}),this.#d++,this.#l[n]=r,this.#m())}resetOverlay(){this.#l={},this.#c.length=0,this.#d=0,this.#m()}getOverlay(){return this.#l}getOverlaySize(){return Object.keys(this.#l).length}buildOverlayPayload(){let e=this.getOverlay(),t=[],r=[],n=[];for(let[i,o]of Object.entries(e)){n.push(o);let{tileIdx:e,tileBufferIndex:s}=this.getTileBufferIndex(i);t.push(e),r.push(s)}return{tileIndexes:t,tileBufferIndexes:r,values:n}}updateTile(e,t){let r=t.toString(16).padStart(64,"0"),n=8*~~(e%this.#f),i=8*~~(e/this.#f),o=0;for(let e=0;e<8;e++)for(let t=0;t<8;t++){let s=Number.parseInt(r[o],16);this.#a[n+t+(i+e)*this.#u]=s,o++}}getBitmapBufferIndex({tileIdx:e,tileBufferIndex:t}){return 8*(e%this.#f)+t%8+(8*(e/this.#f|0)+(t/8|0))*this.#u}getTileBufferIndex(e){let t=e%this.#u,r=e/this.#u|0;return{tileIdx:(r/8|0)*this.#f+(t/8|0),tileBufferIndex:r%8*8+t%8}}getDim(){return this.#u}getTileDim(){return this.#f}getTileCount(){return this.#p}getBuffer(){return this.#a}},TILE_PIXEL_DIM:8,TILE_PIXEL_COUNT:64};var i={};i={ColorPicker:class{#g;#y;#b;constructor(e,t,r){this.#y=[],this.#b=r;let n=0;for(let r of e){let e=document.createElement("div");e.style.backgroundColor=r,e.addEventListener("click",this.setSelectedColor.bind(this,n)),n++,t.appendChild(e),this.#y.push(e)}this.setSelectedColor(0)}setSelectedColor(e){void 0!==this.#g&&this.#y[this.#g].classList.remove("selected"),this.#g=e,this.#y[this.#g].classList.add("selected"),this.#b(e)}getSelectedColor(){return this.#g}}};var o={},s={};s=(()=>{var e={1166:(e,t)=>{function r(e){if(Array.isArray(e)){let t=[],n=0;for(let i=0;ie.length)throw Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function i(e){if(0===e[0])throw Error("invalid RLP: extra zeros");return c(l(e))}function o(e,t){if(e<56)return Uint8Array.from([e+t]);let r=f(e),n=f(t+55+r.length/2);return Uint8Array.from(d(n+r))}function s(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);let r=function e(t){let r,o,s,a,l;let c=[],d=t[0];if(d<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(d<=183){if(r=d-127,s=128===d?Uint8Array.from([]):n(t,1,r),2===r&&s[0]<128)throw Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:s,remainder:t.slice(r)}}if(d<=191){if(o=d-182,t.length-1t.length)throw Error("invalid RLP: total length is larger than the data");for(a=n(t,o,s);a.length;)l=e(a),c.push(l.data),a=l.remainder;return{data:c,remainder:t.slice(s)}}}(m(e));if(t)return r;if(0!==r.remainder.length)throw Error("invalid RLP: remainder must be zero");return r.data}Object.defineProperty(t,"__esModule",{value:!0}),t.RLP=t.utils=t.decode=t.encode=void 0,t.encode=r,t.decode=s;let a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){let t="";for(let r=0;re+t.length,0));for(let r=0,n=0;r=2&&"0"===e[0]&&"x"===e[1]}function m(e){var t;if(e instanceof Uint8Array)return e;if("string"==typeof e)return p(e)?d((t="string"!=typeof e?e:p(e)?e.slice(2):e).length%2?`0${t}`:t):h(e);if("number"==typeof e||"bigint"==typeof e)return e?d(f(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw Error("toBytes: received unsupported type "+typeof e)}t.utils={bytesToHex:l,concatBytes:u,hexToBytes:d,utf8ToBytes:h},t.RLP={encode:r,decode:s}},3815:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createCurve=t.getHash=void 0;let n=r(573),i=r(7969),o=r(378);function s(e){return{hash:e,hmac:(t,...r)=>(0,n.hmac)(e,t,(0,i.concatBytes)(...r)),randomBytes:i.randomBytes}}t.getHash=s,t.createCurve=function(e,t){let r=t=>(0,o.weierstrass)({...e,...s(t)});return Object.freeze({...r(t),create:r})}},337:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateBasic=t.wNAF=void 0;let n=r(4212),i=r(8463),o=BigInt(0),s=BigInt(1);t.wNAF=function(e,t){let r=(e,t)=>{let 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>o;)r&s&&(n=n.add(i)),i=i.double(),r>>=s;return n},precomputeWindow(e,t){let{windows:r,windowSize:i}=n(t),o=[],s=e,a=s;for(let e=0;e>=f,n>l&&(n-=h,o+=s);let a=t+Math.abs(n)-1,p=e%2!=0,m=n<0;0===n?d=d.add(r(p,i[t])):c=c.add(r(m,i[a]))}return{p:c,f:d}},wNAFCached(e,t,r,n){let i=e._WINDOW_SIZE||1,o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,n(o))),this.wNAF(i,o,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})}},9198:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createHasher=t.isogenyMap=t.hash_to_field=t.expand_message_xof=t.expand_message_xmd=void 0;let n=r(4212),i=r(8463),o=i.bytesToNumberBE;function s(e,t){if(e<0||e>=1<<8*t)throw Error(`bad I2OSP call: value=${e} length=${t}`);let 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){if(!(e instanceof Uint8Array))throw Error("Uint8Array expected")}function l(e){if(!Number.isSafeInteger(e))throw Error("number expected")}function c(e,t,r,n){a(e),a(t),l(r),t.length>255&&(t=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));let{outputLen:o,blockLen:c}=n,d=Math.ceil(r/o);if(d>255)throw Error("Invalid xmd length");let u=(0,i.concatBytes)(t,s(t.length,1)),h=s(0,c),f=s(r,2),p=Array(d),m=n((0,i.concatBytes)(h,e,f,s(0,1),u));p[0]=n((0,i.concatBytes)(m,s(1,1),u));for(let e=1;e<=d;e++){let t=[function(e,t){let r=new Uint8Array(e.length);for(let n=0;n255){let e=Math.ceil(2*n/8);t=o.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(e).update(s(r,2)).update(t).update(s(t.length,1)).digest()}function u(e,t,r){let s;(0,i.validateObject)(r,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:u,k:h,m:f,hash:p,expand:m,DST:g}=r;a(e),l(t);let y=function(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return(0,i.utf8ToBytes)(e);throw Error("DST must be Uint8Array or string")}(g),b=Math.ceil((u.toString(2).length+h)/8),v=t*f*b;if("xmd"===m)s=c(e,y,v,p);else if("xof"===m)s=d(e,y,v,h,p);else{if("_internal_pass"!==m)throw Error('expand must be "xmd" or "xof"');s=e}let w=Array(t);for(let e=0;eArray.from(e).reverse());return(t,n)=>{let[i,o,s,a]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n)));return t=e.div(i,o),n=e.mul(n,e.div(s,a)),{x:t,y:n}}},t.createHasher=function(e,t,r){if("function"!=typeof t)throw Error("mapToCurve() must be defined");return{hashToCurve(n,i){let o=u(n,2,{...r,DST:r.DST,...i}),s=e.fromAffine(t(o[0])),a=e.fromAffine(t(o[1])),l=s.add(a).clearCofactor();return l.assertValidity(),l},encodeToCurve(n,i){let o=u(n,1,{...r,DST:r.encodeDST,...i}),s=e.fromAffine(t(o[0])).clearCofactor();return s.assertValidity(),s}}}},4212:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hashToPrivateScalar=t.FpSqrtEven=t.FpSqrtOdd=t.Field=t.nLength=t.FpIsSquare=t.FpDiv=t.FpInvertBatch=t.FpPow=t.validateField=t.isNegativeLE=t.FpSqrt=t.tonelliShanks=t.invert=t.pow2=t.pow=t.mod=void 0;let n=r(8463),i=BigInt(0),o=BigInt(1),s=BigInt(2),a=BigInt(3),l=BigInt(4),c=BigInt(5),d=BigInt(8);function u(e,t){let r=e%t;return r>=i?r:t+r}function h(e,t,r){if(r<=i||t 0");if(r===o)return i;let n=o;for(;t>i;)t&o&&(n=n*e%r),e=e*e%r,t>>=o;return n}function f(e,t){if(e===i||t<=i)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=u(e,t),n=t,s=i,a=o,l=o,c=i;for(;r!==i;){let e=n/r,t=n%r,i=s-l*e,o=a-c*e;n=r,r=t,s=l,a=c,l=i,c=o}if(n!==o)throw Error("invert: does not exist");return u(s,t)}function p(e){let t,r,n;let a=(e-o)/s;for(t=e-o,r=0;t%s===i;t/=s,r++);for(n=s;ni;)n*=n,n%=r;return n},t.invert=f,t.tonelliShanks=p,t.FpSqrt=m,t.isNegativeLE=(e,t)=>(u(e,t)&o)===o;let g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function y(e,t,r){if(r 0");if(r===i)return e.ONE;if(r===o)return t;let n=e.ONE,s=t;for(;r>i;)r&o&&(n=e.mul(n,s)),s=e.sqr(s),r>>=o;return n}function b(e,t){let r=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}function v(e,t){let r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}t.validateField=function(e){let t=g.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.validateObject)(e,t)},t.FpPow=y,t.FpInvertBatch=b,t.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?f(r,e.ORDER):e.inv(r))},t.FpIsSquare=function(e){let t=(e.ORDER-o)/s;return r=>{let n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}},t.nLength=v,t.Field=function(e,t,r=!1,s={}){if(e<=i)throw Error(`Expected Fp ORDER > 0, got ${e}`);let{nBitLength:a,nByteLength:l}=v(e,t);if(l>2048)throw Error("Field lengths over 2048 bytes are not supported");let c=m(e),d=Object.freeze({ORDER:e,BITS:a,BYTES:l,MASK:(0,n.bitMask)(a),ZERO:i,ONE:o,create:t=>u(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("Invalid field element: expected bigint, got "+typeof t);return i<=t&&te===i,isOdd:e=>(e&o)===o,neg:t=>u(-t,e),eql:(e,t)=>e===t,sqr:t=>u(t*t,e),add:(t,r)=>u(t+r,e),sub:(t,r)=>u(t-r,e),mul:(t,r)=>u(t*r,e),pow:(e,t)=>y(d,e,t),div:(t,r)=>u(t*f(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>f(t,e),sqrt:s.sqrt||(e=>c(d,e)),invertBatch:e=>b(d,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.numberToBytesLE)(e,l):(0,n.numberToBytesBE)(e,l),fromBytes:e=>{if(e.length!==l)throw Error(`Fp.fromBytes: expected ${l}, got ${e.length}`);return r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(d)},t.FpSqrtOdd=function(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},t.FpSqrtEven=function(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},t.hashToPrivateScalar=function(e,t,r=!1){let i=(e=(0,n.ensureBytes)("privateHash",e)).length,s=v(t).nByteLength+8;if(s<24||i1024)throw Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${i}`);return u(r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e),t-o)+o}},8463:(e,t)=>{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;let r=BigInt(0),n=BigInt(1),i=BigInt(2),o=e=>e instanceof Uint8Array,s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e){if(!o(e))throw Error("Uint8Array expected");let t="";for(let r=0;re+t.length,0)),r=0;return e.forEach(e=>{if(!o(e))throw Error("Uint8Array expected");t.set(e,r),r+=e.length}),t}t.bytesToHex=a,t.numberToHexUnpadded=l,t.hexToNumber=c,t.hexToBytes=d,t.bytesToNumberBE=function(e){return c(a(e))},t.bytesToNumberLE=function(e){if(!o(e))throw Error("Uint8Array expected");return c(a(Uint8Array.from(e).reverse()))},t.numberToBytesBE=(e,t)=>d(e.toString(16).padStart(2*t,"0")),t.numberToBytesLE=(e,r)=>(0,t.numberToBytesBE)(e,r).reverse(),t.numberToVarBytesBE=e=>d(l(e)),t.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=d(t)}catch(r){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!o(t))throw Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}let i=n.length;if("number"==typeof r&&i!==r)throw Error(`${e} expected ${r} bytes, got ${i}`);return n},t.concatBytes=u,t.equalBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;rr;e>>=n,t+=1);return t},t.bitGet=(e,t)=>e>>BigInt(t)&n,t.bitSet=(e,t,i)=>e|(i?n:r)<(i<new Uint8Array(e),f=e=>Uint8Array.from(e);t.createHmacDrbg=function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=h(e),i=h(e),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),l=(e=h())=>{i=a(f([0]),e),n=a(),0!==e.length&&(i=a(f([1]),e),n=a())},c=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e{let r;for(s(),l(e);!(r=t(c()));)l();return s(),r}};let p={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,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={}){let n=(t,r,n)=>{let i=p[r];if("function"!=typeof i)throw Error(`Invalid validator "${r}", expected function`);let o=e[t];if(!(n&&void 0===o||i(o,e)))throw Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${r}`)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}},378:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mapToCurveSimpleSWU=t.SWUFpSqrtRatio=t.weierstrass=t.weierstrassPoints=t.DER=void 0;let n=r(4212),i=r(8463),o=r(8463),s=r(337),{bytesToNumberBE:a,hexToBytes:l}=i;t.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){let{Err:r}=t.DER;if(e.length<2||2!==e[0])throw new r("Invalid signature integer tag");let 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){let{Err:r}=t.DER,n="string"==typeof e?l(e):e;if(!(n instanceof Uint8Array))throw 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");let{d:o,l:s}=t.DER._parseInt(n.subarray(2)),{d:a,l:c}=t.DER._parseInt(s);if(c.length)throw new r("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(e){let t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{let t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),o=n.length/2,s=i.length/2,a=r(o),l=r(s);return`30${r(s+o+4)}02${l}${i}02${a}${n}`}};let c=BigInt(0),d=BigInt(1),u=BigInt(2),h=BigInt(3),f=BigInt(4);function p(e){let t=function(e){let t=(0,s.validateBasic)(e);i.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw 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 Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,a=t.toBytes||((e,t,n)=>{let o=t.toAffine();return i.concatBytes(Uint8Array.from([4]),r.toBytes(o.x),r.toBytes(o.y))}),l=t.fromBytes||(e=>{let t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function u(e){let{a:n,b:i}=t,o=r.sqr(e),s=r.mul(o,e);return r.add(r.add(s,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),u(t.Gx)))throw Error("bad generator point: equation left != right");function f(e){return"bigint"==typeof e&&cr.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){let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(b.fromAffine)}static fromHex(e){let t=b.fromAffine(l((0,o.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return b.BASE.multiply(m(e))}_setWindowSize(e){this._WINDOW_SIZE=e,g.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw Error("bad point: ZERO")}let{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw Error("bad point: x or y not FE");let i=r.sqr(n),o=u(e);if(!r.eql(i,o))throw Error("bad point: equation left != right");if(!this.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){y(e);let{px:t,py:n,pz:i}=this,{px:o,py:s,pz:a}=e,l=r.eql(r.mul(t,a),r.mul(o,i)),c=r.eql(r.mul(n,a),r.mul(s,i));return l&&c}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){let{a:e,b:n}=t,i=r.mul(n,h),{px:o,py:s,pz:a}=this,l=r.ZERO,c=r.ZERO,d=r.ZERO,u=r.mul(o,o),f=r.mul(s,s),p=r.mul(a,a),m=r.mul(o,s);return m=r.add(m,m),d=r.mul(o,a),d=r.add(d,d),l=r.mul(e,d),c=r.mul(i,p),c=r.add(l,c),l=r.sub(f,c),c=r.add(f,c),c=r.mul(l,c),l=r.mul(m,l),d=r.mul(i,d),p=r.mul(e,p),m=r.sub(u,p),m=r.mul(e,m),m=r.add(m,d),d=r.add(u,u),u=r.add(d,u),u=r.add(u,p),u=r.mul(u,m),c=r.add(c,u),p=r.mul(s,a),p=r.add(p,p),u=r.mul(p,m),l=r.sub(l,u),d=r.mul(p,f),d=r.add(d,d),new b(l,c,d=r.add(d,d))}add(e){y(e);let{px:n,py:i,pz:o}=this,{px:s,py:a,pz:l}=e,c=r.ZERO,d=r.ZERO,u=r.ZERO,f=t.a,p=r.mul(t.b,h),m=r.mul(n,s),g=r.mul(i,a),v=r.mul(o,l),w=r.add(n,i),E=r.add(s,a);w=r.mul(w,E),E=r.add(m,g),w=r.sub(w,E),E=r.add(n,o);let A=r.add(s,l);return E=r.mul(E,A),A=r.add(m,v),E=r.sub(E,A),A=r.add(i,o),c=r.add(a,l),A=r.mul(A,c),c=r.add(g,v),A=r.sub(A,c),u=r.mul(f,E),c=r.mul(p,v),u=r.add(c,u),c=r.sub(g,u),u=r.add(g,u),d=r.mul(c,u),g=r.add(m,m),g=r.add(g,m),v=r.mul(f,v),E=r.mul(p,E),g=r.add(g,v),v=r.sub(m,v),v=r.mul(f,v),E=r.add(E,v),m=r.mul(g,E),d=r.add(d,m),m=r.mul(A,E),c=r.mul(w,c),c=r.sub(c,m),m=r.mul(w,g),u=r.mul(A,u),new b(c,d,u=r.add(u,m))}subtract(e){return this.add(e.negate())}is0(){return this.equals(b.ZERO)}wNAF(e){return w.wNAFCached(this,g,e,e=>{let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(b.fromAffine)})}multiplyUnsafe(e){let n=b.ZERO;if(e===c)return n;if(p(e),e===d)return this;let{endo:i}=t;if(!i)return w.unsafeLadder(this,e);let{k1neg:o,k1:s,k2neg:a,k2:l}=i.splitScalar(e),u=n,h=n,f=this;for(;s>c||l>c;)s&d&&(u=u.add(f)),l&d&&(h=h.add(f)),f=f.double(),s>>=d,l>>=d;return o&&(u=u.negate()),a&&(h=h.negate()),h=new b(r.mul(h.px,i.beta),h.py,h.pz),u.add(h)}multiply(e){let n,i;p(e);let{endo:o}=t;if(o){let{k1neg:t,k1:s,k2neg:a,k2:l}=o.splitScalar(e),{p:c,f:d}=this.wNAF(s),{p:u,f:h}=this.wNAF(l);c=w.constTimeNegate(t,c),u=w.constTimeNegate(a,u),u=new b(r.mul(u.px,o.beta),u.py,u.pz),n=c.add(u),i=d.add(h)}else{let{p:t,f:r}=this.wNAF(e);n=t,i=r}return b.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=b.BASE,i=(e,t)=>t!==c&&t!==d&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){let{px:t,py:n,pz:i}=this,o=this.is0();null==e&&(e=o?r.ONE:r.inv(i));let s=r.mul(t,e),a=r.mul(n,e),l=r.mul(i,e);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw Error("invZ was invalid");return{x:s,y:a}}isTorsionFree(){let{h:e,isTorsionFree:r}=t;if(e===d)return!0;if(r)return r(b,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:r}=t;return e===d?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);let v=t.nBitLength,w=(0,s.wNAF)(b,t.endo?Math.ceil(v/2):v);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:m,weierstrassEquation:u,isWithinCurveOrder:f}}function m(e,t){let r=e.ORDER,n=c;for(let e=r-d;e%u===c;e/=u)n+=d;let i=n,o=(r-d)/u**i,s=(o-d)/u,a=u**i-d,l=u**(i-d),p=e.pow(t,o),m=e.pow(t,(o+d)/u),g=(t,r)=>{let n=p,o=e.pow(r,a),c=e.sqr(o);c=e.mul(c,r);let h=e.mul(t,c);h=e.pow(h,s),h=e.mul(h,o),o=e.mul(h,r),c=e.mul(h,t);let f=e.mul(c,o);h=e.pow(f,l);let g=e.eql(h,e.ONE);o=e.mul(c,m),h=e.mul(f,n),c=e.cmov(o,c,g),f=e.cmov(h,f,g);for(let t=i;t>d;t--){let r=u**(t-u),i=e.pow(f,r),s=e.eql(i,e.ONE);o=e.mul(c,n),n=e.mul(n,n),i=e.mul(f,n),c=e.cmov(o,c,s),f=e.cmov(i,f,s)}return{isValid:g,value:c}};if(e.ORDER%f===h){let r=(e.ORDER-h)/f,n=e.sqrt(e.neg(t));g=(t,i)=>{let o=e.sqr(i),s=e.mul(t,i);o=e.mul(o,s);let a=e.pow(o,r);a=e.mul(a,s);let l=e.mul(a,n),c=e.mul(e.sqr(a),i),d=e.eql(c,t);return{isValid:d,value:e.cmov(l,a,d)}}}return g}t.weierstrassPoints=p,t.weierstrass=function(e){let r=function(e){let t=(0,s.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:l}=r,u=a.BYTES+1,h=2*a.BYTES+1;function f(e){return n.mod(e,l)}function m(e){return n.invert(e,l)}let{ProjectivePoint:g,normPrivateKeyToScalar:y,weierstrassEquation:b,isWithinCurveOrder:v}=p({...r,toBytes(e,t,r){let n=t.toAffine(),o=a.toBytes(n.x),s=i.concatBytes;return r?s(Uint8Array.from([t.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,a.toBytes(n.y))},fromBytes(e){let t=e.length,r=e[0],n=e.subarray(1);if(t!==u||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 Error(`Point of length ${t} was invalid. Expected ${u} compressed bytes or ${h} uncompressed bytes`)}{let e=i.bytesToNumberBE(n);if(!(ci.bytesToHex(i.numberToBytesBE(e,r.nByteLength)),E=(e,t,r)=>i.bytesToNumberBE(e.slice(t,r));class A{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){let t=r.nByteLength;return new A(E(e=(0,o.ensureBytes)("compactSignature",e,2*t),0,t),E(e,t,2*t))}static fromDER(e){let{r:r,s:n}=t.DER.toSig((0,o.ensureBytes)("DER",e));return new A(r,n)}assertValidity(){if(!v(this.r))throw Error("r must be 0 < r < CURVE.n");if(!v(this.s))throw Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new A(this.r,this.s,e)}recoverPublicKey(e){let{r:t,s:n,recovery:i}=this,s=I((0,o.ensureBytes)("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw Error("recovery id invalid");let l=2===i||3===i?t+r.n:t;if(l>=a.ORDER)throw Error("recovery id 2 or 3 invalid");let c=1&i?"03":"02",d=g.fromHex(c+w(l)),u=m(l),h=f(-s*u),p=f(n*u),y=g.BASE.multiplyAndAddUnsafe(d,h,p);if(!y)throw Error("point at infinify");return y.assertValidity(),y}hasHighS(){return this.s>l>>d}normalizeS(){return this.hasHighS()?new A(this.r,f(-this.s),this.recovery):this}toDERRawBytes(){return i.hexToBytes(this.toDERHex())}toDERHex(){return t.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return i.hexToBytes(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}function _(e){let t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===u||n===h:r?n===2*u||n===2*h:e instanceof g}let T=r.bits2int||function(e){let t=i.bytesToNumberBE(e),n=8*e.length-r.nBitLength;return n>0?t>>BigInt(n):t},I=r.bits2int_modN||function(e){return f(T(e))},x=i.bitMask(r.nBitLength);function R(e){if("bigint"!=typeof e)throw Error("bigint expected");if(!(c<=e&&ee in n))throw Error("sign() legacy options not supported");let{hash:s,randomBytes:u}=r,{lowS:h,prehash:p,extraEntropy:b}=n;null==h&&(h=!0),e=(0,o.ensureBytes)("msgHash",e),p&&(e=(0,o.ensureBytes)("prehashed msgHash",s(e)));let w=I(e),E=y(t),_=[R(E),R(w)];if(null!=b){let e=!0===b?u(a.BYTES):b;_.push((0,o.ensureBytes)("extraEntropy",e,a.BYTES))}return{seed:i.concatBytes(..._),k2sig:function(e){let t=T(e);if(!v(t))return;let r=m(t),n=g.BASE.multiply(t).toAffine(),i=f(n.x);if(i===c)return;let o=f(r*f(w+i*E));if(o===c)return;let s=2*(n.x!==i)|Number(n.y&d),a=o;return h&&o>l>>d&&(a=o>l>>d?f(-o):o,s^=1),new A(i,a,s)}}}(e,t,n);return i.createHmacDrbg(r.hash.outputLen,r.nByteLength,r.hmac)(s,u)},verify:function(e,n,i,s=C){let a,l;if(n=(0,o.ensureBytes)("msgHash",n),i=(0,o.ensureBytes)("publicKey",i),"strict"in s)throw Error("options.strict was renamed to lowS");let{lowS:c,prehash:d}=s;try{if("string"==typeof e||e instanceof Uint8Array)try{a=A.fromDER(e)}catch(r){if(!(r instanceof t.DER.Err))throw r;a=A.fromCompact(e)}else{if("object"!=typeof e||"bigint"!=typeof e.r||"bigint"!=typeof e.s)throw Error("PARSE");{let{r:t,s:r}=e;a=new A(t,r)}}l=g.fromHex(i)}catch(e){if("PARSE"===e.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&a.hasHighS())return!1;d&&(n=r.hash(n));let{r:u,s:h}=a,p=I(n),y=m(h),b=f(p*y),v=f(u*y),w=g.BASE.multiplyAndAddUnsafe(l,b,v)?.toAffine();return!!w&&f(w.x)===u},ProjectivePoint:g,Signature:A,utils:{isValidPrivateKey(e){try{return y(e),!0}catch(e){return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{let e=r.randomBytes(a.BYTES+8),t=n.hashToPrivateScalar(e,l);return i.numberToBytesBE(t,r.nByteLength)},precompute:(e=8,t=g.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}},t.SWUFpSqrtRatio=m,t.mapToCurveSimpleSWU=function(e,t){if(n.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw Error("mapToCurveSimpleSWU: invalid opts");let r=m(e,t.Z);if(!e.isOdd)throw Error("Fp.isOdd is not implemented!");return n=>{let i,o,s,a,l,c,d,u;i=e.sqr(n),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),s=e.add(o,e.ONE),s=e.mul(s,t.B),a=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),a=e.mul(a,t.A),o=e.sqr(s),c=e.sqr(a),l=e.mul(c,t.A),o=e.add(o,l),o=e.mul(o,s),c=e.mul(c,a),l=e.mul(c,t.B),o=e.add(o,l),d=e.mul(i,s);let{isValid:h,value:f}=r(o,c);u=e.mul(i,n),u=e.mul(u,f),d=e.cmov(d,s,h),u=e.cmov(u,f,h);let p=e.isOdd(n)===e.isOdd(u);return u=e.cmov(e.neg(u),u,p),{x:d=e.div(d,a),y:u}}}},9523:(e,t)=>{function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length{Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;let n=r(9523),i=r(7969);class o 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){n.default.exists(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;no-a&&(this.process(r,0),a=0);for(let e=a;e>i&o),a=Number(r&o),l=4*!!n,c=4*!n;e.setUint32(t+l,s,n),e.setUint32(t+c,a,n)})(r,o-8,BigInt(8*this.length),s),this.process(r,0);let l=(0,i.createView)(e),c=this.outputLen;if(c%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=c/4,u=this.get();if(d>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},573:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=void 0;let n=r(9523),i=r(7969);class o extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);let r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?e.create().update(r).digest():r);for(let e=0;enew o(e,t).update(r).digest(),t.hmac.create=(e,t)=>new o(e,t)},9957:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;let n=r(1405),i=r(7969),o=(e,t,r)=>e&t^e&r^t&r,s=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),a=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),l=new Uint32Array(64);class c extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){var r;for(let r=0;r<16;r++,t+=4)l[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=l[e-15],r=l[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;l[e]=o+l[e-7]+n+l[e-16]|0}let{A:n,B:a,C:c,D:d,E:u,F:h,G:f,H:p}=this;for(let e=0;e<64;e++){let t=p+((0,i.rotr)(u,6)^(0,i.rotr)(u,11)^(0,i.rotr)(u,25))+((r=u)&h^~r&f)+s[e]+l[e]|0,m=((0,i.rotr)(n,2)^(0,i.rotr)(n,13)^(0,i.rotr)(n,22))+o(n,a,c)|0;p=f,f=h,h=u,u=d+t|0,d=c,c=a,a=n,n=t+m|0}n=n+this.A|0,a=a+this.B|0,c=c+this.C|0,d=d+this.D|0,u=u+this.E|0,h=h+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(n,a,c,d,u,h,f,p)}roundClean(){l.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class d extends c{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new c),t.sha224=(0,i.wrapConstructor)(()=>new d)},7969:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(3911);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),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.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function o(e){if("string"!=typeof e)throw TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=o(e)),!(e instanceof Uint8Array))throw TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw Error("Uint8Array expected");let t="";for(let r=0;r{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o=0&&ee instanceof Uint8Array))throw Error("Uint8Array list expected");if(1===e.length)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));for(let r=0,n=0;re().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){let 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 Error("crypto.getRandomValues must be defined")}},8019:(e,t,r)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.schnorr=t.secp256k1=void 0;let i=r(9957),o=r(7969),s=r(4212),a=r(378),l=r(8463),c=r(9198),d=r(3815),u=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),h=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),f=BigInt(1),p=BigInt(2),m=(e,t)=>(e+t/p)/t;function g(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),c=e*e*e%u,d=c*c*e%u,h=(0,s.pow2)(d,t,u)*d%u,f=(0,s.pow2)(h,t,u)*d%u,m=(0,s.pow2)(f,p,u)*c%u,g=(0,s.pow2)(m,n,u)*m%u,b=(0,s.pow2)(g,i,u)*g%u,v=(0,s.pow2)(b,a,u)*b%u,w=(0,s.pow2)(v,l,u)*v%u,E=(0,s.pow2)(w,a,u)*b%u,A=(0,s.pow2)(E,t,u)*d%u,_=(0,s.pow2)(A,o,u)*g%u,T=(0,s.pow2)(_,r,u)*c%u,I=(0,s.pow2)(T,p,u);if(!y.eql(y.sqr(I),e))throw Error("Cannot find square root");return I}let y=(0,s.Field)(u,void 0,void 0,{sqrt:g});t.secp256k1=(0,d.createCurve)({a:BigInt(0),b:BigInt(7),Fp:y,n:h,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-f*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),o=m(t*e,h),a=m(-r*e,h),l=(0,s.mod)(e-o*t-a*n,h),c=(0,s.mod)(-o*r-a*t,h),d=l>i,u=c>i;if(d&&(l=h-l),u&&(c=h-c),l>i||c>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:u,k2:c}}}},i.sha256);let b=BigInt(0),v=e=>"bigint"==typeof e&&be.charCodeAt(0)));r=(0,l.concatBytes)(t,t),w[e]=r}return(0,i.sha256)((0,l.concatBytes)(r,...t))}let A=e=>e.toRawBytes(!0).slice(1),_=e=>(0,l.numberToBytesBE)(e,32),T=e=>(0,s.mod)(e,u),I=e=>(0,s.mod)(e,h),x=t.secp256k1.ProjectivePoint;function R(e){let r=t.secp256k1.utils.normPrivateKeyToScalar(e),n=x.fromPrivateKey(r);return{scalar:n.hasEvenY()?r:I(-r),bytes:A(n)}}function P(e){if(!v(e))throw Error("bad x: need 0 < x < p");let t=T(e*e),r=g(T(t*e+BigInt(7)));r%p!==b&&(r=T(-r));let n=new x(e,r,f);return n.assertValidity(),n}function C(...e){return I((0,l.bytesToNumberBE)(E("BIP0340/challenge",...e)))}function k(e,t,r){var n;let i=(0,l.ensureBytes)("signature",e,64),o=(0,l.ensureBytes)("message",t),s=(0,l.ensureBytes)("publicKey",r,32);try{let e=P((0,l.bytesToNumberBE)(s)),t=(0,l.bytesToNumberBE)(i.subarray(0,32));if(!v(t))return!1;let r=(0,l.bytesToNumberBE)(i.subarray(32,64));if(!("bigint"==typeof r&&be.map(e=>BigInt(e)))),O=(0,a.mapToCurveSimpleSWU)(y,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:y.create(BigInt("-11"))});n=c.createHasher(t.secp256k1.ProjectivePoint,e=>{let{x:t,y:r}=O(y.create(e[0]));return S(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:y.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256}),t.hashToCurve=n.hashToCurve,t.encodeToCurve=n.encodeToCurve},637:(e,t)=>{var r;r=function(e){e.version="1.2.2";var t=function(){for(var e=0,t=Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1)?-0x12477ce0^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),r=function(e){var t=0,r=0,n=0,i="undefined"!=typeof Int32Array?new Int32Array(4096):Array(4096);for(n=0;256!=n;++n)i[n]=e[n];for(n=0;256!=n;++n)for(r=e[n],t=256+n;t<4096;t+=256)r=i[t]=r>>>8^e[255&r];var o=[];for(n=1;16!=n;++n)o[n-1]="undefined"!=typeof Int32Array?i.subarray(256*n,256*n+256):i.slice(256*n,256*n+256);return o}(t),n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],l=r[5],c=r[6],d=r[7],u=r[8],h=r[9],f=r[10],p=r[11],m=r[12],g=r[13],y=r[14];e.table=t,e.bstr=function(e,r){for(var n=~r,i=0,o=e.length;i>>8^t[255&(n^e.charCodeAt(i++))];return~n},e.buf=function(e,r){for(var b=~r,v=e.length-15,w=0;w>8&255]^m[e[w++]^b>>16&255]^p[e[w++]^b>>>24]^f[e[w++]]^h[e[w++]]^u[e[w++]]^d[e[w++]]^c[e[w++]]^l[e[w++]]^a[e[w++]]^s[e[w++]]^o[e[w++]]^i[e[w++]]^n[e[w++]]^t[e[w++]];for(v+=15;w>>8^t[255&(b^e[w++])];return~b},e.str=function(e,r){for(var n=~r,i=0,o=e.length,s=0,a=0;i>>8^t[255&(n^s)]:s<2048?n=(n=n>>>8^t[255&(n^(192|s>>6&31))])>>>8^t[255&(n^(128|63&s))]:s>=55296&&s<57344?(s=64+(1023&s),a=1023&e.charCodeAt(i++),n=(n=(n=(n=n>>>8^t[255&(n^(240|s>>8&7))])>>>8^t[255&(n^(128|s>>2&63))])>>>8^t[255&(n^(128|a>>6&15|(3&s)<<4))])>>>8^t[255&(n^(128|63&a))]):n=(n=(n=n>>>8^t[255&(n^(224|s>>12&15))])>>>8^t[255&(n^(128|s>>6&63))])>>>8^t[255&(n^(128|63&s))];return~n}},"undefined"==typeof DO_NOT_EXPORT_CRC?r(t):r({})},288:(e,t,r)=>{var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();(function(e){var t=void 0!==i&&i||"undefined"!=typeof self&&self||void 0!==t&&t,r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,o="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in t,a="ArrayBuffer"in t;if(a)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function d(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function p(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function m(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function g(e){var t=new FileReader,r=m(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=m(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),("GET"===this.method||"HEAD"===this.method)&&("no-store"===t.cache||"no-cache"===t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function E(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function A(e,t){if(!(this instanceof A))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},b.call(w.prototype),b.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},A.error=function(){var e=new A(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];A.redirect=function(e,t){if(-1===_.indexOf(t))throw RangeError("Invalid status code");return new A(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function T(r,n){return new Promise(function(i,s){var l=new w(r,n);if(l.signal&&l.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function d(){c.abort()}c.onload=function(){var e,t,r={status:c.status,statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t)};r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var n="response"in c?c.response:c.responseText;setTimeout(function(){i(new A(n,r))},0)},c.onerror=function(){setTimeout(function(){s(TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){s(TypeError("Network request failed"))},0)},c.onabort=function(){setTimeout(function(){s(new e.DOMException("Aborted","AbortError"))},0)},c.open(l.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(t){return e}}(l.url),!0),"include"===l.credentials?c.withCredentials=!0:"omit"===l.credentials&&(c.withCredentials=!1),"responseType"in c&&(o?c.responseType="blob":a&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(c.responseType="arraybuffer")),!n||"object"!=typeof n.headers||n.headers instanceof f?l.headers.forEach(function(e,t){c.setRequestHeader(t,e)}):Object.getOwnPropertyNames(n.headers).forEach(function(e){c.setRequestHeader(e,u(n.headers[e]))}),l.signal&&(l.signal.addEventListener("abort",d),c.onreadystatechange=function(){4===c.readyState&&l.signal.removeEventListener("abort",d)}),c.send(void 0===l._bodyInit?null:l._bodyInit)})}T.polyfill=!0,t.fetch||(t.fetch=T,t.Headers=f,t.Request=w,t.Response=A),e.Headers=f,e.Request=w,e.Response=A,e.fetch=T})({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var o=n.fetch?n:i;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},4740:(e,t,r)=>{r.r(t),r.d(t,{default:()=>i});var n=null;"undefined"!=typeof WebSocket?n=WebSocket:"undefined"!=typeof MozWebSocket?n=MozWebSocket:void 0!==r.g?n=r.g.WebSocket||r.g.MozWebSocket:"undefined"!=typeof window?n=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(n=self.WebSocket||self.MozWebSocket);let i=n},9907:e=>{var t,r,n=e.exports={};function i(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],c=!1,d=-1;function u(){c&&a&&(c=!1,a.length?l=a.concat(l):d=-1,l.length&&h())}function h(){if(!c){var e=s(u);c=!0;for(var t=l.length;t;){for(a=l,l=[];++d1)for(var r=1;r{Object.defineProperty(t,"__esModule",{value:!0});let n=r(7894);t.default={encodeEventSignature:n.encodeEventSignature,encodeFunctionCall:n.encodeFunctionCall,encodeFunctionSignature:n.encodeFunctionSignature,encodeParameter:n.encodeParameter,encodeParameters:n.encodeParameters,decodeParameter:n.decodeParameter,decodeParameters:n.decodeParameters,decodeLog:n.decodeLog}},3533:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.initAccountsForContext=void 0;let i=r(7797),o=r(6825),s=r(67),a=r(2054);t.initAccountsForContext=e=>{let t=(t,r)=>n(void 0,void 0,void 0,function*(){let n=yield(0,s.prepareTransactionForSigning)(t,e),l=(0,o.format)({format:"bytes"},r,i.ETH_DATA_FORMAT);return(0,a.signTransaction)(n,l)}),r=e=>{let r=(0,a.privateKeyToAccount)(e);return Object.assign(Object.assign({},r),{signTransaction:e=>n(void 0,void 0,void 0,function*(){return t(e,r.privateKey)})})},l=(e,r,i)=>n(void 0,void 0,void 0,function*(){var o;let s=yield(0,a.decrypt)(e,r,null===(o=null==i?void 0:i.nonStrict)||void 0===o||o);return Object.assign(Object.assign({},s),{signTransaction:e=>n(void 0,void 0,void 0,function*(){return t(e,s.privateKey)})})}),c=()=>{let e=(0,a.create)();return Object.assign(Object.assign({},e),{signTransaction:r=>n(void 0,void 0,void 0,function*(){return t(r,e.privateKey)})})},d=new a.Wallet({create:c,privateKeyToAccount:r,decrypt:l});return{signTransaction:t,create:c,privateKeyToAccount:r,decrypt:l,recoverTransaction:a.recoverTransaction,hashMessage:a.hashMessage,sign:a.sign,recover:a.recover,encrypt:a.encrypt,wallet:d,privateKeyToAddress:a.privateKeyToAddress,parseAndValidatePrivateKey:a.parseAndValidatePrivateKey,privateKeyToPublicKey:a.privateKeyToPublicKey}}},7205:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Web3PkgInfo=void 0,t.Web3PkgInfo={version:"4.16.0"}},174:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(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 i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3=void 0;let a=r(5177),l=r(67),c=s(r(3976)),d=r(544),u=r(2154),h=r(6314),f=r(3231),p=o(r(6825)),m=r(6825),g=r(162),y=r(1633),b=s(r(751)),v=r(3533),w=r(7205),E=r(5013);class A extends a.Web3Context{constructor(e=g.mainnet){var t;!(0,m.isNullish)(e)&&("string"!=typeof e||""!==e.trim())&&("string"==typeof e||(0,a.isSupportedProvider)(e)||e.provider)||console.warn("NOTE: web3.js is running without provider. You need to pass a provider in order to interact with the network!");let r={};"string"==typeof e||(0,a.isSupportedProvider)(e)?r.provider=e:r=e||{},r.registeredSubscriptions=Object.assign(Object.assign({},l.registeredSubscriptions),null!==(t=r.registeredSubscriptions)&&void 0!==t?t:{}),super(r);let n=(0,v.initAccountsForContext)(this);this._wallet=n.wallet,this._accountProvider=n,this.utils=p;let i=this;class o extends c.default{constructor(e,t,r,n,o){if((0,m.isContractInitOptions)(t)&&(0,m.isContractInitOptions)(r))throw new y.InvalidMethodParamsError("Should not provide options at both 2nd and 3rd parameters");let l,c,d,u={};if(!(0,m.isNullish)(t)&&"object"!=typeof t&&"string"!=typeof t)throw new y.InvalidMethodParamsError;if("string"==typeof t&&(l=t),u=(0,m.isContractInitOptions)(t)?t:(0,m.isContractInitOptions)(r)?r:{},c=t instanceof a.Web3Context?t:r instanceof a.Web3Context?r:n instanceof a.Web3Context?n:i.getContextObject(),o?d=o:(0,m.isDataFormat)(r)?d=r:(0,m.isDataFormat)(n)&&(d=n),super(e,l,u,c,d),super.subscribeToContextEvents(i),!(0,m.isNullish)(s)){let e=s.getTransactionMiddleware();(0,m.isNullish)(e)||super.setTransactionMiddleware(e)}}}let s=i.use(l.Web3Eth);this.eth=Object.assign(s,{ens:i.use(d.ENS,d.registryAddresses.main),Iban:u.Iban,net:i.use(f.Net),personal:i.use(h.Personal),Contract:o,abi:b.default,accounts:n})}}t.Web3=A,A.version=w.Web3PkgInfo.version,A.utils=p,A.requestEIP6963Providers=E.requestEIP6963Providers,A.onNewProviderDiscovered=E.onNewProviderDiscovered,A.modules={Web3Eth:l.Web3Eth,Iban:u.Iban,Net:f.Net,ENS:d.ENS,Personal:h.Personal},t.default=A},5013:function(e,t){var r,n,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.onNewProviderDiscovered=t.requestEIP6963Providers=t.web3ProvidersMapUpdated=t.eip6963ProvidersMap=t.Eip6963EventName=void 0,(r=n||(t.Eip6963EventName=n={})).eip6963announceProvider="eip6963:announceProvider",r.eip6963requestProvider="eip6963:requestProvider",t.eip6963ProvidersMap=new Map,t.web3ProvidersMapUpdated="web3:providersMapUpdated",t.requestEIP6963Providers=()=>i(void 0,void 0,void 0,function*(){return new Promise((e,r)=>{"undefined"==typeof window&&r(Error("window object not available, EIP-6963 is intended to be used within a browser")),window.addEventListener(n.eip6963announceProvider,r=>{t.eip6963ProvidersMap.set(r.detail.info.uuid,r.detail);let n=new CustomEvent(t.web3ProvidersMapUpdated,{detail:t.eip6963ProvidersMap});window.dispatchEvent(n),e(t.eip6963ProvidersMap)}),window.dispatchEvent(new Event(n.eip6963requestProvider))})}),t.onNewProviderDiscovered=e=>{if("undefined"==typeof window)throw Error("window object not available, EIP-6963 is intended to be used within a browser");window.addEventListener(t.web3ProvidersMapUpdated,e)}},7442:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ZodError=t.quotelessJson=t.ZodIssueCode=void 0;let n=r(4705);t.ZodIssueCode=n.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),t.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class i extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;ne.message){let t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}t.ZodError=i,i.create=e=>new i(e)},548:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorMap=t.setErrorMap=t.defaultErrorMap=void 0;let i=n(r(8412));t.defaultErrorMap=i.default;let o=i.default;t.setErrorMap=function(e){o=e},t.getErrorMap=function(){return o}},6340:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(548),t),i(r(6258),t),i(r(9201),t),i(r(4705),t),i(r(5226),t),i(r(7442),t)},5759:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.errorUtil=void 0,(r=t.errorUtil||(t.errorUtil={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},r.toString=e=>"string"==typeof e?e:null==e?void 0:e.message},6258:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.addIssueToContext=t.EMPTY_PATH=t.makeIssue=void 0;let i=r(548),o=n(r(8412));t.makeIssue=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s={...i,path:o},a="";for(let e of n.filter(e=>!!e).slice().reverse())a=e(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}},t.EMPTY_PATH=[],t.addIssueToContext=function(e,r){let n=(0,t.makeIssue)({issueData:r,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,(0,i.getErrorMap)(),o.default].filter(e=>!!e)});e.common.issues.push(n)};class s{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if("aborted"===i.status)return t.INVALID;"dirty"===i.status&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let r=[];for(let e of t)r.push({key:await e.key,value:await e.value});return s.mergeObjectSync(e,r)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:r,value:o}=i;if("aborted"===r.status||"aborted"===o.status)return t.INVALID;"dirty"===r.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"!==r.value&&(void 0!==o.value||i.alwaysSet)&&(n[r.value]=o.value)}return{status:e.value,value:n}}}t.ParseStatus=s,t.INVALID=Object.freeze({status:"aborted"}),t.DIRTY=e=>({status:"dirty",value:e}),t.OK=e=>({status:"valid",value:e}),t.isAborted=e=>"aborted"===e.status,t.isDirty=e=>"dirty"===e.status,t.isValid=e=>"valid"===e.status,t.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise},9201:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4705:(e,t)=>{var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0,(n=r=t.util||(t.util={})).assertEqual=e=>e,n.assertIs=function(e){},n.assertNever=function(e){throw Error()},n.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},n.getValidEnumValues=e=>{let t=n.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),r={};for(let n of t)r[n]=e[n];return n.objectValues(r)},n.objectValues=e=>n.objectKeys(e).map(function(t){return e[t]}),n.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},n.find=(e,t)=>{for(let r of e)if(t(r))return r},n.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,n.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},n.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(t.objectUtil||(t.objectUtil={})).mergeShapes=(e,t)=>({...e,...t}),t.ZodParsedType=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t.getParsedType=e=>{switch(typeof e){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return isNaN(e)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(e)?t.ZodParsedType.array:null===e?t.ZodParsedType.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?t.ZodParsedType.promise:"undefined"!=typeof Map&&e instanceof Map?t.ZodParsedType.map:"undefined"!=typeof Set&&e instanceof Set?t.ZodParsedType.set:"undefined"!=typeof Date&&e instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}}},5995:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(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 i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;let a=o(r(6340));t.z=a,s(r(6340),t),t.default=a},8412:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});let n=r(4705),i=r(7442);t.default=(e,t)=>{let r;switch(e.code){case i.ZodIssueCode.invalid_type:r=e.received===n.ZodParsedType.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case i.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,n.util.jsonStringifyReplacer)}`;break;case i.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${n.util.joinValues(e.keys,", ")}`;break;case i.ZodIssueCode.invalid_union:r="Invalid input";break;case i.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${n.util.joinValues(e.options)}`;break;case i.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${n.util.joinValues(e.options)}, received '${e.received}'`;break;case i.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case i.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case i.ZodIssueCode.invalid_date:r="Invalid date";break;case i.ZodIssueCode.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:n.util.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case i.ZodIssueCode.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case i.ZodIssueCode.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case i.ZodIssueCode.custom:r="Invalid input";break;case i.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case i.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case i.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,n.util.assertNever(e)}return{message:r}}},5226:(e,t,r)=>{var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.date=t.boolean=t.bigint=t.array=t.any=t.coerce=t.ZodFirstPartyTypeKind=t.late=t.ZodSchema=t.Schema=t.custom=t.ZodReadonly=t.ZodPipeline=t.ZodBranded=t.BRAND=t.ZodNaN=t.ZodCatch=t.ZodDefault=t.ZodNullable=t.ZodOptional=t.ZodTransformer=t.ZodEffects=t.ZodPromise=t.ZodNativeEnum=t.ZodEnum=t.ZodLiteral=t.ZodLazy=t.ZodFunction=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodDate=t.ZodBoolean=t.ZodBigInt=t.ZodNumber=t.ZodString=t.ZodType=void 0,t.NEVER=t.void=t.unknown=t.union=t.undefined=t.tuple=t.transformer=t.symbol=t.string=t.strictObject=t.set=t.record=t.promise=t.preprocess=t.pipeline=t.ostring=t.optional=t.onumber=t.oboolean=t.object=t.number=t.nullable=t.null=t.never=t.nativeEnum=t.nan=t.map=t.literal=t.lazy=t.intersection=t.instanceof=t.function=t.enum=t.effect=t.discriminatedUnion=void 0;let o=r(548),s=r(5759),a=r(6258),l=r(4705),c=r(7442);class d{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let u=(e,t)=>{if((0,a.isValid)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new c.ZodError(e.common.issues);return this._error=t,this._error}}};function h(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=n?n:t.defaultError}:{message:null!=r?r:t.defaultError},description:i}}class f{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return(0,l.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,l.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new a.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,l.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if((0,a.isAsync)(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,l.getParsedType)(e)},i=this._parseSync({data:e,path:n.path,parent:n});return u(n,i)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,l.getParsedType)(e)},n=this._parse({data:e,path:r.path,parent:r});return u(r,await ((0,a.isAsync)(n)?n:Promise.resolve(n)))}refine(e,t){let r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{let i=e(t),o=()=>n.addIssue({code:c.ZodIssueCode.custom,...r(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(o(),!1)):!!i||(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new X({schema:this,typeName:n.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Y.create(this,this._def)}nullable(){return J.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this,this._def)}promise(){return $.create(this,this._def)}or(e){return L.create([this,e],this._def)}and(e){return F.create(this,e,this._def)}transform(e){return new X({...h(this._def),schema:this,typeName:n.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new ee({...h(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:n.ZodDefault})}brand(){return new en({typeName:n.ZodBranded,type:this,...h(this._def)})}catch(e){return new et({...h(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:n.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return ei.create(this,e)}readonly(){return eo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}t.ZodType=f,t.Schema=f,t.ZodSchema=f;let p=/^c[^\s-]{8,}$/i,m=/^[a-z][a-z0-9]*$/,g=/[0-9A-HJKMNP-TV-Z]{26}/,y=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,b=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,v=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,w=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,E=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class A extends f{constructor(){super(...arguments),this._regex=(e,t,r)=>this.refinement(t=>e.test(t),{validation:t,code:c.ZodIssueCode.invalid_string,...s.errorUtil.errToObj(r)}),this.nonempty=e=>this.min(1,s.errorUtil.errToObj(e)),this.trim=()=>new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new A({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(e){var t,r;let n;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==l.ZodParsedType.string){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.string,received:t.parsedType}),a.INVALID}let i=new a.ParseStatus;for(let o of this._def.checks)if("min"===o.kind)e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),(0,a.addIssueToContext)(n,{code:c.ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if("length"===o.kind){let t=e.data.length>o.value,r=e.data.length"datetime"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new A({checks:[],typeName:n.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...h(e)})};class _ extends f{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==l.ZodParsedType.number){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.number,received:t.parsedType}),a.INVALID}let r=new a.ParseStatus;for(let n of this._def.checks)"int"===n.kind?l.util.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return parseInt(e.toFixed(i).replace(".",""))%parseInt(t.toFixed(i).replace(".",""))/Math.pow(10,i)}(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.not_finite,message:n.message}),r.dirty()):l.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,s.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,s.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,s.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,s.errorUtil.toString(t))}setLimit(e,t,r,n){return new _({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:s.errorUtil.toString(n)}]})}_addCheck(e){return new _({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:s.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:s.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:s.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:s.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:s.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:s.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:s.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:s.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:s.errorUtil.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&l.util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew _({checks:[],typeName:n.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...h(e)});class T extends f{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==l.ZodParsedType.bigint){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.bigint,received:t.parsedType}),a.INVALID}let r=new a.ParseStatus;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):l.util.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,s.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,s.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,s.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,s.errorUtil.toString(t))}setLimit(e,t,r,n){return new T({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:s.errorUtil.toString(n)}]})}_addCheck(e){return new T({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:s.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:s.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:s.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:s.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:s.errorUtil.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new T({checks:[],typeName:n.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...h(e)})};class I extends f{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==l.ZodParsedType.boolean){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.boolean,received:t.parsedType}),a.INVALID}return(0,a.OK)(e.data)}}t.ZodBoolean=I,I.create=e=>new I({typeName:n.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...h(e)});class x extends f{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==l.ZodParsedType.date){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.date,received:t.parsedType}),a.INVALID}if(isNaN(e.data.getTime())){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_date}),a.INVALID}let r=new a.ParseStatus;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(t=this._getOrReturnCtx(e,t),(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):l.util.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new x({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:s.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:s.errorUtil.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew x({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:n.ZodDate,...h(e)});class R extends f{_parse(e){if(this._getType(e)!==l.ZodParsedType.symbol){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.symbol,received:t.parsedType}),a.INVALID}return(0,a.OK)(e.data)}}t.ZodSymbol=R,R.create=e=>new R({typeName:n.ZodSymbol,...h(e)});class P extends f{_parse(e){if(this._getType(e)!==l.ZodParsedType.undefined){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.undefined,received:t.parsedType}),a.INVALID}return(0,a.OK)(e.data)}}t.ZodUndefined=P,P.create=e=>new P({typeName:n.ZodUndefined,...h(e)});class C extends f{_parse(e){if(this._getType(e)!==l.ZodParsedType.null){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.null,received:t.parsedType}),a.INVALID}return(0,a.OK)(e.data)}}t.ZodNull=C,C.create=e=>new C({typeName:n.ZodNull,...h(e)});class k extends f{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,a.OK)(e.data)}}t.ZodAny=k,k.create=e=>new k({typeName:n.ZodAny,...h(e)});class S extends f{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,a.OK)(e.data)}}t.ZodUnknown=S,S.create=e=>new S({typeName:n.ZodUnknown,...h(e)});class O extends f{_parse(e){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.never,received:t.parsedType}),a.INVALID}}t.ZodNever=O,O.create=e=>new O({typeName:n.ZodNever,...h(e)});class N extends f{_parse(e){if(this._getType(e)!==l.ZodParsedType.undefined){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.void,received:t.parsedType}),a.INVALID}return(0,a.OK)(e.data)}}t.ZodVoid=N,N.create=e=>new N({typeName:n.ZodVoid,...h(e)});class B extends f{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==l.ZodParsedType.array)return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.array,received:t.parsedType}),a.INVALID;if(null!==n.exactLength){let e=t.data.length>n.exactLength.value,i=t.data.lengthn.maxLength.value&&((0,a.addIssueToContext)(t,{code:c.ZodIssueCode.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new d(t,e,t.path,r)))).then(e=>a.ParseStatus.mergeArray(r,e));let i=[...t.data].map((e,r)=>n.type._parseSync(new d(t,e,t.path,r)));return a.ParseStatus.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new B({...this._def,minLength:{value:e,message:s.errorUtil.toString(t)}})}max(e,t){return new B({...this._def,maxLength:{value:e,message:s.errorUtil.toString(t)}})}length(e,t){return new B({...this._def,exactLength:{value:e,message:s.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}t.ZodArray=B,B.create=(e,t)=>new B({type:e,minLength:null,maxLength:null,exactLength:null,typeName:n.ZodArray,...h(t)});class M extends f{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=l.util.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==l.ZodParsedType.object){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.object,received:t.parsedType}),a.INVALID}let{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof O&&"strip"===this._def.unknownKeys))for(let e in r.data)i.includes(e)||o.push(e);let s=[];for(let e of i){let t=n[e],i=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new d(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof O){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of o)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)o.length>0&&((0,a.addIssueToContext)(r,{code:c.ZodIssueCode.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of o){let n=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new d(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let r=await t.key;e.push({key:r,value:await t.value,alwaysSet:t.alwaysSet})}return e}).then(e=>a.ParseStatus.mergeObjectSync(t,e)):a.ParseStatus.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return s.errorUtil.errToObj,new M({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,i,o,a;let l=null!==(o=null===(i=(n=this._def).errorMap)||void 0===i?void 0:i.call(n,t,r).message)&&void 0!==o?o:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=s.errorUtil.errToObj(e).message)&&void 0!==a?a:l}:{message:l}}}:{}})}strip(){return new M({...this._def,unknownKeys:"strip"})}passthrough(){return new M({...this._def,unknownKeys:"passthrough"})}extend(e){return new M({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new M({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:n.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new M({...this._def,catchall:e})}pick(e){let t={};return l.util.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new M({...this._def,shape:()=>t})}omit(e){let t={};return l.util.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new M({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof M){let r={};for(let n in t.shape){let i=t.shape[n];r[n]=Y.create(e(i))}return new M({...t._def,shape:()=>r})}return t instanceof B?new B({...t._def,type:e(t.element)}):t instanceof Y?Y.create(e(t.unwrap())):t instanceof J?J.create(e(t.unwrap())):t instanceof j?j.create(t.items.map(t=>e(t))):t}(this)}partial(e){let t={};return l.util.objectKeys(this.shape).forEach(r=>{let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}),new M({...this._def,shape:()=>t})}required(e){let t={};return l.util.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof Y;)e=e._def.innerType;t[r]=e}}),new M({...this._def,shape:()=>t})}keyof(){return z(l.util.objectKeys(this.shape))}}t.ZodObject=M,M.create=(e,t)=>new M({shape:()=>e,unknownKeys:"strip",catchall:O.create(),typeName:n.ZodObject,...h(t)}),M.strictCreate=(e,t)=>new M({shape:()=>e,unknownKeys:"strict",catchall:O.create(),typeName:n.ZodObject,...h(t)}),M.lazycreate=(e,t)=>new M({shape:e,unknownKeys:"strip",catchall:O.create(),typeName:n.ZodObject,...h(t)});class L extends f{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new c.ZodError(e.ctx.common.issues));return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_union,unionErrors:r}),a.INVALID});{let e;let n=[];for(let i of r){let r={...t,common:{...t.common,issues:[]},parent:null},o=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===o.status)return o;"dirty"!==o.status||e||(e={result:o,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=n.map(e=>new c.ZodError(e));return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_union,unionErrors:i}),a.INVALID}}get options(){return this._def.options}}t.ZodUnion=L,L.create=(e,t)=>new L({options:e,typeName:n.ZodUnion,...h(t)});let D=e=>e instanceof q?D(e.schema):e instanceof X?D(e.innerType()):e instanceof Z?[e.value]:e instanceof K?e.options:e instanceof Q?Object.keys(e.enum):e instanceof ee?D(e._def.innerType):e instanceof P?[void 0]:e instanceof C?[null]:null;class H extends f{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.ZodParsedType.object)return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.object,received:t.parsedType}),a.INVALID;let r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):((0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),a.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let i=new Map;for(let r of t){let t=D(r.shape[e]);if(!t)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let n of t){if(i.has(n))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,r)}}return new H({typeName:n.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...h(r)})}}t.ZodDiscriminatedUnion=H;class F extends f{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if((0,a.isAborted)(e)||(0,a.isAborted)(n))return a.INVALID;let i=function e(t,r){let n=(0,l.getParsedType)(t),i=(0,l.getParsedType)(r);if(t===r)return{valid:!0,data:t};if(n===l.ZodParsedType.object&&i===l.ZodParsedType.object){let n=l.util.objectKeys(r),i=l.util.objectKeys(t).filter(e=>-1!==n.indexOf(e)),o={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};o[n]=i.data}return{valid:!0,data:o}}if(n===l.ZodParsedType.array&&i===l.ZodParsedType.array){if(t.length!==r.length)return{valid:!1};let n=[];for(let i=0;in(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}t.ZodIntersection=F,F.create=(e,t,r)=>new F({left:e,right:t,typeName:n.ZodIntersection,...h(r)});class j extends f{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.ZodParsedType.array)return(0,a.addIssueToContext)(r,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.array,received:r.parsedType}),a.INVALID;if(r.data.lengththis._def.items.length&&((0,a.addIssueToContext)(r,{code:c.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...r.data].map((e,t)=>{let n=this._def.items[t]||this._def.rest;return n?n._parse(new d(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>a.ParseStatus.mergeArray(t,e)):a.ParseStatus.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new j({...this._def,rest:e})}}t.ZodTuple=j,j.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new j({items:e,typeName:n.ZodTuple,rest:null,...h(t)})};class U extends f{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.ZodParsedType.object)return(0,a.addIssueToContext)(r,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.object,received:r.parsedType}),a.INVALID;let n=[],i=this._def.keyType,o=this._def.valueType;for(let e in r.data)n.push({key:i._parse(new d(r,e,r.path,e)),value:o._parse(new d(r,r.data[e],r.path,e))});return r.common.async?a.ParseStatus.mergeObjectAsync(t,n):a.ParseStatus.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new U(t instanceof f?{keyType:e,valueType:t,typeName:n.ZodRecord,...h(r)}:{keyType:A.create(),valueType:e,typeName:n.ZodRecord,...h(t)})}}t.ZodRecord=U;class V extends f{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.ZodParsedType.map)return(0,a.addIssueToContext)(r,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.map,received:r.parsedType}),a.INVALID;let n=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([e,t],o)=>({key:n._parse(new d(r,e,r.path,[o,"key"])),value:i._parse(new d(r,t,r.path,[o,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of o){let n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return a.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of o){let n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return a.INVALID;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}t.ZodMap=V,V.create=(e,t,r)=>new V({valueType:t,keyType:e,typeName:n.ZodMap,...h(r)});class G extends f{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==l.ZodParsedType.set)return(0,a.addIssueToContext)(r,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.set,received:r.parsedType}),a.INVALID;let n=this._def;null!==n.minSize&&r.data.sizen.maxSize.value&&((0,a.addIssueToContext)(r,{code:c.ZodIssueCode.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let i=this._def.valueType;function o(e){let r=new Set;for(let n of e){if("aborted"===n.status)return a.INVALID;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}let s=[...r.data.values()].map((e,t)=>i._parse(new d(r,e,r.path,t)));return r.common.async?Promise.all(s).then(e=>o(e)):o(s)}min(e,t){return new G({...this._def,minSize:{value:e,message:s.errorUtil.toString(t)}})}max(e,t){return new G({...this._def,maxSize:{value:e,message:s.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}t.ZodSet=G,G.create=(e,t)=>new G({valueType:e,minSize:null,maxSize:null,typeName:n.ZodSet,...h(t)});class W extends f{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.ZodParsedType.function)return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.function,received:t.parsedType}),a.INVALID;function r(e,r){return(0,a.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter(e=>!!e),issueData:{code:c.ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return(0,a.makeIssue)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter(e=>!!e),issueData:{code:c.ZodIssueCode.invalid_return_type,returnTypeError:r}})}let i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof $){let e=this;return(0,a.OK)(async function(...t){let o=new c.ZodError([]),a=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(r(t,e)),o}),l=await Reflect.apply(s,this,a);return await e._def.returns._def.type.parseAsync(l,i).catch(e=>{throw o.addIssue(n(l,e)),o})})}{let e=this;return(0,a.OK)(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new c.ZodError([r(t,o.error)]);let a=Reflect.apply(s,this,o.data),l=e._def.returns.safeParse(a,i);if(!l.success)throw new c.ZodError([n(a,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new W({...this._def,args:j.create(e).rest(S.create())})}returns(e){return new W({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new W({args:e||j.create([]).rest(S.create()),returns:t||S.create(),typeName:n.ZodFunction,...h(r)})}}t.ZodFunction=W;class q extends f{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}t.ZodLazy=q,q.create=(e,t)=>new q({getter:e,typeName:n.ZodLazy,...h(t)});class Z extends f{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{received:t.data,code:c.ZodIssueCode.invalid_literal,expected:this._def.value}),a.INVALID}return{status:"valid",value:e.data}}get value(){return this._def.value}}function z(e,t){return new K({values:e,typeName:n.ZodEnum,...h(t)})}t.ZodLiteral=Z,Z.create=(e,t)=>new Z({value:e,typeName:n.ZodLiteral,...h(t)});class K extends f{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return(0,a.addIssueToContext)(t,{expected:l.util.joinValues(r),received:t.parsedType,code:c.ZodIssueCode.invalid_type}),a.INVALID}if(-1===this._def.values.indexOf(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return(0,a.addIssueToContext)(t,{received:t.data,code:c.ZodIssueCode.invalid_enum_value,options:r}),a.INVALID}return(0,a.OK)(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return K.create(e)}exclude(e){return K.create(this.options.filter(t=>!e.includes(t)))}}t.ZodEnum=K,K.create=z;class Q extends f{_parse(e){let t=l.util.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==l.ZodParsedType.string&&r.parsedType!==l.ZodParsedType.number){let e=l.util.objectValues(t);return(0,a.addIssueToContext)(r,{expected:l.util.joinValues(e),received:r.parsedType,code:c.ZodIssueCode.invalid_type}),a.INVALID}if(-1===t.indexOf(e.data)){let e=l.util.objectValues(t);return(0,a.addIssueToContext)(r,{received:r.data,code:c.ZodIssueCode.invalid_enum_value,options:e}),a.INVALID}return(0,a.OK)(e.data)}get enum(){return this._def.values}}t.ZodNativeEnum=Q,Q.create=(e,t)=>new Q({values:e,typeName:n.ZodNativeEnum,...h(t)});class $ extends f{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.ZodParsedType.promise&&!1===t.common.async)return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.promise,received:t.parsedType}),a.INVALID;let r=t.parsedType===l.ZodParsedType.promise?t.data:Promise.resolve(t.data);return(0,a.OK)(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}t.ZodPromise=$,$.create=(e,t)=>new $({type:e,typeName:n.ZodPromise,...h(t)});class X extends f{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===n.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{(0,a.addIssueToContext)(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){let e=n.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(e).then(e=>this._def.schema._parseAsync({data:e,path:r.path,parent:r})):this._def.schema._parseSync({data:e,path:r.path,parent:r})}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){let n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?a.INVALID:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?a.INVALID:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!(0,a.isValid)(e))return e;let o=n.transform(e.value,i);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>(0,a.isValid)(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):e)}l.util.assertNever(n)}}t.ZodEffects=X,t.ZodTransformer=X,X.create=(e,t,r)=>new X({schema:e,typeName:n.ZodEffects,effect:t,...h(r)}),X.createWithPreprocess=(e,t,r)=>new X({schema:t,effect:{type:"preprocess",transform:e},typeName:n.ZodEffects,...h(r)});class Y extends f{_parse(e){return this._getType(e)===l.ZodParsedType.undefined?(0,a.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodOptional=Y,Y.create=(e,t)=>new Y({innerType:e,typeName:n.ZodOptional,...h(t)});class J extends f{_parse(e){return this._getType(e)===l.ZodParsedType.null?(0,a.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}t.ZodNullable=J,J.create=(e,t)=>new J({innerType:e,typeName:n.ZodNullable,...h(t)});class ee extends f{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===l.ZodParsedType.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}t.ZodDefault=ee,ee.create=(e,t)=>new ee({innerType:e,typeName:n.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...h(t)});class et extends f{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,a.isAsync)(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new c.ZodError(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new c.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}t.ZodCatch=et,et.create=(e,t)=>new et({innerType:e,typeName:n.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...h(t)});class er extends f{_parse(e){if(this._getType(e)!==l.ZodParsedType.nan){let t=this._getOrReturnCtx(e);return(0,a.addIssueToContext)(t,{code:c.ZodIssueCode.invalid_type,expected:l.ZodParsedType.nan,received:t.parsedType}),a.INVALID}return{status:"valid",value:e.data}}}t.ZodNaN=er,er.create=e=>new er({typeName:n.ZodNaN,...h(e)}),t.BRAND=Symbol("zod_brand");class en extends f{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}t.ZodBranded=en;class ei extends f{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?a.INVALID:"dirty"===e.status?(t.dirty(),(0,a.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?a.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new ei({in:e,out:t,typeName:n.ZodPipeline})}}t.ZodPipeline=ei;class eo extends f{_parse(e){let t=this._def.innerType._parse(e);return(0,a.isValid)(t)&&(t.value=Object.freeze(t.value)),t}}t.ZodReadonly=eo,eo.create=(e,t)=>new eo({innerType:e,typeName:n.ZodReadonly,...h(t)}),t.custom=(e,t={},r)=>e?k.create().superRefine((n,i)=>{var o,s;if(!e(n)){let e="function"==typeof t?t(n):"string"==typeof t?{message:t}:t,a=null===(s=null!==(o=e.fatal)&&void 0!==o?o:r)||void 0===s||s,l="string"==typeof e?{message:e}:e;i.addIssue({code:"custom",...l,fatal:a})}}):k.create(),t.late={object:M.lazycreate},(i=n=t.ZodFirstPartyTypeKind||(t.ZodFirstPartyTypeKind={})).ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly",t.instanceof=(e,r={message:`Input not instance of ${e.name}`})=>(0,t.custom)(t=>t instanceof e,r);let es=A.create;t.string=es;let ea=_.create;t.number=ea;let el=er.create;t.nan=el;let ec=T.create;t.bigint=ec;let ed=I.create;t.boolean=ed;let eu=x.create;t.date=eu;let eh=R.create;t.symbol=eh;let ef=P.create;t.undefined=ef;let ep=C.create;t.null=ep;let em=k.create;t.any=em;let eg=S.create;t.unknown=eg;let ey=O.create;t.never=ey;let eb=N.create;t.void=eb;let ev=B.create;t.array=ev;let ew=M.create;t.object=ew;let eE=M.strictCreate;t.strictObject=eE;let eA=L.create;t.union=eA;let e_=H.create;t.discriminatedUnion=e_;let eT=F.create;t.intersection=eT;let eI=j.create;t.tuple=eI;let ex=U.create;t.record=ex;let eR=V.create;t.map=eR;let eP=G.create;t.set=eP;let eC=W.create;t.function=eC;let ek=q.create;t.lazy=ek;let eS=Z.create;t.literal=eS;let eO=K.create;t.enum=eO;let eN=Q.create;t.nativeEnum=eN;let eB=$.create;t.promise=eB;let eM=X.create;t.effect=eM,t.transformer=eM;let eL=Y.create;t.optional=eL;let eD=J.create;t.nullable=eD;let eH=X.createWithPreprocess;t.preprocess=eH;let eF=ei.create;t.pipeline=eF,t.ostring=()=>es().optional(),t.onumber=()=>ea().optional(),t.oboolean=()=>ed().optional(),t.coerce={string:e=>A.create({...e,coerce:!0}),number:e=>_.create({...e,coerce:!0}),boolean:e=>I.create({...e,coerce:!0}),bigint:e=>T.create({...e,coerce:!0}),date:e=>x.create({...e,coerce:!0})},t.NEVER=a.INVALID},8864:(e,t)=>{function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length{Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;let n=r(8864),i=r(1014);class o 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){n.default.exists(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;no-a&&(this.process(r,0),a=0);for(let e=a;e>i&o),a=Number(r&o),l=4*!!n,c=4*!n;e.setUint32(t+l,s,n),e.setUint32(t+c,a,n)})(r,o-8,BigInt(8*this.length),s),this.process(r,0);let l=(0,i.createView)(e),c=this.outputLen;if(c%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=c/4,u=this.get();if(d>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;let r=BigInt(0x100000000-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 o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}t.fromBig=i,t.split=o,t.toBig=(e,t)=>BigInt(e>>>0)<>>0),t.add=s;let a={fromBig:i,split:o,toBig:t.toBig,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:(e,t,r)=>e<>>32-r,rotlSL:(e,t,r)=>t<>>32-r,rotlBH:(e,t,r)=>t<>>64-r,rotlBL:(e,t,r)=>e<>>64-r,add:s,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/0x100000000|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/0x100000000|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/0x100000000|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};t.default=a},6962:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},4768:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=void 0;let n=r(8864),i=r(1014);class o extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);let r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?e.create().update(r).digest():r);for(let e=0;enew o(e,t).update(r).digest(),t.hmac.create=(e,t)=>new o(e,t)},134:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;let n=r(8864),i=r(4768),o=r(1014);function s(e,t,r,s){n.default.hash(e);let{c:a,dkLen:l,asyncTick:c}=(0,o.checkOpts)({dkLen:32,asyncTick:10},s);if(n.default.number(a),n.default.number(l),n.default.number(c),a<1)throw Error("PBKDF2: iterations (c) should be >= 1");let d=(0,o.toBytes)(t),u=(0,o.toBytes)(r),h=new Uint8Array(l),f=i.hmac.create(e,d),p=f._cloneInto().update(u);return{c:a,dkLen:l,asyncTick:c,DK:h,PRF:f,PRFSalt:p}}function a(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}t.pbkdf2=function(e,t,r,n){let i;let{c:l,dkLen:c,DK:d,PRF:u,PRFSalt:h}=s(e,t,r,n),f=new Uint8Array(4),p=(0,o.createView)(f),m=new Uint8Array(u.outputLen);for(let e=1,t=0;t{h._cloneInto(i).update(g).digestInto(g);for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.scryptAsync=t.scrypt=void 0;let n=r(8864),i=r(5820),o=r(134),s=r(1014),a=(e,t)=>e<>>32-t;function l(e,t,r,n,i,o){let s=e[t++]^r[n++],l=e[t++]^r[n++],c=e[t++]^r[n++],d=e[t++]^r[n++],u=e[t++]^r[n++],h=e[t++]^r[n++],f=e[t++]^r[n++],p=e[t++]^r[n++],m=e[t++]^r[n++],g=e[t++]^r[n++],y=e[t++]^r[n++],b=e[t++]^r[n++],v=e[t++]^r[n++],w=e[t++]^r[n++],E=e[t++]^r[n++],A=e[t++]^r[n++],_=s,T=l,I=c,x=d,R=u,P=h,C=f,k=p,S=m,O=g,N=y,B=b,M=v,L=w,D=E,H=A;for(let e=0;e<8;e+=2)R^=a(_+M|0,7),S^=a(R+_|0,9),M^=a(S+R|0,13),_^=a(M+S|0,18),O^=a(P+T|0,7),L^=a(O+P|0,9),T^=a(L+O|0,13),P^=a(T+L|0,18),D^=a(N+C|0,7),I^=a(D+N|0,9),C^=a(I+D|0,13),N^=a(C+I|0,18),x^=a(H+B|0,7),k^=a(x+H|0,9),B^=a(k+x|0,13),H^=a(B+k|0,18),T^=a(_+x|0,7),I^=a(T+_|0,9),x^=a(I+T|0,13),_^=a(x+I|0,18),C^=a(P+R|0,7),k^=a(C+P|0,9),R^=a(k+C|0,13),P^=a(R+k|0,18),B^=a(N+O|0,7),S^=a(B+N|0,9),O^=a(S+B|0,13),N^=a(O+S|0,18),M^=a(H+D|0,7),L^=a(M+H|0,9),D^=a(L+M|0,13),H^=a(D+L|0,18);i[o++]=s+_|0,i[o++]=l+T|0,i[o++]=c+I|0,i[o++]=d+x|0,i[o++]=u+R|0,i[o++]=h+P|0,i[o++]=f+C|0,i[o++]=p+k|0,i[o++]=m+S|0,i[o++]=g+O|0,i[o++]=y+N|0,i[o++]=b+B|0,i[o++]=v+M|0,i[o++]=w+L|0,i[o++]=E+D|0,i[o++]=A+H|0}function c(e,t,r,n,i){let o=n+0,s=n+16*i;for(let n=0;n<16;n++)r[s+n]=e[t+16*(2*i-1)+n];for(let n=0;n0&&(s+=16),l(r,o,e,t+=16,r,s)}function d(e,t,r){let{N:a,r:l,p:c,dkLen:d,asyncTick:u,maxmem:h,onProgress:f}=(0,s.checkOpts)({dkLen:32,asyncTick:10,maxmem:0x40000400},r);if(n.default.number(a),n.default.number(l),n.default.number(c),n.default.number(d),n.default.number(u),n.default.number(h),void 0!==f&&"function"!=typeof f)throw Error("progressCb should be function");let p=128*l,m=p/4;if(a<=1||a&a-1||a>=2**(p/8)||a>0x100000000)throw Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(c<0||c>0x1fffffffe0/p)throw Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(d<0||d>0x1fffffffe0)throw Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");let g=p*(a+c);if(g>h)throw Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${h} (maxmem)`);let y=(0,o.pbkdf2)(i.sha256,e,t,{c:1,dkLen:p*c}),b=(0,s.u32)(y),v=(0,s.u32)(new Uint8Array(p*a)),w=(0,s.u32)(new Uint8Array(p)),E=()=>{};if(f){let e=2*a*c,t=Math.max(Math.floor(e/1e4),1),r=0;E=()=>{r++,!f||r%t&&r!==e||f(r/e)}}return{N:a,r:l,p:c,dkLen:d,blockSize32:m,V:v,B32:b,B:y,tmp:w,blockMixCb:E,asyncTick:u}}function u(e,t,r,n,s){let a=(0,o.pbkdf2)(i.sha256,e,r,{c:1,dkLen:t});return r.fill(0),n.fill(0),s.fill(0),a}t.scrypt=function(e,t,r){let{N:n,r:i,p:o,dkLen:s,blockSize32:a,V:l,B32:h,B:f,tmp:p,blockMixCb:m}=d(e,t,r);for(let e=0;e{c(h,r,h,r+=l,i),g()}),c(h,(n-1)*l,f,t,i),g(),await (0,s.asyncLoop)(n,y,e=>{let r=f[t+l-16]%n;for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;let n=r(8398),i=r(1014),o=(e,t,r)=>e&t^e&r^t&r,s=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),a=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),l=new Uint32Array(64);class c extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){var r;for(let r=0;r<16;r++,t+=4)l[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=l[e-15],r=l[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;l[e]=o+l[e-7]+n+l[e-16]|0}let{A:n,B:a,C:c,D:d,E:u,F:h,G:f,H:p}=this;for(let e=0;e<64;e++){let t=p+((0,i.rotr)(u,6)^(0,i.rotr)(u,11)^(0,i.rotr)(u,25))+((r=u)&h^~r&f)+s[e]+l[e]|0,m=((0,i.rotr)(n,2)^(0,i.rotr)(n,13)^(0,i.rotr)(n,22))+o(n,a,c)|0;p=f,f=h,h=u,u=d+t|0,d=c,c=a,a=n,n=t+m|0}n=n+this.A|0,a=a+this.B|0,c=c+this.C|0,d=d+this.D|0,u=u+this.E|0,h=h+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(n,a,c,d,u,h,f,p)}roundClean(){l.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class d extends c{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new c),t.sha224=(0,i.wrapConstructor)(()=>new d)},100:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;let n=r(8864),i=r(9893),o=r(1014),[s,a,l]=[[],[],[]],c=BigInt(0),d=BigInt(1),u=BigInt(2),h=BigInt(7),f=BigInt(256),p=BigInt(113);for(let e=0,t=d,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],s.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let i=c;for(let e=0;e<7;e++)(t=(t<>h)*p)%f)&u&&(i^=d<<(d<r>32?i.default.rotlBH(e,t,r):i.default.rotlSH(e,t,r),b=(e,t,r)=>r>32?i.default.rotlBL(e,t,r):i.default.rotlSL(e,t,r);function v(e,t=24){let 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){let n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=y(o,s,1)^r[n],l=b(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=a[r],o=y(t,i,n),l=b(t,i,n),c=s[r];t=e[c],i=e[c+1],e[c]=o,e[c+1]=l}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]^=m[n],e[1]^=g[n]}r.fill(0)}t.keccakP=v;class w extends o.Hash{constructor(e,t,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,o.u32)(this.state)}keccak(){v(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){n.default.exists(this);let{blockLen:t,state:r}=this,i=(e=(0,o.toBytes)(e)).length;for(let n=0;n=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return n.default.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(n.default.output(e,this),this.finished)throw 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){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new w(t,r,n,o,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=o,e.destroyed=this.destroyed,e}}t.Keccak=w;let E=(e,t,r)=>(0,o.wrapConstructor)(()=>new w(t,e,r));t.sha3_224=E(6,144,28),t.sha3_256=E(6,136,32),t.sha3_384=E(6,104,48),t.sha3_512=E(6,72,64),t.keccak_224=E(1,144,28),t.keccak_256=E(1,136,32),t.keccak_384=E(1,104,48),t.keccak_512=E(1,72,64);let A=(e,t,r)=>(0,o.wrapConstructorWithOpts)((n={})=>new w(t,e,void 0===n.dkLen?r:n.dkLen,!0));t.shake128=A(31,168,16),t.shake256=A(31,136,32)},7769:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;let n=r(8398),i=r(9893),o=r(1014),[s,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))),l=new Uint32Array(80),c=new Uint32Array(80);class d extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:l,El:c,Fh:d,Fl:u,Gh:h,Gl:f,Hh:p,Hl:m}=this;return[e,t,r,n,i,o,s,a,l,c,d,u,h,f,p,m]}set(e,t,r,n,i,o,s,a,l,c,d,u,h,f,p,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|l,this.El=0|c,this.Fh=0|d,this.Fl=0|u,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|m}process(e,t){for(let r=0;r<16;r++,t+=4)l[r]=e.getUint32(t),c[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|l[e-15],r=0|c[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),o=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),s=0|l[e-2],a=0|c[e-2],d=i.default.rotrSH(s,a,19)^i.default.rotrBH(s,a,61)^i.default.shrSH(s,a,6),u=i.default.rotrSL(s,a,19)^i.default.rotrBL(s,a,61)^i.default.shrSL(s,a,6),h=i.default.add4L(o,u,c[e-7],c[e-16]),f=i.default.add4H(h,n,d,l[e-7],l[e-16]);l[e]=0|f,c[e]=0|h}let{Ah:r,Al:n,Bh:o,Bl:d,Ch:u,Cl:h,Dh:f,Dl:p,Eh:m,El:g,Fh:y,Fl:b,Gh:v,Gl:w,Hh:E,Hl:A}=this;for(let e=0;e<80;e++){let t=i.default.rotrSH(m,g,14)^i.default.rotrSH(m,g,18)^i.default.rotrBH(m,g,41),_=i.default.rotrSL(m,g,14)^i.default.rotrSL(m,g,18)^i.default.rotrBL(m,g,41),T=m&y^~m&v,I=g&b^~g&w,x=i.default.add5L(A,_,I,a[e],c[e]),R=i.default.add5H(x,E,t,T,s[e],l[e]),P=0|x,C=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),k=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),S=r&o^r&u^o&u,O=n&d^n&h^d&h;E=0|v,A=0|w,v=0|y,w=0|b,y=0|m,b=0|g,({h:m,l:g}=i.default.add(0|f,0|p,0|R,0|P)),f=0|u,p=0|h,u=0|o,h=0|d,o=0|r,d=0|n;let N=i.default.add3L(P,k,O);r=i.default.add3H(N,R,C,S),n=0|N}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:d}=i.default.add(0|this.Bh,0|this.Bl,0|o,0|d)),({h:u,l:h}=i.default.add(0|this.Ch,0|this.Cl,0|u,0|h)),({h:f,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|f,0|p)),({h:m,l:g}=i.default.add(0|this.Eh,0|this.El,0|m,0|g)),({h:y,l:b}=i.default.add(0|this.Fh,0|this.Fl,0|y,0|b)),({h:v,l:w}=i.default.add(0|this.Gh,0|this.Gl,0|v,0|w)),({h:E,l:A}=i.default.add(0|this.Hh,0|this.Hl,0|E,0|A)),this.set(r,n,o,d,u,h,f,p,m,g,y,b,v,w,E,A)}roundClean(){l.fill(0),c.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)}}t.SHA512=d;class u extends d{constructor(){super(),this.Ah=-0x73c2c838,this.Al=0x19544da2,this.Bh=0x73e19966,this.Bl=-0x76232b2a,this.Ch=0x1dfab7ae,this.Cl=0x32ff9c82,this.Dh=0x679dd514,this.Dl=0x582f9fcf,this.Eh=0xf6d2b69,this.El=0x7bd44da8,this.Fh=0x77e36f73,this.Fl=0x4c48942,this.Gh=0x3f9d85a8,this.Gl=0x6a1d36c8,this.Hh=0x1112e6ad,this.Hl=-0x6e296d5f,this.outputLen=28}}class h extends d{constructor(){super(),this.Ah=0x22312194,this.Al=-0x3d408d4,this.Bh=-0x60aaa05d,this.Bl=-0x37b39b3e,this.Ch=0x2393b86b,this.Cl=0x6f53b151,this.Dh=-0x69c788e7,this.Dl=0x5940eabd,this.Eh=-0x69d7c11e,this.El=-0x5771001d,this.Fh=-0x41a1e1db,this.Fl=0x53863992,this.Gh=0x2b0199fc,this.Gl=0x2c85b8aa,this.Hh=0xeb72ddc,this.Hl=-0x7e3ad35e,this.outputLen=32}}class f extends d{constructor(){super(),this.Ah=-0x344462a3,this.Al=-0x3efa6128,this.Bh=0x629a292a,this.Bl=0x367cd507,this.Ch=-0x6ea6fea6,this.Cl=0x3070dd17,this.Dh=0x152fecd8,this.Dl=-0x8f1a6c7,this.Eh=0x67332667,this.El=-4191439,this.Fh=-0x714bb579,this.Fl=0x68581511,this.Gh=-0x24f3d1f3,this.Gl=0x64f98fa7,this.Hh=0x47b5481d,this.Hl=-0x4105b05c,this.outputLen=48}}t.sha512=(0,o.wrapConstructor)(()=>new d),t.sha512_224=(0,o.wrapConstructor)(()=>new u),t.sha512_256=(0,o.wrapConstructor)(()=>new h),t.sha384=(0,o.wrapConstructor)(()=>new f)},1014:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(6962);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),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.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function o(e){if("string"!=typeof e)throw TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=o(e)),!(e instanceof Uint8Array))throw TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw Error("Uint8Array expected");let t="";for(let r=0;r{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o=0&&ee instanceof Uint8Array))throw Error("Uint8Array list expected");if(1===e.length)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));for(let r=0,n=0;re().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){let 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 Error("crypto.getRandomValues must be defined")}},9303:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;let n=r(6962),i=r(1545),o={web:n.crypto};function s(e,t,r){if(!r.startsWith("aes-"))throw Error(`AES submodule doesn't support mode ${r}`);if(16!==t.length)throw Error("AES: wrong IV length");if(r.startsWith("aes-128")&&16!==e.length||r.startsWith("aes-256")&&32!==e.length)throw Error("AES: wrong key length")}async function a(e,t,r){let n;if(!o.web)throw Error("Browser crypto not available.");if(["aes-128-cbc","aes-256-cbc"].includes(e)&&(n="cbc"),["aes-128-ctr","aes-256-ctr"].includes(e)&&(n="ctr"),!n)throw Error("AES: unsupported mode");return[await o.web.subtle.importKey("raw",t,{name:`AES-${n.toUpperCase()}`,length:8*t.length},!0,["encrypt","decrypt"]),{name:`aes-${n}`,iv:r,counter:r,length:128}]}async function l(e,t,r,n="aes-128-ctr",c=!0){if(s(t,r,n),o.web){let[i,s]=await a(n,t,r),l=new Uint8Array(await o.web.subtle.encrypt(s,i,e));return c||"aes-cbc"!==s.name||e.length%16||(l=l.slice(0,-16)),l}if(o.node){let s=o.node.createCipheriv(n,t,r);return s.setAutoPadding(c),(0,i.concatBytes)(s.update(e),s.final())}throw Error("The environment doesn't have AES module")}t.encrypt=l,t.decrypt=async function(e,t,r,n="aes-128-ctr",c=!0){if(s(t,r,n),o.web){let[s,d]=await a(n,t,r);if(!c&&"aes-cbc"===d.name){let o=await async function(e,t,r,n){let i=e.slice(-16);for(let e=0;e<16;e++)i[e]^=16^r[e];return(await l(i,t,r,n)).slice(0,16)}(e,t,r,n);e=(0,i.concatBytes)(e,o)}let u=new Uint8Array(await o.web.subtle.decrypt(d,s,e));if("aes-cbc"===d.name){let o=await l(u,t,r,n);if(!(0,i.equalsBytes)(o,e))throw Error("AES: wrong padding")}return u}if(o.node){let s=o.node.createDecipheriv(n,t,r);return s.setAutoPadding(c),(0,i.concatBytes)(s.update(e),s.final())}throw Error("The environment doesn't have AES module")}},9204:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.keccak512=t.keccak384=t.keccak256=t.keccak224=void 0;let n=r(100),i=r(1545);t.keccak224=(0,i.wrapHash)(n.keccak_224),t.keccak256=(()=>{let e=(0,i.wrapHash)(n.keccak_256);return e.create=n.keccak_256.create,e})(),t.keccak384=(0,i.wrapHash)(n.keccak_384),t.keccak512=(0,i.wrapHash)(n.keccak_512)},5711:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Sync=t.pbkdf2=void 0;let n=r(134),i=r(5820),o=r(7769),s=r(1545);t.pbkdf2=async function(e,t,r,a,l){if(!["sha256","sha512"].includes(l))throw Error("Only sha256 and sha512 are supported");return(0,s.assertBytes)(e),(0,s.assertBytes)(t),(0,n.pbkdf2Async)("sha256"===l?i.sha256:o.sha512,e,t,{c:r,dkLen:a})},t.pbkdf2Sync=function(e,t,r,a,l){if(!["sha256","sha512"].includes(l))throw Error("Only sha256 and sha512 are supported");return(0,s.assertBytes)(e),(0,s.assertBytes)(t),(0,n.pbkdf2)("sha256"===l?i.sha256:o.sha512,e,t,{c:r,dkLen:a})}},3301:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.scryptSync=t.scrypt=void 0;let n=r(5400),i=r(1545);t.scrypt=async function(e,t,r,o,s,a,l){return(0,i.assertBytes)(e),(0,i.assertBytes)(t),(0,n.scryptAsync)(e,t,{N:r,r:s,p:o,dkLen:a,onProgress:l})},t.scryptSync=function(e,t,r,o,s,a,l){return(0,i.assertBytes)(e),(0,i.assertBytes)(t),(0,n.scrypt)(e,t,{N:r,r:s,p:o,dkLen:a,onProgress:l})}},9164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.secp256k1=void 0;var n=r(8019);Object.defineProperty(t,"secp256k1",{enumerable:!0,get:function(){return n.secp256k1}})},1545:function(e,t,r){e=r.nmd(e);var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.wrapHash=t.equalsBytes=t.hexToBytes=t.bytesToUtf8=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0;let i=n(r(8864)),o=r(1014),s=i.default.bool;t.assertBool=s;let a=i.default.bytes;t.assertBytes=a;var l=r(1014);Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return l.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return l.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return l.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return l.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return l.utf8ToBytes}}),t.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},t.hexToBytes=function(e){let t=e.startsWith("0x")?e.substring(2):e;return(0,o.hexToBytes)(t)},t.equalsBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r(i.default.bytes(t),e(t))},t.crypto=(()=>{let t="object"==typeof self&&"crypto"in self?self.crypto:void 0,r="function"==typeof e.require&&e.require.bind(e);return{node:r&&!t?r("crypto"):void 0,web:t}})()},8525:(e,t)=>{function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length{Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;let r=BigInt(0x100000000-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 o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}t.fromBig=i,t.split=o,t.toBig=(e,t)=>BigInt(e>>>0)<>>0),t.add=s;let a={fromBig:i,split:o,toBig:t.toBig,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:(e,t,r)=>e<>>32-r,rotlSL:(e,t,r)=>t<>>32-r,rotlBH:(e,t,r)=>t<>>64-r,rotlBL:(e,t,r)=>e<>>64-r,add:s,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/0x100000000|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/0x100000000|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/0x100000000|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};t.default=a},4849:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},1251:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;let n=r(8525),i=r(310),o=r(6367),[s,a,l]=[[],[],[]],c=BigInt(0),d=BigInt(1),u=BigInt(2),h=BigInt(7),f=BigInt(256),p=BigInt(113);for(let e=0,t=d,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],s.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let i=c;for(let e=0;e<7;e++)(t=(t<>h)*p)%f)&u&&(i^=d<<(d<r>32?i.default.rotlBH(e,t,r):i.default.rotlSH(e,t,r),b=(e,t,r)=>r>32?i.default.rotlBL(e,t,r):i.default.rotlSL(e,t,r);function v(e,t=24){let 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){let n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=y(o,s,1)^r[n],l=b(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=a[r],o=y(t,i,n),l=b(t,i,n),c=s[r];t=e[c],i=e[c+1],e[c]=o,e[c+1]=l}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]^=m[n],e[1]^=g[n]}r.fill(0)}t.keccakP=v;class w extends o.Hash{constructor(e,t,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,o.u32)(this.state)}keccak(){v(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){n.default.exists(this);let{blockLen:t,state:r}=this,i=(e=(0,o.toBytes)(e)).length;for(let n=0;n=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return n.default.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(n.default.output(e,this),this.finished)throw 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){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new w(t,r,n,o,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=o,e.destroyed=this.destroyed,e}}t.Keccak=w;let E=(e,t,r)=>(0,o.wrapConstructor)(()=>new w(t,e,r));t.sha3_224=E(6,144,28),t.sha3_256=E(6,136,32),t.sha3_384=E(6,104,48),t.sha3_512=E(6,72,64),t.keccak_224=E(1,144,28),t.keccak_256=E(1,136,32),t.keccak_384=E(1,104,48),t.keccak_512=E(1,72,64);let A=(e,t,r)=>(0,o.wrapConstructorWithOpts)((n={})=>new w(t,e,void 0===n.dkLen?r:n.dkLen,!0));t.shake128=A(31,168,16),t.shake256=A(31,136,32)},6367:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(4849);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),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.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function o(e){if("string"!=typeof e)throw TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=o(e)),!(e instanceof Uint8Array))throw TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw Error("Uint8Array expected");let t="";for(let r=0;r{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o=0&&ee instanceof Uint8Array))throw Error("Uint8Array list expected");if(1===e.length)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));for(let r=0,n=0;re().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){let 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 Error("crypto.getRandomValues must be defined")}},9387:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.keccak512=t.keccak384=t.keccak256=t.keccak224=void 0;let n=r(1251),i=r(3096);t.keccak224=(0,i.wrapHash)(n.keccak_224),t.keccak256=(()=>{let e=(0,i.wrapHash)(n.keccak_256);return e.create=n.keccak_256.create,e})(),t.keccak384=(0,i.wrapHash)(n.keccak_384),t.keccak512=(0,i.wrapHash)(n.keccak_512)},6442:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRandomBytes=t.getRandomBytesSync=void 0;let n=r(6367);t.getRandomBytesSync=function(e){return(0,n.randomBytes)(e)},t.getRandomBytes=async function(e){return(0,n.randomBytes)(e)}},3096:function(e,t,r){e=r.nmd(e);var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.wrapHash=t.equalsBytes=t.hexToBytes=t.bytesToUtf8=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0;let i=n(r(8525)),o=r(6367),s=i.default.bool;t.assertBool=s;let a=i.default.bytes;t.assertBytes=a;var l=r(6367);Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return l.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return l.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return l.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return l.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return l.utf8ToBytes}}),t.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},t.hexToBytes=function(e){let t=e.startsWith("0x")?e.substring(2):e;return(0,o.hexToBytes)(t)},t.equalsBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r(i.default.bytes(t),e(t))},t.crypto=(()=>{let t="object"==typeof self&&"crypto"in self?self.crypto:void 0,r="function"==typeof e.require&&e.require.bind(e);return{node:r&&!t?r("crypto"):void 0,web:t}})()},2380:e=>{var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!=typeof n)throw TypeError("The listener must be a function");var a=new i(n,o||e,s),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=Array(o);i{function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length{Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;let r=BigInt(0x100000000-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 o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}t.fromBig=i,t.split=o,t.toBig=(e,t)=>BigInt(e>>>0)<>>0),t.add=s;let a={fromBig:i,split:o,toBig:t.toBig,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:(e,t,r)=>e<>>32-r,rotlSL:(e,t,r)=>t<>>32-r,rotlBH:(e,t,r)=>t<>>64-r,rotlBL:(e,t,r)=>e<>>64-r,add:s,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/0x100000000|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/0x100000000|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/0x100000000|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};t.default=a},326:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},6568:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;let n=r(1380),i=r(633),o=r(3146),[s,a,l]=[[],[],[]],c=BigInt(0),d=BigInt(1),u=BigInt(2),h=BigInt(7),f=BigInt(256),p=BigInt(113);for(let e=0,t=d,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],s.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let i=c;for(let e=0;e<7;e++)(t=(t<>h)*p)%f)&u&&(i^=d<<(d<r>32?i.default.rotlBH(e,t,r):i.default.rotlSH(e,t,r),b=(e,t,r)=>r>32?i.default.rotlBL(e,t,r):i.default.rotlSL(e,t,r);function v(e,t=24){let 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){let n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=y(o,s,1)^r[n],l=b(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=a[r],o=y(t,i,n),l=b(t,i,n),c=s[r];t=e[c],i=e[c+1],e[c]=o,e[c+1]=l}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]^=m[n],e[1]^=g[n]}r.fill(0)}t.keccakP=v;class w extends o.Hash{constructor(e,t,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,o.u32)(this.state)}keccak(){v(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){n.default.exists(this);let{blockLen:t,state:r}=this,i=(e=(0,o.toBytes)(e)).length;for(let n=0;n=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return n.default.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(n.default.output(e,this),this.finished)throw 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){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new w(t,r,n,o,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=o,e.destroyed=this.destroyed,e}}t.Keccak=w;let E=(e,t,r)=>(0,o.wrapConstructor)(()=>new w(t,e,r));t.sha3_224=E(6,144,28),t.sha3_256=E(6,136,32),t.sha3_384=E(6,104,48),t.sha3_512=E(6,72,64),t.keccak_224=E(1,144,28),t.keccak_256=E(1,136,32),t.keccak_384=E(1,104,48),t.keccak_512=E(1,72,64);let A=(e,t,r)=>(0,o.wrapConstructorWithOpts)((n={})=>new w(t,e,void 0===n.dkLen?r:n.dkLen,!0));t.shake128=A(31,168,16),t.shake256=A(31,136,32)},3146:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(326);if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),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.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function o(e){if("string"!=typeof e)throw TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=o(e)),!(e instanceof Uint8Array))throw TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw Error("Uint8Array expected");let t="";for(let r=0;r{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o=0&&ee instanceof Uint8Array))throw Error("Uint8Array list expected");if(1===e.length)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));for(let r=0,n=0;re().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){let 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 Error("crypto.getRandomValues must be defined")}},928:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.keccak512=t.keccak384=t.keccak256=t.keccak224=void 0;let n=r(6568),i=r(3501);t.keccak224=(0,i.wrapHash)(n.keccak_224),t.keccak256=(()=>{let e=(0,i.wrapHash)(n.keccak_256);return e.create=n.keccak_256.create,e})(),t.keccak384=(0,i.wrapHash)(n.keccak_384),t.keccak512=(0,i.wrapHash)(n.keccak_512)},3501:function(e,t,r){e=r.nmd(e);var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.wrapHash=t.equalsBytes=t.hexToBytes=t.bytesToUtf8=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0;let i=n(r(1380)),o=r(3146),s=i.default.bool;t.assertBool=s;let a=i.default.bytes;t.assertBytes=a;var l=r(3146);Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return l.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return l.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return l.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return l.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return l.utf8ToBytes}}),t.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},t.hexToBytes=function(e){let t=e.startsWith("0x")?e.substring(2):e;return(0,o.hexToBytes)(t)},t.equalsBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r(i.default.bytes(t),e(t))},t.crypto=(()=>{let t="object"==typeof self&&"crypto"in self?self.crypto:void 0,r="function"==typeof e.require&&e.require.bind(e);return{node:r&&!t?r("crypto"):void 0,web:t}})()},4457:(e,t)=>{function r(e){var t;let r;return t=function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e>--l&1}let u=0x80000000-1,h=0;for(let e=0;e<31;e++)h=h<<1|d();let f=[],p=0,m=0x80000000;for(;;){let e=Math.floor(((h-p+1)*i-1)/m),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|d(),s=s<<1^0x40000000,a=(0x40000000^a)<<1|0x40000000|1;p=s,m=1+a-s}let g=n-4;return f.map(t=>{switch(t-g){case 3:return g+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return g+256+(e[a++]<<8|e[a++]);case 1:return g+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,o=0,s=0,a=0;i=8&&(n[o++]=a>>(s-=8));return n}(e)),r=0,()=>t[r++]}function n(e,t=0){let r=[];for(;;){let n=e(),i=e();if(!i)break;t+=n;for(let e=0;e{let t=n(e);if(t.length)return t})}function o(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(function(e,t){let r=1+t(),n=t(),i=s(t);return a(i.length,1+e,t).flatMap((e,t)=>{let[o,...s]=e;return Array(i[t]).fill().map((e,t)=>{let i=t*n;return[o+t*r,s.map(e=>e+i)]})})}(r,e))}for(;;){var r,n;let i=e()-1;if(i<0)break;t.push((r=i,a(1+(n=e)(),1+r,n).map(e=>[e[0],e.slice(1)])))}return t.flat()}function s(e){let t=[];for(;;){let r=e(t.length);if(!r)break;t.push(r)}return t}function a(e,t,r){let n=Array(e).fill().map(()=>[]);for(let i=0;i>1:n>>1}return r})(e,r).forEach((e,t)=>n[t].push(e));return n}Object.defineProperty(t,"__esModule",{value:!0});var l=r("AEIRrQh1DccBuQJ+APkBMQDiASoAnADQAHQAngBmANQAaACKAEQAgwBJAHcAOQA9ACoANQAmAGMAHgAvACgAJQAWACwAGQAjAB8ALwAVACgAEQAdAAkAHAARABgAFwA7ACcALAAtADcAEwApABAAHQAfABAAGAAeABsAFwAUBLoF3QEXE7k3ygXaALgArkYBbgCsCAPMAK6GNjY2NjFiAQ0ODBDyAAQHRgbrOAVeBV8APTI5B/a9GAUNz8gAFQPPBeelYALMCjYCjqgCht8/lW+QAsXSAoP5ASbmEADytAFIAjSUCkaWAOoA6QocAB7bwM8TEkSkBCJ+AQQCQBjED/IQBjDwDASIbgwDxAeuBzQAsgBwmO+snIYAYgaaAioG8AAiAEIMmhcCqgLKQiDWCMIwA7gCFAIA9zRyqgCohB8AHgQsAt4dASQAwBnUBQEQIFM+CZ4JjyUiIVbATOqDSQAaABMAHAAVclsAKAAVAE71HN89+gI5X8qc5jUKFyRfVAJfPfMAGgATABwAFXIgY0CeAMPyACIAQAzMFsKqAgHavwViBekC0KYCxLcCClMjpGwUehp0TPwAwhRuAugAEjQ0kBfQmAKBggETIgDEFG4C6AASNAFPUCyYTBEDLgIFMBDecB60Ad5KAHgyEn4COBYoAy4uwD5yAEDoAfwsAM4OqLwBImqIALgMAAwCAIraUAUi3HIeAKgu2AGoBgYGBgYrNAOiAG4BCiA+9Dd7BB8eALEBzgIoAgDmMhJ6OvpQtzOoLjVPBQAGAS4FYAVftr8FcDtkQhlBWEiee5pmZqH/EhoDzA4s+H4qBKpSAlpaAnwisi4BlqqsPGIDTB4EimgQANgCBrJGNioCBzACQGQAcgFoJngAiiQgAJwBUL4ALnAeAbbMAz40KEoEWgF2YAZsAmwA+FAeAzAIDABQSACyAABkAHoAMrwGDvr2IJSGBgAQKAAwALoiTgHYAeIOEjiXf4HvABEAGAA7AEQAPzp3gNrHEGYQYwgFTRBMc0EVEgKzD60L7BEcDNgq0tPfADSwB/IDWgfyA1oDWgfyB/IDWgfyA1oDWgNaA1ocEfAh2scQZg9PBHQFlQWSBN0IiiZQEYgHLwjZVBR0JRxOA0wBAyMsSSM7mjMSJUlME00KCAM2SWyufT8DTjGyVPyQqQPSMlY5cwgFHngSpwAxD3ojNbxOhXpOcacKUk+1tYZJaU5uAsU6rz//CigJmm/Cd1UGRBAeJ6gQ+gw2AbgBPg3wS9sE9AY+BMwfgBkcD9CVnwioLeAM8CbmLqSAXSP4KoYF8Ev3POALUFFrD1wLaAnmOmaBUQMkARAijgrgDTwIcBD2CsxuDegRSAc8A9hJnQCoBwQLFB04FbgmE2KvCww5egb+GvkLkiayEyx6/wXWGiQGUAEsGwIA0i7qhbNaNFwfT2IGBgsoI8oUq1AjDShAunhLGh4HGCWsApRDc0qKUTkeliH5PEANaS4WUX8H+DwIGVILhDyhRq5FERHVPpA9SyJMTC8EOIIsMieOCdIPiAy8fHUBXAkkCbQMdBM0ERo3yAg8BxwwlycnGAgkRphgnQT6ogP2E9QDDgVCCUQHFgO4HDATMRUsBRCBJ9oC9jbYLrYCklaDARoFzg8oH+IQU0fjDuwIngJoA4Yl7gAwFSQAGiKeCEZmAGKP21MILs4IympvI3cDahTqZBF2B5QOWgeqHDYVwhzkcMteDoYLKKayCV4BeAmcAWIE5ggMNV6MoyBEZ1aLWxieIGRBQl3/AjQMaBWiRMCHewKOD24SHgE4AXYHPA0EAnoR8BFuEJgI7oYHNbgz+zooBFIhhiAUCioDUmzRCyom/Az7bAGmEmUDDzRAd/FnrmC5JxgABxwyyEFjIfQLlU/QDJ8axBhFVDEZ5wfCA/Ya9iftQVoGAgOmBhY6UDPxBMALbAiOCUIATA6mGgfaGG0KdIzTATSOAbqcA1qUhgJykgY6Bw4Aag6KBXzoACACqgimAAgA0gNaADwCsAegABwAiEQBQAMqMgEk6AKSA5YINM4BmDIB9iwEHsYMGAD6Om5NAsO0AoBtZqUF4FsCkQJMOAFQKAQIUUpUA7J05ADeAE4GFuJKARiuTc4d5kYB4nIuAMoA/gAIOAcIRAHQAfZwALoBYgs0CaW2uAFQ7CwAhgAYbgHaAowA4AA4AIL0AVYAUAVc/AXWAlJMARQ0Gy5aZAG+AyIBNgEQAHwGzpCozAoiBHAH1gIQHhXkAu8xB7gEAyLiE9BCyAK94VgAMhkKOwqqCqlgXmM2CTR1PVMAER+rPso/UQVUO1Y7WztWO1s7VjtbO1Y7WztWO1sDmsLlwuUKb19IYe4MqQ3XRMs6TBPeYFRgNRPLLboUxBXRJVkZQBq/Jwgl51UMDwct1mYzCC80eBe/AEIpa4NEY4keMwpOHOpTlFT7LR4AtEulM7INrxsYREMFSnXwYi0WEQolAmSEAmJFXlCyAF43IwKh+gJomwJmDAKfhzgeDgJmPgJmKQRxBIIDfxYDfpU5CTl6GjmFOiYmAmwgAjI5OA0CbcoCbbHyjQI2akguAWoA4QDkAE0IB5sMkAEBDsUAELgCdzICdqVCAnlORgJ4vSBf3kWxRvYCfEICessCfQwCfPNIA0iAZicALhhJW0peGBpKzwLRBALQz0sqA4hSA4fpRMiRNQLypF0GAwOxS9FMMCgG0k1PTbICi0ICitvEHgogRmoIugKOOgKOX0OahAKO3AKOX3tRt1M4AA1S11SIApP+ApMPAOwAH1UhVbJV0wksHimYiTLkeGlFPjwCl6IC77VYJKsAXCgClpICln+fAKxZr1oMhFAAPgKWuAKWUVxHXNQCmc4CmWdczV0KHAKcnjnFOqACnBkCn54CnruNACASNC0SAp30Ap6VALhAYTdh8gKe1gKgcQGsAp6iIgKeUahjy2QqKC4CJ7ICJoECoP4CoE/aAqYyAqXRAqgCAIACp/Vof2i0AAZMah9q1AKs5gKssQKtagKtBQJXIAJV3wKx5NoDH1FsmgKywBACsusabONtZm1LYgMl0AK2Xz5CbpMDKUgCuGECuUoYArktenA5cOQCvRwDLbUDMhQCvotyBQMzdAK+HXMlc1ICw84CwwdzhXROOEh04wM8qgADPJ0DPcICxX8CxkoCxhOMAshsVALIRwLJUgLJMQJkoALd1Xh8ZHixeShL0wMYpmcFAmH3GfaVJ3sOXpVevhQCz24Cz28yTlbV9haiAMmwAs92ASztA04Vfk4IAtwqAtuNAtJSA1JfA1NiAQQDVY+AjEIDzhnwY0h4AoLRg5AC2soC2eGEE4RMpz8DhqgAMgNkEYZ0XPwAWALfaALeu3Z6AuIy7RcB8zMqAfSeAfLVigLr9gLpc3wCAur8AurnAPxKAbwC7owC65+WrZcGAu5CA4XjmHxw43GkAvMGAGwDjhmZlgL3FgORcQOSigL3mwL53AL4aZofmq6+OpshA52GAv79AR4APJ8fAJ+2AwWQA6ZtA6bcANTIAwZtoYuiCAwDDEwBIAEiB3AGZLxqCAC+BG7CFI4ethAAGng8ACYDNrIDxAwQA4yCAWYqJACM8gAkAOamCqKUCLoGIqbIBQCuBRjCBfAkREUEFn8Fbz5FRzJCKEK7X3gYX8MAlswFOQCQUyCbwDstYDkYutYONhjNGJDJ/QVeBV8FXgVfBWoFXwVeBV8FXgVfBV4FXwVeBV9NHAjejG4JCQkKa17wMgTQA7gGNsLCAMIErsIA7kcwFrkFTT5wPndCRkK9X3w+X+8AWBgzsgCNBcxyzAOm7kaBRC0qCzIdLj08fnTfccH4GckscAFy13U3HgVmBXHJyMm/CNZQYgcHBwqDXoSSxQA6P4gAChbYBuy0KgwAjMoSAwgUAOVsJEQrJlFCuELDSD8qXy5gPS4/KgnIRAUKSz9KPn8+iD53PngCkELDUElCX9JVVnFUETNyWzYCcQASdSZf5zpBIgluogppKjJDJC1CskLDMswIzANf0BUmNRAPEAMGAQYpfqTfcUE0UR7JssmzCWzI0tMKZ0FmD+wQqhgAk5QkTEIsG7BtQM4/Cjo/Sj53QkYcDhEkU05zYjM0Wui8GQqE9CQyQkYcZA9REBU6W0pJPgs7SpwzCogiNEJGG/wPWikqHzc4BwyPaPBlCnhk0GASYDQqdQZKYCBACSIlYLoNCXIXbFVgVBgIBQZk7mAcYJxghGC6YFJgmG8WHga8FdxcsLxhC0MdsgHCMtTICSYcByMKJQGAAnMBNjecWYcCAZEKv04hAOsqdJUR0RQErU3xAaICjqNWBUdmAP4ARBEHOx1egRKsEysmwbZOAFYTOwMAHBO+NVsC2RJLbBEiAN9VBnwEESVhADgAvQKhLgsWdrIgAWIBjQoDA+D0FgaxBlEGwAAky1ywYRC7aBOQCy1GDsIBwgEpCU4DYQUvLy8nJSYoMxktDSgTlABbAnVel1CcCHUmBA94TgHadRbVWCcgsLdN8QcYBVNmAP4ARBEHgQYNK3MRjhKsPzc0zrZdFBIAZsMSAGpKblAoIiLGADgAvQKhLi1CFdUClxiCAVDCWM90eY7epaIO/KAVRBvzEuASDQ8iAwHOCUEQmgwXMhM9EgBCALrVAQkAqwDoAJuRNgAbAGIbzTVzfTEUyAIXCUIrStroIyUSG4QCggTIEbHxcwA+QDQOrT8u1agjB8IQABBBLtUYIAB9suEjD8IhThzUqHclAUQqZiMC8qAPBFPz6x9sDMMNAQhDCkUABccLRAJSDcIIww1DLtWoMQrDCUMPkhroBCIOwgyYCCILwhZCAKcQwgsFGKd74wA7cgtCDEMAAq0JwwUi1/UMBQ110QaCAAfCEmIYEsMBCADxCAAAexViDRbSG/x2F8IYQgAuwgLyqMIAHsICXCcxhgABwgAC6hVDFcIr8qPCz6hCCgKlJ1IAAmIA5+QZwqViFb/LAPsaggioBRH/dwDfwqfCGOIBGsKjknl5BwKpoooAEsINGxIAA5oAbcINAAvCp0IIGkICwQionNEPAgfHqUIFAOGCL71txQNPAAPyABXCAAcCAAnCAGmSABrCAA7CCRjCjnAWAgABYgAOcgAuUiUABsIAF8IIKAANUQC6wi0AA8IADqIq8gCyYQAcIgAbwgAB8gqoAAXNCxwV4gAHogBCwgEJAGnCAAuCAB3CAAjCCagABdEAbqYZ3ACYCCgABdEAAUIAB+IAHaIIKAAGoQAJggAbMgBtIgDmwocACGIACEIAFMIDAGkCCSgABtEA45IACUILqA7L+2YAB0IAbqNATwBOAArCCwADQgAJtAM+AAciABmCAAISpwIACiIACkIACgKn8gbCAAkiAAMSABBCBwAUQgARcgAPkgAN8gANwgAZEg0WIgAVQgBuoha6AcIAwQATQgBpMhEA4VIAAkIABFkAF4IFIgAG1wAYwgQlAYIvWQBATAC2DwcUDHkALzF3AasMCGUCcyoTBgQQDnZSc2YxkCYFhxsFaTQ9A6gKuwYI3wAdAwIKdQF9eU5ZGygDVgIcRQEzBgp6TcSCWYFHADAAOAgAAgAAAFoR4gCClzMBMgB97BQYOU0IUQBeDAAIVwEOkdMAf0IEJ6wAYQDdHACcbz4mkgDUcrgA1tsBHQ/JfHoiH10kENgBj5eyKVpaVE8ZQ8mQAAAAhiM+RzAy5xieVgB5ATAsNylJIBYDN1wE/sz1AFJs4wBxAngCRhGBOs54NTXcAgEMFxkmCxsOsrMAAAMCBAICABnRAgAqAQAFBQUFBQUEBAQEBAQDBAUGBwgDBAQEBAMBASEAigCNAJI8AOcAuADZAKFDAL8ArwCqAKUA6wCjANcAoADkAQUBAADEAH4AXwDPANEBAADbAO8AjQCmAS4A5wDcANkKAAgOMTrZ2dnZu8Xh0tXTSDccAU8BWTRMAVcBZgFlAVgBSVBISm0SAVAaDA8KOT0SDQAmEyosLjE9Pz9CQkJDRBNFBSNWVlZWWFhXWC5ZWlxbWyJiZmZlZ2Ypa211dHd3d3d3d3l5eXl5eXl5eXl5e3t8e3phAEPxAEgAmQB3ADEAZfcAjQBWAFYANgJz7gCKAAT39wBjAJLxAJ4ATgBhAGP+/q8AhACEAGgAVQCwACMAtQCCAj0CQAD7AOYA/QD9AOcA/gDoAOgA5wDlAC4CeAFQAT8BPQFTAT0BPQE9ATgBNwE3ATcBGwFXFgAwDwcAAFIeER0KHB0VAI0AlQClAFAAaR8CMAB1AG4AlgMSAyQxAx5IRU4wAJACTgDGAlYCoQC/ApMCkwKTApMCkwKTAogCkwKTApMCkwKTApMCkgKSApUCnQKUApMCkwKRApECkQKQAnIB0QKUApoCkwKTApIbfhACAPsKA5oCXgI3HAFRFToC3RYPMBgBSzwYUpYBeKlBAWZeAQIDPEwBAwCWMB4flnEAMGcAcAA1AJADm8yS8LWLYQzBMhXJARgIpNx7MQsEKmEBuQDkhYeGhYeFiImJhYqNi4WMj42HjomPiZCFkYWShZORlIWVhZaJl4WYhZmFmoWbipyPnYmehQCJK6cAigRCBD8EQQREBEIESARFBEAERgRIBEcEQwRFBEgAqgOOANBYANYCEwD9YQD9ASAA/QD7APsA/AD72wOLKmzFAP0A+wD7APwA+yMAkGEA/QCQASAA/QCQAvMA/QCQ2wOLKmzFIwD+YQEgAP0A/QD7APsA/AD7AP4A+wD7APwA+9sDiypsxSMAkGEBIAD9AJAA/QCQAvMA/QCQ2wOLKmzFIwJKAT0CUQFAAlLIA6UC8wOl2wOLKmzFIwCQYQEgA6UAkAOlAJAC8wOlAJDbA4sqbMUjBDcAkAQ4AJANlDh0JwEzAJAHRXUKKgEEAM1hCQBbYQAFGjkJAJAJRN8AUAkAkAkAnW0/6mOd3brkH5dB9mNQ/eNThoJ1CP8EZzy46pMulzRpOAZDJDXL2yXaVtAh1MxM82zfnsL/FXSaOaxJlgv345IW0Dfon3fzkx0WByY6wfCroENsWq/bORcfBvtlWbGzP5ju+gqE1DjyFssbkkSeqLAdrCkLOfItA7XNe1PctDPFKoNd/aZ6IQq6JTB6IrDBZ5/nJIbTHMeaaIWRoDvc42ORs9KtvcQWZd+Nv1D2C/hrzaOrFUjpItLWRI4x3GmzQqZbVH5LoCEJpk3hzt1pmM7bPitwOPG8gTKLVFszSrDZyLmfq8LkwkSUhIQlN4nFJUEhU2N7NBTOGk4Y2q9A2M7ps8jcevOKfycp9u3DyCe9hCt7i5HV8U5pm5LnVnKnyzbIyAN/LU4aqT3JK+e9JsdusAsUCgAuCnc4IwbgPBg4EPGOv5gR8D+96c8fLb09f7L6ON2k+Zxe/Y0AYoZIZ8yuu1At7f70iuSFoFmyPpwDU/4lQ+mHkFmq/CwtE7A979KNdD8zaHSx4HoxWsM8vl+2brNxN0QtIUvOfNGAYyv1R5DaM1JAR0C+Ugp6/cNq4pUDyDPKJjFeP4/L1TBoOJak3PVlmDCi/1oF8k1mnzTCz15BdAvmFjQrjide74m2NW1NG/qRrzhbNwwejlhnPfRn4mIfYmXzj5Fbu3C2TUpnYg+djp65dxZJ8XhwUqJ8JYrrR4WtrHKdKjz0i77K+QitukOAZSfFIwvBr1GKYpSukYTqF4gNtgaNDqh78ZDH4Qerglo3VpTLT0wOglaX6bDNhfs04jHVcMfCHwIb+y5bAaBvh2RARFYEjxjr1xTfU09JEjdY1vfcPrPVmnBBSDPj9TcZ1V/Dz8fvy0WLWZM0JPbRL0hLSPeVoC8hgQIGaeE6AYVZnnqm62/wt00pDl5Nw/nDo+bF1tC4qo5DryXVn8ffL3kuT51e+VcBTGiibvP+vqX50dppfxyNORSr48S5WXV8fzcsgjRQH6zjl+nuUYFVloiEnZOPDpHD/7ILh3JuFCdvAi2ANXYXjTDA5Up6YLihbc7d+dBlI9+mdgr8m8+3/Dp26W/Jssn7b9/pOEP4i+/9TsPI9m2NfNKwEI35mqKV+HpZ+W69Y8sM/sIA9Ltvhd+evQTUUfSkYxki28/CBT0cT96HrlrSrE+V9RzhskX0CsDsCfHffBVybkxmHOFOgaUurWNQ2AcZbi1WjkZzYArWZBHFd1SYwtqQ0DIZt7OV40ewQxCr/LgxAc8dLJeAJFseWJq9XiOp21hLv/HhsFbYbg3zCR8JmonZjhuKYrS/KJc30vnOL2CM+GfogNWug2DstZPzauCNeeD8zlP8wxPyfLHYQB/J+wQE3aDpXH/5tdIQpLn3JXNJYZFiXInGB7FqxRxHYJ/re/lHprE5sngUMm11uOIA3bbtkk06I8DYxuwPD+e4sAeNfor0DkWmiCQFiNptkmiD2xGO1kIKGr/Tuu4bHe6z2NaS7Ih0c+Gpv+QbLY9ea122BXNSitM41sxUSlnWl+uJBIFoLqt66v/VfGIQos2lzhOOLDuScVxcyrqH3/FI4vaYB0b8gFHLXtxyX/9JpUCYNwlLZ1v5CeB99l0F795R5wl5UHRq1OYyKqsoIY07wJz2CT0TOf5/JRBPtJIIk5pOJ60SHayS9kMSKbI3fLLYztsY3B4MlSyoEfc9gL4yJVrPo+OGGunCK4p15UbCArJP/PQgUWDW4l+2P/tCqRRy2flIZL/nVeY/vyAfILUM5qEGfcFXXXrAit7skwDEFnD7mL1ATtyrz7HcodhzP7gShFhazIPm7X0+mTCeSWfrOr5WcvJfip19JRRLfXjuQpQjcNCuXo8kqkxQ68ukJQoxlnfjevc0WcKnGpUvyY54eJTS1IRWDqfHANukJLw56ts5yS6Nea7IrL6/78aKmZsch4Q694ujxgx5+0PhlGpzWimajpvkBOOUQlHLkJorzqu4e768L9nJtZWYturb7dsBxjzlNhd/gZcBuRgIUSdgZjg7Rx+f/zLcs4mAa3qDbJNUQVNbSg+dm0L3KH1uhesTPaErVYjZ8Isvfr+zfiX3DT0PlaOv+hdGvLUIlKSEcYHPMs0NtTGzyqMe74yciNFdAVZVzol/XtLsEqivKqfW7zWTCNCvZkPnnBlMv3UHW5RNNEJfuyR3MvYH/9E6gcts5GAwKIgCaBQ+V2Eh9O0IJkxFksPI1V9obqDKCpmPM55mLd+VQgRqgD+9XvsUxjbh/AXXPxOpc0FXFyJzc85aa1VQZa90LAWR4oinrBaOBr8DymCpFbdXMTn7Cv18S0hMR7T/o5VkRqN1g1/dvaDdZsRArO3bopkfee4efLF+hyVdcX4u3aNGTkWvLRafW+sXPktA1lla4UkSB7uJIULfxy/RAflk2miyw9xq9uVGgCNzqCv4iX+AUchfMkZdEgRZ9TZ+1CPTH2jXjMXjFl/+bEPzSjM7zPKKWhyZUgQG1lpp+DNz+Zz+85kD59q99U5R4B3vuI9WenCWqroy2U2Ruq6I+di5N/v9SmYnqJ5H1HLWCbIg6iVrn3s2gFBVFhrc1zzNqoFe275K3Jy1T0Mc5yeE1iRwO2b1L/j/S8jyvGDz6B3NMFEHErGHMM2+oJ5LobazyWEitdgMjQnsd0cjYrCqRpx8idpfwRq6hz/LleX6obpuJh/AGIu4sxD35hwkIEr5ShH8xro7tTDYK1GPHGylK6rp7NCG0lMr7YqwziMUBwXv0zPW667f3/IRLJRD7mkuwUP6mpkxyVjNlcBiAX12r//+WTuzWxsue7bsjRp7xFjpR2tRLqGHLvjYt3TpeybR82K61iLn+pOSWDfUv/HU8ecBtML+Gbz0v9vmlxSgZeBBzbGeP1KSqsH14ZM2kibgDhbS21hIALSOYFCE9LY+2CNvtzT2QuSJMiKP3zwvvs+/JkDwTg0jHVE0XH//U0nu5HKQtCL2KGDQYUgT7qIMVN/OoWqEz1oeG4wG7InZg47NE7rfHB2i7rkpYCUzaPfVtDYgTEPNpa8gXHI2Pp8A6YB8OYHkXDZMMcOL3rJD0Hxk+mRlsSJ12/7T52IcFst5zRc7uDJtQTXBdm9GvsvyXcBbMfKXWqsDSeEnFyPUXZGTafti4a0it8SN1qXxzBmzj+gVZ/FojNy+x73AuuqtJ/oaMZF6m5kbW6ItpfnUT/BrQunS+gLjTTUz0d8jTMpAfFQ40RQi9uM5qdFYzqk85hqSH1zsPOhiO5CN+hNZvL/RIs7m7LyLDuV80ZtyHHqVEngTVPBctHQhmcPjM30m1veDmHCXEpjybWAbgj3TqLUPNazzdHgxYmNuT7trWFcGOi7iTeL5YeK2yp2H98yoLN+skqhffZI/5n/ivceo44wJRY8bzC6DGwdgkMOulYhzW5m6OKyK2Mg+E3YE19L8ngE08TdAuNu0mIzd6kw0i03zzm4oqfVSZjZyxXnBhvt0v89EmnArya/UvHQrdQxBDAJagK2y+OqgBqzQ4FnUeiKfb7HFoUvFSknWhwq58TpBlVRZ0B0A7QWz7X4GLHcbdh5kFI/PKJ91OEh/kmnMEdh+Z23myFH8sXjR/KaHttrpz80N+bl0HM17RX48UjUWslrYHYW7oiHVgcGqTBoTrqK4JYwTTArFO1/APJ8DnEYf+wD92Dw15a9wrPxyJA88yYcv9RypzXLKAWmMuE0KAtIGjfKx1GbRQIq0AkttuRpBO7p4SGrTZuAOat3hTxXEcIKh3HgC1d88K7bz1+Jsi+y7tL/7zc0ZxCBB3hSxvP90GkUp1Lm2wuESafZyFy4Opir+o3gMWtDSuLF3LRHXTUGkKQtvARnwam8BuKv8Q2fHH/cEwPCQd3dhzgri8eTezRsQoGz6ha+S4E7ZzDB/LXwl04vA70NeVsf5rmv1TLvcQSNIBk3U6Qh6Bm+0905B91hopTLnTJRWZkUmbckEw0woG81azyw6LZaBL5Qx2HPvd3LHGLpN6mPZlto50NwW2zFOkgoPKV1gr142teD9aok2HNkPMepl3NIi78ShnAlJCzjZplteUoqz0+iUEOym1LZGGFHMBkc6/5f+sRCCFZZW6KrEby64o/ZfefQAPP6b5ko2fuujIv7uonIKXN6XiJsZmcOeGxteQ+b/ope3Z1HFeXYoW1AJrU/OiCpsyQP1Pr1BdQKFzS0oYnLCAweSnIh7qMFMRBMY7BcnJ5oskUbbRNiosqMzCYUAZPbo8tjCCsCBm5SoGcTHBMXcE+yQpl/OfBkcTw3oa4X7V+ohEh/Zkcv0cqc8sY40IsOW6lLiIrvYND/exZbRlOMgaHvb/QQKaY0k6Aamee2o3LVARCbIP4RoSd7u3CXkG+Iz6iFLfsN38F9xU4n3ueeVgiRs3jw70SMWu1QzDdiLsKtU1qvaLhv7dUbnLimdqYG+pa2aRZ8A6Q9JSr3yTs1MiAvfFHPQJTiqpI/hVUMmL6gPj6eL7lH0IkLCNcaogBA0TGfO0wO6ddf8Fju0L3YbRrWe8J3IewsNBCbpC2b6etQRJnSGLuWDiFoBez9hJHw6+bMQQGQS8YV/kzQ5AFHEqPaMgOjyR5zaHtlOBI4mjo8gdNItHUHQ7Bzq/E/xV1B+L0uoRcLIEj4hcv0yWQTwWLHzoFrvEZPygABpc4rnVjhfcBw5wOvaVVtgiG5qjklrTY1ZaXHkasyVYBd+lgo6zEHMumfK8XR2eD0cVn5w8l1uxGz2ACwtFob/CTV/TUx1kCKp+QROanLrNBiSPTxAf1eOFE+JifgAJ+pyrFqS/0wKlPWUVKlB2Bhu1Ggx2cvfdiR49VIsgBNnE75pf5lpFaQuz8+VPreUd/HLlW8kDSr25AnETsVRrOycLBPYD9/j/7Z0KKdOjtrM71AT+VsjD3D97aUDP5WrHp1DWghsk/lS/hp2VMwo0eqoEerLL/4/SlmyjStwWVDqF6jHC89niCwr1tMSe8GxeC9wjzMKmE7ZtdHOWqqc1OoTI24eVQc++crbyxSU4TxiB+vWoaAUpYQxZ06KKIPq6EvN/rN4DZ0/tQWYVqZ3FTIftPBfIuOWX3PonIKTUArpSvfmQRpkWD00wc3AQS98i4ZYaUbI+DGv90tuEKRjb2ocfdddC21YGUATYQmzelz7JqWBAQqKrWYdWEJlfPeRFZHtUm2MaISZsoOvURowxJKveGRegmBiKZ3d1cMFioJL33RoIKT0eDeK8FH/ybAhZU5TQIsWYmjyeT7EOLL5xZuRPf4qRIo6bbLtFOV6SX60fR8Smys/u1D5DjkmHJyr/woVAvBP2dxGo9gH1LgIm8XlFF1KSYvfj+0w7aTEfoFpcO+Jv3Ssbv8wwkED5JEC+jdln2dzToPNRtWiPbRb8f8G4aZX1j/2Vdbu7jM3gAVD5BKR+yJaOwLtwJodwjWu5di47tnNs9ahpnCUzVMObQfbTqMNs64MGANlgyihKjhwZ6p1Jsnro0/SfkOk6wx+HgUB6Mz9cUiF7KrJkhxnOVjCCcqPZglIojIRoDtkd2AkLNZC88GdP2qZV/1N6PBAe+fpgWZ36oHnewQ8CHdXcxbwQVjOn8U3qD9+e7FzWpg135vgdEMZ9fH5agDnNzdjKFZQ4tDsJs/S6Lk8FqjFJpHMjaRU6FI/DBDM0g+RRkxNoUvm14JAn5dgd6aVHt1aMkSXiJVenbm2FfrIEaFKHtm1erv1BJ5056ULL8AMGLmHav4yxg6F6n5oBq7bdP6zEr6f+QTDJ/KE1XfoG24JvVk2GL7Fb+me27otVFnq1e/2wEuqv6X+2zLQuJQszy5YJi/M5888fMy34L6z8ykD5sCHgzliAoAtEeoaFmnPT63kOYrZWspxYzqQBu/QKNyQ8e4QwKJUCVazmIUp6/zpLA3bWH2ch7QZN0rzWGxMRl3K1osWeETxL95TZSG/atM8LB9B92/71+g9UGWDPfD+lu/KdOQ85rocuHe91/gHA/iprG9PZ2juX49kaRxZ+1/sB3Ck35eWYBFsmCl0wC4QZWX5c5QMuSAEz1CJj0JWArSReV4D/vrgLw+EyhBB6aA4+B34PdlDaTLpm9q9Pkl+bzVWrSO+7uVrIECzsvk8RcmfmNSJretRcoI7ZcIfAqwciU9nJ8O4u1EgkcMOzC/MM2l6OYZRrGcqXCitp4LPXruVPzeD402JGV9grZyz9wJolMLC/YCcWs9CjiWv+DNRLaoSgD5M8T4PzmG8cXYM4jPo5SG1wY3QK/4wzVPrc33wI+AcGI//yXgvyBjocGrl768DMaYCGglwIit4r6t6ulwhwHJ4KeV3VHjspXXG4DIlDR2HNFvPaqkBViIvr433qZPuUINp6oi1LyVVC+EE1j6+wab8uPMeAo6e9uWYequvZynhnYazrvrDQJVkK3KZRoSR5BHi6vOC+AVCujMiQ1GVzGDZ4RFv8jFm7z5CU0iPH2JeXqUzqaKKP4P7osPkcIL99Y7fP3l+TzeFXO2kSpLIJW51oEY8DRIhqexGnxj0nmtGOseStuViIE2mJge45LENf77xjuI7egRNpzthNiajnuqikg0aQS1JqlIZf+hwSUlOp8BEQ0y3xiTOJkohBP3eyYiPDlZpFY88EWOpp4+hC/tQdhrQ56h2VJ2XA6vhPAbj+wH6iA2XYuTvRV25N8wNPQuA0Vzzem2ADZPFK2vr8l0I3GTV3fUN4S6FFYygW2Pu98f+lsgPf67rwVCbgMFAACW3P10GbxnK3SNuNK+VlPRiL7U3dK1o3spH/MFfDkgXuXjxDTxJrYctqHdwUg4rhUCNA13lGjuhJDatpFb/mExsBWS46aLFtROqVm8xQNPXK6A2rRfazJSWpIyh+FMmorXPXYnHQ7YLOmD4B5QTI8rzp7OomiarnaFs5syYjQ0ucc7g1/JzT446IFlDtpUL7DP9bLRCLJryUvi5R71/qX7ycqRSwunQ7+tfJz44Na3aJNszaMEZ/BV4iOGopabYdmvAPe+kIdGCNq5Q8fg8Ld0VNNXV0ZiiGej7zSA+pexy6wKC5k4rZa0k+qaN8bKq3oJWMQCSGaK7PrwMvA8t8BZTzjDqXcFTAIeRtl0SdlGSuAziVXItFcgAkeqwuNsbsrUZFcU6KUZLmvG415kHa0AwMFW2cNSUvPR0U9iCPh0nyslT92B5slYXiDWeSXvxHXItvjI8z5KCIVTIHqGZsbDBTr7WdHzcUAI1ipR86H3o0p2wPhfp7xg9oWOxWIK4a5BWdaV9OAPc0XuvlbwitCVtZDzZxGhIOl77ZgrRYR7LZQFE+Ih23hW3gI914ekkjgbKCi2bsqSAvij6GGj5p+k6evQtJp3qVh9vg+jiJvFCGcKBCITMWpqHZNKfE6IT0dKntS0rhu0DB5D9qIS0/RboNLsx2DlRMlx1QIBeBpHJNKdCL9uWM9eS7RJXKNOpraULtutuJYOl0apdE4LxfsyRSZb6fJkd51SHrI7lLB4vEg4fifJ1dqcWSeY4DgcyjrUcymK+gd3o+qj+3gHKWlLVdMUr3IeF8aClYBq+eeCV9Y7n1Ye8yL7rEvxY7jAlLwucKQ51pu59N8we8XwrbXPChBHXP4LnD3kDwQ85w1DKghtwvpO609fZOrPq8Q7GOOAjHhfR5VqvpoFne8oMHbCrWb1L0IdATo+h1PFeLLI8wc+FEyftLvskCdOtxKfAx3IEJXzBfWTKq5viKP/uu99dxnEpoNJhRtjSZGwOTWr7Ys44++P58O+nkYxd1Gcqm8G3Gh7AHSCxiPNyJWijI/lECrKrAXgBqkRShvdkd7IfoqUlziFDiglx+jdHnmRVmGnk3p/3n78M/HkzFUGZOS07cPnPn9jAnBWl4qDrB1ECf9idIKOdkJTKcZ690nuLW2yDsqwNpgrlT+wx2gv+Engha74lfVqbwqS15FRwuFDfq3bVCZcPy78TL2pH/DOdHeL9MFAtyybQNwHaO781rnJZAhR4M+AYWoSoa0EjQ99xivreM+FKwd7Jp/FC2vvvcq1z3RnRau/BM5KGkBPBSUBOzTNdfaJS/PWTDb1jRSgn2MuY3pVZbY9peHBVI3Ce/u70hg4f7MCVeAjYJfzTkDVLuB6jyjZs5Kko3u39ozgLK4LuwSbUrNIU5cl6Bs3De62AE084XRsm64Gs5W1ofxsWIZ9cYl8PNa5zQHl9ls5aiIKN0rHIIzBnLr03Kle2qq+n/gLDAzvF89vdZCvUFEHRoi9n33O3i49UWyeHP+ZAeRf+psM867nfqON092zE4Pj7AbLtvIUFJFr1y9Le0CL2flc7LUqbgGzOw4/q3vA/cJO5JeI8S+8bc1Y7pqYSzoEWSFn5G7EoPHTGHPMU6SeLKEeli+i8dHY3lWxSrIOU2y0TNo1SeRYewhVx05OXeVDf0xhHNckqp0arRk+bgToeSaHbVZ5nj3IH3m2oayt3sXY78qSPcDpc/5C7VXDRj6bROvvBG5JCsKl/yeMPAUn1flMsmr/FaFdb7gVUXnhLa+/Ilj87PpCC6rILQ6wkIP1ywEg0PztSEzbsJoRwQzDaxkiTN27YDnsy/YKfe6jKcqZWs64skzUAHIt+nXxju0dUVtbCSDAUXYw78Yd4bJKuYU8gbzLzgL4XIUC2HcPIVCUYvM7cybOBFVBdeGR4cOVB7QbGnohTRpiPrGqi1a8QXFBYqENawROuR43OG8dl+Jx4TpwAoi2kkPXW7b/ARSs4DO/z4H6oTIUpN3+/K6Iuc49C4/Uf1NxQTEE91VP8RnLKTpxjywMe2VxM1l4YGXSFY80HUAKIdqczBnnLMPklFV8mrr5hFDypn5TAT00ruU6AjDPNvncoVzX4ac6wAzTwrNH7oz1XLH1wzjQs5k7hcNLbznXQGB7M+rXxKtZXPrz1Ar+OxYGDkJvElknZsHD/IcxRd7ujmmLYpDDbverynroCnSKVQWEGjHL57PaI/WokvhYRpPMk4ni2EUhjDuIF+IU2R0fs40i+66bw8sz8OzyC2eFAxxicd2n5Juta2eWa9KtObD7xLmPvtK+8cjQt+NLjcZCTt+Ss9p1od0bklVgaIV1qJbWxUOr6iUzLDzFefYxAtyRcBr53IaDB25n60KQdhroQWMUpuWSUpELSFxiu4vgQeRoEZe78/ua3TlrszB8sLVZoecnV9YMYz+HkZA/pLqbFhzurB52Wl/WEM6sVk4q04OnzWZFi76JkcGgeeUyYUIwhCDMdIfTUdD4wQpYm3LBw0sp33CVK2q305jeyzgGnBzSMXjesm4XjcEhhrjPSLtwqqoaFCqD5DlHYhoTVafWtBUQXoNfDk19IFxq8sImCcqgMhOToIZUO2530aasY908dMX2nTMFjgv+lapdI8k/e0a7pFw6X3Tgf0m99bbCpOzVgRu2Dw/13CehVfFj+8BeKP6SZV4g/qiX42NWP568PzMajFm2ANmKtHjEIAIc2hc1iecBR9elGP4LmAQwAVmZT8kWc7JSY0ag583ch/Z16krGrjn2YdIaa22egy4/niU6m0WAG3K/yP65cfL//CP+JzcnoLHQFb/KJQeBrEbR1/IKo+YOFXWIQ8ghNxYdMwa49NeXzFqFOIXTmk3w/v5KneS8sGHiPGACh0DE9a1uLAochB79g3IqYObhlswemMucZnAE7dBkp5OAfToa5gHFbIPcec0fVWEOOLftQXsuffyv3wo1LWDDm+SyNMWgSEWtjMyYkjLjTkUtmj7DQlfbpHf38lDvoEN9d2ALxnWCjph4jvfEIRbHvltKbvE2BiYlz45mnJPeFrwZcBny3k0/pyXNrSbEIWvvZw14Y0Fqy4tba1Fu0yNNYaf47jfnz7VCCxKsrJz5oz3F8jXUdQqFu+gDq6EzvKDipXf/3NmcsCC74VB3OgHPgN7W9cU54pjGFDMfifl3m5Vhy21uk1U2nYCrddrifkpwGLYmLSSQAAjC6M3yB1fc6KHpgDnMXh2bYX2ns+Qma+DBgyCkZ0TqZK8Mp2Sryx7HdMM74X9hrwYhQbwlK+zgATAXRzQyS+hK4OTnP17/cyJ2WzY6DChYWGJYXGCnEdMswF5VTYQdSyTpdLXYuh+x2Qr7DR3H2x+YdP0qsLAzYJIWKwrrKkpBgWCmgNCn5t+QbWqf/LoLuvjgDFLtMoxNK5axIA9kammelvwh5ZI52ktrEm/OVEESPQPZGHAIhP7oWDBnGnuzG45XOTpZWsxwNO4UiyxH8riTvQq4JVq5GwX3yqVCbSR0ef/gVYDgiYaiD2EAAxuEPKyXTp/HhL96eVTpaDqFEoV2x1PP/UMcs/XqeGc1gZQG1ot6YxaIEWHanYavH9YdLFjlyU5yrYALVg/sxBjT39oD+BIXvf4LTbvvvpX3srxckEX1XAM9s2uajUTlpPq32mcx4T+sibdQEHQV2WmgwMhbYovh7WWTPfLF03ZbV5a+ElsSIyH6kgJ8+D6aN/6f+ZstkZOYZYx9GbagcrEqwNblz0iZ9NTyvIAeNn3Oup7rtyD4wVE0PoqcnR/LoSK1s1esmOGPjs3zHB8xW4iL8IrhqAJfsWNBYW9TGR11C3KZJaN7MP4O5Ykmpvw94hHzVmsYA68RQdFYfPlFOgCNBoSdy5ODcv11l9bLs135M4okEc4/e8hQczcz2PWipIVSBxa/5sr9xyTFbjG4xm8f4LmrAhD1uEDGrFDl/6X7Nw7/WZPW7fZJGYN8eZ68Td5KGfJyKjD+pTysvTi+8Q8R0L9wKAxAUrYswdvAuiNeenxSplQZjYTxbcH/wP97fOY215SozY3UDRhv7lomztURB2O2UriTX3oAiTKoInkHQietZyhBQ9wMTVHgMrxOP5T/0gN14eFTz0m2D6/iJMbXYGHdIkKEGV2Voa8k/hVNvAVAZKrDEXthUxotwYkYysTDk8j27XEVy+4a30jopuAp5+/xWYb0ne6lwKZwR3j6kDXroOOtrHqWlkJHSWLoPEQJQo/ARzR8UBZSckmeBPn3gJwY62Zo2dyy1AyRRDQBFAJKH9KX+7auP8U8XDo7mMSzq5ZxmaJ5bLpNg4ZM7938SAjMHcu1yB4+lkHnVLnIp86AOPgigH+ZFDRq1QuKWK3pK5JkLDJdakj176NCbjXDASt1h/t1p+GHyKbAoevHSnHuPfoBmQ3nJrDjOhPfwVYi8V5r0KB8BsrfFu8BvhYCbNrvCVnd4Q8RktqIR/ZilioC6g3++L7PHzuXa8NFSF5zd+ISzGLTjrfaKXsBFCkkK0ksSDbl91yXUghMFOskQBeUoo7o3wuIsE29goRIORuJ4b1jSumvR0gR8B21iyW1G4FqHkZOlWz9zq5FnaJX1WbeAxe2DfGSAnw4cqDwg3LFalk6eH89Sdc41Fr6voEa0hfwdkb54yOM7WevDugT1FRzEqdg9zZZ44ZAKGH3ZyqFve3SE4UDN6tLmIFTdIwMrtYRXWBQDB7vvqOuYj7cN31av64+jg/g1uce+am3TOl0cUUL6s0l35FJ9p8vJcG+G8lAFqC0pdmd/aaWYpqDLvB5LEasLMgbPN2N+Wvkh6HYxPOrZEfoxQX/67AzcWOR0K3eYGOgQhyWL7cwKGlxmY/E2b8CKi6Ssgok+7B+zTtq/DXmaDAHRnwbwvCDJ9pITO5RQgBuprEWT0avZv7QjbzITYD8Fzgy4TSYG3z9tLso0Z7MfgHDLKU+kHrzxWkBPwJRydKMXG4AaCA7mlAmjzpNhGOrMGZGZlHSjPbmO5jPd/lKBrViZ0BaXMmqaFOwA/f03O04qQX6MSVA37+SA5Pne/KP7caLJKuOCJXoXpzArUrYesMVc/RXnOv03YrwKgPlR2SjpqIycyulmodZBy6gVc1jA9y6lJqWgR6SY6tc24sVcYuh2GaTeikYJnhr2d6BiL3oLx8M8wuJBdI3FRVIIAx4XougScOw2xWgwUoSYKeLUHc310kVBzSE/vFeHAjlUil8KZftctMgwGjwrhMbjDbK4rB32fTe9jnsqijdp5kOwkD9+klel+lNh3joAFQ");let c=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function d(e){return`{${e.toString(16).toUpperCase().padStart(2,"0")}}`}function u(e){let t=[];for(let r=0,n=e.length;r>24&255}function g(e){return 0xffffff&e}let y=new Map(i(p).flatMap((e,t)=>e.map(e=>[e,t+1<<24]))),b=new Set(n(p)),v=new Map,w=new Map;for(let[e,t]of o(p)){if(!b.has(e)&&2==t.length){let[r,n]=t,i=w.get(r);i||(i=new Map,w.set(r,i)),i.set(n,e)}v.set(e,t.reverse())}function E(e){return e>=44032&&e<55204}function A(e){let t=[],r=[],n=!1;function i(e){let r=y.get(e);r&&(n=!0,e|=r),t.push(e)}for(let n of e)for(;;){if(n<128)t.push(n);else if(E(n)){let e=n-44032,t=e%588/28|0,r=e%28;i(4352+(e/588|0)),i(4449+t),r>0&&i(4519+r)}else{let e=v.get(n);e?r.push(...e):i(n)}if(!r.length)break;n=r.pop()}if(n&&t.length>1){let e=m(t[0]);for(let r=1;r0&&i>=e)0==e?(t.push(n,...r),r.length=0,n=s):r.push(s),i=e;else{let o=function(e,t){if(e>=4352&&e<4371&&t>=4449&&t<4470)return 44032+588*(e-4352)+28*(t-4449);if(E(e)&&t>4519&&t<4547&&(e-44032)%28==0)return e+(t-4519);{let r=w.get(e);return r&&(r=r.get(t))?r:-1}}(n,s);o>=0?n=o:0==i&&0==e?(t.push(n),n=s):(r.push(s),i=e)}}return n>=0&&t.push(n,...r),t}(A(e))}function I(){return new Set(n(l))}let x=new Map(o(l)),R=I(),P=I(),C=I(),k=I(),S=i(l);function O(){return new Set([n(l).map(e=>S[e]),n(l)].flat(2))}let N=l(),B=s(e=>{let t=s(l).map(e=>e+96);if(t.length){let r=e>=N;t[0]-=32,t=h(t),r&&(t=`Restricted[${t}]`);let n=O(),i=[...n,...O()].sort((e,t)=>e-t);return{N:t,P:n,M:l()-1,R:r,V:new Set(i)}}}),M=I(),L=new Map;for(let{V:e,M:t}of([...M,...I()].sort((e,t)=>e-t).map((e,t,r)=>{let n=l(),i=r[t]=n?r[t-n]:{V:[],M:new Map};i.V.push(e),M.has(e)||L.set(e,i)}),new Set(L.values()))){let r=[];for(let t of e){let e=B.filter(e=>e.V.has(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),e.forEach(e=>n.G.add(e))}let n=r.flatMap(({G:e})=>[...e]);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)}}let D=new Set,H=new Set;for(let e of B)for(let t of e.V)(D.has(t)?H:D).add(t);for(let e of D)L.has(e)||H.has(e)||L.set(e,1);let F=new Set([...D,..._(D)]),j=n(l),U=function e(t){let r=s(()=>{let t=n(l).map(e=>j[e]);if(t.length)return e(t)}).sort((e,t)=>t.Q.size-e.Q.size),i=l();return{B:r,V:i%3,F:1&(i=i/3|0),S:1&(i>>=1),C:2&i,Q:new Set(t)}}([]);class V extends Array{get is_emoji(){return!0}}function G(e,t=d){let r=[];Z(e[0])&&r.push("◌");let n=0,i=e.length;for(let o=0;o0;)if(95!==e[--t])throw Error("underscore allowed only at start")}function Z(e){return P.has(e)}function z(e){return C.has(e)}function K(e,t){let r=0;return e.split(".").map(e=>{let n,i=u(e),o={input:i,offset:r};r+=i.length+1;try{let e,r=o.tokens=J(i,T),s=r.length;if(!s)throw Error("empty label");{let i=r[0],a=s>1||i.is_emoji;if(!a&&i.every(e=>e<128))n=i,q(n),function(e){if(e.length>=4&&45==e[2]&&45==e[3])throw Error("invalid label extension")}(n),e="ASCII";else if(a&&(o.emoji=!0,i=r.flatMap(e=>e.is_emoji?[]:e)),n=r.flatMap(e=>!t&&e.is_emoji?ee(e):e),q(n),i.length){if(P.has(n[0]))throw Y("leading combining mark");for(let e=1;ee.V.has(r));if(!e.length)throw t===B?$(r):X(t[0],r);if(t=e,1==e.length)break}return t}(t);(function(e,t){let{V:r,M:n}=e;for(let n of t)if(!r.has(n))throw X(e,n);if(n>=0){for(let r=1,i=_(t).length;rn)throw Error(`too many combining marks: ${e.N} "${h(t.slice(r-1,o))}" (${o-r}/${n})`);r=o}}})(o,i),function(e,t){let r,n=[];for(let e of t){let t=L.get(e);if(1===t)return;if(t){let n=t.M.get(e);if(!(r=r?r.filter(e=>n.has(e)):[...n]).length)return}else n.push(e)}if(r){for(let t of r)if(n.every(e=>t.V.has(e)))throw Error(`whole-script confusable: ${e.N}/${t.N}`)}}(o,t),e=o.N}else e="Emoji"}o.type=e}catch(e){o.error=e}return o.output=n,o})}function Q(e){return e.map(({input:t,error:r,output:n})=>{if(r){let n=r.message;throw Error(1==e.length?n:`Invalid label "${G(t)}": ${n}`)}return h(n)}).join(".")}function $(e){return Error(`disallowed character: ${W(e)}`)}function X(e,t){let r=W(t),n=B.find(e=>e.P.has(t));return n&&(r=`${n.N} ${r}`),Error(`illegal mixture: ${e.N} + ${r}`)}function Y(e){return Error(`illegal placement: ${e}`)}function J(e,t){let r=[],n=[];for(e=e.slice().reverse();e.length;){let i=et(e);if(i)n.length&&(r.push(t(n)),n=[]),r.push(i);else{let t=e.pop();if(F.has(t))n.push(t);else{let e=x.get(t);if(e)n.push(...e);else if(!R.has(t))throw $(t)}}}return n.length&&r.push(t(n)),r}function ee(e){return e.filter(e=>65039!=e)}function et(e,t){let r,n,i=U,o=[],s=e.length;for(t&&(t.length=0);s;){let a=e[--s];if(!(i=i.B.find(e=>e.Q.has(a))))break;if(i.S)n=a;else if(i.C&&a===n)break;o.push(a),i.F&&(o.push(65039),s>0&&65039==e[s-1]&&s--),i.V&&(r=er(o,i),t&&t.push(...e.slice(s).reverse()),e.length=s)}return r}function er(e,t){let r=V.from(e);return 2==t.V&&r.splice(1,1),r}let en="valid",ei="mapped",eo="ignored";function es(e){return e==en||e==ei}function ea(e){return e.some(e=>k.has(e))}function el(e){for(let t=0;te.cps)})}return e}t.ens_beautify=function(e){let t=K(e,!0);for(let{type:e,output:r,error:n}of t)if(!n&&"Greek"!==e){let e=0;for(;;){let t=r.indexOf(958,e);if(t<0)break;r[t]=926,e=t+1}}return Q(t)},t.ens_emoji=function(){let e=[];return function t(r,n,i){if(r.S)i=n[n.length-1];else if(r.C&&i===n[n.length-1])return;for(let o of(r.F&&n.push(65039),r.V&&e.push(er(n,r)),r.B))for(let e of o.Q)t(o,[...n,e],i)}(U,[]),e.sort(f)},t.ens_normalize=function(e){return Q(K(e))},t.ens_normalize_fragment=function(e,t){let r=t?_:T;return e.split(".").map(e=>h(J(u(e),r).flatMap(e=>e.is_emoji?ee(e):e))).join(".")},t.ens_split=K,t.ens_tokenize=function e(t,{nf:r=!0}={}){let n=u(t).reverse(),i=[],o=[];for(;n.length;){let e=et(n,i);if(e)o.push({type:"emoji",emoji:e,input:i.slice(),cps:ee(e)});else{let e=n.pop();if(46==e)o.push({type:"stop",cp:e});else if(F.has(e))o.push({type:en,cps:[e]});else if(R.has(e))o.push({type:eo,cp:e});else{let t=x.get(e);t?o.push({type:ei,cp:e,cps:t.slice()}):o.push({type:"disallowed",cp:e})}}}if(r)for(let t=0,r=-1;tes(e.type)?e.cps:[]),a=T(s);f(a,s)?(o.splice(r,n-r,{type:"nfc",input:s,cps:a,tokens0:el(i),tokens:e(h(a),{nf:!1})}),t=r):t=n-1,r=-1}else r=t}else n.type!==eo&&(r=-1)}return el(o)},t.is_combining_mark=Z,t.nfc=T,t.nfd=_,t.safe_str_from_cps=G,t.should_escape=z},3934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.outputSyncingFormatter=t.outputPostFormatter=t.inputPostFormatter=t.outputBlockFormatter=t.outputTransactionReceiptFormatter=t.outputLogFormatter=t.inputLogFormatter=t.inputTopicFormatter=t.outputTransactionFormatter=t.inputSignFormatter=t.inputTransactionFormatter=t.inputCallFormatter=t.txInputOptionsFormatter=t.inputAddressFormatter=t.inputDefaultBlockNumberFormatter=t.inputBlockNumberFormatter=t.outputBigIntegerFormatter=t.outputProofFormatter=t.inputStorageKeysFormatter=void 0;let n=r(1633),i=r(2154),o=r(7797),s=r(6825),a=r(7244);t.inputStorageKeysFormatter=e=>e.map(e=>(0,s.numberToHex)(e)),t.outputProofFormatter=e=>({address:(0,s.toChecksumAddress)(e.address),nonce:(0,s.hexToNumberString)(e.nonce),balance:(0,s.hexToNumberString)(e.balance)}),t.outputBigIntegerFormatter=e=>(0,s.toNumber)(e),t.inputBlockNumberFormatter=e=>{if(!(0,a.isNullish)(e))return"string"==typeof e&&(0,a.isBlockTag)(e)?e:"genesis"===e?"0x0":"string"==typeof e&&(0,s.isHexStrict)(e)?e.toLowerCase():(0,s.numberToHex)(e)},t.inputDefaultBlockNumberFormatter=(e,r)=>e?(0,t.inputBlockNumberFormatter)(e):(0,t.inputBlockNumberFormatter)(r),t.inputAddressFormatter=e=>{if(i.Iban.isValid(e)&&i.Iban.isDirect(e))return new i.Iban(e).toAddress().toLowerCase();if((0,s.isAddress)(e))return`0x${e.toLowerCase().replace("0x","")}`;throw new n.FormatterError(`Provided address ${e} is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted.`)},t.txInputOptionsFormatter=e=>{var r;let i=Object.assign({},e);if(e.to&&(i.to=(0,t.inputAddressFormatter)(e.to)),e.data&&e.input)throw new n.FormatterError('You can\'t have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.');if(!e.input&&e.data&&(i.input=e.data,delete i.data),e.input&&!e.input.startsWith("0x")&&(i.input=`0x${e.input}`),i.input&&!(0,s.isHexStrict)(i.input))throw new n.FormatterError("The input field must be HEX encoded data.");return(e.gas||e.gasLimit)&&(i.gas=(0,s.toNumber)(null!==(r=e.gas)&&void 0!==r?r:e.gasLimit)),(e.maxPriorityFeePerGas||e.maxFeePerGas)&&delete i.gasPrice,["gasPrice","gas","value","maxPriorityFeePerGas","maxFeePerGas","nonce","chainId"].filter(e=>!(0,a.isNullish)(i[e])).forEach(e=>{i[e]=(0,s.numberToHex)(i[e])}),i},t.inputCallFormatter=(e,r)=>{var n;let i=(0,t.txInputOptionsFormatter)(e),o=null!==(n=i.from)&&void 0!==n?n:r;return o&&(i.from=(0,t.inputAddressFormatter)(o)),i},t.inputTransactionFormatter=(e,r)=>{var i;let o=(0,t.txInputOptionsFormatter)(e);if("number"!=typeof o.from&&(!o.from||"object"!=typeof o.from)){if(o.from=null!==(i=o.from)&&void 0!==i?i:r,!e.from&&"number"!=typeof e.from)throw new n.FormatterError('The send transactions "from" field must be defined!');o.from=(0,t.inputAddressFormatter)(e.from)}return o},t.inputSignFormatter=e=>(0,s.isHexStrict)(e)?e:(0,s.utf8ToHex)(e),t.outputTransactionFormatter=e=>{let r=Object.assign({},e);return e.blockNumber&&(r.blockNumber=(0,s.hexToNumber)(e.blockNumber)),e.transactionIndex&&(r.transactionIndex=(0,s.hexToNumber)(e.transactionIndex)),r.nonce=(0,s.hexToNumber)(e.nonce),r.gas=(0,s.hexToNumber)(e.gas),e.gasPrice&&(r.gasPrice=(0,t.outputBigIntegerFormatter)(e.gasPrice)),e.maxFeePerGas&&(r.maxFeePerGas=(0,t.outputBigIntegerFormatter)(e.maxFeePerGas)),e.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=(0,t.outputBigIntegerFormatter)(e.maxPriorityFeePerGas)),e.type&&(r.type=(0,s.hexToNumber)(e.type)),r.value=(0,t.outputBigIntegerFormatter)(e.value),e.to&&(0,s.isAddress)(e.to)?r.to=(0,s.toChecksumAddress)(e.to):r.to=void 0,e.from&&(r.from=(0,s.toChecksumAddress)(e.from)),r},t.inputTopicFormatter=e=>{if((0,a.isNullish)(e))return null;let t=String(e);return(0,a.isHex)(t)?t:(0,s.fromUtf8)(t)},t.inputLogFormatter=e=>{var r;let n=(0,a.isNullish)(e)?{}:(0,s.mergeDeep)({},e);return(0,a.isNullish)(n.fromBlock)&&(n.fromBlock=o.BlockTags.LATEST),n.fromBlock=(0,t.inputBlockNumberFormatter)(n.fromBlock),(0,a.isNullish)(n.toBlock)||(n.toBlock=(0,t.inputBlockNumberFormatter)(n.toBlock)),n.topics=null!==(r=n.topics)&&void 0!==r?r:[],n.topics=n.topics.map(e=>Array.isArray(e)?e.map(t.inputTopicFormatter):(0,t.inputTopicFormatter)(e)),n.address&&(n.address=Array.isArray(n.address)?n.address.map(e=>(0,t.inputAddressFormatter)(e)):(0,t.inputAddressFormatter)(n.address)),n},t.outputLogFormatter=e=>{let t=Object.assign({},e),r="string"==typeof e.logIndex?e.logIndex:(0,s.numberToHex)(e.logIndex);if("string"==typeof e.blockHash&&"string"==typeof e.transactionHash){let n=(0,s.sha3Raw)(`${e.blockHash.replace("0x","")}${e.transactionHash.replace("0x","")}${r.replace("0x","")}`);t.id=`log_${n.replace("0x","").slice(0,8)}`}else e.id||(t.id=void 0);return e.blockNumber&&(0,s.isHexStrict)(e.blockNumber)&&(t.blockNumber=(0,s.hexToNumber)(e.blockNumber)),e.transactionIndex&&(0,s.isHexStrict)(e.transactionIndex)&&(t.transactionIndex=(0,s.hexToNumber)(e.transactionIndex)),e.logIndex&&(0,s.isHexStrict)(e.logIndex)&&(t.logIndex=(0,s.hexToNumber)(e.logIndex)),e.address&&(t.address=(0,s.toChecksumAddress)(e.address)),t},t.outputTransactionReceiptFormatter=e=>{if("object"!=typeof e)throw new n.FormatterError(`Received receipt is invalid: ${String(e)}`);let r=Object.assign({},e);return e.blockNumber&&(r.blockNumber=(0,s.hexToNumber)(e.blockNumber)),e.transactionIndex&&(r.transactionIndex=(0,s.hexToNumber)(e.transactionIndex)),r.cumulativeGasUsed=(0,s.hexToNumber)(e.cumulativeGasUsed),r.gasUsed=(0,s.hexToNumber)(e.gasUsed),e.logs&&Array.isArray(e.logs)&&(r.logs=e.logs.map(t.outputLogFormatter)),e.effectiveGasPrice&&(r.effectiveGasPrice=(0,s.hexToNumber)(e.effectiveGasPrice)),e.contractAddress&&(r.contractAddress=(0,s.toChecksumAddress)(e.contractAddress)),e.status&&(r.status=!!parseInt(e.status,10)),r},t.outputBlockFormatter=e=>{let r=Object.assign({},e);return r.gasLimit=(0,s.hexToNumber)(e.gasLimit),r.gasUsed=(0,s.hexToNumber)(e.gasUsed),r.size=(0,s.hexToNumber)(e.size),r.timestamp=(0,s.hexToNumber)(e.timestamp),e.number&&(r.number=(0,s.hexToNumber)(e.number)),e.difficulty&&(r.difficulty=(0,t.outputBigIntegerFormatter)(e.difficulty)),e.totalDifficulty&&(r.totalDifficulty=(0,t.outputBigIntegerFormatter)(e.totalDifficulty)),e.transactions&&Array.isArray(e.transactions)&&(r.transactions=e.transactions.map(t.outputTransactionFormatter)),e.miner&&(r.miner=(0,s.toChecksumAddress)(e.miner)),e.baseFeePerGas&&(r.baseFeePerGas=(0,t.outputBigIntegerFormatter)(e.baseFeePerGas)),r},t.inputPostFormatter=e=>{var t;let r=Object.assign({},e);return e.ttl&&(r.ttl=(0,s.numberToHex)(e.ttl)),e.workToProve&&(r.workToProve=(0,s.numberToHex)(e.workToProve)),e.priority&&(r.priority=(0,s.numberToHex)(e.priority)),e.topics&&!Array.isArray(e.topics)&&(r.topics=e.topics?[e.topics]:[]),r.topics=null===(t=r.topics)||void 0===t?void 0:t.map(e=>e.startsWith("0x")?e:(0,s.fromUtf8)(e)),r},t.outputPostFormatter=e=>{var t;let r=Object.assign({},e);return e.expiry&&(r.expiry=(0,s.hexToNumber)(e.expiry)),e.sent&&(r.sent=(0,s.hexToNumber)(e.sent)),e.ttl&&(r.ttl=(0,s.hexToNumber)(e.ttl)),e.workProved&&(r.workProved=(0,s.hexToNumber)(e.workProved)),e.topics||(r.topics=[]),r.topics=null===(t=r.topics)||void 0===t?void 0:t.map(s.toUtf8),r},t.outputSyncingFormatter=e=>{let t=Object.assign({},e);return t.startingBlock=(0,s.hexToNumber)(e.startingBlock),t.currentBlock=(0,s.hexToNumber)(e.currentBlock),t.highestBlock=(0,s.hexToNumber)(e.highestBlock),e.knownStates&&(t.knownStates=(0,s.hexToNumber)(e.knownStates)),e.pulledStates&&(t.pulledStates=(0,s.hexToNumber)(e.pulledStates)),t}},5177:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatters=void 0,o(r(6063),t),o(r(904),t),o(r(7120),t),o(r(943),t),o(r(3818),t),o(r(3647),t),o(r(7796),t),o(r(4520),t),o(r(3934),t),o(r(4019),t),o(r(5412),t),t.formatters=s(r(3934))},4520:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7796:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isSupportSubscriptions=t.isSupportedProvider=t.isLegacySendAsyncProvider=t.isLegacySendProvider=t.isEIP1193Provider=t.isLegacyRequestProvider=t.isMetaMaskProvider=t.isWeb3Provider=void 0;let n=r(7797);t.isWeb3Provider=e=>n.Web3BaseProvider.isWeb3Provider(e),t.isMetaMaskProvider=e=>"string"!=typeof e&&"request"in e&&"AsyncFunction"===e.request.constructor.name&&"isMetaMask"in e&&e.isMetaMask,t.isLegacyRequestProvider=e=>"string"!=typeof e&&"request"in e&&"Function"===e.request.constructor.name,t.isEIP1193Provider=e=>"string"!=typeof e&&"request"in e&&"AsyncFunction"===e.request.constructor.name,t.isLegacySendProvider=e=>"string"!=typeof e&&"send"in e,t.isLegacySendAsyncProvider=e=>"string"!=typeof e&&"sendAsync"in e,t.isSupportedProvider=e=>e&&((0,t.isWeb3Provider)(e)||(0,t.isEIP1193Provider)(e)||(0,t.isLegacyRequestProvider)(e)||(0,t.isLegacySendAsyncProvider)(e)||(0,t.isLegacySendProvider)(e)),t.isSupportSubscriptions=e=>e&&"supportsSubscriptions"in e?e.supportsSubscriptions():!(!e||"string"==typeof e||!("on"in e))},3647:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3BatchRequest=t.DEFAULT_BATCH_REQUEST_TIMEOUT=void 0;let i=r(6825),o=r(1633);t.DEFAULT_BATCH_REQUEST_TIMEOUT=1e3,t.Web3BatchRequest=class{constructor(e){this._requestManager=e,this._requests=new Map}get requests(){return[...this._requests.values()].map(e=>e.payload)}add(e){let t=i.jsonRpc.toPayload(e),r=new i.Web3DeferredPromise;return this._requests.set(t.id,{payload:t,promise:r}),r}execute(e){return n(this,void 0,void 0,function*(){var r;if(0===this.requests.length)return Promise.resolve([]);let n=new i.Web3DeferredPromise({timeout:null!==(r=null==e?void 0:e.timeout)&&void 0!==r?r:t.DEFAULT_BATCH_REQUEST_TIMEOUT,eagerStart:!0,timeoutMessage:"Batch request timeout"});return this._processBatchRequest(n).catch(e=>n.reject(e)),n.catch(e=>{e instanceof o.OperationTimeoutError&&this._abortAllRequests("Batch request timeout"),n.reject(e)}),n})}_processBatchRequest(e){return n(this,void 0,void 0,function*(){var t,r;let n=yield this._requestManager.sendBatch([...this._requests.values()].map(e=>e.payload));if(n.length!==this._requests.size)throw this._abortAllRequests("Invalid batch response"),new o.ResponseError(n,`Batch request size mismatch the results size. Requests: ${this._requests.size}, Responses: ${n.length}`);let s=this.requests.map(e=>e.id).map(Number).sort((e,t)=>e-t),a=n.map(e=>e.id).map(Number).sort((e,t)=>e-t);if(JSON.stringify(s)!==JSON.stringify(a))throw this._abortAllRequests("Invalid batch response"),new o.ResponseError(n,`Batch request mismatch the results. Requests: [${s.join()}], Responses: [${a.join()}]`);for(let e of n)i.jsonRpc.isResponseWithResult(e)?null===(t=this._requests.get(e.id))||void 0===t||t.promise.resolve(e.result):i.jsonRpc.isResponseWithError(e)&&(null===(r=this._requests.get(e.id))||void 0===r||r.promise.reject(e.error));e.resolve(n)})}_abortAllRequests(e){for(let{promise:t}of this._requests.values())t.reject(new o.OperationAbortError(e))}}},6063:(e,t,r)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Config=t.Web3ConfigEvent=void 0;let i=r(7797),o=r(1633),s=r(6825),a=r(5412);(n||(t.Web3ConfigEvent=n={})).CONFIG_CHANGE="CONFIG_CHANGE";class l extends a.Web3EventEmitter{constructor(e){super(),this.config={handleRevert:!1,defaultAccount:void 0,defaultBlock:"latest",transactionBlockTimeout:50,transactionConfirmationBlocks:24,transactionPollingInterval:1e3,transactionPollingTimeout:75e4,transactionReceiptPollingInterval:void 0,transactionSendTimeout:75e4,transactionConfirmationPollingInterval:void 0,blockHeaderTimeout:10,maxListenersWarningThreshold:100,contractDataInputFill:"data",defaultNetworkId:void 0,defaultChain:"mainnet",defaultHardfork:"london",defaultCommon:void 0,defaultTransactionType:"0x2",defaultMaxPriorityFeePerGas:(0,s.toHex)(25e8),enableExperimentalFeatures:{useSubscriptionWhenCheckingBlockTimeout:!1,useRpcCallSpecification:!1},transactionBuilder:void 0,transactionTypeParser:void 0,customTransactionSchema:void 0,defaultReturnFormat:i.DEFAULT_RETURN_FORMAT,ignoreGasPricing:!1},this.setConfig(null!=e?e:{})}setConfig(e){for(let t of Object.keys(e))this._triggerConfigChange(t,e[t]),(0,s.isNullish)(e[t])||"number"!=typeof e[t]||"maxListenersWarningThreshold"!==t||this.setMaxListenerWarningThreshold(Number(e[t]));Object.assign(this.config,e)}get handleRevert(){return this.config.handleRevert}set handleRevert(e){this._triggerConfigChange("handleRevert",e),this.config.handleRevert=e}get contractDataInputFill(){return this.config.contractDataInputFill}set contractDataInputFill(e){this._triggerConfigChange("contractDataInputFill",e),this.config.contractDataInputFill=e}get defaultAccount(){return this.config.defaultAccount}set defaultAccount(e){this._triggerConfigChange("defaultAccount",e),this.config.defaultAccount=e}get defaultBlock(){return this.config.defaultBlock}set defaultBlock(e){this._triggerConfigChange("defaultBlock",e),this.config.defaultBlock=e}get transactionSendTimeout(){return this.config.transactionSendTimeout}set transactionSendTimeout(e){this._triggerConfigChange("transactionSendTimeout",e),this.config.transactionSendTimeout=e}get transactionBlockTimeout(){return this.config.transactionBlockTimeout}set transactionBlockTimeout(e){this._triggerConfigChange("transactionBlockTimeout",e),this.config.transactionBlockTimeout=e}get transactionConfirmationBlocks(){return this.config.transactionConfirmationBlocks}set transactionConfirmationBlocks(e){this._triggerConfigChange("transactionConfirmationBlocks",e),this.config.transactionConfirmationBlocks=e}get transactionPollingInterval(){return this.config.transactionPollingInterval}set transactionPollingInterval(e){this._triggerConfigChange("transactionPollingInterval",e),this.config.transactionPollingInterval=e,this.transactionReceiptPollingInterval=e,this.transactionConfirmationPollingInterval=e}get transactionPollingTimeout(){return this.config.transactionPollingTimeout}set transactionPollingTimeout(e){this._triggerConfigChange("transactionPollingTimeout",e),this.config.transactionPollingTimeout=e}get transactionReceiptPollingInterval(){return this.config.transactionReceiptPollingInterval}set transactionReceiptPollingInterval(e){this._triggerConfigChange("transactionReceiptPollingInterval",e),this.config.transactionReceiptPollingInterval=e}get transactionConfirmationPollingInterval(){return this.config.transactionConfirmationPollingInterval}set transactionConfirmationPollingInterval(e){this._triggerConfigChange("transactionConfirmationPollingInterval",e),this.config.transactionConfirmationPollingInterval=e}get blockHeaderTimeout(){return this.config.blockHeaderTimeout}set blockHeaderTimeout(e){this._triggerConfigChange("blockHeaderTimeout",e),this.config.blockHeaderTimeout=e}get enableExperimentalFeatures(){return this.config.enableExperimentalFeatures}set enableExperimentalFeatures(e){this._triggerConfigChange("enableExperimentalFeatures",e),this.config.enableExperimentalFeatures=e}get maxListenersWarningThreshold(){return this.config.maxListenersWarningThreshold}set maxListenersWarningThreshold(e){this._triggerConfigChange("maxListenersWarningThreshold",e),this.setMaxListenerWarningThreshold(e),this.config.maxListenersWarningThreshold=e}get defaultReturnFormat(){return this.config.defaultReturnFormat}set defaultReturnFormat(e){this._triggerConfigChange("defaultReturnFormat",e),this.config.defaultReturnFormat=e}get defaultNetworkId(){return this.config.defaultNetworkId}set defaultNetworkId(e){this._triggerConfigChange("defaultNetworkId",e),this.config.defaultNetworkId=e}get defaultChain(){return this.config.defaultChain}set defaultChain(e){if(!(0,s.isNullish)(this.config.defaultCommon)&&!(0,s.isNullish)(this.config.defaultCommon.baseChain)&&e!==this.config.defaultCommon.baseChain)throw new o.ConfigChainMismatchError(this.config.defaultChain,e);this._triggerConfigChange("defaultChain",e),this.config.defaultChain=e}get defaultHardfork(){return this.config.defaultHardfork}set defaultHardfork(e){if(!(0,s.isNullish)(this.config.defaultCommon)&&!(0,s.isNullish)(this.config.defaultCommon.hardfork)&&e!==this.config.defaultCommon.hardfork)throw new o.ConfigHardforkMismatchError(this.config.defaultCommon.hardfork,e);this._triggerConfigChange("defaultHardfork",e),this.config.defaultHardfork=e}get defaultCommon(){return this.config.defaultCommon}set defaultCommon(e){if(!(0,s.isNullish)(this.config.defaultHardfork)&&!(0,s.isNullish)(e)&&!(0,s.isNullish)(e.hardfork)&&this.config.defaultHardfork!==e.hardfork)throw new o.ConfigHardforkMismatchError(this.config.defaultHardfork,e.hardfork);if(!(0,s.isNullish)(this.config.defaultChain)&&!(0,s.isNullish)(e)&&!(0,s.isNullish)(e.baseChain)&&this.config.defaultChain!==e.baseChain)throw new o.ConfigChainMismatchError(this.config.defaultChain,e.baseChain);this._triggerConfigChange("defaultCommon",e),this.config.defaultCommon=e}get ignoreGasPricing(){return this.config.ignoreGasPricing}set ignoreGasPricing(e){this._triggerConfigChange("ignoreGasPricing",e),this.config.ignoreGasPricing=e}get defaultTransactionType(){return this.config.defaultTransactionType}set defaultTransactionType(e){this._triggerConfigChange("defaultTransactionType",e),this.config.defaultTransactionType=e}get defaultMaxPriorityFeePerGas(){return this.config.defaultMaxPriorityFeePerGas}set defaultMaxPriorityFeePerGas(e){this._triggerConfigChange("defaultMaxPriorityFeePerGas",e),this.config.defaultMaxPriorityFeePerGas=e}get transactionBuilder(){return this.config.transactionBuilder}set transactionBuilder(e){this._triggerConfigChange("transactionBuilder",e),this.config.transactionBuilder=e}get transactionTypeParser(){return this.config.transactionTypeParser}set transactionTypeParser(e){this._triggerConfigChange("transactionTypeParser",e),this.config.transactionTypeParser=e}get customTransactionSchema(){return this.config.customTransactionSchema}set customTransactionSchema(e){this._triggerConfigChange("customTransactionSchema",e),this.config.customTransactionSchema=e}_triggerConfigChange(e,t){this.emit(n.CONFIG_CHANGE,{name:e,oldValue:this.config[e],newValue:t})}}t.Web3Config=l},3818:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3EthPluginBase=t.Web3PluginBase=t.Web3Context=void 0;let i=r(1633),o=r(6825),s=r(2054),a=r(7796),l=r(3647),c=r(6063),d=r(904),u=r(7120);class h extends c.Web3Config{constructor(e){var t;if(super(),this.providers=d.Web3RequestManager.providers,(0,o.isNullish)(e)||"string"==typeof e&&""!==e.trim()||(0,a.isSupportedProvider)(e))return this._requestManager=new d.Web3RequestManager(e),void(this._subscriptionManager=new u.Web3SubscriptionManager(this._requestManager,{}));let{config:r,provider:n,requestManager:i,subscriptionManager:s,registeredSubscriptions:l,accountProvider:c,wallet:h,requestManagerMiddleware:f}=e;this.setConfig(null!=r?r:{}),this._requestManager=null!=i?i:new d.Web3RequestManager(n,null===(t=null==r?void 0:r.enableExperimentalFeatures)||void 0===t?void 0:t.useSubscriptionWhenCheckingBlockTimeout,f),this._subscriptionManager=s||new u.Web3SubscriptionManager(this.requestManager,null!=l?l:{}),c&&(this._accountProvider=c),h&&(this._wallet=h)}get requestManager(){return this._requestManager}get subscriptionManager(){return this._subscriptionManager}get wallet(){return this._wallet}get accountProvider(){return this._accountProvider}static fromContextObject(...e){return new this(...e.reverse())}getContextObject(){var e;return{config:this.config,provider:this.provider,requestManager:this.requestManager,subscriptionManager:this.subscriptionManager,registeredSubscriptions:null===(e=this.subscriptionManager)||void 0===e?void 0:e.registeredSubscriptions,providers:this.providers,wallet:this.wallet,accountProvider:this.accountProvider}}use(e,...t){let r=new e(...[...t,this.getContextObject()]);return this.on(c.Web3ConfigEvent.CONFIG_CHANGE,e=>{r.setConfig({[e.name]:e.newValue})}),this[e.name]=r,r}link(e){this.setConfig(e.config),this._requestManager=e.requestManager,this.provider=e.provider,this._subscriptionManager=e.subscriptionManager,this._wallet=e.wallet,this._accountProvider=e._accountProvider,e.on(c.Web3ConfigEvent.CONFIG_CHANGE,e=>{this.setConfig({[e.name]:e.newValue})})}registerPlugin(e){if(void 0!==this[e.pluginNamespace])throw new i.ExistingPluginNamespaceError(e.pluginNamespace);let t={[e.pluginNamespace]:e};t[e.pluginNamespace].link(this),Object.assign(this,t)}get provider(){return this.currentProvider}set provider(e){this.requestManager.setProvider(e)}get currentProvider(){return this.requestManager.provider}set currentProvider(e){this.requestManager.setProvider(e)}get givenProvider(){return h.givenProvider}setProvider(e){return this.provider=e,!0}setRequestManagerMiddleware(e){this.requestManager.setMiddleware(e)}get BatchRequest(){return l.Web3BatchRequest.bind(void 0,this._requestManager)}extend(e){var t;return e.property&&!this[e.property]&&(this[e.property]={}),null===(t=e.methods)||void 0===t||t.forEach(t=>{let r=(...e)=>n(this,void 0,void 0,function*(){return this.requestManager.send({method:t.call,params:e})});e.property?this[e.property][t.name]=r:this[t.name]=r}),this}}t.Web3Context=h,h.providers=d.Web3RequestManager.providers;class f extends h{registerNewTransactionType(e,t){s.TransactionFactory.registerTransactionType(e,t)}}t.Web3PluginBase=f,t.Web3EthPluginBase=class extends f{}},5412:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Web3EventEmitter=void 0;let n=r(6825);t.Web3EventEmitter=class{constructor(){this._emitter=new n.EventEmitter}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,t){this._emitter.emit(e,t)}listenerCount(e){return this._emitter.listenerCount(e)}listeners(e){return this._emitter.listeners(e)}eventNames(){return this._emitter.eventNames()}removeAllListeners(){return this._emitter.removeAllListeners()}setMaxListenerWarningThreshold(e){this._emitter.setMaxListeners(e)}getMaxListeners(){return this._emitter.getMaxListeners()}}},4019:function(e,t,r){var n,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3PromiEvent=void 0;let o=r(5412);class s extends o.Web3EventEmitter{constructor(e){super(),this[n]="Promise",this._promise=new Promise(e)}then(e,t){return i(this,void 0,void 0,function*(){return this._promise.then(e,t)})}catch(e){return i(this,void 0,void 0,function*(){return this._promise.catch(e)})}finally(e){return i(this,void 0,void 0,function*(){return this._promise.finally(e)})}on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}}t.Web3PromiEvent=s,n=Symbol.toStringTag},904:function(e,t,r){var n,i,o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3RequestManager=t.Web3RequestManagerEvent=void 0;let a=r(1633),l=s(r(3655)),c=s(r(5037)),d=r(6825),u=r(7796),h=r(5412);(n=i||(t.Web3RequestManagerEvent=i={})).PROVIDER_CHANGED="PROVIDER_CHANGED",n.BEFORE_PROVIDER_CHANGE="BEFORE_PROVIDER_CHANGE";let f={HttpProvider:l.default,WebsocketProvider:c.default};class p extends h.Web3EventEmitter{constructor(e,t,r){super(),(0,d.isNullish)(e)||this.setProvider(e),this.useRpcCallSpecification=t,(0,d.isNullish)(r)||(this.middleware=r)}static get providers(){return f}get provider(){return this._provider}get providers(){return f}setProvider(e){let t;if(e&&"string"==typeof e&&this.providers){if(/^http(s)?:\/\//i.test(e))t=new this.providers.HttpProvider(e);else{if(!/^ws(s)?:\/\//i.test(e))throw new a.ProviderError(`Can't autodetect provider for "${e}"`);t=new this.providers.WebsocketProvider(e)}}else t=(0,d.isNullish)(e)?void 0:e;return this.emit(i.BEFORE_PROVIDER_CHANGE,this._provider),this._provider=t,this.emit(i.PROVIDER_CHANGED,this._provider),!0}setMiddleware(e){this.middleware=e}send(e){return o(this,void 0,void 0,function*(){let t=Object.assign({},e),r=yield this._sendRequest(t);if((0,d.isNullish)(this.middleware)||(r=yield this.middleware.processResponse(r)),d.jsonRpc.isResponseWithResult(r))return r.result;throw new a.ResponseError(r)})}sendBatch(e){return o(this,void 0,void 0,function*(){return yield this._sendRequest(e)})}_sendRequest(e){return o(this,void 0,void 0,function*(){let{provider:t}=this;if((0,d.isNullish)(t))throw new a.ProviderError("Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.");let r=d.jsonRpc.isBatchRequest(e)?d.jsonRpc.toBatchPayload(e):d.jsonRpc.toPayload(e);if((0,d.isNullish)(this.middleware)||(r=yield this.middleware.processRequest(r)),(0,u.isWeb3Provider)(t)){let e;try{e=yield t.request(r)}catch(t){e=t}return this._processJsonRpcResponse(r,e,{legacy:!1,error:!1})}if((0,u.isEIP1193Provider)(t))return t.request(r).then(e=>this._processJsonRpcResponse(r,e,{legacy:!0,error:!1})).catch(e=>this._processJsonRpcResponse(r,e,{legacy:!0,error:!0}));if((0,u.isLegacyRequestProvider)(t))return new Promise((e,n)=>{let i=e=>{n(this._processJsonRpcResponse(r,e,{legacy:!0,error:!0}))},o=t=>e(this._processJsonRpcResponse(r,t,{legacy:!0,error:!1})),s=t.request(r,(e,t)=>e?i(e):o(t));(0,d.isPromise)(s)&&s.then(o).catch(e=>{try{let t=this._processJsonRpcResponse(r,e,{legacy:!0,error:!0});n(t)}catch(e){n(e)}})});if((0,u.isLegacySendProvider)(t))return new Promise((e,n)=>{t.send(r,(t,i)=>{if(t)return n(this._processJsonRpcResponse(r,t,{legacy:!0,error:!0}));if((0,d.isNullish)(i))throw new a.ResponseError({},'Got a "nullish" response from provider.');return e(this._processJsonRpcResponse(r,i,{legacy:!0,error:!1}))})});if((0,u.isLegacySendAsyncProvider)(t))return t.sendAsync(r).then(e=>this._processJsonRpcResponse(r,e,{legacy:!0,error:!1})).catch(e=>this._processJsonRpcResponse(r,e,{legacy:!0,error:!0}));throw new a.ProviderError("Provider does not have a request or send method to use.")})}_processJsonRpcResponse(e,t,{legacy:r,error:n}){if((0,d.isNullish)(t))return this._buildResponse(e,null,n);if(d.jsonRpc.isResponseWithError(t)){if(this.useRpcCallSpecification&&(0,d.isResponseRpcError)(t)){if(a.rpcErrorsMap.get(t.error.code))throw new(a.rpcErrorsMap.get(t.error.code)).error(t);throw new a.RpcError(t)}if(!p._isReverted(t))throw new a.InvalidResponseError(t,e)}if(d.jsonRpc.isResponseWithResult(t))return t;if(t instanceof Error)throw p._isReverted(t),t;if(!r&&d.jsonRpc.isBatchRequest(e)&&d.jsonRpc.isBatchResponse(t)||r&&!n&&d.jsonRpc.isBatchRequest(e))return t;if(r&&n&&d.jsonRpc.isBatchRequest(e))throw t;if(r&&!d.jsonRpc.isResponseWithError(t)&&!d.jsonRpc.isResponseWithResult(t))return this._buildResponse(e,t,n);if(d.jsonRpc.isBatchRequest(e)&&!Array.isArray(t))throw new a.ResponseError(t,"Got normal response for a batch request.");if(!d.jsonRpc.isBatchRequest(e)&&Array.isArray(t))throw new a.ResponseError(t,"Got batch response for a normal request.");throw new a.ResponseError(t,"Invalid response")}static _isReverted(e){let t;if(d.jsonRpc.isResponseWithError(e)?t=e.error:e instanceof Error&&(t=e),null==t?void 0:t.message.includes("revert"))throw new a.ContractExecutionError(t);return!1}_buildResponse(e,t,r){let n={jsonrpc:"2.0",id:d.jsonRpc.isBatchRequest(e)?e[0].id:"id"in e?e.id:null};return r?Object.assign(Object.assign({},n),{error:t}):Object.assign(Object.assign({},n),{result:t})}}t.Web3RequestManager=p},7120:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3SubscriptionManager=void 0;let i=r(7797),o=r(1633),s=r(6825),a=r(7796),l=r(904);t.Web3SubscriptionManager=class{constructor(e,t,r=!1){this.requestManager=e,this.registeredSubscriptions=t,this.tolerateUnlinkedSubscription=r,this._subscriptions=new Map,this.requestManager.on(l.Web3RequestManagerEvent.BEFORE_PROVIDER_CHANGE,()=>n(this,void 0,void 0,function*(){yield this.unsubscribe()})),this.requestManager.on(l.Web3RequestManagerEvent.PROVIDER_CHANGED,()=>{this.clear(),this.listenToProviderEvents()}),this.listenToProviderEvents()}listenToProviderEvents(){let e=this.requestManager.provider;this.requestManager.provider&&("function"!=typeof(null==e?void 0:e.supportsSubscriptions)||(null==e?void 0:e.supportsSubscriptions()))&&"function"==typeof this.requestManager.provider.on&&("function"==typeof this.requestManager.provider.request?this.requestManager.provider.on("message",e=>this.messageListener(e)):e.on("data",e=>this.messageListener(e)))}messageListener(e){var t,r,n;if(!e)throw new o.SubscriptionError("Should not call messageListener with no data. Type was");let i=(null===(t=e.params)||void 0===t?void 0:t.subscription)||(null===(r=e.data)||void 0===r?void 0:r.subscription)||(null===(n=e.id)||void 0===n?void 0:n.toString(16));if(i){let t=this._subscriptions.get(i);null==t||t.processSubscriptionData(e)}}subscribe(e,t){return n(this,arguments,void 0,function*(e,t,r=i.DEFAULT_RETURN_FORMAT){let n=this.registeredSubscriptions[e];if(!n)throw new o.SubscriptionError("Invalid subscription type");let s=new n(null!=t?t:void 0,{subscriptionManager:this,returnFormat:r});return yield this.addSubscription(s),s})}get subscriptions(){return this._subscriptions}addSubscription(e){return n(this,void 0,void 0,function*(){if(!this.requestManager.provider)throw new o.ProviderError("Provider not available");if(!this.supportsSubscriptions())throw new o.SubscriptionError("The current provider does not support subscriptions");if(e.id&&this._subscriptions.has(e.id))throw new o.SubscriptionError(`Subscription with id "${e.id}" already exists`);if(yield e.sendSubscriptionRequest(),(0,s.isNullish)(e.id))throw new o.SubscriptionError("Subscription is not subscribed yet.");return this._subscriptions.set(e.id,e),e.id})}removeSubscription(e){return n(this,void 0,void 0,function*(){let{id:t}=e;if((0,s.isNullish)(t))throw new o.SubscriptionError("Subscription is not subscribed yet. Or, had already been unsubscribed but not through the Subscription Manager.");if(!this._subscriptions.has(t)&&!this.tolerateUnlinkedSubscription)throw new o.SubscriptionError(`Subscription with id "${t.toString()}" does not exists`);return yield e.sendUnsubscribeRequest(),this._subscriptions.delete(t),t})}unsubscribe(e){return n(this,void 0,void 0,function*(){let t=[];for(let[r,n]of this.subscriptions.entries())(!e||"function"==typeof e&&e({id:r,sub:n}))&&t.push(this.removeSubscription(n));return Promise.all(t)})}clear(){this._subscriptions.clear()}supportsSubscriptions(){return!(0,s.isNullish)(this.requestManager.provider)&&(0,a.isSupportSubscriptions)(this.requestManager.provider)}}},943:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Subscription=void 0;let i=r(7797),o=r(6825),s=r(7120),a=r(5412);class l extends a.Web3EventEmitter{constructor(e,t){var r;super(),this.args=e;let{requestManager:n}=t,{subscriptionManager:o}=t;this._subscriptionManager=n?new s.Web3SubscriptionManager(n,{},!0):o,this._returnFormat=null!==(r=null==t?void 0:t.returnFormat)&&void 0!==r?r:i.DEFAULT_RETURN_FORMAT}get id(){return this._id}get lastBlock(){return this._lastBlock}subscribe(){return n(this,void 0,void 0,function*(){return this._subscriptionManager.addSubscription(this)})}processSubscriptionData(e){var t,r;(null==e?void 0:e.data)?this._processSubscriptionResult(null!==(r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.result)&&void 0!==r?r:null==e?void 0:e.data):e&&o.jsonRpc.isResponseWithNotification(e)&&this._processSubscriptionResult(null==e?void 0:e.params.result)}sendSubscriptionRequest(){return n(this,void 0,void 0,function*(){return this._id=yield this._subscriptionManager.requestManager.send({method:"eth_subscribe",params:this._buildSubscriptionParams()}),this.emit("connected",this._id),this._id})}get returnFormat(){return this._returnFormat}get subscriptionManager(){return this._subscriptionManager}resubscribe(){return n(this,void 0,void 0,function*(){yield this.unsubscribe(),yield this.subscribe()})}unsubscribe(){return n(this,void 0,void 0,function*(){this.id&&(yield this._subscriptionManager.removeSubscription(this))})}sendUnsubscribeRequest(){return n(this,void 0,void 0,function*(){yield this._subscriptionManager.requestManager.send({method:"eth_unsubscribe",params:[this.id]}),this._id=void 0})}formatSubscriptionResult(e){return e}_processSubscriptionResult(e){this.emit("data",this.formatSubscriptionResult(e))}_processSubscriptionError(e){this.emit("error",e)}_buildSubscriptionParams(){throw Error("Implement in the child class")}}t.Web3Subscription=l},3394:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ERR_TX_POLLING_TIMEOUT=t.ERR_TX_DATA_AND_INPUT=t.ERR_TX_UNSUPPORTED_TYPE=t.ERR_TX_UNSUPPORTED_EIP_1559=t.ERR_TX_UNABLE_TO_POPULATE_NONCE=t.ERR_TX_INVALID_NONCE_OR_CHAIN_ID=t.ERR_TX_INVALID_OBJECT=t.ERR_TX_INVALID_LEGACY_FEE_MARKET=t.ERR_TX_INVALID_FEE_MARKET_GAS_PRICE=t.ERR_TX_INVALID_FEE_MARKET_GAS=t.ERR_TX_INVALID_LEGACY_GAS=t.ERR_TX_MISSING_GAS=t.ERR_TX_MISSING_CHAIN_INFO=t.ERR_TX_INVALID_CHAIN_INFO=t.ERR_TX_CHAIN_ID_MISMATCH=t.ERR_TX_MISSING_CUSTOM_CHAIN_ID=t.ERR_TX_MISSING_CUSTOM_CHAIN=t.ERR_TX_INVALID_CALL=t.ERR_TX_INVALID_SENDER=t.ERR_RAW_TX_UNDEFINED=t.ERR_TX_OUT_OF_GAS=t.ERR_TX_REVERT_WITHOUT_REASON=t.ERR_TX_CONTRACT_NOT_STORED=t.ERR_TX_NO_CONTRACT_ADDRESS=t.ERR_TX_REVERT_TRANSACTION=t.ERR_TX_REVERT_INSTRUCTION=t.ERR_TX=t.ERR_CONTRACT_TX_DATA_AND_INPUT=t.ERR_CONTRACT_EXECUTION_REVERTED=t.ERR_CONTRACT_INSTANTIATION=t.ERR_CONTRACT_MISSING_FROM_ADDRESS=t.ERR_CONTRACT_MISSING_ADDRESS=t.ERR_CONTRACT_MISSING_DEPLOY_DATA=t.ERR_CONTRACT_RESERVED_EVENT=t.ERR_CONTRACT_EVENT_NOT_EXISTS=t.ERR_CONTRACT_REQUIRED_CALLBACK=t.ERR_CONTRACT_ABI_MISSING=t.ERR_CONTRACT_RESOLVER_MISSING=t.ERR_CONTRACT=t.ERR_MULTIPLE_ERRORS=t.ERR_INVALID_METHOD_PARAMS=t.ERR_EXISTING_PLUGIN_NAMESPACE=t.ERR_ABI_ENCODING=t.ERR_OPERATION_ABORT=t.ERR_OPERATION_TIMEOUT=t.ERR_METHOD_NOT_IMPLEMENTED=t.ERR_FORMATTERS=t.ERR_PARAM=t.ERR_INVALID_RESPONSE=t.ERR_RESPONSE=void 0,t.ERR_INVALID_BYTES=t.ERR_INVALID_STRING=t.ERR_ENS_NETWORK_NOT_SYNCED=t.ERR_ENS_UNSUPPORTED_NETWORK=t.ERR_ENS_CHECK_INTERFACE_SUPPORT=t.JSONRPC_ERR_CHAIN_DISCONNECTED=t.JSONRPC_ERR_DISCONNECTED=t.JSONRPC_ERR_UNSUPPORTED_METHOD=t.JSONRPC_ERR_UNAUTHORIZED=t.JSONRPC_ERR_REJECTED_REQUEST=t.GENESIS_BLOCK_NUMBER=t.ERR_INVALID_SIGNATURE=t.ERR_SIGNATURE_FAILED=t.ERR_PBKDF2_ITERATIONS=t.ERR_INVALID_KEYSTORE=t.ERR_IV_LENGTH=t.ERR_INVALID_PASSWORD=t.ERR_KEY_VERSION_UNSUPPORTED=t.ERR_KEY_DERIVATION_FAIL=t.ERR_UNSUPPORTED_KDF=t.ERR_INVALID_PRIVATE_KEY=t.ERR_PRIVATE_KEY_LENGTH=t.ERR_WS_PROVIDER=t.ERR_SUBSCRIPTION=t.ERR_INVALID_CLIENT=t.ERR_INVALID_PROVIDER=t.ERR_PROVIDER=t.ERR_REQ_ALREADY_SENT=t.ERR_CONN_PENDING_REQUESTS=t.ERR_CONN_MAX_ATTEMPTS=t.ERR_CONN_CLOSE=t.ERR_CONN_NOT_OPEN=t.ERR_CONN_TIMEOUT=t.ERR_CONN_INVALID=t.ERR_CONN=t.ERR_TX_GAS_MISMATCH_INNER_ERROR=t.ERR_TX_MISSING_GAS_INNER_ERROR=t.ERR_TX_INVALID_PROPERTIES_FOR_TYPE=t.ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR=t.ERR_TX_INVALID_RECEIVER=t.ERR_TX_HARDFORK_MISMATCH=t.ERR_TX_CHAIN_MISMATCH=t.ERR_TX_GAS_MISMATCH=t.ERR_TX_SIGNING=t.ERR_TX_BLOCK_TIMEOUT=t.ERR_TX_SEND_TIMEOUT=t.ERR_TX_NOT_FOUND=t.ERR_TX_LOCAL_WALLET_NOT_AVAILABLE=t.ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER=t.ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL=void 0,t.ERR_RPC_NOT_SUPPORTED=t.ERR_RPC_LIMIT_EXCEEDED=t.ERR_RPC_UNSUPPORTED_METHOD=t.ERR_RPC_TRANSACTION_REJECTED=t.ERR_RPC_UNAVAILABLE_RESOURCE=t.ERR_RPC_MISSING_RESOURCE=t.ERR_RPC_INVALID_INPUT=t.ERR_RPC_INTERNAL_ERROR=t.ERR_RPC_INVALID_PARAMS=t.ERR_RPC_INVALID_METHOD=t.ERR_RPC_INVALID_REQUEST=t.ERR_RPC_INVALID_JSON=t.ERR_SCHEMA_FORMAT=t.ERR_CORE_CHAIN_MISMATCH=t.ERR_CORE_HARDFORK_MISMATCH=t.ERR_VALIDATION=t.ERR_INVALID_INTEGER=t.ERR_INVALID_NIBBLE_WIDTH=t.ERR_INVALID_TYPE_ABI=t.ERR_INVALID_BLOCK=t.ERR_INVALID_LARGE_VALUE=t.ERR_INVALID_SIZE=t.ERR_INVALID_UNSIGNED_INTEGER=t.ERR_INVALID_BOOLEAN=t.ERR_INVALID_TYPE=t.ERR_INVALID_HEX=t.ERR_INVALID_ADDRESS=t.ERR_INVALID_UNIT=t.ERR_INVALID_NUMBER=void 0,t.ERR_RESPONSE=100,t.ERR_INVALID_RESPONSE=101,t.ERR_PARAM=200,t.ERR_FORMATTERS=201,t.ERR_METHOD_NOT_IMPLEMENTED=202,t.ERR_OPERATION_TIMEOUT=203,t.ERR_OPERATION_ABORT=204,t.ERR_ABI_ENCODING=205,t.ERR_EXISTING_PLUGIN_NAMESPACE=206,t.ERR_INVALID_METHOD_PARAMS=207,t.ERR_MULTIPLE_ERRORS=208,t.ERR_CONTRACT=300,t.ERR_CONTRACT_RESOLVER_MISSING=301,t.ERR_CONTRACT_ABI_MISSING=302,t.ERR_CONTRACT_REQUIRED_CALLBACK=303,t.ERR_CONTRACT_EVENT_NOT_EXISTS=304,t.ERR_CONTRACT_RESERVED_EVENT=305,t.ERR_CONTRACT_MISSING_DEPLOY_DATA=306,t.ERR_CONTRACT_MISSING_ADDRESS=307,t.ERR_CONTRACT_MISSING_FROM_ADDRESS=308,t.ERR_CONTRACT_INSTANTIATION=309,t.ERR_CONTRACT_EXECUTION_REVERTED=310,t.ERR_CONTRACT_TX_DATA_AND_INPUT=311,t.ERR_TX=400,t.ERR_TX_REVERT_INSTRUCTION=401,t.ERR_TX_REVERT_TRANSACTION=402,t.ERR_TX_NO_CONTRACT_ADDRESS=403,t.ERR_TX_CONTRACT_NOT_STORED=404,t.ERR_TX_REVERT_WITHOUT_REASON=405,t.ERR_TX_OUT_OF_GAS=406,t.ERR_RAW_TX_UNDEFINED=407,t.ERR_TX_INVALID_SENDER=408,t.ERR_TX_INVALID_CALL=409,t.ERR_TX_MISSING_CUSTOM_CHAIN=410,t.ERR_TX_MISSING_CUSTOM_CHAIN_ID=411,t.ERR_TX_CHAIN_ID_MISMATCH=412,t.ERR_TX_INVALID_CHAIN_INFO=413,t.ERR_TX_MISSING_CHAIN_INFO=414,t.ERR_TX_MISSING_GAS=415,t.ERR_TX_INVALID_LEGACY_GAS=416,t.ERR_TX_INVALID_FEE_MARKET_GAS=417,t.ERR_TX_INVALID_FEE_MARKET_GAS_PRICE=418,t.ERR_TX_INVALID_LEGACY_FEE_MARKET=419,t.ERR_TX_INVALID_OBJECT=420,t.ERR_TX_INVALID_NONCE_OR_CHAIN_ID=421,t.ERR_TX_UNABLE_TO_POPULATE_NONCE=422,t.ERR_TX_UNSUPPORTED_EIP_1559=423,t.ERR_TX_UNSUPPORTED_TYPE=424,t.ERR_TX_DATA_AND_INPUT=425,t.ERR_TX_POLLING_TIMEOUT=426,t.ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL=427,t.ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER=428,t.ERR_TX_LOCAL_WALLET_NOT_AVAILABLE=429,t.ERR_TX_NOT_FOUND=430,t.ERR_TX_SEND_TIMEOUT=431,t.ERR_TX_BLOCK_TIMEOUT=432,t.ERR_TX_SIGNING=433,t.ERR_TX_GAS_MISMATCH=434,t.ERR_TX_CHAIN_MISMATCH=435,t.ERR_TX_HARDFORK_MISMATCH=436,t.ERR_TX_INVALID_RECEIVER=437,t.ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR=438,t.ERR_TX_INVALID_PROPERTIES_FOR_TYPE=439,t.ERR_TX_MISSING_GAS_INNER_ERROR=440,t.ERR_TX_GAS_MISMATCH_INNER_ERROR=441,t.ERR_CONN=500,t.ERR_CONN_INVALID=501,t.ERR_CONN_TIMEOUT=502,t.ERR_CONN_NOT_OPEN=503,t.ERR_CONN_CLOSE=504,t.ERR_CONN_MAX_ATTEMPTS=505,t.ERR_CONN_PENDING_REQUESTS=506,t.ERR_REQ_ALREADY_SENT=507,t.ERR_PROVIDER=600,t.ERR_INVALID_PROVIDER=601,t.ERR_INVALID_CLIENT=602,t.ERR_SUBSCRIPTION=603,t.ERR_WS_PROVIDER=604,t.ERR_PRIVATE_KEY_LENGTH=701,t.ERR_INVALID_PRIVATE_KEY=702,t.ERR_UNSUPPORTED_KDF=703,t.ERR_KEY_DERIVATION_FAIL=704,t.ERR_KEY_VERSION_UNSUPPORTED=705,t.ERR_INVALID_PASSWORD=706,t.ERR_IV_LENGTH=707,t.ERR_INVALID_KEYSTORE=708,t.ERR_PBKDF2_ITERATIONS=709,t.ERR_SIGNATURE_FAILED=801,t.ERR_INVALID_SIGNATURE=802,t.GENESIS_BLOCK_NUMBER="0x0",t.JSONRPC_ERR_REJECTED_REQUEST=4001,t.JSONRPC_ERR_UNAUTHORIZED=4100,t.JSONRPC_ERR_UNSUPPORTED_METHOD=4200,t.JSONRPC_ERR_DISCONNECTED=4900,t.JSONRPC_ERR_CHAIN_DISCONNECTED=4901,t.ERR_ENS_CHECK_INTERFACE_SUPPORT=901,t.ERR_ENS_UNSUPPORTED_NETWORK=902,t.ERR_ENS_NETWORK_NOT_SYNCED=903,t.ERR_INVALID_STRING=1001,t.ERR_INVALID_BYTES=1002,t.ERR_INVALID_NUMBER=1003,t.ERR_INVALID_UNIT=1004,t.ERR_INVALID_ADDRESS=1005,t.ERR_INVALID_HEX=1006,t.ERR_INVALID_TYPE=1007,t.ERR_INVALID_BOOLEAN=1008,t.ERR_INVALID_UNSIGNED_INTEGER=1009,t.ERR_INVALID_SIZE=1010,t.ERR_INVALID_LARGE_VALUE=1011,t.ERR_INVALID_BLOCK=1012,t.ERR_INVALID_TYPE_ABI=1013,t.ERR_INVALID_NIBBLE_WIDTH=1014,t.ERR_INVALID_INTEGER=1015,t.ERR_VALIDATION=1100,t.ERR_CORE_HARDFORK_MISMATCH=1101,t.ERR_CORE_CHAIN_MISMATCH=1102,t.ERR_SCHEMA_FORMAT=1200,t.ERR_RPC_INVALID_JSON=-32700,t.ERR_RPC_INVALID_REQUEST=-32600,t.ERR_RPC_INVALID_METHOD=-32601,t.ERR_RPC_INVALID_PARAMS=-32602,t.ERR_RPC_INTERNAL_ERROR=-32603,t.ERR_RPC_INVALID_INPUT=-32e3,t.ERR_RPC_MISSING_RESOURCE=-32001,t.ERR_RPC_UNAVAILABLE_RESOURCE=-32002,t.ERR_RPC_TRANSACTION_REJECTED=-32003,t.ERR_RPC_UNSUPPORTED_METHOD=-32004,t.ERR_RPC_LIMIT_EXCEEDED=-32005,t.ERR_RPC_NOT_SUPPORTED=-32006},646:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PBKDF2IterationsError=t.IVLengthError=t.InvalidPasswordError=t.KeyStoreVersionError=t.KeyDerivationError=t.InvalidKdfError=t.InvalidSignatureError=t.InvalidPrivateKeyError=t.PrivateKeyLengthError=void 0;let n=r(3394),i=r(2679);class o extends i.BaseWeb3Error{constructor(){super("Private key must be 32 bytes."),this.code=n.ERR_PRIVATE_KEY_LENGTH}}t.PrivateKeyLengthError=o;class s extends i.BaseWeb3Error{constructor(){super("Invalid Private Key, Not a valid string or uint8Array"),this.code=n.ERR_INVALID_PRIVATE_KEY}}t.InvalidPrivateKeyError=s;class a extends i.BaseWeb3Error{constructor(e){super(`"${e}"`),this.code=n.ERR_INVALID_SIGNATURE}}t.InvalidSignatureError=a;class l extends i.BaseWeb3Error{constructor(){super("Invalid key derivation function"),this.code=n.ERR_UNSUPPORTED_KDF}}t.InvalidKdfError=l;class c extends i.BaseWeb3Error{constructor(){super("Key derivation failed - possibly wrong password"),this.code=n.ERR_KEY_DERIVATION_FAIL}}t.KeyDerivationError=c;class d extends i.BaseWeb3Error{constructor(){super("Unsupported key store version"),this.code=n.ERR_KEY_VERSION_UNSUPPORTED}}t.KeyStoreVersionError=d;class u extends i.BaseWeb3Error{constructor(){super("Password cannot be empty"),this.code=n.ERR_INVALID_PASSWORD}}t.InvalidPasswordError=u;class h extends i.BaseWeb3Error{constructor(){super("Initialization vector must be 16 bytes"),this.code=n.ERR_IV_LENGTH}}t.IVLengthError=h;class f extends i.BaseWeb3Error{constructor(){super("c > 1000, pbkdf2 is less secure with less iterations"),this.code=n.ERR_PBKDF2_ITERATIONS}}t.PBKDF2IterationsError=f},3427:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RequestAlreadySentError=t.PendingRequestsOnReconnectingError=t.MaxAttemptsReachedOnReconnectingError=t.ConnectionCloseError=t.ConnectionNotOpenError=t.ConnectionTimeoutError=t.InvalidConnectionError=t.ConnectionError=void 0;let n=r(3394),i=r(2679);class o extends i.BaseWeb3Error{constructor(e,t){super(e),this.code=n.ERR_CONN,t&&(this.errorCode=t.code,this.errorReason=t.reason)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{errorCode:this.errorCode,errorReason:this.errorReason})}}t.ConnectionError=o,t.InvalidConnectionError=class extends o{constructor(e,t){super(`CONNECTION ERROR: Couldn't connect to node ${e}.`,t),this.host=e,this.code=n.ERR_CONN_INVALID}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{host:this.host})}},t.ConnectionTimeoutError=class extends o{constructor(e){super(`CONNECTION TIMEOUT: timeout of ${e}ms achieved`),this.duration=e,this.code=n.ERR_CONN_TIMEOUT}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{duration:this.duration})}},t.ConnectionNotOpenError=class extends o{constructor(e){super("Connection not open",e),this.code=n.ERR_CONN_NOT_OPEN}},t.ConnectionCloseError=class extends o{constructor(e){var t,r;super(`CONNECTION ERROR: The connection got closed with the close code ${null!==(t=null==e?void 0:e.code)&&void 0!==t?t:""} and the following reason string ${null!==(r=null==e?void 0:e.reason)&&void 0!==r?r:""}`,e),this.code=n.ERR_CONN_CLOSE}},t.MaxAttemptsReachedOnReconnectingError=class extends o{constructor(e){super(`Maximum number of reconnect attempts reached! (${e})`),this.code=n.ERR_CONN_MAX_ATTEMPTS}},t.PendingRequestsOnReconnectingError=class extends o{constructor(){super("CONNECTION ERROR: Provider started to reconnect before the response got received!"),this.code=n.ERR_CONN_PENDING_REQUESTS}},t.RequestAlreadySentError=class extends o{constructor(e){super(`Request already sent with following id: ${e}`),this.code=n.ERR_REQ_ALREADY_SENT}}},3341:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContractTransactionDataAndInputError=t.ContractExecutionError=t.Eip838ExecutionError=t.ContractInstantiationError=t.ContractNoFromAddressDefinedError=t.ContractNoAddressDefinedError=t.ContractMissingDeployDataError=t.ContractReservedEventError=t.ContractEventDoesNotExistError=t.ContractOnceRequiresCallbackError=t.ContractMissingABIError=t.ResolverMethodMissingError=t.Web3ContractError=void 0;let n=r(3394),i=r(2679);class o extends i.BaseWeb3Error{constructor(e,t){super(e),this.code=n.ERR_CONTRACT,this.receipt=t}}t.Web3ContractError=o;class s extends i.BaseWeb3Error{constructor(e,t){super(`The resolver at ${e} does not implement requested method: "${t}".`),this.address=e,this.name=t,this.code=n.ERR_CONTRACT_RESOLVER_MISSING}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{address:this.address,name:this.name})}}t.ResolverMethodMissingError=s;class a extends i.BaseWeb3Error{constructor(){super("You must provide the json interface of the contract when instantiating a contract object."),this.code=n.ERR_CONTRACT_ABI_MISSING}}t.ContractMissingABIError=a;class l extends i.BaseWeb3Error{constructor(){super("Once requires a callback as the second parameter."),this.code=n.ERR_CONTRACT_REQUIRED_CALLBACK}}t.ContractOnceRequiresCallbackError=l;class c extends i.BaseWeb3Error{constructor(e){super(`Event "${e}" doesn't exist in this contract.`),this.eventName=e,this.code=n.ERR_CONTRACT_EVENT_NOT_EXISTS}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{eventName:this.eventName})}}t.ContractEventDoesNotExistError=c;class d extends i.BaseWeb3Error{constructor(e){super(`Event "${e}" doesn't exist in this contract.`),this.type=e,this.code=n.ERR_CONTRACT_RESERVED_EVENT}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}t.ContractReservedEventError=d;class u extends i.BaseWeb3Error{constructor(){super('No "data" specified in neither the given options, nor the default options.'),this.code=n.ERR_CONTRACT_MISSING_DEPLOY_DATA}}t.ContractMissingDeployDataError=u;class h extends i.BaseWeb3Error{constructor(){super("This contract object doesn't have address set yet, please set an address first."),this.code=n.ERR_CONTRACT_MISSING_ADDRESS}}t.ContractNoAddressDefinedError=h;class f extends i.BaseWeb3Error{constructor(){super('No "from" address specified in neither the given options, nor the default options.'),this.code=n.ERR_CONTRACT_MISSING_FROM_ADDRESS}}t.ContractNoFromAddressDefinedError=f;class p extends i.BaseWeb3Error{constructor(){super(...arguments),this.code=n.ERR_CONTRACT_INSTANTIATION}}t.ContractInstantiationError=p;class m extends o{constructor(e){if(super(e.message||"Error"),this.name="name"in e&&e.name||this.constructor.name,this.stack="stack"in e&&e.stack||void 0,this.code=e.code,"object"==typeof e.data){let t;t=e.data&&"originalError"in e.data?e.data.originalError:e.data,this.data=t.data,this.cause=new m(t)}else this.data=e.data}setDecodedProperties(e,t,r){this.errorName=e,this.errorSignature=t,this.errorArgs=r}toJSON(){let e=Object.assign(Object.assign({},super.toJSON()),{data:this.data});return this.errorName&&(e=Object.assign(Object.assign({},e),{errorName:this.errorName,errorSignature:this.errorSignature,errorArgs:this.errorArgs})),e}}t.Eip838ExecutionError=m,t.ContractExecutionError=class extends o{constructor(e){super("Error happened while trying to execute a function inside a smart contract"),this.code=n.ERR_CONTRACT_EXECUTION_REVERTED,this.cause=new m(e)}};class g extends i.InvalidValueError{constructor(e){var t,r;super(`data: ${null!==(t=e.data)&&void 0!==t?t:"undefined"}, input: ${null!==(r=e.input)&&void 0!==r?r:"undefined"}`,'You can\'t have "data" and "input" as properties of a contract at the same time, please use either "data" or "input" instead.'),this.code=n.ERR_CONTRACT_TX_DATA_AND_INPUT}}t.ContractTransactionDataAndInputError=g},1294:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigChainMismatchError=t.ConfigHardforkMismatchError=void 0;let n=r(2679),i=r(3394);class o extends n.BaseWeb3Error{constructor(e,t){super(`Web3Config hardfork doesnt match in defaultHardfork ${e} and common.hardfork ${t}`),this.code=i.ERR_CORE_HARDFORK_MISMATCH}}t.ConfigHardforkMismatchError=o;class s extends n.BaseWeb3Error{constructor(e,t){super(`Web3Config chain doesnt match in defaultHardfork ${e} and common.hardfork ${t}`),this.code=i.ERR_CORE_HARDFORK_MISMATCH}}t.ConfigChainMismatchError=s},3155:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENSNetworkNotSyncedError=t.ENSUnsupportedNetworkError=t.ENSCheckInterfaceSupportError=void 0;let n=r(3394),i=r(2679);class o extends i.BaseWeb3Error{constructor(e){super(`ENS resolver check interface support error. "${e}"`),this.code=n.ERR_ENS_CHECK_INTERFACE_SUPPORT}}t.ENSCheckInterfaceSupportError=o;class s extends i.BaseWeb3Error{constructor(e){super(`ENS is not supported on network ${e}`),this.code=n.ERR_ENS_UNSUPPORTED_NETWORK}}t.ENSUnsupportedNetworkError=s;class a extends i.BaseWeb3Error{constructor(){super("Network not synced"),this.code=n.ERR_ENS_NETWORK_NOT_SYNCED}}t.ENSNetworkNotSyncedError=a},3572:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExistingPluginNamespaceError=t.AbiError=t.OperationAbortError=t.OperationTimeoutError=t.MethodNotImplementedError=t.FormatterError=t.InvalidMethodParamsError=t.InvalidNumberOfParamsError=void 0;let n=r(3394),i=r(2679);class o extends i.BaseWeb3Error{constructor(e,t,r){super(`Invalid number of parameters for "${r}". Got "${e}" expected "${t}"!`),this.got=e,this.expected=t,this.method=r,this.code=n.ERR_PARAM}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{got:this.got,expected:this.expected,method:this.method})}}t.InvalidNumberOfParamsError=o;class s extends i.BaseWeb3Error{constructor(e){super(`Invalid parameters passed. "${void 0!==e?e:""}"`),this.hint=e,this.code=n.ERR_INVALID_METHOD_PARAMS}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{hint:this.hint})}}t.InvalidMethodParamsError=s;class a extends i.BaseWeb3Error{constructor(){super(...arguments),this.code=n.ERR_FORMATTERS}}t.FormatterError=a;class l extends i.BaseWeb3Error{constructor(){super("The method you're trying to call is not implemented."),this.code=n.ERR_METHOD_NOT_IMPLEMENTED}}t.MethodNotImplementedError=l;class c extends i.BaseWeb3Error{constructor(){super(...arguments),this.code=n.ERR_OPERATION_TIMEOUT}}t.OperationTimeoutError=c;class d extends i.BaseWeb3Error{constructor(){super(...arguments),this.code=n.ERR_OPERATION_ABORT}}t.OperationAbortError=d;class u extends i.BaseWeb3Error{constructor(e,t){super(e),this.code=n.ERR_ABI_ENCODING,this.props=null!=t?t:{}}}t.AbiError=u;class h extends i.BaseWeb3Error{constructor(e){super(`A plugin with the namespace: ${e} has already been registered.`),this.code=n.ERR_EXISTING_PLUGIN_NAMESPACE}}t.ExistingPluginNamespaceError=h},2240:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Web3WSProviderError=t.SubscriptionError=t.InvalidClientError=t.InvalidProviderError=t.ProviderError=void 0;let n=r(3394),i=r(2679);class o extends i.BaseWeb3Error{constructor(){super(...arguments),this.code=n.ERR_PROVIDER}}t.ProviderError=o;class s extends i.BaseWeb3Error{constructor(e){super(`Provider with url "${e}" is not set or invalid`),this.clientUrl=e,this.code=n.ERR_INVALID_PROVIDER}}t.InvalidProviderError=s;class a extends i.BaseWeb3Error{constructor(e){super(`Client URL "${e}" is invalid.`),this.code=n.ERR_INVALID_CLIENT}}t.InvalidClientError=a;class l extends i.BaseWeb3Error{constructor(){super(...arguments),this.code=n.ERR_SUBSCRIPTION}}t.SubscriptionError=l;class c extends i.BaseWeb3Error{constructor(){super(...arguments),this.code=n.ERR_WS_PROVIDER}}t.Web3WSProviderError=c},462:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidResponseError=t.ResponseError=void 0;let n=r(2679),i=r(3394),o=e=>!Array.isArray(e)&&"2.0"===e.jsonrpc&&e&&(void 0===e.result||null===e.result)&&"error"in e&&("number"==typeof e.id||"string"==typeof e.id)?e.error.message:"";class s extends n.BaseWeb3Error{constructor(e,t,r,s){var a;let l;super(null!=t?t:`Returned error: ${Array.isArray(e)?e.map(e=>o(e)).join(","):o(e)}`),this.code=i.ERR_RESPONSE,t||(this.data=Array.isArray(e)?e.map(e=>{var t;return null===(t=e.error)||void 0===t?void 0:t.data}):null===(a=null==e?void 0:e.error)||void 0===a?void 0:a.data),this.statusCode=s,this.request=r,"error"in e?l=e.error:e instanceof Array&&(l=e.filter(e=>e.error).map(e=>e.error)),Array.isArray(l)&&l.length>0?this.cause=new n.MultipleErrors(l):this.cause=l}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{data:this.data,request:this.request,statusCode:this.statusCode})}}t.ResponseError=s,t.InvalidResponseError=class extends s{constructor(e,t){let r;super(e,void 0,t),this.code=i.ERR_INVALID_RESPONSE,"error"in e?r=e.error:e instanceof Array&&(r=e.map(e=>e.error)),Array.isArray(r)?this.cause=new n.MultipleErrors(r):this.cause=r}}},6222:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RpcErrorMessages=t.genericRpcErrorMessageTemplate=void 0;let n=r(3394);t.genericRpcErrorMessageTemplate="An Rpc error has occured with a code of *code*",t.RpcErrorMessages={[n.ERR_RPC_INVALID_JSON]:{message:"Parse error",description:"Invalid JSON"},[n.ERR_RPC_INVALID_REQUEST]:{message:"Invalid request",description:"JSON is not a valid request object "},[n.ERR_RPC_INVALID_METHOD]:{message:"Method not found",description:"Method does not exist "},[n.ERR_RPC_INVALID_PARAMS]:{message:"Invalid params",description:"Invalid method parameters"},[n.ERR_RPC_INTERNAL_ERROR]:{message:"Internal error",description:"Internal JSON-RPC error"},[n.ERR_RPC_INVALID_INPUT]:{message:"Invalid input",description:"Missing or invalid parameters"},[n.ERR_RPC_MISSING_RESOURCE]:{message:"Resource not found",description:"Requested resource not found"},[n.ERR_RPC_UNAVAILABLE_RESOURCE]:{message:"Resource unavailable",description:"Requested resource not available"},[n.ERR_RPC_TRANSACTION_REJECTED]:{message:"Transaction rejected",description:"Transaction creation failed"},[n.ERR_RPC_UNSUPPORTED_METHOD]:{message:"Method not supported",description:"Method is not implemented"},[n.ERR_RPC_LIMIT_EXCEEDED]:{message:"Limit exceeded",description:"Request exceeds defined limit"},[n.ERR_RPC_NOT_SUPPORTED]:{message:"JSON-RPC version not supported",description:"Version of JSON-RPC protocol is not supported"},[n.JSONRPC_ERR_REJECTED_REQUEST]:{name:"User Rejected Request",message:"The user rejected the request."},[n.JSONRPC_ERR_UNAUTHORIZED]:{name:"Unauthorized",message:"The requested method and/or account has not been authorized by the user."},[n.JSONRPC_ERR_UNSUPPORTED_METHOD]:{name:"Unsupported Method",message:"The Provider does not support the requested method."},[n.JSONRPC_ERR_DISCONNECTED]:{name:"Disconnected",message:"The Provider is disconnected from all chains."},[n.JSONRPC_ERR_CHAIN_DISCONNECTED]:{name:"Chain Disconnected",message:"The Provider is not connected to the requested chain."},"0-999":{name:"",message:"Not used."},1e3:{name:"Normal Closure",message:"The connection successfully completed the purpose for which it was created."},1001:{name:"Going Away",message:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{name:"Protocol error",message:"The endpoint is terminating the connection due to a protocol error."},1003:{name:"Unsupported Data",message:"The connection is being terminated because the endpoint received data of a type it cannot accept. (For example, a text-only endpoint received binary data.)"},1004:{name:"Reserved",message:"Reserved. A meaning might be defined in the future."},1005:{name:"No Status Rcvd",message:"Reserved. Indicates that no status code was provided even though one was expected."},1006:{name:"Abnormal Closure",message:"Reserved. Indicates that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{name:"Invalid frame payload data",message:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{name:"Policy Violation",message:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{name:"Message Too Big",message:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{name:"Mandatory Ext.",message:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{name:"Internal Error",message:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{name:"Service Restart",message:"The server is terminating the connection because it is restarting."},1013:{name:"Try Again Later",message:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{name:"Bad Gateway",message:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{name:"TLS handshake",message:"Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},"1016-2999":{name:"",message:"For definition by future revisions of the WebSocket Protocol specification, and for definition by extension specifications."},"3000-3999":{name:"",message:"For use by libraries, frameworks, and applications. These status codes are registered directly with IANA. The interpretation of these codes is undefined by the WebSocket protocol."},"4000-4999":{name:"",message:"For private use, and thus can't be registered. Such codes can be used by prior agreements between WebSocket applications. The interpretation of these codes is undefined by the WebSocket protocol."}}},2634:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.rpcErrorsMap=t.LimitExceededError=t.TransactionRejectedError=t.VersionNotSupportedError=t.ResourcesNotFoundError=t.ResourceUnavailableError=t.MethodNotSupported=t.InvalidInputError=t.InternalError=t.InvalidParamsError=t.MethodNotFoundError=t.InvalidRequestError=t.ParseError=t.EIP1193ProviderRpcError=t.RpcError=void 0;let n=r(2679),i=r(3394),o=r(6222);class s extends n.BaseWeb3Error{constructor(e,t){super(null!=t?t:o.genericRpcErrorMessageTemplate.replace("*code*",e.error.code.toString())),this.code=e.error.code,this.id=e.id,this.jsonrpc=e.jsonrpc,this.jsonRpcError=e.error}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{error:this.jsonRpcError,id:this.id,jsonRpc:this.jsonrpc})}}t.RpcError=s;class a extends n.BaseWeb3Error{constructor(e,t){var r,n,i,s;if(e){if(null===(r=o.RpcErrorMessages[e])||void 0===r?void 0:r.message)super(o.RpcErrorMessages[e].message);else{let t=Object.keys(o.RpcErrorMessages).find(t=>"string"==typeof t&&e>=parseInt(t.split("-")[0],10)&&e<=parseInt(t.split("-")[1],10));super(null!==(i=null===(n=o.RpcErrorMessages[null!=t?t:""])||void 0===n?void 0:n.message)&&void 0!==i?i:o.genericRpcErrorMessageTemplate.replace("*code*",null!==(s=null==e?void 0:e.toString())&&void 0!==s?s:'""'))}}else super();this.code=e,this.data=t}}t.EIP1193ProviderRpcError=a;class l extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_INVALID_JSON].message),this.code=i.ERR_RPC_INVALID_JSON}}t.ParseError=l;class c extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_INVALID_REQUEST].message),this.code=i.ERR_RPC_INVALID_REQUEST}}t.InvalidRequestError=c;class d extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_INVALID_METHOD].message),this.code=i.ERR_RPC_INVALID_METHOD}}t.MethodNotFoundError=d;class u extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_INVALID_PARAMS].message),this.code=i.ERR_RPC_INVALID_PARAMS}}t.InvalidParamsError=u;class h extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_INTERNAL_ERROR].message),this.code=i.ERR_RPC_INTERNAL_ERROR}}t.InternalError=h;class f extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_INVALID_INPUT].message),this.code=i.ERR_RPC_INVALID_INPUT}}t.InvalidInputError=f;class p extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_UNSUPPORTED_METHOD].message),this.code=i.ERR_RPC_UNSUPPORTED_METHOD}}t.MethodNotSupported=p;class m extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_UNAVAILABLE_RESOURCE].message),this.code=i.ERR_RPC_UNAVAILABLE_RESOURCE}}t.ResourceUnavailableError=m;class g extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_MISSING_RESOURCE].message),this.code=i.ERR_RPC_MISSING_RESOURCE}}t.ResourcesNotFoundError=g;class y extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_NOT_SUPPORTED].message),this.code=i.ERR_RPC_NOT_SUPPORTED}}t.VersionNotSupportedError=y;class b extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_TRANSACTION_REJECTED].message),this.code=i.ERR_RPC_TRANSACTION_REJECTED}}t.TransactionRejectedError=b;class v extends s{constructor(e){super(e,o.RpcErrorMessages[i.ERR_RPC_LIMIT_EXCEEDED].message),this.code=i.ERR_RPC_LIMIT_EXCEEDED}}t.LimitExceededError=v,t.rpcErrorsMap=new Map,t.rpcErrorsMap.set(i.ERR_RPC_INVALID_JSON,{error:l}),t.rpcErrorsMap.set(i.ERR_RPC_INVALID_REQUEST,{error:c}),t.rpcErrorsMap.set(i.ERR_RPC_INVALID_METHOD,{error:d}),t.rpcErrorsMap.set(i.ERR_RPC_INVALID_PARAMS,{error:u}),t.rpcErrorsMap.set(i.ERR_RPC_INTERNAL_ERROR,{error:h}),t.rpcErrorsMap.set(i.ERR_RPC_INVALID_INPUT,{error:f}),t.rpcErrorsMap.set(i.ERR_RPC_UNSUPPORTED_METHOD,{error:p}),t.rpcErrorsMap.set(i.ERR_RPC_UNAVAILABLE_RESOURCE,{error:m}),t.rpcErrorsMap.set(i.ERR_RPC_TRANSACTION_REJECTED,{error:b}),t.rpcErrorsMap.set(i.ERR_RPC_MISSING_RESOURCE,{error:g}),t.rpcErrorsMap.set(i.ERR_RPC_NOT_SUPPORTED,{error:y}),t.rpcErrorsMap.set(i.ERR_RPC_LIMIT_EXCEEDED,{error:v})},4710:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SchemaFormatError=void 0;let n=r(3394),i=r(2679);class o extends i.BaseWeb3Error{constructor(e){super(`Format for the type ${e} is unsupported`),this.type=e,this.code=n.ERR_SCHEMA_FORMAT}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type})}}t.SchemaFormatError=o},2165:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SignatureError=void 0;let n=r(3394),i=r(2679);class o extends i.InvalidValueError{constructor(){super(...arguments),this.code=n.ERR_SIGNATURE_FAILED}}t.SignatureError=o},4187:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidPropertiesForTransactionTypeError=t.LocalWalletNotAvailableError=t.TransactionSigningError=t.TransactionReceiptMissingBlockNumberError=t.TransactionMissingReceiptOrBlockHashError=t.TransactionBlockTimeoutError=t.TransactionPollingTimeoutError=t.TransactionSendTimeoutError=t.TransactionDataAndInputError=t.UnsupportedTransactionTypeError=t.Eip1559NotSupportedError=t.UnableToPopulateNonceError=t.InvalidNonceOrChainIdError=t.InvalidTransactionObjectError=t.UnsupportedFeeMarketError=t.Eip1559GasPriceError=t.InvalidMaxPriorityFeePerGasOrMaxFeePerGas=t.InvalidGasOrGasPrice=t.TransactionGasMismatchError=t.TransactionGasMismatchInnerError=t.MissingGasError=t.MissingGasInnerError=t.MissingChainOrHardforkError=t.CommonOrChainAndHardforkError=t.HardforkMismatchError=t.ChainMismatchError=t.ChainIdMismatchError=t.MissingCustomChainIdError=t.MissingCustomChainError=t.InvalidTransactionCall=t.InvalidTransactionWithReceiver=t.InvalidTransactionWithSender=t.TransactionNotFound=t.UndefinedRawTransactionError=t.TransactionOutOfGasError=t.TransactionRevertedWithoutReasonError=t.ContractCodeNotStoredError=t.NoContractAddressFoundError=t.TransactionRevertWithCustomError=t.TransactionRevertInstructionError=t.RevertInstructionError=t.TransactionError=void 0;let n=r(3394),i=r(2679);class o extends i.BaseWeb3Error{constructor(e,t){super(e),this.receipt=t,this.code=n.ERR_TX}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}}t.TransactionError=o;class s extends i.BaseWeb3Error{constructor(e,t){super(`Your request got reverted with the following reason string: ${e}`),this.reason=e,this.signature=t,this.code=n.ERR_TX_REVERT_INSTRUCTION}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature})}}t.RevertInstructionError=s;class a extends i.BaseWeb3Error{constructor(e,t,r,o){super("Transaction has been reverted by the EVM"+(void 0===r?"":`: ${i.BaseWeb3Error.convertToString(r)}`)),this.reason=e,this.signature=t,this.receipt=r,this.data=o,this.code=n.ERR_TX_REVERT_TRANSACTION}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,signature:this.signature,receipt:this.receipt,data:this.data})}}t.TransactionRevertInstructionError=a,t.TransactionRevertWithCustomError=class extends a{constructor(e,t,r,i,o,s,a){super(e),this.reason=e,this.customErrorName=t,this.customErrorDecodedSignature=r,this.customErrorArguments=i,this.signature=o,this.receipt=s,this.data=a,this.code=n.ERR_TX_REVERT_TRANSACTION_CUSTOM_ERROR}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reason:this.reason,customErrorName:this.customErrorName,customErrorDecodedSignature:this.customErrorDecodedSignature,customErrorArguments:this.customErrorArguments,signature:this.signature,receipt:this.receipt,data:this.data})}},t.NoContractAddressFoundError=class extends o{constructor(e){super("The transaction receipt didn't contain a contract address.",e),this.code=n.ERR_TX_NO_CONTRACT_ADDRESS}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{receipt:this.receipt})}},t.ContractCodeNotStoredError=class extends o{constructor(e){super("The contract code couldn't be stored, please check your gas limit.",e),this.code=n.ERR_TX_CONTRACT_NOT_STORED}},t.TransactionRevertedWithoutReasonError=class extends o{constructor(e){super("Transaction has been reverted by the EVM"+(void 0===e?"":`: ${i.BaseWeb3Error.convertToString(e)}`),e),this.code=n.ERR_TX_REVERT_WITHOUT_REASON}},t.TransactionOutOfGasError=class extends o{constructor(e){super(`Transaction ran out of gas. Please provide more gas: ${JSON.stringify(e,void 0,2)}`,e),this.code=n.ERR_TX_OUT_OF_GAS}},t.UndefinedRawTransactionError=class extends o{constructor(){super("Raw transaction undefined"),this.code=n.ERR_RAW_TX_UNDEFINED}},t.TransactionNotFound=class extends o{constructor(){super("Transaction not found"),this.code=n.ERR_TX_NOT_FOUND}};class l extends i.InvalidValueError{constructor(e){super(e,"invalid transaction with invalid sender"),this.code=n.ERR_TX_INVALID_SENDER}}t.InvalidTransactionWithSender=l;class c extends i.InvalidValueError{constructor(e){super(e,"invalid transaction with invalid receiver"),this.code=n.ERR_TX_INVALID_RECEIVER}}t.InvalidTransactionWithReceiver=c;class d extends i.InvalidValueError{constructor(e){super(e,"invalid transaction call"),this.code=n.ERR_TX_INVALID_CALL}}t.InvalidTransactionCall=d;class u extends i.InvalidValueError{constructor(){super("MissingCustomChainError","If tx.common is provided it must have tx.common.customChain"),this.code=n.ERR_TX_MISSING_CUSTOM_CHAIN}}t.MissingCustomChainError=u;class h extends i.InvalidValueError{constructor(){super("MissingCustomChainIdError","If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"),this.code=n.ERR_TX_MISSING_CUSTOM_CHAIN_ID}}t.MissingCustomChainIdError=h;class f extends i.InvalidValueError{constructor(e){super(JSON.stringify(e),"Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"),this.code=n.ERR_TX_CHAIN_ID_MISMATCH}}t.ChainIdMismatchError=f;class p extends i.InvalidValueError{constructor(e){super(JSON.stringify(e),"Chain doesnt match in tx.chain tx.common.basechain"),this.code=n.ERR_TX_CHAIN_MISMATCH}}t.ChainMismatchError=p;class m extends i.InvalidValueError{constructor(e){super(JSON.stringify(e),"hardfork doesnt match in tx.hardfork tx.common.hardfork"),this.code=n.ERR_TX_HARDFORK_MISMATCH}}t.HardforkMismatchError=m;class g extends i.InvalidValueError{constructor(){super("CommonOrChainAndHardforkError","Please provide the common object or the chain and hardfork property but not all together."),this.code=n.ERR_TX_INVALID_CHAIN_INFO}}t.CommonOrChainAndHardforkError=g;class y extends i.InvalidValueError{constructor(e){var t,r;super("MissingChainOrHardforkError",`When specifying chain and hardfork, both values must be defined. Received "chain": ${null!==(t=e.chain)&&void 0!==t?t:"undefined"}, "hardfork": ${null!==(r=e.hardfork)&&void 0!==r?r:"undefined"}`),this.code=n.ERR_TX_MISSING_CHAIN_INFO}}t.MissingChainOrHardforkError=y;class b extends i.BaseWeb3Error{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions'),this.code=n.ERR_TX_MISSING_GAS_INNER_ERROR}}t.MissingGasInnerError=b;class v extends i.InvalidValueError{constructor(e){var t,r,i,o;super(`gas: ${null!==(t=e.gas)&&void 0!==t?t:"undefined"}, gasPrice: ${null!==(r=e.gasPrice)&&void 0!==r?r:"undefined"}, maxPriorityFeePerGas: ${null!==(i=e.maxPriorityFeePerGas)&&void 0!==i?i:"undefined"}, maxFeePerGas: ${null!==(o=e.maxFeePerGas)&&void 0!==o?o:"undefined"}`,'"gas" is missing'),this.code=n.ERR_TX_MISSING_GAS,this.cause=new b}}t.MissingGasError=v;class w extends i.BaseWeb3Error{constructor(){super('Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions, not both'),this.code=n.ERR_TX_GAS_MISMATCH_INNER_ERROR}}t.TransactionGasMismatchInnerError=w;class E extends i.InvalidValueError{constructor(e){var t,r,i,o;super(`gas: ${null!==(t=e.gas)&&void 0!==t?t:"undefined"}, gasPrice: ${null!==(r=e.gasPrice)&&void 0!==r?r:"undefined"}, maxPriorityFeePerGas: ${null!==(i=e.maxPriorityFeePerGas)&&void 0!==i?i:"undefined"}, maxFeePerGas: ${null!==(o=e.maxFeePerGas)&&void 0!==o?o:"undefined"}`,"transaction must specify legacy or fee market gas properties, not both"),this.code=n.ERR_TX_GAS_MISMATCH,this.cause=new w}}t.TransactionGasMismatchError=E;class A extends i.InvalidValueError{constructor(e){var t,r;super(`gas: ${null!==(t=e.gas)&&void 0!==t?t:"undefined"}, gasPrice: ${null!==(r=e.gasPrice)&&void 0!==r?r:"undefined"}`,"Gas or gasPrice is lower than 0"),this.code=n.ERR_TX_INVALID_LEGACY_GAS}}t.InvalidGasOrGasPrice=A;class _ extends i.InvalidValueError{constructor(e){var t,r;super(`maxPriorityFeePerGas: ${null!==(t=e.maxPriorityFeePerGas)&&void 0!==t?t:"undefined"}, maxFeePerGas: ${null!==(r=e.maxFeePerGas)&&void 0!==r?r:"undefined"}`,"maxPriorityFeePerGas or maxFeePerGas is lower than 0"),this.code=n.ERR_TX_INVALID_FEE_MARKET_GAS}}t.InvalidMaxPriorityFeePerGasOrMaxFeePerGas=_;class T extends i.InvalidValueError{constructor(e){super(e,"eip-1559 transactions don't support gasPrice"),this.code=n.ERR_TX_INVALID_FEE_MARKET_GAS_PRICE}}t.Eip1559GasPriceError=T;class I extends i.InvalidValueError{constructor(e){var t,r;super(`maxPriorityFeePerGas: ${null!==(t=e.maxPriorityFeePerGas)&&void 0!==t?t:"undefined"}, maxFeePerGas: ${null!==(r=e.maxFeePerGas)&&void 0!==r?r:"undefined"}`,"pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas"),this.code=n.ERR_TX_INVALID_LEGACY_FEE_MARKET}}t.UnsupportedFeeMarketError=I;class x extends i.InvalidValueError{constructor(e){super(e,"invalid transaction object"),this.code=n.ERR_TX_INVALID_OBJECT}}t.InvalidTransactionObjectError=x;class R extends i.InvalidValueError{constructor(e){var t,r;super(`nonce: ${null!==(t=e.nonce)&&void 0!==t?t:"undefined"}, chainId: ${null!==(r=e.chainId)&&void 0!==r?r:"undefined"}`,"Nonce or chainId is lower than 0"),this.code=n.ERR_TX_INVALID_NONCE_OR_CHAIN_ID}}t.InvalidNonceOrChainIdError=R;class P extends i.InvalidValueError{constructor(){super("UnableToPopulateNonceError","unable to populate nonce, no from address available"),this.code=n.ERR_TX_UNABLE_TO_POPULATE_NONCE}}t.UnableToPopulateNonceError=P;class C extends i.InvalidValueError{constructor(){super("Eip1559NotSupportedError","Network doesn't support eip-1559"),this.code=n.ERR_TX_UNSUPPORTED_EIP_1559}}t.Eip1559NotSupportedError=C;class k extends i.InvalidValueError{constructor(e){super(e,"unsupported transaction type"),this.code=n.ERR_TX_UNSUPPORTED_TYPE}}t.UnsupportedTransactionTypeError=k;class S extends i.InvalidValueError{constructor(e){var t,r;super(`data: ${null!==(t=e.data)&&void 0!==t?t:"undefined"}, input: ${null!==(r=e.input)&&void 0!==r?r:"undefined"}`,'You can\'t have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.'),this.code=n.ERR_TX_DATA_AND_INPUT}}t.TransactionDataAndInputError=S;class O extends i.BaseWeb3Error{constructor(e){super(`The connected Ethereum Node did not respond within ${e.numberOfSeconds} seconds, please make sure your transaction was properly sent and you are connected to a healthy Node. Be aware that transaction might still be pending or mined! Transaction Hash: ${e.transactionHash?e.transactionHash.toString():"not available"}`),this.code=n.ERR_TX_SEND_TIMEOUT}}function N(e){return`Please make sure your transaction was properly sent and there are no previous pending transaction for the same account. However, be aware that it might still be mined! Transaction Hash: ${e?e.toString():"not available"}`}t.TransactionSendTimeoutError=O;class B extends i.BaseWeb3Error{constructor(e){super(`Transaction was not mined within ${e.numberOfSeconds} seconds. ${N(e.transactionHash)}`),this.code=n.ERR_TX_POLLING_TIMEOUT}}t.TransactionPollingTimeoutError=B;class M extends i.BaseWeb3Error{constructor(e){super(`Transaction started at ${e.starterBlockNumber} but was not mined within ${e.numberOfBlocks} blocks. ${N(e.transactionHash)}`),this.code=n.ERR_TX_BLOCK_TIMEOUT}}t.TransactionBlockTimeoutError=M;class L extends i.InvalidValueError{constructor(e){var t,r;super(`receipt: ${JSON.stringify(e.receipt)}, blockHash: ${null===(t=e.blockHash)||void 0===t?void 0:t.toString()}, transactionHash: ${null===(r=e.transactionHash)||void 0===r?void 0:r.toString()}`,"Receipt missing or blockHash null"),this.code=n.ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL}}t.TransactionMissingReceiptOrBlockHashError=L;class D extends i.InvalidValueError{constructor(e){super(`receipt: ${JSON.stringify(e.receipt)}`,"Receipt missing block number"),this.code=n.ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER}}t.TransactionReceiptMissingBlockNumberError=D;class H extends i.BaseWeb3Error{constructor(e){super(`Invalid signature. "${e}"`),this.code=n.ERR_TX_SIGNING}}t.TransactionSigningError=H;class F extends i.InvalidValueError{constructor(){super("LocalWalletNotAvailableError","Attempted to index account in local wallet, but no wallet is available"),this.code=n.ERR_TX_LOCAL_WALLET_NOT_AVAILABLE}}t.LocalWalletNotAvailableError=F;class j extends i.BaseWeb3Error{constructor(e,t){let r=[];e.forEach(e=>r.push(e.keyword)),super(`The following properties are invalid for the transaction type ${t}: ${r.join(", ")}`),this.code=n.ERR_TX_INVALID_PROPERTIES_FOR_TYPE}}t.InvalidPropertiesForTransactionTypeError=j},3888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidTypeAbiInputError=t.InvalidBlockError=t.InvalidLargeValueError=t.InvalidSizeError=t.InvalidUnsignedIntegerError=t.InvalidBooleanError=t.InvalidTypeError=t.NibbleWidthError=t.HexProcessingError=t.InvalidIntegerError=t.InvalidUnitError=t.InvalidStringError=t.InvalidAddressError=t.InvalidNumberError=t.InvalidBytesError=void 0;let n=r(3394),i=r(2679);class o extends i.InvalidValueError{constructor(e){super(e,"can not parse as byte data"),this.code=n.ERR_INVALID_BYTES}}t.InvalidBytesError=o;class s extends i.InvalidValueError{constructor(e){super(e,"can not parse as number data"),this.code=n.ERR_INVALID_NUMBER}}t.InvalidNumberError=s;class a extends i.InvalidValueError{constructor(e){super(e,"invalid ethereum address"),this.code=n.ERR_INVALID_ADDRESS}}t.InvalidAddressError=a;class l extends i.InvalidValueError{constructor(e){super(e,"not a valid string"),this.code=n.ERR_INVALID_STRING}}t.InvalidStringError=l;class c extends i.InvalidValueError{constructor(e){super(e,"invalid unit"),this.code=n.ERR_INVALID_UNIT}}t.InvalidUnitError=c;class d extends i.InvalidValueError{constructor(e){super(e,"not a valid unit. Must be a positive integer"),this.code=n.ERR_INVALID_INTEGER}}t.InvalidIntegerError=d;class u extends i.InvalidValueError{constructor(e){super(e,"can not be converted to hex"),this.code=n.ERR_INVALID_HEX}}t.HexProcessingError=u;class h extends i.InvalidValueError{constructor(e){super(e,"value greater than the nibble width"),this.code=n.ERR_INVALID_NIBBLE_WIDTH}}t.NibbleWidthError=h;class f extends i.InvalidValueError{constructor(e){super(e,"invalid type, type not supported"),this.code=n.ERR_INVALID_TYPE}}t.InvalidTypeError=f;class p extends i.InvalidValueError{constructor(e){super(e,"not a valid boolean."),this.code=n.ERR_INVALID_BOOLEAN}}t.InvalidBooleanError=p;class m extends i.InvalidValueError{constructor(e){super(e,"not a valid unsigned integer."),this.code=n.ERR_INVALID_UNSIGNED_INTEGER}}t.InvalidUnsignedIntegerError=m;class g extends i.InvalidValueError{constructor(e){super(e,"invalid size given."),this.code=n.ERR_INVALID_SIZE}}t.InvalidSizeError=g;class y extends i.InvalidValueError{constructor(e){super(e,"value is larger than size."),this.code=n.ERR_INVALID_LARGE_VALUE}}t.InvalidLargeValueError=y;class b extends i.InvalidValueError{constructor(e){super(e,"invalid string given"),this.code=n.ERR_INVALID_BLOCK}}t.InvalidBlockError=b;class v extends i.InvalidValueError{constructor(e){super(e,"components found but type is not tuple"),this.code=n.ERR_INVALID_TYPE_ABI}}t.InvalidTypeAbiInputError=v},1633:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3394),t),i(r(2679),t),i(r(646),t),i(r(3427),t),i(r(3341),t),i(r(3155),t),i(r(3572),t),i(r(2240),t),i(r(2165),t),i(r(4187),t),i(r(3888),t),i(r(462),t),i(r(1294),t),i(r(2634),t),i(r(6222),t),i(r(4710),t)},2679:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidValueError=t.MultipleErrors=t.BaseWeb3Error=void 0;let n=r(3394);class i extends Error{get innerError(){return this.cause instanceof o?this.cause.errors:this.cause}set innerError(e){Array.isArray(e)?this.cause=new o(e):this.cause=e}constructor(e,t){super(e),Array.isArray(t)?this.cause=new o(t):this.cause=t,this.name=this.constructor.name,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(new.target.constructor):this.stack=Error().stack}static convertToString(e,t=!1){if(null==e)return"undefined";let r=JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t);return t&&["bigint","string"].includes(typeof e)?r.replace(/['\\"]+/g,""):r}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:this.cause,innerError:this.cause}}}t.BaseWeb3Error=i;class o extends i{constructor(e){super(`Multiple errors occurred: [${e.map(e=>e.message).join("], [")}]`),this.code=n.ERR_MULTIPLE_ERRORS,this.errors=e}}t.MultipleErrors=o,t.InvalidValueError=class extends i{constructor(e,t){super(`Invalid value given "${i.convertToString(e,!0)}". Error: ${t}.`),this.name=this.constructor.name}}},6681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeErrorSignature=void 0;let n=r(6825),i=r(1633),o=r(3463);t.encodeErrorSignature=e=>{let t;if("string"!=typeof e&&!(0,o.isAbiErrorFragment)(e))throw new i.AbiError("Invalid parameter value in encodeErrorSignature");return t=e&&("function"==typeof e||"object"==typeof e)?(0,o.jsonInterfaceMethodToString)(e):e,(0,n.sha3Raw)(t)}},6483:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeEventSignature=void 0;let n=r(6825),i=r(1633),o=r(3463);t.encodeEventSignature=e=>{let t;if("string"!=typeof e&&!(0,o.isAbiEventFragment)(e))throw new i.AbiError("Invalid parameter value in encodeEventSignature");return t=e&&("function"==typeof e||"object"==typeof e)?(0,o.jsonInterfaceMethodToString)(e):e,(0,n.sha3Raw)(t)}},3787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeFunctionReturn=t.decodeFunctionCall=t.encodeFunctionCall=t.encodeFunctionSignature=void 0;let n=r(1633),i=r(6825),o=r(3463),s=r(5594);t.encodeFunctionSignature=e=>{let t;if("string"!=typeof e&&!(0,o.isAbiFunctionFragment)(e))throw new n.AbiError("Invalid parameter value in encodeFunctionSignature");return t=e&&("function"==typeof e||"object"==typeof e)?(0,o.jsonInterfaceMethodToString)(e):e,(0,i.sha3Raw)(t).slice(0,10)},t.encodeFunctionCall=(e,r)=>{var i;if(!(0,o.isAbiFunctionFragment)(e))throw new n.AbiError("Invalid parameter value in encodeFunctionCall");return`${(0,t.encodeFunctionSignature)(e)}${(0,s.encodeParameters)(null!==(i=e.inputs)&&void 0!==i?i:[],null!=r?r:[]).replace("0x","")}`},t.decodeFunctionCall=(e,t,r=!0)=>{let i=r&&t&&t.length>=10&&t.startsWith("0x")?t.slice(10):t;if(!e.inputs)throw new n.Web3ContractError("No inputs found in the ABI");return Object.assign(Object.assign({},(0,s.decodeParameters)([...e.inputs],i)),{__method__:(0,o.jsonInterfaceMethodToString)(e)})},t.decodeFunctionReturn=(e,t)=>{if("constructor"===e.type)return t;if(!t)return null;let r=t.length>=2?t.slice(2):t;if(!e.outputs)return null;let n=(0,s.decodeParameters)([...e.outputs],r);return 1===n.__length__?n[0]:n}},9877:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeLog=void 0;let n=r(5594),i=["bool","string","int","uint","address","fixed","ufixed"];t.decodeLog=(e,t,r)=>{let o=Array.isArray(r)?r:[r],s={},a={};for(let[t,r]of e.entries())r.indexed?s[t]=r:a[t]=r;let l=t?(0,n.decodeParametersWith)(Object.values(a),t,!0):{__length__:0},c=o.length-Object.keys(s).length,d=Object.values(s).map((e,t)=>{var r,s;return i.some(t=>e.type.startsWith(t))?(r=e.type,s=o[t+c],"string"===r?s:(0,n.decodeParameter)(r,s)):o[t+c]}),u={__length__:0},h=0,f=0;for(let[t,r]of e.entries())u[t]="string"===r.type?"":void 0,s[t]&&(u[t]=d[h],h+=1),a[t]&&(u[t]=l[String(f)],f+=1),r.name&&(u[r.name]=u[t]),u.__length__+=1;return u}},5594:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameter=t.decodeParameters=t.decodeParametersWith=t.encodeParameter=t.inferTypesAndEncodeParameters=t.encodeParameters=void 0;let n=r(1633),i=r(9815),o=r(1235);var s=r(1235);Object.defineProperty(t,"encodeParameters",{enumerable:!0,get:function(){return s.encodeParameters}}),Object.defineProperty(t,"inferTypesAndEncodeParameters",{enumerable:!0,get:function(){return s.inferTypesAndEncodeParameters}}),t.encodeParameter=(e,t)=>(0,o.encodeParameters)([e],[t]),t.decodeParametersWith=(e,t,r)=>{try{if(e.length>0&&(!t||"0x"===t||"0X"===t))throw new n.AbiError("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");return(0,i.decodeParameters)(e,`0x${t.replace(/0x/i,"")}`,r)}catch(e){throw new n.AbiError(`Parameter decoding error: ${e.message}`,{internalErr:e})}},t.decodeParameters=(e,r)=>(0,t.decodeParametersWith)(e,r,!1),t.decodeParameter=(e,r)=>(0,t.decodeParameters)([e],r)[0]},3019:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeAddress=function(e,t){if("string"!=typeof t)throw new n.AbiError("address type expects string as input type",{value:t,name:e.name,type:e.type});let r=t.toLowerCase();if(r.startsWith("0x")||(r=`0x${r}`),!(0,o.isAddress)(r))throw new n.AbiError("provided input is not valid address",{value:t,name:e.name,type:e.type});let i=o.utils.hexToUint8Array(r),a=(0,s.alloc)(s.WORD_SIZE);return a.set(i,l),{dynamic:!1,encoded:a}},t.decodeAddress=function(e,t){let r=t.subarray(l,s.WORD_SIZE);if(r.length!==a)throw new n.AbiError("Invalid decoding input, not enough bytes to decode address",{bytes:t});let c=o.utils.uint8ArrayToHexString(r);return{result:(0,i.toChecksumAddress)(c),encoded:t.subarray(s.WORD_SIZE),consumed:s.WORD_SIZE}};let n=r(1633),i=r(6825),o=r(7244),s=r(7576),a=20,l=s.WORD_SIZE-a},1978:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeArray=function(e,t){if(!Array.isArray(t))throw new n.AbiError("Expected value to be array",{abi:e,values:t});let{size:r,param:a}=(0,s.extractArrayType)(e),c=t.map(e=>(0,o.encodeParamFromAbiParameter)(a,e)),d=-1===r,u=c.length>0&&c[0].dynamic;if(!d&&t.length!==r)throw new n.AbiError("Given arguments count doesn't match array length",{arrayLength:r,argumentsLength:t.length});if(d||u){let e=(0,l.encodeDynamicParams)(c);if(d){let t=(0,o.encodeNumber)({type:"uint256",name:""},c.length).encoded;return{dynamic:!0,encoded:c.length>0?(0,i.uint8ArrayConcat)(t,e):t}}return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,i.uint8ArrayConcat)(...c.map(e=>e.encoded))}},t.decodeArray=function(e,t){let{size:r,param:n}=(0,s.extractArrayType)(e),i=0,l=[],c=t;if(-1===r){let e=(0,a.decodeNumber)({type:"uint32",name:""},t);r=Number(e.result),i=e.consumed,c=e.encoded}if((0,s.isDynamic)(n)){for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBoolean=function(e,t){let r;try{r=(0,i.toBool)(t)}catch(r){if(r instanceof n.InvalidBooleanError)throw new n.AbiError("provided input is not valid boolean value",{type:e.type,value:t,name:e.name})}return(0,s.encodeNumber)({type:"uint8",name:""},Number(r))},t.decodeBool=function(e,t){let r=(0,s.decodeNumber)({type:"uint8",name:""},t);if(r.result>1||r.result<0)throw new n.AbiError("Invalid boolean value encoded",{boolBytes:t.subarray(0,o.WORD_SIZE),numberResult:r});return{result:r.result===BigInt(1),encoded:r.encoded,consumed:o.WORD_SIZE}};let n=r(1633),i=r(6825),o=r(7576),s=r(6022)},1148:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBytes=function(e,t){if("string"==typeof t&&t.length%2!=0&&(t+="0"),!(0,o.isBytes)(t))throw new n.AbiError("provided input is not valid bytes value",{type:e.type,value:t,name:e.name});let r=(0,i.bytesToUint8Array)(t),[,c]=e.type.split("bytes");if(c){if(Number(c)>l||1>Number(c))throw new n.AbiError("invalid bytes type. Static byte type can have between 1 and 32 bytes",{type:e.type});if(Number(c)t.length)throw new n.AbiError("there is not enough data to decode",{type:e.type,encoded:t,size:o});return{result:(0,i.bytesToHex)(l.subarray(0,o)),encoded:l.subarray(c*s.WORD_SIZE),consumed:d+c*s.WORD_SIZE}};let n=r(1633),i=r(6825),o=r(7244),s=r(7576),a=r(6022),l=32},7151:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeArray=t.encodeArray=t.decodeTuple=t.encodeTuple=t.decodeString=t.encodeString=t.decodeNumber=t.encodeNumber=t.decodeBytes=t.encodeBytes=t.decodeBool=t.encodeBoolean=t.decodeAddress=t.encodeAddress=void 0,t.encodeParamFromAbiParameter=function(e,t){if("string"===e.type)return(0,l.encodeString)(e,t);if("bool"===e.type)return(0,o.encodeBoolean)(e,t);if("address"===e.type)return(0,i.encodeAddress)(e,t);if("tuple"===e.type)return(0,c.encodeTuple)(e,t);if(e.type.endsWith("]"))return(0,d.encodeArray)(e,t);if(e.type.startsWith("bytes"))return(0,s.encodeBytes)(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return(0,a.encodeNumber)(e,t);throw new n.AbiError("Unsupported",{param:e,value:t})},t.decodeParamFromAbiParameter=function(e,t){if("string"===e.type)return(0,l.decodeString)(e,t);if("bool"===e.type)return(0,o.decodeBool)(e,t);if("address"===e.type)return(0,i.decodeAddress)(e,t);if("tuple"===e.type)return(0,c.decodeTuple)(e,t);if(e.type.endsWith("]"))return(0,d.decodeArray)(e,t);if(e.type.startsWith("bytes"))return(0,s.decodeBytes)(e,t);if(e.type.startsWith("uint")||e.type.startsWith("int"))return(0,a.decodeNumber)(e,t);throw new n.AbiError("Unsupported",{param:e,bytes:t})};let n=r(1633),i=r(3019),o=r(4715),s=r(1148),a=r(6022),l=r(7390),c=r(4141),d=r(1978);var u=r(3019);Object.defineProperty(t,"encodeAddress",{enumerable:!0,get:function(){return u.encodeAddress}}),Object.defineProperty(t,"decodeAddress",{enumerable:!0,get:function(){return u.decodeAddress}});var h=r(4715);Object.defineProperty(t,"encodeBoolean",{enumerable:!0,get:function(){return h.encodeBoolean}}),Object.defineProperty(t,"decodeBool",{enumerable:!0,get:function(){return h.decodeBool}});var f=r(1148);Object.defineProperty(t,"encodeBytes",{enumerable:!0,get:function(){return f.encodeBytes}}),Object.defineProperty(t,"decodeBytes",{enumerable:!0,get:function(){return f.decodeBytes}});var p=r(6022);Object.defineProperty(t,"encodeNumber",{enumerable:!0,get:function(){return p.encodeNumber}}),Object.defineProperty(t,"decodeNumber",{enumerable:!0,get:function(){return p.decodeNumber}});var m=r(7390);Object.defineProperty(t,"encodeString",{enumerable:!0,get:function(){return m.encodeString}}),Object.defineProperty(t,"decodeString",{enumerable:!0,get:function(){return m.decodeString}});var g=r(4141);Object.defineProperty(t,"encodeTuple",{enumerable:!0,get:function(){return g.encodeTuple}}),Object.defineProperty(t,"decodeTuple",{enumerable:!0,get:function(){return g.decodeTuple}});var y=r(1978);Object.defineProperty(t,"encodeArray",{enumerable:!0,get:function(){return y.encodeArray}}),Object.defineProperty(t,"decodeArray",{enumerable:!0,get:function(){return y.decodeArray}})},6022:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeNumber=function(e,t){let r;try{r=(0,i.toBigInt)(t)}catch(r){throw new n.AbiError("provided input is not number value",{type:e.type,value:t,name:e.name})}let c=a.numberLimits.get(e.type);if(!c)throw new n.AbiError("provided abi contains invalid number datatype",{type:e.type});if(rc.max)throw new n.AbiError("provided input is greater then maximum for given type",{type:e.type,value:t,name:e.name,maximum:c.max.toString()});return{dynamic:!1,encoded:function(e,t=s.WORD_SIZE){let r;return r=e<0?(l+e).toString(16):e.toString(16),r=(0,i.padLeft)(r,2*t),o.utils.hexToUint8Array(r)}(r)}},t.decodeNumber=function(e,t){if(t.lengthi.max)throw new n.AbiError("decoded value is greater then maximum for given type",{type:e.type,value:c,name:e.name,maximum:i.max.toString()});return{result:c,encoded:t.subarray(s.WORD_SIZE),consumed:s.WORD_SIZE}};let n=r(1633),i=r(6825),o=r(7244),s=r(7576),a=r(4177),l=BigInt(1)<{Object.defineProperty(t,"__esModule",{value:!0}),t.numberLimits=void 0,t.numberLimits=new Map;let r=BigInt(256);for(let e=8;e<=256;e+=8)t.numberLimits.set(`uint${e}`,{min:BigInt(0),max:r-BigInt(1)}),t.numberLimits.set(`int${e}`,{min:-r/BigInt(2),max:r/BigInt(2)-BigInt(1)}),r*=BigInt(256);t.numberLimits.set("int",t.numberLimits.get("int256")),t.numberLimits.set("uint",t.numberLimits.get("uint256"))},7390:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeString=function(e,t){if("string"!=typeof t)throw new n.AbiError("invalid input, should be string",{input:t});let r=(0,i.utf8ToBytes)(t);return(0,o.encodeBytes)({type:"bytes",name:""},r)},t.decodeString=function(e,t){let r=(0,o.decodeBytes)({type:"bytes",name:""},t);return{result:(0,i.hexToUtf8)(r.result),encoded:r.encoded,consumed:r.consumed}};let n=r(1633),i=r(6825),o=r(1148)},4141:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeTuple=function(e,t){var r,a,l;let c=!1;if(!Array.isArray(t)&&"object"!=typeof t)throw new n.AbiError("param must be either Array or Object",{param:e,input:t});let d=[];for(let i=0;i<(null!==(a=null===(r=e.components)||void 0===r?void 0:r.length)&&void 0!==a?a:0);i+=1){let r;let s=e.components[i];if(Array.isArray(t)){if(i>=t.length)throw new n.AbiError("input param length missmatch",{param:e,input:t});r=(0,o.encodeParamFromAbiParameter)(s,t[i])}else{let i=t[null!==(l=s.name)&&void 0!==l?l:""];if(null==i)throw new n.AbiError("missing input defined in abi",{param:e,input:t,paramName:s.name});r=(0,o.encodeParamFromAbiParameter)(s,i)}r.dynamic&&(c=!0),d.push(r)}return c?{dynamic:!0,encoded:(0,s.encodeDynamicParams)(d)}:{dynamic:!1,encoded:(0,i.uint8ArrayConcat)(...d.map(e=>e.encoded))}},t.decodeTuple=function(e,t){let r={__length__:0},n=0;if(!e.components)return{result:r,encoded:t,consumed:n};let i=0;for(let[s,c]of e.components.entries()){let e;if((0,a.isDynamic)(c)){let r=(0,l.decodeNumber)({type:"uint32",name:""},t.subarray(n));e=(0,o.decodeParamFromAbiParameter)(c,t.subarray(Number(r.result))),n+=r.consumed,i+=e.consumed}else e=(0,o.decodeParamFromAbiParameter)(c,t.subarray(n)),n+=e.consumed;r.__length__+=1,r[s]=e.result,c.name&&""!==c.name&&(r[c.name]=e.result)}return{encoded:t.subarray(n+i),result:r,consumed:n+i}};let n=r(1633),i=r(6825),o=r(7151),s=r(826),a=r(7576),l=r(6022)},826:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeDynamicParams=function(e){let t=0,r=0,s=[],a=[];for(let r of e)r.dynamic?t+=i.WORD_SIZE:t+=r.encoded.length;for(let n of e)n.dynamic?(s.push((0,o.encodeNumber)({type:"uint256",name:""},t+r)),a.push(n),r+=n.encoded.length):s.push(n);return(0,n.uint8ArrayConcat)(...s.map(e=>e.encoded),...a.map(e=>e.encoded))};let n=r(6825),i=r(7576),o=r(6022)},9815:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=function(e,t,r){let s=(0,o.toAbiParams)(e),a=n.utils.hexToUint8Array(t);return(0,i.decodeTuple)({type:"tuple",name:"",components:s},a).result};let n=r(7244),i=r(4141),o=r(7576)},1235:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeParameters=function(e,t){if((null==e?void 0:e.length)!==t.length)throw new n.AbiError("Invalid number of values received for given ABI",{expected:null==e?void 0:e.length,received:t.length});let r=(0,a.toAbiParams)(e);return o.utils.uint8ArrayToHexString((0,s.encodeTuple)({type:"tuple",name:"",components:r},t).encoded)},t.inferTypesAndEncodeParameters=function(e){try{let t=function e(t){let r=[];return t.forEach(t=>{if(Array.isArray(t)){let n=e(t);r.push({type:"tuple",components:n,name:""})}else r.push({type:(0,i.toHex)(t,!0)})}),r}(e);return o.utils.uint8ArrayToHexString((0,s.encodeTuple)({type:"tuple",name:"",components:t},e).encoded)}catch(t){throw new n.AbiError("Could not infer types from given params",{params:e})}};let n=r(1633),i=r(6825),o=r(7244),s=r(7151),a=r(7576)},7576:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WORD_SIZE=void 0,t.alloc=function(e=0){var t;if(void 0!==(null===(t=globalThis.Buffer)||void 0===t?void 0:t.alloc)){let t=globalThis.Buffer.alloc(e);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return new Uint8Array(e)},t.allocUnsafe=function(e=0){var t;if(void 0!==(null===(t=globalThis.Buffer)||void 0===t?void 0:t.allocUnsafe)){let t=globalThis.Buffer.allocUnsafe(e);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return new Uint8Array(e)},t.convertExternalAbiParameter=a,t.isAbiParameter=l,t.toAbiParams=function(e){return e.map(e=>{var t;if(l(e))return e;if("string"==typeof e)return a((0,n.parseAbiParameter)(e.replace(/tuple/,"")));if((0,s.isSimplifiedStructFormat)(e)){let r=Object.keys(e)[0],n=(0,s.mapStructNameAndType)(r);return n.name=null!==(t=n.name)&&void 0!==t?t:"",Object.assign(Object.assign({},n),{components:(0,s.mapStructToCoderFormat)(e[r])})}throw new i.AbiError("Invalid abi")})},t.extractArrayType=c,t.isDynamic=function e(t){var r,n;return!("string"!==t.type&&"bytes"!==t.type&&!t.type.endsWith("[]"))||("tuple"===t.type?null!==(n=null===(r=t.components)||void 0===r?void 0:r.some(e))&&void 0!==n&&n:!!t.type.endsWith("]")&&e(c(t).param))};let n=r(6366),i=r(1633),o=r(6825),s=r(3463);function a(e){var t,r;return Object.assign(Object.assign({},e),{name:null!==(t=e.name)&&void 0!==t?t:"",components:null===(r=e.components)||void 0===r?void 0:r.map(e=>a(e))})}function l(e){return!(0,o.isNullish)(e)&&"object"==typeof e&&!(0,o.isNullish)(e.type)&&"string"==typeof e.type}function c(e){let t=e.type.lastIndexOf("["),r=e.type.substring(0,t),n=e.type.substring(t),o=-1;if("[]"!==n&&isNaN(o=Number(n.slice(1,-1))))throw new i.AbiError("Invalid fixed array size",{size:n});return{param:{type:r,name:"",components:e.components},size:o}}t.WORD_SIZE=32},1013:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeContractErrorData=void 0;let n=r(6681),i=r(5594),o=r(3463);t.decodeContractErrorData=(e,t)=>{if(null==t?void 0:t.data){let r,s,a;try{let l=t.data.slice(0,10),c=e.find(e=>(0,n.encodeErrorSignature)(e).startsWith(l));(null==c?void 0:c.inputs)?(r=c.name,s=(0,o.jsonInterfaceMethodToString)(c),a=(0,i.decodeParameters)([...c.inputs],t.data.substring(10))):t.data.startsWith("0x08c379a0")?(r="Error",s="Error(string)",a=(0,i.decodeParameters)([{name:"message",type:"string"}],t.data.substring(10))):t.data.startsWith("0x4e487b71")?(r="Panic",s="Panic(uint256)",a=(0,i.decodeParameters)([{name:"code",type:"uint256"}],t.data.substring(10))):console.error("No matching error abi found for error data",t.data)}catch(e){console.error(e)}r&&t.setDecodedProperties(r,s,a)}}},7053:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getMessage=void 0;let n=r(6825),i=r(1633),o=r(1235),s=/^\w+/,a=/^(.*)\[([0-9]*?)]$/,l=(e,t,r=[])=>{let n=t.match(s)[0];return r.includes(n)?r:e.types[n]?[n,...e.types[n].reduce((t,r)=>[...t,...l(e,r.type,t).filter(e=>!t.includes(e))],[])]:r},c=(e,t)=>(0,n.keccak256)(((e,t)=>{let[r,...n]=l(e,t);return[r,...n.sort()].map(t=>`${t}(${e.types[t].map(e=>`${e.type} ${e.name}`)})`).join("")})(e,t)),d=(e,t,r)=>(0,n.keccak256)(h(e,t,r));t.getMessage=(e,t)=>{let r=`0x1901${d(e,"EIP712Domain",e.domain).substring(2)}${d(e,e.primaryType,e.message).substring(2)}`;return t?(0,n.keccak256)(r):r};let u=(e,t,r)=>{let s=t.match(a);if(s){let t=s[1],a=Number(s[2])||void 0;if(!Array.isArray(r))throw new i.AbiError("Cannot encode data: value is not of array type",{data:r});if(a&&r.length!==a)throw new i.AbiError(`Cannot encode data: expected length of ${a}, but got ${r.length}`,{data:r});let l=r.map(r=>u(e,t,r)),c=l.map(e=>e[0]),d=l.map(e=>e[1]);return["bytes32",(0,n.keccak256)((0,o.encodeParameters)(c,d))]}return e.types[t]?["bytes32",d(e,t,r)]:"string"===t||"bytes"===t?["bytes32",(0,n.keccak256)(r)]:[t,r]},h=(e,t,r)=>{let[s,a]=e.types[t].reduce(([t,o],s)=>{if((0,n.isNullish)(r[s.name])||(0,n.isNullish)(s.type))throw new i.AbiError(`Cannot encode data: missing data for '${s.name}'`,{data:r,field:s});let a=r[s.name],[l,c]=u(e,s.type,a);return[[...t,l],[...o,c]]},[["bytes32"],[c(e,t)]]);return(0,o.encodeParameters)(s,a)}},7894:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.getEncodedEip712Data=void 0,i(r(6681),t),i(r(6483),t),i(r(3787),t),i(r(9877),t),i(r(5594),t),i(r(3463),t),i(r(1013),t);var o=r(7053);Object.defineProperty(t,"getEncodedEip712Data",{enumerable:!0,get:function(){return o.getMessage}})},3463:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.jsonInterfaceMethodToString=t.flattenTypes=t.formatParam=t.formatOddHexstrings=t.isOddHexstring=t.mapTypes=t.mapStructToCoderFormat=t.mapStructNameAndType=t.isSimplifiedStructFormat=t.isAbiConstructorFragment=t.isAbiFunctionFragment=t.isAbiEventFragment=t.isAbiErrorFragment=t.isAbiFragment=void 0;let n=r(1633),i=r(6825);t.isAbiFragment=e=>!(0,i.isNullish)(e)&&"object"==typeof e&&!(0,i.isNullish)(e.type)&&["function","event","constructor","error"].includes(e.type),t.isAbiErrorFragment=e=>!(0,i.isNullish)(e)&&"object"==typeof e&&!(0,i.isNullish)(e.type)&&"error"===e.type,t.isAbiEventFragment=e=>!(0,i.isNullish)(e)&&"object"==typeof e&&!(0,i.isNullish)(e.type)&&"event"===e.type,t.isAbiFunctionFragment=e=>!(0,i.isNullish)(e)&&"object"==typeof e&&!(0,i.isNullish)(e.type)&&"function"===e.type,t.isAbiConstructorFragment=e=>!(0,i.isNullish)(e)&&"object"==typeof e&&!(0,i.isNullish)(e.type)&&"constructor"===e.type,t.isSimplifiedStructFormat=e=>"object"==typeof e&&void 0===e.components&&void 0===e.name,t.mapStructNameAndType=e=>e.includes("[]")?{type:"tuple[]",name:e.slice(0,-2)}:{type:"tuple",name:e},t.mapStructToCoderFormat=e=>{let r=[];for(let n of Object.keys(e)){let i=e[n];"object"==typeof i?r.push(Object.assign(Object.assign({},(0,t.mapStructNameAndType)(n)),{components:(0,t.mapStructToCoderFormat)(i)})):r.push({name:n,type:e[n]})}return r},t.mapTypes=e=>{let r=[];for(let n of e){let e=n;if("object"==typeof n&&(e=Object.assign({},n)),"object"==typeof n&&"function"===n.type&&(e=Object.assign(Object.assign({},n),{type:"bytes24"})),(0,t.isSimplifiedStructFormat)(e)){let n=Object.keys(e)[0];r.push(Object.assign(Object.assign({},(0,t.mapStructNameAndType)(n)),{components:(0,t.mapStructToCoderFormat)(e[n])}))}else r.push(e)}return r},t.isOddHexstring=e=>"string"==typeof e&&/^(-)?0x[0-9a-f]*$/i.test(e)&&e.length%2==1,t.formatOddHexstrings=e=>(0,t.isOddHexstring)(e)?`0x0${e.substring(2)}`:e;let o=/^bytes([0-9]*)$/,s=/^bytes([0-9]*)\[\]$/,a=/^(u?int)([0-9]*)$/,l=/^(u?int)([0-9]*)\[\]$/;t.formatParam=(e,r)=>{let n="object"!=typeof r||Array.isArray(r)?r:Object.assign({},r);if(n instanceof BigInt||"bigint"==typeof n)return n.toString(10);if(s.exec(e)||l.exec(e))return[...n].map(r=>(0,t.formatParam)(e.replace("[]",""),r));let c=a.exec(e);if(c){let e=parseInt(c[2]?c[2]:"256",10);if(e/8{let i=[];return r.forEach(r=>{if("object"==typeof r.components){if(!r.type.startsWith("tuple"))throw new n.AbiError(`Invalid value given "${r.type}". Error: components found but type is not tuple.`);let o=r.type.indexOf("["),s=o>=0?r.type.substring(o):"",a=(0,t.flattenTypes)(e,r.components);Array.isArray(a)&&e?i.push(`tuple(${a.join(",")})${s}`):e?i.push(`(${a.join()})`):i.push(`(${a.join(",")})${s}`)}else i.push(r.type)}),i},t.jsonInterfaceMethodToString=e=>{var r,n,i,o;return(0,t.isAbiErrorFragment)(e)||(0,t.isAbiEventFragment)(e)||(0,t.isAbiFunctionFragment)(e)?(null===(r=e.name)||void 0===r?void 0:r.includes("("))?e.name:`${null!==(n=e.name)&&void 0!==n?n:""}(${(0,t.flattenTypes)(!1,null!==(i=e.inputs)&&void 0!==i?i:[]).join(",")})`:`(${(0,t.flattenTypes)(!1,null!==(o=e.inputs)&&void 0!==o?o:[]).join(",")})`}},933:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.create=t.privateKeyToAccount=t.encrypt=t.privateKeyToPublicKey=t.privateKeyToAddress=t.recover=t.recoverTransaction=t.signTransaction=t.signRaw=t.sign=t.signMessageWithPrivateKey=t.hashMessage=t.parseAndValidatePrivateKey=void 0;let i=r(9303),o=r(5711),s=r(3301),a=r(1633),l=r(6825),c=r(7244),d=r(114),u=r(9386),h=r(2685);t.parseAndValidatePrivateKey=(e,t)=>{let r;if(!t&&"string"==typeof e&&(0,c.isHexStrict)(e)&&66!==e.length)throw new a.PrivateKeyLengthError;try{r=(0,l.isUint8Array)(e)?e:(0,l.bytesToUint8Array)(e)}catch(e){throw new a.InvalidPrivateKeyError}if(!t&&32!==r.byteLength)throw new a.PrivateKeyLengthError;return r},t.hashMessage=(e,t=!1)=>{let r=(0,c.isHexStrict)(e)?e:(0,l.utf8ToHex)(e),n=(0,l.hexToBytes)(r),i=(0,l.hexToBytes)((0,l.fromUtf8)(`Ethereum Signed Message: ${n.byteLength}`)),o=t?n:(0,l.uint8ArrayConcat)(i,n);return(0,l.sha3Raw)(o)},t.signMessageWithPrivateKey=(e,r)=>{let n=(0,t.parseAndValidatePrivateKey)(r),i=d.secp256k1.sign(e.substring(2),n),o=i.toCompactRawBytes(),s=i.r.toString(16).padStart(64,"0"),a=i.s.toString(16).padStart(64,"0"),c=i.recovery+27;return{messageHash:e,v:(0,l.numberToHex)(c),r:`0x${s}`,s:`0x${a}`,signature:`${(0,l.bytesToHex)(o)}${c.toString(16)}`}},t.sign=(e,r)=>{let n=(0,t.hashMessage)(e),{messageHash:i,v:o,r:s,s:a,signature:l}=(0,t.signMessageWithPrivateKey)(n,r);return{message:e,messageHash:i,v:o,r:s,s:a,signature:l}},t.signRaw=(e,r)=>{let n=(0,t.hashMessage)(e,!0),{messageHash:i,v:o,r:s,s:a,signature:l}=(0,t.signMessageWithPrivateKey)(n,r);return{message:e,messageHash:i,v:o,r:s,s:a,signature:l}},t.signTransaction=(e,t)=>n(void 0,void 0,void 0,function*(){let r=e.sign((0,l.hexToBytes)(t));if((0,c.isNullish)(r.v)||(0,c.isNullish)(r.r)||(0,c.isNullish)(r.s))throw new a.TransactionSigningError("Signer Error");let n=r.validate(!0);if(n.length>0){let e="Signer Error ";for(let t of n)e+=`${e} ${t}.`;throw new a.TransactionSigningError(e)}let i=(0,l.bytesToHex)(r.serialize()),o=(0,l.sha3Raw)(i);return{messageHash:(0,l.bytesToHex)(r.getMessageToSign(!0)),v:`0x${r.v.toString(16)}`,r:`0x${r.r.toString(16).padStart(64,"0")}`,s:`0x${r.s.toString(16).padStart(64,"0")}`,rawTransaction:i,transactionHash:(0,l.bytesToHex)(o)}}),t.recoverTransaction=e=>{if((0,c.isNullish)(e))throw new a.UndefinedRawTransactionError;let t=h.TransactionFactory.fromSerializedData((0,l.hexToBytes)(e));return(0,l.toChecksumAddress)(t.getSenderAddress().toString())},t.recover=(e,r,n,i,o)=>{if("object"==typeof e){let r=`${e.r}${e.s.slice(2)}${e.v.slice(2)}`;return(0,t.recover)(e.messageHash,r,n)}if("string"==typeof r&&"string"==typeof n&&!(0,c.isNullish)(i)){let s=`${n}${i.slice(2)}${r.slice(2)}`;return(0,t.recover)(e,s,o)}if((0,c.isNullish)(r))throw new a.InvalidSignatureError("signature string undefined");let s=n?e:(0,t.hashMessage)(e),u=parseInt(r.substring(130),16);u>26&&(u-=27);let h=d.secp256k1.Signature.fromCompact(r.slice(2,130)).addRecoveryBit(u).recoverPublicKey(s.replace("0x","")).toRawBytes(!1),f=(0,l.sha3Raw)(h.subarray(1));return(0,l.toChecksumAddress)(`0x${f.slice(-40)}`)},t.privateKeyToAddress=e=>{let r=(0,t.parseAndValidatePrivateKey)(e),n=d.secp256k1.getPublicKey(r,!1),i=(0,l.sha3Raw)(n.slice(1)).slice(-40);return(0,l.toChecksumAddress)(`0x${i}`)},t.privateKeyToPublicKey=(e,r)=>{let n=(0,t.parseAndValidatePrivateKey)(e);return`0x${(0,l.bytesToHex)(d.secp256k1.getPublicKey(n,r)).slice(4)}`},t.encrypt=(e,r,d)=>n(void 0,void 0,void 0,function*(){var n,u,h,f,p,m,g;let y,b,v,w;let E=(0,t.parseAndValidatePrivateKey)(e);if(y=(null==d?void 0:d.salt)?"string"==typeof d.salt?(0,l.hexToBytes)(d.salt):d.salt:(0,l.randomBytes)(32),!(0,c.isString)(r)&&!(0,l.isUint8Array)(r))throw new a.InvalidPasswordError;let A="string"==typeof r?(0,l.hexToBytes)((0,l.utf8ToHex)(r)):r;if(null==d?void 0:d.iv){if(16!==(b="string"==typeof d.iv?(0,l.hexToBytes)(d.iv):d.iv).length)throw new a.IVLengthError}else b=(0,l.randomBytes)(16);let _=null!==(n=null==d?void 0:d.kdf)&&void 0!==n?n:"scrypt";if("pbkdf2"===_){if((w={dklen:null!==(u=null==d?void 0:d.dklen)&&void 0!==u?u:32,salt:(0,l.bytesToHex)(y).replace("0x",""),c:null!==(h=null==d?void 0:d.c)&&void 0!==h?h:262144,prf:"hmac-sha256"}).c<1e3)throw new a.PBKDF2IterationsError;v=(0,o.pbkdf2Sync)(A,y,w.c,w.dklen,"sha256")}else{if("scrypt"!==_)throw new a.InvalidKdfError;w={n:null!==(f=null==d?void 0:d.n)&&void 0!==f?f:8192,r:null!==(p=null==d?void 0:d.r)&&void 0!==p?p:8,p:null!==(m=null==d?void 0:d.p)&&void 0!==m?m:1,dklen:null!==(g=null==d?void 0:d.dklen)&&void 0!==g?g:32,salt:(0,l.bytesToHex)(y).replace("0x","")},v=(0,s.scryptSync)(A,y,w.n,w.p,w.r,w.dklen)}let T=yield(0,i.encrypt)(E,v.slice(0,16),b,"aes-128-ctr"),I=(0,l.bytesToHex)(T).slice(2),x=(0,l.sha3Raw)((0,l.uint8ArrayConcat)(v.slice(16,32),T)).replace("0x","");return{version:3,id:(0,l.uuidV4)(),address:(0,t.privateKeyToAddress)(E).toLowerCase().replace("0x",""),crypto:{ciphertext:I,cipherparams:{iv:(0,l.bytesToHex)(b).replace("0x","")},cipher:"aes-128-ctr",kdf:_,kdfparams:w,mac:x}}}),t.privateKeyToAccount=(e,r)=>{let i=(0,t.parseAndValidatePrivateKey)(e,r);return{address:(0,t.privateKeyToAddress)(i),privateKey:(0,l.bytesToHex)(i),signTransaction:e=>{throw new a.TransactionSigningError("Do not have network access to sign the transaction")},sign:e=>(0,t.sign)("string"==typeof e?e:JSON.stringify(e),i),encrypt:(e,r)=>n(void 0,void 0,void 0,function*(){return(0,t.encrypt)(i,e,r)})}},t.create=()=>{let e=d.secp256k1.utils.randomPrivateKey();return(0,t.privateKeyToAccount)(`${(0,l.bytesToHex)(e)}`)},t.decrypt=(e,r,d)=>n(void 0,void 0,void 0,function*(){let n;let h="object"==typeof e?e:JSON.parse(d?e.toLowerCase():e);if(c.validator.validateJSONSchema(u.keyStoreSchema,h),3!==h.version)throw new a.KeyStoreVersionError;let f="string"==typeof r?(0,l.hexToBytes)((0,l.utf8ToHex)(r)):r;if(c.validator.validate(["bytes"],[f]),"scrypt"===h.crypto.kdf){let e=h.crypto.kdfparams,t="string"==typeof e.salt?(0,l.hexToBytes)(e.salt):e.salt;n=(0,s.scryptSync)(f,t,e.n,e.p,e.r,e.dklen)}else{if("pbkdf2"!==h.crypto.kdf)throw new a.InvalidKdfError;{let e=h.crypto.kdfparams,t="string"==typeof e.salt?(0,l.hexToBytes)(e.salt):e.salt;n=(0,o.pbkdf2Sync)(f,t,e.c,e.dklen,"sha256")}}let p=(0,l.hexToBytes)(h.crypto.ciphertext);if((0,l.sha3Raw)((0,l.uint8ArrayConcat)(n.slice(16,32),p)).replace("0x","")!==h.crypto.mac)throw new a.KeyDerivationError;let m=yield(0,i.decrypt)((0,l.hexToBytes)(h.crypto.ciphertext),n.slice(0,16),(0,l.hexToBytes)(h.crypto.cipherparams.iv));return(0,t.privateKeyToAccount)(m)})},5079:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"goerli",chainId:5,networkId:5,defaultHardfork:"merge",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:0xa00000,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://goerli.etherscan.io/block/7382818",name:"merge",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]}},7289:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"mainnet",chainId:1,networkId:1,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:0x400000000,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://etherscan.io/block/15537393",name:"merge",ttd:"58750000000000000000000",block:0xed14f2,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,forkHash:null}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]}},5164:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"sepolia",chainId:0xaa36a7,networkId:0xaa36a7,defaultHardfork:"merge",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://sepolia.etherscan.io/block/1450408",name:"merge",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"}],bootstrapNodes:[],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]}},1917:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Common=void 0;let i=n(r(637)),o=r(6825),s=r(3423),a=r(4163),l=n(r(5079)),c=n(r(7289)),d=n(r(5164)),u=r(5232),h=r(8312),f=r(4127),{buf:p}=i.default;class m extends o.EventEmitter{static custom(e,t={}){var r;let n=null!==(r=t.baseChain)&&void 0!==r?r:"mainnet",i=Object.assign({},m._getChainParams(n));if(i.name="custom-chain","string"!=typeof e)return new m(Object.assign({chain:Object.assign(Object.assign({},i),e)},t));if(e===h.CustomChain.PolygonMainnet)return m.custom({name:h.CustomChain.PolygonMainnet,chainId:137,networkId:137},t);if(e===h.CustomChain.PolygonMumbai)return m.custom({name:h.CustomChain.PolygonMumbai,chainId:80001,networkId:80001},t);if(e===h.CustomChain.ArbitrumRinkebyTestnet)return m.custom({name:h.CustomChain.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},t);if(e===h.CustomChain.ArbitrumOne)return m.custom({name:h.CustomChain.ArbitrumOne,chainId:42161,networkId:42161},t);if(e===h.CustomChain.xDaiChain)return m.custom({name:h.CustomChain.xDaiChain,chainId:100,networkId:100},t);if(e===h.CustomChain.OptimisticKovan)return m.custom({name:h.CustomChain.OptimisticKovan,chainId:69,networkId:69},Object.assign({hardfork:h.Hardfork.Berlin},t));if(e===h.CustomChain.OptimisticEthereum)return m.custom({name:h.CustomChain.OptimisticEthereum,chainId:10,networkId:10},Object.assign({hardfork:h.Hardfork.Berlin},t));throw Error(`Custom chain ${e} not supported`)}static fromGethGenesis(e,{chain:t,eips:r,genesisHash:n,hardfork:i,mergeForkIdPostMerge:o}){var s;let l=(0,a.parseGethGenesis)(e,t,o),c=new m({chain:null!==(s=l.name)&&void 0!==s?s:"custom",customChains:[l],eips:r,hardfork:null!=i?i:l.hardfork});return void 0!==n&&c.setForkHashes(n),c}static isSupportedChainId(e){return!!this._getInitializedChains().names[e.toString()]}static _getChainParams(e,t){let r=e,n=this._getInitializedChains(t);if("number"==typeof r||"bigint"==typeof r){if(r=r.toString(),n.names[r])return n[n.names[r]];throw Error(`Chain with ID ${r} not supported`)}if(void 0!==n[r])return n[r];throw Error(`Chain with name ${r} not supported`)}constructor(e){var t,r;super(),this._eips=[],this._customChains=null!==(t=e.customChains)&&void 0!==t?t:[],this._chainParams=this.setChain(e.chain),this.DEFAULT_HARDFORK=null!==(r=this._chainParams.defaultHardfork)&&void 0!==r?r:h.Hardfork.Merge,this.HARDFORK_CHANGES=this.hardforks().map(e=>[e.name,f.hardforks[e.name]]),this._hardfork=this.DEFAULT_HARDFORK,void 0!==e.hardfork&&this.setHardfork(e.hardfork),e.eips&&this.setEIPs(e.eips)}setChain(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)this._chainParams=m._getChainParams(e,this._customChains);else{if("object"!=typeof e)throw Error("Wrong input format");if(this._customChains.length>0)throw Error("Chain must be a string, number, or bigint when initialized with customChains passed in");for(let t of["networkId","genesis","hardforks","bootstrapNodes"])if(!(t in e))throw Error(`Missing required chain parameter: ${t}`);this._chainParams=e}for(let e of this.hardforks())if(void 0===e.block)throw Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(e){let t=!1;for(let r of this.HARDFORK_CHANGES)r[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),t=!0);if(!t)throw Error(`Hardfork with name ${e} not supported`)}getHardforkByBlockNumber(e,t,r){let n=(0,a.toType)(e,s.TypeOutput.BigInt),i=(0,a.toType)(t,s.TypeOutput.BigInt),o=(0,a.toType)(r,s.TypeOutput.Number),l=this.hardforks().filter(e=>null!==e.block||null!==e.ttd&&void 0!==e.ttd||void 0!==e.timestamp),c=l.findIndex(e=>null!==e.ttd&&void 0!==e.ttd);if(l.slice(c+1).findIndex(e=>null!==e.ttd&&void 0!==e.ttd)>=0)throw Error("More than one merge hardforks found with ttd specified");let d=l.findIndex(e=>null!==e.block&&e.block>n||void 0!==o&&Number(e.timestamp)>o);if(-1===d)d=l.length;else if(0===d)throw Error("Must have at least one hardfork at block 0");if(void 0===o&&(d-=l.slice(0,d).reverse().findIndex(e=>null!==e.block||void 0!==e.ttd)),null===l[d-=1].block&&void 0===l[d].timestamp)(null==i||BigInt(l[d].ttd)>i)&&(d-=1);else if(c>=0&&null!=i){if(d>=c&&BigInt(l[c].ttd)>i)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(d{var r;return Math.max(Number(null!==(r=t.timestamp)&&void 0!==r?r:"0"),e)},0)>o)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(l.slice(d+1).reduce((e,t)=>{var r;return Math.min(Number(null!==(r=t.timestamp)&&void 0!==r?r:o),e)},o)=i}activeOnBlock(e){return this.hardforkIsActiveOnBlock(null,e)}hardforkGteHardfork(e,t){let r=null!=e?e:this._hardfork,n=this.hardforks(),i=-1,o=-1,s=0;for(let e of n)e.name===r&&(i=s),e.name===t&&(o=s),s+=1;return i>=o&&-1!==o}gteHardfork(e){return this.hardforkGteHardfork(null,e)}hardforkBlock(e){var t;let r=null!=e?e:this._hardfork,n=null===(t=this._getHardfork(r))||void 0===t?void 0:t.block;return null==n?null:BigInt(n)}hardforkTimestamp(e){var t;let r=null!=e?e:this._hardfork,n=null===(t=this._getHardfork(r))||void 0===t?void 0:t.timestamp;return null==n?null:BigInt(n)}eipBlock(e){for(let t of this.HARDFORK_CHANGES){let r=t[1];if("eips"in r&&r.eips.includes(e))return this.hardforkBlock("number"==typeof t[0]?String(t[0]):t[0])}return null}hardforkTTD(e){var t;let r=null!=e?e:this._hardfork,n=null===(t=this._getHardfork(r))||void 0===t?void 0:t.ttd;return null==n?null:BigInt(n)}isHardforkBlock(e,t){let r=(0,a.toType)(e,s.TypeOutput.BigInt),n=null!=t?t:this._hardfork,i=this.hardforkBlock(n);return"bigint"==typeof i&&i!==BigInt(0)&&i===r}nextHardforkBlockOrTimestamp(e){var t,r;let n=null!=e?e:this._hardfork,i=this.hardforks(),o=i.findIndex(e=>e.name===n);if(n===h.Hardfork.Merge&&(o-=1),o<0)return null;let s=null!==(t=i[o].timestamp)&&void 0!==t?t:i[o].block;s=null!=s?Number(s):null;let a=i.slice(o+1).find(e=>{var t;let r=null!==(t=e.timestamp)&&void 0!==t?t:e.block;return r=null!=r?Number(r):null,e.name!==h.Hardfork.Merge&&null!=r&&r!==s});if(void 0===a)return null;let l=null!==(r=a.timestamp)&&void 0!==r?r:a.block;return null==l?null:BigInt(l)}nextHardforkBlock(e){let t=null!=e?e:this._hardfork,r=this.hardforkBlock(t);if(null===r&&t===h.Hardfork.Merge){let e=this.hardforks(),t=e.findIndex(e=>null!==e.ttd&&void 0!==e.ttd);if(t<0)throw Error("Merge hardfork should have been found");r=this.hardforkBlock(e[t-1].name)}return null===r?null:this.hardforks().reduce((e,t)=>{let n=BigInt(null===t.block||void 0!==t.ttd&&null!==t.ttd?0:t.block);return n>r&&null===e?n:e},null)}isNextHardforkBlock(e,t){let r=(0,a.toType)(e,s.TypeOutput.BigInt),n=null!=t?t:this._hardfork,i=this.nextHardforkBlock(n);return null!==i&&i===r}_calcForkHash(e,t){let r=new Uint8Array,n=0;for(let t of this.hardforks()){let{block:i,timestamp:s,name:a}=t,l=null!=s?s:i;if("number"==typeof(l=null!==l?Number(l):null)&&0!==l&&l!==n&&a!==h.Hardfork.Merge){let e=(0,o.hexToBytes)(l.toString(16).padStart(16,"0"));r=(0,o.uint8ArrayConcat)(r,e),n=l}if(t.name===e)break}let i=(0,o.uint8ArrayConcat)(t,r);return(0,o.bytesToHex)((0,a.intToUint8Array)(p(i)>>>0))}forkHash(e,t){let r=null!=e?e:this._hardfork,n=this._getHardfork(r);if(null===n||null===(null==n?void 0:n.block)&&void 0===(null==n?void 0:n.timestamp)&&void 0===(null==n?void 0:n.ttd))throw Error("No fork hash calculation possible for future hardfork");if(null!==(null==n?void 0:n.forkHash)&&void 0!==(null==n?void 0:n.forkHash))return n.forkHash;if(!t)throw Error("genesisHash required for forkHash calculation");return this._calcForkHash(r,t)}hardforkForForkHash(e){let t=this.hardforks().filter(t=>t.forkHash===e);return t.length>=1?t[t.length-1]:null}setForkHashes(e){var t;for(let r of this.hardforks()){let n=null!==(t=r.timestamp)&&void 0!==t?t:r.block;null!==r.forkHash&&void 0!==r.forkHash||null==n&&void 0===r.ttd||(r.forkHash=this.forkHash(r.name,e))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){let e;let t=this.hardfork();for(let r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(e=r[1].consensus.type),r[0]===t)break;return null!=e?e:this._chainParams.consensus.type}consensusAlgorithm(){let e;let t=this.hardfork();for(let r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(e=r[1].consensus.algorithm),r[0]===t)break;return null!=e?e:this._chainParams.consensus.algorithm}consensusConfig(){var e;let t;let r=this.hardfork();for(let e of this.HARDFORK_CHANGES)if("consensus"in e[1]&&(t=e[1].consensus[e[1].consensus.algorithm]),e[0]===r)break;return null!==(e=null!=t?t:this._chainParams.consensus[this.consensusAlgorithm()])&&void 0!==e?e:{}}copy(){let e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.removeAllListeners(),e}static _getInitializedChains(e){let t={};for(let[e,r]of Object.entries(h.Chain))t[r]=e.toLowerCase();let r={mainnet:c.default,goerli:l.default,sepolia:d.default};if(e)for(let n of e){let{name:e}=n;t[n.chainId.toString()]=e,r[e]=n}return r.names=t,r}}t.Common=m},1764:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-1153",number:1153,comment:"Transient Storage",url:"https://eips.ethereum.org/EIPS/eip-1153",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}},vm:{},pow:{}}},3170:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-1559",number:1559,comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}},gasPrices:{},vm:{},pow:{}}},19:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-2315",number:2315,comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:"Draft",minimumHardfork:"istanbul",gasConfig:{},gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}},vm:{},pow:{}}},1277:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-2537",number:2537,comment:"BLS12-381 precompiles",url:"https://eips.ethereum.org/EIPS/eip-2537",status:"Draft",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{Bls12381G1AddGas:{v:600,d:"Gas cost of a single BLS12-381 G1 addition precompile-call"},Bls12381G1MulGas:{v:12e3,d:"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},Bls12381G2AddGas:{v:4500,d:"Gas cost of a single BLS12-381 G2 addition precompile-call"},Bls12381G2MulGas:{v:55e3,d:"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},Bls12381PairingBaseGas:{v:115e3,d:"Base gas cost of BLS12-381 pairing check"},Bls12381PairingPerPairGas:{v:23e3,d:"Per-pair gas cost of BLS12-381 pairing check"},Bls12381MapG1Gas:{v:5500,d:"Gas cost of BLS12-381 map field element to G1"},Bls12381MapG2Gas:{v:11e4,d:"Gas cost of BLS12-381 map field element to G2"},Bls12381MultiExpGasDiscount:{v:[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],d:"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},vm:{},pow:{}}},9390:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-2565",number:2565,comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:"Final",minimumHardfork:"byzantium",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}},vm:{},pow:{}}},6796:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-2718",comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{},vm:{},pow:{}}},9818:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-2929",comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:"Final",minimumHardfork:"chainstart",gasConfig:{},gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}},vm:{},pow:{}}},4444:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-2930",comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:"Final",minimumHardfork:"istanbul",requiredEIPs:[2718,2929],gasConfig:{},gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}},vm:{},pow:{}}},4279:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3198",number:3198,comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}},vm:{},pow:{}}},2995:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3529",comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:"Final",minimumHardfork:"berlin",requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}},vm:{},pow:{}}},274:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3540",number:3540,comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:"Review",minimumHardfork:"london",requiredEIPs:[3541],gasConfig:{},gasPrices:{},vm:{},pow:{}}},2337:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3541",comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:"Final",minimumHardfork:"berlin",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}}},939:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3554",comment:"Reduction in refunds",url:"Difficulty Bomb Delay to December 1st 2021",status:"Final",minimumHardfork:"muirGlacier",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}}},6402:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3607",number:3607,comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:"Final",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}}},5337:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3651",number:3198,comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:"Review",minimumHardfork:"london",requiredEIPs:[2929],gasConfig:{},gasPrices:{},vm:{},pow:{}}},5112:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3670",number:3670,comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:"london",requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}}},7003:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3675",number:3675,comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Final",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}}},7779:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3855",number:3855,comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:"Review",minimumHardfork:"chainstart",requiredEIPs:[],gasConfig:{},gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}},vm:{},pow:{}}},2463:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-3860",number:3860,comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:"Review",minimumHardfork:"spuriousDragon",requiredEIPs:[],gasConfig:{},gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}},pow:{}}},1480:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-4345",number:4345,comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:"Final",minimumHardfork:"london",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}}},8329:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-4399",number:4399,comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:"Review",minimumHardfork:"london",requiredEIPs:[],gasConfig:{},gasPrices:{},vm:{},pow:{}}},9194:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"EIP-5133",number:5133,comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:"Draft",minimumHardfork:"grayGlacier",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}}},5232:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EIPs=void 0;let i=n(r(1764)),o=n(r(3170)),s=n(r(19)),a=n(r(1277)),l=n(r(9390)),c=n(r(6796)),d=n(r(9818)),u=n(r(4444)),h=n(r(4279)),f=n(r(2995)),p=n(r(274)),m=n(r(2337)),g=n(r(939)),y=n(r(6402)),b=n(r(5337)),v=n(r(5112)),w=n(r(7003)),E=n(r(7779)),A=n(r(2463)),_=n(r(1480)),T=n(r(8329)),I=n(r(9194));t.EIPs={1153:i.default,1559:o.default,2315:s.default,2537:a.default,2565:l.default,2718:c.default,2929:d.default,2930:u.default,3198:h.default,3529:f.default,3540:p.default,3541:m.default,3554:g.default,3607:y.default,3651:b.default,3670:v.default,3675:w.default,3855:E.default,3860:A.default,4345:_.default,4399:T.default,5133:I.default}},8312:(e,t)=>{var r,n,i,o,s,a,l,c,d,u;Object.defineProperty(t,"__esModule",{value:!0}),t.CustomChain=t.ConsensusAlgorithm=t.ConsensusType=t.Hardfork=t.Chain=void 0,(a=r||(t.Chain=r={}))[a.Mainnet=1]="Mainnet",a[a.Goerli=5]="Goerli",a[a.Sepolia=0xaa36a7]="Sepolia",(l=n||(t.Hardfork=n={})).Chainstart="chainstart",l.Homestead="homestead",l.Dao="dao",l.TangerineWhistle="tangerineWhistle",l.SpuriousDragon="spuriousDragon",l.Byzantium="byzantium",l.Constantinople="constantinople",l.Petersburg="petersburg",l.Istanbul="istanbul",l.MuirGlacier="muirGlacier",l.Berlin="berlin",l.London="london",l.ArrowGlacier="arrowGlacier",l.GrayGlacier="grayGlacier",l.MergeForkIdTransition="mergeForkIdTransition",l.Merge="merge",l.Shanghai="shanghai",l.ShardingForkDev="shardingFork",(c=i||(t.ConsensusType=i={})).ProofOfStake="pos",c.ProofOfWork="pow",c.ProofOfAuthority="poa",(d=o||(t.ConsensusAlgorithm=o={})).Ethash="ethash",d.Clique="clique",d.Casper="casper",(u=s||(t.CustomChain=s={})).PolygonMainnet="polygon-mainnet",u.PolygonMumbai="polygon-mumbai",u.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",u.ArbitrumOne="arbitrum-one",u.xDaiChain="x-dai-chain",u.OptimisticKovan="optimistic-kovan",u.OptimisticEthereum="optimistic-ethereum"},2077:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:"Final",eips:[4345],gasConfig:{},gasPrices:{},vm:{},pow:{}}},159:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:"Final",eips:[2565,2929,2718,2930]}},5560:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:"Final",gasConfig:{},gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},vm:{},pow:{minerReward:{v:"3000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}}},9084:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:"",gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},tierStep:{v:[0,2,3,5,8,10,20],d:"Once per operation, for a selection of them"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},sha3:{v:30,d:"Base fee of the SHA3 opcode"},sha3Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be"},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations"},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:"5000000000000000000",d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}}},9440:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},vm:{},pow:{minerReward:{v:"2000000000000000000",d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}}},1187:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{}}},2727:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:"Draft",eips:[5133],gasConfig:{},gasPrices:{},vm:{},pow:{}}},1281:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:"Final",gasConfig:{},gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}},vm:{},pow:{}}},4127:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hardforks=void 0;let i=n(r(9084)),o=n(r(1187)),s=n(r(1281)),a=n(r(3104)),l=n(r(1484)),c=n(r(5560)),d=n(r(9440)),u=n(r(6682)),h=n(r(697)),f=n(r(201)),p=n(r(159)),m=n(r(9517)),g=n(r(2670)),y=n(r(2077)),b=n(r(2727)),v=n(r(8177)),w=n(r(879));t.hardforks={chainstart:i.default,homestead:s.default,dao:o.default,tangerineWhistle:a.default,spuriousDragon:l.default,byzantium:c.default,constantinople:d.default,petersburg:u.default,istanbul:h.default,muirGlacier:f.default,berlin:p.default,london:m.default,shanghai:g.default,arrowGlacier:y.default,grayGlacier:b.default,mergeForkIdTransition:v.default,merge:w.default}},697:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:"Final",gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}},vm:{},pow:{}}},9517:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:"Final",eips:[1559,3198,3529,3541]}},879:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"merge",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:"Final",consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]}},8177:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:"Draft",eips:[]}},201:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:"Final",gasConfig:{},gasPrices:{},vm:{},pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}}},6682:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:"Final",gasConfig:{},gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}},vm:{},pow:{}}},2670:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:"Final",eips:[3651,3855,3860,4895]}},1484:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:"Final",gasConfig:{},gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}},pow:{}}},3104:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:"Final",gasConfig:{},gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{},pow:{}}},8930:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1917),t),i(r(8312),t),i(r(3423),t),i(r(4163),t)},3423:(e,t)=>{var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.TypeOutput=void 0,(n=r||(t.TypeOutput=r={}))[n.Number=0]="Number",n[n.BigInt=1]="BigInt",n[n.Uint8Array=2]="Uint8Array",n[n.PrefixedHexString=3]="PrefixedHexString"},4163:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ecrecover=t.bigIntToHex=t.unpadUint8Array=t.setLengthLeft=t.zeros=t.toUint8Array=t.intToUint8Array=t.stripHexPrefix=void 0,t.parseGethGenesis=function(e,r,i){try{if(["config","difficulty","gasLimit","alloc"].some(t=>!(t in e)))throw Error("Invalid format, expected geth genesis fields missing");return void 0!==r&&(e.name=r),function(e,r=!0){var i,o,a;let{name:c,config:d,difficulty:u,mixHash:h,gasLimit:f,coinbase:p,baseFeePerGas:m}=e,{extraData:g,timestamp:y,nonce:b}=e,v=Number(y),{chainId:w}=d;if(""===g&&(g="0x"),(0,n.isHexPrefixed)(y)||(y=l(parseInt(y))),18!==b.length&&(b=(a=b)&&"0x0"!==a?(0,n.isHexPrefixed)(a)?`0x${(0,t.stripHexPrefix)(a).padStart(16,"0")}`:`0x${a.padStart(16,"0")}`:"0x0000000000000000"),d.eip155Block!==d.eip158Block)throw Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");let E={name:c,chainId:w,networkId:w,genesis:{timestamp:y,gasLimit:parseInt(f),difficulty:parseInt(u),nonce:b,extraData:g,mixHash:h,coinbase:p,baseFeePerGas:m},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:void 0!==d.clique?{type:"poa",algorithm:"clique",clique:{period:null!==(i=d.clique.period)&&void 0!==i?i:d.clique.blockperiodseconds,epoch:null!==(o=d.clique.epoch)&&void 0!==o?o:d.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},A={[s.Hardfork.Homestead]:{name:"homesteadBlock"},[s.Hardfork.Dao]:{name:"daoForkBlock"},[s.Hardfork.TangerineWhistle]:{name:"eip150Block"},[s.Hardfork.SpuriousDragon]:{name:"eip155Block"},[s.Hardfork.Byzantium]:{name:"byzantiumBlock"},[s.Hardfork.Constantinople]:{name:"constantinopleBlock"},[s.Hardfork.Petersburg]:{name:"petersburgBlock"},[s.Hardfork.Istanbul]:{name:"istanbulBlock"},[s.Hardfork.MuirGlacier]:{name:"muirGlacierBlock"},[s.Hardfork.Berlin]:{name:"berlinBlock"},[s.Hardfork.London]:{name:"londonBlock"},[s.Hardfork.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:r},[s.Hardfork.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[s.Hardfork.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},_=Object.keys(A).reduce((e,t)=>(e[A[t].name]=t,e),{}),T=Object.keys(d).filter(e=>void 0!==_[e]&&void 0!==d[e]&&null!==d[e]);if(E.hardforks=T.map(e=>({name:_[e],block:!0===A[_[e]].isTimestamp||"number"!=typeof d[e]?null:d[e],timestamp:!0===A[_[e]].isTimestamp&&"number"==typeof d[e]?d[e]:void 0})).filter(e=>null!==e.block||void 0!==e.timestamp),E.hardforks.sort((e,t)=>{var r,n;return(null!==(r=e.block)&&void 0!==r?r:1/0)-(null!==(n=t.block)&&void 0!==n?n:1/0)}),E.hardforks.sort((e,t)=>{var r,n;return(null!==(r=e.timestamp)&&void 0!==r?r:v)-(null!==(n=t.timestamp)&&void 0!==n?n:v)}),void 0!==d.terminalTotalDifficulty){let e={name:s.Hardfork.Merge,ttd:d.terminalTotalDifficulty,block:null},t=E.hardforks.findIndex(e=>{var t;return!0===(null===(t=A[e.name])||void 0===t?void 0:t.postMerge)});-1!==t?E.hardforks.splice(t,0,e):E.hardforks.push(e)}let I=E.hardforks.length>0?E.hardforks.slice(-1)[0]:void 0;return E.hardfork=null==I?void 0:I.name,E.hardforks.unshift({name:s.Hardfork.Chainstart,block:0}),E}(e,i)}catch(e){throw Error(`Error parsing parameters file: ${e.message}`)}},t.padToEven=c,t.uint8ArrayToBigInt=d,t.bigIntToUint8Array=u,t.assertIsUint8Array=h,t.stripZeros=f,t.bigIntToUnpaddedUint8Array=function(e){return(0,t.unpadUint8Array)(u(e))},t.toType=function(e,r){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!(0,n.isHexString)(e))throw Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");let o=(0,t.toUint8Array)(e);switch(r){case a.TypeOutput.Uint8Array:return o;case a.TypeOutput.BigInt:return d(o);case a.TypeOutput.Number:{let e=d(o);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case a.TypeOutput.PrefixedHexString:return(0,i.bytesToHex)(o);default:throw Error("unknown outputType")}};let n=r(7244),i=r(6825),o=r(114),s=r(8312),a=r(3423);t.stripHexPrefix=e=>{if("string"!=typeof e)throw Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return(0,n.isHexPrefixed)(e)?e.slice(2):e};let l=function(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};function c(e){let t=e;if("string"!=typeof t)throw Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}function d(e){let t=(0,i.bytesToHex)(e);return"0x"===t?BigInt(0):BigInt(t)}function u(e){return(0,t.toUint8Array)(`0x${e.toString(16)}`)}function h(e){if(!(0,i.isUint8Array)(e))throw Error(`This method only supports Uint8Array but input was: ${e}`)}function f(e){let t=e[0];for(;e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e}t.intToUint8Array=function(e){let t=l(e);return(0,i.hexToBytes)(`0x${c(t.slice(2))}`)},t.toUint8Array=function(e){var r;if(null==e)return new Uint8Array;if(e instanceof Uint8Array)return e;if("Uint8Array"===(null===(r=null==e?void 0:e.constructor)||void 0===r?void 0:r.name)||Array.isArray(e))return Uint8Array.from(e);if("string"==typeof e){if(!(0,n.isHexString)(e))throw Error(`Cannot convert string to Uint8Array. only supports 0x-prefixed hex strings and this string was given: ${e}`);return(0,i.hexToBytes)(c((0,t.stripHexPrefix)(e)))}if("number"==typeof e)return(0,t.toUint8Array)((0,i.numberToHex)(e));if("bigint"==typeof e){if(e`0x${e.toString(16)}`,t.ecrecover=function(e,t,r,n,i){let s=t===BigInt(0)||t===BigInt(1)?t:void 0===i?t-BigInt(27):t-(i*BigInt(2)+BigInt(35));if(s!==BigInt(0)&&s!==BigInt(1))throw Error("Invalid signature v value");return new o.secp256k1.Signature(d(r),d(n)).addRecoveryBit(Number(s)).recoverPublicKey(e).toRawBytes(!1).slice(1)}},2054:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9541),t),i(r(933),t),i(r(6859),t),i(r(9386),t),i(r(8930),t),i(r(2575),t)},9386:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.keyStoreSchema=void 0,t.keyStoreSchema={type:"object",required:["crypto","id","version","address"],properties:{crypto:{type:"object",required:["cipher","ciphertext","cipherparams","kdf","kdfparams","mac"],properties:{cipher:{type:"string"},ciphertext:{type:"string"},cipherparams:{type:"object"},kdf:{type:"string"},kdfparams:{type:"object"},salt:{type:"string"},mac:{type:"string"}}},id:{type:"string"},version:{type:"number"},address:{type:"string"}}}},4043:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;let n=r(9204),i=r(6825),o=r(114),s=r(4163);class a{constructor(e){if(20!==e.length)throw Error("Invalid address length");this.buf=e}static zero(){return new a((0,s.zeros)(20))}equals(e){return(0,i.uint8ArrayEquals)(this.buf,e.buf)}isZero(){return this.equals(a.zero())}toString(){return(0,i.bytesToHex)(this.buf)}toArray(){return this.buf}static publicToAddress(e,t=!1){let r=e;if((0,s.assertIsUint8Array)(r),t&&64!==r.length&&(r=o.secp256k1.ProjectivePoint.fromHex(r).toRawBytes(!1).slice(1)),64!==r.length)throw Error("Expected pubKey to be of length 64");return(0,n.keccak256)(r).slice(-20)}}t.Address=a},5124:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTransaction=void 0;let n=r(6825),i=r(114),o=r(4163),s=r(1917),a=r(8312),l=r(3238),c=r(4043),d=r(4314);t.BaseTransaction=class{constructor(e,t){var r,n;this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=a.Chain.Mainnet,this.DEFAULT_HARDFORK=a.Hardfork.Merge;let{nonce:i,gasLimit:s,to:l,value:u,data:h,v:f,r:p,s:m,type:g}=e;this._type=Number((0,o.uint8ArrayToBigInt)((0,o.toUint8Array)(g))),this.txOptions=t;let y=(0,o.toUint8Array)(""===l?"0x":l),b=(0,o.toUint8Array)(""===f?"0x":f),v=(0,o.toUint8Array)(""===p?"0x":p),w=(0,o.toUint8Array)(""===m?"0x":m);this.nonce=(0,o.uint8ArrayToBigInt)((0,o.toUint8Array)(""===i?"0x":i)),this.gasLimit=(0,o.uint8ArrayToBigInt)((0,o.toUint8Array)(""===s?"0x":s)),this.to=y.length>0?new c.Address(y):void 0,this.value=(0,o.uint8ArrayToBigInt)((0,o.toUint8Array)(""===u?"0x":u)),this.data=(0,o.toUint8Array)(""===h?"0x":h),this.v=b.length>0?(0,o.uint8ArrayToBigInt)(b):void 0,this.r=v.length>0?(0,o.uint8ArrayToBigInt)(v):void 0,this.s=w.length>0?(0,o.uint8ArrayToBigInt)(w):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);let E=void 0===this.to||null===this.to,A=null!==(r=t.allowUnlimitedInitCodeSize)&&void 0!==r&&r,_=null!==(n=t.common)&&void 0!==n?n:this._getCommon();E&&_.isActivatedEIP(3860)&&!A&&(0,d.checkMaxInitCodeSize)(_,this.data.length)}get type(){return this._type}supports(e){return this.activeCapabilities.includes(e)}validate(e=!1){let t=[];return this.getBaseFee()>this.gasLimit&&t.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),e?t:0===t.length}_validateYParity(){let{v:e}=this;if(void 0!==e&&e!==BigInt(0)&&e!==BigInt(1))throw Error(this._errorMsg("The y-parity of the transaction should either be 0 or 1"))}_validateHighS(){let{s:e}=this;if(this.common.gteHardfork("homestead")&&void 0!==e&&e>i.SECP256K1_ORDER_DIV_2)throw Error(this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid"))}getBaseFee(){let e=this.common.param("gasPrices","tx"),t=this.getDataFee();if(e&&(t+=e),this.common.gteHardfork("homestead")&&this.toCreationAddress()){let e=this.common.param("gasPrices","txCreation");e&&(t+=e)}return t}getDataFee(){let e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero"),r=BigInt(0);for(let n=0;n-1&&this.activeCapabilities.splice(e,1)}return s}_getCommon(e,t){var r,n,i,a;if(void 0!==t){let r=(0,o.uint8ArrayToBigInt)((0,o.toUint8Array)(t));if(e){if(e.chainId()!==r)throw Error(this._errorMsg("The chain ID does not match the chain ID of Common"));return e.copy()}return s.Common.isSupportedChainId(r)?new s.Common({chain:r,hardfork:this.DEFAULT_HARDFORK}):s.Common.custom({name:"custom-chain",networkId:r,chainId:r},{baseChain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}if((null==e?void 0:e.copy)&&"function"==typeof(null==e?void 0:e.copy))return e.copy();if(e){let t="function"==typeof e.hardfork?e.hardfork():e.hardfork;return s.Common.custom({name:"custom-chain",networkId:e.networkId?e.networkId():null!==(n=BigInt(null===(r=e.customChain)||void 0===r?void 0:r.networkId))&&void 0!==n?n:void 0,chainId:e.chainId?e.chainId():null!==(a=BigInt(null===(i=e.customChain)||void 0===i?void 0:i.chainId))&&void 0!==a?a:void 0},{baseChain:this.DEFAULT_CHAIN,hardfork:t||this.DEFAULT_HARDFORK})}return new s.Common({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}_validateCannotExceedMaxInteger(e,t=256,r=!1){for(let[n,o]of Object.entries(e))switch(t){case 64:if(r){if(void 0!==o&&o>=i.MAX_UINT64)throw Error(this._errorMsg(`${n} cannot equal or exceed MAX_UINT64 (2^64-1), given ${o}`))}else if(void 0!==o&&o>i.MAX_UINT64)throw Error(this._errorMsg(`${n} cannot exceed MAX_UINT64 (2^64-1), given ${o}`));break;case 256:if(r){if(void 0!==o&&o>=i.MAX_INTEGER)throw Error(this._errorMsg(`${n} cannot equal or exceed MAX_INTEGER (2^256-1), given ${o}`))}else if(void 0!==o&&o>i.MAX_INTEGER)throw Error(this._errorMsg(`${n} cannot exceed MAX_INTEGER (2^256-1), given ${o}`));break;default:throw Error(this._errorMsg("unimplemented bits value"))}}static _validateNotArray(e){let t=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(let[r,n]of Object.entries(e))if(t.includes(r)&&Array.isArray(n))throw Error(`${r} cannot be an array`)}_getSharedErrorPostfix(){let e="";try{e=this.isSigned()?(0,n.bytesToHex)(this.hash()):"not available (unsigned)"}catch(t){e="error"}let t="";try{t=this.isSigned().toString()}catch(t){e="error"}let r="";try{r=this.common.hardfork()}catch(e){r="error"}return`tx type=${this.type} hash=${e} nonce=${this.nonce} value=${this.value} signed=${t} hf=${r}`}_ecsign(e,t,r){let n=i.secp256k1.sign(e,t),o=n.toCompactRawBytes();return{r:o.subarray(0,32),s:o.subarray(32,64),v:void 0===r?BigInt(n.recovery+27):BigInt(n.recovery+35)+BigInt(r)*BigInt(2)}}static fromSerializedTx(e,t={}){}static fromTxData(e,t={}){}}},114:function(e,t,r){var n,i=this&&this.__createBinding||(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]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(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)&&i(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SECP256K1_ORDER_DIV_2=t.SECP256K1_ORDER=t.MAX_INTEGER=t.MAX_UINT64=t.secp256k1=void 0;let a=s(r(9164));t.secp256k1=null!==(n=a.secp256k1)&&void 0!==n?n:a,t.MAX_UINT64=BigInt("0xffffffffffffffff"),t.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),t.SECP256K1_ORDER=t.secp256k1.CURVE.n,t.SECP256K1_ORDER_DIV_2=t.SECP256K1_ORDER/BigInt(2)},8869:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FeeMarketEIP1559Transaction=void 0;let n=r(9204),i=r(7244),o=r(1166),s=r(6825),a=r(114),l=r(5124),c=r(4314),d=r(4163),u=(0,s.hexToBytes)("2".padStart(2,"0"));class h extends l.BaseTransaction{static fromTxData(e,t={}){return new h(e,t)}static fromSerializedTx(e,t={}){if(!(0,s.uint8ArrayEquals)(e.subarray(0,1),u))throw Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: 2, received: ${(0,s.bytesToHex)(e.subarray(0,1))}`);let r=o.RLP.decode(e.subarray(1));if(!Array.isArray(r))throw Error("Invalid serialized tx input: must be array");return h.fromValuesArray(r,t)}static fromValuesArray(e,t={}){if(9!==e.length&&12!==e.length)throw Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");let[r,n,o,s,a,l,c,u,f,p,m,g]=e;return this._validateNotArray({chainId:r,v:p}),(0,i.validateNoLeadingZeroes)({nonce:n,maxPriorityFeePerGas:o,maxFeePerGas:s,gasLimit:a,value:c,v:p,r:m,s:g}),new h({chainId:(0,d.uint8ArrayToBigInt)(r),nonce:n,maxPriorityFeePerGas:o,maxFeePerGas:s,gasLimit:a,to:l,value:c,data:u,accessList:null!=f?f:[],v:void 0!==p?(0,d.uint8ArrayToBigInt)(p):void 0,r:m,s:g},t)}constructor(e,t={}){var r;super(Object.assign(Object.assign({},e),{type:2}),t),this.DEFAULT_HARDFORK="london";let{chainId:n,accessList:i,maxFeePerGas:o,maxPriorityFeePerGas:s}=e;if(this.common=this._getCommon(t.common,n),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(1559))throw Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);let u=(0,c.getAccessListData)(null!=i?i:[]);if(this.accessList=u.accessList,this.AccessListJSON=u.AccessListJSON,(0,c.verifyAccessList)(this.accessList),this.maxFeePerGas=(0,d.uint8ArrayToBigInt)((0,d.toUint8Array)(""===o?"0x":o)),this.maxPriorityFeePerGas=(0,d.uint8ArrayToBigInt)((0,d.toUint8Array)(""===s?"0x":s)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),l.BaseTransaction._validateNotArray(e),this.gasLimit*this.maxFeePerGas>a.MAX_INTEGER)throw Error(this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)"));if(this.maxFeePerGas{Object.defineProperty(t,"__esModule",{value:!0}),t.AccessListEIP2930Transaction=void 0;let n=r(9204),i=r(7244),o=r(1166),s=r(6825),a=r(114),l=r(4314),c=r(4163),d=r(5124),u=(0,s.hexToBytes)("1".padStart(2,"0"));class h extends d.BaseTransaction{static fromTxData(e,t={}){return new h(e,t)}static fromSerializedTx(e,t={}){if(!(0,s.uint8ArrayEquals)(e.subarray(0,1),u))throw Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: 1, received: ${(0,s.bytesToHex)(e.subarray(0,1))}`);let r=o.RLP.decode(Uint8Array.from(e.subarray(1)));if(!Array.isArray(r))throw Error("Invalid serialized tx input: must be array");return h.fromValuesArray(r,t)}static fromValuesArray(e,t={}){if(8!==e.length&&11!==e.length)throw Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");let[r,n,o,s,a,l,d,u,f,p,m]=e;return this._validateNotArray({chainId:r,v:f}),(0,i.validateNoLeadingZeroes)({nonce:n,gasPrice:o,gasLimit:s,value:l,v:f,r:p,s:m}),new h({chainId:(0,c.uint8ArrayToBigInt)(r),nonce:n,gasPrice:o,gasLimit:s,to:a,value:l,data:d,accessList:null!=u?u:[],v:void 0!==f?(0,c.uint8ArrayToBigInt)(f):void 0,r:p,s:m},t)}constructor(e,t={}){var r;super(Object.assign(Object.assign({},e),{type:1}),t),this.DEFAULT_HARDFORK="berlin";let{chainId:n,accessList:i,gasPrice:o}=e;if(this.common=this._getCommon(t.common,n),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);let s=(0,l.getAccessListData)(null!=i?i:[]);if(this.accessList=s.accessList,this.AccessListJSON=s.AccessListJSON,(0,l.verifyAccessList)(this.accessList),this.gasPrice=(0,c.uint8ArrayToBigInt)((0,c.toUint8Array)(""===o?"0x":o)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),d.BaseTransaction._validateNotArray(e),this.gasPrice*this.gasLimit>a.MAX_INTEGER)throw Error(this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER"));this._validateYParity(),this._validateHighS(),(null===(r=null==t?void 0:t.freeze)||void 0===r||r)&&Object.freeze(this)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let e=super.getDataFee();return e+=BigInt((0,l.getDataFeeEIP2930)(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:e,hardfork:this.common.hardfork()}),e}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[(0,c.bigIntToUnpaddedUint8Array)(this.chainId),(0,c.bigIntToUnpaddedUint8Array)(this.nonce),(0,c.bigIntToUnpaddedUint8Array)(this.gasPrice),(0,c.bigIntToUnpaddedUint8Array)(this.gasLimit),void 0!==this.to?this.to.buf:Uint8Array.from([]),(0,c.bigIntToUnpaddedUint8Array)(this.value),this.data,this.accessList,void 0!==this.v?(0,c.bigIntToUnpaddedUint8Array)(this.v):Uint8Array.from([]),void 0!==this.r?(0,c.bigIntToUnpaddedUint8Array)(this.r):Uint8Array.from([]),void 0!==this.s?(0,c.bigIntToUnpaddedUint8Array)(this.s):Uint8Array.from([])]}serialize(){let e=this.raw();return(0,s.uint8ArrayConcat)(u,o.RLP.encode(e))}getMessageToSign(e=!0){let t=this.raw().slice(0,8),r=(0,s.uint8ArrayConcat)(u,o.RLP.encode(t));return e?(0,n.keccak256)(r):r}hash(){if(!this.isSigned())throw Error(this._errorMsg("Cannot call hash method if transaction is not signed"));return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,n.keccak256)(this.serialize())),this.cache.hash):(0,n.keccak256)(this.serialize())}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned())throw Error(this._errorMsg("Cannot call this method if transaction is not signed"));let e=this.getMessageToVerifySignature(),{v:t,r:r,s:n}=this;this._validateHighS();try{return(0,c.ecrecover)(e,t+BigInt(27),(0,c.bigIntToUnpaddedUint8Array)(r),(0,c.bigIntToUnpaddedUint8Array)(n))}catch(e){throw Error(this._errorMsg("Invalid Signature"))}}_processSignature(e,t,r){let n=Object.assign(Object.assign({},this.txOptions),{common:this.common});return h.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:(0,c.uint8ArrayToBigInt)(t),s:(0,c.uint8ArrayToBigInt)(r)},n)}toJSON(){let e=(0,l.getAccessListJSON)(this.accessList);return{chainId:(0,c.bigIntToHex)(this.chainId),nonce:(0,c.bigIntToHex)(this.nonce),gasPrice:(0,c.bigIntToHex)(this.gasPrice),gasLimit:(0,c.bigIntToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,c.bigIntToHex)(this.value),data:(0,s.bytesToHex)(this.data),accessList:e,v:void 0!==this.v?(0,c.bigIntToHex)(this.v):void 0,r:void 0!==this.r?(0,c.bigIntToHex)(this.r):void 0,s:void 0!==this.s?(0,c.bigIntToHex)(this.s):void 0}}errorStr(){var e,t;return this._getSharedErrorPostfix()+` gasPrice=${this.gasPrice} accessListCount=${null!==(t=null===(e=this.accessList)||void 0===e?void 0:e.length)&&void 0!==t?t:0}`}_errorMsg(e){return`${e} (${this.errorStr()})`}}t.AccessListEIP2930Transaction=h},2575:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(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 i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.txUtils=t.BaseTransaction=t.TransactionFactory=t.Transaction=t.AccessListEIP2930Transaction=t.FeeMarketEIP1559Transaction=void 0;var a=r(8869);Object.defineProperty(t,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return a.FeeMarketEIP1559Transaction}});var l=r(3303);Object.defineProperty(t,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return l.AccessListEIP2930Transaction}});var c=r(2886);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return c.Transaction}});var d=r(2685);Object.defineProperty(t,"TransactionFactory",{enumerable:!0,get:function(){return d.TransactionFactory}});var u=r(5124);Object.defineProperty(t,"BaseTransaction",{enumerable:!0,get:function(){return u.BaseTransaction}}),t.txUtils=o(r(4314)),s(r(3238),t)},2886:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;let n=r(1166),i=r(9204),o=r(6825),s=r(7244),a=r(4163),l=r(114),c=r(5124),d=r(3238);function u(e,t){let r=Number(e),n=2*Number(t);return r===n+35||r===n+36}class h extends c.BaseTransaction{static fromTxData(e,t={}){return new h(e,t)}static fromSerializedTx(e,t={}){let r=n.RLP.decode(e);if(!Array.isArray(r))throw Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,t)}static fromValuesArray(e,t={}){if(6!==e.length&&9!==e.length)throw Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");let[r,n,i,o,a,l,c,d,u]=e;return(0,s.validateNoLeadingZeroes)({nonce:r,gasPrice:n,gasLimit:i,value:a,v:c,r:d,s:u}),new h({nonce:r,gasPrice:n,gasLimit:i,to:o,value:a,data:l,v:c,r:d,s:u},t)}constructor(e,t={}){var r;if(super(Object.assign(Object.assign({},e),{type:0}),t),this.common=this._validateTxV(this.v,t.common),this.gasPrice=(0,a.uint8ArrayToBigInt)((0,a.toUint8Array)(""===e.gasPrice?"0x":e.gasPrice)),this.gasPrice*this.gasLimit>l.MAX_INTEGER)throw Error(this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)"));this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),c.BaseTransaction._validateNotArray(e),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?u(this.v,this.common.chainId())&&this.activeCapabilities.push(d.Capability.EIP155ReplayProtection):this.activeCapabilities.push(d.Capability.EIP155ReplayProtection)),(null===(r=null==t?void 0:t.freeze)||void 0===r||r)&&Object.freeze(this)}raw(){return[(0,a.bigIntToUnpaddedUint8Array)(this.nonce),(0,a.bigIntToUnpaddedUint8Array)(this.gasPrice),(0,a.bigIntToUnpaddedUint8Array)(this.gasLimit),void 0!==this.to?this.to.buf:Uint8Array.from([]),(0,a.bigIntToUnpaddedUint8Array)(this.value),this.data,void 0!==this.v?(0,a.bigIntToUnpaddedUint8Array)(this.v):Uint8Array.from([]),void 0!==this.r?(0,a.bigIntToUnpaddedUint8Array)(this.r):Uint8Array.from([]),void 0!==this.s?(0,a.bigIntToUnpaddedUint8Array)(this.s):Uint8Array.from([])]}serialize(){return n.RLP.encode(this.raw())}_getMessageToSign(){let e=[(0,a.bigIntToUnpaddedUint8Array)(this.nonce),(0,a.bigIntToUnpaddedUint8Array)(this.gasPrice),(0,a.bigIntToUnpaddedUint8Array)(this.gasLimit),void 0!==this.to?this.to.buf:Uint8Array.from([]),(0,a.bigIntToUnpaddedUint8Array)(this.value),this.data];return this.supports(d.Capability.EIP155ReplayProtection)&&(e.push((0,a.toUint8Array)(this.common.chainId())),e.push((0,a.unpadUint8Array)((0,a.toUint8Array)(0))),e.push((0,a.unpadUint8Array)((0,a.toUint8Array)(0)))),e}getMessageToSign(e=!0){let t=this._getMessageToSign();return e?(0,i.keccak256)(n.RLP.encode(t)):t}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned())throw Error(this._errorMsg("Cannot call hash method if transaction is not signed"));return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,i.keccak256)(n.RLP.encode(this.raw()))),this.cache.hash):(0,i.keccak256)(n.RLP.encode(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned())throw Error(this._errorMsg("This transaction is not signed"));let e=this._getMessageToSign();return(0,i.keccak256)(n.RLP.encode(e))}getSenderPublicKey(){let e=this.getMessageToVerifySignature(),{v:t,r:r,s:n}=this;this._validateHighS();try{return(0,a.ecrecover)(e,t,(0,a.bigIntToUnpaddedUint8Array)(r),(0,a.bigIntToUnpaddedUint8Array)(n),this.supports(d.Capability.EIP155ReplayProtection)?this.common.chainId():void 0)}catch(e){throw Error(this._errorMsg("Invalid Signature"))}}_processSignature(e,t,r){let n=e;this.supports(d.Capability.EIP155ReplayProtection)&&(n+=this.common.chainId()*BigInt(2)+BigInt(8));let i=Object.assign(Object.assign({},this.txOptions),{common:this.common});return h.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:n,r:(0,a.uint8ArrayToBigInt)(t),s:(0,a.uint8ArrayToBigInt)(r)},i)}toJSON(){return{nonce:(0,a.bigIntToHex)(this.nonce),gasPrice:(0,a.bigIntToHex)(this.gasPrice),gasLimit:(0,a.bigIntToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,a.bigIntToHex)(this.value),data:(0,o.bytesToHex)(this.data),v:void 0!==this.v?(0,a.bigIntToHex)(this.v):void 0,r:void 0!==this.r?(0,a.bigIntToHex)(this.r):void 0,s:void 0!==this.s?(0,a.bigIntToHex)(this.s):void 0}}_validateTxV(e,t){let r;let n=void 0!==e?Number(e):void 0;if(void 0!==n&&n<37&&27!==n&&28!==n)throw Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${n}`);if(void 0!==n&&0!==n&&(!t||t.gteHardfork("spuriousDragon"))&&27!==n&&28!==n){if(t){if(!u(BigInt(n),t.chainId()))throw Error(`Incompatible EIP155-based V ${n} and chain id ${t.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let e;e=(n-35)%2==0?35:36,r=BigInt(n-e)/BigInt(2)}}return this._getCommon(t,r)}errorStr(){return this._getSharedErrorPostfix()+` gasPrice=${this.gasPrice}`}_errorMsg(e){return`${e} (${this.errorStr()})`}}t.Transaction=h},2685:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionFactory=void 0;let n=r(6825),i=r(4163),o=r(8869),s=r(3303),a=r(2886),l=new Map;class c{constructor(){}static typeToInt(e){return Number((0,i.uint8ArrayToBigInt)((0,i.toUint8Array)(e)))}static registerTransactionType(e,t){let r=c.typeToInt(e);l.set(r,t)}static fromTxData(e,t={}){if(!("type"in e)||void 0===e.type)return a.Transaction.fromTxData(e,t);let r=c.typeToInt(e.type);if(0===r)return a.Transaction.fromTxData(e,t);if(1===r)return s.AccessListEIP2930Transaction.fromTxData(e,t);if(2===r)return o.FeeMarketEIP1559Transaction.fromTxData(e,t);let n=l.get(r);if(null==n?void 0:n.fromTxData)return n.fromTxData(e,t);throw Error(`Tx instantiation with type ${r} not supported`)}static fromSerializedData(e,t={}){if(!(e[0]<=127))return a.Transaction.fromSerializedTx(e,t);switch(e[0]){case 1:return s.AccessListEIP2930Transaction.fromSerializedTx(e,t);case 2:return o.FeeMarketEIP1559Transaction.fromSerializedTx(e,t);default:{let r=l.get(Number(e[0]));if(null==r?void 0:r.fromSerializedTx)return r.fromSerializedTx(e,t);throw Error(`TypedTransaction with ID ${e[0]} unknown`)}}}static fromBlockBodyData(e,t={}){if((0,n.isUint8Array)(e))return this.fromSerializedData(e,t);if(Array.isArray(e))return a.Transaction.fromValuesArray(e,t);throw Error("Cannot decode transaction: unknown type input")}}t.TransactionFactory=c},3238:(e,t)=>{var r,n;function i(e){return 0===e.length||!!Array.isArray(e[0])}Object.defineProperty(t,"__esModule",{value:!0}),t.Capability=void 0,t.isAccessListUint8Array=i,t.isAccessList=function(e){return!i(e)},(n=r||(t.Capability=r={}))[n.EIP155ReplayProtection=155]="EIP155ReplayProtection",n[n.EIP1559FeeMarket=1559]="EIP1559FeeMarket",n[n.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",n[n.EIP2930AccessLists=2930]="EIP2930AccessLists"},4314:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDataFeeEIP2930=t.getAccessListJSON=t.verifyAccessList=t.getAccessListData=t.checkMaxInitCodeSize=void 0;let n=r(6825),i=r(4163),o=r(3238);t.checkMaxInitCodeSize=(e,t)=>{let r=e.param("vm","maxInitCodeSize");if(r&&BigInt(t)>r)throw Error(`the initcode size of this transaction is too large: it is ${t} while the max is ${e.param("vm","maxInitCodeSize")}`)},t.getAccessListData=e=>{let t,r;if((0,o.isAccessList)(e)){t=e;let n=[];for(let t=0;t{for(let t=0;t{let t=[];for(let r=0;r{let r=t.param("gasPrices","accessListStorageKeyCost"),n=t.param("gasPrices","accessListAddressCost"),i=0;for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0})},9541:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=void 0;let i=r(7797),o=r(7244);class s extends i.Web3BaseWallet{constructor(){super(...arguments),this._addressMap=new Map,this._defaultKeyName="web3js_wallet"}static getStorage(){let e;try{e=window.localStorage;let t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch(t){return!t||22!==t.code&&1014!==t.code&&"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||(0,o.isNullish)(e)||0===e.length?void 0:e}}create(e){for(let t=0;tn(this,void 0,void 0,function*(){return r.encrypt(e,t)})))})}decrypt(e,t,r){return n(this,void 0,void 0,function*(){for(let i of yield Promise.all(e.map(e=>n(this,void 0,void 0,function*(){return this._accountProvider.decrypt(e,t,r)}))))this.add(i);return this})}save(e,t){return n(this,void 0,void 0,function*(){let r=s.getStorage();if(!r)throw Error("Local storage not available.");return r.setItem(null!=t?t:this._defaultKeyName,JSON.stringify((yield this.encrypt(e)))),!0})}load(e,t){return n(this,void 0,void 0,function*(){let r=s.getStorage();if(!r)throw Error("Local storage not available.");let n=r.getItem(null!=t?t:this._defaultKeyName);return n&&(yield this.decrypt(JSON.parse(n)||[],e)),this})}}t.Wallet=s},1090:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.DeployerMethodClass=void 0;let i=r(1633),o=r(67),s=r(7894),a=r(7797),l=r(6825),c=r(7244),d=r(7623),u=r(7761);t.DeployerMethodClass=class{_contractMethodDeploySend(e){let t={transactionResolver:e=>{if(e.status===BigInt(0))throw new i.Web3ContractError("code couldn't be stored",e);let t=this.parent.clone();return t.options.address=e.contractAddress,t},contractAbi:this.parent.options.jsonInterface,checkRevertBeforeSending:!1};return(0,c.isNullish)(this.parent.getTransactionMiddleware())?(0,o.sendTransaction)(this.parent,e,this.parent.defaultReturnFormat,t):(0,o.sendTransaction)(this.parent,e,this.parent.defaultReturnFormat,t,this.parent.getTransactionMiddleware())}constructor(e,t){this.parent=e,this.deployOptions=t;let{args:r,abi:n,contractOptions:i,deployData:o}=this.calculateDeployParams();this.args=r,this.constructorAbi=n,this.contractOptions=i,this.deployData=o}send(e){let t=Object.assign({},e),r=this.populateTransaction(t);return this._contractMethodDeploySend(r)}populateTransaction(e){var t,r;let n=Object.assign(Object.assign({},this.contractOptions),{from:null!==(r=null!==(t=this.contractOptions.from)&&void 0!==t?t:this.parent.defaultAccount)&&void 0!==r?r:void 0}),i=(0,u.getSendTxParams)({abi:this.constructorAbi,params:this.args,options:Object.assign(Object.assign({},e),{dataInputFill:this.parent.contractDataInputFill}),contractOptions:n});return i.dataInputFill&&delete i.dataInputFill,i}calculateDeployParams(){var e,t,r,n,o,s;let c=this.parent.options.jsonInterface.find(e=>"constructor"===e.type);c||(c={type:"constructor",stateMutability:""});let d=(0,l.format)({format:"bytes"},null!==(t=null===(e=this.deployOptions)||void 0===e?void 0:e.input)&&void 0!==t?t:this.parent.options.input,a.DEFAULT_RETURN_FORMAT),u=(0,l.format)({format:"bytes"},null!==(n=null===(r=this.deployOptions)||void 0===r?void 0:r.data)&&void 0!==n?n:this.parent.options.data,a.DEFAULT_RETURN_FORMAT);if(!(d&&"0x"!==d.trim()||u&&"0x"!==u.trim()))throw new i.Web3ContractError("contract creation without any data provided.");return{args:null!==(s=null===(o=this.deployOptions)||void 0===o?void 0:o.arguments)&&void 0!==s?s:[],abi:c,contractOptions:Object.assign(Object.assign({},this.parent.options),{input:d,data:u}),deployData:null!=d?d:u}}estimateGas(e){return n(this,arguments,void 0,function*(e,t=this.parent.defaultReturnFormat){let r=Object.assign({},e);return this.parent.contractMethodEstimateGas({abi:this.constructorAbi,params:this.args,returnFormat:t,options:r,contractOptions:this.contractOptions})})}encodeABI(){return(0,d.encodeMethodABI)(this.constructorAbi,this.args,(0,l.format)({format:"bytes"},this.deployData,this.parent.defaultReturnFormat))}decodeData(e){return Object.assign(Object.assign({},(0,s.decodeFunctionCall)(this.constructorAbi,e.replace(this.deployData,""),!1)),{__method__:this.constructorAbi.type})}}},7798:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractSubscriptionManager=void 0;let i=r(5177),o=r(7797);class s extends i.Web3SubscriptionManager{constructor(e,t){super(e.requestManager,e.registeredSubscriptions),this.parentContract=t}subscribe(e,t){let r=Object.create(null,{subscribe:{get:()=>super.subscribe}});return n(this,arguments,void 0,function*(e,t,n=o.DEFAULT_RETURN_FORMAT){return r.subscribe.call(this,e,null!=t?t:this.parentContract.options,n)})}}t.ContractSubscriptionManager=s},7984:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;let i=r(5177),o=r(1633),s=r(67),a=r(7894),l=r(7797),c=r(6825),d=r(7244),u=r(7623),h=r(3425),f=r(7761),p=r(1090),m=r(7798),g={logs:h.ContractLogsSubscription,newHeads:s.NewHeadsSubscription,newBlockHeaders:s.NewHeadsSubscription};class y extends i.Web3Context{get subscriptionManager(){return this._subscriptionManager}constructor(e,t,r,n,s){var a,l,u;let h;let p=(0,c.isContractInitOptions)(t)?t:(0,c.isContractInitOptions)(r)?r:void 0;if(super(Object.assign(Object.assign({},h=(0,f.isWeb3ContractContext)(t)?t:(0,f.isWeb3ContractContext)(r)?r:n),{provider:"object"==typeof t&&"provider"in t?t.provider:"object"==typeof r&&"provider"in r?r.provider:"object"==typeof n&&"provider"in n?n.provider:y.givenProvider,registeredSubscriptions:g})),this.syncWithContext=!1,this._functions={},this._subscriptionManager=new m.ContractSubscriptionManager(super.subscriptionManager,this),(null==h?void 0:h.wallet)&&(this._wallet=h.wallet),(null==h?void 0:h.accountProvider)&&(this._accountProvider=h.accountProvider),!(0,d.isNullish)(p)&&!(0,d.isNullish)(p.data)&&!(0,d.isNullish)(p.input)&&"both"!==this.config.contractDataInputFill)throw new o.ContractTransactionDataAndInputError({data:p.data,input:p.input});this._overloadedMethodAbis=new Map;let b=(0,c.isDataFormat)(n)?n:(0,c.isDataFormat)(r)?r:null!=s?s:this.defaultReturnFormat,v="string"==typeof t?t:void 0;this.config.contractDataInputFill=null!==(a=null==p?void 0:p.dataInputFill)&&void 0!==a?a:this.config.contractDataInputFill,this._parseAndSetJsonInterface(e,b),this.defaultReturnFormat!==b&&(this.defaultReturnFormat=b),(0,d.isNullish)(v)||this._parseAndSetAddress(v,b),this.options={address:v,jsonInterface:this._jsonInterface,gas:null!==(l=null==p?void 0:p.gas)&&void 0!==l?l:null==p?void 0:p.gasLimit,gasPrice:null==p?void 0:p.gasPrice,from:null==p?void 0:p.from,input:null==p?void 0:p.input,data:null==p?void 0:p.data},this.syncWithContext=null!==(u=null==p?void 0:p.syncWithContext)&&void 0!==u&&u,h instanceof i.Web3Context&&this.subscribeToContextEvents(h),Object.defineProperty(this.options,"address",{set:e=>this._parseAndSetAddress(e,b),get:()=>this._address}),Object.defineProperty(this.options,"jsonInterface",{set:e=>this._parseAndSetJsonInterface(e,b),get:()=>this._jsonInterface}),h instanceof i.Web3Context&&h.on(i.Web3ConfigEvent.CONFIG_CHANGE,e=>{this.setConfig({[e.name]:e.newValue})})}setTransactionMiddleware(e){this.transactionMiddleware=e}getTransactionMiddleware(){return this.transactionMiddleware}get events(){return this._events}get methods(){return this._methods}clone(){let e;return e=this.options.address?new y([...this._jsonInterface,...this._errorsInterface],this.options.address,{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()):new y([...this._jsonInterface,...this._errorsInterface],{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()),this.context&&e.subscribeToContextEvents(this.context),e}deploy(e){return new p.DeployerMethodClass(this,e)}getPastEvents(e,t,r){return n(this,void 0,void 0,function*(){var n;let i="string"==typeof e?e:s.ALL_EVENTS,a="string"==typeof e||(0,c.isDataFormat)(e)?(0,c.isDataFormat)(t)?{}:t:e,l=(0,c.isDataFormat)(e)?e:(0,c.isDataFormat)(t)?t:null!=r?r:this.defaultReturnFormat,d="allEvents"===i||i===s.ALL_EVENTS?s.ALL_EVENTS_ABI:this._jsonInterface.find(e=>"name"in e&&e.name===i);if(!d)throw new o.Web3ContractError(`Event ${String(i)} not found.`);let{fromBlock:h,toBlock:f,topics:p,address:m}=(0,u.encodeEventABI)(this.options,d,null!=a?a:{}),g=yield(0,s.getLogs)(this,{fromBlock:h,toBlock:f,topics:p,address:m},l),y=g?g.map(e=>"string"==typeof e?e:(0,s.decodeEventABI)(d,e,this._jsonInterface,l)):[],b=null!==(n=null==a?void 0:a.filter)&&void 0!==n?n:{},v=Object.keys(b);return v.length>0?y.filter(e=>"string"==typeof e||v.every(t=>{var r;if(Array.isArray(b[t]))return b[t].some(r=>String(e.returnValues[t]).toUpperCase()===String(r).toUpperCase());let n=null===(r=d.inputs)||void 0===r?void 0:r.filter(e=>e.name===t)[0];return!(!(null==n?void 0:n.indexed)||"string"!==n.type||(0,c.keccak256)(b[t])!==String(e.returnValues[t]))||String(e.returnValues[t]).toUpperCase()===String(b[t]).toUpperCase()})):y})}_parseAndSetAddress(e,t=this.defaultReturnFormat){this._address=e?(0,c.toChecksumAddress)((0,c.format)({format:"address"},e,t)):e}decodeMethodData(e){let t=e.slice(0,10),r=this._jsonInterface.filter(e=>"error"!==e.type).find(e=>t===(0,a.encodeFunctionSignature)((0,a.jsonInterfaceMethodToString)(e)));if(!r)throw new o.Web3ContractError(`The ABI for the provided method signature ${t} was not found.`);return(0,a.decodeFunctionCall)(r,e)}_parseAndSetJsonInterface(e,t=this.defaultReturnFormat){var r,n;this._functions={},this._methods={},this._events={};let i=[],o=e.filter(e=>"error"!==e.type),l=e.filter(e=>(0,a.isAbiErrorFragment)(e));for(let e of o){let o=Object.assign(Object.assign({},e),{signature:""});if((0,a.isAbiFunctionFragment)(o)){let e=(0,a.jsonInterfaceMethodToString)(o),t=(0,a.encodeFunctionSignature)(e);o.methodNameWithInputs=e,o.signature=t,o.constant="view"===o.stateMutability||"pure"===o.stateMutability||o.constant,o.payable="payable"===o.stateMutability||o.payable,this._overloadedMethodAbis.set(o.name,[...null!==(r=this._overloadedMethodAbis.get(o.name))&&void 0!==r?r:[],o]);let i=null!==(n=this._overloadedMethodAbis.get(o.name))&&void 0!==n?n:[],s=this._createContractMethod(i,l),c=this._createContractMethod(i,l,!0);this._functions[e]={signature:t,method:c},this._methods[o.name]=s,this._methods[e]=c,this._methods[t]=c}else if((0,a.isAbiEventFragment)(o)){let e=(0,a.jsonInterfaceMethodToString)(o),r=(0,a.encodeEventSignature)(e),n=this._createContractEvent(o,t);o.signature=r,e in this._events&&"bound"!==o.name||(this._events[e]=n),this._events[o.name]=n,this._events[r]=n}i=[...i,o]}this._events.allEvents=this._createContractEvent(s.ALL_EVENTS_ABI,t),this._jsonInterface=[...i],this._errorsInterface=l}_getAbiParams(e,t){var r;try{return d.utils.transformJsonDataToAbiFormat(null!==(r=e.inputs)&&void 0!==r?r:[],t)}catch(t){throw new o.Web3ContractError(`Invalid parameters for method ${e.name}: ${t.message}`)}}_createContractMethod(e,t,r=!1){let i=e[e.length-1];return(...e)=>{var o,s,l;let c;let h=null!==(s=r?null===(o=this._overloadedMethodAbis.get(i.name))||void 0===o?void 0:o.filter(e=>e.signature===i.signature):this._overloadedMethodAbis.get(i.name))&&void 0!==s?s:[],p=h[0],m=h.filter(t=>{var r;return(null!==(r=t.inputs)&&void 0!==r?r:[]).length===e.length});if(1===h.length||0===m.length)c=this._getAbiParams(p,e),d.validator.validate(null!==(l=i.inputs)&&void 0!==l?l:[],c);else{let t=[],r=[];for(let n of m)try{c=this._getAbiParams(n,e),d.validator.validate(n.inputs,c),r.push(n)}catch(e){t.push(e)}if(1===r.length?[p]=r:r.length>1&&([p]=r,console.warn(`Multiple methods found that is compatible with the given inputs. Found ${r.length} compatible methods: ${JSON.stringify(r.map(e=>`${e.methodNameWithInputs} (signature: ${e.signature})`))} The first one will be used: ${p.methodNameWithInputs}`)),t.length===m.length)throw new d.Web3ValidatorError(t)}let g={arguments:c,call:(e,r)=>n(this,void 0,void 0,function*(){return this._contractMethodCall(p,c,t,e,r)}),send:e=>this._contractMethodSend(p,c,t,e),populateTransaction:(t,r)=>{var n,o;let s=null!=r?r:this.options;s=Object.assign(Object.assign({},s),{input:void 0,from:null!==(o=null!==(n=null==s?void 0:s.from)&&void 0!==n?n:this.defaultAccount)&&void 0!==o?o:void 0});let a=(0,f.getSendTxParams)({abi:i,params:e,options:Object.assign(Object.assign({},t),{dataInputFill:this.config.contractDataInputFill}),contractOptions:s});return a.dataInputFill&&delete a.dataInputFill,a},estimateGas:(e,...t)=>n(this,[e,...t],void 0,function*(e,t=this.defaultReturnFormat){return this.contractMethodEstimateGas({abi:p,params:c,returnFormat:t,options:e})}),encodeABI:()=>(0,u.encodeMethodABI)(p,c),decodeData:e=>(0,a.decodeFunctionCall)(p,e),createAccessList:(e,r)=>n(this,void 0,void 0,function*(){return this._contractMethodCreateAccessList(p,c,t,e,r)})};return p.stateMutability,g}}_contractMethodCall(e,t,r,i,l){return n(this,void 0,void 0,function*(){var n;let c=(0,f.getEthTxCallParams)({abi:e,params:t,options:Object.assign(Object.assign({},i),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:null!==(n=this.options.from)&&void 0!==n?n:this.config.defaultAccount})});try{let t=yield(0,s.call)(this,c,l,this.defaultReturnFormat);return(0,a.decodeFunctionReturn)(e,t)}catch(e){throw e instanceof o.ContractExecutionError&&(0,a.decodeContractErrorData)(r,e.cause),e}})}_contractMethodCreateAccessList(e,t,r,i,l){return n(this,void 0,void 0,function*(){var n;let c=(0,f.getCreateAccessListParams)({abi:e,params:t,options:Object.assign(Object.assign({},i),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:null!==(n=this.options.from)&&void 0!==n?n:this.config.defaultAccount})});try{return(0,s.createAccessList)(this,c,l,this.defaultReturnFormat)}catch(e){throw e instanceof o.ContractExecutionError&&(0,a.decodeContractErrorData)(r,e.cause),e}})}_contractMethodSend(e,t,r,n,i){var l,c;let u=null!=i?i:this.options;u=Object.assign(Object.assign({},u),{input:void 0,from:null!==(c=null!==(l=u.from)&&void 0!==l?l:this.defaultAccount)&&void 0!==c?c:void 0});let h=(0,f.getSendTxParams)({abi:e,params:t,options:Object.assign(Object.assign({},n),{dataInputFill:this.config.contractDataInputFill}),contractOptions:u}),p=(0,d.isNullish)(this.transactionMiddleware)?(0,s.sendTransaction)(this,h,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface}):(0,s.sendTransaction)(this,h,this.defaultReturnFormat,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface},this.transactionMiddleware);return p.on("error",e=>{e instanceof o.ContractExecutionError&&(0,a.decodeContractErrorData)(r,e.cause)}),p}contractMethodEstimateGas(e){return n(this,arguments,void 0,function*({abi:e,params:t,returnFormat:r,options:n,contractOptions:i}){let o=(0,f.getEstimateGasParams)({abi:e,params:t,options:Object.assign(Object.assign({},n),{dataInputFill:this.config.contractDataInputFill}),contractOptions:null!=i?i:this.options});return(0,s.estimateGas)(this,o,l.BlockTags.LATEST,null!=r?r:this.defaultReturnFormat)})}_createContractEvent(e,t=this.defaultReturnFormat){return(...r)=>{var n;let{topics:i,fromBlock:s}=(0,u.encodeEventABI)(this.options,e,r[0]),a=new h.ContractLogsSubscription({address:this.options.address,topics:i,abi:e,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:t});return(0,d.isNullish)(s)||this.getPastEvents(e.name,{fromBlock:s,topics:i},t).then(e=>{e&&e.forEach(e=>a.emit("data",e))}).catch(e=>{a.emit("error",new o.SubscriptionError("Failed to get past events.",e))}),null===(n=this.subscriptionManager)||void 0===n||n.addSubscription(a).catch(e=>{a.emit("error",new o.SubscriptionError("Failed to subscribe.",e))}),a}}subscribeToContextEvents(e){let t=this;this.context=e,t.syncWithContext&&e.on(i.Web3ConfigEvent.CONFIG_CHANGE,e=>{t.setConfig({[e.name]:e.newValue})})}}t.Contract=y},3425:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LogsSubscription=t.ContractLogsSubscription=void 0;let n=r(5177),i=r(67);class o extends n.Web3Subscription{constructor(e,t){super(e,t),this.address=e.address,this.topics=e.topics,this.abi=e.abi,this.jsonInterface=e.jsonInterface}_buildSubscriptionParams(){return["logs",{address:this.address,topics:this.topics}]}formatSubscriptionResult(e){return(0,i.decodeEventABI)(this.abi,e,this.jsonInterface,super.returnFormat)}}t.ContractLogsSubscription=o,t.LogsSubscription=o},7623:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeMethodReturn=t.decodeMethodParams=t.encodeMethodABI=t.encodeEventABI=t.decodeEventABI=void 0;let n=r(6825),i=r(7797),o=r(7894),s=r(67),a=r(1633);var l=r(67);Object.defineProperty(t,"decodeEventABI",{enumerable:!0,get:function(){return l.decodeEventABI}}),t.encodeEventABI=({address:e},t,r)=>{var a,l;let c=null==r?void 0:r.topics,d=null!==(a=null==r?void 0:r.filter)&&void 0!==a?a:{},u={};if((0,n.isNullish)(null==r?void 0:r.fromBlock)||(u.fromBlock=(0,n.format)(s.blockSchema.properties.number,null==r?void 0:r.fromBlock,{number:i.FMT_NUMBER.HEX,bytes:i.FMT_BYTES.HEX})),(0,n.isNullish)(null==r?void 0:r.toBlock)||(u.toBlock=(0,n.format)(s.blockSchema.properties.number,null==r?void 0:r.toBlock,{number:i.FMT_NUMBER.HEX,bytes:i.FMT_BYTES.HEX})),c&&Array.isArray(c))u.topics=[...c];else if(u.topics=[],!t||t.anonymous||[s.ALL_EVENTS,"allEvents"].includes(t.name)||u.topics.push(null!==(l=t.signature)&&void 0!==l?l:(0,o.encodeEventSignature)((0,o.jsonInterfaceMethodToString)(t))),![s.ALL_EVENTS,"allEvents"].includes(t.name)&&t.inputs)for(let e of t.inputs){if(!e.indexed)continue;let t=d[e.name];t?Array.isArray(t)?u.topics.push(t.map(t=>(0,o.encodeParameter)(e.type,t))):"string"===e.type?u.topics.push((0,n.keccak256)(t)):u.topics.push((0,o.encodeParameter)(e.type,t)):u.topics.push(null)}return u.topics.length||delete u.topics,e&&(u.address=e.toLowerCase()),u},t.encodeMethodABI=(e,t,r)=>{let n;let i=Array.isArray(e.inputs)?e.inputs.length:0;if(e.inputs&&i!==t.length)throw new a.Web3ContractError(`The number of arguments is not matching the methods required number. You need to pass ${i} arguments.`);if(n=e.inputs?(0,o.encodeParameters)(Array.isArray(e.inputs)?e.inputs:[],t).replace("0x",""):(0,o.inferTypesAndEncodeParameters)(t).replace("0x",""),(0,o.isAbiConstructorFragment)(e)){if(!r)throw new a.Web3ContractError("The contract has no contract data option set. This is necessary to append the constructor parameters.");return r.startsWith("0x")?`${r}${n}`:`0x${r}${n}`}return`${(0,o.encodeFunctionSignature)(e)}${n}`},t.decodeMethodParams=o.decodeFunctionCall,t.decodeMethodReturn=o.decodeFunctionReturn},3976:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});let o=r(7984);i(r(7623),t),i(r(7984),t),i(r(1090),t),i(r(3425),t),i(r(6797),t),i(r(7761),t),t.default=o.Contract},6797:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7761:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.create2ContractAddress=t.createContractAddress=t.getCreateAccessListParams=t.isWeb3ContractContext=t.getEstimateGasParams=t.getEthTxCallParams=t.getSendTxParams=void 0;let n=r(9356),i=r(1633),o=r(6825),s=r(7244),a=r(7623),l=(e,t,r,n)=>{var i,s;let l={};return(0,o.isNullish)(e.data)&&"both"!==n||(l.data=(0,a.encodeMethodABI)(t,r,null!==(i=e.data)&&void 0!==i?i:e.input)),(0,o.isNullish)(e.input)&&"both"!==n||(l.input=(0,a.encodeMethodABI)(t,r,null!==(s=e.input)&&void 0!==s?s:e.data)),(0,o.isNullish)(l.input)&&(0,o.isNullish)(l.data)&&(l[n]=(0,a.encodeMethodABI)(t,r)),{data:l.data,input:l.input}};t.getSendTxParams=({abi:e,params:t,options:r,contractOptions:n})=>{var s,a,c;if(!(null!==(c=null!==(a=null!==(s=null==r?void 0:r.input)&&void 0!==s?s:null==r?void 0:r.data)&&void 0!==a?a:n.input)&&void 0!==c?c:n.data)&&!(null==r?void 0:r.to)&&!n.address)throw new i.Web3ContractError("Contract address not specified");if(!(null==r?void 0:r.from)&&!n.from)throw new i.Web3ContractError('Contract "from" address not specified');let d=(0,o.mergeDeep)({to:n.address,gas:n.gas,gasPrice:n.gasPrice,from:n.from,input:n.input,maxPriorityFeePerGas:n.maxPriorityFeePerGas,maxFeePerGas:n.maxFeePerGas,data:n.data},r),u=l(d,e,t,null==r?void 0:r.dataInputFill);return Object.assign(Object.assign({},d),{data:u.data,input:u.input})},t.getEthTxCallParams=({abi:e,params:t,options:r,contractOptions:n})=>{if(!(null==r?void 0:r.to)&&!n.address)throw new i.Web3ContractError("Contract address not specified");let s=(0,o.mergeDeep)({to:n.address,gas:n.gas,gasPrice:n.gasPrice,from:n.from,input:n.input,maxPriorityFeePerGas:n.maxPriorityFeePerGas,maxFeePerGas:n.maxFeePerGas,data:n.data},r),a=l(s,e,t,null==r?void 0:r.dataInputFill);return Object.assign(Object.assign({},s),{data:a.data,input:a.input})},t.getEstimateGasParams=({abi:e,params:t,options:r,contractOptions:n})=>{let i=(0,o.mergeDeep)({to:n.address,gas:n.gas,gasPrice:n.gasPrice,from:n.from,input:n.input,data:n.data},r),s=l(i,e,t,null==r?void 0:r.dataInputFill);return Object.assign(Object.assign({},i),{data:s.data,input:s.input})},t.isWeb3ContractContext=e=>"object"==typeof e&&!(0,o.isNullish)(e)&&0!==Object.keys(e).length&&!(0,o.isContractInitOptions)(e),t.getCreateAccessListParams=({abi:e,params:t,options:r,contractOptions:n})=>{if(!(null==r?void 0:r.to)&&!n.address)throw new i.Web3ContractError("Contract address not specified");if(!(null==r?void 0:r.from)&&!n.from)throw new i.Web3ContractError('Contract "from" address not specified');let s=(0,o.mergeDeep)({to:n.address,gas:n.gas,gasPrice:n.gasPrice,from:n.from,input:n.input,maxPriorityFeePerGas:n.maxPriorityFeePerGas,maxFeePerGas:n.maxFeePerGas,data:n.data},r),a=l(s,e,t,null==r?void 0:r.dataInputFill);return Object.assign(Object.assign({},s),{data:a.data,input:a.input})},t.createContractAddress=(e,t)=>{if(!(0,s.isAddress)(e))throw new i.InvalidAddressError(`Invalid address given ${e}`);let r=t;if("string"==typeof t&&(0,s.isHexString)(t))r=(0,o.hexToNumber)(t);else if("string"==typeof t&&!(0,s.isHexString)(t))throw new i.InvalidNumberError("Invalid nonce value format");let a=n.RLP.encode([e,r]),l=(0,o.keccak256)(a),c="0x".concat(l.substring(26));return(0,o.toChecksumAddress)(c)},t.create2ContractAddress=(e,t,r)=>{if(!(0,s.isAddress)(e))throw new i.InvalidAddressError(`Invalid address given ${e}`);if(!(0,s.isHexString)(t))throw new i.InvalidMethodParamsError(`Invalid salt value ${t}`);if(!(0,s.isHexString)(r))throw new i.InvalidMethodParamsError(`Invalid initCode value ${r}`);let n=`0x${["0xff",e,t,(0,o.keccak256)(r).padStart(64,"0")].map(e=>e.replace(/0x/,"")).join("")}`;return(0,o.toChecksumAddress)(`0x${(0,o.keccak256)(n).slice(26)}`)}},9356:(e,t)=>{function r(e){if(Array.isArray(e)){let t=[],n=0;for(let i=0;ie.length)throw Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function i(e){if(0===e[0])throw Error("invalid RLP: extra zeros");return c(l(e))}function o(e,t){if(e<56)return Uint8Array.from([e+t]);let r=f(e),n=f(t+55+r.length/2);return Uint8Array.from(d(n+r))}function s(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);let r=function e(t){let r,o,s,a,l;let c=[],d=t[0];if(d<=127)return{data:t.slice(0,1),remainder:t.subarray(1)};if(d<=183){if(r=d-127,s=128===d?Uint8Array.from([]):n(t,1,r),2===r&&s[0]<128)throw Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:s,remainder:t.subarray(r)}}if(d<=191){if(o=d-182,t.length-1t.length)throw Error("invalid RLP: total length is larger than the data");for(a=n(t,o,s);a.length;)l=e(a),c.push(l.data),a=l.remainder;return{data:c,remainder:t.subarray(s)}}}(m(e));if(t)return{data:r.data,remainder:r.remainder.slice()};if(0!==r.remainder.length)throw Error("invalid RLP: remainder must be zero");return r.data}Object.defineProperty(t,"__esModule",{value:!0}),t.RLP=t.utils=t.decode=t.encode=void 0,t.encode=r,t.decode=s;let a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){let t="";for(let r=0;re+t.length,0));for(let r=0,n=0;r=2&&"0"===e[0]&&"x"===e[1]}function m(e){var t;if(e instanceof Uint8Array)return e;if("string"==typeof e)return p(e)?d((t="string"!=typeof e?e:p(e)?e.slice(2):e).length%2?`0${t}`:t):h(e);if("number"==typeof e||"bigint"==typeof e)return e?d(f(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw Error("toBytes: received unsupported type "+typeof e)}t.utils={bytesToHex:l,concatBytes:u,hexToBytes:d,utf8ToBytes:h},t.RLP={encode:r,decode:s}},3745:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ENSRegistryAbi=void 0,t.ENSRegistryAbi=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"label",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"owner",type:"address"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"resolver",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"ttl",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"}]},8891:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PublicResolverAbi=void 0,t.PublicResolverAbi=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"address",name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"coinType",type:"uint256"},{indexed:!1,internalType:"bytes",name:"newAddress",type:"bytes"}],name:"AddressChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"},{indexed:!1,internalType:"bytes",name:"record",type:"bytes"}],name:"DNSRecordChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"name",type:"bytes"},{indexed:!1,internalType:"uint16",name:"resource",type:"uint16"}],name:"DNSRecordDeleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"}],name:"DNSZoneCleared",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes",name:"lastzonehash",type:"bytes"},{indexed:!1,internalType:"bytes",name:"zonehash",type:"bytes"}],name:"DNSZonehashChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"bytes4",name:"interfaceID",type:"bytes4"},{indexed:!1,internalType:"address",name:"implementer",type:"address"}],name:"InterfaceChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"string",name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"x",type:"bytes32"},{indexed:!1,internalType:"bytes32",name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"node",type:"bytes32"},{indexed:!0,internalType:"string",name:"indexedKey",type:"string"},{indexed:!1,internalType:"string",name:"key",type:"string"}],name:"TextChanged",type:"event"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"addr",outputs:[{internalType:"address payable",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"uint256",name:"coinType",type:"uint256"}],name:"addr",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"contenthash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"},{internalType:"uint16",name:"resource",type:"uint16"}],name:"dnsRecord",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"name",type:"bytes32"}],name:"hasDNSRecords",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"interfaceImplementer",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"pubkey",outputs:[{internalType:"bytes32",name:"x",type:"bytes32"},{internalType:"bytes32",name:"y",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"string",name:"key",type:"string"}],name:"text",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"zonehash",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"a",type:"address"}],name:"setAddr",outputs:[],stateMutability:"nonpayable",type:"function"}]},5316:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.networkIds=t.registryAddresses=t.methodsInInterface=t.interfaceIds=void 0,t.interfaceIds={addr:"0x3b3b57de",name:"0x691f3431",abi:"0x2203ab56",pubkey:"0xc8690233",text:"0x59d1d43c",contenthash:"0xbc1c58d1"},t.methodsInInterface={setAddr:"addr",addr:"addr",setPubkey:"pubkey",pubkey:"pubkey",setContenthash:"contenthash",contenthash:"contenthash",text:"text",name:"name"},t.registryAddresses={main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},t.networkIds={"0x1":"main","0x5":"goerli"}},6248:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ENS=void 0;let i=r(5177),o=r(1633),s=r(67),a=r(3231),l=r(7797),c=r(7244),d=r(5316),u=r(9633),h=r(9840);class f extends i.Web3Context{constructor(e,t){super(null!=t?t:""),this.registryAddress=null!=e?e:d.registryAddresses.main,this._registry=new u.Registry(this.getContextObject(),e),this._resolver=new h.Resolver(this._registry)}getResolver(e){return n(this,void 0,void 0,function*(){return this._registry.getResolver(e)})}recordExists(e){return n(this,void 0,void 0,function*(){return this._registry.recordExists(e)})}getTTL(e){return n(this,void 0,void 0,function*(){return this._registry.getTTL(e)})}getOwner(e){return n(this,void 0,void 0,function*(){return this._registry.getOwner(e)})}getAddress(e){return n(this,arguments,void 0,function*(e,t=60){return this._resolver.getAddress(e,t)})}getText(e,t){return n(this,void 0,void 0,function*(){return(0,c.isAddress)(e)?this._resolver.getText((yield this._resolver.getName(e,!1)),t):this._resolver.getText(e,t)})}getName(e){return n(this,arguments,void 0,function*(e,t=!0){return this._resolver.getName(e,t)})}getPubkey(e){return n(this,void 0,void 0,function*(){return this._resolver.getPubkey(e)})}getContenthash(e){return n(this,void 0,void 0,function*(){return this._resolver.getContenthash(e)})}checkNetwork(){return n(this,void 0,void 0,function*(){let e=Date.now()/1e3;if(!this._lastSyncCheck||e-this._lastSyncCheck>3600){let t=yield(0,s.isSyncing)(this);if("boolean"!=typeof t||t)throw new o.ENSNetworkNotSyncedError;this._lastSyncCheck=e}if(this._detectedAddress)return this._detectedAddress;let t=yield(0,a.getId)(this,Object.assign(Object.assign({},this.defaultReturnFormat),{number:l.FMT_NUMBER.HEX})),r=d.registryAddresses[d.networkIds[t]];if(void 0===r)throw new o.ENSUnsupportedNetworkError(t);return this._detectedAddress=r,this._detectedAddress})}supportsInterface(e,t){return n(this,void 0,void 0,function*(){return this._resolver.supportsInterface(e,t)})}get events(){return this._registry.events}setAddress(e,t,r){return n(this,void 0,void 0,function*(){return this._resolver.setAddress(e,t,r)})}}t.ENS=f},544:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.registryAddresses=void 0;let o=r(5316);Object.defineProperty(t,"registryAddresses",{enumerable:!0,get:function(){return o.registryAddresses}}),i(r(6248),t)},9633:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Registry=void 0;let i=r(3976),o=r(3745),s=r(8891),a=r(5316),l=r(5529);t.Registry=class{constructor(e,t){this.contract=new i.Contract(o.ENSRegistryAbi,null!=t?t:a.registryAddresses.main,e),this.context=e}getOwner(e){return n(this,void 0,void 0,function*(){try{return this.contract.methods.owner((0,l.namehash)(e)).call()}catch(e){throw Error()}})}getTTL(e){return n(this,void 0,void 0,function*(){try{return this.contract.methods.ttl((0,l.namehash)(e)).call()}catch(e){throw Error()}})}recordExists(e){return n(this,void 0,void 0,function*(){try{return this.contract.methods.recordExists((0,l.namehash)(e)).call()}catch(e){throw Error()}})}getResolver(e){return n(this,void 0,void 0,function*(){try{return this.contract.methods.resolver((0,l.namehash)(e)).call().then(e=>{if("string"==typeof e)return new i.Contract(s.PublicResolverAbi,e,this.context);throw Error()})}catch(e){throw Error()}})}get events(){return this.contract.events}}},9840:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Resolver=void 0;let i=r(1633),o=r(6825),s=r(7244),a=r(5316),l=r(5529);t.Resolver=class{constructor(e){this.registry=e}getResolverContractAdapter(e){return n(this,void 0,void 0,function*(){return this.registry.getResolver(e)})}checkInterfaceSupport(e,t){return n(this,void 0,void 0,function*(){var r,n;if((0,o.isNullish)(a.interfaceIds[t]))throw new i.ResolverMethodMissingError(null!==(r=e.options.address)&&void 0!==r?r:"",t);if(!(yield e.methods.supportsInterface(a.interfaceIds[t]).call()))throw new i.ResolverMethodMissingError(null!==(n=e.options.address)&&void 0!==n?n:"",t)})}supportsInterface(e,t){return n(this,void 0,void 0,function*(){var r;let n=yield this.getResolverContractAdapter(e),i=t;if(!(0,s.isHexStrict)(i)){if(i=null!==(r=(0,o.sha3)(t))&&void 0!==r?r:"",""===t)throw Error("Invalid interface Id");i=i.slice(0,10)}return n.methods.supportsInterface(i).call()})}getAddress(e){return n(this,arguments,void 0,function*(e,t=60){let r=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(r,a.methodsInInterface.addr),r.methods.addr((0,l.namehash)(e),t).call()})}getPubkey(e){return n(this,void 0,void 0,function*(){let t=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(t,a.methodsInInterface.pubkey),t.methods.pubkey((0,l.namehash)(e)).call()})}getContenthash(e){return n(this,void 0,void 0,function*(){let t=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(t,a.methodsInInterface.contenthash),t.methods.contenthash((0,l.namehash)(e)).call()})}setAddress(e,t,r){return n(this,void 0,void 0,function*(){let n=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(n,a.methodsInInterface.setAddr),n.methods.setAddr((0,l.namehash)(e),t).send(r)})}getText(e,t){return n(this,void 0,void 0,function*(){let r=yield this.getResolverContractAdapter(e);return yield this.checkInterfaceSupport(r,a.methodsInInterface.text),r.methods.text((0,l.namehash)(e),t).call()})}getName(e){return n(this,arguments,void 0,function*(e,t=!0){let r=`${e.toLowerCase().substring(2)}.addr.reverse`,n=yield this.getResolverContractAdapter(r);return t&&(yield this.checkInterfaceSupport(n,a.methodsInInterface.name)),n.methods.name((0,l.namehash)(r)).call()})}}},5529:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.namehash=t.normalize=void 0;let n=r(6825),i=r(4457);t.normalize=e=>(0,i.ens_normalize)(e),t.namehash=e=>{let r="";for(let e=0;e<32;e+=1)r+="00";if(e){let i=(0,t.normalize)(e).split(".");for(let e=i.length-1;e>=0;e-=1){let t=(0,n.sha3Raw)(i[e]).slice(2);r=(0,n.sha3Raw)(`0x${r}${t}`).slice(2)}}return`0x${r}`}},6408:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Iban=void 0;let n=r(6825),i=r(7244),o=r(1633);class s{static isDirect(e){return 34===e.length||35===e.length}isDirect(){return s.isDirect(this._iban)}static isIndirect(e){return 20===e.length}isIndirect(){return s.isIndirect(this._iban)}static isValid(e){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(e)&&1===s._mod9710(s._iso13616Prepare(e))}isValid(){return s.isValid(this._iban)}constructor(e){if(this.toAddress=()=>{if(this.isDirect()){let e=this._iban.slice(4),t=s._parseInt(e,36),r=(0,n.leftPad)(t,40);return(0,n.toChecksumAddress)(r)}throw Error("Iban is indirect and cannot be converted. Must be length of 34 or 35")},!s.isIndirect(e)&&!s.isDirect(e))throw Error("Invalid IBAN was provided");this._iban=e}static fromBban(e){let t=`0${(98-this._mod9710(this._iso13616Prepare(`XE00${e}`))).toString()}`.slice(-2);return new s(`XE${t}${e}`)}static createIndirect(e){return s.fromBban(`ETH${e.institution}${e.identifier}`)}static fromAddress(e){if(!(0,i.isAddress)(e))throw new o.InvalidAddressError(e);let t=BigInt((0,n.hexToNumber)(e)).toString(36),r=(0,n.leftPad)(t,15);return s.fromBban(r.toUpperCase())}static toIban(e){return s.fromAddress(e).toString()}client(){return this.isIndirect()?this._iban.slice(11):""}checksum(){return this._iban.slice(2,4)}institution(){return this.isIndirect()?this._iban.slice(7,11):""}toString(){return this._iban}}t.Iban=s,s._iso13616Prepare=e=>{let t=e.toUpperCase();return`${t.slice(4)}${t.slice(0,4)}`.split("").map(e=>{let t=e.charCodeAt(0);return t>=65&&t<=90?t-65+10:e}).join("")},s._parseInt=(e,t)=>[...e].reduce((e,r)=>BigInt(parseInt(r,t))+BigInt(t)*e,BigInt(0)),s._mod9710=e=>{let t,r=e;for(;r.length>2;)t=r.slice(0,9),r=`${(parseInt(t,10)%97).toString()}${r.slice(t.length)}`;return parseInt(r,10)%97},s.toAddress=e=>new s(e).toAddress()},2154:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});let o=r(6408);i(r(6408),t),i(r(1223),t),t.default=o.Iban},1223:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6314:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});let o=r(0);i(r(0),t),t.default=o.Personal},0:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(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 i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Personal=void 0;let a=r(5177),l=o(r(3196));class c extends a.Web3Context{getAccounts(){return s(this,void 0,void 0,function*(){return l.getAccounts(this.requestManager)})}newAccount(e){return s(this,void 0,void 0,function*(){return l.newAccount(this.requestManager,e)})}unlockAccount(e,t,r){return s(this,void 0,void 0,function*(){return l.unlockAccount(this.requestManager,e,t,r)})}lockAccount(e){return s(this,void 0,void 0,function*(){return l.lockAccount(this.requestManager,e)})}importRawKey(e,t){return s(this,void 0,void 0,function*(){return l.importRawKey(this.requestManager,e,t)})}sendTransaction(e,t){return s(this,void 0,void 0,function*(){return l.sendTransaction(this.requestManager,e,t,this.config)})}signTransaction(e,t){return s(this,void 0,void 0,function*(){return l.signTransaction(this.requestManager,e,t,this.config)})}sign(e,t,r){return s(this,void 0,void 0,function*(){return l.sign(this.requestManager,e,t,r)})}ecRecover(e,t){return s(this,void 0,void 0,function*(){return l.ecRecover(this.requestManager,e,t)})}}t.Personal=c},3196:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ecRecover=t.sign=t.signTransaction=t.sendTransaction=t.importRawKey=t.lockAccount=t.unlockAccount=t.newAccount=t.getAccounts=void 0;let i=r(6825),o=r(67),s=r(7797),a=r(7244),l=r(8994);t.getAccounts=e=>n(void 0,void 0,void 0,function*(){return(yield l.personalRpcMethods.getAccounts(e)).map(i.toChecksumAddress)}),t.newAccount=(e,t)=>n(void 0,void 0,void 0,function*(){a.validator.validate(["string"],[t]);let r=yield l.personalRpcMethods.newAccount(e,t);return(0,i.toChecksumAddress)(r)}),t.unlockAccount=(e,t,r,i)=>n(void 0,void 0,void 0,function*(){return a.validator.validate(["address","string","uint"],[t,r,i]),l.personalRpcMethods.unlockAccount(e,t,r,i)}),t.lockAccount=(e,t)=>n(void 0,void 0,void 0,function*(){return a.validator.validate(["address"],[t]),l.personalRpcMethods.lockAccount(e,t)}),t.importRawKey=(e,t,r)=>n(void 0,void 0,void 0,function*(){return a.validator.validate(["string","string"],[t,r]),l.personalRpcMethods.importRawKey(e,t,r)}),t.sendTransaction=(e,t,r,i)=>n(void 0,void 0,void 0,function*(){let n=(0,o.formatTransaction)(t,s.ETH_DATA_FORMAT,{transactionSchema:null==i?void 0:i.customTransactionSchema});return l.personalRpcMethods.sendTransaction(e,n,r)}),t.signTransaction=(e,t,r,i)=>n(void 0,void 0,void 0,function*(){let n=(0,o.formatTransaction)(t,s.ETH_DATA_FORMAT,{transactionSchema:null==i?void 0:i.customTransactionSchema});return l.personalRpcMethods.signTransaction(e,n,r)}),t.sign=(e,t,r,o)=>n(void 0,void 0,void 0,function*(){a.validator.validate(["string","address","string"],[t,r,o]);let n=(0,a.isHexStrict)(t)?t:(0,i.utf8ToHex)(t);return l.personalRpcMethods.sign(e,n,r,o)}),t.ecRecover=(e,t,r)=>n(void 0,void 0,void 0,function*(){a.validator.validate(["string","string"],[t,r]);let n=(0,a.isHexStrict)(t)?t:(0,i.utf8ToHex)(t);return l.personalRpcMethods.ecRecover(e,n,r)})},9190:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NUMBER_DATA_FORMAT=t.ALL_EVENTS_ABI=t.ALL_EVENTS=void 0;let n=r(7797);t.ALL_EVENTS="ALLEVENTS",t.ALL_EVENTS_ABI={name:t.ALL_EVENTS,signature:"",type:"event",inputs:[]},t.NUMBER_DATA_FORMAT={bytes:n.FMT_BYTES.HEX,number:n.FMT_NUMBER.NUMBER}},1324:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.createNewPendingTransactionFilter=function(e,t){return n(this,void 0,void 0,function*(){let r=yield i.ethRpcMethods.newPendingTransactionFilter(e.requestManager);return(0,o.format)({format:"uint"},r,null!=t?t:e.defaultReturnFormat)})},t.createNewFilter=function(e,t,r){return n(this,void 0,void 0,function*(){let{toBlock:n,fromBlock:a}=t;(0,s.isNullish)(n)||"number"!=typeof n&&"bigint"!=typeof n||(n=(0,o.numberToHex)(n)),(0,s.isNullish)(a)||"number"!=typeof a&&"bigint"!=typeof a||(a=(0,o.numberToHex)(a));let l=Object.assign(Object.assign({},t),{fromBlock:a,toBlock:n}),c=yield i.ethRpcMethods.newFilter(e.requestManager,l);return(0,o.format)({format:"uint"},c,null!=r?r:e.defaultReturnFormat)})},t.createNewBlockFilter=function(e,t){return n(this,void 0,void 0,function*(){let r=yield i.ethRpcMethods.newBlockFilter(e.requestManager);return(0,o.format)({format:"uint"},r,null!=t?t:e.defaultReturnFormat)})},t.uninstallFilter=function(e,t){return n(this,void 0,void 0,function*(){return yield i.ethRpcMethods.uninstallFilter(e.requestManager,(0,o.numberToHex)(t))})},t.getFilterChanges=function(e,t,r){return n(this,void 0,void 0,function*(){return(yield i.ethRpcMethods.getFilterChanges(e.requestManager,(0,o.numberToHex)(t))).map(t=>"string"==typeof t?t:(0,o.format)(a.logSchema,t,null!=r?r:e.defaultReturnFormat))})},t.getFilterLogs=function(e,t,r){return n(this,void 0,void 0,function*(){return(yield i.ethRpcMethods.getFilterLogs(e.requestManager,(0,o.numberToHex)(t))).map(t=>"string"==typeof t?t:(0,o.format)(a.logSchema,t,null!=r?r:e.defaultReturnFormat))})};let i=r(8994),o=r(6825),s=r(7244),a=r(9375)},67:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.SendTxHelper=t.trySendTransaction=t.waitForTransactionReceipt=t.getTransactionFromOrToAttr=t.transactionBuilder=t.detectTransactionType=void 0,r(766);let o=r(1128);i(r(1128),t),i(r(8096),t),i(r(9375),t),i(r(9190),t),i(r(9138),t),i(r(5800),t),i(r(897),t),i(r(269),t),i(r(6393),t),i(r(5265),t);var s=r(3392);Object.defineProperty(t,"detectTransactionType",{enumerable:!0,get:function(){return s.detectTransactionType}});var a=r(2113);Object.defineProperty(t,"transactionBuilder",{enumerable:!0,get:function(){return a.transactionBuilder}}),Object.defineProperty(t,"getTransactionFromOrToAttr",{enumerable:!0,get:function(){return a.getTransactionFromOrToAttr}});var l=r(940);Object.defineProperty(t,"waitForTransactionReceipt",{enumerable:!0,get:function(){return l.waitForTransactionReceipt}});var c=r(3710);Object.defineProperty(t,"trySendTransaction",{enumerable:!0,get:function(){return c.trySendTransaction}});var d=r(5517);Object.defineProperty(t,"SendTxHelper",{enumerable:!0,get:function(){return d.SendTxHelper}}),t.default=o.Web3Eth},897:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.isMining=t.getCoinbase=t.isSyncing=t.getProtocolVersion=void 0,t.getHashRate=function(e,t){return n(this,void 0,void 0,function*(){let r=yield u.ethRpcMethods.getHashRate(e.requestManager);return(0,a.format)({format:"uint"},r,null!=t?t:e.defaultReturnFormat)})},t.getGasPrice=function(e,t){return n(this,void 0,void 0,function*(){let r=yield u.ethRpcMethods.getGasPrice(e.requestManager);return(0,a.format)({format:"uint"},r,null!=t?t:e.defaultReturnFormat)})},t.getMaxPriorityFeePerGas=function(e,t){return n(this,void 0,void 0,function*(){let r=yield u.ethRpcMethods.getMaxPriorityFeePerGas(e.requestManager);return(0,a.format)({format:"uint"},r,null!=t?t:e.defaultReturnFormat)})},t.getBlockNumber=function(e,t){return n(this,void 0,void 0,function*(){let r=yield u.ethRpcMethods.getBlockNumber(e.requestManager);return(0,a.format)({format:"uint"},r,null!=t?t:e.defaultReturnFormat)})},t.getBalance=function(e,t){return n(this,arguments,void 0,function*(e,t,r=e.defaultBlock,n){let i=(0,c.isBlockTag)(r)?r:(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT),s=yield u.ethRpcMethods.getBalance(e.requestManager,t,i);return(0,a.format)({format:"uint"},s,null!=n?n:e.defaultReturnFormat)})},t.getStorageAt=function(e,t,r){return n(this,arguments,void 0,function*(e,t,r,n=e.defaultBlock,i){let s=(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT),l=(0,c.isBlockTag)(n)?n:(0,a.format)({format:"uint"},n,o.ETH_DATA_FORMAT),d=yield u.ethRpcMethods.getStorageAt(e.requestManager,t,s,l);return(0,a.format)({format:"bytes"},d,null!=i?i:e.defaultReturnFormat)})},t.getCode=function(e,t){return n(this,arguments,void 0,function*(e,t,r=e.defaultBlock,n){let i=(0,c.isBlockTag)(r)?r:(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT),s=yield u.ethRpcMethods.getCode(e.requestManager,t,i);return(0,a.format)({format:"bytes"},s,null!=n?n:e.defaultReturnFormat)})},t.getBlock=function(e){return n(this,arguments,void 0,function*(e,t=e.defaultBlock,r=!1,n){var i;let s;if((0,c.isBytes)(t)){let n=(0,a.format)({format:"bytes32"},t,o.ETH_DATA_FORMAT);s=yield u.ethRpcMethods.getBlockByHash(e.requestManager,n,r)}else{let n=(0,c.isBlockTag)(t)?t:(0,a.format)({format:"uint"},t,o.ETH_DATA_FORMAT);s=yield u.ethRpcMethods.getBlockByNumber(e.requestManager,n,r)}let l=(0,a.format)(f.blockSchema,s,null!=n?n:e.defaultReturnFormat);return(0,c.isNullish)(l)?l:Object.assign(Object.assign({},l),{transactions:null!==(i=l.transactions)&&void 0!==i?i:[]})})},t.getBlockTransactionCount=function(e){return n(this,arguments,void 0,function*(e,t=e.defaultBlock,r){let n;if((0,c.isBytes)(t)){let r=(0,a.format)({format:"bytes32"},t,o.ETH_DATA_FORMAT);n=yield u.ethRpcMethods.getBlockTransactionCountByHash(e.requestManager,r)}else{let r=(0,c.isBlockTag)(t)?t:(0,a.format)({format:"uint"},t,o.ETH_DATA_FORMAT);n=yield u.ethRpcMethods.getBlockTransactionCountByNumber(e.requestManager,r)}return(0,a.format)({format:"uint"},n,null!=r?r:e.defaultReturnFormat)})},t.getBlockUncleCount=function(e){return n(this,arguments,void 0,function*(e,t=e.defaultBlock,r){let n;if((0,c.isBytes)(t)){let r=(0,a.format)({format:"bytes32"},t,o.ETH_DATA_FORMAT);n=yield u.ethRpcMethods.getUncleCountByBlockHash(e.requestManager,r)}else{let r=(0,c.isBlockTag)(t)?t:(0,a.format)({format:"uint"},t,o.ETH_DATA_FORMAT);n=yield u.ethRpcMethods.getUncleCountByBlockNumber(e.requestManager,r)}return(0,a.format)({format:"uint"},n,null!=r?r:e.defaultReturnFormat)})},t.getUncle=function(e){return n(this,arguments,void 0,function*(e,t=e.defaultBlock,r,n){let i;let s=(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT);if((0,c.isBytes)(t)){let r=(0,a.format)({format:"bytes32"},t,o.ETH_DATA_FORMAT);i=yield u.ethRpcMethods.getUncleByBlockHashAndIndex(e.requestManager,r,s)}else{let r=(0,c.isBlockTag)(t)?t:(0,a.format)({format:"uint"},t,o.ETH_DATA_FORMAT);i=yield u.ethRpcMethods.getUncleByBlockNumberAndIndex(e.requestManager,r,s)}return(0,a.format)(f.blockSchema,i,null!=n?n:e.defaultReturnFormat)})},t.getTransaction=function(e,t){return n(this,arguments,void 0,function*(e,t,r=e.defaultReturnFormat){let n=(0,a.format)({format:"bytes32"},t,o.DEFAULT_RETURN_FORMAT),i=yield u.ethRpcMethods.getTransactionByHash(e.requestManager,n);return(0,c.isNullish)(i)?i:(0,m.formatTransaction)(i,r,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0})})},t.getPendingTransactions=function(e,t){return n(this,void 0,void 0,function*(){return(yield u.ethRpcMethods.getPendingTransactions(e.requestManager)).map(r=>(0,m.formatTransaction)(r,null!=t?t:e.defaultReturnFormat,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0}))})},t.getTransactionFromBlock=function(e){return n(this,arguments,void 0,function*(e,t=e.defaultBlock,r,n){let i;let s=(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT);if((0,c.isBytes)(t)){let r=(0,a.format)({format:"bytes32"},t,o.ETH_DATA_FORMAT);i=yield u.ethRpcMethods.getTransactionByBlockHashAndIndex(e.requestManager,r,s)}else{let r=(0,c.isBlockTag)(t)?t:(0,a.format)({format:"uint"},t,o.ETH_DATA_FORMAT);i=yield u.ethRpcMethods.getTransactionByBlockNumberAndIndex(e.requestManager,r,s)}return(0,c.isNullish)(i)?i:(0,m.formatTransaction)(i,null!=n?n:e.defaultReturnFormat,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0})})},t.getTransactionReceipt=function(e,t,r){return n(this,void 0,void 0,function*(){let n;let i=(0,a.format)({format:"bytes32"},t,o.DEFAULT_RETURN_FORMAT);try{n=yield u.ethRpcMethods.getTransactionReceipt(e.requestManager,i)}catch(e){if("object"!=typeof e||(0,c.isNullish)(e)||!("message"in e)||"transaction indexing is in progress"!==e.message)throw e;console.warn("Transaction indexing is in progress.")}return(0,c.isNullish)(n)?n:(0,a.format)(f.transactionReceiptSchema,n,null!=r?r:e.defaultReturnFormat)})},t.getTransactionCount=function(e,t){return n(this,arguments,void 0,function*(e,t,r=e.defaultBlock,n){let i=(0,c.isBlockTag)(r)?r:(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT),s=yield u.ethRpcMethods.getTransactionCount(e.requestManager,t,i);return(0,a.format)({format:"uint"},s,null!=n?n:e.defaultReturnFormat)})},t.sendTransaction=function(e,t,r,i={checkRevertBeforeSending:!0},l){let d=new s.Web3PromiEvent((s,u)=>{setImmediate(()=>{(()=>{n(this,void 0,void 0,function*(){let n=new v.SendTxHelper({web3Context:e,promiEvent:d,options:i,returnFormat:r}),h=Object.assign({},t);(0,c.isNullish)(l)||(h=yield l.processTransaction(h));let g=(0,m.formatTransaction)(Object.assign(Object.assign({},h),{from:(0,p.getTransactionFromOrToAttr)("from",e,h),to:(0,p.getTransactionFromOrToAttr)("to",e,h)}),o.ETH_DATA_FORMAT,{transactionSchema:e.config.customTransactionSchema});try{let t;g=yield n.populateGasPrice({transaction:h,transactionFormatted:g}),yield n.checkRevertBeforeSending(g),n.emitSending(g),e.wallet&&!(0,c.isNullish)(g.from)&&(t=e.wallet.get(g.from));let i=yield n.signAndSend({wallet:t,tx:g}),o=(0,a.format)({format:"bytes32"},i,null!=r?r:e.defaultReturnFormat);n.emitSent(g),n.emitTransactionHash(o);let l=yield(0,y.waitForTransactionReceipt)(e,i,null!=r?r:e.defaultReturnFormat),d=n.getReceiptWithEvents((0,a.format)(f.transactionReceiptSchema,l,null!=r?r:e.defaultReturnFormat));n.emitReceipt(d),s((yield n.handleResolve({receipt:d,tx:g}))),n.emitConfirmation({receipt:d,transactionHash:i})}catch(e){u((yield n.handleError({error:e,tx:g})))}})})()})});return d},t.sendSignedTransaction=function(e,t,r,c={checkRevertBeforeSending:!0}){let d=new s.Web3PromiEvent((s,h)=>{setImmediate(()=>{(()=>{n(this,void 0,void 0,function*(){let p=new v.SendTxHelper({web3Context:e,promiEvent:d,options:c,returnFormat:r}),m=(0,a.format)({format:"bytes"},t,o.ETH_DATA_FORMAT),b=l.TransactionFactory.fromSerializedData((0,a.bytesToUint8Array)((0,a.hexToBytes)(m))),w=Object.assign(Object.assign({},b.toJSON()),{from:b.getSenderAddress().toString()});try{let{v:t,r:o,s:l}=w,c=i(w,["v","r","s"]);yield p.checkRevertBeforeSending(c),p.emitSending(m);let d=yield(0,g.trySendTransaction)(e,()=>n(this,void 0,void 0,function*(){return u.ethRpcMethods.sendRawTransaction(e.requestManager,m)}));p.emitSent(m);let h=(0,a.format)({format:"bytes32"},d,null!=r?r:e.defaultReturnFormat);p.emitTransactionHash(h);let b=yield(0,y.waitForTransactionReceipt)(e,d,null!=r?r:e.defaultReturnFormat),v=p.getReceiptWithEvents((0,a.format)(f.transactionReceiptSchema,b,null!=r?r:e.defaultReturnFormat));p.emitReceipt(v),s((yield p.handleResolve({receipt:v,tx:w}))),p.emitConfirmation({receipt:v,transactionHash:d})}catch(e){h((yield p.handleError({error:e,tx:w})))}})})()})});return d},t.sign=function(e,t,r){return n(this,arguments,void 0,function*(e,t,r,n=e.defaultReturnFormat){var i;let s=(0,a.format)({format:"bytes"},t,o.DEFAULT_RETURN_FORMAT);if(null===(i=e.wallet)||void 0===i?void 0:i.get(r)){let t=e.wallet.get(r).sign(s);return(0,a.format)(f.SignatureObjectSchema,t,n)}if("number"==typeof r)throw new d.SignatureError(t,'RPC method "eth_sign" does not support index signatures');let l=yield u.ethRpcMethods.sign(e.requestManager,r,s);return(0,a.format)({format:"bytes"},l,n)})},t.signTransaction=function(e,t){return n(this,arguments,void 0,function*(e,t,r=e.defaultReturnFormat){let n=yield u.ethRpcMethods.signTransaction(e.requestManager,(0,m.formatTransaction)(t,o.ETH_DATA_FORMAT,{transactionSchema:e.config.customTransactionSchema}));return(0,c.isString)(n)?(0,h.decodeSignedTransaction)(n,r,{fillInputAndData:!0}):{raw:(0,a.format)({format:"bytes"},n.raw,r),tx:(0,m.formatTransaction)(n.tx,r,{transactionSchema:e.config.customTransactionSchema,fillInputAndData:!0})}})},t.call=function(e,t){return n(this,arguments,void 0,function*(e,t,r=e.defaultBlock,n=e.defaultReturnFormat){let i=(0,c.isBlockTag)(r)?r:(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT),s=yield u.ethRpcMethods.call(e.requestManager,(0,m.formatTransaction)(t,o.ETH_DATA_FORMAT,{transactionSchema:e.config.customTransactionSchema}),i);return(0,a.format)({format:"bytes"},s,n)})},t.estimateGas=function(e,t){return n(this,arguments,void 0,function*(e,t,r=e.defaultBlock,n){let i=(0,m.formatTransaction)(t,o.ETH_DATA_FORMAT,{transactionSchema:e.config.customTransactionSchema}),s=(0,c.isBlockTag)(r)?r:(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT),l=yield u.ethRpcMethods.estimateGas(e.requestManager,i,s);return(0,a.format)({format:"uint"},l,null!=n?n:e.defaultReturnFormat)})},t.getLogs=function(e,t,r){return n(this,void 0,void 0,function*(){let{toBlock:n,fromBlock:i}=t;(0,c.isNullish)(n)||"number"!=typeof n&&"bigint"!=typeof n||(n=(0,a.numberToHex)(n)),(0,c.isNullish)(i)||"number"!=typeof i&&"bigint"!=typeof i||(i=(0,a.numberToHex)(i));let o=Object.assign(Object.assign({},t),{fromBlock:i,toBlock:n});return(yield u.ethRpcMethods.getLogs(e.requestManager,o)).map(t=>"string"==typeof t?t:(0,a.format)(f.logSchema,t,null!=r?r:e.defaultReturnFormat))})},t.getChainId=function(e,t){return n(this,void 0,void 0,function*(){let r=yield u.ethRpcMethods.getChainId(e.requestManager);return(0,a.format)({format:"uint"},r,null!=t?t:e.defaultReturnFormat)})},t.getProof=function(e,t,r){return n(this,arguments,void 0,function*(e,t,r,n=e.defaultBlock,i){let s=r.map(e=>(0,a.format)({format:"bytes"},e,o.ETH_DATA_FORMAT)),l=(0,c.isBlockTag)(n)?n:(0,a.format)({format:"uint"},n,o.ETH_DATA_FORMAT),d=yield u.ethRpcMethods.getProof(e.requestManager,t,s,l);return(0,a.format)(f.accountSchema,d,null!=i?i:e.defaultReturnFormat)})},t.getFeeHistory=function(e,t){return n(this,arguments,void 0,function*(e,t,r=e.defaultBlock,n,i){let s=(0,a.format)({format:"uint"},t,o.ETH_DATA_FORMAT),l=(0,c.isBlockTag)(r)?r:(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT),d=(0,a.format)({type:"array",items:{format:"uint"}},n,b.NUMBER_DATA_FORMAT),h=yield u.ethRpcMethods.getFeeHistory(e.requestManager,s,l,d);return(0,a.format)(f.feeHistorySchema,h,null!=i?i:e.defaultReturnFormat)})},t.createAccessList=function(e,t){return n(this,arguments,void 0,function*(e,t,r=e.defaultBlock,n){let i=(0,c.isBlockTag)(r)?r:(0,a.format)({format:"uint"},r,o.ETH_DATA_FORMAT),s=yield u.ethRpcMethods.createAccessList(e.requestManager,(0,m.formatTransaction)(t,o.ETH_DATA_FORMAT,{transactionSchema:e.config.customTransactionSchema}),i);return(0,a.format)(f.accessListResultSchema,s,null!=n?n:e.defaultReturnFormat)})},t.signTypedData=function(e,t,r,i,o){return n(this,void 0,void 0,function*(){let n=yield u.ethRpcMethods.signTypedData(e.requestManager,t,r,i);return(0,a.format)({format:"bytes"},n,null!=o?o:e.defaultReturnFormat)})};let o=r(7797),s=r(5177),a=r(6825),l=r(2054),c=r(7244),d=r(1633),u=r(8994),h=r(2029),f=r(9375),p=r(2113),m=r(269),g=r(3710),y=r(940),b=r(9190),v=r(5517);t.getProtocolVersion=e=>n(void 0,void 0,void 0,function*(){return u.ethRpcMethods.getProtocolVersion(e.requestManager)}),t.isSyncing=e=>n(void 0,void 0,void 0,function*(){return u.ethRpcMethods.getSyncing(e.requestManager)}),t.getCoinbase=e=>n(void 0,void 0,void 0,function*(){return u.ethRpcMethods.getCoinbase(e.requestManager)}),t.isMining=e=>n(void 0,void 0,void 0,function*(){return u.ethRpcMethods.getMining(e.requestManager)})},9375:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.accountSchema=t.storageProofSchema=t.feeHistorySchema=t.SignatureObjectSchema=t.transactionReceiptSchema=t.syncSchema=t.logSchema=t.blockHeaderSchema=t.blockSchema=t.withdrawalsSchema=t.transactionInfoSchema=t.transactionSchema=t.customChainSchema=t.hardforkSchema=t.chainSchema=t.accessListResultSchema=t.accessListSchema=t.accessListItemSchema=void 0,t.accessListItemSchema={type:"object",properties:{address:{format:"address"},storageKeys:{type:"array",items:{format:"bytes32"}}}},t.accessListSchema={type:"array",items:Object.assign({},t.accessListItemSchema)},t.accessListResultSchema={type:"object",properties:{accessList:Object.assign({},t.accessListSchema),gasUsed:{type:"string"}}},t.chainSchema={type:"string",enum:["goerli","kovan","mainnet","rinkeby","ropsten","sepolia"]},t.hardforkSchema={type:"string",enum:["arrowGlacier","berlin","byzantium","chainstart","constantinople","dao","homestead","istanbul","london","merge","muirGlacier","petersburg","shanghai","spuriousDragon","tangerineWhistle"]},t.customChainSchema={type:"object",properties:{name:{format:"string"},networkId:{format:"uint"},chainId:{format:"uint"}}},t.transactionSchema={type:"object",properties:{from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},t.accessListSchema),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},chain:Object.assign({},t.chainSchema),hardfork:Object.assign({},t.hardforkSchema),chainId:{format:"uint"},networkId:{format:"uint"},common:{type:"object",properties:{customChain:Object.assign({},t.customChainSchema),baseChain:Object.assign({},t.chainSchema),hardfork:Object.assign({},t.hardforkSchema)}},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}}},t.transactionInfoSchema={type:"object",properties:Object.assign(Object.assign({},t.transactionSchema.properties),{blockHash:{format:"bytes32"},blockNumber:{format:"uint"},hash:{format:"bytes32"},transactionIndex:{format:"uint"},from:{format:"address"},to:{oneOf:[{format:"address"},{type:"null"}]},value:{format:"uint"},gas:{format:"uint"},gasPrice:{format:"uint"},effectiveGasPrice:{format:"uint"},type:{format:"uint"},maxFeePerGas:{format:"uint"},maxPriorityFeePerGas:{format:"uint"},accessList:Object.assign({},t.accessListSchema),data:{format:"bytes"},input:{format:"bytes"},nonce:{format:"uint"},gasLimit:{format:"uint"},v:{format:"uint"},r:{format:"bytes32"},s:{format:"bytes32"}})},t.withdrawalsSchema={type:"object",properties:{index:{format:"uint"},validatorIndex:{format:"uint"},address:{format:"address"},amount:{format:"uint"}}},t.blockSchema={type:"object",properties:{baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{oneOf:[{type:"array",items:Object.assign({},t.transactionInfoSchema)},{type:"array",items:{format:"bytes32"}}]},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},t.withdrawalsSchema)},withdrawalsRoot:{format:"bytes32"}}},t.blockHeaderSchema={type:"object",properties:{author:{format:"bytes32"},excessDataGas:{format:"uint"},baseFeePerGas:{format:"uint"},blobGasUsed:{format:"uint"},difficulty:{format:"uint"},excessBlobGas:{format:"uint"},extraData:{format:"bytes"},gasLimit:{format:"uint"},gasUsed:{format:"uint"},hash:{format:"bytes32"},logsBloom:{format:"bytes256"},miner:{format:"bytes"},mixHash:{format:"bytes32"},nonce:{format:"uint"},number:{format:"uint"},parentBeaconBlockRoot:{format:"bytes32"},parentHash:{format:"bytes32"},receiptsRoot:{format:"bytes32"},sha3Uncles:{format:"bytes32"},size:{format:"uint"},stateRoot:{format:"bytes32"},timestamp:{format:"uint"},totalDifficulty:{format:"uint"},transactions:{type:"array",items:{format:"bytes32"}},transactionsRoot:{format:"bytes32"},uncles:{type:"array",items:{format:"bytes32"}},withdrawals:{type:"array",items:Object.assign({},t.withdrawalsSchema)},withdrawalsRoot:{format:"bytes32"}}},t.logSchema={type:"object",properties:{removed:{format:"bool"},logIndex:{format:"uint"},transactionIndex:{format:"uint"},transactionHash:{format:"bytes32"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},address:{format:"address"},data:{format:"bytes"},topics:{type:"array",items:{format:"bytes32"}}}},t.syncSchema={type:"object",properties:{startingBlock:{format:"string"},currentBlock:{format:"string"},highestBlock:{format:"string"},knownStates:{format:"string"},pulledStates:{format:"string"}}},t.transactionReceiptSchema={type:"object",properties:{transactionHash:{format:"bytes32"},transactionIndex:{format:"uint"},blockHash:{format:"bytes32"},blockNumber:{format:"uint"},from:{format:"address"},to:{format:"address"},cumulativeGasUsed:{format:"uint"},gasUsed:{format:"uint"},effectiveGasPrice:{format:"uint"},contractAddress:{format:"address"},logs:{type:"array",items:Object.assign({},t.logSchema)},logsBloom:{format:"bytes"},root:{format:"bytes"},status:{format:"uint"},type:{format:"uint"}}},t.SignatureObjectSchema={type:"object",properties:{messageHash:{format:"bytes"},r:{format:"bytes32"},s:{format:"bytes32"},v:{format:"bytes"},message:{format:"bytes"},signature:{format:"bytes"}}},t.feeHistorySchema={type:"object",properties:{oldestBlock:{format:"uint"},baseFeePerGas:{type:"array",items:{format:"uint"}},reward:{type:"array",items:{type:"array",items:{format:"uint"}}},gasUsedRatio:{type:"array",items:{type:"number"}}}},t.storageProofSchema={type:"object",properties:{key:{format:"bytes32"},value:{format:"uint"},proof:{type:"array",items:{format:"bytes32"}}}},t.accountSchema={type:"object",properties:{balance:{format:"uint"},codeHash:{format:"bytes32"},nonce:{format:"uint"},storageHash:{format:"bytes32"},accountProof:{type:"array",items:{format:"bytes32"}},storageProof:{type:"array",items:Object.assign({},t.storageProofSchema)}}}},9138:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2029:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSignedTransaction=function(e,t,r={fillInputAndData:!1}){return{raw:(0,n.format)({format:"bytes"},e,t),tx:(0,s.formatTransaction)(Object.assign(Object.assign({},i.TransactionFactory.fromSerializedData((0,n.hexToBytes)(e)).toJSON()),{hash:(0,n.bytesToHex)((0,n.keccak256)((0,n.hexToBytes)(e))),type:(0,o.detectRawTransactionType)((0,n.hexToBytes)(e))}),t,{fillInputAndData:r.fillInputAndData,transactionSchema:r.transactionSchema})}};let n=r(6825),i=r(2054),o=r(3392),s=r(269)},8096:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeEventABI=void 0;let n=r(6825),i=r(7797),o=r(7894),s=r(9375),a=r(9190);t.decodeEventABI=(e,t,r,l=i.DEFAULT_RETURN_FORMAT)=>{var c,d,u,h,f,p;let m=Object.assign({},e),g=(0,n.format)(s.logSchema,t,l);if([a.ALL_EVENTS,"allEvents"].includes(m.name)&&(m=r.find(e=>e.signature===t.topics[0])||{anonymous:!0}),m.inputs=null!==(d=null!==(c=m.inputs)&&void 0!==c?c:e.inputs)&&void 0!==d?d:[],!m.anonymous){let e=0;(null!==(u=m.inputs)&&void 0!==u?u:[]).forEach(t=>{t.indexed&&(e+=1)}),e>0&&(null==t?void 0:t.topics)&&(null==t?void 0:t.topics.length)!==e+1&&(m=Object.assign(Object.assign({},m),{anonymous:!0,inputs:[]}))}let y=m.anonymous?t.topics:(null!==(h=t.topics)&&void 0!==h?h:[]).slice(1);return Object.assign(Object.assign({},g),{returnValues:(0,o.decodeLog)([...null!==(f=m.inputs)&&void 0!==f?f:[]],t.data,y),event:m.name,signature:!m.anonymous&&(null===(p=t.topics)||void 0===p?void 0:p.length)>0&&t.topics[0]?t.topics[0]:void 0,raw:{data:t.data,topics:t.topics}})}},3392:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.detectRawTransactionType=t.detectTransactionType=t.defaultTransactionTypeParser=void 0;let n=r(6825),i=r(7797),o=r(7244),s=r(1633),a={type:"object",properties:{accessList:{type:"null"},maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},l={type:"object",properties:{maxFeePerGas:{type:"null"},maxPriorityFeePerGas:{type:"null"}}},c={type:"object",properties:{gasPrice:{type:"null"}}},d=(e,t,r)=>{try{o.validator.validateJSONSchema(e,t)}catch(e){if(e instanceof o.Web3ValidatorError)throw new s.InvalidPropertiesForTransactionTypeError(e.errors,r);throw e}};t.defaultTransactionTypeParser=e=>{var t,r;if(!(0,o.isNullish)(e.type)){let t;switch(e.type){case"0x0":t=a;break;case"0x1":t=l;break;case"0x2":t=c;break;default:return(0,n.format)({format:"uint"},e.type,i.ETH_DATA_FORMAT)}return d(t,e,e.type),(0,n.format)({format:"uint"},e.type,i.ETH_DATA_FORMAT)}if(!(0,o.isNullish)(e.maxFeePerGas)||!(0,o.isNullish)(e.maxPriorityFeePerGas))return d(c,e,"0x2"),"0x2";if(!(0,o.isNullish)(e.accessList))return d(l,e,"0x1"),"0x1";let s=null!==(t=e.hardfork)&&void 0!==t?t:null===(r=e.common)||void 0===r?void 0:r.hardfork;if(!(0,o.isNullish)(s)){let t=Object.keys(i.HardforksOrdered).indexOf(s);if(t>=Object.keys(i.HardforksOrdered).indexOf("london"))return(0,o.isNullish)(e.gasPrice)?"0x2":"0x0";if(t===Object.keys(i.HardforksOrdered).indexOf("berlin"))return"0x0"}return(0,o.isNullish)(e.gasPrice)?void 0:(d(a,e,"0x0"),"0x0")},t.detectTransactionType=(e,r)=>{var n;return(null!==(n=null==r?void 0:r.transactionTypeParser)&&void 0!==n?n:t.defaultTransactionTypeParser)(e)},t.detectRawTransactionType=e=>e[0]>127?"0x0":(0,n.toHex)(e[0])},269:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatTransaction=function(e,t=n.DEFAULT_RETURN_FORMAT,r={transactionSchema:a.transactionInfoSchema,fillInputAndData:!1}){var l,c;let d=(0,o.mergeDeep)({},e);if((0,i.isNullish)(null==e?void 0:e.common)||(d.common=Object.assign({},e.common),(0,i.isNullish)(null===(l=e.common)||void 0===l?void 0:l.customChain)||(d.common.customChain=Object.assign({},e.common.customChain))),d=(0,o.format)(null!==(c=r.transactionSchema)&&void 0!==c?c:a.transactionInfoSchema,d,t),!(0,i.isNullish)(d.data)&&!(0,i.isNullish)(d.input)&&(0,o.toHex)(d.data)!==(0,o.toHex)(d.input))throw new s.TransactionDataAndInputError({data:(0,o.bytesToHex)(d.data),input:(0,o.bytesToHex)(d.input)});return r.fillInputAndData&&((0,i.isNullish)(d.data)?(0,i.isNullish)(d.input)||(d.data=d.input):d.input=d.data),(0,i.isNullish)(d.gasLimit)||(d.gas=d.gasLimit,delete d.gasLimit),d};let n=r(7797),i=r(7244),o=r(6825),s=r(1633),a=r(9375)},2801:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.parseTransactionError=void 0,t.getRevertReason=function(e,r,i){return n(this,arguments,void 0,function*(e,r,n,i=e.defaultReturnFormat){try{return void(yield(0,s.call)(e,r,e.defaultBlock,i))}catch(e){return(0,t.parseTransactionError)(e,n)}})};let i=r(1633),o=r(7894),s=r(897);t.parseTransactionError=(e,t)=>{var r,n,s,a,l;if(e instanceof i.ContractExecutionError&&e.cause instanceof i.Eip838ExecutionError){if(void 0!==t){let i=t.filter(e=>(0,o.isAbiErrorFragment)(e));return(0,o.decodeContractErrorData)(i,e.cause),{reason:e.cause.message,signature:null===(r=e.cause.data)||void 0===r?void 0:r.slice(0,10),data:null===(n=e.cause.data)||void 0===n?void 0:n.substring(10),customErrorName:e.cause.errorName,customErrorDecodedSignature:e.cause.errorSignature,customErrorArguments:e.cause.errorArgs}}return{reason:e.cause.message,signature:null===(s=e.cause.data)||void 0===s?void 0:s.slice(0,10),data:null===(a=e.cause.data)||void 0===a?void 0:a.substring(10)}}if(e instanceof i.InvalidResponseError&&!Array.isArray(null===(l=e.cause)||void 0===l?void 0:l.errors)&&void 0!==e.cause)return e.cause.message;throw e}},6179:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionError=function(e,t,r,s,a,l){return n(this,void 0,void 0,function*(){let n,c=l;if(void 0===c&&(void 0!==s?c=(0,o.parseTransactionError)(s):e.handleRevert&&void 0!==t&&(c=yield(0,o.getRevertReason)(e,t,a))),void 0===c)n=new i.TransactionRevertedWithoutReasonError(r);else if("string"==typeof c)n=new i.TransactionRevertInstructionError(c,void 0,r);else if(void 0!==c.customErrorName&&void 0!==c.customErrorDecodedSignature&&void 0!==c.customErrorArguments){let e=c;n=new i.TransactionRevertWithCustomError(e.reason,e.customErrorName,e.customErrorDecodedSignature,e.customErrorArguments,e.signature,r,e.data)}else n=new i.TransactionRevertInstructionError(c.reason,c.signature,r,c.data);return n})};let i=r(1633),o=r(2801)},3541:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionGasPricing=function(e,t,r){return n(this,void 0,void 0,function*(){let d=(0,c.getTransactionType)(e,t);if(!(0,o.isNullish)(d)){if(d.startsWith("-")||0>Number(d)||Number(d)>127)throw new s.UnsupportedTransactionTypeError(d);if((0,o.isNullish)(e.gasPrice)&&("0x0"===d||"0x1"===d))return{gasPrice:yield(0,l.getGasPrice)(t,r),maxPriorityFeePerGas:void 0,maxFeePerGas:void 0};if("0x2"===d)return Object.assign({gasPrice:void 0},(yield function(e,t,r){return n(this,void 0,void 0,function*(){var n,c,d,u;let h;let f=yield(0,l.getBlock)(t,t.defaultBlock,!1,i.ETH_DATA_FORMAT);if((0,o.isNullish)(f.baseFeePerGas))throw new s.Eip1559NotSupportedError;if((0,o.isNullish)(e.gasPrice)&&BigInt(f.baseFeePerGas)===BigInt(0)&&(h=yield(0,l.getGasPrice)(t,r)),!(0,o.isNullish)(e.gasPrice)||!(0,o.isNullish)(h)){let t=(0,a.format)({format:"uint"},null!==(n=e.gasPrice)&&void 0!==n?n:h,r);return{maxPriorityFeePerGas:t,maxFeePerGas:t}}return{maxPriorityFeePerGas:(0,a.format)({format:"uint"},null!==(c=e.maxPriorityFeePerGas)&&void 0!==c?c:t.defaultMaxPriorityFeePerGas,r),maxFeePerGas:(0,a.format)({format:"uint"},null!==(d=e.maxFeePerGas)&&void 0!==d?d:BigInt(f.baseFeePerGas)*BigInt(2)+BigInt(null!==(u=e.maxPriorityFeePerGas)&&void 0!==u?u:t.defaultMaxPriorityFeePerGas),r)}})}(e,t,r)))}})};let i=r(7797),o=r(7244),s=r(1633),a=r(6825),l=r(897),c=r(2113)},6393:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.prepareTransactionForSigning=void 0;let i=r(7797),o=r(6825),s=r(2054),a=r(7244),l=r(5800),c=r(269),d=r(2113);t.prepareTransactionForSigning=(e,t,r,...u)=>n(void 0,[e,t,r,...u],void 0,function*(e,t,r,n=!1,u=!0){var h,f;let p=yield(0,d.transactionBuilder)({transaction:e,web3Context:t,privateKey:r,fillGasPrice:n,fillGasLimit:u}),m=(0,c.formatTransaction)(p,i.ETH_DATA_FORMAT,{transactionSchema:t.config.customTransactionSchema});return(0,l.validateTransactionForSigning)(m,void 0,{transactionSchema:t.config.customTransactionSchema}),s.TransactionFactory.fromTxData(Object.assign(Object.assign({},m),{nonce:m.nonce,gasPrice:m.gasPrice,gasLimit:null!==(h=m.gasLimit)&&void 0!==h?h:m.gas,to:m.to,value:m.value,data:null!==(f=m.data)&&void 0!==f?f:m.input,type:m.type,chainId:m.chainId,accessList:m.accessList,maxPriorityFeePerGas:m.maxPriorityFeePerGas,maxFeePerGas:m.maxFeePerGas}),((e,t)=>{var r,n,i,l,c,d,u,h,f,p,m,g,y,b,v,w,E,A;let _;if(((0,a.isNullish)(e.chain)||(0,a.isNullish)(e.hardfork))&&(0,a.isNullish)(e.common))t.defaultCommon?(_=Object.assign({},t.defaultCommon),(0,a.isNullish)(_.hardfork)&&(_.hardfork=null!==(r=e.hardfork)&&void 0!==r?r:t.defaultHardfork),(0,a.isNullish)(_.baseChain)&&(_.baseChain=t.defaultChain)):_=s.Common.custom({name:"custom-network",chainId:(0,o.toNumber)(e.chainId),networkId:(0,a.isNullish)(e.networkId)?void 0:(0,o.toNumber)(e.networkId),defaultHardfork:null!==(n=e.hardfork)&&void 0!==n?n:t.defaultHardfork},{baseChain:t.defaultChain});else{let r=null!==(d=null!==(c=null===(l=null===(i=null==e?void 0:e.common)||void 0===i?void 0:i.customChain)||void 0===l?void 0:l.name)&&void 0!==c?c:e.chain)&&void 0!==d?d:"custom-network",n=(0,o.toNumber)(null!==(f=null===(h=null===(u=null==e?void 0:e.common)||void 0===u?void 0:u.customChain)||void 0===h?void 0:h.chainId)&&void 0!==f?f:null==e?void 0:e.chainId),a=(0,o.toNumber)(null!==(g=null===(m=null===(p=null==e?void 0:e.common)||void 0===p?void 0:p.customChain)||void 0===m?void 0:m.networkId)&&void 0!==g?g:null==e?void 0:e.networkId),T=null!==(v=null!==(b=null===(y=null==e?void 0:e.common)||void 0===y?void 0:y.hardfork)&&void 0!==b?b:null==e?void 0:e.hardfork)&&void 0!==v?v:t.defaultHardfork,I=null!==(A=null!==(E=null===(w=e.common)||void 0===w?void 0:w.baseChain)&&void 0!==E?E:e.chain)&&void 0!==A?A:t.defaultChain;n&&a&&r&&(_=s.Common.custom({name:r,chainId:n,networkId:a,defaultHardfork:T},{baseChain:I}))}return{common:_}})(m,t))})},2704:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.rejectIfBlockTimeout=function(e,t){return n(this,void 0,void 0,function*(){var r;let{provider:i}=e.requestManager,c=yield(0,a.getBlockNumber)(e,s.NUMBER_DATA_FORMAT);return(null===(r=i.supportsSubscriptions)||void 0===r?void 0:r.call(i))&&e.enableExperimentalFeatures.useSubscriptionWhenCheckingBlockTimeout?yield function(e,t,r){return n(this,void 0,void 0,function*(){var n;let i,s,a=!0;function c(n,i){i&&console.warn("error happened at subscription. So revert to polling...",i),s.clean(),a=!1;let[o,c]=l(e,t,r);s.clean=c.clean,o.catch(e=>n(e))}try{i=yield null===(n=e.subscriptionManager)||void 0===n?void 0:n.subscribe("newHeads"),s={clean:()=>{var t;i.id&&(null===(t=e.subscriptionManager)||void 0===t||t.removeSubscription(i).then(()=>{}).catch(()=>{}))}}}catch(n){return l(e,t,r)}return[new Promise((n,s)=>{try{i.on("data",n=>{if(a=!1,!(null==n?void 0:n.number))return;let i=Number(BigInt(n.number)-BigInt(t));i>=e.transactionBlockTimeout&&s(new o.TransactionBlockTimeoutError({starterBlockNumber:t,numberOfBlocks:i,transactionHash:r}))}),i.on("error",e=>{c(s,e)})}catch(e){c(s,e)}setTimeout(()=>{a&&c(s)},1e3*e.blockHeaderTimeout)}),s]})}(e,c,t):l(e,c,t)})};let i=r(6825),o=r(1633),s=r(9190),a=r(897);function l(e,t,r){let l=e.transactionPollingInterval,[c,d]=(0,i.rejectIfConditionAtInterval)(()=>n(this,void 0,void 0,function*(){let n;try{n=yield(0,a.getBlockNumber)(e,s.NUMBER_DATA_FORMAT)}catch(e){return void console.warn("An error happen while trying to get the block number",e)}let i=n-t;if(i>=e.transactionBlockTimeout)return new o.TransactionBlockTimeoutError({starterBlockNumber:t,numberOfBlocks:i,transactionHash:r})}),l);return[d,{clean:()=>{clearInterval(c)}}]}},5517:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SendTxHelper=void 0;let i=r(7797),o=r(7244),s=r(1633),a=r(8994),l=r(3541),c=r(3710),d=r(2344),u=r(9190),h=r(6179),f=r(2801),p=r(8096);t.SendTxHelper=class{constructor({options:e,web3Context:t,promiEvent:r,returnFormat:n}){this.options={checkRevertBeforeSending:!0},this.options=e,this.web3Context=t,this.promiEvent=r,this.returnFormat=n}getReceiptWithEvents(e){var t,r;let n=Object.assign({},null!=e?e:{});if((null===(t=this.options)||void 0===t?void 0:t.contractAbi)&&n.logs&&n.logs.length>0)for(let e of(n.events={},n.logs)){let t=(0,p.decodeEventABI)(u.ALL_EVENTS_ABI,e,null===(r=this.options)||void 0===r?void 0:r.contractAbi,this.returnFormat);t.event&&(n.events[t.event]=t)}return n}checkRevertBeforeSending(e){return n(this,void 0,void 0,function*(){if(!1!==this.options.checkRevertBeforeSending){let t=e;(0,o.isNullish)(e.data)&&(0,o.isNullish)(e.input)&&(0,o.isNullish)(e.gas)&&(t=Object.assign(Object.assign({},e),{gas:21e3}));let r=yield(0,f.getRevertReason)(this.web3Context,t,this.options.contractAbi);if(void 0!==r)throw yield(0,h.getTransactionError)(this.web3Context,e,void 0,void 0,this.options.contractAbi,r)}})}emitSending(e){this.promiEvent.listenerCount("sending")>0&&this.promiEvent.emit("sending",e)}populateGasPrice(e){return n(this,arguments,void 0,function*({transactionFormatted:e,transaction:t}){var r;let n=e;return this.web3Context.config.ignoreGasPricing||(null===(r=this.options)||void 0===r?void 0:r.ignoreGasPricing)||!(0,o.isNullish)(e.gasPrice)||!(0,o.isNullish)(t.maxPriorityFeePerGas)&&!(0,o.isNullish)(t.maxFeePerGas)||(n=Object.assign(Object.assign({},e),(yield(0,l.getTransactionGasPricing)(e,this.web3Context,i.ETH_DATA_FORMAT)))),n})}signAndSend(e){return n(this,arguments,void 0,function*({wallet:e,tx:t}){if(e){let r=yield e.signTransaction(t);return(0,c.trySendTransaction)(this.web3Context,()=>n(this,void 0,void 0,function*(){return a.ethRpcMethods.sendRawTransaction(this.web3Context.requestManager,r.rawTransaction)}),r.transactionHash)}return(0,c.trySendTransaction)(this.web3Context,()=>n(this,void 0,void 0,function*(){return a.ethRpcMethods.sendTransaction(this.web3Context.requestManager,t)}))})}emitSent(e){this.promiEvent.listenerCount("sent")>0&&this.promiEvent.emit("sent",e)}emitTransactionHash(e){this.promiEvent.listenerCount("transactionHash")>0&&this.promiEvent.emit("transactionHash",e)}emitReceipt(e){this.promiEvent.listenerCount("receipt")>0&&this.promiEvent.emit("receipt",e)}handleError(e){return n(this,arguments,void 0,function*({error:e,tx:t}){var r;let n=e;return n instanceof s.ContractExecutionError&&this.web3Context.handleRevert&&(n=yield(0,h.getTransactionError)(this.web3Context,t,void 0,void 0,null===(r=this.options)||void 0===r?void 0:r.contractAbi)),(n instanceof s.InvalidResponseError||n instanceof s.ContractExecutionError||n instanceof s.TransactionRevertWithCustomError||n instanceof s.TransactionRevertedWithoutReasonError||n instanceof s.TransactionRevertInstructionError||n instanceof s.TransactionPollingTimeoutError)&&this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",n),n})}emitConfirmation({receipt:e,transactionHash:t,customTransactionReceiptSchema:r}){this.promiEvent.listenerCount("confirmation")>0&&(0,d.watchTransactionForConfirmations)(this.web3Context,this.promiEvent,e,t,this.returnFormat,r)}handleResolve(e){return n(this,arguments,void 0,function*({receipt:e,tx:t}){var r,n,i;if(null===(r=this.options)||void 0===r?void 0:r.transactionResolver)return null===(n=this.options)||void 0===n?void 0:n.transactionResolver(e);if(e.status===BigInt(0)){let r=yield(0,h.getTransactionError)(this.web3Context,t,e,void 0,null===(i=this.options)||void 0===i?void 0:i.contractAbi);throw this.promiEvent.listenerCount("error")>0&&this.promiEvent.emit("error",r),r}return e})}}},2113:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.transactionBuilder=t.getTransactionType=t.getTransactionNonce=t.getTransactionFromOrToAttr=void 0,t.defaultTransactionBuilder=m;let i=r(7797),o=r(2054),s=r(3231),a=r(7244),l=r(1633),c=r(6825),d=r(9190),u=r(897),h=r(3392),f=r(9375),p=r(3541);function m(e){return n(this,void 0,void 0,function*(){var r,n;let o=(0,c.format)(f.transactionSchema,e.transaction,e.web3Context.defaultReturnFormat);if((0,a.isNullish)(o.from)&&(o.from=(0,t.getTransactionFromOrToAttr)("from",e.web3Context,void 0,e.privateKey)),(0,a.isNullish)(o.nonce)&&(o.nonce=yield(0,t.getTransactionNonce)(e.web3Context,o.from,i.ETH_DATA_FORMAT)),(0,a.isNullish)(o.value)&&(o.value="0x0"),(0,a.isNullish)(o.data))(0,a.isNullish)(o.input)?o.input="0x":o.input.startsWith("0x")||(o.input=`0x${o.input}`);else{if(!(0,a.isNullish)(o.input)&&o.data!==o.input)throw new l.TransactionDataAndInputError({data:(0,c.bytesToHex)(o.data),input:(0,c.bytesToHex)(o.input)});o.data.startsWith("0x")||(o.data=`0x${o.data}`)}if((0,a.isNullish)(o.common)){if(e.web3Context.defaultCommon){let t=e.web3Context.defaultCommon,r=t.customChain.chainId,n=t.customChain.networkId,i=t.customChain.name;o.common=Object.assign(Object.assign({},t),{customChain:{chainId:r,networkId:n,name:i}})}(0,a.isNullish)(o.chain)&&(o.chain=e.web3Context.defaultChain),(0,a.isNullish)(o.hardfork)&&(o.hardfork=e.web3Context.defaultHardfork)}if((0,a.isNullish)(o.chainId)&&(0,a.isNullish)(null===(r=o.common)||void 0===r?void 0:r.customChain.chainId)&&(o.chainId=yield(0,u.getChainId)(e.web3Context,i.ETH_DATA_FORMAT)),(0,a.isNullish)(o.networkId)&&(o.networkId=null!==(n=e.web3Context.defaultNetworkId)&&void 0!==n?n:yield(0,s.getId)(e.web3Context,i.ETH_DATA_FORMAT)),(0,a.isNullish)(o.gasLimit)&&!(0,a.isNullish)(o.gas)&&(o.gasLimit=o.gas),o.type=(0,t.getTransactionType)(o,e.web3Context),(0,a.isNullish)(o.accessList)&&("0x1"===o.type||"0x2"===o.type)&&(o.accessList=[]),e.fillGasPrice&&(o=Object.assign(Object.assign({},o),(yield(0,p.getTransactionGasPricing)(o,e.web3Context,i.ETH_DATA_FORMAT)))),(0,a.isNullish)(o.gas)&&(0,a.isNullish)(o.gasLimit)&&e.fillGasLimit){let t=yield(0,u.estimateGas)(e.web3Context,o,"latest",i.ETH_DATA_FORMAT);o=Object.assign(Object.assign({},o),{gas:(0,c.format)({format:"uint"},t,i.ETH_DATA_FORMAT)})}return o})}t.getTransactionFromOrToAttr=(e,t,r,n)=>{if(void 0!==r&&e in r&&void 0!==r[e]){if("string"==typeof r[e]&&(0,a.isAddress)(r[e]))return r[e];if(!(0,a.isHexStrict)(r[e])&&(0,a.isNumber)(r[e])){if(t.wallet){let n=t.wallet.get((0,c.format)({format:"uint"},r[e],d.NUMBER_DATA_FORMAT));if(!(0,a.isNullish)(n))return n.address}throw new l.LocalWalletNotAvailableError}throw"from"===e?new l.InvalidTransactionWithSender(r.from):new l.InvalidTransactionWithReceiver(r.to)}if("from"===e){if(!(0,a.isNullish)(n))return(0,o.privateKeyToAddress)(n);if(!(0,a.isNullish)(t.defaultAccount))return t.defaultAccount}},t.getTransactionNonce=(e,t,...r)=>n(void 0,[e,t,...r],void 0,function*(e,t,r=e.defaultReturnFormat){if((0,a.isNullish)(t))throw new l.UnableToPopulateNonceError;return(0,u.getTransactionCount)(e,t,e.defaultBlock,r)}),t.getTransactionType=(e,t)=>{let r=(0,h.detectTransactionType)(e,t);return(0,a.isNullish)(r)?(0,a.isNullish)(t.defaultTransactionType)?void 0:(0,c.format)({format:"uint"},t.defaultTransactionType,i.ETH_DATA_FORMAT):r},t.transactionBuilder=e=>n(void 0,void 0,void 0,function*(){var t;return(null!==(t=e.web3Context.transactionBuilder)&&void 0!==t?t:m)(Object.assign(Object.assign({},e),{transaction:e.transaction}))})},3710:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.trySendTransaction=function(e,t,r){return n(this,void 0,void 0,function*(){let[n,a]=(0,i.rejectIfTimeout)(e.transactionSendTimeout,new o.TransactionSendTimeoutError({numberOfSeconds:e.transactionSendTimeout/1e3,transactionHash:r})),[l,c]=yield(0,s.rejectIfBlockTimeout)(e,r);try{return yield Promise.race([t(),a,l])}finally{clearTimeout(n),c.clean()}})};let i=r(6825),o=r(1633),s=r(2704)},940:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.waitForTransactionReceipt=function(e,t,r,l){return n(this,void 0,void 0,function*(){var c;let d=null!==(c=e.transactionReceiptPollingInterval)&&void 0!==c?c:e.transactionPollingInterval,[u,h]=(0,o.pollTillDefinedAndReturnIntervalId)(()=>n(this,void 0,void 0,function*(){try{return(null!=l?l:a.getTransactionReceipt)(e,t,r)}catch(e){return void console.warn("An error happen while trying to get the transaction receipt",e)}}),d),[f,p]=(0,o.rejectIfTimeout)(e.transactionPollingTimeout,new i.TransactionPollingTimeoutError({numberOfSeconds:e.transactionPollingTimeout/1e3,transactionHash:t})),[m,g]=yield(0,s.rejectIfBlockTimeout)(e,t);try{return yield Promise.race([u,p,m])}finally{f&&clearTimeout(f),h&&clearInterval(h),g.clean()}})};let i=r(1633),o=r(6825),s=r(2704),a=r(897)},6805:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.watchTransactionByPolling=void 0;let i=r(6825),o=r(8994),s=r(9375);t.watchTransactionByPolling=({web3Context:e,transactionReceipt:t,transactionPromiEvent:r,customTransactionReceiptSchema:a,returnFormat:l})=>{var c;let d=1,u=setInterval(()=>{n(void 0,void 0,void 0,function*(){if(d>=e.transactionConfirmationBlocks)return void clearInterval(u);let n=yield o.ethRpcMethods.getBlockByNumber(e.requestManager,(0,i.numberToHex)(BigInt(t.blockNumber)+BigInt(d)),!1);(null==n?void 0:n.hash)&&(d+=1,r.emit("confirmation",{confirmations:(0,i.format)({format:"uint"},d,l),receipt:(0,i.format)(null!=a?a:s.transactionReceiptSchema,t,l),latestBlockHash:(0,i.format)({format:"bytes32"},n.hash,l)}))})},null!==(c=e.transactionReceiptPollingInterval)&&void 0!==c?c:e.transactionPollingInterval)}},8205:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.watchTransactionBySubscription=void 0;let i=r(6825),o=r(9375),s=r(6805);t.watchTransactionBySubscription=({web3Context:e,transactionReceipt:t,transactionPromiEvent:r,customTransactionReceiptSchema:a,returnFormat:l})=>{let c,d=!0;setImmediate(()=>{var u;null===(u=e.subscriptionManager)||void 0===u||u.subscribe("newHeads").then(u=>{u.on("data",s=>n(void 0,void 0,void 0,function*(){var n;if(d=!1,!(null==s?void 0:s.number)||c===(null==s?void 0:s.parentHash))return;c=null==s?void 0:s.parentHash;let h=BigInt(s.number)-BigInt(t.blockNumber)+BigInt(1);r.emit("confirmation",{confirmations:(0,i.format)({format:"uint"},h,l),receipt:(0,i.format)(null!=a?a:o.transactionReceiptSchema,t,l),latestBlockHash:(0,i.format)({format:"bytes32"},s.parentHash,l)}),h>=e.transactionConfirmationBlocks&&(yield null===(n=e.subscriptionManager)||void 0===n?void 0:n.removeSubscription(u))})),u.on("error",()=>n(void 0,void 0,void 0,function*(){var n;yield null===(n=e.subscriptionManager)||void 0===n?void 0:n.removeSubscription(u),d=!1,(0,s.watchTransactionByPolling)({web3Context:e,transactionReceipt:t,transactionPromiEvent:r,customTransactionReceiptSchema:a,returnFormat:l})}))}).catch(()=>{d=!1,(0,s.watchTransactionByPolling)({web3Context:e,transactionReceipt:t,customTransactionReceiptSchema:a,transactionPromiEvent:r,returnFormat:l})})}),setTimeout(()=>{d&&(0,s.watchTransactionByPolling)({web3Context:e,transactionReceipt:t,transactionPromiEvent:r,returnFormat:l})},1e3*e.blockHeaderTimeout)}},2344:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.watchTransactionForConfirmations=function(e,t,r,c,d,u){if((0,i.isNullish)(r)||(0,i.isNullish)(r.blockHash))throw new o.TransactionMissingReceiptOrBlockHashError({receipt:r,blockHash:(0,n.format)({format:"bytes32"},null==r?void 0:r.blockHash,d),transactionHash:(0,n.format)({format:"bytes32"},c,d)});if(!r.blockNumber)throw new o.TransactionReceiptMissingBlockNumberError({receipt:r});t.emit("confirmation",{confirmations:(0,n.format)({format:"uint"},1,d),receipt:(0,n.format)(null!=u?u:s.transactionReceiptSchema,r,d),latestBlockHash:(0,n.format)({format:"bytes32"},r.blockHash,d)});let h=e.requestManager.provider;h&&"supportsSubscriptions"in h&&h.supportsSubscriptions()?(0,l.watchTransactionBySubscription)({web3Context:e,transactionReceipt:r,transactionPromiEvent:t,customTransactionReceiptSchema:u,returnFormat:d}):(0,a.watchTransactionByPolling)({web3Context:e,transactionReceipt:r,transactionPromiEvent:t,customTransactionReceiptSchema:u,returnFormat:d})};let n=r(6825),i=r(7244),o=r(1633),s=r(9375),a=r(6805),l=r(8205)},5800:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTransactionForSigning=t.validateGas=t.validateFeeMarketGas=t.validateLegacyGas=t.validateHardfork=t.validateBaseChain=t.validateChainInfo=t.validateCustomChainInfo=void 0,t.isBaseTransaction=a,t.isAccessListEntry=l,t.isAccessList=c,t.isTransaction1559Unsigned=d,t.isTransaction2930Unsigned=u,t.isTransactionLegacyUnsigned=h,t.isTransactionWithSender=f,t.validateTransactionWithSender=function(e){if(!f(e))throw new o.InvalidTransactionWithSender(e)},t.isTransactionCall=p,t.validateTransactionCall=function(e){if(!p(e))throw new o.InvalidTransactionCall(e)};let n=r(7797),i=r(7244),o=r(1633),s=r(269);function a(e){return!(!(0,i.isNullish)(e.to)&&!(0,i.isAddress)(e.to)||!(0,i.isHexStrict)(e.type)&&!(0,i.isNullish)(e.type)&&2!==e.type.length||!(0,i.isHexStrict)(e.nonce)||!(0,i.isHexStrict)(e.gas)||!(0,i.isHexStrict)(e.value)||!(0,i.isHexStrict)(e.input)||e.chainId&&!(0,i.isHexStrict)(e.chainId))}function l(e){return!(!(0,i.isNullish)(e.address)&&!(0,i.isAddress)(e.address)||!(0,i.isNullish)(e.storageKeys)&&!e.storageKeys.every(e=>(0,i.isHexString32Bytes)(e)))}function c(e){return!(!Array.isArray(e)||!e.every(e=>l(e)))}function d(e){return!!(a(e)&&(0,i.isHexStrict)(e.maxFeePerGas)&&(0,i.isHexStrict)(e.maxPriorityFeePerGas)&&c(e.accessList))}function u(e){return!!a(e)&&!!(0,i.isHexStrict)(e.gasPrice)&&!!c(e.accessList)}function h(e){return!!a(e)&&!!(0,i.isHexStrict)(e.gasPrice)}function f(e){return!!(0,i.isAddress)(e.from)&&!!a(e)&&!!(d(e)||u(e)||h(e))}function p(e){return!(!(0,i.isNullish)(e.from)&&!(0,i.isAddress)(e.from)||!(0,i.isAddress)(e.to)||!(0,i.isNullish)(e.gas)&&!(0,i.isHexStrict)(e.gas)||!(0,i.isNullish)(e.gasPrice)&&!(0,i.isHexStrict)(e.gasPrice)||!(0,i.isNullish)(e.value)&&!(0,i.isHexStrict)(e.value)||!(0,i.isNullish)(e.data)&&!(0,i.isHexStrict)(e.data)||!(0,i.isNullish)(e.input)&&!(0,i.isHexStrict)(e.input)||!(0,i.isNullish)(e.type)||d(e)||u(e))}t.validateCustomChainInfo=e=>{if(!(0,i.isNullish)(e.common)){if((0,i.isNullish)(e.common.customChain))throw new o.MissingCustomChainError;if((0,i.isNullish)(e.common.customChain.chainId))throw new o.MissingCustomChainIdError;if(!(0,i.isNullish)(e.chainId)&&e.chainId!==e.common.customChain.chainId)throw new o.ChainIdMismatchError({txChainId:e.chainId,customChainId:e.common.customChain.chainId})}},t.validateChainInfo=e=>{if(!(0,i.isNullish)(e.common)&&!(0,i.isNullish)(e.chain)&&!(0,i.isNullish)(e.hardfork))throw new o.CommonOrChainAndHardforkError;if(!(0,i.isNullish)(e.chain)&&(0,i.isNullish)(e.hardfork)||!(0,i.isNullish)(e.hardfork)&&(0,i.isNullish)(e.chain))throw new o.MissingChainOrHardforkError({chain:e.chain,hardfork:e.hardfork})},t.validateBaseChain=e=>{if(!(0,i.isNullish)(e.common)&&!(0,i.isNullish)(e.common.baseChain)&&!(0,i.isNullish)(e.chain)&&e.chain!==e.common.baseChain)throw new o.ChainMismatchError({txChain:e.chain,baseChain:e.common.baseChain})},t.validateHardfork=e=>{if(!(0,i.isNullish)(e.common)&&!(0,i.isNullish)(e.common.hardfork)&&!(0,i.isNullish)(e.hardfork)&&e.hardfork!==e.common.hardfork)throw new o.HardforkMismatchError({txHardfork:e.hardfork,commonHardfork:e.common.hardfork})},t.validateLegacyGas=e=>{if((0,i.isNullish)(e.gas)||!(0,i.isUInt)(e.gas)||(0,i.isNullish)(e.gasPrice)||!(0,i.isUInt)(e.gasPrice))throw new o.InvalidGasOrGasPrice({gas:e.gas,gasPrice:e.gasPrice});if(!(0,i.isNullish)(e.maxFeePerGas)||!(0,i.isNullish)(e.maxPriorityFeePerGas))throw new o.UnsupportedFeeMarketError({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas})},t.validateFeeMarketGas=e=>{if(!(0,i.isNullish)(e.gasPrice)&&"0x2"===e.type)throw new o.Eip1559GasPriceError(e.gasPrice);if("0x0"===e.type||"0x1"===e.type)throw new o.UnsupportedFeeMarketError({maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas});if((0,i.isNullish)(e.maxFeePerGas)||!(0,i.isUInt)(e.maxFeePerGas)||(0,i.isNullish)(e.maxPriorityFeePerGas)||!(0,i.isUInt)(e.maxPriorityFeePerGas))throw new o.InvalidMaxPriorityFeePerGasOrMaxFeePerGas({maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas})},t.validateGas=e=>{let r=!(0,i.isNullish)(e.gas)||!(0,i.isNullish)(e.gasLimit),n=r&&!(0,i.isNullish)(e.gasPrice),s=r&&!(0,i.isNullish)(e.maxPriorityFeePerGas)&&!(0,i.isNullish)(e.maxFeePerGas);if(!n&&!s)throw new o.MissingGasError({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});if(n&&s)throw new o.TransactionGasMismatchError({gas:e.gas,gasPrice:e.gasPrice,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas});(n?t.validateLegacyGas:t.validateFeeMarketGas)(e),(!(0,i.isNullish)(e.type)&&e.type>"0x1"?t.validateFeeMarketGas:t.validateLegacyGas)(e)},t.validateTransactionForSigning=(e,r,a={transactionSchema:void 0})=>{if(!(0,i.isNullish)(r))return void r(e);if("object"!=typeof e||(0,i.isNullish)(e))throw new o.InvalidTransactionObjectError(e);(0,t.validateCustomChainInfo)(e),(0,t.validateChainInfo)(e),(0,t.validateBaseChain)(e),(0,t.validateHardfork)(e);let l=(0,s.formatTransaction)(e,n.ETH_DATA_FORMAT,{transactionSchema:a.transactionSchema});if((0,t.validateGas)(l),(0,i.isNullish)(l.nonce)||(0,i.isNullish)(l.chainId)||l.nonce.startsWith("-")||l.chainId.startsWith("-"))throw new o.InvalidNonceOrChainIdError({nonce:e.nonce,chainId:e.chainId})}},1128:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(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 i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Eth=t.registeredSubscriptions=void 0;let a=r(7797),l=r(5177),c=r(1633),d=r(6825),u=r(8994),h=o(r(897)),f=o(r(1324)),p=r(5265);t.registeredSubscriptions={logs:p.LogsSubscription,newPendingTransactions:p.NewPendingTransactionsSubscription,newHeads:p.NewHeadsSubscription,syncing:p.SyncingSubscription,pendingTransactions:p.NewPendingTransactionsSubscription,newBlockHeaders:p.NewHeadsSubscription};class m extends l.Web3Context{constructor(e){"string"==typeof e||(0,l.isSupportedProvider)(e)?super({provider:e,registeredSubscriptions:t.registeredSubscriptions}):e.registeredSubscriptions?super(e):(super(Object.assign(Object.assign({},e),{registeredSubscriptions:t.registeredSubscriptions})),this.getFeeData=this.calculateFeeData)}setTransactionMiddleware(e){this.transactionMiddleware=e}getTransactionMiddleware(){return this.transactionMiddleware}getProtocolVersion(){return s(this,void 0,void 0,function*(){return u.ethRpcMethods.getProtocolVersion(this.requestManager)})}isSyncing(){return s(this,void 0,void 0,function*(){return u.ethRpcMethods.getSyncing(this.requestManager)})}getCoinbase(){return s(this,void 0,void 0,function*(){return u.ethRpcMethods.getCoinbase(this.requestManager)})}isMining(){return s(this,void 0,void 0,function*(){return u.ethRpcMethods.getMining(this.requestManager)})}getHashrate(e){return s(this,void 0,void 0,function*(){var t;return void 0===e&&(e=null!==(t=this.defaultReturnFormat)&&void 0!==t?t:a.DEFAULT_RETURN_FORMAT),this.getHashRate(e)})}getHashRate(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return h.getHashRate(this,e)})}getGasPrice(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return h.getGasPrice(this,e)})}getMaxPriorityFeePerGas(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return h.getMaxPriorityFeePerGas(this,e)})}calculateFeeData(){return s(this,arguments,void 0,function*(e=BigInt(2),t=d.ethUnitMap.Gwei){var r;let n,i,o;let s=yield this.getBlock(void 0,!1),a=null!==(r=null==s?void 0:s.baseFeePerGas)&&void 0!==r?r:void 0;try{n=yield this.getGasPrice()}catch(e){}try{i=yield this.getMaxPriorityFeePerGas()}catch(e){}return a&&(i=null!=i?i:t,o=a*("number"==typeof e?BigInt(Math.floor(1e3*e))/BigInt(1e3):e)+i),{gasPrice:n,maxFeePerGas:o,maxPriorityFeePerGas:i,baseFeePerGas:a}})}getAccounts(){return s(this,void 0,void 0,function*(){var e;return(null!==(e=yield u.ethRpcMethods.getAccounts(this.requestManager))&&void 0!==e?e:[]).map(e=>(0,d.toChecksumAddress)(e))})}getBlockNumber(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return h.getBlockNumber(this,e)})}getBalance(e){return s(this,arguments,void 0,function*(e,t=this.defaultBlock,r=this.defaultReturnFormat){return h.getBalance(this,e,t,r)})}getStorageAt(e,t){return s(this,arguments,void 0,function*(e,t,r=this.defaultBlock,n=this.defaultReturnFormat){return h.getStorageAt(this,e,t,r,n)})}getCode(e){return s(this,arguments,void 0,function*(e,t=this.defaultBlock,r=this.defaultReturnFormat){return h.getCode(this,e,t,r)})}getBlock(){return s(this,arguments,void 0,function*(e=this.defaultBlock,t=!1,r=this.defaultReturnFormat){return h.getBlock(this,e,t,r)})}getBlockTransactionCount(){return s(this,arguments,void 0,function*(e=this.defaultBlock,t=this.defaultReturnFormat){return h.getBlockTransactionCount(this,e,t)})}getBlockUncleCount(){return s(this,arguments,void 0,function*(e=this.defaultBlock,t=this.defaultReturnFormat){return h.getBlockUncleCount(this,e,t)})}getUncle(){return s(this,arguments,void 0,function*(e=this.defaultBlock,t,r=this.defaultReturnFormat){return h.getUncle(this,e,t,r)})}getTransaction(e){return s(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){let r=yield h.getTransaction(this,e,t);if(!r)throw new c.TransactionNotFound;return r})}getPendingTransactions(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return h.getPendingTransactions(this,e)})}getTransactionFromBlock(){return s(this,arguments,void 0,function*(e=this.defaultBlock,t,r=this.defaultReturnFormat){return h.getTransactionFromBlock(this,e,t,r)})}getTransactionReceipt(e){return s(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){let r=yield h.getTransactionReceipt(this,e,t);if(!r)throw new c.TransactionNotFound;return r})}getTransactionCount(e){return s(this,arguments,void 0,function*(e,t=this.defaultBlock,r=this.defaultReturnFormat){return h.getTransactionCount(this,e,t,r)})}sendTransaction(e,t=this.defaultReturnFormat,r){return h.sendTransaction(this,e,t,r,this.transactionMiddleware)}sendSignedTransaction(e,t=this.defaultReturnFormat,r){return h.sendSignedTransaction(this,e,t,r)}sign(e,t){return s(this,arguments,void 0,function*(e,t,r=this.defaultReturnFormat){return h.sign(this,e,t,r)})}signTransaction(e){return s(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return h.signTransaction(this,e,t)})}call(e){return s(this,arguments,void 0,function*(e,t=this.defaultBlock,r=this.defaultReturnFormat){return h.call(this,e,t,r)})}estimateGas(e){return s(this,arguments,void 0,function*(e,t=this.defaultBlock,r=this.defaultReturnFormat){return h.estimateGas(this,e,t,r)})}getPastLogs(e){return s(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return h.getLogs(this,e,t)})}getWork(){return s(this,void 0,void 0,function*(){return u.ethRpcMethods.getWork(this.requestManager)})}submitWork(e,t,r){return s(this,void 0,void 0,function*(){return u.ethRpcMethods.submitWork(this.requestManager,e,t,r)})}requestAccounts(){return s(this,void 0,void 0,function*(){return u.ethRpcMethods.requestAccounts(this.requestManager)})}getChainId(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return h.getChainId(this,e)})}getNodeInfo(){return s(this,void 0,void 0,function*(){return u.ethRpcMethods.getNodeInfo(this.requestManager)})}getProof(e,t){return s(this,arguments,void 0,function*(e,t,r=this.defaultBlock,n=this.defaultReturnFormat){return h.getProof(this,e,t,r,n)})}getFeeHistory(e){return s(this,arguments,void 0,function*(e,t=this.defaultBlock,r,n=this.defaultReturnFormat){return h.getFeeHistory(this,e,t,r,n)})}createAccessList(e){return s(this,arguments,void 0,function*(e,t=this.defaultBlock,r=this.defaultReturnFormat){return h.createAccessList(this,e,t,r)})}signTypedData(e,t,r,n){return s(this,void 0,void 0,function*(){var i;return void 0===r&&(r=!1),void 0===n&&(n=null!==(i=this.defaultReturnFormat)&&void 0!==i?i:a.DEFAULT_RETURN_FORMAT),h.signTypedData(this,e,t,r,n)})}subscribe(e,t,r){return s(this,void 0,void 0,function*(){var n,i;void 0===r&&(r=null!==(n=this.defaultReturnFormat)&&void 0!==n?n:a.DEFAULT_RETURN_FORMAT);let o=yield null===(i=this.subscriptionManager)||void 0===i?void 0:i.subscribe(e,t,r);return o instanceof p.LogsSubscription&&"logs"===e&&"object"==typeof t&&!(0,d.isNullish)(t.fromBlock)&&Number.isFinite(Number(t.fromBlock))&&setImmediate(()=>{this.getPastLogs(t).then(e=>{for(let t of e)o._processSubscriptionResult(t)}).catch(e=>{o._processSubscriptionError(e)})}),o})}static shouldClearSubscription({sub:e}){return!(e instanceof p.SyncingSubscription)}clearSubscriptions(e=!1){var t;return null===(t=this.subscriptionManager)||void 0===t?void 0:t.unsubscribe(e?m.shouldClearSubscription:void 0)}createNewPendingTransactionFilter(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return f.createNewPendingTransactionFilter(this,e)})}createNewFilter(e){return s(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return f.createNewFilter(this,e,t)})}createNewBlockFilter(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return f.createNewBlockFilter(this,e)})}uninstallFilter(e){return s(this,void 0,void 0,function*(){return f.uninstallFilter(this,e)})}getFilterChanges(e){return s(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return f.getFilterChanges(this,e,t)})}getFilterLogs(e){return s(this,arguments,void 0,function*(e,t=this.defaultReturnFormat){return f.getFilterLogs(this,e,t)})}}t.Web3Eth=m},5265:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SyncingSubscription=t.NewHeadsSubscription=t.NewPendingTransactionsSubscription=t.LogsSubscription=void 0;let n=r(6825),i=r(5177),o=r(9375);class s extends i.Web3Subscription{_buildSubscriptionParams(){return["logs",this.args]}formatSubscriptionResult(e){return(0,n.format)(o.logSchema,e,super.returnFormat)}}t.LogsSubscription=s;class a extends i.Web3Subscription{_buildSubscriptionParams(){return["newPendingTransactions"]}formatSubscriptionResult(e){return(0,n.format)({format:"string"},e,super.returnFormat)}}t.NewPendingTransactionsSubscription=a;class l extends i.Web3Subscription{_buildSubscriptionParams(){return["newHeads"]}formatSubscriptionResult(e){return(0,n.format)(o.blockHeaderSchema,e,super.returnFormat)}}t.NewHeadsSubscription=l;class c extends i.Web3Subscription{_buildSubscriptionParams(){return["syncing"]}_processSubscriptionResult(e){if("boolean"==typeof e)this.emit("changed",e);else{let t=Object.fromEntries(Object.entries((null==e?void 0:e.status)||e).map(([e,t])=>[e.charAt(0).toLowerCase()+e.substring(1),t]));this.emit("changed",e.syncing),this.emit("data",(0,n.format)(o.syncSchema,t,super.returnFormat))}}}t.SyncingSubscription=c},3231:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});let o=r(6572);i(r(6572),t),i(r(1837),t),t.default=o.Net},6572:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(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 i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Net=void 0;let a=r(5177),l=o(r(1837));class c extends a.Web3Context{getId(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return l.getId(this,e)})}getPeerCount(){return s(this,arguments,void 0,function*(e=this.defaultReturnFormat){return l.getPeerCount(this,e)})}isListening(){return s(this,void 0,void 0,function*(){return l.isListening(this)})}}t.Net=c},1837:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.isListening=void 0,t.getId=function(e,t){return n(this,void 0,void 0,function*(){let r=yield o.netRpcMethods.getId(e.requestManager);return(0,i.format)({format:"uint"},r,t)})},t.getPeerCount=function(e,t){return n(this,void 0,void 0,function*(){let r=yield o.netRpcMethods.getPeerCount(e.requestManager);return(0,i.format)({format:"uint"},r,t)})};let i=r(6825),o=r(8994);t.isListening=e=>n(void 0,void 0,void 0,function*(){return o.netRpcMethods.isListening(e.requestManager)})},3655:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpProvider=void 0;let o=i(r(288)),s=r(7797),a=r(1633);class l extends s.Web3BaseProvider{constructor(e,t){if(super(),!l.validateClientUrl(e))throw new a.InvalidClientError(e);this.clientUrl=e,this.httpProviderOptions=t}static validateClientUrl(e){return"string"==typeof e&&/^http(s)?:\/\//i.test(e)}getStatus(){throw new a.MethodNotImplementedError}supportsSubscriptions(){return!1}request(e,t){return n(this,void 0,void 0,function*(){var r;let n=Object.assign(Object.assign({},null===(r=this.httpProviderOptions)||void 0===r?void 0:r.providerOptions),t),i=yield(0,o.default)(this.clientUrl,Object.assign(Object.assign({},n),{method:"POST",headers:Object.assign(Object.assign({},n.headers),{"Content-Type":"application/json"}),body:JSON.stringify(e)}));if(!i.ok)throw new a.ResponseError((yield i.json()),void 0,void 0,i.status);return yield i.json()})}on(){throw new a.MethodNotImplementedError}removeListener(){throw new a.MethodNotImplementedError}once(){throw new a.MethodNotImplementedError}removeAllListeners(){throw new a.MethodNotImplementedError}connect(){throw new a.MethodNotImplementedError}disconnect(){throw new a.MethodNotImplementedError}reset(){throw new a.MethodNotImplementedError}reconnect(){throw new a.MethodNotImplementedError}}t.default=l,t.HttpProvider=l},5037:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketProvider=void 0;let i=n(r(4740)),o=r(6825),s=r(1633);class a extends o.SocketProvider{_validateProviderPath(e){return"string"==typeof e&&/^ws(s)?:\/\//i.test(e)}constructor(e,t,r){super(e,t,r)}getStatus(){if(this._socketConnection&&!(0,o.isNullish)(this._socketConnection))switch(this._socketConnection.readyState){case this._socketConnection.CONNECTING:return"connecting";case this._socketConnection.OPEN:return"connected"}return"disconnected"}_openSocketConnection(){this._socketConnection=new i.default(this._socketPath,void 0,this._socketOptions&&0===Object.keys(this._socketOptions).length?void 0:this._socketOptions)}_closeSocketConnection(e,t){var r;null===(r=this._socketConnection)||void 0===r||r.close(e,t)}_sendToSocket(e){var t;if("disconnected"===this.getStatus())throw new s.ConnectionNotOpenError;null===(t=this._socketConnection)||void 0===t||t.send(JSON.stringify(e))}_parseResponses(e){return this.chunkResponseParser.parseResponse(e.data)}_addSocketListeners(){var e,t,r,n;null===(e=this._socketConnection)||void 0===e||e.addEventListener("open",this._onOpenHandler),null===(t=this._socketConnection)||void 0===t||t.addEventListener("message",this._onMessageHandler),null===(r=this._socketConnection)||void 0===r||r.addEventListener("close",e=>this._onCloseHandler(e)),null===(n=this._socketConnection)||void 0===n||n.addEventListener("error",this._onErrorHandler)}_removeSocketListeners(){var e,t,r;null===(e=this._socketConnection)||void 0===e||e.removeEventListener("message",this._onMessageHandler),null===(t=this._socketConnection)||void 0===t||t.removeEventListener("open",this._onOpenHandler),null===(r=this._socketConnection)||void 0===r||r.removeEventListener("close",this._onCloseHandler)}_onCloseEvent(e){var t;!this._reconnectOptions.autoReconnect||[1e3,1001].includes(e.code)&&e.wasClean?(this._clearQueues(e),this._removeSocketListeners(),this._onDisconnect(e.code,e.reason),null===(t=this._socketConnection)||void 0===t||t.removeEventListener("error",this._onErrorHandler)):this._reconnect()}}t.default=a,t.WebSocketProvider=a},952:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.getProtocolVersion=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_protocolVersion",params:[]})})},t.getSyncing=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_syncing",params:[]})})},t.getCoinbase=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_coinbase",params:[]})})},t.getMining=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_mining",params:[]})})},t.getHashRate=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_hashrate",params:[]})})},t.getGasPrice=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_gasPrice",params:[]})})},t.getMaxPriorityFeePerGas=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_maxPriorityFeePerGas",params:[]})})},t.getAccounts=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_accounts",params:[]})})},t.getBlockNumber=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_blockNumber",params:[]})})},t.getBalance=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["address","blockNumberOrTag"],[t,r]),e.send({method:"eth_getBalance",params:[t,r]})})},t.getStorageAt=function(e,t,r,o){return n(this,void 0,void 0,function*(){return i.validator.validate(["address","hex","blockNumberOrTag"],[t,r,o]),e.send({method:"eth_getStorageAt",params:[t,r,o]})})},t.getTransactionCount=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["address","blockNumberOrTag"],[t,r]),e.send({method:"eth_getTransactionCount",params:[t,r]})})},t.getBlockTransactionCountByHash=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["bytes32"],[t]),e.send({method:"eth_getBlockTransactionCountByHash",params:[t]})})},t.getBlockTransactionCountByNumber=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getBlockTransactionCountByNumber",params:[t]})})},t.getUncleCountByBlockHash=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["bytes32"],[t]),e.send({method:"eth_getUncleCountByBlockHash",params:[t]})})},t.getUncleCountByBlockNumber=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["blockNumberOrTag"],[t]),e.send({method:"eth_getUncleCountByBlockNumber",params:[t]})})},t.getCode=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["address","blockNumberOrTag"],[t,r]),e.send({method:"eth_getCode",params:[t,r]})})},t.sign=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["address","hex"],[t,r]),e.send({method:"eth_sign",params:[t,r]})})},t.signTransaction=function(e,t){return n(this,void 0,void 0,function*(){return e.send({method:"eth_signTransaction",params:[t]})})},t.sendTransaction=function(e,t){return n(this,void 0,void 0,function*(){return e.send({method:"eth_sendTransaction",params:[t]})})},t.sendRawTransaction=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["hex"],[t]),e.send({method:"eth_sendRawTransaction",params:[t]})})},t.call=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["blockNumberOrTag"],[r]),e.send({method:"eth_call",params:[t,r]})})},t.estimateGas=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["blockNumberOrTag"],[r]),e.send({method:"eth_estimateGas",params:[t,r]})})},t.getBlockByHash=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["bytes32","bool"],[t,r]),e.send({method:"eth_getBlockByHash",params:[t,r]})})},t.getBlockByNumber=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["blockNumberOrTag","bool"],[t,r]),e.send({method:"eth_getBlockByNumber",params:[t,r]})})},t.getTransactionByHash=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionByHash",params:[t]})})},t.getTransactionByBlockHashAndIndex=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["bytes32","hex"],[t,r]),e.send({method:"eth_getTransactionByBlockHashAndIndex",params:[t,r]})})},t.getTransactionByBlockNumberAndIndex=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["blockNumberOrTag","hex"],[t,r]),e.send({method:"eth_getTransactionByBlockNumberAndIndex",params:[t,r]})})},t.getTransactionReceipt=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["bytes32"],[t]),e.send({method:"eth_getTransactionReceipt",params:[t]})})},t.getUncleByBlockHashAndIndex=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["bytes32","hex"],[t,r]),e.send({method:"eth_getUncleByBlockHashAndIndex",params:[t,r]})})},t.getUncleByBlockNumberAndIndex=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["blockNumberOrTag","hex"],[t,r]),e.send({method:"eth_getUncleByBlockNumberAndIndex",params:[t,r]})})},t.getCompilers=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_getCompilers",params:[]})})},t.compileSolidity=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["string"],[t]),e.send({method:"eth_compileSolidity",params:[t]})})},t.compileLLL=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["string"],[t]),e.send({method:"eth_compileLLL",params:[t]})})},t.compileSerpent=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["string"],[t]),e.send({method:"eth_compileSerpent",params:[t]})})},t.newFilter=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["filter"],[t]),e.send({method:"eth_newFilter",params:[t]})})},t.newBlockFilter=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_newBlockFilter",params:[]})})},t.newPendingTransactionFilter=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_newPendingTransactionFilter",params:[]})})},t.uninstallFilter=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["hex"],[t]),e.send({method:"eth_uninstallFilter",params:[t]})})},t.getFilterChanges=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["hex"],[t]),e.send({method:"eth_getFilterChanges",params:[t]})})},t.getFilterLogs=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["hex"],[t]),e.send({method:"eth_getFilterLogs",params:[t]})})},t.getLogs=function(e,t){return n(this,void 0,void 0,function*(){return i.validator.validate(["filter"],[t]),e.send({method:"eth_getLogs",params:[t]})})},t.getWork=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_getWork",params:[]})})},t.submitWork=function(e,t,r,o){return n(this,void 0,void 0,function*(){return i.validator.validate(["bytes8","bytes32","bytes32"],[t,r,o]),e.send({method:"eth_submitWork",params:[t,r,o]})})},t.submitHashrate=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["bytes32","bytes32"],[t,r]),e.send({method:"eth_submitHashrate",params:[t,r]})})},t.getFeeHistory=function(e,t,r,o){return n(this,void 0,void 0,function*(){for(let e of(i.validator.validate(["hex","blockNumberOrTag"],[t,r]),o))i.validator.validate(["number"],[e]);return e.send({method:"eth_feeHistory",params:[t,r,o]})})},t.getPendingTransactions=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_pendingTransactions",params:[]})})},t.requestAccounts=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_requestAccounts",params:[]})})},t.getChainId=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"eth_chainId",params:[]})})},t.getProof=function(e,t,r,o){return n(this,void 0,void 0,function*(){return i.validator.validate(["address","bytes32[]","blockNumberOrTag"],[t,r,o]),e.send({method:"eth_getProof",params:[t,r,o]})})},t.getNodeInfo=function(e){return n(this,void 0,void 0,function*(){return e.send({method:"web3_clientVersion",params:[]})})},t.createAccessList=function(e,t,r){return n(this,void 0,void 0,function*(){return i.validator.validate(["blockNumberOrTag"],[r]),e.send({method:"eth_createAccessList",params:[t,r]})})},t.signTypedData=function(e,t,r){return n(this,arguments,void 0,function*(e,t,r,n=!1){return i.validator.validate(["address"],[t]),e.send({method:"eth_signTypedData"+(n?"":"_v4"),params:[t,r]})})};let i=r(7244)},8994:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.personalRpcMethods=t.netRpcMethods=t.ethRpcMethods=void 0;let s=o(r(952));t.ethRpcMethods=s;let a=o(r(2440));t.netRpcMethods=a;let l=o(r(5497));t.personalRpcMethods=l},2440:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.getId=function(e){return r(this,void 0,void 0,function*(){return e.send({method:"net_version",params:[]})})},t.getPeerCount=function(e){return r(this,void 0,void 0,function*(){return e.send({method:"net_peerCount",params:[]})})},t.isListening=function(e){return r(this,void 0,void 0,function*(){return e.send({method:"net_listening",params:[]})})}},5497:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ecRecover=t.sign=t.signTransaction=t.sendTransaction=t.importRawKey=t.lockAccount=t.unlockAccount=t.newAccount=t.getAccounts=void 0,t.getAccounts=e=>r(void 0,void 0,void 0,function*(){return e.send({method:"personal_listAccounts",params:[]})}),t.newAccount=(e,t)=>r(void 0,void 0,void 0,function*(){return e.send({method:"personal_newAccount",params:[t]})}),t.unlockAccount=(e,t,n,i)=>r(void 0,void 0,void 0,function*(){return e.send({method:"personal_unlockAccount",params:[t,n,i]})}),t.lockAccount=(e,t)=>r(void 0,void 0,void 0,function*(){return e.send({method:"personal_lockAccount",params:[t]})}),t.importRawKey=(e,t,n)=>r(void 0,void 0,void 0,function*(){return e.send({method:"personal_importRawKey",params:[t,n]})}),t.sendTransaction=(e,t,n)=>r(void 0,void 0,void 0,function*(){return e.send({method:"personal_sendTransaction",params:[t,n]})}),t.signTransaction=(e,t,n)=>r(void 0,void 0,void 0,function*(){return e.send({method:"personal_signTransaction",params:[t,n]})}),t.sign=(e,t,n,i)=>r(void 0,void 0,void 0,function*(){return e.send({method:"personal_sign",params:[t,n,i]})}),t.ecRecover=(e,t,n)=>r(void 0,void 0,void 0,function*(){return e.send({method:"personal_ecRecover",params:[t,n]})})},9623:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderConfigOptionsError=t.QuickNodeRateLimitError=void 0;let n=r(1633);class i extends n.BaseWeb3Error{constructor(e){super("You've reach the rate limit of free RPC calls from our Partner Quick Nodes. There are two options you can either create a paid Quick Nodes account and get 20% off for 2 months using WEB3JS referral code, or use Free public RPC endpoint.",e),this.code=1300}}t.QuickNodeRateLimitError=i;class o extends n.BaseWeb3Error{constructor(e){super(`Invalid provider config options given for ${e}`),this.code=1301}}t.ProviderConfigOptionsError=o},162:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.mainnet=void 0;let o=r(8595);i(r(3935),t),i(r(8595),t),i(r(7967),t),i(r(6035),t),i(r(9623),t),t.mainnet=new o.QuickNodeProvider},3935:(e,t)=>{var r,n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Network=t.Transport=void 0,(i=r||(t.Transport=r={})).HTTPS="https",i.WebSocket="wss",(o=n||(t.Network=n={})).ETH_MAINNET="eth_mainnet",o.ETH_SEPOLIA="eth_sepolia",o.ETH_HOLESKY="eth_holesky",o.POLYGON_MAINNET="polygon_mainnet",o.POLYGON_AMOY="polygon_amoy",o.AVALANCHE_C_MAINNET="avalanche_c_mainnet",o.AVALANCHE_P_MAINNET="avalanche_p_mainnet",o.AVALANCHE_X_MAINNET="avalanche_x_mainnet",o.ARBITRUM_MAINNET="arbitrum_mainnet",o.ARBITRUM_SEPOLIA="arbitrum_sepolia",o.BASE_MAINNET="base_mainnet",o.BASE_SEPOLIA="base_sepolia",o.OPTIMISM_MAINNET="optimism_mainnet",o.OPTIMISM_SEPOLIA="optimism_sepolia",o.FANTOM_MAINNET="fantom_mainnet",o.FANTOM_TESTNET="fantom_testnet",o.DYMENSION_MAINNET="dymension_mainnet",o.DYMENSION_TESTNET="dymension_testnet",o.BNB_MAINNET="bnb_mainnet",o.BNB_TESTNET="bnb_testnet",o.BSC_MAINNET="bsc_mainnet",o.BSC_TESTNET="bsc_testnet",o.ARBITRUM_ONE="arbitrum_one",o.ARBITRUM_NOVA="arbitrum_nova",o.AVALANCHE_FUJI_C="avalanche_fuji_c",o.AVALANCHE_FUJI_P="avalanche_fuji_p",o.AVALANCHE_FUJI_X="avalanche_fuji_x",o.BLAST_MAINNET="blast_mainnet",o.OPBNB_MAINNET="opbnb_mainnet",o.OPBNB_TESTNET="opbnb_testnet",o.GNOSIS_MAINNET="gnosis_mainnet",o.GNOSIS_CHIADO="gnosis_chiado",o.PULSECHAIN_MAINNET="pulsechain_mainnet",o.PULSECHAIN_TESTNET="pulsechain_testnet",o.KAVA_MAINNET="kava_mainnet",o.CRONOS_MAINNET="cronos_mainnet",o.MANTLE_MAINNET="mantle_mainnet",o.CHILIZ_MAINNET="chiliz_mainnet",o.CHILIZ_SPICY="chiliz_spicy",o.MOONBEAM_MAINNET="moonbeam_mainnet",o.TAIKO_MAINNET="taiko_mainnet",o.TAIKO_HEKLA="taiko_hekla",o.LINEA_MAINNET="linea_mainnet",o.LINEA_SEPOLIA="linea_sepolia",o.BAHAMUT_MAINNET="bahamut_mainnet",o.SCROLL_MAINNET="scroll_mainnet",o.SCROLL_SEPOLIA="scroll_sepolia",o.TRON_MAINNET="tron_mainnet",o.SYSCOIN_MAINNET="syscoin_mainnet",o.SYSCOIN_TANENBAUM="syscoin_tanenbaum",o.MOONRIVER_MAINNET="moonriver_mainnet",o.HAQQ_MAINNET="haqq_mainnet",o.EVMOS_MAINNET="evmos_mainnet",o.EVMOS_TESTNET="evmos_testnet",o.BERACHAIN_TESTNET="berachain_testnet"},6035:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3ExternalProvider=void 0;let o=i(r(3655)),s=i(r(5037)),a=r(6825),l=r(3935),c=r(9623);class d extends a.Eip1193Provider{constructor(e,t,r,n,i){if(super(),void 0!==i&&t===l.Transport.HTTPS&&!("providerOptions"in i))throw new c.ProviderConfigOptionsError("HTTP Provider");if(void 0!==i&&t===l.Transport.WebSocket&&!("socketOptions"in i)&&!("reconnectOptions"in i))throw new c.ProviderConfigOptionsError("Websocket Provider");this.transport=t,t===l.Transport.HTTPS?this.provider=new o.default(this.getRPCURL(e,t,r,n),i):t===l.Transport.WebSocket&&(this.provider=new s.default(this.getRPCURL(e,t,r,n),null==i?void 0:i.socketOptions,null==i?void 0:i.reconnectOptions))}request(e,t){return n(this,void 0,void 0,function*(){return this.transport===l.Transport.HTTPS?yield this.provider.request(e,t):this.provider.request(e)})}getStatus(){return this.provider.getStatus()}supportsSubscriptions(){return this.provider.supportsSubscriptions()}once(e,t){var r;(null===(r=this.provider)||void 0===r?void 0:r.once)&&this.provider.once(e,t)}removeAllListeners(e){var t;(null===(t=this.provider)||void 0===t?void 0:t.removeAllListeners)&&this.provider.removeAllListeners(e)}connect(){var e;(null===(e=this.provider)||void 0===e?void 0:e.connect)&&this.provider.connect()}disconnect(e,t){var r;(null===(r=this.provider)||void 0===r?void 0:r.disconnect)&&this.provider.disconnect(e,t)}reset(){var e;(null===(e=this.provider)||void 0===e?void 0:e.reset)&&this.provider.reset()}on(e,t){this.provider&&this.provider.on(e,t)}removeListener(e,t){this.provider&&this.provider.removeListener(e,t)}}t.Web3ExternalProvider=d},7967:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PublicNodeProvider=void 0;let n=r(3935),i=r(6035),o=[n.Network.DYMENSION_MAINNET,n.Network.DYMENSION_TESTNET,n.Network.KAVA_MAINNET,n.Network.CRONOS_MAINNET,n.Network.POLYGON_MAINNET];class s extends i.Web3ExternalProvider{constructor(e=n.Network.ETH_MAINNET,t=n.Transport.HTTPS,r="",i){super(e,t,"",r,i)}getRPCURL(e,t,r,i){if(!s.networkHostMap[e])throw Error("Network info not avalible.");let a=`${s.networkHostMap[e]}.publicnode.com`,l=void 0!==i&&i.trim().length>0?i:a;return o.includes(e)&&t===n.Transport.WebSocket?`${t}://${l}/websocket`:`${t}://${l}`}}t.PublicNodeProvider=s,s.networkHostMap={[n.Network.POLYGON_AMOY]:"polygon-amoy-bor-rpc",[n.Network.DYMENSION_MAINNET]:"dymension-evm-rpc",[n.Network.DYMENSION_TESTNET]:"dymension-testnet-evm-rpc",[n.Network.BLAST_MAINNET]:"blast-rpc",[n.Network.GNOSIS_MAINNET]:"gnosis-rpc",[n.Network.PULSECHAIN_MAINNET]:"pulsechain-rpc",[n.Network.PULSECHAIN_TESTNET]:"pulsechain-testnet-rpc",[n.Network.KAVA_MAINNET]:"kava-evm-rpc",[n.Network.CRONOS_MAINNET]:"cronos-evm-rpc",[n.Network.MANTLE_MAINNET]:"mantle-rpc",[n.Network.TAIKO_MAINNET]:"taiko-rpc",[n.Network.TAIKO_HEKLA]:"taiko-hekla-rpc",[n.Network.LINEA_MAINNET]:"linea-rpc",[n.Network.LINEA_SEPOLIA]:"linea-sepolia-rpc",[n.Network.SCROLL_MAINNET]:"scroll-rpc",[n.Network.SCROLL_SEPOLIA]:"scroll-sepolia-rpc",[n.Network.SYSCOIN_MAINNET]:"syscoin-evm-rpc",[n.Network.SYSCOIN_TANENBAUM]:"syscoin-tanenbaum-evm-rpc",[n.Network.HAQQ_MAINNET]:"haqq-evm-rpc",[n.Network.EVMOS_MAINNET]:"evmos-evm-rpc",[n.Network.EVMOS_TESTNET]:"evmos-testnet-evm-rpc",[n.Network.BERACHAIN_TESTNET]:"berachain-testnet-evm-rpc",[n.Network.ETH_MAINNET]:"ethereum-rpc",[n.Network.ETH_SEPOLIA]:"ethereum-sepolia-rpc",[n.Network.ETH_HOLESKY]:"ethereum-holesky-rpc",[n.Network.BSC_MAINNET]:"bsc-rpc",[n.Network.BSC_TESTNET]:"bsc-testnet-rpc",[n.Network.POLYGON_MAINNET]:"polygon-bor-rpc",[n.Network.BASE_MAINNET]:"base-rpc",[n.Network.BASE_SEPOLIA]:"base-sepolia-rpc",[n.Network.ARBITRUM_ONE]:"arbitrum-one-rpc",[n.Network.ARBITRUM_NOVA]:"arbitrum-nova-rpc",[n.Network.ARBITRUM_SEPOLIA]:"arbitrum-sepolia-rpc",[n.Network.AVALANCHE_C_MAINNET]:"avalanche-c-chain-rpc",[n.Network.AVALANCHE_P_MAINNET]:"avalanche-p-chain-rpc",[n.Network.AVALANCHE_X_MAINNET]:"avalanche-x-chain-rpc",[n.Network.AVALANCHE_FUJI_C]:"avalanche-fuji-c-chain-rpc",[n.Network.AVALANCHE_FUJI_P]:"avalanche-fuji-p-chain-rpc",[n.Network.AVALANCHE_FUJI_X]:"avalanche-fuji-x-chain-rpc",[n.Network.OPTIMISM_MAINNET]:"optimism-rpc",[n.Network.OPTIMISM_SEPOLIA]:"optimism-sepolia-rpc",[n.Network.FANTOM_MAINNET]:"fantom-rpc",[n.Network.FANTOM_TESTNET]:"fantom-testnet-rpc",[n.Network.OPBNB_MAINNET]:"opbnb-rpc",[n.Network.OPBNB_TESTNET]:"opbnb-testnet-rpc",[n.Network.GNOSIS_CHIADO]:"gnosis-chiado-rpc",[n.Network.CHILIZ_MAINNET]:"chiliz-rpc",[n.Network.CHILIZ_SPICY]:"chiliz-spicy-rpc",[n.Network.MOONBEAM_MAINNET]:"moonbeam-rpc",[n.Network.BAHAMUT_MAINNET]:"bahamut-rpc",[n.Network.TRON_MAINNET]:"tron-evm-rpc",[n.Network.MOONRIVER_MAINNET]:"moonriver-rpc"}},8595:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.QuickNodeProvider=void 0;let i=r(1633),o=r(3935),s=r(6035),a=r(9623),l=e=>void 0!==e&&e.trim().length>0;class c extends s.Web3ExternalProvider{constructor(e=o.Network.ETH_MAINNET,t=o.Transport.HTTPS,r="",n="",i){super(e,t,r,n,i)}request(e,t){let r=Object.create(null,{request:{get:()=>super.request}});return n(this,void 0,void 0,function*(){try{return yield r.request.call(this,e,t)}catch(e){if(e instanceof i.ResponseError&&429===e.statusCode)throw new a.QuickNodeRateLimitError(e);throw e}})}getRPCURL(e,t,r,n){let i="",s="";switch(e){case o.Network.ETH_MAINNET:i=l(n)?n:"powerful-holy-bush.quiknode.pro",s=l(r)?r:"3240624a343867035925ff7561eb60dfdba2a668";break;case o.Network.ETH_SEPOLIA:i=l(n)?n:"dimensional-fabled-glitter.ethereum-sepolia.quiknode.pro",s=l(r)?r:"382a3b5a4b938f2d6e8686c19af4b22921fde2cd";break;case o.Network.ETH_HOLESKY:i=l(n)?n:"yolo-morning-card.ethereum-holesky.quiknode.pro",s=l(r)?r:"481ebe70638c4dcf176af617a16d02ab866b9af9";break;case o.Network.ARBITRUM_MAINNET:i=l(n)?n:"autumn-divine-dinghy.arbitrum-mainnet.quiknode.pro",s=l(r)?r:"a5d7bfbf60b5ae9ce3628e53d69ef50d529e9a8c";break;case o.Network.ARBITRUM_SEPOLIA:i=l(n)?n:"few-patient-pond.arbitrum-sepolia.quiknode.pro",s=l(r)?r:"3be985450970628c860b959c65cd2642dcafe53c";break;case o.Network.BNB_MAINNET:i=l(n)?n:"purple-empty-reel.bsc.quiknode.pro",s=l(r)?r:"ebf6c532961e21f092ff2facce1ec4c89c540158";break;case o.Network.BNB_TESTNET:i=l(n)?n:"floral-rough-scion.bsc-testnet.quiknode.pro",s=l(r)?r:"5b297e5acff5f81f4c37ebf6f235f7299b6f9d28";break;case o.Network.POLYGON_MAINNET:i=l(n)?n:"small-chaotic-moon.matic.quiknode.pro",s=l(r)?r:"847569f8a017e84d985e10d0f44365d965a951f1";break;case o.Network.POLYGON_AMOY:i=l(n)?n:"prettiest-side-shape.matic-amoy.quiknode.pro",s=l(r)?r:"79a9476eea661d4f82de614db1d8a895b14b881c";break;default:throw Error("Network info not avalible.")}return`${t}://${i}/${s}`}}t.QuickNodeProvider=c},8682:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2172:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8250:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4543:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8361:(e,t)=>{var r,n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.ETH_DATA_FORMAT=t.DEFAULT_RETURN_FORMAT=t.FMT_BYTES=t.FMT_NUMBER=void 0,(i=r||(t.FMT_NUMBER=r={})).NUMBER="NUMBER_NUMBER",i.HEX="NUMBER_HEX",i.STR="NUMBER_STR",i.BIGINT="NUMBER_BIGINT",(o=n||(t.FMT_BYTES=n={})).HEX="BYTES_HEX",o.UINT8ARRAY="BYTES_UINT8ARRAY",t.DEFAULT_RETURN_FORMAT={number:r.BIGINT,bytes:n.HEX},t.ETH_DATA_FORMAT={number:r.HEX,bytes:n.HEX}},1661:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3081:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7217:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5348:(e,t)=>{var r,n,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t.HardforksOrdered=t.BlockTags=void 0,(i=r||(t.BlockTags=r={})).EARLIEST="earliest",i.LATEST="latest",i.PENDING="pending",i.SAFE="safe",i.FINALIZED="finalized",i.COMMITTED="committed",(o=n||(t.HardforksOrdered=n={})).chainstart="chainstart",o.frontier="frontier",o.homestead="homestead",o.dao="dao",o.tangerineWhistle="tangerineWhistle",o.spuriousDragon="spuriousDragon",o.byzantium="byzantium",o.constantinople="constantinople",o.petersburg="petersburg",o.istanbul="istanbul",o.muirGlacier="muirGlacier",o.berlin="berlin",o.london="london",o.altair="altair",o.arrowGlacier="arrowGlacier",o.grayGlacier="grayGlacier",o.bellatrix="bellatrix",o.merge="merge",o.capella="capella",o.shanghai="shanghai"},7797:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1661),t),i(r(8682),t),i(r(8250),t),i(r(4543),t),i(r(2172),t),i(r(8361),t),i(r(5348),t),i(r(3081),t),i(r(7217),t),i(r(9593),t),i(r(4941),t),i(r(5379),t),i(r(775),t),i(r(3006),t),i(r(254),t),i(r(307),t)},9593:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypedArray=void 0,t.TypedArray=Object.getPrototypeOf(Uint8Array)},5379:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},775:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3006:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3BaseProvider=void 0;let n=Symbol.for("web3/base-provider");class i{static isWeb3Provider(e){return e instanceof i||!!(e&&e[n])}get[n](){return!0}send(e,t){this.request(e).then(e=>{t(null,e)}).catch(e=>{t(e)})}sendAsync(e){return r(this,void 0,void 0,function*(){return this.request(e)})}asEIP1193Provider(){let e=Object.create(this),t=e.request;return e.request=function(e){return r(this,void 0,void 0,function*(){return(yield t(e)).result})},e.asEIP1193Provider=void 0,e}}t.Web3BaseProvider=i},254:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Web3BaseWallet=void 0,t.Web3BaseWallet=class extends Array{constructor(e){super(),this._accountProvider=e}}},307:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2964:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkResponseParser=void 0;let n=r(1633);t.ChunkResponseParser=class{constructor(e,t){this.eventEmitter=e,this.autoReconnect=t,this.chunkTimeout=15e3}clearQueues(){"function"==typeof this._clearQueues&&this._clearQueues()}onError(e){this._clearQueues=e}parseResponse(e){let t=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(e=>{let r,i=e;this.lastChunk&&(i=this.lastChunk+i);try{r=JSON.parse(i)}catch(e){return this.lastChunk=i,this.lastChunkTimeout&&clearTimeout(this.lastChunkTimeout),void(this.lastChunkTimeout=setTimeout(()=>{this.autoReconnect||(this.clearQueues(),this.eventEmitter.emit("error",new n.InvalidResponseError({id:1,jsonrpc:"2.0",error:{code:2,message:"Chunk timeout"}})))},this.chunkTimeout))}clearTimeout(this.lastChunkTimeout),this.lastChunk=void 0,r&&t.push(r)}),t}}},5608:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toBool=t.toChecksumAddress=t.toWei=t.fromWei=t.toBigInt=t.toNumber=t.toHex=t.toAscii=t.hexToAscii=t.fromAscii=t.asciiToHex=t.hexToString=t.utf8ToBytes=t.toUtf8=t.hexToUtf8=t.stringToHex=t.fromUtf8=t.utf8ToHex=t.hexToNumberString=t.fromDecimal=t.numberToHex=t.toDecimal=t.hexToNumber=t.hexToBytes=t.bytesToHex=t.bytesToUint8Array=t.ethUnitMap=void 0;let n=r(9387),i=r(3096),o=r(7244),s=r(1633),a=r(5528);t.ethUnitMap={noether:BigInt(0),wei:BigInt(1),kwei:BigInt(1e3),Kwei:BigInt(1e3),babbage:BigInt(1e3),femtoether:BigInt(1e3),mwei:BigInt(1e6),Mwei:BigInt(1e6),lovelace:BigInt(1e6),picoether:BigInt(1e6),gwei:BigInt(1e9),Gwei:BigInt(1e9),shannon:BigInt(1e9),nanoether:BigInt(1e9),nano:BigInt(1e9),szabo:BigInt(1e12),microether:BigInt(1e12),micro:BigInt(1e12),finney:BigInt(1e15),milliether:BigInt(1e15),milli:BigInt(1e15),ether:BigInt("1000000000000000000"),kether:BigInt("1000000000000000000000"),grand:BigInt("1000000000000000000000"),mether:BigInt("1000000000000000000000000"),gether:BigInt("1000000000000000000000000000"),tether:BigInt("1000000000000000000000000000000")};let l="Warning: Using type `number` with values that are large or contain many decimals may cause loss of precision, it is recommended to use type `string` or `BigInt` when using conversion methods";t.bytesToUint8Array=e=>{if(o.validator.validate(["bytes"],[e]),(0,a.isUint8Array)(e))return e;if(Array.isArray(e))return new Uint8Array(e);if("string"==typeof e)return o.utils.hexToUint8Array(e);throw new s.InvalidBytesError(e)};let{uint8ArrayToHexString:c}=o.utils;t.bytesToHex=e=>c((0,t.bytesToUint8Array)(e)),t.hexToBytes=e=>"string"==typeof e&&"0x"!==e.slice(0,2).toLowerCase()?(0,t.bytesToUint8Array)(`0x${e}`):(0,t.bytesToUint8Array)(e),t.hexToNumber=e=>(o.validator.validate(["hex"],[e]),o.utils.hexToNumber(e)),t.toDecimal=t.hexToNumber,t.numberToHex=(e,t)=>{"bigint"!=typeof e&&o.validator.validate(["int"],[e]);let r=o.utils.numberToHex(e);return t&&(r.startsWith("-")||r.length%2!=1?r.length%2==0&&r.startsWith("-")&&(r="-0x0".concat(r.slice(3))):r="0x0".concat(r.slice(2))),r},t.fromDecimal=t.numberToHex,t.hexToNumberString=e=>(0,t.hexToNumber)(e).toString(),t.utf8ToHex=e=>{o.validator.validate(["string"],[e]);let r=e.replace(/^(?:\u0000)/,"");return r=r.replace(/(?:\u0000)$/,""),(0,t.bytesToHex)((new TextEncoder).encode(r))},t.fromUtf8=t.utf8ToHex,t.stringToHex=t.utf8ToHex,t.hexToUtf8=e=>(0,i.bytesToUtf8)((0,t.hexToBytes)(e)),t.toUtf8=e=>"string"==typeof e?(0,t.hexToUtf8)(e):(o.validator.validate(["bytes"],[e]),(0,i.bytesToUtf8)(e)),t.utf8ToBytes=i.utf8ToBytes,t.hexToString=t.hexToUtf8,t.asciiToHex=e=>{o.validator.validate(["string"],[e]);let t="";for(let r=0;rnew TextDecoder("ascii").decode((0,t.hexToBytes)(e)),t.toAscii=t.hexToAscii,t.toHex=(e,r)=>{if("string"==typeof e&&(0,o.isAddress)(e))return r?"address":`0x${e.toLowerCase().replace(/^0x/i,"")}`;if("boolean"==typeof e)return r?"bool":e?"0x01":"0x00";if("number"==typeof e)return r?e<0?"int256":"uint256":(0,t.numberToHex)(e);if("bigint"==typeof e)return r?"bigint":(0,t.numberToHex)(e);if((0,a.isUint8Array)(e))return r?"bytes":(0,t.bytesToHex)(e);if("object"==typeof e&&e)return r?"string":(0,t.utf8ToHex)(JSON.stringify(e));if("string"==typeof e){if(e.startsWith("-0x")||e.startsWith("-0X"))return r?"int256":(0,t.numberToHex)(e);if((0,o.isHexStrict)(e))return r?"bytes":e;if((0,o.isHex)(e)&&!(0,o.isInt)(e)&&!(0,o.isUInt)(e))return r?"bytes":`0x${e}`;if((0,o.isHex)(e)&&!(0,o.isInt)(e)&&(0,o.isUInt)(e))return r?"uint":(0,t.numberToHex)(e);if(!Number.isFinite(e))return r?"string":(0,t.utf8ToHex)(e)}throw new s.HexProcessingError(e)},t.toNumber=e=>{if("number"==typeof e)return e>1e20?(console.warn(l),BigInt(e)):e;if("bigint"==typeof e)return e>=Number.MIN_SAFE_INTEGER&&e<=Number.MAX_SAFE_INTEGER?Number(e):e;if("string"==typeof e&&(0,o.isHexStrict)(e))return(0,t.hexToNumber)(e);try{return(0,t.toNumber)(BigInt(e))}catch(t){throw new s.InvalidNumberError(e)}},t.toBigInt=e=>{if("number"==typeof e)return BigInt(e);if("bigint"==typeof e)return e;if("string"==typeof e&&(0,o.isHex)(e))return e.startsWith("-")?-BigInt(e.substring(1)):BigInt(e);throw new s.InvalidNumberError(e)},t.fromWei=(e,r)=>{let n;if("string"==typeof r){if(!(n=t.ethUnitMap[r]))throw new s.InvalidUnitError(r)}else{if(r<0||!Number.isInteger(r))throw new s.InvalidIntegerError(r);n=(0,o.bigintPower)(BigInt(10),BigInt(r))}let i=String((0,t.toNumber)(e)),a=n.toString().length-1;if(a<=0)return i.toString();let l=i.padStart(a,"0"),c=l.slice(0,-a),d=l.slice(-a).replace(/\.?0+$/,"");return""===c?d?`0.${d}`:"0":""===d?c:`${c}.${d}`.slice(0,c.length+a+1)},t.toWei=(e,r)=>{let n;if(o.validator.validate(["number"],[e]),"string"==typeof r){if(!(n=t.ethUnitMap[r]))throw new s.InvalidUnitError(r)}else{if(r<0||!Number.isInteger(r))throw new s.InvalidIntegerError(r);n=(0,o.bigintPower)(BigInt(10),BigInt(r))}let i=e;"number"==typeof i&&(i<1e-15&&console.warn(l),i>1e20?(console.warn(l),i=BigInt(i)):i=i.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20}));let[a,c]=String("string"!=typeof i||(0,o.isHexStrict)(i)?(0,t.toNumber)(i):i).split(".").concat(""),d=BigInt(`${a}${c}`)*n,u=c.length;return 0===u?d.toString():d.toString().slice(0,-u)},t.toChecksumAddress=e=>{if(!(0,o.isAddress)(e,!1))throw new s.InvalidAddressError(e);let r=e.toLowerCase().replace(/^0x/i,""),i=o.utils.uint8ArrayToHexString((0,n.keccak256)(o.utils.ensureIfUint8Array((0,t.utf8ToBytes)(r))));if((0,o.isNullish)(i)||"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"===i)return"";let a="0x",l=i.replace(/^0x/i,"");for(let e=0;e7?a+=r[e].toUpperCase():a+=r[e];return a},t.toBool=e=>{if("boolean"==typeof e)return e;if("number"==typeof e&&(0===e||1===e)||"bigint"==typeof e&&(e===BigInt(0)||e===BigInt(1)))return!!e;if("string"==typeof e&&!(0,o.isHexStrict)(e)&&("1"===e||"0"===e||"false"===e||"true"===e))return"true"===e||"false"!==e&&!!Number(e);if("string"==typeof e&&(0,o.isHexStrict)(e)&&("0x1"===e||"0x0"===e))return!!(0,t.toNumber)(e);throw new s.InvalidBooleanError(e)}},976:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter=void 0;let i=n(r(2380));class o extends i.default{constructor(){super(...arguments),this.maxListeners=Number.MAX_SAFE_INTEGER}setMaxListeners(e){return this.maxListeners=e,this}getMaxListeners(){return this.maxListeners}}t.EventEmitter=o},5307:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.format=t.convert=t.convertScalarValue=t.isDataFormat=void 0;let n=r(1633),i=r(7797),o=r(7244),s=r(5608),a=r(2625),l=r(6014),c=r(5528),{parseBaseType:d}=o.utils;t.isDataFormat=e=>"object"==typeof e&&!(0,o.isNullish)(e)&&"number"in e&&"bytes"in e;let u=(e,t,r=[])=>{let n,i=Object.assign({},e);for(let e of t){if(i.oneOf&&n){let e=n,t=r.find(([t])=>t===e);t&&t[0]===n&&(i=i.oneOf[t[1]])}if(!i.properties&&!i.items)return;i.properties?i=i.properties[e]:i.items&&i.items.properties?i=i.items.properties[e]:i.items&&(0,o.isObject)(i.items)?i=i.items:i.items&&Array.isArray(i.items)&&(i=i.items[parseInt(e,10)]),i&&e&&(n=e)}return i};t.convertScalarValue=(e,t,r)=>{try{let{baseType:o,baseTypeSize:a}=d(t);if("int"===o||"uint"===o)switch(r.number){case i.FMT_NUMBER.NUMBER:return Number((0,s.toBigInt)(e));case i.FMT_NUMBER.HEX:return(0,s.numberToHex)((0,s.toBigInt)(e));case i.FMT_NUMBER.STR:return(0,s.toBigInt)(e).toString();case i.FMT_NUMBER.BIGINT:return(0,s.toBigInt)(e);default:throw new n.FormatterError(`Invalid format: ${String(r.number)}`)}if("bytes"===o){let t;switch(a?"string"==typeof e?t=(0,l.padLeft)(e,2*a):(0,c.isUint8Array)(e)&&(t=(0,c.uint8ArrayConcat)(new Uint8Array(a-e.length),e)):t=e,r.bytes){case i.FMT_BYTES.HEX:return(0,s.bytesToHex)((0,s.bytesToUint8Array)(t));case i.FMT_BYTES.UINT8ARRAY:return(0,s.bytesToUint8Array)(t);default:throw new n.FormatterError(`Invalid format: ${String(r.bytes)}`)}}if("string"===o)return String(e)}catch(e){}return e};let h=({value:e,schemaProp:r,schema:n,object:i,key:s,dataPath:a,format:l,oneOfPath:c=[]})=>{var d,u;if(Array.isArray(e)){let h=r;if(void 0!==(null==r?void 0:r.oneOf)&&r.oneOf.forEach((t,n)=>{var i,o;Array.isArray(null==r?void 0:r.items)||("object"!=typeof e[0]||"object"!==(null===(i=null==t?void 0:t.items)||void 0===i?void 0:i.type))&&("string"!=typeof e[0]||"object"===(null===(o=null==t?void 0:t.items)||void 0===o?void 0:o.type))||(h=t,c.push([s,n]))}),(0,o.isNullish)(null==h?void 0:h.items))return delete i[s],a.pop(),!0;if((0,o.isObject)(h.items)&&!(0,o.isNullish)(h.items.format)){for(let r=0;r{var a;if(!(0,o.isObject)(e)&&!Array.isArray(e))return(0,t.convertScalarValue)(e,null==r?void 0:r.format,i);if(Array.isArray(e)&&"array"===(null==r?void 0:r.type)&&"object"===(null===(a=null==r?void 0:r.items)||void 0===a?void 0:a.type))h({value:e,schemaProp:r,schema:r,object:e,key:"",dataPath:n,format:i,oneOfPath:s});else for(let[a,l]of Object.entries(e)){n.push(a);let c=u(r,n,s);if((0,o.isNullish)(c))delete e[a],n.pop();else if((0,o.isObject)(l))(0,t.convert)(l,r,n,i,s),n.pop();else if(!h({value:l,schemaProp:c,schema:r,object:e,key:a,dataPath:n,format:i,oneOfPath:s})){if(void 0===(null==c?void 0:c.format)&&void 0!==(null==c?void 0:c.oneOf)){for(let[e,t]of c.oneOf.entries())if(void 0!==(null==t?void 0:t.format)){c=t;break}}e[a]=(0,t.convertScalarValue)(l,c.format,i),n.pop()}}return e},t.format=(e,r,s=i.DEFAULT_RETURN_FORMAT)=>{let l;l=(0,o.isObject)(r)?(0,a.mergeDeep)({},r):Array.isArray(r)?[...r]:r;let c=(0,o.isObject)(e)?e:o.utils.ethAbiToJsonSchema(e);if(!c.properties&&!c.items&&!c.format)throw new n.FormatterError("Invalid json schema for formatting");return(0,t.convert)(l,c,[],s)}},6985:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getStorageSlotNumForLongString=t.soliditySha3Raw=t.soliditySha3=t.encodePacked=t.processSolidityEncodePackedArgs=t.sha3Raw=t.sha3=t.keccak256=t.keccak256Wrapper=void 0;let n=r(9387),i=r(3096),o=r(1633),s=r(7244),a=r(5608),l=r(6014),c="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";t.keccak256Wrapper=e=>{let t;return t="bigint"==typeof e||"number"==typeof e?(0,i.utf8ToBytes)(e.toString()):Array.isArray(e)?new Uint8Array(e):"string"!=typeof e||(0,s.isHexStrict)(e)?(0,a.bytesToUint8Array)(e):(0,i.utf8ToBytes)(e),(0,a.bytesToHex)((0,n.keccak256)(s.utils.ensureIfUint8Array(t)))},t.keccak256=t.keccak256Wrapper,t.sha3=e=>{let r;r="string"==typeof e?e.startsWith("0x")&&(0,s.isHexStrict)(e)?(0,a.hexToBytes)(e):(0,i.utf8ToBytes)(e):e;let n=(0,t.keccak256Wrapper)(r);return n===c?void 0:n},t.sha3Raw=e=>{let r=(0,t.sha3)(e);return(0,s.isNullish)(r)?c:r};let d=(e,t)=>{let r=/^(\d+).*$/.exec(e.slice(t));return r?parseInt(r[1],10):0},u=e=>e.toString(2).length,h=(e,t)=>{let r=t.toString();if("string"===e){if("string"==typeof t)return(0,a.utf8ToHex)(t);throw new o.InvalidStringError(t)}if("bool"===e||"boolean"===e){if("boolean"==typeof t)return t?"01":"00";throw new o.InvalidBooleanError(t)}if("address"===e){if(!(0,s.isAddress)(r))throw new o.InvalidAddressError(r);return r}let n=e.startsWith("int[")?`int256${e.slice(3)}`:"int"===e?"int256":e.startsWith("uint[")?`uint256'${e.slice(4)}`:"uint"===e?"uint256":e;if(e.startsWith("uint")){let e=d(n,4);if(e%8||e<8||e>256)throw new o.InvalidSizeError(r);let t=(0,a.toNumber)(r);if(u(t)>e)throw new o.InvalidLargeValueError(r);if(t256)throw new o.InvalidSizeError(e);let i=(0,a.toNumber)(r);if(u(i)>t)throw new o.InvalidLargeValueError(r);return i64||t{let[t,r]=(e=>{let t,r;if(Array.isArray(e))throw Error("Autodetection of array types is not supported.");if("object"==typeof e&&("t"in e||"type"in e)&&("v"in e||"value"in e))t="t"in e?e.t:e.type,r="v"in e?e.v:e.value,t="bigint"===t.toLowerCase()?"int":t;else{if("bigint"==typeof e)return["int",e];t=(0,a.toHex)(e,!0),r=(0,a.toHex)(e),t.startsWith("int")||t.startsWith("uint")||(t="bytes")}return!t.startsWith("int")&&!t.startsWith("uint")||"string"!=typeof r||/^(-)?0x/i.test(r)||(r=(0,a.toBigInt)(r)),[t,r]})(e);return Array.isArray(r)?r.map(e=>h(t,e).replace("0x","")).join(""):h(t,r).replace("0x","")},t.encodePacked=(...e)=>`0x${e.map(t.processSolidityEncodePackedArgs).join("").toLowerCase()}`,t.soliditySha3=(...e)=>(0,t.sha3)((0,t.encodePacked)(...e)),t.soliditySha3Raw=(...e)=>(0,t.sha3Raw)((0,t.encodePacked)(...e)),t.getStorageSlotNumForLongString=e=>(0,t.sha3)(`0x${("number"==typeof e?e.toString():e).padStart(64,"0")}`)},6825:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.jsonRpc=void 0,o(r(5608),t),o(r(976),t),o(r(1746),t),o(r(5307),t),o(r(6985),t),o(r(182),t),o(r(6014),t),o(r(2625),t),o(r(7622),t),o(r(9999),t),t.jsonRpc=s(r(9999)),o(r(1868),t),o(r(2964),t),o(r(6846),t),o(r(5081),t),o(r(9986),t),o(r(5528),t)},9999:(e,t,r)=>{let n;Object.defineProperty(t,"__esModule",{value:!0}),t.isBatchRequest=t.toBatchPayload=t.toPayload=t.setRequestIdStart=t.isBatchResponse=t.isValidResponse=t.validateResponse=t.isSubscriptionResult=t.isResponseWithNotification=t.isResponseWithError=t.isResponseWithResult=t.isResponseRpcError=void 0;let i=r(7244),o=r(1633),s=r(6846);t.isResponseRpcError=e=>{let t=e.error.code;return o.rpcErrorsMap.has(t)||t>=-32099&&t<=-32e3},t.isResponseWithResult=e=>!Array.isArray(e)&&!!e&&"2.0"===e.jsonrpc&&"result"in e&&(0,i.isNullish)(e.error)&&("number"==typeof e.id||"string"==typeof e.id),t.isResponseWithError=e=>!Array.isArray(e)&&"2.0"===e.jsonrpc&&!!e&&(0,i.isNullish)(e.result)&&"error"in e&&("number"==typeof e.id||"string"==typeof e.id),t.isResponseWithNotification=e=>!(Array.isArray(e)||!e||"2.0"!==e.jsonrpc||(0,i.isNullish)(e.params)||(0,i.isNullish)(e.method)),t.isSubscriptionResult=e=>!Array.isArray(e)&&!!e&&"2.0"===e.jsonrpc&&"id"in e&&"result"in e,t.validateResponse=e=>(0,t.isResponseWithResult)(e)||(0,t.isResponseWithError)(e),t.isValidResponse=e=>Array.isArray(e)?e.every(t.validateResponse):(0,t.validateResponse)(e),t.isBatchResponse=e=>Array.isArray(e)&&e.length>0&&(0,t.isValidResponse)(e),t.setRequestIdStart=e=>{n=e},t.toPayload=e=>{var t,r,i,o;return void 0!==n&&(n+=1),{jsonrpc:null!==(t=e.jsonrpc)&&void 0!==t?t:"2.0",id:null!==(i=null!==(r=e.id)&&void 0!==r?r:n)&&void 0!==i?i:(0,s.uuidV4)(),method:e.method,params:null!==(o=e.params)&&void 0!==o?o:void 0}},t.toBatchPayload=e=>e.map(e=>(0,t.toPayload)(e)),t.isBatchRequest=e=>Array.isArray(e)&&e.length>0},2625:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.mergeDeep=void 0;let n=r(7797),i=r(7244),o=e=>!("object"!=typeof e||(0,i.isNullish)(e)||Array.isArray(e)||e instanceof n.TypedArray);t.mergeDeep=(e,...r)=>{if(!o(e))return e;let s=Object.assign({},e);for(let e of r)for(let r in e)o(e[r])?(s[r]||(s[r]={}),s[r]=(0,t.mergeDeep)(s[r],e[r])):!(0,i.isNullish)(e[r])&&Object.hasOwnProperty.call(e,r)&&(Array.isArray(e[r])||e[r]instanceof n.TypedArray?s[r]=e[r].slice(0):s[r]=e[r]);return s}},7622:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=function(e){return("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},t.waitWithTimeout=o,t.pollTillDefinedAndReturnIntervalId=s,t.pollTillDefined=function(e,t){return n(this,void 0,void 0,function*(){return s(e,t)[0]})},t.rejectIfTimeout=function(e,t){let r;let n=new Promise((n,i)=>{r=setTimeout(()=>{i(t)},e)});return[r,n]},t.rejectIfConditionAtInterval=function(e,t){let r;let i=new Promise((i,o)=>{r=setInterval(()=>{(()=>{n(this,void 0,void 0,function*(){let t=yield e();t&&(clearInterval(r),o(t))})})()},t)});return[r,i]};let i=r(7244);function o(e,t,r){return n(this,void 0,void 0,function*(){let n;let i=yield Promise.race([e instanceof Promise?e:e(),new Promise((e,i)=>{n=setTimeout(()=>r?i(r):e(void 0),t)})]);if(n&&clearTimeout(n),i instanceof Error)throw i;return i})}function s(e,t){let r;return[new Promise((s,a)=>{r=setInterval(function l(){return(()=>{n(this,void 0,void 0,function*(){try{let n=yield o(e,t);(0,i.isNullish)(n)||(clearInterval(r),s(n))}catch(e){clearInterval(r),a(e)}})})(),l}(),t)}),r]}},182:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.randomHex=t.randomBytes=void 0;let n=r(6442),i=r(5608);t.randomBytes=e=>(0,n.getRandomBytesSync)(e),t.randomHex=e=>(0,i.bytesToHex)((0,t.randomBytes)(e))},9986:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(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 i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SocketProvider=void 0;let a=r(1633),l=r(5081),c=r(2964),d=r(1746),u=r(1868),h=o(r(9999)),f={autoReconnect:!0,delay:5e3,maxAttempts:5};class p extends l.Eip1193Provider{get SocketConnection(){return this._socketConnection}constructor(e,t,r){if(super(),this._connectionStatus="connecting",this._onMessageHandler=this._onMessage.bind(this),this._onOpenHandler=this._onConnect.bind(this),this._onCloseHandler=this._onCloseEvent.bind(this),this._onErrorHandler=this._onError.bind(this),!this._validateProviderPath(e))throw new a.InvalidClientError(e);this._socketPath=e,this._socketOptions=t,this._reconnectOptions=Object.assign(Object.assign({},f),null!=r?r:{}),this._pendingRequestsQueue=new Map,this._sentRequestsQueue=new Map,this._init(),this.connect(),this.chunkResponseParser=new c.ChunkResponseParser(this._eventEmitter,this._reconnectOptions.autoReconnect),this.chunkResponseParser.onError(()=>{this._clearQueues()}),this.isReconnecting=!1}_init(){this._reconnectAttempts=0}connect(){try{this._openSocketConnection(),this._connectionStatus="connecting",this._addSocketListeners()}catch(e){if(!this.isReconnecting)throw this._connectionStatus="disconnected",e&&e.message?new a.ConnectionError(`Error while connecting to ${this._socketPath}. Reason: ${e.message}`):new a.InvalidClientError(this._socketPath);setImmediate(()=>{this._reconnect()})}}_validateProviderPath(e){return!!e}getPendingRequestQueueSize(){return this._pendingRequestsQueue.size}getSentRequestsQueueSize(){return this._sentRequestsQueue.size}supportsSubscriptions(){return!0}on(e,t){this._eventEmitter.on(e,t)}once(e,t){this._eventEmitter.once(e,t)}removeListener(e,t){this._eventEmitter.removeListener(e,t)}_onDisconnect(e,t){this._connectionStatus="disconnected",super._onDisconnect(e,t)}disconnect(e,t){let r=null!=e?e:1e3;this._removeSocketListeners(),"disconnected"!==this.getStatus()&&this._closeSocketConnection(r,t),this._onDisconnect(r,t)}safeDisconnect(e,t){return s(this,arguments,void 0,function*(e,t,r=!1,n=1e3){let i=0;yield s(this,void 0,void 0,function*(){return new Promise(e=>{let t=setInterval(()=>{r&&i>=5&&this.clearQueues(),0===this.getPendingRequestQueueSize()&&0===this.getSentRequestsQueueSize()&&(clearInterval(t),e(!0)),i+=1},n)})}),this.disconnect(e,t)})}removeAllListeners(e){this._eventEmitter.removeAllListeners(e)}_onError(e){this.isReconnecting?this._reconnect():this._eventEmitter.emit("error",e)}reset(){this._sentRequestsQueue.clear(),this._pendingRequestsQueue.clear(),this._init(),this._removeSocketListeners(),this._addSocketListeners()}_reconnect(){this.isReconnecting||(this.isReconnecting=!0,this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((e,t)=>{e.deferredPromise.reject(new a.PendingRequestsOnReconnectingError),this._sentRequestsQueue.delete(t)}),this._reconnectAttempts{this._removeSocketListeners(),this.connect(),this.isReconnecting=!1},this._reconnectOptions.delay)):(this.isReconnecting=!1,this._clearQueues(),this._removeSocketListeners(),this._eventEmitter.emit("error",new a.MaxAttemptsReachedOnReconnectingError(this._reconnectOptions.maxAttempts))))}request(e){return s(this,void 0,void 0,function*(){if((0,d.isNullish)(this._socketConnection))throw Error("Connection is undefined");"disconnected"===this.getStatus()&&this.connect();let t=h.isBatchRequest(e)?e[0].id:e.id;if(!t)throw new a.Web3WSProviderError("Request Id not defined");if(this._sentRequestsQueue.has(t))throw new a.RequestAlreadySentError(t);let r=new u.Web3DeferredPromise;r.catch(e=>{this._eventEmitter.emit("error",e)});let n={payload:e,deferredPromise:r};if("connecting"===this.getStatus())return this._pendingRequestsQueue.set(t,n),n.deferredPromise;this._sentRequestsQueue.set(t,n);try{this._sendToSocket(n.payload)}catch(e){this._sentRequestsQueue.delete(t),this._eventEmitter.emit("error",e)}return r})}_onConnect(){this._connectionStatus="connected",this._reconnectAttempts=0,super._onConnect(),this._sendPendingRequests()}_sendPendingRequests(){for(let[e,t]of this._pendingRequestsQueue.entries())try{this._sendToSocket(t.payload),this._pendingRequestsQueue.delete(e),this._sentRequestsQueue.set(e,t)}catch(t){this._pendingRequestsQueue.delete(e),this._eventEmitter.emit("error",t)}}_onMessage(e){let t=this._parseResponses(e);if(!(0,d.isNullish)(t)&&0!==t.length)for(let e of t){if(h.isResponseWithNotification(e)&&e.method.endsWith("_subscription"))return void this._eventEmitter.emit("message",e);let t=h.isBatchResponse(e)?e[0].id:e.id,r=this._sentRequestsQueue.get(t);if(!r)return;(h.isBatchResponse(e)||h.isResponseWithResult(e)||h.isResponseWithError(e))&&(this._eventEmitter.emit("message",e),r.deferredPromise.resolve(e)),this._sentRequestsQueue.delete(t)}}clearQueues(e){this._clearQueues(e)}_clearQueues(e){this._pendingRequestsQueue.size>0&&this._pendingRequestsQueue.forEach((t,r)=>{t.deferredPromise.reject(new a.ConnectionNotOpenError(e)),this._pendingRequestsQueue.delete(r)}),this._sentRequestsQueue.size>0&&this._sentRequestsQueue.forEach((t,r)=>{t.deferredPromise.reject(new a.ConnectionNotOpenError(e)),this._sentRequestsQueue.delete(r)}),this._removeSocketListeners()}}t.SocketProvider=p},6014:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fromTwosComplement=t.toTwosComplement=t.leftPad=t.rightPad=t.padRight=t.padLeft=void 0;let n=r(1633),i=r(7244),o=r(5608);t.padLeft=(e,t,r="0")=>"string"==typeof e?(0,i.isHexStrict)(e)?i.utils.padLeft(e,t,r):e.padStart(t,r):(i.validator.validate(["int"],[e]),i.utils.padLeft(e,t,r)),t.padRight=(e,t,r="0")=>{if("string"==typeof e&&!(0,i.isHexStrict)(e))return e.padEnd(t,r);let n="string"==typeof e&&(0,i.isHexStrict)(e)?e:(0,o.numberToHex)(e),s=n.startsWith("-")?3:2;return i.validator.validate([n.startsWith("-")?"int":"uint"],[e]),n.padEnd(t+s,r)},t.rightPad=t.padRight,t.leftPad=t.padLeft,t.toTwosComplement=(e,r=64)=>{i.validator.validate(["int"],[e]);let s=(0,o.toNumber)(e);if(s>=0)return(0,t.padLeft)((0,o.toHex)(s),r);let a=(0,i.bigintPower)(BigInt(2),BigInt(4*r));if(-s>=a)throw new n.NibbleWidthError(`value: ${e}, nibbleWidth: ${r}`);let l=BigInt(s)+a;return(0,t.padLeft)((0,o.numberToHex)(l),r)},t.fromTwosComplement=(e,t=64)=>{i.validator.validate(["int"],[e]);let r=(0,o.toNumber)(e);if(r<0)return r;let s=Math.ceil(Math.log(Number(r))/Math.log(2));if(s>4*t)throw new n.NibbleWidthError(`value: "${e}", nibbleWidth: "${t}"`);if(4*t!==s)return r;let a=(0,i.bigintPower)(BigInt(2),BigInt(t)*BigInt(4));return(0,o.toNumber)(BigInt(r)-a)}},5528:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=function(e){var t,r;return e instanceof Uint8Array||"Uint8Array"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)||"Buffer"===(null===(r=null==e?void 0:e.constructor)||void 0===r?void 0:r.name)},t.uint8ArrayConcat=function(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},t.uint8ArrayEquals=function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.uuidV4=void 0;let n=r(5608),i=r(182);t.uuidV4=()=>{let e=(0,i.randomBytes)(16);e[6]=15&e[6]|64,e[8]=63&e[8]|128;let t=(0,n.bytesToHex)(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}},1746:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNullish=t.isContractInitOptions=t.compareBlockNumbers=t.isTopicInBloom=t.isTopic=t.isContractAddressInBloom=t.isUserEthereumAddressInBloom=t.isInBloom=t.isBloom=t.isAddress=t.checkAddressCheckSum=t.isHex=t.isHexStrict=void 0;let n=r(1633),i=r(7244),o=r(7797);t.isHexStrict=i.isHexStrict,t.isHex=i.isHex,t.checkAddressCheckSum=i.checkAddressCheckSum,t.isAddress=i.isAddress,t.isBloom=i.isBloom,t.isInBloom=i.isInBloom,t.isUserEthereumAddressInBloom=i.isUserEthereumAddressInBloom,t.isContractAddressInBloom=i.isContractAddressInBloom,t.isTopic=i.isTopic,t.isTopicInBloom=i.isTopicInBloom,t.compareBlockNumbers=(e,t)=>{let r="string"==typeof e&&(0,i.isBlockTag)(e),s="string"==typeof t&&(0,i.isBlockTag)(t);if(e===t||("earliest"===e||0===e)&&("earliest"===t||0===t))return 0;if("earliest"===e)return -1;if("earliest"===t)return 1;if(r&&s){let r={[o.BlockTags.EARLIEST]:1,[o.BlockTags.FINALIZED]:2,[o.BlockTags.SAFE]:3,[o.BlockTags.LATEST]:4,[o.BlockTags.PENDING]:5};return r[e]"object"==typeof e&&!(0,i.isNullish)(e)&&0!==Object.keys(e).length&&["input","data","from","gas","gasPrice","gasLimit","address","jsonInterface","syncWithContext","dataInputFill"].some(t=>t in e),t.isNullish=i.isNullish},1868:function(e,t,r){var n,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Web3DeferredPromise=void 0;let o=r(1633);t.Web3DeferredPromise=class{constructor({timeout:e,eagerStart:t,timeoutMessage:r}={timeout:0,eagerStart:!1,timeoutMessage:"DeferredPromise timed out"}){this[n]="Promise",this._state="pending",this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),this._timeoutMessage=r,this._timeoutInterval=e,t&&this.startTimer()}get state(){return this._state}then(e,t){return i(this,void 0,void 0,function*(){return this._promise.then(e,t)})}catch(e){return i(this,void 0,void 0,function*(){return this._promise.catch(e)})}finally(e){return i(this,void 0,void 0,function*(){return this._promise.finally(e)})}resolve(e){this._resolve(e),this._state="fulfilled",this._clearTimeout()}reject(e){this._reject(e),this._state="rejected",this._clearTimeout()}startTimer(){this._timeoutInterval&&this._timeoutInterval>0&&(this._timeoutId=setTimeout(this._checkTimeout.bind(this),this._timeoutInterval))}_checkTimeout(){"pending"===this._state&&this._timeoutId&&this.reject(new o.OperationTimeoutError(this._timeoutMessage))}_clearTimeout(){this._timeoutId&&clearTimeout(this._timeoutId)}},n=Symbol.toStringTag},5081:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.Eip1193Provider=void 0;let i=r(7797),o=r(2380),s=r(1633),a=r(9999);class l extends i.Web3BaseProvider{constructor(){super(...arguments),this._eventEmitter=new o.EventEmitter,this._chainId="",this._accounts=[]}_getChainId(){return n(this,void 0,void 0,function*(){var e;let t=yield this.request((0,a.toPayload)({method:"eth_chainId",params:[]}));return null!==(e=null==t?void 0:t.result)&&void 0!==e?e:""})}_getAccounts(){return n(this,void 0,void 0,function*(){var e;let t=yield this.request((0,a.toPayload)({method:"eth_accounts",params:[]}));return null!==(e=null==t?void 0:t.result)&&void 0!==e?e:[]})}_onConnect(){Promise.all([this._getChainId().then(e=>{e!==this._chainId&&(this._chainId=e,this._eventEmitter.emit("chainChanged",this._chainId))}).catch(e=>{console.error(e)}),this._getAccounts().then(e=>{this._accounts.length===e.length&&e.every(t=>e.includes(t))||(this._accounts=e,this._onAccountsChanged())}).catch(e=>{console.error(e)})]).then(()=>this._eventEmitter.emit("connect",{chainId:this._chainId})).catch(e=>{console.error(e)})}_onDisconnect(e,t){this._eventEmitter.emit("disconnect",new s.EIP1193ProviderRpcError(e,t))}_onAccountsChanged(){this._eventEmitter.emit("accountsChanged",this._accounts)}}t.Eip1193Provider=l},1937:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VALID_ETH_BASE_TYPES=void 0,t.VALID_ETH_BASE_TYPES=["bool","int","uint","bytes","string","address","tuple"]},6032:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validator=void 0;let n=r(3048);t.validator=new n.Web3Validator},8141:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Web3ValidatorError=void 0;let n=r(1633),i=e=>e.message?e.message:"unspecified error";class o extends n.BaseWeb3Error{constructor(e){super(),this.code=n.ERR_VALIDATION,this.errors=e,super.message=`Web3 validator found ${e.length} error[s]: ${this._compileErrors().join("\n")}`}_compileErrors(){return this.errors.map(i)}}t.Web3ValidatorError=o},3860:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});let n=r(7258),i=r(6875),o=r(4013),s=r(1386),a=r(9865),l=r(7230),c=r(1977),d=r(2464),u={address:e=>(0,n.isAddress)(e),bloom:e=>(0,o.isBloom)(e),blockNumber:e=>(0,i.isBlockNumber)(e),blockTag:e=>(0,i.isBlockTag)(e),blockNumberOrTag:e=>(0,i.isBlockNumberOrTag)(e),bool:e=>(0,s.isBoolean)(e),bytes:e=>(0,a.isBytes)(e),filter:e=>(0,l.isFilterObject)(e),hex:e=>(0,c.isHexStrict)(e),uint:e=>(0,d.isUInt)(e),int:e=>(0,d.isInt)(e),number:e=>(0,d.isNumber)(e),string:e=>(0,c.isString)(e)};for(let e=8;e<=256;e+=8)u[`int${e}`]=t=>(0,d.isInt)(t,{bitSize:e}),u[`uint${e}`]=t=>(0,d.isUInt)(t,{bitSize:e});for(let e=1;e<=32;e+=1)u[`bytes${e}`]=t=>(0,a.isBytes)(t,{size:e});u.bytes256=u.bytes,t.default=u},7244:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},s=this&&this.__importStar||function(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 i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.utils=void 0,o(r(3048),t),o(r(6032),t),o(r(5225),t),t.utils=s(r(8933)),o(r(8141),t),o(r(1937),t),o(r(6738),t)},5225:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8933:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.padLeft=t.numberToHex=t.hexToNumber=t.codePointToInt=t.transformJsonDataToAbiFormat=t.fetchArrayElement=t.ethAbiToJsonSchema=t.abiSchemaToJsonSchema=t.parseBaseType=void 0,t.uint8ArrayToHexString=function(e){let t="0x";for(let r of e){let e=r.toString(16);t+=1===e.length?`0${e}`:e}return t},t.hexToUint8Array=function(e){let t=0;if(e.startsWith("0")&&("x"===e[1]||"X"===e[1])&&(t=2),e.length%2!=0)throw new n.InvalidBytesError(`hex string has odd length: ${e}`);let r=(e.length-t)/2,i=new Uint8Array(r);for(let o=0,s=t;o{let t,r=e.replace(/ /,""),n=!1,o=[];if(e.includes("[")&&(r=r.slice(0,r.indexOf("[")),n=(o=[...e.matchAll(/(?:\[(\d*)\])/g)].map(e=>parseInt(e[1],10)).map(e=>Number.isNaN(e)?-1:e)).length>0),i.VALID_ETH_BASE_TYPES.includes(r))return{baseType:r,isArray:n,baseTypeSize:t,arraySizes:o};if(r.startsWith("int"))t=parseInt(r.substring(3),10),r="int";else if(r.startsWith("uint"))t=parseInt(e.substring(4),10),r="uint";else{if(!r.startsWith("bytes"))return{baseType:void 0,isArray:!1,baseTypeSize:void 0,arraySizes:o};t=parseInt(r.substring(5),10),r="bytes"}return{baseType:r,isArray:n,baseTypeSize:t,arraySizes:o}};let c=(e,r={})=>{if(Object.keys(r).includes("type"))throw new a.Web3ValidatorError([{keyword:"eth",message:'Either "eth" or "type" can be presented in schema',params:{eth:e},instancePath:"",schemaPath:""}]);let{baseType:n,baseTypeSize:i}=(0,t.parseBaseType)(e);if(!n&&!l.includes(e))throw new a.Web3ValidatorError([{keyword:"eth",message:`Eth data type "${e}" is not valid`,params:{eth:e},instancePath:"",schemaPath:""}]);if(n){if("tuple"===n)throw Error('"tuple" type is not implemented directly.');return{format:`${n}${null!=i?i:""}`,required:!0}}return e?{format:e,required:!0}:{}};t.abiSchemaToJsonSchema=(e,r="/0")=>{let n={type:"array",items:[],maxItems:e.length,minItems:e.length};for(let[i,s]of e.entries()){let e,a,l=[];(0,o.isAbiParameterSchema)(s)?(e=s.type,a=s.name||`${r}/${i}`,l=s.components):"string"==typeof s?(e=s,a=`${r}/${i}`):Array.isArray(s)&&(s[0]&&"string"==typeof s[0]&&s[0].startsWith("tuple")&&!Array.isArray(s[0])&&s[1]&&Array.isArray(s[1])?(e=s[0],a=`${r}/${i}`,l=s[1]):(e="tuple",a=`${r}/${i}`,l=s));let{baseType:d,isArray:u,arraySizes:h}=(0,t.parseBaseType)(e),f,p=n;for(let e=h.length-1;e>0;e-=1)f={type:"array",$id:a,items:[],maxItems:h[e],minItems:h[e]},h[e]<0&&(delete f.maxItems,delete f.minItems),Array.isArray(p.items)?0===p.items.length?p.items=[f]:p.items.push(f):p.items=[p.items,f],p=f;if("tuple"!==d||u){if("tuple"===d&&u){let e=h[0],r=Object.assign({type:"array",$id:a,items:(0,t.abiSchemaToJsonSchema)(l,a)},e>=0&&{minItems:e,maxItems:e});p.items.push(r)}else if(u){let t=h[0],r=Object.assign({type:"array",$id:a,items:c(e)},t>=0&&{minItems:t,maxItems:t});p.items.push(r)}else Array.isArray(p.items),p.items.push(Object.assign({$id:a},c(e)))}else{let e=(0,t.abiSchemaToJsonSchema)(l,a);e.$id=a,p.items.push(e)}p=n}return n},t.ethAbiToJsonSchema=e=>(0,t.abiSchemaToJsonSchema)(e),t.fetchArrayElement=(e,r)=>1===r?e:(0,t.fetchArrayElement)(e[0],r-1),t.transformJsonDataToAbiFormat=(e,r,n)=>{let i=[];for(let[s,a]of e.entries()){let e,l,c=[];(0,o.isAbiParameterSchema)(a)?(e=a.type,l=a.name,c=a.components):"string"==typeof a?e=a:Array.isArray(a)&&(a[1]&&Array.isArray(a[1])?(e=a[0],c=a[1]):(e="tuple",c=a));let{baseType:d,isArray:u,arraySizes:h}=(0,t.parseBaseType)(e),f=Array.isArray(r)?r[s]:r[l];if("tuple"!==d||u){if("tuple"===d&&u){let e=[];for(let r of f)if(h.length>1){let i=(0,t.fetchArrayElement)(r,h.length-1),o=[];for(let e of i)o.push((0,t.transformJsonDataToAbiFormat)(c,e,n));e.push(o)}else e.push((0,t.transformJsonDataToAbiFormat)(c,r,n));i.push(e)}else i.push(f)}else i.push((0,t.transformJsonDataToAbiFormat)(c,f,n))}return(n=null!=n?n:[]).push(...i),n},t.codePointToInt=e=>{if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw Error(`Invalid code point: ${e}`)},t.hexToNumber=e=>{if(!(0,s.isHexStrict)(e))throw Error("Invalid hex string");let[t,r]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e],n=BigInt(r);return n>Number.MAX_SAFE_INTEGER?t?-n:n:n{if(("number"==typeof e||"bigint"==typeof e)&&e<0)return`-0x${e.toString(16).slice(1)}`;if(("number"==typeof e||"bigint"==typeof e)&&e>=0)return`0x${e.toString(16)}`;if("string"==typeof e&&(0,s.isHexStrict)(e)){let[t,r]=e.startsWith("-")?[!0,e.slice(1)]:[!1,e];return`${t?"-":""}0x${r.split(/^(-)?0(x|X)/).slice(-1)[0].replace(/^0+/,"").toLowerCase()}`}if("string"==typeof e&&!(0,s.isHexStrict)(e))return(0,t.numberToHex)(BigInt(e));throw new n.InvalidNumberError(e)},t.padLeft=(e,r,n="0")=>{if("string"==typeof e&&!(0,s.isHexStrict)(e))return e.padStart(r,n);let i="string"==typeof e&&(0,s.isHexStrict)(e)?e:(0,t.numberToHex)(e),[o,a]=i.startsWith("-")?["-0x",i.slice(3)]:["0x",i.slice(2)];return`${o}${a.padStart(r,n)}`};let d={zero:48,nine:57,A:65,F:70,a:97,f:102};function u(e){return e>=d.zero&&e<=d.nine?e-d.zero:e>=d.A&&e<=d.F?e-(d.A-10):e>=d.a&&e<=d.f?e-(d.a-10):void 0}},6772:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isAbiParameterSchema=void 0,t.isAbiParameterSchema=e=>"object"==typeof e&&"type"in e&&"name"in e},7258:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isAddress=t.checkAddressCheckSum=void 0;let n=r(928),i=r(3501),o=r(8933),s=r(1977),a=r(9865);t.checkAddressCheckSum=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;let t=e.slice(2),r=(0,i.utf8ToBytes)(t.toLowerCase()),s=(0,o.uint8ArrayToHexString)((0,n.keccak256)((0,o.ensureIfUint8Array)(r))).slice(2);for(let e=0;e<40;e+=1)if(parseInt(s[e],16)>7&&t[e].toUpperCase()!==t[e]||7>=parseInt(s[e],16)&&t[e].toLowerCase()!==t[e])return!1;return!0},t.isAddress=(e,r=!0)=>{let n;return!!("string"==typeof e||(0,a.isUint8Array)(e))&&(n=(0,a.isUint8Array)(e)?(0,o.uint8ArrayToHexString)(e):"string"!=typeof e||(0,s.isHexStrict)(e)||e.toLowerCase().startsWith("0x")?e:`0x${e}`,!!/^(0x)?[0-9a-f]{40}$/i.test(n)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(n)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(n))||!r||(0,t.checkAddressCheckSum)(n)))}},6875:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isBlockNumberOrTag=t.isBlockTag=t.isBlockNumber=void 0;let n=r(7797),i=r(2464);t.isBlockNumber=e=>(0,i.isUInt)(e),t.isBlockTag=e=>Object.values(n.BlockTags).includes(e),t.isBlockNumberOrTag=e=>(0,t.isBlockTag)(e)||(0,t.isBlockNumber)(e)},4013:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isContractAddressInBloom=t.isUserEthereumAddressInBloom=t.isInBloom=t.isBloom=void 0;let n=r(928),i=r(8933),o=r(7258),s=r(1977);t.isBloom=e=>!("string"!=typeof e||!/^(0x)?[0-9a-f]{512}$/i.test(e)||!/^(0x)?[0-9a-f]{512}$/.test(e)&&!/^(0x)?[0-9A-F]{512}$/.test(e)),t.isInBloom=(e,r)=>{if("string"==typeof r&&!(0,s.isHexStrict)(r)||!(0,t.isBloom)(e))return!1;let o="string"==typeof r?(0,i.hexToUint8Array)(r):r,a=(0,i.uint8ArrayToHexString)((0,n.keccak256)(o)).slice(2);for(let t=0;t<12;t+=4){let r=(parseInt(a.slice(t,t+2),16)<<8)+parseInt(a.slice(t+2,t+4),16)&2047,n=1<{if(!(0,t.isBloom)(e)||!(0,o.isAddress)(r))return!1;let n=(0,i.padLeft)(r,64);return(0,t.isInBloom)(e,n)},t.isContractAddressInBloom=(e,r)=>!!(0,t.isBloom)(e)&&!!(0,o.isAddress)(r)&&(0,t.isInBloom)(e,r)},1386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isBoolean=void 0;let n=r(1977);t.isBoolean=e=>!!["number","string","boolean"].includes(typeof e)&&("boolean"==typeof e||("string"!=typeof e||(0,n.isHexStrict)(e)?"string"==typeof e&&(0,n.isHexStrict)(e)?"0x1"===e||"0x0"===e:1===e||0===e:"1"===e||"0"===e))},9865:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isBytes=t.isUint8Array=void 0;let n=r(8933),i=r(1977);t.isUint8Array=e=>{var t,r;return e instanceof Uint8Array||"Uint8Array"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)||"Buffer"===(null===(r=null==e?void 0:e.constructor)||void 0===r?void 0:r.name)},t.isBytes=(e,r={abiType:"bytes"})=>{let o;if("string"!=typeof e&&!Array.isArray(e)&&!(0,t.isUint8Array)(e)||"string"==typeof e&&(0,i.isHexStrict)(e)&&e.startsWith("-")||"string"==typeof e&&!(0,i.isHexStrict)(e))return!1;if("string"==typeof e){if(e.length%2!=0)return!1;o=(0,n.hexToUint8Array)(e)}else if(Array.isArray(e)){if(e.some(e=>e<0||e>255||!Number.isInteger(e)))return!1;o=new Uint8Array(e)}else o=e;if(null==r?void 0:r.abiType){let{baseTypeSize:e}=(0,n.parseBaseType)(r.abiType);return!e||o.length===e}return!(null==r?void 0:r.size)||o.length===(null==r?void 0:r.size)}},5617:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isValidEthBaseType=void 0;let n=r(8933);t.isValidEthBaseType=e=>{let{baseType:t,baseTypeSize:r}=(0,n.parseBaseType)(e);return!!t&&(t===e||("int"!==t&&"uint"!==t||!r||r<=256&&r%8==0)&&("bytes"!==t||!r||r>=1&&r<=32))}},7230:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isFilterObject=void 0;let n=r(7258),i=r(6875),o=r(2735),s=r(2257);t.isFilterObject=e=>{let t=["fromBlock","toBlock","address","topics","blockHash"];if((0,o.isNullish)(e)||"object"!=typeof e||!Object.keys(e).every(e=>t.includes(e))||!(0,o.isNullish)(e.fromBlock)&&!(0,i.isBlockNumberOrTag)(e.fromBlock)||!(0,o.isNullish)(e.toBlock)&&!(0,i.isBlockNumberOrTag)(e.toBlock))return!1;if(!(0,o.isNullish)(e.address)){if(Array.isArray(e.address)){if(!e.address.every(e=>(0,n.isAddress)(e)))return!1}else if(!(0,n.isAddress)(e.address))return!1}return!(!(0,o.isNullish)(e.topics)&&!e.topics.every(e=>!!(0,o.isNullish)(e)||(Array.isArray(e)?e.every(e=>(0,s.isTopic)(e)):!!(0,s.isTopic)(e))))}},6738:function(e,t,r){var n=this&&this.__createBinding||(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]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7258),t),i(r(6875),t),i(r(4013),t),i(r(1386),t),i(r(9865),t),i(r(5617),t),i(r(7230),t),i(r(2464),t),i(r(1977),t),i(r(2257),t),i(r(2735),t)},2464:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=t.isInt=t.isUInt=t.bigintPower=t.isBigInt=void 0;let n=r(8933),i=r(1977);t.isBigInt=e=>"bigint"==typeof e,t.bigintPower=(e,t)=>{if(t===BigInt(0))return BigInt(1);let r=e;for(let n=1;n{let o;if(!["number","string","bigint"].includes(typeof e)||"string"==typeof e&&0===e.length)return!1;if(null==r?void 0:r.abiType){let{baseTypeSize:e}=(0,n.parseBaseType)(r.abiType);e&&(o=e)}else r.bitSize&&(o=r.bitSize);let s=(0,t.bigintPower)(BigInt(2),BigInt(null!=o?o:256))-BigInt(1);try{let t="string"==typeof e&&(0,i.isHexStrict)(e)?BigInt((0,n.hexToNumber)(e)):BigInt(e);return t>=0&&t<=s}catch(e){return!1}},t.isInt=(e,r={abiType:"int"})=>{let o;if(!["number","string","bigint"].includes(typeof e)||"number"==typeof e&&e>Number.MAX_SAFE_INTEGER)return!1;if(null==r?void 0:r.abiType){let{baseTypeSize:e,baseType:t}=(0,n.parseBaseType)(r.abiType);if("int"!==t)return!1;e&&(o=e)}else r.bitSize&&(o=r.bitSize);let s=(0,t.bigintPower)(BigInt(2),BigInt((null!=o?o:256)-1)),a=BigInt(-1)*(0,t.bigintPower)(BigInt(2),BigInt((null!=o?o:256)-1));try{let t="string"==typeof e&&(0,i.isHexStrict)(e)?BigInt((0,n.hexToNumber)(e)):BigInt(e);return t>=a&&t<=s}catch(e){return!1}},t.isNumber=e=>!!(0,t.isInt)(e)||!("string"!=typeof e||!/[0-9.]/.test(e)||e.indexOf(".")!==e.lastIndexOf("."))||"number"==typeof e},2735:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=t.isNullish=void 0;let n=r(7797);t.isNullish=e=>null==e,t.isObject=e=>!("object"!=typeof e||(0,t.isNullish)(e)||Array.isArray(e)||e instanceof n.TypedArray)},1977:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateNoLeadingZeroes=t.isHexString32Bytes=t.isHexString8Bytes=t.isHex=t.isHexStrict=t.isString=void 0,t.isHexString=function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||void 0!==t&&t>0&&e.length!==2+2*t)},t.isHexPrefixed=function(e){if("string"!=typeof e)throw Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return e.startsWith("0x")},t.isString=e=>"string"==typeof e,t.isHexStrict=e=>"string"==typeof e&&/^((-)?0x[0-9a-f]+|(0x))$/i.test(e),t.isHex=e=>"number"==typeof e||"bigint"==typeof e||"string"==typeof e&&/^((-0x|0x|-)?[0-9a-f]+|(0x))$/i.test(e),t.isHexString8Bytes=(e,r=!0)=>r?(0,t.isHexStrict)(e)&&18===e.length:(0,t.isHex)(e)&&16===e.length,t.isHexString32Bytes=(e,r=!0)=>r?(0,t.isHexStrict)(e)&&66===e.length:(0,t.isHex)(e)&&64===e.length,t.validateNoLeadingZeroes=function(e){for(let[t,r]of Object.entries(e))if(void 0!==r&&r.length>0&&0===r[0])throw Error(`${t} cannot have leading zeroes, received: ${r.toString()}`)}},2257:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isTopicInBloom=t.isTopic=void 0;let n=r(4013);t.isTopic=e=>!("string"!=typeof e||!/^(0x)?[0-9a-f]{64}$/i.test(e)||!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e)),t.isTopicInBloom=(e,r)=>!!(0,n.isBloom)(e)&&!!(0,t.isTopic)(r)&&(0,n.isInBloom)(e,r)},4918:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;let i=r(1633),o=r(5995),s=r(8141),a=n(r(3860)),l=e=>{if((!(null==e?void 0:e.type)||"object"===(null==e?void 0:e.type))&&(null==e?void 0:e.properties)){let t={};for(let r of Object.keys(e.properties)){let n=l(e.properties[r]);n&&(t[r]=n)}return Array.isArray(e.required)?o.z.object(t).partial().required(e.required.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:!0}),{})):o.z.object(t).partial()}if("array"===(null==e?void 0:e.type)&&(null==e?void 0:e.items)){if(Array.isArray(e.items)&&e.items.length>1&&void 0!==e.maxItems&&new Set(e.items.map(e=>e.$id)).size===e.items.length){let t=[];for(let r of e.items){let e=l(r);e&&t.push(e)}return o.z.tuple(t)}let t=Array.isArray(e.items)?e.items[0]:e.items,r=o.z.array(l(t));return r=void 0!==e.minItems?r.min(e.minItems):r,r=void 0!==e.maxItems?r.max(e.maxItems):r}if(e.oneOf&&Array.isArray(e.oneOf))return o.z.union(e.oneOf.map(e=>l(e)));if(null==e?void 0:e.format){if(!a.default[e.format])throw new i.SchemaFormatError(e.format);return o.z.any().refine(a.default[e.format],t=>({params:{value:t,format:e.format}}))}return(null==e?void 0:e.type)&&"object"!==(null==e?void 0:e.type)&&"function"==typeof o.z[String(e.type)]?o.z[String(e.type)]():o.z.object({data:o.z.any()}).partial()};class c{static factory(){return c.validatorInstance||(c.validatorInstance=new c),c.validatorInstance}validate(e,t,r){var n,i;let o=l(e).safeParse(t);if(!o.success){let e=this.convertErrors(null!==(i=null===(n=o.error)||void 0===n?void 0:n.issues)&&void 0!==i?i:[]);if(e){if(null==r?void 0:r.silent)return e;throw new s.Web3ValidatorError(e)}}}convertErrors(e){if(e&&Array.isArray(e)&&e.length>0)return e.map(e=>{var t;let r,n,i,s;s=e.path.join("/");let a=String(e.path[e.path.length-1]),l=e.path.join("/");if(e.code===o.ZodIssueCode.too_big)n="maxItems",s=`${l}/maxItems`,i={limit:e.maximum},r=`must NOT have more than ${e.maximum} items`;else if(e.code===o.ZodIssueCode.too_small)n="minItems",s=`${l}/minItems`,i={limit:e.minimum},r=`must NOT have fewer than ${e.minimum} items`;else if(e.code===o.ZodIssueCode.custom){let{value:n,format:o}=null!==(t=e.params)&&void 0!==t?t:{};r=void 0===n?`value at "/${s}" is required`:`value "${"object"==typeof n?JSON.stringify(n):n}" at "/${s}" must pass "${o}" validation`,i={value:n}}return{keyword:null!=n?n:a,instancePath:l?`/${l}`:"",schemaPath:s?`#${s}`:"#",params:null!=i?i:{value:e.message},message:null!=r?r:e.message}})}}t.Validator=c},3048:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Validator=void 0;let n=r(4918),i=r(8933),o=r(8141);t.Web3Validator=class{constructor(){this._validator=n.Validator.factory()}validateJSONSchema(e,t,r){return this._validator.validate(e,t,r)}validate(e,t,r={silent:!1}){var n,s;let a=(0,i.ethAbiToJsonSchema)(e);if(!Array.isArray(a.items)||0!==(null===(n=a.items)||void 0===n?void 0:n.length)||0!==t.length){if(Array.isArray(a.items)&&0===(null===(s=a.items)||void 0===s?void 0:s.length)&&0!==t.length)throw new o.Web3ValidatorError([{instancePath:"/0",schemaPath:"/",keyword:"required",message:"empty schema against data can not be validated",params:t}]);return this._validator.validate(a,t,r)}}}},6366:(e,t,r)=>{function n(e,t){let r=e.exec(t);return r?.groups}r.r(t),r.d(t,{BaseError:()=>c,narrow:()=>d,parseAbi:()=>N,parseAbiItem:()=>B,parseAbiParameter:()=>M,parseAbiParameters:()=>L});var i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,o=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,s=/^\(.+?\).*?$/,a=Object.defineProperty,l=(e,t,r)=>{var n;return(n="symbol"!=typeof t?t+"":t)in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,r},c=class extends Error{constructor(e,t={}){let r=t.cause instanceof c?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof c&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: https://abitype.dev${n}`]:[],...r?[`Details: ${r}`]:[],"Version: abitype@0.7.1"].join("\n")),l(this,"details"),l(this,"docsPath"),l(this,"metaMessages"),l(this,"shortMessage"),l(this,"name","AbiTypeError"),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.shortMessage=e}};function d(e){return e}var u=/^error (?[a-zA-Z0-9_]+)\((?.*?)\)$/,h=/^event (?[a-zA-Z0-9_]+)\((?.*?)\)$/,f=/^function (?[a-zA-Z0-9_]+)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns \((?.*?)\))?$/,p=/^struct (?[a-zA-Z0-9_]+) \{(?.*?)\}$/;function m(e){return p.test(e)}var g=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/,y=/^fallback\(\)$/,b=/^receive\(\) external payable$/,v=new Set(["memory","indexed","storage","calldata"]),w=new Set(["indexed"]),E=new Set(["calldata","memory","storage"]),A=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function _(e,t={}){if(f.test(e)){let r=n(f,e);if(!r)throw new c("Invalid function signature.",{details:e});let i=P(r.parameters),o=[],s=i.length;for(let e=0;e[a-zA-Z0-9_]+?)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z0-9_]+))?$/,I=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z0-9_]+))?$/,x=/^u?int$/;function R(e,t){var r,a,l;let d=(r=t?.type)?`${r}:${e}`:e;if(A.has(d))return A.get(d);let u=s.test(e),h=n(u?I:T,e);if(!h)throw new c("Invalid ABI parameter.",{details:e});if(h.name&&("address"===(a=h.name)||"bool"===a||"function"===a||"string"===a||"tuple"===a||i.test(a)||o.test(a)||k.test(a)))throw new c("Invalid ABI parameter.",{details:e,metaMessages:[`"${h.name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]});let f=h.name?{name:h.name}:{},p="indexed"===h.modifier?{indexed:!0}:{},m=t?.structs??{},g,y={};if(u){g="tuple";let e=P(h.type),t=[],r=e.length;for(let n=0;n0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`});return[...t,r.trim()]}let i=e.length;for(let o=0;o[a-zA-Z0-9_]+?)(?(?:\[\d*?\])+?)?$/;function N(e){let t=S(e),r=[],n=e.length;for(let i=0;i{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&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(174).default})();var a={},l={};void 0!==(l=function(){let e;function t(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw TypeError("Private element is not present on this object")}let r={},n=()=>{r.previousActiveElement instanceof HTMLElement?(r.previousActiveElement.focus(),r.previousActiveElement=null):document.body&&document.body.focus()},i=e=>new Promise(t=>{if(!e)return t();let i=window.scrollX,o=window.scrollY;r.restoreFocusTimeout=setTimeout(()=>{n(),t()},100),window.scrollTo(i,o)}),o="swal2-",s=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","draggable","dragging"].reduce((e,t)=>(e[t]=o+t,e),{}),a=["success","warning","info","question","error"].reduce((e,t)=>(e[t]=o+t,e),{}),l="SweetAlert2:",c=e=>e.charAt(0).toUpperCase()+e.slice(1),d=e=>{console.warn(`${l} ${"object"==typeof e?e.join(" "):e}`)},u=e=>{console.error(`${l} ${e}`)},h=[],f=e=>{h.includes(e)||(h.push(e),d(e))},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;f(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`)},m=e=>"function"==typeof e?e():e,g=e=>e&&"function"==typeof e.toPromise,y=e=>g(e)?e.toPromise():Promise.resolve(e),b=e=>e&&Promise.resolve(e)===e,v=()=>document.body.querySelector(`.${s.container}`),w=e=>{let t=v();return t?t.querySelector(e):null},E=e=>w(`.${e}`),A=()=>E(s.popup),_=()=>E(s.icon),T=()=>E(s.title),I=()=>E(s["html-container"]),x=()=>E(s.image),R=()=>E(s["progress-steps"]),P=()=>E(s["validation-message"]),C=()=>w(`.${s.actions} .${s.confirm}`),k=()=>w(`.${s.actions} .${s.cancel}`),S=()=>w(`.${s.actions} .${s.deny}`),O=()=>w(`.${s.loader}`),N=()=>E(s.actions),B=()=>E(s.footer),M=()=>E(s["timer-progress-bar"]),L=()=>E(s.close),D=` a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable], audio[controls], video[controls], summary `,H=()=>{let e=A();if(!e)return[];let t=Array.from(e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((e,t)=>{let r=parseInt(e.getAttribute("tabindex")||"0"),n=parseInt(t.getAttribute("tabindex")||"0");return r>n?1:r"-1"!==e.getAttribute("tabindex"));return[...new Set(t.concat(r))].filter(e=>en(e))},F=()=>V(document.body,s.shown)&&!V(document.body,s["toast-shown"])&&!V(document.body,s["no-backdrop"]),j=()=>{let e=A();return!!e&&V(e,s.toast)},U=(e,t)=>{if(e.textContent="",t){let r=new DOMParser().parseFromString(t,"text/html"),n=r.querySelector("head");n&&Array.from(n.childNodes).forEach(t=>{e.appendChild(t)});let i=r.querySelector("body");i&&Array.from(i.childNodes).forEach(t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},V=(e,t)=>{if(!t)return!1;let r=t.split(/\s+/);for(let t=0;t{Array.from(e.classList).forEach(r=>{Object.values(s).includes(r)||Object.values(a).includes(r)||Object.values(t.showClass||{}).includes(r)||e.classList.remove(r)})},W=(e,t,r)=>{if(G(e,t),!t.customClass)return;let n=t.customClass[r];if(n){if("string"!=typeof n&&!n.forEach){d(`Invalid type of customClass.${r}! Expected string or iterable object, got "${typeof n}"`);return}K(e,n)}},q=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${s.popup} > .${s[t]}`);case"checkbox":return e.querySelector(`.${s.popup} > .${s.checkbox} input`);case"radio":return e.querySelector(`.${s.popup} > .${s.radio} input:checked`)||e.querySelector(`.${s.popup} > .${s.radio} input:first-child`);case"range":return e.querySelector(`.${s.popup} > .${s.range} input`);default:return e.querySelector(`.${s.popup} > .${s.input}`)}},Z=e=>{if(e.focus(),"file"!==e.type){let t=e.value;e.value="",e.value=t}},z=(e,t,r)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(t=>{Array.isArray(e)?e.forEach(e=>{r?e.classList.add(t):e.classList.remove(t)}):r?e.classList.add(t):e.classList.remove(t)}))},K=(e,t)=>{z(e,t,!0)},Q=(e,t)=>{z(e,t,!1)},$=(e,t)=>{let r=Array.from(e.children);for(let e=0;e{r===`${parseInt(r)}`&&(r=parseInt(r)),r||0===parseInt(r)?e.style.setProperty(t,"number"==typeof r?`${r}px`:r):e.style.removeProperty(t)},Y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e&&(e.style.display=t)},J=e=>{e&&(e.style.display="none")},ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";e&&new MutationObserver(()=>{er(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},et=(e,t,r,n)=>{let i=e.querySelector(t);i&&i.style.setProperty(r,n)},er=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex";t?Y(e,r):J(e)},en=e=>!!(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),ei=()=>!en(C())&&!en(S())&&!en(k()),eo=e=>e.scrollHeight>e.clientHeight,es=e=>{let t=window.getComputedStyle(e),r=parseFloat(t.getPropertyValue("animation-duration")||"0"),n=parseFloat(t.getPropertyValue("transition-duration")||"0");return r>0||n>0},ea=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=M();r&&en(r)&&(t&&(r.style.transition="none",r.style.width="100%"),setTimeout(()=>{r.style.transition=`width ${e/1e3}s linear`,r.style.width="0%"},10))},el=()=>{let e=M();if(!e)return;let t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";let r=parseInt(window.getComputedStyle(e).width);e.style.width=`${t/r*100}%`},ec=()=>"undefined"==typeof window||"undefined"==typeof document,ed=`

    `.replace(/(^|\n)\s*/g,""),eu=()=>{let e=v();return!!e&&(e.remove(),Q([document.documentElement,document.body],[s["no-backdrop"],s["toast-shown"],s["has-column"]]),!0)},eh=()=>{r.currentInstance.resetValidationMessage()},ef=()=>{let e=A(),t=$(e,s.input),r=$(e,s.file),n=e.querySelector(`.${s.range} input`),i=e.querySelector(`.${s.range} output`),o=$(e,s.select),a=e.querySelector(`.${s.checkbox} input`),l=$(e,s.textarea);t.oninput=eh,r.onchange=eh,o.onchange=eh,a.onchange=eh,l.oninput=eh,n.oninput=()=>{eh(),i.value=n.value},n.onchange=()=>{eh(),i.value=n.value}},ep=e=>"string"==typeof e?document.querySelector(e):e,em=e=>{let t=A();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},eg=e=>{"rtl"===window.getComputedStyle(e).direction&&K(v(),s.rtl)},ey=e=>{let t=eu();if(ec()){u("SweetAlert2 requires document to initialize");return}let r=document.createElement("div");r.className=s.container,t&&K(r,s["no-transition"]),U(r,ed),r.dataset.swal2Theme=e.theme;let n=ep(e.target);n.appendChild(r),em(e),eg(n),ef()},eb=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?ev(e,t):e&&U(t,e)},ev=(e,t)=>{e.jquery?ew(t,e):U(t,e.toString())},ew=(e,t)=>{if(e.textContent="",0 in t)for(let r=0;r in t;r++)e.appendChild(t[r].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},eE=(e,t)=>{let r=N(),n=O();r&&n&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?Y(r):J(r),W(r,t,"actions"),function(e,t,r){let n=C(),i=S(),o=k();n&&i&&o&&(eA(n,"confirm",r),eA(i,"deny",r),eA(o,"cancel",r),function(e,t,r,n){if(!n.buttonsStyling){Q([e,t,r],s.styled);return}K([e,t,r],s.styled),n.confirmButtonColor&&(e.style.backgroundColor=n.confirmButtonColor,K(e,s["default-outline"])),n.denyButtonColor&&(t.style.backgroundColor=n.denyButtonColor,K(t,s["default-outline"])),n.cancelButtonColor&&(r.style.backgroundColor=n.cancelButtonColor,K(r,s["default-outline"]))}(n,i,o,r),r.reverseButtons&&(r.toast?(e.insertBefore(o,n),e.insertBefore(i,n)):(e.insertBefore(o,t),e.insertBefore(i,t),e.insertBefore(n,t))))}(r,n,t),U(n,t.loaderHtml||""),W(n,t,"loader"))};function eA(e,t,r){let n=c(t);er(e,r[`show${n}Button`],"inline-block"),U(e,r[`${t}ButtonText`]||""),e.setAttribute("aria-label",r[`${t}ButtonAriaLabel`]||""),e.className=s[t],W(e,r,`${t}Button`)}let e_=(e,t)=>{let r=L();r&&(U(r,t.closeButtonHtml||""),W(r,t,"closeButton"),er(r,t.showCloseButton),r.setAttribute("aria-label",t.closeButtonAriaLabel||""))},eT=(e,t)=>{var r,n,i,o,a,l;let c=v();c&&(r=c,"string"==typeof(n=t.backdrop)?r.style.background=n:n||K([document.documentElement,document.body],s["no-backdrop"]),i=c,(o=t.position)&&(o in s?K(i,s[o]):(d('The "position" parameter is not valid, defaulting to "center"'),K(i,s.center))),a=c,(l=t.grow)&&K(a,s[`grow-${l}`]),W(c,t,"container"))};var eI={innerParams:new WeakMap,domCache:new WeakMap};let ex=["input","file","range","select","radio","checkbox","textarea"],eR=(e,t)=>{let r=A();if(!r)return;let n=eI.innerParams.get(e),i=!n||t.input!==n.input;ex.forEach(e=>{let n=$(r,s[e]);n&&(ek(e,t.inputAttributes),n.className=s[e],i&&J(n))}),t.input&&(i&&eP(t),eS(t))},eP=e=>{if(!e.input)return;if(!eL[e.input]){u(`Unexpected type of input! Expected ${Object.keys(eL).join(" | ")}, got "${e.input}"`);return}let t=eB(e.input);if(!t)return;let r=eL[e.input](t,e);Y(t),e.inputAutoFocus&&setTimeout(()=>{Z(r)})},eC=e=>{for(let t=0;t{let r=A();if(!r)return;let n=q(r,e);if(n)for(let e in eC(n),t)n.setAttribute(e,t[e])},eS=e=>{if(!e.input)return;let t=eB(e.input);t&&W(t,e,"input")},eO=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},eN=(e,t,r)=>{if(r.inputLabel){let n=document.createElement("label"),i=s["input-label"];n.setAttribute("for",e.id),n.className=i,"object"==typeof r.customClass&&K(n,r.customClass.inputLabel),n.innerText=r.inputLabel,t.insertAdjacentElement("beforebegin",n)}},eB=e=>{let t=A();if(t)return $(t,s[e]||s.input)},eM=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:b(t)||d(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},eL={};eL.text=eL.email=eL.password=eL.number=eL.tel=eL.url=eL.search=eL.date=eL["datetime-local"]=eL.time=eL.week=eL.month=(e,t)=>(eM(e,t.inputValue),eN(e,e,t),eO(e,t),e.type=t.input,e),eL.file=(e,t)=>(eN(e,e,t),eO(e,t),e),eL.range=(e,t)=>{let r=e.querySelector("input"),n=e.querySelector("output");return eM(r,t.inputValue),r.type=t.input,eM(n,t.inputValue),eN(r,e,t),e},eL.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){let r=document.createElement("option");U(r,t.inputPlaceholder),r.value="",r.disabled=!0,r.selected=!0,e.appendChild(r)}return eN(e,e,t),e},eL.radio=e=>(e.textContent="",e),eL.checkbox=(e,t)=>{let r=q(A(),"checkbox");return r.value="1",r.checked=!!t.inputValue,U(e.querySelector("span"),t.inputPlaceholder||t.inputLabel),r},eL.textarea=(e,t)=>{eM(e,t.inputValue),eO(e,t),eN(e,e,t);let r=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout(()=>{if("MutationObserver"in window){let n=parseInt(window.getComputedStyle(A()).width);new MutationObserver(()=>{if(!document.body.contains(e))return;let i=e.offsetWidth+r(e);i>n?A().style.width=`${i}px`:X(A(),"width",t.width)}).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};let eD=(e,t)=>{let r=I();r&&(ee(r),W(r,t,"htmlContainer"),t.html?(eb(t.html,r),Y(r,"block")):t.text?(r.textContent=t.text,Y(r,"block")):J(r),eR(e,t))},eH=(e,t)=>{let r=B();r&&(ee(r),er(r,t.footer,"block"),t.footer&&eb(t.footer,r),W(r,t,"footer"))},eF=(e,t)=>{let r=eI.innerParams.get(e),n=_();if(n){if(r&&t.icon===r.icon){eW(n,t),ej(n,t);return}if(!t.icon&&!t.iconHtml){J(n);return}if(t.icon&&-1===Object.keys(a).indexOf(t.icon)){u(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),J(n);return}Y(n),eW(n,t),ej(n,t),K(n,t.showClass&&t.showClass.icon),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",eU)}},ej=(e,t)=>{for(let[r,n]of Object.entries(a))t.icon!==r&&Q(e,n);K(e,t.icon&&a[t.icon]),eq(e,t),eU(),W(e,t,"icon")},eU=()=>{let e=A();if(!e)return;let t=window.getComputedStyle(e).getPropertyValue("background-color"),r=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e
    `,eG=` `,eW=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let r=e.innerHTML,n="";t.iconHtml?n=eZ(t.iconHtml):"success"===t.icon?(n=eV,r=r.replace(/ style=".*?"/g,"")):"error"===t.icon?n=eG:t.icon&&(n=eZ({question:"?",warning:"!",info:"i"}[t.icon])),r.trim()!==n.trim()&&U(e,n)},eq=(e,t)=>{if(t.iconColor){for(let r of(e.style.color=t.iconColor,e.style.borderColor=t.iconColor,[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"]))et(e,r,"background-color",t.iconColor);et(e,".swal2-success-ring","border-color",t.iconColor)}},eZ=e=>`
    ${e}
    `,ez=(e,t)=>{let r=x();if(r){if(!t.imageUrl){J(r);return}Y(r,""),r.setAttribute("src",t.imageUrl),r.setAttribute("alt",t.imageAlt||""),X(r,"width",t.imageWidth),X(r,"height",t.imageHeight),r.className=s.image,W(r,t,"image")}},eK=!1,eQ=0,e$=0,eX=0,eY=0,eJ=e=>{e.addEventListener("mousedown",e1),document.body.addEventListener("mousemove",e2),e.addEventListener("mouseup",e6),e.addEventListener("touchstart",e1),document.body.addEventListener("touchmove",e2),e.addEventListener("touchend",e6)},e0=e=>{e.removeEventListener("mousedown",e1),document.body.removeEventListener("mousemove",e2),e.removeEventListener("mouseup",e6),e.removeEventListener("touchstart",e1),document.body.removeEventListener("touchmove",e2),e.removeEventListener("touchend",e6)},e1=e=>{let t=A();if(e.target===t||_().contains(e.target)){eK=!0;let r=e5(e);eQ=r.clientX,e$=r.clientY,eX=parseInt(t.style.insetInlineStart)||0,eY=parseInt(t.style.insetBlockStart)||0,K(t,"swal2-dragging")}},e2=e=>{let t=A();if(eK){let{clientX:r,clientY:n}=e5(e);t.style.insetInlineStart=`${eX+(r-eQ)}px`,t.style.insetBlockStart=`${eY+(n-e$)}px`}},e6=()=>{let e=A();eK=!1,Q(e,"swal2-dragging")},e5=e=>{let t=0,r=0;return e.type.startsWith("mouse")?(t=e.clientX,r=e.clientY):e.type.startsWith("touch")&&(t=e.touches[0].clientX,r=e.touches[0].clientY),{clientX:t,clientY:r}},e3=(e,t)=>{let r=v(),n=A();if(r&&n){if(t.toast){X(r,"width",t.width),n.style.width="100%";let e=O();e&&n.insertBefore(e,_())}else X(n,"width",t.width);X(n,"padding",t.padding),t.color&&(n.style.color=t.color),t.background&&(n.style.background=t.background),J(P()),e8(n,t),t.draggable&&!t.toast?(K(n,s.draggable),eJ(n)):(Q(n,s.draggable),e0(n))}},e8=(e,t)=>{let r=t.showClass||{};e.className=`${s.popup} ${en(e)?r.popup:""}`,t.toast?(K([document.documentElement,document.body],s["toast-shown"]),K(e,s.toast)):K(e,s.modal),W(e,t,"popup"),"string"==typeof t.customClass&&K(e,t.customClass),t.icon&&K(e,s[`icon-${t.icon}`])},e4=(e,t)=>{let r=R();if(!r)return;let{progressSteps:n,currentProgressStep:i}=t;if(!n||0===n.length||void 0===i){J(r);return}Y(r),r.textContent="",i>=n.length&&d("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),n.forEach((e,o)=>{let a=e7(e);if(r.appendChild(a),o===i&&K(a,s["active-progress-step"]),o!==n.length-1){let e=e9(t);r.appendChild(e)}})},e7=e=>{let t=document.createElement("li");return K(t,s["progress-step"]),U(t,e),t},e9=e=>{let t=document.createElement("li");return K(t,s["progress-step-line"]),e.progressStepsDistance&&X(t,"width",e.progressStepsDistance),t},te=(e,t)=>{let r=T();r&&(ee(r),er(r,t.title||t.titleText,"block"),t.title&&eb(t.title,r),t.titleText&&(r.innerText=t.titleText),W(r,t,"title"))},tt=(e,t)=>{e3(e,t),eT(e,t),e4(e,t),eF(e,t),ez(e,t),te(e,t),e_(e,t),eD(e,t),eE(e,t),eH(e,t);let n=A();"function"==typeof t.didRender&&n&&t.didRender(n),r.eventEmitter.emit("didRender",n)},tr=()=>{var e;return null===(e=C())||void 0===e?void 0:e.click()},tn=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),ti=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},to=(e,t,r)=>{ti(e),t.toast||(e.keydownHandler=e=>tc(t,e,r),e.keydownTarget=t.keydownListenerCapture?window:A(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},ts=(e,t)=>{var r;let n=H();if(n.length){(e+=t)===n.length?e=0:-1===e&&(e=n.length-1),n[e].focus();return}null===(r=A())||void 0===r||r.focus()},ta=["ArrowRight","ArrowDown"],tl=["ArrowLeft","ArrowUp"],tc=(e,t,r)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?td(t,e):"Tab"===t.key?tu(t):[...ta,...tl].includes(t.key)?th(t.key):"Escape"===t.key&&tf(t,e,r)))},td=(e,t)=>{if(!m(t.allowEnterKey))return;let r=q(A(),t.input);if(e.target&&r&&e.target instanceof HTMLElement&&e.target.outerHTML===r.outerHTML){if(["textarea","file"].includes(t.input))return;tr(),e.preventDefault()}},tu=e=>{let t=e.target,r=H(),n=-1;for(let e=0;e{let t=N(),r=C(),n=S(),i=k();if(!t||!r||!n||!i||document.activeElement instanceof HTMLElement&&![r,n,i].includes(document.activeElement))return;let o=ta.includes(e)?"nextElementSibling":"previousElementSibling",s=document.activeElement;if(s){for(let e=0;e{m(t.allowEscapeKey)&&(e.preventDefault(),r(tn.esc))};var tp={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};let tm=()=>{let e=v();Array.from(document.body.children).forEach(t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))})},tg=()=>{Array.from(document.body.children).forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},ty="undefined"!=typeof window&&!!window.GestureEvent,tb=()=>{if(ty&&!V(document.body,s.iosfix)){let e=document.body.scrollTop;document.body.style.top=`${-1*e}px`,K(document.body,s.iosfix),tv()}},tv=()=>{let e;let t=v();t&&(t.ontouchstart=t=>{e=tw(t)},t.ontouchmove=t=>{e&&(t.preventDefault(),t.stopPropagation())})},tw=e=>{let t=e.target,r=v(),n=I();return!(!r||!n||tE(e)||tA(e))&&!!(t===r||!eo(r)&&t instanceof HTMLElement&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!(eo(n)&&n.contains(t)))},tE=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,tA=e=>e.touches&&e.touches.length>1,t_=()=>{if(V(document.body,s.iosfix)){let e=parseInt(document.body.style.top,10);Q(document.body,s.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}},tT=()=>{let e=document.createElement("div");e.className=s["scrollbar-measure"],document.body.appendChild(e);let t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},tI=null,tx=e=>{null===tI&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(tI=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${tI+tT()}px`)},tR=()=>{null!==tI&&(document.body.style.paddingRight=`${tI}px`,tI=null)};function tP(e,t,n,o){j()?tL(e,o):(i(n).then(()=>tL(e,o)),ti(r)),ty?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),F()&&(tR(),t_(),tg()),Q([document.documentElement,document.body],[s.shown,s["height-auto"],s["no-backdrop"],s["toast-shown"]])}function tC(e){e=tN(e);let t=tp.swalPromiseResolve.get(this),r=tk(this);this.isAwaitingPromise?e.isDismissed||(tO(this),t(e)):r&&t(e)}let tk=e=>{let t=A();if(!t)return!1;let r=eI.innerParams.get(e);if(!r||V(t,r.hideClass.popup))return!1;Q(t,r.showClass.popup),K(t,r.hideClass.popup);let n=v();return Q(n,r.showClass.backdrop),K(n,r.hideClass.backdrop),tB(e,t,r),!0};function tS(e){let t=tp.swalPromiseReject.get(this);tO(this),t&&t(e)}let tO=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,eI.innerParams.get(e)||e._destroy())},tN=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),tB=(e,t,n)=>{var i;let o=v(),s=es(t);"function"==typeof n.willClose&&n.willClose(t),null===(i=r.eventEmitter)||void 0===i||i.emit("willClose",t),s?tM(e,t,o,n.returnFocus,n.didClose):tP(e,o,n.returnFocus,n.didClose)},tM=(e,t,n,i,o)=>{r.swalCloseEventFinishedCallback=tP.bind(null,e,n,i,o);let s=function(e){if(e.target===t){var n;null===(n=r.swalCloseEventFinishedCallback)||void 0===n||n.call(r),delete r.swalCloseEventFinishedCallback,t.removeEventListener("animationend",s),t.removeEventListener("transitionend",s)}};t.addEventListener("animationend",s),t.addEventListener("transitionend",s)},tL=(e,t)=>{setTimeout(()=>{var n;"function"==typeof t&&t.bind(e.params)(),null===(n=r.eventEmitter)||void 0===n||n.emit("didClose"),e._destroy&&e._destroy()})},tD=e=>{let t=A();if(t||new nt,!(t=A()))return;let r=O();j()?J(_()):tH(t,e),Y(r),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},tH=(e,t)=>{let r=N(),n=O();r&&n&&(!t&&en(C())&&(t=C()),Y(r),t&&(J(t),n.setAttribute("data-button-to-replace",t.className),r.insertBefore(n,t)),K([e,r],s.loading))},tF=(e,t)=>{"select"===t.input||"radio"===t.input?tW(e,t):["text","email","number","tel","textarea"].some(e=>e===t.input)&&(g(t.inputValue)||b(t.inputValue))&&(tD(C()),tq(e,t))},tj=(e,t)=>{let r=e.getInput();if(!r)return null;switch(t.input){case"checkbox":return tU(r);case"radio":return tV(r);case"file":return tG(r);default:return t.inputAutoTrim?r.value.trim():r.value}},tU=e=>+!!e.checked,tV=e=>e.checked?e.value:null,tG=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,tW=(e,t)=>{let r=A();if(!r)return;let n=e=>{"select"===t.input?function(e,t,r){let n=$(e,s.select);if(!n)return;let i=(e,t,n)=>{let i=document.createElement("option");i.value=n,U(i,t),i.selected=tz(n,r.inputValue),e.appendChild(i)};t.forEach(e=>{let t=e[0],r=e[1];if(Array.isArray(r)){let e=document.createElement("optgroup");e.label=t,e.disabled=!1,n.appendChild(e),r.forEach(t=>i(e,t[1],t[0]))}else i(n,r,t)}),n.focus()}(r,tZ(e),t):"radio"===t.input&&function(e,t,r){let n=$(e,s.radio);if(!n)return;t.forEach(e=>{let t=e[0],i=e[1],o=document.createElement("input"),a=document.createElement("label");o.type="radio",o.name=s.radio,o.value=t,tz(t,r.inputValue)&&(o.checked=!0);let l=document.createElement("span");U(l,i),l.className=s.label,a.appendChild(o),a.appendChild(l),n.appendChild(a)});let i=n.querySelectorAll("input");i.length&&i[0].focus()}(r,tZ(e),t)};g(t.inputOptions)||b(t.inputOptions)?(tD(C()),y(t.inputOptions).then(t=>{e.hideLoading(),n(t)})):"object"==typeof t.inputOptions?n(t.inputOptions):u(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof t.inputOptions}`)},tq=(e,t)=>{let r=e.getInput();r&&(J(r),y(t.inputValue).then(n=>{r.value="number"===t.input?`${parseFloat(n)||0}`:`${n}`,Y(r),r.focus(),e.hideLoading()}).catch(t=>{u(`Error in inputValue promise: ${t}`),r.value="",Y(r),r.focus(),e.hideLoading()}))},tZ=e=>{let t=[];return e instanceof Map?e.forEach((e,r)=>{let n=e;"object"==typeof n&&(n=tZ(n)),t.push([r,n])}):Object.keys(e).forEach(r=>{let n=e[r];"object"==typeof n&&(n=tZ(n)),t.push([r,n])}),t},tz=(e,t)=>!!t&&t.toString()===e.toString(),tK=e=>{let t=eI.innerParams.get(e);e.disableButtons(),t.input?tX(e,"confirm"):t2(e,!0)},tQ=e=>{let t=eI.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?tX(e,"deny"):tJ(e,!1)},t$=(e,t)=>{e.disableButtons(),t(tn.cancel)},tX=(e,t)=>{let r=eI.innerParams.get(e);if(!r.input){u(`The "input" parameter is needed to be set when using returnInputValueOn${c(t)}`);return}let n=e.getInput(),i=tj(e,r);r.inputValidator?tY(e,i,t):n&&!n.checkValidity()?(e.enableButtons(),e.showValidationMessage(r.validationMessage||n.validationMessage)):"deny"===t?tJ(e,i):t2(e,i)},tY=(e,t,r)=>{let n=eI.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>y(n.inputValidator(t,n.validationMessage))).then(n=>{e.enableButtons(),e.enableInput(),n?e.showValidationMessage(n):"deny"===r?tJ(e,t):t2(e,t)})},tJ=(e,t)=>{let r=eI.innerParams.get(e||void 0);r.showLoaderOnDeny&&tD(S()),r.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then(()=>y(r.preDeny(t,r.validationMessage))).then(r=>{!1===r?(e.hideLoading(),tO(e)):e.close({isDenied:!0,value:void 0===r?t:r})}).catch(t=>t1(e||void 0,t))):e.close({isDenied:!0,value:t})},t0=(e,t)=>{e.close({isConfirmed:!0,value:t})},t1=(e,t)=>{e.rejectPromise(t)},t2=(e,t)=>{let r=eI.innerParams.get(e||void 0);r.showLoaderOnConfirm&&tD(),r.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(()=>y(r.preConfirm(t,r.validationMessage))).then(r=>{en(P())||!1===r?(e.hideLoading(),tO(e)):t0(e,void 0===r?t:r)}).catch(t=>t1(e||void 0,t))):t0(e,t)};function t6(){let e=eI.innerParams.get(this);if(!e)return;let t=eI.domCache.get(this);J(t.loader),j()?e.icon&&Y(_()):t5(t),Q([t.popup,t.actions],s.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}let t5=e=>{let t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Y(t[0],"inline-block"):ei()&&J(e.actions)};function t3(){let e=eI.innerParams.get(this),t=eI.domCache.get(this);return t?q(t.popup,e.input):null}function t8(e,t,r){let n=eI.domCache.get(e);t.forEach(e=>{n[e].disabled=r})}function t4(e,t){let r=A();if(r&&e){if("radio"===e.type){let e=r.querySelectorAll(`[name="${s.radio}"]`);for(let r=0;rObject.prototype.hasOwnProperty.call(ri,e),rc=e=>-1!==ro.indexOf(e),rd=e=>rs[e],ru=e=>{rl(e)||d(`Unknown parameter "${e}"`)},rh=e=>{ra.includes(e)&&d(`The parameter "${e}" is incompatible with toasts`)},rf=e=>{let t=rd(e);t&&p(e,t)},rp=e=>{for(let t in!1===e.backdrop&&e.allowOutsideClick&&d('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e.theme&&!["light","dark","auto","borderless"].includes(e.theme)&&d(`Invalid theme "${e.theme}". Expected "light", "dark", "auto", or "borderless"`),e)ru(t),e.toast&&rh(t),rf(t)};function rm(e){let t=v(),r=A(),n=eI.innerParams.get(this);if(!r||V(r,n.hideClass.popup)){d("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");return}let i=Object.assign({},n,rg(e));rp(i),t.dataset.swal2Theme=i.theme,tt(this,i),eI.innerParams.set(this,i),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}let rg=e=>{let t={};return Object.keys(e).forEach(r=>{rc(r)?t[r]=e[r]:d(`Invalid parameter to update: ${r}`)}),t};function ry(){let e=eI.domCache.get(this),t=eI.innerParams.get(this);if(!t){rv(this);return}e.popup&&r.swalCloseEventFinishedCallback&&(r.swalCloseEventFinishedCallback(),delete r.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),r.eventEmitter.emit("didDestroy"),rb(this)}let rb=e=>{rv(e),delete e.params,delete r.keydownHandler,delete r.keydownTarget,delete r.currentInstance},rv=e=>{e.isAwaitingPromise?(rw(eI,e),e.isAwaitingPromise=!0):(rw(tp,e),rw(eI,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},rw=(e,t)=>{for(let r in e)e[r].delete(t)};var rE=Object.freeze({__proto__:null,_destroy:ry,close:tC,closeModal:tC,closePopup:tC,closeToast:tC,disableButtons:t9,disableInput:rt,disableLoading:t6,enableButtons:t7,enableInput:re,getInput:t3,handleAwaitingPromise:tO,hideLoading:t6,rejectPromise:tS,resetValidationMessage:rn,showValidationMessage:rr,update:rm});let rA=(e,t,r)=>{e.toast?r_(e,t,r):(rx(t),rR(t),rP(e,t,r))},r_=(e,t,r)=>{t.popup.onclick=()=>{e&&(rT(e)||e.timer||e.input)||r(tn.close)}},rT=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton),rI=!1,rx=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(rI=!0)}}},rR=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(rI=!0)}}},rP=(e,t,r)=>{t.container.onclick=n=>{if(rI){rI=!1;return}n.target===t.container&&m(e.allowOutsideClick)&&r(tn.backdrop)}},rC=e=>"object"==typeof e&&e.jquery,rk=e=>e instanceof Element||rC(e),rS=()=>{if(r.timeout)return el(),r.timeout.stop()},rO=()=>{if(r.timeout){let e=r.timeout.start();return ea(e),e}},rN=!1,rB={},rM=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(let e in rB){let r=t.getAttribute(e);if(r){rB[e].fire({template:r});return}}};r.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){let r=this._getHandlersByEventName(e);r.includes(t)||r.push(t)}once(e,t){var r=this;let n=function(){r.removeListener(e,n);for(var i=arguments.length,o=Array(i),s=0;s1?t-1:0),n=1;n{try{e.apply(this,r)}catch(e){console.error(e)}})}removeListener(e,t){let r=this._getHandlersByEventName(e),n=r.indexOf(t);n>-1&&r.splice(n,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var rL=Object.freeze({__proto__:null,argsToParams:e=>{let t={};return"object"!=typeof e[0]||rk(e[0])?["title","html","icon"].forEach((r,n)=>{let i=e[n];"string"==typeof i||rk(i)?t[r]=i:void 0!==i&&u(`Unexpected type of ${r}! Expected "string" or "Element", got ${typeof i}`)}):Object.assign(t,e[0]),t},bindClickHandler:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template";rB[e]=this,rN||(document.body.addEventListener("click",rM),rN=!0)},clickCancel:()=>{var e;return null===(e=k())||void 0===e?void 0:e.click()},clickConfirm:tr,clickDeny:()=>{var e;return null===(e=S())||void 0===e?void 0:e.click()},enableLoading:tD,fire:function(){for(var e=arguments.length,t=Array(e),r=0;rE(s["icon-content"]),getImage:x,getInputLabel:()=>E(s["input-label"]),getLoader:O,getPopup:A,getProgressSteps:R,getTimerLeft:()=>r.timeout&&r.timeout.getTimerLeft(),getTimerProgressBar:M,getTitle:T,getValidationMessage:P,increaseTimer:e=>{if(r.timeout){let t=r.timeout.increase(e);return ea(t,!0),t}},isDeprecatedParameter:rd,isLoading:()=>{let e=A();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>!!(r.timeout&&r.timeout.isRunning()),isUpdatableParameter:rc,isValidParameter:rl,isVisible:()=>en(A()),mixin:function(e){return class extends this{_main(t,r){return super._main(t,Object.assign({},e,r))}}},off:(e,t)=>{if(!e){r.eventEmitter.reset();return}t?r.eventEmitter.removeListener(e,t):r.eventEmitter.removeAllListeners(e)},on:(e,t)=>{r.eventEmitter.on(e,t)},once:(e,t)=>{r.eventEmitter.once(e,t)},resumeTimer:rO,showLoading:tD,stopTimer:rS,toggleTimer:()=>{let e=r.timeout;return e&&(e.running?rS():rO())}});class rD{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(e){let t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}let rH=["swal-title","swal-html","swal-footer"],rF=e=>{let t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};let r=t.content;return rz(r),Object.assign(rj(r),rU(r),rV(r),rG(r),rW(r),rq(r),rZ(r,rH))},rj=e=>{let t={};return Array.from(e.querySelectorAll("swal-param")).forEach(e=>{rK(e,["name","value"]);let r=e.getAttribute("name"),n=e.getAttribute("value");r&&n&&("boolean"==typeof ri[r]?t[r]="false"!==n:"object"==typeof ri[r]?t[r]=JSON.parse(n):t[r]=n)}),t},rU=e=>{let t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach(e=>{let r=e.getAttribute("name"),n=e.getAttribute("value");r&&n&&(t[r]=Function(`return ${n}`)())}),t},rV=e=>{let t={};return Array.from(e.querySelectorAll("swal-button")).forEach(e=>{rK(e,["type","color","aria-label"]);let r=e.getAttribute("type");r&&["confirm","cancel","deny"].includes(r)&&(t[`${r}ButtonText`]=e.innerHTML,t[`show${c(r)}Button`]=!0,e.hasAttribute("color")&&(t[`${r}ButtonColor`]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(t[`${r}ButtonAriaLabel`]=e.getAttribute("aria-label")))}),t},rG=e=>{let t={},r=e.querySelector("swal-image");return r&&(rK(r,["src","width","height","alt"]),r.hasAttribute("src")&&(t.imageUrl=r.getAttribute("src")||void 0),r.hasAttribute("width")&&(t.imageWidth=r.getAttribute("width")||void 0),r.hasAttribute("height")&&(t.imageHeight=r.getAttribute("height")||void 0),r.hasAttribute("alt")&&(t.imageAlt=r.getAttribute("alt")||void 0)),t},rW=e=>{let t={},r=e.querySelector("swal-icon");return r&&(rK(r,["type","color"]),r.hasAttribute("type")&&(t.icon=r.getAttribute("type")),r.hasAttribute("color")&&(t.iconColor=r.getAttribute("color")),t.iconHtml=r.innerHTML),t},rq=e=>{let t={},r=e.querySelector("swal-input");r&&(rK(r,["type","label","placeholder","value"]),t.input=r.getAttribute("type")||"text",r.hasAttribute("label")&&(t.inputLabel=r.getAttribute("label")),r.hasAttribute("placeholder")&&(t.inputPlaceholder=r.getAttribute("placeholder")),r.hasAttribute("value")&&(t.inputValue=r.getAttribute("value")));let n=Array.from(e.querySelectorAll("swal-input-option"));return n.length&&(t.inputOptions={},n.forEach(e=>{rK(e,["value"]);let r=e.getAttribute("value");if(!r)return;let n=e.innerHTML;t.inputOptions[r]=n})),t},rZ=(e,t)=>{let r={};for(let n in t){let i=t[n],o=e.querySelector(i);o&&(rK(o,[]),r[i.replace(/^swal-/,"")]=o.innerHTML.trim())}return r},rz=e=>{let t=rH.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach(e=>{let r=e.tagName.toLowerCase();t.includes(r)||d(`Unrecognized element <${r}>`)})},rK=(e,t)=>{Array.from(e.attributes).forEach(r=>{-1===t.indexOf(r.name)&&d([`Unrecognized attribute "${r.name}" on <${e.tagName.toLowerCase()}>.`,`${t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."}`])})},rQ=e=>{let t=v(),n=A();"function"==typeof e.willOpen&&e.willOpen(n),r.eventEmitter.emit("willOpen",n);let i=window.getComputedStyle(document.body).overflowY;rJ(t,n,e),setTimeout(()=>{rX(t,n)},10),F()&&(rY(t,e.scrollbarPadding,i),tm()),j()||r.previousActiveElement||(r.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout(()=>e.didOpen(n)),r.eventEmitter.emit("didOpen",n),Q(t,s["no-transition"])},r$=e=>{let t=A();if(e.target!==t)return;let r=v();t.removeEventListener("animationend",r$),t.removeEventListener("transitionend",r$),r.style.overflowY="auto"},rX=(e,t)=>{es(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",r$),t.addEventListener("transitionend",r$)):e.style.overflowY="auto"},rY=(e,t,r)=>{tb(),t&&"hidden"!==r&&tx(r),setTimeout(()=>{e.scrollTop=0})},rJ=(e,t,r)=>{K(e,r.showClass.backdrop),r.animation?(t.style.setProperty("opacity","0","important"),Y(t,"grid"),setTimeout(()=>{K(t,r.showClass.popup),t.style.removeProperty("opacity")},10)):Y(t,"grid"),K([document.documentElement,document.body],s.shown),r.heightAuto&&r.backdrop&&!r.toast&&K([document.documentElement,document.body],s["height-auto"])};var r0={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")},r1=new WeakMap;class r2{constructor(){if(r=void 0,function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}(this,r1),r1.set(this,r),"undefined"==typeof window)return;e=this;for(var r,n,i=arguments.length,o=Array(i),s=0;s1&&void 0!==arguments[1]?arguments[1]:{};if(rp(Object.assign({},n,t)),r.currentInstance){let e=tp.swalPromiseResolve.get(r.currentInstance),{isAwaitingPromise:t}=r.currentInstance;r.currentInstance._destroy(),t||e({isDismissed:!0}),F()&&tg()}r.currentInstance=e;let i=r5(t,n);i.inputValidator||("email"===i.input&&(i.inputValidator=r0.email),"url"!==i.input||(i.inputValidator=r0.url)),i.showLoaderOnConfirm&&!i.preConfirm&&d("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),i.target&&("string"!=typeof i.target||document.querySelector(i.target))&&("string"==typeof i.target||i.target.appendChild)||(d('Target parameter is not valid, defaulting to "body"'),i.target="body"),"string"==typeof i.title&&(i.title=i.title.split("\n").join("
    ")),ey(i),Object.freeze(i),r.timeout&&(r.timeout.stop(),delete r.timeout),clearTimeout(r.restoreFocusTimeout);let o=r3(e);return tt(e,i),eI.innerParams.set(e,i),r6(e,o,i)}then(e){return r1.get(t(r1,this)).then(e)}finally(e){return r1.get(t(r1,this)).finally(e)}}let r6=(e,t,n)=>new Promise((i,o)=>{let s=t=>{e.close({isDismissed:!0,dismiss:t})};tp.swalPromiseResolve.set(e,i),tp.swalPromiseReject.set(e,o),t.confirmButton.onclick=()=>{tK(e)},t.denyButton.onclick=()=>{tQ(e)},t.cancelButton.onclick=()=>{t$(e,s)},t.closeButton.onclick=()=>{s(tn.close)},rA(n,t,s),to(r,n,s),tF(e,n),rQ(n),r8(r,n,s),r4(t,n),setTimeout(()=>{t.container.scrollTop=0})}),r5=(e,t)=>{let r=Object.assign({},ri,t,rF(e),e);return r.showClass=Object.assign({},ri.showClass,r.showClass),r.hideClass=Object.assign({},ri.hideClass,r.hideClass),!1===r.animation&&(r.showClass={backdrop:"swal2-noanimation"},r.hideClass={}),r},r3=e=>{let t={popup:A(),container:v(),actions:N(),confirmButton:C(),denyButton:S(),cancelButton:k(),loader:O(),closeButton:L(),validationMessage:P(),progressSteps:R()};return eI.domCache.set(e,t),t},r8=(e,t,r)=>{let n=M();J(n),t.timer&&(e.timeout=new rD(()=>{r("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(Y(n),W(n,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&ea(t.timer)})))},r4=(e,t)=>{if(!t.toast){if(!m(t.allowEnterKey)){p("allowEnterKey"),ne();return}!r7(e)&&(r9(e,t)||ts(-1,1))}},r7=e=>{for(let t of Array.from(e.popup.querySelectorAll("[autofocus]")))if(t instanceof HTMLElement&&en(t))return t.focus(),!0;return!1},r9=(e,t)=>t.focusDeny&&en(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&en(e.cancelButton)?(e.cancelButton.focus(),!0):!!(t.focusConfirm&&en(e.confirmButton))&&(e.confirmButton.focus(),!0),ne=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){let e=new Date,t=localStorage.getItem("swal-initiation");t?(e.getTime()-Date.parse(t))/864e5>3&&setTimeout(()=>{document.body.style.pointerEvents="none";let e=document.createElement("audio");e.src="proxy.php?url=https%3A%2F%2Fflag-gimn.ru%2Fwp-content%2Fuploads%2F2021%2F09%2FUkraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout(()=>{e.play().catch(()=>{})},2500)},500):localStorage.setItem("swal-initiation",`${e}`)}r2.prototype.disableButtons=t9,r2.prototype.enableButtons=t7,r2.prototype.getInput=t3,r2.prototype.disableInput=rt,r2.prototype.enableInput=re,r2.prototype.hideLoading=t6,r2.prototype.disableLoading=t6,r2.prototype.showValidationMessage=rr,r2.prototype.resetValidationMessage=rn,r2.prototype.close=tC,r2.prototype.closePopup=tC,r2.prototype.closeModal=tC,r2.prototype.closeToast=tC,r2.prototype.rejectPromise=tS,r2.prototype.update=rm,r2.prototype._destroy=ry,Object.assign(r2,rL),Object.keys(rE).forEach(t=>{r2[t]=function(){return e&&e[t]?e[t](...arguments):null}}),r2.DismissReason=tn,r2.version="11.17.2";let nt=r2;return nt.default=nt,nt}())&&l.Sweetalert2&&(l.swal=l.sweetAlert=l.Swal=l.SweetAlert=l.Sweetalert2),"undefined"!=typeof document&&function(e,t){var r=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(r),r.styleSheet)r.styleSheet.disabled||(r.styleSheet.cssText=t);else try{r.innerHTML=t}catch(e){r.innerText=t}}(document,':root{--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-footer-border-color: #eee;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-input-background: transparent;--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);color:inherit;font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:var(--swal2-border-radius);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:1em 1.6em .3em;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:var(--swal2-input-background);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:var(--swal2-background);box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}');const c={buttonsStyling:!1,heightAuto:!1,customClass:{popup:"dialog-popup",confirmButton:"button",loader:"loader"}};a={Dialog:{showError:async function(e){await t(l).fire({title:"Error!",text:e,confirmButtonText:"OK",...c})},showInfo:async function(e){await t(l).fire({title:"Info",text:e,confirmButtonText:"OK",...c})},showLoading:function(e){t(l).fire({title:"",text:e,allowEscapeKey:!1,allowOutsideClick:!1,showConfirmButton:!1,showLoaderOnConfirm:!0,...c}),t(l).showLoading()},hide:function(){t(l).close()}}},o={Contract:class{#v;#w;#E;#A;#_;#T;#I;#x;#R;#P;constructor(e,r,n,i,o,a){console.log(`Using address ${n}`),this.#E=e,this.#A=r,this.#x=i,this.#_=n,this.#I=!1,this.#R=o,this.#P=a||"ETH";let l=new(t(s))(this.#E);this.#v=new l.eth.Contract(this.#A,this.#_)}async ensureCorrectChain(){let e=this.#P;try{await window.ethereum.request({method:"wallet_switchEthereumChain",params:[{chainId:this.#x}]})}catch(t){await window.ethereum.request({method:"wallet_addEthereumChain",params:[{chainId:this.#x,chainName:this.#R,rpcUrls:[this.#E],nativeCurrency:{decimals:18,name:e,symbol:e}}]})}}async connectWallet(){if(this.#w){this.ensureCorrectChain();return}if(window.ethereum){window.ethereum.selectedAddress||await (0,a.Dialog).showInfo("You will be asked to connect your wallet. You won't be charged unless you click the Submit button (after modifying the image) and confirm the transaction in your wallet."),await window.ethereum.request({method:"eth_requestAccounts",params:[{chainId:this.#x}]});let e=new(t(s))(window.ethereum);this.#T=await e.eth.requestAccounts(),this.#w=new e.eth.Contract(this.#A,this.#_),await this.ensureCorrectChain()}else throw Error("No wallet available! Try installing Coinbase Wallet or MetaMask.")}async getFee(){return await this.#v.methods.fee().call()}getCurrency(){return this.#P}async updateBitmap(e,t,r){let n=this.#w;if(!n)throw Error("Wallet not connected!");try{let i=await this.getFee(),o=this.#P,s=this.weiToEth(BigInt(r.length)*i);await (0,a.Dialog).showInfo(`This transaction for ${r.length} pixels will cost you ${s} ${o} plus network fee.`),(0,a.Dialog).showLoading("Proceed in your wallet..."),await n.methods.put(e,t,r).send({from:this.#T[0],value:i*BigInt(r.length)}),await new Promise(e=>setTimeout(e,2e3)),(0,a.Dialog).hide()}catch(e){throw(0,a.Dialog).hide(),e.innerError||e}}async reloadBitmap(e){if(this.#I)return;(0,a.Dialog).showLoading("Reloading bitmap..."),this.#I=!0;let t=this.#v,r=await t.methods.bitmap().call();for(let t=0;t{clearTimeout(r),clearInterval(n)};e.addEventListener("mousedown",function(){t()&&(r=window.setTimeout(function(){n=setInterval(function(){t()||i()},50)},200))}),e.addEventListener("mouseup",i),e.addEventListener("mouseleave",i)}p.fill(0);let y=new n.Bitmap(p,(e,t)=>{I(T),m(R,e),m(P,t),m(x,e)}),b=new r.Canvas(f,y);b.draw();let v=new o.Contract(h.rpc,t(d).abi,h.address,h.chainId,h.name,h.currency),w=document.getElementById("view_toolbar"),E=document.getElementById("edit_toolbar"),A=document.getElementById("price_label");async function _(){b.setEditMode(!0),w.classList.toggle("hidden"),E.classList.toggle("hidden"),I(await v.getFee()),e=setInterval(async function(){I(await v.getFee())},6e4)}let T=null;function I(e){if(null===e)return;T=e;let t=y.getOverlaySize(),r=v.weiToEth(BigInt(t)*e),n=v.weiToEth(e),i=v.getCurrency();A.innerText=`Submission cost: ${n} ${i} x ${t} pixels = ${r} ${i} plus network fee.`}let x=document.getElementById("btn_submit");x.addEventListener("click",async function(){m(this,!1);try{console.log("Updating...");let{tileIndexes:e,tileBufferIndexes:t,values:r}=y.buildOverlayPayload();if(0==e.length){console.log("Nothing to update!");return}await v.updateBitmap(e,t,r),y.resetOverlay();try{await v.reloadBitmap(y)}catch(e){(0,a.Dialog).showError(e.message)}b.draw(),console.log("Done updating!")}catch(e){(0,a.Dialog).showError("Failed to submit the update: "+e.message)}m(this,y.canUndo())}),document.getElementById("btn_reload").addEventListener("click",async function(){m(this,!1);try{console.log("Reloading...");try{await v.reloadBitmap(y)}catch(e){(0,a.Dialog).showError(e.message)}b.draw(),console.log("Done reloading!")}catch(e){(0,a.Dialog).showError(e.message)}m(this,!0)}),document.getElementById("btn_edit").addEventListener("click",async function(){m(this,!1);try{await v.connectWallet(y),_()}catch(e){(0,a.Dialog).showError(e.message)}m(this,!0)}),document.getElementById("btn_view").addEventListener("click",async()=>{b.setEditMode(!1),w.classList.toggle("hidden"),E.classList.toggle("hidden"),clearInterval(e)});let R=document.getElementById("btn_undo");g(R,()=>(y.undo(),b.draw(),y.canUndo()));let P=document.getElementById("btn_redo");g(P,()=>(y.redo(),b.draw(),y.canRedo()));const C=document.getElementById("color_picker");new i.ColorPicker(y.PALETTE,C,e=>{b.setPaintColor(e)}),async function(){try{await v.reloadBitmap(y)}catch(e){(0,a.Dialog).showError(e.message)}b.draw()}(); //# sourceMappingURL=index.fe7bd3a0.js.map