@dcl/explorer-website 2.6.1-25865517797.commit-b7a7cba → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/assets/{ConstantsUtil-ByjAYmvC.js → ConstantsUtil-BYRHWuZV.js} +1 -1
  2. package/assets/{ExchangeController-Bp8ztJrX.js → ExchangeController-N42lbf3C.js} +1 -1
  3. package/assets/{HelpersUtil-Dp4e1zvd.js → HelpersUtil-DFmhrbIH.js} +1 -1
  4. package/assets/{NetworkUtil-DqGcuBfF.js → NetworkUtil-DM5H1DOt.js} +1 -1
  5. package/assets/{SwapController-DUCq2f7d.js → SwapController-SgAc8zJM.js} +1 -1
  6. package/assets/{W3MFrameProviderSingleton-9eitOT0j.js → W3MFrameProviderSingleton-dGwr0u32.js} +3 -3
  7. package/assets/{basic-C7tUDecp.js → basic-CDUVa7W3.js} +1 -1
  8. package/assets/{biconomy-plHCR2Qq.js → biconomy-Dj37CYYZ.js} +1 -1
  9. package/assets/{browser-VYI7gorG.js → browser-h4rN6CV4.js} +1 -1
  10. package/assets/browser-ponyfill-LG9Rjmfj.js +1 -0
  11. package/assets/{ccip-Bldffu31.js → ccip-Cv_5kGJ0.js} +1 -1
  12. package/assets/{ccip-CrAifiNa.js → ccip-TlIoUAte.js} +1 -1
  13. package/assets/{chains-DTVDhUwv.js → chains-CsuV2rnE.js} +1 -1
  14. package/assets/{common-BEf2T7Hi.js → common-C9wbti_7.js} +1 -1
  15. package/assets/{controller-B8Iy-6V9.js → controller-DpEeOSLx.js} +2 -2
  16. package/assets/{core-XFvzSI58.js → core-BGvtiIgG.js} +4 -4
  17. package/assets/{custom-cPmISGcH.js → custom-BbQhcg55.js} +1 -1
  18. package/assets/{data-capture-DnvAEYWK.js → data-capture-C5UoNnMk.js} +1 -1
  19. package/assets/decimals-DA8L6Gte.js +1 -0
  20. package/assets/{decimals-8g2-fBFa.js → decimals-mBEEumco.js} +1 -1
  21. package/assets/{detectExtension-yvI5WWZb.js → detectExtension-oDT7CrDk.js} +1 -1
  22. package/assets/{email-C8DRQjTT.js → email-CUatRSQC.js} +1 -1
  23. package/assets/{embedded-wallet-BxgtT1uV.js → embedded-wallet-DZAeJhJN.js} +1 -1
  24. package/assets/{engine-BERe87yT.js → engine-AXDB-0h6.js} +1 -1
  25. package/assets/{estimate-l1-fee-BTeKvFv5.js → estimate-l1-fee-Bxwscz8f.js} +1 -1
  26. package/assets/eth_estimateGas-DFXalA2X.js +1 -0
  27. package/assets/{eth_getStorageAt-SbVMAQY-.js → eth_getStorageAt-Dr4zmiJF.js} +1 -1
  28. package/assets/{eth_getTransactionCount-qv0oO1Md.js → eth_getTransactionCount-cZacEETx.js} +1 -1
  29. package/assets/{ethereum-BP59xYBe.js → ethereum-CIBzGnJl.js} +1 -1
  30. package/assets/{extractIPFS-BOFlZk7U.js → extractIPFS-Czsz8-sO.js} +1 -1
  31. package/assets/{features-DVWd8_kC.js → features-fx-atM_l.js} +1 -1
  32. package/assets/{fetchTokenMetadata-BaJXN6RH.js → fetchTokenMetadata-uG4nb_Kh.js} +2 -2
  33. package/assets/{fortmatic-DARkeYTE.js → fortmatic-boxtmFta.js} +1 -1
  34. package/assets/get-ecosystem-wallet-info-BI2Fd0Vd.js +1 -0
  35. package/assets/{getBalance-D6wpo61w.js → getBalance-CC2S0qtL.js} +2 -2
  36. package/assets/{getInstalledModules-Dkj379ys.js → getInstalledModules-53n5UYt2.js} +1 -1
  37. package/assets/{getNFT-HMkoXD7L.js → getNFT-C3FPakLN.js} +2 -2
  38. package/assets/{getNFT-Drn4rxrk.js → getNFT-CnaK4j2q.js} +1 -1
  39. package/assets/{hashTypedData-CMDSWYgs.js → hashTypedData-C4JiqOxU.js} +1 -1
  40. package/assets/{hashTypedData-B5shS-rs.js → hashTypedData-D1Ievn97.js} +1 -1
  41. package/assets/{in-app-wallet-calls-l9-2W_Em.js → in-app-wallet-calls-khLeeKNu.js} +1 -1
  42. package/assets/{index-BIPd_vR5.js → index-0P32tQWj.js} +1 -1
  43. package/assets/{index-DIlwNfpB.js → index-1quVm3wk.js} +1 -1
  44. package/assets/{index-DbAu4Peg.js → index-B2PoGJRP.js} +3 -3
  45. package/assets/{index-BaGjqMte.js → index-B5w_jZpc.js} +2 -2
  46. package/assets/{index-CE5G6IEJ.js → index-B6j-Tckn.js} +1 -1
  47. package/assets/{index-CjiwjbqL.js → index-BCiKer83.js} +1 -1
  48. package/assets/{index-C8NSq3HK.js → index-BCqrDgyR.js} +1 -1
  49. package/assets/{index-BXAxcybX.js → index-BE5nQY53.js} +1 -1
  50. package/assets/{index-C51HwlD0.js → index-BF9Yx_yV.js} +1 -1
  51. package/assets/{index-CWGeCZBJ.js → index-BJCYEGPg.js} +1 -1
  52. package/assets/{index-Cy1X3n_C.js → index-BT0xQ-Xd.js} +1 -1
  53. package/assets/{index-0ShVRzxt.js → index-BVi4iI8y.js} +1 -1
  54. package/assets/{index-BDgZ3gDE.js → index-BVvMg9ZB.js} +1 -1
  55. package/assets/{index-DFE6t65x.js → index-BpxeqYFx.js} +1 -1
  56. package/assets/{index-B5ECjSS9.js → index-Bv6LvzLS.js} +1 -1
  57. package/assets/{index-i4VBSYqA.js → index-BvCGPTHO.js} +1 -1
  58. package/assets/index-Bzi38pjx.css +1 -0
  59. package/assets/{index-CH0zI801.js → index-C5oPclal.js} +1 -1
  60. package/assets/{index-D2ZBQG8w.js → index-C6-AvlPm.js} +1 -1
  61. package/assets/{index-CWnFK_-0.js → index-C9EMW8qD.js} +1 -1
  62. package/assets/{index-C-uqursN.js → index-C9vcJp9T.js} +1 -1
  63. package/assets/{index-DK-ZMNLh.js → index-CO3lXLzl.js} +1 -1
  64. package/assets/{index-DS2Lm9tG.js → index-CYBDya_s.js} +1 -1
  65. package/assets/{index-okvlQSs2.js → index-Coj3uG35.js} +1 -1
  66. package/assets/{index-Cu4ZjLNb.js → index-CqbvjyBi.js} +5 -5
  67. package/assets/{index-wds8TuUm.js → index-CwfOYq8B.js} +1 -1
  68. package/assets/{index-aoxVkzFE.js → index-Cz0JdeQb.js} +1 -1
  69. package/assets/{index-C5ciuua_.js → index-D-YuFp2i.js} +1 -1
  70. package/assets/{index-I68folnJ.js → index-D4NLrlUn.js} +1 -1
  71. package/assets/{index-B7Jt3b4d.js → index-D8PaxcsI.js} +1 -1
  72. package/assets/{index-r_1z0VI_.js → index-D9ey6cqT.js} +1 -1
  73. package/assets/{index-B-vyBZw9.js → index-DRYOQXZX.js} +1 -1
  74. package/assets/{index-DOnRCLNP.js → index-DT1PkdGa.js} +2 -2
  75. package/assets/{index-DWRq2SN_.js → index-DXCSroqX.js} +1 -1
  76. package/assets/{index-mZa0UiRt.js → index-DXs78xw9.js} +1 -1
  77. package/assets/{index-kXKMGszW.js → index-DZ0punK7.js} +1 -1
  78. package/assets/{index-B9U0GcYk.js → index-D_m5AL3D.js} +1 -1
  79. package/assets/{index-BxdNwV86.js → index-Dc148hav.js} +1 -1
  80. package/assets/{index-DP1DuCnR.js → index-DgDxBH9m.js} +1 -1
  81. package/assets/{index-DfWsAOhN.js → index-Dm7tCcMc.js} +3 -3
  82. package/assets/{index-D0LvjNIX.js → index-DmIGOG39.js} +1 -1
  83. package/assets/{index-JfVynEph.js → index-DmK5ktNw.js} +1 -1
  84. package/assets/{index-Cp7mdTuR.js → index-Eyans5--.js} +1 -1
  85. package/assets/{index-DPxCDCvr.js → index-KK8ZylE4.js} +1 -1
  86. package/assets/{index-DvJmANzU.js → index-TUD0QlWP.js} +1 -1
  87. package/assets/{index-TBthDmkl.js → index-ak5cSl-l.js} +1 -1
  88. package/assets/{index-8M7OkBFm.js → index-bVr8-SEv.js} +1 -1
  89. package/assets/{index-BlykZ8Gp.js → index-prLj8b2x.js} +1 -1
  90. package/assets/{index-BKL7nv1p.js → index-vajj2FBo.js} +1 -1
  91. package/assets/{index.es-YpI01v2I.js → index.es-C85F8NOj.js} +1 -1
  92. package/assets/{index.es-CkxUaFYS.js → index.es-DYgSAVrd.js} +1 -1
  93. package/assets/{index.es-cEGj7JU0.js → index.es-XXBqJXMm.js} +4 -4
  94. package/assets/{localBatchGatewayRequest-CNIOIq-Z.js → localBatchGatewayRequest-DbQn1s0J.js} +1 -1
  95. package/assets/{networks-DJ72puSk.js → networks-DMqekeph.js} +1 -1
  96. package/assets/{onramp--l5ZLxWE.js → onramp-qvbxoSMm.js} +1 -1
  97. package/assets/{openzeppelin-CqtRqxtF.js → openzeppelin-B6Und3LJ.js} +1 -1
  98. package/assets/{ownerOf-cWkgEtd8.js → ownerOf-CUoSe2c5.js} +1 -1
  99. package/assets/{parseEventLogs-D1xiFnCH.js → parseEventLogs-BxtEI7tW.js} +3 -3
  100. package/assets/{parseNft-DH5KlHPI.js → parseNft-DB_pGzOu.js} +2 -2
  101. package/assets/{parseSignature-HAlgOHnm.js → parseSignature-Csyua1uA.js} +3 -3
  102. package/assets/{parseSignature-BYhcrVdX.js → parseSignature-O0fAqZoB.js} +1 -1
  103. package/assets/{pay-with-exchange-CiXPJJ6-.js → pay-with-exchange-1MlV9x6H.js} +1 -1
  104. package/assets/{qr-overlay-CmFgwJBd.js → qr-overlay-DA6htUdY.js} +3 -3
  105. package/assets/{receive-t2TxUItI.js → receive-JnpfZY7d.js} +1 -1
  106. package/assets/{resolveImplementation-iG9WRRnW.js → resolveImplementation-B8d2Q-Ro.js} +1 -1
  107. package/assets/{rpc-sIdV4wiJ.js → rpc-DkFFCBh9.js} +1 -1
  108. package/assets/{secp256k1-Rk5k9i7o.js → secp256k1-BCPsQ5nJ.js} +1 -1
  109. package/assets/{secp256k1-Co_Jve4c.js → secp256k1-BZmrY8e3.js} +1 -1
  110. package/assets/{secp256k1-Bg2aUJRs.js → secp256k1-TIizaas9.js} +1 -1
  111. package/assets/{send-ByB5fOtm.js → send-DsnDja5n.js} +1 -1
  112. package/assets/{send-batch-transaction-D79MC_wr.js → send-batch-transaction-jNcvidMH.js} +1 -1
  113. package/assets/{send-eip712-transaction-CB6qLgks.js → send-eip712-transaction-DDJVOUpU.js} +2 -2
  114. package/assets/{send-gasless-transaction-Dt1qtUR8.js → send-gasless-transaction-DXjarWmh.js} +2 -2
  115. package/assets/{session-proposal-CY0k9Jnm.js → session-proposal-xJguSOgr.js} +1 -1
  116. package/assets/{session-request-B_2glC9e.js → session-request-BhD4eDPG.js} +2 -2
  117. package/assets/{sha256-Dy8KQE_5.js → sha256-CbjS9vFa.js} +1 -1
  118. package/assets/{signing-gNn6SJWz.js → signing-tKzVzr3v.js} +5 -5
  119. package/assets/{socials-Dx84-PrV.js → socials-CER945jA.js} +1 -1
  120. package/assets/{swaps-CK9Sfcew.js → swaps-Dy4hNTFm.js} +1 -1
  121. package/assets/{thirdweb-Bx5V_C1s.js → thirdweb-CNCkvOQU.js} +3 -3
  122. package/assets/{totalSupply-O-VFDoRO.js → totalSupply-BQvZy7Uc.js} +1 -1
  123. package/assets/{transactionReceipt-BqEjx5q-.js → transactionReceipt-DA1xo-2g.js} +1 -1
  124. package/assets/{transactions-BLOC2qYE.js → transactions-CwEfhngY.js} +1 -1
  125. package/assets/{utils-h8VUSGPW.js → utils-BUWGRgBa.js} +1 -1
  126. package/assets/{verifyHash-CNJ6t8Wp.js → verifyHash-CX9Livyx.js} +1 -1
  127. package/assets/{w3m-modal-nzPxg0Fr.js → w3m-modal-B1spewtI.js} +1 -1
  128. package/assets/{w3m-modal-CCQuGDus.js → w3m-modal-B6M729n4.js} +1 -1
  129. package/assets/{wait-for-tx-receipt-5pSBMNe2.js → wait-for-tx-receipt-BLruoSfj.js} +1 -1
  130. package/assets/{wallets-Bz03-Btm.js → wallets-vCTTbbau.js} +6 -6
  131. package/assets/{web-connector-CAOe_uvv.js → web-connector-h9SB5qXs.js} +3 -3
  132. package/assets/{writeContract-CCar3Ocq.js → writeContract-C9KDDivM.js} +1 -1
  133. package/assets/{zora-sepolia-D6mjhB5j.js → zora-sepolia-pCyxGzqm.js} +1 -1
  134. package/assets/{zoraTestnet-WLSFziQl.js → zoraTestnet-ChmlUfs6.js} +1 -1
  135. package/index.html +4 -4
  136. package/package.json +3 -3
  137. package/assets/browser-ponyfill-BmgQyNz0.js +0 -1
  138. package/assets/decimals-DR6jraOc.js +0 -1
  139. package/assets/eth_estimateGas-DKKwG-Ue.js +0 -1
  140. package/assets/get-ecosystem-wallet-info-Cvjz8DFX.js +0 -1
  141. package/assets/index-829Uxa3Y.css +0 -1
@@ -1,4 +1,4 @@
1
- import{l as Sr,B as oe,m as Bl,n as Pl,o as Ol,p as Fl,q as Pe,a as Cr,s as nr,t as kr,k as zu,b as de,u as Dl,g as ql}from"./index-Cu4ZjLNb.js";import{p as jl,a as $l}from"./hooks.module-CpBu4GjP.js";function Ul(e,n){for(var r=0;r<n.length;r++){const t=n[r];if(typeof t!="string"&&!Array.isArray(t)){for(const g in t)if(g!=="default"&&!(g in e)){const l=Object.getOwnPropertyDescriptor(t,g);l&&Object.defineProperty(e,g,l.get?l:{enumerable:!0,get:()=>t[g]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Cn={},_t={},vt={},so;function Hl(){if(so)return vt;so=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.walletLogo=void 0;const e=(n,r)=>{let t;switch(n){case"standard":return t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=r,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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.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.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 t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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.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"textWithLogoLight":return t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 `}};return vt.walletLogo=e,vt}var Et={},oo;function Wl(){return oo||(oo=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.LINK_API_URL=void 0,Et.LINK_API_URL="https://www.walletlink.org"),Et}var X={},kn={},ze={},ao;function Ir(){return ao||(ao=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.errorValues=ze.standardErrorCodes=void 0,ze.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}},ze.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."}}),ze}var Rt={},In={},co;function Ps(){return co||(co=1,(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 n=Ir(),r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function t(u,i=r){if(u&&Number.isInteger(u)){const p=u.toString();if(f(n.errorValues,p))return n.errorValues[p].message;if(h(u))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return i}e.getMessageFromCode=t;function g(u){if(!Number.isInteger(u))return!1;const i=u.toString();return!!(n.errorValues[i]||h(u))}e.isValidCode=g;function l(u){var i;if(typeof u=="number")return u;if(c(u))return(i=u.code)!==null&&i!==void 0?i:u.errorCode}e.getErrorCode=l;function c(u){return typeof u=="object"&&u!==null&&(typeof u.code=="number"||typeof u.errorCode=="number")}function o(u,{shouldIncludeStack:i=!1}={}){const p={};if(u&&typeof u=="object"&&!Array.isArray(u)&&f(u,"code")&&g(u.code)){const b=u;p.code=b.code,b.message&&typeof b.message=="string"?(p.message=b.message,f(b,"data")&&(p.data=b.data)):(p.message=t(p.code),p.data={originalError:d(u)})}else p.code=n.standardErrorCodes.rpc.internal,p.message=s(u,"message")?u.message:r,p.data={originalError:d(u)};return i&&(p.stack=s(u,"stack")?u.stack:void 0),p}e.serialize=o;function h(u){return u>=-32099&&u<=-32e3}function d(u){return u&&typeof u=="object"&&!Array.isArray(u)?Object.assign({},u):u}function f(u,i){return Object.prototype.hasOwnProperty.call(u,i)}function s(u,i){return typeof u=="object"&&u!==null&&i in u&&typeof u[i]=="string"}})(In)),In}var uo;function Vl(){if(uo)return Rt;uo=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.standardErrors=void 0;const e=Ir(),n=Ps();Rt.standardErrors={rpc:{parse:h=>r(e.standardErrorCodes.rpc.parse,h),invalidRequest:h=>r(e.standardErrorCodes.rpc.invalidRequest,h),invalidParams:h=>r(e.standardErrorCodes.rpc.invalidParams,h),methodNotFound:h=>r(e.standardErrorCodes.rpc.methodNotFound,h),internal:h=>r(e.standardErrorCodes.rpc.internal,h),server:h=>{if(!h||typeof h!="object"||Array.isArray(h))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:d}=h;if(!Number.isInteger(d)||d>-32005||d<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return r(d,h)},invalidInput:h=>r(e.standardErrorCodes.rpc.invalidInput,h),resourceNotFound:h=>r(e.standardErrorCodes.rpc.resourceNotFound,h),resourceUnavailable:h=>r(e.standardErrorCodes.rpc.resourceUnavailable,h),transactionRejected:h=>r(e.standardErrorCodes.rpc.transactionRejected,h),methodNotSupported:h=>r(e.standardErrorCodes.rpc.methodNotSupported,h),limitExceeded:h=>r(e.standardErrorCodes.rpc.limitExceeded,h)},provider:{userRejectedRequest:h=>t(e.standardErrorCodes.provider.userRejectedRequest,h),unauthorized:h=>t(e.standardErrorCodes.provider.unauthorized,h),unsupportedMethod:h=>t(e.standardErrorCodes.provider.unsupportedMethod,h),disconnected:h=>t(e.standardErrorCodes.provider.disconnected,h),chainDisconnected:h=>t(e.standardErrorCodes.provider.chainDisconnected,h),unsupportedChain:h=>t(e.standardErrorCodes.provider.unsupportedChain,h),custom:h=>{if(!h||typeof h!="object"||Array.isArray(h))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:d,message:f,data:s}=h;if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string');return new c(d,f,s)}}};function r(h,d){const[f,s]=g(d);return new l(h,f||(0,n.getMessageFromCode)(h),s)}function t(h,d){const[f,s]=g(d);return new c(h,f||(0,n.getMessageFromCode)(h),s)}function g(h){if(h){if(typeof h=="string")return[h];if(typeof h=="object"&&!Array.isArray(h)){const{message:d,data:f}=h;if(d&&typeof d!="string")throw new Error("Must specify string message.");return[d||void 0,f]}}return[]}class l extends Error{constructor(d,f,s){if(!Number.isInteger(d))throw new Error('"code" must be an integer.');if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string.');super(f),this.code=d,s!==void 0&&(this.data=s)}}class c extends l{constructor(d,f,s){if(!o(d))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(d,f,s)}}function o(h){return Number.isInteger(h)&&h>=1e3&&h<=4999}return Rt}var St={},Ct={},lo;function Os(){if(lo)return Ct;lo=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.isErrorResponse=void 0;function e(n){return n.errorMessage!==void 0}return Ct.isErrorResponse=e,Ct}var kt={},ho;function Fs(){return ho||(ho=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.LIB_VERSION=void 0,kt.LIB_VERSION="3.9.3"),kt}var fo;function zl(){if(fo)return St;fo=1,Object.defineProperty(St,"__esModule",{value:!0}),St.serializeError=void 0;const e=Os(),n=Fs(),r=Ir(),t=Ps();function g(o,h){const d=(0,t.serialize)(l(o),{shouldIncludeStack:!0}),f=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");f.searchParams.set("version",n.LIB_VERSION),f.searchParams.set("code",d.code.toString());const s=c(d.data,h);return s&&f.searchParams.set("method",s),f.searchParams.set("message",d.message),Object.assign(Object.assign({},d),{docUrl:f.href})}St.serializeError=g;function l(o){return typeof o=="string"?{message:o,code:r.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(o)?Object.assign(Object.assign({},o),{message:o.errorMessage,code:o.errorCode,data:{method:o.method}}):o}function c(o,h){const d=o?.method;if(d)return d;if(h!==void 0){if(typeof h=="string")return h;if(Array.isArray(h)){if(h.length>0)return h[0].method}else return h.method}}return St}var po;function Ar(){return po||(po=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const n=Ir();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return n.standardErrorCodes}});const r=Vl();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const t=zl();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}});const g=Ps();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return g.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return g.getMessageFromCode}})})(kn)),kn}var _e={},go;function xr(){if(go)return _e;go=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.ProviderType=_e.RegExpString=_e.IntNumber=_e.BigIntString=_e.AddressString=_e.HexString=_e.OpaqueType=void 0;function e(){return t=>t}_e.OpaqueType=e,_e.HexString=e(),_e.AddressString=e(),_e.BigIntString=e();function n(t){return Math.floor(t)}_e.IntNumber=n,_e.RegExpString=e();var r;return(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(r||(_e.ProviderType=r={})),_e}var mo;function Ue(){if(mo)return X;mo=1;var e=X&&X.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(X,"__esModule",{value:!0}),X.isMobileWeb=X.getLocation=X.isInIFrame=X.createQrUrl=X.getFavicon=X.range=X.isBigNumber=X.ensureParsedJSONObject=X.ensureBN=X.ensureRegExpString=X.ensureIntNumber=X.ensureBuffer=X.ensureAddressString=X.ensureEvenLengthHexString=X.ensureHexString=X.isHexString=X.prepend0x=X.strip0x=X.has0xPrefix=X.hexStringFromIntNumber=X.intNumberFromHexString=X.bigIntStringFromBN=X.hexStringFromBuffer=X.hexStringToUint8Array=X.uint8ArrayToHex=X.randomBytesHex=void 0;const n=e(Sr()),r=Ar(),t=xr(),g=/^[0-9]*$/,l=/^[a-f0-9]*$/;function c(T){return o(crypto.getRandomValues(new Uint8Array(T)))}X.randomBytesHex=c;function o(T){return[...T].map(O=>O.toString(16).padStart(2,"0")).join("")}X.uint8ArrayToHex=o;function h(T){return new Uint8Array(T.match(/.{1,2}/g).map(O=>parseInt(O,16)))}X.hexStringToUint8Array=h;function d(T,O=!1){const W=T.toString("hex");return(0,t.HexString)(O?`0x${W}`:W)}X.hexStringFromBuffer=d;function f(T){return(0,t.BigIntString)(T.toString(10))}X.bigIntStringFromBN=f;function s(T){return(0,t.IntNumber)(new n.default(w(T,!1),16).toNumber())}X.intNumberFromHexString=s;function u(T){return(0,t.HexString)(`0x${new n.default(T).toString(16)}`)}X.hexStringFromIntNumber=u;function i(T){return T.startsWith("0x")||T.startsWith("0X")}X.has0xPrefix=i;function p(T){return i(T)?T.slice(2):T}X.strip0x=p;function b(T){return i(T)?`0x${T.slice(2)}`:`0x${T}`}X.prepend0x=b;function m(T){if(typeof T!="string")return!1;const O=p(T).toLowerCase();return l.test(O)}X.isHexString=m;function a(T,O=!1){if(typeof T=="string"){const W=p(T).toLowerCase();if(l.test(W))return(0,t.HexString)(O?`0x${W}`:W)}throw r.standardErrors.rpc.invalidParams(`"${String(T)}" is not a hexadecimal string`)}X.ensureHexString=a;function w(T,O=!1){let W=a(T,!1);return W.length%2===1&&(W=(0,t.HexString)(`0${W}`)),O?(0,t.HexString)(`0x${W}`):W}X.ensureEvenLengthHexString=w;function v(T){if(typeof T=="string"){const O=p(T).toLowerCase();if(m(O)&&O.length===40)return(0,t.AddressString)(b(O))}throw r.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(T)}`)}X.ensureAddressString=v;function R(T){if(oe.isBuffer(T))return T;if(typeof T=="string"){if(m(T)){const O=w(T,!1);return oe.from(O,"hex")}return oe.from(T,"utf8")}throw r.standardErrors.rpc.invalidParams(`Not binary data: ${String(T)}`)}X.ensureBuffer=R;function S(T){if(typeof T=="number"&&Number.isInteger(T))return(0,t.IntNumber)(T);if(typeof T=="string"){if(g.test(T))return(0,t.IntNumber)(Number(T));if(m(T))return(0,t.IntNumber)(new n.default(w(T,!1),16).toNumber())}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(T)}`)}X.ensureIntNumber=S;function x(T){if(T instanceof RegExp)return(0,t.RegExpString)(T.toString());throw r.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(T)}`)}X.ensureRegExpString=x;function A(T){if(T!==null&&(n.default.isBN(T)||D(T)))return new n.default(T.toString(10),10);if(typeof T=="number")return new n.default(S(T));if(typeof T=="string"){if(g.test(T))return new n.default(T,10);if(m(T))return new n.default(w(T,!1),16)}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(T)}`)}X.ensureBN=A;function M(T){if(typeof T=="string")return JSON.parse(T);if(typeof T=="object")return T;throw r.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(T)}`)}X.ensureParsedJSONObject=M;function D(T){if(T==null||typeof T.constructor!="function")return!1;const{constructor:O}=T;return typeof O.config=="function"&&typeof O.EUCLID=="number"}X.isBigNumber=D;function V(T,O){return Array.from({length:O-T},(W,U)=>T+U)}X.range=V;function Z(){const T=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:O,host:W}=document.location,U=T?T.getAttribute("href"):null;return!U||U.startsWith("javascript:")||U.startsWith("vbscript:")?null:U.startsWith("http://")||U.startsWith("https://")||U.startsWith("data:")?U:U.startsWith("//")?O+U:`${O}//${W}${U}`}X.getFavicon=Z;function Y(T,O,W,U,G,Q){const J=U?"parent-id":"id",ee=new URLSearchParams({[J]:T,secret:O,server:W,v:G,chainId:Q.toString()}).toString();return`${W}/#/link?${ee}`}X.createQrUrl=Y;function ne(){try{return window.frameElement!==null}catch{return!1}}X.isInIFrame=ne;function H(){try{return ne()&&window.top?window.top.location:window.location}catch{return window.location}}X.getLocation=H;function F(){var T;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((T=window?.navigator)===null||T===void 0?void 0:T.userAgent)}return X.isMobileWeb=F,X}var It={},bo;function Jl(){if(bo)return It;bo=1,Object.defineProperty(It,"__esModule",{value:!0}),It.ScopedLocalStorage=void 0;let e=class{constructor(r){this.scope=r}setItem(r,t){localStorage.setItem(this.scopedKey(r),t)}getItem(r){return localStorage.getItem(this.scopedKey(r))}removeItem(r){localStorage.removeItem(this.scopedKey(r))}clear(){const r=this.scopedKey(""),t=[];for(let g=0;g<localStorage.length;g++){const l=localStorage.key(g);typeof l=="string"&&l.startsWith(r)&&t.push(l)}t.forEach(g=>localStorage.removeItem(g))}scopedKey(r){return`${this.scope}:${r}`}};return It.ScopedLocalStorage=e,It}var Je={},An={exports:{}},yo;function Gl(){return yo||(yo=1,(function(e){var n=Object.prototype.hasOwnProperty,r="~";function t(){}Object.create&&(t.prototype=Object.create(null),new t().__proto__||(r=!1));function g(h,d,f){this.fn=h,this.context=d,this.once=f||!1}function l(h,d,f,s,u){if(typeof f!="function")throw new TypeError("The listener must be a function");var i=new g(f,s||h,u),p=r?r+d:d;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],i]:h._events[p].push(i):(h._events[p]=i,h._eventsCount++),h}function c(h,d){--h._eventsCount===0?h._events=new t:delete h._events[d]}function o(){this._events=new t,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],f,s;if(this._eventsCount===0)return d;for(s in f=this._events)n.call(f,s)&&d.push(r?s.slice(1):s);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},o.prototype.listeners=function(d){var f=r?r+d:d,s=this._events[f];if(!s)return[];if(s.fn)return[s.fn];for(var u=0,i=s.length,p=new Array(i);u<i;u++)p[u]=s[u].fn;return p},o.prototype.listenerCount=function(d){var f=r?r+d:d,s=this._events[f];return s?s.fn?1:s.length:0},o.prototype.emit=function(d,f,s,u,i,p){var b=r?r+d:d;if(!this._events[b])return!1;var m=this._events[b],a=arguments.length,w,v;if(m.fn){switch(m.once&&this.removeListener(d,m.fn,void 0,!0),a){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,f),!0;case 3:return m.fn.call(m.context,f,s),!0;case 4:return m.fn.call(m.context,f,s,u),!0;case 5:return m.fn.call(m.context,f,s,u,i),!0;case 6:return m.fn.call(m.context,f,s,u,i,p),!0}for(v=1,w=new Array(a-1);v<a;v++)w[v-1]=arguments[v];m.fn.apply(m.context,w)}else{var R=m.length,S;for(v=0;v<R;v++)switch(m[v].once&&this.removeListener(d,m[v].fn,void 0,!0),a){case 1:m[v].fn.call(m[v].context);break;case 2:m[v].fn.call(m[v].context,f);break;case 3:m[v].fn.call(m[v].context,f,s);break;case 4:m[v].fn.call(m[v].context,f,s,u);break;default:if(!w)for(S=1,w=new Array(a-1);S<a;S++)w[S-1]=arguments[S];m[v].fn.apply(m[v].context,w)}}return!0},o.prototype.on=function(d,f,s){return l(this,d,f,s,!1)},o.prototype.once=function(d,f,s){return l(this,d,f,s,!0)},o.prototype.removeListener=function(d,f,s,u){var i=r?r+d:d;if(!this._events[i])return this;if(!f)return c(this,i),this;var p=this._events[i];if(p.fn)p.fn===f&&(!u||p.once)&&(!s||p.context===s)&&c(this,i);else{for(var b=0,m=[],a=p.length;b<a;b++)(p[b].fn!==f||u&&!p[b].once||s&&p[b].context!==s)&&m.push(p[b]);m.length?this._events[i]=m.length===1?m[0]:m:c(this,i)}return this},o.prototype.removeAllListeners=function(d){var f;return d?(f=r?r+d:d,this._events[f]&&c(this,f)):(this._events=new t,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(An)),An.exports}var At={},xt={},Tt={},wo;function Ds(){return wo||(wo=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.EVENTS=void 0,Tt.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"}),Tt}var Te={},_o;function qs(){if(_o)return Te;_o=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.RelayAbstract=Te.APP_VERSION_KEY=Te.LOCAL_STORAGE_ADDRESSES_KEY=Te.WALLET_USER_NAME_KEY=void 0;const e=Ar();Te.WALLET_USER_NAME_KEY="walletUsername",Te.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",Te.APP_VERSION_KEY="AppVersion";let n=class{async makeEthereumJSONRPCRequest(t,g){if(!g)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(g,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(l=>l.json()).then(l=>{if(!l)throw e.standardErrors.rpc.parse({});const c=l,{error:o}=c;if(o)throw(0,e.serializeError)(o,t.method);return c})}};return Te.RelayAbstract=n,Te}var Lt={},xn={exports:{}},cr={exports:{}},Tn={},Mt={},vo;function Zl(){if(vo)return Mt;vo=1,Mt.byteLength=o,Mt.toByteArray=d,Mt.fromByteArray=u;for(var e=[],n=[],r=typeof Uint8Array<"u"?Uint8Array:Array,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=0,l=t.length;g<l;++g)e[g]=t[g],n[t.charCodeAt(g)]=g;n[45]=62,n[95]=63;function c(i){var p=i.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=i.indexOf("=");b===-1&&(b=p);var m=b===p?0:4-b%4;return[b,m]}function o(i){var p=c(i),b=p[0],m=p[1];return(b+m)*3/4-m}function h(i,p,b){return(p+b)*3/4-b}function d(i){var p,b=c(i),m=b[0],a=b[1],w=new r(h(i,m,a)),v=0,R=a>0?m-4:m,S;for(S=0;S<R;S+=4)p=n[i.charCodeAt(S)]<<18|n[i.charCodeAt(S+1)]<<12|n[i.charCodeAt(S+2)]<<6|n[i.charCodeAt(S+3)],w[v++]=p>>16&255,w[v++]=p>>8&255,w[v++]=p&255;return a===2&&(p=n[i.charCodeAt(S)]<<2|n[i.charCodeAt(S+1)]>>4,w[v++]=p&255),a===1&&(p=n[i.charCodeAt(S)]<<10|n[i.charCodeAt(S+1)]<<4|n[i.charCodeAt(S+2)]>>2,w[v++]=p>>8&255,w[v++]=p&255),w}function f(i){return e[i>>18&63]+e[i>>12&63]+e[i>>6&63]+e[i&63]}function s(i,p,b){for(var m,a=[],w=p;w<b;w+=3)m=(i[w]<<16&16711680)+(i[w+1]<<8&65280)+(i[w+2]&255),a.push(f(m));return a.join("")}function u(i){for(var p,b=i.length,m=b%3,a=[],w=16383,v=0,R=b-m;v<R;v+=w)a.push(s(i,v,v+w>R?R:v+w));return m===1?(p=i[b-1],a.push(e[p>>2]+e[p<<4&63]+"==")):m===2&&(p=(i[b-2]<<8)+i[b-1],a.push(e[p>>10]+e[p>>4&63]+e[p<<2&63]+"=")),a.join("")}return Mt}var ur={};var Eo;function Kl(){return Eo||(Eo=1,ur.read=function(e,n,r,t,g){var l,c,o=g*8-t-1,h=(1<<o)-1,d=h>>1,f=-7,s=r?g-1:0,u=r?-1:1,i=e[n+s];for(s+=u,l=i&(1<<-f)-1,i>>=-f,f+=o;f>0;l=l*256+e[n+s],s+=u,f-=8);for(c=l&(1<<-f)-1,l>>=-f,f+=t;f>0;c=c*256+e[n+s],s+=u,f-=8);if(l===0)l=1-d;else{if(l===h)return c?NaN:(i?-1:1)*(1/0);c=c+Math.pow(2,t),l=l-d}return(i?-1:1)*c*Math.pow(2,l-t)},ur.write=function(e,n,r,t,g,l){var c,o,h,d=l*8-g-1,f=(1<<d)-1,s=f>>1,u=g===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=t?0:l-1,p=t?1:-1,b=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(o=isNaN(n)?1:0,c=f):(c=Math.floor(Math.log(n)/Math.LN2),n*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+s>=1?n+=u/h:n+=u*Math.pow(2,1-s),n*h>=2&&(c++,h/=2),c+s>=f?(o=0,c=f):c+s>=1?(o=(n*h-1)*Math.pow(2,g),c=c+s):(o=n*Math.pow(2,s-1)*Math.pow(2,g),c=0));g>=8;e[r+i]=o&255,i+=p,o/=256,g-=8);for(c=c<<g|o,d+=g;d>0;e[r+i]=c&255,i+=p,c/=256,d-=8);e[r+i-p]|=b*128}),ur}var Ro;function Tr(){return Ro||(Ro=1,(function(e){const n=Zl(),r=Kl(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=w,e.INSPECT_MAX_BYTES=50;const g=2147483647;e.kMaxLength=g,o.TYPED_ARRAY_SUPPORT=l(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const E=new Uint8Array(1),y={foo:function(){return 42}};return Object.setPrototypeOf(y,Uint8Array.prototype),Object.setPrototypeOf(E,y),E.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function c(E){if(E>g)throw new RangeError('The value "'+E+'" is invalid for option "size"');const y=new Uint8Array(E);return Object.setPrototypeOf(y,o.prototype),y}function o(E,y,_){if(typeof E=="number"){if(typeof y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return s(E)}return h(E,y,_)}o.poolSize=8192;function h(E,y,_){if(typeof E=="string")return u(E,y);if(ArrayBuffer.isView(E))return p(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(me(E,ArrayBuffer)||E&&me(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(E,SharedArrayBuffer)||E&&me(E.buffer,SharedArrayBuffer)))return b(E,y,_);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const C=E.valueOf&&E.valueOf();if(C!=null&&C!==E)return o.from(C,y,_);const L=m(E);if(L)return L;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return o.from(E[Symbol.toPrimitive]("string"),y,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}o.from=function(E,y,_){return h(E,y,_)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function d(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function f(E,y,_){return d(E),E<=0?c(E):y!==void 0?typeof _=="string"?c(E).fill(y,_):c(E).fill(y):c(E)}o.alloc=function(E,y,_){return f(E,y,_)};function s(E){return d(E),c(E<0?0:a(E)|0)}o.allocUnsafe=function(E){return s(E)},o.allocUnsafeSlow=function(E){return s(E)};function u(E,y){if((typeof y!="string"||y==="")&&(y="utf8"),!o.isEncoding(y))throw new TypeError("Unknown encoding: "+y);const _=v(E,y)|0;let C=c(_);const L=C.write(E,y);return L!==_&&(C=C.slice(0,L)),C}function i(E){const y=E.length<0?0:a(E.length)|0,_=c(y);for(let C=0;C<y;C+=1)_[C]=E[C]&255;return _}function p(E){if(me(E,Uint8Array)){const y=new Uint8Array(E);return b(y.buffer,y.byteOffset,y.byteLength)}return i(E)}function b(E,y,_){if(y<0||E.byteLength<y)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<y+(_||0))throw new RangeError('"length" is outside of buffer bounds');let C;return y===void 0&&_===void 0?C=new Uint8Array(E):_===void 0?C=new Uint8Array(E,y):C=new Uint8Array(E,y,_),Object.setPrototypeOf(C,o.prototype),C}function m(E){if(o.isBuffer(E)){const y=a(E.length)|0,_=c(y);return _.length===0||E.copy(_,0,0,y),_}if(E.length!==void 0)return typeof E.length!="number"||ke(E.length)?c(0):i(E);if(E.type==="Buffer"&&Array.isArray(E.data))return i(E.data)}function a(E){if(E>=g)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+g.toString(16)+" bytes");return E|0}function w(E){return+E!=E&&(E=0),o.alloc(+E)}o.isBuffer=function(y){return y!=null&&y._isBuffer===!0&&y!==o.prototype},o.compare=function(y,_){if(me(y,Uint8Array)&&(y=o.from(y,y.offset,y.byteLength)),me(_,Uint8Array)&&(_=o.from(_,_.offset,_.byteLength)),!o.isBuffer(y)||!o.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(y===_)return 0;let C=y.length,L=_.length;for(let P=0,q=Math.min(C,L);P<q;++P)if(y[P]!==_[P]){C=y[P],L=_[P];break}return C<L?-1:L<C?1:0},o.isEncoding=function(y){switch(String(y).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(y,_){if(!Array.isArray(y))throw new TypeError('"list" argument must be an Array of Buffers');if(y.length===0)return o.alloc(0);let C;if(_===void 0)for(_=0,C=0;C<y.length;++C)_+=y[C].length;const L=o.allocUnsafe(_);let P=0;for(C=0;C<y.length;++C){let q=y[C];if(me(q,Uint8Array))P+q.length>L.length?(o.isBuffer(q)||(q=o.from(q)),q.copy(L,P)):Uint8Array.prototype.set.call(L,q,P);else if(o.isBuffer(q))q.copy(L,P);else throw new TypeError('"list" argument must be an Array of Buffers');P+=q.length}return L};function v(E,y){if(o.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||me(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const _=E.length,C=arguments.length>2&&arguments[2]===!0;if(!C&&_===0)return 0;let L=!1;for(;;)switch(y){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return ce(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return xe(E).length;default:if(L)return C?-1:ce(E).length;y=(""+y).toLowerCase(),L=!0}}o.byteLength=v;function R(E,y,_){let C=!1;if((y===void 0||y<0)&&(y=0),y>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,y>>>=0,_<=y))return"";for(E||(E="utf8");;)switch(E){case"hex":return U(this,y,_);case"utf8":case"utf-8":return H(this,y,_);case"ascii":return O(this,y,_);case"latin1":case"binary":return W(this,y,_);case"base64":return ne(this,y,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,y,_);default:if(C)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),C=!0}}o.prototype._isBuffer=!0;function S(E,y,_){const C=E[y];E[y]=E[_],E[_]=C}o.prototype.swap16=function(){const y=this.length;if(y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let _=0;_<y;_+=2)S(this,_,_+1);return this},o.prototype.swap32=function(){const y=this.length;if(y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let _=0;_<y;_+=4)S(this,_,_+3),S(this,_+1,_+2);return this},o.prototype.swap64=function(){const y=this.length;if(y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let _=0;_<y;_+=8)S(this,_,_+7),S(this,_+1,_+6),S(this,_+2,_+5),S(this,_+3,_+4);return this},o.prototype.toString=function(){const y=this.length;return y===0?"":arguments.length===0?H(this,0,y):R.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(y){if(!o.isBuffer(y))throw new TypeError("Argument must be a Buffer");return this===y?!0:o.compare(this,y)===0},o.prototype.inspect=function(){let y="";const _=e.INSPECT_MAX_BYTES;return y=this.toString("hex",0,_).replace(/(.{2})/g,"$1 ").trim(),this.length>_&&(y+=" ... "),"<Buffer "+y+">"},t&&(o.prototype[t]=o.prototype.inspect),o.prototype.compare=function(y,_,C,L,P){if(me(y,Uint8Array)&&(y=o.from(y,y.offset,y.byteLength)),!o.isBuffer(y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof y);if(_===void 0&&(_=0),C===void 0&&(C=y?y.length:0),L===void 0&&(L=0),P===void 0&&(P=this.length),_<0||C>y.length||L<0||P>this.length)throw new RangeError("out of range index");if(L>=P&&_>=C)return 0;if(L>=P)return-1;if(_>=C)return 1;if(_>>>=0,C>>>=0,L>>>=0,P>>>=0,this===y)return 0;let q=P-L,se=C-_;const pe=Math.min(q,se),fe=this.slice(L,P),ge=y.slice(_,C);for(let le=0;le<pe;++le)if(fe[le]!==ge[le]){q=fe[le],se=ge[le];break}return q<se?-1:se<q?1:0};function x(E,y,_,C,L){if(E.length===0)return-1;if(typeof _=="string"?(C=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,ke(_)&&(_=L?0:E.length-1),_<0&&(_=E.length+_),_>=E.length){if(L)return-1;_=E.length-1}else if(_<0)if(L)_=0;else return-1;if(typeof y=="string"&&(y=o.from(y,C)),o.isBuffer(y))return y.length===0?-1:A(E,y,_,C,L);if(typeof y=="number")return y=y&255,typeof Uint8Array.prototype.indexOf=="function"?L?Uint8Array.prototype.indexOf.call(E,y,_):Uint8Array.prototype.lastIndexOf.call(E,y,_):A(E,[y],_,C,L);throw new TypeError("val must be string, number or Buffer")}function A(E,y,_,C,L){let P=1,q=E.length,se=y.length;if(C!==void 0&&(C=String(C).toLowerCase(),C==="ucs2"||C==="ucs-2"||C==="utf16le"||C==="utf-16le")){if(E.length<2||y.length<2)return-1;P=2,q/=2,se/=2,_/=2}function pe(ge,le){return P===1?ge[le]:ge.readUInt16BE(le*P)}let fe;if(L){let ge=-1;for(fe=_;fe<q;fe++)if(pe(E,fe)===pe(y,ge===-1?0:fe-ge)){if(ge===-1&&(ge=fe),fe-ge+1===se)return ge*P}else ge!==-1&&(fe-=fe-ge),ge=-1}else for(_+se>q&&(_=q-se),fe=_;fe>=0;fe--){let ge=!0;for(let le=0;le<se;le++)if(pe(E,fe+le)!==pe(y,le)){ge=!1;break}if(ge)return fe}return-1}o.prototype.includes=function(y,_,C){return this.indexOf(y,_,C)!==-1},o.prototype.indexOf=function(y,_,C){return x(this,y,_,C,!0)},o.prototype.lastIndexOf=function(y,_,C){return x(this,y,_,C,!1)};function M(E,y,_,C){_=Number(_)||0;const L=E.length-_;C?(C=Number(C),C>L&&(C=L)):C=L;const P=y.length;C>P/2&&(C=P/2);let q;for(q=0;q<C;++q){const se=parseInt(y.substr(q*2,2),16);if(ke(se))return q;E[_+q]=se}return q}function D(E,y,_,C){return be(ce(y,E.length-_),E,_,C)}function V(E,y,_,C){return be(Re(y),E,_,C)}function Z(E,y,_,C){return be(xe(y),E,_,C)}function Y(E,y,_,C){return be(Ae(y,E.length-_),E,_,C)}o.prototype.write=function(y,_,C,L){if(_===void 0)L="utf8",C=this.length,_=0;else if(C===void 0&&typeof _=="string")L=_,C=this.length,_=0;else if(isFinite(_))_=_>>>0,isFinite(C)?(C=C>>>0,L===void 0&&(L="utf8")):(L=C,C=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const P=this.length-_;if((C===void 0||C>P)&&(C=P),y.length>0&&(C<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");L||(L="utf8");let q=!1;for(;;)switch(L){case"hex":return M(this,y,_,C);case"utf8":case"utf-8":return D(this,y,_,C);case"ascii":case"latin1":case"binary":return V(this,y,_,C);case"base64":return Z(this,y,_,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,y,_,C);default:if(q)throw new TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),q=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(E,y,_){return y===0&&_===E.length?n.fromByteArray(E):n.fromByteArray(E.slice(y,_))}function H(E,y,_){_=Math.min(E.length,_);const C=[];let L=y;for(;L<_;){const P=E[L];let q=null,se=P>239?4:P>223?3:P>191?2:1;if(L+se<=_){let pe,fe,ge,le;switch(se){case 1:P<128&&(q=P);break;case 2:pe=E[L+1],(pe&192)===128&&(le=(P&31)<<6|pe&63,le>127&&(q=le));break;case 3:pe=E[L+1],fe=E[L+2],(pe&192)===128&&(fe&192)===128&&(le=(P&15)<<12|(pe&63)<<6|fe&63,le>2047&&(le<55296||le>57343)&&(q=le));break;case 4:pe=E[L+1],fe=E[L+2],ge=E[L+3],(pe&192)===128&&(fe&192)===128&&(ge&192)===128&&(le=(P&15)<<18|(pe&63)<<12|(fe&63)<<6|ge&63,le>65535&&le<1114112&&(q=le))}}q===null?(q=65533,se=1):q>65535&&(q-=65536,C.push(q>>>10&1023|55296),q=56320|q&1023),C.push(q),L+=se}return T(C)}const F=4096;function T(E){const y=E.length;if(y<=F)return String.fromCharCode.apply(String,E);let _="",C=0;for(;C<y;)_+=String.fromCharCode.apply(String,E.slice(C,C+=F));return _}function O(E,y,_){let C="";_=Math.min(E.length,_);for(let L=y;L<_;++L)C+=String.fromCharCode(E[L]&127);return C}function W(E,y,_){let C="";_=Math.min(E.length,_);for(let L=y;L<_;++L)C+=String.fromCharCode(E[L]);return C}function U(E,y,_){const C=E.length;(!y||y<0)&&(y=0),(!_||_<0||_>C)&&(_=C);let L="";for(let P=y;P<_;++P)L+=De[E[P]];return L}function G(E,y,_){const C=E.slice(y,_);let L="";for(let P=0;P<C.length-1;P+=2)L+=String.fromCharCode(C[P]+C[P+1]*256);return L}o.prototype.slice=function(y,_){const C=this.length;y=~~y,_=_===void 0?C:~~_,y<0?(y+=C,y<0&&(y=0)):y>C&&(y=C),_<0?(_+=C,_<0&&(_=0)):_>C&&(_=C),_<y&&(_=y);const L=this.subarray(y,_);return Object.setPrototypeOf(L,o.prototype),L};function Q(E,y,_){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+y>_)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(y,_,C){y=y>>>0,_=_>>>0,C||Q(y,_,this.length);let L=this[y],P=1,q=0;for(;++q<_&&(P*=256);)L+=this[y+q]*P;return L},o.prototype.readUintBE=o.prototype.readUIntBE=function(y,_,C){y=y>>>0,_=_>>>0,C||Q(y,_,this.length);let L=this[y+--_],P=1;for(;_>0&&(P*=256);)L+=this[y+--_]*P;return L},o.prototype.readUint8=o.prototype.readUInt8=function(y,_){return y=y>>>0,_||Q(y,1,this.length),this[y]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(y,_){return y=y>>>0,_||Q(y,2,this.length),this[y]|this[y+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(y,_){return y=y>>>0,_||Q(y,2,this.length),this[y]<<8|this[y+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),(this[y]|this[y+1]<<8|this[y+2]<<16)+this[y+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),this[y]*16777216+(this[y+1]<<16|this[y+2]<<8|this[y+3])},o.prototype.readBigUInt64LE=ve(function(y){y=y>>>0,$(y,"offset");const _=this[y],C=this[y+7];(_===void 0||C===void 0)&&z(y,this.length-8);const L=_+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24,P=this[++y]+this[++y]*2**8+this[++y]*2**16+C*2**24;return BigInt(L)+(BigInt(P)<<BigInt(32))}),o.prototype.readBigUInt64BE=ve(function(y){y=y>>>0,$(y,"offset");const _=this[y],C=this[y+7];(_===void 0||C===void 0)&&z(y,this.length-8);const L=_*2**24+this[++y]*2**16+this[++y]*2**8+this[++y],P=this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+C;return(BigInt(L)<<BigInt(32))+BigInt(P)}),o.prototype.readIntLE=function(y,_,C){y=y>>>0,_=_>>>0,C||Q(y,_,this.length);let L=this[y],P=1,q=0;for(;++q<_&&(P*=256);)L+=this[y+q]*P;return P*=128,L>=P&&(L-=Math.pow(2,8*_)),L},o.prototype.readIntBE=function(y,_,C){y=y>>>0,_=_>>>0,C||Q(y,_,this.length);let L=_,P=1,q=this[y+--L];for(;L>0&&(P*=256);)q+=this[y+--L]*P;return P*=128,q>=P&&(q-=Math.pow(2,8*_)),q},o.prototype.readInt8=function(y,_){return y=y>>>0,_||Q(y,1,this.length),this[y]&128?(255-this[y]+1)*-1:this[y]},o.prototype.readInt16LE=function(y,_){y=y>>>0,_||Q(y,2,this.length);const C=this[y]|this[y+1]<<8;return C&32768?C|4294901760:C},o.prototype.readInt16BE=function(y,_){y=y>>>0,_||Q(y,2,this.length);const C=this[y+1]|this[y]<<8;return C&32768?C|4294901760:C},o.prototype.readInt32LE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),this[y]|this[y+1]<<8|this[y+2]<<16|this[y+3]<<24},o.prototype.readInt32BE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),this[y]<<24|this[y+1]<<16|this[y+2]<<8|this[y+3]},o.prototype.readBigInt64LE=ve(function(y){y=y>>>0,$(y,"offset");const _=this[y],C=this[y+7];(_===void 0||C===void 0)&&z(y,this.length-8);const L=this[y+4]+this[y+5]*2**8+this[y+6]*2**16+(C<<24);return(BigInt(L)<<BigInt(32))+BigInt(_+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24)}),o.prototype.readBigInt64BE=ve(function(y){y=y>>>0,$(y,"offset");const _=this[y],C=this[y+7];(_===void 0||C===void 0)&&z(y,this.length-8);const L=(_<<24)+this[++y]*2**16+this[++y]*2**8+this[++y];return(BigInt(L)<<BigInt(32))+BigInt(this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+C)}),o.prototype.readFloatLE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),r.read(this,y,!0,23,4)},o.prototype.readFloatBE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),r.read(this,y,!1,23,4)},o.prototype.readDoubleLE=function(y,_){return y=y>>>0,_||Q(y,8,this.length),r.read(this,y,!0,52,8)},o.prototype.readDoubleBE=function(y,_){return y=y>>>0,_||Q(y,8,this.length),r.read(this,y,!1,52,8)};function J(E,y,_,C,L,P){if(!o.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(y>L||y<P)throw new RangeError('"value" argument is out of bounds');if(_+C>E.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(y,_,C,L){if(y=+y,_=_>>>0,C=C>>>0,!L){const se=Math.pow(2,8*C)-1;J(this,y,_,C,se,0)}let P=1,q=0;for(this[_]=y&255;++q<C&&(P*=256);)this[_+q]=y/P&255;return _+C},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(y,_,C,L){if(y=+y,_=_>>>0,C=C>>>0,!L){const se=Math.pow(2,8*C)-1;J(this,y,_,C,se,0)}let P=C-1,q=1;for(this[_+P]=y&255;--P>=0&&(q*=256);)this[_+P]=y/q&255;return _+C},o.prototype.writeUint8=o.prototype.writeUInt8=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,1,255,0),this[_]=y&255,_+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,2,65535,0),this[_]=y&255,this[_+1]=y>>>8,_+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,2,65535,0),this[_]=y>>>8,this[_+1]=y&255,_+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,4,4294967295,0),this[_+3]=y>>>24,this[_+2]=y>>>16,this[_+1]=y>>>8,this[_]=y&255,_+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,4,4294967295,0),this[_]=y>>>24,this[_+1]=y>>>16,this[_+2]=y>>>8,this[_+3]=y&255,_+4};function ee(E,y,_,C,L){I(y,C,L,E,_,7);let P=Number(y&BigInt(4294967295));E[_++]=P,P=P>>8,E[_++]=P,P=P>>8,E[_++]=P,P=P>>8,E[_++]=P;let q=Number(y>>BigInt(32)&BigInt(4294967295));return E[_++]=q,q=q>>8,E[_++]=q,q=q>>8,E[_++]=q,q=q>>8,E[_++]=q,_}function ae(E,y,_,C,L){I(y,C,L,E,_,7);let P=Number(y&BigInt(4294967295));E[_+7]=P,P=P>>8,E[_+6]=P,P=P>>8,E[_+5]=P,P=P>>8,E[_+4]=P;let q=Number(y>>BigInt(32)&BigInt(4294967295));return E[_+3]=q,q=q>>8,E[_+2]=q,q=q>>8,E[_+1]=q,q=q>>8,E[_]=q,_+8}o.prototype.writeBigUInt64LE=ve(function(y,_=0){return ee(this,y,_,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=ve(function(y,_=0){return ae(this,y,_,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(y,_,C,L){if(y=+y,_=_>>>0,!L){const pe=Math.pow(2,8*C-1);J(this,y,_,C,pe-1,-pe)}let P=0,q=1,se=0;for(this[_]=y&255;++P<C&&(q*=256);)y<0&&se===0&&this[_+P-1]!==0&&(se=1),this[_+P]=(y/q>>0)-se&255;return _+C},o.prototype.writeIntBE=function(y,_,C,L){if(y=+y,_=_>>>0,!L){const pe=Math.pow(2,8*C-1);J(this,y,_,C,pe-1,-pe)}let P=C-1,q=1,se=0;for(this[_+P]=y&255;--P>=0&&(q*=256);)y<0&&se===0&&this[_+P+1]!==0&&(se=1),this[_+P]=(y/q>>0)-se&255;return _+C},o.prototype.writeInt8=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,1,127,-128),y<0&&(y=255+y+1),this[_]=y&255,_+1},o.prototype.writeInt16LE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,2,32767,-32768),this[_]=y&255,this[_+1]=y>>>8,_+2},o.prototype.writeInt16BE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,2,32767,-32768),this[_]=y>>>8,this[_+1]=y&255,_+2},o.prototype.writeInt32LE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,4,2147483647,-2147483648),this[_]=y&255,this[_+1]=y>>>8,this[_+2]=y>>>16,this[_+3]=y>>>24,_+4},o.prototype.writeInt32BE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,4,2147483647,-2147483648),y<0&&(y=4294967295+y+1),this[_]=y>>>24,this[_+1]=y>>>16,this[_+2]=y>>>8,this[_+3]=y&255,_+4},o.prototype.writeBigInt64LE=ve(function(y,_=0){return ee(this,y,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=ve(function(y,_=0){return ae(this,y,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function te(E,y,_,C,L,P){if(_+C>E.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function B(E,y,_,C,L){return y=+y,_=_>>>0,L||te(E,y,_,4),r.write(E,y,_,C,23,4),_+4}o.prototype.writeFloatLE=function(y,_,C){return B(this,y,_,!0,C)},o.prototype.writeFloatBE=function(y,_,C){return B(this,y,_,!1,C)};function N(E,y,_,C,L){return y=+y,_=_>>>0,L||te(E,y,_,8),r.write(E,y,_,C,52,8),_+8}o.prototype.writeDoubleLE=function(y,_,C){return N(this,y,_,!0,C)},o.prototype.writeDoubleBE=function(y,_,C){return N(this,y,_,!1,C)},o.prototype.copy=function(y,_,C,L){if(!o.isBuffer(y))throw new TypeError("argument should be a Buffer");if(C||(C=0),!L&&L!==0&&(L=this.length),_>=y.length&&(_=y.length),_||(_=0),L>0&&L<C&&(L=C),L===C||y.length===0||this.length===0)return 0;if(_<0)throw new RangeError("targetStart out of bounds");if(C<0||C>=this.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("sourceEnd out of bounds");L>this.length&&(L=this.length),y.length-_<L-C&&(L=y.length-_+C);const P=L-C;return this===y&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(_,C,L):Uint8Array.prototype.set.call(y,this.subarray(C,L),_),P},o.prototype.fill=function(y,_,C,L){if(typeof y=="string"){if(typeof _=="string"?(L=_,_=0,C=this.length):typeof C=="string"&&(L=C,C=this.length),L!==void 0&&typeof L!="string")throw new TypeError("encoding must be a string");if(typeof L=="string"&&!o.isEncoding(L))throw new TypeError("Unknown encoding: "+L);if(y.length===1){const q=y.charCodeAt(0);(L==="utf8"&&q<128||L==="latin1")&&(y=q)}}else typeof y=="number"?y=y&255:typeof y=="boolean"&&(y=Number(y));if(_<0||this.length<_||this.length<C)throw new RangeError("Out of range index");if(C<=_)return this;_=_>>>0,C=C===void 0?this.length:C>>>0,y||(y=0);let P;if(typeof y=="number")for(P=_;P<C;++P)this[P]=y;else{const q=o.isBuffer(y)?y:o.from(y,L),se=q.length;if(se===0)throw new TypeError('The value "'+y+'" is invalid for argument "value"');for(P=0;P<C-_;++P)this[P+_]=q[P%se]}return this};const j={};function K(E,y,_){j[E]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(L){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:L,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(E,y){return`The "${E}" argument must be of type number. Received type ${typeof y}`},TypeError),K("ERR_OUT_OF_RANGE",function(E,y,_){let C=`The value of "${E}" is out of range.`,L=_;return Number.isInteger(_)&&Math.abs(_)>2**32?L=re(String(_)):typeof _=="bigint"&&(L=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(L=re(L)),L+="n"),C+=` It must be ${y}. Received ${L}`,C},RangeError);function re(E){let y="",_=E.length;const C=E[0]==="-"?1:0;for(;_>=C+4;_-=3)y=`_${E.slice(_-3,_)}${y}`;return`${E.slice(0,_)}${y}`}function k(E,y,_){$(y,"offset"),(E[y]===void 0||E[y+_]===void 0)&&z(y,E.length-(_+1))}function I(E,y,_,C,L,P){if(E>_||E<y){const q=typeof y=="bigint"?"n":"";let se;throw y===0||y===BigInt(0)?se=`>= 0${q} and < 2${q} ** ${(P+1)*8}${q}`:se=`>= -(2${q} ** ${(P+1)*8-1}${q}) and < 2 ** ${(P+1)*8-1}${q}`,new j.ERR_OUT_OF_RANGE("value",se,E)}k(C,L,P)}function $(E,y){if(typeof E!="number")throw new j.ERR_INVALID_ARG_TYPE(y,"number",E)}function z(E,y,_){throw Math.floor(E)!==E?($(E,_),new j.ERR_OUT_OF_RANGE("offset","an integer",E)):y<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${y}`,E)}const he=/[^+/0-9A-Za-z-_]/g;function ie(E){if(E=E.split("=")[0],E=E.trim().replace(he,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function ce(E,y){y=y||1/0;let _;const C=E.length;let L=null;const P=[];for(let q=0;q<C;++q){if(_=E.charCodeAt(q),_>55295&&_<57344){if(!L){if(_>56319){(y-=3)>-1&&P.push(239,191,189);continue}else if(q+1===C){(y-=3)>-1&&P.push(239,191,189);continue}L=_;continue}if(_<56320){(y-=3)>-1&&P.push(239,191,189),L=_;continue}_=(L-55296<<10|_-56320)+65536}else L&&(y-=3)>-1&&P.push(239,191,189);if(L=null,_<128){if((y-=1)<0)break;P.push(_)}else if(_<2048){if((y-=2)<0)break;P.push(_>>6|192,_&63|128)}else if(_<65536){if((y-=3)<0)break;P.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((y-=4)<0)break;P.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return P}function Re(E){const y=[];for(let _=0;_<E.length;++_)y.push(E.charCodeAt(_)&255);return y}function Ae(E,y){let _,C,L;const P=[];for(let q=0;q<E.length&&!((y-=2)<0);++q)_=E.charCodeAt(q),C=_>>8,L=_%256,P.push(L),P.push(C);return P}function xe(E){return n.toByteArray(ie(E))}function be(E,y,_,C){let L;for(L=0;L<C&&!(L+_>=y.length||L>=E.length);++L)y[L+_]=E[L];return L}function me(E,y){return E instanceof y||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===y.name}function ke(E){return E!==E}const De=(function(){const E="0123456789abcdef",y=new Array(256);for(let _=0;_<16;++_){const C=_*16;for(let L=0;L<16;++L)y[C+L]=E[_]+E[L]}return y})();function ve(E){return typeof BigInt>"u"?qe:E}function qe(){throw new Error("BigInt not supported")}})(Tn)),Tn}var So;function He(){return So||(So=1,(function(e,n){var r=Tr(),t=r.Buffer;function g(c,o){for(var h in c)o[h]=c[h]}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?e.exports=r:(g(r,n),n.Buffer=l);function l(c,o,h){return t(c,o,h)}l.prototype=Object.create(t.prototype),g(t,l),l.from=function(c,o,h){if(typeof c=="number")throw new TypeError("Argument must not be a number");return t(c,o,h)},l.alloc=function(c,o,h){if(typeof c!="number")throw new TypeError("Argument must be a number");var d=t(c);return o!==void 0?typeof h=="string"?d.fill(o,h):d.fill(o):d.fill(0),d},l.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return t(c)},l.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(c)}})(cr,cr.exports)),cr.exports}var Ln,Co;function Ql(){if(Co)return Ln;Co=1;var e=Bl();return Ln=function(r){return!!e(r)},Ln}var Mn,ko;function Yl(){if(ko)return Mn;ko=1;var e=Ol(),n=Pl(),r=n("TypedArray.prototype.buffer",!0),t=Ql();return Mn=r||function(l){if(!t(l))throw new e("Not a Typed Array");return l.buffer},Mn}var Nn,Io;function Xl(){if(Io)return Nn;Io=1;var e=He().Buffer,n=Fl(),r=Yl(),t=ArrayBuffer.isView||function(h){try{return r(h),!0}catch{return!1}},g=typeof Uint8Array<"u",l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",c=l&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return Nn=function(h,d){if(e.isBuffer(h))return h.constructor&&!("isBuffer"in h)?e.from(h):h;if(typeof h=="string")return e.from(h,d);if(l&&t(h)){if(h.byteLength===0)return e.alloc(0);if(c){var f=e.from(h.buffer,h.byteOffset,h.byteLength);if(f.byteLength===h.byteLength)return f}var s=h instanceof Uint8Array?h:new Uint8Array(h.buffer,h.byteOffset,h.byteLength),u=e.from(s);if(u.length===h.byteLength)return u}if(g&&h instanceof Uint8Array)return e.from(h);var i=n(h);if(i)for(var p=0;p<h.length;p+=1){var b=h[p];if(typeof b!="number"||b<0||b>255||~~b!==b)throw new RangeError("Array items must be numbers in the range 0-255.")}if(i||e.isBuffer(h)&&h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return e.from(h);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Nn}var Bn,Ao;function mt(){if(Ao)return Bn;Ao=1;var e=He().Buffer,n=Xl();function r(t,g){this._block=e.alloc(t),this._finalSize=g,this._blockSize=t,this._len=0}return r.prototype.update=function(t,g){t=n(t,g||"utf8");for(var l=this._block,c=this._blockSize,o=t.length,h=this._len,d=0;d<o;){for(var f=h%c,s=Math.min(o-d,c-f),u=0;u<s;u++)l[f+u]=t[d+u];h+=s,d+=s,h%c===0&&this._update(l)}return this._len+=o,this},r.prototype.digest=function(t){var g=this._len%this._blockSize;this._block[g]=128,this._block.fill(0,g+1),g>=this._finalSize&&(this._update(this._block),this._block.fill(0));var l=this._len*8;if(l<=4294967295)this._block.writeUInt32BE(l,this._blockSize-4);else{var c=(l&4294967295)>>>0,o=(l-c)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(c,this._blockSize-4)}this._update(this._block);var h=this._hash();return t?h.toString(t):h},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},Bn=r,Bn}var Pn,xo;function ed(){if(xo)return Pn;xo=1;var e=Pe(),n=mt(),r=He().Buffer,t=[1518500249,1859775393,-1894007588,-899497514],g=new Array(80);function l(){this.init(),this._w=g,n.call(this,64,56)}e(l,n),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function c(d){return d<<5|d>>>27}function o(d){return d<<30|d>>>2}function h(d,f,s,u){return d===0?f&s|~f&u:d===2?f&s|f&u|s&u:f^s^u}return l.prototype._update=function(d){for(var f=this._w,s=this._a|0,u=this._b|0,i=this._c|0,p=this._d|0,b=this._e|0,m=0;m<16;++m)f[m]=d.readInt32BE(m*4);for(;m<80;++m)f[m]=f[m-3]^f[m-8]^f[m-14]^f[m-16];for(var a=0;a<80;++a){var w=~~(a/20),v=c(s)+h(w,u,i,p)+b+f[a]+t[w]|0;b=p,p=i,i=o(u),u=s,s=v}this._a=s+this._a|0,this._b=u+this._b|0,this._c=i+this._c|0,this._d=p+this._d|0,this._e=b+this._e|0},l.prototype._hash=function(){var d=r.allocUnsafe(20);return d.writeInt32BE(this._a|0,0),d.writeInt32BE(this._b|0,4),d.writeInt32BE(this._c|0,8),d.writeInt32BE(this._d|0,12),d.writeInt32BE(this._e|0,16),d},Pn=l,Pn}var On,To;function td(){if(To)return On;To=1;var e=Pe(),n=mt(),r=He().Buffer,t=[1518500249,1859775393,-1894007588,-899497514],g=new Array(80);function l(){this.init(),this._w=g,n.call(this,64,56)}e(l,n),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function c(f){return f<<1|f>>>31}function o(f){return f<<5|f>>>27}function h(f){return f<<30|f>>>2}function d(f,s,u,i){return f===0?s&u|~s&i:f===2?s&u|s&i|u&i:s^u^i}return l.prototype._update=function(f){for(var s=this._w,u=this._a|0,i=this._b|0,p=this._c|0,b=this._d|0,m=this._e|0,a=0;a<16;++a)s[a]=f.readInt32BE(a*4);for(;a<80;++a)s[a]=c(s[a-3]^s[a-8]^s[a-14]^s[a-16]);for(var w=0;w<80;++w){var v=~~(w/20),R=o(u)+d(v,i,p,b)+m+s[w]+t[v]|0;m=b,b=p,p=h(i),i=u,u=R}this._a=u+this._a|0,this._b=i+this._b|0,this._c=p+this._c|0,this._d=b+this._d|0,this._e=m+this._e|0},l.prototype._hash=function(){var f=r.allocUnsafe(20);return f.writeInt32BE(this._a|0,0),f.writeInt32BE(this._b|0,4),f.writeInt32BE(this._c|0,8),f.writeInt32BE(this._d|0,12),f.writeInt32BE(this._e|0,16),f},On=l,On}var Fn,Lo;function Ju(){if(Lo)return Fn;Lo=1;var e=Pe(),n=mt(),r=He().Buffer,t=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=new Array(64);function l(){this.init(),this._w=g,n.call(this,64,56)}e(l,n),l.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function c(u,i,p){return p^u&(i^p)}function o(u,i,p){return u&i|p&(u|i)}function h(u){return(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10)}function d(u){return(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7)}function f(u){return(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3}function s(u){return(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10}return l.prototype._update=function(u){for(var i=this._w,p=this._a|0,b=this._b|0,m=this._c|0,a=this._d|0,w=this._e|0,v=this._f|0,R=this._g|0,S=this._h|0,x=0;x<16;++x)i[x]=u.readInt32BE(x*4);for(;x<64;++x)i[x]=s(i[x-2])+i[x-7]+f(i[x-15])+i[x-16]|0;for(var A=0;A<64;++A){var M=S+d(w)+c(w,v,R)+t[A]+i[A]|0,D=h(p)+o(p,b,m)|0;S=R,R=v,v=w,w=a+M|0,a=m,m=b,b=p,p=M+D|0}this._a=p+this._a|0,this._b=b+this._b|0,this._c=m+this._c|0,this._d=a+this._d|0,this._e=w+this._e|0,this._f=v+this._f|0,this._g=R+this._g|0,this._h=S+this._h|0},l.prototype._hash=function(){var u=r.allocUnsafe(32);return u.writeInt32BE(this._a,0),u.writeInt32BE(this._b,4),u.writeInt32BE(this._c,8),u.writeInt32BE(this._d,12),u.writeInt32BE(this._e,16),u.writeInt32BE(this._f,20),u.writeInt32BE(this._g,24),u.writeInt32BE(this._h,28),u},Fn=l,Fn}var Dn,Mo;function rd(){if(Mo)return Dn;Mo=1;var e=Pe(),n=Ju(),r=mt(),t=He().Buffer,g=new Array(64);function l(){this.init(),this._w=g,r.call(this,64,56)}return e(l,n),l.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},l.prototype._hash=function(){var c=t.allocUnsafe(28);return c.writeInt32BE(this._a,0),c.writeInt32BE(this._b,4),c.writeInt32BE(this._c,8),c.writeInt32BE(this._d,12),c.writeInt32BE(this._e,16),c.writeInt32BE(this._f,20),c.writeInt32BE(this._g,24),c},Dn=l,Dn}var qn,No;function Gu(){if(No)return qn;No=1;var e=Pe(),n=mt(),r=He().Buffer,t=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],g=new Array(160);function l(){this.init(),this._w=g,n.call(this,128,112)}e(l,n),l.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function c(b,m,a){return a^b&(m^a)}function o(b,m,a){return b&m|a&(b|m)}function h(b,m){return(b>>>28|m<<4)^(m>>>2|b<<30)^(m>>>7|b<<25)}function d(b,m){return(b>>>14|m<<18)^(b>>>18|m<<14)^(m>>>9|b<<23)}function f(b,m){return(b>>>1|m<<31)^(b>>>8|m<<24)^b>>>7}function s(b,m){return(b>>>1|m<<31)^(b>>>8|m<<24)^(b>>>7|m<<25)}function u(b,m){return(b>>>19|m<<13)^(m>>>29|b<<3)^b>>>6}function i(b,m){return(b>>>19|m<<13)^(m>>>29|b<<3)^(b>>>6|m<<26)}function p(b,m){return b>>>0<m>>>0?1:0}return l.prototype._update=function(b){for(var m=this._w,a=this._ah|0,w=this._bh|0,v=this._ch|0,R=this._dh|0,S=this._eh|0,x=this._fh|0,A=this._gh|0,M=this._hh|0,D=this._al|0,V=this._bl|0,Z=this._cl|0,Y=this._dl|0,ne=this._el|0,H=this._fl|0,F=this._gl|0,T=this._hl|0,O=0;O<32;O+=2)m[O]=b.readInt32BE(O*4),m[O+1]=b.readInt32BE(O*4+4);for(;O<160;O+=2){var W=m[O-30],U=m[O-30+1],G=f(W,U),Q=s(U,W);W=m[O-4],U=m[O-4+1];var J=u(W,U),ee=i(U,W),ae=m[O-14],te=m[O-14+1],B=m[O-32],N=m[O-32+1],j=Q+te|0,K=G+ae+p(j,Q)|0;j=j+ee|0,K=K+J+p(j,ee)|0,j=j+N|0,K=K+B+p(j,N)|0,m[O]=K,m[O+1]=j}for(var re=0;re<160;re+=2){K=m[re],j=m[re+1];var k=o(a,w,v),I=o(D,V,Z),$=h(a,D),z=h(D,a),he=d(S,ne),ie=d(ne,S),ce=t[re],Re=t[re+1],Ae=c(S,x,A),xe=c(ne,H,F),be=T+ie|0,me=M+he+p(be,T)|0;be=be+xe|0,me=me+Ae+p(be,xe)|0,be=be+Re|0,me=me+ce+p(be,Re)|0,be=be+j|0,me=me+K+p(be,j)|0;var ke=z+I|0,De=$+k+p(ke,z)|0;M=A,T=F,A=x,F=H,x=S,H=ne,ne=Y+be|0,S=R+me+p(ne,Y)|0,R=v,Y=Z,v=w,Z=V,w=a,V=D,D=be+ke|0,a=me+De+p(D,be)|0}this._al=this._al+D|0,this._bl=this._bl+V|0,this._cl=this._cl+Z|0,this._dl=this._dl+Y|0,this._el=this._el+ne|0,this._fl=this._fl+H|0,this._gl=this._gl+F|0,this._hl=this._hl+T|0,this._ah=this._ah+a+p(this._al,D)|0,this._bh=this._bh+w+p(this._bl,V)|0,this._ch=this._ch+v+p(this._cl,Z)|0,this._dh=this._dh+R+p(this._dl,Y)|0,this._eh=this._eh+S+p(this._el,ne)|0,this._fh=this._fh+x+p(this._fl,H)|0,this._gh=this._gh+A+p(this._gl,F)|0,this._hh=this._hh+M+p(this._hl,T)|0},l.prototype._hash=function(){var b=r.allocUnsafe(64);function m(a,w,v){b.writeInt32BE(a,v),b.writeInt32BE(w,v+4)}return m(this._ah,this._al,0),m(this._bh,this._bl,8),m(this._ch,this._cl,16),m(this._dh,this._dl,24),m(this._eh,this._el,32),m(this._fh,this._fl,40),m(this._gh,this._gl,48),m(this._hh,this._hl,56),b},qn=l,qn}var jn,Bo;function nd(){if(Bo)return jn;Bo=1;var e=Pe(),n=Gu(),r=mt(),t=He().Buffer,g=new Array(160);function l(){this.init(),this._w=g,r.call(this,128,112)}return e(l,n),l.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},l.prototype._hash=function(){var c=t.allocUnsafe(48);function o(h,d,f){c.writeInt32BE(h,f),c.writeInt32BE(d,f+4)}return o(this._ah,this._al,0),o(this._bh,this._bl,8),o(this._ch,this._cl,16),o(this._dh,this._dl,24),o(this._eh,this._el,32),o(this._fh,this._fl,40),c},jn=l,jn}var Po;function id(){return Po||(Po=1,(function(e){e.exports=function(r){var t=r.toLowerCase(),g=e.exports[t];if(!g)throw new Error(t+" is not supported (we accept pull requests)");return new g},e.exports.sha=ed(),e.exports.sha1=td(),e.exports.sha224=rd(),e.exports.sha256=Ju(),e.exports.sha384=nd(),e.exports.sha512=Gu()})(xn)),xn.exports}var Oo;function js(){if(Oo)return Lt;Oo=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.Session=void 0;const e=id(),n=Ue(),r="session:id",t="session:secret",g="session:linked";let l=class Zu{constructor(o,h,d,f){this._storage=o,this._id=h||(0,n.randomBytesHex)(16),this._secret=d||(0,n.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!f}static load(o){const h=o.getItem(r),d=o.getItem(g),f=o.getItem(t);return h&&f?new Zu(o,h,f,d==="1"):null}static hash(o){return new e.sha256().update(o).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(o){this._linked=o,this.persistLinked()}save(){return this._storage.setItem(r,this._id),this._storage.setItem(t,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(g,this._linked?"1":"0")}};return Lt.Session=l,Lt}var Nt={},Bt={},Fo;function sd(){if(Fo)return Bt;Fo=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Cipher=void 0;const e=Ue();let n=class{constructor(t){this.secret=t}async encrypt(t){const g=this.secret;if(g.length!==64)throw Error("secret must be 256 bits");const l=crypto.getRandomValues(new Uint8Array(12)),c=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(g),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=new TextEncoder,h=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:l},c,o.encode(t)),d=16,f=h.slice(h.byteLength-d),s=h.slice(0,h.byteLength-d),u=new Uint8Array(f),i=new Uint8Array(s),p=new Uint8Array([...l,...u,...i]);return(0,e.uint8ArrayToHex)(p)}async decrypt(t){const g=this.secret;if(g.length!==64)throw Error("secret must be 256 bits");return new Promise((l,c)=>{(async function(){const o=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(g),{name:"aes-gcm"},!1,["encrypt","decrypt"]),h=(0,e.hexStringToUint8Array)(t),d=h.slice(0,12),f=h.slice(12,28),s=h.slice(28),u=new Uint8Array([...s,...f]),i={name:"AES-GCM",iv:new Uint8Array(d)};try{const p=await window.crypto.subtle.decrypt(i,o,u),b=new TextDecoder;l(b.decode(p))}catch(p){c(p)}})()})}};return Bt.Cipher=n,Bt}var Pt={},Do;function od(){if(Do)return Pt;Do=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.WalletLinkHTTP=void 0;let e=class{constructor(r,t,g){this.linkAPIUrl=r,this.sessionId=t;const l=`${t}:${g}`;this.auth=`Basic ${btoa(l)}`}async markUnseenEventsAsSeen(r){return Promise.all(r.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var r;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:g,error:l}=await t.json();if(l)throw new Error(`Check unseen events failed: ${l}`);const c=(r=g?.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&r!==void 0?r:[];return this.markUnseenEventsAsSeen(c),c}throw new Error(`Check unseen events failed: ${t.status}`)}};return Pt.WalletLinkHTTP=e,Pt}var Ge={},qo;function ad(){if(qo)return Ge;qo=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.WalletLinkWebSocket=Ge.ConnectionState=void 0;var e;(function(r){r[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"})(e||(Ge.ConnectionState=e={}));let n=class{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,g=WebSocket){this.WebSocketClass=g,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,g)=>{var l;let c;try{this.webSocket=c=new this.WebSocketClass(this.url)}catch(o){g(o);return}(l=this.connectionStateListener)===null||l===void 0||l.call(this,e.CONNECTING),c.onclose=o=>{var h;this.clearWebSocket(),g(new Error(`websocket error ${o.code}: ${o.reason}`)),(h=this.connectionStateListener)===null||h===void 0||h.call(this,e.DISCONNECTED)},c.onopen=o=>{var h;t(),(h=this.connectionStateListener)===null||h===void 0||h.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(f=>this.sendData(f)),this.pendingData=[])},c.onmessage=o=>{var h,d;if(o.data==="h")(h=this.incomingDataListener)===null||h===void 0||h.call(this,{type:"Heartbeat"});else try{const f=JSON.parse(o.data);(d=this.incomingDataListener)===null||d===void 0||d.call(this,f)}catch{}}})}disconnect(){var t;const{webSocket:g}=this;if(g){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{g.close()}catch{}}}sendData(t){const{webSocket:g}=this;if(!g){this.pendingData.push(t),this.connect();return}g.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};return Ge.WalletLinkWebSocket=n,Ge}var jo;function cd(){if(jo)return Nt;jo=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.WalletLinkConnection=void 0;const e=xr(),n=sd(),r=Ds(),t=qs(),g=js(),l=od(),c=ad(),o=1e4,h=6e4;let d=class{constructor({session:s,linkAPIUrl:u,listener:i,diagnostic:p,WebSocketClass:b=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.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",v=>a.JsonRpcUrl&&this.handleChainUpdated(v,a.JsonRpcUrl)]]).forEach((v,R)=>{const S=a[R];S!==void 0&&v(S)})},this.handleDestroyed=a=>{var w,v;a==="1"&&((w=this.listener)===null||w===void 0||w.resetAndReload(),(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:g.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var w,v;try{const R=await this.cipher.decrypt(a);(w=this.listener)===null||w===void 0||w.accountUpdated(R)}catch{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,w)=>{var v,R;try{const S=await this.cipher.decrypt(w);(v=this.listener)===null||v===void 0||v.metadataUpdated(a,S)}catch{(R=this.diagnostic)===null||R===void 0||R.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(t.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(t.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,w)=>{var v,R;try{const S=await this.cipher.decrypt(a),x=await this.cipher.decrypt(w);(v=this.listener)===null||v===void 0||v.chainUpdated(S,x)}catch{(R=this.diagnostic)===null||R===void 0||R.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=s,this.cipher=new n.Cipher(s.secret),this.diagnostic=p,this.listener=i;const m=new c.WalletLinkWebSocket(`${u}/rpc`,b);m.setConnectionStateListener(async a=>{var w;(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:g.Session.hash(s.id)});let v=!1;switch(a){case c.ConnectionState.DISCONNECTED:if(!this.destroyed){const R=async()=>{await new Promise(S=>setTimeout(S,5e3)),this.destroyed||m.connect().catch(()=>{R()})};R()}break;case c.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),v=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},o),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case c.ConnectionState.CONNECTING:break}this.connected!==v&&(this.connected=v)}),m.setIncomingDataListener(a=>{var w,v,R;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const S=a.type==="IsLinkedOK"?a.linked:void 0;(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.LINKED,{sessionIdHash:g.Session.hash(s.id),linked:S,type:a.type,onlineGuests:a.onlineGuests}),this.linked=S||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:g.Session.hash(s.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&&((R=this.requestResolutions.get(a.id))===null||R===void 0||R(a))}),this.ws=m,this.http=new l.WalletLinkHTTP(u,s.id,s.key)}connect(){var s;if(this.destroyed)throw new Error("instance is destroyed");(s=this.diagnostic)===null||s===void 0||s.log(r.EVENTS.STARTED_CONNECTING,{sessionIdHash:g.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var s;this.destroyed=!0,this.ws.disconnect(),(s=this.diagnostic)===null||s===void 0||s.log(r.EVENTS.DISCONNECTED,{sessionIdHash:g.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(s){var u,i;this._connected=s,s&&((u=this.onceConnected)===null||u===void 0||u.call(this)),(i=this.listener)===null||i===void 0||i.connectedUpdated(s)}setOnceConnected(s){return new Promise(u=>{this.connected?s().then(u):this.onceConnected=()=>{s().then(u),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(s){var u,i;this._linked=s,s&&((u=this.onceLinked)===null||u===void 0||u.call(this)),(i=this.listener)===null||i===void 0||i.linkedUpdated(s)}setOnceLinked(s){return new Promise(u=>{this.linked?s().then(u):this.onceLinked=()=>{s().then(u),this.onceLinked=void 0}})}async handleIncomingEvent(s){var u,i;if(!(s.type!=="Event"||s.event!=="Web3Response"))try{const p=await this.cipher.decrypt(s.data),b=JSON.parse(p);if(b.type!=="WEB3_RESPONSE")return;(u=this.listener)===null||u===void 0||u.handleWeb3ResponseMessage(b)}catch{(i=this.diagnostic)===null||i===void 0||i.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(s=>setTimeout(s,250));try{await this.fetchUnseenEventsAPI()}catch(s){console.error("Unable to check for unseen events",s)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(u=>this.handleIncomingEvent(u))}async setSessionMetadata(s,u){const i={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[s]:u}};return this.setOnceConnected(async()=>{const p=await this.makeRequest(i);if(p.type==="Fail")throw new Error(p.error||"failed to set session metadata")})}async publishEvent(s,u,i=!1){const p=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},u),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),b={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:s,data:p,callWebhook:i};return this.setOnceLinked(async()=>{const m=await this.makeRequest(b);if(m.type==="Fail")throw new Error(m.error||"failed to publish event");return m.eventId})}sendData(s){this.ws.sendData(JSON.stringify(s))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>o*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(s,u=h){const i=s.id;this.sendData(s);let p;return Promise.race([new Promise((b,m)=>{p=window.setTimeout(()=>{m(new Error(`request ${i} timed out`))},u)}),new Promise(b=>{this.requestResolutions.set(i,m=>{clearTimeout(p),b(m),this.requestResolutions.delete(i)})})])}async authenticate(){const s={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},u=await this.makeRequest(s);if(u.type==="Fail")throw new Error(u.error||"failed to authentcate")}sendIsLinked(){const s={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}sendGetSessionConfig(){const s={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}};return Nt.WalletLinkConnection=d,Nt}var Ot={},Ze={},lr={},$o;function ud(){return $o||($o=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.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}'),lr}var Uo;function Ku(){if(Uo)return Ze;Uo=1;var e=Ze&&Ze.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.injectCssReset=void 0;const n=e(ud());function r(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(n.default)),document.documentElement.appendChild(t)}return Ze.injectCssReset=r,Ze}var Ft={};const Se=Cr(jl);var Ke={};const Lr=Cr($l);var je={},Dt={},Ho;function ld(){if(Ho)return Dt;Ho=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.CloseIcon=void 0;const e=Se;function n(r){return(0,e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return Dt.CloseIcon=n,Dt}var qt={},Wo;function dd(){if(Wo)return qt;Wo=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.CoinbaseWalletRound=void 0;const e=Se;function n(r){return(0,e.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,e.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,e.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"}))}return qt.CoinbaseWalletRound=n,qt}var jt={},Vo;function hd(){if(Vo)return jt;Vo=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.QRCodeIcon=void 0;const e=Se;function n(r){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,e.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,e.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,e.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}return jt.QRCodeIcon=n,jt}var Qe={},$n,zo;function fd(){if(zo)return $n;zo=1;function e(i){this.mode=r.MODE_8BIT_BYTE,this.data=i,this.parsedData=[];for(var p=0,b=this.data.length;p<b;p++){var m=[],a=this.data.charCodeAt(p);a>65536?(m[0]=240|(a&1835008)>>>18,m[1]=128|(a&258048)>>>12,m[2]=128|(a&4032)>>>6,m[3]=128|a&63):a>2048?(m[0]=224|(a&61440)>>>12,m[1]=128|(a&4032)>>>6,m[2]=128|a&63):a>128?(m[0]=192|(a&1984)>>>6,m[1]=128|a&63):m[0]=a,this.parsedData.push(m)}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))}e.prototype={getLength:function(i){return this.parsedData.length},write:function(i){for(var p=0,b=this.parsedData.length;p<b;p++)i.put(this.parsedData[p],8)}};function n(i,p){this.typeNumber=i,this.errorCorrectLevel=p,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}n.prototype={addData:function(i){var p=new e(i);this.dataList.push(p),this.dataCache=null},isDark:function(i,p){if(i<0||this.moduleCount<=i||p<0||this.moduleCount<=p)throw new Error(i+","+p);return this.modules[i][p]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(i,p){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++){this.modules[b]=new Array(this.moduleCount);for(var m=0;m<this.moduleCount;m++)this.modules[b][m]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(i,p),this.typeNumber>=7&&this.setupTypeNumber(i),this.dataCache==null&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,p)},setupPositionProbePattern:function(i,p){for(var b=-1;b<=7;b++)if(!(i+b<=-1||this.moduleCount<=i+b))for(var m=-1;m<=7;m++)p+m<=-1||this.moduleCount<=p+m||(0<=b&&b<=6&&(m==0||m==6)||0<=m&&m<=6&&(b==0||b==6)||2<=b&&b<=4&&2<=m&&m<=4?this.modules[i+b][p+m]=!0:this.modules[i+b][p+m]=!1)},getBestMaskPattern:function(){for(var i=0,p=0,b=0;b<8;b++){this.makeImpl(!0,b);var m=l.getLostPoint(this);(b==0||i>m)&&(i=m,p=b)}return p},createMovieClip:function(i,p,b){var m=i.createEmptyMovieClip(p,b),a=1;this.make();for(var w=0;w<this.modules.length;w++)for(var v=w*a,R=0;R<this.modules[w].length;R++){var S=R*a,x=this.modules[w][R];x&&(m.beginFill(0,100),m.moveTo(S,v),m.lineTo(S+a,v),m.lineTo(S+a,v+a),m.lineTo(S,v+a),m.endFill())}return m},setupTimingPattern:function(){for(var i=8;i<this.moduleCount-8;i++)this.modules[i][6]==null&&(this.modules[i][6]=i%2==0);for(var p=8;p<this.moduleCount-8;p++)this.modules[6][p]==null&&(this.modules[6][p]=p%2==0)},setupPositionAdjustPattern:function(){for(var i=l.getPatternPosition(this.typeNumber),p=0;p<i.length;p++)for(var b=0;b<i.length;b++){var m=i[p],a=i[b];if(this.modules[m][a]==null)for(var w=-2;w<=2;w++)for(var v=-2;v<=2;v++)w==-2||w==2||v==-2||v==2||w==0&&v==0?this.modules[m+w][a+v]=!0:this.modules[m+w][a+v]=!1}},setupTypeNumber:function(i){for(var p=l.getBCHTypeNumber(this.typeNumber),b=0;b<18;b++){var m=!i&&(p>>b&1)==1;this.modules[Math.floor(b/3)][b%3+this.moduleCount-8-3]=m}for(var b=0;b<18;b++){var m=!i&&(p>>b&1)==1;this.modules[b%3+this.moduleCount-8-3][Math.floor(b/3)]=m}},setupTypeInfo:function(i,p){for(var b=this.errorCorrectLevel<<3|p,m=l.getBCHTypeInfo(b),a=0;a<15;a++){var w=!i&&(m>>a&1)==1;a<6?this.modules[a][8]=w:a<8?this.modules[a+1][8]=w:this.modules[this.moduleCount-15+a][8]=w}for(var a=0;a<15;a++){var w=!i&&(m>>a&1)==1;a<8?this.modules[8][this.moduleCount-a-1]=w:a<9?this.modules[8][15-a-1+1]=w:this.modules[8][15-a-1]=w}this.modules[this.moduleCount-8][8]=!i},mapData:function(i,p){for(var b=-1,m=this.moduleCount-1,a=7,w=0,v=this.moduleCount-1;v>0;v-=2)for(v==6&&v--;;){for(var R=0;R<2;R++)if(this.modules[m][v-R]==null){var S=!1;w<i.length&&(S=(i[w]>>>a&1)==1);var x=l.getMask(p,m,v-R);x&&(S=!S),this.modules[m][v-R]=S,a--,a==-1&&(w++,a=7)}if(m+=b,m<0||this.moduleCount<=m){m-=b,b=-b;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(i,p,b){for(var m=d.getRSBlocks(i,p),a=new f,w=0;w<b.length;w++){var v=b[w];a.put(v.mode,4),a.put(v.getLength(),l.getLengthInBits(v.mode,i)),v.write(a)}for(var R=0,w=0;w<m.length;w++)R+=m[w].dataCount;if(a.getLengthInBits()>R*8)throw new Error("code length overflow. ("+a.getLengthInBits()+">"+R*8+")");for(a.getLengthInBits()+4<=R*8&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=R*8||(a.put(n.PAD0,8),a.getLengthInBits()>=R*8));)a.put(n.PAD1,8);return n.createBytes(a,m)},n.createBytes=function(i,p){for(var b=0,m=0,a=0,w=new Array(p.length),v=new Array(p.length),R=0;R<p.length;R++){var S=p[R].dataCount,x=p[R].totalCount-S;m=Math.max(m,S),a=Math.max(a,x),w[R]=new Array(S);for(var A=0;A<w[R].length;A++)w[R][A]=255&i.buffer[A+b];b+=S;var M=l.getErrorCorrectPolynomial(x),D=new h(w[R],M.getLength()-1),V=D.mod(M);v[R]=new Array(M.getLength()-1);for(var A=0;A<v[R].length;A++){var Z=A+V.getLength()-v[R].length;v[R][A]=Z>=0?V.get(Z):0}}for(var Y=0,A=0;A<p.length;A++)Y+=p[A].totalCount;for(var ne=new Array(Y),H=0,A=0;A<m;A++)for(var R=0;R<p.length;R++)A<w[R].length&&(ne[H++]=w[R][A]);for(var A=0;A<a;A++)for(var R=0;R<p.length;R++)A<v[R].length&&(ne[H++]=v[R][A]);return ne};for(var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},g={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},l={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(i){for(var p=i<<10;l.getBCHDigit(p)-l.getBCHDigit(l.G15)>=0;)p^=l.G15<<l.getBCHDigit(p)-l.getBCHDigit(l.G15);return(i<<10|p)^l.G15_MASK},getBCHTypeNumber:function(i){for(var p=i<<12;l.getBCHDigit(p)-l.getBCHDigit(l.G18)>=0;)p^=l.G18<<l.getBCHDigit(p)-l.getBCHDigit(l.G18);return i<<12|p},getBCHDigit:function(i){for(var p=0;i!=0;)p++,i>>>=1;return p},getPatternPosition:function(i){return l.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,p,b){switch(i){case g.PATTERN000:return(p+b)%2==0;case g.PATTERN001:return p%2==0;case g.PATTERN010:return b%3==0;case g.PATTERN011:return(p+b)%3==0;case g.PATTERN100:return(Math.floor(p/2)+Math.floor(b/3))%2==0;case g.PATTERN101:return p*b%2+p*b%3==0;case g.PATTERN110:return(p*b%2+p*b%3)%2==0;case g.PATTERN111:return(p*b%3+(p+b)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){for(var p=new h([1],0),b=0;b<i;b++)p=p.multiply(new h([1,c.gexp(b)],0));return p},getLengthInBits:function(i,p){if(1<=p&&p<10)switch(i){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:return 8;case r.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(p<27)switch(i){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(p<41)switch(i){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+p)},getLostPoint:function(i){for(var p=i.getModuleCount(),b=0,m=0;m<p;m++)for(var a=0;a<p;a++){for(var w=0,v=i.isDark(m,a),R=-1;R<=1;R++)if(!(m+R<0||p<=m+R))for(var S=-1;S<=1;S++)a+S<0||p<=a+S||R==0&&S==0||v==i.isDark(m+R,a+S)&&w++;w>5&&(b+=3+w-5)}for(var m=0;m<p-1;m++)for(var a=0;a<p-1;a++){var x=0;i.isDark(m,a)&&x++,i.isDark(m+1,a)&&x++,i.isDark(m,a+1)&&x++,i.isDark(m+1,a+1)&&x++,(x==0||x==4)&&(b+=3)}for(var m=0;m<p;m++)for(var a=0;a<p-6;a++)i.isDark(m,a)&&!i.isDark(m,a+1)&&i.isDark(m,a+2)&&i.isDark(m,a+3)&&i.isDark(m,a+4)&&!i.isDark(m,a+5)&&i.isDark(m,a+6)&&(b+=40);for(var a=0;a<p;a++)for(var m=0;m<p-6;m++)i.isDark(m,a)&&!i.isDark(m+1,a)&&i.isDark(m+2,a)&&i.isDark(m+3,a)&&i.isDark(m+4,a)&&!i.isDark(m+5,a)&&i.isDark(m+6,a)&&(b+=40);for(var A=0,a=0;a<p;a++)for(var m=0;m<p;m++)i.isDark(m,a)&&A++;var M=Math.abs(100*A/p/p-50)/5;return b+=M*10,b}},c={glog:function(i){if(i<1)throw new Error("glog("+i+")");return c.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return c.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},o=0;o<8;o++)c.EXP_TABLE[o]=1<<o;for(var o=8;o<256;o++)c.EXP_TABLE[o]=c.EXP_TABLE[o-4]^c.EXP_TABLE[o-5]^c.EXP_TABLE[o-6]^c.EXP_TABLE[o-8];for(var o=0;o<255;o++)c.LOG_TABLE[c.EXP_TABLE[o]]=o;function h(i,p){if(i.length==null)throw new Error(i.length+"/"+p);for(var b=0;b<i.length&&i[b]==0;)b++;this.num=new Array(i.length-b+p);for(var m=0;m<i.length-b;m++)this.num[m]=i[m+b]}h.prototype={get:function(i){return this.num[i]},getLength:function(){return this.num.length},multiply:function(i){for(var p=new Array(this.getLength()+i.getLength()-1),b=0;b<this.getLength();b++)for(var m=0;m<i.getLength();m++)p[b+m]^=c.gexp(c.glog(this.get(b))+c.glog(i.get(m)));return new h(p,0)},mod:function(i){if(this.getLength()-i.getLength()<0)return this;for(var p=c.glog(this.get(0))-c.glog(i.get(0)),b=new Array(this.getLength()),m=0;m<this.getLength();m++)b[m]=this.get(m);for(var m=0;m<i.getLength();m++)b[m]^=c.gexp(c.glog(i.get(m))+p);return new h(b,0).mod(i)}};function d(i,p){this.totalCount=i,this.dataCount=p}d.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],[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]],d.getRSBlocks=function(i,p){var b=d.getRsBlockTable(i,p);if(b==null)throw new Error("bad rs block @ typeNumber:"+i+"/errorCorrectLevel:"+p);for(var m=b.length/3,a=[],w=0;w<m;w++)for(var v=b[w*3+0],R=b[w*3+1],S=b[w*3+2],x=0;x<v;x++)a.push(new d(R,S));return a},d.getRsBlockTable=function(i,p){switch(p){case t.L:return d.RS_BLOCK_TABLE[(i-1)*4+0];case t.M:return d.RS_BLOCK_TABLE[(i-1)*4+1];case t.Q:return d.RS_BLOCK_TABLE[(i-1)*4+2];case t.H:return d.RS_BLOCK_TABLE[(i-1)*4+3];default:return}};function f(){this.buffer=[],this.length=0}f.prototype={get:function(i){var p=Math.floor(i/8);return(this.buffer[p]>>>7-i%8&1)==1},put:function(i,p){for(var b=0;b<p;b++)this.putBit((i>>>p-b-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(i){var p=Math.floor(this.length/8);this.buffer.length<=p&&this.buffer.push(0),i&&(this.buffer[p]|=128>>>this.length%8),this.length++}};var s=[[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 u(i){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof i=="string"&&(i={content:i}),i)for(var p in i)this.options[p]=i[p];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 b(S){switch(S){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Error("Unknwon error correction level: "+S)}}function m(S,x){for(var A=a(S),M=1,D=0,V=0,Z=s.length;V<=Z;V++){var Y=s[V];if(!Y)throw new Error("Content too long: expected "+D+" but got "+A);switch(x){case"L":D=Y[0];break;case"M":D=Y[1];break;case"Q":D=Y[2];break;case"H":D=Y[3];break;default:throw new Error("Unknwon error correction level: "+x)}if(A<=D)break;M++}if(M>s.length)throw new Error("Content too long");return M}function a(S){var x=encodeURI(S).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return x.length+(x.length!=S?3:0)}var w=this.options.content,v=m(w,this.options.ecl),R=b(this.options.ecl);this.qrcode=new n(v,R),this.qrcode.addData(w),this.qrcode.make()}return u.prototype.svg=function(i){var p=this.options||{},b=this.qrcode.modules;typeof i>"u"&&(i={container:p.container||"svg"});for(var m=typeof p.pretty<"u"?!!p.pretty:!0,a=m?" ":"",w=m?`\r
1
+ import{l as Sr,B as oe,m as Bl,n as Pl,o as Ol,p as Fl,q as Pe,a as Cr,s as nr,t as kr,k as zu,b as de,u as Dl,g as ql}from"./index-CqbvjyBi.js";import{p as jl,a as $l}from"./hooks.module-CpBu4GjP.js";function Ul(e,n){for(var r=0;r<n.length;r++){const t=n[r];if(typeof t!="string"&&!Array.isArray(t)){for(const g in t)if(g!=="default"&&!(g in e)){const l=Object.getOwnPropertyDescriptor(t,g);l&&Object.defineProperty(e,g,l.get?l:{enumerable:!0,get:()=>t[g]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Cn={},_t={},vt={},so;function Hl(){if(so)return vt;so=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.walletLogo=void 0;const e=(n,r)=>{let t;switch(n){case"standard":return t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=r,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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.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.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 t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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.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"textWithLogoLight":return t=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 t=r,`data:image/svg+xml,%3Csvg width='${r}' height='${t}' 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 `}};return vt.walletLogo=e,vt}var Et={},oo;function Wl(){return oo||(oo=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.LINK_API_URL=void 0,Et.LINK_API_URL="https://www.walletlink.org"),Et}var X={},kn={},ze={},ao;function Ir(){return ao||(ao=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.errorValues=ze.standardErrorCodes=void 0,ze.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}},ze.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."}}),ze}var Rt={},In={},co;function Ps(){return co||(co=1,(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 n=Ir(),r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function t(u,i=r){if(u&&Number.isInteger(u)){const p=u.toString();if(f(n.errorValues,p))return n.errorValues[p].message;if(h(u))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return i}e.getMessageFromCode=t;function g(u){if(!Number.isInteger(u))return!1;const i=u.toString();return!!(n.errorValues[i]||h(u))}e.isValidCode=g;function l(u){var i;if(typeof u=="number")return u;if(c(u))return(i=u.code)!==null&&i!==void 0?i:u.errorCode}e.getErrorCode=l;function c(u){return typeof u=="object"&&u!==null&&(typeof u.code=="number"||typeof u.errorCode=="number")}function o(u,{shouldIncludeStack:i=!1}={}){const p={};if(u&&typeof u=="object"&&!Array.isArray(u)&&f(u,"code")&&g(u.code)){const b=u;p.code=b.code,b.message&&typeof b.message=="string"?(p.message=b.message,f(b,"data")&&(p.data=b.data)):(p.message=t(p.code),p.data={originalError:d(u)})}else p.code=n.standardErrorCodes.rpc.internal,p.message=s(u,"message")?u.message:r,p.data={originalError:d(u)};return i&&(p.stack=s(u,"stack")?u.stack:void 0),p}e.serialize=o;function h(u){return u>=-32099&&u<=-32e3}function d(u){return u&&typeof u=="object"&&!Array.isArray(u)?Object.assign({},u):u}function f(u,i){return Object.prototype.hasOwnProperty.call(u,i)}function s(u,i){return typeof u=="object"&&u!==null&&i in u&&typeof u[i]=="string"}})(In)),In}var uo;function Vl(){if(uo)return Rt;uo=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.standardErrors=void 0;const e=Ir(),n=Ps();Rt.standardErrors={rpc:{parse:h=>r(e.standardErrorCodes.rpc.parse,h),invalidRequest:h=>r(e.standardErrorCodes.rpc.invalidRequest,h),invalidParams:h=>r(e.standardErrorCodes.rpc.invalidParams,h),methodNotFound:h=>r(e.standardErrorCodes.rpc.methodNotFound,h),internal:h=>r(e.standardErrorCodes.rpc.internal,h),server:h=>{if(!h||typeof h!="object"||Array.isArray(h))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:d}=h;if(!Number.isInteger(d)||d>-32005||d<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return r(d,h)},invalidInput:h=>r(e.standardErrorCodes.rpc.invalidInput,h),resourceNotFound:h=>r(e.standardErrorCodes.rpc.resourceNotFound,h),resourceUnavailable:h=>r(e.standardErrorCodes.rpc.resourceUnavailable,h),transactionRejected:h=>r(e.standardErrorCodes.rpc.transactionRejected,h),methodNotSupported:h=>r(e.standardErrorCodes.rpc.methodNotSupported,h),limitExceeded:h=>r(e.standardErrorCodes.rpc.limitExceeded,h)},provider:{userRejectedRequest:h=>t(e.standardErrorCodes.provider.userRejectedRequest,h),unauthorized:h=>t(e.standardErrorCodes.provider.unauthorized,h),unsupportedMethod:h=>t(e.standardErrorCodes.provider.unsupportedMethod,h),disconnected:h=>t(e.standardErrorCodes.provider.disconnected,h),chainDisconnected:h=>t(e.standardErrorCodes.provider.chainDisconnected,h),unsupportedChain:h=>t(e.standardErrorCodes.provider.unsupportedChain,h),custom:h=>{if(!h||typeof h!="object"||Array.isArray(h))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:d,message:f,data:s}=h;if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string');return new c(d,f,s)}}};function r(h,d){const[f,s]=g(d);return new l(h,f||(0,n.getMessageFromCode)(h),s)}function t(h,d){const[f,s]=g(d);return new c(h,f||(0,n.getMessageFromCode)(h),s)}function g(h){if(h){if(typeof h=="string")return[h];if(typeof h=="object"&&!Array.isArray(h)){const{message:d,data:f}=h;if(d&&typeof d!="string")throw new Error("Must specify string message.");return[d||void 0,f]}}return[]}class l extends Error{constructor(d,f,s){if(!Number.isInteger(d))throw new Error('"code" must be an integer.');if(!f||typeof f!="string")throw new Error('"message" must be a nonempty string.');super(f),this.code=d,s!==void 0&&(this.data=s)}}class c extends l{constructor(d,f,s){if(!o(d))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(d,f,s)}}function o(h){return Number.isInteger(h)&&h>=1e3&&h<=4999}return Rt}var St={},Ct={},lo;function Os(){if(lo)return Ct;lo=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.isErrorResponse=void 0;function e(n){return n.errorMessage!==void 0}return Ct.isErrorResponse=e,Ct}var kt={},ho;function Fs(){return ho||(ho=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.LIB_VERSION=void 0,kt.LIB_VERSION="3.9.3"),kt}var fo;function zl(){if(fo)return St;fo=1,Object.defineProperty(St,"__esModule",{value:!0}),St.serializeError=void 0;const e=Os(),n=Fs(),r=Ir(),t=Ps();function g(o,h){const d=(0,t.serialize)(l(o),{shouldIncludeStack:!0}),f=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");f.searchParams.set("version",n.LIB_VERSION),f.searchParams.set("code",d.code.toString());const s=c(d.data,h);return s&&f.searchParams.set("method",s),f.searchParams.set("message",d.message),Object.assign(Object.assign({},d),{docUrl:f.href})}St.serializeError=g;function l(o){return typeof o=="string"?{message:o,code:r.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(o)?Object.assign(Object.assign({},o),{message:o.errorMessage,code:o.errorCode,data:{method:o.method}}):o}function c(o,h){const d=o?.method;if(d)return d;if(h!==void 0){if(typeof h=="string")return h;if(Array.isArray(h)){if(h.length>0)return h[0].method}else return h.method}}return St}var po;function Ar(){return po||(po=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const n=Ir();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return n.standardErrorCodes}});const r=Vl();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const t=zl();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}});const g=Ps();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return g.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return g.getMessageFromCode}})})(kn)),kn}var _e={},go;function xr(){if(go)return _e;go=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.ProviderType=_e.RegExpString=_e.IntNumber=_e.BigIntString=_e.AddressString=_e.HexString=_e.OpaqueType=void 0;function e(){return t=>t}_e.OpaqueType=e,_e.HexString=e(),_e.AddressString=e(),_e.BigIntString=e();function n(t){return Math.floor(t)}_e.IntNumber=n,_e.RegExpString=e();var r;return(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(r||(_e.ProviderType=r={})),_e}var mo;function Ue(){if(mo)return X;mo=1;var e=X&&X.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(X,"__esModule",{value:!0}),X.isMobileWeb=X.getLocation=X.isInIFrame=X.createQrUrl=X.getFavicon=X.range=X.isBigNumber=X.ensureParsedJSONObject=X.ensureBN=X.ensureRegExpString=X.ensureIntNumber=X.ensureBuffer=X.ensureAddressString=X.ensureEvenLengthHexString=X.ensureHexString=X.isHexString=X.prepend0x=X.strip0x=X.has0xPrefix=X.hexStringFromIntNumber=X.intNumberFromHexString=X.bigIntStringFromBN=X.hexStringFromBuffer=X.hexStringToUint8Array=X.uint8ArrayToHex=X.randomBytesHex=void 0;const n=e(Sr()),r=Ar(),t=xr(),g=/^[0-9]*$/,l=/^[a-f0-9]*$/;function c(T){return o(crypto.getRandomValues(new Uint8Array(T)))}X.randomBytesHex=c;function o(T){return[...T].map(O=>O.toString(16).padStart(2,"0")).join("")}X.uint8ArrayToHex=o;function h(T){return new Uint8Array(T.match(/.{1,2}/g).map(O=>parseInt(O,16)))}X.hexStringToUint8Array=h;function d(T,O=!1){const W=T.toString("hex");return(0,t.HexString)(O?`0x${W}`:W)}X.hexStringFromBuffer=d;function f(T){return(0,t.BigIntString)(T.toString(10))}X.bigIntStringFromBN=f;function s(T){return(0,t.IntNumber)(new n.default(w(T,!1),16).toNumber())}X.intNumberFromHexString=s;function u(T){return(0,t.HexString)(`0x${new n.default(T).toString(16)}`)}X.hexStringFromIntNumber=u;function i(T){return T.startsWith("0x")||T.startsWith("0X")}X.has0xPrefix=i;function p(T){return i(T)?T.slice(2):T}X.strip0x=p;function b(T){return i(T)?`0x${T.slice(2)}`:`0x${T}`}X.prepend0x=b;function m(T){if(typeof T!="string")return!1;const O=p(T).toLowerCase();return l.test(O)}X.isHexString=m;function a(T,O=!1){if(typeof T=="string"){const W=p(T).toLowerCase();if(l.test(W))return(0,t.HexString)(O?`0x${W}`:W)}throw r.standardErrors.rpc.invalidParams(`"${String(T)}" is not a hexadecimal string`)}X.ensureHexString=a;function w(T,O=!1){let W=a(T,!1);return W.length%2===1&&(W=(0,t.HexString)(`0${W}`)),O?(0,t.HexString)(`0x${W}`):W}X.ensureEvenLengthHexString=w;function v(T){if(typeof T=="string"){const O=p(T).toLowerCase();if(m(O)&&O.length===40)return(0,t.AddressString)(b(O))}throw r.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(T)}`)}X.ensureAddressString=v;function R(T){if(oe.isBuffer(T))return T;if(typeof T=="string"){if(m(T)){const O=w(T,!1);return oe.from(O,"hex")}return oe.from(T,"utf8")}throw r.standardErrors.rpc.invalidParams(`Not binary data: ${String(T)}`)}X.ensureBuffer=R;function S(T){if(typeof T=="number"&&Number.isInteger(T))return(0,t.IntNumber)(T);if(typeof T=="string"){if(g.test(T))return(0,t.IntNumber)(Number(T));if(m(T))return(0,t.IntNumber)(new n.default(w(T,!1),16).toNumber())}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(T)}`)}X.ensureIntNumber=S;function x(T){if(T instanceof RegExp)return(0,t.RegExpString)(T.toString());throw r.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(T)}`)}X.ensureRegExpString=x;function A(T){if(T!==null&&(n.default.isBN(T)||D(T)))return new n.default(T.toString(10),10);if(typeof T=="number")return new n.default(S(T));if(typeof T=="string"){if(g.test(T))return new n.default(T,10);if(m(T))return new n.default(w(T,!1),16)}throw r.standardErrors.rpc.invalidParams(`Not an integer: ${String(T)}`)}X.ensureBN=A;function M(T){if(typeof T=="string")return JSON.parse(T);if(typeof T=="object")return T;throw r.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(T)}`)}X.ensureParsedJSONObject=M;function D(T){if(T==null||typeof T.constructor!="function")return!1;const{constructor:O}=T;return typeof O.config=="function"&&typeof O.EUCLID=="number"}X.isBigNumber=D;function V(T,O){return Array.from({length:O-T},(W,U)=>T+U)}X.range=V;function Z(){const T=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:O,host:W}=document.location,U=T?T.getAttribute("href"):null;return!U||U.startsWith("javascript:")||U.startsWith("vbscript:")?null:U.startsWith("http://")||U.startsWith("https://")||U.startsWith("data:")?U:U.startsWith("//")?O+U:`${O}//${W}${U}`}X.getFavicon=Z;function Y(T,O,W,U,G,Q){const J=U?"parent-id":"id",ee=new URLSearchParams({[J]:T,secret:O,server:W,v:G,chainId:Q.toString()}).toString();return`${W}/#/link?${ee}`}X.createQrUrl=Y;function ne(){try{return window.frameElement!==null}catch{return!1}}X.isInIFrame=ne;function H(){try{return ne()&&window.top?window.top.location:window.location}catch{return window.location}}X.getLocation=H;function F(){var T;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((T=window?.navigator)===null||T===void 0?void 0:T.userAgent)}return X.isMobileWeb=F,X}var It={},bo;function Jl(){if(bo)return It;bo=1,Object.defineProperty(It,"__esModule",{value:!0}),It.ScopedLocalStorage=void 0;let e=class{constructor(r){this.scope=r}setItem(r,t){localStorage.setItem(this.scopedKey(r),t)}getItem(r){return localStorage.getItem(this.scopedKey(r))}removeItem(r){localStorage.removeItem(this.scopedKey(r))}clear(){const r=this.scopedKey(""),t=[];for(let g=0;g<localStorage.length;g++){const l=localStorage.key(g);typeof l=="string"&&l.startsWith(r)&&t.push(l)}t.forEach(g=>localStorage.removeItem(g))}scopedKey(r){return`${this.scope}:${r}`}};return It.ScopedLocalStorage=e,It}var Je={},An={exports:{}},yo;function Gl(){return yo||(yo=1,(function(e){var n=Object.prototype.hasOwnProperty,r="~";function t(){}Object.create&&(t.prototype=Object.create(null),new t().__proto__||(r=!1));function g(h,d,f){this.fn=h,this.context=d,this.once=f||!1}function l(h,d,f,s,u){if(typeof f!="function")throw new TypeError("The listener must be a function");var i=new g(f,s||h,u),p=r?r+d:d;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],i]:h._events[p].push(i):(h._events[p]=i,h._eventsCount++),h}function c(h,d){--h._eventsCount===0?h._events=new t:delete h._events[d]}function o(){this._events=new t,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],f,s;if(this._eventsCount===0)return d;for(s in f=this._events)n.call(f,s)&&d.push(r?s.slice(1):s);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},o.prototype.listeners=function(d){var f=r?r+d:d,s=this._events[f];if(!s)return[];if(s.fn)return[s.fn];for(var u=0,i=s.length,p=new Array(i);u<i;u++)p[u]=s[u].fn;return p},o.prototype.listenerCount=function(d){var f=r?r+d:d,s=this._events[f];return s?s.fn?1:s.length:0},o.prototype.emit=function(d,f,s,u,i,p){var b=r?r+d:d;if(!this._events[b])return!1;var m=this._events[b],a=arguments.length,w,v;if(m.fn){switch(m.once&&this.removeListener(d,m.fn,void 0,!0),a){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,f),!0;case 3:return m.fn.call(m.context,f,s),!0;case 4:return m.fn.call(m.context,f,s,u),!0;case 5:return m.fn.call(m.context,f,s,u,i),!0;case 6:return m.fn.call(m.context,f,s,u,i,p),!0}for(v=1,w=new Array(a-1);v<a;v++)w[v-1]=arguments[v];m.fn.apply(m.context,w)}else{var R=m.length,S;for(v=0;v<R;v++)switch(m[v].once&&this.removeListener(d,m[v].fn,void 0,!0),a){case 1:m[v].fn.call(m[v].context);break;case 2:m[v].fn.call(m[v].context,f);break;case 3:m[v].fn.call(m[v].context,f,s);break;case 4:m[v].fn.call(m[v].context,f,s,u);break;default:if(!w)for(S=1,w=new Array(a-1);S<a;S++)w[S-1]=arguments[S];m[v].fn.apply(m[v].context,w)}}return!0},o.prototype.on=function(d,f,s){return l(this,d,f,s,!1)},o.prototype.once=function(d,f,s){return l(this,d,f,s,!0)},o.prototype.removeListener=function(d,f,s,u){var i=r?r+d:d;if(!this._events[i])return this;if(!f)return c(this,i),this;var p=this._events[i];if(p.fn)p.fn===f&&(!u||p.once)&&(!s||p.context===s)&&c(this,i);else{for(var b=0,m=[],a=p.length;b<a;b++)(p[b].fn!==f||u&&!p[b].once||s&&p[b].context!==s)&&m.push(p[b]);m.length?this._events[i]=m.length===1?m[0]:m:c(this,i)}return this},o.prototype.removeAllListeners=function(d){var f;return d?(f=r?r+d:d,this._events[f]&&c(this,f)):(this._events=new t,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(An)),An.exports}var At={},xt={},Tt={},wo;function Ds(){return wo||(wo=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.EVENTS=void 0,Tt.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"}),Tt}var Te={},_o;function qs(){if(_o)return Te;_o=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.RelayAbstract=Te.APP_VERSION_KEY=Te.LOCAL_STORAGE_ADDRESSES_KEY=Te.WALLET_USER_NAME_KEY=void 0;const e=Ar();Te.WALLET_USER_NAME_KEY="walletUsername",Te.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",Te.APP_VERSION_KEY="AppVersion";let n=class{async makeEthereumJSONRPCRequest(t,g){if(!g)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(g,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(l=>l.json()).then(l=>{if(!l)throw e.standardErrors.rpc.parse({});const c=l,{error:o}=c;if(o)throw(0,e.serializeError)(o,t.method);return c})}};return Te.RelayAbstract=n,Te}var Lt={},xn={exports:{}},cr={exports:{}},Tn={},Mt={},vo;function Zl(){if(vo)return Mt;vo=1,Mt.byteLength=o,Mt.toByteArray=d,Mt.fromByteArray=u;for(var e=[],n=[],r=typeof Uint8Array<"u"?Uint8Array:Array,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=0,l=t.length;g<l;++g)e[g]=t[g],n[t.charCodeAt(g)]=g;n[45]=62,n[95]=63;function c(i){var p=i.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=i.indexOf("=");b===-1&&(b=p);var m=b===p?0:4-b%4;return[b,m]}function o(i){var p=c(i),b=p[0],m=p[1];return(b+m)*3/4-m}function h(i,p,b){return(p+b)*3/4-b}function d(i){var p,b=c(i),m=b[0],a=b[1],w=new r(h(i,m,a)),v=0,R=a>0?m-4:m,S;for(S=0;S<R;S+=4)p=n[i.charCodeAt(S)]<<18|n[i.charCodeAt(S+1)]<<12|n[i.charCodeAt(S+2)]<<6|n[i.charCodeAt(S+3)],w[v++]=p>>16&255,w[v++]=p>>8&255,w[v++]=p&255;return a===2&&(p=n[i.charCodeAt(S)]<<2|n[i.charCodeAt(S+1)]>>4,w[v++]=p&255),a===1&&(p=n[i.charCodeAt(S)]<<10|n[i.charCodeAt(S+1)]<<4|n[i.charCodeAt(S+2)]>>2,w[v++]=p>>8&255,w[v++]=p&255),w}function f(i){return e[i>>18&63]+e[i>>12&63]+e[i>>6&63]+e[i&63]}function s(i,p,b){for(var m,a=[],w=p;w<b;w+=3)m=(i[w]<<16&16711680)+(i[w+1]<<8&65280)+(i[w+2]&255),a.push(f(m));return a.join("")}function u(i){for(var p,b=i.length,m=b%3,a=[],w=16383,v=0,R=b-m;v<R;v+=w)a.push(s(i,v,v+w>R?R:v+w));return m===1?(p=i[b-1],a.push(e[p>>2]+e[p<<4&63]+"==")):m===2&&(p=(i[b-2]<<8)+i[b-1],a.push(e[p>>10]+e[p>>4&63]+e[p<<2&63]+"=")),a.join("")}return Mt}var ur={};var Eo;function Kl(){return Eo||(Eo=1,ur.read=function(e,n,r,t,g){var l,c,o=g*8-t-1,h=(1<<o)-1,d=h>>1,f=-7,s=r?g-1:0,u=r?-1:1,i=e[n+s];for(s+=u,l=i&(1<<-f)-1,i>>=-f,f+=o;f>0;l=l*256+e[n+s],s+=u,f-=8);for(c=l&(1<<-f)-1,l>>=-f,f+=t;f>0;c=c*256+e[n+s],s+=u,f-=8);if(l===0)l=1-d;else{if(l===h)return c?NaN:(i?-1:1)*(1/0);c=c+Math.pow(2,t),l=l-d}return(i?-1:1)*c*Math.pow(2,l-t)},ur.write=function(e,n,r,t,g,l){var c,o,h,d=l*8-g-1,f=(1<<d)-1,s=f>>1,u=g===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=t?0:l-1,p=t?1:-1,b=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(o=isNaN(n)?1:0,c=f):(c=Math.floor(Math.log(n)/Math.LN2),n*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+s>=1?n+=u/h:n+=u*Math.pow(2,1-s),n*h>=2&&(c++,h/=2),c+s>=f?(o=0,c=f):c+s>=1?(o=(n*h-1)*Math.pow(2,g),c=c+s):(o=n*Math.pow(2,s-1)*Math.pow(2,g),c=0));g>=8;e[r+i]=o&255,i+=p,o/=256,g-=8);for(c=c<<g|o,d+=g;d>0;e[r+i]=c&255,i+=p,c/=256,d-=8);e[r+i-p]|=b*128}),ur}var Ro;function Tr(){return Ro||(Ro=1,(function(e){const n=Zl(),r=Kl(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=w,e.INSPECT_MAX_BYTES=50;const g=2147483647;e.kMaxLength=g,o.TYPED_ARRAY_SUPPORT=l(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const E=new Uint8Array(1),y={foo:function(){return 42}};return Object.setPrototypeOf(y,Uint8Array.prototype),Object.setPrototypeOf(E,y),E.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function c(E){if(E>g)throw new RangeError('The value "'+E+'" is invalid for option "size"');const y=new Uint8Array(E);return Object.setPrototypeOf(y,o.prototype),y}function o(E,y,_){if(typeof E=="number"){if(typeof y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return s(E)}return h(E,y,_)}o.poolSize=8192;function h(E,y,_){if(typeof E=="string")return u(E,y);if(ArrayBuffer.isView(E))return p(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(me(E,ArrayBuffer)||E&&me(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(E,SharedArrayBuffer)||E&&me(E.buffer,SharedArrayBuffer)))return b(E,y,_);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const C=E.valueOf&&E.valueOf();if(C!=null&&C!==E)return o.from(C,y,_);const L=m(E);if(L)return L;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return o.from(E[Symbol.toPrimitive]("string"),y,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}o.from=function(E,y,_){return h(E,y,_)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function d(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function f(E,y,_){return d(E),E<=0?c(E):y!==void 0?typeof _=="string"?c(E).fill(y,_):c(E).fill(y):c(E)}o.alloc=function(E,y,_){return f(E,y,_)};function s(E){return d(E),c(E<0?0:a(E)|0)}o.allocUnsafe=function(E){return s(E)},o.allocUnsafeSlow=function(E){return s(E)};function u(E,y){if((typeof y!="string"||y==="")&&(y="utf8"),!o.isEncoding(y))throw new TypeError("Unknown encoding: "+y);const _=v(E,y)|0;let C=c(_);const L=C.write(E,y);return L!==_&&(C=C.slice(0,L)),C}function i(E){const y=E.length<0?0:a(E.length)|0,_=c(y);for(let C=0;C<y;C+=1)_[C]=E[C]&255;return _}function p(E){if(me(E,Uint8Array)){const y=new Uint8Array(E);return b(y.buffer,y.byteOffset,y.byteLength)}return i(E)}function b(E,y,_){if(y<0||E.byteLength<y)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<y+(_||0))throw new RangeError('"length" is outside of buffer bounds');let C;return y===void 0&&_===void 0?C=new Uint8Array(E):_===void 0?C=new Uint8Array(E,y):C=new Uint8Array(E,y,_),Object.setPrototypeOf(C,o.prototype),C}function m(E){if(o.isBuffer(E)){const y=a(E.length)|0,_=c(y);return _.length===0||E.copy(_,0,0,y),_}if(E.length!==void 0)return typeof E.length!="number"||ke(E.length)?c(0):i(E);if(E.type==="Buffer"&&Array.isArray(E.data))return i(E.data)}function a(E){if(E>=g)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+g.toString(16)+" bytes");return E|0}function w(E){return+E!=E&&(E=0),o.alloc(+E)}o.isBuffer=function(y){return y!=null&&y._isBuffer===!0&&y!==o.prototype},o.compare=function(y,_){if(me(y,Uint8Array)&&(y=o.from(y,y.offset,y.byteLength)),me(_,Uint8Array)&&(_=o.from(_,_.offset,_.byteLength)),!o.isBuffer(y)||!o.isBuffer(_))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(y===_)return 0;let C=y.length,L=_.length;for(let P=0,q=Math.min(C,L);P<q;++P)if(y[P]!==_[P]){C=y[P],L=_[P];break}return C<L?-1:L<C?1:0},o.isEncoding=function(y){switch(String(y).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(y,_){if(!Array.isArray(y))throw new TypeError('"list" argument must be an Array of Buffers');if(y.length===0)return o.alloc(0);let C;if(_===void 0)for(_=0,C=0;C<y.length;++C)_+=y[C].length;const L=o.allocUnsafe(_);let P=0;for(C=0;C<y.length;++C){let q=y[C];if(me(q,Uint8Array))P+q.length>L.length?(o.isBuffer(q)||(q=o.from(q)),q.copy(L,P)):Uint8Array.prototype.set.call(L,q,P);else if(o.isBuffer(q))q.copy(L,P);else throw new TypeError('"list" argument must be an Array of Buffers');P+=q.length}return L};function v(E,y){if(o.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||me(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const _=E.length,C=arguments.length>2&&arguments[2]===!0;if(!C&&_===0)return 0;let L=!1;for(;;)switch(y){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return ce(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return xe(E).length;default:if(L)return C?-1:ce(E).length;y=(""+y).toLowerCase(),L=!0}}o.byteLength=v;function R(E,y,_){let C=!1;if((y===void 0||y<0)&&(y=0),y>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,y>>>=0,_<=y))return"";for(E||(E="utf8");;)switch(E){case"hex":return U(this,y,_);case"utf8":case"utf-8":return H(this,y,_);case"ascii":return O(this,y,_);case"latin1":case"binary":return W(this,y,_);case"base64":return ne(this,y,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,y,_);default:if(C)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),C=!0}}o.prototype._isBuffer=!0;function S(E,y,_){const C=E[y];E[y]=E[_],E[_]=C}o.prototype.swap16=function(){const y=this.length;if(y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let _=0;_<y;_+=2)S(this,_,_+1);return this},o.prototype.swap32=function(){const y=this.length;if(y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let _=0;_<y;_+=4)S(this,_,_+3),S(this,_+1,_+2);return this},o.prototype.swap64=function(){const y=this.length;if(y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let _=0;_<y;_+=8)S(this,_,_+7),S(this,_+1,_+6),S(this,_+2,_+5),S(this,_+3,_+4);return this},o.prototype.toString=function(){const y=this.length;return y===0?"":arguments.length===0?H(this,0,y):R.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(y){if(!o.isBuffer(y))throw new TypeError("Argument must be a Buffer");return this===y?!0:o.compare(this,y)===0},o.prototype.inspect=function(){let y="";const _=e.INSPECT_MAX_BYTES;return y=this.toString("hex",0,_).replace(/(.{2})/g,"$1 ").trim(),this.length>_&&(y+=" ... "),"<Buffer "+y+">"},t&&(o.prototype[t]=o.prototype.inspect),o.prototype.compare=function(y,_,C,L,P){if(me(y,Uint8Array)&&(y=o.from(y,y.offset,y.byteLength)),!o.isBuffer(y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof y);if(_===void 0&&(_=0),C===void 0&&(C=y?y.length:0),L===void 0&&(L=0),P===void 0&&(P=this.length),_<0||C>y.length||L<0||P>this.length)throw new RangeError("out of range index");if(L>=P&&_>=C)return 0;if(L>=P)return-1;if(_>=C)return 1;if(_>>>=0,C>>>=0,L>>>=0,P>>>=0,this===y)return 0;let q=P-L,se=C-_;const pe=Math.min(q,se),fe=this.slice(L,P),ge=y.slice(_,C);for(let le=0;le<pe;++le)if(fe[le]!==ge[le]){q=fe[le],se=ge[le];break}return q<se?-1:se<q?1:0};function x(E,y,_,C,L){if(E.length===0)return-1;if(typeof _=="string"?(C=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,ke(_)&&(_=L?0:E.length-1),_<0&&(_=E.length+_),_>=E.length){if(L)return-1;_=E.length-1}else if(_<0)if(L)_=0;else return-1;if(typeof y=="string"&&(y=o.from(y,C)),o.isBuffer(y))return y.length===0?-1:A(E,y,_,C,L);if(typeof y=="number")return y=y&255,typeof Uint8Array.prototype.indexOf=="function"?L?Uint8Array.prototype.indexOf.call(E,y,_):Uint8Array.prototype.lastIndexOf.call(E,y,_):A(E,[y],_,C,L);throw new TypeError("val must be string, number or Buffer")}function A(E,y,_,C,L){let P=1,q=E.length,se=y.length;if(C!==void 0&&(C=String(C).toLowerCase(),C==="ucs2"||C==="ucs-2"||C==="utf16le"||C==="utf-16le")){if(E.length<2||y.length<2)return-1;P=2,q/=2,se/=2,_/=2}function pe(ge,le){return P===1?ge[le]:ge.readUInt16BE(le*P)}let fe;if(L){let ge=-1;for(fe=_;fe<q;fe++)if(pe(E,fe)===pe(y,ge===-1?0:fe-ge)){if(ge===-1&&(ge=fe),fe-ge+1===se)return ge*P}else ge!==-1&&(fe-=fe-ge),ge=-1}else for(_+se>q&&(_=q-se),fe=_;fe>=0;fe--){let ge=!0;for(let le=0;le<se;le++)if(pe(E,fe+le)!==pe(y,le)){ge=!1;break}if(ge)return fe}return-1}o.prototype.includes=function(y,_,C){return this.indexOf(y,_,C)!==-1},o.prototype.indexOf=function(y,_,C){return x(this,y,_,C,!0)},o.prototype.lastIndexOf=function(y,_,C){return x(this,y,_,C,!1)};function M(E,y,_,C){_=Number(_)||0;const L=E.length-_;C?(C=Number(C),C>L&&(C=L)):C=L;const P=y.length;C>P/2&&(C=P/2);let q;for(q=0;q<C;++q){const se=parseInt(y.substr(q*2,2),16);if(ke(se))return q;E[_+q]=se}return q}function D(E,y,_,C){return be(ce(y,E.length-_),E,_,C)}function V(E,y,_,C){return be(Re(y),E,_,C)}function Z(E,y,_,C){return be(xe(y),E,_,C)}function Y(E,y,_,C){return be(Ae(y,E.length-_),E,_,C)}o.prototype.write=function(y,_,C,L){if(_===void 0)L="utf8",C=this.length,_=0;else if(C===void 0&&typeof _=="string")L=_,C=this.length,_=0;else if(isFinite(_))_=_>>>0,isFinite(C)?(C=C>>>0,L===void 0&&(L="utf8")):(L=C,C=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const P=this.length-_;if((C===void 0||C>P)&&(C=P),y.length>0&&(C<0||_<0)||_>this.length)throw new RangeError("Attempt to write outside buffer bounds");L||(L="utf8");let q=!1;for(;;)switch(L){case"hex":return M(this,y,_,C);case"utf8":case"utf-8":return D(this,y,_,C);case"ascii":case"latin1":case"binary":return V(this,y,_,C);case"base64":return Z(this,y,_,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,y,_,C);default:if(q)throw new TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),q=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(E,y,_){return y===0&&_===E.length?n.fromByteArray(E):n.fromByteArray(E.slice(y,_))}function H(E,y,_){_=Math.min(E.length,_);const C=[];let L=y;for(;L<_;){const P=E[L];let q=null,se=P>239?4:P>223?3:P>191?2:1;if(L+se<=_){let pe,fe,ge,le;switch(se){case 1:P<128&&(q=P);break;case 2:pe=E[L+1],(pe&192)===128&&(le=(P&31)<<6|pe&63,le>127&&(q=le));break;case 3:pe=E[L+1],fe=E[L+2],(pe&192)===128&&(fe&192)===128&&(le=(P&15)<<12|(pe&63)<<6|fe&63,le>2047&&(le<55296||le>57343)&&(q=le));break;case 4:pe=E[L+1],fe=E[L+2],ge=E[L+3],(pe&192)===128&&(fe&192)===128&&(ge&192)===128&&(le=(P&15)<<18|(pe&63)<<12|(fe&63)<<6|ge&63,le>65535&&le<1114112&&(q=le))}}q===null?(q=65533,se=1):q>65535&&(q-=65536,C.push(q>>>10&1023|55296),q=56320|q&1023),C.push(q),L+=se}return T(C)}const F=4096;function T(E){const y=E.length;if(y<=F)return String.fromCharCode.apply(String,E);let _="",C=0;for(;C<y;)_+=String.fromCharCode.apply(String,E.slice(C,C+=F));return _}function O(E,y,_){let C="";_=Math.min(E.length,_);for(let L=y;L<_;++L)C+=String.fromCharCode(E[L]&127);return C}function W(E,y,_){let C="";_=Math.min(E.length,_);for(let L=y;L<_;++L)C+=String.fromCharCode(E[L]);return C}function U(E,y,_){const C=E.length;(!y||y<0)&&(y=0),(!_||_<0||_>C)&&(_=C);let L="";for(let P=y;P<_;++P)L+=De[E[P]];return L}function G(E,y,_){const C=E.slice(y,_);let L="";for(let P=0;P<C.length-1;P+=2)L+=String.fromCharCode(C[P]+C[P+1]*256);return L}o.prototype.slice=function(y,_){const C=this.length;y=~~y,_=_===void 0?C:~~_,y<0?(y+=C,y<0&&(y=0)):y>C&&(y=C),_<0?(_+=C,_<0&&(_=0)):_>C&&(_=C),_<y&&(_=y);const L=this.subarray(y,_);return Object.setPrototypeOf(L,o.prototype),L};function Q(E,y,_){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+y>_)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(y,_,C){y=y>>>0,_=_>>>0,C||Q(y,_,this.length);let L=this[y],P=1,q=0;for(;++q<_&&(P*=256);)L+=this[y+q]*P;return L},o.prototype.readUintBE=o.prototype.readUIntBE=function(y,_,C){y=y>>>0,_=_>>>0,C||Q(y,_,this.length);let L=this[y+--_],P=1;for(;_>0&&(P*=256);)L+=this[y+--_]*P;return L},o.prototype.readUint8=o.prototype.readUInt8=function(y,_){return y=y>>>0,_||Q(y,1,this.length),this[y]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(y,_){return y=y>>>0,_||Q(y,2,this.length),this[y]|this[y+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(y,_){return y=y>>>0,_||Q(y,2,this.length),this[y]<<8|this[y+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),(this[y]|this[y+1]<<8|this[y+2]<<16)+this[y+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),this[y]*16777216+(this[y+1]<<16|this[y+2]<<8|this[y+3])},o.prototype.readBigUInt64LE=ve(function(y){y=y>>>0,$(y,"offset");const _=this[y],C=this[y+7];(_===void 0||C===void 0)&&z(y,this.length-8);const L=_+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24,P=this[++y]+this[++y]*2**8+this[++y]*2**16+C*2**24;return BigInt(L)+(BigInt(P)<<BigInt(32))}),o.prototype.readBigUInt64BE=ve(function(y){y=y>>>0,$(y,"offset");const _=this[y],C=this[y+7];(_===void 0||C===void 0)&&z(y,this.length-8);const L=_*2**24+this[++y]*2**16+this[++y]*2**8+this[++y],P=this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+C;return(BigInt(L)<<BigInt(32))+BigInt(P)}),o.prototype.readIntLE=function(y,_,C){y=y>>>0,_=_>>>0,C||Q(y,_,this.length);let L=this[y],P=1,q=0;for(;++q<_&&(P*=256);)L+=this[y+q]*P;return P*=128,L>=P&&(L-=Math.pow(2,8*_)),L},o.prototype.readIntBE=function(y,_,C){y=y>>>0,_=_>>>0,C||Q(y,_,this.length);let L=_,P=1,q=this[y+--L];for(;L>0&&(P*=256);)q+=this[y+--L]*P;return P*=128,q>=P&&(q-=Math.pow(2,8*_)),q},o.prototype.readInt8=function(y,_){return y=y>>>0,_||Q(y,1,this.length),this[y]&128?(255-this[y]+1)*-1:this[y]},o.prototype.readInt16LE=function(y,_){y=y>>>0,_||Q(y,2,this.length);const C=this[y]|this[y+1]<<8;return C&32768?C|4294901760:C},o.prototype.readInt16BE=function(y,_){y=y>>>0,_||Q(y,2,this.length);const C=this[y+1]|this[y]<<8;return C&32768?C|4294901760:C},o.prototype.readInt32LE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),this[y]|this[y+1]<<8|this[y+2]<<16|this[y+3]<<24},o.prototype.readInt32BE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),this[y]<<24|this[y+1]<<16|this[y+2]<<8|this[y+3]},o.prototype.readBigInt64LE=ve(function(y){y=y>>>0,$(y,"offset");const _=this[y],C=this[y+7];(_===void 0||C===void 0)&&z(y,this.length-8);const L=this[y+4]+this[y+5]*2**8+this[y+6]*2**16+(C<<24);return(BigInt(L)<<BigInt(32))+BigInt(_+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24)}),o.prototype.readBigInt64BE=ve(function(y){y=y>>>0,$(y,"offset");const _=this[y],C=this[y+7];(_===void 0||C===void 0)&&z(y,this.length-8);const L=(_<<24)+this[++y]*2**16+this[++y]*2**8+this[++y];return(BigInt(L)<<BigInt(32))+BigInt(this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+C)}),o.prototype.readFloatLE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),r.read(this,y,!0,23,4)},o.prototype.readFloatBE=function(y,_){return y=y>>>0,_||Q(y,4,this.length),r.read(this,y,!1,23,4)},o.prototype.readDoubleLE=function(y,_){return y=y>>>0,_||Q(y,8,this.length),r.read(this,y,!0,52,8)},o.prototype.readDoubleBE=function(y,_){return y=y>>>0,_||Q(y,8,this.length),r.read(this,y,!1,52,8)};function J(E,y,_,C,L,P){if(!o.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(y>L||y<P)throw new RangeError('"value" argument is out of bounds');if(_+C>E.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(y,_,C,L){if(y=+y,_=_>>>0,C=C>>>0,!L){const se=Math.pow(2,8*C)-1;J(this,y,_,C,se,0)}let P=1,q=0;for(this[_]=y&255;++q<C&&(P*=256);)this[_+q]=y/P&255;return _+C},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(y,_,C,L){if(y=+y,_=_>>>0,C=C>>>0,!L){const se=Math.pow(2,8*C)-1;J(this,y,_,C,se,0)}let P=C-1,q=1;for(this[_+P]=y&255;--P>=0&&(q*=256);)this[_+P]=y/q&255;return _+C},o.prototype.writeUint8=o.prototype.writeUInt8=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,1,255,0),this[_]=y&255,_+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,2,65535,0),this[_]=y&255,this[_+1]=y>>>8,_+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,2,65535,0),this[_]=y>>>8,this[_+1]=y&255,_+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,4,4294967295,0),this[_+3]=y>>>24,this[_+2]=y>>>16,this[_+1]=y>>>8,this[_]=y&255,_+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,4,4294967295,0),this[_]=y>>>24,this[_+1]=y>>>16,this[_+2]=y>>>8,this[_+3]=y&255,_+4};function ee(E,y,_,C,L){I(y,C,L,E,_,7);let P=Number(y&BigInt(4294967295));E[_++]=P,P=P>>8,E[_++]=P,P=P>>8,E[_++]=P,P=P>>8,E[_++]=P;let q=Number(y>>BigInt(32)&BigInt(4294967295));return E[_++]=q,q=q>>8,E[_++]=q,q=q>>8,E[_++]=q,q=q>>8,E[_++]=q,_}function ae(E,y,_,C,L){I(y,C,L,E,_,7);let P=Number(y&BigInt(4294967295));E[_+7]=P,P=P>>8,E[_+6]=P,P=P>>8,E[_+5]=P,P=P>>8,E[_+4]=P;let q=Number(y>>BigInt(32)&BigInt(4294967295));return E[_+3]=q,q=q>>8,E[_+2]=q,q=q>>8,E[_+1]=q,q=q>>8,E[_]=q,_+8}o.prototype.writeBigUInt64LE=ve(function(y,_=0){return ee(this,y,_,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=ve(function(y,_=0){return ae(this,y,_,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(y,_,C,L){if(y=+y,_=_>>>0,!L){const pe=Math.pow(2,8*C-1);J(this,y,_,C,pe-1,-pe)}let P=0,q=1,se=0;for(this[_]=y&255;++P<C&&(q*=256);)y<0&&se===0&&this[_+P-1]!==0&&(se=1),this[_+P]=(y/q>>0)-se&255;return _+C},o.prototype.writeIntBE=function(y,_,C,L){if(y=+y,_=_>>>0,!L){const pe=Math.pow(2,8*C-1);J(this,y,_,C,pe-1,-pe)}let P=C-1,q=1,se=0;for(this[_+P]=y&255;--P>=0&&(q*=256);)y<0&&se===0&&this[_+P+1]!==0&&(se=1),this[_+P]=(y/q>>0)-se&255;return _+C},o.prototype.writeInt8=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,1,127,-128),y<0&&(y=255+y+1),this[_]=y&255,_+1},o.prototype.writeInt16LE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,2,32767,-32768),this[_]=y&255,this[_+1]=y>>>8,_+2},o.prototype.writeInt16BE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,2,32767,-32768),this[_]=y>>>8,this[_+1]=y&255,_+2},o.prototype.writeInt32LE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,4,2147483647,-2147483648),this[_]=y&255,this[_+1]=y>>>8,this[_+2]=y>>>16,this[_+3]=y>>>24,_+4},o.prototype.writeInt32BE=function(y,_,C){return y=+y,_=_>>>0,C||J(this,y,_,4,2147483647,-2147483648),y<0&&(y=4294967295+y+1),this[_]=y>>>24,this[_+1]=y>>>16,this[_+2]=y>>>8,this[_+3]=y&255,_+4},o.prototype.writeBigInt64LE=ve(function(y,_=0){return ee(this,y,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=ve(function(y,_=0){return ae(this,y,_,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function te(E,y,_,C,L,P){if(_+C>E.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function B(E,y,_,C,L){return y=+y,_=_>>>0,L||te(E,y,_,4),r.write(E,y,_,C,23,4),_+4}o.prototype.writeFloatLE=function(y,_,C){return B(this,y,_,!0,C)},o.prototype.writeFloatBE=function(y,_,C){return B(this,y,_,!1,C)};function N(E,y,_,C,L){return y=+y,_=_>>>0,L||te(E,y,_,8),r.write(E,y,_,C,52,8),_+8}o.prototype.writeDoubleLE=function(y,_,C){return N(this,y,_,!0,C)},o.prototype.writeDoubleBE=function(y,_,C){return N(this,y,_,!1,C)},o.prototype.copy=function(y,_,C,L){if(!o.isBuffer(y))throw new TypeError("argument should be a Buffer");if(C||(C=0),!L&&L!==0&&(L=this.length),_>=y.length&&(_=y.length),_||(_=0),L>0&&L<C&&(L=C),L===C||y.length===0||this.length===0)return 0;if(_<0)throw new RangeError("targetStart out of bounds");if(C<0||C>=this.length)throw new RangeError("Index out of range");if(L<0)throw new RangeError("sourceEnd out of bounds");L>this.length&&(L=this.length),y.length-_<L-C&&(L=y.length-_+C);const P=L-C;return this===y&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(_,C,L):Uint8Array.prototype.set.call(y,this.subarray(C,L),_),P},o.prototype.fill=function(y,_,C,L){if(typeof y=="string"){if(typeof _=="string"?(L=_,_=0,C=this.length):typeof C=="string"&&(L=C,C=this.length),L!==void 0&&typeof L!="string")throw new TypeError("encoding must be a string");if(typeof L=="string"&&!o.isEncoding(L))throw new TypeError("Unknown encoding: "+L);if(y.length===1){const q=y.charCodeAt(0);(L==="utf8"&&q<128||L==="latin1")&&(y=q)}}else typeof y=="number"?y=y&255:typeof y=="boolean"&&(y=Number(y));if(_<0||this.length<_||this.length<C)throw new RangeError("Out of range index");if(C<=_)return this;_=_>>>0,C=C===void 0?this.length:C>>>0,y||(y=0);let P;if(typeof y=="number")for(P=_;P<C;++P)this[P]=y;else{const q=o.isBuffer(y)?y:o.from(y,L),se=q.length;if(se===0)throw new TypeError('The value "'+y+'" is invalid for argument "value"');for(P=0;P<C-_;++P)this[P+_]=q[P%se]}return this};const j={};function K(E,y,_){j[E]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(L){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:L,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(E,y){return`The "${E}" argument must be of type number. Received type ${typeof y}`},TypeError),K("ERR_OUT_OF_RANGE",function(E,y,_){let C=`The value of "${E}" is out of range.`,L=_;return Number.isInteger(_)&&Math.abs(_)>2**32?L=re(String(_)):typeof _=="bigint"&&(L=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(L=re(L)),L+="n"),C+=` It must be ${y}. Received ${L}`,C},RangeError);function re(E){let y="",_=E.length;const C=E[0]==="-"?1:0;for(;_>=C+4;_-=3)y=`_${E.slice(_-3,_)}${y}`;return`${E.slice(0,_)}${y}`}function k(E,y,_){$(y,"offset"),(E[y]===void 0||E[y+_]===void 0)&&z(y,E.length-(_+1))}function I(E,y,_,C,L,P){if(E>_||E<y){const q=typeof y=="bigint"?"n":"";let se;throw y===0||y===BigInt(0)?se=`>= 0${q} and < 2${q} ** ${(P+1)*8}${q}`:se=`>= -(2${q} ** ${(P+1)*8-1}${q}) and < 2 ** ${(P+1)*8-1}${q}`,new j.ERR_OUT_OF_RANGE("value",se,E)}k(C,L,P)}function $(E,y){if(typeof E!="number")throw new j.ERR_INVALID_ARG_TYPE(y,"number",E)}function z(E,y,_){throw Math.floor(E)!==E?($(E,_),new j.ERR_OUT_OF_RANGE("offset","an integer",E)):y<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${y}`,E)}const he=/[^+/0-9A-Za-z-_]/g;function ie(E){if(E=E.split("=")[0],E=E.trim().replace(he,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function ce(E,y){y=y||1/0;let _;const C=E.length;let L=null;const P=[];for(let q=0;q<C;++q){if(_=E.charCodeAt(q),_>55295&&_<57344){if(!L){if(_>56319){(y-=3)>-1&&P.push(239,191,189);continue}else if(q+1===C){(y-=3)>-1&&P.push(239,191,189);continue}L=_;continue}if(_<56320){(y-=3)>-1&&P.push(239,191,189),L=_;continue}_=(L-55296<<10|_-56320)+65536}else L&&(y-=3)>-1&&P.push(239,191,189);if(L=null,_<128){if((y-=1)<0)break;P.push(_)}else if(_<2048){if((y-=2)<0)break;P.push(_>>6|192,_&63|128)}else if(_<65536){if((y-=3)<0)break;P.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((y-=4)<0)break;P.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return P}function Re(E){const y=[];for(let _=0;_<E.length;++_)y.push(E.charCodeAt(_)&255);return y}function Ae(E,y){let _,C,L;const P=[];for(let q=0;q<E.length&&!((y-=2)<0);++q)_=E.charCodeAt(q),C=_>>8,L=_%256,P.push(L),P.push(C);return P}function xe(E){return n.toByteArray(ie(E))}function be(E,y,_,C){let L;for(L=0;L<C&&!(L+_>=y.length||L>=E.length);++L)y[L+_]=E[L];return L}function me(E,y){return E instanceof y||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===y.name}function ke(E){return E!==E}const De=(function(){const E="0123456789abcdef",y=new Array(256);for(let _=0;_<16;++_){const C=_*16;for(let L=0;L<16;++L)y[C+L]=E[_]+E[L]}return y})();function ve(E){return typeof BigInt>"u"?qe:E}function qe(){throw new Error("BigInt not supported")}})(Tn)),Tn}var So;function He(){return So||(So=1,(function(e,n){var r=Tr(),t=r.Buffer;function g(c,o){for(var h in c)o[h]=c[h]}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?e.exports=r:(g(r,n),n.Buffer=l);function l(c,o,h){return t(c,o,h)}l.prototype=Object.create(t.prototype),g(t,l),l.from=function(c,o,h){if(typeof c=="number")throw new TypeError("Argument must not be a number");return t(c,o,h)},l.alloc=function(c,o,h){if(typeof c!="number")throw new TypeError("Argument must be a number");var d=t(c);return o!==void 0?typeof h=="string"?d.fill(o,h):d.fill(o):d.fill(0),d},l.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return t(c)},l.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(c)}})(cr,cr.exports)),cr.exports}var Ln,Co;function Ql(){if(Co)return Ln;Co=1;var e=Bl();return Ln=function(r){return!!e(r)},Ln}var Mn,ko;function Yl(){if(ko)return Mn;ko=1;var e=Ol(),n=Pl(),r=n("TypedArray.prototype.buffer",!0),t=Ql();return Mn=r||function(l){if(!t(l))throw new e("Not a Typed Array");return l.buffer},Mn}var Nn,Io;function Xl(){if(Io)return Nn;Io=1;var e=He().Buffer,n=Fl(),r=Yl(),t=ArrayBuffer.isView||function(h){try{return r(h),!0}catch{return!1}},g=typeof Uint8Array<"u",l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",c=l&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return Nn=function(h,d){if(e.isBuffer(h))return h.constructor&&!("isBuffer"in h)?e.from(h):h;if(typeof h=="string")return e.from(h,d);if(l&&t(h)){if(h.byteLength===0)return e.alloc(0);if(c){var f=e.from(h.buffer,h.byteOffset,h.byteLength);if(f.byteLength===h.byteLength)return f}var s=h instanceof Uint8Array?h:new Uint8Array(h.buffer,h.byteOffset,h.byteLength),u=e.from(s);if(u.length===h.byteLength)return u}if(g&&h instanceof Uint8Array)return e.from(h);var i=n(h);if(i)for(var p=0;p<h.length;p+=1){var b=h[p];if(typeof b!="number"||b<0||b>255||~~b!==b)throw new RangeError("Array items must be numbers in the range 0-255.")}if(i||e.isBuffer(h)&&h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return e.from(h);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Nn}var Bn,Ao;function mt(){if(Ao)return Bn;Ao=1;var e=He().Buffer,n=Xl();function r(t,g){this._block=e.alloc(t),this._finalSize=g,this._blockSize=t,this._len=0}return r.prototype.update=function(t,g){t=n(t,g||"utf8");for(var l=this._block,c=this._blockSize,o=t.length,h=this._len,d=0;d<o;){for(var f=h%c,s=Math.min(o-d,c-f),u=0;u<s;u++)l[f+u]=t[d+u];h+=s,d+=s,h%c===0&&this._update(l)}return this._len+=o,this},r.prototype.digest=function(t){var g=this._len%this._blockSize;this._block[g]=128,this._block.fill(0,g+1),g>=this._finalSize&&(this._update(this._block),this._block.fill(0));var l=this._len*8;if(l<=4294967295)this._block.writeUInt32BE(l,this._blockSize-4);else{var c=(l&4294967295)>>>0,o=(l-c)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(c,this._blockSize-4)}this._update(this._block);var h=this._hash();return t?h.toString(t):h},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},Bn=r,Bn}var Pn,xo;function ed(){if(xo)return Pn;xo=1;var e=Pe(),n=mt(),r=He().Buffer,t=[1518500249,1859775393,-1894007588,-899497514],g=new Array(80);function l(){this.init(),this._w=g,n.call(this,64,56)}e(l,n),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function c(d){return d<<5|d>>>27}function o(d){return d<<30|d>>>2}function h(d,f,s,u){return d===0?f&s|~f&u:d===2?f&s|f&u|s&u:f^s^u}return l.prototype._update=function(d){for(var f=this._w,s=this._a|0,u=this._b|0,i=this._c|0,p=this._d|0,b=this._e|0,m=0;m<16;++m)f[m]=d.readInt32BE(m*4);for(;m<80;++m)f[m]=f[m-3]^f[m-8]^f[m-14]^f[m-16];for(var a=0;a<80;++a){var w=~~(a/20),v=c(s)+h(w,u,i,p)+b+f[a]+t[w]|0;b=p,p=i,i=o(u),u=s,s=v}this._a=s+this._a|0,this._b=u+this._b|0,this._c=i+this._c|0,this._d=p+this._d|0,this._e=b+this._e|0},l.prototype._hash=function(){var d=r.allocUnsafe(20);return d.writeInt32BE(this._a|0,0),d.writeInt32BE(this._b|0,4),d.writeInt32BE(this._c|0,8),d.writeInt32BE(this._d|0,12),d.writeInt32BE(this._e|0,16),d},Pn=l,Pn}var On,To;function td(){if(To)return On;To=1;var e=Pe(),n=mt(),r=He().Buffer,t=[1518500249,1859775393,-1894007588,-899497514],g=new Array(80);function l(){this.init(),this._w=g,n.call(this,64,56)}e(l,n),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function c(f){return f<<1|f>>>31}function o(f){return f<<5|f>>>27}function h(f){return f<<30|f>>>2}function d(f,s,u,i){return f===0?s&u|~s&i:f===2?s&u|s&i|u&i:s^u^i}return l.prototype._update=function(f){for(var s=this._w,u=this._a|0,i=this._b|0,p=this._c|0,b=this._d|0,m=this._e|0,a=0;a<16;++a)s[a]=f.readInt32BE(a*4);for(;a<80;++a)s[a]=c(s[a-3]^s[a-8]^s[a-14]^s[a-16]);for(var w=0;w<80;++w){var v=~~(w/20),R=o(u)+d(v,i,p,b)+m+s[w]+t[v]|0;m=b,b=p,p=h(i),i=u,u=R}this._a=u+this._a|0,this._b=i+this._b|0,this._c=p+this._c|0,this._d=b+this._d|0,this._e=m+this._e|0},l.prototype._hash=function(){var f=r.allocUnsafe(20);return f.writeInt32BE(this._a|0,0),f.writeInt32BE(this._b|0,4),f.writeInt32BE(this._c|0,8),f.writeInt32BE(this._d|0,12),f.writeInt32BE(this._e|0,16),f},On=l,On}var Fn,Lo;function Ju(){if(Lo)return Fn;Lo=1;var e=Pe(),n=mt(),r=He().Buffer,t=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=new Array(64);function l(){this.init(),this._w=g,n.call(this,64,56)}e(l,n),l.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function c(u,i,p){return p^u&(i^p)}function o(u,i,p){return u&i|p&(u|i)}function h(u){return(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10)}function d(u){return(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7)}function f(u){return(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3}function s(u){return(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10}return l.prototype._update=function(u){for(var i=this._w,p=this._a|0,b=this._b|0,m=this._c|0,a=this._d|0,w=this._e|0,v=this._f|0,R=this._g|0,S=this._h|0,x=0;x<16;++x)i[x]=u.readInt32BE(x*4);for(;x<64;++x)i[x]=s(i[x-2])+i[x-7]+f(i[x-15])+i[x-16]|0;for(var A=0;A<64;++A){var M=S+d(w)+c(w,v,R)+t[A]+i[A]|0,D=h(p)+o(p,b,m)|0;S=R,R=v,v=w,w=a+M|0,a=m,m=b,b=p,p=M+D|0}this._a=p+this._a|0,this._b=b+this._b|0,this._c=m+this._c|0,this._d=a+this._d|0,this._e=w+this._e|0,this._f=v+this._f|0,this._g=R+this._g|0,this._h=S+this._h|0},l.prototype._hash=function(){var u=r.allocUnsafe(32);return u.writeInt32BE(this._a,0),u.writeInt32BE(this._b,4),u.writeInt32BE(this._c,8),u.writeInt32BE(this._d,12),u.writeInt32BE(this._e,16),u.writeInt32BE(this._f,20),u.writeInt32BE(this._g,24),u.writeInt32BE(this._h,28),u},Fn=l,Fn}var Dn,Mo;function rd(){if(Mo)return Dn;Mo=1;var e=Pe(),n=Ju(),r=mt(),t=He().Buffer,g=new Array(64);function l(){this.init(),this._w=g,r.call(this,64,56)}return e(l,n),l.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},l.prototype._hash=function(){var c=t.allocUnsafe(28);return c.writeInt32BE(this._a,0),c.writeInt32BE(this._b,4),c.writeInt32BE(this._c,8),c.writeInt32BE(this._d,12),c.writeInt32BE(this._e,16),c.writeInt32BE(this._f,20),c.writeInt32BE(this._g,24),c},Dn=l,Dn}var qn,No;function Gu(){if(No)return qn;No=1;var e=Pe(),n=mt(),r=He().Buffer,t=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],g=new Array(160);function l(){this.init(),this._w=g,n.call(this,128,112)}e(l,n),l.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function c(b,m,a){return a^b&(m^a)}function o(b,m,a){return b&m|a&(b|m)}function h(b,m){return(b>>>28|m<<4)^(m>>>2|b<<30)^(m>>>7|b<<25)}function d(b,m){return(b>>>14|m<<18)^(b>>>18|m<<14)^(m>>>9|b<<23)}function f(b,m){return(b>>>1|m<<31)^(b>>>8|m<<24)^b>>>7}function s(b,m){return(b>>>1|m<<31)^(b>>>8|m<<24)^(b>>>7|m<<25)}function u(b,m){return(b>>>19|m<<13)^(m>>>29|b<<3)^b>>>6}function i(b,m){return(b>>>19|m<<13)^(m>>>29|b<<3)^(b>>>6|m<<26)}function p(b,m){return b>>>0<m>>>0?1:0}return l.prototype._update=function(b){for(var m=this._w,a=this._ah|0,w=this._bh|0,v=this._ch|0,R=this._dh|0,S=this._eh|0,x=this._fh|0,A=this._gh|0,M=this._hh|0,D=this._al|0,V=this._bl|0,Z=this._cl|0,Y=this._dl|0,ne=this._el|0,H=this._fl|0,F=this._gl|0,T=this._hl|0,O=0;O<32;O+=2)m[O]=b.readInt32BE(O*4),m[O+1]=b.readInt32BE(O*4+4);for(;O<160;O+=2){var W=m[O-30],U=m[O-30+1],G=f(W,U),Q=s(U,W);W=m[O-4],U=m[O-4+1];var J=u(W,U),ee=i(U,W),ae=m[O-14],te=m[O-14+1],B=m[O-32],N=m[O-32+1],j=Q+te|0,K=G+ae+p(j,Q)|0;j=j+ee|0,K=K+J+p(j,ee)|0,j=j+N|0,K=K+B+p(j,N)|0,m[O]=K,m[O+1]=j}for(var re=0;re<160;re+=2){K=m[re],j=m[re+1];var k=o(a,w,v),I=o(D,V,Z),$=h(a,D),z=h(D,a),he=d(S,ne),ie=d(ne,S),ce=t[re],Re=t[re+1],Ae=c(S,x,A),xe=c(ne,H,F),be=T+ie|0,me=M+he+p(be,T)|0;be=be+xe|0,me=me+Ae+p(be,xe)|0,be=be+Re|0,me=me+ce+p(be,Re)|0,be=be+j|0,me=me+K+p(be,j)|0;var ke=z+I|0,De=$+k+p(ke,z)|0;M=A,T=F,A=x,F=H,x=S,H=ne,ne=Y+be|0,S=R+me+p(ne,Y)|0,R=v,Y=Z,v=w,Z=V,w=a,V=D,D=be+ke|0,a=me+De+p(D,be)|0}this._al=this._al+D|0,this._bl=this._bl+V|0,this._cl=this._cl+Z|0,this._dl=this._dl+Y|0,this._el=this._el+ne|0,this._fl=this._fl+H|0,this._gl=this._gl+F|0,this._hl=this._hl+T|0,this._ah=this._ah+a+p(this._al,D)|0,this._bh=this._bh+w+p(this._bl,V)|0,this._ch=this._ch+v+p(this._cl,Z)|0,this._dh=this._dh+R+p(this._dl,Y)|0,this._eh=this._eh+S+p(this._el,ne)|0,this._fh=this._fh+x+p(this._fl,H)|0,this._gh=this._gh+A+p(this._gl,F)|0,this._hh=this._hh+M+p(this._hl,T)|0},l.prototype._hash=function(){var b=r.allocUnsafe(64);function m(a,w,v){b.writeInt32BE(a,v),b.writeInt32BE(w,v+4)}return m(this._ah,this._al,0),m(this._bh,this._bl,8),m(this._ch,this._cl,16),m(this._dh,this._dl,24),m(this._eh,this._el,32),m(this._fh,this._fl,40),m(this._gh,this._gl,48),m(this._hh,this._hl,56),b},qn=l,qn}var jn,Bo;function nd(){if(Bo)return jn;Bo=1;var e=Pe(),n=Gu(),r=mt(),t=He().Buffer,g=new Array(160);function l(){this.init(),this._w=g,r.call(this,128,112)}return e(l,n),l.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},l.prototype._hash=function(){var c=t.allocUnsafe(48);function o(h,d,f){c.writeInt32BE(h,f),c.writeInt32BE(d,f+4)}return o(this._ah,this._al,0),o(this._bh,this._bl,8),o(this._ch,this._cl,16),o(this._dh,this._dl,24),o(this._eh,this._el,32),o(this._fh,this._fl,40),c},jn=l,jn}var Po;function id(){return Po||(Po=1,(function(e){e.exports=function(r){var t=r.toLowerCase(),g=e.exports[t];if(!g)throw new Error(t+" is not supported (we accept pull requests)");return new g},e.exports.sha=ed(),e.exports.sha1=td(),e.exports.sha224=rd(),e.exports.sha256=Ju(),e.exports.sha384=nd(),e.exports.sha512=Gu()})(xn)),xn.exports}var Oo;function js(){if(Oo)return Lt;Oo=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.Session=void 0;const e=id(),n=Ue(),r="session:id",t="session:secret",g="session:linked";let l=class Zu{constructor(o,h,d,f){this._storage=o,this._id=h||(0,n.randomBytesHex)(16),this._secret=d||(0,n.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!f}static load(o){const h=o.getItem(r),d=o.getItem(g),f=o.getItem(t);return h&&f?new Zu(o,h,f,d==="1"):null}static hash(o){return new e.sha256().update(o).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(o){this._linked=o,this.persistLinked()}save(){return this._storage.setItem(r,this._id),this._storage.setItem(t,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(g,this._linked?"1":"0")}};return Lt.Session=l,Lt}var Nt={},Bt={},Fo;function sd(){if(Fo)return Bt;Fo=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Cipher=void 0;const e=Ue();let n=class{constructor(t){this.secret=t}async encrypt(t){const g=this.secret;if(g.length!==64)throw Error("secret must be 256 bits");const l=crypto.getRandomValues(new Uint8Array(12)),c=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(g),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=new TextEncoder,h=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:l},c,o.encode(t)),d=16,f=h.slice(h.byteLength-d),s=h.slice(0,h.byteLength-d),u=new Uint8Array(f),i=new Uint8Array(s),p=new Uint8Array([...l,...u,...i]);return(0,e.uint8ArrayToHex)(p)}async decrypt(t){const g=this.secret;if(g.length!==64)throw Error("secret must be 256 bits");return new Promise((l,c)=>{(async function(){const o=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(g),{name:"aes-gcm"},!1,["encrypt","decrypt"]),h=(0,e.hexStringToUint8Array)(t),d=h.slice(0,12),f=h.slice(12,28),s=h.slice(28),u=new Uint8Array([...s,...f]),i={name:"AES-GCM",iv:new Uint8Array(d)};try{const p=await window.crypto.subtle.decrypt(i,o,u),b=new TextDecoder;l(b.decode(p))}catch(p){c(p)}})()})}};return Bt.Cipher=n,Bt}var Pt={},Do;function od(){if(Do)return Pt;Do=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.WalletLinkHTTP=void 0;let e=class{constructor(r,t,g){this.linkAPIUrl=r,this.sessionId=t;const l=`${t}:${g}`;this.auth=`Basic ${btoa(l)}`}async markUnseenEventsAsSeen(r){return Promise.all(r.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var r;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:g,error:l}=await t.json();if(l)throw new Error(`Check unseen events failed: ${l}`);const c=(r=g?.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&r!==void 0?r:[];return this.markUnseenEventsAsSeen(c),c}throw new Error(`Check unseen events failed: ${t.status}`)}};return Pt.WalletLinkHTTP=e,Pt}var Ge={},qo;function ad(){if(qo)return Ge;qo=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.WalletLinkWebSocket=Ge.ConnectionState=void 0;var e;(function(r){r[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"})(e||(Ge.ConnectionState=e={}));let n=class{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,g=WebSocket){this.WebSocketClass=g,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,g)=>{var l;let c;try{this.webSocket=c=new this.WebSocketClass(this.url)}catch(o){g(o);return}(l=this.connectionStateListener)===null||l===void 0||l.call(this,e.CONNECTING),c.onclose=o=>{var h;this.clearWebSocket(),g(new Error(`websocket error ${o.code}: ${o.reason}`)),(h=this.connectionStateListener)===null||h===void 0||h.call(this,e.DISCONNECTED)},c.onopen=o=>{var h;t(),(h=this.connectionStateListener)===null||h===void 0||h.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(f=>this.sendData(f)),this.pendingData=[])},c.onmessage=o=>{var h,d;if(o.data==="h")(h=this.incomingDataListener)===null||h===void 0||h.call(this,{type:"Heartbeat"});else try{const f=JSON.parse(o.data);(d=this.incomingDataListener)===null||d===void 0||d.call(this,f)}catch{}}})}disconnect(){var t;const{webSocket:g}=this;if(g){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{g.close()}catch{}}}sendData(t){const{webSocket:g}=this;if(!g){this.pendingData.push(t),this.connect();return}g.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};return Ge.WalletLinkWebSocket=n,Ge}var jo;function cd(){if(jo)return Nt;jo=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.WalletLinkConnection=void 0;const e=xr(),n=sd(),r=Ds(),t=qs(),g=js(),l=od(),c=ad(),o=1e4,h=6e4;let d=class{constructor({session:s,linkAPIUrl:u,listener:i,diagnostic:p,WebSocketClass:b=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,e.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",v=>a.JsonRpcUrl&&this.handleChainUpdated(v,a.JsonRpcUrl)]]).forEach((v,R)=>{const S=a[R];S!==void 0&&v(S)})},this.handleDestroyed=a=>{var w,v;a==="1"&&((w=this.listener)===null||w===void 0||w.resetAndReload(),(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:g.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var w,v;try{const R=await this.cipher.decrypt(a);(w=this.listener)===null||w===void 0||w.accountUpdated(R)}catch{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,w)=>{var v,R;try{const S=await this.cipher.decrypt(w);(v=this.listener)===null||v===void 0||v.metadataUpdated(a,S)}catch{(R=this.diagnostic)===null||R===void 0||R.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(t.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(t.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,w)=>{var v,R;try{const S=await this.cipher.decrypt(a),x=await this.cipher.decrypt(w);(v=this.listener)===null||v===void 0||v.chainUpdated(S,x)}catch{(R=this.diagnostic)===null||R===void 0||R.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=s,this.cipher=new n.Cipher(s.secret),this.diagnostic=p,this.listener=i;const m=new c.WalletLinkWebSocket(`${u}/rpc`,b);m.setConnectionStateListener(async a=>{var w;(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:g.Session.hash(s.id)});let v=!1;switch(a){case c.ConnectionState.DISCONNECTED:if(!this.destroyed){const R=async()=>{await new Promise(S=>setTimeout(S,5e3)),this.destroyed||m.connect().catch(()=>{R()})};R()}break;case c.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),v=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},o),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case c.ConnectionState.CONNECTING:break}this.connected!==v&&(this.connected=v)}),m.setIncomingDataListener(a=>{var w,v,R;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const S=a.type==="IsLinkedOK"?a.linked:void 0;(w=this.diagnostic)===null||w===void 0||w.log(r.EVENTS.LINKED,{sessionIdHash:g.Session.hash(s.id),linked:S,type:a.type,onlineGuests:a.onlineGuests}),this.linked=S||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(v=this.diagnostic)===null||v===void 0||v.log(r.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:g.Session.hash(s.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&&((R=this.requestResolutions.get(a.id))===null||R===void 0||R(a))}),this.ws=m,this.http=new l.WalletLinkHTTP(u,s.id,s.key)}connect(){var s;if(this.destroyed)throw new Error("instance is destroyed");(s=this.diagnostic)===null||s===void 0||s.log(r.EVENTS.STARTED_CONNECTING,{sessionIdHash:g.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var s;this.destroyed=!0,this.ws.disconnect(),(s=this.diagnostic)===null||s===void 0||s.log(r.EVENTS.DISCONNECTED,{sessionIdHash:g.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(s){var u,i;this._connected=s,s&&((u=this.onceConnected)===null||u===void 0||u.call(this)),(i=this.listener)===null||i===void 0||i.connectedUpdated(s)}setOnceConnected(s){return new Promise(u=>{this.connected?s().then(u):this.onceConnected=()=>{s().then(u),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(s){var u,i;this._linked=s,s&&((u=this.onceLinked)===null||u===void 0||u.call(this)),(i=this.listener)===null||i===void 0||i.linkedUpdated(s)}setOnceLinked(s){return new Promise(u=>{this.linked?s().then(u):this.onceLinked=()=>{s().then(u),this.onceLinked=void 0}})}async handleIncomingEvent(s){var u,i;if(!(s.type!=="Event"||s.event!=="Web3Response"))try{const p=await this.cipher.decrypt(s.data),b=JSON.parse(p);if(b.type!=="WEB3_RESPONSE")return;(u=this.listener)===null||u===void 0||u.handleWeb3ResponseMessage(b)}catch{(i=this.diagnostic)===null||i===void 0||i.log(r.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(s=>setTimeout(s,250));try{await this.fetchUnseenEventsAPI()}catch(s){console.error("Unable to check for unseen events",s)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(u=>this.handleIncomingEvent(u))}async setSessionMetadata(s,u){const i={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[s]:u}};return this.setOnceConnected(async()=>{const p=await this.makeRequest(i);if(p.type==="Fail")throw new Error(p.error||"failed to set session metadata")})}async publishEvent(s,u,i=!1){const p=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},u),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),b={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:s,data:p,callWebhook:i};return this.setOnceLinked(async()=>{const m=await this.makeRequest(b);if(m.type==="Fail")throw new Error(m.error||"failed to publish event");return m.eventId})}sendData(s){this.ws.sendData(JSON.stringify(s))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>o*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(s,u=h){const i=s.id;this.sendData(s);let p;return Promise.race([new Promise((b,m)=>{p=window.setTimeout(()=>{m(new Error(`request ${i} timed out`))},u)}),new Promise(b=>{this.requestResolutions.set(i,m=>{clearTimeout(p),b(m),this.requestResolutions.delete(i)})})])}async authenticate(){const s={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},u=await this.makeRequest(s);if(u.type==="Fail")throw new Error(u.error||"failed to authentcate")}sendIsLinked(){const s={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}sendGetSessionConfig(){const s={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(s)}};return Nt.WalletLinkConnection=d,Nt}var Ot={},Ze={},lr={},$o;function ud(){return $o||($o=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.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}'),lr}var Uo;function Ku(){if(Uo)return Ze;Uo=1;var e=Ze&&Ze.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.injectCssReset=void 0;const n=e(ud());function r(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(n.default)),document.documentElement.appendChild(t)}return Ze.injectCssReset=r,Ze}var Ft={};const Se=Cr(jl);var Ke={};const Lr=Cr($l);var je={},Dt={},Ho;function ld(){if(Ho)return Dt;Ho=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.CloseIcon=void 0;const e=Se;function n(r){return(0,e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return Dt.CloseIcon=n,Dt}var qt={},Wo;function dd(){if(Wo)return qt;Wo=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.CoinbaseWalletRound=void 0;const e=Se;function n(r){return(0,e.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,e.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,e.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"}))}return qt.CoinbaseWalletRound=n,qt}var jt={},Vo;function hd(){if(Vo)return jt;Vo=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.QRCodeIcon=void 0;const e=Se;function n(r){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,e.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,e.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,e.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}return jt.QRCodeIcon=n,jt}var Qe={},$n,zo;function fd(){if(zo)return $n;zo=1;function e(i){this.mode=r.MODE_8BIT_BYTE,this.data=i,this.parsedData=[];for(var p=0,b=this.data.length;p<b;p++){var m=[],a=this.data.charCodeAt(p);a>65536?(m[0]=240|(a&1835008)>>>18,m[1]=128|(a&258048)>>>12,m[2]=128|(a&4032)>>>6,m[3]=128|a&63):a>2048?(m[0]=224|(a&61440)>>>12,m[1]=128|(a&4032)>>>6,m[2]=128|a&63):a>128?(m[0]=192|(a&1984)>>>6,m[1]=128|a&63):m[0]=a,this.parsedData.push(m)}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))}e.prototype={getLength:function(i){return this.parsedData.length},write:function(i){for(var p=0,b=this.parsedData.length;p<b;p++)i.put(this.parsedData[p],8)}};function n(i,p){this.typeNumber=i,this.errorCorrectLevel=p,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}n.prototype={addData:function(i){var p=new e(i);this.dataList.push(p),this.dataCache=null},isDark:function(i,p){if(i<0||this.moduleCount<=i||p<0||this.moduleCount<=p)throw new Error(i+","+p);return this.modules[i][p]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(i,p){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++){this.modules[b]=new Array(this.moduleCount);for(var m=0;m<this.moduleCount;m++)this.modules[b][m]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(i,p),this.typeNumber>=7&&this.setupTypeNumber(i),this.dataCache==null&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,p)},setupPositionProbePattern:function(i,p){for(var b=-1;b<=7;b++)if(!(i+b<=-1||this.moduleCount<=i+b))for(var m=-1;m<=7;m++)p+m<=-1||this.moduleCount<=p+m||(0<=b&&b<=6&&(m==0||m==6)||0<=m&&m<=6&&(b==0||b==6)||2<=b&&b<=4&&2<=m&&m<=4?this.modules[i+b][p+m]=!0:this.modules[i+b][p+m]=!1)},getBestMaskPattern:function(){for(var i=0,p=0,b=0;b<8;b++){this.makeImpl(!0,b);var m=l.getLostPoint(this);(b==0||i>m)&&(i=m,p=b)}return p},createMovieClip:function(i,p,b){var m=i.createEmptyMovieClip(p,b),a=1;this.make();for(var w=0;w<this.modules.length;w++)for(var v=w*a,R=0;R<this.modules[w].length;R++){var S=R*a,x=this.modules[w][R];x&&(m.beginFill(0,100),m.moveTo(S,v),m.lineTo(S+a,v),m.lineTo(S+a,v+a),m.lineTo(S,v+a),m.endFill())}return m},setupTimingPattern:function(){for(var i=8;i<this.moduleCount-8;i++)this.modules[i][6]==null&&(this.modules[i][6]=i%2==0);for(var p=8;p<this.moduleCount-8;p++)this.modules[6][p]==null&&(this.modules[6][p]=p%2==0)},setupPositionAdjustPattern:function(){for(var i=l.getPatternPosition(this.typeNumber),p=0;p<i.length;p++)for(var b=0;b<i.length;b++){var m=i[p],a=i[b];if(this.modules[m][a]==null)for(var w=-2;w<=2;w++)for(var v=-2;v<=2;v++)w==-2||w==2||v==-2||v==2||w==0&&v==0?this.modules[m+w][a+v]=!0:this.modules[m+w][a+v]=!1}},setupTypeNumber:function(i){for(var p=l.getBCHTypeNumber(this.typeNumber),b=0;b<18;b++){var m=!i&&(p>>b&1)==1;this.modules[Math.floor(b/3)][b%3+this.moduleCount-8-3]=m}for(var b=0;b<18;b++){var m=!i&&(p>>b&1)==1;this.modules[b%3+this.moduleCount-8-3][Math.floor(b/3)]=m}},setupTypeInfo:function(i,p){for(var b=this.errorCorrectLevel<<3|p,m=l.getBCHTypeInfo(b),a=0;a<15;a++){var w=!i&&(m>>a&1)==1;a<6?this.modules[a][8]=w:a<8?this.modules[a+1][8]=w:this.modules[this.moduleCount-15+a][8]=w}for(var a=0;a<15;a++){var w=!i&&(m>>a&1)==1;a<8?this.modules[8][this.moduleCount-a-1]=w:a<9?this.modules[8][15-a-1+1]=w:this.modules[8][15-a-1]=w}this.modules[this.moduleCount-8][8]=!i},mapData:function(i,p){for(var b=-1,m=this.moduleCount-1,a=7,w=0,v=this.moduleCount-1;v>0;v-=2)for(v==6&&v--;;){for(var R=0;R<2;R++)if(this.modules[m][v-R]==null){var S=!1;w<i.length&&(S=(i[w]>>>a&1)==1);var x=l.getMask(p,m,v-R);x&&(S=!S),this.modules[m][v-R]=S,a--,a==-1&&(w++,a=7)}if(m+=b,m<0||this.moduleCount<=m){m-=b,b=-b;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(i,p,b){for(var m=d.getRSBlocks(i,p),a=new f,w=0;w<b.length;w++){var v=b[w];a.put(v.mode,4),a.put(v.getLength(),l.getLengthInBits(v.mode,i)),v.write(a)}for(var R=0,w=0;w<m.length;w++)R+=m[w].dataCount;if(a.getLengthInBits()>R*8)throw new Error("code length overflow. ("+a.getLengthInBits()+">"+R*8+")");for(a.getLengthInBits()+4<=R*8&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=R*8||(a.put(n.PAD0,8),a.getLengthInBits()>=R*8));)a.put(n.PAD1,8);return n.createBytes(a,m)},n.createBytes=function(i,p){for(var b=0,m=0,a=0,w=new Array(p.length),v=new Array(p.length),R=0;R<p.length;R++){var S=p[R].dataCount,x=p[R].totalCount-S;m=Math.max(m,S),a=Math.max(a,x),w[R]=new Array(S);for(var A=0;A<w[R].length;A++)w[R][A]=255&i.buffer[A+b];b+=S;var M=l.getErrorCorrectPolynomial(x),D=new h(w[R],M.getLength()-1),V=D.mod(M);v[R]=new Array(M.getLength()-1);for(var A=0;A<v[R].length;A++){var Z=A+V.getLength()-v[R].length;v[R][A]=Z>=0?V.get(Z):0}}for(var Y=0,A=0;A<p.length;A++)Y+=p[A].totalCount;for(var ne=new Array(Y),H=0,A=0;A<m;A++)for(var R=0;R<p.length;R++)A<w[R].length&&(ne[H++]=w[R][A]);for(var A=0;A<a;A++)for(var R=0;R<p.length;R++)A<v[R].length&&(ne[H++]=v[R][A]);return ne};for(var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},g={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},l={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(i){for(var p=i<<10;l.getBCHDigit(p)-l.getBCHDigit(l.G15)>=0;)p^=l.G15<<l.getBCHDigit(p)-l.getBCHDigit(l.G15);return(i<<10|p)^l.G15_MASK},getBCHTypeNumber:function(i){for(var p=i<<12;l.getBCHDigit(p)-l.getBCHDigit(l.G18)>=0;)p^=l.G18<<l.getBCHDigit(p)-l.getBCHDigit(l.G18);return i<<12|p},getBCHDigit:function(i){for(var p=0;i!=0;)p++,i>>>=1;return p},getPatternPosition:function(i){return l.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,p,b){switch(i){case g.PATTERN000:return(p+b)%2==0;case g.PATTERN001:return p%2==0;case g.PATTERN010:return b%3==0;case g.PATTERN011:return(p+b)%3==0;case g.PATTERN100:return(Math.floor(p/2)+Math.floor(b/3))%2==0;case g.PATTERN101:return p*b%2+p*b%3==0;case g.PATTERN110:return(p*b%2+p*b%3)%2==0;case g.PATTERN111:return(p*b%3+(p+b)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){for(var p=new h([1],0),b=0;b<i;b++)p=p.multiply(new h([1,c.gexp(b)],0));return p},getLengthInBits:function(i,p){if(1<=p&&p<10)switch(i){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:return 8;case r.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(p<27)switch(i){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(p<41)switch(i){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+p)},getLostPoint:function(i){for(var p=i.getModuleCount(),b=0,m=0;m<p;m++)for(var a=0;a<p;a++){for(var w=0,v=i.isDark(m,a),R=-1;R<=1;R++)if(!(m+R<0||p<=m+R))for(var S=-1;S<=1;S++)a+S<0||p<=a+S||R==0&&S==0||v==i.isDark(m+R,a+S)&&w++;w>5&&(b+=3+w-5)}for(var m=0;m<p-1;m++)for(var a=0;a<p-1;a++){var x=0;i.isDark(m,a)&&x++,i.isDark(m+1,a)&&x++,i.isDark(m,a+1)&&x++,i.isDark(m+1,a+1)&&x++,(x==0||x==4)&&(b+=3)}for(var m=0;m<p;m++)for(var a=0;a<p-6;a++)i.isDark(m,a)&&!i.isDark(m,a+1)&&i.isDark(m,a+2)&&i.isDark(m,a+3)&&i.isDark(m,a+4)&&!i.isDark(m,a+5)&&i.isDark(m,a+6)&&(b+=40);for(var a=0;a<p;a++)for(var m=0;m<p-6;m++)i.isDark(m,a)&&!i.isDark(m+1,a)&&i.isDark(m+2,a)&&i.isDark(m+3,a)&&i.isDark(m+4,a)&&!i.isDark(m+5,a)&&i.isDark(m+6,a)&&(b+=40);for(var A=0,a=0;a<p;a++)for(var m=0;m<p;m++)i.isDark(m,a)&&A++;var M=Math.abs(100*A/p/p-50)/5;return b+=M*10,b}},c={glog:function(i){if(i<1)throw new Error("glog("+i+")");return c.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return c.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},o=0;o<8;o++)c.EXP_TABLE[o]=1<<o;for(var o=8;o<256;o++)c.EXP_TABLE[o]=c.EXP_TABLE[o-4]^c.EXP_TABLE[o-5]^c.EXP_TABLE[o-6]^c.EXP_TABLE[o-8];for(var o=0;o<255;o++)c.LOG_TABLE[c.EXP_TABLE[o]]=o;function h(i,p){if(i.length==null)throw new Error(i.length+"/"+p);for(var b=0;b<i.length&&i[b]==0;)b++;this.num=new Array(i.length-b+p);for(var m=0;m<i.length-b;m++)this.num[m]=i[m+b]}h.prototype={get:function(i){return this.num[i]},getLength:function(){return this.num.length},multiply:function(i){for(var p=new Array(this.getLength()+i.getLength()-1),b=0;b<this.getLength();b++)for(var m=0;m<i.getLength();m++)p[b+m]^=c.gexp(c.glog(this.get(b))+c.glog(i.get(m)));return new h(p,0)},mod:function(i){if(this.getLength()-i.getLength()<0)return this;for(var p=c.glog(this.get(0))-c.glog(i.get(0)),b=new Array(this.getLength()),m=0;m<this.getLength();m++)b[m]=this.get(m);for(var m=0;m<i.getLength();m++)b[m]^=c.gexp(c.glog(i.get(m))+p);return new h(b,0).mod(i)}};function d(i,p){this.totalCount=i,this.dataCount=p}d.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],[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]],d.getRSBlocks=function(i,p){var b=d.getRsBlockTable(i,p);if(b==null)throw new Error("bad rs block @ typeNumber:"+i+"/errorCorrectLevel:"+p);for(var m=b.length/3,a=[],w=0;w<m;w++)for(var v=b[w*3+0],R=b[w*3+1],S=b[w*3+2],x=0;x<v;x++)a.push(new d(R,S));return a},d.getRsBlockTable=function(i,p){switch(p){case t.L:return d.RS_BLOCK_TABLE[(i-1)*4+0];case t.M:return d.RS_BLOCK_TABLE[(i-1)*4+1];case t.Q:return d.RS_BLOCK_TABLE[(i-1)*4+2];case t.H:return d.RS_BLOCK_TABLE[(i-1)*4+3];default:return}};function f(){this.buffer=[],this.length=0}f.prototype={get:function(i){var p=Math.floor(i/8);return(this.buffer[p]>>>7-i%8&1)==1},put:function(i,p){for(var b=0;b<p;b++)this.putBit((i>>>p-b-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(i){var p=Math.floor(this.length/8);this.buffer.length<=p&&this.buffer.push(0),i&&(this.buffer[p]|=128>>>this.length%8),this.length++}};var s=[[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 u(i){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof i=="string"&&(i={content:i}),i)for(var p in i)this.options[p]=i[p];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 b(S){switch(S){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Error("Unknwon error correction level: "+S)}}function m(S,x){for(var A=a(S),M=1,D=0,V=0,Z=s.length;V<=Z;V++){var Y=s[V];if(!Y)throw new Error("Content too long: expected "+D+" but got "+A);switch(x){case"L":D=Y[0];break;case"M":D=Y[1];break;case"Q":D=Y[2];break;case"H":D=Y[3];break;default:throw new Error("Unknwon error correction level: "+x)}if(A<=D)break;M++}if(M>s.length)throw new Error("Content too long");return M}function a(S){var x=encodeURI(S).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return x.length+(x.length!=S?3:0)}var w=this.options.content,v=m(w,this.options.ecl),R=b(this.options.ecl);this.qrcode=new n(v,R),this.qrcode.addData(w),this.qrcode.make()}return u.prototype.svg=function(i){var p=this.options||{},b=this.qrcode.modules;typeof i>"u"&&(i={container:p.container||"svg"});for(var m=typeof p.pretty<"u"?!!p.pretty:!0,a=m?" ":"",w=m?`\r
2
2
  `:"",v=p.width,R=p.height,S=b.length,x=v/(S+2*p.padding),A=R/(S+2*p.padding),M=typeof p.join<"u"?!!p.join:!1,D=typeof p.swap<"u"?!!p.swap:!1,V=typeof p.xmlDeclaration<"u"?!!p.xmlDeclaration:!0,Z=typeof p.predefined<"u"?!!p.predefined:!1,Y=Z?a+'<defs><path id="qrmodule" d="M0 0 h'+A+" v"+x+' H0 z" style="fill:'+p.color+';shape-rendering:crispEdges;" /></defs>'+w:"",ne=a+'<rect x="0" y="0" width="'+v+'" height="'+R+'" style="fill:'+p.background+';shape-rendering:crispEdges;"/>'+w,H="",F="",T=0;T<S;T++)for(var O=0;O<S;O++){var W=b[O][T];if(W){var U=O*x+p.padding*x,G=T*A+p.padding*A;if(D){var Q=U;U=G,G=Q}if(M){var J=x+U,ee=A+G;U=Number.isInteger(U)?Number(U):U.toFixed(2),G=Number.isInteger(G)?Number(G):G.toFixed(2),J=Number.isInteger(J)?Number(J):J.toFixed(2),ee=Number.isInteger(ee)?Number(ee):ee.toFixed(2),F+="M"+U+","+G+" V"+ee+" H"+J+" V"+G+" H"+U+" Z "}else Z?H+=a+'<use x="'+U.toString()+'" y="'+G.toString()+'" href="#qrmodule" />'+w:H+=a+'<rect x="'+U.toString()+'" y="'+G.toString()+'" width="'+x+'" height="'+A+'" style="fill:'+p.color+';shape-rendering:crispEdges;"/>'+w}}M&&(H=a+'<path x="0" y="0" style="fill:'+p.color+';shape-rendering:crispEdges;" d="'+F+'" />');let ae="";if(this.options.image!==void 0&&this.options.image.svg){const B=v*this.options.image.width/100,N=R*this.options.image.height/100,j=v/2-B/2,K=R/2-N/2;ae+=`<svg x="${j}" y="${K}" width="${B}" height="${N}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,ae+=this.options.image.svg+w,ae+="</svg>"}var te="";switch(i.container){case"svg":V&&(te+='<?xml version="1.0" standalone="yes"?>'+w),te+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+v+'" height="'+R+'">'+w,te+=Y+ne+H,te+=ae,te+="</svg>";break;case"svg-viewbox":V&&(te+='<?xml version="1.0" standalone="yes"?>'+w),te+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+v+" "+R+'">'+w,te+=Y+ne+H,te+=ae,te+="</svg>";break;case"g":te+='<g width="'+v+'" height="'+R+'">'+w,te+=Y+ne+H,te+=ae,te+="</g>";break;default:te+=(Y+ne+H+ae).replace(/^\s+/,"");break}return te},$n=u,$n}var Jo;function pd(){if(Jo)return Qe;Jo=1;var e=Qe&&Qe.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.QRCode=void 0;const n=Se,r=Lr,t=e(fd()),g=l=>{const[c,o]=(0,r.useState)("");return(0,r.useEffect)(()=>{var h,d;const f=new t.default({content:l.content,background:l.bgColor||"#ffffff",color:l.fgColor||"#000000",container:"svg",ecl:"M",width:(h=l.width)!==null&&h!==void 0?h:256,height:(d=l.height)!==null&&d!==void 0?d:256,padding:0,image:l.image}),s=oe.from(f.svg(),"utf8").toString("base64");o(`data:image/svg+xml;base64,${s}`)},[l.bgColor,l.content,l.fgColor,l.height,l.image,l.width]),c?(0,n.h)("img",{src:c,alt:"QR Code"}):null};return Qe.QRCode=g,Qe}var Ye={},dr={},Go;function gd(){return Go||(Go=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.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)}}"),dr}var Zo;function md(){if(Zo)return Ye;Zo=1;var e=Ye&&Ye.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.Spinner=void 0;const n=Se,r=e(gd()),t=g=>{var l;const c=(l=g.size)!==null&&l!==void 0?l:64,o=g.color||"#000";return(0,n.h)("div",{class:"-cbwsdk-spinner"},(0,n.h)("style",null,r.default),(0,n.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:c,height:c}},(0,n.h)("circle",{style:{cx:50,cy:50,r:45,stroke:o}})))};return Ye.Spinner=t,Ye}var hr={},Ko;function bd(){return Ko||(Ko=1,Object.defineProperty(hr,"__esModule",{value:!0}),hr.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}"),hr}var Qo;function yd(){if(Qo)return je;Qo=1;var e=je&&je.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(je,"__esModule",{value:!0}),je.CoinbaseWalletSteps=je.ConnectContent=void 0;const n=e(nr),r=Se,t=Ue(),g=Fs(),l=ld(),c=dd(),o=hd(),h=pd(),d=md(),f=e(bd()),s={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:b},u=m=>m==="light"?"#FFFFFF":"#0A0B0D";function i(m){const{theme:a}=m,w=(0,t.createQrUrl)(m.sessionId,m.sessionSecret,m.linkAPIUrl,m.isParentConnection,m.version,m.chainId),v=s.steps;return(0,r.h)("div",{"data-testid":"connect-content",className:(0,n.default)("-cbwsdk-connect-content",a)},(0,r.h)("style",null,f.default),(0,r.h)("div",{className:"-cbwsdk-connect-content-header"},(0,r.h)("h2",{className:(0,n.default)("-cbwsdk-connect-content-heading",a)},"Scan to connect with our mobile app"),m.onCancel&&(0,r.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:m.onCancel},(0,r.h)(l.CloseIcon,{fill:a==="light"?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,r.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,r.h)(p,{title:s.title,description:s.description,theme:a})),(0,r.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,r.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,r.h)(h.QRCode,{content:w,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,r.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:g.LIB_VERSION}),(0,r.h)("input",{type:"hidden",value:w})),(0,r.h)(v,{theme:a}),!m.isConnected&&(0,r.h)("div",{"data-testid":"connecting-spinner",className:(0,n.default)("-cbwsdk-connect-content-qr-connecting",a)},(0,r.h)(d.Spinner,{size:36,color:a==="dark"?"#FFF":"#000"}),(0,r.h)("p",null,"Connecting...")))))}je.ConnectContent=i;function p({title:m,description:a,theme:w}){return(0,r.h)("div",{className:(0,n.default)("-cbwsdk-connect-item",w)},(0,r.h)("div",null,(0,r.h)(c.CoinbaseWalletRound,null)),(0,r.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,r.h)("h3",{className:"-cbwsdk-connect-item-title"},m),(0,r.h)("p",{className:"-cbwsdk-connect-item-description"},a)))}function b({theme:m}){return(0,r.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,r.h)("li",{className:(0,n.default)("-cbwsdk-wallet-steps-item",m)},(0,r.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,r.h)("li",{className:(0,n.default)("-cbwsdk-wallet-steps-item",m)},(0,r.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,r.h)("span",null,"Tap ",(0,r.h)("strong",null,"Scan")," "),(0,r.h)("span",{className:(0,n.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",m)},(0,r.h)(o.QRCodeIcon,{fill:u(m)})))))}return je.CoinbaseWalletSteps=b,je}var Xe={},$t={},Yo;function wd(){if(Yo)return $t;Yo=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.ArrowLeftIcon=void 0;const e=Se;function n(r){return(0,e.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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"}))}return $t.ArrowLeftIcon=n,$t}var Ut={},Xo;function _d(){if(Xo)return Ut;Xo=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.LaptopIcon=void 0;const e=Se;function n(r){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,e.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"}))}return Ut.LaptopIcon=n,Ut}var Ht={},ea;function vd(){if(ea)return Ht;ea=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.SafeIcon=void 0;const e=Se;function n(r){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},r),(0,e.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.8001 5.20598 8.8001 6.2001Z"}))}return Ht.SafeIcon=n,Ht}var fr={},ta;function Ed(){return ta||(ta=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.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}"),fr}var ra;function Rd(){if(ra)return Xe;ra=1;var e=Xe&&Xe.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.TryExtensionContent=void 0;const n=e(nr),r=Se,t=Lr,g=wd(),l=_d(),c=vd(),o=e(Ed());function h({theme:d}){const[f,s]=(0,t.useState)(!1),u=(0,t.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,t.useCallback)(()=>{f?window.location.reload():(u(),s(!0))},[u,f]);return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-try-extension",d)},(0,r.h)("style",null,o.default),(0,r.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,r.h)("h3",{class:(0,n.default)("-cbwsdk-try-extension-heading",d)},"Or try the Coinbase Wallet browser extension"),(0,r.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,r.h)("button",{class:(0,n.default)("-cbwsdk-try-extension-cta",d),onClick:i},f?"Refresh":"Install"),(0,r.h)("div",null,!f&&(0,r.h)(g.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:d==="light"?"#0052FF":"#588AF5"})))),(0,r.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,r.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,r.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,r.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,r.h)("span",{class:(0,n.default)("-cbwsdk-try-extension-list-item-icon",d)},(0,r.h)(l.LaptopIcon,{fill:d==="light"?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-try-extension-list-item-copy",d)},"Connect with dapps with just one click on your desktop browser")),(0,r.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,r.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,r.h)("span",{class:(0,n.default)("-cbwsdk-try-extension-list-item-icon",d)},(0,r.h)(c.SafeIcon,{fill:d==="light"?"#0A0B0D":"#FFFFFF"}))),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-try-extension-list-item-copy",d)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}return Xe.TryExtensionContent=h,Xe}var pr={},na;function Sd(){return na||(na=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.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}.-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}"),pr}var ia;function Cd(){if(ia)return Ke;ia=1;var e=Ke&&Ke.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.ConnectDialog=void 0;const n=e(nr),r=Se,t=Lr,g=yd(),l=Rd(),c=e(Sd()),o=h=>{const{isOpen:d,darkMode:f}=h,[s,u]=(0,t.useState)(!d),[i,p]=(0,t.useState)(!d);(0,t.useEffect)(()=>{const m=[window.setTimeout(()=>{p(!d)},10)];return d?u(!1):m.push(window.setTimeout(()=>{u(!0)},360)),()=>{m.forEach(window.clearTimeout)}},[d]);const b=f?"dark":"light";return(0,r.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-container",s&&"-cbwsdk-connect-dialog-container-hidden")},(0,r.h)("style",null,c.default),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-backdrop",b,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,r.h)("div",{class:"-cbwsdk-connect-dialog"},(0,r.h)("div",{class:(0,n.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},h.connectDisabled?null:(0,r.h)(g.ConnectContent,{theme:b,version:h.version,sessionId:h.sessionId,sessionSecret:h.sessionSecret,linkAPIUrl:h.linkAPIUrl,isConnected:h.isConnected,isParentConnection:h.isParentConnection,chainId:h.chainId,onCancel:h.onCancel}),(0,r.h)(l.TryExtensionContent,{theme:b}))))};return Ke.ConnectDialog=o,Ke}var sa;function kd(){if(sa)return Ft;sa=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.LinkFlow=void 0;const e=Se,n=Cd();let r=class{constructor(g){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=g.darkMode,this.version=g.version,this.sessionId=g.sessionId,this.sessionSecret=g.sessionSecret,this.linkAPIUrl=g.linkAPIUrl,this.isParentConnection=g.isParentConnection}attach(g){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",g.appendChild(this.root),this.render()}setConnected(g){this.connected!==g&&(this.connected=g,this.render())}setChainId(g){this.chainId!==g&&(this.chainId=g,this.render())}detach(){var g;this.root&&((0,e.render)(null,this.root),(g=this.root.parentElement)===null||g===void 0||g.removeChild(this.root))}setConnectDisabled(g){this.connectDisabled=g}open(g){this.isOpen=!0,this.onCancel=g.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,e.render)((0,e.h)(n.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)}};return Ft.LinkFlow=r,Ft}var Wt={},gr={},oa;function Id(){return oa||(oa=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.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;cursor: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}"),gr}var aa;function Qu(){return aa||(aa=1,(function(e){var n=Wt&&Wt.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=n(nr),t=Se,g=Lr,l=n(Id()),c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{constructor(u){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=u.darkMode}attach(u){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",u.appendChild(this.root),this.render()}presentItem(u){const i=this.nextItemKey++;return this.items.set(i,u),this.render(),()=>{this.items.delete(i),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,t.render)((0,t.h)("div",null,(0,t.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([u,i])=>(0,t.h)(e.SnackbarInstance,Object.assign({},i,{key:u}))))),this.root)}}e.Snackbar=h;const d=s=>(0,t.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,t.h)("style",null,l.default),(0,t.h)("div",{class:"-cbwsdk-snackbar"},s.children));e.SnackbarContainer=d;const f=({autoExpand:s,message:u,menuItems:i})=>{const[p,b]=(0,g.useState)(!0),[m,a]=(0,g.useState)(s??!1);(0,g.useEffect)(()=>{const v=[window.setTimeout(()=>{b(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{v.forEach(window.clearTimeout)}});const w=()=>{a(!m)};return(0,t.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",p&&"-cbwsdk-snackbar-instance-hidden",m&&"-cbwsdk-snackbar-instance-expanded")},(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:w},(0,t.h)("img",{src:c,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},u),(0,t.h)("div",{class:"-gear-container"},!m&&(0,t.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,t.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),i&&i.length>0&&(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},i.map((v,R)=>(0,t.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",v.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:v.onClick,key:R},(0,t.h)("svg",{width:v.svgWidth,height:v.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("path",{"fill-rule":v.defaultFillRule,"clip-rule":v.defaultClipRule,d:v.path,fill:"#AAAAAA"})),(0,t.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",v.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},v.info)))))};e.SnackbarInstance=f})(Wt)),Wt}var ca;function Yu(){if(ca)return Ot;ca=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.WalletLinkRelayUI=void 0;const e=Ku(),n=kd(),r=Qu();let t=class{constructor(l){this.standalone=null,this.attached=!1,this.snackbar=new r.Snackbar({darkMode:l.darkMode}),this.linkFlow=new n.LinkFlow({darkMode:l.darkMode,version:l.version,sessionId:l.session.id,sessionSecret:l.session.secret,linkAPIUrl:l.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const l=document.documentElement,c=document.createElement("div");c.className="-cbwsdk-css-reset",l.appendChild(c),this.linkFlow.attach(c),this.snackbar.attach(c),this.attached=!0,(0,e.injectCssReset)()}setConnected(l){this.linkFlow.setConnected(l)}setChainId(l){this.linkFlow.setChainId(l)}setConnectDisabled(l){this.linkFlow.setConnectDisabled(l)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(l){this.linkFlow.open({onCancel:l.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(l){let c;return l.isUnlinkedErrorState?c={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.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:l.onResetConnection}]}:c={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:l.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:l.onResetConnection}]},this.snackbar.presentItem(c)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(l){this.standalone=l}isStandalone(){var l;return(l=this.standalone)!==null&&l!==void 0?l:!1}};return Ot.WalletLinkRelayUI=t,Ot}var ua;function Xu(){if(ua)return xt;ua=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.WalletLinkRelay=void 0;const e=Ar(),n=xr(),r=Ue(),t=Ds(),g=qs(),l=js(),c=cd(),o=Os(),h=Yu();let d=class ht extends g.RelayAbstract{constructor(s){var u;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=m=>{var a;this.isLinked=m;const w=this.storage.getItem(g.LOCAL_STORAGE_ADDRESSES_KEY);if(m&&(this.session.linked=m),this.isUnlinkedErrorState=!1,w){const v=w.split(" "),R=this.storage.getItem("IsStandaloneSigning")==="true";if(v[0]!==""&&!m&&this.session.linked&&!R){this.isUnlinkedErrorState=!0;const S=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(t.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:S})}}},this.metadataUpdated=(m,a)=>{this.storage.setItem(m,a)},this.chainUpdated=(m,a)=>{this.chainCallbackParams.chainId===m&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:m,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(m,a))},this.accountUpdated=m=>{this.accountsCallback&&this.accountsCallback([m]),ht.accountRequestCallbackIds.size>0&&(Array.from(ht.accountRequestCallbackIds.values()).forEach(a=>{const w={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[m]}};this.invokeCallback(Object.assign(Object.assign({},w),{id:a}))}),ht.accountRequestCallbackIds.clear())},this.connectedUpdated=m=>{this.ui.setConnected(m)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=s.linkAPIUrl,this.storage=s.storage,this.options=s;const{session:i,ui:p,connection:b}=this.subscribe();this._session=i,this.connection=b,this.relayEventManager=s.relayEventManager,this.diagnostic=s.diagnosticLogger,this._reloadOnDisconnect=(u=s.reloadOnDisconnect)!==null&&u!==void 0?u:!0,this.ui=p}subscribe(){const s=l.Session.load(this.storage)||new l.Session(this.storage).save(),{linkAPIUrl:u,diagnostic:i}=this,p=new c.WalletLinkConnection({session:s,linkAPIUrl:u,diagnostic:i,listener:this}),{version:b,darkMode:m}=this.options,a=this.options.uiConstructor({linkAPIUrl:u,version:b,darkMode:m,session:s});return p.connect(),{session:s,ui:a,connection:p}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(s=>setTimeout(()=>s(null),1e3))]).then(()=>{var s,u;const i=this.ui.isStandalone();(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const p=l.Session.load(this.storage);if(p?.id===this._session.id?this.storage.clear():p&&((u=this.diagnostic)===null||u===void 0||u.log(t.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:l.Session.hash(p.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:b,ui:m,connection:a}=this.subscribe();this._session=b,this.connection=a,this.ui=m,i&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(s=>{var u;(u=this.diagnostic)===null||u===void 0||u.log(t.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${s}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(s,u){this.appName=s,this.appLogoUrl=u}getStorageItem(s){return this.storage.getItem(s)}get session(){return this._session}setStorageItem(s,u){this.storage.setItem(s,u)}signEthereumMessage(s,u,i,p){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,r.hexStringFromBuffer)(s,!0),address:u,addPrefix:i,typedDataJson:p||null}})}ethereumAddressFromSignedMessage(s,u,i){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,r.hexStringFromBuffer)(s,!0),signature:(0,r.hexStringFromBuffer)(u,!0),addPrefix:i}})}signEthereumTransaction(s){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:s.fromAddress,toAddress:s.toAddress,weiValue:(0,r.bigIntStringFromBN)(s.weiValue),data:(0,r.hexStringFromBuffer)(s.data,!0),nonce:s.nonce,gasPriceInWei:s.gasPriceInWei?(0,r.bigIntStringFromBN)(s.gasPriceInWei):null,maxFeePerGas:s.gasPriceInWei?(0,r.bigIntStringFromBN)(s.gasPriceInWei):null,maxPriorityFeePerGas:s.gasPriceInWei?(0,r.bigIntStringFromBN)(s.gasPriceInWei):null,gasLimit:s.gasLimit?(0,r.bigIntStringFromBN)(s.gasLimit):null,chainId:s.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(s){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:s.fromAddress,toAddress:s.toAddress,weiValue:(0,r.bigIntStringFromBN)(s.weiValue),data:(0,r.hexStringFromBuffer)(s.data,!0),nonce:s.nonce,gasPriceInWei:s.gasPriceInWei?(0,r.bigIntStringFromBN)(s.gasPriceInWei):null,maxFeePerGas:s.maxFeePerGas?(0,r.bigIntStringFromBN)(s.maxFeePerGas):null,maxPriorityFeePerGas:s.maxPriorityFeePerGas?(0,r.bigIntStringFromBN)(s.maxPriorityFeePerGas):null,gasLimit:s.gasLimit?(0,r.bigIntStringFromBN)(s.gasLimit):null,chainId:s.chainId,shouldSubmit:!0}})}submitEthereumTransaction(s,u){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,r.hexStringFromBuffer)(s,!0),chainId:u}})}scanQRCode(s){return this.sendRequest({method:"scanQRCode",params:{regExp:s}})}getQRCodeUrl(){return(0,r.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(s,u){return this.sendRequest({method:"generic",params:{action:u,data:s}})}sendGenericMessage(s){return this.sendRequest(s)}sendRequest(s){let u=null;const i=(0,r.randomBytesHex)(8),p=m=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,s.method,m),u?.()};return{promise:new Promise((m,a)=>{this.ui.isStandalone()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(i,w=>{if(u?.(),(0,o.isErrorResponse)(w))return a(new Error(w.errorMessage));m(w)}),this.ui.isStandalone()?this.sendRequestStandalone(i,s):this.publishWeb3RequestEvent(i,s)}),cancel:p}}setConnectDisabled(s){this.ui.setConnectDisabled(s)}setAccountsCallback(s){this.accountsCallback=s}setChainCallback(s){this.chainCallback=s}setDappDefaultChainCallback(s){this.dappDefaultChain=s,this.ui instanceof h.WalletLinkRelayUI&&this.ui.setChainId(s)}publishWeb3RequestEvent(s,u){var i;const p={type:"WEB3_REQUEST",id:s,request:u},b=l.Session.load(this.storage);(i=this.diagnostic)===null||i===void 0||i.log(t.EVENTS.WEB3_REQUEST,{eventId:p.id,method:`relay::${u.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:b?l.Session.hash(b.id):"",isSessionMismatched:(b?.id!==this._session.id).toString()}),this.publishEvent("Web3Request",p,!0).then(m=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(t.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:p.id,method:`relay::${u.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:b?l.Session.hash(b.id):"",isSessionMismatched:(b?.id!==this._session.id).toString()})}).catch(m=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p.id,response:{method:u.method,errorMessage:m.message}})})}publishWeb3RequestCanceledEvent(s){const u={type:"WEB3_REQUEST_CANCELED",id:s};this.publishEvent("Web3RequestCanceled",u,!1).then()}publishEvent(s,u,i){return this.connection.publishEvent(s,u,i)}handleWeb3ResponseMessage(s){var u;const{response:i}=s;if((u=this.diagnostic)===null||u===void 0||u.log(t.EVENTS.WEB3_RESPONSE,{eventId:s.id,method:`relay::${i.method}`,sessionIdHash:this.getSessionIdHash()}),i.method==="requestEthereumAccounts"){ht.accountRequestCallbackIds.forEach(p=>this.invokeCallback(Object.assign(Object.assign({},s),{id:p}))),ht.accountRequestCallbackIds.clear();return}this.invokeCallback(s)}handleErrorResponse(s,u,i,p){var b;const m=(b=i?.message)!==null&&b!==void 0?b:(0,e.getMessageFromCode)(p);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:u,errorMessage:m,errorCode:p}})}invokeCallback(s){const u=this.relayEventManager.callbacks.get(s.id);u&&(u(s.response),this.relayEventManager.callbacks.delete(s.id))}requestEthereumAccounts(){const s={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},u=(0,r.randomBytesHex)(8),i=b=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,s.method,b)};return{promise:new Promise((b,m)=>{if(this.relayEventManager.callbacks.set(u,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,o.isErrorResponse)(a))return m(new Error(a.errorMessage));b(a)}),this.ui.inlineAccountsResponse()){const a=w=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"requestEthereumAccounts",result:w}})};this.ui.requestEthereumAccounts({onCancel:i,onAccounts:a})}else{const a=e.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>i(a)})}ht.accountRequestCallbackIds.add(u),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,s)}),cancel:i}}selectProvider(s){const u={method:"selectProvider"},i=(0,r.randomBytesHex)(8),p=m=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,u.method,m)},b=new Promise((m,a)=>{this.relayEventManager.callbacks.set(i,R=>{if((0,o.isErrorResponse)(R))return a(new Error(R.errorMessage));m(R)});const w=R=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"selectProvider",result:n.ProviderType.Unselected}})},v=R=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"selectProvider",result:R}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:v,onCancel:w,providerOptions:s})});return{cancel:p,promise:b}}watchAsset(s,u,i,p,b,m){const a={method:"watchAsset",params:{type:s,options:{address:u,symbol:i,decimals:p,image:b},chainId:m}};let w=null;const v=(0,r.randomBytesHex)(8),R=x=>{this.publishWeb3RequestCanceledEvent(v),this.handleErrorResponse(v,a.method,x),w?.()};this.ui.inlineWatchAsset()||(w=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:R,onResetConnection:this.resetAndReload}));const S=new Promise((x,A)=>{this.relayEventManager.callbacks.set(v,V=>{if(w?.(),(0,o.isErrorResponse)(V))return A(new Error(V.errorMessage));x(V)});const M=V=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:v,response:{method:"watchAsset",result:!1}})},D=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:v,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:D,onCancel:M,type:s,address:u,symbol:i,decimals:p,image:b,chainId:m}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(v,a)});return{cancel:R,promise:S}}addEthereumChain(s,u,i,p,b,m){const a={method:"addEthereumChain",params:{chainId:s,rpcUrls:u,blockExplorerUrls:p,chainName:b,iconUrls:i,nativeCurrency:m}};let w=null;const v=(0,r.randomBytesHex)(8),R=x=>{this.publishWeb3RequestCanceledEvent(v),this.handleErrorResponse(v,a.method,x),w?.()};return this.ui.inlineAddEthereumChain(s)||(w=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:R,onResetConnection:this.resetAndReload})),{promise:new Promise((x,A)=>{this.relayEventManager.callbacks.set(v,V=>{if(w?.(),(0,o.isErrorResponse)(V))return A(new Error(V.errorMessage));x(V)});const M=V=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:v,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},D=V=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:v,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:V}}})};this.ui.inlineAddEthereumChain(s)&&this.ui.addEthereumChain({onCancel:M,onApprove:D,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(s)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(v,a)}),cancel:R}}switchEthereumChain(s,u){const i={method:"switchEthereumChain",params:Object.assign({chainId:s},{address:u})},p=(0,r.randomBytesHex)(8),b=a=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,i.method,a)};return{promise:new Promise((a,w)=>{this.relayEventManager.callbacks.set(p,S=>{if((0,o.isErrorResponse)(S)&&S.errorCode)return w(e.standardErrors.provider.custom({code:S.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,o.isErrorResponse)(S))return w(new Error(S.errorMessage));a(S)});const v=S=>{var x;if(S){const A=(x=(0,e.getErrorCode)(S))!==null&&x!==void 0?x:e.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(p,"switchEthereumChain",S instanceof Error?S:e.standardErrors.provider.unsupportedChain(s),A)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},R=S=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:S}}})};this.ui.switchEthereumChain({onCancel:v,onApprove:R,chainId:i.params.chainId,address:i.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(p,i)}),cancel:b}}inlineAddEthereumChain(s){return this.ui.inlineAddEthereumChain(s)}getSessionIdHash(){return l.Session.hash(this._session.id)}sendRequestStandalone(s,u){const i=b=>{this.handleErrorResponse(s,u.method,b)},p=b=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:b})};switch(u.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:u,onSuccess:p,onCancel:i});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:u,onSuccess:p,onCancel:i});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:u,onSuccess:p,onCancel:i});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:u,onSuccess:p});break;default:i();break}}};return xt.WalletLinkRelay=d,d.accountRequestCallbackIds=new Set,xt}var Vt={},et={},tt={},la;function Ad(){return la||(la=1,(function(e){var n=tt&&tt.__createBinding||(Object.create?(function(t,g,l,c){c===void 0&&(c=l);var o=Object.getOwnPropertyDescriptor(g,l);(!o||("get"in o?!g.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return g[l]}}),Object.defineProperty(t,c,o)}):(function(t,g,l,c){c===void 0&&(c=l),t[c]=g[l]})),r=tt&&tt.__exportStar||function(t,g){for(var l in t)l!=="default"&&!Object.prototype.hasOwnProperty.call(g,l)&&n(g,t,l)};Object.defineProperty(e,"__esModule",{value:!0}),r(Qu(),e)})(tt)),tt}var mr={},da;function xd(){return da||(da=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.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}"),mr}var ha;function Td(){if(ha)return et;ha=1;var e=et&&et.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(et,"__esModule",{value:!0}),et.RedirectDialog=void 0;const n=e(nr),r=Se,t=Ku(),g=Ad(),l=e(xd());let c=class{constructor(){this.root=null}attach(){const d=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",d.appendChild(this.root),(0,t.injectCssReset)()}present(d){this.render(d)}clear(){this.render(null)}render(d){this.root&&((0,r.render)(null,this.root),d&&(0,r.render)((0,r.h)(o,Object.assign({},d,{onDismiss:()=>{this.clear()}})),this.root))}};et.RedirectDialog=c;const o=({title:h,buttonText:d,darkMode:f,onButtonClick:s,onDismiss:u})=>{const i=f?"dark":"light";return(0,r.h)(g.SnackbarContainer,{darkMode:f},(0,r.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,r.h)("style",null,l.default),(0,r.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:u}),(0,r.h)("div",{class:(0,n.default)("-cbwsdk-redirect-dialog-box",i)},(0,r.h)("p",null,h),(0,r.h)("button",{onClick:s},d))))};return et}var fa;function el(){if(fa)return Vt;fa=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.MobileRelayUI=void 0;const e=Td();let n=class{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new e.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 g=new URL("https://go.cb-w.com/walletlink");g.searchParams.append("redirect_url",window.location.href),t&&g.searchParams.append("wl_url",t);const l=document.createElement("a");l.target="cbw-opener",l.href=g.href,l.rel="noreferrer noopener",l.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}};return Vt.MobileRelayUI=n,Vt}var pa;function tl(){if(pa)return At;pa=1,Object.defineProperty(At,"__esModule",{value:!0}),At.MobileRelay=void 0;const e=Ue(),n=Xu(),r=el();let t=class extends n.WalletLinkRelay{constructor(l){var c;super(l),this._enableMobileWalletLink=(c=l.enableMobileWalletLink)!==null&&c!==void 0?c:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const l=(0,e.getLocation)();l.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(l.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(l,c){if(super.publishWeb3RequestEvent(l,c),!(this._enableMobileWalletLink&&this.ui instanceof r.MobileRelayUI))return;let o=!1;switch(c.method){case"requestEthereumAccounts":case"connectAndSignIn":o=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:o=!0,this.ui.openCoinbaseWalletDeeplink();break}o&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(l){super.handleWeb3ResponseMessage(l)}connectAndSignIn(l){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:l.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:l.statement,resources:l.resources}})}};return At.MobileRelay=t,At}var br={exports:{}},Un,ga;function rl(){return ga||(ga=1,Un=kr().EventEmitter),Un}var Hn,ma;function Ld(){if(ma)return Hn;ma=1;function e(p,b){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(p);b&&(a=a.filter(function(w){return Object.getOwnPropertyDescriptor(p,w).enumerable})),m.push.apply(m,a)}return m}function n(p){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?e(Object(m),!0).forEach(function(a){r(p,a,m[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):e(Object(m)).forEach(function(a){Object.defineProperty(p,a,Object.getOwnPropertyDescriptor(m,a))})}return p}function r(p,b,m){return b=c(b),b in p?Object.defineProperty(p,b,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[b]=m,p}function t(p,b){if(!(p instanceof b))throw new TypeError("Cannot call a class as a function")}function g(p,b){for(var m=0;m<b.length;m++){var a=b[m];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(p,c(a.key),a)}}function l(p,b,m){return b&&g(p.prototype,b),Object.defineProperty(p,"prototype",{writable:!1}),p}function c(p){var b=o(p,"string");return typeof b=="symbol"?b:String(b)}function o(p,b){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var a=m.call(p,b);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(p)}var h=Tr(),d=h.Buffer,f=zu,s=f.inspect,u=s&&s.custom||"inspect";function i(p,b,m){d.prototype.copy.call(p,b,m)}return Hn=(function(){function p(){t(this,p),this.head=null,this.tail=null,this.length=0}return l(p,[{key:"push",value:function(m){var a={data:m,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(m){var a={data:m,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(this.length!==0){var m=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,m}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(m){if(this.length===0)return"";for(var a=this.head,w=""+a.data;a=a.next;)w+=m+a.data;return w}},{key:"concat",value:function(m){if(this.length===0)return d.alloc(0);for(var a=d.allocUnsafe(m>>>0),w=this.head,v=0;w;)i(w.data,a,v),v+=w.data.length,w=w.next;return a}},{key:"consume",value:function(m,a){var w;return m<this.head.data.length?(w=this.head.data.slice(0,m),this.head.data=this.head.data.slice(m)):m===this.head.data.length?w=this.shift():w=a?this._getString(m):this._getBuffer(m),w}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(m){var a=this.head,w=1,v=a.data;for(m-=v.length;a=a.next;){var R=a.data,S=m>R.length?R.length:m;if(S===R.length?v+=R:v+=R.slice(0,m),m-=S,m===0){S===R.length?(++w,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=R.slice(S));break}++w}return this.length-=w,v}},{key:"_getBuffer",value:function(m){var a=d.allocUnsafe(m),w=this.head,v=1;for(w.data.copy(a),m-=w.data.length;w=w.next;){var R=w.data,S=m>R.length?R.length:m;if(R.copy(a,a.length-m,0,S),m-=S,m===0){S===R.length?(++v,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=R.slice(S));break}++v}return this.length-=v,a}},{key:u,value:function(m,a){return s(this,n(n({},a),{},{depth:0,customInspect:!1}))}}]),p})(),Hn}var Wn,ba;function nl(){if(ba)return Wn;ba=1;function e(c,o){var h=this,d=this._readableState&&this._readableState.destroyed,f=this._writableState&&this._writableState.destroyed;return d||f?(o?o(c):c&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,de.nextTick(g,this,c)):de.nextTick(g,this,c)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(c||null,function(s){!o&&s?h._writableState?h._writableState.errorEmitted?de.nextTick(r,h):(h._writableState.errorEmitted=!0,de.nextTick(n,h,s)):de.nextTick(n,h,s):o?(de.nextTick(r,h),o(s)):de.nextTick(r,h)}),this)}function n(c,o){g(c,o),r(c)}function r(c){c._writableState&&!c._writableState.emitClose||c._readableState&&!c._readableState.emitClose||c.emit("close")}function t(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function g(c,o){c.emit("error",o)}function l(c,o){var h=c._readableState,d=c._writableState;h&&h.autoDestroy||d&&d.autoDestroy?c.destroy(o):c.emit("error",o)}return Wn={destroy:e,undestroy:t,errorOrDestroy:l},Wn}var Vn={},ya;function bt(){if(ya)return Vn;ya=1;function e(o,h){o.prototype=Object.create(h.prototype),o.prototype.constructor=o,o.__proto__=h}var n={};function r(o,h,d){d||(d=Error);function f(u,i,p){return typeof h=="string"?h:h(u,i,p)}var s=(function(u){e(i,u);function i(p,b,m){return u.call(this,f(p,b,m))||this}return i})(d);s.prototype.name=d.name,s.prototype.code=o,n[o]=s}function t(o,h){if(Array.isArray(o)){var d=o.length;return o=o.map(function(f){return String(f)}),d>2?"one of ".concat(h," ").concat(o.slice(0,d-1).join(", "),", or ")+o[d-1]:d===2?"one of ".concat(h," ").concat(o[0]," or ").concat(o[1]):"of ".concat(h," ").concat(o[0])}else return"of ".concat(h," ").concat(String(o))}function g(o,h,d){return o.substr(0,h.length)===h}function l(o,h,d){return(d===void 0||d>o.length)&&(d=o.length),o.substring(d-h.length,d)===h}function c(o,h,d){return typeof d!="number"&&(d=0),d+h.length>o.length?!1:o.indexOf(h,d)!==-1}return r("ERR_INVALID_OPT_VALUE",function(o,h){return'The value "'+h+'" is invalid for option "'+o+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(o,h,d){var f;typeof h=="string"&&g(h,"not ")?(f="must not be",h=h.replace(/^not /,"")):f="must be";var s;if(l(o," argument"))s="The ".concat(o," ").concat(f," ").concat(t(h,"type"));else{var u=c(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(u," ").concat(f," ").concat(t(h,"type"))}return s+=". Received type ".concat(typeof d),s},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Vn.codes=n,Vn}var zn,wa;function il(){if(wa)return zn;wa=1;var e=bt().codes.ERR_INVALID_OPT_VALUE;function n(t,g,l){return t.highWaterMark!=null?t.highWaterMark:g?t[l]:null}function r(t,g,l,c){var o=n(g,c,l);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var h=c?l:"highWaterMark";throw new e(h,o)}return Math.floor(o)}return t.objectMode?16:16*1024}return zn={getHighWaterMark:r},zn}var Jn,_a;function Md(){if(_a)return Jn;_a=1,Jn=e;function e(r,t){if(n("noDeprecation"))return r;var g=!1;function l(){if(!g){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),g=!0}return r.apply(this,arguments)}return l}function n(r){try{if(!globalThis.localStorage)return!1}catch{return!1}var t=globalThis.localStorage[r];return t==null?!1:String(t).toLowerCase()==="true"}return Jn}var Gn,va;function sl(){if(va)return Gn;va=1,Gn=M;function e(B){var N=this;this.next=null,this.entry=null,this.finish=function(){te(N,B)}}var n;M.WritableState=x;var r={deprecate:Md()},t=rl(),g=Tr().Buffer,l=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(B){return g.from(B)}function o(B){return g.isBuffer(B)||B instanceof l}var h=nl(),d=il(),f=d.getHighWaterMark,s=bt().codes,u=s.ERR_INVALID_ARG_TYPE,i=s.ERR_METHOD_NOT_IMPLEMENTED,p=s.ERR_MULTIPLE_CALLBACK,b=s.ERR_STREAM_CANNOT_PIPE,m=s.ERR_STREAM_DESTROYED,a=s.ERR_STREAM_NULL_VALUES,w=s.ERR_STREAM_WRITE_AFTER_END,v=s.ERR_UNKNOWN_ENCODING,R=h.errorOrDestroy;Pe()(M,t);function S(){}function x(B,N,j){n=n||gt(),B=B||{},typeof j!="boolean"&&(j=N instanceof n),this.objectMode=!!B.objectMode,j&&(this.objectMode=this.objectMode||!!B.writableObjectMode),this.highWaterMark=f(this,B,"writableHighWaterMark",j),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=B.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=B.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(re){T(N,re)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=B.emitClose!==!1,this.autoDestroy=!!B.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}x.prototype.getBuffer=function(){for(var N=this.bufferedRequest,j=[];N;)j.push(N),N=N.next;return j},(function(){try{Object.defineProperty(x.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var A;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(A=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(N){return A.call(this,N)?!0:this!==M?!1:N&&N._writableState instanceof x}})):A=function(N){return N instanceof this};function M(B){n=n||gt();var N=this instanceof n;if(!N&&!A.call(M,this))return new M(B);this._writableState=new x(B,this,N),this.writable=!0,B&&(typeof B.write=="function"&&(this._write=B.write),typeof B.writev=="function"&&(this._writev=B.writev),typeof B.destroy=="function"&&(this._destroy=B.destroy),typeof B.final=="function"&&(this._final=B.final)),t.call(this)}M.prototype.pipe=function(){R(this,new b)};function D(B,N){var j=new w;R(B,j),de.nextTick(N,j)}function V(B,N,j,K){var re;return j===null?re=new a:typeof j!="string"&&!N.objectMode&&(re=new u("chunk",["string","Buffer"],j)),re?(R(B,re),de.nextTick(K,re),!1):!0}M.prototype.write=function(B,N,j){var K=this._writableState,re=!1,k=!K.objectMode&&o(B);return k&&!g.isBuffer(B)&&(B=c(B)),typeof N=="function"&&(j=N,N=null),k?N="buffer":N||(N=K.defaultEncoding),typeof j!="function"&&(j=S),K.ending?D(this,j):(k||V(this,K,B,j))&&(K.pendingcb++,re=Y(this,K,k,B,N,j)),re},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var B=this._writableState;B.corked&&(B.corked--,!B.writing&&!B.corked&&!B.bufferProcessing&&B.bufferedRequest&&U(this,B))},M.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new v(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Z(B,N,j){return!B.objectMode&&B.decodeStrings!==!1&&typeof N=="string"&&(N=g.from(N,j)),N}Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Y(B,N,j,K,re,k){if(!j){var I=Z(N,K,re);K!==I&&(j=!0,re="buffer",K=I)}var $=N.objectMode?1:K.length;N.length+=$;var z=N.length<N.highWaterMark;if(z||(N.needDrain=!0),N.writing||N.corked){var he=N.lastBufferedRequest;N.lastBufferedRequest={chunk:K,encoding:re,isBuf:j,callback:k,next:null},he?he.next=N.lastBufferedRequest:N.bufferedRequest=N.lastBufferedRequest,N.bufferedRequestCount+=1}else ne(B,N,!1,$,K,re,k);return z}function ne(B,N,j,K,re,k,I){N.writelen=K,N.writecb=I,N.writing=!0,N.sync=!0,N.destroyed?N.onwrite(new m("write")):j?B._writev(re,N.onwrite):B._write(re,k,N.onwrite),N.sync=!1}function H(B,N,j,K,re){--N.pendingcb,j?(de.nextTick(re,K),de.nextTick(ee,B,N),B._writableState.errorEmitted=!0,R(B,K)):(re(K),B._writableState.errorEmitted=!0,R(B,K),ee(B,N))}function F(B){B.writing=!1,B.writecb=null,B.length-=B.writelen,B.writelen=0}function T(B,N){var j=B._writableState,K=j.sync,re=j.writecb;if(typeof re!="function")throw new p;if(F(j),N)H(B,j,K,N,re);else{var k=G(j)||B.destroyed;!k&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&U(B,j),K?de.nextTick(O,B,j,k,re):O(B,j,k,re)}}function O(B,N,j,K){j||W(B,N),N.pendingcb--,K(),ee(B,N)}function W(B,N){N.length===0&&N.needDrain&&(N.needDrain=!1,B.emit("drain"))}function U(B,N){N.bufferProcessing=!0;var j=N.bufferedRequest;if(B._writev&&j&&j.next){var K=N.bufferedRequestCount,re=new Array(K),k=N.corkedRequestsFree;k.entry=j;for(var I=0,$=!0;j;)re[I]=j,j.isBuf||($=!1),j=j.next,I+=1;re.allBuffers=$,ne(B,N,!0,N.length,re,"",k.finish),N.pendingcb++,N.lastBufferedRequest=null,k.next?(N.corkedRequestsFree=k.next,k.next=null):N.corkedRequestsFree=new e(N),N.bufferedRequestCount=0}else{for(;j;){var z=j.chunk,he=j.encoding,ie=j.callback,ce=N.objectMode?1:z.length;if(ne(B,N,!1,ce,z,he,ie),j=j.next,N.bufferedRequestCount--,N.writing)break}j===null&&(N.lastBufferedRequest=null)}N.bufferedRequest=j,N.bufferProcessing=!1}M.prototype._write=function(B,N,j){j(new i("_write()"))},M.prototype._writev=null,M.prototype.end=function(B,N,j){var K=this._writableState;return typeof B=="function"?(j=B,B=null,N=null):typeof N=="function"&&(j=N,N=null),B!=null&&this.write(B,N),K.corked&&(K.corked=1,this.uncork()),K.ending||ae(this,K,j),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function G(B){return B.ending&&B.length===0&&B.bufferedRequest===null&&!B.finished&&!B.writing}function Q(B,N){B._final(function(j){N.pendingcb--,j&&R(B,j),N.prefinished=!0,B.emit("prefinish"),ee(B,N)})}function J(B,N){!N.prefinished&&!N.finalCalled&&(typeof B._final=="function"&&!N.destroyed?(N.pendingcb++,N.finalCalled=!0,de.nextTick(Q,B,N)):(N.prefinished=!0,B.emit("prefinish")))}function ee(B,N){var j=G(N);if(j&&(J(B,N),N.pendingcb===0&&(N.finished=!0,B.emit("finish"),N.autoDestroy))){var K=B._readableState;(!K||K.autoDestroy&&K.endEmitted)&&B.destroy()}return j}function ae(B,N,j){N.ending=!0,ee(B,N),j&&(N.finished?de.nextTick(j):B.once("finish",j)),N.ended=!0,B.writable=!1}function te(B,N,j){var K=B.entry;for(B.entry=null;K;){var re=K.callback;N.pendingcb--,re(j),K=K.next}N.corkedRequestsFree.next=B}return Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(N){this._writableState&&(this._writableState.destroyed=N)}}),M.prototype.destroy=h.destroy,M.prototype._undestroy=h.undestroy,M.prototype._destroy=function(B,N){N(B)},Gn}var Zn,Ea;function gt(){if(Ea)return Zn;Ea=1;var e=Object.keys||function(d){var f=[];for(var s in d)f.push(s);return f};Zn=c;var n=ol(),r=sl();Pe()(c,n);for(var t=e(r.prototype),g=0;g<t.length;g++){var l=t[g];c.prototype[l]||(c.prototype[l]=r.prototype[l])}function c(d){if(!(this instanceof c))return new c(d);n.call(this,d),r.call(this,d),this.allowHalfOpen=!0,d&&(d.readable===!1&&(this.readable=!1),d.writable===!1&&(this.writable=!1),d.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",o)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function o(){this._writableState.ended||de.nextTick(h,this)}function h(d){d.end()}return Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(f){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=f,this._writableState.destroyed=f)}}),Zn}var Kn={},Ra;function Sa(){if(Ra)return Kn;Ra=1;var e=He().Buffer,n=e.isEncoding||function(a){switch(a=""+a,a&&a.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(a){if(!a)return"utf8";for(var w;;)switch(a){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return a;default:if(w)return;a=(""+a).toLowerCase(),w=!0}}function t(a){var w=r(a);if(typeof w!="string"&&(e.isEncoding===n||!n(a)))throw new Error("Unknown encoding: "+a);return w||a}Kn.StringDecoder=g;function g(a){this.encoding=t(a);var w;switch(this.encoding){case"utf16le":this.text=s,this.end=u,w=4;break;case"utf8":this.fillLast=h,w=4;break;case"base64":this.text=i,this.end=p,w=3;break;default:this.write=b,this.end=m;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(w)}g.prototype.write=function(a){if(a.length===0)return"";var w,v;if(this.lastNeed){if(w=this.fillLast(a),w===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<a.length?w?w+this.text(a,v):this.text(a,v):w||""},g.prototype.end=f,g.prototype.text=d,g.prototype.fillLast=function(a){if(this.lastNeed<=a.length)return a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,a.length),this.lastNeed-=a.length};function l(a){return a<=127?0:a>>5===6?2:a>>4===14?3:a>>3===30?4:a>>6===2?-1:-2}function c(a,w,v){var R=w.length-1;if(R<v)return 0;var S=l(w[R]);return S>=0?(S>0&&(a.lastNeed=S-1),S):--R<v||S===-2?0:(S=l(w[R]),S>=0?(S>0&&(a.lastNeed=S-2),S):--R<v||S===-2?0:(S=l(w[R]),S>=0?(S>0&&(S===2?S=0:a.lastNeed=S-3),S):0))}function o(a,w,v){if((w[0]&192)!==128)return a.lastNeed=0,"�";if(a.lastNeed>1&&w.length>1){if((w[1]&192)!==128)return a.lastNeed=1,"�";if(a.lastNeed>2&&w.length>2&&(w[2]&192)!==128)return a.lastNeed=2,"�"}}function h(a){var w=this.lastTotal-this.lastNeed,v=o(this,a);if(v!==void 0)return v;if(this.lastNeed<=a.length)return a.copy(this.lastChar,w,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);a.copy(this.lastChar,w,0,a.length),this.lastNeed-=a.length}function d(a,w){var v=c(this,a,w);if(!this.lastNeed)return a.toString("utf8",w);this.lastTotal=v;var R=a.length-(v-this.lastNeed);return a.copy(this.lastChar,0,R),a.toString("utf8",w,R)}function f(a){var w=a&&a.length?this.write(a):"";return this.lastNeed?w+"�":w}function s(a,w){if((a.length-w)%2===0){var v=a.toString("utf16le",w);if(v){var R=v.charCodeAt(v.length-1);if(R>=55296&&R<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",w,a.length-1)}function u(a){var w=a&&a.length?this.write(a):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return w+this.lastChar.toString("utf16le",0,v)}return w}function i(a,w){var v=(a.length-w)%3;return v===0?a.toString("base64",w):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",w,a.length-v))}function p(a){var w=a&&a.length?this.write(a):"";return this.lastNeed?w+this.lastChar.toString("base64",0,3-this.lastNeed):w}function b(a){return a.toString(this.encoding)}function m(a){return a&&a.length?this.write(a):""}return Kn}var Qn,Ca;function $s(){if(Ca)return Qn;Ca=1;var e=bt().codes.ERR_STREAM_PREMATURE_CLOSE;function n(l){var c=!1;return function(){if(!c){c=!0;for(var o=arguments.length,h=new Array(o),d=0;d<o;d++)h[d]=arguments[d];l.apply(this,h)}}}function r(){}function t(l){return l.setHeader&&typeof l.abort=="function"}function g(l,c,o){if(typeof c=="function")return g(l,null,c);c||(c={}),o=n(o||r);var h=c.readable||c.readable!==!1&&l.readable,d=c.writable||c.writable!==!1&&l.writable,f=function(){l.writable||u()},s=l._writableState&&l._writableState.finished,u=function(){d=!1,s=!0,h||o.call(l)},i=l._readableState&&l._readableState.endEmitted,p=function(){h=!1,i=!0,d||o.call(l)},b=function(v){o.call(l,v)},m=function(){var v;if(h&&!i)return(!l._readableState||!l._readableState.ended)&&(v=new e),o.call(l,v);if(d&&!s)return(!l._writableState||!l._writableState.ended)&&(v=new e),o.call(l,v)},a=function(){l.req.on("finish",u)};return t(l)?(l.on("complete",u),l.on("abort",m),l.req?a():l.on("request",a)):d&&!l._writableState&&(l.on("end",f),l.on("close",f)),l.on("end",p),l.on("finish",u),c.error!==!1&&l.on("error",b),l.on("close",m),function(){l.removeListener("complete",u),l.removeListener("abort",m),l.removeListener("request",a),l.req&&l.req.removeListener("finish",u),l.removeListener("end",f),l.removeListener("close",f),l.removeListener("finish",u),l.removeListener("end",p),l.removeListener("error",b),l.removeListener("close",m)}}return Qn=g,Qn}var Yn,ka;function Nd(){if(ka)return Yn;ka=1;var e;function n(v,R,S){return R=r(R),R in v?Object.defineProperty(v,R,{value:S,enumerable:!0,configurable:!0,writable:!0}):v[R]=S,v}function r(v){var R=t(v,"string");return typeof R=="symbol"?R:String(R)}function t(v,R){if(typeof v!="object"||v===null)return v;var S=v[Symbol.toPrimitive];if(S!==void 0){var x=S.call(v,R);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(v)}var g=$s(),l=Symbol("lastResolve"),c=Symbol("lastReject"),o=Symbol("error"),h=Symbol("ended"),d=Symbol("lastPromise"),f=Symbol("handlePromise"),s=Symbol("stream");function u(v,R){return{value:v,done:R}}function i(v){var R=v[l];if(R!==null){var S=v[s].read();S!==null&&(v[d]=null,v[l]=null,v[c]=null,R(u(S,!1)))}}function p(v){de.nextTick(i,v)}function b(v,R){return function(S,x){v.then(function(){if(R[h]){S(u(void 0,!0));return}R[f](S,x)},x)}}var m=Object.getPrototypeOf(function(){}),a=Object.setPrototypeOf((e={get stream(){return this[s]},next:function(){var R=this,S=this[o];if(S!==null)return Promise.reject(S);if(this[h])return Promise.resolve(u(void 0,!0));if(this[s].destroyed)return new Promise(function(D,V){de.nextTick(function(){R[o]?V(R[o]):D(u(void 0,!0))})});var x=this[d],A;if(x)A=new Promise(b(x,this));else{var M=this[s].read();if(M!==null)return Promise.resolve(u(M,!1));A=new Promise(this[f])}return this[d]=A,A}},n(e,Symbol.asyncIterator,function(){return this}),n(e,"return",function(){var R=this;return new Promise(function(S,x){R[s].destroy(null,function(A){if(A){x(A);return}S(u(void 0,!0))})})}),e),m),w=function(R){var S,x=Object.create(a,(S={},n(S,s,{value:R,writable:!0}),n(S,l,{value:null,writable:!0}),n(S,c,{value:null,writable:!0}),n(S,o,{value:null,writable:!0}),n(S,h,{value:R._readableState.endEmitted,writable:!0}),n(S,f,{value:function(M,D){var V=x[s].read();V?(x[d]=null,x[l]=null,x[c]=null,M(u(V,!1))):(x[l]=M,x[c]=D)},writable:!0}),S));return x[d]=null,g(R,function(A){if(A&&A.code!=="ERR_STREAM_PREMATURE_CLOSE"){var M=x[c];M!==null&&(x[d]=null,x[l]=null,x[c]=null,M(A)),x[o]=A;return}var D=x[l];D!==null&&(x[d]=null,x[l]=null,x[c]=null,D(u(void 0,!0))),x[h]=!0}),R.on("readable",p.bind(null,x)),x};return Yn=w,Yn}var Xn,Ia;function Bd(){return Ia||(Ia=1,Xn=function(){throw new Error("Readable.from is not available in the browser")}),Xn}var ei,Aa;function ol(){if(Aa)return ei;Aa=1,ei=D;var e;D.ReadableState=M,kr().EventEmitter;var n=function(I,$){return I.listeners($).length},r=rl(),t=Tr().Buffer,g=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function l(k){return t.from(k)}function c(k){return t.isBuffer(k)||k instanceof g}var o=zu,h;o&&o.debuglog?h=o.debuglog("stream"):h=function(){};var d=Ld(),f=nl(),s=il(),u=s.getHighWaterMark,i=bt().codes,p=i.ERR_INVALID_ARG_TYPE,b=i.ERR_STREAM_PUSH_AFTER_EOF,m=i.ERR_METHOD_NOT_IMPLEMENTED,a=i.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,w,v,R;Pe()(D,r);var S=f.errorOrDestroy,x=["error","close","destroy","pause","resume"];function A(k,I,$){if(typeof k.prependListener=="function")return k.prependListener(I,$);!k._events||!k._events[I]?k.on(I,$):Array.isArray(k._events[I])?k._events[I].unshift($):k._events[I]=[$,k._events[I]]}function M(k,I,$){e=e||gt(),k=k||{},typeof $!="boolean"&&($=I instanceof e),this.objectMode=!!k.objectMode,$&&(this.objectMode=this.objectMode||!!k.readableObjectMode),this.highWaterMark=u(this,k,"readableHighWaterMark",$),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.destroyed=!1,this.defaultEncoding=k.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,k.encoding&&(w||(w=Sa().StringDecoder),this.decoder=new w(k.encoding),this.encoding=k.encoding)}function D(k){if(e=e||gt(),!(this instanceof D))return new D(k);var I=this instanceof e;this._readableState=new M(k,this,I),this.readable=!0,k&&(typeof k.read=="function"&&(this._read=k.read),typeof k.destroy=="function"&&(this._destroy=k.destroy)),r.call(this)}Object.defineProperty(D.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(I){this._readableState&&(this._readableState.destroyed=I)}}),D.prototype.destroy=f.destroy,D.prototype._undestroy=f.undestroy,D.prototype._destroy=function(k,I){I(k)},D.prototype.push=function(k,I){var $=this._readableState,z;return $.objectMode?z=!0:typeof k=="string"&&(I=I||$.defaultEncoding,I!==$.encoding&&(k=t.from(k,I),I=""),z=!0),V(this,k,I,!1,z)},D.prototype.unshift=function(k){return V(this,k,null,!0,!1)};function V(k,I,$,z,he){h("readableAddChunk",I);var ie=k._readableState;if(I===null)ie.reading=!1,T(k,ie);else{var ce;if(he||(ce=Y(ie,I)),ce)S(k,ce);else if(ie.objectMode||I&&I.length>0)if(typeof I!="string"&&!ie.objectMode&&Object.getPrototypeOf(I)!==t.prototype&&(I=l(I)),z)ie.endEmitted?S(k,new a):Z(k,ie,I,!0);else if(ie.ended)S(k,new b);else{if(ie.destroyed)return!1;ie.reading=!1,ie.decoder&&!$?(I=ie.decoder.write(I),ie.objectMode||I.length!==0?Z(k,ie,I,!1):U(k,ie)):Z(k,ie,I,!1)}else z||(ie.reading=!1,U(k,ie))}return!ie.ended&&(ie.length<ie.highWaterMark||ie.length===0)}function Z(k,I,$,z){I.flowing&&I.length===0&&!I.sync?(I.awaitDrain=0,k.emit("data",$)):(I.length+=I.objectMode?1:$.length,z?I.buffer.unshift($):I.buffer.push($),I.needReadable&&O(k)),U(k,I)}function Y(k,I){var $;return!c(I)&&typeof I!="string"&&I!==void 0&&!k.objectMode&&($=new p("chunk",["string","Buffer","Uint8Array"],I)),$}D.prototype.isPaused=function(){return this._readableState.flowing===!1},D.prototype.setEncoding=function(k){w||(w=Sa().StringDecoder);var I=new w(k);this._readableState.decoder=I,this._readableState.encoding=this._readableState.decoder.encoding;for(var $=this._readableState.buffer.head,z="";$!==null;)z+=I.write($.data),$=$.next;return this._readableState.buffer.clear(),z!==""&&this._readableState.buffer.push(z),this._readableState.length=z.length,this};var ne=1073741824;function H(k){return k>=ne?k=ne:(k--,k|=k>>>1,k|=k>>>2,k|=k>>>4,k|=k>>>8,k|=k>>>16,k++),k}function F(k,I){return k<=0||I.length===0&&I.ended?0:I.objectMode?1:k!==k?I.flowing&&I.length?I.buffer.head.data.length:I.length:(k>I.highWaterMark&&(I.highWaterMark=H(k)),k<=I.length?k:I.ended?I.length:(I.needReadable=!0,0))}D.prototype.read=function(k){h("read",k),k=parseInt(k,10);var I=this._readableState,$=k;if(k!==0&&(I.emittedReadable=!1),k===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return h("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?j(this):O(this),null;if(k=F(k,I),k===0&&I.ended)return I.length===0&&j(this),null;var z=I.needReadable;h("need readable",z),(I.length===0||I.length-k<I.highWaterMark)&&(z=!0,h("length less than watermark",z)),I.ended||I.reading?(z=!1,h("reading or ended",z)):z&&(h("do read"),I.reading=!0,I.sync=!0,I.length===0&&(I.needReadable=!0),this._read(I.highWaterMark),I.sync=!1,I.reading||(k=F($,I)));var he;return k>0?he=N(k,I):he=null,he===null?(I.needReadable=I.length<=I.highWaterMark,k=0):(I.length-=k,I.awaitDrain=0),I.length===0&&(I.ended||(I.needReadable=!0),$!==k&&I.ended&&j(this)),he!==null&&this.emit("data",he),he};function T(k,I){if(h("onEofChunk"),!I.ended){if(I.decoder){var $=I.decoder.end();$&&$.length&&(I.buffer.push($),I.length+=I.objectMode?1:$.length)}I.ended=!0,I.sync?O(k):(I.needReadable=!1,I.emittedReadable||(I.emittedReadable=!0,W(k)))}}function O(k){var I=k._readableState;h("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(h("emitReadable",I.flowing),I.emittedReadable=!0,de.nextTick(W,k))}function W(k){var I=k._readableState;h("emitReadable_",I.destroyed,I.length,I.ended),!I.destroyed&&(I.length||I.ended)&&(k.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,B(k)}function U(k,I){I.readingMore||(I.readingMore=!0,de.nextTick(G,k,I))}function G(k,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){var $=I.length;if(h("maybeReadMore read 0"),k.read(0),$===I.length)break}I.readingMore=!1}D.prototype._read=function(k){S(this,new m("_read()"))},D.prototype.pipe=function(k,I){var $=this,z=this._readableState;switch(z.pipesCount){case 0:z.pipes=k;break;case 1:z.pipes=[z.pipes,k];break;default:z.pipes.push(k);break}z.pipesCount+=1,h("pipe count=%d opts=%j",z.pipesCount,I);var he=(!I||I.end!==!1)&&k!==de.stdout&&k!==de.stderr,ie=he?Re:qe;z.endEmitted?de.nextTick(ie):$.once("end",ie),k.on("unpipe",ce);function ce(E,y){h("onunpipe"),E===$&&y&&y.hasUnpiped===!1&&(y.hasUnpiped=!0,be())}function Re(){h("onend"),k.end()}var Ae=Q($);k.on("drain",Ae);var xe=!1;function be(){h("cleanup"),k.removeListener("close",De),k.removeListener("finish",ve),k.removeListener("drain",Ae),k.removeListener("error",ke),k.removeListener("unpipe",ce),$.removeListener("end",Re),$.removeListener("end",qe),$.removeListener("data",me),xe=!0,z.awaitDrain&&(!k._writableState||k._writableState.needDrain)&&Ae()}$.on("data",me);function me(E){h("ondata");var y=k.write(E);h("dest.write",y),y===!1&&((z.pipesCount===1&&z.pipes===k||z.pipesCount>1&&re(z.pipes,k)!==-1)&&!xe&&(h("false write response, pause",z.awaitDrain),z.awaitDrain++),$.pause())}function ke(E){h("onerror",E),qe(),k.removeListener("error",ke),n(k,"error")===0&&S(k,E)}A(k,"error",ke);function De(){k.removeListener("finish",ve),qe()}k.once("close",De);function ve(){h("onfinish"),k.removeListener("close",De),qe()}k.once("finish",ve);function qe(){h("unpipe"),$.unpipe(k)}return k.emit("pipe",$),z.flowing||(h("pipe resume"),$.resume()),k};function Q(k){return function(){var $=k._readableState;h("pipeOnDrain",$.awaitDrain),$.awaitDrain&&$.awaitDrain--,$.awaitDrain===0&&n(k,"data")&&($.flowing=!0,B(k))}}D.prototype.unpipe=function(k){var I=this._readableState,$={hasUnpiped:!1};if(I.pipesCount===0)return this;if(I.pipesCount===1)return k&&k!==I.pipes?this:(k||(k=I.pipes),I.pipes=null,I.pipesCount=0,I.flowing=!1,k&&k.emit("unpipe",this,$),this);if(!k){var z=I.pipes,he=I.pipesCount;I.pipes=null,I.pipesCount=0,I.flowing=!1;for(var ie=0;ie<he;ie++)z[ie].emit("unpipe",this,{hasUnpiped:!1});return this}var ce=re(I.pipes,k);return ce===-1?this:(I.pipes.splice(ce,1),I.pipesCount-=1,I.pipesCount===1&&(I.pipes=I.pipes[0]),k.emit("unpipe",this,$),this)},D.prototype.on=function(k,I){var $=r.prototype.on.call(this,k,I),z=this._readableState;return k==="data"?(z.readableListening=this.listenerCount("readable")>0,z.flowing!==!1&&this.resume()):k==="readable"&&!z.endEmitted&&!z.readableListening&&(z.readableListening=z.needReadable=!0,z.flowing=!1,z.emittedReadable=!1,h("on readable",z.length,z.reading),z.length?O(this):z.reading||de.nextTick(ee,this)),$},D.prototype.addListener=D.prototype.on,D.prototype.removeListener=function(k,I){var $=r.prototype.removeListener.call(this,k,I);return k==="readable"&&de.nextTick(J,this),$},D.prototype.removeAllListeners=function(k){var I=r.prototype.removeAllListeners.apply(this,arguments);return(k==="readable"||k===void 0)&&de.nextTick(J,this),I};function J(k){var I=k._readableState;I.readableListening=k.listenerCount("readable")>0,I.resumeScheduled&&!I.paused?I.flowing=!0:k.listenerCount("data")>0&&k.resume()}function ee(k){h("readable nexttick read 0"),k.read(0)}D.prototype.resume=function(){var k=this._readableState;return k.flowing||(h("resume"),k.flowing=!k.readableListening,ae(this,k)),k.paused=!1,this};function ae(k,I){I.resumeScheduled||(I.resumeScheduled=!0,de.nextTick(te,k,I))}function te(k,I){h("resume",I.reading),I.reading||k.read(0),I.resumeScheduled=!1,k.emit("resume"),B(k),I.flowing&&!I.reading&&k.read(0)}D.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function B(k){var I=k._readableState;for(h("flow",I.flowing);I.flowing&&k.read()!==null;);}D.prototype.wrap=function(k){var I=this,$=this._readableState,z=!1;k.on("end",function(){if(h("wrapped end"),$.decoder&&!$.ended){var ce=$.decoder.end();ce&&ce.length&&I.push(ce)}I.push(null)}),k.on("data",function(ce){if(h("wrapped data"),$.decoder&&(ce=$.decoder.write(ce)),!($.objectMode&&ce==null)&&!(!$.objectMode&&(!ce||!ce.length))){var Re=I.push(ce);Re||(z=!0,k.pause())}});for(var he in k)this[he]===void 0&&typeof k[he]=="function"&&(this[he]=(function(Re){return function(){return k[Re].apply(k,arguments)}})(he));for(var ie=0;ie<x.length;ie++)k.on(x[ie],this.emit.bind(this,x[ie]));return this._read=function(ce){h("wrapped _read",ce),z&&(z=!1,k.resume())},this},typeof Symbol=="function"&&(D.prototype[Symbol.asyncIterator]=function(){return v===void 0&&(v=Nd()),v(this)}),Object.defineProperty(D.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(D.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(D.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(I){this._readableState&&(this._readableState.flowing=I)}}),D._fromList=N,Object.defineProperty(D.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function N(k,I){if(I.length===0)return null;var $;return I.objectMode?$=I.buffer.shift():!k||k>=I.length?(I.decoder?$=I.buffer.join(""):I.buffer.length===1?$=I.buffer.first():$=I.buffer.concat(I.length),I.buffer.clear()):$=I.buffer.consume(k,I.decoder),$}function j(k){var I=k._readableState;h("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,de.nextTick(K,I,k))}function K(k,I){if(h("endReadableNT",k.endEmitted,k.length),!k.endEmitted&&k.length===0&&(k.endEmitted=!0,I.readable=!1,I.emit("end"),k.autoDestroy)){var $=I._writableState;(!$||$.autoDestroy&&$.finished)&&I.destroy()}}typeof Symbol=="function"&&(D.from=function(k,I){return R===void 0&&(R=Bd()),R(D,k,I)});function re(k,I){for(var $=0,z=k.length;$<z;$++)if(k[$]===I)return $;return-1}return ei}var ti,xa;function al(){if(xa)return ti;xa=1,ti=o;var e=bt().codes,n=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,t=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,g=e.ERR_TRANSFORM_WITH_LENGTH_0,l=gt();Pe()(o,l);function c(f,s){var u=this._transformState;u.transforming=!1;var i=u.writecb;if(i===null)return this.emit("error",new r);u.writechunk=null,u.writecb=null,s!=null&&this.push(s),i(f);var p=this._readableState;p.reading=!1,(p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}function o(f){if(!(this instanceof o))return new o(f);l.call(this,f),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,f&&(typeof f.transform=="function"&&(this._transform=f.transform),typeof f.flush=="function"&&(this._flush=f.flush)),this.on("prefinish",h)}function h(){var f=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,u){d(f,s,u)}):d(this,null,null)}o.prototype.push=function(f,s){return this._transformState.needTransform=!1,l.prototype.push.call(this,f,s)},o.prototype._transform=function(f,s,u){u(new n("_transform()"))},o.prototype._write=function(f,s,u){var i=this._transformState;if(i.writecb=u,i.writechunk=f,i.writeencoding=s,!i.transforming){var p=this._readableState;(i.needTransform||p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}},o.prototype._read=function(f){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},o.prototype._destroy=function(f,s){l.prototype._destroy.call(this,f,function(u){s(u)})};function d(f,s,u){if(s)return f.emit("error",s);if(u!=null&&f.push(u),f._writableState.length)throw new g;if(f._transformState.transforming)throw new t;return f.push(null)}return ti}var ri,Ta;function Pd(){if(Ta)return ri;Ta=1,ri=n;var e=al();Pe()(n,e);function n(r){if(!(this instanceof n))return new n(r);e.call(this,r)}return n.prototype._transform=function(r,t,g){g(null,r)},ri}var ni,La;function Od(){if(La)return ni;La=1;var e;function n(u){var i=!1;return function(){i||(i=!0,u.apply(void 0,arguments))}}var r=bt().codes,t=r.ERR_MISSING_ARGS,g=r.ERR_STREAM_DESTROYED;function l(u){if(u)throw u}function c(u){return u.setHeader&&typeof u.abort=="function"}function o(u,i,p,b){b=n(b);var m=!1;u.on("close",function(){m=!0}),e===void 0&&(e=$s()),e(u,{readable:i,writable:p},function(w){if(w)return b(w);m=!0,b()});var a=!1;return function(w){if(!m&&!a){if(a=!0,c(u))return u.abort();if(typeof u.destroy=="function")return u.destroy();b(w||new g("pipe"))}}}function h(u){u()}function d(u,i){return u.pipe(i)}function f(u){return!u.length||typeof u[u.length-1]!="function"?l:u.pop()}function s(){for(var u=arguments.length,i=new Array(u),p=0;p<u;p++)i[p]=arguments[p];var b=f(i);if(Array.isArray(i[0])&&(i=i[0]),i.length<2)throw new t("streams");var m,a=i.map(function(w,v){var R=v<i.length-1,S=v>0;return o(w,R,S,function(x){m||(m=x),x&&a.forEach(h),!R&&(a.forEach(h),b(m))})});return i.reduce(d)}return ni=s,ni}var Ma;function cl(){return Ma||(Ma=1,(function(e,n){n=e.exports=ol(),n.Stream=n,n.Readable=n,n.Writable=sl(),n.Duplex=gt(),n.Transform=al(),n.PassThrough=Pd(),n.finished=$s(),n.pipeline=Od()})(br,br.exports)),br.exports}var ii,Na;function Fd(){if(Na)return ii;Na=1;const{Transform:e}=cl();return ii=n=>class ul extends e{constructor(t,g,l,c,o){super(o),this._rate=t,this._capacity=g,this._delimitedSuffix=l,this._hashBitLength=c,this._options=o,this._state=new n,this._state.initialize(t,g),this._finalized=!1}_transform(t,g,l){let c=null;try{this.update(t,g)}catch(o){c=o}l(c)}_flush(t){let g=null;try{this.push(this.digest())}catch(l){g=l}t(g)}update(t,g){if(!oe.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return oe.isBuffer(t)||(t=oe.from(t,g)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let g=this._state.squeeze(this._hashBitLength/8);return t!==void 0&&(g=g.toString(t)),this._resetState(),g}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new ul(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},ii}var si,Ba;function Dd(){if(Ba)return si;Ba=1;const{Transform:e}=cl();return si=n=>class ll extends e{constructor(t,g,l,c){super(c),this._rate=t,this._capacity=g,this._delimitedSuffix=l,this._options=c,this._state=new n,this._state.initialize(t,g),this._finalized=!1}_transform(t,g,l){let c=null;try{this.update(t,g)}catch(o){c=o}l(c)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,g){if(!oe.isBuffer(t)&&typeof t!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return oe.isBuffer(t)||(t=oe.from(t,g)),this._state.absorb(t),this}squeeze(t,g){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let l=this._state.squeeze(t);return g!==void 0&&(l=l.toString(g)),l}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new ll(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},si}var oi,Pa;function qd(){if(Pa)return oi;Pa=1;const e=Fd(),n=Dd();return oi=function(r){const t=e(r),g=n(r);return function(l,c){switch(typeof l=="string"?l.toLowerCase():l){case"keccak224":return new t(1152,448,null,224,c);case"keccak256":return new t(1088,512,null,256,c);case"keccak384":return new t(832,768,null,384,c);case"keccak512":return new t(576,1024,null,512,c);case"sha3-224":return new t(1152,448,6,224,c);case"sha3-256":return new t(1088,512,6,256,c);case"sha3-384":return new t(832,768,6,384,c);case"sha3-512":return new t(576,1024,6,512,c);case"shake128":return new g(1344,256,31,c);case"shake256":return new g(1088,512,31,c);default:throw new Error("Invald algorithm: "+l)}}},oi}var ai={},Oa;function jd(){if(Oa)return ai;Oa=1;const e=[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];return ai.p1600=function(n){for(let r=0;r<24;++r){const t=n[0]^n[10]^n[20]^n[30]^n[40],g=n[1]^n[11]^n[21]^n[31]^n[41],l=n[2]^n[12]^n[22]^n[32]^n[42],c=n[3]^n[13]^n[23]^n[33]^n[43],o=n[4]^n[14]^n[24]^n[34]^n[44],h=n[5]^n[15]^n[25]^n[35]^n[45],d=n[6]^n[16]^n[26]^n[36]^n[46],f=n[7]^n[17]^n[27]^n[37]^n[47],s=n[8]^n[18]^n[28]^n[38]^n[48],u=n[9]^n[19]^n[29]^n[39]^n[49];let i=s^(l<<1|c>>>31),p=u^(c<<1|l>>>31);const b=n[0]^i,m=n[1]^p,a=n[10]^i,w=n[11]^p,v=n[20]^i,R=n[21]^p,S=n[30]^i,x=n[31]^p,A=n[40]^i,M=n[41]^p;i=t^(o<<1|h>>>31),p=g^(h<<1|o>>>31);const D=n[2]^i,V=n[3]^p,Z=n[12]^i,Y=n[13]^p,ne=n[22]^i,H=n[23]^p,F=n[32]^i,T=n[33]^p,O=n[42]^i,W=n[43]^p;i=l^(d<<1|f>>>31),p=c^(f<<1|d>>>31);const U=n[4]^i,G=n[5]^p,Q=n[14]^i,J=n[15]^p,ee=n[24]^i,ae=n[25]^p,te=n[34]^i,B=n[35]^p,N=n[44]^i,j=n[45]^p;i=o^(s<<1|u>>>31),p=h^(u<<1|s>>>31);const K=n[6]^i,re=n[7]^p,k=n[16]^i,I=n[17]^p,$=n[26]^i,z=n[27]^p,he=n[36]^i,ie=n[37]^p,ce=n[46]^i,Re=n[47]^p;i=d^(t<<1|g>>>31),p=f^(g<<1|t>>>31);const Ae=n[8]^i,xe=n[9]^p,be=n[18]^i,me=n[19]^p,ke=n[28]^i,De=n[29]^p,ve=n[38]^i,qe=n[39]^p,E=n[48]^i,y=n[49]^p,_=b,C=m,L=w<<4|a>>>28,P=a<<4|w>>>28,q=v<<3|R>>>29,se=R<<3|v>>>29,pe=x<<9|S>>>23,fe=S<<9|x>>>23,ge=A<<18|M>>>14,le=M<<18|A>>>14,Dr=D<<1|V>>>31,qr=V<<1|D>>>31,jr=Y<<12|Z>>>20,$r=Z<<12|Y>>>20,Ur=ne<<10|H>>>22,Hr=H<<10|ne>>>22,Wr=T<<13|F>>>19,Vr=F<<13|T>>>19,zr=O<<2|W>>>30,Jr=W<<2|O>>>30,Gr=G<<30|U>>>2,Zr=U<<30|G>>>2,Kr=Q<<6|J>>>26,Qr=J<<6|Q>>>26,Yr=ae<<11|ee>>>21,Xr=ee<<11|ae>>>21,en=te<<15|B>>>17,tn=B<<15|te>>>17,rn=j<<29|N>>>3,nn=N<<29|j>>>3,sn=K<<28|re>>>4,on=re<<28|K>>>4,an=I<<23|k>>>9,cn=k<<23|I>>>9,un=$<<25|z>>>7,ln=z<<25|$>>>7,dn=he<<21|ie>>>11,hn=ie<<21|he>>>11,fn=Re<<24|ce>>>8,pn=ce<<24|Re>>>8,gn=Ae<<27|xe>>>5,mn=xe<<27|Ae>>>5,bn=be<<20|me>>>12,yn=me<<20|be>>>12,wn=De<<7|ke>>>25,_n=ke<<7|De>>>25,vn=ve<<8|qe>>>24,En=qe<<8|ve>>>24,Rn=E<<14|y>>>18,Sn=y<<14|E>>>18;n[0]=_^~jr&Yr,n[1]=C^~$r&Xr,n[10]=sn^~bn&q,n[11]=on^~yn&se,n[20]=Dr^~Kr&un,n[21]=qr^~Qr&ln,n[30]=gn^~L&Ur,n[31]=mn^~P&Hr,n[40]=Gr^~an&wn,n[41]=Zr^~cn&_n,n[2]=jr^~Yr&dn,n[3]=$r^~Xr&hn,n[12]=bn^~q&Wr,n[13]=yn^~se&Vr,n[22]=Kr^~un&vn,n[23]=Qr^~ln&En,n[32]=L^~Ur&en,n[33]=P^~Hr&tn,n[42]=an^~wn&pe,n[43]=cn^~_n&fe,n[4]=Yr^~dn&Rn,n[5]=Xr^~hn&Sn,n[14]=q^~Wr&rn,n[15]=se^~Vr&nn,n[24]=un^~vn&ge,n[25]=ln^~En&le,n[34]=Ur^~en&fn,n[35]=Hr^~tn&pn,n[44]=wn^~pe&zr,n[45]=_n^~fe&Jr,n[6]=dn^~Rn&_,n[7]=hn^~Sn&C,n[16]=Wr^~rn&sn,n[17]=Vr^~nn&on,n[26]=vn^~ge&Dr,n[27]=En^~le&qr,n[36]=en^~fn&gn,n[37]=tn^~pn&mn,n[46]=pe^~zr&Gr,n[47]=fe^~Jr&Zr,n[8]=Rn^~_&jr,n[9]=Sn^~C&$r,n[18]=rn^~sn&bn,n[19]=nn^~on&yn,n[28]=ge^~Dr&Kr,n[29]=le^~qr&Qr,n[38]=fn^~gn&L,n[39]=pn^~mn&P,n[48]=zr^~Gr&an,n[49]=Jr^~Zr&cn,n[0]^=e[r*2],n[1]^=e[r*2+1]}},ai}var ci,Fa;function $d(){if(Fa)return ci;Fa=1;const e=jd();function n(){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}return n.prototype.initialize=function(r,t){for(let g=0;g<50;++g)this.state[g]=0;this.blockSize=r/8,this.count=0,this.squeezing=!1},n.prototype.absorb=function(r){for(let t=0;t<r.length;++t)this.state[~~(this.count/4)]^=r[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0)},n.prototype.absorbLastFewBits=function(r){this.state[~~(this.count/4)]^=r<<8*(this.count%4),(r&128)!==0&&this.count===this.blockSize-1&&e.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),e.p1600(this.state),this.count=0,this.squeezing=!0},n.prototype.squeeze=function(r){this.squeezing||this.absorbLastFewBits(1);const t=oe.alloc(r);for(let g=0;g<r;++g)t[g]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0);return t},n.prototype.copy=function(r){for(let t=0;t<50;++t)r.state[t]=this.state[t];r.blockSize=this.blockSize,r.count=this.count,r.squeezing=this.squeezing},ci=n,ci}var ui,Da;function Ud(){return Da||(Da=1,ui=qd()($d())),ui}var li,qa;function dl(){if(qa)return li;qa=1;const e=Ud(),n=Sr();function r(s){return oe.allocUnsafe(s).fill(0)}function t(s,u,i){const p=r(u);return s=l(s),i?s.length<u?(s.copy(p),p):s.slice(0,u):s.length<u?(s.copy(p,u-s.length),p):s.slice(-u)}function g(s,u){return t(s,u,!0)}function l(s){if(!oe.isBuffer(s))if(Array.isArray(s))s=oe.from(s);else if(typeof s=="string")d(s)?s=oe.from(h(f(s)),"hex"):s=oe.from(s);else if(typeof s=="number")s=intToBuffer(s);else if(s==null)s=oe.allocUnsafe(0);else if(n.isBN(s))s=s.toArrayLike(oe);else if(s.toArray)s=oe.from(s.toArray());else throw new Error("invalid type");return s}function c(s){return s=l(s),"0x"+s.toString("hex")}function o(s,u){return s=l(s),u||(u=256),e("keccak"+u).update(s).digest()}function h(s){return s.length%2?"0"+s:s}function d(s){return typeof s=="string"&&s.match(/^0x[0-9A-Fa-f]*$/)}function f(s){return typeof s=="string"&&s.startsWith("0x")?s.slice(2):s}return li={zeros:r,setLength:t,setLengthRight:g,isHexString:d,stripHexPrefix:f,toBuffer:l,bufferToHex:c,keccak:o},li}var di,ja;function Hd(){if(ja)return di;ja=1;const e=dl(),n=Sr();function r(i){return i.startsWith("int[")?"int256"+i.slice(3):i==="int"?"int256":i.startsWith("uint[")?"uint256"+i.slice(4):i==="uint"?"uint256":i.startsWith("fixed[")?"fixed128x128"+i.slice(5):i==="fixed"?"fixed128x128":i.startsWith("ufixed[")?"ufixed128x128"+i.slice(6):i==="ufixed"?"ufixed128x128":i}function t(i){return parseInt(/^\D+(\d+)$/.exec(i)[1],10)}function g(i){var p=/^\D+(\d+)x(\d+)$/.exec(i);return[parseInt(p[1],10),parseInt(p[2],10)]}function l(i){var p=i.match(/(.*)\[(.*?)\]$/);return p?p[2]===""?"dynamic":parseInt(p[2],10):null}function c(i){var p=typeof i;if(p==="string")return e.isHexString(i)?new n(e.stripHexPrefix(i),16):new n(i,10);if(p==="number")return new n(i);if(i.toArray)return i;throw new Error("Argument is not a number")}function o(i,p){var b,m,a,w;if(i==="address")return o("uint160",c(p));if(i==="bool")return o("uint8",p?1:0);if(i==="string")return o("bytes",new oe(p,"utf8"));if(d(i)){if(typeof p.length>"u")throw new Error("Not an array?");if(b=l(i),b!=="dynamic"&&b!==0&&p.length>b)throw new Error("Elements exceed array size: "+b);a=[],i=i.slice(0,i.lastIndexOf("[")),typeof p=="string"&&(p=JSON.parse(p));for(w in p)a.push(o(i,p[w]));if(b==="dynamic"){var v=o("uint256",p.length);a.unshift(v)}return oe.concat(a)}else{if(i==="bytes")return p=new oe(p),a=oe.concat([o("uint256",p.length),p]),p.length%32!==0&&(a=oe.concat([a,e.zeros(32-p.length%32)])),a;if(i.startsWith("bytes")){if(b=t(i),b<1||b>32)throw new Error("Invalid bytes<N> width: "+b);return e.setLengthRight(p,32)}else if(i.startsWith("uint")){if(b=t(i),b%8||b<8||b>256)throw new Error("Invalid uint<N> width: "+b);if(m=c(p),m.bitLength()>b)throw new Error("Supplied uint exceeds width: "+b+" vs "+m.bitLength());if(m<0)throw new Error("Supplied uint is negative");return m.toArrayLike(oe,"be",32)}else if(i.startsWith("int")){if(b=t(i),b%8||b<8||b>256)throw new Error("Invalid int<N> width: "+b);if(m=c(p),m.bitLength()>b)throw new Error("Supplied int exceeds width: "+b+" vs "+m.bitLength());return m.toTwos(256).toArrayLike(oe,"be",32)}else if(i.startsWith("ufixed")){if(b=g(i),m=c(p),m<0)throw new Error("Supplied ufixed is negative");return o("uint256",m.mul(new n(2).pow(new n(b[1]))))}else if(i.startsWith("fixed"))return b=g(i),o("int256",c(p).mul(new n(2).pow(new n(b[1]))))}throw new Error("Unsupported or invalid type: "+i)}function h(i){return i==="string"||i==="bytes"||l(i)==="dynamic"}function d(i){return i.lastIndexOf("]")===i.length-1}function f(i,p){var b=[],m=[],a=32*i.length;for(var w in i){var v=r(i[w]),R=p[w],S=o(v,R);h(v)?(b.push(o("uint256",a)),m.push(S),a+=S.length):b.push(S)}return oe.concat(b.concat(m))}function s(i,p){if(i.length!==p.length)throw new Error("Number of types are not matching the values");for(var b,m,a=[],w=0;w<i.length;w++){var v=r(i[w]),R=p[w];if(v==="bytes")a.push(R);else if(v==="string")a.push(new oe(R,"utf8"));else if(v==="bool")a.push(new oe(R?"01":"00","hex"));else if(v==="address")a.push(e.setLength(R,20));else if(v.startsWith("bytes")){if(b=t(v),b<1||b>32)throw new Error("Invalid bytes<N> width: "+b);a.push(e.setLengthRight(R,b))}else if(v.startsWith("uint")){if(b=t(v),b%8||b<8||b>256)throw new Error("Invalid uint<N> width: "+b);if(m=c(R),m.bitLength()>b)throw new Error("Supplied uint exceeds width: "+b+" vs "+m.bitLength());a.push(m.toArrayLike(oe,"be",b/8))}else if(v.startsWith("int")){if(b=t(v),b%8||b<8||b>256)throw new Error("Invalid int<N> width: "+b);if(m=c(R),m.bitLength()>b)throw new Error("Supplied int exceeds width: "+b+" vs "+m.bitLength());a.push(m.toTwos(b).toArrayLike(oe,"be",b/8))}else throw new Error("Unsupported or invalid type: "+v)}return oe.concat(a)}function u(i,p){return e.keccak(s(i,p))}return di={rawEncode:f,solidityPack:s,soliditySHA3:u},di}var hi,$a;function Wd(){if($a)return hi;$a=1;const e=dl(),n=Hd(),r={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"]},t={encodeData(l,c,o,h=!0){const d=["bytes32"],f=[this.hashType(l,o)];if(h){const s=(u,i,p)=>{if(o[i]!==void 0)return["bytes32",p==null?"0x0000000000000000000000000000000000000000000000000000000000000000":e.keccak(this.encodeData(i,p,o,h))];if(p===void 0)throw new Error(`missing value for field ${u} of type ${i}`);if(i==="bytes")return["bytes32",e.keccak(p)];if(i==="string")return typeof p=="string"&&(p=oe.from(p,"utf8")),["bytes32",e.keccak(p)];if(i.lastIndexOf("]")===i.length-1){const b=i.slice(0,i.lastIndexOf("[")),m=p.map(a=>s(u,b,a));return["bytes32",e.keccak(n.rawEncode(m.map(([a])=>a),m.map(([,a])=>a)))]}return[i,p]};for(const u of o[l]){const[i,p]=s(u.name,u.type,c[u.name]);d.push(i),f.push(p)}}else for(const s of o[l]){let u=c[s.name];if(u!==void 0)if(s.type==="bytes")d.push("bytes32"),u=e.keccak(u),f.push(u);else if(s.type==="string")d.push("bytes32"),typeof u=="string"&&(u=oe.from(u,"utf8")),u=e.keccak(u),f.push(u);else if(o[s.type]!==void 0)d.push("bytes32"),u=e.keccak(this.encodeData(s.type,u,o,h)),f.push(u);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");d.push(s.type),f.push(u)}}return n.rawEncode(d,f)},encodeType(l,c){let o="",h=this.findTypeDependencies(l,c).filter(d=>d!==l);h=[l].concat(h.sort());for(const d of h){if(!c[d])throw new Error("No type definition specified: "+d);o+=d+"("+c[d].map(({name:s,type:u})=>u+" "+s).join(",")+")"}return o},findTypeDependencies(l,c,o=[]){if(l=l.match(/^\w*/)[0],o.includes(l)||c[l]===void 0)return o;o.push(l);for(const h of c[l])for(const d of this.findTypeDependencies(h.type,c,o))!o.includes(d)&&o.push(d);return o},hashStruct(l,c,o,h=!0){return e.keccak(this.encodeData(l,c,o,h))},hashType(l,c){return e.keccak(this.encodeType(l,c))},sanitizeData(l){const c={};for(const o in r.properties)l[o]&&(c[o]=l[o]);return c.types&&(c.types=Object.assign({EIP712Domain:[]},c.types)),c},hash(l,c=!0){const o=this.sanitizeData(l),h=[oe.from("1901","hex")];return h.push(this.hashStruct("EIP712Domain",o.domain,o.types,c)),o.primaryType!=="EIP712Domain"&&h.push(this.hashStruct(o.primaryType,o.message,o.types,c)),e.keccak(oe.concat(h))}};hi={TYPED_MESSAGE_SCHEMA:r,TypedDataUtils:t,hashForSignTypedDataLegacy:function(l){return g(l.data)},hashForSignTypedData_v3:function(l){return t.hash(l.data,!1)},hashForSignTypedData_v4:function(l){return t.hash(l.data)}};function g(l){const c=new Error("Expect argument to be non-empty array");if(typeof l!="object"||!l.length)throw c;const o=l.map(function(f){return f.type==="bytes"?e.toBuffer(f.value):f.value}),h=l.map(function(f){return f.type}),d=l.map(function(f){if(!f.name)throw c;return f.type+" "+f.name});return n.soliditySHA3(["bytes32","bytes32"],[n.soliditySHA3(new Array(l.length).fill("string"),d),n.soliditySHA3(h,o)])}return hi}var rt={},Ua;function Vd(){if(Ua)return rt;Ua=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.filterFromParam=rt.FilterPolyfill=void 0;const e=xr(),n=Ue(),r=300*1e3,t={jsonrpc:"2.0",id:0};let g=class{constructor(u){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,e.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=u}async newFilter(u){const i=l(u),p=this.makeFilterId(),b=await this.setInitialCursorPosition(p,i.fromBlock);return console.info(`Installing new log filter(${p}):`,i,"initial cursor position:",b),this.logFilters.set(p,i),this.setFilterTimeout(p),(0,n.hexStringFromIntNumber)(p)}async newBlockFilter(){const u=this.makeFilterId(),i=await this.setInitialCursorPosition(u,"latest");return console.info(`Installing new block filter (${u}) with initial cursor position:`,i),this.blockFilters.add(u),this.setFilterTimeout(u),(0,n.hexStringFromIntNumber)(u)}async newPendingTransactionFilter(){const u=this.makeFilterId(),i=await this.setInitialCursorPosition(u,"latest");return console.info(`Installing new block filter (${u}) with initial cursor position:`,i),this.pendingTransactionFilters.add(u),this.setFilterTimeout(u),(0,n.hexStringFromIntNumber)(u)}uninstallFilter(u){const i=(0,n.intNumberFromHexString)(u);return console.info(`Uninstalling filter (${i})`),this.deleteFilter(i),!0}getFilterChanges(u){const i=(0,n.intNumberFromHexString)(u);return this.timeouts.has(i)&&this.setFilterTimeout(i),this.logFilters.has(i)?this.getLogFilterChanges(i):this.blockFilters.has(i)?this.getBlockFilterChanges(i):this.pendingTransactionFilters.has(i)?this.getPendingTransactionFilterChanges(i):Promise.resolve(d())}async getFilterLogs(u){const i=(0,n.intNumberFromHexString)(u),p=this.logFilters.get(i);return p?this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[c(p)]})):d()}makeFilterId(){return(0,e.IntNumber)(++this.nextFilterId)}sendAsyncPromise(u){return new Promise((i,p)=>{this.provider.sendAsync(u,(b,m)=>{if(b)return p(b);if(Array.isArray(m)||m==null)return p(new Error(`unexpected response received: ${JSON.stringify(m)}`));i(m)})})}deleteFilter(u){console.info(`Deleting filter (${u})`),this.logFilters.delete(u),this.blockFilters.delete(u),this.pendingTransactionFilters.delete(u),this.cursors.delete(u),this.timeouts.delete(u)}async getLogFilterChanges(u){const i=this.logFilters.get(u),p=this.cursors.get(u);if(!p||!i)return d();const b=await this.getCurrentBlockHeight(),m=i.toBlock==="latest"?b:i.toBlock;if(p>b||p>Number(i.toBlock))return f();console.info(`Fetching logs from ${p} to ${m} for filter ${u}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[c(Object.assign(Object.assign({},i),{fromBlock:p,toBlock:m}))]}));if(Array.isArray(a.result)){const w=a.result.map(R=>(0,n.intNumberFromHexString)(R.blockNumber||"0x0")),v=Math.max(...w);if(v&&v>p){const R=(0,e.IntNumber)(v+1);console.info(`Moving cursor position for filter (${u}) from ${p} to ${R}`),this.cursors.set(u,R)}}return a}async getBlockFilterChanges(u){const i=this.cursors.get(u);if(!i)return d();const p=await this.getCurrentBlockHeight();if(i>p)return f();console.info(`Fetching blocks from ${i} to ${p} for filter (${u})`);const b=(await Promise.all((0,n.range)(i,p+1).map(a=>this.getBlockHashByNumber((0,e.IntNumber)(a))))).filter(a=>!!a),m=(0,e.IntNumber)(i+b.length);return console.info(`Moving cursor position for filter (${u}) from ${i} to ${m}`),this.cursors.set(u,m),Object.assign(Object.assign({},t),{result:b})}async getPendingTransactionFilterChanges(u){return Promise.resolve(f())}async setInitialCursorPosition(u,i){const p=await this.getCurrentBlockHeight(),b=typeof i=="number"&&i>p?i:p;return this.cursors.set(u,b),b}setFilterTimeout(u){const i=this.timeouts.get(u);i&&window.clearTimeout(i);const p=window.setTimeout(()=>{console.info(`Filter (${u}) timed out`),this.deleteFilter(u)},r);this.timeouts.set(u,p)}async getCurrentBlockHeight(){const u=new Date;if(u.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=u;const i=await this._getCurrentBlockHeight();this.currentBlockHeight=i,this.resolvers.forEach(p=>p(i)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(i=>this.resolvers.push(i))}async _getCurrentBlockHeight(){const{result:u}=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_blockNumber",params:[]}));return(0,n.intNumberFromHexString)((0,n.ensureHexString)(u))}async getBlockHashByNumber(u){const i=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getBlockByNumber",params:[(0,n.hexStringFromIntNumber)(u),!1]}));return i.result&&typeof i.result.hash=="string"?(0,n.ensureHexString)(i.result.hash):null}};rt.FilterPolyfill=g;function l(s){return{fromBlock:o(s.fromBlock),toBlock:o(s.toBlock),addresses:s.address===void 0?null:Array.isArray(s.address)?s.address:[s.address],topics:s.topics||[]}}rt.filterFromParam=l;function c(s){const u={fromBlock:h(s.fromBlock),toBlock:h(s.toBlock),topics:s.topics};return s.addresses!==null&&(u.address=s.addresses),u}function o(s){if(s===void 0||s==="latest"||s==="pending")return"latest";if(s==="earliest")return(0,e.IntNumber)(0);if((0,n.isHexString)(s))return(0,n.intNumberFromHexString)(s);throw new Error(`Invalid block option: ${String(s)}`)}function h(s){return s==="latest"?s:(0,n.hexStringFromIntNumber)(s)}function d(){return Object.assign(Object.assign({},t),{error:{code:-32e3,message:"filter not found"}})}function f(){return Object.assign(Object.assign({},t),{result:[]})}return rt}var zt={},nt={},it={},fi,Ha;function Us(){if(Ha)return fi;Ha=1,fi=e;function e(n){n=n||{};var r=n.max||Number.MAX_SAFE_INTEGER,t=typeof n.start<"u"?n.start:Math.floor(Math.random()*r);return function(){return t=t%r,t++}}return fi}var pi,Wa;function zd(){if(Wa)return pi;Wa=1;const e=(n,r)=>function(){const t=r.promiseModule,g=new Array(arguments.length);for(let l=0;l<arguments.length;l++)g[l]=arguments[l];return new t((l,c)=>{r.errorFirst?g.push(function(o,h){if(r.multiArgs){const d=new Array(arguments.length-1);for(let f=1;f<arguments.length;f++)d[f-1]=arguments[f];o?(d.unshift(o),c(d)):l(d)}else o?c(o):l(h)}):g.push(function(o){if(r.multiArgs){const h=new Array(arguments.length-1);for(let d=0;d<arguments.length;d++)h[d]=arguments[d];l(h)}else l(o)}),n.apply(this,g)})};return pi=(n,r)=>{r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);const t=l=>{const c=o=>typeof o=="string"?l===o:o.test(l);return r.include?r.include.some(c):!r.exclude.some(c)};let g;typeof n=="function"?g=function(){return r.excludeMain?n.apply(this,arguments):e(n,r).apply(this,arguments)}:g=Object.create(Object.getPrototypeOf(n));for(const l in n){const c=n[l];g[l]=typeof c=="function"&&t(l)?e(c,r):c}return g},pi}var st={},yr={},Va;function Hs(){if(Va)return yr;Va=1,Object.defineProperty(yr,"__esModule",{value:!0});const e=kr();function n(g,l,c){try{Reflect.apply(g,l,c)}catch(o){setTimeout(()=>{throw o})}}function r(g){const l=g.length,c=new Array(l);for(let o=0;o<l;o+=1)c[o]=g[o];return c}class t extends e.EventEmitter{emit(l,...c){let o=l==="error";const h=this._events;if(h!==void 0)o=o&&h.error===void 0;else if(!o)return!1;if(o){let f;if(c.length>0&&([f]=c),f instanceof Error)throw f;const s=new Error(`Unhandled error.${f?` (${f.message})`:""}`);throw s.context=f,s}const d=h[l];if(d===void 0)return!1;if(typeof d=="function")n(d,this,c);else{const f=d.length,s=r(d);for(let u=0;u<f;u+=1)n(s[u],this,c)}return!0}}return yr.default=t,yr}var za;function hl(){if(za)return st;za=1;var e=st&&st.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(st,"__esModule",{value:!0}),st.BaseBlockTracker=void 0;const n=e(Hs()),r=1e3,t=(o,h)=>o+h,g=["sync","latest"];let l=class extends n.default{constructor(h){super(),this._blockResetDuration=h.blockResetDuration||20*r,this._usePastBlocks=h.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(d=>this.once("latest",d))}removeAllListeners(h){return h?super.removeAllListeners(h):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(h){g.includes(h)&&this._maybeStart()}_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 g.map(h=>this.listenerCount(h)).reduce(t)}_shouldUseNewBlock(h){const d=this._currentBlock;if(!d)return!0;const f=c(h),s=c(d);return this._usePastBlocks&&f<s||f>s}_newPotentialLatest(h){this._shouldUseNewBlock(h)&&this._setCurrentBlock(h)}_setCurrentBlock(h){const d=this._currentBlock;this._currentBlock=h,this.emit("latest",h),this.emit("sync",{oldBlock:d,newBlock:h})}_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}};st.BaseBlockTracker=l;function c(o){return Number.parseInt(o,16)}return st}var gi={},ot={},Le={};class fl extends TypeError{constructor(n,r){let t;const{message:g,explanation:l,...c}=n,{path:o}=n,h=o.length===0?g:`At path: ${o.join(".")} -- ${g}`;super(l??h),l!=null&&(this.cause=h),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>t??(t=[n,...r()])}}function Jd(e){return Ie(e)&&typeof e[Symbol.iterator]=="function"}function Ie(e){return typeof e=="object"&&e!=null}function Ja(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}function we(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Gd(e){const{done:n,value:r}=e.next();return n?void 0:r}function Zd(e,n,r,t){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:g,branch:l}=n,{type:c}=r,{refinement:o,message:h=`Expected a value of type \`${c}\`${o?` with refinement \`${o}\``:""}, but received: \`${we(t)}\``}=e;return{value:t,type:c,refinement:o,key:g[g.length-1],path:g,branch:l,...e,message:h}}function*Ns(e,n,r,t){Jd(e)||(e=[e]);for(const g of e){const l=Zd(g,n,r,t);l&&(yield l)}}function*Ws(e,n,r={}){const{path:t=[],branch:g=[e],coerce:l=!1,mask:c=!1}=r,o={path:t,branch:g};if(l&&(e=n.coercer(e,o),c&&n.type!=="type"&&Ie(n.schema)&&Ie(e)&&!Array.isArray(e)))for(const d in e)n.schema[d]===void 0&&delete e[d];let h="valid";for(const d of n.validator(e,o))d.explanation=r.message,h="not_valid",yield[d,void 0];for(let[d,f,s]of n.entries(e,o)){const u=Ws(f,s,{path:d===void 0?t:[...t,d],branch:d===void 0?g:[...g,f],coerce:l,mask:c,message:r.message});for(const i of u)i[0]?(h=i[0].refinement!=null?"not_refined":"not_valid",yield[i[0],void 0]):l&&(f=i[1],d===void 0?e=f:e instanceof Map?e.set(d,f):e instanceof Set?e.add(f):Ie(e)&&(f!==void 0||d in e)&&(e[d]=f))}if(h!=="not_valid")for(const d of n.refiner(e,o))d.explanation=r.message,h="not_refined",yield[d,void 0];h==="valid"&&(yield[void 0,e])}class ye{constructor(n){const{type:r,schema:t,validator:g,refiner:l,coercer:c=h=>h,entries:o=function*(){}}=n;this.type=r,this.schema=t,this.entries=o,this.coercer=c,g?this.validator=(h,d)=>{const f=g(h,d);return Ns(f,d,this,h)}:this.validator=()=>[],l?this.refiner=(h,d)=>{const f=l(h,d);return Ns(f,d,this,h)}:this.refiner=()=>[]}assert(n,r){return pl(n,this,r)}create(n,r){return gl(n,this,r)}is(n){return Vs(n,this)}mask(n,r){return ml(n,this,r)}validate(n,r={}){return yt(n,this,r)}}function pl(e,n,r){const t=yt(e,n,{message:r});if(t[0])throw t[0]}function gl(e,n,r){const t=yt(e,n,{coerce:!0,message:r});if(t[0])throw t[0];return t[1]}function ml(e,n,r){const t=yt(e,n,{coerce:!0,mask:!0,message:r});if(t[0])throw t[0];return t[1]}function Vs(e,n){return!yt(e,n)[0]}function yt(e,n,r={}){const t=Ws(e,n,r),g=Gd(t);return g[0]?[new fl(g[0],function*(){for(const c of t)c[0]&&(yield c[0])}),void 0]:[void 0,g[1]]}function Kd(...e){const n=e[0].type==="type",r=e.map(g=>g.schema),t=Object.assign({},...r);return n?sr(t):ir(t)}function Ce(e,n){return new ye({type:e,schema:null,validator:n})}function Qd(e,n){return new ye({...e,refiner:(r,t)=>r===void 0||e.refiner(r,t),validator(r,t){return r===void 0?!0:(n(r,t),e.validator(r,t))}})}function Yd(e){return new ye({type:"dynamic",schema:null,*entries(n,r){yield*e(n,r).entries(n,r)},validator(n,r){return e(n,r).validator(n,r)},coercer(n,r){return e(n,r).coercer(n,r)},refiner(n,r){return e(n,r).refiner(n,r)}})}function Xd(e){let n;return new ye({type:"lazy",schema:null,*entries(r,t){n??(n=e()),yield*n.entries(r,t)},validator(r,t){return n??(n=e()),n.validator(r,t)},coercer(r,t){return n??(n=e()),n.coercer(r,t)},refiner(r,t){return n??(n=e()),n.refiner(r,t)}})}function eh(e,n){const{schema:r}=e,t={...r};for(const g of n)delete t[g];return e.type==="type"?sr(t):ir(t)}function th(e){const n=e instanceof ye,r=n?{...e.schema}:{...e};for(const t in r)r[t]=bl(r[t]);return n&&e.type==="type"?sr(r):ir(r)}function rh(e,n){const{schema:r}=e,t={};for(const g of n)t[g]=r[g];return e.type==="type"?sr(t):ir(t)}function nh(e,n){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ce(e,n)}function ih(){return Ce("any",()=>!0)}function sh(e){return new ye({type:"array",schema:e,*entries(n){if(e&&Array.isArray(n))for(const[r,t]of n.entries())yield[r,t,e]},coercer(n){return Array.isArray(n)?n.slice():n},validator(n){return Array.isArray(n)||`Expected an array value, but received: ${we(n)}`}})}function oh(){return Ce("bigint",e=>typeof e=="bigint")}function ah(){return Ce("boolean",e=>typeof e=="boolean")}function ch(){return Ce("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${we(e)}`)}function uh(e){const n={},r=e.map(t=>we(t)).join();for(const t of e)n[t]=t;return new ye({type:"enums",schema:n,validator(t){return e.includes(t)||`Expected one of \`${r}\`, but received: ${we(t)}`}})}function lh(){return Ce("func",e=>typeof e=="function"||`Expected a function, but received: ${we(e)}`)}function dh(e){return Ce("instance",n=>n instanceof e||`Expected a \`${e.name}\` instance, but received: ${we(n)}`)}function hh(){return Ce("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${we(e)}`)}function fh(e){return new ye({type:"intersection",schema:null,*entries(n,r){for(const t of e)yield*t.entries(n,r)},*validator(n,r){for(const t of e)yield*t.validator(n,r)},*refiner(n,r){for(const t of e)yield*t.refiner(n,r)}})}function ph(e){const n=we(e),r=typeof e;return new ye({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(t){return t===e||`Expected the literal \`${n}\`, but received: ${we(t)}`}})}function gh(e,n){return new ye({type:"map",schema:null,*entries(r){if(e&&n&&r instanceof Map)for(const[t,g]of r.entries())yield[t,t,e],yield[t,g,n]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${we(r)}`}})}function zs(){return Ce("never",()=>!1)}function mh(e){return new ye({...e,validator:(n,r)=>n===null||e.validator(n,r),refiner:(n,r)=>n===null||e.refiner(n,r)})}function bh(){return Ce("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${we(e)}`)}function ir(e){const n=e?Object.keys(e):[],r=zs();return new ye({type:"object",schema:e||null,*entries(t){if(e&&Ie(t)){const g=new Set(Object.keys(t));for(const l of n)g.delete(l),yield[l,t[l],e[l]];for(const l of g)yield[l,t[l],r]}},validator(t){return Ie(t)||`Expected an object, but received: ${we(t)}`},coercer(t){return Ie(t)?{...t}:t}})}function bl(e){return new ye({...e,validator:(n,r)=>n===void 0||e.validator(n,r),refiner:(n,r)=>n===void 0||e.refiner(n,r)})}function yh(e,n){return new ye({type:"record",schema:null,*entries(r){if(Ie(r))for(const t in r){const g=r[t];yield[t,t,e],yield[t,g,n]}},validator(r){return Ie(r)||`Expected an object, but received: ${we(r)}`}})}function wh(){return Ce("regexp",e=>e instanceof RegExp)}function _h(e){return new ye({type:"set",schema:null,*entries(n){if(e&&n instanceof Set)for(const r of n)yield[r,r,e]},coercer(n){return n instanceof Set?new Set(n):n},validator(n){return n instanceof Set||`Expected a \`Set\` object, but received: ${we(n)}`}})}function yl(){return Ce("string",e=>typeof e=="string"||`Expected a string, but received: ${we(e)}`)}function vh(e){const n=zs();return new ye({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const t=Math.max(e.length,r.length);for(let g=0;g<t;g++)yield[g,r[g],e[g]||n]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${we(r)}`}})}function sr(e){const n=Object.keys(e);return new ye({type:"type",schema:e,*entries(r){if(Ie(r))for(const t of n)yield[t,r[t],e[t]]},validator(r){return Ie(r)||`Expected an object, but received: ${we(r)}`},coercer(r){return Ie(r)?{...r}:r}})}function Eh(e){const n=e.map(r=>r.type).join(" | ");return new ye({type:"union",schema:null,coercer(r){for(const t of e){const[g,l]=t.validate(r,{coerce:!0});if(!g)return l}return r},validator(r,t){const g=[];for(const l of e){const[...c]=Ws(r,l,t),[o]=c;if(o[0])for(const[h]of c)h&&g.push(h);else return[]}return[`Expected the value to satisfy a union of \`${n}\`, but received: ${we(r)}`,...g]}})}function wl(){return Ce("unknown",()=>!0)}function Js(e,n,r){return new ye({...e,coercer:(t,g)=>Vs(t,n)?e.coercer(r(t,g),g):e.coercer(t,g)})}function Rh(e,n,r={}){return Js(e,wl(),t=>{const g=typeof n=="function"?n():n;if(t===void 0)return g;if(!r.strict&&Ja(t)&&Ja(g)){const l={...t};let c=!1;for(const o in g)l[o]===void 0&&(l[o]=g[o],c=!0);if(c)return l}return t})}function Sh(e){return Js(e,yl(),n=>n.trim())}function Ch(e){return ft(e,"empty",n=>{const r=_l(n);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function _l(e){return e instanceof Map||e instanceof Set?e.size:e.length}function kh(e,n,r={}){const{exclusive:t}=r;return ft(e,"max",g=>t?g<n:g<=n||`Expected a ${e.type} less than ${t?"":"or equal to "}${n} but received \`${g}\``)}function Ih(e,n,r={}){const{exclusive:t}=r;return ft(e,"min",g=>t?g>n:g>=n||`Expected a ${e.type} greater than ${t?"":"or equal to "}${n} but received \`${g}\``)}function Ah(e){return ft(e,"nonempty",n=>_l(n)>0||`Expected a nonempty ${e.type} but received an empty one`)}function xh(e,n){return ft(e,"pattern",r=>n.test(r)||`Expected a ${e.type} matching \`/${n.source}/\` but received "${r}"`)}function Th(e,n,r=n){const t=`Expected a ${e.type}`,g=n===r?`of \`${n}\``:`between \`${n}\` and \`${r}\``;return ft(e,"size",l=>{if(typeof l=="number"||l instanceof Date)return n<=l&&l<=r||`${t} ${g} but received \`${l}\``;if(l instanceof Map||l instanceof Set){const{size:c}=l;return n<=c&&c<=r||`${t} with a size ${g} but received one with a size of \`${c}\``}else{const{length:c}=l;return n<=c&&c<=r||`${t} with a length ${g} but received one with a length of \`${c}\``}})}function ft(e,n,r){return new ye({...e,*refiner(t,g){yield*e.refiner(t,g);const l=r(t,g),c=Ns(l,g,e,t);for(const o of c)yield{...o,refinement:n}}})}const Lh=Object.freeze(Object.defineProperty({__proto__:null,Struct:ye,StructError:fl,any:ih,array:sh,assert:pl,assign:Kd,bigint:oh,boolean:ah,coerce:Js,create:gl,date:ch,defaulted:Rh,define:Ce,deprecated:Qd,dynamic:Yd,empty:Ch,enums:uh,func:lh,instance:dh,integer:hh,intersection:fh,is:Vs,lazy:Xd,literal:ph,map:gh,mask:ml,max:kh,min:Ih,never:zs,nonempty:Ah,nullable:mh,number:bh,object:ir,omit:eh,optional:bl,partial:th,pattern:xh,pick:rh,record:yh,refine:ft,regexp:wh,set:_h,size:Th,string:yl,struct:nh,trimmed:Sh,tuple:vh,type:sr,union:Eh,unknown:wl,validate:yt},Symbol.toStringTag,{value:"Module"})),pt=Cr(Lh);var Ga;function Ve(){if(Ga)return Le;Ga=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.assertExhaustive=Le.assertStruct=Le.assert=Le.AssertionError=void 0;const e=pt;function n(d){return typeof d=="object"&&d!==null&&"message"in d}function r(d){var f,s;return typeof((s=(f=d?.prototype)===null||f===void 0?void 0:f.constructor)===null||s===void 0?void 0:s.name)=="string"}function t(d){const f=n(d)?d.message:String(d);return f.endsWith(".")?f.slice(0,-1):f}function g(d,f){return r(d)?new d({message:f}):d({message:f})}class l extends Error{constructor(f){super(f.message),this.code="ERR_ASSERTION"}}Le.AssertionError=l;function c(d,f="Assertion failed.",s=l){if(!d)throw f instanceof Error?f:g(s,f)}Le.assert=c;function o(d,f,s="Assertion failed",u=l){try{(0,e.assert)(d,f)}catch(i){throw g(u,`${s}: ${t(i)}.`)}}Le.assertStruct=o;function h(d){throw new Error("Invalid branch reached. Should be detected during compilation.")}return Le.assertExhaustive=h,Le}var Jt={},Za;function vl(){if(Za)return Jt;Za=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.base64=void 0;const e=pt,n=Ve(),r=(t,g={})=>{var l,c;const o=(l=g.paddingRequired)!==null&&l!==void 0?l:!1,h=(c=g.characterSet)!==null&&c!==void 0?c:"base64";let d;h==="base64"?d=String.raw`[A-Za-z0-9+\/]`:((0,n.assert)(h==="base64url"),d=String.raw`[-_A-Za-z0-9]`);let f;return o?f=new RegExp(`^(?:${d}{4})*(?:${d}{3}=|${d}{2}==)?$`,"u"):f=new RegExp(`^(?:${d}{4})*(?:${d}{2,3}|${d}{3}=|${d}{2}==)?$`,"u"),(0,e.pattern)(t,f)};return Jt.base64=r,Jt}var ue={},mi={},Ka;function Mr(){return Ka||(Ka=1,(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 n=pt,r=Ve();e.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu);function t(d){return(0,n.is)(d,e.HexStruct)}e.isHexString=t;function g(d){return(0,n.is)(d,e.StrictHexStruct)}e.isStrictHexString=g;function l(d){(0,r.assert)(t(d),"Value must be a hexadecimal string.")}e.assertIsHexString=l;function c(d){(0,r.assert)(g(d),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=c;function o(d){return d.startsWith("0x")?d:d.startsWith("0X")?`0x${d.substring(2)}`:`0x${d}`}e.add0x=o;function h(d){return d.startsWith("0x")||d.startsWith("0X")?d.substring(2):d}e.remove0x=h})(mi)),mi}var Qa;function El(){if(Qa)return ue;Qa=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.createDataView=ue.concatBytes=ue.valueToBytes=ue.stringToBytes=ue.numberToBytes=ue.signedBigIntToBytes=ue.bigIntToBytes=ue.hexToBytes=ue.bytesToString=ue.bytesToNumber=ue.bytesToSignedBigInt=ue.bytesToBigInt=ue.bytesToHex=ue.assertIsBytes=ue.isBytes=void 0;const e=Ve(),n=Mr(),r=48,t=58,g=87;function l(){const A=[];return()=>{if(A.length===0)for(let M=0;M<256;M++)A.push(M.toString(16).padStart(2,"0"));return A}}const c=l();function o(A){return A instanceof Uint8Array}ue.isBytes=o;function h(A){(0,e.assert)(o(A),"Value must be a Uint8Array.")}ue.assertIsBytes=h;function d(A){if(h(A),A.length===0)return"0x";const M=c(),D=new Array(A.length);for(let V=0;V<A.length;V++)D[V]=M[A[V]];return(0,n.add0x)(D.join(""))}ue.bytesToHex=d;function f(A){h(A);const M=d(A);return BigInt(M)}ue.bytesToBigInt=f;function s(A){h(A);let M=BigInt(0);for(const D of A)M=(M<<BigInt(8))+BigInt(D);return BigInt.asIntN(A.length*8,M)}ue.bytesToSignedBigInt=s;function u(A){h(A);const M=f(A);return(0,e.assert)(M<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(M)}ue.bytesToNumber=u;function i(A){return h(A),new TextDecoder().decode(A)}ue.bytesToString=i;function p(A){var M;if(((M=A?.toLowerCase)===null||M===void 0?void 0:M.call(A))==="0x")return new Uint8Array;(0,n.assertIsHexString)(A);const D=(0,n.remove0x)(A).toLowerCase(),V=D.length%2===0?D:`0${D}`,Z=new Uint8Array(V.length/2);for(let Y=0;Y<Z.length;Y++){const ne=V.charCodeAt(Y*2),H=V.charCodeAt(Y*2+1),F=ne-(ne<t?r:g),T=H-(H<t?r:g);Z[Y]=F*16+T}return Z}ue.hexToBytes=p;function b(A){(0,e.assert)(typeof A=="bigint","Value must be a bigint."),(0,e.assert)(A>=BigInt(0),"Value must be a non-negative bigint.");const M=A.toString(16);return p(M)}ue.bigIntToBytes=b;function m(A,M){(0,e.assert)(M>0);const D=A>>BigInt(31);return!((~A&D)+(A&~D)>>BigInt(M*8+-1))}function a(A,M){(0,e.assert)(typeof A=="bigint","Value must be a bigint."),(0,e.assert)(typeof M=="number","Byte length must be a number."),(0,e.assert)(M>0,"Byte length must be greater than 0."),(0,e.assert)(m(A,M),"Byte length is too small to represent the given value.");let D=A;const V=new Uint8Array(M);for(let Z=0;Z<V.length;Z++)V[Z]=Number(BigInt.asUintN(8,D)),D>>=BigInt(8);return V.reverse()}ue.signedBigIntToBytes=a;function w(A){(0,e.assert)(typeof A=="number","Value must be a number."),(0,e.assert)(A>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(A),"Value is not a safe integer. Use `bigIntToBytes` instead.");const M=A.toString(16);return p(M)}ue.numberToBytes=w;function v(A){return(0,e.assert)(typeof A=="string","Value must be a string."),new TextEncoder().encode(A)}ue.stringToBytes=v;function R(A){if(typeof A=="bigint")return b(A);if(typeof A=="number")return w(A);if(typeof A=="string")return A.startsWith("0x")?p(A):v(A);if(o(A))return A;throw new TypeError(`Unsupported value type: "${typeof A}".`)}ue.valueToBytes=R;function S(A){const M=new Array(A.length);let D=0;for(let Z=0;Z<A.length;Z++){const Y=R(A[Z]);M[Z]=Y,D+=Y.length}const V=new Uint8Array(D);for(let Z=0,Y=0;Z<M.length;Z++)V.set(M[Z],Y),Y+=M[Z].length;return V}ue.concatBytes=S;function x(A){if(typeof oe<"u"&&A instanceof oe){const M=A.buffer.slice(A.byteOffset,A.byteOffset+A.byteLength);return new DataView(M)}return new DataView(A.buffer,A.byteOffset,A.byteLength)}return ue.createDataView=x,ue}var Gt={},Ya;function Mh(){if(Ya)return Gt;Ya=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.ChecksumStruct=void 0;const e=pt,n=vl();return Gt.ChecksumStruct=(0,e.size)((0,n.base64)((0,e.string)(),{paddingRequired:!0}),44,44),Gt}var Me={},Xa;function Nh(){if(Xa)return Me;Xa=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.createHex=Me.createBytes=Me.createBigInt=Me.createNumber=void 0;const e=pt,n=Ve(),r=El(),t=Mr(),g=(0,e.union)([(0,e.number)(),(0,e.bigint)(),(0,e.string)(),t.StrictHexStruct]),l=(0,e.coerce)((0,e.number)(),g,Number),c=(0,e.coerce)((0,e.bigint)(),g,BigInt);(0,e.union)([t.StrictHexStruct,(0,e.instance)(Uint8Array)]);const o=(0,e.coerce)((0,e.instance)(Uint8Array),(0,e.union)([t.StrictHexStruct]),r.hexToBytes),h=(0,e.coerce)(t.StrictHexStruct,(0,e.instance)(Uint8Array),r.bytesToHex);function d(i){try{const p=(0,e.create)(i,l);return(0,n.assert)(Number.isFinite(p),`Expected a number-like value, got "${i}".`),p}catch(p){throw p instanceof e.StructError?new Error(`Expected a number-like value, got "${i}".`):p}}Me.createNumber=d;function f(i){try{return(0,e.create)(i,c)}catch(p){throw p instanceof e.StructError?new Error(`Expected a number-like value, got "${String(p.value)}".`):p}}Me.createBigInt=f;function s(i){if(typeof i=="string"&&i.toLowerCase()==="0x")return new Uint8Array;try{return(0,e.create)(i,o)}catch(p){throw p instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(p.value)}".`):p}}Me.createBytes=s;function u(i){if(i instanceof Uint8Array&&i.length===0||typeof i=="string"&&i.toLowerCase()==="0x")return"0x";try{return(0,e.create)(i,h)}catch(p){throw p instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(p.value)}".`):p}}return Me.createHex=u,Me}var Ne={},ec;function Bh(){if(ec)return Ne;ec=1;var e=Ne&&Ne.__classPrivateFieldSet||function(c,o,h,d,f){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!f)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?c!==o||!f:!o.has(c))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?f.call(c,h):f?f.value=h:o.set(c,h),h},n=Ne&&Ne.__classPrivateFieldGet||function(c,o,h,d){if(h==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?c!==o||!d:!o.has(c))throw new TypeError("Cannot read private member from an object whose class did not declare it");return h==="m"?d:h==="a"?d.call(c):d?d.value:o.get(c)},r,t;Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.FrozenSet=Ne.FrozenMap=void 0;class g{constructor(o){r.set(this,void 0),e(this,r,new Map(o),"f"),Object.freeze(this)}get size(){return n(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return n(this,r,"f")[Symbol.iterator]()}entries(){return n(this,r,"f").entries()}forEach(o,h){return n(this,r,"f").forEach((d,f,s)=>o.call(h,d,f,this))}get(o){return n(this,r,"f").get(o)}has(o){return n(this,r,"f").has(o)}keys(){return n(this,r,"f").keys()}values(){return n(this,r,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([o,h])=>`${String(o)} => ${String(h)}`).join(", ")} `:""}}`}}Ne.FrozenMap=g;class l{constructor(o){t.set(this,void 0),e(this,t,new Set(o),"f"),Object.freeze(this)}get size(){return n(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return n(this,t,"f")[Symbol.iterator]()}entries(){return n(this,t,"f").entries()}forEach(o,h){return n(this,t,"f").forEach((d,f,s)=>o.call(h,d,f,this))}has(o){return n(this,t,"f").has(o)}keys(){return n(this,t,"f").keys()}values(){return n(this,t,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(o=>String(o)).join(", ")} `:""}}`}}return Ne.FrozenSet=l,Object.freeze(g),Object.freeze(g.prototype),Object.freeze(l),Object.freeze(l.prototype),Ne}var bi={},tc;function Ph(){return tc||(tc=1,Object.defineProperty(bi,"__esModule",{value:!0})),bi}var yi={},rc;function Oh(){return rc||(rc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const n=pt,r=Ve(),t=()=>(0,n.define)("finite number",S=>(0,n.is)(S,(0,n.number)())&&Number.isFinite(S));e.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),t(),(0,n.string)(),(0,n.array)((0,n.lazy)(()=>e.UnsafeJsonStruct)),(0,n.record)((0,n.string)(),(0,n.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,n.define)("Json",(S,x)=>{function A(M,D){const Z=[...D.validator(M,x)];return Z.length>0?Z:!0}try{const M=A(S,e.UnsafeJsonStruct);return M!==!0?M:A(JSON.parse(JSON.stringify(S)),e.UnsafeJsonStruct)}catch(M){return M instanceof RangeError?"Circular reference detected":!1}});function g(S){return(0,n.is)(S,e.JsonStruct)}e.isValidJson=g;function l(S){(0,r.assertStruct)(S,e.JsonStruct,"Invalid JSON value");const x=JSON.stringify(S);return new TextEncoder().encode(x).byteLength}e.getJsonSize=l,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,n.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),e.JsonRpcErrorStruct=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(e.JsonStruct),stack:(0,n.optional)((0,n.string)())}),e.JsonRpcParamsStruct=(0,n.optional)((0,n.union)([(0,n.record)((0,n.string)(),e.JsonStruct),(0,n.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,n.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,n.omit)(e.JsonRpcRequestStruct,["id"]);function c(S){return(0,n.is)(S,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=c;function o(S,x){(0,r.assertStruct)(S,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",x)}e.assertIsJsonRpcNotification=o;function h(S){return(0,n.is)(S,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=h;function d(S,x){(0,r.assertStruct)(S,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",x)}e.assertIsJsonRpcRequest=d,e.PendingJsonRpcResponseStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,n.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function f(S){return(0,n.is)(S,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=f;function s(S,x){(0,r.assertStruct)(S,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",x)}e.assertIsPendingJsonRpcResponse=s;function u(S){return(0,n.is)(S,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=u;function i(S,x){(0,r.assertStruct)(S,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",x)}e.assertIsJsonRpcResponse=i;function p(S){return(0,n.is)(S,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=p;function b(S,x){(0,r.assertStruct)(S,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",x)}e.assertIsJsonRpcSuccess=b;function m(S){return(0,n.is)(S,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=m;function a(S,x){(0,r.assertStruct)(S,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",x)}e.assertIsJsonRpcFailure=a;function w(S){return(0,n.is)(S,e.JsonRpcErrorStruct)}e.isJsonRpcError=w;function v(S,x){(0,r.assertStruct)(S,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",x)}e.assertIsJsonRpcError=v;function R(S){const{permitEmptyString:x,permitFractions:A,permitNull:M}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},S);return V=>!!(typeof V=="number"&&(A||Number.isInteger(V))||typeof V=="string"&&(x||V.length>0)||M&&V===null)}e.getJsonRpcIdValidator=R})(yi)),yi}var wi={},nc;function Fh(){return nc||(nc=1,Object.defineProperty(wi,"__esModule",{value:!0})),wi}var $e={},wr={exports:{}},_i,ic;function Dh(){if(ic)return _i;ic=1;var e=1e3,n=e*60,r=n*60,t=r*24,g=t*7,l=t*365.25;_i=function(f,s){s=s||{};var u=typeof f;if(u==="string"&&f.length>0)return c(f);if(u==="number"&&isFinite(f))return s.long?h(f):o(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function c(f){if(f=String(f),!(f.length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(f);if(s){var u=parseFloat(s[1]),i=(s[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return u*l;case"weeks":case"week":case"w":return u*g;case"days":case"day":case"d":return u*t;case"hours":case"hour":case"hrs":case"hr":case"h":return u*r;case"minutes":case"minute":case"mins":case"min":case"m":return u*n;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}}}function o(f){var s=Math.abs(f);return s>=t?Math.round(f/t)+"d":s>=r?Math.round(f/r)+"h":s>=n?Math.round(f/n)+"m":s>=e?Math.round(f/e)+"s":f+"ms"}function h(f){var s=Math.abs(f);return s>=t?d(f,s,t,"day"):s>=r?d(f,s,r,"hour"):s>=n?d(f,s,n,"minute"):s>=e?d(f,s,e,"second"):f+" ms"}function d(f,s,u,i){var p=s>=u*1.5;return Math.round(f/u)+" "+i+(p?"s":"")}return _i}var vi,sc;function qh(){if(sc)return vi;sc=1;function e(n){t.debug=t,t.default=t,t.coerce=d,t.disable=o,t.enable=l,t.enabled=h,t.humanize=Dh(),t.destroy=f,Object.keys(n).forEach(s=>{t[s]=n[s]}),t.names=[],t.skips=[],t.formatters={};function r(s){let u=0;for(let i=0;i<s.length;i++)u=(u<<5)-u+s.charCodeAt(i),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=r;function t(s){let u,i=null,p,b;function m(...a){if(!m.enabled)return;const w=m,v=Number(new Date),R=v-(u||v);w.diff=R,w.prev=u,w.curr=v,u=v,a[0]=t.coerce(a[0]),typeof a[0]!="string"&&a.unshift("%O");let S=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(A,M)=>{if(A==="%%")return"%";S++;const D=t.formatters[M];if(typeof D=="function"){const V=a[S];A=D.call(w,V),a.splice(S,1),S--}return A}),t.formatArgs.call(w,a),(w.log||t.log).apply(w,a)}return m.namespace=s,m.useColors=t.useColors(),m.color=t.selectColor(s),m.extend=g,m.destroy=t.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>i!==null?i:(p!==t.namespaces&&(p=t.namespaces,b=t.enabled(s)),b),set:a=>{i=a}}),typeof t.init=="function"&&t.init(m),m}function g(s,u){const i=t(this.namespace+(typeof u>"u"?":":u)+s);return i.log=this.log,i}function l(s){t.save(s),t.namespaces=s,t.names=[],t.skips=[];const u=(typeof s=="string"?s:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const i of u)i[0]==="-"?t.skips.push(i.slice(1)):t.names.push(i)}function c(s,u){let i=0,p=0,b=-1,m=0;for(;i<s.length;)if(p<u.length&&(u[p]===s[i]||u[p]==="*"))u[p]==="*"?(b=p,m=i,p++):(i++,p++);else if(b!==-1)p=b+1,m++,i=m;else return!1;for(;p<u.length&&u[p]==="*";)p++;return p===u.length}function o(){const s=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),s}function h(s){for(const u of t.skips)if(c(s,u))return!1;for(const u of t.names)if(c(s,u))return!0;return!1}function d(s){return s instanceof Error?s.stack||s.message:s}function f(){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 t.enable(t.load()),t}return vi=e,vi}var oc;function jh(){return oc||(oc=1,(function(e,n){var r={};n.formatArgs=g,n.save=l,n.load=c,n.useColors=t,n.storage=o(),n.destroy=(()=>{let d=!1;return()=>{d||(d=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let d;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(d=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(d[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function g(d){if(d[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+d[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const f="color: "+this.color;d.splice(1,0,f,"color: inherit");let s=0,u=0;d[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(s++,i==="%c"&&(u=s))}),d.splice(u,0,f)}n.log=console.debug||console.log||(()=>{});function l(d){try{d?n.storage.setItem("debug",d):n.storage.removeItem("debug")}catch{}}function c(){let d;try{d=n.storage.getItem("debug")||n.storage.getItem("DEBUG")}catch{}return!d&&typeof de<"u"&&"env"in de&&(d=r.DEBUG),d}function o(){try{return localStorage}catch{}}e.exports=qh()(n);const{formatters:h}=e.exports;h.j=function(d){try{return JSON.stringify(d)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}}})(wr,wr.exports)),wr.exports}var ac;function $h(){if(ac)return $e;ac=1;var e=$e&&$e.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty($e,"__esModule",{value:!0}),$e.createModuleLogger=$e.createProjectLogger=void 0;const r=(0,e(jh()).default)("metamask");function t(l){return r.extend(l)}$e.createProjectLogger=t;function g(l,c){return l.extend(c)}return $e.createModuleLogger=g,$e}var Ei={},cc;function Uh(){return cc||(cc=1,(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 n(d){return Array.isArray(d)&&d.length>0}e.isNonEmptyArray=n;function r(d){return d==null}e.isNullOrUndefined=r;function t(d){return!!d&&typeof d=="object"&&!Array.isArray(d)}e.isObject=t;const g=(d,f)=>Object.hasOwnProperty.call(d,f);e.hasProperty=g,(function(d){d[d.Null=4]="Null",d[d.Comma=1]="Comma",d[d.Wrapper=1]="Wrapper",d[d.True=4]="True",d[d.False=5]="False",d[d.Quote=1]="Quote",d[d.Colon=1]="Colon",d[d.Date=24]="Date"})(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function l(d){if(typeof d!="object"||d===null)return!1;try{let f=d;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(d)===f}catch{return!1}}e.isPlainObject=l;function c(d){return d.charCodeAt(0)<=127}e.isASCII=c;function o(d){var f;return d.split("").reduce((u,i)=>c(i)?u+1:u+2,0)+((f=d.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&f!==void 0?f:[]).length}e.calculateStringSize=o;function h(d){return d.toString().length}e.calculateNumberSize=h})(Ei)),Ei}var Be={},uc;function Hh(){if(uc)return Be;uc=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.hexToBigInt=Be.hexToNumber=Be.bigIntToHex=Be.numberToHex=void 0;const e=Ve(),n=Mr(),r=c=>((0,e.assert)(typeof c=="number","Value must be a number."),(0,e.assert)(c>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(c),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,n.add0x)(c.toString(16)));Be.numberToHex=r;const t=c=>((0,e.assert)(typeof c=="bigint","Value must be a bigint."),(0,e.assert)(c>=0,"Value must be a non-negative bigint."),(0,n.add0x)(c.toString(16)));Be.bigIntToHex=t;const g=c=>{(0,n.assertIsHexString)(c);const o=parseInt(c,16);return(0,e.assert)(Number.isSafeInteger(o),"Value is not a safe integer. Use `hexToBigInt` instead."),o};Be.hexToNumber=g;const l=c=>((0,n.assertIsHexString)(c),BigInt((0,n.add0x)(c)));return Be.hexToBigInt=l,Be}var Ri={},lc;function Wh(){return lc||(lc=1,Object.defineProperty(Ri,"__esModule",{value:!0})),Ri}var Si={},dc;function Vh(){return dc||(dc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,(function(l){l[l.Millisecond=1]="Millisecond",l[l.Second=1e3]="Second",l[l.Minute=6e4]="Minute",l[l.Hour=36e5]="Hour",l[l.Day=864e5]="Day",l[l.Week=6048e5]="Week",l[l.Year=31536e6]="Year"})(e.Duration||(e.Duration={}));const n=l=>Number.isInteger(l)&&l>=0,r=(l,c)=>{if(!n(l))throw new Error(`"${c}" must be a non-negative integer. Received: "${l}".`)};function t(l,c){return r(l,"count"),l*c}e.inMilliseconds=t;function g(l){return r(l,"timestamp"),Date.now()-l}e.timeSince=g})(Si)),Si}var Ci={},hc;function zh(){return hc||(hc=1,Object.defineProperty(Ci,"__esModule",{value:!0})),Ci}var ki={},_r={exports:{}},Ii,fc;function Nr(){if(fc)return Ii;fc=1;const e="2.0.0",n=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,t=16,g=n-6;return Ii={MAX_LENGTH:n,MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:g,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ii}var Ai,pc;function Br(){if(pc)return Ai;pc=1;var e={};return Ai=typeof de=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{},Ai}var gc;function or(){return gc||(gc=1,(function(e,n){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:t,MAX_LENGTH:g}=Nr(),l=Br();n=e.exports={};const c=n.re=[],o=n.safeRe=[],h=n.src=[],d=n.safeSrc=[],f=n.t={};let s=0;const u="[a-zA-Z0-9-]",i=[["\\s",1],["\\d",g],[u,t]],p=m=>{for(const[a,w]of i)m=m.split(`${a}*`).join(`${a}{0,${w}}`).split(`${a}+`).join(`${a}{1,${w}}`);return m},b=(m,a,w)=>{const v=p(a),R=s++;l(m,R,a),f[m]=R,h[R]=a,d[R]=v,c[R]=new RegExp(a,w?"g":void 0),o[R]=new RegExp(v,w?"g":void 0)};b("NUMERICIDENTIFIER","0|[1-9]\\d*"),b("NUMERICIDENTIFIERLOOSE","\\d+"),b("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),b("MAINVERSION",`(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})`),b("MAINVERSIONLOOSE",`(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASEIDENTIFIER",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIER]})`),b("PRERELEASEIDENTIFIERLOOSE",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASE",`(?:-(${h[f.PRERELEASEIDENTIFIER]}(?:\\.${h[f.PRERELEASEIDENTIFIER]})*))`),b("PRERELEASELOOSE",`(?:-?(${h[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[f.PRERELEASEIDENTIFIERLOOSE]})*))`),b("BUILDIDENTIFIER",`${u}+`),b("BUILD",`(?:\\+(${h[f.BUILDIDENTIFIER]}(?:\\.${h[f.BUILDIDENTIFIER]})*))`),b("FULLPLAIN",`v?${h[f.MAINVERSION]}${h[f.PRERELEASE]}?${h[f.BUILD]}?`),b("FULL",`^${h[f.FULLPLAIN]}$`),b("LOOSEPLAIN",`[v=\\s]*${h[f.MAINVERSIONLOOSE]}${h[f.PRERELEASELOOSE]}?${h[f.BUILD]}?`),b("LOOSE",`^${h[f.LOOSEPLAIN]}$`),b("GTLT","((?:<|>)?=?)"),b("XRANGEIDENTIFIERLOOSE",`${h[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),b("XRANGEIDENTIFIER",`${h[f.NUMERICIDENTIFIER]}|x|X|\\*`),b("XRANGEPLAIN",`[v=\\s]*(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:${h[f.PRERELEASE]})?${h[f.BUILD]}?)?)?`),b("XRANGEPLAINLOOSE",`[v=\\s]*(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:${h[f.PRERELEASELOOSE]})?${h[f.BUILD]}?)?)?`),b("XRANGE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAIN]}$`),b("XRANGELOOSE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAINLOOSE]}$`),b("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),b("COERCE",`${h[f.COERCEPLAIN]}(?:$|[^\\d])`),b("COERCEFULL",h[f.COERCEPLAIN]+`(?:${h[f.PRERELEASE]})?(?:${h[f.BUILD]})?(?:$|[^\\d])`),b("COERCERTL",h[f.COERCE],!0),b("COERCERTLFULL",h[f.COERCEFULL],!0),b("LONETILDE","(?:~>?)"),b("TILDETRIM",`(\\s*)${h[f.LONETILDE]}\\s+`,!0),n.tildeTrimReplace="$1~",b("TILDE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAIN]}$`),b("TILDELOOSE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAINLOOSE]}$`),b("LONECARET","(?:\\^)"),b("CARETTRIM",`(\\s*)${h[f.LONECARET]}\\s+`,!0),n.caretTrimReplace="$1^",b("CARET",`^${h[f.LONECARET]}${h[f.XRANGEPLAIN]}$`),b("CARETLOOSE",`^${h[f.LONECARET]}${h[f.XRANGEPLAINLOOSE]}$`),b("COMPARATORLOOSE",`^${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]})$|^$`),b("COMPARATOR",`^${h[f.GTLT]}\\s*(${h[f.FULLPLAIN]})$|^$`),b("COMPARATORTRIM",`(\\s*)${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]}|${h[f.XRANGEPLAIN]})`,!0),n.comparatorTrimReplace="$1$2$3",b("HYPHENRANGE",`^\\s*(${h[f.XRANGEPLAIN]})\\s+-\\s+(${h[f.XRANGEPLAIN]})\\s*$`),b("HYPHENRANGELOOSE",`^\\s*(${h[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[f.XRANGEPLAINLOOSE]})\\s*$`),b("STAR","(<|>)?=?\\s*\\*"),b("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),b("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(_r,_r.exports)),_r.exports}var xi,mc;function Gs(){if(mc)return xi;mc=1;const e=Object.freeze({loose:!0}),n=Object.freeze({});return xi=t=>t?typeof t!="object"?e:t:n,xi}var Ti,bc;function Rl(){if(bc)return Ti;bc=1;const e=/^[0-9]+$/,n=(t,g)=>{const l=e.test(t),c=e.test(g);return l&&c&&(t=+t,g=+g),t===g?0:l&&!c?-1:c&&!l?1:t<g?-1:1};return Ti={compareIdentifiers:n,rcompareIdentifiers:(t,g)=>n(g,t)},Ti}var Li,yc;function Ee(){if(yc)return Li;yc=1;const e=Br(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:r}=Nr(),{safeRe:t,t:g}=or(),l=Gs(),{compareIdentifiers:c}=Rl();class o{constructor(d,f){if(f=l(f),d instanceof o){if(d.loose===!!f.loose&&d.includePrerelease===!!f.includePrerelease)return d;d=d.version}else if(typeof d!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof d}".`);if(d.length>n)throw new TypeError(`version is longer than ${n} characters`);e("SemVer",d,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const s=d.trim().match(f.loose?t[g.LOOSE]:t[g.FULL]);if(!s)throw new TypeError(`Invalid Version: ${d}`);if(this.raw=d,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(u=>{if(/^[0-9]+$/.test(u)){const i=+u;if(i>=0&&i<r)return i}return u}):this.prerelease=[],this.build=s[5]?s[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(d){if(e("SemVer.compare",this.version,this.options,d),!(d instanceof o)){if(typeof d=="string"&&d===this.version)return 0;d=new o(d,this.options)}return d.version===this.version?0:this.compareMain(d)||this.comparePre(d)}compareMain(d){return d instanceof o||(d=new o(d,this.options)),c(this.major,d.major)||c(this.minor,d.minor)||c(this.patch,d.patch)}comparePre(d){if(d instanceof o||(d=new o(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;let f=0;do{const s=this.prerelease[f],u=d.prerelease[f];if(e("prerelease compare",f,s,u),s===void 0&&u===void 0)return 0;if(u===void 0)return 1;if(s===void 0)return-1;if(s===u)continue;return c(s,u)}while(++f)}compareBuild(d){d instanceof o||(d=new o(d,this.options));let f=0;do{const s=this.build[f],u=d.build[f];if(e("build compare",f,s,u),s===void 0&&u===void 0)return 0;if(u===void 0)return 1;if(s===void 0)return-1;if(s===u)continue;return c(s,u)}while(++f)}inc(d,f,s){if(d.startsWith("pre")){if(!f&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const u=`-${f}`.match(this.options.loose?t[g.PRERELEASELOOSE]:t[g.PRERELEASE]);if(!u||u[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,s),this.inc("pre",f,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,s),this.inc("pre",f,s);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;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 u=Number(s)?1:0;if(this.prerelease.length===0)this.prerelease=[u];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(f===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(u)}}if(f){let i=[f,u];s===!1&&(i=[f]),c(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${d}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Li=o,Li}var Mi,wc;function wt(){if(wc)return Mi;wc=1;const e=Ee();return Mi=(r,t,g=!1)=>{if(r instanceof e)return r;try{return new e(r,t)}catch(l){if(!g)return null;throw l}},Mi}var Ni,_c;function Jh(){if(_c)return Ni;_c=1;const e=wt();return Ni=(r,t)=>{const g=e(r,t);return g?g.version:null},Ni}var Bi,vc;function Gh(){if(vc)return Bi;vc=1;const e=wt();return Bi=(r,t)=>{const g=e(r.trim().replace(/^[=v]+/,""),t);return g?g.version:null},Bi}var Pi,Ec;function Zh(){if(Ec)return Pi;Ec=1;const e=Ee();return Pi=(r,t,g,l,c)=>{typeof g=="string"&&(c=l,l=g,g=void 0);try{return new e(r instanceof e?r.version:r,g).inc(t,l,c).version}catch{return null}},Pi}var Oi,Rc;function Kh(){if(Rc)return Oi;Rc=1;const e=wt();return Oi=(r,t)=>{const g=e(r,null,!0),l=e(t,null,!0),c=g.compare(l);if(c===0)return null;const o=c>0,h=o?g:l,d=o?l:g,f=!!h.prerelease.length;if(!!d.prerelease.length&&!f){if(!d.patch&&!d.minor)return"major";if(d.compareMain(h)===0)return d.minor&&!d.patch?"minor":"patch"}const u=f?"pre":"";return g.major!==l.major?u+"major":g.minor!==l.minor?u+"minor":g.patch!==l.patch?u+"patch":"prerelease"},Oi}var Fi,Sc;function Qh(){if(Sc)return Fi;Sc=1;const e=Ee();return Fi=(r,t)=>new e(r,t).major,Fi}var Di,Cc;function Yh(){if(Cc)return Di;Cc=1;const e=Ee();return Di=(r,t)=>new e(r,t).minor,Di}var qi,kc;function Xh(){if(kc)return qi;kc=1;const e=Ee();return qi=(r,t)=>new e(r,t).patch,qi}var ji,Ic;function ef(){if(Ic)return ji;Ic=1;const e=wt();return ji=(r,t)=>{const g=e(r,t);return g&&g.prerelease.length?g.prerelease:null},ji}var $i,Ac;function Oe(){if(Ac)return $i;Ac=1;const e=Ee();return $i=(r,t,g)=>new e(r,g).compare(new e(t,g)),$i}var Ui,xc;function tf(){if(xc)return Ui;xc=1;const e=Oe();return Ui=(r,t,g)=>e(t,r,g),Ui}var Hi,Tc;function rf(){if(Tc)return Hi;Tc=1;const e=Oe();return Hi=(r,t)=>e(r,t,!0),Hi}var Wi,Lc;function Zs(){if(Lc)return Wi;Lc=1;const e=Ee();return Wi=(r,t,g)=>{const l=new e(r,g),c=new e(t,g);return l.compare(c)||l.compareBuild(c)},Wi}var Vi,Mc;function nf(){if(Mc)return Vi;Mc=1;const e=Zs();return Vi=(r,t)=>r.sort((g,l)=>e(g,l,t)),Vi}var zi,Nc;function sf(){if(Nc)return zi;Nc=1;const e=Zs();return zi=(r,t)=>r.sort((g,l)=>e(l,g,t)),zi}var Ji,Bc;function Pr(){if(Bc)return Ji;Bc=1;const e=Oe();return Ji=(r,t,g)=>e(r,t,g)>0,Ji}var Gi,Pc;function Ks(){if(Pc)return Gi;Pc=1;const e=Oe();return Gi=(r,t,g)=>e(r,t,g)<0,Gi}var Zi,Oc;function Sl(){if(Oc)return Zi;Oc=1;const e=Oe();return Zi=(r,t,g)=>e(r,t,g)===0,Zi}var Ki,Fc;function Cl(){if(Fc)return Ki;Fc=1;const e=Oe();return Ki=(r,t,g)=>e(r,t,g)!==0,Ki}var Qi,Dc;function Qs(){if(Dc)return Qi;Dc=1;const e=Oe();return Qi=(r,t,g)=>e(r,t,g)>=0,Qi}var Yi,qc;function Ys(){if(qc)return Yi;qc=1;const e=Oe();return Yi=(r,t,g)=>e(r,t,g)<=0,Yi}var Xi,jc;function kl(){if(jc)return Xi;jc=1;const e=Sl(),n=Cl(),r=Pr(),t=Qs(),g=Ks(),l=Ys();return Xi=(o,h,d,f)=>{switch(h){case"===":return typeof o=="object"&&(o=o.version),typeof d=="object"&&(d=d.version),o===d;case"!==":return typeof o=="object"&&(o=o.version),typeof d=="object"&&(d=d.version),o!==d;case"":case"=":case"==":return e(o,d,f);case"!=":return n(o,d,f);case">":return r(o,d,f);case">=":return t(o,d,f);case"<":return g(o,d,f);case"<=":return l(o,d,f);default:throw new TypeError(`Invalid operator: ${h}`)}},Xi}var es,$c;function of(){if($c)return es;$c=1;const e=Ee(),n=wt(),{safeRe:r,t}=or();return es=(l,c)=>{if(l instanceof e)return l;if(typeof l=="number"&&(l=String(l)),typeof l!="string")return null;c=c||{};let o=null;if(!c.rtl)o=l.match(c.includePrerelease?r[t.COERCEFULL]:r[t.COERCE]);else{const i=c.includePrerelease?r[t.COERCERTLFULL]:r[t.COERCERTL];let p;for(;(p=i.exec(l))&&(!o||o.index+o[0].length!==l.length);)(!o||p.index+p[0].length!==o.index+o[0].length)&&(o=p),i.lastIndex=p.index+p[1].length+p[2].length;i.lastIndex=-1}if(o===null)return null;const h=o[2],d=o[3]||"0",f=o[4]||"0",s=c.includePrerelease&&o[5]?`-${o[5]}`:"",u=c.includePrerelease&&o[6]?`+${o[6]}`:"";return n(`${h}.${d}.${f}${s}${u}`,c)},es}var ts,Uc;function af(){if(Uc)return ts;Uc=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const t=this.map.get(r);if(t!==void 0)return this.map.delete(r),this.map.set(r,t),t}delete(r){return this.map.delete(r)}set(r,t){if(!this.delete(r)&&t!==void 0){if(this.map.size>=this.max){const l=this.map.keys().next().value;this.delete(l)}this.map.set(r,t)}return this}}return ts=e,ts}var rs,Hc;function Fe(){if(Hc)return rs;Hc=1;const e=/\s+/g;class n{constructor(F,T){if(T=g(T),F instanceof n)return F.loose===!!T.loose&&F.includePrerelease===!!T.includePrerelease?F:new n(F.raw,T);if(F instanceof l)return this.raw=F.value,this.set=[[F]],this.formatted=void 0,this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=F.trim().replace(e," "),this.set=this.raw.split("||").map(O=>this.parseRange(O.trim())).filter(O=>O.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const O=this.set[0];if(this.set=this.set.filter(W=>!b(W[0])),this.set.length===0)this.set=[O];else if(this.set.length>1){for(const W of this.set)if(W.length===1&&m(W[0])){this.set=[W];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let F=0;F<this.set.length;F++){F>0&&(this.formatted+="||");const T=this.set[F];for(let O=0;O<T.length;O++)O>0&&(this.formatted+=" "),this.formatted+=T[O].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(F){const O=((this.options.includePrerelease&&i)|(this.options.loose&&p))+":"+F,W=t.get(O);if(W)return W;const U=this.options.loose,G=U?h[d.HYPHENRANGELOOSE]:h[d.HYPHENRANGE];F=F.replace(G,Y(this.options.includePrerelease)),c("hyphen replace",F),F=F.replace(h[d.COMPARATORTRIM],f),c("comparator trim",F),F=F.replace(h[d.TILDETRIM],s),c("tilde trim",F),F=F.replace(h[d.CARETTRIM],u),c("caret trim",F);let Q=F.split(" ").map(te=>w(te,this.options)).join(" ").split(/\s+/).map(te=>Z(te,this.options));U&&(Q=Q.filter(te=>(c("loose invalid filter",te,this.options),!!te.match(h[d.COMPARATORLOOSE])))),c("range list",Q);const J=new Map,ee=Q.map(te=>new l(te,this.options));for(const te of ee){if(b(te))return[te];J.set(te.value,te)}J.size>1&&J.has("")&&J.delete("");const ae=[...J.values()];return t.set(O,ae),ae}intersects(F,T){if(!(F instanceof n))throw new TypeError("a Range is required");return this.set.some(O=>a(O,T)&&F.set.some(W=>a(W,T)&&O.every(U=>W.every(G=>U.intersects(G,T)))))}test(F){if(!F)return!1;if(typeof F=="string")try{F=new o(F,this.options)}catch{return!1}for(let T=0;T<this.set.length;T++)if(ne(this.set[T],F,this.options))return!0;return!1}}rs=n;const r=af(),t=new r,g=Gs(),l=Or(),c=Br(),o=Ee(),{safeRe:h,t:d,comparatorTrimReplace:f,tildeTrimReplace:s,caretTrimReplace:u}=or(),{FLAG_INCLUDE_PRERELEASE:i,FLAG_LOOSE:p}=Nr(),b=H=>H.value==="<0.0.0-0",m=H=>H.value==="",a=(H,F)=>{let T=!0;const O=H.slice();let W=O.pop();for(;T&&O.length;)T=O.every(U=>W.intersects(U,F)),W=O.pop();return T},w=(H,F)=>(c("comp",H,F),H=x(H,F),c("caret",H),H=R(H,F),c("tildes",H),H=M(H,F),c("xrange",H),H=V(H,F),c("stars",H),H),v=H=>!H||H.toLowerCase()==="x"||H==="*",R=(H,F)=>H.trim().split(/\s+/).map(T=>S(T,F)).join(" "),S=(H,F)=>{const T=F.loose?h[d.TILDELOOSE]:h[d.TILDE];return H.replace(T,(O,W,U,G,Q)=>{c("tilde",H,O,W,U,G,Q);let J;return v(W)?J="":v(U)?J=`>=${W}.0.0 <${+W+1}.0.0-0`:v(G)?J=`>=${W}.${U}.0 <${W}.${+U+1}.0-0`:Q?(c("replaceTilde pr",Q),J=`>=${W}.${U}.${G}-${Q} <${W}.${+U+1}.0-0`):J=`>=${W}.${U}.${G} <${W}.${+U+1}.0-0`,c("tilde return",J),J})},x=(H,F)=>H.trim().split(/\s+/).map(T=>A(T,F)).join(" "),A=(H,F)=>{c("caret",H,F);const T=F.loose?h[d.CARETLOOSE]:h[d.CARET],O=F.includePrerelease?"-0":"";return H.replace(T,(W,U,G,Q,J)=>{c("caret",H,W,U,G,Q,J);let ee;return v(U)?ee="":v(G)?ee=`>=${U}.0.0${O} <${+U+1}.0.0-0`:v(Q)?U==="0"?ee=`>=${U}.${G}.0${O} <${U}.${+G+1}.0-0`:ee=`>=${U}.${G}.0${O} <${+U+1}.0.0-0`:J?(c("replaceCaret pr",J),U==="0"?G==="0"?ee=`>=${U}.${G}.${Q}-${J} <${U}.${G}.${+Q+1}-0`:ee=`>=${U}.${G}.${Q}-${J} <${U}.${+G+1}.0-0`:ee=`>=${U}.${G}.${Q}-${J} <${+U+1}.0.0-0`):(c("no pr"),U==="0"?G==="0"?ee=`>=${U}.${G}.${Q}${O} <${U}.${G}.${+Q+1}-0`:ee=`>=${U}.${G}.${Q}${O} <${U}.${+G+1}.0-0`:ee=`>=${U}.${G}.${Q} <${+U+1}.0.0-0`),c("caret return",ee),ee})},M=(H,F)=>(c("replaceXRanges",H,F),H.split(/\s+/).map(T=>D(T,F)).join(" ")),D=(H,F)=>{H=H.trim();const T=F.loose?h[d.XRANGELOOSE]:h[d.XRANGE];return H.replace(T,(O,W,U,G,Q,J)=>{c("xRange",H,O,W,U,G,Q,J);const ee=v(U),ae=ee||v(G),te=ae||v(Q),B=te;return W==="="&&B&&(W=""),J=F.includePrerelease?"-0":"",ee?W===">"||W==="<"?O="<0.0.0-0":O="*":W&&B?(ae&&(G=0),Q=0,W===">"?(W=">=",ae?(U=+U+1,G=0,Q=0):(G=+G+1,Q=0)):W==="<="&&(W="<",ae?U=+U+1:G=+G+1),W==="<"&&(J="-0"),O=`${W+U}.${G}.${Q}${J}`):ae?O=`>=${U}.0.0${J} <${+U+1}.0.0-0`:te&&(O=`>=${U}.${G}.0${J} <${U}.${+G+1}.0-0`),c("xRange return",O),O})},V=(H,F)=>(c("replaceStars",H,F),H.trim().replace(h[d.STAR],"")),Z=(H,F)=>(c("replaceGTE0",H,F),H.trim().replace(h[F.includePrerelease?d.GTE0PRE:d.GTE0],"")),Y=H=>(F,T,O,W,U,G,Q,J,ee,ae,te,B)=>(v(O)?T="":v(W)?T=`>=${O}.0.0${H?"-0":""}`:v(U)?T=`>=${O}.${W}.0${H?"-0":""}`:G?T=`>=${T}`:T=`>=${T}${H?"-0":""}`,v(ee)?J="":v(ae)?J=`<${+ee+1}.0.0-0`:v(te)?J=`<${ee}.${+ae+1}.0-0`:B?J=`<=${ee}.${ae}.${te}-${B}`:H?J=`<${ee}.${ae}.${+te+1}-0`:J=`<=${J}`,`${T} ${J}`.trim()),ne=(H,F,T)=>{for(let O=0;O<H.length;O++)if(!H[O].test(F))return!1;if(F.prerelease.length&&!T.includePrerelease){for(let O=0;O<H.length;O++)if(c(H[O].semver),H[O].semver!==l.ANY&&H[O].semver.prerelease.length>0){const W=H[O].semver;if(W.major===F.major&&W.minor===F.minor&&W.patch===F.patch)return!0}return!1}return!0};return rs}var ns,Wc;function Or(){if(Wc)return ns;Wc=1;const e=Symbol("SemVer ANY");class n{static get ANY(){return e}constructor(f,s){if(s=r(s),f instanceof n){if(f.loose===!!s.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),c("comparator",f,s),this.options=s,this.loose=!!s.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(f){const s=this.options.loose?t[g.COMPARATORLOOSE]:t[g.COMPARATOR],u=f.match(s);if(!u)throw new TypeError(`Invalid comparator: ${f}`);this.operator=u[1]!==void 0?u[1]:"",this.operator==="="&&(this.operator=""),u[2]?this.semver=new o(u[2],this.options.loose):this.semver=e}toString(){return this.value}test(f){if(c("Comparator.test",f,this.options.loose),this.semver===e||f===e)return!0;if(typeof f=="string")try{f=new o(f,this.options)}catch{return!1}return l(f,this.operator,this.semver,this.options)}intersects(f,s){if(!(f instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(f.value,s).test(this.value):f.operator===""?f.value===""?!0:new h(this.value,s).test(f.semver):(s=r(s),s.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!s.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||l(this.semver,"<",f.semver,s)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||l(this.semver,">",f.semver,s)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}ns=n;const r=Gs(),{safeRe:t,t:g}=or(),l=kl(),c=Br(),o=Ee(),h=Fe();return ns}var is,Vc;function Fr(){if(Vc)return is;Vc=1;const e=Fe();return is=(r,t,g)=>{try{t=new e(t,g)}catch{return!1}return t.test(r)},is}var ss,zc;function cf(){if(zc)return ss;zc=1;const e=Fe();return ss=(r,t)=>new e(r,t).set.map(g=>g.map(l=>l.value).join(" ").trim().split(" ")),ss}var os,Jc;function uf(){if(Jc)return os;Jc=1;const e=Ee(),n=Fe();return os=(t,g,l)=>{let c=null,o=null,h=null;try{h=new n(g,l)}catch{return null}return t.forEach(d=>{h.test(d)&&(!c||o.compare(d)===-1)&&(c=d,o=new e(c,l))}),c},os}var as,Gc;function lf(){if(Gc)return as;Gc=1;const e=Ee(),n=Fe();return as=(t,g,l)=>{let c=null,o=null,h=null;try{h=new n(g,l)}catch{return null}return t.forEach(d=>{h.test(d)&&(!c||o.compare(d)===1)&&(c=d,o=new e(c,l))}),c},as}var cs,Zc;function df(){if(Zc)return cs;Zc=1;const e=Ee(),n=Fe(),r=Pr();return cs=(g,l)=>{g=new n(g,l);let c=new e("0.0.0");if(g.test(c)||(c=new e("0.0.0-0"),g.test(c)))return c;c=null;for(let o=0;o<g.set.length;++o){const h=g.set[o];let d=null;h.forEach(f=>{const s=new e(f.semver.version);switch(f.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!d||r(s,d))&&(d=s);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${f.operator}`)}}),d&&(!c||r(c,d))&&(c=d)}return c&&g.test(c)?c:null},cs}var us,Kc;function hf(){if(Kc)return us;Kc=1;const e=Fe();return us=(r,t)=>{try{return new e(r,t).range||"*"}catch{return null}},us}var ls,Qc;function Xs(){if(Qc)return ls;Qc=1;const e=Ee(),n=Or(),{ANY:r}=n,t=Fe(),g=Fr(),l=Pr(),c=Ks(),o=Ys(),h=Qs();return ls=(f,s,u,i)=>{f=new e(f,i),s=new t(s,i);let p,b,m,a,w;switch(u){case">":p=l,b=o,m=c,a=">",w=">=";break;case"<":p=c,b=h,m=l,a="<",w="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(g(f,s,i))return!1;for(let v=0;v<s.set.length;++v){const R=s.set[v];let S=null,x=null;if(R.forEach(A=>{A.semver===r&&(A=new n(">=0.0.0")),S=S||A,x=x||A,p(A.semver,S.semver,i)?S=A:m(A.semver,x.semver,i)&&(x=A)}),S.operator===a||S.operator===w||(!x.operator||x.operator===a)&&b(f,x.semver))return!1;if(x.operator===w&&m(f,x.semver))return!1}return!0},ls}var ds,Yc;function ff(){if(Yc)return ds;Yc=1;const e=Xs();return ds=(r,t,g)=>e(r,t,">",g),ds}var hs,Xc;function pf(){if(Xc)return hs;Xc=1;const e=Xs();return hs=(r,t,g)=>e(r,t,"<",g),hs}var fs,eu;function gf(){if(eu)return fs;eu=1;const e=Fe();return fs=(r,t,g)=>(r=new e(r,g),t=new e(t,g),r.intersects(t,g)),fs}var ps,tu;function mf(){if(tu)return ps;tu=1;const e=Fr(),n=Oe();return ps=(r,t,g)=>{const l=[];let c=null,o=null;const h=r.sort((u,i)=>n(u,i,g));for(const u of h)e(u,t,g)?(o=u,c||(c=u)):(o&&l.push([c,o]),o=null,c=null);c&&l.push([c,null]);const d=[];for(const[u,i]of l)u===i?d.push(u):!i&&u===h[0]?d.push("*"):i?u===h[0]?d.push(`<=${i}`):d.push(`${u} - ${i}`):d.push(`>=${u}`);const f=d.join(" || "),s=typeof t.raw=="string"?t.raw:String(t);return f.length<s.length?f:t},ps}var gs,ru;function bf(){if(ru)return gs;ru=1;const e=Fe(),n=Or(),{ANY:r}=n,t=Fr(),g=Oe(),l=(s,u,i={})=>{if(s===u)return!0;s=new e(s,i),u=new e(u,i);let p=!1;e:for(const b of s.set){for(const m of u.set){const a=h(b,m,i);if(p=p||a!==null,a)continue e}if(p)return!1}return!0},c=[new n(">=0.0.0-0")],o=[new n(">=0.0.0")],h=(s,u,i)=>{if(s===u)return!0;if(s.length===1&&s[0].semver===r){if(u.length===1&&u[0].semver===r)return!0;i.includePrerelease?s=c:s=o}if(u.length===1&&u[0].semver===r){if(i.includePrerelease)return!0;u=o}const p=new Set;let b,m;for(const M of s)M.operator===">"||M.operator===">="?b=d(b,M,i):M.operator==="<"||M.operator==="<="?m=f(m,M,i):p.add(M.semver);if(p.size>1)return null;let a;if(b&&m){if(a=g(b.semver,m.semver,i),a>0)return null;if(a===0&&(b.operator!==">="||m.operator!=="<="))return null}for(const M of p){if(b&&!t(M,String(b),i)||m&&!t(M,String(m),i))return null;for(const D of u)if(!t(M,String(D),i))return!1;return!0}let w,v,R,S,x=m&&!i.includePrerelease&&m.semver.prerelease.length?m.semver:!1,A=b&&!i.includePrerelease&&b.semver.prerelease.length?b.semver:!1;x&&x.prerelease.length===1&&m.operator==="<"&&x.prerelease[0]===0&&(x=!1);for(const M of u){if(S=S||M.operator===">"||M.operator===">=",R=R||M.operator==="<"||M.operator==="<=",b){if(A&&M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===A.major&&M.semver.minor===A.minor&&M.semver.patch===A.patch&&(A=!1),M.operator===">"||M.operator===">="){if(w=d(b,M,i),w===M&&w!==b)return!1}else if(b.operator===">="&&!t(b.semver,String(M),i))return!1}if(m){if(x&&M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===x.major&&M.semver.minor===x.minor&&M.semver.patch===x.patch&&(x=!1),M.operator==="<"||M.operator==="<="){if(v=f(m,M,i),v===M&&v!==m)return!1}else if(m.operator==="<="&&!t(m.semver,String(M),i))return!1}if(!M.operator&&(m||b)&&a!==0)return!1}return!(b&&R&&!m&&a!==0||m&&S&&!b&&a!==0||A||x)},d=(s,u,i)=>{if(!s)return u;const p=g(s.semver,u.semver,i);return p>0?s:p<0||u.operator===">"&&s.operator===">="?u:s},f=(s,u,i)=>{if(!s)return u;const p=g(s.semver,u.semver,i);return p<0?s:p>0||u.operator==="<"&&s.operator==="<="?u:s};return gs=l,gs}var ms,nu;function yf(){if(nu)return ms;nu=1;const e=or(),n=Nr(),r=Ee(),t=Rl(),g=wt(),l=Jh(),c=Gh(),o=Zh(),h=Kh(),d=Qh(),f=Yh(),s=Xh(),u=ef(),i=Oe(),p=tf(),b=rf(),m=Zs(),a=nf(),w=sf(),v=Pr(),R=Ks(),S=Sl(),x=Cl(),A=Qs(),M=Ys(),D=kl(),V=of(),Z=Or(),Y=Fe(),ne=Fr(),H=cf(),F=uf(),T=lf(),O=df(),W=hf(),U=Xs(),G=ff(),Q=pf(),J=gf(),ee=mf(),ae=bf();return ms={parse:g,valid:l,clean:c,inc:o,diff:h,major:d,minor:f,patch:s,prerelease:u,compare:i,rcompare:p,compareLoose:b,compareBuild:m,sort:a,rsort:w,gt:v,lt:R,eq:S,neq:x,gte:A,lte:M,cmp:D,coerce:V,Comparator:Z,Range:Y,satisfies:ne,toComparators:H,maxSatisfying:F,minSatisfying:T,minVersion:O,validRange:W,outside:U,gtr:G,ltr:Q,intersects:J,simplifyRange:ee,subset:ae,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:t.compareIdentifiers,rcompareIdentifiers:t.rcompareIdentifiers},ms}var iu;function wf(){return iu||(iu=1,(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 n=yf(),r=pt,t=Ve();e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",s=>(0,n.valid)(s)===null?`Expected SemVer version, got "${s}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",s=>(0,n.validRange)(s)===null?`Expected SemVer range, got "${s}"`:!0);function g(s){return(0,r.is)(s,e.VersionStruct)}e.isValidSemVerVersion=g;function l(s){return(0,r.is)(s,e.VersionRangeStruct)}e.isValidSemVerRange=l;function c(s){(0,t.assertStruct)(s,e.VersionStruct)}e.assertIsSemVerVersion=c;function o(s){(0,t.assertStruct)(s,e.VersionRangeStruct)}e.assertIsSemVerRange=o;function h(s,u){return(0,n.gt)(s,u)}e.gtVersion=h;function d(s,u){return(0,n.gtr)(s,u)}e.gtRange=d;function f(s,u){return(0,n.satisfies)(s,u,{includePrerelease:!0})}e.satisfiesVersionRange=f})(ki)),ki}var su;function _f(){return su||(su=1,(function(e){var n=ot&&ot.__createBinding||(Object.create?(function(t,g,l,c){c===void 0&&(c=l);var o=Object.getOwnPropertyDescriptor(g,l);(!o||("get"in o?!g.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return g[l]}}),Object.defineProperty(t,c,o)}):(function(t,g,l,c){c===void 0&&(c=l),t[c]=g[l]})),r=ot&&ot.__exportStar||function(t,g){for(var l in t)l!=="default"&&!Object.prototype.hasOwnProperty.call(g,l)&&n(g,t,l)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ve(),e),r(vl(),e),r(El(),e),r(Mh(),e),r(Nh(),e),r(Bh(),e),r(Ph(),e),r(Mr(),e),r(Oh(),e),r(Fh(),e),r($h(),e),r(Uh(),e),r(Hh(),e),r(Wh(),e),r(Vh(),e),r(zh(),e),r(wf(),e)})(ot)),ot}var ou;function vf(){return ou||(ou=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const n=_f();Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return n.createModuleLogger}}),e.projectLogger=(0,n.createProjectLogger)("eth-block-tracker")})(gi)),gi}var au;function Ef(){if(au)return it;au=1;var e=it&&it.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(it,"__esModule",{value:!0}),it.PollingBlockTracker=void 0;const n=e(Us()),r=e(zd()),t=hl(),g=vf(),l=(0,g.createModuleLogger)(g.projectLogger,"polling-block-tracker"),c=(0,n.default)(),o=1e3;let h=class extends t.BaseBlockTracker{constructor(s={}){var u;if(!s.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},s),{blockResetDuration:(u=s.blockResetDuration)!==null&&u!==void 0?u:s.pollingInterval})),this._provider=s.provider,this._pollingInterval=s.pollingInterval||20*o,this._retryTimeout=s.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=s.keepEventLoopActive===void 0?!0:s.keepEventLoopActive,this._setSkipCacheFlag=s.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var s;this._isRunning;)try{await this._updateLatestBlock();const u=d(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await u}catch(u){const i=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
3
3
  ${(s=u.stack)!==null&&s!==void 0?s:u}`);try{this.emit("error",i)}catch{console.error(i)}const p=d(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await p}}async _updateLatestBlock(){const s=await this._fetchLatestBlock();this._newPotentialLatest(s)}async _fetchLatestBlock(){const s={jsonrpc:"2.0",id:c(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(s.skipCache=!0),l("Making request",s);const u=await(0,r.default)(i=>this._provider.sendAsync(s,i))();if(l("Got response",u),u.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
4
4
  ${u.error.message}`);return u.result}};it.PollingBlockTracker=h;function d(f,s){return new Promise(u=>{const i=setTimeout(u,f);i.unref&&s&&i.unref()})}return it}var at={},cu;function Rf(){if(cu)return at;cu=1;var e=at&&at.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(at,"__esModule",{value:!0}),at.SubscribeBlockTracker=void 0;const n=e(Us()),r=hl(),t=(0,n.default)();let g=class extends r.BaseBlockTracker{constructor(c={}){if(!c.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(c),this._provider=c.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const c=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(c)}catch(c){this.emit("error",c)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(c){this.emit("error",c)}}_call(c,...o){return new Promise((h,d)=>{this._provider.sendAsync({id:t(),method:c,params:o,jsonrpc:"2.0"},(f,s)=>{f?d(f):h(s.result)})})}_handleSubData(c,o){var h;o.method==="eth_subscription"&&((h=o.params)===null||h===void 0?void 0:h.subscription)===this._subscriptionId&&this._newPotentialLatest(o.params.result.number)}};return at.SubscribeBlockTracker=g,at}var uu;function Sf(){return uu||(uu=1,(function(e){var n=nt&&nt.__createBinding||(Object.create?(function(t,g,l,c){c===void 0&&(c=l),Object.defineProperty(t,c,{enumerable:!0,get:function(){return g[l]}})}):(function(t,g,l,c){c===void 0&&(c=l),t[c]=g[l]})),r=nt&&nt.__exportStar||function(t,g){for(var l in t)l!=="default"&&!Object.prototype.hasOwnProperty.call(g,l)&&n(g,t,l)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ef(),e),r(Rf(),e)})(nt)),nt}var ct={},Zt={},Kt={},lu;function Il(){if(lu)return Kt;lu=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.getUniqueId=void 0;const e=4294967295;let n=Math.floor(Math.random()*e);function r(){return n=(n+1)%e,n}return Kt.getUniqueId=r,Kt}var du;function Cf(){if(du)return Zt;du=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.createIdRemapMiddleware=void 0;const e=Il();function n(){return(r,t,g,l)=>{const c=r.id,o=e.getUniqueId();r.id=o,t.id=o,g(h=>{r.id=c,t.id=c,h()})}}return Zt.createIdRemapMiddleware=n,Zt}var Qt={},hu;function kf(){if(hu)return Qt;hu=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.createAsyncMiddleware=void 0;function e(n){return async(r,t,g,l)=>{let c;const o=new Promise(s=>{c=s});let h=null,d=!1;const f=async()=>{d=!0,g(s=>{h=s,c()}),await o};try{await n(r,t,f),d?(await o,h(null)):l(null)}catch(s){h?h(s):l(s)}}}return Qt.createAsyncMiddleware=e,Qt}var Yt={},fu;function If(){if(fu)return Yt;fu=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.createScaffoldMiddleware=void 0;function e(n){return(r,t,g,l)=>{const c=n[r.method];return c===void 0?g():typeof c=="function"?c(r,t,g,l):(t.result=c,l())}}return Yt.createScaffoldMiddleware=e,Yt}var ut={},vr={},pu;function Af(){if(pu)return vr;pu=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=kr();function n(g,l,c){try{Reflect.apply(g,l,c)}catch(o){setTimeout(()=>{throw o})}}function r(g){const l=g.length,c=new Array(l);for(let o=0;o<l;o+=1)c[o]=g[o];return c}class t extends e.EventEmitter{emit(l,...c){let o=l==="error";const h=this._events;if(h!==void 0)o=o&&h.error===void 0;else if(!o)return!1;if(o){let f;if(c.length>0&&([f]=c),f instanceof Error)throw f;const s=new Error(`Unhandled error.${f?` (${f.message})`:""}`);throw s.context=f,s}const d=h[l];if(d===void 0)return!1;if(typeof d=="function")n(d,this,c);else{const f=d.length,s=r(d);for(let u=0;u<f;u+=1)n(s[u],this,c)}return!0}}return vr.default=t,vr}var bs={},lt={},ys,gu;function xf(){if(gu)return ys;gu=1,ys=l,l.default=l,l.stable=d,l.stableStringify=d;var e="[...]",n="[Circular]",r=[],t=[];function g(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function l(u,i,p,b){typeof b>"u"&&(b=g()),o(u,"",0,[],void 0,0,b);var m;try{t.length===0?m=JSON.stringify(u,i,p):m=JSON.stringify(u,s(i),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;r.length!==0;){var a=r.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return m}function c(u,i,p,b){var m=Object.getOwnPropertyDescriptor(b,p);m.get!==void 0?m.configurable?(Object.defineProperty(b,p,{value:u}),r.push([b,p,i,m])):t.push([i,p,u]):(b[p]=u,r.push([b,p,i]))}function o(u,i,p,b,m,a,w){a+=1;var v;if(typeof u=="object"&&u!==null){for(v=0;v<b.length;v++)if(b[v]===u){c(n,u,i,m);return}if(typeof w.depthLimit<"u"&&a>w.depthLimit){c(e,u,i,m);return}if(typeof w.edgesLimit<"u"&&p+1>w.edgesLimit){c(e,u,i,m);return}if(b.push(u),Array.isArray(u))for(v=0;v<u.length;v++)o(u[v],v,v,b,u,a,w);else{var R=Object.keys(u);for(v=0;v<R.length;v++){var S=R[v];o(u[S],S,v,b,u,a,w)}}b.pop()}}function h(u,i){return u<i?-1:u>i?1:0}function d(u,i,p,b){typeof b>"u"&&(b=g());var m=f(u,"",0,[],void 0,0,b)||u,a;try{t.length===0?a=JSON.stringify(m,i,p):a=JSON.stringify(m,s(i),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;r.length!==0;){var w=r.pop();w.length===4?Object.defineProperty(w[0],w[1],w[3]):w[0][w[1]]=w[2]}}return a}function f(u,i,p,b,m,a,w){a+=1;var v;if(typeof u=="object"&&u!==null){for(v=0;v<b.length;v++)if(b[v]===u){c(n,u,i,m);return}try{if(typeof u.toJSON=="function")return}catch{return}if(typeof w.depthLimit<"u"&&a>w.depthLimit){c(e,u,i,m);return}if(typeof w.edgesLimit<"u"&&p+1>w.edgesLimit){c(e,u,i,m);return}if(b.push(u),Array.isArray(u))for(v=0;v<u.length;v++)f(u[v],v,v,b,u,a,w);else{var R={},S=Object.keys(u).sort(h);for(v=0;v<S.length;v++){var x=S[v];f(u[x],x,v,b,u,a,w),R[x]=u[x]}if(typeof m<"u")r.push([m,i,u]),m[i]=R;else return R}b.pop()}}function s(u){return u=typeof u<"u"?u:function(i,p){return p},function(i,p){if(t.length>0)for(var b=0;b<t.length;b++){var m=t[b];if(m[1]===i&&m[0]===p){p=m[2],t.splice(b,1);break}}return u.call(this,i,p)}}return ys}var mu;function eo(){if(mu)return lt;mu=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.EthereumProviderError=lt.EthereumRpcError=void 0;const e=xf();class n extends Error{constructor(c,o,h){if(!Number.isInteger(c))throw new Error('"code" must be an integer.');if(!o||typeof o!="string")throw new Error('"message" must be a nonempty string.');super(o),this.code=c,h!==void 0&&(this.data=h)}serialize(){const c={code:this.code,message:this.message};return this.data!==void 0&&(c.data=this.data),this.stack&&(c.stack=this.stack),c}toString(){return e.default(this.serialize(),g,2)}}lt.EthereumRpcError=n;class r extends n{constructor(c,o,h){if(!t(c))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(c,o,h)}}lt.EthereumProviderError=r;function t(l){return Number.isInteger(l)&&l>=1e3&&l<=4999}function g(l,c){if(c!=="[Circular]")return c}return lt}var ws={},dt={},bu;function to(){return bu||(bu=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.errorValues=dt.errorCodes=void 0,dt.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}},dt.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."}}),dt}var yu;function Al(){return yu||(yu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=to(),r=eo(),t=n.errorCodes.rpc.internal,g="Unspecified error message. This is a bug, please report it.",l={code:t,message:c(t)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function c(u,i=g){if(Number.isInteger(u)){const p=u.toString();if(s(n.errorValues,p))return n.errorValues[p].message;if(d(u))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return i}e.getMessageFromCode=c;function o(u){if(!Number.isInteger(u))return!1;const i=u.toString();return!!(n.errorValues[i]||d(u))}e.isValidCode=o;function h(u,{fallbackError:i=l,shouldIncludeStack:p=!1}={}){var b,m;if(!i||!Number.isInteger(i.code)||typeof i.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(u instanceof r.EthereumRpcError)return u.serialize();const a={};if(u&&typeof u=="object"&&!Array.isArray(u)&&s(u,"code")&&o(u.code)){const v=u;a.code=v.code,v.message&&typeof v.message=="string"?(a.message=v.message,s(v,"data")&&(a.data=v.data)):(a.message=c(a.code),a.data={originalError:f(u)})}else{a.code=i.code;const v=(b=u)===null||b===void 0?void 0:b.message;a.message=v&&typeof v=="string"?v:i.message,a.data={originalError:f(u)}}const w=(m=u)===null||m===void 0?void 0:m.stack;return p&&u&&w&&typeof w=="string"&&(a.stack=w),a}e.serializeError=h;function d(u){return u>=-32099&&u<=-32e3}function f(u){return u&&typeof u=="object"&&!Array.isArray(u)?Object.assign({},u):u}function s(u,i){return Object.prototype.hasOwnProperty.call(u,i)}})(ws)),ws}var Xt={},wu;function Tf(){if(wu)return Xt;wu=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.ethErrors=void 0;const e=eo(),n=Al(),r=to();Xt.ethErrors={rpc:{parse:c=>t(r.errorCodes.rpc.parse,c),invalidRequest:c=>t(r.errorCodes.rpc.invalidRequest,c),invalidParams:c=>t(r.errorCodes.rpc.invalidParams,c),methodNotFound:c=>t(r.errorCodes.rpc.methodNotFound,c),internal:c=>t(r.errorCodes.rpc.internal,c),server:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:o}=c;if(!Number.isInteger(o)||o>-32005||o<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return t(o,c)},invalidInput:c=>t(r.errorCodes.rpc.invalidInput,c),resourceNotFound:c=>t(r.errorCodes.rpc.resourceNotFound,c),resourceUnavailable:c=>t(r.errorCodes.rpc.resourceUnavailable,c),transactionRejected:c=>t(r.errorCodes.rpc.transactionRejected,c),methodNotSupported:c=>t(r.errorCodes.rpc.methodNotSupported,c),limitExceeded:c=>t(r.errorCodes.rpc.limitExceeded,c)},provider:{userRejectedRequest:c=>g(r.errorCodes.provider.userRejectedRequest,c),unauthorized:c=>g(r.errorCodes.provider.unauthorized,c),unsupportedMethod:c=>g(r.errorCodes.provider.unsupportedMethod,c),disconnected:c=>g(r.errorCodes.provider.disconnected,c),chainDisconnected:c=>g(r.errorCodes.provider.chainDisconnected,c),custom:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:o,message:h,data:d}=c;if(!h||typeof h!="string")throw new Error('"message" must be a nonempty string');return new e.EthereumProviderError(o,h,d)}}};function t(c,o){const[h,d]=l(o);return new e.EthereumRpcError(c,h||n.getMessageFromCode(c),d)}function g(c,o){const[h,d]=l(o);return new e.EthereumProviderError(c,h||n.getMessageFromCode(c),d)}function l(c){if(c){if(typeof c=="string")return[c];if(typeof c=="object"&&!Array.isArray(c)){const{message:o,data:h}=c;if(o&&typeof o!="string")throw new Error("Must specify string message.");return[o||void 0,h]}}return[]}return Xt}var _u;function Lf(){return _u||(_u=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const n=eo();Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});const r=Al();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const t=Tf();Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return t.ethErrors}});const g=to();Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return g.errorCodes}})})(bs)),bs}var vu;function xl(){if(vu)return ut;vu=1;var e=ut&&ut.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(ut,"__esModule",{value:!0}),ut.JsonRpcEngine=void 0;const n=e(Af()),r=Lf();let t=class We extends n.default{constructor(){super(),this._middleware=[]}push(c){this._middleware.push(c)}handle(c,o){if(o&&typeof o!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(c)?o?this._handleBatch(c,o):this._handleBatch(c):o?this._handle(c,o):this._promiseHandle(c)}asMiddleware(){return async(c,o,h,d)=>{try{const[f,s,u]=await We._runAllMiddleware(c,o,this._middleware);return s?(await We._runReturnHandlers(u),d(f)):h(async i=>{try{await We._runReturnHandlers(u)}catch(p){return i(p)}return i()})}catch(f){return d(f)}}}async _handleBatch(c,o){try{const h=await Promise.all(c.map(this._promiseHandle.bind(this)));return o?o(null,h):h}catch(h){if(o)return o(h);throw h}}_promiseHandle(c){return new Promise(o=>{this._handle(c,(h,d)=>{o(d)})})}async _handle(c,o){if(!c||Array.isArray(c)||typeof c!="object"){const s=new r.EthereumRpcError(r.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof c}`,{request:c});return o(s,{id:void 0,jsonrpc:"2.0",error:s})}if(typeof c.method!="string"){const s=new r.EthereumRpcError(r.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof c.method}`,{request:c});return o(s,{id:c.id,jsonrpc:"2.0",error:s})}const h=Object.assign({},c),d={id:h.id,jsonrpc:h.jsonrpc};let f=null;try{await this._processRequest(h,d)}catch(s){f=s}return f&&(delete d.result,d.error||(d.error=r.serializeError(f))),o(f,d)}async _processRequest(c,o){const[h,d,f]=await We._runAllMiddleware(c,o,this._middleware);if(We._checkForCompletion(c,o,d),await We._runReturnHandlers(f),h)throw h}static async _runAllMiddleware(c,o,h){const d=[];let f=null,s=!1;for(const u of h)if([f,s]=await We._runMiddleware(c,o,u,d),s)break;return[f,s,d.reverse()]}static _runMiddleware(c,o,h,d){return new Promise(f=>{const s=i=>{const p=i||o.error;p&&(o.error=r.serializeError(p)),f([p,!0])},u=i=>{o.error?s(o.error):(i&&(typeof i!="function"&&s(new r.EthereumRpcError(r.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof i}" for request: