superstack-wallet-sdk 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/src/client.js +1 -1
- package/dist/esm/src/client.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const wl=BigInt(0),vl=BigInt(1);function xl(e,t){const n=t.negate();return e?n:t
|
|
|
9
9
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $l(e){void 0!==e.lowS&&Qs("lowS",e.lowS),void 0!==e.prehash&&Qs("prehash",e.prehash)}class Bl extends Error{constructor(e=""){super(e)}}const Cl={Err:Bl,_tlv:{encode:(e,t)=>{const{Err:n}=Cl;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(1&t.length)throw new n("tlv.encode: unpadded data");const r=t.length/2,o=Xs(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Xs(o.length/2|128):"";return Xs(e)+s+o+t},decode(e,t){const{Err:n}=Cl;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const o=t[r++];let s=0;if(!!(128&o)){const e=127&o;if(!e)throw new n("tlv.decode(long): indefinite length not supported");if(e>4)throw new n("tlv.decode(long): byte length is too big");const a=t.subarray(r,r+e);if(a.length!==e)throw new n("tlv.decode: length bytes not complete");if(0===a[0])throw new n("tlv.decode(long): zero leftmost byte");for(const e of a)s=s<<8|e;if(r+=e,s<128)throw new n("tlv.decode(long): not minimal encoding")}else s=o;const a=t.subarray(r,r+s);if(a.length!==s)throw new n("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+s)}}},_int:{encode(e){const{Err:t}=Cl;if(e<Rl)throw new t("integer: negative integers are not allowed");let n=Xs(e);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=Cl;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return fa(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=Cl,o=ga("signature",e),{v:s,l:a}=r.decode(48,o);if(a.length)throw new t("invalid signature: left bytes after parsing");const{v:i,l:c}=r.decode(2,s),{v:u,l:l}=r.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(i),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=Cl,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}};function Ol(e,t){return ra(pa(e,t))}const Rl=BigInt(0),zl=BigInt(1);BigInt(2);const _l=BigInt(3),Ml=BigInt(4);function Fl(e){const t=function(e){const t=Tl(e);Aa(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:n}=t,r=gl(t.n,t.nBitLength),o=t.toBytes||((e,t,r)=>{const o=t.toAffine();return ba(Uint8Array.from([4]),n.toBytes(o.x),n.toBytes(o.y))}),s=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function a(e){const{a:r,b:o}=t,s=n.sqr(e),a=n.mul(s,e);return n.add(n.add(a,n.mul(e,r)),o)}function i(e,t){const r=n.sqr(t),o=a(e);return n.eql(r,o)}if(!i(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const c=n.mul(n.pow(t.a,_l),Ml),u=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(c,u)))throw new Error("bad curve params: a or b");function l(e){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:o,n:s}=t;if(n&&"bigint"!=typeof e){if(Ks(e)&&(e=ra(e)),"string"!=typeof e||!n.includes(e.length))throw new Error("invalid private key");e=e.padStart(2*r,"0")}let a;try{a="bigint"==typeof e?e:fa(ga("private key",e,r))}catch(t){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof e)}return o&&(a=al(a,s)),va("private key",a,zl,s),a}function d(e){if(!(e instanceof p))throw new Error("ProjectivePoint expected")}const f=Ia((e,t)=>{const{px:r,py:o,pz:s}=e;if(n.eql(s,n.ONE))return{x:r,y:o};const a=e.is0();null==t&&(t=a?n.ONE:n.inv(s));const i=n.mul(r,t),c=n.mul(o,t),u=n.mul(s,t);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:i,y:c}}),h=Ia(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.py))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=e.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not FE");if(!i(r,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class p{constructor(e,t,r){if(null==e||!n.isValid(e))throw new Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof p)throw new Error("projective point not allowed");const o=e=>n.eql(e,n.ZERO);return o(t)&&o(r)?p.ZERO:new p(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=hl(n,e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(p.fromAffine)}static fromHex(e){const t=p.fromAffine(s(ga("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return p.BASE.multiply(l(e))}static msm(e,t){return Sl(p,r,e,t)}_setWindowSize(e){b.setWindowSize(this,e)}assertValidity(){h(this)}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){d(e);const{px:t,py:r,pz:o}=this,{px:s,py:a,pz:i}=e,c=n.eql(n.mul(t,i),n.mul(s,o)),u=n.eql(n.mul(r,i),n.mul(a,o));return c&&u}negate(){return new p(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,o=n.mul(r,_l),{px:s,py:a,pz:i}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,d=n.mul(s,s),f=n.mul(a,a),h=n.mul(i,i),m=n.mul(s,a);return m=n.add(m,m),l=n.mul(s,i),l=n.add(l,l),c=n.mul(e,l),u=n.mul(o,h),u=n.add(c,u),c=n.sub(f,u),u=n.add(f,u),u=n.mul(c,u),c=n.mul(m,c),l=n.mul(o,l),h=n.mul(e,h),m=n.sub(d,h),m=n.mul(e,m),m=n.add(m,l),l=n.add(d,d),d=n.add(l,d),d=n.add(d,h),d=n.mul(d,m),u=n.add(u,d),h=n.mul(a,i),h=n.add(h,h),d=n.mul(h,m),c=n.sub(c,d),l=n.mul(h,f),l=n.add(l,l),l=n.add(l,l),new p(c,u,l)}add(e){d(e);const{px:r,py:o,pz:s}=this,{px:a,py:i,pz:c}=e;let u=n.ZERO,l=n.ZERO,f=n.ZERO;const h=t.a,m=n.mul(t.b,_l);let g=n.mul(r,a),b=n.mul(o,i),y=n.mul(s,c),w=n.add(r,o),v=n.add(a,i);w=n.mul(w,v),v=n.add(g,b),w=n.sub(w,v),v=n.add(r,s);let x=n.add(a,c);return v=n.mul(v,x),x=n.add(g,y),v=n.sub(v,x),x=n.add(o,s),u=n.add(i,c),x=n.mul(x,u),u=n.add(b,y),x=n.sub(x,u),f=n.mul(h,v),u=n.mul(m,y),f=n.add(u,f),u=n.sub(b,f),f=n.add(b,f),l=n.mul(u,f),b=n.add(g,g),b=n.add(b,g),y=n.mul(h,y),v=n.mul(m,v),b=n.add(b,y),y=n.sub(g,y),y=n.mul(h,y),v=n.add(v,y),g=n.mul(b,v),l=n.add(l,g),g=n.mul(x,v),u=n.mul(w,u),u=n.sub(u,g),g=n.mul(w,b),f=n.mul(x,f),f=n.add(f,g),new p(u,l,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(p.ZERO)}wNAF(e){return b.wNAFCached(this,e,p.normalizeZ)}multiplyUnsafe(e){const{endo:r,n:o}=t;va("scalar",e,Rl,o);const s=p.ZERO;if(e===Rl)return s;if(this.is0()||e===zl)return this;if(!r||b.hasPrecomputes(this))return b.wNAFCachedUnsafe(this,e,p.normalizeZ);let{k1neg:a,k1:i,k2neg:c,k2:u}=r.splitScalar(e),l=s,d=s,f=this;for(;i>Rl||u>Rl;)i&zl&&(l=l.add(f)),u&zl&&(d=d.add(f)),f=f.double(),i>>=zl,u>>=zl;return a&&(l=l.negate()),c&&(d=d.negate()),d=new p(n.mul(d.px,r.beta),d.py,d.pz),l.add(d)}multiply(e){const{endo:r,n:o}=t;let s,a;if(va("scalar",e,zl,o),r){const{k1neg:t,k1:o,k2neg:i,k2:c}=r.splitScalar(e);let{p:u,f:l}=this.wNAF(o),{p:d,f:f}=this.wNAF(c);u=b.constTimeNegate(t,u),d=b.constTimeNegate(i,d),d=new p(n.mul(d.px,r.beta),d.py,d.pz),s=u.add(d),a=l.add(f)}else{const{p:t,f:n}=this.wNAF(e);s=t,a=n}return p.normalizeZ([s,a])[0]}multiplyAndAddUnsafe(e,t,n){const r=p.BASE,o=(e,t)=>t!==Rl&&t!==zl&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),s=o(this,t).add(o(e,n));return s.is0()?void 0:s}toAffine(e){return f(this,e)}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===zl)return!0;if(n)return n(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===zl?this:n?n(p,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return Qs("isCompressed",e),this.assertValidity(),o(p,this,e)}toHex(e=!0){return Qs("isCompressed",e),ra(this.toRawBytes(e))}}p.BASE=new p(t.Gx,t.Gy,n.ONE),p.ZERO=new p(n.ZERO,n.ONE,n.ZERO);const{endo:m,nBitLength:g}=t,b=(y=p,w=m?Math.ceil(g/2):g,{constTimeNegate:xl,hasPrecomputes:e=>1!==Nl(e),unsafeLadder(e,t,n=y.ZERO){let r=e;for(;t>wl;)t&vl&&(n=n.add(r)),r=r.double(),t>>=vl;return n},precomputeWindow(e,t){const{windows:n,windowSize:r}=Pl(t,w),o=[];let s=e,a=s;for(let e=0;e<n;e++){a=s,o.push(a);for(let e=1;e<r;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(e,t,n){let r=y.ZERO,o=y.BASE;const s=Pl(e,w);for(let e=0;e<s.windows;e++){const{nextN:a,offset:i,isZero:c,isNeg:u,isNegF:l,offsetF:d}=kl(n,e,s);n=a,c?o=o.add(xl(l,t[d])):r=r.add(xl(u,t[i]))}return{p:r,f:o}},wNAFUnsafe(e,t,n,r=y.ZERO){const o=Pl(e,w);for(let e=0;e<o.windows&&n!==wl;e++){const{nextN:s,offset:a,isZero:i,isNeg:c}=kl(n,e,o);if(n=s,!i){const e=t[a];r=r.add(c?e.negate():e)}}return r},getPrecomputes(e,t,n){let r=Al.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&Al.set(t,n(r))),r},wNAFCached(e,t,n){const r=Nl(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const o=Nl(e);return 1===o?this.unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)},setWindowSize(e,t){El(t,w),Il.set(e,t),Al.delete(e)}});var y,w;return{CURVE:t,ProjectivePoint:p,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function(e){return wa(e,zl,t.n)}}}function jl(e){const t=function(e){const t=Tl(e);return Aa(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,a=n.BYTES+1,i=2*n.BYTES+1;function c(e){return al(e,r)}function u(e){return cl(e,r)}const{ProjectivePoint:l,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=Fl({...t,toBytes(e,t,r){const o=t.toAffine(),s=n.toBytes(o.x),a=ba;return Qs("isCompressed",r),r?a(Uint8Array.from([t.hasEvenY()?2:3]),s):a(Uint8Array.from([4]),s,n.toBytes(o.y))},fromBytes(e){const t=e.length,r=e[0],o=e.subarray(1);if(t!==a||2!==r&&3!==r){if(t===i&&4===r){return{x:n.fromBytes(o.subarray(0,n.BYTES)),y:n.fromBytes(o.subarray(n.BYTES,2*n.BYTES))}}throw new Error("invalid Point, expected length of "+a+", or uncompressed "+i+", got "+t)}{const e=fa(o);if(!wa(e,zl,n.ORDER))throw new Error("Point is not on curve");const t=f(e);let s;try{s=n.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("Point is not on curve"+t)}return!(1&~r)!==((s&zl)===zl)&&(s=n.neg(s)),{x:e,y:s}}}});function p(e){return e>r>>zl}const m=(e,t,n)=>fa(e.slice(t,n));class g{constructor(e,t,n){va("r",e,zl,r),va("s",t,zl,r),this.r=e,this.s=t,null!=n&&(this.recovery=n),Object.freeze(this)}static fromCompact(e){const t=o;return e=ga("compactSignature",e,2*t),new g(m(e,0,t),m(e,t,2*t))}static fromDER(e){const{r:t,s:n}=Cl.toSig(ga("DER",e));return new g(t,n)}assertValidity(){}addRecoveryBit(e){return new g(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:o,recovery:s}=this,a=v(ga("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw new Error("recovery id invalid");const i=2===s||3===s?r+t.n:r;if(i>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=1&s?"03":"02",f=l.fromHex(d+Ol(i,n.BYTES)),h=u(i),p=c(-a*h),m=c(o*h),g=l.BASE.multiplyAndAddUnsafe(f,p,m);if(!g)throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return da(this.toDERHex())}toDERHex(){return Cl.hexFromSig(this)}toCompactRawBytes(){return da(this.toCompactHex())}toCompactHex(){const e=o;return Ol(this.r,e)+Ol(this.s,e)}}const b={isValidPrivateKey(e){try{return d(e),!0}catch(e){return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const e=yl(t.n);return function(e,t,n=!1){const r=e.length,o=bl(t),s=yl(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const a=al(n?ha(e):fa(e),t-el)+el;return n?ma(a,o):pa(a,o)}(t.randomBytes(e),t.n)},precompute:(e=8,t=l.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){if("bigint"==typeof e)return!1;if(e instanceof l)return!0;const r=ga("key",e).length,s=n.BYTES,a=s+1,i=2*s+1;return t.allowedPrivateKeyLengths||o===a?void 0:r===a||r===i}const w=t.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=fa(e),n=8*e.length-s;return n>0?t>>BigInt(n):t},v=t.bits2int_modN||function(e){return c(w(e))},x=xa(s);function E(e){return va("num < 2^"+s,e,Rl,x),pa(e,o)}function P(e,r,o=k){if(["recovered","canonical"].some(e=>e in o))throw new Error("sign() legacy options not supported");const{hash:s,randomBytes:a}=t;let{lowS:i,prehash:f,extraEntropy:m}=o;null==i&&(i=!0),e=ga("msgHash",e),$l(o),f&&(e=ga("prehashed msgHash",s(e)));const b=v(e),y=d(r),x=[E(y),E(b)];if(null!=m&&!1!==m){const e=!0===m?a(n.BYTES):m;x.push(ga("extraEntropy",e))}const P=ba(...x),A=b;return{seed:P,k2sig:function(e){const t=w(e);if(!h(t))return;const n=u(t),r=l.BASE.multiply(t).toAffine(),o=c(r.x);if(o===Rl)return;const s=c(n*c(A+o*y));if(s===Rl)return;let a=(r.x===o?0:2)|Number(r.y&zl),d=s;return i&&p(s)&&(d=function(e){return p(e)?c(-e):e}(s),a^=1),new g(o,d,a)}}}const k={lowS:t.lowS,prehash:!1},A={lowS:t.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return l.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,n=!0){if(!0===y(e))throw new Error("first arg must be private key");if(!1===y(t))throw new Error("second arg must be public key");return l.fromHex(t).multiply(d(e)).toRawBytes(n)},sign:function(e,n,r=k){const{seed:o,k2sig:s}=P(e,n,r),a=t,i=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=Ea(e),o=Ea(e),s=0;const a=()=>{r.fill(1),o.fill(0),s=0},i=(...e)=>n(o,r,...e),c=(e=Ea(0))=>{o=i(Pa([0]),e),r=i(),0!==e.length&&(o=i(Pa([1]),e),r=i())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){r=i();const t=r.slice();n.push(t),e+=r.length}return ba(...n)};return(e,t)=>{let n;for(a(),c(e);!(n=t(u()));)c();return a(),n}}(a.hash.outputLen,a.nByteLength,a.hmac);return i(o,s)},verify:function(e,n,r,o=A){const s=e;n=ga("msgHash",n),r=ga("publicKey",r);const{lowS:a,prehash:i,format:d}=o;if($l(o),"strict"in o)throw new Error("options.strict was renamed to lowS");if(void 0!==d&&"compact"!==d&&"der"!==d)throw new Error("format must be compact or der");const f="string"==typeof s||Ks(s),h=!f&&!d&&"object"==typeof s&&null!==s&&"bigint"==typeof s.r&&"bigint"==typeof s.s;if(!f&&!h)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let p,m;try{if(h&&(p=new g(s.r,s.s)),f){try{"compact"!==d&&(p=g.fromDER(s))}catch(e){if(!(e instanceof Cl.Err))throw e}p||"der"===d||(p=g.fromCompact(s))}m=l.fromHex(r)}catch(e){return!1}if(!p)return!1;if(a&&p.hasHighS())return!1;i&&(n=t.hash(n));const{r:b,s:y}=p,w=v(n),x=u(y),E=c(w*x),P=c(b*x),k=l.BASE.multiplyAndAddUnsafe(m,E,P)?.toAffine();return!!k&&c(k.x)===b},ProjectivePoint:l,Signature:g,utils:b}}
|
|
10
10
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ll(e){return{hash:e,hmac:(t,...n)=>Qu(e,t,function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];Jt(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n}(...n)),randomBytes:un}}
|
|
11
11
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
12
|
-
const Ul=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Dl=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Gl=BigInt(0),ql=BigInt(1),Vl=BigInt(2),Wl=(e,t)=>(e+t/Vl)/t;const Hl=gl(Ul,void 0,void 0,{sqrt:function(e){const t=Ul,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),a=BigInt(23),i=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=il(l,n,t)*l%t,f=il(d,n,t)*l%t,h=il(f,Vl,t)*u%t,p=il(h,o,t)*h%t,m=il(p,s,t)*p%t,g=il(m,i,t)*m%t,b=il(g,c,t)*g%t,y=il(b,i,t)*m%t,w=il(y,n,t)*l%t,v=il(w,a,t)*p%t,x=il(v,r,t)*u%t,E=il(x,Vl,t);if(!Hl.eql(Hl.sqr(E),e))throw new Error("Cannot find square root");return E}}),Yl=function(e,t){const n=t=>jl({...e,...Ll(t)});return{...n(t),create:n}}({a:Gl,b:BigInt(7),Fp:Hl,n:Dl,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Dl,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-ql*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,a=BigInt("0x100000000000000000000000000000000"),i=Wl(s*e,t),c=Wl(-r*e,t);let u=al(e-i*n-c*o,t),l=al(-i*r-c*s,t);const d=u>a,f=l>a;if(d&&(u=t-u),f&&(l=t-l),u>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}}},ks);var Zl=Object.freeze({__proto__:null,secp256k1:Yl});function Kl(e,t={}){const{recovered:n}=t;if(void 0===e.r)throw new td({signature:e});if(void 0===e.s)throw new td({signature:e});if(n&&void 0===e.yParity)throw new td({signature:e});if(e.r<0n||e.r>Su)throw new nd({value:e.r});if(e.s<0n||e.s>Su)throw new rd({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new od({value:e.yParity})}function Jl(e){if(130!==e.length&&132!==e.length)throw new ed({signature:e});const t=BigInt(di(e,0,32)),n=BigInt(di(e,32,64)),r=(()=>{const t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return Xl(t)}catch{throw new od({value:t})}})();return void 0===r?{r:t,s:n}:{r:t,s:n,yParity:r}}function Ql(e){if(void 0!==e.r&&void 0!==e.s)return function(e){const t="string"==typeof e?Jl(e):e instanceof Uint8Array?function(e){return Jl(ai(e))}(e):"string"==typeof e.r?function(e){const t=(()=>{const t=e.v?Number(e.v):void 0;let n=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof n&&(n=Xl(t)),"number"!=typeof n)throw new od({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}(e):e.v?function(e){return{r:e.r,s:e.s,yParity:Xl(e.v)}}(e):{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}};return Kl(t),t}(e)}function Xl(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return e%2==0?1:0;throw new sd({value:e})}class ed extends Na{constructor({signature:e}){var t;super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${fi((t=e,t instanceof Uint8Array?ai(t):Array.isArray(t)?ai(new Uint8Array(t)):t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class td extends Na{constructor({signature:e}){super(`Signature \`${La(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class nd extends Na{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class rd extends Na{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class od extends Na{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class sd extends Na{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function ad(e,t={}){return"string"==typeof e.chainId?function(e){const{address:t,chainId:n,nonce:r}=e,o=Ql(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}(e):{...e,...t.signature}}const id=Gu("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function cd(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==di(e,-32))throw new ud(e)}else Kl(e.authorization)}let ud=class extends Na{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};async function ld(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",a=void 0!==n?Mt(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Ct(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map(e=>({...e,value:BigInt(e.value)}))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,o,a||s]}))}async function dd(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){const a=r||"latest",i=void 0!==n?Mt(n):void 0;let c=null;if(c=o?await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Mt(s)]},{dedupe:!0}):await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[i||a,Mt(s)]},{dedupe:Boolean(i)}),!c)throw new jr({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(e.chain?.formatters?.transaction?.format||cs)(c)}async function fd(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Lr({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||lc)(n)}async function hd(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:a,validation:i}=t;try{const t=[];for(const e of o){const n=e.blockOverrides?Pi(e.blockOverrides):void 0,r=e.calls.map(e=>{const t=e,n=t.account?ar(t.account):void 0,r=t.abi?cr(t):t.data,o={...t,data:t.dataSuffix?jn([r||"0x",t.dataSuffix]):r,from:t.from??n?.address};return ns(o),Jo(o)}),o=e.stateOverrides?es(e.stateOverrides):void 0;t.push({blockOverrides:n,calls:r,stateOverrides:o})}const c=("bigint"==typeof n?Mt(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:s,traceTransfers:a,validation:i},c]})).map((e,t)=>({...us(e),calls:e.calls.map((e,n)=>{const{abi:r,args:s,functionName:a,to:i}=o[t].calls[n],c=e.error?.data??e.returnData,u=BigInt(e.gasUsed),l=e.logs?.map(e=>Gs(e)),d="0x1"===e.status?"success":"failure",f=r&&"success"===d&&"0x"!==c?Hs({abi:r,data:c,functionName:a}):null,h=(()=>{if("success"===d)return;let t;return"0x"===e.error?.data?t=new Qe:e.error&&(t=new Hr(e.error)),t?No(t,{abi:r??[],address:i??"0x",args:s,functionName:a??"<unknown>"}):void 0})();return{data:c,gasUsed:u,logs:l,status:d,..."success"===d?{result:f}:{error:h}}})}))}catch(e){const t=e,n=Yo(t,{});if(n instanceof Ho)throw t;throw n}}function pd(e){let t=!0,n="",r=0,o="",s=!1;for(let a=0;a<e.length;a++){const i=e[a];if(["(",")",","].includes(i)&&(t=!0),"("===i&&r++,")"===i&&r--,t)if(0!==r)" "!==i?(o+=i,n+=i):","!==e[a-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===i&&["event","function","error",""].includes(o))o="";else if(o+=i,")"===i){s=!0;break}}if(!s)throw new Na("Unable to normalize signature.");return o}function md(e,t){const n=typeof e,r=t.type;switch(r){case"address":return xu(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every((t,n)=>md(Object.values(e)[n],t)):/^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)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every(e=>md(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})))}}function gd(e,t,n){for(const r in e){const o=e[r],s=t[r];if("tuple"===o.type&&"tuple"===s.type&&"components"in o&&"components"in s)return gd(o.components,s.components,n[r]);const a=[o.type,s.type];if((()=>!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&xu(n[r],{strict:!1}))())return a}}function bd(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||"string"==typeof e?Me(e):e;return{...r,...n?{hash:vd(r)}:{}}}function yd(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=mi(t,{strict:!1}),a=e.filter(e=>s?"function"===e.type||"error"===e.type?wd(e)===di(t,0,4):"event"===e.type&&vd(e)===t:"name"in e&&e.name===t);if(0===a.length)throw new Ed({name:t});if(1===a.length)return{...a[0],...o?{hash:vd(a[0])}:{}};let i;for(const e of a){if(!("inputs"in e))continue;if(!r||0===r.length){if(!e.inputs||0===e.inputs.length)return{...e,...o?{hash:vd(e)}:{}};continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==r.length)continue;const t=r.every((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&md(t,r)});if(t){if(i&&"inputs"in i&&i.inputs){const t=gd(e.inputs,i.inputs,r);if(t)throw new xd({abiItem:e,type:t[0]},{abiItem:i,type:t[1]})}i=e}}const c=(()=>{if(i)return i;const[e,...t]=a;return{...e,overloads:t}})();if(!c)throw new Ed({name:t});return{...c,...o?{hash:vd(c)}:{}}}function wd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return yd(t,n)}return e[0]})();return di(vd(t),0,4)}function vd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return yd(t,n)}return e[0]})();return"string"!=typeof t&&"hash"in t&&t.hash?t.hash:bu(ci(function(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return yd(t,n)}return e[0]})();return pd("string"==typeof t?t:J(t))}(t)))}class xd extends Na{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${pd(J(e.abiItem))}\`, and`,`\`${t.type}\` in \`${pd(J(t.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class Ed extends Na{constructor({name:e,data:t,type:n="item"}){super(`ABI ${n}${e?` with name "${e}"`:t?` with data "${t}"`:""} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function Pd(e){const t=e.find(e=>"constructor"===e.type);if(!t)throw new Ed({name:"constructor"});return t}function kd(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[t,n,r]=e;return[Id(t,n,{args:r}),r]}const[t,n]=e;return[t,n]})(),{overloads:r}=t,o=r?Id([t,...r],t.name,{args:n}):t,s=wd(o);const a=n.length>0?Uu(o.inputs,n):void 0;return a?oi(s,a):s}function Ad(e,t={}){return bd(e,t)}function Id(e,t,n){const r=yd(e,t,n);if("function"!==r.type)throw new Ed({name:t,type:"function"});return r}const Nd="0x0000000000000000000000000000000000000000";async function Sd(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:a,traceTransfers:i,validation:c}=t,u=t.account?ar(t.account):void 0;if(a&&!u)throw new He("`account` is required when `traceAssetChanges` is true");const l=u?function(...e){const[t,n]=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return[Pd(t),n]}return e})(),{bytecode:r,args:o}=n;return oi(r,t.inputs?.length&&o?.length?Uu(t.inputs,o):"0x")}(bd("constructor(bytes, bytes)"),{bytecode:Ri,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",kd(Ad("function getBalance(address)"),[u.address])]}):void 0;const d=a?await Promise.all(t.calls.map(async t=>{if(!t.data&&!t.abi)return;const{accessList:n}=await jc(e,{account:u.address,...t,data:t.abi?cr(t):t.data});return n.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],f=await hd(e,{blockNumber:n,blockTag:r,blocks:[...a?[{calls:[{data:l}],stateOverrides:s},{calls:d.map((e,t)=>({abi:[Ad("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]}]:[],{calls:[...o,{}].map(e=>({...e,from:u?.address})),stateOverrides:s},...a?[{calls:[{data:l}]},{calls:d.map((e,t)=>({abi:[Ad("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Ad("function decimals() returns (uint256)")],functionName:"decimals",from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Ad("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Ad("function symbol() returns (string)")],functionName:"symbol",from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]}]:[]],traceTransfers:i,validation:c}),h=a?f[2]:f[0],[p,m,,g,b,y,w,v]=a?f:[],{calls:x,...E}=h,P=x.slice(0,-1)??[],k=[...p?.calls??[],...m?.calls??[]].map(e=>"success"===e.status?Bt(e.data):null),A=[...g?.calls??[],...b?.calls??[]].map(e=>"success"===e.status?Bt(e.data):null),I=(y?.calls??[]).map(e=>"success"===e.status?e.result:null),N=(v?.calls??[]).map(e=>"success"===e.status?e.result:null),S=(w?.calls??[]).map(e=>"success"===e.status?e.result:null),T=[];for(const[e,t]of A.entries()){const n=k[e];if("bigint"!=typeof t)continue;if("bigint"!=typeof n)continue;const r=I[e-1],o=N[e-1],s=S[e-1],a=(()=>0===e?{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",decimals:18,symbol:"ETH"}:{address:d[e-1],decimals:s||r?Number(r??1):void 0,symbol:o??void 0})();T.some(e=>e.token.address===a.address)||T.push({token:a,value:{pre:n,post:t,diff:t-n}})}return{assetChanges:T,block:E,results:P}}const Td="0x6492649264926492649264926492649264926492649264926492649264926492";function $d(e){try{return function(e){if(di(e,-32)!==Td)throw new Bd(e)}(e),!0}catch{return!1}}class Bd extends Na{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function Cd({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(0===o||1===o)return o;if(r&&(27n===r||28n===r||r>=35n))return r%2n==0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),a=`0x${new Yl.Signature(Bt(e),Bt(t)).toCompactHex()}${0===s?"1b":"1c"}`;return"hex"===n?a:qt(a)}async function Od(e,t){const{address:n,hash:r,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??e.chain?.contracts?.erc6492Verifier?.address,multicallAddress:s=t.multicallAddress??e.chain?.contracts?.multicall3?.address}=t,a=(()=>{const e=t.signature;return De(e)?e:"object"==typeof e&&"r"in e&&"s"in e?Cd(e):_t(e)})();try{return function(e){try{return cd(e),!0}catch{return!1}}(a)?await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:a}=t,{authorization:i,data:c,signature:u,to:l}=function(e){cd(e);const t=pi(di(e,-64,-32)),n=di(e,-t-64,-64),r=di(e,0,-t-64),[o,s,a]=Lu(id,n);return{authorization:ad({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...a&&"0x"!==a?{data:a,to:s}:{}}}(t.signature),d=await Dc(e,{address:n,blockNumber:r,blockTag:o});if(d===Ln(["0xef0100",i.address]))return await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:a}=t,i=await je(e,Zi,"readContract")({address:n,abi:Bi,args:[s,a],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(e=>{if(e instanceof Gr)throw new Rd;throw e});if(i.startsWith("0x1626ba7e"))return!0;throw new Rd}(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:u});const f={address:i.address,chainId:Number(i.chainId),nonce:Number(i.nonce),r:Mt(i.r,{size:32}),s:Mt(i.s,{size:32}),yParity:i.yParity},h=await async function({address:e,authorization:t,signature:n}){return Fs(zn(e),await Ro({authorization:t,signature:n}))}({address:n,authorization:f});if(!h)throw new Rd;const p=await je(e,Zi,"readContract")({...a?{address:a}:{code:Mi},authorizationList:[f],abi:ki,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:l??n,callData:c}]:[],{allowFailure:!0,target:n,callData:cr({abi:Bi,functionName:"isValidSignature",args:[s,u]})}]]}),m=p[p.length-1]?.returnData;if(m?.startsWith("0x1626ba7e"))return!0;throw new Rd}(e,{...t,multicallAddress:s,signature:a}):await async function(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:a,verifierAddress:i,...c}=t,u=await(async()=>r||o?$d(a)?a:function(e){const{data:t,signature:n,to:r}=e;return oi(Uu(Gu("address, bytes, bytes"),[r,t,n]),Td)}({data:o,signature:a,to:r}):a)(),l=i?{to:i,data:cr({abi:Ci,functionName:"isValidSig",args:[n,s,u]}),...c}:{data:Ui({abi:Ci,args:[n,s,u],bytecode:_i}),...c},{data:d}=await je(e,Hi,"call")(l).catch(e=>{if(e instanceof Dr)throw new Rd;throw e});if(function(e,t={}){let n=e;if(t.size&&($t(n,{size:t.size}),n=Tt(n)),"0x00"===Tt(n))return!1;if("0x01"===Tt(n))return!0;throw new Nt(n)}(d??"0x0"))return!0;throw new Rd}(e,{...t,verifierAddress:o,signature:a})}catch(e){try{if(Fs(zn(n),await To({hash:r,signature:a})))return!0}catch{}if(e instanceof Rd)return!1;throw e}}class Rd extends Error{}function zd(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:a=e.pollingInterval}){let i;return(void 0!==s?s:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type))?Xi(Ir(["watchBlockNumber",e.uid,t,n,a]),{onBlockNumber:r,onError:o},r=>tc(async()=>{try{const t=await je(e,sc,"getBlockNumber")({cacheTime:0});if(void 0!==i){if(t===i)return;if(t-i>1&&n)for(let e=i+1n;e<t;e++)r.onBlockNumber(e,i),i=e}(void 0===i||t>i)&&(r.onBlockNumber(t,i),i=t)}catch(e){r.onError?.(e)}},{emitOnBegin:t,interval:a})):Xi(Ir(["watchBlockNumber",e.uid,t,n]),{onBlockNumber:r,onError:o},t=>{let n=!0,r=()=>n=!1;return(async()=>{try{const o=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:s}=await o.subscribe({params:["newHeads"],onData(e){if(!n)return;const r=Bt(e.result?.number);t.onBlockNumber(r,i),i=r},onError(e){t.onError?.(e)}});r=s,n||r()}catch(e){o?.(e)}})(),()=>r()})}const _d=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,Md=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;async function Fd(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:a,signature:i,time:c=new Date,...u}=t,l=function(e){const{scheme:t,statement:n,...r}=e.match(_d)?.groups??{},{chainId:o,expirationTime:s,issuedAt:a,notBefore:i,requestId:c,...u}=e.match(Md)?.groups??{},l=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...r,...u,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...a?{issuedAt:new Date(a)}:{},...i?{notBefore:new Date(i)}:{},...c?{requestId:c}:{},...l?{resources:l}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}(o);if(!l.address)return!1;const d=function(e){const{address:t,domain:n,message:r,nonce:o,scheme:s,time:a=new Date}=e;if(n&&r.domain!==n)return!1;if(o&&r.nonce!==o)return!1;if(s&&r.scheme!==s)return!1;if(r.expirationTime&&a>=r.expirationTime)return!1;if(r.notBefore&&a<r.notBefore)return!1;try{if(!r.address)return!1;if(!Fn(r.address,{strict:!1}))return!1;if(t&&!Fs(r.address,t))return!1}catch{return!1}return!0}({address:n,domain:r,message:l,nonce:s,scheme:a,time:c});if(!d)return!1;const f=ru(o);return Od(e,{address:l.address,hash:f,signature:i,...u})}function jd(e){return{call:t=>Hi(e,t),createAccessList:t=>jc(e,t),createBlockFilter:()=>async function(e){const t=or(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>sr(e,t),createEventFilter:t=>Lc(e,t),createPendingTransactionFilter:()=>Uc(e),estimateContractGas:t=>async function(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:a,...i}=t,c=cr({abi:n,args:o,functionName:s});try{return await je(e,Ms,"estimateGas")({data:`${c}${a?a.replace("0x",""):""}`,to:r,...i})}catch(e){const t=i.account?ar(i.account):void 0;throw No(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:t?.address})}}(e,t),estimateGas:t=>Ms(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o="bigint"==typeof n?Mt(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}(e,t),getBlobBaseFee:()=>async function(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}(e),getBlock:t=>ls(e,t),getBlockNumber:t=>sc(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=void 0!==n?Mt(n):void 0;let s;return s=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:Boolean(o)}),Ct(s)}(e,t),getBytecode:t=>Dc(e,t),getChainId:()=>Os(e),getCode:t=>Dc(e,t),getContractEvents:t=>Vs(e,t),getEip712Domain:t=>async function(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[t,s,a,i,c,u,l]=await je(e,Zi,"readContract")({abi:qc,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:s,version:a,chainId:Number(i),verifyingContract:c,salt:u},extensions:l,fields:t}}catch(e){const t=e;if("ContractFunctionExecutionError"===t.name&&"ContractFunctionZeroDataError"===t.cause.name)throw new Gc({address:n});throw t}}(e,t),getEnsAddress:t=>async function(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:a,strict:i}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Di({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some(e=>s.endsWith(e)))return null;const d=null!=o?[xc(s),BigInt(o)]:[xc(s)];try{const t=cr({abi:$i,functionName:"addr",args:d}),o={address:u,abi:Ni,functionName:"resolveWithGateways",args:[Rt(kc(s)),t,a??[yc]],blockNumber:n,blockTag:r},i=je(e,Zi,"readContract"),c=await i(o);if("0x"===c[0])return null;const l=Hs({abi:$i,args:d,functionName:"addr",data:c[0]});return"0x"===l||"0x00"===Tt(l)?null:l}catch(e){if(i)throw e;if(pc(e))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:a,universalResolverAddress:i}){const c=await je(e,Fc,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:i,gatewayUrls:s,strict:a});if(!c)return null;try{return await Mc(e,{record:c,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:a,strict:i}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Di({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();try{const t={address:u,abi:Si,args:[n,s,a??[yc]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},i=je(e,Zi,"readContract"),[c]=await i(t);return c||null}catch(e){if(i)throw e;if(pc(e))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return Di({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),i=s?.ensTlds;if(i&&!i.some(e=>o.endsWith(e)))throw new Error(`${o} is not a valid ENS TLD (${i?.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[c]=await je(e,Zi,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Rt(kc(o))],blockNumber:n,blockTag:r});return c}(e,t),getEnsText:t=>Fc(e,t),getFeeHistory:t=>Vc(e,t),estimateFeesPerGas:t=>async function(e,t){return hs(e,t)}(e,t),getFilterChanges:e=>ac(0,e),getFilterLogs:e=>async function(e,{filter:t}){const n=t.strict??!1,r=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(e=>Gs(e));return t.abi?Ds({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>ds(e),getLogs:t=>qs(e,t),getProof:t=>ld(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return fs(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=void 0!==n?Mt(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}(e,t),getTransaction:t=>dd(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([je(e,sc,"getBlockNumber")({}),t?je(e,dd,"getTransaction")({hash:t}):void 0]),s=n?.blockNumber||o?.blockNumber;return s?r-s+1n:0n}(e,t),getTransactionCount:t=>ps(e,t),getTransactionReceipt:t=>fd(e,t),multicall:t=>async function(e,t){const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:a,blockTag:i,stateOverride:c}=t,u=t.contracts,{batchSize:l=t.batchSize??1024,deployless:d=t.deployless??!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},f=(()=>{if(t.multicallAddress)return t.multicallAddress;if(d)return null;if(e.chain)return Di({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),h=[[]];let p=0,m=0;for(let e=0;e<u.length;e++){const{abi:t,address:r,args:s,functionName:a}=u[e];try{const e=cr({abi:t,args:s,functionName:a});m+=(e.length-2)/2,l>0&&m>l&&h[p].length>0&&(p++,m=(e.length-2)/2,h[p]=[]),h[p]=[...h[p],{allowFailure:!0,callData:e,target:r}]}catch(e){const i=No(e,{abi:t,address:r,args:s,docsPath:"/docs/contract/multicall",functionName:a,sender:n});if(!o)throw i;h[p]=[...h[p],{allowFailure:!0,callData:"0x",target:r}]}}const g=await Promise.allSettled(h.map(t=>je(e,Zi,"readContract")({...null===f?{code:Mi}:{address:f},abi:ki,account:n,args:[t],authorizationList:r,blockNumber:s,blockOverrides:a,blockTag:i,functionName:"aggregate3",stateOverride:c}))),b=[];for(let e=0;e<g.length;e++){const t=g[e];if("rejected"===t.status){if(!o)throw t.reason;for(let n=0;n<h[e].length;n++)b.push({status:"failure",error:t.reason,result:void 0});continue}const n=t.value;for(let t=0;t<n.length;t++){const{returnData:r,success:s}=n[t],{callData:a}=h[e][t],{abi:i,address:c,functionName:l,args:d}=u[b.length];try{if("0x"===a)throw new Qe;if(!s)throw new Hr({data:r});const e=Hs({abi:i,args:d,data:r,functionName:l});b.push(o?{result:e,status:"success"}:e)}catch(e){const t=No(e,{abi:i,address:c,args:d,docsPath:"/docs/contract/multicall",functionName:l});if(!o)throw t;b.push({error:t,result:void 0,status:"failure"})}}}if(b.length!==u.length)throw new He("multicall results mismatch");return b}(e,t),prepareTransactionRequest:t=>_s(e,t),readContract:t=>Zi(e,t),sendRawTransaction:t=>async function(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}(e,t),simulate:t=>hd(e,t),simulateBlocks:t=>hd(e,t),simulateCalls:t=>Sd(e,t),simulateContract:t=>async function(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:a,...i}=t,c=i.account?ar(i.account):e.account,u=cr({abi:n,args:o,functionName:a});try{const{data:l}=await je(e,Hi,"call")({batch:!1,data:`${u}${s?s.replace("0x",""):""}`,to:r,...i,account:c});return{result:Hs({abi:n,args:o,functionName:a,data:l||"0x"}),request:{abi:n.filter(e=>"name"in e&&e.name===t.functionName),address:r,args:o,dataSuffix:s,functionName:a,...i,account:c}}}catch(e){throw No(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:a,sender:c?.address})}}(e,t),verifyHash:t=>Od(e,t),verifyMessage:t=>async function(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...a}){return Od(e,{address:t,factory:r,factoryData:o,hash:ru(n),signature:s,...a})}(e,t),verifySiweMessage:t=>Fd(e,t),verifyTypedData:t=>async function(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:a,primaryType:i,types:c,domain:u,...l}=t;return Od(e,{address:n,factory:r,factoryData:o,hash:uu({message:a,primaryType:i,types:c,domain:u}),signature:s,...l})}(e,t),uninstallFilter:e=>ic(0,e),waitForTransactionReceipt:t=>async function(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:a=6,retryDelay:i=({count:e})=>200*(1<<e),timeout:c=18e4}=t,u=Ir(["waitForTransactionReceipt",e.uid,o]),l=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval;let d,f,h,p,m,g=!1;const{promise:b,resolve:y,reject:w}=qi(),v=c?setTimeout(()=>{m?.(),p?.(),w(new Ur({hash:o}))},c):void 0;return p=Xi(u,{onReplaced:s,resolve:y,reject:w},async t=>{if(h=await je(e,fd,"getTransactionReceipt")({hash:o}).catch(()=>{}),h&&r<=1)return clearTimeout(v),t.resolve(h),void p?.();m=je(e,zd,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:l,async onBlockNumber(s){const c=e=>{clearTimeout(v),m?.(),e(),p?.()};let u=s;if(!g)try{if(h){if(r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;return void c(()=>t.resolve(h))}if(n&&!d&&(g=!0,await cc(async()=>{d=await je(e,dd,"getTransaction")({hash:o}),d.blockNumber&&(u=d.blockNumber)},{delay:i,retryCount:a}),g=!1),h=await je(e,fd,"getTransactionReceipt")({hash:o}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;c(()=>t.resolve(h))}catch(n){if(n instanceof jr||n instanceof Lr){if(!d)return void(g=!1);try{f=d,g=!0;const n=await cc(()=>je(e,ls,"getBlock")({blockNumber:u,includeTransactions:!0}),{delay:i,retryCount:a,shouldRetry:({error:e})=>e instanceof as});g=!1;const o=n.transactions.find(({from:e,nonce:t})=>e===f.from&&t===f.nonce);if(!o)return;if(h=await je(e,fd,"getTransactionReceipt")({hash:o.hash}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;let s="replaced";o.to===f.to&&o.value===f.value&&o.input===f.input?s="repriced":o.from===o.to&&0n===o.value&&(s="cancelled"),c(()=>{t.onReplaced?.({reason:s,replacedTransaction:f,transaction:o,transactionReceipt:h}),t.resolve(h)})}catch(e){c(()=>t.reject(e))}}else c(()=>t.reject(n))}}})}),b}(e,t),watchBlocks:t=>function(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:a,poll:i,pollingInterval:c=e.pollingInterval}){const u=void 0!==i?i:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type),l=a??!1;let d;return u?Xi(Ir(["watchBlocks",e.uid,t,n,r,l,c]),{onBlock:o,onError:s},o=>tc(async()=>{try{const r=await je(e,ls,"getBlock")({blockTag:t,includeTransactions:l});if(null!==r.number&&null!=d?.number){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;t<r.number;t++){const n=await je(e,ls,"getBlock")({blockNumber:t,includeTransactions:l});o.onBlock(n,d),d=n}}(null==d?.number||"pending"===t&&null==r?.number||null!==r.number&&r.number>d.number)&&(o.onBlock(r,d),d=r)}catch(e){o.onError?.(e)}},{emitOnBegin:r,interval:c})):(()=>{let n=!0,a=!0,i=()=>n=!1;return(async()=>{try{r&&je(e,ls,"getBlock")({blockTag:t,includeTransactions:l}).then(e=>{n&&a&&(o(e,void 0),a=!1)}).catch(s);const c=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:u}=await c.subscribe({params:["newHeads"],async onData(t){if(!n)return;const r=await je(e,ls,"getBlock")({blockNumber:t.result?.number,includeTransactions:l}).catch(()=>{});n&&(o(r,d),a=!1,d=r)},onError(e){s?.(e)}});i=u,n||i()}catch(e){s?.(e)}})(),()=>i()})()}(e,t),watchBlockNumber:t=>zd(e,t),watchContractEvent:t=>function(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:a,fromBlock:i,onError:c,onLogs:u,poll:l,pollingInterval:d=e.pollingInterval,strict:f}=t;return(void 0!==l?l:"bigint"==typeof i||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{const t=f??!1;return Xi(Ir(["watchContractEvent",r,o,s,e.uid,a,d,t,i]),{onLogs:u,onError:c},c=>{let u,l;void 0!==i&&(u=i-1n);let f=!1;const h=tc(async()=>{if(f)try{let i;if(l)i=await je(e,ac,"getFilterChanges")({filter:l});else{const s=await je(e,sc,"getBlockNumber")({});i=u&&u<s?await je(e,Vs,"getContractEvents")({abi:n,address:r,args:o,eventName:a,fromBlock:u+1n,toBlock:s,strict:t}):[],u=s}if(0===i.length)return;if(s)c.onLogs(i);else for(const e of i)c.onLogs([e])}catch(e){l&&e instanceof oo&&(f=!1),c.onError?.(e)}else{try{l=await je(e,sr,"createContractEventFilter")({abi:n,address:r,args:o,eventName:a,strict:t,fromBlock:i})}catch{}f=!0}},{emitOnBegin:!0,interval:d});return async()=>{l&&await je(e,ic,"uninstallFilter")({filter:l}),h()}})})():(()=>{const t=f??!1,i=Ir(["watchContractEvent",r,o,s,e.uid,a,d,t]);let l=!0,h=()=>l=!1;return Xi(i,{onLogs:u,onError:c},t=>((async()=>{try{const s=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),i=a?nr({abi:n,eventName:a,args:o}):[],{unsubscribe:c}=await s.subscribe({params:["logs",{address:r,topics:i}],onData(e){if(!l)return;const r=e.result;try{const{eventName:e,args:o}=Ls({abi:n,data:r.data,topics:r.topics,strict:f}),s=Gs(r,{args:o,eventName:e});t.onLogs([s])}catch(e){let n,o;if(e instanceof ht||e instanceof pt){if(f)return;n=e.abiItem.name,o=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const s=Gs(r,{args:o?[]:{},eventName:n});t.onLogs([s])}},onError(e){t.onError?.(e)}});h=c,l||h()}catch(e){c?.(e)}})(),()=>h()))})()}(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:a,onError:i,onLogs:c,poll:u,pollingInterval:l=e.pollingInterval,strict:d}){const f=void 0!==u?u:"bigint"==typeof a||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type),h=d??!1;return f?Xi(Ir(["watchEvent",t,n,r,e.uid,o,l,a]),{onLogs:c,onError:i},i=>{let c,u;void 0!==a&&(c=a-1n);let d=!1;const f=tc(async()=>{if(d)try{let a;if(u)a=await je(e,ac,"getFilterChanges")({filter:u});else{const r=await je(e,sc,"getBlockNumber")({});a=c&&c!==r?await je(e,qs,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:c+1n,toBlock:r}):[],c=r}if(0===a.length)return;if(r)i.onLogs(a);else for(const e of a)i.onLogs([e])}catch(e){u&&e instanceof oo&&(d=!1),i.onError?.(e)}else{try{u=await je(e,Lc,"createEventFilter")({address:t,args:n,event:o,events:s,strict:h,fromBlock:a})}catch{}d=!0}},{emitOnBegin:!0,interval:l});return async()=>{u&&await je(e,ic,"uninstallFilter")({filter:u}),f()}}):(()=>{let r=!0,a=()=>r=!1;return(async()=>{try{const u=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),l=s??(o?[o]:void 0);let f=[];if(l){const e=l.flatMap(e=>nr({abi:[e],eventName:e.name,args:n}));f=[e],o&&(f=f[0])}const{unsubscribe:p}=await u.subscribe({params:["logs",{address:t,topics:f}],onData(e){if(!r)return;const t=e.result;try{const{eventName:e,args:n}=Ls({abi:l??[],data:t.data,topics:t.topics,strict:h}),r=Gs(t,{args:n,eventName:e});c([r])}catch(e){let n,r;if(e instanceof ht||e instanceof pt){if(d)return;n=e.abiItem.name,r=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const o=Gs(t,{args:r?[]:{},eventName:n});c([o])}},onError(e){i?.(e)}});a=p,r||a()}catch(e){i?.(e)}})(),()=>a()})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(void 0!==o?o:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type)?Xi(Ir(["watchPendingTransactions",e.uid,t,s]),{onTransactions:r,onError:n},n=>{let r;const o=tc(async()=>{try{if(!r)try{return void(r=await je(e,Uc,"createPendingTransactionFilter")({}))}catch(e){throw o(),e}const s=await je(e,ac,"getFilterChanges")({filter:r});if(0===s.length)return;if(t)n.onTransactions(s);else for(const e of s)n.onTransactions([e])}catch(e){n.onError?.(e)}},{emitOnBegin:!0,interval:s});return async()=>{r&&await je(e,ic,"uninstallFilter")({filter:r}),o()}}):(()=>{let t=!0,o=()=>t=!1;return(async()=>{try{const{unsubscribe:s}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});o=s,t||o()}catch(e){n?.(e)}})(),()=>o()})()}(e,t)}}function Ld(e){const{key:t="public",name:n="Public Client"}=e,r=function(e){const{batch:t,chain:n,ccipRead:r,key:o="base",name:s="Base Client",type:a="base"}=e,i=e.experimental_blockTag??("number"==typeof n?.experimental_preconfirmationTime?"pending":void 0),c=n?.blockTime??12e3,u=Math.min(Math.max(Math.floor(c/2),500),4e3),l=e.pollingInterval??u,d=e.cacheTime??l,f=e.account?ar(e.account):void 0,{config:h,request:p,value:m}=e.transport({chain:n,pollingInterval:l}),g={account:f,batch:t,cacheTime:d,ccipRead:r,chain:n,key:o,name:s,pollingInterval:l,request:p,transport:{...h,...m},type:a,uid:hc(),...i?{experimental_blockTag:i}:{}};return Object.assign(g,{extend:function e(t){return n=>{const r=n(t);for(const e in g)delete r[e];const o={...t,...r};return Object.assign(o,{extend:e(o)})}}(g)})}({...e,key:t,name:n,type:"publicClient"});return r.extend(jd)}class Ud extends He{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Dd(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:a,name:i="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:u,retryDelay:l,raw:d}=t;return({chain:f,retryCount:h,timeout:p})=>{const{batchSize:m=1e3,wait:g=0}="object"==typeof n?n:{},b=t.retryCount??h,y=p??t.timeout??1e4,w=e||f?.rpcUrls.default.http[0];if(!w)throw new Ud;const v=nu(w,{fetchFn:r,fetchOptions:o,onRequest:c,onResponse:u,timeout:y});return function({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:a,type:i},c){return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:a,type:i},request:Hc(r,{methods:t,retryCount:o,retryDelay:s,uid:hc()}),value:c}}({key:s,methods:a,name:i,async request({method:e,params:t}){const r={method:e,params:t},{schedule:o}=Wi({id:w,wait:g,shouldSplitBatch:e=>e.length>m,fn:e=>v.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:s,result:a}]=await(async e=>n?o(e):[await v.request({body:e})])(r);if(d)return{error:s,result:a};if(s)throw new Zr({body:r,error:s,url:w});return a},retryCount:b,retryDelay:l,timeout:y,type:"http"},{fetchOptions:o,url:w})}}function Gd(e,t,n){for(let n in t){let r=t[n];Object.defineProperty(e,n,{enumerable:!0,value:r,writable:!1})}}function qd(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(e=>qd(e,t)).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let r=0;r<e.length;r++)n+=t[e[r]>>4],n+=t[15&e[r]];return n}if("object"==typeof e&&"function"==typeof e.toJSON)return qd(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(n=>`${qd(n,t)}: ${qd(e[n],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Vd(e,t,n,r){if(!e)throw function(e,t,n){let r,o=e;{const r=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${qd(n)}`);for(const e in n){if("shortMessage"===e)continue;const t=n[e];r.push(e+"="+qd(t))}}r.push(`code=${t}`),r.push("version=6.15.0"),r.length&&(e+=" ("+r.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return Gd(r,{code:t}),n&&Object.assign(r,n),null==r.shortMessage&&Gd(r,{shortMessage:o}),r}(t,n,r)}function Wd(e,t,n,r){Vd(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function Hd(e,t){return function(e,t){if(e instanceof Uint8Array)return e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let n=2;for(let r=0;r<t.length;r++)t[r]=parseInt(e.substring(n,n+2),16),n+=2;return t}Wd(!1,"invalid BytesLike value",t,e)}(e,t)}["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e},[]);const Yd=BigInt(0),Zd=BigInt(1),Kd=9007199254740991;function Jd(e,t){const n=ef(e,"value"),r=BigInt(nf(t,"width"));if(Vd(n>>r===Yd,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-Zd){return-((~n&(Zd<<r)-Zd)+Zd)}return n}function Qd(e,t){const n=ef(e,"value"),r=BigInt(nf(t,"bits"));return n&(Zd<<r)-Zd}function Xd(e,t){switch(typeof e){case"bigint":return e;case"number":return Wd(Number.isInteger(e),"underflow",t||"value",e),Wd(e>=-Kd&&e<=Kd,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(n){Wd(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}Wd(!1,"invalid BigNumberish value",t||"value",e)}function ef(e,t){const n=Xd(e,t);return Vd(n>=Yd,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const tf="0123456789abcdef";function nf(e,t){switch(typeof e){case"bigint":return Wd(e>=-Kd&&e<=Kd,"overflow",t||"value",e),Number(e);case"number":return Wd(Number.isInteger(e),"underflow",t||"value",e),Wd(e>=-Kd&&e<=Kd,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return nf(BigInt(e),t)}catch(n){Wd(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}Wd(!1,"invalid numeric value",t||"value",e)}const rf=BigInt(-1),of=BigInt(0),sf=BigInt(1),af=BigInt(5),cf={};let uf="0000";for(;uf.length<80;)uf+=uf;function lf(e){let t=uf;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function df(e,t,n){const r=BigInt(t.width);if(t.signed){const t=sf<<r-sf;Vd(null==n||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=e>of?Jd(Qd(e,r),r):-Jd(Qd(-e,r),r)}else{const t=sf<<r;Vd(null==n||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=(e%t+t)%t&t-sf}return e}function ff(e){"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Wd(o,"invalid fixed format","format",e),t="u"!==o[1],n=parseInt(o[2]),r=parseInt(o[3])}else if(e){const o=e,s=(e,t,n)=>null==o[e]?n:(Wd(typeof o[e]===t,"invalid fixed format ("+e+" not "+t+")","format."+e,o[e]),o[e]);t=s("signed","boolean",t),n=s("width","number",n),r=s("decimals","number",r)}Wd(n%8==0,"invalid FixedNumber width (not byte aligned)","format.width",n),Wd(r<=80,"invalid FixedNumber decimals (too large)","format.decimals",r);return{signed:t,width:n,decimals:r,name:(t?"":"u")+"fixed"+String(n)+"x"+String(r)}}class hf{format;#e;#t;#n;_value;constructor(e,t,n){!function(e,t,n){if(e!==t){let e=n,t="new";e+=".",t+=" "+n,Vd(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}(e,cf,"FixedNumber"),this.#t=t,this.#e=n;const r=function(e,t){let n="";e<of&&(n="-",e*=rf);let r=e.toString();if(0===t)return n+r;for(;r.length<=t;)r=uf+r;const o=r.length-t;for(r=r.substring(0,o)+"."+r.substring(o);"0"===r[0]&&"."!==r[1];)r=r.substring(1);for(;"0"===r[r.length-1]&&"."!==r[r.length-2];)r=r.substring(0,r.length-1);return n+r}(t,n.decimals);Gd(this,{format:n.name,_value:r}),this.#n=lf(n.decimals)}get signed(){return this.#e.signed}get width(){return this.#e.width}get decimals(){return this.#e.decimals}get value(){return this.#t}#r(e){Wd(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#o(e,t){return e=df(e,this.#e,t),new hf(cf,e,this.#e)}#s(e,t){return this.#r(e),this.#o(this.#t+e.#t,t)}addUnsafe(e){return this.#s(e)}add(e){return this.#s(e,"add")}#a(e,t){return this.#r(e),this.#o(this.#t-e.#t,t)}subUnsafe(e){return this.#a(e)}sub(e){return this.#a(e,"sub")}#i(e,t){return this.#r(e),this.#o(this.#t*e.#t/this.#n,t)}mulUnsafe(e){return this.#i(e)}mul(e){return this.#i(e,"mul")}mulSignal(e){this.#r(e);const t=this.#t*e.#t;return Vd(t%this.#n===of,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#o(t/this.#n,"mulSignal")}#c(e,t){return Vd(e.#t!==of,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e),this.#o(this.#t*this.#n/e.#t,t)}divUnsafe(e){return this.#c(e)}div(e){return this.#c(e,"div")}divSignal(e){Vd(e.#t!==of,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e);const t=this.#t*this.#n;return Vd(t%e.#t===of,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#o(t/e.#t,"divSignal")}cmp(e){let t=this.value,n=e.value;const r=this.decimals-e.decimals;return r>0?n*=lf(r):r<0&&(t*=lf(-r)),t<n?-1:t>n?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#t;return this.#t<of&&(e-=this.#n-sf),e=this.#t/this.#n*this.#n,this.#o(e,"floor")}ceiling(){let e=this.#t;return this.#t>of&&(e+=this.#n-sf),e=this.#t/this.#n*this.#n,this.#o(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const t=this.decimals-e,n=af*lf(t-1);let r=this.value+n;const o=lf(t);return r=r/o*o,df(r,this.#e,"round"),new hf(cf,r,this.#e)}isZero(){return this.#t===of}isNegative(){return this.#t<of}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return hf.fromString(this.toString(),e)}static fromValue(e,t,n){const r=null==t?0:nf(t),o=ff(n);let s=Xd(e,"value");const a=r-o.decimals;if(a>0){const t=lf(a);Vd(s%t===of,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),s/=t}else a<0&&(s*=lf(-a));return df(s,o,"fromValue"),new hf(cf,s,o)}static fromString(e,t){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);Wd(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const r=ff(t);let o=n[2]||"0",s=n[3]||"";for(;s.length<r.decimals;)s+=uf;Vd(s.substring(r.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),s=s.substring(0,r.decimals);const a=BigInt(n[1]+o+s);return df(a,r,"fromString"),new hf(cf,a,r)}static fromBytes(e,t){let n=function(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=tf[n>>4],t+=tf[15&n];return BigInt(t)}return Xd(e)}(Hd(e,"value"));const r=ff(t);return r.signed&&(n=Jd(n,r.width)),df(n,r,"fromBytes"),new hf(cf,n,r)}}function pf(e){return function(e,t){let n=18;return n=nf(t,"unit"),hf.fromValue(e,n,{decimals:n,width:512}).toString()}(e,18)}const mf="0.38.13";function gf({projectId:e,originComponentName:t,...n}){const r=new URL("https://pay.coinbase.com/buy");void 0!==e&&r.searchParams.append("appId",e);for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(["string","number","boolean"].includes(typeof t)?r.searchParams.append(e,t.toString()):r.searchParams.append(e,JSON.stringify(t)))}return t?r.searchParams.append("sdkVersion",`onchainkit@${mf}:${t}`):r.searchParams.append("sdkVersion",`onchainkit@${mf}`),r.searchParams.sort(),r.toString()}var bf=[],yf=[],wf="undefined"!=typeof Uint8Array?Uint8Array:Array,vf=!1;function xf(){vf=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)bf[t]=e[t],yf[e.charCodeAt(t)]=t;yf["-".charCodeAt(0)]=62,yf["_".charCodeAt(0)]=63}function Ef(e){return bf[e>>18&63]+bf[e>>12&63]+bf[e>>6&63]+bf[63&e]}function Pf(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push(Ef(r));return o.join("")}function kf(e){var t;vf||xf();for(var n=e.length,r=n%3,o="",s=[],a=16383,i=0,c=n-r;i<c;i+=a)s.push(Pf(e,i,i+a>c?c:i+a));return 1===r?(t=e[n-1],o+=bf[t>>2],o+=bf[t<<4&63],o+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],o+=bf[t>>10],o+=bf[t>>4&63],o+=bf[t<<2&63],o+="="),s.push(o),s.join("")}function Af(e,t,n,r,o){var s,a,i=8*o-r-1,c=(1<<i)-1,u=c>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-l)-1,h>>=-l,l+=i;l>0;s=256*s+e[t+d],d+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===s)s=1-u;else{if(s===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),s-=u}return(h?-1:1)*a*Math.pow(2,s-r)}function If(e,t,n,r,o,s){var a,i,c,u=8*s-o-1,l=(1<<u)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(i=0,a=l):a+d>=1?(i=(t*c-1)*Math.pow(2,o),a+=d):(i=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&i,h+=p,i/=256,o-=8);for(a=a<<o|i,u+=o;u>0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*m}var Nf={}.toString,Sf=Array.isArray||function(e){return"[object Array]"==Nf.call(e)};function Tf(){return Bf.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function $f(e,t){if(Tf()<t)throw new RangeError("Invalid typed array length");return Bf.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Bf.prototype:(null===e&&(e=new Bf(t)),e.length=t),e}function Bf(e,t,n){if(!(Bf.TYPED_ARRAY_SUPPORT||this instanceof Bf))return new Bf(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Rf(this,e)}return Cf(this,e,t,n)}function Cf(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Bf.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Bf.prototype:e=zf(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Bf.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Ff(t,n);e=$f(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(Mf(t)){var n=0|_f(t.length);return 0===(e=$f(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?$f(e,0):zf(e,t);if("Buffer"===t.type&&Sf(t.data))return zf(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Of(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Rf(e,t){if(Of(t),e=$f(e,t<0?0:0|_f(t)),!Bf.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function zf(e,t){var n=t.length<0?0:0|_f(t.length);e=$f(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function _f(e){if(e>=Tf())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tf().toString(16)+" bytes");return 0|e}function Mf(e){return!(null==e||!e._isBuffer)}function Ff(e,t){if(Mf(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return dh(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return fh(e).length;default:if(r)return dh(e).length;t=(""+t).toLowerCase(),r=!0}}function jf(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return eh(this,t,n);case"utf8":case"utf-8":return Kf(this,t,n);case"ascii":return Qf(this,t,n);case"latin1":case"binary":return Xf(this,t,n);case"base64":return Zf(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return th(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Lf(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Uf(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=Bf.from(t,r)),Mf(t))return 0===t.length?-1:Df(e,t,n,r,o);if("number"==typeof t)return t&=255,Bf.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Df(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function Df(e,t,n,r,o){var s,a=1,i=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,i/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(s=n;s<i;s++)if(u(e,s)===u(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===c)return l*a}else-1!==l&&(s-=s-l),l=-1}else for(n+c>i&&(n=i-c),s=n;s>=0;s--){for(var d=!0,f=0;f<c;f++)if(u(e,s+f)!==u(t,f)){d=!1;break}if(d)return s}return-1}function Gf(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var a=0;a<r;++a){var i=parseInt(t.substr(2*a,2),16);if(isNaN(i))return a;e[n+a]=i}return a}function qf(e,t,n,r){return hh(dh(t,e.length-n),e,n,r)}function Vf(e,t,n,r){return hh(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function Wf(e,t,n,r){return Vf(e,t,n,r)}function Hf(e,t,n,r){return hh(fh(t),e,n,r)}function Yf(e,t,n,r){return hh(function(e,t){for(var n,r,o,s=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,s.push(o),s.push(r);return s}(t,e.length-n),e,n,r)}function Zf(e,t,n){return 0===t&&n===e.length?kf(e):kf(e.slice(t,n))}function Kf(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var s,a,i,c,u=e[o],l=null,d=u>239?4:u>223?3:u>191?2:1;if(o+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(s=e[o+1]))&&(c=(31&u)<<6|63&s)>127&&(l=c);break;case 3:s=e[o+1],a=e[o+2],128==(192&s)&&128==(192&a)&&(c=(15&u)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:s=e[o+1],a=e[o+2],i=e[o+3],128==(192&s)&&128==(192&a)&&128==(192&i)&&(c=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&i)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=d}return function(e){var t=e.length;if(t<=Jf)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Jf));return n}(r)}Bf.TYPED_ARRAY_SUPPORT=void 0===globalThis.TYPED_ARRAY_SUPPORT||globalThis.TYPED_ARRAY_SUPPORT,Tf(),Bf.poolSize=8192,Bf._augment=function(e){return e.__proto__=Bf.prototype,e},Bf.from=function(e,t,n){return Cf(null,e,t,n)},Bf.TYPED_ARRAY_SUPPORT&&(Bf.prototype.__proto__=Uint8Array.prototype,Bf.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Bf[Symbol.species]),Bf.alloc=function(e,t,n){return function(e,t,n,r){return Of(t),t<=0?$f(e,t):void 0!==n?"string"==typeof r?$f(e,t).fill(n,r):$f(e,t).fill(n):$f(e,t)}(null,e,t,n)},Bf.allocUnsafe=function(e){return Rf(null,e)},Bf.allocUnsafeSlow=function(e){return Rf(null,e)},Bf.isBuffer=function(e){return null!=e&&(!!e._isBuffer||ph(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ph(e.slice(0,0))}(e))},Bf.compare=function(e,t){if(!Mf(e)||!Mf(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,s=Math.min(n,r);o<s;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},Bf.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Bf.concat=function(e,t){if(!Sf(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Bf.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Bf.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!Mf(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},Bf.byteLength=Ff,Bf.prototype._isBuffer=!0,Bf.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Lf(this,t,t+1);return this},Bf.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Lf(this,t,t+3),Lf(this,t+1,t+2);return this},Bf.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Lf(this,t,t+7),Lf(this,t+1,t+6),Lf(this,t+2,t+5),Lf(this,t+3,t+4);return this},Bf.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Kf(this,0,e):jf.apply(this,arguments)},Bf.prototype.equals=function(e){if(!Mf(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Bf.compare(this,e)},Bf.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Bf.prototype.compare=function(e,t,n,r,o){if(!Mf(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),i=Math.min(s,a),c=this.slice(r,o),u=e.slice(t,n),l=0;l<i;++l)if(c[l]!==u[l]){s=c[l],a=u[l];break}return s<a?-1:a<s?1:0},Bf.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Bf.prototype.indexOf=function(e,t,n){return Uf(this,e,t,n,!0)},Bf.prototype.lastIndexOf=function(e,t,n){return Uf(this,e,t,n,!1)},Bf.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return Gf(this,e,t,n);case"utf8":case"utf-8":return qf(this,e,t,n);case"ascii":return Vf(this,e,t,n);case"latin1":case"binary":return Wf(this,e,t,n);case"base64":return Hf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yf(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},Bf.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Jf=4096;function Qf(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function Xf(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function eh(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",s=t;s<n;++s)o+=lh(e[s]);return o}function th(e,t,n){for(var r=e.slice(t,n),o="",s=0;s<r.length;s+=2)o+=String.fromCharCode(r[s]+256*r[s+1]);return o}function nh(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function rh(e,t,n,r,o,s){if(!Mf(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function oh(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,s=Math.min(e.length-n,2);o<s;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function sh(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,s=Math.min(e.length-n,4);o<s;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function ah(e,t,n,r,o,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ih(e,t,n,r,o){return o||ah(e,0,n,4),If(e,t,n,r,23,4),n+4}function ch(e,t,n,r,o){return o||ah(e,0,n,8),If(e,t,n,r,52,8),n+8}Bf.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Bf.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Bf.prototype;else{var o=t-e;n=new Bf(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+e]}return n},Bf.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||nh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r},Bf.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||nh(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},Bf.prototype.readUInt8=function(e,t){return t||nh(e,1,this.length),this[e]},Bf.prototype.readUInt16LE=function(e,t){return t||nh(e,2,this.length),this[e]|this[e+1]<<8},Bf.prototype.readUInt16BE=function(e,t){return t||nh(e,2,this.length),this[e]<<8|this[e+1]},Bf.prototype.readUInt32LE=function(e,t){return t||nh(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Bf.prototype.readUInt32BE=function(e,t){return t||nh(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Bf.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||nh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},Bf.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||nh(e,t,this.length);for(var r=t,o=1,s=this[e+--r];r>0&&(o*=256);)s+=this[e+--r]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*t)),s},Bf.prototype.readInt8=function(e,t){return t||nh(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Bf.prototype.readInt16LE=function(e,t){t||nh(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Bf.prototype.readInt16BE=function(e,t){t||nh(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Bf.prototype.readInt32LE=function(e,t){return t||nh(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Bf.prototype.readInt32BE=function(e,t){return t||nh(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Bf.prototype.readFloatLE=function(e,t){return t||nh(e,4,this.length),Af(this,e,!0,23,4)},Bf.prototype.readFloatBE=function(e,t){return t||nh(e,4,this.length),Af(this,e,!1,23,4)},Bf.prototype.readDoubleLE=function(e,t){return t||nh(e,8,this.length),Af(this,e,!0,52,8)},Bf.prototype.readDoubleBE=function(e,t){return t||nh(e,8,this.length),Af(this,e,!1,52,8)},Bf.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||rh(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,s=0;for(this[t]=255&e;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},Bf.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||rh(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},Bf.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,1,255,0),Bf.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Bf.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,2,65535,0),Bf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):oh(this,e,t,!0),t+2},Bf.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,2,65535,0),Bf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):oh(this,e,t,!1),t+2},Bf.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,4,4294967295,0),Bf.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):sh(this,e,t,!0),t+4},Bf.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,4,4294967295,0),Bf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):sh(this,e,t,!1),t+4},Bf.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);rh(this,e,t,n,o-1,-o)}var s=0,a=1,i=0;for(this[t]=255&e;++s<n&&(a*=256);)e<0&&0===i&&0!==this[t+s-1]&&(i=1),this[t+s]=(e/a|0)-i&255;return t+n},Bf.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);rh(this,e,t,n,o-1,-o)}var s=n-1,a=1,i=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/a|0)-i&255;return t+n},Bf.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,1,127,-128),Bf.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Bf.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,2,32767,-32768),Bf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):oh(this,e,t,!0),t+2},Bf.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,2,32767,-32768),Bf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):oh(this,e,t,!1),t+2},Bf.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,4,2147483647,-2147483648),Bf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):sh(this,e,t,!0),t+4},Bf.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Bf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):sh(this,e,t,!1),t+4},Bf.prototype.writeFloatLE=function(e,t,n){return ih(this,e,t,!0,n)},Bf.prototype.writeFloatBE=function(e,t,n){return ih(this,e,t,!1,n)},Bf.prototype.writeDoubleLE=function(e,t,n){return ch(this,e,t,!0,n)},Bf.prototype.writeDoubleBE=function(e,t,n){return ch(this,e,t,!1,n)},Bf.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,s=r-n;if(this===e&&n<t&&t<r)for(o=s-1;o>=0;--o)e[o+t]=this[o+n];else if(s<1e3||!Bf.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},Bf.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Bf.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var a=Mf(e)?e:dh(new Bf(e,r).toString()),i=a.length;for(s=0;s<n-t;++s)this[s+t]=a[s%i]}return this};var uh=/[^+\/0-9A-Za-z-_]/g;function lh(e){return e<16?"0"+e.toString(16):e.toString(16)}function dh(e,t){var n;t=t||1/0;for(var r=e.length,o=null,s=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&s.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function fh(e){return function(e){var t,n,r,o,s,a;vf||xf();var i=e.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s="="===e[i-2]?2:"="===e[i-1]?1:0,a=new wf(3*i/4-s),r=s>0?i-4:i;var c=0;for(t=0,n=0;t<r;t+=4,n+=3)o=yf[e.charCodeAt(t)]<<18|yf[e.charCodeAt(t+1)]<<12|yf[e.charCodeAt(t+2)]<<6|yf[e.charCodeAt(t+3)],a[c++]=o>>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===s?(o=yf[e.charCodeAt(t)]<<2|yf[e.charCodeAt(t+1)]>>4,a[c++]=255&o):1===s&&(o=yf[e.charCodeAt(t)]<<10|yf[e.charCodeAt(t+1)]<<4|yf[e.charCodeAt(t+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(uh,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function hh(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function ph(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}class mh{constructor(e){this.selectedWalletId=null,this.solanaConnection=null,this.ethereumProvider=null,this.walletInfo=null,this.phantomAdapter=null,this.walletType="embedded",this.ethereumNetwork=null,this.defaultNetwork=exports.Network.Solana,this.api=h.default.create({baseURL:e.baseURL,headers:{"Content-Type":"application/json"}}),this.middleAccountApi=h.default.create({baseURL:e.middleAccountBaseURL||"https://yeezy-payment-service-sit-a0dchfccbufeh5bx.z03.azurefd.net",headers:{"Content-Type":"application/json"}}),this.solanaCluster=e.solanaCluster,this.solanaConnection=new t.Connection(e.solanaCluster.rpcUrl),e.ethereumNetwork&&(this.ethereumNetwork={...e.ethereumNetwork,chainId:Number(e.ethereumNetwork.chainId)},this.ethereumProvider=Ld({transport:Dd(e.ethereumNetwork.rpcUrl)})),this.defaultNetwork=e.defaultNetwork||exports.Network.Solana}setWallet(e){this.walletInfo=e}setWalletType(e){this.walletType=e,E.saveWalletType(e)}getWallet(){return this.walletInfo}getPhantomAdapter(){return this.phantomAdapter}getWalletType(){return this.walletType}get wallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===this.defaultNetwork))||null}get address(){var e;return(null===(e=this.wallet)||void 0===e?void 0:e.address)||null}get network(){var e;return(null===(e=this.wallet)||void 0===e?void 0:e.network)||null}get ethereumWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.address===E.getSwitchedAccountAddress()||e.network===exports.Network.Ethereum&&"Main"===e.wallet_set))||null}get ethereumAddress(){var e;return(null===(e=this.ethereumWallet)||void 0===e?void 0:e.address)||null}get solanaWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Solana&&"Main"===e.wallet_set))||null}get forwardSolanaWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Solana&&"Forward-0"===e.wallet_set))||null}get forwardSolanaAddress(){var e;return(null===(e=this.forwardSolanaWallet)||void 0===e?void 0:e.address)||null}get forwardEthereumWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Ethereum&&"Forward-0"===e.wallet_set))||null}get forwardEthereumAddress(){var e;return(null===(e=this.forwardEthereumWallet)||void 0===e?void 0:e.address)||null}get solanaAddress(){var e;return(null===(e=this.solanaWallet)||void 0===e?void 0:e.address)||null}get id(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.id)||null}get social_links(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.social_links)||null}async reconnect(){try{if("phantom"===E.getWalletType())return await this.connectPhantom();{const e=await this.getSession();return this.setWallet(e),e}}catch(e){return null}}async connectPhantom(){try{if(this.phantomAdapter||(this.phantomAdapter=new D),await this.phantomAdapter.connect(),!this.phantomAdapter.publicKey)throw new Error("Failed to connect to Phantom wallet");const e=this.phantomAdapter.publicKey.toString(),t={id:r.v4(),is_exported:!1,address:e,network:exports.Network.Solana,type:exports.WalletType.Phantom,wallets:[{id:e,address:e,network:exports.Network.Solana,wallet_type:exports.WalletType.Phantom,wallet_set:"Main"}],social_links:[],social_infos:[],account_info:{name:null}};return this.setWallet(t),this.setWalletType("phantom"),t}catch(e){throw console.error("Phantom connect error:",e),new Error(e instanceof Error?e.message:"Failed to connect to Phantom wallet")}}async updateAccountName(e){if(!this.walletInfo)throw new Error("No wallet info");const t=await this.api.post("/account/update",{name:e},{withCredentials:!0});return this.walletInfo.account_info.name=e,t.data}async signSolanaTransaction(e){try{if(!this.walletInfo)throw new Error("No wallet info");if(!this.solanaConnection)throw new Error("No rpc connection");const{blockhash:n}=await this.solanaConnection.getLatestBlockhash();if(b(e)?e.message.recentBlockhash=n:e.recentBlockhash=n,this.phantomAdapter&&this.phantomAdapter.publicKey)return await this.phantomAdapter.signTransaction(e);const r=this.solanaWallet;if(!r)throw new Error("No solana wallet available");const o={user_id:this.walletInfo.id,address:r.address,network:exports.Network.Solana,tx:{Solana:p.default.encode(b(e)?e.message.serialize():e.serializeMessage())}},s=await this.api.post("/sign2",o,{withCredentials:!0}),{signature:a}=s.data;return e.addSignature(new t.PublicKey(r.address),Bf.from(p.default.decode(a))),e}catch(e){throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async signEthereumEip712(e){if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const t={user_id:this.walletInfo.id,address:this.ethereumAddress,network:exports.Network.Ethereum,tx:{EthereumEip712:e}},n=await this.api.post("/sign2",t,{withCredentials:!0}),{signature:r}=n.data;return r}async sendSolanaTransaction(e){if(!this.solanaConnection)throw new Error("No rpc connection");try{return await this.solanaConnection.sendRawTransaction(e,{maxRetries:3,skipPreflight:!1})}catch(e){throw e}}async sendEthereumTransaction(e){if(!this.ethereumProvider)throw new Error("No Ethereum provider");try{return await this.ethereumProvider.sendRawTransaction({serializedTransaction:e})}catch(e){throw e}}async sendEmailVerificationCode(e){await this.api.post("/send_verification",{email:e})}async sendPhoneVerificationCode(e){e.startsWith("+")||(e=`+${e}`),await this.api.post("/send_verification",{phone:e,type:"phone"})}async verifyEmailVerificationCode({email:e,code:t}){const n={type:"Email",data:{network:this.defaultNetwork,email:e,code:t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async verifyPhoneVerificationCode({phone:e,code:t}){const n={type:"Phone",data:{network:this.defaultNetwork,phone:e,code:t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async twitterLogin(e){const t={type:"TwitterOAuth",data:{network:this.defaultNetwork,...e}},n=(await this.api.post("/login",t,{withCredentials:!0})).data;return this.setWallet(n),this.setWalletType("embedded"),n}async googleLogin(e){const t={type:"GoogleOAuth",data:{network:this.defaultNetwork,...e}},n=(await this.api.post("/login",t,{withCredentials:!0})).data;return this.setWallet(n),this.setWalletType("embedded"),n}async oauthLogin(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async loginWithChallenge(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async oauthInit(e){return(await this.api.post("/oauth/init",e)).data}async getSignChallenge(e){return(await this.api.get(`/challenge?method=${e.method}&id=${e.id}`)).data}async getSession(){const e=(await this.api.get("/session",{withCredentials:!0})).data,{access_token:t,...n}=e;return t&&E.saveAccessToken(t),e}async logout(){this.phantomAdapter?(this.phantomAdapter.disconnect(),this.phantomAdapter=null):await this.api.post("/logout",{},{withCredentials:!0}),this.setWallet(null),E.clear()}async getOAuth2ClientId(e){return(await this.api.get(`/oauth_id/${e}`)).data.client_id}setSelectedWallet(e){this.selectedWalletId=e}getSelectedWallet(){return this.selectedWalletId}async getSolanaBalance(){if(!this.solanaConnection||!this.solanaAddress)throw new Error("Solana connection not available");return(await this.solanaConnection.getBalance(new t.PublicKey(this.solanaAddress))/t.LAMPORTS_PER_SOL).toString()}async getEthereumBalance(){if(!this.ethereumProvider||!this.ethereumAddress)throw new Error("Ethereum provider not available");return pf(await this.ethereumProvider.getBalance({address:this.ethereumAddress}))}async fetchCoinbaseToken(e,t="solana"){return(await this.api.post("/ramp/coinbase",{addresses:[{address:e,blockchains:[t]}],assets:["solana"===t?"SOL":"ETH"]})).data.token}viemSignerAdapter(){return{signTypedData:async e=>{if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const t={user_id:this.walletInfo.id,address:this.ethereumAddress,network:exports.Network.Ethereum,tx:{EthereumEip712:e}},n=await this.api.post("/sign2",t,{withCredentials:!0}),{signature:r}=n.data,o=p.default.decode(r),s=o[64];return Cd({r:`0x${Bf.from(o.slice(0,32)).toString("hex")}`,s:`0x${Bf.from(o.slice(32,64)).toString("hex")}`,v:BigInt(s+27)})}}}async createMiddleAccount(e){try{return(await this.middleAccountApi.post("/create",e)).data}catch(e){throw new Error(e instanceof Error?e.message:"Failed to create middle account")}}async getCoinbaseOnrampUrlForMiddleAccount(e){try{const t={sessionToken:await this.fetchCoinbaseToken(e.middleAccountAddress,e.network===exports.Network.Solana?"solana":"ethereum"),presetCryptoAmount:Number(e.amount),redirectUrl:e.redirectUrl||window.location.href};return gf(t)}catch(e){throw new Error(e instanceof Error?e.message:"Failed to get Coinbase onramp URL")}}async getOrderState(e){try{return(await this.middleAccountApi.get(`/order/${e}`)).data}catch(e){throw new Error(e instanceof Error?e.message:"Failed to get order status")}}async transfer(e){var t,n;if(!this.walletInfo)throw new Error("No wallet info available");const r={user_id:this.walletInfo.id,from:e.from,to:e.to,amount:e.amount,decimals:e.decimals,token:e.token,network:e.network,chain_id:e.chain_id};try{return(await this.api.post("/transfer",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Transfer failed")}}async buildTransaction(e){var t,n;try{return(await this.api.post("/build_transaction",e,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to build transaction")}}}var gh=function(){return gh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},gh.apply(this,arguments)};function bh(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function yh(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}"function"==typeof SuppressedError&&SuppressedError;var wh=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,vh=yh(function(e){return wh.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),xh="-ms-",Eh="-moz-",Ph="-webkit-",kh="comm",Ah="rule",Ih="decl",Nh="@keyframes",Sh=Math.abs,Th=String.fromCharCode,$h=Object.assign;function Bh(e){return e.trim()}function Ch(e,t){return(e=t.exec(e))?e[0]:e}function Oh(e,t,n){return e.replace(t,n)}function Rh(e,t,n){return e.indexOf(t,n)}function zh(e,t){return 0|e.charCodeAt(t)}function _h(e,t,n){return e.slice(t,n)}function Mh(e){return e.length}function Fh(e){return e.length}function jh(e,t){return t.push(e),e}function Lh(e,t){return e.filter(function(e){return!Ch(e,t)})}var Uh=1,Dh=1,Gh=0,qh=0,Vh=0,Wh="";function Hh(e,t,n,r,o,s,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:s,line:Uh,column:Dh,length:a,return:"",siblings:i}}function Yh(e,t){return $h(Hh("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Zh(e){for(;e.root;)e=Yh(e.root,{children:[e]});jh(e,e.siblings)}function Kh(){return Vh=qh>0?zh(Wh,--qh):0,Dh--,10===Vh&&(Dh=1,Uh--),Vh}function Jh(){return Vh=qh<Gh?zh(Wh,qh++):0,Dh++,10===Vh&&(Dh=1,Uh++),Vh}function Qh(){return zh(Wh,qh)}function Xh(){return qh}function ep(e,t){return _h(Wh,e,t)}function tp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function np(e){return Bh(ep(qh-1,sp(91===e?e+2:40===e?e+1:e)))}function rp(e){for(;(Vh=Qh())&&Vh<33;)Jh();return tp(e)>2||tp(Vh)>3?"":" "}function op(e,t){for(;--t&&Jh()&&!(Vh<48||Vh>102||Vh>57&&Vh<65||Vh>70&&Vh<97););return ep(e,Xh()+(t<6&&32==Qh()&&32==Jh()))}function sp(e){for(;Jh();)switch(Vh){case e:return qh;case 34:case 39:34!==e&&39!==e&&sp(Vh);break;case 40:41===e&&sp(e);break;case 92:Jh()}return qh}function ap(e,t){for(;Jh()&&e+Vh!==57&&(e+Vh!==84||47!==Qh()););return"/*"+ep(t,qh-1)+"*"+Th(47===e?e:Jh())}function ip(e){for(;!tp(Qh());)Jh();return ep(e,qh)}function cp(e){return function(e){return Wh="",e}(up("",null,null,null,[""],e=function(e){return Uh=Dh=1,Gh=Mh(Wh=e),qh=0,[]}(e),0,[0],e))}function up(e,t,n,r,o,s,a,i,c){for(var u=0,l=0,d=a,f=0,h=0,p=0,m=1,g=1,b=1,y=0,w="",v=o,x=s,E=r,P=w;g;)switch(p=y,y=Jh()){case 40:if(108!=p&&58==zh(P,d-1)){-1!=Rh(P+=Oh(np(y),"&","&\f"),"&\f",Sh(u?i[u-1]:0))&&(b=-1);break}case 34:case 39:case 91:P+=np(y);break;case 9:case 10:case 13:case 32:P+=rp(p);break;case 92:P+=op(Xh()-1,7);continue;case 47:switch(Qh()){case 42:case 47:jh(dp(ap(Jh(),Xh()),t,n,c),c);break;default:P+="/"}break;case 123*m:i[u++]=Mh(P)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+l:-1==b&&(P=Oh(P,/\f/g,"")),h>0&&Mh(P)-d&&jh(h>32?fp(P+";",r,n,d-1,c):fp(Oh(P," ","")+";",r,n,d-2,c),c);break;case 59:P+=";";default:if(jh(E=lp(P,t,n,u,l,o,i,w,v=[],x=[],d,s),s),123===y)if(0===l)up(P,t,E,E,v,s,d,i,x);else switch(99===f&&110===zh(P,3)?100:f){case 100:case 108:case 109:case 115:up(e,E,E,r&&jh(lp(e,E,E,0,0,o,i,w,o,v=[],d,x),x),o,x,d,i,r?v:x);break;default:up(P,E,E,E,[""],x,0,i,x)}}u=l=h=0,m=b=1,w=P="",d=a;break;case 58:d=1+Mh(P),h=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==Kh())continue;switch(P+=Th(y),y*m){case 38:b=l>0?1:(P+="\f",-1);break;case 44:i[u++]=(Mh(P)-1)*b,b=1;break;case 64:45===Qh()&&(P+=np(Jh())),f=Qh(),l=d=Mh(w=P+=ip(Xh())),y++;break;case 45:45===p&&2==Mh(P)&&(m=0)}}return s}function lp(e,t,n,r,o,s,a,i,c,u,l,d){for(var f=o-1,h=0===o?s:[""],p=Fh(h),m=0,g=0,b=0;m<r;++m)for(var y=0,w=_h(e,f+1,f=Sh(g=a[m])),v=e;y<p;++y)(v=Bh(g>0?h[y]+" "+w:Oh(w,/&\f/g,h[y])))&&(c[b++]=v);return Hh(e,t,n,0===o?Ah:i,c,u,l,d)}function dp(e,t,n,r){return Hh(e,t,n,kh,Th(Vh),_h(e,2,-2),0,r)}function fp(e,t,n,r,o){return Hh(e,t,n,Ih,_h(e,0,r),_h(e,r+1,-1),r,o)}function hp(e,t,n){switch(function(e,t){return 45^zh(e,0)?(((t<<2^zh(e,0))<<2^zh(e,1))<<2^zh(e,2))<<2^zh(e,3):0}(e,t)){case 5103:return Ph+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ph+e+e;case 4789:return Eh+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ph+e+Eh+e+xh+e+e;case 5936:switch(zh(e,t+11)){case 114:return Ph+e+xh+Oh(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ph+e+xh+Oh(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ph+e+xh+Oh(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ph+e+xh+e+e;case 6165:return Ph+e+xh+"flex-"+e+e;case 5187:return Ph+e+Oh(e,/(\w+).+(:[^]+)/,Ph+"box-$1$2"+xh+"flex-$1$2")+e;case 5443:return Ph+e+xh+"flex-item-"+Oh(e,/flex-|-self/g,"")+(Ch(e,/flex-|baseline/)?"":xh+"grid-row-"+Oh(e,/flex-|-self/g,""))+e;case 4675:return Ph+e+xh+"flex-line-pack"+Oh(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ph+e+xh+Oh(e,"shrink","negative")+e;case 5292:return Ph+e+xh+Oh(e,"basis","preferred-size")+e;case 6060:return Ph+"box-"+Oh(e,"-grow","")+Ph+e+xh+Oh(e,"grow","positive")+e;case 4554:return Ph+Oh(e,/([^-])(transform)/g,"$1"+Ph+"$2")+e;case 6187:return Oh(Oh(Oh(e,/(zoom-|grab)/,Ph+"$1"),/(image-set)/,Ph+"$1"),e,"")+e;case 5495:case 3959:return Oh(e,/(image-set\([^]*)/,Ph+"$1$`$1");case 4968:return Oh(Oh(e,/(.+:)(flex-)?(.*)/,Ph+"box-pack:$3"+xh+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ph+e+e;case 4200:if(!Ch(e,/flex-|baseline/))return xh+"grid-column-align"+_h(e,t)+e;break;case 2592:case 3360:return xh+Oh(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(e,n){return t=n,Ch(e.props,/grid-\w+-end/)})?~Rh(e+(n=n[t].value),"span",0)?e:xh+Oh(e,"-start","")+e+xh+"grid-row-span:"+(~Rh(n,"span",0)?Ch(n,/\d+/):+Ch(n,/\d+/)-+Ch(e,/\d+/))+";":xh+Oh(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(e){return Ch(e.props,/grid-\w+-start/)})?e:xh+Oh(Oh(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Oh(e,/(.+)-inline(.+)/,Ph+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Mh(e)-1-t>6)switch(zh(e,t+1)){case 109:if(45!==zh(e,t+4))break;case 102:return Oh(e,/(.+:)(.+)-([^]+)/,"$1"+Ph+"$2-$3$1"+Eh+(108==zh(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Rh(e,"stretch",0)?hp(Oh(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Oh(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,n,r,o,s,a,i){return xh+n+":"+r+i+(o?xh+n+"-span:"+(s?a:+a-+r)+i:"")+e});case 4949:if(121===zh(e,t+6))return Oh(e,":",":"+Ph)+e;break;case 6444:switch(zh(e,45===zh(e,14)?18:11)){case 120:return Oh(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ph+(45===zh(e,14)?"inline-":"")+"box$3$1"+Ph+"$2$3$1"+xh+"$2box$3")+e;case 100:return Oh(e,":",":"+xh)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Oh(e,"scroll-","scroll-snap-")+e}return e}function pp(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function mp(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ih:return e.return=e.return||e.value;case kh:return"";case Nh:return e.return=e.value+"{"+pp(e.children,r)+"}";case Ah:if(!Mh(e.value=e.props.join(",")))return""}return Mh(n=pp(e.children,r))?e.return=e.value+"{"+n+"}":""}function gp(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ih:return void(e.return=hp(e.value,e.length,n));case Nh:return pp([Yh(e,{value:Oh(e.value,"@","@"+Ph)})],r);case Ah:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,function(t){switch(Ch(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Zh(Yh(e,{props:[Oh(t,/:(read-\w+)/,":-moz-$1")]})),Zh(Yh(e,{props:[t]})),$h(e,{props:Lh(n,r)});break;case"::placeholder":Zh(Yh(e,{props:[Oh(t,/:(plac\w+)/,":"+Ph+"input-$1")]})),Zh(Yh(e,{props:[Oh(t,/:(plac\w+)/,":-moz-$1")]})),Zh(Yh(e,{props:[Oh(t,/:(plac\w+)/,xh+"input-$1")]})),Zh(Yh(e,{props:[t]})),$h(e,{props:Lh(n,r)})}return""})}}var bp={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},yp="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",wp="active",vp="data-styled-version",xp="6.1.19",Ep="/*!sc*/\n",Pp="undefined"!=typeof window&&"undefined"!=typeof document,kp=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),Ap=/invalid hook call/i,Ip=new Set,Np=function(e,t){if("production"!==process.env.NODE_ENV){var n=t?' with the id of "'.concat(t,'"'):"",r="The component ".concat(e).concat(n," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.\nSee https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\n",s=console.error;try{var a=!0;console.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ap.test(e)?(a=!1,Ip.delete(r)):s.apply(void 0,bh([e],t,!1))},o.useRef(),a&&!Ip.has(r)&&(console.warn(r),Ip.add(r))}catch(e){Ap.test(e.message)&&Ip.delete(r)}finally{console.error=s}}},Sp=Object.freeze([]),Tp=Object.freeze({});var $p=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Bp=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Cp=/(^-|-$)/g;function Op(e){return e.replace(Bp,"-").replace(Cp,"")}var Rp=/(a)(d)/gi,zp=function(e){return String.fromCharCode(e+(e>25?39:97))};function _p(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=zp(t%52)+n;return(zp(t%52)+n).replace(Rp,"$1-$2")}var Mp,Fp=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},jp=function(e){return Fp(5381,e)};function Lp(e){return _p(jp(e)>>>0)}function Up(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function Dp(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Gp="function"==typeof Symbol&&Symbol.for,qp=Gp?Symbol.for("react.memo"):60115,Vp=Gp?Symbol.for("react.forward_ref"):60112,Wp={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Hp={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Yp={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Zp=((Mp={})[Vp]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Mp[qp]=Yp,Mp);function Kp(e){return("type"in(t=e)&&t.type.$$typeof)===qp?Yp:"$$typeof"in e?Zp[e.$$typeof]:Wp;var t}var Jp=Object.defineProperty,Qp=Object.getOwnPropertyNames,Xp=Object.getOwnPropertySymbols,em=Object.getOwnPropertyDescriptor,tm=Object.getPrototypeOf,nm=Object.prototype;function rm(e,t,n){if("string"!=typeof t){if(nm){var r=tm(t);r&&r!==nm&&rm(e,r,n)}var o=Qp(t);Xp&&(o=o.concat(Xp(t)));for(var s=Kp(e),a=Kp(t),i=0;i<o.length;++i){var c=o[i];if(!(c in Hp||n&&n[c]||a&&c in a||s&&c in s)){var u=em(t,c);try{Jp(e,c,u)}catch(e){}}}}return e}function om(e){return"function"==typeof e}function sm(e){return"object"==typeof e&&"styledComponentId"in e}function am(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function im(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function cm(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function um(e,t,n){if(void 0===n&&(n=!1),!n&&!cm(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=um(e[r],t[r]);else if(cm(t))for(var r in t)e[r]=um(e[r],t[r]);return e}function lm(e,t){Object.defineProperty(e,"toString",{value:t})}var dm="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function fm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,s=e.length;o<s;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function hm(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(fm.apply(void 0,bh([dm[e]],t,!1)).trim())}var pm=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw hm(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var a=this.indexOfGroup(e+1),i=(s=0,t.length);s<i;s++)this.tag.insertRule(a,t[s])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat(Ep);return t},e}(),mm=1<<30,gm=new Map,bm=new Map,ym=1,wm=function(e){if(gm.has(e))return gm.get(e);for(;bm.has(ym);)ym++;var t=ym++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>mm))throw hm(16,"".concat(t));return gm.set(e,t),bm.set(t,e),t},vm=function(e,t){ym=t+1,gm.set(e,t),bm.set(t,e)},xm="style[".concat(yp,"][").concat(vp,'="').concat(xp,'"]'),Em=new RegExp("^".concat(yp,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Pm=function(e,t,n){for(var r,o=n.split(","),s=0,a=o.length;s<a;s++)(r=o[s])&&e.registerName(t,r)},km=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(Ep),o=[],s=0,a=r.length;s<a;s++){var i=r[s].trim();if(i){var c=i.match(Em);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(vm(l,u),Pm(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(i)}}},Am=function(e){for(var t=document.querySelectorAll(xm),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(yp)!==wp&&(km(e,o),o.parentNode&&o.parentNode.removeChild(o))}};var Im=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(yp,"]")));return t[t.length-1]}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(yp,wp),r.setAttribute(vp,xp);var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,s),r},Nm=function(){function e(e){this.element=Im(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw hm(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Sm=function(){function e(e){this.element=Im(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),Tm=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),$m=Pp,Bm={isServer:!Pp,useCSSOMInjection:!kp},Cm=function(){function e(e,t,n){void 0===e&&(e=Tp),void 0===t&&(t={});var r=this;this.options=gh(gh({},Bm),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&Pp&&$m&&($m=!1,Am(this)),lm(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return bm.get(e)}(n);if(void 0===o)return"continue";var s=e.names.get(o),a=t.getGroup(n);if(void 0===s||!s.size||0===a.length)return"continue";var i="".concat(yp,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(a).concat(i,'{content:"').concat(c,'"}').concat(Ep)},s=0;s<n;s++)o(s);return r}(r)})}return e.registerId=function(e){return wm(e)},e.prototype.rehydrate=function(){!this.server&&Pp&&Am(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(gh(gh({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new Tm(n):t?new Nm(n):new Sm(n)}(this.options),new pm(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(wm(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(wm(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(wm(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Om=/&/g,Rm=/^\s*\/\/.*$/gm;function zm(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=zm(e.children,t)),e})}var _m=new Cm,Mm=function(){var e,t,n,r=Tp,o=r.options,s=void 0===o?Tp:o,a=r.plugins,i=void 0===a?Sp:a,c=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},u=i.slice();u.push(function(e){e.type===Ah&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Om,t).replace(n,c))}),s.prefix&&u.push(gp),u.push(mp);var l=function(r,o,a,i){void 0===o&&(o=""),void 0===a&&(a=""),void 0===i&&(i="&"),e=i,t=o,n=new RegExp("\\".concat(t,"\\b"),"g");var c=r.replace(Rm,""),l=cp(a||o?"".concat(a," ").concat(o," { ").concat(c," }"):c);s.namespace&&(l=zm(l,s.namespace));var d,f=[];return pp(l,function(e){var t=Fh(e);return function(n,r,o,s){for(var a="",i=0;i<t;i++)a+=e[i](n,r,o,s)||"";return a}}(u.concat((d=function(e){return f.push(e)},function(e){e.root||(e=e.return)&&d(e)})))),f};return l.hash=i.length?i.reduce(function(e,t){return t.name||hm(15),Fp(e,t.name)},5381).toString():"",l}(),Fm=m.default.createContext({shouldForwardProp:void 0,styleSheet:_m,stylis:Mm});function jm(){return o.useContext(Fm)}Fm.Consumer,m.default.createContext(void 0);var Lm=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Mm);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,lm(this,function(){throw hm(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=Mm),this.name+e.hash},e}(),Um=function(e){return e>="A"&&e<="Z"};function Dm(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Um(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Gm=function(e){return null==e||!1===e||""===e},qm=function(e){var t,n,r=[];for(var o in e){var s=e[o];e.hasOwnProperty(o)&&!Gm(s)&&(Array.isArray(s)&&s.isCss||om(s)?r.push("".concat(Dm(o),":"),s,";"):cm(s)?r.push.apply(r,bh(bh(["".concat(o," {")],qm(s),!1),["}"],!1)):r.push("".concat(Dm(o),": ").concat((t=o,null==(n=s)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in bp||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Vm(e,t,n,r){if(Gm(e))return[];if(sm(e))return[".".concat(e.styledComponentId)];if(om(e)){if(!om(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof Lm||cm(o)||null===o||console.error("".concat(Up(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Vm(o,t,n,r)}var s;return e instanceof Lm?n?(e.inject(n,r),[e.getName(r)]):[e]:cm(e)?qm(e):Array.isArray(e)?Array.prototype.concat.apply(Sp,e.map(function(e){return Vm(e,t,n,r)})):[e.toString()]}var Wm=jp(xp),Hm=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(om(n)&&!sm(n))return!1}return!0}(e),this.componentId=t,this.baseHash=Fp(Wm,t),this.baseStyle=n,Cm.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=am(r,this.staticRulesId);else{var o=im(Vm(this.rules,e,t,n)),s=_p(Fp(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,s)){var a=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,a)}r=am(r,s),this.staticRulesId=s}else{for(var i=Fp(this.baseHash,n.hash),c="",u=0;u<this.rules.length;u++){var l=this.rules[u];if("string"==typeof l)c+=l,"production"!==process.env.NODE_ENV&&(i=Fp(i,l));else if(l){var d=im(Vm(l,e,t,n));i=Fp(i,d+u),c+=d}}if(c){var f=_p(i>>>0);t.hasNameForId(this.componentId,f)||t.insertRules(this.componentId,f,n(c,".".concat(f),void 0,this.componentId)),r=am(r,f)}}return r},e}(),Ym=m.default.createContext(void 0);Ym.Consumer;var Zm={},Km=new Set;function Jm(e,t,n){var r=sm(e),s=e,a=!Dp(e),i=t.attrs,c=void 0===i?Sp:i,u=t.componentId,l=void 0===u?function(e,t){var n="string"!=typeof e?"sc":Op(e);Zm[n]=(Zm[n]||0)+1;var r="".concat(n,"-").concat(Lp(xp+n+Zm[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):u,d=t.displayName,f=void 0===d?function(e){return Dp(e)?"styled.".concat(e):"Styled(".concat(Up(e),")")}(e):d,h=t.displayName&&t.componentId?"".concat(Op(t.displayName),"-").concat(t.componentId):t.componentId||l,p=r&&s.attrs?s.attrs.concat(c).filter(Boolean):c,g=t.shouldForwardProp;if(r&&s.shouldForwardProp){var b=s.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;g=function(e,t){return b(e,t)&&y(e,t)}}else g=b}var w=new Hm(n,h,r?s.componentStyle:void 0);function v(e,t){return function(e,t,n){var r=e.attrs,s=e.componentStyle,a=e.defaultProps,i=e.foldedComponentIds,c=e.styledComponentId,u=e.target,l=m.default.useContext(Ym),d=jm(),f=e.shouldForwardProp||d.shouldForwardProp;"production"!==process.env.NODE_ENV&&o.useDebugValue(c);var h=function(e,t,n){return void 0===n&&(n=Tp),e.theme!==n.theme&&e.theme||t||n.theme}(t,l,a)||Tp,p=function(e,t,n){for(var r,o=gh(gh({},t),{className:void 0,theme:n}),s=0;s<e.length;s+=1){var a=om(r=e[s])?r(o):r;for(var i in a)o[i]="className"===i?am(o[i],a[i]):"style"===i?gh(gh({},o[i]),a[i]):a[i]}return t.className&&(o.className=am(o.className,t.className)),o}(r,t,h),g=p.as||u,b={};for(var y in p)void 0===p[y]||"$"===y[0]||"as"===y||"theme"===y&&p.theme===h||("forwardedAs"===y?b.as=p.forwardedAs:f&&!f(y,g)||(b[y]=p[y],f||"development"!==process.env.NODE_ENV||vh(y)||Km.has(y)||!$p.has(g)||(Km.add(y),console.warn('styled-components: it looks like an unknown prop "'.concat(y,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var w=function(e,t){var n=jm(),r=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return"production"!==process.env.NODE_ENV&&o.useDebugValue(r),r}(s,p);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(w);var v=am(i,c);return w&&(v+=" "+w),p.className&&(v+=" "+p.className),b[Dp(g)&&!$p.has(g)?"class":"className"]=v,n&&(b.ref=n),o.createElement(g,b)}(x,e,t)}v.displayName=f;var x=m.default.forwardRef(v);return x.attrs=p,x.componentStyle=w,x.displayName=f,x.shouldForwardProp=g,x.foldedComponentIds=r?am(s.foldedComponentIds,s.styledComponentId):"",x.styledComponentId=h,x.target=r?s.target:e,Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=r?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)um(e,o[r],!0);return e}({},s.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(Np(f,h),x.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(s,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(f,h)),lm(x,function(){return".".concat(x.styledComponentId)}),a&&rm(x,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),x}function Qm(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var Xm=function(e){return Object.assign(e,{isCss:!0})};function eg(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(om(e)||cm(e))return Xm(Vm(Qm(Sp,bh([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?Vm(r):Xm(Vm(Qm(r,t)))}function tg(e,t,n){if(void 0===n&&(n=Tp),!t)throw hm(1,t);var r=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return e(t,n,eg.apply(void 0,bh([r],o,!1)))};return r.attrs=function(r){return tg(e,t,gh(gh({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return tg(e,t,gh(gh({},n),r))},r}var ng=function(e){return tg(Jm,e)},rg=ng;$p.forEach(function(e){rg[e]=ng(e)}),"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var og="__sc-".concat(yp,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[og]||(window[og]=0),1===window[og]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[og]+=1);const sg={colors:{black:"#000000",white:"#FFFFFF",offWhite:"#F5F5F5",grey:{100:"#F7F7F7",200:"#E6E6E6",300:"#D1D1D1",400:"#B0B0B0",500:"#8C8C8C",600:"#696969",700:"#474747",800:"#2B2B2B",900:"#1A1A1A"},primary:"#000000",secondary:"#B0B0B0",error:"#FF4D4D",success:"#4CAF50",background:{main:"#FFFFFF",secondary:"#F5F5F5",overlay:"rgba(0, 0, 0, 0.7)"},text:{primary:"#000000",secondary:"#474747",tertiary:"#8C8C8C",inverse:"#FFFFFF"},button:{primary:{background:"#000000",text:"#FFFFFF",hover:"#2B2B2B",disabled:"#8C8C8C"},secondary:{background:"#F5F5F5",text:"#000000",hover:"#E6E6E6",disabled:"#D1D1D1"}},border:{light:"#E6E6E6",medium:"#D1D1D1",dark:"#8C8C8C"}},typography:{fontFamily:"'Montserrat', 'Arial', sans-serif",fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeights:{light:300,regular:400,medium:500,semibold:600,bold:700}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{none:"0",sm:"0.125rem",md:"0.25rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},shadows:{none:"none",sm:"0 1px 2px rgba(0, 0, 0, 0.05)",md:"0 4px 6px rgba(0, 0, 0, 0.05)",lg:"0 10px 15px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.1s ease",normal:"0.2s ease",slow:"0.3s ease"}},ag=(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var r=im(eg.apply(void 0,bh([e],t,!1))),o=Lp(r);return new Lm(o,r)})`
|
|
12
|
+
const Ul=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Dl=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Gl=BigInt(0),ql=BigInt(1),Vl=BigInt(2),Wl=(e,t)=>(e+t/Vl)/t;const Hl=gl(Ul,void 0,void 0,{sqrt:function(e){const t=Ul,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),a=BigInt(23),i=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=il(l,n,t)*l%t,f=il(d,n,t)*l%t,h=il(f,Vl,t)*u%t,p=il(h,o,t)*h%t,m=il(p,s,t)*p%t,g=il(m,i,t)*m%t,b=il(g,c,t)*g%t,y=il(b,i,t)*m%t,w=il(y,n,t)*l%t,v=il(w,a,t)*p%t,x=il(v,r,t)*u%t,E=il(x,Vl,t);if(!Hl.eql(Hl.sqr(E),e))throw new Error("Cannot find square root");return E}}),Yl=function(e,t){const n=t=>jl({...e,...Ll(t)});return{...n(t),create:n}}({a:Gl,b:BigInt(7),Fp:Hl,n:Dl,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Dl,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-ql*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,a=BigInt("0x100000000000000000000000000000000"),i=Wl(s*e,t),c=Wl(-r*e,t);let u=al(e-i*n-c*o,t),l=al(-i*r-c*s,t);const d=u>a,f=l>a;if(d&&(u=t-u),f&&(l=t-l),u>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}}},ks);var Zl=Object.freeze({__proto__:null,secp256k1:Yl});function Kl(e,t={}){const{recovered:n}=t;if(void 0===e.r)throw new td({signature:e});if(void 0===e.s)throw new td({signature:e});if(n&&void 0===e.yParity)throw new td({signature:e});if(e.r<0n||e.r>Su)throw new nd({value:e.r});if(e.s<0n||e.s>Su)throw new rd({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new od({value:e.yParity})}function Jl(e){if(130!==e.length&&132!==e.length)throw new ed({signature:e});const t=BigInt(di(e,0,32)),n=BigInt(di(e,32,64)),r=(()=>{const t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return Xl(t)}catch{throw new od({value:t})}})();return void 0===r?{r:t,s:n}:{r:t,s:n,yParity:r}}function Ql(e){if(void 0!==e.r&&void 0!==e.s)return function(e){const t="string"==typeof e?Jl(e):e instanceof Uint8Array?function(e){return Jl(ai(e))}(e):"string"==typeof e.r?function(e){const t=(()=>{const t=e.v?Number(e.v):void 0;let n=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof n&&(n=Xl(t)),"number"!=typeof n)throw new od({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}(e):e.v?function(e){return{r:e.r,s:e.s,yParity:Xl(e.v)}}(e):{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}};return Kl(t),t}(e)}function Xl(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return e%2==0?1:0;throw new sd({value:e})}class ed extends Na{constructor({signature:e}){var t;super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${fi((t=e,t instanceof Uint8Array?ai(t):Array.isArray(t)?ai(new Uint8Array(t)):t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class td extends Na{constructor({signature:e}){super(`Signature \`${La(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class nd extends Na{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class rd extends Na{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class od extends Na{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class sd extends Na{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function ad(e,t={}){return"string"==typeof e.chainId?function(e){const{address:t,chainId:n,nonce:r}=e,o=Ql(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}(e):{...e,...t.signature}}const id=Gu("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function cd(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==di(e,-32))throw new ud(e)}else Kl(e.authorization)}let ud=class extends Na{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};async function ld(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",a=void 0!==n?Mt(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Ct(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map(e=>({...e,value:BigInt(e.value)}))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,o,a||s]}))}async function dd(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){const a=r||"latest",i=void 0!==n?Mt(n):void 0;let c=null;if(c=o?await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Mt(s)]},{dedupe:!0}):await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[i||a,Mt(s)]},{dedupe:Boolean(i)}),!c)throw new jr({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(e.chain?.formatters?.transaction?.format||cs)(c)}async function fd(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Lr({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||lc)(n)}async function hd(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:a,validation:i}=t;try{const t=[];for(const e of o){const n=e.blockOverrides?Pi(e.blockOverrides):void 0,r=e.calls.map(e=>{const t=e,n=t.account?ar(t.account):void 0,r=t.abi?cr(t):t.data,o={...t,data:t.dataSuffix?jn([r||"0x",t.dataSuffix]):r,from:t.from??n?.address};return ns(o),Jo(o)}),o=e.stateOverrides?es(e.stateOverrides):void 0;t.push({blockOverrides:n,calls:r,stateOverrides:o})}const c=("bigint"==typeof n?Mt(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:s,traceTransfers:a,validation:i},c]})).map((e,t)=>({...us(e),calls:e.calls.map((e,n)=>{const{abi:r,args:s,functionName:a,to:i}=o[t].calls[n],c=e.error?.data??e.returnData,u=BigInt(e.gasUsed),l=e.logs?.map(e=>Gs(e)),d="0x1"===e.status?"success":"failure",f=r&&"success"===d&&"0x"!==c?Hs({abi:r,data:c,functionName:a}):null,h=(()=>{if("success"===d)return;let t;return"0x"===e.error?.data?t=new Qe:e.error&&(t=new Hr(e.error)),t?No(t,{abi:r??[],address:i??"0x",args:s,functionName:a??"<unknown>"}):void 0})();return{data:c,gasUsed:u,logs:l,status:d,..."success"===d?{result:f}:{error:h}}})}))}catch(e){const t=e,n=Yo(t,{});if(n instanceof Ho)throw t;throw n}}function pd(e){let t=!0,n="",r=0,o="",s=!1;for(let a=0;a<e.length;a++){const i=e[a];if(["(",")",","].includes(i)&&(t=!0),"("===i&&r++,")"===i&&r--,t)if(0!==r)" "!==i?(o+=i,n+=i):","!==e[a-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===i&&["event","function","error",""].includes(o))o="";else if(o+=i,")"===i){s=!0;break}}if(!s)throw new Na("Unable to normalize signature.");return o}function md(e,t){const n=typeof e,r=t.type;switch(r){case"address":return xu(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every((t,n)=>md(Object.values(e)[n],t)):/^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)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every(e=>md(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})))}}function gd(e,t,n){for(const r in e){const o=e[r],s=t[r];if("tuple"===o.type&&"tuple"===s.type&&"components"in o&&"components"in s)return gd(o.components,s.components,n[r]);const a=[o.type,s.type];if((()=>!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&xu(n[r],{strict:!1}))())return a}}function bd(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||"string"==typeof e?Me(e):e;return{...r,...n?{hash:vd(r)}:{}}}function yd(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=mi(t,{strict:!1}),a=e.filter(e=>s?"function"===e.type||"error"===e.type?wd(e)===di(t,0,4):"event"===e.type&&vd(e)===t:"name"in e&&e.name===t);if(0===a.length)throw new Ed({name:t});if(1===a.length)return{...a[0],...o?{hash:vd(a[0])}:{}};let i;for(const e of a){if(!("inputs"in e))continue;if(!r||0===r.length){if(!e.inputs||0===e.inputs.length)return{...e,...o?{hash:vd(e)}:{}};continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==r.length)continue;const t=r.every((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&md(t,r)});if(t){if(i&&"inputs"in i&&i.inputs){const t=gd(e.inputs,i.inputs,r);if(t)throw new xd({abiItem:e,type:t[0]},{abiItem:i,type:t[1]})}i=e}}const c=(()=>{if(i)return i;const[e,...t]=a;return{...e,overloads:t}})();if(!c)throw new Ed({name:t});return{...c,...o?{hash:vd(c)}:{}}}function wd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return yd(t,n)}return e[0]})();return di(vd(t),0,4)}function vd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return yd(t,n)}return e[0]})();return"string"!=typeof t&&"hash"in t&&t.hash?t.hash:bu(ci(function(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return yd(t,n)}return e[0]})();return pd("string"==typeof t?t:J(t))}(t)))}class xd extends Na{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${pd(J(e.abiItem))}\`, and`,`\`${t.type}\` in \`${pd(J(t.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class Ed extends Na{constructor({name:e,data:t,type:n="item"}){super(`ABI ${n}${e?` with name "${e}"`:t?` with data "${t}"`:""} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function Pd(e){const t=e.find(e=>"constructor"===e.type);if(!t)throw new Ed({name:"constructor"});return t}function kd(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[t,n,r]=e;return[Id(t,n,{args:r}),r]}const[t,n]=e;return[t,n]})(),{overloads:r}=t,o=r?Id([t,...r],t.name,{args:n}):t,s=wd(o);const a=n.length>0?Uu(o.inputs,n):void 0;return a?oi(s,a):s}function Ad(e,t={}){return bd(e,t)}function Id(e,t,n){const r=yd(e,t,n);if("function"!==r.type)throw new Ed({name:t,type:"function"});return r}const Nd="0x0000000000000000000000000000000000000000";async function Sd(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:a,traceTransfers:i,validation:c}=t,u=t.account?ar(t.account):void 0;if(a&&!u)throw new He("`account` is required when `traceAssetChanges` is true");const l=u?function(...e){const[t,n]=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return[Pd(t),n]}return e})(),{bytecode:r,args:o}=n;return oi(r,t.inputs?.length&&o?.length?Uu(t.inputs,o):"0x")}(bd("constructor(bytes, bytes)"),{bytecode:Ri,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",kd(Ad("function getBalance(address)"),[u.address])]}):void 0;const d=a?await Promise.all(t.calls.map(async t=>{if(!t.data&&!t.abi)return;const{accessList:n}=await jc(e,{account:u.address,...t,data:t.abi?cr(t):t.data});return n.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],f=await hd(e,{blockNumber:n,blockTag:r,blocks:[...a?[{calls:[{data:l}],stateOverrides:s},{calls:d.map((e,t)=>({abi:[Ad("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]}]:[],{calls:[...o,{}].map(e=>({...e,from:u?.address})),stateOverrides:s},...a?[{calls:[{data:l}]},{calls:d.map((e,t)=>({abi:[Ad("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Ad("function decimals() returns (uint256)")],functionName:"decimals",from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Ad("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Ad("function symbol() returns (string)")],functionName:"symbol",from:Nd,nonce:t})),stateOverrides:[{address:Nd,nonce:0}]}]:[]],traceTransfers:i,validation:c}),h=a?f[2]:f[0],[p,m,,g,b,y,w,v]=a?f:[],{calls:x,...E}=h,P=x.slice(0,-1)??[],k=[...p?.calls??[],...m?.calls??[]].map(e=>"success"===e.status?Bt(e.data):null),A=[...g?.calls??[],...b?.calls??[]].map(e=>"success"===e.status?Bt(e.data):null),I=(y?.calls??[]).map(e=>"success"===e.status?e.result:null),N=(v?.calls??[]).map(e=>"success"===e.status?e.result:null),S=(w?.calls??[]).map(e=>"success"===e.status?e.result:null),T=[];for(const[e,t]of A.entries()){const n=k[e];if("bigint"!=typeof t)continue;if("bigint"!=typeof n)continue;const r=I[e-1],o=N[e-1],s=S[e-1],a=(()=>0===e?{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",decimals:18,symbol:"ETH"}:{address:d[e-1],decimals:s||r?Number(r??1):void 0,symbol:o??void 0})();T.some(e=>e.token.address===a.address)||T.push({token:a,value:{pre:n,post:t,diff:t-n}})}return{assetChanges:T,block:E,results:P}}const Td="0x6492649264926492649264926492649264926492649264926492649264926492";function $d(e){try{return function(e){if(di(e,-32)!==Td)throw new Bd(e)}(e),!0}catch{return!1}}class Bd extends Na{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function Cd({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(0===o||1===o)return o;if(r&&(27n===r||28n===r||r>=35n))return r%2n==0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),a=`0x${new Yl.Signature(Bt(e),Bt(t)).toCompactHex()}${0===s?"1b":"1c"}`;return"hex"===n?a:qt(a)}async function Od(e,t){const{address:n,hash:r,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??e.chain?.contracts?.erc6492Verifier?.address,multicallAddress:s=t.multicallAddress??e.chain?.contracts?.multicall3?.address}=t,a=(()=>{const e=t.signature;return De(e)?e:"object"==typeof e&&"r"in e&&"s"in e?Cd(e):_t(e)})();try{return function(e){try{return cd(e),!0}catch{return!1}}(a)?await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:a}=t,{authorization:i,data:c,signature:u,to:l}=function(e){cd(e);const t=pi(di(e,-64,-32)),n=di(e,-t-64,-64),r=di(e,0,-t-64),[o,s,a]=Lu(id,n);return{authorization:ad({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...a&&"0x"!==a?{data:a,to:s}:{}}}(t.signature),d=await Dc(e,{address:n,blockNumber:r,blockTag:o});if(d===Ln(["0xef0100",i.address]))return await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:a}=t,i=await je(e,Zi,"readContract")({address:n,abi:Bi,args:[s,a],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(e=>{if(e instanceof Gr)throw new Rd;throw e});if(i.startsWith("0x1626ba7e"))return!0;throw new Rd}(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:u});const f={address:i.address,chainId:Number(i.chainId),nonce:Number(i.nonce),r:Mt(i.r,{size:32}),s:Mt(i.s,{size:32}),yParity:i.yParity},h=await async function({address:e,authorization:t,signature:n}){return Fs(zn(e),await Ro({authorization:t,signature:n}))}({address:n,authorization:f});if(!h)throw new Rd;const p=await je(e,Zi,"readContract")({...a?{address:a}:{code:Mi},authorizationList:[f],abi:ki,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:l??n,callData:c}]:[],{allowFailure:!0,target:n,callData:cr({abi:Bi,functionName:"isValidSignature",args:[s,u]})}]]}),m=p[p.length-1]?.returnData;if(m?.startsWith("0x1626ba7e"))return!0;throw new Rd}(e,{...t,multicallAddress:s,signature:a}):await async function(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:a,verifierAddress:i,...c}=t,u=await(async()=>r||o?$d(a)?a:function(e){const{data:t,signature:n,to:r}=e;return oi(Uu(Gu("address, bytes, bytes"),[r,t,n]),Td)}({data:o,signature:a,to:r}):a)(),l=i?{to:i,data:cr({abi:Ci,functionName:"isValidSig",args:[n,s,u]}),...c}:{data:Ui({abi:Ci,args:[n,s,u],bytecode:_i}),...c},{data:d}=await je(e,Hi,"call")(l).catch(e=>{if(e instanceof Dr)throw new Rd;throw e});if(function(e,t={}){let n=e;if(t.size&&($t(n,{size:t.size}),n=Tt(n)),"0x00"===Tt(n))return!1;if("0x01"===Tt(n))return!0;throw new Nt(n)}(d??"0x0"))return!0;throw new Rd}(e,{...t,verifierAddress:o,signature:a})}catch(e){try{if(Fs(zn(n),await To({hash:r,signature:a})))return!0}catch{}if(e instanceof Rd)return!1;throw e}}class Rd extends Error{}function zd(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:a=e.pollingInterval}){let i;return(void 0!==s?s:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type))?Xi(Ir(["watchBlockNumber",e.uid,t,n,a]),{onBlockNumber:r,onError:o},r=>tc(async()=>{try{const t=await je(e,sc,"getBlockNumber")({cacheTime:0});if(void 0!==i){if(t===i)return;if(t-i>1&&n)for(let e=i+1n;e<t;e++)r.onBlockNumber(e,i),i=e}(void 0===i||t>i)&&(r.onBlockNumber(t,i),i=t)}catch(e){r.onError?.(e)}},{emitOnBegin:t,interval:a})):Xi(Ir(["watchBlockNumber",e.uid,t,n]),{onBlockNumber:r,onError:o},t=>{let n=!0,r=()=>n=!1;return(async()=>{try{const o=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:s}=await o.subscribe({params:["newHeads"],onData(e){if(!n)return;const r=Bt(e.result?.number);t.onBlockNumber(r,i),i=r},onError(e){t.onError?.(e)}});r=s,n||r()}catch(e){o?.(e)}})(),()=>r()})}const _d=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,Md=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;async function Fd(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:a,signature:i,time:c=new Date,...u}=t,l=function(e){const{scheme:t,statement:n,...r}=e.match(_d)?.groups??{},{chainId:o,expirationTime:s,issuedAt:a,notBefore:i,requestId:c,...u}=e.match(Md)?.groups??{},l=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...r,...u,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...a?{issuedAt:new Date(a)}:{},...i?{notBefore:new Date(i)}:{},...c?{requestId:c}:{},...l?{resources:l}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}(o);if(!l.address)return!1;const d=function(e){const{address:t,domain:n,message:r,nonce:o,scheme:s,time:a=new Date}=e;if(n&&r.domain!==n)return!1;if(o&&r.nonce!==o)return!1;if(s&&r.scheme!==s)return!1;if(r.expirationTime&&a>=r.expirationTime)return!1;if(r.notBefore&&a<r.notBefore)return!1;try{if(!r.address)return!1;if(!Fn(r.address,{strict:!1}))return!1;if(t&&!Fs(r.address,t))return!1}catch{return!1}return!0}({address:n,domain:r,message:l,nonce:s,scheme:a,time:c});if(!d)return!1;const f=ru(o);return Od(e,{address:l.address,hash:f,signature:i,...u})}function jd(e){return{call:t=>Hi(e,t),createAccessList:t=>jc(e,t),createBlockFilter:()=>async function(e){const t=or(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>sr(e,t),createEventFilter:t=>Lc(e,t),createPendingTransactionFilter:()=>Uc(e),estimateContractGas:t=>async function(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:a,...i}=t,c=cr({abi:n,args:o,functionName:s});try{return await je(e,Ms,"estimateGas")({data:`${c}${a?a.replace("0x",""):""}`,to:r,...i})}catch(e){const t=i.account?ar(i.account):void 0;throw No(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:t?.address})}}(e,t),estimateGas:t=>Ms(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o="bigint"==typeof n?Mt(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}(e,t),getBlobBaseFee:()=>async function(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}(e),getBlock:t=>ls(e,t),getBlockNumber:t=>sc(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=void 0!==n?Mt(n):void 0;let s;return s=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:Boolean(o)}),Ct(s)}(e,t),getBytecode:t=>Dc(e,t),getChainId:()=>Os(e),getCode:t=>Dc(e,t),getContractEvents:t=>Vs(e,t),getEip712Domain:t=>async function(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[t,s,a,i,c,u,l]=await je(e,Zi,"readContract")({abi:qc,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:s,version:a,chainId:Number(i),verifyingContract:c,salt:u},extensions:l,fields:t}}catch(e){const t=e;if("ContractFunctionExecutionError"===t.name&&"ContractFunctionZeroDataError"===t.cause.name)throw new Gc({address:n});throw t}}(e,t),getEnsAddress:t=>async function(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:a,strict:i}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Di({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some(e=>s.endsWith(e)))return null;const d=null!=o?[xc(s),BigInt(o)]:[xc(s)];try{const t=cr({abi:$i,functionName:"addr",args:d}),o={address:u,abi:Ni,functionName:"resolveWithGateways",args:[Rt(kc(s)),t,a??[yc]],blockNumber:n,blockTag:r},i=je(e,Zi,"readContract"),c=await i(o);if("0x"===c[0])return null;const l=Hs({abi:$i,args:d,functionName:"addr",data:c[0]});return"0x"===l||"0x00"===Tt(l)?null:l}catch(e){if(i)throw e;if(pc(e))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:a,universalResolverAddress:i}){const c=await je(e,Fc,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:i,gatewayUrls:s,strict:a});if(!c)return null;try{return await Mc(e,{record:c,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:a,strict:i}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Di({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();try{const t={address:u,abi:Si,args:[n,s,a??[yc]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},i=je(e,Zi,"readContract"),[c]=await i(t);return c||null}catch(e){if(i)throw e;if(pc(e))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return Di({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),i=s?.ensTlds;if(i&&!i.some(e=>o.endsWith(e)))throw new Error(`${o} is not a valid ENS TLD (${i?.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[c]=await je(e,Zi,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Rt(kc(o))],blockNumber:n,blockTag:r});return c}(e,t),getEnsText:t=>Fc(e,t),getFeeHistory:t=>Vc(e,t),estimateFeesPerGas:t=>async function(e,t){return hs(e,t)}(e,t),getFilterChanges:e=>ac(0,e),getFilterLogs:e=>async function(e,{filter:t}){const n=t.strict??!1,r=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(e=>Gs(e));return t.abi?Ds({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>ds(e),getLogs:t=>qs(e,t),getProof:t=>ld(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return fs(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=void 0!==n?Mt(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}(e,t),getTransaction:t=>dd(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([je(e,sc,"getBlockNumber")({}),t?je(e,dd,"getTransaction")({hash:t}):void 0]),s=n?.blockNumber||o?.blockNumber;return s?r-s+1n:0n}(e,t),getTransactionCount:t=>ps(e,t),getTransactionReceipt:t=>fd(e,t),multicall:t=>async function(e,t){const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:a,blockTag:i,stateOverride:c}=t,u=t.contracts,{batchSize:l=t.batchSize??1024,deployless:d=t.deployless??!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},f=(()=>{if(t.multicallAddress)return t.multicallAddress;if(d)return null;if(e.chain)return Di({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),h=[[]];let p=0,m=0;for(let e=0;e<u.length;e++){const{abi:t,address:r,args:s,functionName:a}=u[e];try{const e=cr({abi:t,args:s,functionName:a});m+=(e.length-2)/2,l>0&&m>l&&h[p].length>0&&(p++,m=(e.length-2)/2,h[p]=[]),h[p]=[...h[p],{allowFailure:!0,callData:e,target:r}]}catch(e){const i=No(e,{abi:t,address:r,args:s,docsPath:"/docs/contract/multicall",functionName:a,sender:n});if(!o)throw i;h[p]=[...h[p],{allowFailure:!0,callData:"0x",target:r}]}}const g=await Promise.allSettled(h.map(t=>je(e,Zi,"readContract")({...null===f?{code:Mi}:{address:f},abi:ki,account:n,args:[t],authorizationList:r,blockNumber:s,blockOverrides:a,blockTag:i,functionName:"aggregate3",stateOverride:c}))),b=[];for(let e=0;e<g.length;e++){const t=g[e];if("rejected"===t.status){if(!o)throw t.reason;for(let n=0;n<h[e].length;n++)b.push({status:"failure",error:t.reason,result:void 0});continue}const n=t.value;for(let t=0;t<n.length;t++){const{returnData:r,success:s}=n[t],{callData:a}=h[e][t],{abi:i,address:c,functionName:l,args:d}=u[b.length];try{if("0x"===a)throw new Qe;if(!s)throw new Hr({data:r});const e=Hs({abi:i,args:d,data:r,functionName:l});b.push(o?{result:e,status:"success"}:e)}catch(e){const t=No(e,{abi:i,address:c,args:d,docsPath:"/docs/contract/multicall",functionName:l});if(!o)throw t;b.push({error:t,result:void 0,status:"failure"})}}}if(b.length!==u.length)throw new He("multicall results mismatch");return b}(e,t),prepareTransactionRequest:t=>_s(e,t),readContract:t=>Zi(e,t),sendRawTransaction:t=>async function(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}(e,t),simulate:t=>hd(e,t),simulateBlocks:t=>hd(e,t),simulateCalls:t=>Sd(e,t),simulateContract:t=>async function(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:a,...i}=t,c=i.account?ar(i.account):e.account,u=cr({abi:n,args:o,functionName:a});try{const{data:l}=await je(e,Hi,"call")({batch:!1,data:`${u}${s?s.replace("0x",""):""}`,to:r,...i,account:c});return{result:Hs({abi:n,args:o,functionName:a,data:l||"0x"}),request:{abi:n.filter(e=>"name"in e&&e.name===t.functionName),address:r,args:o,dataSuffix:s,functionName:a,...i,account:c}}}catch(e){throw No(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:a,sender:c?.address})}}(e,t),verifyHash:t=>Od(e,t),verifyMessage:t=>async function(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...a}){return Od(e,{address:t,factory:r,factoryData:o,hash:ru(n),signature:s,...a})}(e,t),verifySiweMessage:t=>Fd(e,t),verifyTypedData:t=>async function(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:a,primaryType:i,types:c,domain:u,...l}=t;return Od(e,{address:n,factory:r,factoryData:o,hash:uu({message:a,primaryType:i,types:c,domain:u}),signature:s,...l})}(e,t),uninstallFilter:e=>ic(0,e),waitForTransactionReceipt:t=>async function(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:a=6,retryDelay:i=({count:e})=>200*(1<<e),timeout:c=18e4}=t,u=Ir(["waitForTransactionReceipt",e.uid,o]),l=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval;let d,f,h,p,m,g=!1;const{promise:b,resolve:y,reject:w}=qi(),v=c?setTimeout(()=>{m?.(),p?.(),w(new Ur({hash:o}))},c):void 0;return p=Xi(u,{onReplaced:s,resolve:y,reject:w},async t=>{if(h=await je(e,fd,"getTransactionReceipt")({hash:o}).catch(()=>{}),h&&r<=1)return clearTimeout(v),t.resolve(h),void p?.();m=je(e,zd,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:l,async onBlockNumber(s){const c=e=>{clearTimeout(v),m?.(),e(),p?.()};let u=s;if(!g)try{if(h){if(r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;return void c(()=>t.resolve(h))}if(n&&!d&&(g=!0,await cc(async()=>{d=await je(e,dd,"getTransaction")({hash:o}),d.blockNumber&&(u=d.blockNumber)},{delay:i,retryCount:a}),g=!1),h=await je(e,fd,"getTransactionReceipt")({hash:o}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;c(()=>t.resolve(h))}catch(n){if(n instanceof jr||n instanceof Lr){if(!d)return void(g=!1);try{f=d,g=!0;const n=await cc(()=>je(e,ls,"getBlock")({blockNumber:u,includeTransactions:!0}),{delay:i,retryCount:a,shouldRetry:({error:e})=>e instanceof as});g=!1;const o=n.transactions.find(({from:e,nonce:t})=>e===f.from&&t===f.nonce);if(!o)return;if(h=await je(e,fd,"getTransactionReceipt")({hash:o.hash}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;let s="replaced";o.to===f.to&&o.value===f.value&&o.input===f.input?s="repriced":o.from===o.to&&0n===o.value&&(s="cancelled"),c(()=>{t.onReplaced?.({reason:s,replacedTransaction:f,transaction:o,transactionReceipt:h}),t.resolve(h)})}catch(e){c(()=>t.reject(e))}}else c(()=>t.reject(n))}}})}),b}(e,t),watchBlocks:t=>function(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:a,poll:i,pollingInterval:c=e.pollingInterval}){const u=void 0!==i?i:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type),l=a??!1;let d;return u?Xi(Ir(["watchBlocks",e.uid,t,n,r,l,c]),{onBlock:o,onError:s},o=>tc(async()=>{try{const r=await je(e,ls,"getBlock")({blockTag:t,includeTransactions:l});if(null!==r.number&&null!=d?.number){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;t<r.number;t++){const n=await je(e,ls,"getBlock")({blockNumber:t,includeTransactions:l});o.onBlock(n,d),d=n}}(null==d?.number||"pending"===t&&null==r?.number||null!==r.number&&r.number>d.number)&&(o.onBlock(r,d),d=r)}catch(e){o.onError?.(e)}},{emitOnBegin:r,interval:c})):(()=>{let n=!0,a=!0,i=()=>n=!1;return(async()=>{try{r&&je(e,ls,"getBlock")({blockTag:t,includeTransactions:l}).then(e=>{n&&a&&(o(e,void 0),a=!1)}).catch(s);const c=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:u}=await c.subscribe({params:["newHeads"],async onData(t){if(!n)return;const r=await je(e,ls,"getBlock")({blockNumber:t.result?.number,includeTransactions:l}).catch(()=>{});n&&(o(r,d),a=!1,d=r)},onError(e){s?.(e)}});i=u,n||i()}catch(e){s?.(e)}})(),()=>i()})()}(e,t),watchBlockNumber:t=>zd(e,t),watchContractEvent:t=>function(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:a,fromBlock:i,onError:c,onLogs:u,poll:l,pollingInterval:d=e.pollingInterval,strict:f}=t;return(void 0!==l?l:"bigint"==typeof i||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{const t=f??!1;return Xi(Ir(["watchContractEvent",r,o,s,e.uid,a,d,t,i]),{onLogs:u,onError:c},c=>{let u,l;void 0!==i&&(u=i-1n);let f=!1;const h=tc(async()=>{if(f)try{let i;if(l)i=await je(e,ac,"getFilterChanges")({filter:l});else{const s=await je(e,sc,"getBlockNumber")({});i=u&&u<s?await je(e,Vs,"getContractEvents")({abi:n,address:r,args:o,eventName:a,fromBlock:u+1n,toBlock:s,strict:t}):[],u=s}if(0===i.length)return;if(s)c.onLogs(i);else for(const e of i)c.onLogs([e])}catch(e){l&&e instanceof oo&&(f=!1),c.onError?.(e)}else{try{l=await je(e,sr,"createContractEventFilter")({abi:n,address:r,args:o,eventName:a,strict:t,fromBlock:i})}catch{}f=!0}},{emitOnBegin:!0,interval:d});return async()=>{l&&await je(e,ic,"uninstallFilter")({filter:l}),h()}})})():(()=>{const t=f??!1,i=Ir(["watchContractEvent",r,o,s,e.uid,a,d,t]);let l=!0,h=()=>l=!1;return Xi(i,{onLogs:u,onError:c},t=>((async()=>{try{const s=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),i=a?nr({abi:n,eventName:a,args:o}):[],{unsubscribe:c}=await s.subscribe({params:["logs",{address:r,topics:i}],onData(e){if(!l)return;const r=e.result;try{const{eventName:e,args:o}=Ls({abi:n,data:r.data,topics:r.topics,strict:f}),s=Gs(r,{args:o,eventName:e});t.onLogs([s])}catch(e){let n,o;if(e instanceof ht||e instanceof pt){if(f)return;n=e.abiItem.name,o=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const s=Gs(r,{args:o?[]:{},eventName:n});t.onLogs([s])}},onError(e){t.onError?.(e)}});h=c,l||h()}catch(e){c?.(e)}})(),()=>h()))})()}(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:a,onError:i,onLogs:c,poll:u,pollingInterval:l=e.pollingInterval,strict:d}){const f=void 0!==u?u:"bigint"==typeof a||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type),h=d??!1;return f?Xi(Ir(["watchEvent",t,n,r,e.uid,o,l,a]),{onLogs:c,onError:i},i=>{let c,u;void 0!==a&&(c=a-1n);let d=!1;const f=tc(async()=>{if(d)try{let a;if(u)a=await je(e,ac,"getFilterChanges")({filter:u});else{const r=await je(e,sc,"getBlockNumber")({});a=c&&c!==r?await je(e,qs,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:c+1n,toBlock:r}):[],c=r}if(0===a.length)return;if(r)i.onLogs(a);else for(const e of a)i.onLogs([e])}catch(e){u&&e instanceof oo&&(d=!1),i.onError?.(e)}else{try{u=await je(e,Lc,"createEventFilter")({address:t,args:n,event:o,events:s,strict:h,fromBlock:a})}catch{}d=!0}},{emitOnBegin:!0,interval:l});return async()=>{u&&await je(e,ic,"uninstallFilter")({filter:u}),f()}}):(()=>{let r=!0,a=()=>r=!1;return(async()=>{try{const u=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),l=s??(o?[o]:void 0);let f=[];if(l){const e=l.flatMap(e=>nr({abi:[e],eventName:e.name,args:n}));f=[e],o&&(f=f[0])}const{unsubscribe:p}=await u.subscribe({params:["logs",{address:t,topics:f}],onData(e){if(!r)return;const t=e.result;try{const{eventName:e,args:n}=Ls({abi:l??[],data:t.data,topics:t.topics,strict:h}),r=Gs(t,{args:n,eventName:e});c([r])}catch(e){let n,r;if(e instanceof ht||e instanceof pt){if(d)return;n=e.abiItem.name,r=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const o=Gs(t,{args:r?[]:{},eventName:n});c([o])}},onError(e){i?.(e)}});a=p,r||a()}catch(e){i?.(e)}})(),()=>a()})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(void 0!==o?o:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type)?Xi(Ir(["watchPendingTransactions",e.uid,t,s]),{onTransactions:r,onError:n},n=>{let r;const o=tc(async()=>{try{if(!r)try{return void(r=await je(e,Uc,"createPendingTransactionFilter")({}))}catch(e){throw o(),e}const s=await je(e,ac,"getFilterChanges")({filter:r});if(0===s.length)return;if(t)n.onTransactions(s);else for(const e of s)n.onTransactions([e])}catch(e){n.onError?.(e)}},{emitOnBegin:!0,interval:s});return async()=>{r&&await je(e,ic,"uninstallFilter")({filter:r}),o()}}):(()=>{let t=!0,o=()=>t=!1;return(async()=>{try{const{unsubscribe:s}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});o=s,t||o()}catch(e){n?.(e)}})(),()=>o()})()}(e,t)}}function Ld(e){const{key:t="public",name:n="Public Client"}=e,r=function(e){const{batch:t,chain:n,ccipRead:r,key:o="base",name:s="Base Client",type:a="base"}=e,i=e.experimental_blockTag??("number"==typeof n?.experimental_preconfirmationTime?"pending":void 0),c=n?.blockTime??12e3,u=Math.min(Math.max(Math.floor(c/2),500),4e3),l=e.pollingInterval??u,d=e.cacheTime??l,f=e.account?ar(e.account):void 0,{config:h,request:p,value:m}=e.transport({chain:n,pollingInterval:l}),g={account:f,batch:t,cacheTime:d,ccipRead:r,chain:n,key:o,name:s,pollingInterval:l,request:p,transport:{...h,...m},type:a,uid:hc(),...i?{experimental_blockTag:i}:{}};return Object.assign(g,{extend:function e(t){return n=>{const r=n(t);for(const e in g)delete r[e];const o={...t,...r};return Object.assign(o,{extend:e(o)})}}(g)})}({...e,key:t,name:n,type:"publicClient"});return r.extend(jd)}class Ud extends He{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Dd(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:a,name:i="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:u,retryDelay:l,raw:d}=t;return({chain:f,retryCount:h,timeout:p})=>{const{batchSize:m=1e3,wait:g=0}="object"==typeof n?n:{},b=t.retryCount??h,y=p??t.timeout??1e4,w=e||f?.rpcUrls.default.http[0];if(!w)throw new Ud;const v=nu(w,{fetchFn:r,fetchOptions:o,onRequest:c,onResponse:u,timeout:y});return function({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:a,type:i},c){return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:a,type:i},request:Hc(r,{methods:t,retryCount:o,retryDelay:s,uid:hc()}),value:c}}({key:s,methods:a,name:i,async request({method:e,params:t}){const r={method:e,params:t},{schedule:o}=Wi({id:w,wait:g,shouldSplitBatch:e=>e.length>m,fn:e=>v.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:s,result:a}]=await(async e=>n?o(e):[await v.request({body:e})])(r);if(d)return{error:s,result:a};if(s)throw new Zr({body:r,error:s,url:w});return a},retryCount:b,retryDelay:l,timeout:y,type:"http"},{fetchOptions:o,url:w})}}function Gd(e,t,n){for(let n in t){let r=t[n];Object.defineProperty(e,n,{enumerable:!0,value:r,writable:!1})}}function qd(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(e=>qd(e,t)).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let r=0;r<e.length;r++)n+=t[e[r]>>4],n+=t[15&e[r]];return n}if("object"==typeof e&&"function"==typeof e.toJSON)return qd(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(n=>`${qd(n,t)}: ${qd(e[n],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Vd(e,t,n,r){if(!e)throw function(e,t,n){let r,o=e;{const r=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${qd(n)}`);for(const e in n){if("shortMessage"===e)continue;const t=n[e];r.push(e+"="+qd(t))}}r.push(`code=${t}`),r.push("version=6.15.0"),r.length&&(e+=" ("+r.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return Gd(r,{code:t}),n&&Object.assign(r,n),null==r.shortMessage&&Gd(r,{shortMessage:o}),r}(t,n,r)}function Wd(e,t,n,r){Vd(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function Hd(e,t){return function(e,t){if(e instanceof Uint8Array)return e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let n=2;for(let r=0;r<t.length;r++)t[r]=parseInt(e.substring(n,n+2),16),n+=2;return t}Wd(!1,"invalid BytesLike value",t,e)}(e,t)}["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e},[]);const Yd=BigInt(0),Zd=BigInt(1),Kd=9007199254740991;function Jd(e,t){const n=ef(e,"value"),r=BigInt(nf(t,"width"));if(Vd(n>>r===Yd,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-Zd){return-((~n&(Zd<<r)-Zd)+Zd)}return n}function Qd(e,t){const n=ef(e,"value"),r=BigInt(nf(t,"bits"));return n&(Zd<<r)-Zd}function Xd(e,t){switch(typeof e){case"bigint":return e;case"number":return Wd(Number.isInteger(e),"underflow",t||"value",e),Wd(e>=-Kd&&e<=Kd,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(n){Wd(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}Wd(!1,"invalid BigNumberish value",t||"value",e)}function ef(e,t){const n=Xd(e,t);return Vd(n>=Yd,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const tf="0123456789abcdef";function nf(e,t){switch(typeof e){case"bigint":return Wd(e>=-Kd&&e<=Kd,"overflow",t||"value",e),Number(e);case"number":return Wd(Number.isInteger(e),"underflow",t||"value",e),Wd(e>=-Kd&&e<=Kd,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return nf(BigInt(e),t)}catch(n){Wd(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}Wd(!1,"invalid numeric value",t||"value",e)}const rf=BigInt(-1),of=BigInt(0),sf=BigInt(1),af=BigInt(5),cf={};let uf="0000";for(;uf.length<80;)uf+=uf;function lf(e){let t=uf;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function df(e,t,n){const r=BigInt(t.width);if(t.signed){const t=sf<<r-sf;Vd(null==n||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=e>of?Jd(Qd(e,r),r):-Jd(Qd(-e,r),r)}else{const t=sf<<r;Vd(null==n||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=(e%t+t)%t&t-sf}return e}function ff(e){"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Wd(o,"invalid fixed format","format",e),t="u"!==o[1],n=parseInt(o[2]),r=parseInt(o[3])}else if(e){const o=e,s=(e,t,n)=>null==o[e]?n:(Wd(typeof o[e]===t,"invalid fixed format ("+e+" not "+t+")","format."+e,o[e]),o[e]);t=s("signed","boolean",t),n=s("width","number",n),r=s("decimals","number",r)}Wd(n%8==0,"invalid FixedNumber width (not byte aligned)","format.width",n),Wd(r<=80,"invalid FixedNumber decimals (too large)","format.decimals",r);return{signed:t,width:n,decimals:r,name:(t?"":"u")+"fixed"+String(n)+"x"+String(r)}}class hf{format;#e;#t;#n;_value;constructor(e,t,n){!function(e,t,n){if(e!==t){let e=n,t="new";e+=".",t+=" "+n,Vd(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}(e,cf,"FixedNumber"),this.#t=t,this.#e=n;const r=function(e,t){let n="";e<of&&(n="-",e*=rf);let r=e.toString();if(0===t)return n+r;for(;r.length<=t;)r=uf+r;const o=r.length-t;for(r=r.substring(0,o)+"."+r.substring(o);"0"===r[0]&&"."!==r[1];)r=r.substring(1);for(;"0"===r[r.length-1]&&"."!==r[r.length-2];)r=r.substring(0,r.length-1);return n+r}(t,n.decimals);Gd(this,{format:n.name,_value:r}),this.#n=lf(n.decimals)}get signed(){return this.#e.signed}get width(){return this.#e.width}get decimals(){return this.#e.decimals}get value(){return this.#t}#r(e){Wd(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#o(e,t){return e=df(e,this.#e,t),new hf(cf,e,this.#e)}#s(e,t){return this.#r(e),this.#o(this.#t+e.#t,t)}addUnsafe(e){return this.#s(e)}add(e){return this.#s(e,"add")}#a(e,t){return this.#r(e),this.#o(this.#t-e.#t,t)}subUnsafe(e){return this.#a(e)}sub(e){return this.#a(e,"sub")}#i(e,t){return this.#r(e),this.#o(this.#t*e.#t/this.#n,t)}mulUnsafe(e){return this.#i(e)}mul(e){return this.#i(e,"mul")}mulSignal(e){this.#r(e);const t=this.#t*e.#t;return Vd(t%this.#n===of,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#o(t/this.#n,"mulSignal")}#c(e,t){return Vd(e.#t!==of,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e),this.#o(this.#t*this.#n/e.#t,t)}divUnsafe(e){return this.#c(e)}div(e){return this.#c(e,"div")}divSignal(e){Vd(e.#t!==of,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e);const t=this.#t*this.#n;return Vd(t%e.#t===of,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#o(t/e.#t,"divSignal")}cmp(e){let t=this.value,n=e.value;const r=this.decimals-e.decimals;return r>0?n*=lf(r):r<0&&(t*=lf(-r)),t<n?-1:t>n?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#t;return this.#t<of&&(e-=this.#n-sf),e=this.#t/this.#n*this.#n,this.#o(e,"floor")}ceiling(){let e=this.#t;return this.#t>of&&(e+=this.#n-sf),e=this.#t/this.#n*this.#n,this.#o(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const t=this.decimals-e,n=af*lf(t-1);let r=this.value+n;const o=lf(t);return r=r/o*o,df(r,this.#e,"round"),new hf(cf,r,this.#e)}isZero(){return this.#t===of}isNegative(){return this.#t<of}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return hf.fromString(this.toString(),e)}static fromValue(e,t,n){const r=null==t?0:nf(t),o=ff(n);let s=Xd(e,"value");const a=r-o.decimals;if(a>0){const t=lf(a);Vd(s%t===of,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),s/=t}else a<0&&(s*=lf(-a));return df(s,o,"fromValue"),new hf(cf,s,o)}static fromString(e,t){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);Wd(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const r=ff(t);let o=n[2]||"0",s=n[3]||"";for(;s.length<r.decimals;)s+=uf;Vd(s.substring(r.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),s=s.substring(0,r.decimals);const a=BigInt(n[1]+o+s);return df(a,r,"fromString"),new hf(cf,a,r)}static fromBytes(e,t){let n=function(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=tf[n>>4],t+=tf[15&n];return BigInt(t)}return Xd(e)}(Hd(e,"value"));const r=ff(t);return r.signed&&(n=Jd(n,r.width)),df(n,r,"fromBytes"),new hf(cf,n,r)}}function pf(e){return function(e,t){let n=18;return n=nf(t,"unit"),hf.fromValue(e,n,{decimals:n,width:512}).toString()}(e,18)}const mf="0.38.13";function gf({projectId:e,originComponentName:t,...n}){const r=new URL("https://pay.coinbase.com/buy");void 0!==e&&r.searchParams.append("appId",e);for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(["string","number","boolean"].includes(typeof t)?r.searchParams.append(e,t.toString()):r.searchParams.append(e,JSON.stringify(t)))}return t?r.searchParams.append("sdkVersion",`onchainkit@${mf}:${t}`):r.searchParams.append("sdkVersion",`onchainkit@${mf}`),r.searchParams.sort(),r.toString()}var bf=[],yf=[],wf="undefined"!=typeof Uint8Array?Uint8Array:Array,vf=!1;function xf(){vf=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)bf[t]=e[t],yf[e.charCodeAt(t)]=t;yf["-".charCodeAt(0)]=62,yf["_".charCodeAt(0)]=63}function Ef(e){return bf[e>>18&63]+bf[e>>12&63]+bf[e>>6&63]+bf[63&e]}function Pf(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push(Ef(r));return o.join("")}function kf(e){var t;vf||xf();for(var n=e.length,r=n%3,o="",s=[],a=16383,i=0,c=n-r;i<c;i+=a)s.push(Pf(e,i,i+a>c?c:i+a));return 1===r?(t=e[n-1],o+=bf[t>>2],o+=bf[t<<4&63],o+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],o+=bf[t>>10],o+=bf[t>>4&63],o+=bf[t<<2&63],o+="="),s.push(o),s.join("")}function Af(e,t,n,r,o){var s,a,i=8*o-r-1,c=(1<<i)-1,u=c>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-l)-1,h>>=-l,l+=i;l>0;s=256*s+e[t+d],d+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===s)s=1-u;else{if(s===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),s-=u}return(h?-1:1)*a*Math.pow(2,s-r)}function If(e,t,n,r,o,s){var a,i,c,u=8*s-o-1,l=(1<<u)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(i=0,a=l):a+d>=1?(i=(t*c-1)*Math.pow(2,o),a+=d):(i=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&i,h+=p,i/=256,o-=8);for(a=a<<o|i,u+=o;u>0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*m}var Nf={}.toString,Sf=Array.isArray||function(e){return"[object Array]"==Nf.call(e)};function Tf(){return Bf.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function $f(e,t){if(Tf()<t)throw new RangeError("Invalid typed array length");return Bf.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Bf.prototype:(null===e&&(e=new Bf(t)),e.length=t),e}function Bf(e,t,n){if(!(Bf.TYPED_ARRAY_SUPPORT||this instanceof Bf))return new Bf(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Rf(this,e)}return Cf(this,e,t,n)}function Cf(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Bf.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Bf.prototype:e=zf(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Bf.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Ff(t,n);e=$f(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(Mf(t)){var n=0|_f(t.length);return 0===(e=$f(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?$f(e,0):zf(e,t);if("Buffer"===t.type&&Sf(t.data))return zf(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Of(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Rf(e,t){if(Of(t),e=$f(e,t<0?0:0|_f(t)),!Bf.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function zf(e,t){var n=t.length<0?0:0|_f(t.length);e=$f(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function _f(e){if(e>=Tf())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tf().toString(16)+" bytes");return 0|e}function Mf(e){return!(null==e||!e._isBuffer)}function Ff(e,t){if(Mf(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return dh(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return fh(e).length;default:if(r)return dh(e).length;t=(""+t).toLowerCase(),r=!0}}function jf(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return eh(this,t,n);case"utf8":case"utf-8":return Kf(this,t,n);case"ascii":return Qf(this,t,n);case"latin1":case"binary":return Xf(this,t,n);case"base64":return Zf(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return th(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Lf(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Uf(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=Bf.from(t,r)),Mf(t))return 0===t.length?-1:Df(e,t,n,r,o);if("number"==typeof t)return t&=255,Bf.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Df(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function Df(e,t,n,r,o){var s,a=1,i=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,i/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(s=n;s<i;s++)if(u(e,s)===u(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===c)return l*a}else-1!==l&&(s-=s-l),l=-1}else for(n+c>i&&(n=i-c),s=n;s>=0;s--){for(var d=!0,f=0;f<c;f++)if(u(e,s+f)!==u(t,f)){d=!1;break}if(d)return s}return-1}function Gf(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var a=0;a<r;++a){var i=parseInt(t.substr(2*a,2),16);if(isNaN(i))return a;e[n+a]=i}return a}function qf(e,t,n,r){return hh(dh(t,e.length-n),e,n,r)}function Vf(e,t,n,r){return hh(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function Wf(e,t,n,r){return Vf(e,t,n,r)}function Hf(e,t,n,r){return hh(fh(t),e,n,r)}function Yf(e,t,n,r){return hh(function(e,t){for(var n,r,o,s=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,s.push(o),s.push(r);return s}(t,e.length-n),e,n,r)}function Zf(e,t,n){return 0===t&&n===e.length?kf(e):kf(e.slice(t,n))}function Kf(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var s,a,i,c,u=e[o],l=null,d=u>239?4:u>223?3:u>191?2:1;if(o+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(s=e[o+1]))&&(c=(31&u)<<6|63&s)>127&&(l=c);break;case 3:s=e[o+1],a=e[o+2],128==(192&s)&&128==(192&a)&&(c=(15&u)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:s=e[o+1],a=e[o+2],i=e[o+3],128==(192&s)&&128==(192&a)&&128==(192&i)&&(c=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&i)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=d}return function(e){var t=e.length;if(t<=Jf)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Jf));return n}(r)}Bf.TYPED_ARRAY_SUPPORT=void 0===globalThis.TYPED_ARRAY_SUPPORT||globalThis.TYPED_ARRAY_SUPPORT,Tf(),Bf.poolSize=8192,Bf._augment=function(e){return e.__proto__=Bf.prototype,e},Bf.from=function(e,t,n){return Cf(null,e,t,n)},Bf.TYPED_ARRAY_SUPPORT&&(Bf.prototype.__proto__=Uint8Array.prototype,Bf.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Bf[Symbol.species]),Bf.alloc=function(e,t,n){return function(e,t,n,r){return Of(t),t<=0?$f(e,t):void 0!==n?"string"==typeof r?$f(e,t).fill(n,r):$f(e,t).fill(n):$f(e,t)}(null,e,t,n)},Bf.allocUnsafe=function(e){return Rf(null,e)},Bf.allocUnsafeSlow=function(e){return Rf(null,e)},Bf.isBuffer=function(e){return null!=e&&(!!e._isBuffer||ph(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ph(e.slice(0,0))}(e))},Bf.compare=function(e,t){if(!Mf(e)||!Mf(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,s=Math.min(n,r);o<s;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},Bf.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Bf.concat=function(e,t){if(!Sf(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Bf.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Bf.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!Mf(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},Bf.byteLength=Ff,Bf.prototype._isBuffer=!0,Bf.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Lf(this,t,t+1);return this},Bf.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Lf(this,t,t+3),Lf(this,t+1,t+2);return this},Bf.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Lf(this,t,t+7),Lf(this,t+1,t+6),Lf(this,t+2,t+5),Lf(this,t+3,t+4);return this},Bf.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Kf(this,0,e):jf.apply(this,arguments)},Bf.prototype.equals=function(e){if(!Mf(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Bf.compare(this,e)},Bf.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Bf.prototype.compare=function(e,t,n,r,o){if(!Mf(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),i=Math.min(s,a),c=this.slice(r,o),u=e.slice(t,n),l=0;l<i;++l)if(c[l]!==u[l]){s=c[l],a=u[l];break}return s<a?-1:a<s?1:0},Bf.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Bf.prototype.indexOf=function(e,t,n){return Uf(this,e,t,n,!0)},Bf.prototype.lastIndexOf=function(e,t,n){return Uf(this,e,t,n,!1)},Bf.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return Gf(this,e,t,n);case"utf8":case"utf-8":return qf(this,e,t,n);case"ascii":return Vf(this,e,t,n);case"latin1":case"binary":return Wf(this,e,t,n);case"base64":return Hf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yf(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},Bf.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Jf=4096;function Qf(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function Xf(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function eh(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",s=t;s<n;++s)o+=lh(e[s]);return o}function th(e,t,n){for(var r=e.slice(t,n),o="",s=0;s<r.length;s+=2)o+=String.fromCharCode(r[s]+256*r[s+1]);return o}function nh(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function rh(e,t,n,r,o,s){if(!Mf(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function oh(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,s=Math.min(e.length-n,2);o<s;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function sh(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,s=Math.min(e.length-n,4);o<s;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function ah(e,t,n,r,o,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ih(e,t,n,r,o){return o||ah(e,0,n,4),If(e,t,n,r,23,4),n+4}function ch(e,t,n,r,o){return o||ah(e,0,n,8),If(e,t,n,r,52,8),n+8}Bf.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Bf.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Bf.prototype;else{var o=t-e;n=new Bf(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+e]}return n},Bf.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||nh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r},Bf.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||nh(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},Bf.prototype.readUInt8=function(e,t){return t||nh(e,1,this.length),this[e]},Bf.prototype.readUInt16LE=function(e,t){return t||nh(e,2,this.length),this[e]|this[e+1]<<8},Bf.prototype.readUInt16BE=function(e,t){return t||nh(e,2,this.length),this[e]<<8|this[e+1]},Bf.prototype.readUInt32LE=function(e,t){return t||nh(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Bf.prototype.readUInt32BE=function(e,t){return t||nh(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Bf.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||nh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},Bf.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||nh(e,t,this.length);for(var r=t,o=1,s=this[e+--r];r>0&&(o*=256);)s+=this[e+--r]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*t)),s},Bf.prototype.readInt8=function(e,t){return t||nh(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Bf.prototype.readInt16LE=function(e,t){t||nh(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Bf.prototype.readInt16BE=function(e,t){t||nh(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Bf.prototype.readInt32LE=function(e,t){return t||nh(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Bf.prototype.readInt32BE=function(e,t){return t||nh(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Bf.prototype.readFloatLE=function(e,t){return t||nh(e,4,this.length),Af(this,e,!0,23,4)},Bf.prototype.readFloatBE=function(e,t){return t||nh(e,4,this.length),Af(this,e,!1,23,4)},Bf.prototype.readDoubleLE=function(e,t){return t||nh(e,8,this.length),Af(this,e,!0,52,8)},Bf.prototype.readDoubleBE=function(e,t){return t||nh(e,8,this.length),Af(this,e,!1,52,8)},Bf.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||rh(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,s=0;for(this[t]=255&e;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},Bf.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||rh(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},Bf.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,1,255,0),Bf.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Bf.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,2,65535,0),Bf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):oh(this,e,t,!0),t+2},Bf.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,2,65535,0),Bf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):oh(this,e,t,!1),t+2},Bf.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,4,4294967295,0),Bf.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):sh(this,e,t,!0),t+4},Bf.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,4,4294967295,0),Bf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):sh(this,e,t,!1),t+4},Bf.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);rh(this,e,t,n,o-1,-o)}var s=0,a=1,i=0;for(this[t]=255&e;++s<n&&(a*=256);)e<0&&0===i&&0!==this[t+s-1]&&(i=1),this[t+s]=(e/a|0)-i&255;return t+n},Bf.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);rh(this,e,t,n,o-1,-o)}var s=n-1,a=1,i=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/a|0)-i&255;return t+n},Bf.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,1,127,-128),Bf.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Bf.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,2,32767,-32768),Bf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):oh(this,e,t,!0),t+2},Bf.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,2,32767,-32768),Bf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):oh(this,e,t,!1),t+2},Bf.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,4,2147483647,-2147483648),Bf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):sh(this,e,t,!0),t+4},Bf.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||rh(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Bf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):sh(this,e,t,!1),t+4},Bf.prototype.writeFloatLE=function(e,t,n){return ih(this,e,t,!0,n)},Bf.prototype.writeFloatBE=function(e,t,n){return ih(this,e,t,!1,n)},Bf.prototype.writeDoubleLE=function(e,t,n){return ch(this,e,t,!0,n)},Bf.prototype.writeDoubleBE=function(e,t,n){return ch(this,e,t,!1,n)},Bf.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,s=r-n;if(this===e&&n<t&&t<r)for(o=s-1;o>=0;--o)e[o+t]=this[o+n];else if(s<1e3||!Bf.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},Bf.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Bf.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var a=Mf(e)?e:dh(new Bf(e,r).toString()),i=a.length;for(s=0;s<n-t;++s)this[s+t]=a[s%i]}return this};var uh=/[^+\/0-9A-Za-z-_]/g;function lh(e){return e<16?"0"+e.toString(16):e.toString(16)}function dh(e,t){var n;t=t||1/0;for(var r=e.length,o=null,s=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&s.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function fh(e){return function(e){var t,n,r,o,s,a;vf||xf();var i=e.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s="="===e[i-2]?2:"="===e[i-1]?1:0,a=new wf(3*i/4-s),r=s>0?i-4:i;var c=0;for(t=0,n=0;t<r;t+=4,n+=3)o=yf[e.charCodeAt(t)]<<18|yf[e.charCodeAt(t+1)]<<12|yf[e.charCodeAt(t+2)]<<6|yf[e.charCodeAt(t+3)],a[c++]=o>>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===s?(o=yf[e.charCodeAt(t)]<<2|yf[e.charCodeAt(t+1)]>>4,a[c++]=255&o):1===s&&(o=yf[e.charCodeAt(t)]<<10|yf[e.charCodeAt(t+1)]<<4|yf[e.charCodeAt(t+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(uh,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function hh(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function ph(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}class mh{constructor(e){this.selectedWalletId=null,this.solanaConnection=null,this.ethereumProvider=null,this.walletInfo=null,this.phantomAdapter=null,this.walletType="embedded",this.ethereumNetwork=null,this.defaultNetwork=exports.Network.Solana,this.api=h.default.create({baseURL:e.baseURL,headers:{"Content-Type":"application/json"}}),this.middleAccountApi=h.default.create({baseURL:e.middleAccountBaseURL||"https://yeezy-payment-service-sit-a0dchfccbufeh5bx.z03.azurefd.net",headers:{"Content-Type":"application/json"}}),this.solanaCluster=e.solanaCluster,this.solanaConnection=new t.Connection(e.solanaCluster.rpcUrl),e.ethereumNetwork&&(this.ethereumNetwork={...e.ethereumNetwork,chainId:Number(e.ethereumNetwork.chainId)},this.ethereumProvider=Ld({transport:Dd(e.ethereumNetwork.rpcUrl)})),this.defaultNetwork=e.defaultNetwork||exports.Network.Solana}setWallet(e){this.walletInfo=e}setWalletType(e){this.walletType=e,E.saveWalletType(e)}getWallet(){return this.walletInfo}getPhantomAdapter(){return this.phantomAdapter}getWalletType(){return this.walletType}get wallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===this.defaultNetwork))||null}get address(){var e;return(null===(e=this.wallet)||void 0===e?void 0:e.address)||null}get network(){var e;return(null===(e=this.wallet)||void 0===e?void 0:e.network)||null}get ethereumWallet(){var e,t;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.address===E.getSwitchedAccountAddress()))||(null===(t=this.walletInfo)||void 0===t?void 0:t.wallets.find(e=>e.network===exports.Network.Ethereum&&"Main"===e.wallet_set))||null}get ethereumAddress(){var e;return(null===(e=this.ethereumWallet)||void 0===e?void 0:e.address)||null}get solanaWallet(){var e,t,n,r;const o=null===(t=null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.address===E.getSwitchedAccountAddress()))||void 0===t?void 0:t.wallet_set;return o?(null===(n=this.walletInfo)||void 0===n?void 0:n.wallets.find(e=>e.network===exports.Network.Solana&&e.wallet_set===o))||null:(null===(r=this.walletInfo)||void 0===r?void 0:r.wallets.find(e=>e.network===exports.Network.Solana&&"Main"===e.wallet_set))||null}get forwardSolanaWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Solana&&"Forward-0"===e.wallet_set))||null}get forwardSolanaAddress(){var e;return(null===(e=this.forwardSolanaWallet)||void 0===e?void 0:e.address)||null}get forwardEthereumWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Ethereum&&"Forward-0"===e.wallet_set))||null}get forwardEthereumAddress(){var e;return(null===(e=this.forwardEthereumWallet)||void 0===e?void 0:e.address)||null}get solanaAddress(){var e;return(null===(e=this.solanaWallet)||void 0===e?void 0:e.address)||null}get id(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.id)||null}get social_links(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.social_links)||null}async reconnect(){try{if("phantom"===E.getWalletType())return await this.connectPhantom();{const e=await this.getSession();return this.setWallet(e),e}}catch(e){return null}}async connectPhantom(){try{if(this.phantomAdapter||(this.phantomAdapter=new D),await this.phantomAdapter.connect(),!this.phantomAdapter.publicKey)throw new Error("Failed to connect to Phantom wallet");const e=this.phantomAdapter.publicKey.toString(),t={id:r.v4(),is_exported:!1,address:e,network:exports.Network.Solana,type:exports.WalletType.Phantom,wallets:[{id:e,address:e,network:exports.Network.Solana,wallet_type:exports.WalletType.Phantom,wallet_set:"Main"}],social_links:[],social_infos:[],account_info:{name:null}};return this.setWallet(t),this.setWalletType("phantom"),t}catch(e){throw console.error("Phantom connect error:",e),new Error(e instanceof Error?e.message:"Failed to connect to Phantom wallet")}}async updateAccountName(e){if(!this.walletInfo)throw new Error("No wallet info");const t=await this.api.post("/account/update",{name:e},{withCredentials:!0});return this.walletInfo.account_info.name=e,t.data}async signSolanaTransaction(e){try{if(!this.walletInfo)throw new Error("No wallet info");if(!this.solanaConnection)throw new Error("No rpc connection");const{blockhash:n}=await this.solanaConnection.getLatestBlockhash();if(b(e)?e.message.recentBlockhash=n:e.recentBlockhash=n,this.phantomAdapter&&this.phantomAdapter.publicKey)return await this.phantomAdapter.signTransaction(e);const r=this.solanaWallet;if(!r)throw new Error("No solana wallet available");const o={user_id:this.walletInfo.id,address:r.address,network:exports.Network.Solana,tx:{Solana:p.default.encode(b(e)?e.message.serialize():e.serializeMessage())}},s=await this.api.post("/sign2",o,{withCredentials:!0}),{signature:a}=s.data;return e.addSignature(new t.PublicKey(r.address),Bf.from(p.default.decode(a))),e}catch(e){throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async signEthereumEip712(e){if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const t={user_id:this.walletInfo.id,address:this.ethereumAddress,network:exports.Network.Ethereum,tx:{EthereumEip712:e}},n=await this.api.post("/sign2",t,{withCredentials:!0}),{signature:r}=n.data;return r}async sendSolanaTransaction(e){if(!this.solanaConnection)throw new Error("No rpc connection");try{return await this.solanaConnection.sendRawTransaction(e,{maxRetries:3,skipPreflight:!1})}catch(e){throw e}}async sendEthereumTransaction(e){if(!this.ethereumProvider)throw new Error("No Ethereum provider");try{return await this.ethereumProvider.sendRawTransaction({serializedTransaction:e})}catch(e){throw e}}async sendEmailVerificationCode(e){await this.api.post("/send_verification",{email:e})}async sendPhoneVerificationCode(e){e.startsWith("+")||(e=`+${e}`),await this.api.post("/send_verification",{phone:e,type:"phone"})}async verifyEmailVerificationCode({email:e,code:t}){const n={type:"Email",data:{network:this.defaultNetwork,email:e,code:t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async verifyPhoneVerificationCode({phone:e,code:t}){const n={type:"Phone",data:{network:this.defaultNetwork,phone:e,code:t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async twitterLogin(e){const t={type:"TwitterOAuth",data:{network:this.defaultNetwork,...e}},n=(await this.api.post("/login",t,{withCredentials:!0})).data;return this.setWallet(n),this.setWalletType("embedded"),n}async googleLogin(e){const t={type:"GoogleOAuth",data:{network:this.defaultNetwork,...e}},n=(await this.api.post("/login",t,{withCredentials:!0})).data;return this.setWallet(n),this.setWalletType("embedded"),n}async oauthLogin(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async loginWithChallenge(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWallet(r),this.setWalletType("embedded"),r}async oauthInit(e){return(await this.api.post("/oauth/init",e)).data}async getSignChallenge(e){return(await this.api.get(`/challenge?method=${e.method}&id=${e.id}`)).data}async getSession(){const e=(await this.api.get("/session",{withCredentials:!0})).data,{access_token:t,...n}=e;return t&&E.saveAccessToken(t),e}async logout(){this.phantomAdapter?(this.phantomAdapter.disconnect(),this.phantomAdapter=null):await this.api.post("/logout",{},{withCredentials:!0}),this.setWallet(null),E.clear()}async getOAuth2ClientId(e){return(await this.api.get(`/oauth_id/${e}`)).data.client_id}setSelectedWallet(e){this.selectedWalletId=e}getSelectedWallet(){return this.selectedWalletId}async getSolanaBalance(){if(!this.solanaConnection||!this.solanaAddress)throw new Error("Solana connection not available");return(await this.solanaConnection.getBalance(new t.PublicKey(this.solanaAddress))/t.LAMPORTS_PER_SOL).toString()}async getEthereumBalance(){if(!this.ethereumProvider||!this.ethereumAddress)throw new Error("Ethereum provider not available");return pf(await this.ethereumProvider.getBalance({address:this.ethereumAddress}))}async fetchCoinbaseToken(e,t="solana"){return(await this.api.post("/ramp/coinbase",{addresses:[{address:e,blockchains:[t]}],assets:["solana"===t?"SOL":"ETH"]})).data.token}viemSignerAdapter(){return{signTypedData:async e=>{if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const t={user_id:this.walletInfo.id,address:this.ethereumAddress,network:exports.Network.Ethereum,tx:{EthereumEip712:e}},n=await this.api.post("/sign2",t,{withCredentials:!0}),{signature:r}=n.data,o=p.default.decode(r),s=o[64];return Cd({r:`0x${Bf.from(o.slice(0,32)).toString("hex")}`,s:`0x${Bf.from(o.slice(32,64)).toString("hex")}`,v:BigInt(s+27)})}}}async createMiddleAccount(e){try{return(await this.middleAccountApi.post("/create",e)).data}catch(e){throw new Error(e instanceof Error?e.message:"Failed to create middle account")}}async getCoinbaseOnrampUrlForMiddleAccount(e){try{const t={sessionToken:await this.fetchCoinbaseToken(e.middleAccountAddress,e.network===exports.Network.Solana?"solana":"ethereum"),presetCryptoAmount:Number(e.amount),redirectUrl:e.redirectUrl||window.location.href};return gf(t)}catch(e){throw new Error(e instanceof Error?e.message:"Failed to get Coinbase onramp URL")}}async getOrderState(e){try{return(await this.middleAccountApi.get(`/order/${e}`)).data}catch(e){throw new Error(e instanceof Error?e.message:"Failed to get order status")}}async transfer(e){var t,n;if(!this.walletInfo)throw new Error("No wallet info available");const r={user_id:this.walletInfo.id,from:e.from,to:e.to,amount:e.amount,decimals:e.decimals,token:e.token,network:e.network,chain_id:e.chain_id};try{return(await this.api.post("/transfer",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Transfer failed")}}async buildTransaction(e){var t,n;try{return(await this.api.post("/build_transaction",e,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to build transaction")}}}var gh=function(){return gh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},gh.apply(this,arguments)};function bh(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function yh(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}"function"==typeof SuppressedError&&SuppressedError;var wh=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,vh=yh(function(e){return wh.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),xh="-ms-",Eh="-moz-",Ph="-webkit-",kh="comm",Ah="rule",Ih="decl",Nh="@keyframes",Sh=Math.abs,Th=String.fromCharCode,$h=Object.assign;function Bh(e){return e.trim()}function Ch(e,t){return(e=t.exec(e))?e[0]:e}function Oh(e,t,n){return e.replace(t,n)}function Rh(e,t,n){return e.indexOf(t,n)}function zh(e,t){return 0|e.charCodeAt(t)}function _h(e,t,n){return e.slice(t,n)}function Mh(e){return e.length}function Fh(e){return e.length}function jh(e,t){return t.push(e),e}function Lh(e,t){return e.filter(function(e){return!Ch(e,t)})}var Uh=1,Dh=1,Gh=0,qh=0,Vh=0,Wh="";function Hh(e,t,n,r,o,s,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:s,line:Uh,column:Dh,length:a,return:"",siblings:i}}function Yh(e,t){return $h(Hh("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Zh(e){for(;e.root;)e=Yh(e.root,{children:[e]});jh(e,e.siblings)}function Kh(){return Vh=qh>0?zh(Wh,--qh):0,Dh--,10===Vh&&(Dh=1,Uh--),Vh}function Jh(){return Vh=qh<Gh?zh(Wh,qh++):0,Dh++,10===Vh&&(Dh=1,Uh++),Vh}function Qh(){return zh(Wh,qh)}function Xh(){return qh}function ep(e,t){return _h(Wh,e,t)}function tp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function np(e){return Bh(ep(qh-1,sp(91===e?e+2:40===e?e+1:e)))}function rp(e){for(;(Vh=Qh())&&Vh<33;)Jh();return tp(e)>2||tp(Vh)>3?"":" "}function op(e,t){for(;--t&&Jh()&&!(Vh<48||Vh>102||Vh>57&&Vh<65||Vh>70&&Vh<97););return ep(e,Xh()+(t<6&&32==Qh()&&32==Jh()))}function sp(e){for(;Jh();)switch(Vh){case e:return qh;case 34:case 39:34!==e&&39!==e&&sp(Vh);break;case 40:41===e&&sp(e);break;case 92:Jh()}return qh}function ap(e,t){for(;Jh()&&e+Vh!==57&&(e+Vh!==84||47!==Qh()););return"/*"+ep(t,qh-1)+"*"+Th(47===e?e:Jh())}function ip(e){for(;!tp(Qh());)Jh();return ep(e,qh)}function cp(e){return function(e){return Wh="",e}(up("",null,null,null,[""],e=function(e){return Uh=Dh=1,Gh=Mh(Wh=e),qh=0,[]}(e),0,[0],e))}function up(e,t,n,r,o,s,a,i,c){for(var u=0,l=0,d=a,f=0,h=0,p=0,m=1,g=1,b=1,y=0,w="",v=o,x=s,E=r,P=w;g;)switch(p=y,y=Jh()){case 40:if(108!=p&&58==zh(P,d-1)){-1!=Rh(P+=Oh(np(y),"&","&\f"),"&\f",Sh(u?i[u-1]:0))&&(b=-1);break}case 34:case 39:case 91:P+=np(y);break;case 9:case 10:case 13:case 32:P+=rp(p);break;case 92:P+=op(Xh()-1,7);continue;case 47:switch(Qh()){case 42:case 47:jh(dp(ap(Jh(),Xh()),t,n,c),c);break;default:P+="/"}break;case 123*m:i[u++]=Mh(P)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+l:-1==b&&(P=Oh(P,/\f/g,"")),h>0&&Mh(P)-d&&jh(h>32?fp(P+";",r,n,d-1,c):fp(Oh(P," ","")+";",r,n,d-2,c),c);break;case 59:P+=";";default:if(jh(E=lp(P,t,n,u,l,o,i,w,v=[],x=[],d,s),s),123===y)if(0===l)up(P,t,E,E,v,s,d,i,x);else switch(99===f&&110===zh(P,3)?100:f){case 100:case 108:case 109:case 115:up(e,E,E,r&&jh(lp(e,E,E,0,0,o,i,w,o,v=[],d,x),x),o,x,d,i,r?v:x);break;default:up(P,E,E,E,[""],x,0,i,x)}}u=l=h=0,m=b=1,w=P="",d=a;break;case 58:d=1+Mh(P),h=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==Kh())continue;switch(P+=Th(y),y*m){case 38:b=l>0?1:(P+="\f",-1);break;case 44:i[u++]=(Mh(P)-1)*b,b=1;break;case 64:45===Qh()&&(P+=np(Jh())),f=Qh(),l=d=Mh(w=P+=ip(Xh())),y++;break;case 45:45===p&&2==Mh(P)&&(m=0)}}return s}function lp(e,t,n,r,o,s,a,i,c,u,l,d){for(var f=o-1,h=0===o?s:[""],p=Fh(h),m=0,g=0,b=0;m<r;++m)for(var y=0,w=_h(e,f+1,f=Sh(g=a[m])),v=e;y<p;++y)(v=Bh(g>0?h[y]+" "+w:Oh(w,/&\f/g,h[y])))&&(c[b++]=v);return Hh(e,t,n,0===o?Ah:i,c,u,l,d)}function dp(e,t,n,r){return Hh(e,t,n,kh,Th(Vh),_h(e,2,-2),0,r)}function fp(e,t,n,r,o){return Hh(e,t,n,Ih,_h(e,0,r),_h(e,r+1,-1),r,o)}function hp(e,t,n){switch(function(e,t){return 45^zh(e,0)?(((t<<2^zh(e,0))<<2^zh(e,1))<<2^zh(e,2))<<2^zh(e,3):0}(e,t)){case 5103:return Ph+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ph+e+e;case 4789:return Eh+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ph+e+Eh+e+xh+e+e;case 5936:switch(zh(e,t+11)){case 114:return Ph+e+xh+Oh(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ph+e+xh+Oh(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ph+e+xh+Oh(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ph+e+xh+e+e;case 6165:return Ph+e+xh+"flex-"+e+e;case 5187:return Ph+e+Oh(e,/(\w+).+(:[^]+)/,Ph+"box-$1$2"+xh+"flex-$1$2")+e;case 5443:return Ph+e+xh+"flex-item-"+Oh(e,/flex-|-self/g,"")+(Ch(e,/flex-|baseline/)?"":xh+"grid-row-"+Oh(e,/flex-|-self/g,""))+e;case 4675:return Ph+e+xh+"flex-line-pack"+Oh(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ph+e+xh+Oh(e,"shrink","negative")+e;case 5292:return Ph+e+xh+Oh(e,"basis","preferred-size")+e;case 6060:return Ph+"box-"+Oh(e,"-grow","")+Ph+e+xh+Oh(e,"grow","positive")+e;case 4554:return Ph+Oh(e,/([^-])(transform)/g,"$1"+Ph+"$2")+e;case 6187:return Oh(Oh(Oh(e,/(zoom-|grab)/,Ph+"$1"),/(image-set)/,Ph+"$1"),e,"")+e;case 5495:case 3959:return Oh(e,/(image-set\([^]*)/,Ph+"$1$`$1");case 4968:return Oh(Oh(e,/(.+:)(flex-)?(.*)/,Ph+"box-pack:$3"+xh+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ph+e+e;case 4200:if(!Ch(e,/flex-|baseline/))return xh+"grid-column-align"+_h(e,t)+e;break;case 2592:case 3360:return xh+Oh(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(e,n){return t=n,Ch(e.props,/grid-\w+-end/)})?~Rh(e+(n=n[t].value),"span",0)?e:xh+Oh(e,"-start","")+e+xh+"grid-row-span:"+(~Rh(n,"span",0)?Ch(n,/\d+/):+Ch(n,/\d+/)-+Ch(e,/\d+/))+";":xh+Oh(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(e){return Ch(e.props,/grid-\w+-start/)})?e:xh+Oh(Oh(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Oh(e,/(.+)-inline(.+)/,Ph+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Mh(e)-1-t>6)switch(zh(e,t+1)){case 109:if(45!==zh(e,t+4))break;case 102:return Oh(e,/(.+:)(.+)-([^]+)/,"$1"+Ph+"$2-$3$1"+Eh+(108==zh(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Rh(e,"stretch",0)?hp(Oh(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Oh(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,n,r,o,s,a,i){return xh+n+":"+r+i+(o?xh+n+"-span:"+(s?a:+a-+r)+i:"")+e});case 4949:if(121===zh(e,t+6))return Oh(e,":",":"+Ph)+e;break;case 6444:switch(zh(e,45===zh(e,14)?18:11)){case 120:return Oh(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ph+(45===zh(e,14)?"inline-":"")+"box$3$1"+Ph+"$2$3$1"+xh+"$2box$3")+e;case 100:return Oh(e,":",":"+xh)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Oh(e,"scroll-","scroll-snap-")+e}return e}function pp(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function mp(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Ih:return e.return=e.return||e.value;case kh:return"";case Nh:return e.return=e.value+"{"+pp(e.children,r)+"}";case Ah:if(!Mh(e.value=e.props.join(",")))return""}return Mh(n=pp(e.children,r))?e.return=e.value+"{"+n+"}":""}function gp(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ih:return void(e.return=hp(e.value,e.length,n));case Nh:return pp([Yh(e,{value:Oh(e.value,"@","@"+Ph)})],r);case Ah:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,function(t){switch(Ch(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Zh(Yh(e,{props:[Oh(t,/:(read-\w+)/,":-moz-$1")]})),Zh(Yh(e,{props:[t]})),$h(e,{props:Lh(n,r)});break;case"::placeholder":Zh(Yh(e,{props:[Oh(t,/:(plac\w+)/,":"+Ph+"input-$1")]})),Zh(Yh(e,{props:[Oh(t,/:(plac\w+)/,":-moz-$1")]})),Zh(Yh(e,{props:[Oh(t,/:(plac\w+)/,xh+"input-$1")]})),Zh(Yh(e,{props:[t]})),$h(e,{props:Lh(n,r)})}return""})}}var bp={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},yp="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",wp="active",vp="data-styled-version",xp="6.1.19",Ep="/*!sc*/\n",Pp="undefined"!=typeof window&&"undefined"!=typeof document,kp=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),Ap=/invalid hook call/i,Ip=new Set,Np=function(e,t){if("production"!==process.env.NODE_ENV){var n=t?' with the id of "'.concat(t,'"'):"",r="The component ".concat(e).concat(n," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.\nSee https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\n",s=console.error;try{var a=!0;console.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ap.test(e)?(a=!1,Ip.delete(r)):s.apply(void 0,bh([e],t,!1))},o.useRef(),a&&!Ip.has(r)&&(console.warn(r),Ip.add(r))}catch(e){Ap.test(e.message)&&Ip.delete(r)}finally{console.error=s}}},Sp=Object.freeze([]),Tp=Object.freeze({});var $p=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Bp=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Cp=/(^-|-$)/g;function Op(e){return e.replace(Bp,"-").replace(Cp,"")}var Rp=/(a)(d)/gi,zp=function(e){return String.fromCharCode(e+(e>25?39:97))};function _p(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=zp(t%52)+n;return(zp(t%52)+n).replace(Rp,"$1-$2")}var Mp,Fp=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},jp=function(e){return Fp(5381,e)};function Lp(e){return _p(jp(e)>>>0)}function Up(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function Dp(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Gp="function"==typeof Symbol&&Symbol.for,qp=Gp?Symbol.for("react.memo"):60115,Vp=Gp?Symbol.for("react.forward_ref"):60112,Wp={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Hp={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Yp={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Zp=((Mp={})[Vp]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Mp[qp]=Yp,Mp);function Kp(e){return("type"in(t=e)&&t.type.$$typeof)===qp?Yp:"$$typeof"in e?Zp[e.$$typeof]:Wp;var t}var Jp=Object.defineProperty,Qp=Object.getOwnPropertyNames,Xp=Object.getOwnPropertySymbols,em=Object.getOwnPropertyDescriptor,tm=Object.getPrototypeOf,nm=Object.prototype;function rm(e,t,n){if("string"!=typeof t){if(nm){var r=tm(t);r&&r!==nm&&rm(e,r,n)}var o=Qp(t);Xp&&(o=o.concat(Xp(t)));for(var s=Kp(e),a=Kp(t),i=0;i<o.length;++i){var c=o[i];if(!(c in Hp||n&&n[c]||a&&c in a||s&&c in s)){var u=em(t,c);try{Jp(e,c,u)}catch(e){}}}}return e}function om(e){return"function"==typeof e}function sm(e){return"object"==typeof e&&"styledComponentId"in e}function am(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function im(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function cm(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function um(e,t,n){if(void 0===n&&(n=!1),!n&&!cm(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=um(e[r],t[r]);else if(cm(t))for(var r in t)e[r]=um(e[r],t[r]);return e}function lm(e,t){Object.defineProperty(e,"toString",{value:t})}var dm="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function fm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,s=e.length;o<s;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function hm(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(fm.apply(void 0,bh([dm[e]],t,!1)).trim())}var pm=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw hm(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var a=this.indexOfGroup(e+1),i=(s=0,t.length);s<i;s++)this.tag.insertRule(a,t[s])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat(Ep);return t},e}(),mm=1<<30,gm=new Map,bm=new Map,ym=1,wm=function(e){if(gm.has(e))return gm.get(e);for(;bm.has(ym);)ym++;var t=ym++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>mm))throw hm(16,"".concat(t));return gm.set(e,t),bm.set(t,e),t},vm=function(e,t){ym=t+1,gm.set(e,t),bm.set(t,e)},xm="style[".concat(yp,"][").concat(vp,'="').concat(xp,'"]'),Em=new RegExp("^".concat(yp,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Pm=function(e,t,n){for(var r,o=n.split(","),s=0,a=o.length;s<a;s++)(r=o[s])&&e.registerName(t,r)},km=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(Ep),o=[],s=0,a=r.length;s<a;s++){var i=r[s].trim();if(i){var c=i.match(Em);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(vm(l,u),Pm(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(i)}}},Am=function(e){for(var t=document.querySelectorAll(xm),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(yp)!==wp&&(km(e,o),o.parentNode&&o.parentNode.removeChild(o))}};var Im=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(yp,"]")));return t[t.length-1]}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(yp,wp),r.setAttribute(vp,xp);var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,s),r},Nm=function(){function e(e){this.element=Im(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw hm(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Sm=function(){function e(e){this.element=Im(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),Tm=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),$m=Pp,Bm={isServer:!Pp,useCSSOMInjection:!kp},Cm=function(){function e(e,t,n){void 0===e&&(e=Tp),void 0===t&&(t={});var r=this;this.options=gh(gh({},Bm),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&Pp&&$m&&($m=!1,Am(this)),lm(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return bm.get(e)}(n);if(void 0===o)return"continue";var s=e.names.get(o),a=t.getGroup(n);if(void 0===s||!s.size||0===a.length)return"continue";var i="".concat(yp,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(a).concat(i,'{content:"').concat(c,'"}').concat(Ep)},s=0;s<n;s++)o(s);return r}(r)})}return e.registerId=function(e){return wm(e)},e.prototype.rehydrate=function(){!this.server&&Pp&&Am(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(gh(gh({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new Tm(n):t?new Nm(n):new Sm(n)}(this.options),new pm(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(wm(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(wm(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(wm(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Om=/&/g,Rm=/^\s*\/\/.*$/gm;function zm(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=zm(e.children,t)),e})}var _m=new Cm,Mm=function(){var e,t,n,r=Tp,o=r.options,s=void 0===o?Tp:o,a=r.plugins,i=void 0===a?Sp:a,c=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},u=i.slice();u.push(function(e){e.type===Ah&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Om,t).replace(n,c))}),s.prefix&&u.push(gp),u.push(mp);var l=function(r,o,a,i){void 0===o&&(o=""),void 0===a&&(a=""),void 0===i&&(i="&"),e=i,t=o,n=new RegExp("\\".concat(t,"\\b"),"g");var c=r.replace(Rm,""),l=cp(a||o?"".concat(a," ").concat(o," { ").concat(c," }"):c);s.namespace&&(l=zm(l,s.namespace));var d,f=[];return pp(l,function(e){var t=Fh(e);return function(n,r,o,s){for(var a="",i=0;i<t;i++)a+=e[i](n,r,o,s)||"";return a}}(u.concat((d=function(e){return f.push(e)},function(e){e.root||(e=e.return)&&d(e)})))),f};return l.hash=i.length?i.reduce(function(e,t){return t.name||hm(15),Fp(e,t.name)},5381).toString():"",l}(),Fm=m.default.createContext({shouldForwardProp:void 0,styleSheet:_m,stylis:Mm});function jm(){return o.useContext(Fm)}Fm.Consumer,m.default.createContext(void 0);var Lm=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Mm);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,lm(this,function(){throw hm(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=Mm),this.name+e.hash},e}(),Um=function(e){return e>="A"&&e<="Z"};function Dm(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Um(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Gm=function(e){return null==e||!1===e||""===e},qm=function(e){var t,n,r=[];for(var o in e){var s=e[o];e.hasOwnProperty(o)&&!Gm(s)&&(Array.isArray(s)&&s.isCss||om(s)?r.push("".concat(Dm(o),":"),s,";"):cm(s)?r.push.apply(r,bh(bh(["".concat(o," {")],qm(s),!1),["}"],!1)):r.push("".concat(Dm(o),": ").concat((t=o,null==(n=s)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in bp||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Vm(e,t,n,r){if(Gm(e))return[];if(sm(e))return[".".concat(e.styledComponentId)];if(om(e)){if(!om(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof Lm||cm(o)||null===o||console.error("".concat(Up(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),Vm(o,t,n,r)}var s;return e instanceof Lm?n?(e.inject(n,r),[e.getName(r)]):[e]:cm(e)?qm(e):Array.isArray(e)?Array.prototype.concat.apply(Sp,e.map(function(e){return Vm(e,t,n,r)})):[e.toString()]}var Wm=jp(xp),Hm=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(om(n)&&!sm(n))return!1}return!0}(e),this.componentId=t,this.baseHash=Fp(Wm,t),this.baseStyle=n,Cm.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=am(r,this.staticRulesId);else{var o=im(Vm(this.rules,e,t,n)),s=_p(Fp(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,s)){var a=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,a)}r=am(r,s),this.staticRulesId=s}else{for(var i=Fp(this.baseHash,n.hash),c="",u=0;u<this.rules.length;u++){var l=this.rules[u];if("string"==typeof l)c+=l,"production"!==process.env.NODE_ENV&&(i=Fp(i,l));else if(l){var d=im(Vm(l,e,t,n));i=Fp(i,d+u),c+=d}}if(c){var f=_p(i>>>0);t.hasNameForId(this.componentId,f)||t.insertRules(this.componentId,f,n(c,".".concat(f),void 0,this.componentId)),r=am(r,f)}}return r},e}(),Ym=m.default.createContext(void 0);Ym.Consumer;var Zm={},Km=new Set;function Jm(e,t,n){var r=sm(e),s=e,a=!Dp(e),i=t.attrs,c=void 0===i?Sp:i,u=t.componentId,l=void 0===u?function(e,t){var n="string"!=typeof e?"sc":Op(e);Zm[n]=(Zm[n]||0)+1;var r="".concat(n,"-").concat(Lp(xp+n+Zm[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):u,d=t.displayName,f=void 0===d?function(e){return Dp(e)?"styled.".concat(e):"Styled(".concat(Up(e),")")}(e):d,h=t.displayName&&t.componentId?"".concat(Op(t.displayName),"-").concat(t.componentId):t.componentId||l,p=r&&s.attrs?s.attrs.concat(c).filter(Boolean):c,g=t.shouldForwardProp;if(r&&s.shouldForwardProp){var b=s.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;g=function(e,t){return b(e,t)&&y(e,t)}}else g=b}var w=new Hm(n,h,r?s.componentStyle:void 0);function v(e,t){return function(e,t,n){var r=e.attrs,s=e.componentStyle,a=e.defaultProps,i=e.foldedComponentIds,c=e.styledComponentId,u=e.target,l=m.default.useContext(Ym),d=jm(),f=e.shouldForwardProp||d.shouldForwardProp;"production"!==process.env.NODE_ENV&&o.useDebugValue(c);var h=function(e,t,n){return void 0===n&&(n=Tp),e.theme!==n.theme&&e.theme||t||n.theme}(t,l,a)||Tp,p=function(e,t,n){for(var r,o=gh(gh({},t),{className:void 0,theme:n}),s=0;s<e.length;s+=1){var a=om(r=e[s])?r(o):r;for(var i in a)o[i]="className"===i?am(o[i],a[i]):"style"===i?gh(gh({},o[i]),a[i]):a[i]}return t.className&&(o.className=am(o.className,t.className)),o}(r,t,h),g=p.as||u,b={};for(var y in p)void 0===p[y]||"$"===y[0]||"as"===y||"theme"===y&&p.theme===h||("forwardedAs"===y?b.as=p.forwardedAs:f&&!f(y,g)||(b[y]=p[y],f||"development"!==process.env.NODE_ENV||vh(y)||Km.has(y)||!$p.has(g)||(Km.add(y),console.warn('styled-components: it looks like an unknown prop "'.concat(y,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var w=function(e,t){var n=jm(),r=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return"production"!==process.env.NODE_ENV&&o.useDebugValue(r),r}(s,p);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(w);var v=am(i,c);return w&&(v+=" "+w),p.className&&(v+=" "+p.className),b[Dp(g)&&!$p.has(g)?"class":"className"]=v,n&&(b.ref=n),o.createElement(g,b)}(x,e,t)}v.displayName=f;var x=m.default.forwardRef(v);return x.attrs=p,x.componentStyle=w,x.displayName=f,x.shouldForwardProp=g,x.foldedComponentIds=r?am(s.foldedComponentIds,s.styledComponentId):"",x.styledComponentId=h,x.target=r?s.target:e,Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=r?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)um(e,o[r],!0);return e}({},s.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(Np(f,h),x.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(s,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(f,h)),lm(x,function(){return".".concat(x.styledComponentId)}),a&&rm(x,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),x}function Qm(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var Xm=function(e){return Object.assign(e,{isCss:!0})};function eg(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(om(e)||cm(e))return Xm(Vm(Qm(Sp,bh([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?Vm(r):Xm(Vm(Qm(r,t)))}function tg(e,t,n){if(void 0===n&&(n=Tp),!t)throw hm(1,t);var r=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return e(t,n,eg.apply(void 0,bh([r],o,!1)))};return r.attrs=function(r){return tg(e,t,gh(gh({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return tg(e,t,gh(gh({},n),r))},r}var ng=function(e){return tg(Jm,e)},rg=ng;$p.forEach(function(e){rg[e]=ng(e)}),"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var og="__sc-".concat(yp,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[og]||(window[og]=0),1===window[og]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[og]+=1);const sg={colors:{black:"#000000",white:"#FFFFFF",offWhite:"#F5F5F5",grey:{100:"#F7F7F7",200:"#E6E6E6",300:"#D1D1D1",400:"#B0B0B0",500:"#8C8C8C",600:"#696969",700:"#474747",800:"#2B2B2B",900:"#1A1A1A"},primary:"#000000",secondary:"#B0B0B0",error:"#FF4D4D",success:"#4CAF50",background:{main:"#FFFFFF",secondary:"#F5F5F5",overlay:"rgba(0, 0, 0, 0.7)"},text:{primary:"#000000",secondary:"#474747",tertiary:"#8C8C8C",inverse:"#FFFFFF"},button:{primary:{background:"#000000",text:"#FFFFFF",hover:"#2B2B2B",disabled:"#8C8C8C"},secondary:{background:"#F5F5F5",text:"#000000",hover:"#E6E6E6",disabled:"#D1D1D1"}},border:{light:"#E6E6E6",medium:"#D1D1D1",dark:"#8C8C8C"}},typography:{fontFamily:"'Montserrat', 'Arial', sans-serif",fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeights:{light:300,regular:400,medium:500,semibold:600,bold:700}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{none:"0",sm:"0.125rem",md:"0.25rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},shadows:{none:"none",sm:"0 1px 2px rgba(0, 0, 0, 0.05)",md:"0 4px 6px rgba(0, 0, 0, 0.05)",lg:"0 10px 15px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.1s ease",normal:"0.2s ease",slow:"0.3s ease"}},ag=(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var r=im(eg.apply(void 0,bh([e],t,!1))),o=Lp(r);return new Lm(o,r)})`
|
|
13
13
|
from {
|
|
14
14
|
transform: rotate(0deg);
|
|
15
15
|
}
|