PageSourceSearch

https://app.fungify.it/assets/index-BJ3LYk4J.js

js fungify.it collected 2026-10-06 13:41:34 UTC 260,585 bytes, 7 lines download raw bytes

1import{cu as A,eG as Cr,cJ as $,eH as jc,cH as jt,eI as sa,cI as ia,aU as Ts,eJ as Dc,K as Hc}from"./index-CUYrygIZ.js";import{d as Uc,h as Vc}from"./hooks.module-D-mH0Km3.js";function Wc(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var js={},xt={},kr={};Object.defineProperty(kr,"__esModule",{value:!0});kr.walletLogo=void 0;const zc=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3
1V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7
1h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};kr.walletLogo=zc;var Rr={};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.LINK_API_URL=void 0;Rr.LINK_API_URL="https://www.walletlink.org";var v={},Dt={},Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.errorValues=Fe.standardErrorCodes=void 0;Fe.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Fe.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var Ir={},Ar={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Fe,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";
1function n(h,f=r){if(h&&Number.isInteger(h)){const g=h.toString();if(u(t.errorValues,g))return t.errorValues[g].message;if(l(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return f}e.getMessageFromCode=n;function s(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!(t.errorValues[f]||l(h))}e.isValidCode=s;function i(h){var f;if(typeof h=="number")return h;if(o(h))return(f=h.code)!==null&&f!==void 0?f:h.errorCode}e.getErrorCode=i;function o(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function a(h,{shouldIncludeStack:f=!1}={}){const g={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&s(h.code)){const E=h;g.code=E.code,E.message&&typeof E.message=="string"?(g.message=E.message,u(E,"data")&&(g.data=E.data)):(g.message=n(g.code),g.data={originalError:c(h)})}else g.code=t.standardErrorCodes.rpc.internal,g.message=d(h,"message")?h.message:r,g.data={originalError:c(h)};return f&&(g.stack=d(h,"stack")?h.stack:void 0),g}e.serialize=a;function l(h){return h>=-32099&&h<=-32e3}function c(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,f){return Object.prototype.hasOwnProperty.call(h,f)}function d(h,f){return typeof h=="object"&&h!==null&&f in h&&typeof h[f]=="string"}})(Ar);Object.defineProperty(Ir,"__esModule",{value:!0});Ir.standardErrors=void 0;const te=Fe,oa=Ar;Ir.standardErrors={rpc:{parse:e=>me(te.standardErrorCodes.rpc.parse,e),invalidRequest:e=>me(te.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>me(te.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>me(te.standardErrorCodes.rpc.methodNotFound,e),internal:e=>me(te.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code 
1<= -32005');return me(t,e)},invalidInput:e=>me(te.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>me(te.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>me(te.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>me(te.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>me(te.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>me(te.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>it(te.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>it(te.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>it(te.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>it(te.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>it(te.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>it(te.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new la(t,r,n)}}};function me(e,t){const[r,n]=aa(t);return new ca(e,r||(0,oa.getMessageFromCode)(e),n)}function it(e,t){const[r,n]=aa(t);return new la(e,r||(0,oa.getMessageFromCode)(e),n)}function aa(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;
1if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let ca=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},la=class extends ca{constructor(t,r,n){if(!qc(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function qc(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Nr={},St={};Object.defineProperty(St,"__esModule",{value:!0});St.isErrorResponse=void 0;function Jc(e){return e.errorMessage!==void 0}St.isErrorResponse=Jc;var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.LIB_VERSION=void 0;Ct.LIB_VERSION="3.9.3";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.serializeError=void 0;const Gc=St,Zc=Ct,Qc=Fe,Kc=Ar;function Xc(e,t){const r=(0,Kc.serialize)(Yc(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Zc.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=el(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Nr.serializeError=Xc;function Yc(e){return typeof e=="string"?{message:e,code:Qc.standardErrorCodes.rpc.internal}:(0,Gc.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function el(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Fe;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Ir;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Nr;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=Ar;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(Dt);var X={};Object.defineProperty(X,"__esModule",{value:!0});X.ProviderType=X.RegExpString=X.IntNumber=X.BigIntString=X.AddressString=X.HexString=X.OpaqueType=void 0;function Ht(){return e=>e}X.OpaqueType=Ht;X.HexString=Ht();X.AddressString=Ht();X.BigIntString=Ht();function tl(e){return Math.floor(e)}X.IntNumber=tl;X.RegExpString=Ht();var Wi;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Wi||(X.ProviderType=Wi={}));var rl=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(v,"__esModule",{value:!0});v.isMobileWeb=v.getLocation=v.isInIFrame=v.createQrUrl=v.getFavicon=v.range=v.isBigNumber=v.ensureParsedJSONObject=v.ensureBN=v.ensureRegExpString=v.ensureIntNumber=v.ensureBuffer=v.ensureAddressString=v.ensureEvenLengthHexString=v.ensureHexString=v.isHexString=v.prepend0x=v.strip0x=v.has0xPrefix=v.hexStringFromIntNumber=v.intNumberFromHexString=v.bigIntStringFromBN=v.hexStringFromBuffer=v.hexStringToUint8Array=v.uint8ArrayToHex=v.randomBytesHex=void 0;const He=rl(Cr),rt=Dt,Ee=X,ua=/^[0-9]*$/,da=/^[a-f0-9]*$/;function nl(e){return ha(crypto.getRandomValues(new Uint8Array(e)))}v.randomBytesHex=nl;function ha(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}v.uint8ArrayToHex=ha;function sl(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}v.hexStringToUint8Array=sl;function il(e,t=!1){const r=e.toString("hex");return(0,Ee.HexString)(t?`0x${r}`:r)}v.hexStringFromBuffer=il;function ol(e){return(0,Ee.BigIntString)(e.toString(10))}v.bigIntStringFromBN=ol;function al(e){return(0,Ee.IntNumber)(new He.default(Vt(e,!1),16).toNumber())}v.intNumberFromHexString=al;function cl(e){return(0,Ee.HexString)(`0x${new He.default(e).toString(16)}`)}v.hexStringFromIntNumber=cl;function Ds(e){return e.startsWith("0x")||e.startsWith("0X")}v.has0xPrefix=Ds;function Lr(e){return Ds(e)?e.slice(2):e}v.strip0x=Lr;function fa(e){return Ds(e)?`0x${e.slice(2)}`:`0x${e}`}v.prepend0x=fa;function Ut(e){if(typeof e!="string")return!1;const t=Lr(e).toLowerCase();return da.test(t)}v.isHexString=Ut;function ga(e,t=!1){if(typeof e=="string"){const r=Lr(e).toLowerCase();if(da.test(r))return(0,Ee.HexString)(t?`0x${r}`:r)}throw rt.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}v.ensureHexString=ga;
1function Vt(e,t=!1){let r=ga(e,!1);return r.length%2===1&&(r=(0,Ee.HexString)(`0${r}`)),t?(0,Ee.HexString)(`0x${r}`):r}v.ensureEvenLengthHexString=Vt;function ll(e){if(typeof e=="string"){const t=Lr(e).toLowerCase();if(Ut(t)&&t.length===40)return(0,Ee.AddressString)(fa(t))}throw rt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}v.ensureAddressString=ll;function ul(e){if($.isBuffer(e))return e;if(typeof e=="string"){if(Ut(e)){const t=Vt(e,!1);return $.from(t,"hex")}return $.from(e,"utf8")}throw rt.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}v.ensureBuffer=ul;function pa(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Ee.IntNumber)(e);if(typeof e=="string"){if(ua.test(e))return(0,Ee.IntNumber)(Number(e));if(Ut(e))return(0,Ee.IntNumber)(new He.default(Vt(e,!1),16).toNumber())}throw rt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}v.ensureIntNumber=pa;function dl(e){if(e instanceof RegExp)return(0,Ee.RegExpString)(e.toString());throw rt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}v.ensureRegExpString=dl;function hl(e){if(e!==null&&(He.default.isBN(e)||ma(e)))return new He.default(e.toString(10),10);if(typeof e=="number")return new He.default(pa(e));if(typeof e=="string"){if(ua.test(e))return new He.default(e,10);if(Ut(e))return new He.default(Vt(e,!1),16)}throw rt.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}v.ensureBN=hl;function fl(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw rt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}v.ensureParsedJSONObject=fl;function ma(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}v.isBigNumber=ma;function gl(e,t){return Array.from({length:t-e},(r,n)=>e+n)}v.range=gl;function pl(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}v.getFavicon=pl;function ml(e,t,r,n,s,i){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${a}`}v.createQrUrl=ml;function ba(){try{return window.frameElement!==null}catch{return!1}}v.isInIFrame=ba;function bl(){try{return ba()&&window.top?window.top.location:window.location}catch{return window.location}}v.getLocation=bl;function wl(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}v.isMobileWeb=wl;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.ScopedLocalStorage=void 0;class yl{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const s=localStorage.key(n);typeof s=="string"&&s.startsWith(t)&&r.push(s)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Mr.ScopedLocalStorage=yl;var bt={},wa={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function i(l,c,u,d,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var f=new s(u,d||l,h),g=r?r+c:c;return l._events[g]?l._events[g].fn?l._events[g]=[l._events[g],f]:l._events[g].push(f):(l._events[g]=f,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function a(){this._events=new n,this._eventsCount=0}
1a.prototype.eventNames=function(){var c=[],u,d;if(this._eventsCount===0)return c;for(d in u=this._events)t.call(u,d)&&c.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=r?r+c:c,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,f=d.length,g=new Array(f);h<f;h++)g[h]=d[h].fn;return g},a.prototype.listenerCount=function(c){var u=r?r+c:c,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(c,u,d,h,f,g){var E=r?r+c:c;if(!this._events[E])return!1;var p=this._events[E],S=arguments.length,b,m;if(p.fn){switch(p.once&&this.removeListener(c,p.fn,void 0,!0),S){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,u),!0;case 3:return p.fn.call(p.context,u,d),!0;case 4:return p.fn.call(p.context,u,d,h),!0;case 5:return p.fn.call(p.context,u,d,h,f),!0;case 6:return p.fn.call(p.context,u,d,h,f,g),!0}for(m=1,b=new Array(S-1);m<S;m++)b[m-1]=arguments[m];p.fn.apply(p.context,b)}else{var x=p.length,y;for(m=0;m<x;m++)switch(p[m].once&&this.removeListener(c,p[m].fn,void 0,!0),S){case 1:p[m].fn.call(p[m].context);break;case 2:p[m].fn.call(p[m].context,u);break;case 3:p[m].fn.call(p[m].context,u,d);break;case 4:p[m].fn.call(p[m].context,u,d,h);break;default:if(!b)for(y=1,b=new Array(S-1);y<S;y++)b[y-1]=arguments[y];p[m].fn.apply(p[m].context,b)}}return!0},a.prototype.on=function(c,u,d){return i(this,c,u,d,!1)},a.prototype.once=function(c,u,d){return i(this,c,u,d,!0)},a.prototype.removeListener=function(c,u,d,h){var f=r?r+c:c;if(!this._events[f])return this;if(!u)return o(this,f),this;var g=this._events[f];if(g.fn)g.fn===u&&(!h||g.once)&&(!d||g.context===d)&&o(this,f);else{for(var E=0,p=[],S=g.length;E<S;E++)(g[E].fn!==u||h&&!g[E].once||d&&g[E].context!==d)&&p.push(g[E]);p.length?this._events[f]=p.length===1?p[0]:p:o(this,f)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=r?r+c:c,this._events[u]&&o(this,u)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a})(wa);var El=wa.exports,Wt={},zt={},kt={};Object.defineProperty(kt,"__esModule",{value:!0});kt.EVENTS=void 0;kt.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.RelayAbstract=ye.APP_VERSION_KEY=ye.LOCAL_STORAGE_ADDRESSES_KEY=ye.WALLET_USER_NAME_KEY=void 0;const zi=Dt;ye.WALLET_USER_NAME_KEY="walletUsername";ye.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";ye.APP_VERSION_KEY="AppVersion";class _l{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw zi.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,zi.serializeError)(i,t.method);return s})}}ye.RelayAbstract=_l;var Rt={};
1Object.defineProperty(Rt,"__esModule",{value:!0});Rt.Session=void 0;const qi=jc,Ji=v,Gi="session:id",Zi="session:secret",Qi="session:linked";class Hs{constructor(t,r,n,s){this._storage=t,this._id=r||(0,Ji.randomBytesHex)(16),this._secret=n||(0,Ji.randomBytesHex)(32),this._key=new qi.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(Gi),n=t.getItem(Qi),s=t.getItem(Zi);return r&&s?new Hs(t,r,s,n==="1"):null}static hash(t){return new qi.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Gi,this._id),this._storage.setItem(Zi,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Qi,this._linked?"1":"0")}}Rt.Session=Hs;var Tr={},Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});Pr.Cipher=void 0;const ar=v;class vl{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,ar.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),a=16,l=o.slice(o.byteLength-a),c=o.slice(0,o.byteLength-a),u=new Uint8Array(l),d=new Uint8Array(c),h=new Uint8Array([...n,...u,...d]);return(0,ar.uint8ArrayToHex)(h)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,ar.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,ar.hexStringToUint8Array)(t),a=o.slice(0,12),l=o.slice(12,28),c=o.slice(28),u=new Uint8Array([...c,...l]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(d,i,u),f=new TextDecoder;n(f.decode(h))}catch(h){s(h)}})()})}}Pr.Cipher=vl;var $r={};Object.defineProperty($r,"__esModule",{value:!0});$r.WalletLinkHTTP=void 0;class Sl{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}$r.WalletLinkHTTP=Sl;var wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.WalletLinkWebSocket=wt.ConnectionState=void 0;var ht;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(ht||(wt.ConnectionState=ht={}));class Cl{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,ht.CONNECTING),s.onclose
1=i=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,ht.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,ht.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},s.onmessage=i=>{var o,a;if(i.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(i.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,l)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,ht.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}wt.WalletLinkWebSocket=Cl;Object.defineProperty(Tr,"__esModule",{value:!0});Tr.WalletLinkConnection=void 0;const ot=X,kl=Pr,Re=kt,Ki=ye,at=Rt,Rl=$r,cr=wt,Xi=1e4,Il=6e4;class Al{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,ot.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",c=>a.JsonRpcUrl&&this.handleChainUpdated(c,a.JsonRpcUrl)]]).forEach((c,u)=>{const d=a[u];d!==void 0&&c(d)})},this.handleDestroyed=a=>{var l,c;a==="1"&&((l=this.listener)===null||l===void 0||l.resetAndReload(),(c=this.diagnostic)===null||c===void 0||c.log(Re.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:at.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var l,c;try{const u=await this.cipher.decrypt(a);(l=this.listener)===null||l===void 0||l.accountUpdated(u)}catch{(c=this.diagnostic)===null||c===void 0||c.log(Re.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,l)=>{var c,u;try{const d=await this.cipher.decrypt(l);(c=this.listener)===null||c===void 0||c.metadataUpdated(a,d)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Re.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(Ki.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Ki.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,l)=>{var c,u;try{const d=await this.cipher.decrypt(a),h=await this.cipher.decrypt(l);(c=this.listener)===null||c===void 0||c.chainUpdated(d,h)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Re.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new kl.Cipher(t.secret),this.diagnostic=s,this.listener=n;const o=new cr.WalletLinkWebSocket(`${r}/rpc`,i);o.setConnectionStateListener(async a=>{var l;(l=this.diagnostic)===null||l===void 0||l.log(Re.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:at.Session.hash(t.id)});let c=!1;switch(a){case cr.ConnectionState.DISCONNECTED:if(!this.destroyed){const u=async()=>{await new Promise(d=>setTimeout(d,5e3)),this.destroyed||o.connect().catch(()=>{u()})};u()}break;case cr.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),c=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Xi),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case cr.ConnectionState.CONNECTING:break}this.connected!==c&&(this.connected=c)}),o.setIncomingDataListener(a=>{var l,c,u;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const d=a.type==="IsLinkedOK"?a.linked:void 0;(l=this.diagnostic)===null||l===void 0||l.log(Re.EVENTS.LINKED,{sessionIdHash:at.Session.hash(t.id),linked:d,type:a.type,onlineGuests:a.onlineGuests}),this.linked=d||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(c=this.diagnostic)===null||c===void 0||c.log(Re.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:at.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((u=this.requestResolutions.get(a.id))===null||u===void 0||u(a))}),this.ws=o,this.http=new Rl.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Re.EVENTS.STARTED_CONNECTING,{sessionIdHash:at.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Re.EVENTS.DISCONNECTED,{sessionIdHash:at.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Re.EVENTS.GENERAL_ER
1ROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,ot.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,ot.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(i);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Xi*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Il){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,o)=>{s=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,o=>{clearTimeout(s),i(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,ot.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,ot.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,ot.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Tr.WalletLinkConnection=Al;var qt={},Jt={},Us={};Object.defineProperty(Us,"__esModule",{value:!0});Us.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';
1var Nl=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.injectCssReset=void 0;const Ll=Nl(Us);function Ml(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Ll.default)),document.documentElement.appendChild(e)}Jt.injectCssReset=Ml;var Or={};const de=jt(Uc);var xr={};function ya(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=ya(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Yi(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=ya(e))&&(n&&(n+=" "),n+=t);return n}const Tl=Object.freeze(Object.defineProperty({__proto__:null,clsx:Yi,default:Yi},Symbol.toStringTag,{value:"Module"})),Gt=jt(Tl),Fr=jt(Vc);var yt={},Br={};Object.defineProperty(Br,"__esModule",{value:!0});Br.CloseIcon=void 0;const eo=de;function Pl(e){return(0,eo.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,eo.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}Br.CloseIcon=Pl;var jr={};Object.defineProperty(jr,"__esModule",{value:!0});jr.CoinbaseWalletRound=void 0;const lr=de;function $l(e){return(0,lr.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,lr.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,lr.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,lr.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}jr.CoinbaseWalletRound=$l;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.QRCodeIcon=void 0;const Mt=de;function Ol(e){return(0,Mt.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Mt.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Mt.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Mt.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Mt.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Dr.QRCodeIcon=Ol;var Hr={};function Ea(e){this.mode=ge.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],s=this.data.charCodeAt(t);s>65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>
12048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Ea.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Te(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Te.prototype={addData:function(e){var t=new Ea(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Te.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=z.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i<this.modules.length;i++)for(var o=i*s,a=0;a<this.modules[i].length;a++){var l=a*s,c=this.modules[i][a];c&&(n.beginFill(0,100),n.moveTo(l,o),n.lineTo(l+s,o),n.lineTo(l+s,o+s),n.lineTo(l,o+s),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=z.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],s=e[r];if(this.modules[n][s]==null)for(var i=-2;i<=2;i++)for(var o=-2;o<=2;o++)i==-2||i==2||o==-2||o==2||i==0&&o==0?this.modules[n+i][s+o]=!0:this.modules[n+i][s+o]=!1}},setupTypeNumber:function(e){for(var t=z.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=z.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var l=!1;i<e.length&&(l=(e[i]>>>s&1)==1);var c=z.getMask(t,n,o-a);c&&(l=!l),this.modules[n][o-a]=l,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Te.PAD0=236;Te.PAD1=17;Te.createData=function(e,t,r){for(var n=Me.getRSBlocks(e,t),s=new _a,i=0;i<r.length;i++){var o=r[i];s.put(o.mode,4),s.put(o.getLength(),z.getLengthInBits(o.mode,e)),o.write(s)}for(var a=0,i=0;i<n.length;i++)a+=n[i].dataCount;if(s.getLengthInBits()>a*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(Te.PAD0,8),s.getLengthInBits()>=a*8));)s.put(Te.PAD1,8);return Te.createBytes(s,n)};Te.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),o=new Array(t.length),a=0;a<t.length;a++){var l=t[a].dataCount,c=t[a].totalCount-l;n=Math.max(n,l),s=Math.max(s,c),i[a]=new Array(l);for(var u=0;u<i[a].length;u++)i[a][u]=255&e.buffer[u+r];r+=l;var d=z.getErrorCorrectPolynomial(c),h=new ft(i[a],d.getLength()-1),f=h.mod(d);o[a]=new Array(d.getLength()-1);for(var u=0;u<o[a].length;u++){var g=u+f.getLength()-o[a].length;o[a][u]=g>=0?f.get(g):0}}for(var E=0,u=0;u<t.length;u++)E+=t[u].totalCount;for(var p=new Array(E),S=0,u=0;u<n;u++)for(var a=0;a<t.length;a++)u<i[a].length&&(p[S++]=i[a][u]);for(var u=0;u<s;u++)for(var a=0;a<t.length;a++)u<o[a].length&&(p[S++]=o[a][u]);return p};var ge={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ue={L:1,M:0,Q:3,H:2},je={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},z={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;
vendor: 4,297 bytes, line 1
1z.getBCHDigit(t)-z.getBCHDigit(z.G15)>=0;)t^=z.G15<<z.getBCHDigit(t)-z.getBCHDigit(z.G15);return(e<<10|t)^z.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;z.getBCHDigit(t)-z.getBCHDigit(z.G18)>=0;)t^=z.G18<<z.getBCHDigit(t)-z.getBCHDigit(z.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return z.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case je.PATTERN000:return(t+r)%2==0;case je.PATTERN001:return t%2==0;case je.PATTERN010:return r%3==0;case je.PATTERN011:return(t+r)%3==0;case je.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case je.PATTERN101:return t*r%2+t*r%3==0;case je.PATTERN110:return(t*r%2+t*r%3)%2==0;case je.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new ft([1],0),r=0;r<e;r++)t=t.multiply(new ft([1,ee.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ge.MODE_NUMBER:return 10;case ge.MODE_ALPHA_NUM:return 9;case ge.MODE_8BIT_BYTE:return 8;case ge.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ge.MODE_NUMBER:return 12;case ge.MODE_ALPHA_NUM:return 11;case ge.MODE_8BIT_BYTE:return 16;case ge.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ge.MODE_NUMBER:return 14;case ge.MODE_ALPHA_NUM:return 13;case ge.MODE_8BIT_BYTE:return 16;case ge.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var s=0;s<t;s++){for(var i=0,o=e.isDark(n,s),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var l=-1;l<=1;l++)s+l<0||t<=s+l||a==0&&l==0||o==e.isDark(n+a,s+l)&&i++;i>5&&(r+=3+i-5)}for(var n=0;n<t-1;n++)for(var s=0;s<t-1;s++){var c=0;e.isDark(n,s)&&c++,e.isDark(n+1,s)&&c++,e.isDark(n,s+1)&&c++,e.isDark(n+1,s+1)&&c++,(c==0||c==4)&&(r+=3)}for(var n=0;n<t;n++)for(var s=0;s<t-6;s++)e.isDark(n,s)&&!e.isDark(n,s+1)&&e.isDark(n,s+2)&&e.isDark(n,s+3)&&e.isDark(n,s+4)&&!e.isDark(n,s+5)&&e.isDark(n,s+6)&&(r+=40);for(var s=0;s<t;s++)for(var n=0;n<t-6;n++)e.isDark(n,s)&&!e.isDark(n+1,s)&&e.isDark(n+2,s)&&e.isDark(n+3,s)&&e.isDark(n+4,s)&&!e.isDark(n+5,s)&&e.isDark(n+6,s)&&(r+=40);for(var u=0,s=0;s<t;s++)for(var n=0;n<t;n++)e.isDark(n,s)&&u++;var d=Math.abs(100*u/t/t-50)/5;return r+=d*10,r}},ee={glog:function(e){if(e<1)throw new Error("glog("+e+")");return ee.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return ee.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var re=0;re<8;re++)ee.EXP_TABLE[re]=1<<re;for(var re=8;re<256;re++)ee.EXP_TABLE[re]=ee.EXP_TABLE[re-4]^ee.EXP_TABLE[re-5]^ee.EXP_TABLE[re-6]^ee.EXP_TABLE[re-8];for(var re=0;re<255;re++)ee.LOG_TABLE[ee.EXP_TABLE[re]]=re;function ft(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}ft.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=ee.gexp(ee.glog(this.get(r))+ee.glog(e.get(n)));return new ft(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=ee.glog(this.get(0))-ee.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=ee.gexp(ee.glog(e.get(n))+t);return new ft(r,0).mod(e)}};function Me(e,t){this.totalCount=e,this.dataCount=t}Me.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37
1],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Me.getRSBlocks=function(e,t){var r=Me.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,s=[],i=0;i<n;i++)for(var o=r[i*3+0],a=r[i*3+1],l=r[i*3+2],c=0;c<o;c++)s.push(new Me(a,l));return s};Me.getRsBlockTable=function(e,t){switch(t){case Ue.L:return Me.RS_BLOCK_TABLE[(e-1)*4+0];case Ue.M:return Me.RS_BLOCK_TABLE[(e-1)*4+1];case Ue.Q:return Me.RS_BLOCK_TABLE[(e-1)*4+2];case Ue.H:return Me.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function _a(){this.buffer=[],this.length=0}_a.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var hs=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function va(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(l){switch(l){case"L":return Ue.L;case"M":return Ue.M;case"Q":return Ue.Q;case"H":return Ue.H;default:throw new Error("Unknwon error correction level: "+l)}}function n(l,c){for(var u=s(l),d=1,h=0,f=0,g=hs.length;f<=g;f++){var E=hs[f];
1if(!E)throw new Error("Content too long: expected "+h+" but got "+u);switch(c){case"L":h=E[0];break;case"M":h=E[1];break;case"Q":h=E[2];break;case"H":h=E[3];break;default:throw new Error("Unknwon error correction level: "+c)}if(u<=h)break;d++}if(d>hs.length)throw new Error("Content too long");return d}function s(l){var c=encodeURI(l).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return c.length+(c.length!=l?3:0)}var i=this.options.content,o=n(i,this.options.ecl),a=r(this.options.ecl);this.qrcode=new Te(o,a),this.qrcode.addData(i),this.qrcode.make()}va.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?"  ":"",i=n?`\r
2`:"",o=t.width,a=t.height,l=r.length,c=o/(l+2*t.padding),u=a/(l+2*t.padding),d=typeof t.join<"u"?!!t.join:!1,h=typeof t.swap<"u"?!!t.swap:!1,f=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,g=typeof t.predefined<"u"?!!t.predefined:!1,E=g?s+'<defs><path id="qrmodule" d="M0 0 h'+u+" v"+c+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",p=s+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,S="",b="",m=0;m<l;m++)for(var x=0;x<l;x++){var y=r[x][m];if(y){var L=x*c+t.padding*c,U=m*u+t.padding*u;if(h){var K=L;L=U,U=K}if(d){var se=c+L,J=u+U;L=Number.isInteger(L)?Number(L):L.toFixed(2),U=Number.isInteger(U)?Number(U):U.toFixed(2),se=Number.isInteger(se)?Number(se):se.toFixed(2),J=Number.isInteger(J)?Number(J):J.toFixed(2),b+="M"+L+","+U+" V"+J+" H"+se+" V"+U+" H"+L+" Z "}else g?S+=s+'<use x="'+L.toString()+'" y="'+U.toString()+'" href="#qrmodule" />'+i:S+=s+'<rect x="'+L.toString()+'" y="'+U.toString()+'" width="'+c+'" height="'+u+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}}d&&(S=s+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+b+'" />');let ae="";if(this.options.image!==void 0&&this.options.image.svg){const _=o*this.options.image.width/100,w=a*this.options.image.height/100,R=o/2-_/2,k=a/2-w/2;ae+=`<svg x="${R}" y="${k}" width="${_}" height="${w}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,ae+=this.options.image.svg+i,ae+="</svg>"}var G="";switch(e.container){case"svg":f&&(G+='<?xml version="1.0" standalone="yes"?>'+i),G+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+i,G+=E+p+S,G+=ae,G+="</svg>";break;case"svg-viewbox":f&&(G+='<?xml version="1.0" standalone="yes"?>'+i),G+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+i,G+=E+p+S,G+=ae,G+="</svg>";break;case"g":G+='<g width="'+o+'" height="'+a+'">'+i,G+=E+p+S,G+=ae,G+="</g>";break;default:G+=(E+p+S+ae).replace(/^\s+/,"");break}return G};var xl=va,Fl=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.QRCode=void 0;const Bl=de,to=Fr,jl=Fl(xl),Dl=e=>{const[t,r]=(0,to.useState)("");return(0,to.useEffect)(()=>{var n,s;const i=new jl.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(s=e.height)!==null&&s!==void 0?s:256,padding:0,image:e.image}),o=$.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Bl.h)("img",{src:t,alt:"QR Code"}):null};Hr.QRCode=Dl;var Ur={},Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";
2var Hl=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.Spinner=void 0;const ur=de,Ul=Hl(Vs),Vl=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,ur.h)("div",{class:"-cbwsdk-spinner"},(0,ur.h)("style",null,Ul.default),(0,ur.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,ur.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Ur.Spinner=Vl;var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";
2var Sa=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yt,"__esModule",{value:!0});yt.CoinbaseWalletSteps=yt.ConnectContent=void 0;const Ye=Sa(Gt),B=de,Wl=v,zl=Ct,ql=Br,Jl=jr,Gl=Dr,Zl=Hr,Ql=Ur,Kl=Sa(Ws),fs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Ca},Xl=e=>e==="light"?"#FFFFFF":"#0A0B0D";function Yl(e){const{theme:t}=e,r=(0,Wl.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=fs.steps;return(0,B.h)("div",{"data-testid":"connect-content",className:(0,Ye.default)("-cbwsdk-connect-content",t)},(0,B.h)("style",null,Kl.default),(0,B.h)("div",{className:"-cbwsdk-connect-content-header"},(0,B.h)("h2",{className:(0,Ye.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,B.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,B.h)(ql.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,B.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,B.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,B.h)(eu,{title:fs.title,description:fs.description,theme:t})),(0,B.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,B.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,B.h)(Zl.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,B.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:zl.LIB_VERSION}),(0,B.h)("input",{type:"hidden",value:r})),(0,B.h)(n,{theme:t}),!e.isConnected&&(0,B.h)("div",{"data-testid":"connecting-spinner",className:(0,Ye.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,B.h)(Ql.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,B.h)("p",null,"Connecting...")))))}yt.ConnectContent=Yl;function eu({title:e,description:t,theme:r}){return(0,B.h)("div",{className:(0,Ye.default)("-cbwsdk-connect-item",r)},(0,B.h)("div",null,(0,B.h)(Jl.CoinbaseWalletRound,null)),(0,B.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,B.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,B.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Ca({theme:e}){return(0,B.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,B.h)("li",{className:(0,Ye.default)("-cbwsdk-wallet-steps-item",e)},(0,B.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,B.h)("li",{className:(0,Ye.default)("-cbwsdk-wallet-steps-item",e)},(0,B.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,B.h)("span",null,"Tap ",(0,B.h)("strong",null,"Scan")," "),(0,B.h)("span",{className:(0,Ye.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,B.h)(Gl.QRCodeIcon,{fill:Xl(e)})))))}yt.CoinbaseWalletSteps=Ca;var Vr={},Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.ArrowLeftIcon=void 0;const ro=de;function tu(e){return(0,ro.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,ro.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Wr.ArrowLeftIcon=tu;var zr={};Object.defineProperty(zr,"__esModule",{value:!0});zr.LaptopIcon=void 0;const gs=de;function ru(e){return(0,gs.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,gs.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,gs.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}zr.LaptopIcon=ru;var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.SafeIcon=void 0;const no=de;function nu(e){return(0,no.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,no.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8
2001 5.20598 8.8001 6.2001Z"}))}qr.SafeIcon=nu;var zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var ka=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.TryExtensionContent=void 0;const ze=ka(Gt),Q=de,ps=Fr,su=Wr,iu=zr,ou=qr,au=ka(zs);function cu({theme:e}){const[t,r]=(0,ps.useState)(!1),n=(0,ps.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,ps.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Q.h)("div",{class:(0,ze.default)("-cbwsdk-try-extension",e)},(0,Q.h)("style",null,au.default),(0,Q.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Q.h)("h3",{class:(0,ze.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Q.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Q.h)("button",{class:(0,ze.default)("-cbwsdk-try-extension-cta",e),onClick:s},t?"Refresh":"Install"),(0,Q.h)("div",null,!t&&(0,Q.h)(su.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Q.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Q.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Q.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Q.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Q.h)("span",{class:(0,ze.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Q.h)(iu.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Q.h)("div",{class:(0,ze.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Q.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Q.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Q.h)("span",{class:(0,ze.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Q.h)(ou.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Q.h)("div",{class:(0,ze.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Vr.TryExtensionContent=cu;var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}
2.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Ra=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xr,"__esModule",{value:!0});xr.ConnectDialog=void 0;const ms=Ra(Gt),qe=de,bs=Fr,lu=yt,uu=Vr,du=Ra(qs),hu=e=>{const{isOpen:t,darkMode:r}=e,[n,s]=(0,bs.useState)(!t),[i,o]=(0,bs.useState)(!t);(0,bs.useEffect)(()=>{const l=[window.setTimeout(()=>{o(!t)},10)];return t?s(!1):l.push(window.setTimeout(()=>{s(!0)},360)),()=>{l.forEach(window.clearTimeout)}},[t]);const a=r?"dark":"light";return(0,qe.h)("div",{class:(0,ms.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,qe.h)("style",null,du.default),(0,qe.h)("div",{class:(0,ms.default)("-cbwsdk-connect-dialog-backdrop",a,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,qe.h)("div",{class:"-cbwsdk-connect-dialog"},(0,qe.h)("div",{class:(0,ms.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,qe.h)(lu.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,qe.h)(uu.TryExtensionContent,{theme:a}))))};xr.ConnectDialog=hu;Object.defineProperty(Or,"__esModule",{value:!0});Or.LinkFlow=void 0;const ws=de,fu=xr;class gu{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,ws.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,ws.render)((0,ws.h)(fu.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}Or.LinkFlow=gu;var Js={},Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;
2cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=A&&A.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(Gt),n=de,s=Fr,i=t(Gs),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwu
2NTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class l{constructor(h){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=h.darkMode}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const f=this.nextItemKey++;return this.items.set(f,h),this.render(),()=>{this.items.delete(f),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,f])=>(0,n.h)(e.SnackbarInstance,Object.assign({},f,{key:h}))))),this.root)}}e.Snackbar=l;const c=d=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},d.children));e.SnackbarContainer=c;const u=({autoExpand:d,message:h,menuItems:f})=>{const[g,E]=(0,s.useState)(!0),[p,S]=(0,s.useState)(d??!1);(0,s.useEffect)(()=>{const m=[window.setTimeout(()=>{E(!1)},1),window.setTimeout(()=>{S(!0)},1e4)];return()=>{m.forEach(window.clearTimeout)}});const b=()=>{S(!p)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",g&&"-cbwsdk-snackbar-instance-hidden",p&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:b},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!p&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),f&&f.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},f.map((m,x)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",m.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:m.onClick,key:x},(0,n.h)("svg",{width:m.svgWidth,height:m.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":m.defaultFillRule,"clip-rule":m.defaultClipRule,d:m.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",m.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},m.info)))))};e.SnackbarInstance=u})(Js);Object.defineProperty(qt,"__esModule",{value:!0});qt.WalletLinkRelayUI=void 0;const pu=Jt,mu=Or,bu=Js;class wu{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new bu.Snackbar({darkMode:t.darkMode}),this.linkFlow=new mu.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,pu.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.9687
25 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}qt.WalletLinkRelayUI=wu;Object.defineProperty(zt,"__esModule",{value:!0});zt.WalletLinkRelay=void 0;const ct=Dt,yu=X,W=v,Je=kt,so=ye,De=Rt,Eu=Tr,Ge=St,_u=qt;class xe extends so.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var a;this.isLinked=o;const l=this.storage.getItem(so.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,l){const c=l.split(" "),u=this.storage.getItem("IsStandaloneSigning")==="true";if(c[0]!==""&&!o&&this.session.linked&&!u){this.isUnlinkedErrorState=!0;const d=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(Je.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:d})}}},this.metadataUpdated=(o,a)=>{this.storage.setItem(o,a)},this.chainUpdated=(o,a)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:o,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(o,a))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),xe.accountRequestCallbackIds.size>0&&(Array.from(xe.accountRequestCallbackIds.values()).forEach(a=>{const l={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},l),{id:a}))}),xe.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:s,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=s}subscribe(){const t=De.Session.load(this.storage)||new De.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,s=new Eu.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:i,darkMode:o}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:i,darkMode:o,session:t});return s.connect(),{session:t,ui:a,connection:s}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(Je.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=De.Session.load(this.storage);if((s==null?void 0:s.id)===this._session.id?this.storage.clear():s&&((r=this.diagnostic)===null||r===void 0||r.log(Je.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:De.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:i,ui:o,connection:a}=this.subscribe();this._session=i,this.connection=a,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Je.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,W.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,W.hexStringFromBuffer)(t,!0),signature:(0,W.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,W.bigIntStringFromBN)(t.weiValue),data:(0,W.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,W.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,W.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,W.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,W.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,W.bigIntStringFromBN)(t.weiValue),data:(0,W.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,W.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,W.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,W.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,W.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,W.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,W.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,W.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,l=>{if(r==null||r(),(0,Ge.isErrorResponse)(l))return a(new Error(l.errorMessage));o(l)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:s}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof _u.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const s={type:"WEB3_REQUEST",id:t,request:r},i=De.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Je.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?De.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(Je.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?De.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(Je.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){xe.accountRequestCallbackIds.forEach(s=>this.invokeCallback(Object.assign(Object.assign({},t),{id:s}))),xe.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,s){var i;const o=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:(0,ct.getMessageFromCode)(s);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:s}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,a
2ppLogoUrl:this.appLogoUrl||null}},r=(0,W.randomBytesHex)(8),n=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,i)};return{promise:new Promise((i,o)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,Ge.isErrorResponse)(a))return o(new Error(a.errorMessage));i(a)}),this.ui.inlineAccountsResponse()){const a=l=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:l}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=ct.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}xe.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,W.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},i=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,u=>{if((0,Ge.isErrorResponse)(u))return a(new Error(u.errorMessage));o(u)});const l=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:yu.ProviderType.Unselected}})},c=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:u}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:c,onCancel:l,providerOptions:t})});return{cancel:s,promise:i}}watchAsset(t,r,n,s,i,o){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:s,image:i},chainId:o}};let l=null;const c=(0,W.randomBytesHex)(8),u=h=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,h),l==null||l()};this.ui.inlineWatchAsset()||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));const d=new Promise((h,f)=>{this.relayEventManager.callbacks.set(c,p=>{if(l==null||l(),(0,Ge.isErrorResponse)(p))return f(new Error(p.errorMessage));h(p)});const g=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:c,response:{method:"watchAsset",result:!1}})},E=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:c,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:E,onCancel:g,type:t,address:r,symbol:n,decimals:s,image:i,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(c,a)});return{cancel:u,promise:d}}addEthereumChain(t,r,n,s,i,o){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:o}};let l=null;const c=(0,W.randomBytesHex)(8),u=h=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,h),l==null||l()};return this.ui.inlineAddEthereumChain(t)||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload})),{promise:new Promise((h,f)=>{this.relayEventManager.callbacks.set(c,p=>{if(l==null||l(),(0,Ge.isErrorResponse)(p))return f(new Error(p.errorMessage));h(p)});const g=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:c,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},E=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:c,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:p}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:g,onApprove:E,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(c,a)}),cancel:u}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},s=(0,W.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,a)};return{promise:new Promise((a,l)=>{this.relayEventManager.callbacks.set(s,d=>{if((0,Ge.isErrorResponse)(d)&&d.errorCode)return l(ct.standardErrors.provider.custom({code:d.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,Ge.isErrorResponse)(d))return l(new Error(d.errorMessage));a(d)});const c=d=>{var h;if(d){const f=(h=(0,ct.getErrorCode)(d))!==null&&h!==void 0?h:ct.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(s,"switchEthereumChain",d instanceof Error?d:ct.standardErrors.provider.unsupportedChain(t),f)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},u=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:d}}})};this.ui.switchEthereumChain({onCancel:c,onApprove:u,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(s,n)}),cancel:i}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return De.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=i=>{this.handleErrorResponse(t,r.method,i)},s=i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:i})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:s,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:s});break;default:n();break}}}zt.WalletLinkRelay=xe;xe.accountRequestCallbackIds=new Set;var Zt={},Jr={},Ia={};(function(e){var t=A&&A.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}
2),r=A&&A.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Js,e)})(Ia);var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Aa=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.RedirectDialog=void 0;const vu=Aa(Gt),Le=de,Su=Jt,Cu=Ia,ku=Aa(Zs);class Ru{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,Su.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Le.render)(null,this.root),t&&(0,Le.render)((0,Le.h)(Iu,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}Jr.RedirectDialog=Ru;const Iu=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:s})=>{const i=r?"dark":"light";return(0,Le.h)(Cu.SnackbarContainer,{darkMode:r},(0,Le.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Le.h)("style",null,ku.default),(0,Le.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,Le.h)("div",{class:(0,vu.default)("-cbwsdk-redirect-dialog-box",i)},(0,Le.h)("p",null,e),(0,Le.h)("button",{onClick:n},t))))};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.MobileRelayUI=void 0;const Au=Jr;class Nu{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new Au.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}Zt.MobileRelayUI=Nu;Object.defineProperty(Wt,"__esModule",{value:!0});Wt.MobileRelay=void 0;const Lu=v,Mu=zt,Tu=Zt;class Pu extends Mu.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,Lu.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof Tu.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,a
2ppLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}Wt.MobileRelay=Pu;const{Transform:$u}=sa;var Ou=e=>class Na extends $u{constructor(r,n,s,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(r){let n=null;try{this.push(this.digest())}catch(s){n=s}r(n)}update(r,n){if(!$.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return $.isBuffer(r)||(r=$.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Na(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:xu}=sa;var Fu=e=>class La extends xu{constructor(r,n,s,i){super(i),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._options=i,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!$.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return $.isBuffer(r)||(r=$.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let s=this._state.squeeze(r);return n!==void 0&&(s=s.toString(n)),s}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new La(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Bu=Ou,ju=Fu;var Du=function(e){const t=Bu(e),r=ju(e);return function(n,s){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,s);case"keccak256":return new t(1088,512,null,256,s);case"keccak384":return new t(832,768,null,384,s);case"keccak512":return new t(576,1024,null,512,s);case"sha3-224":return new t(1152,448,6,224,s);case"sha3-256":return new t(1088,512,6,256,s);case"sha3-384":return new t(832,768,6,384,s);case"sha3-512":return new t(576,1024,6,512,s);case"shake128":return new r(1344,256,31,s);case"shake256":return new r(1088,512,31,s);default:throw new Error("Invald algorithm: "+n)}}},Ma={};const io=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Ma.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],u=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49];let h=u^(s<<1|i>>>31),f=d^(i<<1|s>>>31);const g=e[0]^h,E=e[1]^f,p=e[10]^h,S=e[11]^f,b=e[20]^h,m=e[21]^f,x=e[30]^h,y=e[31]^f,L=e[40]^h,U=e[41]^f;h=r^(o<<1|a>>>31),f=n^(a<<1|o>>>31);const K=e[2]^h,se=e[3]^f,J=e[12]^h,ae=e[13]^f,G=e[22]^h,_=e[23]^f,w=e[32]^h,R=e[33]^f,k=e[42]^h,I=e[43]^f;h=s^(l<<1|c>>>31),f=i^(c<<1|l>>>31);const C=e[4]^h,M=e[5]^f,D=e[14]^h,P=e[15]^f,H=e[24]^h,ie=e[25]^f,V=e[34]^h,Be=e[35]^f,vi=e[44]^h,Si=e[45]^f;h=o^(u<<1|d>>>31),f=a^(d<<1|u>>>31);const Ci=e[6]^h,ki=e[7]^f,Ri=e[16]^h,Ii=e[17]^f,Ai=e[26]^h,Ni=e[27]^f,Li=e[36]^h,Mi=e[37]^f,Ti=e[46]^h,Pi=e[47]^f;h=l^(r<<1|n>>>31),f=c^(n<<1|r>>>31);const $i=e[8]^h,Oi=e[9]^f,xi=e[18]^h,Fi=e[19]^f,Bi=e[28]^h,ji=e[29]^f,Di=e[38]^h,Hi=e[39]^f,Ui=e[48]^h,Vi=e[49]^f,mn=g,bn=E,wn=S<<4|p>>>28,yn=p<<4|S>>>28,En=b<<3|m>>>29,_n=m<<3|b>>>29,vn=y<<9|x>>>23,Sn=x<<9|y>>>23,Cn=L<<18|U>>>14,kn=U<<18|L>>>14,Rn=K<<1|se>>>31,In=se<<1|K>>>31,An=ae<<12|J>>>20,Nn=J<<12|ae>>>20,Ln=G<<10|_>>>22,Mn=_<<10|G>>>22,Tn=R<<13|w>>>19,Pn=w<<13|R>>>19,$n=k<<2|I>>>30,On=I<<2|k>>>30,xn=M<<30|C>>>2,Fn=C<<30|M>>>2,Bn=D<<6|P>>>26,jn=P<<6|D>>>26,Dn=ie<<11|H>>>21,Hn=H<<11|ie>>>21,Un=V<<15|Be>>>17,Vn=Be<<15|V>>>17,Wn=Si<<29|vi>>>3,zn=vi<<29|Si>>>3,qn=Ci<<28|ki>>>4,Jn=ki<<28|Ci>>>4,Gn=Ii<<23|Ri>>>9,Zn=Ri<<23|Ii>>>9,Qn=Ai<<25|Ni>>>7,Kn=Ni<<25|Ai>>>7,Xn=Li<<21|Mi>>>11,Yn=Mi<<21|Li>>>11,es=Pi<<24|Ti>>>8,ts=Ti<<24|Pi>>>8,rs=$i<<27|Oi>>>5,ns=Oi<<27|$i>>>5,ss=xi<<20|Fi>>>12,is=Fi<<20|xi>>>12,os=ji<<7|Bi>>>25,as=Bi<<7|ji>>>25,cs=Di<<8|Hi>
2>>24,ls=Hi<<8|Di>>>24,us=Ui<<14|Vi>>>18,ds=Vi<<14|Ui>>>18;e[0]=mn^~An&Dn,e[1]=bn^~Nn&Hn,e[10]=qn^~ss&En,e[11]=Jn^~is&_n,e[20]=Rn^~Bn&Qn,e[21]=In^~jn&Kn,e[30]=rs^~wn&Ln,e[31]=ns^~yn&Mn,e[40]=xn^~Gn&os,e[41]=Fn^~Zn&as,e[2]=An^~Dn&Xn,e[3]=Nn^~Hn&Yn,e[12]=ss^~En&Tn,e[13]=is^~_n&Pn,e[22]=Bn^~Qn&cs,e[23]=jn^~Kn&ls,e[32]=wn^~Ln&Un,e[33]=yn^~Mn&Vn,e[42]=Gn^~os&vn,e[43]=Zn^~as&Sn,e[4]=Dn^~Xn&us,e[5]=Hn^~Yn&ds,e[14]=En^~Tn&Wn,e[15]=_n^~Pn&zn,e[24]=Qn^~cs&Cn,e[25]=Kn^~ls&kn,e[34]=Ln^~Un&es,e[35]=Mn^~Vn&ts,e[44]=os^~vn&$n,e[45]=as^~Sn&On,e[6]=Xn^~us&mn,e[7]=Yn^~ds&bn,e[16]=Tn^~Wn&qn,e[17]=Pn^~zn&Jn,e[26]=cs^~Cn&Rn,e[27]=ls^~kn&In,e[36]=Un^~es&rs,e[37]=Vn^~ts&ns,e[46]=vn^~$n&xn,e[47]=Sn^~On&Fn,e[8]=us^~mn&An,e[9]=ds^~bn&Nn,e[18]=Wn^~qn&ss,e[19]=zn^~Jn&is,e[28]=Cn^~Rn&Bn,e[29]=kn^~In&jn,e[38]=es^~rs&wn,e[39]=ts^~ns&yn,e[48]=$n^~xn&Gn,e[49]=On^~Fn&Zn,e[0]^=io[t*2],e[1]^=io[t*2+1]}};const _r=Ma;function It(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}It.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};It.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(_r.p1600(this.state),this.count=0)};It.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&_r.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),_r.p1600(this.state),this.count=0,this.squeezing=!0};It.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=$.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(_r.p1600(this.state),this.count=0);return t};It.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Hu=It,Uu=Du(Hu);const Vu=Uu,Wu=Cr;function Ta(e){return $.allocUnsafe(e).fill(0)}function Pa(e,t,r){const n=Ta(t);return e=Gr(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function zu(e,t){return Pa(e,t,!0)}function Gr(e){if(!$.isBuffer(e))if(Array.isArray(e))e=$.from(e);else if(typeof e=="string")$a(e)?e=$.from(Gu(Oa(e)),"hex"):e=$.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=$.allocUnsafe(0);else if(Wu.isBN(e))e=e.toArrayLike($);else if(e.toArray)e=$.from(e.toArray());else throw new Error("invalid type");return e}function qu(e){return e=Gr(e),"0x"+e.toString("hex")}function Ju(e,t){return e=Gr(e),t||(t=256),Vu("keccak"+t).update(e).digest()}function Gu(e){return e.length%2?"0"+e:e}function $a(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function Oa(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var xa={zeros:Ta,setLength:Pa,setLengthRight:zu,isHexString:$a,stripHexPrefix:Oa,toBuffer:Gr,bufferToHex:qu,keccak:Ju};const et=xa,Ke=Cr;function Fa(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function gt(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function oo(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Ba(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function Ze(e){var t=typeof e;if(t==="string")return et.isHexString(e)?new Ke(et.stripHexPrefix(e),16):new Ke(e,10);if(t==="number")return new Ke(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Ne(e,t){var r,n,s,i;if(e==="address")return Ne("uint160",Ze(t));if(e==="bool")return Ne("uint8",t?1:0);if(e==="string")return Ne("bytes",new $(t,"utf8"));if(Qu(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Ba(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);s=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(i in t)s.push(Ne(e,t[i]));if(r==="dynamic"){var o=Ne("uint256",t.length);s.unshift(o)}return $.concat(s)}else{if(e==="bytes")return t=new $(t),s=$.concat([Ne("uint256",t.length),t]),t.length%32!==0&&(s=$.concat([s,et.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if(r=gt(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return et.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=gt(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Ze(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike($,"be",32)}else if(e.startsWith("int")){if(r=gt(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Ze(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike($,"be",32)}else if(e.startsWith("ufixed")){if(r=oo(e),n=Ze(t),n<0)throw new Error("Supplied ufixed is negative");return Ne("uint256",n.mul(new Ke(2).pow(new Ke(r[1]))))}else if(e.startsWith("fixed"))return r=oo(e),Ne("int256",Ze(t).mul(new Ke(2).pow(new Ke(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Zu(e){return e==="string"||e==="bytes"||Ba(e)==="dynamic"}function Qu(e){return e.lastIndexOf("]")===e.length-1}function Ku(e,t){var r=[],n=[],s=32*e.length;
2for(var i in e){var o=Fa(e[i]),a=t[i],l=Ne(o,a);Zu(o)?(r.push(Ne("uint256",s)),n.push(l),s+=l.length):r.push(l)}return $.concat(r.concat(n))}function ja(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,s=[],i=0;i<e.length;i++){var o=Fa(e[i]),a=t[i];if(o==="bytes")s.push(a);else if(o==="string")s.push(new $(a,"utf8"));else if(o==="bool")s.push(new $(a?"01":"00","hex"));else if(o==="address")s.push(et.setLength(a,20));else if(o.startsWith("bytes")){if(r=gt(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);s.push(et.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=gt(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Ze(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());s.push(n.toArrayLike($,"be",r/8))}else if(o.startsWith("int")){if(r=gt(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Ze(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());s.push(n.toTwos(r).toArrayLike($,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return $.concat(s)}function Xu(e,t){return et.keccak(ja(e,t))}var Yu={rawEncode:Ku,solidityPack:ja,soliditySHA3:Xu};const Se=xa,Ot=Yu,Da={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},ys={encodeData(e,t,r,n=!0){const s=["bytes32"],i=[this.hashType(e,r)];if(n){const o=(a,l,c)=>{if(r[l]!==void 0)return["bytes32",c==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Se.keccak(this.encodeData(l,c,r,n))];if(c===void 0)throw new Error(`missing value for field ${a} of type ${l}`);if(l==="bytes")return["bytes32",Se.keccak(c)];if(l==="string")return typeof c=="string"&&(c=$.from(c,"utf8")),["bytes32",Se.keccak(c)];if(l.lastIndexOf("]")===l.length-1){const u=l.slice(0,l.lastIndexOf("[")),d=c.map(h=>o(a,u,h));return["bytes32",Se.keccak(Ot.rawEncode(d.map(([h])=>h),d.map(([,h])=>h)))]}return[l,c]};
2for(const a of r[e]){const[l,c]=o(a.name,a.type,t[a.name]);s.push(l),i.push(c)}}else for(const o of r[e]){let a=t[o.name];if(a!==void 0)if(o.type==="bytes")s.push("bytes32"),a=Se.keccak(a),i.push(a);else if(o.type==="string")s.push("bytes32"),typeof a=="string"&&(a=$.from(a,"utf8")),a=Se.keccak(a),i.push(a);else if(r[o.type]!==void 0)s.push("bytes32"),a=Se.keccak(this.encodeData(o.type,a,r,n)),i.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(o.type),i.push(a)}}return Ot.rawEncode(s,i)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(s=>s!==e);n=[e].concat(n.sort());for(const s of n){if(!t[s])throw new Error("No type definition specified: "+s);r+=s+"("+t[s].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const s of this.findTypeDependencies(n.type,t,r))!r.includes(s)&&r.push(s);return r},hashStruct(e,t,r,n=!0){return Se.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Se.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Da.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[$.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Se.keccak($.concat(n))}};var ed={TYPED_MESSAGE_SCHEMA:Da,TypedDataUtils:ys,hashForSignTypedDataLegacy:function(e){return td(e.data)},hashForSignTypedData_v3:function(e){return ys.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return ys.hash(e.data)}};function td(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(i){return i.type==="bytes"?Se.toBuffer(i.value):i.value}),n=e.map(function(i){return i.type}),s=e.map(function(i){if(!i.name)throw t;return i.type+" "+i.name});return Ot.soliditySHA3(["bytes32","bytes32"],[Ot.soliditySHA3(new Array(e.length).fill("string"),s),Ot.soliditySHA3(n,r)])}var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.filterFromParam=Et.FilterPolyfill=void 0;const dt=X,ce=v,rd=5*60*1e3,Qe={jsonrpc:"2.0",id:0};class nd{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,dt.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=Ha(t),n=this.makeFilterId(),s=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",s),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,ce.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,ce.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,ce.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,ce.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,ce.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(dr())}async getFilterLogs(t){const r=(0,ce.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Qe),{method:"eth_getLogs",params:[ao(n)]})):dr()}makeFilterId(){return(0,dt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(s,i)=>{if(s)return n(s);if(Array.isArray(i)||i==null)return n(new Error(`unexpected response received: ${JSON.stringify(i)}`));r(i)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return dr();const s=await this.getCurrentBlockHeight(),i=r.toBlock==="latest"?s:r.toBlock;if(n>s||n>Number(r.toBlock))return hr();console.info(`Fetching logs from ${n} to ${i} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Qe),{method:"eth_getLogs",params:[ao(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(o.result)){const a=o.result.map(c=>(0,ce.intNumberFromHexString)(c.blockNumber||"0x0")),l=Math.max(...a);if(l&&l>n){const c=(0,dt.IntNumber)(l+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${c}`),this.cursors.set(t,c)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return dr();const n=await this.getCurrentBlockHeight();if(r>n)return hr();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const s=(await Promise.all((0,ce.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,dt.IntNumber)(o))))).filter(o=>!!o),i=(0,dt.IntNumber)(r+s.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},Qe),{result:s})}async getPendingTransactionFilterChanges(t){return Promise.resolve(hr())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),s=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,s),s}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},rd);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();
2this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},Qe),{method:"eth_blockNumber",params:[]}));return(0,ce.intNumberFromHexString)((0,ce.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},Qe),{method:"eth_getBlockByNumber",params:[(0,ce.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,ce.ensureHexString)(r.result.hash):null}}Et.FilterPolyfill=nd;function Ha(e){return{fromBlock:co(e.fromBlock),toBlock:co(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Et.filterFromParam=Ha;function ao(e){const t={fromBlock:lo(e.fromBlock),toBlock:lo(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function co(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,dt.IntNumber)(0);if((0,ce.isHexString)(e))return(0,ce.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function lo(e){return e==="latest"?e:(0,ce.hexStringFromIntNumber)(e)}function dr(){return Object.assign(Object.assign({},Qe),{error:{code:-32e3,message:"filter not found"}})}function hr(){return Object.assign(Object.assign({},Qe),{result:[]})}var Zr={},Ua={},Qr={},Qs=sd;function sd(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const uo=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let s=0;s<arguments.length;s++)n[s]=arguments[s];return new r((s,i)=>{t.errorFirst?n.push(function(o,a){if(t.multiArgs){const l=new Array(arguments.length-1);for(let c=1;c<arguments.length;c++)l[c-1]=arguments[c];o?(l.unshift(o),i(l)):s(l)}else o?i(o):s(a)}):n.push(function(o){if(t.multiArgs){const a=new Array(arguments.length-1);for(let l=0;l<arguments.length;l++)a[l]=arguments[l];s(a)}else s(o)}),e.apply(this,n)})};var id=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=s=>{const i=o=>typeof o=="string"?s===o:o.test(s);return t.include?t.include.some(i):!t.exclude.some(i)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):uo(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const s in e){const i=e[s];n[s]=typeof i=="function"&&r(s)?uo(i,t):i}return n},Qt={},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});const od=ia;function ho(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function ad(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let cd=class extends od.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")ho(i,this,r);else{const o=i.length,a=ad(i);for(let l=0;l<o;l+=1)ho(a[l],this,r)}return!0}};Kt.default=cd;var ld=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.BaseBlockTracker=void 0;const ud=ld(Kt),dd=1e3,hd=(e,t)=>e+t,fo=["sync","latest"];class fd extends ud.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*dd,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){fo.includes(t)&&this._maybeStart()}
2_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return fo.map(t=>this.listenerCount(t)).reduce(hd)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=go(t),s=go(r);return this._usePastBlocks&&n<s||n>s}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Qt.BaseBlockTracker=fd;function go(e){return Number.parseInt(e,16)}var Va={},Wa={},ne={};class za extends TypeError{constructor(t,r){let n;const{message:s,explanation:i,...o}=t,{path:a}=t,l=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;super(i??l),i!=null&&(this.cause=l),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function gd(e){return _e(e)&&typeof e[Symbol.iterator]=="function"}function _e(e){return typeof e=="object"&&e!=null}function po(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Y(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function pd(e){const{done:t,value:r}=e.next();return t?void 0:r}function md(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:i}=t,{type:o}=r,{refinement:a,message:l=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${Y(n)}\``}=e;return{value:n,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...e,message:l}}function*Ps(e,t,r,n){gd(e)||(e=[e]);for(const s of e){const i=md(s,t,r,n);i&&(yield i)}}function*Ks(e,t,r={}){const{path:n=[],branch:s=[e],coerce:i=!1,mask:o=!1}=r,a={path:n,branch:s};if(i&&(e=t.coercer(e,a),o&&t.type!=="type"&&_e(t.schema)&&_e(e)&&!Array.isArray(e)))for(const c in e)t.schema[c]===void 0&&delete e[c];let l="valid";for(const c of t.validator(e,a))c.explanation=r.message,l="not_valid",yield[c,void 0];for(let[c,u,d]of t.entries(e,a)){const h=Ks(u,d,{path:c===void 0?n:[...n,c],branch:c===void 0?s:[...s,u],coerce:i,mask:o,message:r.message});for(const f of h)f[0]?(l=f[0].refinement!=null?"not_refined":"not_valid",yield[f[0],void 0]):i&&(u=f[1],c===void 0?e=u:e instanceof Map?e.set(c,u):e instanceof Set?e.add(u):_e(e)&&(u!==void 0||c in e)&&(e[c]=u))}if(l!=="not_valid")for(const c of t.refiner(e,a))c.explanation=r.message,l="not_refined",yield[c,void 0];l==="valid"&&(yield[void 0,e])}class Z{constructor(t){const{type:r,schema:n,validator:s,refiner:i,coercer:o=l=>l,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,s?this.validator=(l,c)=>{const u=s(l,c);return Ps(u,c,this,l)}:this.validator=()=>[],i?this.refiner=(l,c)=>{const u=i(l,c);return Ps(u,c,this,l)}:this.refiner=()=>[]}assert(t,r){return qa(t,this,r)}create(t,r){return Ja(t,this,r)}is(t){return Xs(t,this)}mask(t,r){return Ga(t,this,r)}validate(t,r={}){return At(t,this,r)}}function qa(e,t,r){const n=At(e,t,{message:r});if(n[0])throw n[0]}function Ja(e,t,r){const n=At(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Ga(e,t,r){const n=At(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Xs(e,t){return!At(e,t)[0]}function At(e,t,r={}){const n=Ks(e,t,r),s=pd(n);return s[0]?[new za(s[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function bd(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),n=Object.assign({},...r);return t?Yt(n):Xt(n)}function he(e,t){return new Z({type:e,schema:null,validator:t})}function wd(e,t){return new Z({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function yd(e){return new Z({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function Ed(e){let t;return new Z({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function _d(e,t){const{schema:r}=e,n={...r};for(const s of t)delete n[s];switch(e.type){case"type":return Yt(n);default:return Xt(n)}}function vd(e){const t=e instanceof Z,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Za(r[n]);return t&&e.type==="type"?Yt(r):Xt(r)}function Sd(e,t){const{schema:r}=e,n={};for(const s of t)n[s]=r[s];switch(e.type){case"type":return Yt(n);default:return Xt(n)}}function Cd(e,t){return console.warn("[email protected] - The `struct` helper has been renamed to `define`."),he(e,t)}function kd(){return he("any",()=>!0)}function Rd(e){return new Z({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Y(t)}`}})}function Id(){return he("bigint",e=>typeof e=="bigint")}function Ad(){return he("boolean",e=>typeof e=="boolean")}function Nd(){return he("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Y(e)}`)}function Ld(e){const t={},r=e.map(n=>Y(n)).join();for(const n of e)t[n]=n;return new Z({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Y(n)}`}})}function Md(){return he("func",e=>typeof e=="function"||`Expected a function, but received: ${Y(e)}`)}function Td(e){return he("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Y(t)}`)}function Pd(){return he("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Y(e)}`)}function $d(e){return new Z({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)}
2,*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function Od(e){const t=Y(e),r=typeof e;return new Z({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Y(n)}`}})}function xd(e,t){return new Z({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Y(r)}`}})}function Ys(){return he("never",()=>!1)}function Fd(e){return new Z({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function Bd(){return he("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Y(e)}`)}function Xt(e){const t=e?Object.keys(e):[],r=Ys();return new Z({type:"object",schema:e||null,*entries(n){if(e&&_e(n)){const s=new Set(Object.keys(n));for(const i of t)s.delete(i),yield[i,n[i],e[i]];for(const i of s)yield[i,n[i],r]}},validator(n){return _e(n)||`Expected an object, but received: ${Y(n)}`},coercer(n){return _e(n)?{...n}:n}})}function Za(e){return new Z({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function jd(e,t){return new Z({type:"record",schema:null,*entries(r){if(_e(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator(r){return _e(r)||`Expected an object, but received: ${Y(r)}`}})}function Dd(){return he("regexp",e=>e instanceof RegExp)}function Hd(e){return new Z({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Y(t)}`}})}function Qa(){return he("string",e=>typeof e=="string"||`Expected a string, but received: ${Y(e)}`)}function Ud(e){const t=Ys();return new Z({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;s<n;s++)yield[s,r[s],e[s]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${Y(r)}`}})}function Yt(e){const t=Object.keys(e);return new Z({type:"type",schema:e,*entries(r){if(_e(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return _e(r)||`Expected an object, but received: ${Y(r)}`},coercer(r){return _e(r)?{...r}:r}})}function Vd(e){const t=e.map(r=>r.type).join(" | ");return new Z({type:"union",schema:null,coercer(r){for(const n of e){const[s,i]=n.validate(r,{coerce:!0});if(!s)return i}return r},validator(r,n){const s=[];for(const i of e){const[...o]=Ks(r,i,n),[a]=o;if(a[0])for(const[l]of o)l&&s.push(l);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Y(r)}`,...s]}})}function Ka(){return he("unknown",()=>!0)}function ei(e,t,r){return new Z({...e,coercer:(n,s)=>Xs(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function Wd(e,t,r={}){return ei(e,Ka(),n=>{const s=typeof t=="function"?t():t;if(n===void 0)return s;if(!r.strict&&po(n)&&po(s)){const i={...n};let o=!1;for(const a in s)i[a]===void 0&&(i[a]=s[a],o=!0);if(o)return i}return n})}function zd(e){return ei(e,Qa(),t=>t.trim())}function qd(e){return nt(e,"empty",t=>{const r=Xa(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Xa(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Jd(e,t,r={}){const{exclusive:n}=r;return nt(e,"max",s=>n?s<t:s<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${s}\``)}function Gd(e,t,r={}){const{exclusive:n}=r;return nt(e,"min",s=>n?s>t:s>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${s}\``)}function Zd(e){return nt(e,"nonempty",t=>Xa(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Qd(e,t){return nt(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function Kd(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return nt(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return t<=i&&i<=r||`${n} ${s} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:o}=i;return t<=o&&o<=r||`${n} with a size ${s} but received one with a size of \`${o}\``}else{const{length:o}=i;return t<=o&&o<=r||`${n} with a length ${s} but received one with a length of \`${o}\``}})}function nt(e,t,r){return new Z({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),o=Ps(i,s,e,n);for(const a of o)yield{...a,refinement:t}}})}const Xd=Object.freeze(Object.defineProperty({__proto__:null,Struct:Z,StructError:za,any:kd,array:Rd,assert:qa,assign:bd,bigint:Id,boolean:Ad,coerce:ei,create:Ja,date:Nd,defaulted:Wd,define:he,deprecated:wd,dynamic:yd,empty:qd,enums:Ld,func:Md,instance:Td,integer:Pd,intersection:$d,is:Xs,lazy:Ed,literal:Od,map:xd,mask:Ga,max:Jd,min:Gd,never:Ys,nonempty:Zd,nullable:Fd,number:Bd,object:Xt,omit:_d,optional:Za,partial:vd,pattern:Qd,pick:Sd,record:jd,refine:nt,regexp:Dd,set:Hd,size:Kd,string:Qa,struct:Cd,trimmed:zd,tuple:Ud,type:Yt,union:Vd,unknown:Ka,validate:At},Symbol.toStringTag,{value:"Module"})),st=jt(Xd);
2Object.defineProperty(ne,"__esModule",{value:!0});ne.assertExhaustive=ne.assertStruct=ne.assert=ne.AssertionError=void 0;const Yd=st;function eh(e){return typeof e=="object"&&e!==null&&"message"in e}function th(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function rh(e){const t=eh(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Ya(e,t){return th(e)?new e({message:t}):e({message:t})}class ti extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}ne.AssertionError=ti;function nh(e,t="Assertion failed.",r=ti){if(!e)throw t instanceof Error?t:Ya(r,t)}ne.assert=nh;function sh(e,t,r="Assertion failed",n=ti){try{(0,Yd.assert)(e,t)}catch(s){throw Ya(n,`${r}: ${rh(s)}.`)}}ne.assertStruct=sh;function ih(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}ne.assertExhaustive=ih;var er={};Object.defineProperty(er,"__esModule",{value:!0});er.base64=void 0;const oh=st,ah=ne,ch=(e,t={})=>{var r,n;const s=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,i=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;i==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,ah.assert)(i==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return s?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,oh.pattern)(e,a)};er.base64=ch;var j={},tr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=st,r=ne;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(c){return(0,t.is)(c,e.HexStruct)}e.isHexString=n;function s(c){return(0,t.is)(c,e.StrictHexStruct)}e.isStrictHexString=s;function i(c){(0,r.assert)(n(c),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function o(c){(0,r.assert)(s(c),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function a(c){return c.startsWith("0x")?c:c.startsWith("0X")?`0x${c.substring(2)}`:`0x${c}`}e.add0x=a;function l(c){return c.startsWith("0x")||c.startsWith("0X")?c.substring(2):c}e.remove0x=l})(tr);Object.defineProperty(j,"__esModule",{value:!0});j.createDataView=j.concatBytes=j.valueToBytes=j.stringToBytes=j.numberToBytes=j.signedBigIntToBytes=j.bigIntToBytes=j.hexToBytes=j.bytesToString=j.bytesToNumber=j.bytesToSignedBigInt=j.bytesToBigInt=j.bytesToHex=j.assertIsBytes=j.isBytes=void 0;const pe=ne,$s=tr,mo=48,bo=58,wo=87;function lh(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const uh=lh();function ri(e){return e instanceof Uint8Array}j.isBytes=ri;function Nt(e){(0,pe.assert)(ri(e),"Value must be a Uint8Array.")}j.assertIsBytes=Nt;function ec(e){if(Nt(e),e.length===0)return"0x";const t=uh(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,$s.add0x)(r.join(""))}j.bytesToHex=ec;function tc(e){Nt(e);const t=ec(e);return BigInt(t)}j.bytesToBigInt=tc;function dh(e){Nt(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}j.bytesToSignedBigInt=dh;function hh(e){Nt(e);const t=tc(e);return(0,pe.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}j.bytesToNumber=hh;function fh(e){return Nt(e),new TextDecoder().decode(e)}j.bytesToString=fh;function Kr(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,$s.assertIsHexString)(e);const r=(0,$s.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,s=new Uint8Array(n.length/2);for(let i=0;i<s.length;i++){const o=n.charCodeAt(i*2),a=n.charCodeAt(i*2+1),l=o-(o<bo?mo:wo),c=a-(a<bo?mo:wo);s[i]=l*16+c}return s}j.hexToBytes=Kr;function rc(e){(0,pe.assert)(typeof e=="bigint","Value must be a bigint."),(0,pe.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Kr(t)}j.bigIntToBytes=rc;function gh(e,t){(0,pe.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function ph(e,t){(0,pe.assert)(typeof e=="bigint","Value must be a bigint."),(0,pe.assert)(typeof t=="number","Byte length must be a number."),(0,pe.assert)(t>0,"Byte length must be greater than 0."),(0,pe.assert)(gh(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let s=0;s<n.length;s++)n[s]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}j.signedBigIntToBytes=ph;function nc(e){(0,pe.assert)(typeof e=="number","Value must be a number."),(0,pe.assert)(e>=0,"Value must be a non-negative number."),(0,pe.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Kr(t)}j.numberToBytes=nc;function sc(e){return(0,pe.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}j.stringToBytes=sc;function ic(e){if(typeof e=="bigint")return rc(e);if(typeof e=="number")return nc(e);if(typeof e=="string")return e.startsWith("0x")?Kr(e):sc(e);if(ri(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}j.valueToBytes=ic;function mh(e){const t=new Array(e.length);let r=0;for(let s=0;s<e.length;s++){const i=ic(e[s]);t[s]=i,r+=i.length}const n=new Uint8Array(r);for(let s=0,i=0;s<t.length;s++)n.set(t[s],i),i+=t[s].length;return n}j.concatBytes=mh;function bh(e){if(typeof $<"u"&&e instanceof $){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}j.createDataView=bh;var Xr={};
2Object.defineProperty(Xr,"__esModule",{value:!0});Xr.ChecksumStruct=void 0;const yo=st,wh=er;Xr.ChecksumStruct=(0,yo.size)((0,wh.base64)((0,yo.string)(),{paddingRequired:!0}),44,44);var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.createHex=Pe.createBytes=Pe.createBigInt=Pe.createNumber=void 0;const q=st,yh=ne,oc=j,Yr=tr,ac=(0,q.union)([(0,q.number)(),(0,q.bigint)(),(0,q.string)(),Yr.StrictHexStruct]),Eh=(0,q.coerce)((0,q.number)(),ac,Number),_h=(0,q.coerce)((0,q.bigint)(),ac,BigInt);(0,q.union)([Yr.StrictHexStruct,(0,q.instance)(Uint8Array)]);const vh=(0,q.coerce)((0,q.instance)(Uint8Array),(0,q.union)([Yr.StrictHexStruct]),oc.hexToBytes),Sh=(0,q.coerce)(Yr.StrictHexStruct,(0,q.instance)(Uint8Array),oc.bytesToHex);function Ch(e){try{const t=(0,q.create)(e,Eh);return(0,yh.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof q.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Pe.createNumber=Ch;function kh(e){try{return(0,q.create)(e,_h)}catch(t){throw t instanceof q.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Pe.createBigInt=kh;function Rh(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,q.create)(e,vh)}catch(t){throw t instanceof q.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Pe.createBytes=Rh;function Ih(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,q.create)(e,Sh)}catch(t){throw t instanceof q.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Pe.createHex=Ih;var _t={},cc=A&&A.__classPrivateFieldSet||function(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},le=A&&A.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ve,Ie;Object.defineProperty(_t,"__esModule",{value:!0});_t.FrozenSet=_t.FrozenMap=void 0;class ni{constructor(t){ve.set(this,void 0),cc(this,ve,new Map(t),"f"),Object.freeze(this)}get size(){return le(this,ve,"f").size}[(ve=new WeakMap,Symbol.iterator)](){return le(this,ve,"f")[Symbol.iterator]()}entries(){return le(this,ve,"f").entries()}forEach(t,r){return le(this,ve,"f").forEach((n,s,i)=>t.call(r,n,s,this))}get(t){return le(this,ve,"f").get(t)}has(t){return le(this,ve,"f").has(t)}keys(){return le(this,ve,"f").keys()}values(){return le(this,ve,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}_t.FrozenMap=ni;class si{constructor(t){Ie.set(this,void 0),cc(this,Ie,new Set(t),"f"),Object.freeze(this)}get size(){return le(this,Ie,"f").size}[(Ie=new WeakMap,Symbol.iterator)](){return le(this,Ie,"f")[Symbol.iterator]()}entries(){return le(this,Ie,"f").entries()}forEach(t,r){return le(this,Ie,"f").forEach((n,s,i)=>t.call(r,n,s,this))}has(t){return le(this,Ie,"f").has(t)}keys(){return le(this,Ie,"f").keys()}values(){return le(this,Ie,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}_t.FrozenSet=si;Object.freeze(ni);Object.freeze(ni.prototype);Object.freeze(si);Object.freeze(si.prototype);var lc={};Object.defineProperty(lc,"__esModule",{value:!0});var uc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJ
2sonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=st,r=ne,n=()=>(0,t.define)("finite number",y=>(0,t.is)(y,(0,t.number)())&&Number.isFinite(y));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(y,L)=>{function U(K,se){const ae=[...se.validator(K,L)];return ae.length>0?ae:!0}try{const K=U(y,e.UnsafeJsonStruct);return K!==!0?K:U(JSON.parse(JSON.stringify(y)),e.UnsafeJsonStruct)}catch(K){return K instanceof RangeError?"Circular reference detected":!1}});function s(y){return(0,t.is)(y,e.JsonStruct)}e.isValidJson=s;function i(y){(0,r.assertStruct)(y,e.JsonStruct,"Invalid JSON value");const L=JSON.stringify(y);return new TextEncoder().encode(L).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(y){return(0,t.is)(y,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function a(y,L){(0,r.assertStruct)(y,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",L)}e.assertIsJsonRpcNotification=a;function l(y){return(0,t.is)(y,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=l;function c(y,L){(0,r.assertStruct)(y,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",L)}e.assertIsJsonRpcRequest=c,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function u(y){return(0,t.is)(y,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=u;function d(y,L){(0,r.assertStruct)(y,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",L)}e.assertIsPendingJsonRpcResponse=d;function h(y){return(0,t.is)(y,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=h;function f(y,L){(0,r.assertStruct)(y,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",L)}e.assertIsJsonRpcResponse=f;function g(y){return(0,t.is)(y,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=g;function E(y,L){(0,r.assertStruct)(y,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",L)}e.assertIsJsonRpcSuccess=E;function p(y){return(0,t.is)(y,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=p;function S(y,L){(0,r.assertStruct)(y,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",L)}e.assertIsJsonRpcFailure=S;function b(y){return(0,t.is)(y,e.JsonRpcErrorStruct)}e.isJsonRpcError=b;function m(y,L){(0,r.assertStruct)(y,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",L)}e.assertIsJsonRpcError=m;function x(y){const{permitEmptyString:L,permitFractions:U,permitNull:K}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},y);return J=>!!(typeof J=="number"&&(U||Number.isInteger(J))||typeof J=="string"&&(L||J.length>0)||K&&J===null)}e.getJsonRpcIdValidator=x})(uc);var dc={};Object.defineProperty(dc,"__esModule",{value:!0});var vt={},Os={exports:{}},Es,Eo;function Ah(){if(Eo)return Es;Eo=1;var e=1e3,t=e*60,r=t*60,n=r*24,s=n*7,i=n*365.25;Es=function(u,d){d=d||{};var h=typeof u;
vendor: 4,309 bytes, line 2
2if(h==="string"&&u.length>0)return o(u);if(h==="number"&&isFinite(u))return d.long?l(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var h=parseFloat(d[1]),f=(d[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"weeks":case"week":case"w":return h*s;case"days":case"day":case"d":return h*n;case"hours":case"hour":case"hrs":case"hr":case"h":return h*r;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){var d=Math.abs(u);return d>=n?Math.round(u/n)+"d":d>=r?Math.round(u/r)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=n?c(u,d,n,"day"):d>=r?c(u,d,r,"hour"):d>=t?c(u,d,t,"minute"):d>=e?c(u,d,e,"second"):u+" ms"}function c(u,d,h,f){var g=d>=h*1.5;return Math.round(u/h)+" "+f+(g?"s":"")}return Es}function Nh(e){r.debug=r,r.default=r,r.coerce=l,r.disable=i,r.enable=s,r.enabled=o,r.humanize=Ah(),r.destroy=c,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let d=0;for(let h=0;h<u.length;h++)d=(d<<5)-d+u.charCodeAt(h),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=t;function r(u){let d,h=null,f,g;function E(...p){if(!E.enabled)return;const S=E,b=Number(new Date),m=b-(d||b);S.diff=m,S.prev=d,S.curr=b,d=b,p[0]=r.coerce(p[0]),typeof p[0]!="string"&&p.unshift("%O");let x=0;p[0]=p[0].replace(/%([a-zA-Z%])/g,(L,U)=>{if(L==="%%")return"%";x++;const K=r.formatters[U];if(typeof K=="function"){const se=p[x];L=K.call(S,se),p.splice(x,1),x--}return L}),r.formatArgs.call(S,p),(S.log||r.log).apply(S,p)}return E.namespace=u,E.useColors=r.useColors(),E.color=r.selectColor(u),E.extend=n,E.destroy=r.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(f!==r.namespaces&&(f=r.namespaces,g=r.enabled(u)),g),set:p=>{h=p}}),typeof r.init=="function"&&r.init(E),E}function n(u,d){const h=r(this.namespace+(typeof d>"u"?":":d)+u);return h.log=this.log,h}function s(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let d;const h=(typeof u=="string"?u:"").split(/[\s,]+/),f=h.length;for(d=0;d<f;d++)h[d]&&(u=h[d].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.slice(1)+"$")):r.names.push(new RegExp("^"+u+"$")))}function i(){const u=[...r.names.map(a),...r.skips.map(a).map(d=>"-"+d)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let d,h;for(d=0,h=r.skips.length;d<h;d++)if(r.skips[d].test(u))return!1;for(d=0,h=r.names.length;d<h;d++)if(r.names[d].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Lh=Nh;(function(e,t){var r={};t.formatArgs=s,t.save=i,t.load=o,t.useColors=n,t.storage=a(),t.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#F
2F6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function s(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;c.splice(1,0,u,"color: inherit");let d=0,h=0;c[0].replace(/%[a-zA-Z%]/g,f=>{f!=="%%"&&(d++,f==="%c"&&(h=d))}),c.splice(h,0,u)}t.log=console.debug||console.log||(()=>{});function i(c){try{c?t.storage.setItem("debug",c):t.storage.removeItem("debug")}catch{}}function o(){let c;try{c=t.storage.getItem("debug")}catch{}return!c&&typeof Ts<"u"&&"env"in Ts&&(c=r.DEBUG),c}function a(){try{return localStorage}catch{}}e.exports=Lh(t);const{formatters:l}=e.exports;l.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(Os,Os.exports);var Mh=Os.exports,Th=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vt,"__esModule",{value:!0});vt.createModuleLogger=vt.createProjectLogger=void 0;const Ph=Th(Mh),$h=(0,Ph.default)("metamask");function Oh(e){return $h.extend(e)}vt.createProjectLogger=Oh;function xh(e,t){return e.extend(t)}vt.createModuleLogger=xh;var hc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(c){return Array.isArray(c)&&c.length>0}e.isNonEmptyArray=t;function r(c){return c==null}e.isNullOrUndefined=r;function n(c){return!!c&&typeof c=="object"&&!Array.isArray(c)}e.isObject=n;const s=(c,u)=>Object.hasOwnProperty.call(c,u);e.hasProperty=s,function(c){c[c.Null=4]="Null",c[c.Comma=1]="Comma",c[c.Wrapper=1]="Wrapper",c[c.True=4]="True",c[c.False=5]="False",c[c.Quote=1]="Quote",c[c.Colon=1]="Colon",c[c.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(c){if(typeof c!="object"||c===null)return!1;try{let u=c;for(;Object.getPrototypeOf(u)!==null;)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(c)===u}catch{return!1}}e.isPlainObject=i;function o(c){return c.charCodeAt(0)<=127}e.isASCII=o;function a(c){var u;return c.split("").reduce((h,f)=>o(f)?h+1:h+2,0)+((u=c.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&u!==void 0?u:[]).length}e.calculateStringSize=a;function l(c){return c.toString().length}e.calculateNumberSize=l})(hc);var $e={};Object.defineProperty($e,"__esModule",{value:!0});$e.hexToBigInt=$e.hexToNumber=$e.bigIntToHex=$e.numberToHex=void 0;const pt=ne,Ft=tr,Fh=e=>((0,pt.assert)(typeof e=="number","Value must be a number."),(0,pt.assert)(e>=0,"Value must be a non-negative number."),(0,pt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Ft.add0x)(e.toString(16)));$e.numberToHex=Fh;const Bh=e=>((0,pt.assert)(typeof e=="bigint","Value must be a bigint."),(0,pt.assert)(e>=0,"Value must be a non-negative bigint."),(0,Ft.add0x)(e.toString(16)));$e.bigIntToHex=Bh;const jh=e=>{(0,Ft.assertIsHexString)(e);const t=parseInt(e,16);return(0,pt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};$e.hexToNumber=jh;const Dh=e=>((0,Ft.assertIsHexString)(e),BigInt((0,Ft.add0x)(e)));$e.hexToBigInt=Dh;var fc={};Object.defineProperty(fc,"__esModule",{value:!0});var gc={};
2(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=i=>Number.isInteger(i)&&i>=0,r=(i,o)=>{if(!t(i))throw new Error(`"${o}" must be a non-negative integer. Received: "${i}".`)};function n(i,o){return r(i,"count"),i*o}e.inMilliseconds=n;function s(i){return r(i,"timestamp"),Date.now()-i}e.timeSince=s})(gc);var pc={};Object.defineProperty(pc,"__esModule",{value:!0});var mc={},xs={exports:{}};const Hh="2.0.0",bc=256,Uh=Number.MAX_SAFE_INTEGER||9007199254740991,Vh=16,Wh=bc-6,zh=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var en={MAX_LENGTH:bc,MAX_SAFE_COMPONENT_LENGTH:Vh,MAX_SAFE_BUILD_LENGTH:Wh,MAX_SAFE_INTEGER:Uh,RELEASE_TYPES:zh,SEMVER_SPEC_VERSION:Hh,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},_s={};const qh=typeof Ts=="object"&&_s&&_s.NODE_DEBUG&&/\bsemver\b/i.test(_s.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var tn=qh;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=en,i=tn;t=e.exports={};const o=t.re=[],a=t.safeRe=[],l=t.src=[],c=t.t={};let u=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[d,n]],f=E=>{for(const[p,S]of h)E=E.split(`${p}*`).join(`${p}{0,${S}}`).split(`${p}+`).join(`${p}{1,${S}}`);return E},g=(E,p,S)=>{const b=f(p),m=u++;i(E,m,p),c[E]=m,l[m]=p,o[m]=new RegExp(p,S?"g":void 0),a[m]=new RegExp(b,S?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),g("FULL",`^${l[c.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),g("LOOSE",`^${l[c.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),g("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),g("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[c.COERCE],!0),g("COERCERTLFULL",l[c.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]}
2)\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(xs,xs.exports);var rr=xs.exports;const Jh=Object.freeze({loose:!0}),Gh=Object.freeze({}),Zh=e=>e?typeof e!="object"?Jh:e:Gh;var ii=Zh;const _o=/^[0-9]+$/,wc=(e,t)=>{const r=_o.test(e),n=_o.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Qh=(e,t)=>wc(t,e);var yc={compareIdentifiers:wc,rcompareIdentifiers:Qh};const fr=tn,{MAX_LENGTH:vo,MAX_SAFE_INTEGER:gr}=en,{safeRe:So,t:Co}=rr,Kh=ii,{compareIdentifiers:lt}=yc;let Xh=class Ae{constructor(t,r){if(r=Kh(r),t instanceof Ae){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>vo)throw new TypeError(`version is longer than ${vo} characters`);fr("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?So[Co.LOOSE]:So[Co.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>gr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>gr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>gr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i<gr)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(fr("SemVer.compare",this.version,this.options,t),!(t instanceof Ae)){if(typeof t=="string"&&t===this.version)return 0;t=new Ae(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Ae||(t=new Ae(t,this.options)),lt(this.major,t.major)||lt(this.minor,t.minor)||lt(this.patch,t.patch)}comparePre(t){if(t instanceof Ae||(t=new Ae(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],s=t.prerelease[r];if(fr("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return lt(n,s)}while(++r)}compareBuild(t){t instanceof Ae||(t=new Ae(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(fr("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return lt(n,s)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),lt(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var ue=Xh;const ko=ue,Yh=(e,t,r=!1)=>
vendor: 15,475 bytes, line 2
2{if(e instanceof ko)return e;try{return new ko(e,t)}catch(n){if(!r)return null;throw n}};var Lt=Yh;const ef=Lt,tf=(e,t)=>{const r=ef(e,t);return r?r.version:null};var rf=tf;const nf=Lt,sf=(e,t)=>{const r=nf(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var of=sf;const Ro=ue,af=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Ro(e instanceof Ro?e.version:e,r).inc(t,n,s).version}catch{return null}};var cf=af;const Io=Lt,lf=(e,t)=>{const r=Io(e,null,!0),n=Io(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,o=i?r:n,a=i?n:r,l=!!o.prerelease.length;if(!!a.prerelease.length&&!l)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const u=l?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};var uf=lf;const df=ue,hf=(e,t)=>new df(e,t).major;var ff=hf;const gf=ue,pf=(e,t)=>new gf(e,t).minor;var mf=pf;const bf=ue,wf=(e,t)=>new bf(e,t).patch;var yf=wf;const Ef=Lt,_f=(e,t)=>{const r=Ef(e,t);return r&&r.prerelease.length?r.prerelease:null};var vf=_f;const Ao=ue,Sf=(e,t,r)=>new Ao(e,r).compare(new Ao(t,r));var Ce=Sf;const Cf=Ce,kf=(e,t,r)=>Cf(t,e,r);var Rf=kf;const If=Ce,Af=(e,t)=>If(e,t,!0);var Nf=Af;const No=ue,Lf=(e,t,r)=>{const n=new No(e,r),s=new No(t,r);return n.compare(s)||n.compareBuild(s)};var oi=Lf;const Mf=oi,Tf=(e,t)=>e.sort((r,n)=>Mf(r,n,t));var Pf=Tf;const $f=oi,Of=(e,t)=>e.sort((r,n)=>$f(n,r,t));var xf=Of;const Ff=Ce,Bf=(e,t,r)=>Ff(e,t,r)>0;var rn=Bf;const jf=Ce,Df=(e,t,r)=>jf(e,t,r)<0;var ai=Df;const Hf=Ce,Uf=(e,t,r)=>Hf(e,t,r)===0;var Ec=Uf;const Vf=Ce,Wf=(e,t,r)=>Vf(e,t,r)!==0;var _c=Wf;const zf=Ce,qf=(e,t,r)=>zf(e,t,r)>=0;var ci=qf;const Jf=Ce,Gf=(e,t,r)=>Jf(e,t,r)<=0;var li=Gf;const Zf=Ec,Qf=_c,Kf=rn,Xf=ci,Yf=ai,e0=li,t0=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Zf(e,r,n);case"!=":return Qf(e,r,n);case">":return Kf(e,r,n);case">=":return Xf(e,r,n);case"<":return Yf(e,r,n);case"<=":return e0(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var vc=t0;const r0=ue,n0=Lt,{safeRe:pr,t:mr}=rr,s0=(e,t)=>{if(e instanceof r0)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?pr[mr.COERCEFULL]:pr[mr.COERCE]);else{const l=t.includePrerelease?pr[mr.COERCERTLFULL]:pr[mr.COERCERTL];let c;for(;(c=l.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(r===null)return null;const n=r[2],s=r[3]||"0",i=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return n0(`${n}.${s}.${i}${o}${a}`,t)};var i0=s0;class o0{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var a0=o0,vs,Lo;function ke(){if(Lo)return vs;Lo=1;class e{constructor(w,R){if(R=n(R),w instanceof e)return w.loose===!!R.loose&&w.includePrerelease===!!R.includePrerelease?w:new e(w.raw,R);if(w instanceof s)return this.raw=w.value,this.set=[[w]],this.format(),this;if(this.options=R,this.loose=!!R.loose,this.includePrerelease=!!R.includePrerelease,this.raw=w.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(I=>!g(I[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const I of this.set)if(I.length===1&&E(I[0])){this.set=[I];break}}}this.format()}format(){return this.range=this.set.map(w=>w.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(w){const k=((this.options.includePrerelease&&h)|(this.options.loose&&f))+":"+w,I=r.get(k);if(I)return I;const C=this.options.loose,M=C?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];w=w.replace(M,ae(this.options.includePrerelease)),i("hyphen replace",w),w=w.replace(a[l.COMPARATORTRIM],c),i("comparator trim",w),w=w.replace(a[l.TILDETRIM],u),i("tilde trim",w),w=w.replace(a[l.CARETTRIM],d),i("caret trim",w);let D=w.split(" ").map(V=>S(V,this.options)).join(" ").split(/\s+/).map(V=>J(V,this.options));C&&(D=D.filter(V=>(i("loose invalid filter",V,this.options),!!V.match(a[l.COMPARATORLOOSE])))),i("range list",D);const P=new Map,H=D.map(V=>new s(V,this.options));for(const V of H){if(g(V))return[V];P.set(V.value,V)}P.size>1&&P.has("")&&P.delete("");const ie=[...P.values()];return r.set(k,ie),ie}intersects(w,R){if(!(w instanceof e))throw new TypeError("a Range is required");return this.set.some(k=>p(k,R)&&w.set.some(I=>p(I,R)&&k.every(C=>I.every(M=>C.intersects(M,R)))))}test(w){if(!w)return!1;if(typeof w=="string")try{w=new o(w,this.options)}catch{return!1}for(let R=0;R<this.set.length;R++)if(G(this.set[R],w,this.options))return!0;return!1}}vs=e;const t=a0,r=new t,n=ii,s=nn(),i=tn,o=ue,{safeRe:a,t:l,comparatorTrimReplace:c,tildeTrimReplace:u,caretTrimReplace:d}=rr,{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:f}=en,g=_=>_.value==="<0.0.0-0",E=_=>_.value==="",p=(_,w)=>{let R=!0;const k=_.slice();let I=k.pop();for(;R&&k.length;)R=k.every(C=>I.intersects(C,w)),I=k.pop();return R},S=(_,w)=>(i("comp",_,w),_=y(_,w),i("caret",_),_=m(_,w),i("tildes",_),_=U(_,w),i("xrange",_),_=se(_,w),i("stars",_),_),b=_=>!_||_.toLowerCase()==="x"||_==="*",m=(_,w)=>_.trim().split(/\s+/).map(R=>x(R,w)).join(" "),x=(_,w)=>{const R=w.loose?a[l.TILDELOOSE]:a[l.TILDE];return _.replace(R,(k,I,C,M,D)=>{i("tilde",_,k,I,C,M,D);let P;return b(I)?P="":b(C)?P=`>=${I}.0.0 <${+I+1}.0.0-0`:b(M)?P=`>=${I}.${C}.0 <${I}.${+C+1}.0-0`:D?(i("replaceTilde pr",D),P=`>=${I}.${C}.${M}-${D} <${I}.${+C+1}.0-0`):P=`>=${I}.${C}.${M} <${I}.${+C+1}.0-0`,i("tilde return",P),P})},y=(_,w)=>_.trim().split(/\s+/).map(R=>L(R,w)).join(" "),L=(_,w)=>{i("caret",_,w);const R=w.loose?a[l.CARETLOOSE]:a[l.CARET],k=w.includePrerelease?"-0":"";return _.replace(R,(I,C,M,D,P)=>{i("caret",_,I,C,M,D,P);let H;return b(C)?H="":b(M)?H=`>=${C}.0.0${k} <${+C+1}.0.0-0`:b(D)?C==="0"?H=`>=${C}.${M}.0${k} <${C}.${+M+1}.0-0`:H=`>=${C}.${M}.0${k} <${+C+1}.0.0-0`:P?(i("replaceCaret pr",P),C==="0"?M==="0"?H=`>=${C}.${M}.${D}-${P} <${C}.${M}.${+D+1}-0`:H=`>=${C}.${M}.${D}-${P} <${C}.${+M+1}.0-0`:H=`>=${C}.${M}.${D}-${P} <${+C+1}.0.0-0`):(i("no pr"),C==="0"?M==="0"?H=`>=${C}.${M}.${D}${k} <${C}.${M}.${+D+1}-0`:H=`>=${C}.${M}.${D}${k} <${C}.${+M+1}.0-0`:H=`>=${C}.${M}.${D} <${+C+1}.0.0-0`),i("caret return",H),H})},U=(_,w)=>(i("replaceXRanges",_,w),_.split(/\s+/).map(R=>K(R,w)).join(" ")),K=(_,w)=>{_=_.trim();const R=w.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return _.replace(R,(k,I,C,M,D,P)=>{i("xRange",_,k,I,C,M,D,P);const H=b(C),ie=H||b(M),V=ie||b(D),Be=V;return I==="="&&Be&&(I=""),P=w.includePrerelease?"-0":"",H?I===">"||I==="<"?k="<0.0.0-0":k="*":I&&Be?(ie&&(M=0),D=0,I===">"?(I=">=",ie?(C=+C+1,M=0,D=0):(M=+M+1,D=0)):I==="<="&&(I="<",ie?C=+C+1:M=+M+1),I==="<"&&(P="-0"),k=`${I+C}.${M}.${D}${P}`):ie?k=`>=${C}.0.0${P} <${+C+1}.0.0-0`:V&&(k=`>=${C}.${M}.0${P} <${C}.${+M+1}.0-0`),i("xRange return",k),k})},se=(_,w)=>(i("replaceStars",_,w),_.trim().replace(a[l.STAR],"")),J=(_,w)=>(i("replaceGTE0",_,w),_.trim().replace(a[w.includePrerelease?l.GTE0PRE:l.GTE0],"")),ae=_=>(w,R,k,I,C,M,D,P,H,ie,V,Be)=>(b(k)?R="":b(I)?R=`>=${k}.0.0${_?"-0":""}`:b(C)?R=`>=${k}.${I}.0${_?"-0":""}`:M?R=`>=${R}`:R=`>=${R}${_?"-0":""}`,b(H)?P="":b(ie)?P=`<${+H+1}.0.0-0`:b(V)?P=`<${H}.${+ie+1}.0-0`:Be?P=`<=${H}.${ie}.${V}-${Be}`:_?P=`<${H}.${ie}.${+V+1}-0`:P=`<=${P}`,`${R} ${P}`.trim()),G=(_,w,R)=>{for(let k=0;k<_.length;k++)if(!_[k].test(w))return!1;if(w.prerelease.length&&!R.includePrerelease){for(let k=0;k<_.length;k++)if(i(_[k].semver),_[k].semver!==s.ANY&&_[k].semver.prerelease.length>0){const I=_[k].semver;if(I.major===w.major&&I.minor===w.minor&&I.patch===w.patch)return!0}return!1}return!0};return vs}var Ss,Mo;function nn(){if(Mo)return Ss;Mo=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,d){if(d=r(d),u instanceof t){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const d=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=u.match(d);if(!h)throw new TypeError(`Invalid comparator: ${u}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,d).test(u.semver):(d=r(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Ss=t;const r=ii,{safeRe:n,t:s}=rr,i=vc,o=tn,a=ue,l=ke();return Ss}const c0=ke(),l0=(e,t,r)=>{try{t=new c0(t,r)}catch{return!1}return t.test(e)};var sn=l0;const u0=ke(),d0=(e,t)=>new u0(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var h0=d0;const f0=ue,g0=ke(),p0=(e,t,r)=>{let n=null,s=null,i=null;try{i=new g0(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new f0(n,r))}),n};var m0=p0;const b0=ue,w0=ke(),y0=(e,t,r)=>{let n=null,s=null,i=null;try{i=new w0(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new b0(n,r))}),n};var E0=y0;const Cs=ue,_0=ke(),To=rn,v0=(e,t)=>{e=new _0(e,t);let r=new Cs("0.0.0");if(e.test(r)||(r=new Cs("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const s=e.set[n];let i=null;s.forEach(o=>{const a=new Cs(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||To(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||To(r,i))&&(r=i)}return r&&e.test(r)?r:null};var S0=v0;const C0=ke(),k0=(e,t)=>{try{return new C0(e,t).range||"*"}catch{return null}};var R0=k0;const I0=ue,Sc=nn(),{ANY:A0}=Sc,N0=ke(),L0=sn,Po=rn,$o=ai,M0=li,T0=ci,P0=(e,t,r,n)=>{e=new I0(e,n),t=new N0(t,n);let s,i,o,a,l;switch(r){case">":s=Po,i=M0,o=$o,a=">",l=">=";break;case"<":s=$o,i=T0,o=Po,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(L0(e,t,n))return!1;for(let c=0;c<t.set.length;++c){const u=t.set[c];let d=null,h=null;if(u.forEach(f=>{f.semver===A0&&(f=new Sc(">=0.0.0")),d=d||f,h=h||f,s(f.semver,d.semver,n)?d=f:o(f.semver,h.semver,n)&&(h=f)}),d.operator===a||d.operator===l||(!h.operator||h.operator===a)&&i(e,h.semver))return!1;if(h.operator===l&&o(e,h.semver))return!1}return!0};var ui=P0;const $0=ui,O0=(e,t,r)=>$0(e,t,">",r);var x0=O0;const F0=ui,B0=(e,t,r)=>F0(e,t,"<",r);var j0=B0;const Oo=ke(),D0=(e,t,r)=>(e=new Oo(e,r),t=new Oo(t,r),e.intersects(t,r));var H0=D0;const U0=sn,V0=Ce;var W0=(e,t,r)=>{const n=[];let s=null,i=null;const o=e.sort((u,d)=>V0(u,d,r));for(const u of o)U0(u,t,r)?(i=u,s||(s=u)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const a=[];for(const[u,d]of n)u===d?a.push(u):!d&&u===o[0]?a.push("*"):d?u===o[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);const l=a.join(" || "),c=typeof t.raw=="string"?t.raw:String(t);return l.length<c.length?l:t};const xo=ke(),di=nn(),{ANY:ks}=di,Tt=sn,hi=Ce,z0=(e,t,r={})=>{if(e===t)return!0;e=new xo(e,r),t=new xo(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const o=J0(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},q0=[new di(">=0.0.0-0")],Fo=[new di(">=0.0.0")],J0=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ks){if(t.length===1&&t[0].semver===ks)return!0;r.includePrerelease?e=q0:e=Fo}if(t.length===1&&t[0].semver===ks){if(r.includePrerelease)return!0;t=Fo}const n=new Set;let s,i;for(const f of e)f.operator===">"||f.operator===">="?s=Bo(s,f,r):f.operator==="<"||f.operator==="<="?i=jo(i,f,r):n.add(f.semver);if(n.size>1)return null;let o;if(s&&i){if(o=hi(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const f of n){if(s&&!Tt(f,String(s),r)||i&&!Tt(f,String(i),r))return null;for(const g of t)if(!Tt(f,String(g),r))return!1;return!0}let a,l,c,u,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(const f of t){if(u=u||f.operator===">"||f.operator===">=",c=c||f.operator==="<"||f.operator==="<=",s){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator===">"||f.operator===">="){if(a=Bo(s,f,r),a===f&&a!==s)return!1}else if(s.operator===">="&&!Tt(s.semver,String(f),r))return!1}if(i){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(l=jo(i,f,r),l===f&&l!==i)return!1}else if(i.operator==="<="&&!Tt(i.semver,String(f),r))return!1}if(!f.operator&&(i||s)&&o!==0)return!1}return!(s&&c&&!i&&o!==0||i&&u&&!s&&o!==0||h||d)},Bo=(e,t,r)=>{if(!e)return t;const n=hi(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},jo=(e,t,r)=>{if(!e)return t;const n=hi(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var G0=z0;const Rs=rr,Do=en,Z0=ue,Ho=yc,Q0=Lt,K0=rf,X0=of,Y0=cf,e1=uf,t1=ff,r1=mf,n1=yf,s1=vf,i1=Ce,o1=Rf,a1=Nf,c1=oi,l1=Pf,u1=xf,d1=rn,h1=ai,f1=Ec,g1=_c,p1=ci,m1=li,b1=vc,w1=i0,y1=nn(),E1=ke(),_1=sn,v1=h0,S1=m0,C1=E0,k1=S0,R1=R0,I1=ui,A1=x0,N1=j0,L1=H0,M1=W0,T1=G0;var P1={parse:Q0,valid:K0,clean:X0,inc:Y0,diff:e1,major:t1,minor:r1,patch:n1,prerelease:s1,compare:i1,rcompare:o1,compareLoose:a1,compareBuild:c1,sort:l1,rsort:u1,gt:d1,lt:h1,eq:f1,neq:g1,gte:p1,lte:m1,cmp:b1,coerce:w1,Comparator:y1,Range:E1,satisfies:_1,toComparators:v1,maxSatisfying:S1,minSatisfying:C1,minVersion:k1,validRange:R1,outside:I1,gtr:A1,ltr:N1,intersects:L1,simplifyRange:M1,subset:T1,SemVer:Z0,re:Rs.re,src:Rs.src,tokens:Rs.t,SEMVER_SPEC_VERSION:Do.SEMVER_SPEC_VERSION,RELEASE_TYPES:Do.RELEASE_TYPES,compareIdentifiers:Ho.compareIdentifiers,rcompareIdentifiers:Ho.rcompareIdentifiers};
2(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=P1,r=st,n=ne;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",d=>(0,t.valid)(d)===null?`Expected SemVer version, got "${d}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",d=>(0,t.validRange)(d)===null?`Expected SemVer range, got "${d}"`:!0);function s(d){return(0,r.is)(d,e.VersionStruct)}e.isValidSemVerVersion=s;function i(d){return(0,r.is)(d,e.VersionRangeStruct)}e.isValidSemVerRange=i;function o(d){(0,n.assertStruct)(d,e.VersionStruct)}e.assertIsSemVerVersion=o;function a(d){(0,n.assertStruct)(d,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function l(d,h){return(0,t.gt)(d,h)}e.gtVersion=l;function c(d,h){return(0,t.gtr)(d,h)}e.gtRange=c;function u(d,h){return(0,t.satisfies)(d,h,{includePrerelease:!0})}e.satisfiesVersionRange=u})(mc);(function(e){var t=A&&A.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=A&&A.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(ne,e),r(er,e),r(j,e),r(Xr,e),r(Pe,e),r(_t,e),r(lc,e),r(tr,e),r(uc,e),r(dc,e),r(vt,e),r(hc,e),r($e,e),r(fc,e),r(gc,e),r(pc,e),r(mc,e)})(Wa);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Wa;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Va);var Cc=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.PollingBlockTracker=void 0;const $1=Cc(Qs),O1=Cc(id),x1=Qt,Uo=Va,Vo=(0,Uo.createModuleLogger)(Uo.projectLogger,"polling-block-tracker"),F1=(0,$1.default)(),B1=1e3;class j1 extends x1.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*B1,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=Wo(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
3${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const s=Wo(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await s}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:F1(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Vo("Making request",t);const r=await(0,O1.default)(n=>this._provider.sendAsync(t,n))();if(Vo("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
4${r.error.message}`);return r.result}}Qr.PollingBlockTracker=j1;function Wo(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var on={},D1=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(on,"__esModule",{value:!0});on.SubscribeBlockTracker=void 0;const H1=D1(Qs),U1=Qt,V1=(0,H1.default)();class W1 extends U1.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}
4async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,s)=>{this._provider.sendAsync({id:V1(),method:t,params:r,jsonrpc:"2.0"},(i,o)=>{i?s(i):n(o.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}on.SubscribeBlockTracker=W1;(function(e){var t=A&&A.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=A&&A.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Qr,e),r(on,e)})(Ua);var fi={},an={},nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.getUniqueId=void 0;const kc=4294967295;let Is=Math.floor(Math.random()*kc);function z1(){return Is=(Is+1)%kc,Is}nr.getUniqueId=z1;Object.defineProperty(an,"__esModule",{value:!0});an.createIdRemapMiddleware=void 0;const q1=nr;function J1(){return(e,t,r,n)=>{const s=e.id,i=q1.getUniqueId();e.id=i,t.id=i,r(o=>{e.id=s,t.id=s,o()})}}an.createIdRemapMiddleware=J1;var cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.createAsyncMiddleware=void 0;function G1(e){return async(t,r,n,s)=>{let i;const o=new Promise(u=>{i=u});let a=null,l=!1;const c=async()=>{l=!0,n(u=>{a=u,i()}),await o};try{await e(t,r,c),l?(await o,a(null)):s(null)}catch(u){a?a(u):s(u)}}}cn.createAsyncMiddleware=G1;var ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.createScaffoldMiddleware=void 0;function Z1(e){return(t,r,n,s)=>{const i=e[t.method];return i===void 0?n():typeof i=="function"?i(t,r,n,s):(r.result=i,s())}}ln.createScaffoldMiddleware=Z1;var sr={},gi={};Object.defineProperty(gi,"__esModule",{value:!0});const Q1=ia;function zo(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function K1(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let X1=class extends Q1.EventEmitter{emit(t,...r){let n=t==="error";const s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")zo(i,this,r);else{const o=i.length,a=K1(i);for(let l=0;l<o;l+=1)zo(a[l],this,r)}return!0}};gi.default=X1;var Rc={},Ve={},Y1=Bt;Bt.default=Bt;Bt.stable=Nc;Bt.stableStringify=Nc;var vr="[...]",Ic="[Circular]",tt=[],Xe=[];function Ac(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Bt(e,t,r,n){typeof n>"u"&&(n=Ac()),Fs(e,"",0,[],void 0,0,n);var s;try{Xe.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,Lc(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;tt.length!==0;){var i=tt.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function mt(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),tt.push([n,r,t,s])):Xe.push([t,r,e]):(n[r]=e,tt.push([n,r,t]))}function Fs(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){mt(Ic,e,t,s);return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){mt(vr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){mt(vr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Fs(e[a],a,a,n,e,i,o);else{var l=Object.keys(e);for(a=0;a<l.length;a++){var c=l[a];Fs(e[c],c,a,n,e,i,o)}}n.pop()}}function eg(e,t){return e<t?-1:e>t?1:0}function Nc(e,t,r,n){typeof n>"u"&&(n=Ac());var s=Bs(e,"",0,[],void 0,0,n)||e,i;try{Xe.length===0?i=JSON.stringify(s,t,r):i=JSON.stringify(s,Lc(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;tt.length!==0;){var o=tt.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Bs(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){mt(Ic,e,t,s);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&i>o.depthLimit){mt(vr,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){mt(vr,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Bs(e[a],a,a,n,e,i,o);else{var l={},c=Object.keys(e).sort(eg);for(a=0;a<c.length;a++){var u=c[a];Bs(e[u],u,a,n,e,i,o),l[u]=e[u]}if(typeof s<"u")tt.push([s,t,e]),s[t]=l;else return l}n.pop()}}function Lc(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Xe.length>0)for(var n=0;n<Xe.length;n++){var s=Xe[n];if(s[1]===t&&s[0]===r){r=s[2],Xe.splice(n,1);break}}return e.call(this,t,r)}}
4Object.defineProperty(Ve,"__esModule",{value:!0});Ve.EthereumProviderError=Ve.EthereumRpcError=void 0;const tg=Y1;class Mc extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return tg.default(this.serialize(),sg,2)}}Ve.EthereumRpcError=Mc;class rg extends Mc{constructor(t,r,n){if(!ng(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Ve.EthereumProviderError=rg;function ng(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function sg(e,t){if(t!=="[Circular]")return t}var pi={},We={};Object.defineProperty(We,"__esModule",{value:!0});We.errorValues=We.errorCodes=void 0;We.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};We.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=We,r=Ve,n=t.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",i={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(h,f=s){if(Number.isInteger(h)){const g=h.toString();if(d(t.errorValues,g))return t.errorValues[g].message;if(c(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return f}e.getMessageFromCode=o;function a(h){if(!Number.isInteger(h))return!1;const f=h.toString();return!!(t.errorValues[f]||c(h))}e.isValidCode=a;function l(h,{fallbackError:f=i,shouldIncludeStack:g=!1}={}){var E,p;if(!f||!Number.isInteger(f.code)||typeof f.message!="string")throw new Error("Mu
4st provide fallback error with integer number code and string message.");if(h instanceof r.EthereumRpcError)return h.serialize();const S={};if(h&&typeof h=="object"&&!Array.isArray(h)&&d(h,"code")&&a(h.code)){const m=h;S.code=m.code,m.message&&typeof m.message=="string"?(S.message=m.message,d(m,"data")&&(S.data=m.data)):(S.message=o(S.code),S.data={originalError:u(h)})}else{S.code=f.code;const m=(E=h)===null||E===void 0?void 0:E.message;S.message=m&&typeof m=="string"?m:f.message,S.data={originalError:u(h)}}const b=(p=h)===null||p===void 0?void 0:p.stack;return g&&h&&b&&typeof b=="string"&&(S.stack=b),S}e.serializeError=l;function c(h){return h>=-32099&&h<=-32e3}function u(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function d(h,f){return Object.prototype.hasOwnProperty.call(h,f)}})(pi);var un={};Object.defineProperty(un,"__esModule",{value:!0});un.ethErrors=void 0;const mi=Ve,Tc=pi,oe=We;un.ethErrors={rpc:{parse:e=>be(oe.errorCodes.rpc.parse,e),invalidRequest:e=>be(oe.errorCodes.rpc.invalidRequest,e),invalidParams:e=>be(oe.errorCodes.rpc.invalidParams,e),methodNotFound:e=>be(oe.errorCodes.rpc.methodNotFound,e),internal:e=>be(oe.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code 
4<= -32005');return be(t,e)},invalidInput:e=>be(oe.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>be(oe.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>be(oe.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>be(oe.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>be(oe.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>be(oe.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Pt(oe.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Pt(oe.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Pt(oe.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Pt(oe.errorCodes.provider.disconnected,e),chainDisconnected:e=>Pt(oe.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new mi.EthereumProviderError(t,r,n)}}};function be(e,t){const[r,n]=Pc(t);return new mi.EthereumRpcError(e,r||Tc.getMessageFromCode(e),n)}function Pt(e,t){const[r,n]=Pc(t);return new mi.EthereumProviderError(e,r||Tc.getMessageFromCode(e),n)}function Pc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;
4if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Ve;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=pi;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=un;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=We;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(Rc);var ig=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sr,"__esModule",{value:!0});sr.JsonRpcEngine=void 0;const og=ig(gi),we=Rc;class Oe extends og.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,s)=>{try{const[i,o,a]=await Oe._runAllMiddleware(t,r,this._middleware);return o?(await Oe._runReturnHandlers(a),s(i)):n(async l=>{try{await Oe._runReturnHandlers(a)}catch(c){return l(c)}return l()})}catch(i){return s(i)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,s)=>{r(s)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new we.EthereumRpcError(we.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new we.EthereumRpcError(we.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),s={id:n.id,jsonrpc:n.jsonrpc};let i=null;try{await this._processRequest(n,s)}catch(o){i=o}return i&&(delete s.result,s.error||(s.error=we.serializeError(i))),r(i,s)}async _processRequest(t,r){const[n,s,i]=await Oe._runAllMiddleware(t,r,this._middleware);if(Oe._checkForCompletion(t,r,s),await Oe._runReturnHandlers(i),n)throw n}static async _runAllMiddleware(t,r,n){const s=[];let i=null,o=!1;for(const a of n)if([i,o]=await Oe._runMiddleware(t,r,a,s),o)break;return[i,o,s.reverse()]}static _runMiddleware(t,r,n,s){return new Promise(i=>{const o=l=>{const c=l||r.error;c&&(r.error=we.serializeError(c)),i([c,!0])},a=l=>{r.error?o(r.error):(l&&(typeof l!="function"&&o(new we.EthereumRpcError(we.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof l}" for request:
5${As(t)}`,{request:t})),s.push(l)),i([null,!1]))};try{n(t,r,a,o)}catch(l){o(l)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,s)=>{r(i=>i?s(i):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new we.EthereumRpcError(we.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
6${As(t)}`,{request:t});if(!n)throw new we.EthereumRpcError(we.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
7${As(t)}`,{request:t})}}sr.JsonRpcEngine=Oe;function As(e){return JSON.stringify(e,null,2)}var dn={};Object.defineProperty(dn,"__esModule",{value:!0});dn.mergeMiddleware=void 0;const ag=sr;function cg(e){const t=new ag.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}dn.mergeMiddleware=cg;(function(e){var t=A&&A.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}
7),r=A&&A.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(an,e),r(cn,e),r(ln,e),r(nr,e),r(sr,e),r(dn,e)})(fi);var $c={},bi={};const wi=jt(Dc);var hn={};Object.defineProperty(hn,"__esModule",{value:!0});var qo=wi,lg=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(s){return t._queue.push(s)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return qo.__awaiter(this,void 0,void 0,function(){var r,n,s;return qo.__generator(this,function(i){switch(i.label){case 0:return[4,this.acquire()];case 1:r=i.sent(),n=r[0],s=r[1],i.label=2;case 2:return i.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,i.sent()];case 4:return s(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();hn.default=lg;Object.defineProperty(bi,"__esModule",{value:!0});var Jo=wi,ug=hn,dg=function(){function e(){this._semaphore=new ug.default(1)}return e.prototype.acquire=function(){return Jo.__awaiter(this,void 0,void 0,function(){var t,r;return Jo.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();bi.default=dg;var fn={};Object.defineProperty(fn,"__esModule",{value:!0});fn.withTimeout=void 0;var br=wi;function hg(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(s,i){return br.__awaiter(n,void 0,void 0,function(){var o,a,l;return br.__generator(this,function(c){switch(c.label){case 0:return o=!1,setTimeout(function(){o=!0,i(r)},t),[4,e.acquire()];case 1:return a=c.sent(),o?(l=Array.isArray(a)?a[1]:a,l()):s(a),[2]}})})})},runExclusive:function(s){return br.__awaiter(this,void 0,void 0,function(){var i,o;return br.__generator(this,function(a){switch(a.label){case 0:i=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(i=o[1],[4,s(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return i=o,[4,s()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return i(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}fn.withTimeout=hg;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=bi;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=hn;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=fn;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})($c);var fg=pg,gg=Object.prototype.hasOwnProperty;function pg(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)gg.call(r,n)&&(e[n]=r[n])}return e}const mg=fg,bg=Qs();var wg=N;function N(e){const t=this;t.currentProvider=e}N.prototype.getBalance=ir(2,"eth_getBalance");N.prototype.getCode=ir(2,"eth_getCode");N.prototype.getTransactionCount=ir(2,"eth_getTransactionCount");N.prototype.getStorageAt=ir(3,"eth_getStorageAt");N.prototype.call=ir(2,"eth_call");N.prototype.protocolVersion=O("eth_protocolVersion");N.prototype.syncing=O("eth_syncing");N.prototype.coinbase=O("eth_coinbase");N.prototype.mining=O("eth_mining");N.prototype.hashrate=O("eth_hashrate");N.prototype.gasPrice=O("eth_gasPrice");N.prototype.accounts=O("eth_accounts");N.prototype.blockNumber=O("eth_blockNumber");N.prototype.getBlockTransactionCountByHash=O("eth_getBlockTransactionCountByHash");N.prototype.getBlockTransactionCountByNumber=O("eth_getBlockTransactionCountByNumber");N.prototype.getUncleCountByBlockHash=O("eth_getUncleCountByBlockHash");N.prototype.getUncleCountByBlockNumber=O("eth_getUncleCountByBlockNumber");N.prototype.sign=O("eth_sign");N.prototype.sendTransaction=O("eth_sendTransaction");N.prototype.sendRawTransaction=O("eth_sendRawTransaction");N.prototype.estimateGas=O("eth_estimateGas");N.prototype.getBlockByHash=O("eth_getBlockByHash");N.prototype.getBlockByNumber=O("eth_getBlockByNumber");N.prototype.getTransactionByHash=O("eth_getTransactionByHash");N.prototype.getTransactionByBlockHashAndIndex=O("eth_getTransactionByBlockHashAndIndex");N.prototype.getTransactionByBlockNumberAndIndex=O("eth_getTransactionByBlockNumberAndIndex");N.prototype.getTransactionReceipt=O("eth_getTransactionReceipt");N.prototype.getUncleByBlockHashAndIndex=O("eth_getUncleByBlockHashAndIndex");N.prototype.getUncleByBlockNumberAndIndex=O("eth_getUncleByBlockNumberAndIndex");N.prototype.getCompilers=O("eth_getCompilers");N.prototype.compileLLL=O("eth_compileLLL");N.prototype.compileSolidity=O("eth_compileSolidity");N.prototype.compileSerpent=O("eth_compileSerpent");N.prototype.newFilter=O("eth_newFilter");N.prototype.newBlockFilter=O("eth_newBlockFilter");N.prototype.newPendingTransactionFilter=O("eth_newPendingTransactionFilter");N.prototype.uninstallFilter=O("eth_uninstallFilter");N.prototype.getFilterChanges=O("eth_getFilterChanges");N.prototype.getFilterLogs=O("eth_getFilterLogs");N.prototype.getLogs=O("eth_getLogs");N.prototype.getWork=O("eth_getWork");N.prototype.submitWork=O("eth_submitWork");N.prototype.submitHashrate=O("eth_submitHashrate");N.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(yg(e),function(n,s){if(!n&&s.error&&(n=new Error("EthQuery - RPC Error - "+s.error.message)),n)return t(n);t(null,s.result)})};function O(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function ir(e,t){return function(){const r=this;var n=[].slice.call(arguments),s=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},s)}}function yg(e){return mg({id:bg(),jsonrpc:"2.0",params:[]},e)}const Go=(e,t,r,n)=>function(...s){const i=t.promiseModule;return new i((o,a)=>{t.multiArgs?s.push((...c)=>{t.errorFirst?c[0]?a(c):(c.shift(),o(c)):o(c)}):t.errorFirst?s.push((c,u)=>{c?a(c):o(u)}):s.push(o),Reflect.apply(e,this===r?n:this,s)})},Zo=new WeakMap;var Eg=(e,t)=>
7{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(o,a)=>{let l=Zo.get(o);if(l||(l={},Zo.set(o,l)),a in l)return l[a];const c=g=>typeof g=="string"||typeof a=="symbol"?a===g:g.test(a),u=Reflect.getOwnPropertyDescriptor(o,a),d=u===void 0||u.writable||u.configurable,f=(t.include?t.include.some(c):!t.exclude.some(c))&&d;return l[a]=f,f},s=new WeakMap,i=new Proxy(e,{apply(o,a,l){const c=s.get(o);if(c)return Reflect.apply(c,a,l);const u=t.excludeMain?o:Go(o,t,i,o);return s.set(o,u),Reflect.apply(u,a,l)},get(o,a){const l=o[a];if(!n(o,a)||l===Function.prototype[a])return l;const c=s.get(l);if(c)return c;if(typeof l=="function"){const u=Go(l,t,i,o);return s.set(l,u),u}return l}});return i};const _g=Kt.default;let vg=class extends _g{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var yi=vg;const Sg=yi;let Cg=class extends Sg{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var kg=Cg,or={minBlockRef:Rg,maxBlockRef:Ig,sortBlockRefs:Ei,bnToHex:Ag,blockRefIsNumber:Ng,hexToInt:Sr,incrementHexInt:Lg,intToHex:Oc,unsafeRandomBytes:Mg};function Rg(...e){return Ei(e)[0]}function Ig(...e){const t=Ei(e);return t[t.length-1]}function Ei(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Sr(t)-Sr(r))}function Ag(e){return"0x"+e.toString(16)}function Ng(e){return e&&!["earliest","latest","pending"].includes(e)}function Sr(e){return e==null?e:Number.parseInt(e,16)}function Lg(e){if(e==null)return e;const t=Sr(e);return Oc(t+1)}function Oc(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function Mg(e){let t="0x";for(let r=0;r<e;r++)t+=Qo(),t+=Qo();return t}function Qo(){return Math.floor(Math.random()*16).toString(16)}const Tg=wg,Pg=Eg,$g=kg,{bnToHex:Jp,hexToInt:wr,incrementHexInt:Og,minBlockRef:xg,blockRefIsNumber:Fg}=or;let Bg=class extends $g{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new Tg(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=xg(this.params.toBlock,t),s=Object.assign({},this.params,{toBlock:n}),i=await this._fetchLogs(s);this.addInitialResults(i)}async update({oldBlock:t,newBlock:r}){const n=r;let s;t?s=Og(t):s=r;const i=Object.assign({},this.params,{fromBlock:s,toBlock:n}),a=(await this._fetchLogs(i)).filter(l=>this.matchLog(l));this.addResults(a)}async _fetchLogs(t){return await Pg(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(wr(this.params.fromBlock)>=wr(t.blockNumber)||Fg(this.params.toBlock)&&wr(this.params.toBlock)<=wr(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((s,i)=>{let o=t.topics[i];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(s)?s:[s];return a.includes(null)?!0:(a=a.map(u=>u.toLowerCase()),a.includes(o))})}};var jg=Bg,_i=Dg;async function Dg({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=Ko(t),i=Ko(r)-n+1,o=Array(i).fill().map((l,c)=>n+c).map(Hg);let a=await Promise.all(o.map(l=>Vg(e,"eth_getBlockByNumber",[l,!1])));return a=a.filter(l=>l!==null),a}function Ko(e){return e==null?e:Number.parseInt(e,16)}function Hg(e){return e==null?e:"0x"+e.toString(16)}function Ug(e,t){return new Promise((r,n)=>{e.sendAsync(t,(s,i)=>{s?n(s):i.error?n(i.error):i.result?r(i.result):n(new Error("Result was empty"))})})}async function Vg(e,t,r){for(let n=0;n<3;n++)try{return await Ug(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(s){console.error(`provider.sendAsync failed: ${s.stack||s.message||s}`)}return null}const Wg=yi,zg=_i,{incrementHexInt:qg}=or;let Jg=class extends Wg{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,s=qg(t),o=(await zg({provider:this.provider,fromBlock:s,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var Gg=Jg;const Zg=yi,Qg=_i,{incrementHexInt:Kg}=or;let Xg=class extends Zg{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=Kg(t),s=await Qg({provider:this.provider,fromBlock:n,toBlock:r}),i=[];for(const o of s)i.push(...o.transactions);this.addResults(i)}};var Yg=Xg;const ep=$c.Mutex,{createAsyncMiddleware:tp,createScaffoldMiddleware:rp}=fi,np=jg,sp=Gg,ip=Yg,{intToHex:xc,hexToInt:Ns}=or;var op=ap;function ap({blockTracker:e,provider:t}){let r=0,n={};const s=new ep,i=cp({mutex:s}),o=rp({eth_newFilter:i(Ls(l)),eth_newBlockFilter:i(Ls(c)),eth_newPendingTransactionFilter:i(Ls(u)),eth_uninstallFilter:i(Er(f)),eth_getFilterChanges:i(Er(d)),eth_getFilterLogs:i(Er(h))}),a=async({oldBlock:b,newBlock:m})=>
7{if(n.length===0)return;const x=await s.acquire();try{await Promise.all(ut(n).map(async y=>{try{await y.update({oldBlock:b,newBlock:m})}catch(L){console.error(L)}}))}catch(y){console.error(y)}x()};return o.newLogFilter=l,o.newBlockFilter=c,o.newPendingTransactionFilter=u,o.uninstallFilter=f,o.getFilterChanges=d,o.getFilterLogs=h,o.destroy=()=>{p()},o;async function l(b){const m=new np({provider:t,params:b});return await g(m),m}async function c(){const b=new sp({provider:t});return await g(b),b}async function u(){const b=new ip({provider:t});return await g(b),b}async function d(b){const m=Ns(b),x=n[m];if(!x)throw new Error(`No filter for index "${m}"`);return x.getChangesAndClear()}async function h(b){const m=Ns(b),x=n[m];if(!x)throw new Error(`No filter for index "${m}"`);let y=[];return x.type==="log"&&(y=x.getAllResults()),y}async function f(b){const m=Ns(b),y=!!n[m];return y&&await E(m),y}async function g(b){const m=ut(n).length,x=await e.getLatestBlock();await b.initialize({currentBlock:x}),r++,n[r]=b,b.id=r,b.idHex=xc(r);const y=ut(n).length;return S({prevFilterCount:m,newFilterCount:y}),r}async function E(b){const m=ut(n).length;delete n[b];const x=ut(n).length;S({prevFilterCount:m,newFilterCount:x})}async function p(){const b=ut(n).length;n={},S({prevFilterCount:b,newFilterCount:0})}function S({prevFilterCount:b,newFilterCount:m}){if(b===0&&m>0){e.on("sync",a);return}if(b>0&&m===0){e.removeListener("sync",a);return}}}function Ls(e){return Er(async(...t)=>{const r=await e(...t);return xc(r.id)})}function Er(e){return tp(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function cp({mutex:e}){return t=>async(r,n,s,i)=>{(await e.acquire())(),t(r,n,s,i)}}function ut(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const lp=Kt.default,{createAsyncMiddleware:Xo,createScaffoldMiddleware:up}=fi,dp=op,{unsafeRandomBytes:hp,incrementHexInt:fp}=or,gp=_i;var pp=mp;function mp({blockTracker:e,provider:t}){const r={},n=dp({blockTracker:e,provider:t});let s=!1;const i=new lp,o=up({eth_subscribe:Xo(a),eth_unsubscribe:Xo(l)});return o.destroy=u,{events:i,middleware:o};
7async function a(d,h){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const f=d.params[0],g=hp(16);let E;switch(f){case"newHeads":E=p({subId:g});break;case"logs":const b=d.params[1],m=await n.newLogFilter(b);E=S({subId:g,filter:m});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${f}"`)}r[g]=E,h.result=g;return;function p({subId:b}){const m={type:f,destroy:async()=>{e.removeListener("sync",m.update)},update:async({oldBlock:x,newBlock:y})=>{const L=y,U=fp(x);(await gp({provider:t,fromBlock:U,toBlock:L})).map(bp).filter(J=>J!==null).forEach(J=>{c(b,J)})}};return e.on("sync",m.update),m}function S({subId:b,filter:m}){return m.on("update",y=>c(b,y)),{type:f,destroy:async()=>await n.uninstallFilter(m.idHex)}}}async function l(d,h){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const f=d.params[0],g=r[f];if(!g){h.result=!1;return}delete r[f],await g.destroy(),h.result=!0}function c(d,h){i.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:d,result:h}})}function u(){i.removeAllListeners();for(const d in r)r[d].destroy(),delete r[d];s=!0}}function bp(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(Zr,"__esModule",{value:!0});Zr.SubscriptionManager=void 0;const wp=Ua,yp=pp,Yo=()=>{};class Ep{constructor(t){const r=new wp.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:s}=yp({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=s}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,Yo,Yo),r}destroy(){this.subscriptionMiddleware.destroy()}}Zr.SubscriptionManager=Ep;var Fc=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bt,"__esModule",{value:!0});bt.CoinbaseWalletProvider=void 0;const _p=Fc(Cr),vp=El,F=Dt,T=v,Sp=Wt,ea=ye,yr=Rt,fe=St,Ms=Fc(ed),$t=kt,Cp=Et,kp=Zr,ta="DefaultChainId",ra="DefaultJsonRpcUrl";class Rp extends vp.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new Cp.FilterPolyfill(this),this._subscriptionManager=new kp.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const s=this.getChainId(),i=(0,T.prepend0x)(s.toString(16));this.emit("connect",{chainIdStr:i});const o=this._storage.getItem(ea.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(l=>(0,T.ensureAddressString)(l)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var l;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"&&a.data.data.action==="dappChainSwitched"){const c=a.data.data.chainId,u=(l=a.data.data.jsonRpcUrl)!==null&&l!==void 0?l:this.jsonRpcUrl;
7this.updateProviderInfo(u,Number(c))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,T.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(ra))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(ra,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(ta,r.toString(10)),((0,T.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,s,i,o){const l=await(await this.initializeRelay()).watchAsset(t,r,n,s,i,o==null?void 0:o.toString()).promise;return(0,fe.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(t,r,n,s,i,o){var a,l;if((0,T.ensureIntNumber)(t)===this.getChainId())return!1;const c=await this.initializeRelay(),u=c.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!u&&await c.requestEthereumAccounts().promise;const d=await c.addEthereumChain(t.toString(),r,i,n,s,o).promise;return(0,fe.isErrorResponse)(d)?!1:(((a=d.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],t),((l=d.result)===null||l===void 0?void 0:l.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,fe.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===F.standardErrorCodes.provider.unsupportedChain?F.standardErrors.provider.unsupportedChain():F.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const s=n.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log($t.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?yr.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(s=>{throw(0,F.serializeError)(s,t)})}catch(n){throw(0,F.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const s=t,i=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:s,params:i};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const s=t,i=r;return this._sendAsync(s,i)}if(Array.isArray(t))return t.map(i=>this._sendRequest(i));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,F.serializeError)(n,t)})}catch(n){return Promise.reject((0,F.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const s=r;this._sendMultipleRequestsAsync(t).then(i=>s(null,i)).catch(i=>s(i,null));return}const n=r;return this._sendRequestAsync(t).then(s=>n(null,s)).catch(s=>n(s,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,F.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,F.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw F.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw F.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw F.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const s=n===void 0?[]:n,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:s,jsonrpc:"2.0",id:i})).result}
7async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,T.ensureRegExpString)(t)).promise;if((0,fe.isErrorResponse)(n))throw(0,F.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,F.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const s=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,fe.isErrorResponse)(s))throw(0,F.serializeError)(s.errorMessage,"generic");if(typeof s.result!="string")throw(0,F.serializeError)("result was not a string","generic");return s.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log($t.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?yr.Session.hash(this._relay.session.id):void 0});let n;try{const i=await this.initializeRelay();if(!(i instanceof Sp.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await i.connectAndSignIn(t).promise,(0,fe.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied account authorization"):i}if(!n.result)throw new Error("accounts received is empty");const{accounts:s}=n.result;return this._setAddresses(s),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,fe.isErrorResponse)(n))throw(0,F.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,F.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(s=>(0,T.ensureAddressString)(s));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(ea.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const s=this._handleSynchronousMethods(t);if(s!==void 0)return r({jsonrpc:"2.0",id:t.id,result:s});const i=this._handleAsynchronousFilterMethods(t);if(i!==void 0){i.then(a=>r(Object.assign(Object.assign({},a),{id:t.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(t);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:t.id,result:a.result})).catch(a=>n(a));return}}catch(s){return n(s)}this._handleAsynchronousMethods(t).then(s=>s&&r(Object.assign(Object.assign({},s),{id:t.id}))).catch(s=>n(s))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).cat
7ch(i=>{var o;throw(i.code===F.standardErrorCodes.rpc.methodNotFound||i.code===F.standardErrorCodes.rpc.methodNotSupported)&&((o=this.diagnostic)===null||o===void 0||o.log($t.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?yr.Session.hash(this._relay.session.id):void 0})),i})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,T.ensureAddressString)(t);return this._addresses.map(s=>(0,T.ensureAddressString)(s)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log($t.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,T.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,T.ensureAddressString)(t.to):null,s=t.value!=null?(0,T.ensureBN)(t.value):new _p.default(0),i=t.data?(0,T.ensureBuffer)(t.data):$.alloc(0),o=t.nonce!=null?(0,T.ensureIntNumber)(t.nonce):null,a=t.gasPrice!=null?(0,T.ensureBN)(t.gasPrice):null,l=t.maxFeePerGas!=null?(0,T.ensureBN)(t.maxFeePerGas):null,c=t.maxPriorityFeePerGas!=null?(0,T.ensureBN)(t.maxPriorityFeePerGas):null,u=t.gas!=null?(0,T.ensureBN)(t.gas):null,d=t.chainId?(0,T.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:s,data:i,nonce:o,gasPriceInWei:a,maxFeePerGas:l,maxPriorityFeePerGas:c,gasLimit:u,chainId:d}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw F.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw F.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,s){this._ensureKnownAddress(r);try{const o=await(await this.initializeRelay()).signEthereumMessage(t,r,n,s).promise;if((0,fe.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied message signature"):i}}async _ethereumAddressFromSignedMessage(t,r,n){const i=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,fe.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,T.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(ta);if(!t)return(0,T.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,T.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log($t.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?yr.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,fe.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,T.ensureAddressString)(t[0]),n=(0,T.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,T.ensureBuffer)(t[0]),n=(0,T.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,T.ensureBuffer)(t[0]),n=(0,T.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,T.ensureBuffer)(t[0]),n=(0,T.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const s=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,fe.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,T.ensureBuffer)(t[0]),s=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,fe.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const s=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,fe.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?F.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,T.ensureParsedJSONObject)(t[0]),n=(0,T.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const s=Ms.default.hashForSignTypedDataLegacy({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(s,n,!1,i)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,T.ensureAddressString)(t[0]),n=(0,T.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const s=Ms.default.hashForSignTypedData_v3({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,r,!1,i)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,T.ensureAddressString)(t[0]),n=(0,T.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const s=Ms.default.hashForSignTypedData_v4({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,r,!1,i)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];
7if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,s,i;const o=t[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw F.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw F.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(s=o.blockExplorerUrls)!==null&&s!==void 0?s:[],o.chainName,(i=o.iconUrls)!==null&&i!==void 0?i:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw F.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw F.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw F.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw F.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:s,symbol:i,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,s,i,a,o,n)}}_eth_uninstallFilter(t){const r=(0,T.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,T.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,T.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}bt.CoinbaseWalletProvider=Rp;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.RelayEventManager=void 0;const Ip=v;class Ap{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,Ip.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}gn.RelayEventManager=Ap;Object.defineProperty(xt,"__esModule",{value:!0});xt.CoinbaseWalletSDK=void 0;const Np=kr,Lp=Rr,na=v,Mp=Mr,Tp=bt,Pp=Wt,$p=Zt,Op=gn,xp=qt,Fp=zt,Bc=Ct;class pn{constructor(t){var r,n,s;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=t.linkAPIUrl||Lp.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(s=t.reloadOnDisconnect)!==null&&s!==void 0?s:!0;const o=new URL(i),a=`${o.protocol}//${o.host}`;if(this._storage=new Mp.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",pn.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new Op.RelayEventManager;const l=(0,na.isMobileWeb)(),c=t.uiConstructor||(d=>l?new $p.MobileRelayUI(d):new xp.WalletLinkRelayUI(d)),u={linkAPIUrl:i,version:Bc.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:c,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=l?new Pp.MobileRelay(u):new Fp.WalletLinkRelay(u),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const s=this.coinbaseBrowser;if(s)return s;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||i.setConnectDisabled(!0),new Tp.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,na.getFavicon)();const s=this.walletExtension;s?this.isCipherProvider(s)||s.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,Np.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}xt.CoinbaseWalletSDK=pn;pn.VERSION=Bc.LIB_VERSION;
7(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=xt,r=bt;var n=xt;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var s=bt;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return s.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(js);const Bp=Hc(js),Kp=Wc({__proto__:null,default:Bp},[js]);export{Kp as i};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.