@dcl/shop 0.1.0-28788415697.commit-92a0131 → 0.1.0-28791959161.commit-bbf2734

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 (197) hide show
  1. package/assets/{Assets-C0yakYaS.js → Assets-9qLUKs50.js} +1 -1
  2. package/assets/{Cart-CcietwVV.js → Cart-CAxVkNGc.js} +1 -1
  3. package/assets/{CircularProgress-B0lRHBCP.js → CircularProgress-DPMvJNpJ.js} +1 -1
  4. package/assets/{Collection-DpUFjy6q.js → Collection-B66-SzHK.js} +1 -1
  5. package/assets/{ConstantsUtil-D9t4gp4-.js → ConstantsUtil-B4MJgBKG.js} +1 -1
  6. package/assets/{Creator-BIgvo89M.js → Creator-CohqYjVA.js} +1 -1
  7. package/assets/{ExchangeController-BxGELXaJ.js → ExchangeController-B18u0eQ4.js} +1 -1
  8. package/assets/GetCredits-BVysqJhS.js +2 -0
  9. package/assets/{HelpersUtil-JEAWoPWy.js → HelpersUtil-DXeL2ELM.js} +1 -1
  10. package/assets/{ImportListings-_ZmYZr75.js → ImportListings-EKqPuzMQ.js} +1 -1
  11. package/assets/ItemDetail-BA4Jq4vl.js +1 -0
  12. package/assets/{LoadMore-DB6TwvRe.js → LoadMore-BoliIoyr.js} +1 -1
  13. package/assets/Market-BOmV77no.js +1 -0
  14. package/assets/MenuItem-CYD8wnVv.js +82 -0
  15. package/assets/MyAssets-DFlUMWgL.js +1 -0
  16. package/assets/{MyFavorites-LznRvK5N.js → MyFavorites-DA8qZCPg.js} +1 -1
  17. package/assets/{MyPurchases-BM1Uxpk1.js → MyPurchases-WNv2t3Pp.js} +1 -1
  18. package/assets/{NetworkUtil-CSluj-ND.js → NetworkUtil-DbINpnxE.js} +1 -1
  19. package/assets/NotFound-B7E5Xnkr.js +1 -0
  20. package/assets/{RealCheckout-DbSQfCUZ.js → RealCheckout-Dkhr3jY-.js} +1 -1
  21. package/assets/ShopFooterInner-iVLxRIPv.js +24 -0
  22. package/assets/{SkeletonCards-yV2mi4oc.js → SkeletonCards-DAmSiIVf.js} +1 -1
  23. package/assets/{Success-CkhrWNlU.js → Success-D2rmbG3W.js} +1 -1
  24. package/assets/{SvgIcon-o9nhGFxM.js → SvgIcon-BkLz4SgC.js} +1 -1
  25. package/assets/{SwapController-C1nqmWnS.js → SwapController-1METXOfk.js} +1 -1
  26. package/assets/{TradeService-BOr6_BxE.js → TradeService-CRDhsP_X.js} +1 -1
  27. package/assets/{W3MFrameProviderSingleton-Drovl6ew.js → W3MFrameProviderSingleton-D3O9Q4nI.js} +3 -3
  28. package/assets/{WebCryptoP256-C468KsvN.js → WebCryptoP256-rsQwOOur.js} +1 -1
  29. package/assets/{basic-CfT3tKSs.js → basic-Dex73X0G.js} +1 -1
  30. package/assets/{biconomy-BRQR4sBp.js → biconomy-B8w-qPSq.js} +1 -1
  31. package/assets/{browser-tNtPL9tA.js → browser-apEuT0kU.js} +1 -1
  32. package/assets/{browser-ponyfill-DgNUJw98.js → browser-ponyfill-1U6QLnAR.js} +1 -1
  33. package/assets/{buy-C-Rj-xp5.js → buy-HuTwLbo0.js} +1 -1
  34. package/assets/{buy-gasless-BmoACMRr.js → buy-gasless-CcKNzGZP.js} +1 -1
  35. package/assets/{ccip-0BllB1E2.js → ccip-CkIiZ-BD.js} +1 -1
  36. package/assets/{ccip-c6S7TqyR.js → ccip-DNRw33rF.js} +1 -1
  37. package/assets/{chains-L33YnVne.js → chains-CpTlhss6.js} +1 -1
  38. package/assets/{collection-WeXeyjAn.js → collection-Rtdzd46Q.js} +1 -1
  39. package/assets/colors-LINLm1ux.js +1 -0
  40. package/assets/{common-CKF0Kl8D.js → common-Dks4AppO.js} +1 -1
  41. package/assets/{controller-dlBlTbYB.js → controller-SQzTuixq.js} +2 -2
  42. package/assets/{core-Bl_sLfyx.js → core-C9yTXrtq.js} +4 -4
  43. package/assets/{custom-CNFVifWV.js → custom-CFFscJUJ.js} +1 -1
  44. package/assets/{data-capture-SDMekFnt.js → data-capture-C5EMGON1.js} +1 -1
  45. package/assets/{decimals-CSVlCZb3.js → decimals-CDXweQXA.js} +1 -1
  46. package/assets/decimals-CbsdRaWr.js +1 -0
  47. package/assets/{detectExtension-CGFTREd-.js → detectExtension-DR_ZxH4l.js} +1 -1
  48. package/assets/{email-CYnr2jcE.js → email-Cok_0DNo.js} +1 -1
  49. package/assets/{embedded-wallet-W7SWJ6st.js → embedded-wallet-BcVJOMpi.js} +1 -1
  50. package/assets/{engine-UOkAfyVN.js → engine-Bl8dVlnm.js} +1 -1
  51. package/assets/{estimate-l1-fee-D_bpSDla.js → estimate-l1-fee-CglMANTl.js} +1 -1
  52. package/assets/eth_estimateGas-BMVHcoRz.js +1 -0
  53. package/assets/{eth_getStorageAt-D3dzlnBk.js → eth_getStorageAt-DsIXkK1E.js} +1 -1
  54. package/assets/eth_getTransactionCount-9Lmh4DiA.js +1 -0
  55. package/assets/{ethereum-BT-rALS5.js → ethereum-CG-ae6aA.js} +1 -1
  56. package/assets/{ethers-DbXGgxrh.js → ethers-BX4n1m6i.js} +1 -1
  57. package/assets/{extractIPFS-DGHj61b1.js → extractIPFS-Bf2NI_E_.js} +1 -1
  58. package/assets/{features-DENKVFit.js → features-fnkNUeaS.js} +1 -1
  59. package/assets/{fetchTokenMetadata-D85asFLD.js → fetchTokenMetadata-B9JutSBZ.js} +2 -2
  60. package/assets/{fortmatic-fqRJiMUL.js → fortmatic-Ce5oNyb-.js} +1 -1
  61. package/assets/{generateUtilityClasses-DXz6v4wN.js → generateUtilityClasses-DCkAA4c7.js} +2 -2
  62. package/assets/get-ecosystem-wallet-info-CyIyjQv6.js +1 -0
  63. package/assets/{getBalance-D2EO4aBF.js → getBalance-D7KCQayQ.js} +2 -2
  64. package/assets/{getInstalledModules-D4PNkmVO.js → getInstalledModules-CZxVqCTa.js} +1 -1
  65. package/assets/{getNFT-BESsQ4oH.js → getNFT-CJKw4HGu.js} +1 -1
  66. package/assets/{getNFT-Ddh7bEJQ.js → getNFT-D-2QIZ2a.js} +2 -2
  67. package/assets/{hashTypedData-Bx3nzvk8.js → hashTypedData-D9Gm8pUL.js} +1 -1
  68. package/assets/{hashTypedData-C9QOz9pr.js → hashTypedData-DcHyOdmW.js} +1 -1
  69. package/assets/{import-CDNhzcDz.js → import-C6AgY1_D.js} +1 -1
  70. package/assets/{in-app-wallet-calls-Df158hbr.js → in-app-wallet-calls-DDLXy2LU.js} +1 -1
  71. package/assets/{index-BpRV6pU7.js → index-B-Pk9QiX.js} +1 -1
  72. package/assets/{index-C6ImpJyG.js → index-B02qSUhX.js} +1 -1
  73. package/assets/{index-B3m29cNt.js → index-B8koHdVP.js} +1 -1
  74. package/assets/{index-BqV4-5lu.js → index-BFLSR3Ft.js} +2 -2
  75. package/assets/{index-m4zZXBld.js → index-BQ31Yq6g.js} +1 -1
  76. package/assets/{index-DFJRGUDh.js → index-BXg7SCyS.js} +1 -1
  77. package/assets/{index-wj8CVNfJ.js → index-B_YP2wWW.js} +1 -1
  78. package/assets/index-BchMdjBo.js +1 -0
  79. package/assets/index-Bmwrl-dJ.js +95 -0
  80. package/assets/{index-yPxvUW6S.js → index-BqDUGpB4.js} +1 -1
  81. package/assets/{index-3SuxDGIz.js → index-Bs4bNJDW.js} +1 -1
  82. package/assets/{index-Dk9zDQwk.js → index-Bwer1-dK.js} +1 -1
  83. package/assets/index-C2KNJWDl.css +1 -0
  84. package/assets/{index-aTH_VwVx.js → index-C59UMg6N.js} +1 -1
  85. package/assets/{index-CBLO6USL.js → index-CEKz6pqL.js} +1 -1
  86. package/assets/{index-DoTsdAEj.js → index-CH3FzygQ.js} +1 -1
  87. package/assets/{index-DUOCGq8U.js → index-CHbgCYns.js} +1 -1
  88. package/assets/{index-B4P5FnkC.js → index-CHsrXN_y.js} +1 -1
  89. package/assets/{index-SBOBxQlc.js → index-CKcVWNdI.js} +1 -1
  90. package/assets/index-CM_Ta_i6.js +4 -0
  91. package/assets/{index-WQHztqda.js → index-CNkf4DZu.js} +1 -1
  92. package/assets/{index-LSdKGFoq.js → index-CRm6-g8n.js} +1 -1
  93. package/assets/index-CWSt1wQZ.js +7 -0
  94. package/assets/{index-boWBUFDv.js → index-CWs_Wh8Q.js} +1 -1
  95. package/assets/{index-75Ps2rGt.js → index-C_G903UG.js} +3 -3
  96. package/assets/{index-CIxFIqFU.js → index-CcTYKjQ1.js} +1 -1
  97. package/assets/{index-BEqhzSDF.js → index-CiTZNj37.js} +1 -1
  98. package/assets/{index-BUE1aXpM.js → index-Ck3k_VCr.js} +1 -1
  99. package/assets/{index-p2GbBPES.js → index-CmVXXD_2.js} +1 -1
  100. package/assets/{index-B5lBgsVo.js → index-D4OQbbeB.js} +1 -1
  101. package/assets/{index-DaBA0yRd.js → index-D6BrjomW.js} +1 -1
  102. package/assets/{index-DYf2mXDi.js → index-D6hK9xR0.js} +1 -1
  103. package/assets/{index-BwMgLDly.js → index-D7GAB1Bz.js} +1 -1
  104. package/assets/{index-B4VK7VPX.js → index-DAz0jXfm.js} +1 -1
  105. package/assets/{index-bwiQJCJg.js → index-DEVaMATu.js} +2 -2
  106. package/assets/{index-u6DTe7Nz.js → index-DHCxhjX5.js} +1 -1
  107. package/assets/{index-K4m_AYVk.js → index-DQliuKMN.js} +3 -3
  108. package/assets/{index-soJZoLvF.js → index-DRNqbTPs.js} +1 -1
  109. package/assets/{index-kSZb6Dua.js → index-DX6hECM_.js} +1 -1
  110. package/assets/{index-CfLoF7Qe.js → index-DaA0LnpT.js} +1 -1
  111. package/assets/index-DcTElrwc.js +1 -0
  112. package/assets/{index-BGGbU05t.js → index-DcU1FQxy.js} +1 -1
  113. package/assets/{index-CvVHPcFb.js → index-DcbkT8vS.js} +1 -1
  114. package/assets/{index-ykRzQjuZ.js → index-Dd0chS-6.js} +2 -2
  115. package/assets/{index-kV1vUp3Z.js → index-Dg-hrVBd.js} +1 -1
  116. package/assets/{index-BQWuxKdW.js → index-DlMSW5Vf.js} +1 -1
  117. package/assets/{index-TLgW5WZT.js → index-DvowIig0.js} +1 -1
  118. package/assets/{index-63GX_n07.js → index-R0c-ydIQ.js} +2 -2
  119. package/assets/{index-D6h-NdP-.js → index-SDWOUKNs.js} +1 -1
  120. package/assets/{index-C631qzTG.js → index-U5sRdDyJ.js} +1 -1
  121. package/assets/{index-DBg2eXPN.js → index-hSRK1RUs.js} +1 -1
  122. package/assets/{index-Cre0gJrZ.js → index-k2oXA-48.js} +1 -1
  123. package/assets/{index-DdlK5WYO.js → index-l9Xp1tyI.js} +1 -1
  124. package/assets/{index-VSv5weX8.js → index-mbNv-LyJ.js} +1 -1
  125. package/assets/{index-DFrHyvod.js → index-tUr9zh4i.js} +1 -1
  126. package/assets/{index-BC7-fNQN.js → index-uNLop9p2.js} +1 -1
  127. package/assets/{index-BkFksbUM.js → index-xVRJSATu.js} +1 -1
  128. package/assets/{index-CORb4fda.js → index-yqPXyIyc.js} +1 -1
  129. package/assets/{index.es-C0c_PfHy.js → index.es-BL-JlnBJ.js} +1 -1
  130. package/assets/{index.es-BRKHDF5O.js → index.es-BQRPtQt1.js} +1 -1
  131. package/assets/{index.es-CO_XF63k.js → index.es-lpnM3lDg.js} +4 -4
  132. package/assets/{localBatchGatewayRequest-Coptu8fQ.js → localBatchGatewayRequest-B2n6ANqu.js} +1 -1
  133. package/assets/{mana-rate-RN1C71HA.js → mana-rate-CRLBuDqT.js} +1 -1
  134. package/assets/{native-BJmDxbqB.js → native-DH6SCBuz.js} +1 -1
  135. package/assets/network-BKKQJgKT.js +1 -0
  136. package/assets/{networks-Dk1wsaJ8.js → networks-DlVMUz6O.js} +1 -1
  137. package/assets/{onramp-8Ursi6WH.js → onramp-D-T39BXU.js} +1 -1
  138. package/assets/{openzeppelin-DoezFh1a.js → openzeppelin-BMHzUJE4.js} +1 -1
  139. package/assets/{ownerOf-Be35NH6y.js → ownerOf-6LxIztWA.js} +1 -1
  140. package/assets/{parseNft-B8RddWyu.js → parseNft-CfNws3z5.js} +2 -2
  141. package/assets/{parseSignature-B9N92FV1.js → parseSignature-BDHrsB7s.js} +3 -3
  142. package/assets/{parseSignature-BCXOdvDq.js → parseSignature-jJ3rJ5Sg.js} +1 -1
  143. package/assets/{pay-with-exchange-CLsRdRnD.js → pay-with-exchange-C_SUNuNn.js} +1 -1
  144. package/assets/{qr-overlay-CfKat5Nj.js → qr-overlay-BwVINpcT.js} +3 -3
  145. package/assets/{react-E8ng6RF2.js → react-l18WOY32.js} +1 -1
  146. package/assets/{receive-Bpba7exF.js → receive-2Eh0umfn.js} +1 -1
  147. package/assets/{resolveImplementation-COEuR_c6.js → resolveImplementation-BvaPw5pc.js} +1 -1
  148. package/assets/{rpc-CA14ywXy.js → rpc-BGhngNqK.js} +1 -1
  149. package/assets/{secp256k1-BxNXIPx_.js → secp256k1-BNUDarxj.js} +1 -1
  150. package/assets/{secp256k1-BYTveHSI.js → secp256k1-ClZ8xt6Q.js} +1 -1
  151. package/assets/{secp256k1-VCKU6ZbV.js → secp256k1-npTNusCa.js} +1 -1
  152. package/assets/{send-CKEWBVZR.js → send-BE0uL3pF.js} +1 -1
  153. package/assets/{send-batch-transaction-kRaDbHFW.js → send-batch-transaction-BtaKnrYE.js} +1 -1
  154. package/assets/{send-eip712-transaction-BdAsbdUC.js → send-eip712-transaction-RGnyfyzZ.js} +2 -2
  155. package/assets/{send-gasless-transaction-umbide8L.js → send-gasless-transaction-DkDSvDxp.js} +2 -2
  156. package/assets/{sendRawTransaction-9yflHgsx.js → sendRawTransaction-B9S48daQ.js} +3 -3
  157. package/assets/{serializeTransaction-Cl_9QLOo.js → serializeTransaction-DHOPK3lx.js} +1 -1
  158. package/assets/{session-proposal-CAuTXnKi.js → session-proposal-DDeob-V0.js} +1 -1
  159. package/assets/{session-request-CuMQl9E8.js → session-request-DK60D5-t.js} +2 -2
  160. package/assets/{sha256-4KqSLEWF.js → sha256-DqmOF0I7.js} +1 -1
  161. package/assets/{signing-CHdT_Ot8.js → signing-C2R2pyWK.js} +5 -5
  162. package/assets/{socials-9xnPXlWI.js → socials-kNITtnGE.js} +1 -1
  163. package/assets/{swaps-DJp-RCo5.js → swaps-DrHq48WX.js} +1 -1
  164. package/assets/{thirdweb-T9OwwIQ6.js → thirdweb-Cm8cbl_-.js} +3 -3
  165. package/assets/{totalSupply-D_X-_ZDw.js → totalSupply-UDWCcR3y.js} +1 -1
  166. package/assets/{transactionReceipt-BTJ1sQrj.js → transactionReceipt-CJQ8YwEm.js} +1 -1
  167. package/assets/{transactions-C6sC5BaM.js → transactions-Co2DoasX.js} +1 -1
  168. package/assets/{useInfiniteGrid-et3T-1IY.js → useInfiniteGrid-B7hqbXQc.js} +1 -1
  169. package/assets/{utils-BZTXwsyT.js → utils-Y9Dyt8Hx.js} +1 -1
  170. package/assets/{verifyHash-CudNiAgH.js → verifyHash-DUTuBtMs.js} +1 -1
  171. package/assets/{w3m-modal-BxYBckMB.js → w3m-modal-CJa5uxWK.js} +1 -1
  172. package/assets/{w3m-modal-DIuoUtJk.js → w3m-modal-jCh4fDDj.js} +1 -1
  173. package/assets/{wait-for-tx-receipt-CygP4VsC.js → wait-for-tx-receipt-BzGR0tRr.js} +1 -1
  174. package/assets/{wallet-kind-BTWNHcc9.js → wallet-kind-DUl1zXtH.js} +1 -1
  175. package/assets/{wallets-CsiIl2HG.js → wallets-CluwpKtd.js} +6 -6
  176. package/assets/{web-connector-BkMDTCh_.js → web-connector-CbuzGU4n.js} +3 -3
  177. package/assets/{writeContract-C8FPneHs.js → writeContract-BkdgR96B.js} +1 -1
  178. package/assets/{zora-sepolia-BF9oR096.js → zora-sepolia-BEDS3zXD.js} +1 -1
  179. package/assets/{zoraTestnet-CQZ9NUll.js → zoraTestnet-Cf-3MEIW.js} +1 -1
  180. package/index.html +8 -8
  181. package/package.json +2 -2
  182. package/assets/GetCredits-BkyWsDk5.js +0 -2
  183. package/assets/ItemDetail-5H1R8AEJ.js +0 -1
  184. package/assets/Market-DjypWFj5.js +0 -1
  185. package/assets/MyAssets-CrobB3dP.js +0 -1
  186. package/assets/NotFound-DW9xW0V2.js +0 -1
  187. package/assets/decimals-DoXdKj3t.js +0 -1
  188. package/assets/eth_estimateGas-CtUEH79c.js +0 -1
  189. package/assets/eth_getTransactionCount-n2pPwlEw.js +0 -1
  190. package/assets/get-ecosystem-wallet-info-D5g78AMe.js +0 -1
  191. package/assets/index-C13awi5n.js +0 -74
  192. package/assets/index-CVEOS5BF.css +0 -1
  193. package/assets/index-ChPBLIHl.js +0 -1
  194. package/assets/index-D7_2_7YY.js +0 -85
  195. package/assets/index-DSxKsQSh.js +0 -1
  196. package/assets/index-z01aMwFk.js +0 -7
  197. package/assets/network-DRh88abw.js +0 -1
@@ -1,7 +0,0 @@
1
- import{e as Ut,c as fr,g as Ll}from"./react-E8ng6RF2.js";import{E as K}from"./index-C13awi5n.js";import{k as pr,e as Es,p as te,i as Wt}from"./ethers-DbXGgxrh.js";import{r as Pl}from"./index-COjgItKg.js";import{e as Nl,b as yu,c as Ol,d as Gs}from"./index-SBOBxQlc.js";import{p as xl,a as Dl,b as jl}from"./hooks.module-C4R15-Vr.js";import{r as mr}from"./index-63GX_n07.js";function Bl(e,r){for(var n=0;n<r.length;n++){const t=r[n];if(typeof t!="string"&&!Array.isArray(t)){for(const c in t)if(c!=="default"&&!(c in e)){const i=Object.getOwnPropertyDescriptor(t,c);i&&Object.defineProperty(e,c,i.get?i:{enumerable:!0,get:()=>t[c]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var ys=function(e,r){return ys=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&(n[c]=t[c])},ys(e,r)};function wu(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");ys(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var hr=function(){return hr=Object.assign||function(r){for(var n,t=1,c=arguments.length;t<c;t++){n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},hr.apply(this,arguments)};function _u(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,t=Object.getOwnPropertySymbols(e);c<t.length;c++)r.indexOf(t[c])<0&&Object.prototype.propertyIsEnumerable.call(e,t[c])&&(n[t[c]]=e[t[c]]);return n}function vu(e,r,n,t){var c=arguments.length,i=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,n):t,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,n,t);else for(var h=e.length-1;h>=0;h--)(a=e[h])&&(i=(c<3?a(i):c>3?a(r,n,i):a(r,n))||i);return c>3&&i&&Object.defineProperty(r,n,i),i}function Eu(e,r){return function(n,t){r(n,t,e)}}function Ru(e,r,n,t,c,i){function a(g){if(g!==void 0&&typeof g!="function")throw new TypeError("Function expected");return g}for(var h=t.kind,l=h==="getter"?"get":h==="setter"?"set":"value",f=!r&&e?t.static?e:e.prototype:null,d=r||(f?Object.getOwnPropertyDescriptor(f,t.name):{}),o,u=!1,s=n.length-1;s>=0;s--){var p={};for(var m in t)p[m]=m==="access"?{}:t[m];for(var m in t.access)p.access[m]=t.access[m];p.addInitializer=function(g){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(g||null))};var b=(0,n[s])(h==="accessor"?{get:d.get,set:d.set}:d[l],p);if(h==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(o=a(b.get))&&(d.get=o),(o=a(b.set))&&(d.set=o),(o=a(b.init))&&c.unshift(o)}else(o=a(b))&&(h==="field"?c.unshift(o):d[l]=o)}f&&Object.defineProperty(f,t.name,d),u=!0}function Su(e,r,n){for(var t=arguments.length>2,c=0;c<r.length;c++)n=t?r[c].call(e,n):r[c].call(e);return t?n:void 0}function Cu(e){return typeof e=="symbol"?e:"".concat(e)}function ku(e,r,n){return typeof r=="symbol"&&(r=r.description?"[".concat(r.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",r):r})}function Iu(e,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,r)}function Au(e,r,n,t){function c(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function h(d){try{f(t.next(d))}catch(o){a(o)}}function l(d){try{f(t.throw(d))}catch(o){a(o)}}function f(d){d.done?i(d.value):c(d.value).then(h,l)}f((t=t.apply(e,r||[])).next())})}function Tu(e,r){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,c,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=h(0),a.throw=h(1),a.return=h(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function h(f){return function(d){return l([f,d])}}function l(f){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(t=1,c&&(i=f[0]&2?c.return:f[0]?c.throw||((i=c.return)&&i.call(c),0):c.next)&&!(i=i.call(c,f[1])).done)return i;switch(c=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,c=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){n.label=f[1];break}if(f[0]===6&&n.label<i[1]){n.label=i[1],i=f;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(f);break}i[2]&&n.ops.pop(),n.trys.pop();continue}f=r.call(e,n)}catch(d){f=[6,d],c=0}finally{t=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var br=Object.create?(function(e,r,n,t){t===void 0&&(t=n);var c=Object.getOwnPropertyDescriptor(r,n);(!c||("get"in c?!r.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,t,c)}):(function(e,r,n,t){t===void 0&&(t=n),e[t]=r[n]});function Mu(e,r){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(r,n)&&br(r,e,n)}function gr(e){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&e[r],t=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rs(e,r){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var t=n.call(e),c,i=[],a;try{for(;(r===void 0||r-- >0)&&!(c=t.next()).done;)i.push(c.value)}catch(h){a={error:h}}finally{try{c&&!c.done&&(n=t.return)&&n.call(t)}finally{if(a)throw a.error}}return i}function Lu(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(Rs(arguments[r]));return e}function Pu(){for(var e=0,r=0,n=arguments.length;r<n;r++)e+=arguments[r].length;for(var t=Array(e),c=0,r=0;r<n;r++)for(var i=arguments[r],a=0,h=i.length;a<h;a++,c++)t[c]=i[a];return t}function Nu(e,r,n){if(n||arguments.length===2)for(var t=0,c=r.length,i;t<c;t++)(i||!(t in r))&&(i||(i=Array.prototype.slice.call(r,0,t)),i[t]=r[t]);return e.concat(i||Array.prototype.slice.call(r))}function tt(e){return this instanceof tt?(this.v=e,this):new tt(e)}function Ou(e,r,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n.apply(e,r||[]),c,i=[];return c=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),h("next"),h("throw"),h("return",a),c[Symbol.asyncIterator]=function(){return this},c;function a(s){return function(p){return Promise.resolve(p).then(s,o)}}function h(s,p){t[s]&&(c[s]=function(m){return new Promise(function(b,g){i.push([s,m,b,g])>1||l(s,m)})},p&&(c[s]=p(c[s])))}function l(s,p){try{f(t[s](p))}catch(m){u(i[0][3],m)}}function f(s){s.value instanceof tt?Promise.resolve(s.value.v).then(d,o):u(i[0][2],s)}function d(s){l("next",s)}function o(s){l("throw",s)}function u(s,p){s(p),i.shift(),i.length&&l(i[0][0],i[0][1])}}function xu(e){var r,n;return r={},t("next"),t("throw",function(c){throw c}),t("return"),r[Symbol.iterator]=function(){return this},r;function t(c,i){r[c]=e[c]?function(a){return(n=!n)?{value:tt(e[c](a)),done:!1}:i?i(a):a}:i}}function Du(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],n;return r?r.call(e):(e=typeof gr=="function"?gr(e):e[Symbol.iterator](),n={},t("next"),t("throw"),t("return"),n[Symbol.asyncIterator]=function(){return this},n);function t(i){n[i]=e[i]&&function(a){return new Promise(function(h,l){a=e[i](a),c(h,l,a.done,a.value)})}}function c(i,a,h,l){Promise.resolve(l).then(function(f){i({value:f,done:h})},a)}}function ju(e,r){return Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,e}var Fl=Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r},ws=function(e){return ws=Object.getOwnPropertyNames||function(r){var n=[];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[n.length]=t);return n},ws(e)};function Bu(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=ws(e),t=0;t<n.length;t++)n[t]!=="default"&&br(r,e,n[t]);return Fl(r,e),r}function Fu(e){return e&&e.__esModule?e:{default:e}}function qu(e,r,n,t){if(n==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!t:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?t:n==="a"?t.call(e):t?t.value:r.get(e)}function $u(e,r,n,t,c){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?e!==r||!c:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?c.call(e,n):c?c.value=n:r.set(e,n),n}function Hu(e,r){if(r===null||typeof r!="object"&&typeof r!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?r===e:e.has(r)}function Uu(e,r,n){if(r!=null){if(typeof r!="object"&&typeof r!="function")throw new TypeError("Object expected.");var t,c;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");t=r[Symbol.asyncDispose]}if(t===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");t=r[Symbol.dispose],n&&(c=t)}if(typeof t!="function")throw new TypeError("Object not disposable.");c&&(t=function(){try{c.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:r,dispose:t,async:n})}else n&&e.stack.push({async:!0});return r}var ql=typeof SuppressedError=="function"?SuppressedError:function(e,r,n){var t=new Error(n);return t.name="SuppressedError",t.error=e,t.suppressed=r,t};function Wu(e){function r(i){e.error=e.hasError?new ql(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}var n,t=0;function c(){for(;n=e.stack.pop();)try{if(!n.async&&t===1)return t=0,e.stack.push(n),Promise.resolve().then(c);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return t|=2,Promise.resolve(i).then(c,function(a){return r(a),c()})}else t|=1}catch(a){r(a)}if(t===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return c()}function Vu(e,r){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,t,c,i,a){return t?r?".jsx":".js":c&&(!i||!a)?n:c+i+"."+a.toLowerCase()+"js"}):e}const $l={__extends:wu,__assign:hr,__rest:_u,__decorate:vu,__param:Eu,__esDecorate:Ru,__runInitializers:Su,__propKey:Cu,__setFunctionName:ku,__metadata:Iu,__awaiter:Au,__generator:Tu,__createBinding:br,__exportStar:Mu,__values:gr,__read:Rs,__spread:Lu,__spreadArrays:Pu,__spreadArray:Nu,__await:tt,__asyncGenerator:Ou,__asyncDelegator:xu,__asyncValues:Du,__makeTemplateObject:ju,__importStar:Bu,__importDefault:Fu,__classPrivateFieldGet:qu,__classPrivateFieldSet:$u,__classPrivateFieldIn:Hu,__addDisposableResource:Uu,__disposeResources:Wu,__rewriteRelativeImportExtension:Vu},Hl=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Uu,get __assign(){return hr},__asyncDelegator:xu,__asyncGenerator:Ou,__asyncValues:Du,__await:tt,__awaiter:Au,__classPrivateFieldGet:qu,__classPrivateFieldIn:Hu,__classPrivateFieldSet:$u,__createBinding:br,__decorate:vu,__disposeResources:Wu,__esDecorate:Ru,__exportStar:Mu,__extends:wu,__generator:Tu,__importDefault:Fu,__importStar:Bu,__makeTemplateObject:ju,__metadata:Iu,__param:Eu,__propKey:Cu,__read:Rs,__rest:_u,__rewriteRelativeImportExtension:Vu,__runInitializers:Su,__setFunctionName:ku,__spread:Lu,__spreadArray:Nu,__spreadArrays:Pu,__values:gr,default:$l},Symbol.toStringTag,{value:"Module"}));var Sn={},at={},ct={},Zs;function Ul(){if(Zs)return ct;Zs=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.walletLogo=void 0;const e=(r,n)=>{let t;switch(r){case"standard":return t=n,`data:image/svg+xml,%3Csvg width='${n}' 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=n,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${n}' 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*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' 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*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' 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*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' 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*n).toFixed(2),`data:image/svg+xml,%3Csvg width='${n}' 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=n,`data:image/svg+xml,%3Csvg width='${n}' 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 ct.walletLogo=e,ct}var ut={},Ks;function Wl(){return Ks||(Ks=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.LINK_API_URL=void 0,ut.LINK_API_URL="https://www.walletlink.org"),ut}var W={},Cn={},Ae={},Qs;function yr(){return Qs||(Qs=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.errorValues=Ae.standardErrorCodes=void 0,Ae.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}},Ae.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."}}),Ae}var lt={},kn={},Ys;function Ss(){return Ys||(Ys=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 r=yr(),n="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function t(u,s=n){if(u&&Number.isInteger(u)){const p=u.toString();if(d(r.errorValues,p))return r.errorValues[p].message;if(l(u))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return s}e.getMessageFromCode=t;function c(u){if(!Number.isInteger(u))return!1;const s=u.toString();return!!(r.errorValues[s]||l(u))}e.isValidCode=c;function i(u){var s;if(typeof u=="number")return u;if(a(u))return(s=u.code)!==null&&s!==void 0?s:u.errorCode}e.getErrorCode=i;function a(u){return typeof u=="object"&&u!==null&&(typeof u.code=="number"||typeof u.errorCode=="number")}function h(u,{shouldIncludeStack:s=!1}={}){const p={};if(u&&typeof u=="object"&&!Array.isArray(u)&&d(u,"code")&&c(u.code)){const m=u;p.code=m.code,m.message&&typeof m.message=="string"?(p.message=m.message,d(m,"data")&&(p.data=m.data)):(p.message=t(p.code),p.data={originalError:f(u)})}else p.code=r.standardErrorCodes.rpc.internal,p.message=o(u,"message")?u.message:n,p.data={originalError:f(u)};return s&&(p.stack=o(u,"stack")?u.stack:void 0),p}e.serialize=h;function l(u){return u>=-32099&&u<=-32e3}function f(u){return u&&typeof u=="object"&&!Array.isArray(u)?Object.assign({},u):u}function d(u,s){return Object.prototype.hasOwnProperty.call(u,s)}function o(u,s){return typeof u=="object"&&u!==null&&s in u&&typeof u[s]=="string"}})(kn)),kn}var Xs;function Vl(){if(Xs)return lt;Xs=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.standardErrors=void 0;const e=yr(),r=Ss();lt.standardErrors={rpc:{parse:l=>n(e.standardErrorCodes.rpc.parse,l),invalidRequest:l=>n(e.standardErrorCodes.rpc.invalidRequest,l),invalidParams:l=>n(e.standardErrorCodes.rpc.invalidParams,l),methodNotFound:l=>n(e.standardErrorCodes.rpc.methodNotFound,l),internal:l=>n(e.standardErrorCodes.rpc.internal,l),server:l=>{if(!l||typeof l!="object"||Array.isArray(l))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:f}=l;if(!Number.isInteger(f)||f>-32005||f<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(f,l)},invalidInput:l=>n(e.standardErrorCodes.rpc.invalidInput,l),resourceNotFound:l=>n(e.standardErrorCodes.rpc.resourceNotFound,l),resourceUnavailable:l=>n(e.standardErrorCodes.rpc.resourceUnavailable,l),transactionRejected:l=>n(e.standardErrorCodes.rpc.transactionRejected,l),methodNotSupported:l=>n(e.standardErrorCodes.rpc.methodNotSupported,l),limitExceeded:l=>n(e.standardErrorCodes.rpc.limitExceeded,l)},provider:{userRejectedRequest:l=>t(e.standardErrorCodes.provider.userRejectedRequest,l),unauthorized:l=>t(e.standardErrorCodes.provider.unauthorized,l),unsupportedMethod:l=>t(e.standardErrorCodes.provider.unsupportedMethod,l),disconnected:l=>t(e.standardErrorCodes.provider.disconnected,l),chainDisconnected:l=>t(e.standardErrorCodes.provider.chainDisconnected,l),unsupportedChain:l=>t(e.standardErrorCodes.provider.unsupportedChain,l),custom:l=>{if(!l||typeof l!="object"||Array.isArray(l))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:f,message:d,data:o}=l;if(!d||typeof d!="string")throw new Error('"message" must be a nonempty string');return new a(f,d,o)}}};function n(l,f){const[d,o]=c(f);return new i(l,d||(0,r.getMessageFromCode)(l),o)}function t(l,f){const[d,o]=c(f);return new a(l,d||(0,r.getMessageFromCode)(l),o)}function c(l){if(l){if(typeof l=="string")return[l];if(typeof l=="object"&&!Array.isArray(l)){const{message:f,data:d}=l;if(f&&typeof f!="string")throw new Error("Must specify string message.");return[f||void 0,d]}}return[]}class i extends Error{constructor(f,d,o){if(!Number.isInteger(f))throw new Error('"code" must be an integer.');if(!d||typeof d!="string")throw new Error('"message" must be a nonempty string.');super(d),this.code=f,o!==void 0&&(this.data=o)}}class a extends i{constructor(f,d,o){if(!h(f))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(f,d,o)}}function h(l){return Number.isInteger(l)&&l>=1e3&&l<=4999}return lt}var dt={},ft={},eo;function Cs(){if(eo)return ft;eo=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.isErrorResponse=void 0;function e(r){return r.errorMessage!==void 0}return ft.isErrorResponse=e,ft}var ht={},to;function ks(){return to||(to=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.LIB_VERSION=void 0,ht.LIB_VERSION="3.9.3"),ht}var ro;function zl(){if(ro)return dt;ro=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.serializeError=void 0;const e=Cs(),r=ks(),n=yr(),t=Ss();function c(h,l){const f=(0,t.serialize)(i(h),{shouldIncludeStack:!0}),d=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");d.searchParams.set("version",r.LIB_VERSION),d.searchParams.set("code",f.code.toString());const o=a(f.data,l);return o&&d.searchParams.set("method",o),d.searchParams.set("message",f.message),Object.assign(Object.assign({},f),{docUrl:d.href})}dt.serializeError=c;function i(h){return typeof h=="string"?{message:h,code:n.standardErrorCodes.rpc.internal}:(0,e.isErrorResponse)(h)?Object.assign(Object.assign({},h),{message:h.errorMessage,code:h.errorCode,data:{method:h.method}}):h}function a(h,l){const f=h==null?void 0:h.method;if(f)return f;if(l!==void 0){if(typeof l=="string")return l;if(Array.isArray(l)){if(l.length>0)return l[0].method}else return l.method}}return dt}var no;function wr(){return no||(no=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const r=yr();Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return r.standardErrorCodes}});const n=Vl();Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return n.standardErrors}});const t=zl();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return t.serializeError}});const c=Ss();Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return c.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return c.getMessageFromCode}})})(Cn)),Cn}var oe={},io;function _r(){if(io)return oe;io=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.ProviderType=oe.RegExpString=oe.IntNumber=oe.BigIntString=oe.AddressString=oe.HexString=oe.OpaqueType=void 0;function e(){return t=>t}oe.OpaqueType=e,oe.HexString=e(),oe.AddressString=e(),oe.BigIntString=e();function r(t){return Math.floor(t)}oe.IntNumber=r,oe.RegExpString=e();var n;return(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(n||(oe.ProviderType=n={})),oe}var so;function Re(){if(so)return W;so=1;var e=W&&W.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(W,"__esModule",{value:!0}),W.isMobileWeb=W.getLocation=W.isInIFrame=W.createQrUrl=W.getFavicon=W.range=W.isBigNumber=W.ensureParsedJSONObject=W.ensureBN=W.ensureRegExpString=W.ensureIntNumber=W.ensureBuffer=W.ensureAddressString=W.ensureEvenLengthHexString=W.ensureHexString=W.isHexString=W.prepend0x=W.strip0x=W.has0xPrefix=W.hexStringFromIntNumber=W.intNumberFromHexString=W.bigIntStringFromBN=W.hexStringFromBuffer=W.hexStringToUint8Array=W.uint8ArrayToHex=W.randomBytesHex=void 0;const r=e(pr()),n=wr(),t=_r(),c=/^[0-9]*$/,i=/^[a-f0-9]*$/;function a(T){return h(crypto.getRandomValues(new Uint8Array(T)))}W.randomBytesHex=a;function h(T){return[...T].map(M=>M.toString(16).padStart(2,"0")).join("")}W.uint8ArrayToHex=h;function l(T){return new Uint8Array(T.match(/.{1,2}/g).map(M=>parseInt(M,16)))}W.hexStringToUint8Array=l;function f(T,M=!1){const L=T.toString("hex");return(0,t.HexString)(M?`0x${L}`:L)}W.hexStringFromBuffer=f;function d(T){return(0,t.BigIntString)(T.toString(10))}W.bigIntStringFromBN=d;function o(T){return(0,t.IntNumber)(new r.default(y(T,!1),16).toNumber())}W.intNumberFromHexString=o;function u(T){return(0,t.HexString)(`0x${new r.default(T).toString(16)}`)}W.hexStringFromIntNumber=u;function s(T){return T.startsWith("0x")||T.startsWith("0X")}W.has0xPrefix=s;function p(T){return s(T)?T.slice(2):T}W.strip0x=p;function m(T){return s(T)?`0x${T.slice(2)}`:`0x${T}`}W.prepend0x=m;function b(T){if(typeof T!="string")return!1;const M=p(T).toLowerCase();return i.test(M)}W.isHexString=b;function g(T,M=!1){if(typeof T=="string"){const L=p(T).toLowerCase();if(i.test(L))return(0,t.HexString)(M?`0x${L}`:L)}throw n.standardErrors.rpc.invalidParams(`"${String(T)}" is not a hexadecimal string`)}W.ensureHexString=g;function y(T,M=!1){let L=g(T,!1);return L.length%2===1&&(L=(0,t.HexString)(`0${L}`)),M?(0,t.HexString)(`0x${L}`):L}W.ensureEvenLengthHexString=y;function w(T){if(typeof T=="string"){const M=p(T).toLowerCase();if(b(M)&&M.length===40)return(0,t.AddressString)(m(M))}throw n.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(T)}`)}W.ensureAddressString=w;function _(T){if(K.isBuffer(T))return T;if(typeof T=="string"){if(b(T)){const M=y(T,!1);return K.from(M,"hex")}return K.from(T,"utf8")}throw n.standardErrors.rpc.invalidParams(`Not binary data: ${String(T)}`)}W.ensureBuffer=_;function v(T){if(typeof T=="number"&&Number.isInteger(T))return(0,t.IntNumber)(T);if(typeof T=="string"){if(c.test(T))return(0,t.IntNumber)(Number(T));if(b(T))return(0,t.IntNumber)(new r.default(y(T,!1),16).toNumber())}throw n.standardErrors.rpc.invalidParams(`Not an integer: ${String(T)}`)}W.ensureIntNumber=v;function C(T){if(T instanceof RegExp)return(0,t.RegExpString)(T.toString());throw n.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(T)}`)}W.ensureRegExpString=C;function S(T){if(T!==null&&(r.default.isBN(T)||N(T)))return new r.default(T.toString(10),10);if(typeof T=="number")return new r.default(v(T));if(typeof T=="string"){if(c.test(T))return new r.default(T,10);if(b(T))return new r.default(y(T,!1),16)}throw n.standardErrors.rpc.invalidParams(`Not an integer: ${String(T)}`)}W.ensureBN=S;function I(T){if(typeof T=="string")return JSON.parse(T);if(typeof T=="object")return T;throw n.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(T)}`)}W.ensureParsedJSONObject=I;function N(T){if(T==null||typeof T.constructor!="function")return!1;const{constructor:M}=T;return typeof M.config=="function"&&typeof M.EUCLID=="number"}W.isBigNumber=N;function D(T,M){return Array.from({length:M-T},(L,x)=>T+x)}W.range=D;function $(){const T=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:M,host:L}=document.location,x=T?T.getAttribute("href"):null;return!x||x.startsWith("javascript:")||x.startsWith("vbscript:")?null:x.startsWith("http://")||x.startsWith("https://")||x.startsWith("data:")?x:x.startsWith("//")?M+x:`${M}//${L}${x}`}W.getFavicon=$;function z(T,M,L,x,j,V){const B=x?"parent-id":"id",q=new URLSearchParams({[B]:T,secret:M,server:L,v:j,chainId:V.toString()}).toString();return`${L}/#/link?${q}`}W.createQrUrl=z;function X(){try{return window.frameElement!==null}catch{return!1}}W.isInIFrame=X;function Y(){try{return X()&&window.top?window.top.location:window.location}catch{return window.location}}W.getLocation=Y;function J(){var T;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((T=window==null?void 0:window.navigator)===null||T===void 0?void 0:T.userAgent)}return W.isMobileWeb=J,W}var gt={},oo;function Jl(){if(oo)return gt;oo=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.ScopedLocalStorage=void 0;let e=class{constructor(n){this.scope=n}setItem(n,t){localStorage.setItem(this.scopedKey(n),t)}getItem(n){return localStorage.getItem(this.scopedKey(n))}removeItem(n){localStorage.removeItem(this.scopedKey(n))}clear(){const n=this.scopedKey(""),t=[];for(let c=0;c<localStorage.length;c++){const i=localStorage.key(c);typeof i=="string"&&i.startsWith(n)&&t.push(i)}t.forEach(c=>localStorage.removeItem(c))}scopedKey(n){return`${this.scope}:${n}`}};return gt.ScopedLocalStorage=e,gt}var Te={},pt={},mt={},bt={},ao;function Is(){return ao||(ao=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.EVENTS=void 0,bt.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"}),bt}var de={},co;function As(){if(co)return de;co=1,Object.defineProperty(de,"__esModule",{value:!0}),de.RelayAbstract=de.APP_VERSION_KEY=de.LOCAL_STORAGE_ADDRESSES_KEY=de.WALLET_USER_NAME_KEY=void 0;const e=wr();de.WALLET_USER_NAME_KEY="walletUsername",de.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",de.APP_VERSION_KEY="AppVersion";let r=class{async makeEthereumJSONRPCRequest(t,c){if(!c)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(c,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(i=>i.json()).then(i=>{if(!i)throw e.standardErrors.rpc.parse({});const a=i,{error:h}=a;if(h)throw(0,e.serializeError)(h,t.method);return a})}};return de.RelayAbstract=r,de}var yt={},uo;function Ts(){if(uo)return yt;uo=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.Session=void 0;const e=Nl(),r=Re(),n="session:id",t="session:secret",c="session:linked";let i=class zu{constructor(h,l,f,d){this._storage=h,this._id=l||(0,r.randomBytesHex)(16),this._secret=f||(0,r.randomBytesHex)(32),this._key=new e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!d}static load(h){const l=h.getItem(n),f=h.getItem(c),d=h.getItem(t);return l&&d?new zu(h,l,d,f==="1"):null}static hash(h){return new e.sha256().update(h).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(h){this._linked=h,this.persistLinked()}save(){return this._storage.setItem(n,this._id),this._storage.setItem(t,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(c,this._linked?"1":"0")}};return yt.Session=i,yt}var wt={},_t={},lo;function Gl(){if(lo)return _t;lo=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.Cipher=void 0;const e=Re();let r=class{constructor(t){this.secret=t}async encrypt(t){const c=this.secret;if(c.length!==64)throw Error("secret must be 256 bits");const i=crypto.getRandomValues(new Uint8Array(12)),a=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(c),{name:"aes-gcm"},!1,["encrypt","decrypt"]),h=new TextEncoder,l=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:i},a,h.encode(t)),f=16,d=l.slice(l.byteLength-f),o=l.slice(0,l.byteLength-f),u=new Uint8Array(d),s=new Uint8Array(o),p=new Uint8Array([...i,...u,...s]);return(0,e.uint8ArrayToHex)(p)}async decrypt(t){const c=this.secret;if(c.length!==64)throw Error("secret must be 256 bits");return new Promise((i,a)=>{(async function(){const h=await crypto.subtle.importKey("raw",(0,e.hexStringToUint8Array)(c),{name:"aes-gcm"},!1,["encrypt","decrypt"]),l=(0,e.hexStringToUint8Array)(t),f=l.slice(0,12),d=l.slice(12,28),o=l.slice(28),u=new Uint8Array([...o,...d]),s={name:"AES-GCM",iv:new Uint8Array(f)};try{const p=await window.crypto.subtle.decrypt(s,h,u),m=new TextDecoder;i(m.decode(p))}catch(p){a(p)}})()})}};return _t.Cipher=r,_t}var vt={},fo;function Zl(){if(fo)return vt;fo=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.WalletLinkHTTP=void 0;let e=class{constructor(n,t,c){this.linkAPIUrl=n,this.sessionId=t;const i=`${t}:${c}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(n){return Promise.all(n.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 n;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:c,error:i}=await t.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const a=(n=c==null?void 0:c.filter(h=>h.event==="Web3Response").map(h=>({type:"Event",sessionId:this.sessionId,eventId:h.id,event:h.event,data:h.data})))!==null&&n!==void 0?n:[];return this.markUnseenEventsAsSeen(a),a}throw new Error(`Check unseen events failed: ${t.status}`)}};return vt.WalletLinkHTTP=e,vt}var Me={},ho;function Kl(){if(ho)return Me;ho=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.WalletLinkWebSocket=Me.ConnectionState=void 0;var e;(function(n){n[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED"})(e||(Me.ConnectionState=e={}));let r=class{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,c=WebSocket){this.WebSocketClass=c,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,c)=>{var i;let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(h){c(h);return}(i=this.connectionStateListener)===null||i===void 0||i.call(this,e.CONNECTING),a.onclose=h=>{var l;this.clearWebSocket(),c(new Error(`websocket error ${h.code}: ${h.reason}`)),(l=this.connectionStateListener)===null||l===void 0||l.call(this,e.DISCONNECTED)},a.onopen=h=>{var l;t(),(l=this.connectionStateListener)===null||l===void 0||l.call(this,e.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(d=>this.sendData(d)),this.pendingData=[])},a.onmessage=h=>{var l,f;if(h.data==="h")(l=this.incomingDataListener)===null||l===void 0||l.call(this,{type:"Heartbeat"});else try{const d=JSON.parse(h.data);(f=this.incomingDataListener)===null||f===void 0||f.call(this,d)}catch{}}})}disconnect(){var t;const{webSocket:c}=this;if(c){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,e.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{c.close()}catch{}}}sendData(t){const{webSocket:c}=this;if(!c){this.pendingData.push(t),this.connect();return}c.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}};return Me.WalletLinkWebSocket=r,Me}var go;function Ql(){if(go)return wt;go=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.WalletLinkConnection=void 0;const e=_r(),r=Gl(),n=Is(),t=As(),c=Ts(),i=Zl(),a=Kl(),h=1e4,l=6e4;let f=class{constructor({session:o,linkAPIUrl:u,listener:s,diagnostic:p,WebSocketClass:m=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=g=>{if(!g)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",w=>g.JsonRpcUrl&&this.handleChainUpdated(w,g.JsonRpcUrl)]]).forEach((w,_)=>{const v=g[_];v!==void 0&&w(v)})},this.handleDestroyed=g=>{var y,w;g==="1"&&((y=this.listener)===null||y===void 0||y.resetAndReload(),(w=this.diagnostic)===null||w===void 0||w.log(n.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:c.Session.hash(this.session.id)}))},this.handleAccountUpdated=async g=>{var y,w;try{const _=await this.cipher.decrypt(g);(y=this.listener)===null||y===void 0||y.accountUpdated(_)}catch{(w=this.diagnostic)===null||w===void 0||w.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(g,y)=>{var w,_;try{const v=await this.cipher.decrypt(y);(w=this.listener)===null||w===void 0||w.metadataUpdated(g,v)}catch{(_=this.diagnostic)===null||_===void 0||_.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:g})}},this.handleWalletUsernameUpdated=async g=>{this.handleMetadataUpdated(t.WALLET_USER_NAME_KEY,g)},this.handleAppVersionUpdated=async g=>{this.handleMetadataUpdated(t.APP_VERSION_KEY,g)},this.handleChainUpdated=async(g,y)=>{var w,_;try{const v=await this.cipher.decrypt(g),C=await this.cipher.decrypt(y);(w=this.listener)===null||w===void 0||w.chainUpdated(v,C)}catch{(_=this.diagnostic)===null||_===void 0||_.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=o,this.cipher=new r.Cipher(o.secret),this.diagnostic=p,this.listener=s;const b=new a.WalletLinkWebSocket(`${u}/rpc`,m);b.setConnectionStateListener(async g=>{var y;(y=this.diagnostic)===null||y===void 0||y.log(n.EVENTS.CONNECTED_STATE_CHANGE,{state:g,sessionIdHash:c.Session.hash(o.id)});let w=!1;switch(g){case a.ConnectionState.DISCONNECTED:if(!this.destroyed){const _=async()=>{await new Promise(v=>setTimeout(v,5e3)),this.destroyed||b.connect().catch(()=>{_()})};_()}break;case a.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),w=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},h),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case a.ConnectionState.CONNECTING:break}this.connected!==w&&(this.connected=w)}),b.setIncomingDataListener(g=>{var y,w,_;switch(g.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const v=g.type==="IsLinkedOK"?g.linked:void 0;(y=this.diagnostic)===null||y===void 0||y.log(n.EVENTS.LINKED,{sessionIdHash:c.Session.hash(o.id),linked:v,type:g.type,onlineGuests:g.onlineGuests}),this.linked=v||g.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(w=this.diagnostic)===null||w===void 0||w.log(n.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:c.Session.hash(o.id),metadata_keys:g&&g.metadata?Object.keys(g.metadata):void 0}),this.handleSessionMetadataUpdated(g.metadata);break}case"Event":{this.handleIncomingEvent(g);break}}g.id!==void 0&&((_=this.requestResolutions.get(g.id))===null||_===void 0||_(g))}),this.ws=b,this.http=new i.WalletLinkHTTP(u,o.id,o.key)}connect(){var o;if(this.destroyed)throw new Error("instance is destroyed");(o=this.diagnostic)===null||o===void 0||o.log(n.EVENTS.STARTED_CONNECTING,{sessionIdHash:c.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var o;this.destroyed=!0,this.ws.disconnect(),(o=this.diagnostic)===null||o===void 0||o.log(n.EVENTS.DISCONNECTED,{sessionIdHash:c.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(o){var u,s;this._connected=o,o&&((u=this.onceConnected)===null||u===void 0||u.call(this)),(s=this.listener)===null||s===void 0||s.connectedUpdated(o)}setOnceConnected(o){return new Promise(u=>{this.connected?o().then(u):this.onceConnected=()=>{o().then(u),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(o){var u,s;this._linked=o,o&&((u=this.onceLinked)===null||u===void 0||u.call(this)),(s=this.listener)===null||s===void 0||s.linkedUpdated(o)}setOnceLinked(o){return new Promise(u=>{this.linked?o().then(u):this.onceLinked=()=>{o().then(u),this.onceLinked=void 0}})}async handleIncomingEvent(o){var u,s;if(!(o.type!=="Event"||o.event!=="Web3Response"))try{const p=await this.cipher.decrypt(o.data),m=JSON.parse(p);if(m.type!=="WEB3_RESPONSE")return;(u=this.listener)===null||u===void 0||u.handleWeb3ResponseMessage(m)}catch{(s=this.diagnostic)===null||s===void 0||s.log(n.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(o=>setTimeout(o,250));try{await this.fetchUnseenEventsAPI()}catch(o){console.error("Unable to check for unseen events",o)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(u=>this.handleIncomingEvent(u))}async setSessionMetadata(o,u){const s={type:"SetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[o]:u}};return this.setOnceConnected(async()=>{const p=await this.makeRequest(s);if(p.type==="Fail")throw new Error(p.error||"failed to set session metadata")})}async publishEvent(o,u,s=!1){const p=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},u),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),m={type:"PublishEvent",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:o,data:p,callWebhook:s};return this.setOnceLinked(async()=>{const b=await this.makeRequest(m);if(b.type==="Fail")throw new Error(b.error||"failed to publish event");return b.eventId})}sendData(o){this.ws.sendData(JSON.stringify(o))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>h*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(o,u=l){const s=o.id;this.sendData(o);let p;return Promise.race([new Promise((m,b)=>{p=window.setTimeout(()=>{b(new Error(`request ${s} timed out`))},u)}),new Promise(m=>{this.requestResolutions.set(s,b=>{clearTimeout(p),m(b),this.requestResolutions.delete(s)})})])}async authenticate(){const o={type:"HostSession",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},u=await this.makeRequest(o);if(u.type==="Fail")throw new Error(u.error||"failed to authentcate")}sendIsLinked(){const o={type:"IsLinked",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(o)}sendGetSessionConfig(){const o={type:"GetSessionConfig",id:(0,e.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(o)}};return wt.WalletLinkConnection=f,wt}var Et={},Le={},Yt={},po;function Yl(){return po||(po=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.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}'),Yt}var mo;function Ju(){if(mo)return Le;mo=1;var e=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0}),Le.injectCssReset=void 0;const r=e(Yl());function n(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(r.default)),document.documentElement.appendChild(t)}return Le.injectCssReset=n,Le}var Rt={};const ce=Ut(xl);var Pe={};const Vt=Ut(Dl),vr=Ut(jl);var ve={},St={},bo;function Xl(){if(bo)return St;bo=1,Object.defineProperty(St,"__esModule",{value:!0}),St.CloseIcon=void 0;const e=ce;function r(n){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"},n),(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 St.CloseIcon=r,St}var Ct={},yo;function ed(){if(yo)return Ct;yo=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.CoinbaseWalletRound=void 0;const e=ce;function r(n){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"},n),(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 Ct.CoinbaseWalletRound=r,Ct}var kt={},wo;function td(){if(wo)return kt;wo=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.QRCodeIcon=void 0;const e=ce;function r(n){return(0,e.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},n),(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 kt.QRCodeIcon=r,kt}var Ne={},In,_o;function rd(){if(_o)return In;_o=1;function e(s){this.mode=n.MODE_8BIT_BYTE,this.data=s,this.parsedData=[];for(var p=0,m=this.data.length;p<m;p++){var b=[],g=this.data.charCodeAt(p);g>65536?(b[0]=240|(g&1835008)>>>18,b[1]=128|(g&258048)>>>12,b[2]=128|(g&4032)>>>6,b[3]=128|g&63):g>2048?(b[0]=224|(g&61440)>>>12,b[1]=128|(g&4032)>>>6,b[2]=128|g&63):g>128?(b[0]=192|(g&1984)>>>6,b[1]=128|g&63):b[0]=g,this.parsedData.push(b)}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(s){return this.parsedData.length},write:function(s){for(var p=0,m=this.parsedData.length;p<m;p++)s.put(this.parsedData[p],8)}};function r(s,p){this.typeNumber=s,this.errorCorrectLevel=p,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}r.prototype={addData:function(s){var p=new e(s);this.dataList.push(p),this.dataCache=null},isDark:function(s,p){if(s<0||this.moduleCount<=s||p<0||this.moduleCount<=p)throw new Error(s+","+p);return this.modules[s][p]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(s,p){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var m=0;m<this.moduleCount;m++){this.modules[m]=new Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[m][b]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(s,p),this.typeNumber>=7&&this.setupTypeNumber(s),this.dataCache==null&&(this.dataCache=r.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,p)},setupPositionProbePattern:function(s,p){for(var m=-1;m<=7;m++)if(!(s+m<=-1||this.moduleCount<=s+m))for(var b=-1;b<=7;b++)p+b<=-1||this.moduleCount<=p+b||(0<=m&&m<=6&&(b==0||b==6)||0<=b&&b<=6&&(m==0||m==6)||2<=m&&m<=4&&2<=b&&b<=4?this.modules[s+m][p+b]=!0:this.modules[s+m][p+b]=!1)},getBestMaskPattern:function(){for(var s=0,p=0,m=0;m<8;m++){this.makeImpl(!0,m);var b=i.getLostPoint(this);(m==0||s>b)&&(s=b,p=m)}return p},createMovieClip:function(s,p,m){var b=s.createEmptyMovieClip(p,m),g=1;this.make();for(var y=0;y<this.modules.length;y++)for(var w=y*g,_=0;_<this.modules[y].length;_++){var v=_*g,C=this.modules[y][_];C&&(b.beginFill(0,100),b.moveTo(v,w),b.lineTo(v+g,w),b.lineTo(v+g,w+g),b.lineTo(v,w+g),b.endFill())}return b},setupTimingPattern:function(){for(var s=8;s<this.moduleCount-8;s++)this.modules[s][6]==null&&(this.modules[s][6]=s%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 s=i.getPatternPosition(this.typeNumber),p=0;p<s.length;p++)for(var m=0;m<s.length;m++){var b=s[p],g=s[m];if(this.modules[b][g]==null)for(var y=-2;y<=2;y++)for(var w=-2;w<=2;w++)y==-2||y==2||w==-2||w==2||y==0&&w==0?this.modules[b+y][g+w]=!0:this.modules[b+y][g+w]=!1}},setupTypeNumber:function(s){for(var p=i.getBCHTypeNumber(this.typeNumber),m=0;m<18;m++){var b=!s&&(p>>m&1)==1;this.modules[Math.floor(m/3)][m%3+this.moduleCount-8-3]=b}for(var m=0;m<18;m++){var b=!s&&(p>>m&1)==1;this.modules[m%3+this.moduleCount-8-3][Math.floor(m/3)]=b}},setupTypeInfo:function(s,p){for(var m=this.errorCorrectLevel<<3|p,b=i.getBCHTypeInfo(m),g=0;g<15;g++){var y=!s&&(b>>g&1)==1;g<6?this.modules[g][8]=y:g<8?this.modules[g+1][8]=y:this.modules[this.moduleCount-15+g][8]=y}for(var g=0;g<15;g++){var y=!s&&(b>>g&1)==1;g<8?this.modules[8][this.moduleCount-g-1]=y:g<9?this.modules[8][15-g-1+1]=y:this.modules[8][15-g-1]=y}this.modules[this.moduleCount-8][8]=!s},mapData:function(s,p){for(var m=-1,b=this.moduleCount-1,g=7,y=0,w=this.moduleCount-1;w>0;w-=2)for(w==6&&w--;;){for(var _=0;_<2;_++)if(this.modules[b][w-_]==null){var v=!1;y<s.length&&(v=(s[y]>>>g&1)==1);var C=i.getMask(p,b,w-_);C&&(v=!v),this.modules[b][w-_]=v,g--,g==-1&&(y++,g=7)}if(b+=m,b<0||this.moduleCount<=b){b-=m,m=-m;break}}}},r.PAD0=236,r.PAD1=17,r.createData=function(s,p,m){for(var b=f.getRSBlocks(s,p),g=new d,y=0;y<m.length;y++){var w=m[y];g.put(w.mode,4),g.put(w.getLength(),i.getLengthInBits(w.mode,s)),w.write(g)}for(var _=0,y=0;y<b.length;y++)_+=b[y].dataCount;if(g.getLengthInBits()>_*8)throw new Error("code length overflow. ("+g.getLengthInBits()+">"+_*8+")");for(g.getLengthInBits()+4<=_*8&&g.put(0,4);g.getLengthInBits()%8!=0;)g.putBit(!1);for(;!(g.getLengthInBits()>=_*8||(g.put(r.PAD0,8),g.getLengthInBits()>=_*8));)g.put(r.PAD1,8);return r.createBytes(g,b)},r.createBytes=function(s,p){for(var m=0,b=0,g=0,y=new Array(p.length),w=new Array(p.length),_=0;_<p.length;_++){var v=p[_].dataCount,C=p[_].totalCount-v;b=Math.max(b,v),g=Math.max(g,C),y[_]=new Array(v);for(var S=0;S<y[_].length;S++)y[_][S]=255&s.buffer[S+m];m+=v;var I=i.getErrorCorrectPolynomial(C),N=new l(y[_],I.getLength()-1),D=N.mod(I);w[_]=new Array(I.getLength()-1);for(var S=0;S<w[_].length;S++){var $=S+D.getLength()-w[_].length;w[_][S]=$>=0?D.get($):0}}for(var z=0,S=0;S<p.length;S++)z+=p[S].totalCount;for(var X=new Array(z),Y=0,S=0;S<b;S++)for(var _=0;_<p.length;_++)S<y[_].length&&(X[Y++]=y[_][S]);for(var S=0;S<g;S++)for(var _=0;_<p.length;_++)S<w[_].length&&(X[Y++]=w[_][S]);return X};for(var n={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},c={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},i={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(s){for(var p=s<<10;i.getBCHDigit(p)-i.getBCHDigit(i.G15)>=0;)p^=i.G15<<i.getBCHDigit(p)-i.getBCHDigit(i.G15);return(s<<10|p)^i.G15_MASK},getBCHTypeNumber:function(s){for(var p=s<<12;i.getBCHDigit(p)-i.getBCHDigit(i.G18)>=0;)p^=i.G18<<i.getBCHDigit(p)-i.getBCHDigit(i.G18);return s<<12|p},getBCHDigit:function(s){for(var p=0;s!=0;)p++,s>>>=1;return p},getPatternPosition:function(s){return i.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,p,m){switch(s){case c.PATTERN000:return(p+m)%2==0;case c.PATTERN001:return p%2==0;case c.PATTERN010:return m%3==0;case c.PATTERN011:return(p+m)%3==0;case c.PATTERN100:return(Math.floor(p/2)+Math.floor(m/3))%2==0;case c.PATTERN101:return p*m%2+p*m%3==0;case c.PATTERN110:return(p*m%2+p*m%3)%2==0;case c.PATTERN111:return(p*m%3+(p+m)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){for(var p=new l([1],0),m=0;m<s;m++)p=p.multiply(new l([1,a.gexp(m)],0));return p},getLengthInBits:function(s,p){if(1<=p&&p<10)switch(s){case n.MODE_NUMBER:return 10;case n.MODE_ALPHA_NUM:return 9;case n.MODE_8BIT_BYTE:return 8;case n.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(p<27)switch(s){case n.MODE_NUMBER:return 12;case n.MODE_ALPHA_NUM:return 11;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(p<41)switch(s){case n.MODE_NUMBER:return 14;case n.MODE_ALPHA_NUM:return 13;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+p)},getLostPoint:function(s){for(var p=s.getModuleCount(),m=0,b=0;b<p;b++)for(var g=0;g<p;g++){for(var y=0,w=s.isDark(b,g),_=-1;_<=1;_++)if(!(b+_<0||p<=b+_))for(var v=-1;v<=1;v++)g+v<0||p<=g+v||_==0&&v==0||w==s.isDark(b+_,g+v)&&y++;y>5&&(m+=3+y-5)}for(var b=0;b<p-1;b++)for(var g=0;g<p-1;g++){var C=0;s.isDark(b,g)&&C++,s.isDark(b+1,g)&&C++,s.isDark(b,g+1)&&C++,s.isDark(b+1,g+1)&&C++,(C==0||C==4)&&(m+=3)}for(var b=0;b<p;b++)for(var g=0;g<p-6;g++)s.isDark(b,g)&&!s.isDark(b,g+1)&&s.isDark(b,g+2)&&s.isDark(b,g+3)&&s.isDark(b,g+4)&&!s.isDark(b,g+5)&&s.isDark(b,g+6)&&(m+=40);for(var g=0;g<p;g++)for(var b=0;b<p-6;b++)s.isDark(b,g)&&!s.isDark(b+1,g)&&s.isDark(b+2,g)&&s.isDark(b+3,g)&&s.isDark(b+4,g)&&!s.isDark(b+5,g)&&s.isDark(b+6,g)&&(m+=40);for(var S=0,g=0;g<p;g++)for(var b=0;b<p;b++)s.isDark(b,g)&&S++;var I=Math.abs(100*S/p/p-50)/5;return m+=I*10,m}},a={glog:function(s){if(s<1)throw new Error("glog("+s+")");return a.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return a.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},h=0;h<8;h++)a.EXP_TABLE[h]=1<<h;for(var h=8;h<256;h++)a.EXP_TABLE[h]=a.EXP_TABLE[h-4]^a.EXP_TABLE[h-5]^a.EXP_TABLE[h-6]^a.EXP_TABLE[h-8];for(var h=0;h<255;h++)a.LOG_TABLE[a.EXP_TABLE[h]]=h;function l(s,p){if(s.length==null)throw new Error(s.length+"/"+p);for(var m=0;m<s.length&&s[m]==0;)m++;this.num=new Array(s.length-m+p);for(var b=0;b<s.length-m;b++)this.num[b]=s[b+m]}l.prototype={get:function(s){return this.num[s]},getLength:function(){return this.num.length},multiply:function(s){for(var p=new Array(this.getLength()+s.getLength()-1),m=0;m<this.getLength();m++)for(var b=0;b<s.getLength();b++)p[m+b]^=a.gexp(a.glog(this.get(m))+a.glog(s.get(b)));return new l(p,0)},mod:function(s){if(this.getLength()-s.getLength()<0)return this;for(var p=a.glog(this.get(0))-a.glog(s.get(0)),m=new Array(this.getLength()),b=0;b<this.getLength();b++)m[b]=this.get(b);for(var b=0;b<s.getLength();b++)m[b]^=a.gexp(a.glog(s.get(b))+p);return new l(m,0).mod(s)}};function f(s,p){this.totalCount=s,this.dataCount=p}f.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]],f.getRSBlocks=function(s,p){var m=f.getRsBlockTable(s,p);if(m==null)throw new Error("bad rs block @ typeNumber:"+s+"/errorCorrectLevel:"+p);for(var b=m.length/3,g=[],y=0;y<b;y++)for(var w=m[y*3+0],_=m[y*3+1],v=m[y*3+2],C=0;C<w;C++)g.push(new f(_,v));return g},f.getRsBlockTable=function(s,p){switch(p){case t.L:return f.RS_BLOCK_TABLE[(s-1)*4+0];case t.M:return f.RS_BLOCK_TABLE[(s-1)*4+1];case t.Q:return f.RS_BLOCK_TABLE[(s-1)*4+2];case t.H:return f.RS_BLOCK_TABLE[(s-1)*4+3];default:return}};function d(){this.buffer=[],this.length=0}d.prototype={get:function(s){var p=Math.floor(s/8);return(this.buffer[p]>>>7-s%8&1)==1},put:function(s,p){for(var m=0;m<p;m++)this.putBit((s>>>p-m-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(s){var p=Math.floor(this.length/8);this.buffer.length<=p&&this.buffer.push(0),s&&(this.buffer[p]|=128>>>this.length%8),this.length++}};var o=[[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(s){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof s=="string"&&(s={content:s}),s)for(var p in s)this.options[p]=s[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 m(v){switch(v){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: "+v)}}function b(v,C){for(var S=g(v),I=1,N=0,D=0,$=o.length;D<=$;D++){var z=o[D];if(!z)throw new Error("Content too long: expected "+N+" but got "+S);switch(C){case"L":N=z[0];break;case"M":N=z[1];break;case"Q":N=z[2];break;case"H":N=z[3];break;default:throw new Error("Unknwon error correction level: "+C)}if(S<=N)break;I++}if(I>o.length)throw new Error("Content too long");return I}function g(v){var C=encodeURI(v).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return C.length+(C.length!=v?3:0)}var y=this.options.content,w=b(y,this.options.ecl),_=m(this.options.ecl);this.qrcode=new r(w,_),this.qrcode.addData(y),this.qrcode.make()}return u.prototype.svg=function(s){var p=this.options||{},m=this.qrcode.modules;typeof s>"u"&&(s={container:p.container||"svg"});for(var b=typeof p.pretty<"u"?!!p.pretty:!0,g=b?" ":"",y=b?`\r
2
- `:"",w=p.width,_=p.height,v=m.length,C=w/(v+2*p.padding),S=_/(v+2*p.padding),I=typeof p.join<"u"?!!p.join:!1,N=typeof p.swap<"u"?!!p.swap:!1,D=typeof p.xmlDeclaration<"u"?!!p.xmlDeclaration:!0,$=typeof p.predefined<"u"?!!p.predefined:!1,z=$?g+'<defs><path id="qrmodule" d="M0 0 h'+S+" v"+C+' H0 z" style="fill:'+p.color+';shape-rendering:crispEdges;" /></defs>'+y:"",X=g+'<rect x="0" y="0" width="'+w+'" height="'+_+'" style="fill:'+p.background+';shape-rendering:crispEdges;"/>'+y,Y="",J="",T=0;T<v;T++)for(var M=0;M<v;M++){var L=m[M][T];if(L){var x=M*C+p.padding*C,j=T*S+p.padding*S;if(N){var V=x;x=j,j=V}if(I){var B=C+x,q=S+j;x=Number.isInteger(x)?Number(x):x.toFixed(2),j=Number.isInteger(j)?Number(j):j.toFixed(2),B=Number.isInteger(B)?Number(B):B.toFixed(2),q=Number.isInteger(q)?Number(q):q.toFixed(2),J+="M"+x+","+j+" V"+q+" H"+B+" V"+j+" H"+x+" Z "}else $?Y+=g+'<use x="'+x.toString()+'" y="'+j.toString()+'" href="#qrmodule" />'+y:Y+=g+'<rect x="'+x.toString()+'" y="'+j.toString()+'" width="'+C+'" height="'+S+'" style="fill:'+p.color+';shape-rendering:crispEdges;"/>'+y}}I&&(Y=g+'<path x="0" y="0" style="fill:'+p.color+';shape-rendering:crispEdges;" d="'+J+'" />');let G="";if(this.options.image!==void 0&&this.options.image.svg){const k=w*this.options.image.width/100,A=_*this.options.image.height/100,P=w/2-k/2,U=_/2-A/2;G+=`<svg x="${P}" y="${U}" width="${k}" height="${A}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,G+=this.options.image.svg+y,G+="</svg>"}var H="";switch(s.container){case"svg":D&&(H+='<?xml version="1.0" standalone="yes"?>'+y),H+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+w+'" height="'+_+'">'+y,H+=z+X+Y,H+=G,H+="</svg>";break;case"svg-viewbox":D&&(H+='<?xml version="1.0" standalone="yes"?>'+y),H+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+w+" "+_+'">'+y,H+=z+X+Y,H+=G,H+="</svg>";break;case"g":H+='<g width="'+w+'" height="'+_+'">'+y,H+=z+X+Y,H+=G,H+="</g>";break;default:H+=(z+X+Y+G).replace(/^\s+/,"");break}return H},In=u,In}var vo;function nd(){if(vo)return Ne;vo=1;var e=Ne&&Ne.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.QRCode=void 0;const r=ce,n=vr,t=e(rd()),c=i=>{const[a,h]=(0,n.useState)("");return(0,n.useEffect)(()=>{var l,f;const d=new t.default({content:i.content,background:i.bgColor||"#ffffff",color:i.fgColor||"#000000",container:"svg",ecl:"M",width:(l=i.width)!==null&&l!==void 0?l:256,height:(f=i.height)!==null&&f!==void 0?f:256,padding:0,image:i.image}),o=K.from(d.svg(),"utf8").toString("base64");h(`data:image/svg+xml;base64,${o}`)},[i.bgColor,i.content,i.fgColor,i.height,i.image,i.width]),a?(0,r.h)("img",{src:a,alt:"QR Code"}):null};return Ne.QRCode=c,Ne}var Oe={},Xt={},Eo;function id(){return Eo||(Eo=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.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)}}"),Xt}var Ro;function sd(){if(Ro)return Oe;Ro=1;var e=Oe&&Oe.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.Spinner=void 0;const r=ce,n=e(id()),t=c=>{var i;const a=(i=c.size)!==null&&i!==void 0?i:64,h=c.color||"#000";return(0,r.h)("div",{class:"-cbwsdk-spinner"},(0,r.h)("style",null,n.default),(0,r.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:a,height:a}},(0,r.h)("circle",{style:{cx:50,cy:50,r:45,stroke:h}})))};return Oe.Spinner=t,Oe}var er={},So;function od(){return So||(So=1,Object.defineProperty(er,"__esModule",{value:!0}),er.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}"),er}var Co;function ad(){if(Co)return ve;Co=1;var e=ve&&ve.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(ve,"__esModule",{value:!0}),ve.CoinbaseWalletSteps=ve.ConnectContent=void 0;const r=e(Vt),n=ce,t=Re(),c=ks(),i=Xl(),a=ed(),h=td(),l=nd(),f=sd(),d=e(od()),o={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:m},u=b=>b==="light"?"#FFFFFF":"#0A0B0D";function s(b){const{theme:g}=b,y=(0,t.createQrUrl)(b.sessionId,b.sessionSecret,b.linkAPIUrl,b.isParentConnection,b.version,b.chainId),w=o.steps;return(0,n.h)("div",{"data-testid":"connect-content",className:(0,r.default)("-cbwsdk-connect-content",g)},(0,n.h)("style",null,d.default),(0,n.h)("div",{className:"-cbwsdk-connect-content-header"},(0,n.h)("h2",{className:(0,r.default)("-cbwsdk-connect-content-heading",g)},"Scan to connect with our mobile app"),b.onCancel&&(0,n.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:b.onCancel},(0,n.h)(i.CloseIcon,{fill:g==="light"?"#0A0B0D":"#FFFFFF"}))),(0,n.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,n.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,n.h)(p,{title:o.title,description:o.description,theme:g})),(0,n.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,n.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,n.h)(l.QRCode,{content:y,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,n.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:c.LIB_VERSION}),(0,n.h)("input",{type:"hidden",value:y})),(0,n.h)(w,{theme:g}),!b.isConnected&&(0,n.h)("div",{"data-testid":"connecting-spinner",className:(0,r.default)("-cbwsdk-connect-content-qr-connecting",g)},(0,n.h)(f.Spinner,{size:36,color:g==="dark"?"#FFF":"#000"}),(0,n.h)("p",null,"Connecting...")))))}ve.ConnectContent=s;function p({title:b,description:g,theme:y}){return(0,n.h)("div",{className:(0,r.default)("-cbwsdk-connect-item",y)},(0,n.h)("div",null,(0,n.h)(a.CoinbaseWalletRound,null)),(0,n.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,n.h)("h3",{className:"-cbwsdk-connect-item-title"},b),(0,n.h)("p",{className:"-cbwsdk-connect-item-description"},g)))}function m({theme:b}){return(0,n.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,n.h)("li",{className:(0,r.default)("-cbwsdk-wallet-steps-item",b)},(0,n.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,n.h)("li",{className:(0,r.default)("-cbwsdk-wallet-steps-item",b)},(0,n.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,n.h)("span",null,"Tap ",(0,n.h)("strong",null,"Scan")," "),(0,n.h)("span",{className:(0,r.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",b)},(0,n.h)(h.QRCodeIcon,{fill:u(b)})))))}return ve.CoinbaseWalletSteps=m,ve}var xe={},It={},ko;function cd(){if(ko)return It;ko=1,Object.defineProperty(It,"__esModule",{value:!0}),It.ArrowLeftIcon=void 0;const e=ce;function r(n){return(0,e.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},n),(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 It.ArrowLeftIcon=r,It}var At={},Io;function ud(){if(Io)return At;Io=1,Object.defineProperty(At,"__esModule",{value:!0}),At.LaptopIcon=void 0;const e=ce;function r(n){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},n),(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 At.LaptopIcon=r,At}var Tt={},Ao;function ld(){if(Ao)return Tt;Ao=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.SafeIcon=void 0;const e=ce;function r(n){return(0,e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},n),(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 Tt.SafeIcon=r,Tt}var tr={},To;function dd(){return To||(To=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.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}"),tr}var Mo;function fd(){if(Mo)return xe;Mo=1;var e=xe&&xe.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(xe,"__esModule",{value:!0}),xe.TryExtensionContent=void 0;const r=e(Vt),n=ce,t=vr,c=cd(),i=ud(),a=ld(),h=e(dd());function l({theme:f}){const[d,o]=(0,t.useState)(!1),u=(0,t.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,t.useCallback)(()=>{d?window.location.reload():(u(),o(!0))},[u,d]);return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-try-extension",f)},(0,n.h)("style",null,h.default),(0,n.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,n.h)("h3",{class:(0,r.default)("-cbwsdk-try-extension-heading",f)},"Or try the Coinbase Wallet browser extension"),(0,n.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,n.h)("button",{class:(0,r.default)("-cbwsdk-try-extension-cta",f),onClick:s},d?"Refresh":"Install"),(0,n.h)("div",null,!d&&(0,n.h)(c.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:f==="light"?"#0052FF":"#588AF5"})))),(0,n.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,n.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,n.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,n.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,n.h)("span",{class:(0,r.default)("-cbwsdk-try-extension-list-item-icon",f)},(0,n.h)(i.LaptopIcon,{fill:f==="light"?"#0A0B0D":"#FFFFFF"}))),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-try-extension-list-item-copy",f)},"Connect with dapps with just one click on your desktop browser")),(0,n.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,n.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,n.h)("span",{class:(0,r.default)("-cbwsdk-try-extension-list-item-icon",f)},(0,n.h)(a.SafeIcon,{fill:f==="light"?"#0A0B0D":"#FFFFFF"}))),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-try-extension-list-item-copy",f)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}return xe.TryExtensionContent=l,xe}var rr={},Lo;function hd(){return Lo||(Lo=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.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}"),rr}var Po;function gd(){if(Po)return Pe;Po=1;var e=Pe&&Pe.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.ConnectDialog=void 0;const r=e(Vt),n=ce,t=vr,c=ad(),i=fd(),a=e(hd()),h=l=>{const{isOpen:f,darkMode:d}=l,[o,u]=(0,t.useState)(!f),[s,p]=(0,t.useState)(!f);(0,t.useEffect)(()=>{const b=[window.setTimeout(()=>{p(!f)},10)];return f?u(!1):b.push(window.setTimeout(()=>{u(!0)},360)),()=>{b.forEach(window.clearTimeout)}},[f]);const m=d?"dark":"light";return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-container",o&&"-cbwsdk-connect-dialog-container-hidden")},(0,n.h)("style",null,a.default),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-backdrop",m,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,n.h)("div",{class:"-cbwsdk-connect-dialog"},(0,n.h)("div",{class:(0,r.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},l.connectDisabled?null:(0,n.h)(c.ConnectContent,{theme:m,version:l.version,sessionId:l.sessionId,sessionSecret:l.sessionSecret,linkAPIUrl:l.linkAPIUrl,isConnected:l.isConnected,isParentConnection:l.isParentConnection,chainId:l.chainId,onCancel:l.onCancel}),(0,n.h)(i.TryExtensionContent,{theme:m}))))};return Pe.ConnectDialog=h,Pe}var No;function pd(){if(No)return Rt;No=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.LinkFlow=void 0;const e=ce,r=gd();let n=class{constructor(c){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=c.darkMode,this.version=c.version,this.sessionId=c.sessionId,this.sessionSecret=c.sessionSecret,this.linkAPIUrl=c.linkAPIUrl,this.isParentConnection=c.isParentConnection}attach(c){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",c.appendChild(this.root),this.render()}setConnected(c){this.connected!==c&&(this.connected=c,this.render())}setChainId(c){this.chainId!==c&&(this.chainId=c,this.render())}detach(){var c;this.root&&((0,e.render)(null,this.root),(c=this.root.parentElement)===null||c===void 0||c.removeChild(this.root))}setConnectDisabled(c){this.connectDisabled=c}open(c){this.isOpen=!0,this.onCancel=c.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,e.render)((0,e.h)(r.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 Rt.LinkFlow=n,Rt}var Mt={},nr={},Oo;function md(){return Oo||(Oo=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.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}"),nr}var xo;function Gu(){return xo||(xo=1,(function(e){var r=Mt&&Mt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const n=r(Vt),t=ce,c=vr,i=r(md()),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",h="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class l{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 s=this.nextItemKey++;return this.items.set(s,u),this.render(),()=>{this.items.delete(s),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,s])=>(0,t.h)(e.SnackbarInstance,Object.assign({},s,{key:u}))))),this.root)}}e.Snackbar=l;const f=o=>(0,t.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,t.h)("style",null,i.default),(0,t.h)("div",{class:"-cbwsdk-snackbar"},o.children));e.SnackbarContainer=f;const d=({autoExpand:o,message:u,menuItems:s})=>{const[p,m]=(0,c.useState)(!0),[b,g]=(0,c.useState)(o??!1);(0,c.useEffect)(()=>{const w=[window.setTimeout(()=>{m(!1)},1),window.setTimeout(()=>{g(!0)},1e4)];return()=>{w.forEach(window.clearTimeout)}});const y=()=>{g(!b)};return(0,t.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",p&&"-cbwsdk-snackbar-instance-hidden",b&&"-cbwsdk-snackbar-instance-expanded")},(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:y},(0,t.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},u),(0,t.h)("div",{class:"-gear-container"},!b&&(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:h,class:"-gear-icon",title:"Expand"}))),s&&s.length>0&&(0,t.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},s.map((w,_)=>(0,t.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",w.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:w.onClick,key:_},(0,t.h)("svg",{width:w.svgWidth,height:w.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.h)("path",{"fill-rule":w.defaultFillRule,"clip-rule":w.defaultClipRule,d:w.path,fill:"#AAAAAA"})),(0,t.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",w.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},w.info)))))};e.SnackbarInstance=d})(Mt)),Mt}var Do;function Zu(){if(Do)return Et;Do=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.WalletLinkRelayUI=void 0;const e=Ju(),r=pd(),n=Gu();let t=class{constructor(i){this.standalone=null,this.attached=!1,this.snackbar=new n.Snackbar({darkMode:i.darkMode}),this.linkFlow=new r.LinkFlow({darkMode:i.darkMode,version:i.version,sessionId:i.session.id,sessionSecret:i.session.secret,linkAPIUrl:i.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const i=document.documentElement,a=document.createElement("div");a.className="-cbwsdk-css-reset",i.appendChild(a),this.linkFlow.attach(a),this.snackbar.attach(a),this.attached=!0,(0,e.injectCssReset)()}setConnected(i){this.linkFlow.setConnected(i)}setChainId(i){this.linkFlow.setChainId(i)}setConnectDisabled(i){this.linkFlow.setConnectDisabled(i)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(i){this.linkFlow.open({onCancel:i.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(i){let a;return i.isUnlinkedErrorState?a={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:i.onResetConnection}]}:a={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:i.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:i.onResetConnection}]},this.snackbar.presentItem(a)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(i){this.standalone=i}isStandalone(){var i;return(i=this.standalone)!==null&&i!==void 0?i:!1}};return Et.WalletLinkRelayUI=t,Et}var jo;function Ku(){if(jo)return mt;jo=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.WalletLinkRelay=void 0;const e=wr(),r=_r(),n=Re(),t=Is(),c=As(),i=Ts(),a=Ql(),h=Cs(),l=Zu();let f=class Ge extends c.RelayAbstract{constructor(o){var u;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=b=>{var g;this.isLinked=b;const y=this.storage.getItem(c.LOCAL_STORAGE_ADDRESSES_KEY);if(b&&(this.session.linked=b),this.isUnlinkedErrorState=!1,y){const w=y.split(" "),_=this.storage.getItem("IsStandaloneSigning")==="true";if(w[0]!==""&&!b&&this.session.linked&&!_){this.isUnlinkedErrorState=!0;const v=this.getSessionIdHash();(g=this.diagnostic)===null||g===void 0||g.log(t.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:v})}}},this.metadataUpdated=(b,g)=>{this.storage.setItem(b,g)},this.chainUpdated=(b,g)=>{this.chainCallbackParams.chainId===b&&this.chainCallbackParams.jsonRpcUrl===g||(this.chainCallbackParams={chainId:b,jsonRpcUrl:g},this.chainCallback&&this.chainCallback(b,g))},this.accountUpdated=b=>{this.accountsCallback&&this.accountsCallback([b]),Ge.accountRequestCallbackIds.size>0&&(Array.from(Ge.accountRequestCallbackIds.values()).forEach(g=>{const y={type:"WEB3_RESPONSE",id:g,response:{method:"requestEthereumAccounts",result:[b]}};this.invokeCallback(Object.assign(Object.assign({},y),{id:g}))}),Ge.accountRequestCallbackIds.clear())},this.connectedUpdated=b=>{this.ui.setConnected(b)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=o.linkAPIUrl,this.storage=o.storage,this.options=o;const{session:s,ui:p,connection:m}=this.subscribe();this._session=s,this.connection=m,this.relayEventManager=o.relayEventManager,this.diagnostic=o.diagnosticLogger,this._reloadOnDisconnect=(u=o.reloadOnDisconnect)!==null&&u!==void 0?u:!0,this.ui=p}subscribe(){const o=i.Session.load(this.storage)||new i.Session(this.storage).save(),{linkAPIUrl:u,diagnostic:s}=this,p=new a.WalletLinkConnection({session:o,linkAPIUrl:u,diagnostic:s,listener:this}),{version:m,darkMode:b}=this.options,g=this.options.uiConstructor({linkAPIUrl:u,version:m,darkMode:b,session:o});return p.connect(),{session:o,ui:g,connection:p}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(o=>setTimeout(()=>o(null),1e3))]).then(()=>{var o,u;const s=this.ui.isStandalone();(o=this.diagnostic)===null||o===void 0||o.log(t.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const p=i.Session.load(this.storage);if((p==null?void 0: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:i.Session.hash(p.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:m,ui:b,connection:g}=this.subscribe();this._session=m,this.connection=g,this.ui=b,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(o=>{var u;(u=this.diagnostic)===null||u===void 0||u.log(t.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${o}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(o,u){this.appName=o,this.appLogoUrl=u}getStorageItem(o){return this.storage.getItem(o)}get session(){return this._session}setStorageItem(o,u){this.storage.setItem(o,u)}signEthereumMessage(o,u,s,p){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,n.hexStringFromBuffer)(o,!0),address:u,addPrefix:s,typedDataJson:p||null}})}ethereumAddressFromSignedMessage(o,u,s){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,n.hexStringFromBuffer)(o,!0),signature:(0,n.hexStringFromBuffer)(u,!0),addPrefix:s}})}signEthereumTransaction(o){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:o.fromAddress,toAddress:o.toAddress,weiValue:(0,n.bigIntStringFromBN)(o.weiValue),data:(0,n.hexStringFromBuffer)(o.data,!0),nonce:o.nonce,gasPriceInWei:o.gasPriceInWei?(0,n.bigIntStringFromBN)(o.gasPriceInWei):null,maxFeePerGas:o.gasPriceInWei?(0,n.bigIntStringFromBN)(o.gasPriceInWei):null,maxPriorityFeePerGas:o.gasPriceInWei?(0,n.bigIntStringFromBN)(o.gasPriceInWei):null,gasLimit:o.gasLimit?(0,n.bigIntStringFromBN)(o.gasLimit):null,chainId:o.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(o){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:o.fromAddress,toAddress:o.toAddress,weiValue:(0,n.bigIntStringFromBN)(o.weiValue),data:(0,n.hexStringFromBuffer)(o.data,!0),nonce:o.nonce,gasPriceInWei:o.gasPriceInWei?(0,n.bigIntStringFromBN)(o.gasPriceInWei):null,maxFeePerGas:o.maxFeePerGas?(0,n.bigIntStringFromBN)(o.maxFeePerGas):null,maxPriorityFeePerGas:o.maxPriorityFeePerGas?(0,n.bigIntStringFromBN)(o.maxPriorityFeePerGas):null,gasLimit:o.gasLimit?(0,n.bigIntStringFromBN)(o.gasLimit):null,chainId:o.chainId,shouldSubmit:!0}})}submitEthereumTransaction(o,u){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,n.hexStringFromBuffer)(o,!0),chainId:u}})}scanQRCode(o){return this.sendRequest({method:"scanQRCode",params:{regExp:o}})}getQRCodeUrl(){return(0,n.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(o,u){return this.sendRequest({method:"generic",params:{action:u,data:o}})}sendGenericMessage(o){return this.sendRequest(o)}sendRequest(o){let u=null;const s=(0,n.randomBytesHex)(8),p=b=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,o.method,b),u==null||u()};return{promise:new Promise((b,g)=>{this.ui.isStandalone()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(s,y=>{if(u==null||u(),(0,h.isErrorResponse)(y))return g(new Error(y.errorMessage));b(y)}),this.ui.isStandalone()?this.sendRequestStandalone(s,o):this.publishWeb3RequestEvent(s,o)}),cancel:p}}setConnectDisabled(o){this.ui.setConnectDisabled(o)}setAccountsCallback(o){this.accountsCallback=o}setChainCallback(o){this.chainCallback=o}setDappDefaultChainCallback(o){this.dappDefaultChain=o,this.ui instanceof l.WalletLinkRelayUI&&this.ui.setChainId(o)}publishWeb3RequestEvent(o,u){var s;const p={type:"WEB3_REQUEST",id:o,request:u},m=i.Session.load(this.storage);(s=this.diagnostic)===null||s===void 0||s.log(t.EVENTS.WEB3_REQUEST,{eventId:p.id,method:`relay::${u.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:m?i.Session.hash(m.id):"",isSessionMismatched:((m==null?void 0:m.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",p,!0).then(b=>{var g;(g=this.diagnostic)===null||g===void 0||g.log(t.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:p.id,method:`relay::${u.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:m?i.Session.hash(m.id):"",isSessionMismatched:((m==null?void 0:m.id)!==this._session.id).toString()})}).catch(b=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p.id,response:{method:u.method,errorMessage:b.message}})})}publishWeb3RequestCanceledEvent(o){const u={type:"WEB3_REQUEST_CANCELED",id:o};this.publishEvent("Web3RequestCanceled",u,!1).then()}publishEvent(o,u,s){return this.connection.publishEvent(o,u,s)}handleWeb3ResponseMessage(o){var u;const{response:s}=o;if((u=this.diagnostic)===null||u===void 0||u.log(t.EVENTS.WEB3_RESPONSE,{eventId:o.id,method:`relay::${s.method}`,sessionIdHash:this.getSessionIdHash()}),s.method==="requestEthereumAccounts"){Ge.accountRequestCallbackIds.forEach(p=>this.invokeCallback(Object.assign(Object.assign({},o),{id:p}))),Ge.accountRequestCallbackIds.clear();return}this.invokeCallback(o)}handleErrorResponse(o,u,s,p){var m;const b=(m=s==null?void 0:s.message)!==null&&m!==void 0?m:(0,e.getMessageFromCode)(p);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:o,response:{method:u,errorMessage:b,errorCode:p}})}invokeCallback(o){const u=this.relayEventManager.callbacks.get(o.id);u&&(u(o.response),this.relayEventManager.callbacks.delete(o.id))}requestEthereumAccounts(){const o={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},u=(0,n.randomBytesHex)(8),s=m=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,m)};return{promise:new Promise((m,b)=>{if(this.relayEventManager.callbacks.set(u,g=>{if(this.ui.hideRequestEthereumAccounts(),(0,h.isErrorResponse)(g))return b(new Error(g.errorMessage));m(g)}),this.ui.inlineAccountsResponse()){const g=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"requestEthereumAccounts",result:y}})};this.ui.requestEthereumAccounts({onCancel:s,onAccounts:g})}else{const g=e.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>s(g)})}Ge.accountRequestCallbackIds.add(u),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,o)}),cancel:s}}selectProvider(o){const u={method:"selectProvider"},s=(0,n.randomBytesHex)(8),p=b=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,u.method,b)},m=new Promise((b,g)=>{this.relayEventManager.callbacks.set(s,_=>{if((0,h.isErrorResponse)(_))return g(new Error(_.errorMessage));b(_)});const y=_=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"selectProvider",result:r.ProviderType.Unselected}})},w=_=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"selectProvider",result:_}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:w,onCancel:y,providerOptions:o})});return{cancel:p,promise:m}}watchAsset(o,u,s,p,m,b){const g={method:"watchAsset",params:{type:o,options:{address:u,symbol:s,decimals:p,image:m},chainId:b}};let y=null;const w=(0,n.randomBytesHex)(8),_=C=>{this.publishWeb3RequestCanceledEvent(w),this.handleErrorResponse(w,g.method,C),y==null||y()};this.ui.inlineWatchAsset()||(y=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:_,onResetConnection:this.resetAndReload}));const v=new Promise((C,S)=>{this.relayEventManager.callbacks.set(w,D=>{if(y==null||y(),(0,h.isErrorResponse)(D))return S(new Error(D.errorMessage));C(D)});const I=D=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"watchAsset",result:!1}})},N=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:N,onCancel:I,type:o,address:u,symbol:s,decimals:p,image:m,chainId:b}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(w,g)});return{cancel:_,promise:v}}addEthereumChain(o,u,s,p,m,b){const g={method:"addEthereumChain",params:{chainId:o,rpcUrls:u,blockExplorerUrls:p,chainName:m,iconUrls:s,nativeCurrency:b}};let y=null;const w=(0,n.randomBytesHex)(8),_=C=>{this.publishWeb3RequestCanceledEvent(w),this.handleErrorResponse(w,g.method,C),y==null||y()};return this.ui.inlineAddEthereumChain(o)||(y=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:_,onResetConnection:this.resetAndReload})),{promise:new Promise((C,S)=>{this.relayEventManager.callbacks.set(w,D=>{if(y==null||y(),(0,h.isErrorResponse)(D))return S(new Error(D.errorMessage));C(D)});const I=D=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},N=D=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:w,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:D}}})};this.ui.inlineAddEthereumChain(o)&&this.ui.addEthereumChain({onCancel:I,onApprove:N,chainId:g.params.chainId,rpcUrls:g.params.rpcUrls,blockExplorerUrls:g.params.blockExplorerUrls,chainName:g.params.chainName,iconUrls:g.params.iconUrls,nativeCurrency:g.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(o)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(w,g)}),cancel:_}}switchEthereumChain(o,u){const s={method:"switchEthereumChain",params:Object.assign({chainId:o},{address:u})},p=(0,n.randomBytesHex)(8),m=g=>{this.publishWeb3RequestCanceledEvent(p),this.handleErrorResponse(p,s.method,g)};return{promise:new Promise((g,y)=>{this.relayEventManager.callbacks.set(p,v=>{if((0,h.isErrorResponse)(v)&&v.errorCode)return y(e.standardErrors.provider.custom({code:v.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,h.isErrorResponse)(v))return y(new Error(v.errorMessage));g(v)});const w=v=>{var C;if(v){const S=(C=(0,e.getErrorCode)(v))!==null&&C!==void 0?C:e.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(p,"switchEthereumChain",v instanceof Error?v:e.standardErrors.provider.unsupportedChain(o),S)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},_=v=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:p,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:v}}})};this.ui.switchEthereumChain({onCancel:w,onApprove:_,chainId:s.params.chainId,address:s.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(p,s)}),cancel:m}}inlineAddEthereumChain(o){return this.ui.inlineAddEthereumChain(o)}getSessionIdHash(){return i.Session.hash(this._session.id)}sendRequestStandalone(o,u){const s=m=>{this.handleErrorResponse(o,u.method,m)},p=m=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:o,response:m})};switch(u.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:u,onSuccess:p,onCancel:s});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:u,onSuccess:p,onCancel:s});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:u,onSuccess:p,onCancel:s});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:u,onSuccess:p});break;default:s();break}}};return mt.WalletLinkRelay=f,f.accountRequestCallbackIds=new Set,mt}var Lt={},De={},je={},Bo;function bd(){return Bo||(Bo=1,(function(e){var r=je&&je.__createBinding||(Object.create?(function(t,c,i,a){a===void 0&&(a=i);var h=Object.getOwnPropertyDescriptor(c,i);(!h||("get"in h?!c.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return c[i]}}),Object.defineProperty(t,a,h)}):(function(t,c,i,a){a===void 0&&(a=i),t[a]=c[i]})),n=je&&je.__exportStar||function(t,c){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(c,i)&&r(c,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Gu(),e)})(je)),je}var ir={},Fo;function yd(){return Fo||(Fo=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.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}"),ir}var qo;function wd(){if(qo)return De;qo=1;var e=De&&De.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(De,"__esModule",{value:!0}),De.RedirectDialog=void 0;const r=e(Vt),n=ce,t=Ju(),c=bd(),i=e(yd());let a=class{constructor(){this.root=null}attach(){const f=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",f.appendChild(this.root),(0,t.injectCssReset)()}present(f){this.render(f)}clear(){this.render(null)}render(f){this.root&&((0,n.render)(null,this.root),f&&(0,n.render)((0,n.h)(h,Object.assign({},f,{onDismiss:()=>{this.clear()}})),this.root))}};De.RedirectDialog=a;const h=({title:l,buttonText:f,darkMode:d,onButtonClick:o,onDismiss:u})=>{const s=d?"dark":"light";return(0,n.h)(c.SnackbarContainer,{darkMode:d},(0,n.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:u}),(0,n.h)("div",{class:(0,r.default)("-cbwsdk-redirect-dialog-box",s)},(0,n.h)("p",null,l),(0,n.h)("button",{onClick:o},f))))};return De}var $o;function Qu(){if($o)return Lt;$o=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.MobileRelayUI=void 0;const e=wd();let r=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 c=new URL("https://go.cb-w.com/walletlink");c.searchParams.append("redirect_url",window.location.href),t&&c.searchParams.append("wl_url",t);const i=document.createElement("a");i.target="cbw-opener",i.href=c.href,i.rel="noreferrer noopener",i.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 Lt.MobileRelayUI=r,Lt}var Ho;function Yu(){if(Ho)return pt;Ho=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.MobileRelay=void 0;const e=Re(),r=Ku(),n=Qu();let t=class extends r.WalletLinkRelay{constructor(i){var a;super(i),this._enableMobileWalletLink=(a=i.enableMobileWalletLink)!==null&&a!==void 0?a:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const i=(0,e.getLocation)();i.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(i.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(i,a){if(super.publishWeb3RequestEvent(i,a),!(this._enableMobileWalletLink&&this.ui instanceof n.MobileRelayUI))return;let h=!1;switch(a.method){case"requestEthereumAccounts":case"connectAndSignIn":h=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:h=!0,this.ui.openCoinbaseWalletDeeplink();break}h&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(i){super.handleWeb3ResponseMessage(i)}connectAndSignIn(i){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:i.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:i.statement,resources:i.resources}})}};return pt.MobileRelay=t,pt}var sr={exports:{}},An,Uo;function Xu(){return Uo||(Uo=1,An=mr().EventEmitter),An}var Tn,Wo;function _d(){if(Wo)return Tn;Wo=1;function e(p,m){var b=Object.keys(p);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(p);m&&(g=g.filter(function(y){return Object.getOwnPropertyDescriptor(p,y).enumerable})),b.push.apply(b,g)}return b}function r(p){for(var m=1;m<arguments.length;m++){var b=arguments[m]!=null?arguments[m]:{};m%2?e(Object(b),!0).forEach(function(g){n(p,g,b[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(b)):e(Object(b)).forEach(function(g){Object.defineProperty(p,g,Object.getOwnPropertyDescriptor(b,g))})}return p}function n(p,m,b){return m=a(m),m in p?Object.defineProperty(p,m,{value:b,enumerable:!0,configurable:!0,writable:!0}):p[m]=b,p}function t(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function c(p,m){for(var b=0;b<m.length;b++){var g=m[b];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(p,a(g.key),g)}}function i(p,m,b){return m&&c(p.prototype,m),Object.defineProperty(p,"prototype",{writable:!1}),p}function a(p){var m=h(p,"string");return typeof m=="symbol"?m:String(m)}function h(p,m){if(typeof p!="object"||p===null)return p;var b=p[Symbol.toPrimitive];if(b!==void 0){var g=b.call(p,m);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(p)}var l=Es(),f=l.Buffer,d=yu(),o=d.inspect,u=o&&o.custom||"inspect";function s(p,m,b){f.prototype.copy.call(p,m,b)}return Tn=(function(){function p(){t(this,p),this.head=null,this.tail=null,this.length=0}return i(p,[{key:"push",value:function(b){var g={data:b,next:null};this.length>0?this.tail.next=g:this.head=g,this.tail=g,++this.length}},{key:"unshift",value:function(b){var g={data:b,next:this.head};this.length===0&&(this.tail=g),this.head=g,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var g=this.head,y=""+g.data;g=g.next;)y+=b+g.data;return y}},{key:"concat",value:function(b){if(this.length===0)return f.alloc(0);for(var g=f.allocUnsafe(b>>>0),y=this.head,w=0;y;)s(y.data,g,w),w+=y.data.length,y=y.next;return g}},{key:"consume",value:function(b,g){var y;return b<this.head.data.length?(y=this.head.data.slice(0,b),this.head.data=this.head.data.slice(b)):b===this.head.data.length?y=this.shift():y=g?this._getString(b):this._getBuffer(b),y}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(b){var g=this.head,y=1,w=g.data;for(b-=w.length;g=g.next;){var _=g.data,v=b>_.length?_.length:b;if(v===_.length?w+=_:w+=_.slice(0,b),b-=v,b===0){v===_.length?(++y,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=_.slice(v));break}++y}return this.length-=y,w}},{key:"_getBuffer",value:function(b){var g=f.allocUnsafe(b),y=this.head,w=1;for(y.data.copy(g),b-=y.data.length;y=y.next;){var _=y.data,v=b>_.length?_.length:b;if(_.copy(g,g.length-b,0,v),b-=v,b===0){v===_.length?(++w,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=_.slice(v));break}++w}return this.length-=w,g}},{key:u,value:function(b,g){return o(this,r(r({},g),{},{depth:0,customInspect:!1}))}}]),p})(),Tn}var Mn,Vo;function el(){if(Vo)return Mn;Vo=1;function e(a,h){var l=this,f=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return f||d?(h?h(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,te.nextTick(c,this,a)):te.nextTick(c,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(o){!h&&o?l._writableState?l._writableState.errorEmitted?te.nextTick(n,l):(l._writableState.errorEmitted=!0,te.nextTick(r,l,o)):te.nextTick(r,l,o):h?(te.nextTick(n,l),h(o)):te.nextTick(n,l)}),this)}function r(a,h){c(a,h),n(a)}function n(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.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 c(a,h){a.emit("error",h)}function i(a,h){var l=a._readableState,f=a._writableState;l&&l.autoDestroy||f&&f.autoDestroy?a.destroy(h):a.emit("error",h)}return Mn={destroy:e,undestroy:t,errorOrDestroy:i},Mn}var Ln={},zo;function nt(){if(zo)return Ln;zo=1;function e(h,l){h.prototype=Object.create(l.prototype),h.prototype.constructor=h,h.__proto__=l}var r={};function n(h,l,f){f||(f=Error);function d(u,s,p){return typeof l=="string"?l:l(u,s,p)}var o=(function(u){e(s,u);function s(p,m,b){return u.call(this,d(p,m,b))||this}return s})(f);o.prototype.name=f.name,o.prototype.code=h,r[h]=o}function t(h,l){if(Array.isArray(h)){var f=h.length;return h=h.map(function(d){return String(d)}),f>2?"one of ".concat(l," ").concat(h.slice(0,f-1).join(", "),", or ")+h[f-1]:f===2?"one of ".concat(l," ").concat(h[0]," or ").concat(h[1]):"of ".concat(l," ").concat(h[0])}else return"of ".concat(l," ").concat(String(h))}function c(h,l,f){return h.substr(0,l.length)===l}function i(h,l,f){return(f===void 0||f>h.length)&&(f=h.length),h.substring(f-l.length,f)===l}function a(h,l,f){return typeof f!="number"&&(f=0),f+l.length>h.length?!1:h.indexOf(l,f)!==-1}return n("ERR_INVALID_OPT_VALUE",function(h,l){return'The value "'+l+'" is invalid for option "'+h+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(h,l,f){var d;typeof l=="string"&&c(l,"not ")?(d="must not be",l=l.replace(/^not /,"")):d="must be";var o;if(i(h," argument"))o="The ".concat(h," ").concat(d," ").concat(t(l,"type"));else{var u=a(h,".")?"property":"argument";o='The "'.concat(h,'" ').concat(u," ").concat(d," ").concat(t(l,"type"))}return o+=". Received type ".concat(typeof f),o},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(h){return"The "+h+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(h){return"Cannot call "+h+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(h){return"Unknown encoding: "+h},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ln.codes=r,Ln}var Pn,Jo;function tl(){if(Jo)return Pn;Jo=1;var e=nt().codes.ERR_INVALID_OPT_VALUE;function r(t,c,i){return t.highWaterMark!=null?t.highWaterMark:c?t[i]:null}function n(t,c,i,a){var h=r(c,a,i);if(h!=null){if(!(isFinite(h)&&Math.floor(h)===h)||h<0){var l=a?i:"highWaterMark";throw new e(l,h)}return Math.floor(h)}return t.objectMode?16:16*1024}return Pn={getHighWaterMark:n},Pn}var Nn,Go;function rl(){if(Go)return Nn;Go=1,Nn=I;function e(k){var A=this;this.next=null,this.entry=null,this.finish=function(){H(A,k)}}var r;I.WritableState=C;var n={deprecate:Ol()},t=Xu(),c=Es().Buffer,i=(typeof fr<"u"?fr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(k){return c.from(k)}function h(k){return c.isBuffer(k)||k instanceof i}var l=el(),f=tl(),d=f.getHighWaterMark,o=nt().codes,u=o.ERR_INVALID_ARG_TYPE,s=o.ERR_METHOD_NOT_IMPLEMENTED,p=o.ERR_MULTIPLE_CALLBACK,m=o.ERR_STREAM_CANNOT_PIPE,b=o.ERR_STREAM_DESTROYED,g=o.ERR_STREAM_NULL_VALUES,y=o.ERR_STREAM_WRITE_AFTER_END,w=o.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;Wt()(I,t);function v(){}function C(k,A,P){r=r||rt(),k=k||{},typeof P!="boolean"&&(P=A instanceof r),this.objectMode=!!k.objectMode,P&&(this.objectMode=this.objectMode||!!k.writableObjectMode),this.highWaterMark=d(this,k,"writableHighWaterMark",P),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=k.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=k.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){T(A,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}C.prototype.getBuffer=function(){for(var A=this.bufferedRequest,P=[];A;)P.push(A),A=A.next;return P},(function(){try{Object.defineProperty(C.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var S;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(S=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(A){return S.call(this,A)?!0:this!==I?!1:A&&A._writableState instanceof C}})):S=function(A){return A instanceof this};function I(k){r=r||rt();var A=this instanceof r;if(!A&&!S.call(I,this))return new I(k);this._writableState=new C(k,this,A),this.writable=!0,k&&(typeof k.write=="function"&&(this._write=k.write),typeof k.writev=="function"&&(this._writev=k.writev),typeof k.destroy=="function"&&(this._destroy=k.destroy),typeof k.final=="function"&&(this._final=k.final)),t.call(this)}I.prototype.pipe=function(){_(this,new m)};function N(k,A){var P=new y;_(k,P),te.nextTick(A,P)}function D(k,A,P,U){var Q;return P===null?Q=new g:typeof P!="string"&&!A.objectMode&&(Q=new u("chunk",["string","Buffer"],P)),Q?(_(k,Q),te.nextTick(U,Q),!1):!0}I.prototype.write=function(k,A,P){var U=this._writableState,Q=!1,E=!U.objectMode&&h(k);return E&&!c.isBuffer(k)&&(k=a(k)),typeof A=="function"&&(P=A,A=null),E?A="buffer":A||(A=U.defaultEncoding),typeof P!="function"&&(P=v),U.ending?N(this,P):(E||D(this,U,k,P))&&(U.pendingcb++,Q=z(this,U,E,k,A,P)),Q},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var k=this._writableState;k.corked&&(k.corked--,!k.writing&&!k.corked&&!k.bufferProcessing&&k.bufferedRequest&&x(this,k))},I.prototype.setDefaultEncoding=function(A){if(typeof A=="string"&&(A=A.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((A+"").toLowerCase())>-1))throw new w(A);return this._writableState.defaultEncoding=A,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function $(k,A,P){return!k.objectMode&&k.decodeStrings!==!1&&typeof A=="string"&&(A=c.from(A,P)),A}Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function z(k,A,P,U,Q,E){if(!P){var R=$(A,U,Q);U!==R&&(P=!0,Q="buffer",U=R)}var O=A.objectMode?1:U.length;A.length+=O;var F=A.length<A.highWaterMark;if(F||(A.needDrain=!0),A.writing||A.corked){var ne=A.lastBufferedRequest;A.lastBufferedRequest={chunk:U,encoding:Q,isBuf:P,callback:E,next:null},ne?ne.next=A.lastBufferedRequest:A.bufferedRequest=A.lastBufferedRequest,A.bufferedRequestCount+=1}else X(k,A,!1,O,U,Q,E);return F}function X(k,A,P,U,Q,E,R){A.writelen=U,A.writecb=R,A.writing=!0,A.sync=!0,A.destroyed?A.onwrite(new b("write")):P?k._writev(Q,A.onwrite):k._write(Q,E,A.onwrite),A.sync=!1}function Y(k,A,P,U,Q){--A.pendingcb,P?(te.nextTick(Q,U),te.nextTick(q,k,A),k._writableState.errorEmitted=!0,_(k,U)):(Q(U),k._writableState.errorEmitted=!0,_(k,U),q(k,A))}function J(k){k.writing=!1,k.writecb=null,k.length-=k.writelen,k.writelen=0}function T(k,A){var P=k._writableState,U=P.sync,Q=P.writecb;if(typeof Q!="function")throw new p;if(J(P),A)Y(k,P,U,A,Q);else{var E=j(P)||k.destroyed;!E&&!P.corked&&!P.bufferProcessing&&P.bufferedRequest&&x(k,P),U?te.nextTick(M,k,P,E,Q):M(k,P,E,Q)}}function M(k,A,P,U){P||L(k,A),A.pendingcb--,U(),q(k,A)}function L(k,A){A.length===0&&A.needDrain&&(A.needDrain=!1,k.emit("drain"))}function x(k,A){A.bufferProcessing=!0;var P=A.bufferedRequest;if(k._writev&&P&&P.next){var U=A.bufferedRequestCount,Q=new Array(U),E=A.corkedRequestsFree;E.entry=P;for(var R=0,O=!0;P;)Q[R]=P,P.isBuf||(O=!1),P=P.next,R+=1;Q.allBuffers=O,X(k,A,!0,A.length,Q,"",E.finish),A.pendingcb++,A.lastBufferedRequest=null,E.next?(A.corkedRequestsFree=E.next,E.next=null):A.corkedRequestsFree=new e(A),A.bufferedRequestCount=0}else{for(;P;){var F=P.chunk,ne=P.encoding,Z=P.callback,re=A.objectMode?1:F.length;if(X(k,A,!1,re,F,ne,Z),P=P.next,A.bufferedRequestCount--,A.writing)break}P===null&&(A.lastBufferedRequest=null)}A.bufferedRequest=P,A.bufferProcessing=!1}I.prototype._write=function(k,A,P){P(new s("_write()"))},I.prototype._writev=null,I.prototype.end=function(k,A,P){var U=this._writableState;return typeof k=="function"?(P=k,k=null,A=null):typeof A=="function"&&(P=A,A=null),k!=null&&this.write(k,A),U.corked&&(U.corked=1,this.uncork()),U.ending||G(this,U,P),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function j(k){return k.ending&&k.length===0&&k.bufferedRequest===null&&!k.finished&&!k.writing}function V(k,A){k._final(function(P){A.pendingcb--,P&&_(k,P),A.prefinished=!0,k.emit("prefinish"),q(k,A)})}function B(k,A){!A.prefinished&&!A.finalCalled&&(typeof k._final=="function"&&!A.destroyed?(A.pendingcb++,A.finalCalled=!0,te.nextTick(V,k,A)):(A.prefinished=!0,k.emit("prefinish")))}function q(k,A){var P=j(A);if(P&&(B(k,A),A.pendingcb===0&&(A.finished=!0,k.emit("finish"),A.autoDestroy))){var U=k._readableState;(!U||U.autoDestroy&&U.endEmitted)&&k.destroy()}return P}function G(k,A,P){A.ending=!0,q(k,A),P&&(A.finished?te.nextTick(P):k.once("finish",P)),A.ended=!0,k.writable=!1}function H(k,A,P){var U=k.entry;for(k.entry=null;U;){var Q=U.callback;A.pendingcb--,Q(P),U=U.next}A.corkedRequestsFree.next=k}return Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(A){this._writableState&&(this._writableState.destroyed=A)}}),I.prototype.destroy=l.destroy,I.prototype._undestroy=l.undestroy,I.prototype._destroy=function(k,A){A(k)},Nn}var On,Zo;function rt(){if(Zo)return On;Zo=1;var e=Object.keys||function(f){var d=[];for(var o in f)d.push(o);return d};On=a;var r=nl(),n=rl();Wt()(a,r);for(var t=e(n.prototype),c=0;c<t.length;c++){var i=t[c];a.prototype[i]||(a.prototype[i]=n.prototype[i])}function a(f){if(!(this instanceof a))return new a(f);r.call(this,f),n.call(this,f),this.allowHalfOpen=!0,f&&(f.readable===!1&&(this.readable=!1),f.writable===!1&&(this.writable=!1),f.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",h)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function h(){this._writableState.ended||te.nextTick(l,this)}function l(f){f.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),On}var xn,Ko;function Ms(){if(Ko)return xn;Ko=1;var e=nt().codes.ERR_STREAM_PREMATURE_CLOSE;function r(i){var a=!1;return function(){if(!a){a=!0;for(var h=arguments.length,l=new Array(h),f=0;f<h;f++)l[f]=arguments[f];i.apply(this,l)}}}function n(){}function t(i){return i.setHeader&&typeof i.abort=="function"}function c(i,a,h){if(typeof a=="function")return c(i,null,a);a||(a={}),h=r(h||n);var l=a.readable||a.readable!==!1&&i.readable,f=a.writable||a.writable!==!1&&i.writable,d=function(){i.writable||u()},o=i._writableState&&i._writableState.finished,u=function(){f=!1,o=!0,l||h.call(i)},s=i._readableState&&i._readableState.endEmitted,p=function(){l=!1,s=!0,f||h.call(i)},m=function(w){h.call(i,w)},b=function(){var w;if(l&&!s)return(!i._readableState||!i._readableState.ended)&&(w=new e),h.call(i,w);if(f&&!o)return(!i._writableState||!i._writableState.ended)&&(w=new e),h.call(i,w)},g=function(){i.req.on("finish",u)};return t(i)?(i.on("complete",u),i.on("abort",b),i.req?g():i.on("request",g)):f&&!i._writableState&&(i.on("end",d),i.on("close",d)),i.on("end",p),i.on("finish",u),a.error!==!1&&i.on("error",m),i.on("close",b),function(){i.removeListener("complete",u),i.removeListener("abort",b),i.removeListener("request",g),i.req&&i.req.removeListener("finish",u),i.removeListener("end",d),i.removeListener("close",d),i.removeListener("finish",u),i.removeListener("end",p),i.removeListener("error",m),i.removeListener("close",b)}}return xn=c,xn}var Dn,Qo;function vd(){if(Qo)return Dn;Qo=1;var e;function r(w,_,v){return _=n(_),_ in w?Object.defineProperty(w,_,{value:v,enumerable:!0,configurable:!0,writable:!0}):w[_]=v,w}function n(w){var _=t(w,"string");return typeof _=="symbol"?_:String(_)}function t(w,_){if(typeof w!="object"||w===null)return w;var v=w[Symbol.toPrimitive];if(v!==void 0){var C=v.call(w,_);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(w)}var c=Ms(),i=Symbol("lastResolve"),a=Symbol("lastReject"),h=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),o=Symbol("stream");function u(w,_){return{value:w,done:_}}function s(w){var _=w[i];if(_!==null){var v=w[o].read();v!==null&&(w[f]=null,w[i]=null,w[a]=null,_(u(v,!1)))}}function p(w){te.nextTick(s,w)}function m(w,_){return function(v,C){w.then(function(){if(_[l]){v(u(void 0,!0));return}_[d](v,C)},C)}}var b=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((e={get stream(){return this[o]},next:function(){var _=this,v=this[h];if(v!==null)return Promise.reject(v);if(this[l])return Promise.resolve(u(void 0,!0));if(this[o].destroyed)return new Promise(function(N,D){te.nextTick(function(){_[h]?D(_[h]):N(u(void 0,!0))})});var C=this[f],S;if(C)S=new Promise(m(C,this));else{var I=this[o].read();if(I!==null)return Promise.resolve(u(I,!1));S=new Promise(this[d])}return this[f]=S,S}},r(e,Symbol.asyncIterator,function(){return this}),r(e,"return",function(){var _=this;return new Promise(function(v,C){_[o].destroy(null,function(S){if(S){C(S);return}v(u(void 0,!0))})})}),e),b),y=function(_){var v,C=Object.create(g,(v={},r(v,o,{value:_,writable:!0}),r(v,i,{value:null,writable:!0}),r(v,a,{value:null,writable:!0}),r(v,h,{value:null,writable:!0}),r(v,l,{value:_._readableState.endEmitted,writable:!0}),r(v,d,{value:function(I,N){var D=C[o].read();D?(C[f]=null,C[i]=null,C[a]=null,I(u(D,!1))):(C[i]=I,C[a]=N)},writable:!0}),v));return C[f]=null,c(_,function(S){if(S&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"){var I=C[a];I!==null&&(C[f]=null,C[i]=null,C[a]=null,I(S)),C[h]=S;return}var N=C[i];N!==null&&(C[f]=null,C[i]=null,C[a]=null,N(u(void 0,!0))),C[l]=!0}),_.on("readable",p.bind(null,C)),C};return Dn=y,Dn}var jn,Yo;function Ed(){return Yo||(Yo=1,jn=function(){throw new Error("Readable.from is not available in the browser")}),jn}var Bn,Xo;function nl(){if(Xo)return Bn;Xo=1,Bn=N;var e;N.ReadableState=I,mr().EventEmitter;var r=function(R,O){return R.listeners(O).length},n=Xu(),t=Es().Buffer,c=(typeof fr<"u"?fr:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(E){return t.from(E)}function a(E){return t.isBuffer(E)||E instanceof c}var h=yu(),l;h&&h.debuglog?l=h.debuglog("stream"):l=function(){};var f=_d(),d=el(),o=tl(),u=o.getHighWaterMark,s=nt().codes,p=s.ERR_INVALID_ARG_TYPE,m=s.ERR_STREAM_PUSH_AFTER_EOF,b=s.ERR_METHOD_NOT_IMPLEMENTED,g=s.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,y,w,_;Wt()(N,n);var v=d.errorOrDestroy,C=["error","close","destroy","pause","resume"];function S(E,R,O){if(typeof E.prependListener=="function")return E.prependListener(R,O);!E._events||!E._events[R]?E.on(R,O):Array.isArray(E._events[R])?E._events[R].unshift(O):E._events[R]=[O,E._events[R]]}function I(E,R,O){e=e||rt(),E=E||{},typeof O!="boolean"&&(O=R instanceof e),this.objectMode=!!E.objectMode,O&&(this.objectMode=this.objectMode||!!E.readableObjectMode),this.highWaterMark=u(this,E,"readableHighWaterMark",O),this.buffer=new f,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=E.emitClose!==!1,this.autoDestroy=!!E.autoDestroy,this.destroyed=!1,this.defaultEncoding=E.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,E.encoding&&(y||(y=Gs().StringDecoder),this.decoder=new y(E.encoding),this.encoding=E.encoding)}function N(E){if(e=e||rt(),!(this instanceof N))return new N(E);var R=this instanceof e;this._readableState=new I(E,this,R),this.readable=!0,E&&(typeof E.read=="function"&&(this._read=E.read),typeof E.destroy=="function"&&(this._destroy=E.destroy)),n.call(this)}Object.defineProperty(N.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),N.prototype.destroy=d.destroy,N.prototype._undestroy=d.undestroy,N.prototype._destroy=function(E,R){R(E)},N.prototype.push=function(E,R){var O=this._readableState,F;return O.objectMode?F=!0:typeof E=="string"&&(R=R||O.defaultEncoding,R!==O.encoding&&(E=t.from(E,R),R=""),F=!0),D(this,E,R,!1,F)},N.prototype.unshift=function(E){return D(this,E,null,!0,!1)};function D(E,R,O,F,ne){l("readableAddChunk",R);var Z=E._readableState;if(R===null)Z.reading=!1,T(E,Z);else{var re;if(ne||(re=z(Z,R)),re)v(E,re);else if(Z.objectMode||R&&R.length>0)if(typeof R!="string"&&!Z.objectMode&&Object.getPrototypeOf(R)!==t.prototype&&(R=i(R)),F)Z.endEmitted?v(E,new g):$(E,Z,R,!0);else if(Z.ended)v(E,new m);else{if(Z.destroyed)return!1;Z.reading=!1,Z.decoder&&!O?(R=Z.decoder.write(R),Z.objectMode||R.length!==0?$(E,Z,R,!1):x(E,Z)):$(E,Z,R,!1)}else F||(Z.reading=!1,x(E,Z))}return!Z.ended&&(Z.length<Z.highWaterMark||Z.length===0)}function $(E,R,O,F){R.flowing&&R.length===0&&!R.sync?(R.awaitDrain=0,E.emit("data",O)):(R.length+=R.objectMode?1:O.length,F?R.buffer.unshift(O):R.buffer.push(O),R.needReadable&&M(E)),x(E,R)}function z(E,R){var O;return!a(R)&&typeof R!="string"&&R!==void 0&&!E.objectMode&&(O=new p("chunk",["string","Buffer","Uint8Array"],R)),O}N.prototype.isPaused=function(){return this._readableState.flowing===!1},N.prototype.setEncoding=function(E){y||(y=Gs().StringDecoder);var R=new y(E);this._readableState.decoder=R,this._readableState.encoding=this._readableState.decoder.encoding;for(var O=this._readableState.buffer.head,F="";O!==null;)F+=R.write(O.data),O=O.next;return this._readableState.buffer.clear(),F!==""&&this._readableState.buffer.push(F),this._readableState.length=F.length,this};var X=1073741824;function Y(E){return E>=X?E=X:(E--,E|=E>>>1,E|=E>>>2,E|=E>>>4,E|=E>>>8,E|=E>>>16,E++),E}function J(E,R){return E<=0||R.length===0&&R.ended?0:R.objectMode?1:E!==E?R.flowing&&R.length?R.buffer.head.data.length:R.length:(E>R.highWaterMark&&(R.highWaterMark=Y(E)),E<=R.length?E:R.ended?R.length:(R.needReadable=!0,0))}N.prototype.read=function(E){l("read",E),E=parseInt(E,10);var R=this._readableState,O=E;if(E!==0&&(R.emittedReadable=!1),E===0&&R.needReadable&&((R.highWaterMark!==0?R.length>=R.highWaterMark:R.length>0)||R.ended))return l("read: emitReadable",R.length,R.ended),R.length===0&&R.ended?P(this):M(this),null;if(E=J(E,R),E===0&&R.ended)return R.length===0&&P(this),null;var F=R.needReadable;l("need readable",F),(R.length===0||R.length-E<R.highWaterMark)&&(F=!0,l("length less than watermark",F)),R.ended||R.reading?(F=!1,l("reading or ended",F)):F&&(l("do read"),R.reading=!0,R.sync=!0,R.length===0&&(R.needReadable=!0),this._read(R.highWaterMark),R.sync=!1,R.reading||(E=J(O,R)));var ne;return E>0?ne=A(E,R):ne=null,ne===null?(R.needReadable=R.length<=R.highWaterMark,E=0):(R.length-=E,R.awaitDrain=0),R.length===0&&(R.ended||(R.needReadable=!0),O!==E&&R.ended&&P(this)),ne!==null&&this.emit("data",ne),ne};function T(E,R){if(l("onEofChunk"),!R.ended){if(R.decoder){var O=R.decoder.end();O&&O.length&&(R.buffer.push(O),R.length+=R.objectMode?1:O.length)}R.ended=!0,R.sync?M(E):(R.needReadable=!1,R.emittedReadable||(R.emittedReadable=!0,L(E)))}}function M(E){var R=E._readableState;l("emitReadable",R.needReadable,R.emittedReadable),R.needReadable=!1,R.emittedReadable||(l("emitReadable",R.flowing),R.emittedReadable=!0,te.nextTick(L,E))}function L(E){var R=E._readableState;l("emitReadable_",R.destroyed,R.length,R.ended),!R.destroyed&&(R.length||R.ended)&&(E.emit("readable"),R.emittedReadable=!1),R.needReadable=!R.flowing&&!R.ended&&R.length<=R.highWaterMark,k(E)}function x(E,R){R.readingMore||(R.readingMore=!0,te.nextTick(j,E,R))}function j(E,R){for(;!R.reading&&!R.ended&&(R.length<R.highWaterMark||R.flowing&&R.length===0);){var O=R.length;if(l("maybeReadMore read 0"),E.read(0),O===R.length)break}R.readingMore=!1}N.prototype._read=function(E){v(this,new b("_read()"))},N.prototype.pipe=function(E,R){var O=this,F=this._readableState;switch(F.pipesCount){case 0:F.pipes=E;break;case 1:F.pipes=[F.pipes,E];break;default:F.pipes.push(E);break}F.pipesCount+=1,l("pipe count=%d opts=%j",F.pipesCount,R);var ne=(!R||R.end!==!1)&&E!==te.stdout&&E!==te.stderr,Z=ne?ye:Se;F.endEmitted?te.nextTick(Z):O.once("end",Z),E.on("unpipe",re);function re(we,_e){l("onunpipe"),we===O&&_e&&_e.hasUnpiped===!1&&(_e.hasUnpiped=!0,Qt())}function ye(){l("onend"),E.end()}var Ie=V(O);E.on("drain",Ie);var st=!1;function Qt(){l("cleanup"),E.removeListener("close",Xe),E.removeListener("finish",et),E.removeListener("drain",Ie),E.removeListener("error",Ye),E.removeListener("unpipe",re),O.removeListener("end",ye),O.removeListener("end",Se),O.removeListener("data",ot),st=!0,F.awaitDrain&&(!E._writableState||E._writableState.needDrain)&&Ie()}O.on("data",ot);function ot(we){l("ondata");var _e=E.write(we);l("dest.write",_e),_e===!1&&((F.pipesCount===1&&F.pipes===E||F.pipesCount>1&&Q(F.pipes,E)!==-1)&&!st&&(l("false write response, pause",F.awaitDrain),F.awaitDrain++),O.pause())}function Ye(we){l("onerror",we),Se(),E.removeListener("error",Ye),r(E,"error")===0&&v(E,we)}S(E,"error",Ye);function Xe(){E.removeListener("finish",et),Se()}E.once("close",Xe);function et(){l("onfinish"),E.removeListener("close",Xe),Se()}E.once("finish",et);function Se(){l("unpipe"),O.unpipe(E)}return E.emit("pipe",O),F.flowing||(l("pipe resume"),O.resume()),E};function V(E){return function(){var O=E._readableState;l("pipeOnDrain",O.awaitDrain),O.awaitDrain&&O.awaitDrain--,O.awaitDrain===0&&r(E,"data")&&(O.flowing=!0,k(E))}}N.prototype.unpipe=function(E){var R=this._readableState,O={hasUnpiped:!1};if(R.pipesCount===0)return this;if(R.pipesCount===1)return E&&E!==R.pipes?this:(E||(E=R.pipes),R.pipes=null,R.pipesCount=0,R.flowing=!1,E&&E.emit("unpipe",this,O),this);if(!E){var F=R.pipes,ne=R.pipesCount;R.pipes=null,R.pipesCount=0,R.flowing=!1;for(var Z=0;Z<ne;Z++)F[Z].emit("unpipe",this,{hasUnpiped:!1});return this}var re=Q(R.pipes,E);return re===-1?this:(R.pipes.splice(re,1),R.pipesCount-=1,R.pipesCount===1&&(R.pipes=R.pipes[0]),E.emit("unpipe",this,O),this)},N.prototype.on=function(E,R){var O=n.prototype.on.call(this,E,R),F=this._readableState;return E==="data"?(F.readableListening=this.listenerCount("readable")>0,F.flowing!==!1&&this.resume()):E==="readable"&&!F.endEmitted&&!F.readableListening&&(F.readableListening=F.needReadable=!0,F.flowing=!1,F.emittedReadable=!1,l("on readable",F.length,F.reading),F.length?M(this):F.reading||te.nextTick(q,this)),O},N.prototype.addListener=N.prototype.on,N.prototype.removeListener=function(E,R){var O=n.prototype.removeListener.call(this,E,R);return E==="readable"&&te.nextTick(B,this),O},N.prototype.removeAllListeners=function(E){var R=n.prototype.removeAllListeners.apply(this,arguments);return(E==="readable"||E===void 0)&&te.nextTick(B,this),R};function B(E){var R=E._readableState;R.readableListening=E.listenerCount("readable")>0,R.resumeScheduled&&!R.paused?R.flowing=!0:E.listenerCount("data")>0&&E.resume()}function q(E){l("readable nexttick read 0"),E.read(0)}N.prototype.resume=function(){var E=this._readableState;return E.flowing||(l("resume"),E.flowing=!E.readableListening,G(this,E)),E.paused=!1,this};function G(E,R){R.resumeScheduled||(R.resumeScheduled=!0,te.nextTick(H,E,R))}function H(E,R){l("resume",R.reading),R.reading||E.read(0),R.resumeScheduled=!1,E.emit("resume"),k(E),R.flowing&&!R.reading&&E.read(0)}N.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function k(E){var R=E._readableState;for(l("flow",R.flowing);R.flowing&&E.read()!==null;);}N.prototype.wrap=function(E){var R=this,O=this._readableState,F=!1;E.on("end",function(){if(l("wrapped end"),O.decoder&&!O.ended){var re=O.decoder.end();re&&re.length&&R.push(re)}R.push(null)}),E.on("data",function(re){if(l("wrapped data"),O.decoder&&(re=O.decoder.write(re)),!(O.objectMode&&re==null)&&!(!O.objectMode&&(!re||!re.length))){var ye=R.push(re);ye||(F=!0,E.pause())}});for(var ne in E)this[ne]===void 0&&typeof E[ne]=="function"&&(this[ne]=(function(ye){return function(){return E[ye].apply(E,arguments)}})(ne));for(var Z=0;Z<C.length;Z++)E.on(C[Z],this.emit.bind(this,C[Z]));return this._read=function(re){l("wrapped _read",re),F&&(F=!1,E.resume())},this},typeof Symbol=="function"&&(N.prototype[Symbol.asyncIterator]=function(){return w===void 0&&(w=vd()),w(this)}),Object.defineProperty(N.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(N.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(N.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(R){this._readableState&&(this._readableState.flowing=R)}}),N._fromList=A,Object.defineProperty(N.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function A(E,R){if(R.length===0)return null;var O;return R.objectMode?O=R.buffer.shift():!E||E>=R.length?(R.decoder?O=R.buffer.join(""):R.buffer.length===1?O=R.buffer.first():O=R.buffer.concat(R.length),R.buffer.clear()):O=R.buffer.consume(E,R.decoder),O}function P(E){var R=E._readableState;l("endReadable",R.endEmitted),R.endEmitted||(R.ended=!0,te.nextTick(U,R,E))}function U(E,R){if(l("endReadableNT",E.endEmitted,E.length),!E.endEmitted&&E.length===0&&(E.endEmitted=!0,R.readable=!1,R.emit("end"),E.autoDestroy)){var O=R._writableState;(!O||O.autoDestroy&&O.finished)&&R.destroy()}}typeof Symbol=="function"&&(N.from=function(E,R){return _===void 0&&(_=Ed()),_(N,E,R)});function Q(E,R){for(var O=0,F=E.length;O<F;O++)if(E[O]===R)return O;return-1}return Bn}var Fn,ea;function il(){if(ea)return Fn;ea=1,Fn=h;var e=nt().codes,r=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,t=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,c=e.ERR_TRANSFORM_WITH_LENGTH_0,i=rt();Wt()(h,i);function a(d,o){var u=this._transformState;u.transforming=!1;var s=u.writecb;if(s===null)return this.emit("error",new n);u.writechunk=null,u.writecb=null,o!=null&&this.push(o),s(d);var p=this._readableState;p.reading=!1,(p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}function h(d){if(!(this instanceof h))return new h(d);i.call(this,d),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",l)}function l(){var d=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(o,u){f(d,o,u)}):f(this,null,null)}h.prototype.push=function(d,o){return this._transformState.needTransform=!1,i.prototype.push.call(this,d,o)},h.prototype._transform=function(d,o,u){u(new r("_transform()"))},h.prototype._write=function(d,o,u){var s=this._transformState;if(s.writecb=u,s.writechunk=d,s.writeencoding=o,!s.transforming){var p=this._readableState;(s.needTransform||p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}},h.prototype._read=function(d){var o=this._transformState;o.writechunk!==null&&!o.transforming?(o.transforming=!0,this._transform(o.writechunk,o.writeencoding,o.afterTransform)):o.needTransform=!0},h.prototype._destroy=function(d,o){i.prototype._destroy.call(this,d,function(u){o(u)})};function f(d,o,u){if(o)return d.emit("error",o);if(u!=null&&d.push(u),d._writableState.length)throw new c;if(d._transformState.transforming)throw new t;return d.push(null)}return Fn}var qn,ta;function Rd(){if(ta)return qn;ta=1,qn=r;var e=il();Wt()(r,e);function r(n){if(!(this instanceof r))return new r(n);e.call(this,n)}return r.prototype._transform=function(n,t,c){c(null,n)},qn}var $n,ra;function Sd(){if(ra)return $n;ra=1;var e;function r(u){var s=!1;return function(){s||(s=!0,u.apply(void 0,arguments))}}var n=nt().codes,t=n.ERR_MISSING_ARGS,c=n.ERR_STREAM_DESTROYED;function i(u){if(u)throw u}function a(u){return u.setHeader&&typeof u.abort=="function"}function h(u,s,p,m){m=r(m);var b=!1;u.on("close",function(){b=!0}),e===void 0&&(e=Ms()),e(u,{readable:s,writable:p},function(y){if(y)return m(y);b=!0,m()});var g=!1;return function(y){if(!b&&!g){if(g=!0,a(u))return u.abort();if(typeof u.destroy=="function")return u.destroy();m(y||new c("pipe"))}}}function l(u){u()}function f(u,s){return u.pipe(s)}function d(u){return!u.length||typeof u[u.length-1]!="function"?i:u.pop()}function o(){for(var u=arguments.length,s=new Array(u),p=0;p<u;p++)s[p]=arguments[p];var m=d(s);if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new t("streams");var b,g=s.map(function(y,w){var _=w<s.length-1,v=w>0;return h(y,_,v,function(C){b||(b=C),C&&g.forEach(l),!_&&(g.forEach(l),m(b))})});return s.reduce(f)}return $n=o,$n}var na;function sl(){return na||(na=1,(function(e,r){r=e.exports=nl(),r.Stream=r,r.Readable=r,r.Writable=rl(),r.Duplex=rt(),r.Transform=il(),r.PassThrough=Rd(),r.finished=Ms(),r.pipeline=Sd()})(sr,sr.exports)),sr.exports}var Hn,ia;function Cd(){if(ia)return Hn;ia=1;const{Transform:e}=sl();return Hn=r=>class ol extends e{constructor(t,c,i,a,h){super(h),this._rate=t,this._capacity=c,this._delimitedSuffix=i,this._hashBitLength=a,this._options=h,this._state=new r,this._state.initialize(t,c),this._finalized=!1}_transform(t,c,i){let a=null;try{this.update(t,c)}catch(h){a=h}i(a)}_flush(t){let c=null;try{this.push(this.digest())}catch(i){c=i}t(c)}update(t,c){if(!K.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 K.isBuffer(t)||(t=K.from(t,c)),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 c=this._state.squeeze(this._hashBitLength/8);return t!==void 0&&(c=c.toString(t)),this._resetState(),c}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new ol(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},Hn}var Un,sa;function kd(){if(sa)return Un;sa=1;const{Transform:e}=sl();return Un=r=>class al extends e{constructor(t,c,i,a){super(a),this._rate=t,this._capacity=c,this._delimitedSuffix=i,this._options=a,this._state=new r,this._state.initialize(t,c),this._finalized=!1}_transform(t,c,i){let a=null;try{this.update(t,c)}catch(h){a=h}i(a)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,c){if(!K.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 K.isBuffer(t)||(t=K.from(t,c)),this._state.absorb(t),this}squeeze(t,c){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(t);return c!==void 0&&(i=i.toString(c)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new al(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},Un}var Wn,oa;function Id(){if(oa)return Wn;oa=1;const e=Cd(),r=kd();return Wn=function(n){const t=e(n),c=r(n);return function(i,a){switch(typeof i=="string"?i.toLowerCase():i){case"keccak224":return new t(1152,448,null,224,a);case"keccak256":return new t(1088,512,null,256,a);case"keccak384":return new t(832,768,null,384,a);case"keccak512":return new t(576,1024,null,512,a);case"sha3-224":return new t(1152,448,6,224,a);case"sha3-256":return new t(1088,512,6,256,a);case"sha3-384":return new t(832,768,6,384,a);case"sha3-512":return new t(576,1024,6,512,a);case"shake128":return new c(1344,256,31,a);case"shake256":return new c(1088,512,31,a);default:throw new Error("Invald algorithm: "+i)}}},Wn}var Vn={},aa;function Ad(){if(aa)return Vn;aa=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 Vn.p1600=function(r){for(let n=0;n<24;++n){const t=r[0]^r[10]^r[20]^r[30]^r[40],c=r[1]^r[11]^r[21]^r[31]^r[41],i=r[2]^r[12]^r[22]^r[32]^r[42],a=r[3]^r[13]^r[23]^r[33]^r[43],h=r[4]^r[14]^r[24]^r[34]^r[44],l=r[5]^r[15]^r[25]^r[35]^r[45],f=r[6]^r[16]^r[26]^r[36]^r[46],d=r[7]^r[17]^r[27]^r[37]^r[47],o=r[8]^r[18]^r[28]^r[38]^r[48],u=r[9]^r[19]^r[29]^r[39]^r[49];let s=o^(i<<1|a>>>31),p=u^(a<<1|i>>>31);const m=r[0]^s,b=r[1]^p,g=r[10]^s,y=r[11]^p,w=r[20]^s,_=r[21]^p,v=r[30]^s,C=r[31]^p,S=r[40]^s,I=r[41]^p;s=t^(h<<1|l>>>31),p=c^(l<<1|h>>>31);const N=r[2]^s,D=r[3]^p,$=r[12]^s,z=r[13]^p,X=r[22]^s,Y=r[23]^p,J=r[32]^s,T=r[33]^p,M=r[42]^s,L=r[43]^p;s=i^(f<<1|d>>>31),p=a^(d<<1|f>>>31);const x=r[4]^s,j=r[5]^p,V=r[14]^s,B=r[15]^p,q=r[24]^s,G=r[25]^p,H=r[34]^s,k=r[35]^p,A=r[44]^s,P=r[45]^p;s=h^(o<<1|u>>>31),p=l^(u<<1|o>>>31);const U=r[6]^s,Q=r[7]^p,E=r[16]^s,R=r[17]^p,O=r[26]^s,F=r[27]^p,ne=r[36]^s,Z=r[37]^p,re=r[46]^s,ye=r[47]^p;s=f^(t<<1|c>>>31),p=d^(c<<1|t>>>31);const Ie=r[8]^s,st=r[9]^p,Qt=r[18]^s,ot=r[19]^p,Ye=r[28]^s,Xe=r[29]^p,et=r[38]^s,Se=r[39]^p,we=r[48]^s,_e=r[49]^p,Ir=m,Ar=b,Tr=y<<4|g>>>28,Mr=g<<4|y>>>28,Lr=w<<3|_>>>29,Pr=_<<3|w>>>29,Nr=C<<9|v>>>23,Or=v<<9|C>>>23,xr=S<<18|I>>>14,Dr=I<<18|S>>>14,jr=N<<1|D>>>31,Br=D<<1|N>>>31,Fr=z<<12|$>>>20,qr=$<<12|z>>>20,$r=X<<10|Y>>>22,Hr=Y<<10|X>>>22,Ur=T<<13|J>>>19,Wr=J<<13|T>>>19,Vr=M<<2|L>>>30,zr=L<<2|M>>>30,Jr=j<<30|x>>>2,Gr=x<<30|j>>>2,Zr=V<<6|B>>>26,Kr=B<<6|V>>>26,Qr=G<<11|q>>>21,Yr=q<<11|G>>>21,Xr=H<<15|k>>>17,en=k<<15|H>>>17,tn=P<<29|A>>>3,rn=A<<29|P>>>3,nn=U<<28|Q>>>4,sn=Q<<28|U>>>4,on=R<<23|E>>>9,an=E<<23|R>>>9,cn=O<<25|F>>>7,un=F<<25|O>>>7,ln=ne<<21|Z>>>11,dn=Z<<21|ne>>>11,fn=ye<<24|re>>>8,hn=re<<24|ye>>>8,gn=Ie<<27|st>>>5,pn=st<<27|Ie>>>5,mn=Qt<<20|ot>>>12,bn=ot<<20|Qt>>>12,yn=Xe<<7|Ye>>>25,wn=Ye<<7|Xe>>>25,_n=et<<8|Se>>>24,vn=Se<<8|et>>>24,En=we<<14|_e>>>18,Rn=_e<<14|we>>>18;r[0]=Ir^~Fr&Qr,r[1]=Ar^~qr&Yr,r[10]=nn^~mn&Lr,r[11]=sn^~bn&Pr,r[20]=jr^~Zr&cn,r[21]=Br^~Kr&un,r[30]=gn^~Tr&$r,r[31]=pn^~Mr&Hr,r[40]=Jr^~on&yn,r[41]=Gr^~an&wn,r[2]=Fr^~Qr&ln,r[3]=qr^~Yr&dn,r[12]=mn^~Lr&Ur,r[13]=bn^~Pr&Wr,r[22]=Zr^~cn&_n,r[23]=Kr^~un&vn,r[32]=Tr^~$r&Xr,r[33]=Mr^~Hr&en,r[42]=on^~yn&Nr,r[43]=an^~wn&Or,r[4]=Qr^~ln&En,r[5]=Yr^~dn&Rn,r[14]=Lr^~Ur&tn,r[15]=Pr^~Wr&rn,r[24]=cn^~_n&xr,r[25]=un^~vn&Dr,r[34]=$r^~Xr&fn,r[35]=Hr^~en&hn,r[44]=yn^~Nr&Vr,r[45]=wn^~Or&zr,r[6]=ln^~En&Ir,r[7]=dn^~Rn&Ar,r[16]=Ur^~tn&nn,r[17]=Wr^~rn&sn,r[26]=_n^~xr&jr,r[27]=vn^~Dr&Br,r[36]=Xr^~fn&gn,r[37]=en^~hn&pn,r[46]=Nr^~Vr&Jr,r[47]=Or^~zr&Gr,r[8]=En^~Ir&Fr,r[9]=Rn^~Ar&qr,r[18]=tn^~nn&mn,r[19]=rn^~sn&bn,r[28]=xr^~jr&Zr,r[29]=Dr^~Br&Kr,r[38]=fn^~gn&Tr,r[39]=hn^~pn&Mr,r[48]=Vr^~Jr&on,r[49]=zr^~Gr&an,r[0]^=e[n*2],r[1]^=e[n*2+1]}},Vn}var zn,ca;function Td(){if(ca)return zn;ca=1;const e=Ad();function r(){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 r.prototype.initialize=function(n,t){for(let c=0;c<50;++c)this.state[c]=0;this.blockSize=n/8,this.count=0,this.squeezing=!1},r.prototype.absorb=function(n){for(let t=0;t<n.length;++t)this.state[~~(this.count/4)]^=n[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(e.p1600(this.state),this.count=0)},r.prototype.absorbLastFewBits=function(n){this.state[~~(this.count/4)]^=n<<8*(this.count%4),(n&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},r.prototype.squeeze=function(n){this.squeezing||this.absorbLastFewBits(1);const t=K.alloc(n);for(let c=0;c<n;++c)t[c]=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},r.prototype.copy=function(n){for(let t=0;t<50;++t)n.state[t]=this.state[t];n.blockSize=this.blockSize,n.count=this.count,n.squeezing=this.squeezing},zn=r,zn}var Jn,ua;function Md(){return ua||(ua=1,Jn=Id()(Td())),Jn}var Gn,la;function cl(){if(la)return Gn;la=1;const e=Md(),r=pr();function n(o){return K.allocUnsafe(o).fill(0)}function t(o,u,s){const p=n(u);return o=i(o),s?o.length<u?(o.copy(p),p):o.slice(0,u):o.length<u?(o.copy(p,u-o.length),p):o.slice(-u)}function c(o,u){return t(o,u,!0)}function i(o){if(!K.isBuffer(o))if(Array.isArray(o))o=K.from(o);else if(typeof o=="string")f(o)?o=K.from(l(d(o)),"hex"):o=K.from(o);else if(typeof o=="number")o=intToBuffer(o);else if(o==null)o=K.allocUnsafe(0);else if(r.isBN(o))o=o.toArrayLike(K);else if(o.toArray)o=K.from(o.toArray());else throw new Error("invalid type");return o}function a(o){return o=i(o),"0x"+o.toString("hex")}function h(o,u){return o=i(o),u||(u=256),e("keccak"+u).update(o).digest()}function l(o){return o.length%2?"0"+o:o}function f(o){return typeof o=="string"&&o.match(/^0x[0-9A-Fa-f]*$/)}function d(o){return typeof o=="string"&&o.startsWith("0x")?o.slice(2):o}return Gn={zeros:n,setLength:t,setLengthRight:c,isHexString:f,stripHexPrefix:d,toBuffer:i,bufferToHex:a,keccak:h},Gn}var Zn,da;function Ld(){if(da)return Zn;da=1;const e=cl(),r=pr();function n(s){return s.startsWith("int[")?"int256"+s.slice(3):s==="int"?"int256":s.startsWith("uint[")?"uint256"+s.slice(4):s==="uint"?"uint256":s.startsWith("fixed[")?"fixed128x128"+s.slice(5):s==="fixed"?"fixed128x128":s.startsWith("ufixed[")?"ufixed128x128"+s.slice(6):s==="ufixed"?"ufixed128x128":s}function t(s){return parseInt(/^\D+(\d+)$/.exec(s)[1],10)}function c(s){var p=/^\D+(\d+)x(\d+)$/.exec(s);return[parseInt(p[1],10),parseInt(p[2],10)]}function i(s){var p=s.match(/(.*)\[(.*?)\]$/);return p?p[2]===""?"dynamic":parseInt(p[2],10):null}function a(s){var p=typeof s;if(p==="string")return e.isHexString(s)?new r(e.stripHexPrefix(s),16):new r(s,10);if(p==="number")return new r(s);if(s.toArray)return s;throw new Error("Argument is not a number")}function h(s,p){var m,b,g,y;if(s==="address")return h("uint160",a(p));if(s==="bool")return h("uint8",p?1:0);if(s==="string")return h("bytes",new K(p,"utf8"));if(f(s)){if(typeof p.length>"u")throw new Error("Not an array?");if(m=i(s),m!=="dynamic"&&m!==0&&p.length>m)throw new Error("Elements exceed array size: "+m);g=[],s=s.slice(0,s.lastIndexOf("[")),typeof p=="string"&&(p=JSON.parse(p));for(y in p)g.push(h(s,p[y]));if(m==="dynamic"){var w=h("uint256",p.length);g.unshift(w)}return K.concat(g)}else{if(s==="bytes")return p=new K(p),g=K.concat([h("uint256",p.length),p]),p.length%32!==0&&(g=K.concat([g,e.zeros(32-p.length%32)])),g;if(s.startsWith("bytes")){if(m=t(s),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);return e.setLengthRight(p,32)}else if(s.startsWith("uint")){if(m=t(s),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);if(b=a(p),b.bitLength()>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+b.bitLength());if(b<0)throw new Error("Supplied uint is negative");return b.toArrayLike(K,"be",32)}else if(s.startsWith("int")){if(m=t(s),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);if(b=a(p),b.bitLength()>m)throw new Error("Supplied int exceeds width: "+m+" vs "+b.bitLength());return b.toTwos(256).toArrayLike(K,"be",32)}else if(s.startsWith("ufixed")){if(m=c(s),b=a(p),b<0)throw new Error("Supplied ufixed is negative");return h("uint256",b.mul(new r(2).pow(new r(m[1]))))}else if(s.startsWith("fixed"))return m=c(s),h("int256",a(p).mul(new r(2).pow(new r(m[1]))))}throw new Error("Unsupported or invalid type: "+s)}function l(s){return s==="string"||s==="bytes"||i(s)==="dynamic"}function f(s){return s.lastIndexOf("]")===s.length-1}function d(s,p){var m=[],b=[],g=32*s.length;for(var y in s){var w=n(s[y]),_=p[y],v=h(w,_);l(w)?(m.push(h("uint256",g)),b.push(v),g+=v.length):m.push(v)}return K.concat(m.concat(b))}function o(s,p){if(s.length!==p.length)throw new Error("Number of types are not matching the values");for(var m,b,g=[],y=0;y<s.length;y++){var w=n(s[y]),_=p[y];if(w==="bytes")g.push(_);else if(w==="string")g.push(new K(_,"utf8"));else if(w==="bool")g.push(new K(_?"01":"00","hex"));else if(w==="address")g.push(e.setLength(_,20));else if(w.startsWith("bytes")){if(m=t(w),m<1||m>32)throw new Error("Invalid bytes<N> width: "+m);g.push(e.setLengthRight(_,m))}else if(w.startsWith("uint")){if(m=t(w),m%8||m<8||m>256)throw new Error("Invalid uint<N> width: "+m);if(b=a(_),b.bitLength()>m)throw new Error("Supplied uint exceeds width: "+m+" vs "+b.bitLength());g.push(b.toArrayLike(K,"be",m/8))}else if(w.startsWith("int")){if(m=t(w),m%8||m<8||m>256)throw new Error("Invalid int<N> width: "+m);if(b=a(_),b.bitLength()>m)throw new Error("Supplied int exceeds width: "+m+" vs "+b.bitLength());g.push(b.toTwos(m).toArrayLike(K,"be",m/8))}else throw new Error("Unsupported or invalid type: "+w)}return K.concat(g)}function u(s,p){return e.keccak(o(s,p))}return Zn={rawEncode:d,solidityPack:o,soliditySHA3:u},Zn}var Kn,fa;function Pd(){if(fa)return Kn;fa=1;const e=cl(),r=Ld(),n={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(i,a,h,l=!0){const f=["bytes32"],d=[this.hashType(i,h)];if(l){const o=(u,s,p)=>{if(h[s]!==void 0)return["bytes32",p==null?"0x0000000000000000000000000000000000000000000000000000000000000000":e.keccak(this.encodeData(s,p,h,l))];if(p===void 0)throw new Error(`missing value for field ${u} of type ${s}`);if(s==="bytes")return["bytes32",e.keccak(p)];if(s==="string")return typeof p=="string"&&(p=K.from(p,"utf8")),["bytes32",e.keccak(p)];if(s.lastIndexOf("]")===s.length-1){const m=s.slice(0,s.lastIndexOf("[")),b=p.map(g=>o(u,m,g));return["bytes32",e.keccak(r.rawEncode(b.map(([g])=>g),b.map(([,g])=>g)))]}return[s,p]};for(const u of h[i]){const[s,p]=o(u.name,u.type,a[u.name]);f.push(s),d.push(p)}}else for(const o of h[i]){let u=a[o.name];if(u!==void 0)if(o.type==="bytes")f.push("bytes32"),u=e.keccak(u),d.push(u);else if(o.type==="string")f.push("bytes32"),typeof u=="string"&&(u=K.from(u,"utf8")),u=e.keccak(u),d.push(u);else if(h[o.type]!==void 0)f.push("bytes32"),u=e.keccak(this.encodeData(o.type,u,h,l)),d.push(u);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");f.push(o.type),d.push(u)}}return r.rawEncode(f,d)},encodeType(i,a){let h="",l=this.findTypeDependencies(i,a).filter(f=>f!==i);l=[i].concat(l.sort());for(const f of l){if(!a[f])throw new Error("No type definition specified: "+f);h+=f+"("+a[f].map(({name:o,type:u})=>u+" "+o).join(",")+")"}return h},findTypeDependencies(i,a,h=[]){if(i=i.match(/^\w*/)[0],h.includes(i)||a[i]===void 0)return h;h.push(i);for(const l of a[i])for(const f of this.findTypeDependencies(l.type,a,h))!h.includes(f)&&h.push(f);return h},hashStruct(i,a,h,l=!0){return e.keccak(this.encodeData(i,a,h,l))},hashType(i,a){return e.keccak(this.encodeType(i,a))},sanitizeData(i){const a={};for(const h in n.properties)i[h]&&(a[h]=i[h]);return a.types&&(a.types=Object.assign({EIP712Domain:[]},a.types)),a},hash(i,a=!0){const h=this.sanitizeData(i),l=[K.from("1901","hex")];return l.push(this.hashStruct("EIP712Domain",h.domain,h.types,a)),h.primaryType!=="EIP712Domain"&&l.push(this.hashStruct(h.primaryType,h.message,h.types,a)),e.keccak(K.concat(l))}};Kn={TYPED_MESSAGE_SCHEMA:n,TypedDataUtils:t,hashForSignTypedDataLegacy:function(i){return c(i.data)},hashForSignTypedData_v3:function(i){return t.hash(i.data,!1)},hashForSignTypedData_v4:function(i){return t.hash(i.data)}};function c(i){const a=new Error("Expect argument to be non-empty array");if(typeof i!="object"||!i.length)throw a;const h=i.map(function(d){return d.type==="bytes"?e.toBuffer(d.value):d.value}),l=i.map(function(d){return d.type}),f=i.map(function(d){if(!d.name)throw a;return d.type+" "+d.name});return r.soliditySHA3(["bytes32","bytes32"],[r.soliditySHA3(new Array(i.length).fill("string"),f),r.soliditySHA3(l,h)])}return Kn}var Be={},ha;function Nd(){if(ha)return Be;ha=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.filterFromParam=Be.FilterPolyfill=void 0;const e=_r(),r=Re(),n=300*1e3,t={jsonrpc:"2.0",id:0};let c=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 s=i(u),p=this.makeFilterId(),m=await this.setInitialCursorPosition(p,s.fromBlock);return console.info(`Installing new log filter(${p}):`,s,"initial cursor position:",m),this.logFilters.set(p,s),this.setFilterTimeout(p),(0,r.hexStringFromIntNumber)(p)}async newBlockFilter(){const u=this.makeFilterId(),s=await this.setInitialCursorPosition(u,"latest");return console.info(`Installing new block filter (${u}) with initial cursor position:`,s),this.blockFilters.add(u),this.setFilterTimeout(u),(0,r.hexStringFromIntNumber)(u)}async newPendingTransactionFilter(){const u=this.makeFilterId(),s=await this.setInitialCursorPosition(u,"latest");return console.info(`Installing new block filter (${u}) with initial cursor position:`,s),this.pendingTransactionFilters.add(u),this.setFilterTimeout(u),(0,r.hexStringFromIntNumber)(u)}uninstallFilter(u){const s=(0,r.intNumberFromHexString)(u);return console.info(`Uninstalling filter (${s})`),this.deleteFilter(s),!0}getFilterChanges(u){const s=(0,r.intNumberFromHexString)(u);return this.timeouts.has(s)&&this.setFilterTimeout(s),this.logFilters.has(s)?this.getLogFilterChanges(s):this.blockFilters.has(s)?this.getBlockFilterChanges(s):this.pendingTransactionFilters.has(s)?this.getPendingTransactionFilterChanges(s):Promise.resolve(f())}async getFilterLogs(u){const s=(0,r.intNumberFromHexString)(u),p=this.logFilters.get(s);return p?this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[a(p)]})):f()}makeFilterId(){return(0,e.IntNumber)(++this.nextFilterId)}sendAsyncPromise(u){return new Promise((s,p)=>{this.provider.sendAsync(u,(m,b)=>{if(m)return p(m);if(Array.isArray(b)||b==null)return p(new Error(`unexpected response received: ${JSON.stringify(b)}`));s(b)})})}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 s=this.logFilters.get(u),p=this.cursors.get(u);if(!p||!s)return f();const m=await this.getCurrentBlockHeight(),b=s.toBlock==="latest"?m:s.toBlock;if(p>m||p>Number(s.toBlock))return d();console.info(`Fetching logs from ${p} to ${b} for filter ${u}`);const g=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getLogs",params:[a(Object.assign(Object.assign({},s),{fromBlock:p,toBlock:b}))]}));if(Array.isArray(g.result)){const y=g.result.map(_=>(0,r.intNumberFromHexString)(_.blockNumber||"0x0")),w=Math.max(...y);if(w&&w>p){const _=(0,e.IntNumber)(w+1);console.info(`Moving cursor position for filter (${u}) from ${p} to ${_}`),this.cursors.set(u,_)}}return g}async getBlockFilterChanges(u){const s=this.cursors.get(u);if(!s)return f();const p=await this.getCurrentBlockHeight();if(s>p)return d();console.info(`Fetching blocks from ${s} to ${p} for filter (${u})`);const m=(await Promise.all((0,r.range)(s,p+1).map(g=>this.getBlockHashByNumber((0,e.IntNumber)(g))))).filter(g=>!!g),b=(0,e.IntNumber)(s+m.length);return console.info(`Moving cursor position for filter (${u}) from ${s} to ${b}`),this.cursors.set(u,b),Object.assign(Object.assign({},t),{result:m})}async getPendingTransactionFilterChanges(u){return Promise.resolve(d())}async setInitialCursorPosition(u,s){const p=await this.getCurrentBlockHeight(),m=typeof s=="number"&&s>p?s:p;return this.cursors.set(u,m),m}setFilterTimeout(u){const s=this.timeouts.get(u);s&&window.clearTimeout(s);const p=window.setTimeout(()=>{console.info(`Filter (${u}) timed out`),this.deleteFilter(u)},n);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 s=await this._getCurrentBlockHeight();this.currentBlockHeight=s,this.resolvers.forEach(p=>p(s)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(s=>this.resolvers.push(s))}async _getCurrentBlockHeight(){const{result:u}=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_blockNumber",params:[]}));return(0,r.intNumberFromHexString)((0,r.ensureHexString)(u))}async getBlockHashByNumber(u){const s=await this.sendAsyncPromise(Object.assign(Object.assign({},t),{method:"eth_getBlockByNumber",params:[(0,r.hexStringFromIntNumber)(u),!1]}));return s.result&&typeof s.result.hash=="string"?(0,r.ensureHexString)(s.result.hash):null}};Be.FilterPolyfill=c;function i(o){return{fromBlock:h(o.fromBlock),toBlock:h(o.toBlock),addresses:o.address===void 0?null:Array.isArray(o.address)?o.address:[o.address],topics:o.topics||[]}}Be.filterFromParam=i;function a(o){const u={fromBlock:l(o.fromBlock),toBlock:l(o.toBlock),topics:o.topics};return o.addresses!==null&&(u.address=o.addresses),u}function h(o){if(o===void 0||o==="latest"||o==="pending")return"latest";if(o==="earliest")return(0,e.IntNumber)(0);if((0,r.isHexString)(o))return(0,r.intNumberFromHexString)(o);throw new Error(`Invalid block option: ${String(o)}`)}function l(o){return o==="latest"?o:(0,r.hexStringFromIntNumber)(o)}function f(){return Object.assign(Object.assign({},t),{error:{code:-32e3,message:"filter not found"}})}function d(){return Object.assign(Object.assign({},t),{result:[]})}return Be}var Pt={},Fe={},qe={},Qn,ga;function Ls(){if(ga)return Qn;ga=1,Qn=e;function e(r){r=r||{};var n=r.max||Number.MAX_SAFE_INTEGER,t=typeof r.start<"u"?r.start:Math.floor(Math.random()*n);return function(){return t=t%n,t++}}return Qn}var Yn,pa;function Od(){if(pa)return Yn;pa=1;const e=(r,n)=>function(){const t=n.promiseModule,c=new Array(arguments.length);for(let i=0;i<arguments.length;i++)c[i]=arguments[i];return new t((i,a)=>{n.errorFirst?c.push(function(h,l){if(n.multiArgs){const f=new Array(arguments.length-1);for(let d=1;d<arguments.length;d++)f[d-1]=arguments[d];h?(f.unshift(h),a(f)):i(f)}else h?a(h):i(l)}):c.push(function(h){if(n.multiArgs){const l=new Array(arguments.length-1);for(let f=0;f<arguments.length;f++)l[f]=arguments[f];i(l)}else i(h)}),r.apply(this,c)})};return Yn=(r,n)=>{n=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},n);const t=i=>{const a=h=>typeof h=="string"?i===h:h.test(i);return n.include?n.include.some(a):!n.exclude.some(a)};let c;typeof r=="function"?c=function(){return n.excludeMain?r.apply(this,arguments):e(r,n).apply(this,arguments)}:c=Object.create(Object.getPrototypeOf(r));for(const i in r){const a=r[i];c[i]=typeof a=="function"&&t(i)?e(a,n):a}return c},Yn}var $e={},or={},ma;function Ps(){if(ma)return or;ma=1,Object.defineProperty(or,"__esModule",{value:!0});const e=mr();function r(c,i,a){try{Reflect.apply(c,i,a)}catch(h){setTimeout(()=>{throw h})}}function n(c){const i=c.length,a=new Array(i);for(let h=0;h<i;h+=1)a[h]=c[h];return a}class t extends e.EventEmitter{emit(i,...a){let h=i==="error";const l=this._events;if(l!==void 0)h=h&&l.error===void 0;else if(!h)return!1;if(h){let d;if(a.length>0&&([d]=a),d instanceof Error)throw d;const o=new Error(`Unhandled error.${d?` (${d.message})`:""}`);throw o.context=d,o}const f=l[i];if(f===void 0)return!1;if(typeof f=="function")r(f,this,a);else{const d=f.length,o=n(f);for(let u=0;u<d;u+=1)r(o[u],this,a)}return!0}}return or.default=t,or}var ba;function ul(){if(ba)return $e;ba=1;var e=$e&&$e.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty($e,"__esModule",{value:!0}),$e.BaseBlockTracker=void 0;const r=e(Ps()),n=1e3,t=(h,l)=>h+l,c=["sync","latest"];let i=class extends r.default{constructor(l){super(),this._blockResetDuration=l.blockResetDuration||20*n,this._usePastBlocks=l.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(f=>this.once("latest",f))}removeAllListeners(l){return l?super.removeAllListeners(l):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(l){c.includes(l)&&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 c.map(l=>this.listenerCount(l)).reduce(t)}_shouldUseNewBlock(l){const f=this._currentBlock;if(!f)return!0;const d=a(l),o=a(f);return this._usePastBlocks&&d<o||d>o}_newPotentialLatest(l){this._shouldUseNewBlock(l)&&this._setCurrentBlock(l)}_setCurrentBlock(l){const f=this._currentBlock;this._currentBlock=l,this.emit("latest",l),this.emit("sync",{oldBlock:f,newBlock:l})}_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}};$e.BaseBlockTracker=i;function a(h){return Number.parseInt(h,16)}return $e}var Xn={},He={},fe={};class ll extends TypeError{constructor(r,n){let t;const{message:c,explanation:i,...a}=r,{path:h}=r,l=h.length===0?c:`At path: ${h.join(".")} -- ${c}`;super(i??l),i!=null&&(this.cause=l),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>t??(t=[r,...n()])}}function xd(e){return le(e)&&typeof e[Symbol.iterator]=="function"}function le(e){return typeof e=="object"&&e!=null}function ya(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function se(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Dd(e){const{done:r,value:n}=e.next();return r?void 0:n}function jd(e,r,n,t){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:c,branch:i}=r,{type:a}=n,{refinement:h,message:l=`Expected a value of type \`${a}\`${h?` with refinement \`${h}\``:""}, but received: \`${se(t)}\``}=e;return{value:t,type:a,refinement:h,key:c[c.length-1],path:c,branch:i,...e,message:l}}function*_s(e,r,n,t){xd(e)||(e=[e]);for(const c of e){const i=jd(c,r,n,t);i&&(yield i)}}function*Ns(e,r,n={}){const{path:t=[],branch:c=[e],coerce:i=!1,mask:a=!1}=n,h={path:t,branch:c};if(i&&(e=r.coercer(e,h),a&&r.type!=="type"&&le(r.schema)&&le(e)&&!Array.isArray(e)))for(const f in e)r.schema[f]===void 0&&delete e[f];let l="valid";for(const f of r.validator(e,h))f.explanation=n.message,l="not_valid",yield[f,void 0];for(let[f,d,o]of r.entries(e,h)){const u=Ns(d,o,{path:f===void 0?t:[...t,f],branch:f===void 0?c:[...c,d],coerce:i,mask:a,message:n.message});for(const s of u)s[0]?(l=s[0].refinement!=null?"not_refined":"not_valid",yield[s[0],void 0]):i&&(d=s[1],f===void 0?e=d:e instanceof Map?e.set(f,d):e instanceof Set?e.add(d):le(e)&&(d!==void 0||f in e)&&(e[f]=d))}if(l!=="not_valid")for(const f of r.refiner(e,h))f.explanation=n.message,l="not_refined",yield[f,void 0];l==="valid"&&(yield[void 0,e])}class ie{constructor(r){const{type:n,schema:t,validator:c,refiner:i,coercer:a=l=>l,entries:h=function*(){}}=r;this.type=n,this.schema=t,this.entries=h,this.coercer=a,c?this.validator=(l,f)=>{const d=c(l,f);return _s(d,f,this,l)}:this.validator=()=>[],i?this.refiner=(l,f)=>{const d=i(l,f);return _s(d,f,this,l)}:this.refiner=()=>[]}assert(r,n){return dl(r,this,n)}create(r,n){return fl(r,this,n)}is(r){return Os(r,this)}mask(r,n){return hl(r,this,n)}validate(r,n={}){return it(r,this,n)}}function dl(e,r,n){const t=it(e,r,{message:n});if(t[0])throw t[0]}function fl(e,r,n){const t=it(e,r,{coerce:!0,message:n});if(t[0])throw t[0];return t[1]}function hl(e,r,n){const t=it(e,r,{coerce:!0,mask:!0,message:n});if(t[0])throw t[0];return t[1]}function Os(e,r){return!it(e,r)[0]}function it(e,r,n={}){const t=Ns(e,r,n),c=Dd(t);return c[0]?[new ll(c[0],function*(){for(const a of t)a[0]&&(yield a[0])}),void 0]:[void 0,c[1]]}function Bd(...e){const r=e[0].type==="type",n=e.map(c=>c.schema),t=Object.assign({},...n);return r?Jt(t):zt(t)}function ue(e,r){return new ie({type:e,schema:null,validator:r})}function Fd(e,r){return new ie({...e,refiner:(n,t)=>n===void 0||e.refiner(n,t),validator(n,t){return n===void 0?!0:(r(n,t),e.validator(n,t))}})}function qd(e){return new ie({type:"dynamic",schema:null,*entries(r,n){yield*e(r,n).entries(r,n)},validator(r,n){return e(r,n).validator(r,n)},coercer(r,n){return e(r,n).coercer(r,n)},refiner(r,n){return e(r,n).refiner(r,n)}})}function $d(e){let r;return new ie({type:"lazy",schema:null,*entries(n,t){r??(r=e()),yield*r.entries(n,t)},validator(n,t){return r??(r=e()),r.validator(n,t)},coercer(n,t){return r??(r=e()),r.coercer(n,t)},refiner(n,t){return r??(r=e()),r.refiner(n,t)}})}function Hd(e,r){const{schema:n}=e,t={...n};for(const c of r)delete t[c];switch(e.type){case"type":return Jt(t);default:return zt(t)}}function Ud(e){const r=e instanceof ie,n=r?{...e.schema}:{...e};for(const t in n)n[t]=gl(n[t]);return r&&e.type==="type"?Jt(n):zt(n)}function Wd(e,r){const{schema:n}=e,t={};for(const c of r)t[c]=n[c];switch(e.type){case"type":return Jt(t);default:return zt(t)}}function Vd(e,r){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ue(e,r)}function zd(){return ue("any",()=>!0)}function Jd(e){return new ie({type:"array",schema:e,*entries(r){if(e&&Array.isArray(r))for(const[n,t]of r.entries())yield[n,t,e]},coercer(r){return Array.isArray(r)?r.slice():r},validator(r){return Array.isArray(r)||`Expected an array value, but received: ${se(r)}`}})}function Gd(){return ue("bigint",e=>typeof e=="bigint")}function Zd(){return ue("boolean",e=>typeof e=="boolean")}function Kd(){return ue("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${se(e)}`)}function Qd(e){const r={},n=e.map(t=>se(t)).join();for(const t of e)r[t]=t;return new ie({type:"enums",schema:r,validator(t){return e.includes(t)||`Expected one of \`${n}\`, but received: ${se(t)}`}})}function Yd(){return ue("func",e=>typeof e=="function"||`Expected a function, but received: ${se(e)}`)}function Xd(e){return ue("instance",r=>r instanceof e||`Expected a \`${e.name}\` instance, but received: ${se(r)}`)}function ef(){return ue("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${se(e)}`)}function tf(e){return new ie({type:"intersection",schema:null,*entries(r,n){for(const t of e)yield*t.entries(r,n)},*validator(r,n){for(const t of e)yield*t.validator(r,n)},*refiner(r,n){for(const t of e)yield*t.refiner(r,n)}})}function rf(e){const r=se(e),n=typeof e;return new ie({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?e:null,validator(t){return t===e||`Expected the literal \`${r}\`, but received: ${se(t)}`}})}function nf(e,r){return new ie({type:"map",schema:null,*entries(n){if(e&&r&&n instanceof Map)for(const[t,c]of n.entries())yield[t,t,e],yield[t,c,r]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${se(n)}`}})}function xs(){return ue("never",()=>!1)}function sf(e){return new ie({...e,validator:(r,n)=>r===null||e.validator(r,n),refiner:(r,n)=>r===null||e.refiner(r,n)})}function of(){return ue("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${se(e)}`)}function zt(e){const r=e?Object.keys(e):[],n=xs();return new ie({type:"object",schema:e||null,*entries(t){if(e&&le(t)){const c=new Set(Object.keys(t));for(const i of r)c.delete(i),yield[i,t[i],e[i]];for(const i of c)yield[i,t[i],n]}},validator(t){return le(t)||`Expected an object, but received: ${se(t)}`},coercer(t){return le(t)?{...t}:t}})}function gl(e){return new ie({...e,validator:(r,n)=>r===void 0||e.validator(r,n),refiner:(r,n)=>r===void 0||e.refiner(r,n)})}function af(e,r){return new ie({type:"record",schema:null,*entries(n){if(le(n))for(const t in n){const c=n[t];yield[t,t,e],yield[t,c,r]}},validator(n){return le(n)||`Expected an object, but received: ${se(n)}`}})}function cf(){return ue("regexp",e=>e instanceof RegExp)}function uf(e){return new ie({type:"set",schema:null,*entries(r){if(e&&r instanceof Set)for(const n of r)yield[n,n,e]},coercer(r){return r instanceof Set?new Set(r):r},validator(r){return r instanceof Set||`Expected a \`Set\` object, but received: ${se(r)}`}})}function pl(){return ue("string",e=>typeof e=="string"||`Expected a string, but received: ${se(e)}`)}function lf(e){const r=xs();return new ie({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const t=Math.max(e.length,n.length);for(let c=0;c<t;c++)yield[c,n[c],e[c]||r]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${se(n)}`}})}function Jt(e){const r=Object.keys(e);return new ie({type:"type",schema:e,*entries(n){if(le(n))for(const t of r)yield[t,n[t],e[t]]},validator(n){return le(n)||`Expected an object, but received: ${se(n)}`},coercer(n){return le(n)?{...n}:n}})}function df(e){const r=e.map(n=>n.type).join(" | ");return new ie({type:"union",schema:null,coercer(n){for(const t of e){const[c,i]=t.validate(n,{coerce:!0});if(!c)return i}return n},validator(n,t){const c=[];for(const i of e){const[...a]=Ns(n,i,t),[h]=a;if(h[0])for(const[l]of a)l&&c.push(l);else return[]}return[`Expected the value to satisfy a union of \`${r}\`, but received: ${se(n)}`,...c]}})}function ml(){return ue("unknown",()=>!0)}function Ds(e,r,n){return new ie({...e,coercer:(t,c)=>Os(t,r)?e.coercer(n(t,c),c):e.coercer(t,c)})}function ff(e,r,n={}){return Ds(e,ml(),t=>{const c=typeof r=="function"?r():r;if(t===void 0)return c;if(!n.strict&&ya(t)&&ya(c)){const i={...t};let a=!1;for(const h in c)i[h]===void 0&&(i[h]=c[h],a=!0);if(a)return i}return t})}function hf(e){return Ds(e,pl(),r=>r.trim())}function gf(e){return Ze(e,"empty",r=>{const n=bl(r);return n===0||`Expected an empty ${e.type} but received one with a size of \`${n}\``})}function bl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function pf(e,r,n={}){const{exclusive:t}=n;return Ze(e,"max",c=>t?c<r:c<=r||`Expected a ${e.type} less than ${t?"":"or equal to "}${r} but received \`${c}\``)}function mf(e,r,n={}){const{exclusive:t}=n;return Ze(e,"min",c=>t?c>r:c>=r||`Expected a ${e.type} greater than ${t?"":"or equal to "}${r} but received \`${c}\``)}function bf(e){return Ze(e,"nonempty",r=>bl(r)>0||`Expected a nonempty ${e.type} but received an empty one`)}function yf(e,r){return Ze(e,"pattern",n=>r.test(n)||`Expected a ${e.type} matching \`/${r.source}/\` but received "${n}"`)}function wf(e,r,n=r){const t=`Expected a ${e.type}`,c=r===n?`of \`${r}\``:`between \`${r}\` and \`${n}\``;return Ze(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return r<=i&&i<=n||`${t} ${c} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:a}=i;return r<=a&&a<=n||`${t} with a size ${c} but received one with a size of \`${a}\``}else{const{length:a}=i;return r<=a&&a<=n||`${t} with a length ${c} but received one with a length of \`${a}\``}})}function Ze(e,r,n){return new ie({...e,*refiner(t,c){yield*e.refiner(t,c);const i=n(t,c),a=_s(i,c,e,t);for(const h of a)yield{...h,refinement:r}}})}const _f=Object.freeze(Object.defineProperty({__proto__:null,Struct:ie,StructError:ll,any:zd,array:Jd,assert:dl,assign:Bd,bigint:Gd,boolean:Zd,coerce:Ds,create:fl,date:Kd,defaulted:ff,define:ue,deprecated:Fd,dynamic:qd,empty:gf,enums:Qd,func:Yd,instance:Xd,integer:ef,intersection:tf,is:Os,lazy:$d,literal:rf,map:nf,mask:hl,max:pf,min:mf,never:xs,nonempty:bf,nullable:sf,number:of,object:zt,omit:Hd,optional:gl,partial:Ud,pattern:yf,pick:Wd,record:af,refine:Ze,regexp:cf,set:uf,size:wf,string:pl,struct:Vd,trimmed:hf,tuple:lf,type:Jt,union:df,unknown:ml,validate:it},Symbol.toStringTag,{value:"Module"})),Ke=Ut(_f);var wa;function ke(){if(wa)return fe;wa=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.assertExhaustive=fe.assertStruct=fe.assert=fe.AssertionError=void 0;const e=Ke;function r(f){return typeof f=="object"&&f!==null&&"message"in f}function n(f){var d,o;return typeof((o=(d=f==null?void 0:f.prototype)===null||d===void 0?void 0:d.constructor)===null||o===void 0?void 0:o.name)=="string"}function t(f){const d=r(f)?f.message:String(f);return d.endsWith(".")?d.slice(0,-1):d}function c(f,d){return n(f)?new f({message:d}):f({message:d})}class i extends Error{constructor(d){super(d.message),this.code="ERR_ASSERTION"}}fe.AssertionError=i;function a(f,d="Assertion failed.",o=i){if(!f)throw d instanceof Error?d:c(o,d)}fe.assert=a;function h(f,d,o="Assertion failed",u=i){try{(0,e.assert)(f,d)}catch(s){throw c(u,`${o}: ${t(s)}.`)}}fe.assertStruct=h;function l(f){throw new Error("Invalid branch reached. Should be detected during compilation.")}return fe.assertExhaustive=l,fe}var Nt={},_a;function yl(){if(_a)return Nt;_a=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.base64=void 0;const e=Ke,r=ke(),n=(t,c={})=>{var i,a;const h=(i=c.paddingRequired)!==null&&i!==void 0?i:!1,l=(a=c.characterSet)!==null&&a!==void 0?a:"base64";let f;l==="base64"?f=String.raw`[A-Za-z0-9+\/]`:((0,r.assert)(l==="base64url"),f=String.raw`[-_A-Za-z0-9]`);let d;return h?d=new RegExp(`^(?:${f}{4})*(?:${f}{3}=|${f}{2}==)?$`,"u"):d=new RegExp(`^(?:${f}{4})*(?:${f}{2,3}|${f}{3}=|${f}{2}==)?$`,"u"),(0,e.pattern)(t,d)};return Nt.base64=n,Nt}var ee={},ei={},va;function Er(){return va||(va=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 r=Ke,n=ke();e.HexStruct=(0,r.pattern)((0,r.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,r.pattern)((0,r.string)(),/^0x[0-9a-f]+$/iu);function t(f){return(0,r.is)(f,e.HexStruct)}e.isHexString=t;function c(f){return(0,r.is)(f,e.StrictHexStruct)}e.isStrictHexString=c;function i(f){(0,n.assert)(t(f),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function a(f){(0,n.assert)(c(f),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function h(f){return f.startsWith("0x")?f:f.startsWith("0X")?`0x${f.substring(2)}`:`0x${f}`}e.add0x=h;function l(f){return f.startsWith("0x")||f.startsWith("0X")?f.substring(2):f}e.remove0x=l})(ei)),ei}var Ea;function wl(){if(Ea)return ee;Ea=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.createDataView=ee.concatBytes=ee.valueToBytes=ee.stringToBytes=ee.numberToBytes=ee.signedBigIntToBytes=ee.bigIntToBytes=ee.hexToBytes=ee.bytesToString=ee.bytesToNumber=ee.bytesToSignedBigInt=ee.bytesToBigInt=ee.bytesToHex=ee.assertIsBytes=ee.isBytes=void 0;const e=ke(),r=Er(),n=48,t=58,c=87;function i(){const S=[];return()=>{if(S.length===0)for(let I=0;I<256;I++)S.push(I.toString(16).padStart(2,"0"));return S}}const a=i();function h(S){return S instanceof Uint8Array}ee.isBytes=h;function l(S){(0,e.assert)(h(S),"Value must be a Uint8Array.")}ee.assertIsBytes=l;function f(S){if(l(S),S.length===0)return"0x";const I=a(),N=new Array(S.length);for(let D=0;D<S.length;D++)N[D]=I[S[D]];return(0,r.add0x)(N.join(""))}ee.bytesToHex=f;function d(S){l(S);const I=f(S);return BigInt(I)}ee.bytesToBigInt=d;function o(S){l(S);let I=BigInt(0);for(const N of S)I=(I<<BigInt(8))+BigInt(N);return BigInt.asIntN(S.length*8,I)}ee.bytesToSignedBigInt=o;function u(S){l(S);const I=d(S);return(0,e.assert)(I<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(I)}ee.bytesToNumber=u;function s(S){return l(S),new TextDecoder().decode(S)}ee.bytesToString=s;function p(S){var I;if(((I=S==null?void 0:S.toLowerCase)===null||I===void 0?void 0:I.call(S))==="0x")return new Uint8Array;(0,r.assertIsHexString)(S);const N=(0,r.remove0x)(S).toLowerCase(),D=N.length%2===0?N:`0${N}`,$=new Uint8Array(D.length/2);for(let z=0;z<$.length;z++){const X=D.charCodeAt(z*2),Y=D.charCodeAt(z*2+1),J=X-(X<t?n:c),T=Y-(Y<t?n:c);$[z]=J*16+T}return $}ee.hexToBytes=p;function m(S){(0,e.assert)(typeof S=="bigint","Value must be a bigint."),(0,e.assert)(S>=BigInt(0),"Value must be a non-negative bigint.");const I=S.toString(16);return p(I)}ee.bigIntToBytes=m;function b(S,I){(0,e.assert)(I>0);const N=S>>BigInt(31);return!((~S&N)+(S&~N)>>BigInt(I*8+-1))}function g(S,I){(0,e.assert)(typeof S=="bigint","Value must be a bigint."),(0,e.assert)(typeof I=="number","Byte length must be a number."),(0,e.assert)(I>0,"Byte length must be greater than 0."),(0,e.assert)(b(S,I),"Byte length is too small to represent the given value.");let N=S;const D=new Uint8Array(I);for(let $=0;$<D.length;$++)D[$]=Number(BigInt.asUintN(8,N)),N>>=BigInt(8);return D.reverse()}ee.signedBigIntToBytes=g;function y(S){(0,e.assert)(typeof S=="number","Value must be a number."),(0,e.assert)(S>=0,"Value must be a non-negative number."),(0,e.assert)(Number.isSafeInteger(S),"Value is not a safe integer. Use `bigIntToBytes` instead.");const I=S.toString(16);return p(I)}ee.numberToBytes=y;function w(S){return(0,e.assert)(typeof S=="string","Value must be a string."),new TextEncoder().encode(S)}ee.stringToBytes=w;function _(S){if(typeof S=="bigint")return m(S);if(typeof S=="number")return y(S);if(typeof S=="string")return S.startsWith("0x")?p(S):w(S);if(h(S))return S;throw new TypeError(`Unsupported value type: "${typeof S}".`)}ee.valueToBytes=_;function v(S){const I=new Array(S.length);let N=0;for(let $=0;$<S.length;$++){const z=_(S[$]);I[$]=z,N+=z.length}const D=new Uint8Array(N);for(let $=0,z=0;$<I.length;$++)D.set(I[$],z),z+=I[$].length;return D}ee.concatBytes=v;function C(S){if(typeof K<"u"&&S instanceof K){const I=S.buffer.slice(S.byteOffset,S.byteOffset+S.byteLength);return new DataView(I)}return new DataView(S.buffer,S.byteOffset,S.byteLength)}return ee.createDataView=C,ee}var Ot={},Ra;function vf(){if(Ra)return Ot;Ra=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.ChecksumStruct=void 0;const e=Ke,r=yl();return Ot.ChecksumStruct=(0,e.size)((0,r.base64)((0,e.string)(),{paddingRequired:!0}),44,44),Ot}var he={},Sa;function Ef(){if(Sa)return he;Sa=1,Object.defineProperty(he,"__esModule",{value:!0}),he.createHex=he.createBytes=he.createBigInt=he.createNumber=void 0;const e=Ke,r=ke(),n=wl(),t=Er(),c=(0,e.union)([(0,e.number)(),(0,e.bigint)(),(0,e.string)(),t.StrictHexStruct]),i=(0,e.coerce)((0,e.number)(),c,Number),a=(0,e.coerce)((0,e.bigint)(),c,BigInt);(0,e.union)([t.StrictHexStruct,(0,e.instance)(Uint8Array)]);const h=(0,e.coerce)((0,e.instance)(Uint8Array),(0,e.union)([t.StrictHexStruct]),n.hexToBytes),l=(0,e.coerce)(t.StrictHexStruct,(0,e.instance)(Uint8Array),n.bytesToHex);function f(s){try{const p=(0,e.create)(s,i);return(0,r.assert)(Number.isFinite(p),`Expected a number-like value, got "${s}".`),p}catch(p){throw p instanceof e.StructError?new Error(`Expected a number-like value, got "${s}".`):p}}he.createNumber=f;function d(s){try{return(0,e.create)(s,a)}catch(p){throw p instanceof e.StructError?new Error(`Expected a number-like value, got "${String(p.value)}".`):p}}he.createBigInt=d;function o(s){if(typeof s=="string"&&s.toLowerCase()==="0x")return new Uint8Array;try{return(0,e.create)(s,h)}catch(p){throw p instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(p.value)}".`):p}}he.createBytes=o;function u(s){if(s instanceof Uint8Array&&s.length===0||typeof s=="string"&&s.toLowerCase()==="0x")return"0x";try{return(0,e.create)(s,l)}catch(p){throw p instanceof e.StructError?new Error(`Expected a bytes-like value, got "${String(p.value)}".`):p}}return he.createHex=u,he}var ge={},Ca;function Rf(){if(Ca)return ge;Ca=1;var e=ge&&ge.__classPrivateFieldSet||function(a,h,l,f,d){if(f==="m")throw new TypeError("Private method is not writable");if(f==="a"&&!d)throw new TypeError("Private accessor was defined without a setter");if(typeof h=="function"?a!==h||!d:!h.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return f==="a"?d.call(a,l):d?d.value=l:h.set(a,l),l},r=ge&&ge.__classPrivateFieldGet||function(a,h,l,f){if(l==="a"&&!f)throw new TypeError("Private accessor was defined without a getter");if(typeof h=="function"?a!==h||!f:!h.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return l==="m"?f:l==="a"?f.call(a):f?f.value:h.get(a)},n,t;Object.defineProperty(ge,"__esModule",{value:!0}),ge.FrozenSet=ge.FrozenMap=void 0;class c{constructor(h){n.set(this,void 0),e(this,n,new Map(h),"f"),Object.freeze(this)}get size(){return r(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return r(this,n,"f")[Symbol.iterator]()}entries(){return r(this,n,"f").entries()}forEach(h,l){return r(this,n,"f").forEach((f,d,o)=>h.call(l,f,d,this))}get(h){return r(this,n,"f").get(h)}has(h){return r(this,n,"f").has(h)}keys(){return r(this,n,"f").keys()}values(){return r(this,n,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([h,l])=>`${String(h)} => ${String(l)}`).join(", ")} `:""}}`}}ge.FrozenMap=c;class i{constructor(h){t.set(this,void 0),e(this,t,new Set(h),"f"),Object.freeze(this)}get size(){return r(this,t,"f").size}[(t=new WeakMap,Symbol.iterator)](){return r(this,t,"f")[Symbol.iterator]()}entries(){return r(this,t,"f").entries()}forEach(h,l){return r(this,t,"f").forEach((f,d,o)=>h.call(l,f,d,this))}has(h){return r(this,t,"f").has(h)}keys(){return r(this,t,"f").keys()}values(){return r(this,t,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(h=>String(h)).join(", ")} `:""}}`}}return ge.FrozenSet=i,Object.freeze(c),Object.freeze(c.prototype),Object.freeze(i),Object.freeze(i.prototype),ge}var ti={},ka;function Sf(){return ka||(ka=1,Object.defineProperty(ti,"__esModule",{value:!0})),ti}var ri={},Ia;function Cf(){return Ia||(Ia=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 r=Ke,n=ke(),t=()=>(0,r.define)("finite number",v=>(0,r.is)(v,(0,r.number)())&&Number.isFinite(v));e.UnsafeJsonStruct=(0,r.union)([(0,r.literal)(null),(0,r.boolean)(),t(),(0,r.string)(),(0,r.array)((0,r.lazy)(()=>e.UnsafeJsonStruct)),(0,r.record)((0,r.string)(),(0,r.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,r.define)("Json",(v,C)=>{function S(I,N){const $=[...N.validator(I,C)];return $.length>0?$:!0}try{const I=S(v,e.UnsafeJsonStruct);return I!==!0?I:S(JSON.parse(JSON.stringify(v)),e.UnsafeJsonStruct)}catch(I){return I instanceof RangeError?"Circular reference detected":!1}});function c(v){return(0,r.is)(v,e.JsonStruct)}e.isValidJson=c;function i(v){(0,n.assertStruct)(v,e.JsonStruct,"Invalid JSON value");const C=JSON.stringify(v);return new TextEncoder().encode(C).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,r.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,r.nullable)((0,r.union)([(0,r.number)(),(0,r.string)()])),e.JsonRpcErrorStruct=(0,r.object)({code:(0,r.integer)(),message:(0,r.string)(),data:(0,r.optional)(e.JsonStruct),stack:(0,r.optional)((0,r.string)())}),e.JsonRpcParamsStruct=(0,r.optional)((0,r.union)([(0,r.record)((0,r.string)(),e.JsonStruct),(0,r.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,r.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,r.omit)(e.JsonRpcRequestStruct,["id"]);function a(v){return(0,r.is)(v,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function h(v,C){(0,n.assertStruct)(v,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",C)}e.assertIsJsonRpcNotification=h;function l(v){return(0,r.is)(v,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=l;function f(v,C){(0,n.assertStruct)(v,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",C)}e.assertIsJsonRpcRequest=f,e.PendingJsonRpcResponseStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,r.optional)((0,r.unknown)()),error:(0,r.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,r.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,r.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function d(v){return(0,r.is)(v,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=d;function o(v,C){(0,n.assertStruct)(v,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",C)}e.assertIsPendingJsonRpcResponse=o;function u(v){return(0,r.is)(v,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=u;function s(v,C){(0,n.assertStruct)(v,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",C)}e.assertIsJsonRpcResponse=s;function p(v){return(0,r.is)(v,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=p;function m(v,C){(0,n.assertStruct)(v,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",C)}e.assertIsJsonRpcSuccess=m;function b(v){return(0,r.is)(v,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=b;function g(v,C){(0,n.assertStruct)(v,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",C)}e.assertIsJsonRpcFailure=g;function y(v){return(0,r.is)(v,e.JsonRpcErrorStruct)}e.isJsonRpcError=y;function w(v,C){(0,n.assertStruct)(v,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",C)}e.assertIsJsonRpcError=w;function _(v){const{permitEmptyString:C,permitFractions:S,permitNull:I}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},v);return D=>!!(typeof D=="number"&&(S||Number.isInteger(D))||typeof D=="string"&&(C||D.length>0)||I&&D===null)}e.getJsonRpcIdValidator=_})(ri)),ri}var ni={},Aa;function kf(){return Aa||(Aa=1,Object.defineProperty(ni,"__esModule",{value:!0})),ni}var Ee={},ar={exports:{}},ii,Ta;function If(){if(Ta)return ii;Ta=1;var e=1e3,r=e*60,n=r*60,t=n*24,c=t*7,i=t*365.25;ii=function(d,o){o=o||{};var u=typeof d;if(u==="string"&&d.length>0)return a(d);if(u==="number"&&isFinite(d))return o.long?l(d):h(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function a(d){if(d=String(d),!(d.length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(o){var u=parseFloat(o[1]),s=(o[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return u*i;case"weeks":case"week":case"w":return u*c;case"days":case"day":case"d":return u*t;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;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 h(d){var o=Math.abs(d);return o>=t?Math.round(d/t)+"d":o>=n?Math.round(d/n)+"h":o>=r?Math.round(d/r)+"m":o>=e?Math.round(d/e)+"s":d+"ms"}function l(d){var o=Math.abs(d);return o>=t?f(d,o,t,"day"):o>=n?f(d,o,n,"hour"):o>=r?f(d,o,r,"minute"):o>=e?f(d,o,e,"second"):d+" ms"}function f(d,o,u,s){var p=o>=u*1.5;return Math.round(d/u)+" "+s+(p?"s":"")}return ii}var si,Ma;function Af(){if(Ma)return si;Ma=1;function e(r){t.debug=t,t.default=t,t.coerce=f,t.disable=h,t.enable=i,t.enabled=l,t.humanize=If(),t.destroy=d,Object.keys(r).forEach(o=>{t[o]=r[o]}),t.names=[],t.skips=[],t.formatters={};function n(o){let u=0;for(let s=0;s<o.length;s++)u=(u<<5)-u+o.charCodeAt(s),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=n;function t(o){let u,s=null,p,m;function b(...g){if(!b.enabled)return;const y=b,w=Number(new Date),_=w-(u||w);y.diff=_,y.prev=u,y.curr=w,u=w,g[0]=t.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let v=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(S,I)=>{if(S==="%%")return"%";v++;const N=t.formatters[I];if(typeof N=="function"){const D=g[v];S=N.call(y,D),g.splice(v,1),v--}return S}),t.formatArgs.call(y,g),(y.log||t.log).apply(y,g)}return b.namespace=o,b.useColors=t.useColors(),b.color=t.selectColor(o),b.extend=c,b.destroy=t.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>s!==null?s:(p!==t.namespaces&&(p=t.namespaces,m=t.enabled(o)),m),set:g=>{s=g}}),typeof t.init=="function"&&t.init(b),b}function c(o,u){const s=t(this.namespace+(typeof u>"u"?":":u)+o);return s.log=this.log,s}function i(o){t.save(o),t.namespaces=o,t.names=[],t.skips=[];const u=(typeof o=="string"?o:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const s of u)s[0]==="-"?t.skips.push(s.slice(1)):t.names.push(s)}function a(o,u){let s=0,p=0,m=-1,b=0;for(;s<o.length;)if(p<u.length&&(u[p]===o[s]||u[p]==="*"))u[p]==="*"?(m=p,b=s,p++):(s++,p++);else if(m!==-1)p=m+1,b++,s=b;else return!1;for(;p<u.length&&u[p]==="*";)p++;return p===u.length}function h(){const o=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),o}function l(o){for(const u of t.skips)if(a(o,u))return!1;for(const u of t.names)if(a(o,u))return!0;return!1}function f(o){return o instanceof Error?o.stack||o.message:o}function d(){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 si=e,si}var La;function Tf(){return La||(La=1,(function(e,r){var n={};r.formatArgs=c,r.save=i,r.load=a,r.useColors=t,r.storage=h(),r.destroy=(()=>{let f=!1;return()=>{f||(f=!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`."))}})(),r.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 f;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&&(f=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(f[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function c(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const d="color: "+this.color;f.splice(1,0,d,"color: inherit");let o=0,u=0;f[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(o++,s==="%c"&&(u=o))}),f.splice(u,0,d)}r.log=console.debug||console.log||(()=>{});function i(f){try{f?r.storage.setItem("debug",f):r.storage.removeItem("debug")}catch{}}function a(){let f;try{f=r.storage.getItem("debug")||r.storage.getItem("DEBUG")}catch{}return!f&&typeof te<"u"&&"env"in te&&(f=n.DEBUG),f}function h(){try{return localStorage}catch{}}e.exports=Af()(r);const{formatters:l}=e.exports;l.j=function(f){try{return JSON.stringify(f)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}})(ar,ar.exports)),ar.exports}var Pa;function Mf(){if(Pa)return Ee;Pa=1;var e=Ee&&Ee.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.createModuleLogger=Ee.createProjectLogger=void 0;const n=(0,e(Tf()).default)("metamask");function t(i){return n.extend(i)}Ee.createProjectLogger=t;function c(i,a){return i.extend(a)}return Ee.createModuleLogger=c,Ee}var oi={},Na;function Lf(){return Na||(Na=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 r(f){return Array.isArray(f)&&f.length>0}e.isNonEmptyArray=r;function n(f){return f==null}e.isNullOrUndefined=n;function t(f){return!!f&&typeof f=="object"&&!Array.isArray(f)}e.isObject=t;const c=(f,d)=>Object.hasOwnProperty.call(f,d);e.hasProperty=c,(function(f){f[f.Null=4]="Null",f[f.Comma=1]="Comma",f[f.Wrapper=1]="Wrapper",f[f.True=4]="True",f[f.False=5]="False",f[f.Quote=1]="Quote",f[f.Colon=1]="Colon",f[f.Date=24]="Date"})(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(f){if(typeof f!="object"||f===null)return!1;try{let d=f;for(;Object.getPrototypeOf(d)!==null;)d=Object.getPrototypeOf(d);return Object.getPrototypeOf(f)===d}catch{return!1}}e.isPlainObject=i;function a(f){return f.charCodeAt(0)<=127}e.isASCII=a;function h(f){var d;return f.split("").reduce((u,s)=>a(s)?u+1:u+2,0)+((d=f.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&d!==void 0?d:[]).length}e.calculateStringSize=h;function l(f){return f.toString().length}e.calculateNumberSize=l})(oi)),oi}var pe={},Oa;function Pf(){if(Oa)return pe;Oa=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.hexToBigInt=pe.hexToNumber=pe.bigIntToHex=pe.numberToHex=void 0;const e=ke(),r=Er(),n=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 `bigIntToHex` instead."),(0,r.add0x)(a.toString(16)));pe.numberToHex=n;const t=a=>((0,e.assert)(typeof a=="bigint","Value must be a bigint."),(0,e.assert)(a>=0,"Value must be a non-negative bigint."),(0,r.add0x)(a.toString(16)));pe.bigIntToHex=t;const c=a=>{(0,r.assertIsHexString)(a);const h=parseInt(a,16);return(0,e.assert)(Number.isSafeInteger(h),"Value is not a safe integer. Use `hexToBigInt` instead."),h};pe.hexToNumber=c;const i=a=>((0,r.assertIsHexString)(a),BigInt((0,r.add0x)(a)));return pe.hexToBigInt=i,pe}var ai={},xa;function Nf(){return xa||(xa=1,Object.defineProperty(ai,"__esModule",{value:!0})),ai}var ci={},Da;function Of(){return Da||(Da=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,(function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"})(e.Duration||(e.Duration={}));const r=i=>Number.isInteger(i)&&i>=0,n=(i,a)=>{if(!r(i))throw new Error(`"${a}" must be a non-negative integer. Received: "${i}".`)};function t(i,a){return n(i,"count"),i*a}e.inMilliseconds=t;function c(i){return n(i,"timestamp"),Date.now()-i}e.timeSince=c})(ci)),ci}var ui={},ja;function xf(){return ja||(ja=1,Object.defineProperty(ui,"__esModule",{value:!0})),ui}var li={},cr={exports:{}},di,Ba;function Gt(){if(Ba)return di;Ba=1;const e="2.0.0",r=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,t=16,c=r-6;return di={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},di}var fi,Fa;function Rr(){if(Fa)return fi;Fa=1;var e={};return fi=typeof te=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},fi}var qa;function Zt(){return qa||(qa=1,(function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:t,MAX_LENGTH:c}=Gt(),i=Rr();r=e.exports={};const a=r.re=[],h=r.safeRe=[],l=r.src=[],f=r.safeSrc=[],d=r.t={};let o=0;const u="[a-zA-Z0-9-]",s=[["\\s",1],["\\d",c],[u,t]],p=b=>{for(const[g,y]of s)b=b.split(`${g}*`).join(`${g}{0,${y}}`).split(`${g}+`).join(`${g}{1,${y}}`);return b},m=(b,g,y)=>{const w=p(g),_=o++;i(b,_,g),d[b]=_,l[_]=g,f[_]=w,a[_]=new RegExp(g,y?"g":void 0),h[_]=new RegExp(w,y?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),m("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${u}+`),m("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),m("FULL",`^${l[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),m("LOOSE",`^${l[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),m("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?(?:${l[d.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",l[d.COERCE],!0),m("COERCERTLFULL",l[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",m("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",m("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(cr,cr.exports)),cr.exports}var hi,$a;function js(){if($a)return hi;$a=1;const e=Object.freeze({loose:!0}),r=Object.freeze({});return hi=t=>t?typeof t!="object"?e:t:r,hi}var gi,Ha;function _l(){if(Ha)return gi;Ha=1;const e=/^[0-9]+$/,r=(t,c)=>{if(typeof t=="number"&&typeof c=="number")return t===c?0:t<c?-1:1;const i=e.test(t),a=e.test(c);return i&&a&&(t=+t,c=+c),t===c?0:i&&!a?-1:a&&!i?1:t<c?-1:1};return gi={compareIdentifiers:r,rcompareIdentifiers:(t,c)=>r(c,t)},gi}var pi,Ua;function ae(){if(Ua)return pi;Ua=1;const e=Rr(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:n}=Gt(),{safeRe:t,t:c}=Zt(),i=js(),{compareIdentifiers:a}=_l(),h=(f,d)=>{const o=d.split(".");if(o.length>f.length)return!1;for(let u=0;u<o.length;u++)if(a(f[u],o[u])!==0)return!1;return!0};class l{constructor(d,o){if(o=i(o),d instanceof l){if(d.loose===!!o.loose&&d.includePrerelease===!!o.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>r)throw new TypeError(`version is longer than ${r} characters`);e("SemVer",d,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;const u=d.trim().match(o.loose?t[c.LOOSE]:t[c.FULL]);if(!u)throw new TypeError(`Invalid Version: ${d}`);if(this.raw=d,this.major=+u[1],this.minor=+u[2],this.patch=+u[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");u[4]?this.prerelease=u[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const p=+s;if(p>=0&&p<n)return p}return s}):this.prerelease=[],this.build=u[5]?u[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 l)){if(typeof d=="string"&&d===this.version)return 0;d=new l(d,this.options)}return d.version===this.version?0:this.compareMain(d)||this.comparePre(d)}compareMain(d){return d instanceof l||(d=new l(d,this.options)),this.major<d.major?-1:this.major>d.major?1:this.minor<d.minor?-1:this.minor>d.minor?1:this.patch<d.patch?-1:this.patch>d.patch?1:0}comparePre(d){if(d instanceof l||(d=new l(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 o=0;do{const u=this.prerelease[o],s=d.prerelease[o];if(e("prerelease compare",o,u,s),u===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(u===void 0)return-1;if(u===s)continue;return a(u,s)}while(++o)}compareBuild(d){d instanceof l||(d=new l(d,this.options));let o=0;do{const u=this.build[o],s=d.build[o];if(e("build compare",o,u,s),u===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(u===void 0)return-1;if(u===s)continue;return a(u,s)}while(++o)}inc(d,o,u){if(d.startsWith("pre")){if(!o&&u===!1)throw new Error("invalid increment argument: identifier is empty");if(o){const s=`-${o}`.match(this.options.loose?t[c.PRERELEASELOOSE]:t[c.PRERELEASE]);if(!s||s[1]!==o)throw new Error(`invalid identifier: ${o}`)}}switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",o,u);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",o,u);break;case"prepatch":this.prerelease.length=0,this.inc("patch",o,u),this.inc("pre",o,u);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",o,u),this.inc("pre",o,u);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 s=Number(u)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let p=this.prerelease.length;for(;--p>=0;)typeof this.prerelease[p]=="number"&&(this.prerelease[p]++,p=-2);if(p===-1){if(o===this.prerelease.join(".")&&u===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(o){let p=[o,s];if(u===!1&&(p=[o]),h(this.prerelease,o)){const m=this.prerelease[o.split(".").length];isNaN(m)&&(this.prerelease=p)}else this.prerelease=p}break}default:throw new Error(`invalid increment argument: ${d}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return pi=l,pi}var mi,Wa;function Qe(){if(Wa)return mi;Wa=1;const e=ae();return mi=(n,t,c=!1)=>{if(n instanceof e)return n;try{return new e(n,t)}catch(i){if(!c)return null;throw i}},mi}var bi,Va;function Df(){if(Va)return bi;Va=1;const e=Qe();return bi=(n,t)=>{const c=e(n,t);return c?c.version:null},bi}var yi,za;function jf(){if(za)return yi;za=1;const e=Qe();return yi=(n,t)=>{const c=e(n.trim().replace(/^[=v]+/,""),t);return c?c.version:null},yi}var wi,Ja;function Bf(){if(Ja)return wi;Ja=1;const e=ae();return wi=(n,t,c,i,a)=>{typeof c=="string"&&(a=i,i=c,c=void 0);try{return new e(n instanceof e?n.version:n,c).inc(t,i,a).version}catch{return null}},wi}var _i,Ga;function Ff(){if(Ga)return _i;Ga=1;const e=Qe();return _i=(n,t)=>{const c=e(n,null,!0),i=e(t,null,!0),a=c.compare(i);if(a===0)return null;const h=a>0,l=h?c:i,f=h?i:c,d=!!l.prerelease.length;if(!!f.prerelease.length&&!d){if(!f.patch&&!f.minor)return"major";if(f.compareMain(l)===0)return f.minor&&!f.patch?"minor":"patch"}const u=d?"pre":"";return c.major!==i.major?u+"major":c.minor!==i.minor?u+"minor":c.patch!==i.patch?u+"patch":"prerelease"},_i}var vi,Za;function qf(){if(Za)return vi;Za=1;const e=ae();return vi=(n,t)=>new e(n,t).major,vi}var Ei,Ka;function $f(){if(Ka)return Ei;Ka=1;const e=ae();return Ei=(n,t)=>new e(n,t).minor,Ei}var Ri,Qa;function Hf(){if(Qa)return Ri;Qa=1;const e=ae();return Ri=(n,t)=>new e(n,t).patch,Ri}var Si,Ya;function Uf(){if(Ya)return Si;Ya=1;const e=Qe();return Si=(n,t)=>{const c=e(n,t);return c&&c.prerelease.length?c.prerelease:null},Si}var Ci,Xa;function me(){if(Xa)return Ci;Xa=1;const e=ae();return Ci=(n,t,c)=>new e(n,c).compare(new e(t,c)),Ci}var ki,ec;function Wf(){if(ec)return ki;ec=1;const e=me();return ki=(n,t,c)=>e(t,n,c),ki}var Ii,tc;function Vf(){if(tc)return Ii;tc=1;const e=me();return Ii=(n,t)=>e(n,t,!0),Ii}var Ai,rc;function Bs(){if(rc)return Ai;rc=1;const e=ae();return Ai=(n,t,c)=>{const i=new e(n,c),a=new e(t,c);return i.compare(a)||i.compareBuild(a)},Ai}var Ti,nc;function zf(){if(nc)return Ti;nc=1;const e=Bs();return Ti=(n,t)=>n.sort((c,i)=>e(c,i,t)),Ti}var Mi,ic;function Jf(){if(ic)return Mi;ic=1;const e=Bs();return Mi=(n,t)=>n.sort((c,i)=>e(i,c,t)),Mi}var Li,sc;function Sr(){if(sc)return Li;sc=1;const e=me();return Li=(n,t,c)=>e(n,t,c)>0,Li}var Pi,oc;function Fs(){if(oc)return Pi;oc=1;const e=me();return Pi=(n,t,c)=>e(n,t,c)<0,Pi}var Ni,ac;function vl(){if(ac)return Ni;ac=1;const e=me();return Ni=(n,t,c)=>e(n,t,c)===0,Ni}var Oi,cc;function El(){if(cc)return Oi;cc=1;const e=me();return Oi=(n,t,c)=>e(n,t,c)!==0,Oi}var xi,uc;function qs(){if(uc)return xi;uc=1;const e=me();return xi=(n,t,c)=>e(n,t,c)>=0,xi}var Di,lc;function $s(){if(lc)return Di;lc=1;const e=me();return Di=(n,t,c)=>e(n,t,c)<=0,Di}var ji,dc;function Rl(){if(dc)return ji;dc=1;const e=vl(),r=El(),n=Sr(),t=qs(),c=Fs(),i=$s();return ji=(h,l,f,d)=>{switch(l){case"===":return typeof h=="object"&&(h=h.version),typeof f=="object"&&(f=f.version),h===f;case"!==":return typeof h=="object"&&(h=h.version),typeof f=="object"&&(f=f.version),h!==f;case"":case"=":case"==":return e(h,f,d);case"!=":return r(h,f,d);case">":return n(h,f,d);case">=":return t(h,f,d);case"<":return c(h,f,d);case"<=":return i(h,f,d);default:throw new TypeError(`Invalid operator: ${l}`)}},ji}var Bi,fc;function Gf(){if(fc)return Bi;fc=1;const e=ae(),r=Qe(),{safeRe:n,t}=Zt();return Bi=(i,a)=>{if(i instanceof e)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;a=a||{};let h=null;if(!a.rtl)h=i.match(a.includePrerelease?n[t.COERCEFULL]:n[t.COERCE]);else{const s=a.includePrerelease?n[t.COERCERTLFULL]:n[t.COERCERTL];let p;for(;(p=s.exec(i))&&(!h||h.index+h[0].length!==i.length);)(!h||p.index+p[0].length!==h.index+h[0].length)&&(h=p),s.lastIndex=p.index+p[1].length+p[2].length;s.lastIndex=-1}if(h===null)return null;const l=h[2],f=h[3]||"0",d=h[4]||"0",o=a.includePrerelease&&h[5]?`-${h[5]}`:"",u=a.includePrerelease&&h[6]?`+${h[6]}`:"";return r(`${l}.${f}.${d}${o}${u}`,a)},Bi}var Fi,hc;function Zf(){if(hc)return Fi;hc=1;const e=Qe(),r=Gt(),n=ae(),t=(h,l,f)=>{if(!r.RELEASE_TYPES.includes(l))return null;const d=c(h,f);return d&&i(d,l)},c=(h,l)=>{const f=h instanceof n?h.version:h;return e(f,l)},i=(h,l)=>{if(a(l))return h.version;switch(h.prerelease=[],l){case"major":h.minor=0,h.patch=0;break;case"minor":h.patch=0;break}return h.format()},a=h=>h.startsWith("pre");return Fi=t,Fi}var qi,gc;function Kf(){if(gc)return qi;gc=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const t=this.map.get(n);if(t!==void 0)return this.map.delete(n),this.map.set(n,t),t}delete(n){return this.map.delete(n)}set(n,t){if(!this.delete(n)&&t!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(n,t)}return this}}return qi=e,qi}var $i,pc;function be(){if(pc)return $i;pc=1;const e=/\s+/g;class r{constructor(L,x){if(x=c(x),L instanceof r)return L.loose===!!x.loose&&L.includePrerelease===!!x.includePrerelease?L:new r(L.raw,x);if(L instanceof i)return this.raw=L.value,this.set=[[L]],this.formatted=void 0,this;if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=L.trim().replace(e," "),this.set=this.raw.split("||").map(j=>this.parseRange(j.trim())).filter(j=>j.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const j=this.set[0];if(this.set=this.set.filter(V=>!g(V[0])),this.set.length===0)this.set=[j];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&y(V[0])){this.set=[V];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let L=0;L<this.set.length;L++){L>0&&(this.formatted+="||");const x=this.set[L];for(let j=0;j<x.length;j++)j>0&&(this.formatted+=" "),this.formatted+=x[j].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(L){L=L.replace(b,"");const j=((this.options.includePrerelease&&p)|(this.options.loose&&m))+":"+L,V=t.get(j);if(V)return V;const B=this.options.loose,q=B?l[d.HYPHENRANGELOOSE]:l[d.HYPHENRANGE];L=L.replace(q,J(this.options.includePrerelease)),a("hyphen replace",L),L=L.replace(l[d.COMPARATORTRIM],o),a("comparator trim",L),L=L.replace(l[d.TILDETRIM],u),a("tilde trim",L),L=L.replace(l[d.CARETTRIM],s),a("caret trim",L);let G=L.split(" ").map(P=>_(P,this.options)).join(" ").split(/\s+/).map(P=>Y(P,this.options));B&&(G=G.filter(P=>(a("loose invalid filter",P,this.options),!!P.match(l[d.COMPARATORLOOSE])))),a("range list",G);const H=new Map,k=G.map(P=>new i(P,this.options));for(const P of k){if(g(P))return[P];H.set(P.value,P)}H.size>1&&H.has("")&&H.delete("");const A=[...H.values()];return t.set(j,A),A}intersects(L,x){if(!(L instanceof r))throw new TypeError("a Range is required");return this.set.some(j=>w(j,x)&&L.set.some(V=>w(V,x)&&j.every(B=>V.every(q=>B.intersects(q,x)))))}test(L){if(!L)return!1;if(typeof L=="string")try{L=new h(L,this.options)}catch{return!1}for(let x=0;x<this.set.length;x++)if(T(this.set[x],L,this.options))return!0;return!1}}$i=r;const n=Kf(),t=new n,c=js(),i=Cr(),a=Rr(),h=ae(),{safeRe:l,src:f,t:d,comparatorTrimReplace:o,tildeTrimReplace:u,caretTrimReplace:s}=Zt(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=Gt(),b=new RegExp(f[d.BUILD],"g"),g=M=>M.value==="<0.0.0-0",y=M=>M.value==="",w=(M,L)=>{let x=!0;const j=M.slice();let V=j.pop();for(;x&&j.length;)x=j.every(B=>V.intersects(B,L)),V=j.pop();return x},_=(M,L)=>(M=M.replace(l[d.BUILD],""),a("comp",M,L),M=N(M,L),a("caret",M),M=S(M,L),a("tildes",M),M=$(M,L),a("xrange",M),M=X(M,L),a("stars",M),M),v=M=>!M||M.toLowerCase()==="x"||M==="*",C=(M,L,x)=>v(M)&&!v(L)||v(L)&&x&&!v(x),S=(M,L)=>M.trim().split(/\s+/).map(x=>I(x,L)).join(" "),I=(M,L)=>{const x=L.loose?l[d.TILDELOOSE]:l[d.TILDE],j=L.includePrerelease?"-0":"";return M.replace(x,(V,B,q,G,H)=>{a("tilde",M,V,B,q,G,H);let k;return v(B)?k="":v(q)?k=`>=${B}.0.0${j} <${+B+1}.0.0-0`:v(G)?k=`>=${B}.${q}.0${j} <${B}.${+q+1}.0-0`:H?(a("replaceTilde pr",H),k=`>=${B}.${q}.${G}-${H} <${B}.${+q+1}.0-0`):k=`>=${B}.${q}.${G} <${B}.${+q+1}.0-0`,a("tilde return",k),k})},N=(M,L)=>M.trim().split(/\s+/).map(x=>D(x,L)).join(" "),D=(M,L)=>{a("caret",M,L);const x=L.loose?l[d.CARETLOOSE]:l[d.CARET],j=L.includePrerelease?"-0":"";return M.replace(x,(V,B,q,G,H)=>{a("caret",M,V,B,q,G,H);let k;return v(B)?k="":v(q)?k=`>=${B}.0.0${j} <${+B+1}.0.0-0`:v(G)?B==="0"?k=`>=${B}.${q}.0${j} <${B}.${+q+1}.0-0`:k=`>=${B}.${q}.0${j} <${+B+1}.0.0-0`:H?(a("replaceCaret pr",H),B==="0"?q==="0"?k=`>=${B}.${q}.${G}-${H} <${B}.${q}.${+G+1}-0`:k=`>=${B}.${q}.${G}-${H} <${B}.${+q+1}.0-0`:k=`>=${B}.${q}.${G}-${H} <${+B+1}.0.0-0`):(a("no pr"),B==="0"?q==="0"?k=`>=${B}.${q}.${G} <${B}.${q}.${+G+1}-0`:k=`>=${B}.${q}.${G} <${B}.${+q+1}.0-0`:k=`>=${B}.${q}.${G} <${+B+1}.0.0-0`),a("caret return",k),k})},$=(M,L)=>(a("replaceXRanges",M,L),M.split(/\s+/).map(x=>z(x,L)).join(" ")),z=(M,L)=>{M=M.trim();const x=L.loose?l[d.XRANGELOOSE]:l[d.XRANGE];return M.replace(x,(j,V,B,q,G,H)=>{if(a("xRange",M,j,V,B,q,G,H),C(B,q,G))return M;const k=v(B),A=k||v(q),P=A||v(G),U=P;return V==="="&&U&&(V=""),H=L.includePrerelease?"-0":"",k?V===">"||V==="<"?j="<0.0.0-0":j="*":V&&U?(A&&(q=0),G=0,V===">"?(V=">=",A?(B=+B+1,q=0,G=0):(q=+q+1,G=0)):V==="<="&&(V="<",A?B=+B+1:q=+q+1),V==="<"&&(H="-0"),j=`${V+B}.${q}.${G}${H}`):A?j=`>=${B}.0.0${H} <${+B+1}.0.0-0`:P&&(j=`>=${B}.${q}.0${H} <${B}.${+q+1}.0-0`),a("xRange return",j),j})},X=(M,L)=>(a("replaceStars",M,L),M.trim().replace(l[d.STAR],"")),Y=(M,L)=>(a("replaceGTE0",M,L),M.trim().replace(l[L.includePrerelease?d.GTE0PRE:d.GTE0],"")),J=M=>(L,x,j,V,B,q,G,H,k,A,P,U)=>(v(j)?x="":v(V)?x=`>=${j}.0.0${M?"-0":""}`:v(B)?x=`>=${j}.${V}.0${M?"-0":""}`:q?x=`>=${x}`:x=`>=${x}${M?"-0":""}`,v(k)?H="":v(A)?H=`<${+k+1}.0.0-0`:v(P)?H=`<${k}.${+A+1}.0-0`:U?H=`<=${k}.${A}.${P}-${U}`:M?H=`<${k}.${A}.${+P+1}-0`:H=`<=${H}`,`${x} ${H}`.trim()),T=(M,L,x)=>{for(let j=0;j<M.length;j++)if(!M[j].test(L))return!1;if(L.prerelease.length&&!x.includePrerelease){for(let j=0;j<M.length;j++)if(a(M[j].semver),M[j].semver!==i.ANY&&M[j].semver.prerelease.length>0){const V=M[j].semver;if(V.major===L.major&&V.minor===L.minor&&V.patch===L.patch)return!0}return!1}return!0};return $i}var Hi,mc;function Cr(){if(mc)return Hi;mc=1;const e=Symbol("SemVer ANY");class r{static get ANY(){return e}constructor(d,o){if(o=n(o),d instanceof r){if(d.loose===!!o.loose)return d;d=d.value}d=d.trim().split(/\s+/).join(" "),a("comparator",d,o),this.options=o,this.loose=!!o.loose,this.parse(d),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(d){const o=this.options.loose?t[c.COMPARATORLOOSE]:t[c.COMPARATOR],u=d.match(o);if(!u)throw new TypeError(`Invalid comparator: ${d}`);this.operator=u[1]!==void 0?u[1]:"",this.operator==="="&&(this.operator=""),u[2]?this.semver=new h(u[2],this.options.loose):this.semver=e}toString(){return this.value}test(d){if(a("Comparator.test",d,this.options.loose),this.semver===e||d===e)return!0;if(typeof d=="string")try{d=new h(d,this.options)}catch{return!1}return i(d,this.operator,this.semver,this.options)}intersects(d,o){if(!(d instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(d.value,o).test(this.value):d.operator===""?d.value===""?!0:new l(this.value,o).test(d.semver):(o=n(o),o.includePrerelease&&(this.value==="<0.0.0-0"||d.value==="<0.0.0-0")||!o.includePrerelease&&(this.value.startsWith("<0.0.0")||d.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&d.operator.startsWith(">")||this.operator.startsWith("<")&&d.operator.startsWith("<")||this.semver.version===d.semver.version&&this.operator.includes("=")&&d.operator.includes("=")||i(this.semver,"<",d.semver,o)&&this.operator.startsWith(">")&&d.operator.startsWith("<")||i(this.semver,">",d.semver,o)&&this.operator.startsWith("<")&&d.operator.startsWith(">")))}}Hi=r;const n=js(),{safeRe:t,t:c}=Zt(),i=Rl(),a=Rr(),h=ae(),l=be();return Hi}var Ui,bc;function kr(){if(bc)return Ui;bc=1;const e=be();return Ui=(n,t,c)=>{try{t=new e(t,c)}catch{return!1}return t.test(n)},Ui}var Wi,yc;function Qf(){if(yc)return Wi;yc=1;const e=be();return Wi=(n,t)=>new e(n,t).set.map(c=>c.map(i=>i.value).join(" ").trim().split(" ")),Wi}var Vi,wc;function Yf(){if(wc)return Vi;wc=1;const e=ae(),r=be();return Vi=(t,c,i)=>{let a=null,h=null,l=null;try{l=new r(c,i)}catch{return null}return t.forEach(f=>{l.test(f)&&(!a||h.compare(f)===-1)&&(a=f,h=new e(a,i))}),a},Vi}var zi,_c;function Xf(){if(_c)return zi;_c=1;const e=ae(),r=be();return zi=(t,c,i)=>{let a=null,h=null,l=null;try{l=new r(c,i)}catch{return null}return t.forEach(f=>{l.test(f)&&(!a||h.compare(f)===1)&&(a=f,h=new e(a,i))}),a},zi}var Ji,vc;function eh(){if(vc)return Ji;vc=1;const e=ae(),r=be(),n=Sr();return Ji=(c,i)=>{c=new r(c,i);let a=new e("0.0.0");if(c.test(a)||(a=new e("0.0.0-0"),c.test(a)))return a;a=null;for(let h=0;h<c.set.length;++h){const l=c.set[h];let f=null;l.forEach(d=>{const o=new e(d.semver.version);switch(d.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!f||n(o,f))&&(f=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${d.operator}`)}}),f&&(!a||n(a,f))&&(a=f)}return a&&c.test(a)?a:null},Ji}var Gi,Ec;function th(){if(Ec)return Gi;Ec=1;const e=be();return Gi=(n,t)=>{try{return new e(n,t).range||"*"}catch{return null}},Gi}var Zi,Rc;function Hs(){if(Rc)return Zi;Rc=1;const e=ae(),r=Cr(),{ANY:n}=r,t=be(),c=kr(),i=Sr(),a=Fs(),h=$s(),l=qs();return Zi=(d,o,u,s)=>{d=new e(d,s),o=new t(o,s);let p,m,b,g,y;switch(u){case">":p=i,m=h,b=a,g=">",y=">=";break;case"<":p=a,m=l,b=i,g="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(c(d,o,s))return!1;for(let w=0;w<o.set.length;++w){const _=o.set[w];let v=null,C=null;if(_.forEach(S=>{S.semver===n&&(S=new r(">=0.0.0")),v=v||S,C=C||S,p(S.semver,v.semver,s)?v=S:b(S.semver,C.semver,s)&&(C=S)}),v.operator===g||v.operator===y||(!C.operator||C.operator===g)&&m(d,C.semver))return!1;if(C.operator===y&&b(d,C.semver))return!1}return!0},Zi}var Ki,Sc;function rh(){if(Sc)return Ki;Sc=1;const e=Hs();return Ki=(n,t,c)=>e(n,t,">",c),Ki}var Qi,Cc;function nh(){if(Cc)return Qi;Cc=1;const e=Hs();return Qi=(n,t,c)=>e(n,t,"<",c),Qi}var Yi,kc;function ih(){if(kc)return Yi;kc=1;const e=be();return Yi=(n,t,c)=>(n=new e(n,c),t=new e(t,c),n.intersects(t,c)),Yi}var Xi,Ic;function sh(){if(Ic)return Xi;Ic=1;const e=kr(),r=me();return Xi=(n,t,c)=>{const i=[];let a=null,h=null;const l=n.sort((u,s)=>r(u,s,c));for(const u of l)e(u,t,c)?(h=u,a||(a=u)):(h&&i.push([a,h]),h=null,a=null);a&&i.push([a,null]);const f=[];for(const[u,s]of i)u===s?f.push(u):!s&&u===l[0]?f.push("*"):s?u===l[0]?f.push(`<=${s}`):f.push(`${u} - ${s}`):f.push(`>=${u}`);const d=f.join(" || "),o=typeof t.raw=="string"?t.raw:String(t);return d.length<o.length?d:t},Xi}var es,Ac;function oh(){if(Ac)return es;Ac=1;const e=be(),r=Cr(),{ANY:n}=r,t=kr(),c=me(),i=(o,u,s={})=>{if(o===u)return!0;o=new e(o,s),u=new e(u,s);let p=!1;e:for(const m of o.set){for(const b of u.set){const g=l(m,b,s);if(p=p||g!==null,g)continue e}if(p)return!1}return!0},a=[new r(">=0.0.0-0")],h=[new r(">=0.0.0")],l=(o,u,s)=>{if(o===u)return!0;if(o.length===1&&o[0].semver===n){if(u.length===1&&u[0].semver===n)return!0;s.includePrerelease?o=a:o=h}if(u.length===1&&u[0].semver===n){if(s.includePrerelease)return!0;u=h}const p=new Set;let m,b;for(const I of o)I.operator===">"||I.operator===">="?m=f(m,I,s):I.operator==="<"||I.operator==="<="?b=d(b,I,s):p.add(I.semver);if(p.size>1)return null;let g;if(m&&b){if(g=c(m.semver,b.semver,s),g>0)return null;if(g===0&&(m.operator!==">="||b.operator!=="<="))return null}for(const I of p){if(m&&!t(I,String(m),s)||b&&!t(I,String(b),s))return null;for(const N of u)if(!t(I,String(N),s))return!1;return!0}let y,w,_,v,C=b&&!s.includePrerelease&&b.semver.prerelease.length?b.semver:!1,S=m&&!s.includePrerelease&&m.semver.prerelease.length?m.semver:!1;C&&C.prerelease.length===1&&b.operator==="<"&&C.prerelease[0]===0&&(C=!1);for(const I of u){if(v=v||I.operator===">"||I.operator===">=",_=_||I.operator==="<"||I.operator==="<=",m){if(S&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===S.major&&I.semver.minor===S.minor&&I.semver.patch===S.patch&&(S=!1),I.operator===">"||I.operator===">="){if(y=f(m,I,s),y===I&&y!==m)return!1}else if(m.operator===">="&&!I.test(m.semver))return!1}if(b){if(C&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===C.major&&I.semver.minor===C.minor&&I.semver.patch===C.patch&&(C=!1),I.operator==="<"||I.operator==="<="){if(w=d(b,I,s),w===I&&w!==b)return!1}else if(b.operator==="<="&&!I.test(b.semver))return!1}if(!I.operator&&(b||m)&&g!==0)return!1}return!(m&&_&&!b&&g!==0||b&&v&&!m&&g!==0||S||C)},f=(o,u,s)=>{if(!o)return u;const p=c(o.semver,u.semver,s);return p>0?o:p<0||u.operator===">"&&o.operator===">="?u:o},d=(o,u,s)=>{if(!o)return u;const p=c(o.semver,u.semver,s);return p<0?o:p>0||u.operator==="<"&&o.operator==="<="?u:o};return es=i,es}var ts,Tc;function ah(){if(Tc)return ts;Tc=1;const e=Zt(),r=Gt(),n=ae(),t=_l(),c=Qe(),i=Df(),a=jf(),h=Bf(),l=Ff(),f=qf(),d=$f(),o=Hf(),u=Uf(),s=me(),p=Wf(),m=Vf(),b=Bs(),g=zf(),y=Jf(),w=Sr(),_=Fs(),v=vl(),C=El(),S=qs(),I=$s(),N=Rl(),D=Gf(),$=Zf(),z=Cr(),X=be(),Y=kr(),J=Qf(),T=Yf(),M=Xf(),L=eh(),x=th(),j=Hs(),V=rh(),B=nh(),q=ih(),G=sh(),H=oh();return ts={parse:c,valid:i,clean:a,inc:h,diff:l,major:f,minor:d,patch:o,prerelease:u,compare:s,rcompare:p,compareLoose:m,compareBuild:b,sort:g,rsort:y,gt:w,lt:_,eq:v,neq:C,gte:S,lte:I,cmp:N,coerce:D,truncate:$,Comparator:z,Range:X,satisfies:Y,toComparators:J,maxSatisfying:T,minSatisfying:M,minVersion:L,validRange:x,outside:j,gtr:V,ltr:B,intersects:q,simplifyRange:G,subset:H,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:t.compareIdentifiers,rcompareIdentifiers:t.rcompareIdentifiers},ts}var Mc;function ch(){return Mc||(Mc=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 r=ah(),n=Ke,t=ke();e.VersionStruct=(0,n.refine)((0,n.string)(),"Version",o=>(0,r.valid)(o)===null?`Expected SemVer version, got "${o}"`:!0),e.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",o=>(0,r.validRange)(o)===null?`Expected SemVer range, got "${o}"`:!0);function c(o){return(0,n.is)(o,e.VersionStruct)}e.isValidSemVerVersion=c;function i(o){return(0,n.is)(o,e.VersionRangeStruct)}e.isValidSemVerRange=i;function a(o){(0,t.assertStruct)(o,e.VersionStruct)}e.assertIsSemVerVersion=a;function h(o){(0,t.assertStruct)(o,e.VersionRangeStruct)}e.assertIsSemVerRange=h;function l(o,u){return(0,r.gt)(o,u)}e.gtVersion=l;function f(o,u){return(0,r.gtr)(o,u)}e.gtRange=f;function d(o,u){return(0,r.satisfies)(o,u,{includePrerelease:!0})}e.satisfiesVersionRange=d})(li)),li}var Lc;function uh(){return Lc||(Lc=1,(function(e){var r=He&&He.__createBinding||(Object.create?(function(t,c,i,a){a===void 0&&(a=i);var h=Object.getOwnPropertyDescriptor(c,i);(!h||("get"in h?!c.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return c[i]}}),Object.defineProperty(t,a,h)}):(function(t,c,i,a){a===void 0&&(a=i),t[a]=c[i]})),n=He&&He.__exportStar||function(t,c){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(c,i)&&r(c,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(ke(),e),n(yl(),e),n(wl(),e),n(vf(),e),n(Ef(),e),n(Rf(),e),n(Sf(),e),n(Er(),e),n(Cf(),e),n(kf(),e),n(Mf(),e),n(Lf(),e),n(Pf(),e),n(Nf(),e),n(Of(),e),n(xf(),e),n(ch(),e)})(He)),He}var Pc;function lh(){return Pc||(Pc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const r=uh();Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return r.createModuleLogger}}),e.projectLogger=(0,r.createProjectLogger)("eth-block-tracker")})(Xn)),Xn}var Nc;function dh(){if(Nc)return qe;Nc=1;var e=qe&&qe.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(qe,"__esModule",{value:!0}),qe.PollingBlockTracker=void 0;const r=e(Ls()),n=e(Od()),t=ul(),c=lh(),i=(0,c.createModuleLogger)(c.projectLogger,"polling-block-tracker"),a=(0,r.default)(),h=1e3;let l=class extends t.BaseBlockTracker{constructor(o={}){var u;if(!o.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},o),{blockResetDuration:(u=o.blockResetDuration)!==null&&u!==void 0?u:o.pollingInterval})),this._provider=o.provider,this._pollingInterval=o.pollingInterval||20*h,this._retryTimeout=o.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=o.keepEventLoopActive===void 0?!0:o.keepEventLoopActive,this._setSkipCacheFlag=o.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var o;this._isRunning;)try{await this._updateLatestBlock();const u=f(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await u}catch(u){const s=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
3
- ${(o=u.stack)!==null&&o!==void 0?o:u}`);try{this.emit("error",s)}catch{console.error(s)}const p=f(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await p}}async _updateLatestBlock(){const o=await this._fetchLatestBlock();this._newPotentialLatest(o)}async _fetchLatestBlock(){const o={jsonrpc:"2.0",id:a(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(o.skipCache=!0),i("Making request",o);const u=await(0,n.default)(s=>this._provider.sendAsync(o,s))();if(i("Got response",u),u.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
4
- ${u.error.message}`);return u.result}};qe.PollingBlockTracker=l;function f(d,o){return new Promise(u=>{const s=setTimeout(u,d);s.unref&&o&&s.unref()})}return qe}var Ue={},Oc;function fh(){if(Oc)return Ue;Oc=1;var e=Ue&&Ue.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.SubscribeBlockTracker=void 0;const r=e(Ls()),n=ul(),t=(0,r.default)();let c=class extends n.BaseBlockTracker{constructor(a={}){if(!a.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(a),this._provider=a.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const a=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(a)}catch(a){this.emit("error",a)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(a){this.emit("error",a)}}_call(a,...h){return new Promise((l,f)=>{this._provider.sendAsync({id:t(),method:a,params:h,jsonrpc:"2.0"},(d,o)=>{d?f(d):l(o.result)})})}_handleSubData(a,h){var l;h.method==="eth_subscription"&&((l=h.params)===null||l===void 0?void 0:l.subscription)===this._subscriptionId&&this._newPotentialLatest(h.params.result.number)}};return Ue.SubscribeBlockTracker=c,Ue}var xc;function hh(){return xc||(xc=1,(function(e){var r=Fe&&Fe.__createBinding||(Object.create?(function(t,c,i,a){a===void 0&&(a=i),Object.defineProperty(t,a,{enumerable:!0,get:function(){return c[i]}})}):(function(t,c,i,a){a===void 0&&(a=i),t[a]=c[i]})),n=Fe&&Fe.__exportStar||function(t,c){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(c,i)&&r(c,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(dh(),e),n(fh(),e)})(Fe)),Fe}var We={},xt={},Dt={},Dc;function Sl(){if(Dc)return Dt;Dc=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.getUniqueId=void 0;const e=4294967295;let r=Math.floor(Math.random()*e);function n(){return r=(r+1)%e,r}return Dt.getUniqueId=n,Dt}var jc;function gh(){if(jc)return xt;jc=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.createIdRemapMiddleware=void 0;const e=Sl();function r(){return(n,t,c,i)=>{const a=n.id,h=e.getUniqueId();n.id=h,t.id=h,c(l=>{n.id=a,t.id=a,l()})}}return xt.createIdRemapMiddleware=r,xt}var jt={},Bc;function ph(){if(Bc)return jt;Bc=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.createAsyncMiddleware=void 0;function e(r){return async(n,t,c,i)=>{let a;const h=new Promise(o=>{a=o});let l=null,f=!1;const d=async()=>{f=!0,c(o=>{l=o,a()}),await h};try{await r(n,t,d),f?(await h,l(null)):i(null)}catch(o){l?l(o):i(o)}}}return jt.createAsyncMiddleware=e,jt}var Bt={},Fc;function mh(){if(Fc)return Bt;Fc=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.createScaffoldMiddleware=void 0;function e(r){return(n,t,c,i)=>{const a=r[n.method];return a===void 0?c():typeof a=="function"?a(n,t,c,i):(t.result=a,i())}}return Bt.createScaffoldMiddleware=e,Bt}var Ve={},ur={},qc;function bh(){if(qc)return ur;qc=1,Object.defineProperty(ur,"__esModule",{value:!0});const e=mr();function r(c,i,a){try{Reflect.apply(c,i,a)}catch(h){setTimeout(()=>{throw h})}}function n(c){const i=c.length,a=new Array(i);for(let h=0;h<i;h+=1)a[h]=c[h];return a}class t extends e.EventEmitter{emit(i,...a){let h=i==="error";const l=this._events;if(l!==void 0)h=h&&l.error===void 0;else if(!h)return!1;if(h){let d;if(a.length>0&&([d]=a),d instanceof Error)throw d;const o=new Error(`Unhandled error.${d?` (${d.message})`:""}`);throw o.context=d,o}const f=l[i];if(f===void 0)return!1;if(typeof f=="function")r(f,this,a);else{const d=f.length,o=n(f);for(let u=0;u<d;u+=1)r(o[u],this,a)}return!0}}return ur.default=t,ur}var rs={},ze={},ns,$c;function yh(){if($c)return ns;$c=1,ns=i,i.default=i,i.stable=f,i.stableStringify=f;var e="[...]",r="[Circular]",n=[],t=[];function c(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function i(u,s,p,m){typeof m>"u"&&(m=c()),h(u,"",0,[],void 0,0,m);var b;try{t.length===0?b=JSON.stringify(u,s,p):b=JSON.stringify(u,o(s),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var g=n.pop();g.length===4?Object.defineProperty(g[0],g[1],g[3]):g[0][g[1]]=g[2]}}return b}function a(u,s,p,m){var b=Object.getOwnPropertyDescriptor(m,p);b.get!==void 0?b.configurable?(Object.defineProperty(m,p,{value:u}),n.push([m,p,s,b])):t.push([s,p,u]):(m[p]=u,n.push([m,p,s]))}function h(u,s,p,m,b,g,y){g+=1;var w;if(typeof u=="object"&&u!==null){for(w=0;w<m.length;w++)if(m[w]===u){a(r,u,s,b);return}if(typeof y.depthLimit<"u"&&g>y.depthLimit){a(e,u,s,b);return}if(typeof y.edgesLimit<"u"&&p+1>y.edgesLimit){a(e,u,s,b);return}if(m.push(u),Array.isArray(u))for(w=0;w<u.length;w++)h(u[w],w,w,m,u,g,y);else{var _=Object.keys(u);for(w=0;w<_.length;w++){var v=_[w];h(u[v],v,w,m,u,g,y)}}m.pop()}}function l(u,s){return u<s?-1:u>s?1:0}function f(u,s,p,m){typeof m>"u"&&(m=c());var b=d(u,"",0,[],void 0,0,m)||u,g;try{t.length===0?g=JSON.stringify(b,s,p):g=JSON.stringify(b,o(s),p)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var y=n.pop();y.length===4?Object.defineProperty(y[0],y[1],y[3]):y[0][y[1]]=y[2]}}return g}function d(u,s,p,m,b,g,y){g+=1;var w;if(typeof u=="object"&&u!==null){for(w=0;w<m.length;w++)if(m[w]===u){a(r,u,s,b);return}try{if(typeof u.toJSON=="function")return}catch{return}if(typeof y.depthLimit<"u"&&g>y.depthLimit){a(e,u,s,b);return}if(typeof y.edgesLimit<"u"&&p+1>y.edgesLimit){a(e,u,s,b);return}if(m.push(u),Array.isArray(u))for(w=0;w<u.length;w++)d(u[w],w,w,m,u,g,y);else{var _={},v=Object.keys(u).sort(l);for(w=0;w<v.length;w++){var C=v[w];d(u[C],C,w,m,u,g,y),_[C]=u[C]}if(typeof b<"u")n.push([b,s,u]),b[s]=_;else return _}m.pop()}}function o(u){return u=typeof u<"u"?u:function(s,p){return p},function(s,p){if(t.length>0)for(var m=0;m<t.length;m++){var b=t[m];if(b[1]===s&&b[0]===p){p=b[2],t.splice(m,1);break}}return u.call(this,s,p)}}return ns}var Hc;function Us(){if(Hc)return ze;Hc=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.EthereumProviderError=ze.EthereumRpcError=void 0;const e=yh();class r extends Error{constructor(a,h,l){if(!Number.isInteger(a))throw new Error('"code" must be an integer.');if(!h||typeof h!="string")throw new Error('"message" must be a nonempty string.');super(h),this.code=a,l!==void 0&&(this.data=l)}serialize(){const a={code:this.code,message:this.message};return this.data!==void 0&&(a.data=this.data),this.stack&&(a.stack=this.stack),a}toString(){return e.default(this.serialize(),c,2)}}ze.EthereumRpcError=r;class n extends r{constructor(a,h,l){if(!t(a))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(a,h,l)}}ze.EthereumProviderError=n;function t(i){return Number.isInteger(i)&&i>=1e3&&i<=4999}function c(i,a){if(a!=="[Circular]")return a}return ze}var is={},Je={},Uc;function Ws(){return Uc||(Uc=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.errorValues=Je.errorCodes=void 0,Je.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}},Je.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."}}),Je}var Wc;function Cl(){return Wc||(Wc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=Ws(),n=Us(),t=r.errorCodes.rpc.internal,c="Unspecified error message. This is a bug, please report it.",i={code:t,message:a(t)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(u,s=c){if(Number.isInteger(u)){const p=u.toString();if(o(r.errorValues,p))return r.errorValues[p].message;if(f(u))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return s}e.getMessageFromCode=a;function h(u){if(!Number.isInteger(u))return!1;const s=u.toString();return!!(r.errorValues[s]||f(u))}e.isValidCode=h;function l(u,{fallbackError:s=i,shouldIncludeStack:p=!1}={}){var m,b;if(!s||!Number.isInteger(s.code)||typeof s.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(u instanceof n.EthereumRpcError)return u.serialize();const g={};if(u&&typeof u=="object"&&!Array.isArray(u)&&o(u,"code")&&h(u.code)){const w=u;g.code=w.code,w.message&&typeof w.message=="string"?(g.message=w.message,o(w,"data")&&(g.data=w.data)):(g.message=a(g.code),g.data={originalError:d(u)})}else{g.code=s.code;const w=(m=u)===null||m===void 0?void 0:m.message;g.message=w&&typeof w=="string"?w:s.message,g.data={originalError:d(u)}}const y=(b=u)===null||b===void 0?void 0:b.stack;return p&&u&&y&&typeof y=="string"&&(g.stack=y),g}e.serializeError=l;function f(u){return u>=-32099&&u<=-32e3}function d(u){return u&&typeof u=="object"&&!Array.isArray(u)?Object.assign({},u):u}function o(u,s){return Object.prototype.hasOwnProperty.call(u,s)}})(is)),is}var Ft={},Vc;function wh(){if(Vc)return Ft;Vc=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.ethErrors=void 0;const e=Us(),r=Cl(),n=Ws();Ft.ethErrors={rpc:{parse:a=>t(n.errorCodes.rpc.parse,a),invalidRequest:a=>t(n.errorCodes.rpc.invalidRequest,a),invalidParams:a=>t(n.errorCodes.rpc.invalidParams,a),methodNotFound:a=>t(n.errorCodes.rpc.methodNotFound,a),internal:a=>t(n.errorCodes.rpc.internal,a),server:a=>{if(!a||typeof a!="object"||Array.isArray(a))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:h}=a;if(!Number.isInteger(h)||h>-32005||h<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return t(h,a)},invalidInput:a=>t(n.errorCodes.rpc.invalidInput,a),resourceNotFound:a=>t(n.errorCodes.rpc.resourceNotFound,a),resourceUnavailable:a=>t(n.errorCodes.rpc.resourceUnavailable,a),transactionRejected:a=>t(n.errorCodes.rpc.transactionRejected,a),methodNotSupported:a=>t(n.errorCodes.rpc.methodNotSupported,a),limitExceeded:a=>t(n.errorCodes.rpc.limitExceeded,a)},provider:{userRejectedRequest:a=>c(n.errorCodes.provider.userRejectedRequest,a),unauthorized:a=>c(n.errorCodes.provider.unauthorized,a),unsupportedMethod:a=>c(n.errorCodes.provider.unsupportedMethod,a),disconnected:a=>c(n.errorCodes.provider.disconnected,a),chainDisconnected:a=>c(n.errorCodes.provider.chainDisconnected,a),custom:a=>{if(!a||typeof a!="object"||Array.isArray(a))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:h,message:l,data:f}=a;if(!l||typeof l!="string")throw new Error('"message" must be a nonempty string');return new e.EthereumProviderError(h,l,f)}}};function t(a,h){const[l,f]=i(h);return new e.EthereumRpcError(a,l||r.getMessageFromCode(a),f)}function c(a,h){const[l,f]=i(h);return new e.EthereumProviderError(a,l||r.getMessageFromCode(a),f)}function i(a){if(a){if(typeof a=="string")return[a];if(typeof a=="object"&&!Array.isArray(a)){const{message:h,data:l}=a;if(h&&typeof h!="string")throw new Error("Must specify string message.");return[h||void 0,l]}}return[]}return Ft}var zc;function _h(){return zc||(zc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const r=Us();Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});const n=Cl();Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const t=wh();Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return t.ethErrors}});const c=Ws();Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return c.errorCodes}})})(rs)),rs}var Jc;function kl(){if(Jc)return Ve;Jc=1;var e=Ve&&Ve.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.JsonRpcEngine=void 0;const r=e(bh()),n=_h();let t=class Ce extends r.default{constructor(){super(),this._middleware=[]}push(a){this._middleware.push(a)}handle(a,h){if(h&&typeof h!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(a)?h?this._handleBatch(a,h):this._handleBatch(a):h?this._handle(a,h):this._promiseHandle(a)}asMiddleware(){return async(a,h,l,f)=>{try{const[d,o,u]=await Ce._runAllMiddleware(a,h,this._middleware);return o?(await Ce._runReturnHandlers(u),f(d)):l(async s=>{try{await Ce._runReturnHandlers(u)}catch(p){return s(p)}return s()})}catch(d){return f(d)}}}async _handleBatch(a,h){try{const l=await Promise.all(a.map(this._promiseHandle.bind(this)));return h?h(null,l):l}catch(l){if(h)return h(l);throw l}}_promiseHandle(a){return new Promise(h=>{this._handle(a,(l,f)=>{h(f)})})}async _handle(a,h){if(!a||Array.isArray(a)||typeof a!="object"){const o=new n.EthereumRpcError(n.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof a}`,{request:a});return h(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof a.method!="string"){const o=new n.EthereumRpcError(n.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof a.method}`,{request:a});return h(o,{id:a.id,jsonrpc:"2.0",error:o})}const l=Object.assign({},a),f={id:l.id,jsonrpc:l.jsonrpc};let d=null;try{await this._processRequest(l,f)}catch(o){d=o}return d&&(delete f.result,f.error||(f.error=n.serializeError(d))),h(d,f)}async _processRequest(a,h){const[l,f,d]=await Ce._runAllMiddleware(a,h,this._middleware);if(Ce._checkForCompletion(a,h,f),await Ce._runReturnHandlers(d),l)throw l}static async _runAllMiddleware(a,h,l){const f=[];let d=null,o=!1;for(const u of l)if([d,o]=await Ce._runMiddleware(a,h,u,f),o)break;return[d,o,f.reverse()]}static _runMiddleware(a,h,l,f){return new Promise(d=>{const o=s=>{const p=s||h.error;p&&(h.error=n.serializeError(p)),d([p,!0])},u=s=>{h.error?o(h.error):(s&&(typeof s!="function"&&o(new n.EthereumRpcError(n.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof s}" for request:
5
- ${c(a)}`,{request:a})),f.push(s)),d([null,!1]))};try{l(a,h,u,o)}catch(s){o(s)}})}static async _runReturnHandlers(a){for(const h of a)await new Promise((l,f)=>{h(d=>d?f(d):l())})}static _checkForCompletion(a,h,l){if(!("result"in h)&&!("error"in h))throw new n.EthereumRpcError(n.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
6
- ${c(a)}`,{request:a});if(!l)throw new n.EthereumRpcError(n.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
7
- ${c(a)}`,{request:a})}};Ve.JsonRpcEngine=t;function c(i){return JSON.stringify(i,null,2)}return Ve}var qt={},Gc;function vh(){if(Gc)return qt;Gc=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.mergeMiddleware=void 0;const e=kl();function r(n){const t=new e.JsonRpcEngine;return n.forEach(c=>t.push(c)),t.asMiddleware()}return qt.mergeMiddleware=r,qt}var Zc;function Il(){return Zc||(Zc=1,(function(e){var r=We&&We.__createBinding||(Object.create?(function(t,c,i,a){a===void 0&&(a=i),Object.defineProperty(t,a,{enumerable:!0,get:function(){return c[i]}})}):(function(t,c,i,a){a===void 0&&(a=i),t[a]=c[i]})),n=We&&We.__exportStar||function(t,c){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(c,i)&&r(c,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(gh(),e),n(ph(),e),n(mh(),e),n(Sl(),e),n(kl(),e),n(vh(),e)})(We)),We}var ss={},lr={};const Vs=Ut(Hl);var dr={},Kc;function Al(){if(Kc)return dr;Kc=1,Object.defineProperty(dr,"__esModule",{value:!0});var e=Vs,r=(function(){function n(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return n.prototype.acquire=function(){var t=this,c=this.isLocked(),i=new Promise(function(a){return t._queue.push(a)});return c||this._dispatch(),i},n.prototype.runExclusive=function(t){return e.__awaiter(this,void 0,void 0,function(){var c,i,a;return e.__generator(this,function(h){switch(h.label){case 0:return[4,this.acquire()];case 1:c=h.sent(),i=c[0],a=c[1],h.label=2;case 2:return h.trys.push([2,,4,5]),[4,t(i)];case 3:return[2,h.sent()];case 4:return a(),[7];case 5:return[2]}})})},n.prototype.isLocked=function(){return this._value<=0},n.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},n.prototype._dispatch=function(){var t=this,c=this._queue.shift();if(c){var i=!1;this._currentReleaser=function(){i||(i=!0,t._value++,t._dispatch())},c([this._value--,this._currentReleaser])}},n})();return dr.default=r,dr}var Qc;function Eh(){if(Qc)return lr;Qc=1,Object.defineProperty(lr,"__esModule",{value:!0});var e=Vs,r=Al(),n=(function(){function t(){this._semaphore=new r.default(1)}return t.prototype.acquire=function(){return e.__awaiter(this,void 0,void 0,function(){var c,i;return e.__generator(this,function(a){switch(a.label){case 0:return[4,this._semaphore.acquire()];case 1:return c=a.sent(),i=c[1],[2,i]}})})},t.prototype.runExclusive=function(c){return this._semaphore.runExclusive(function(){return c()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t})();return lr.default=n,lr}var $t={},Yc;function Rh(){if(Yc)return $t;Yc=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.withTimeout=void 0;var e=Vs;function r(n,t,c){var i=this;return c===void 0&&(c=new Error("timeout")),{acquire:function(){return new Promise(function(a,h){return e.__awaiter(i,void 0,void 0,function(){var l,f,d;return e.__generator(this,function(o){switch(o.label){case 0:return l=!1,setTimeout(function(){l=!0,h(c)},t),[4,n.acquire()];case 1:return f=o.sent(),l?(d=Array.isArray(f)?f[1]:f,d()):a(f),[2]}})})})},runExclusive:function(a){return e.__awaiter(this,void 0,void 0,function(){var h,l;return e.__generator(this,function(f){switch(f.label){case 0:h=function(){},f.label=1;case 1:return f.trys.push([1,,7,8]),[4,this.acquire()];case 2:return l=f.sent(),Array.isArray(l)?(h=l[1],[4,a(l[0])]):[3,4];case 3:return[2,f.sent()];case 4:return h=l,[4,a()];case 5:return[2,f.sent()];case 6:return[3,8];case 7:return h(),[7];case 8:return[2]}})})},release:function(){n.release()},isLocked:function(){return n.isLocked()}}}return $t.withTimeout=r,$t}var Xc;function Sh(){return Xc||(Xc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var r=Eh();Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return r.default}});var n=Al();Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return n.default}});var t=Rh();Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return t.withTimeout}})})(ss)),ss}var os,eu;function Ch(){if(eu)return os;eu=1,os=r;var e=Object.prototype.hasOwnProperty;function r(){for(var n={},t=0;t<arguments.length;t++){var c=arguments[t];for(var i in c)e.call(c,i)&&(n[i]=c[i])}return n}return os}var as,tu;function kh(){if(tu)return as;tu=1;const e=Ch(),r=Ls()();as=n;function n(a){const h=this;h.currentProvider=a}n.prototype.getBalance=c(2,"eth_getBalance"),n.prototype.getCode=c(2,"eth_getCode"),n.prototype.getTransactionCount=c(2,"eth_getTransactionCount"),n.prototype.getStorageAt=c(3,"eth_getStorageAt"),n.prototype.call=c(2,"eth_call"),n.prototype.protocolVersion=t("eth_protocolVersion"),n.prototype.syncing=t("eth_syncing"),n.prototype.coinbase=t("eth_coinbase"),n.prototype.mining=t("eth_mining"),n.prototype.hashrate=t("eth_hashrate"),n.prototype.gasPrice=t("eth_gasPrice"),n.prototype.accounts=t("eth_accounts"),n.prototype.blockNumber=t("eth_blockNumber"),n.prototype.getBlockTransactionCountByHash=t("eth_getBlockTransactionCountByHash"),n.prototype.getBlockTransactionCountByNumber=t("eth_getBlockTransactionCountByNumber"),n.prototype.getUncleCountByBlockHash=t("eth_getUncleCountByBlockHash"),n.prototype.getUncleCountByBlockNumber=t("eth_getUncleCountByBlockNumber"),n.prototype.sign=t("eth_sign"),n.prototype.sendTransaction=t("eth_sendTransaction"),n.prototype.sendRawTransaction=t("eth_sendRawTransaction"),n.prototype.estimateGas=t("eth_estimateGas"),n.prototype.getBlockByHash=t("eth_getBlockByHash"),n.prototype.getBlockByNumber=t("eth_getBlockByNumber"),n.prototype.getTransactionByHash=t("eth_getTransactionByHash"),n.prototype.getTransactionByBlockHashAndIndex=t("eth_getTransactionByBlockHashAndIndex"),n.prototype.getTransactionByBlockNumberAndIndex=t("eth_getTransactionByBlockNumberAndIndex"),n.prototype.getTransactionReceipt=t("eth_getTransactionReceipt"),n.prototype.getUncleByBlockHashAndIndex=t("eth_getUncleByBlockHashAndIndex"),n.prototype.getUncleByBlockNumberAndIndex=t("eth_getUncleByBlockNumberAndIndex"),n.prototype.getCompilers=t("eth_getCompilers"),n.prototype.compileLLL=t("eth_compileLLL"),n.prototype.compileSolidity=t("eth_compileSolidity"),n.prototype.compileSerpent=t("eth_compileSerpent"),n.prototype.newFilter=t("eth_newFilter"),n.prototype.newBlockFilter=t("eth_newBlockFilter"),n.prototype.newPendingTransactionFilter=t("eth_newPendingTransactionFilter"),n.prototype.uninstallFilter=t("eth_uninstallFilter"),n.prototype.getFilterChanges=t("eth_getFilterChanges"),n.prototype.getFilterLogs=t("eth_getFilterLogs"),n.prototype.getLogs=t("eth_getLogs"),n.prototype.getWork=t("eth_getWork"),n.prototype.submitWork=t("eth_submitWork"),n.prototype.submitHashrate=t("eth_submitHashrate"),n.prototype.sendAsync=function(a,h){this.currentProvider.sendAsync(i(a),function(f,d){if(!f&&d.error&&(f=new Error("EthQuery - RPC Error - "+d.error.message)),f)return h(f);h(null,d.result)})};function t(a){return function(){const h=this;var l=[].slice.call(arguments),f=l.pop();h.sendAsync({method:a,params:l},f)}}function c(a,h){return function(){const l=this;var f=[].slice.call(arguments),d=f.pop();f.length<a&&f.push("latest"),l.sendAsync({method:h,params:f},d)}}function i(a){return e({id:r(),jsonrpc:"2.0",params:[]},a)}return as}var cs,ru;function Ih(){if(ru)return cs;ru=1;const e=(n,t,c,i)=>function(...a){const h=t.promiseModule;return new h((l,f)=>{t.multiArgs?a.push((...o)=>{t.errorFirst?o[0]?f(o):(o.shift(),l(o)):l(o)}):t.errorFirst?a.push((o,u)=>{o?f(o):l(u)}):a.push(l),Reflect.apply(n,this===c?i:this,a)})},r=new WeakMap;return cs=(n,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const c=typeof n;if(!(n!==null&&(c==="object"||c==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${n===null?"null":c}\``);const i=(l,f)=>{let d=r.get(l);if(d||(d={},r.set(l,d)),f in d)return d[f];const o=b=>typeof b=="string"||typeof f=="symbol"?f===b:b.test(f),u=Reflect.getOwnPropertyDescriptor(l,f),s=u===void 0||u.writable||u.configurable,m=(t.include?t.include.some(o):!t.exclude.some(o))&&s;return d[f]=m,m},a=new WeakMap,h=new Proxy(n,{apply(l,f,d){const o=a.get(l);if(o)return Reflect.apply(o,f,d);const u=t.excludeMain?l:e(l,t,h,l);return a.set(l,u),Reflect.apply(u,f,d)},get(l,f){const d=l[f];if(!i(l,f)||d===Function.prototype[f])return d;const o=a.get(d);if(o)return o;if(typeof d=="function"){const u=e(d,t,h,l);return a.set(d,u),u}return d}});return h},cs}var us,nu;function zs(){if(nu)return us;nu=1;const e=Ps().default;class r extends e{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(c=>this.emit("update",c))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}}return us=r,us}var ls,iu;function Ah(){if(iu)return ls;iu=1;const e=zs();class r extends e{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}}return ls=r,ls}var ds,su;function Kt(){if(su)return ds;su=1,ds={minBlockRef:e,maxBlockRef:r,sortBlockRefs:n,bnToHex:t,blockRefIsNumber:c,hexToInt:i,incrementHexInt:a,intToHex:h,unsafeRandomBytes:l};function e(...d){return n(d)[0]}function r(...d){const o=n(d);return o[o.length-1]}function n(d){return d.sort((o,u)=>o==="latest"||u==="earliest"?1:u==="latest"||o==="earliest"?-1:i(o)-i(u))}function t(d){return"0x"+d.toString(16)}function c(d){return d&&!["earliest","latest","pending"].includes(d)}function i(d){return d==null?d:Number.parseInt(d,16)}function a(d){if(d==null)return d;const o=i(d);return h(o+1)}function h(d){if(d==null)return d;let o=d.toString(16);return o.length%2&&(o="0"+o),"0x"+o}function l(d){let o="0x";for(let u=0;u<d;u++)o+=f(),o+=f();return o}function f(){return Math.floor(Math.random()*16).toString(16)}return ds}var fs,ou;function Th(){if(ou)return fs;ou=1;const e=kh(),r=Ih(),n=Ah(),{bnToHex:t,hexToInt:c,incrementHexInt:i,minBlockRef:a,blockRefIsNumber:h}=Kt();class l extends n{constructor({provider:d,params:o}){super(),this.type="log",this.ethQuery=new e(d),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},o),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(u=>u.toLowerCase()))}async initialize({currentBlock:d}){let o=this.params.fromBlock;["latest","pending"].includes(o)&&(o=d),o==="earliest"&&(o="0x0"),this.params.fromBlock=o;const u=a(this.params.toBlock,d),s=Object.assign({},this.params,{toBlock:u}),p=await this._fetchLogs(s);this.addInitialResults(p)}async update({oldBlock:d,newBlock:o}){const u=o;let s;d?s=i(d):s=o;const p=Object.assign({},this.params,{fromBlock:s,toBlock:u}),b=(await this._fetchLogs(p)).filter(g=>this.matchLog(g));this.addResults(b)}async _fetchLogs(d){return await r(u=>this.ethQuery.getLogs(d,u))()}matchLog(d){if(c(this.params.fromBlock)>=c(d.blockNumber)||h(this.params.toBlock)&&c(this.params.toBlock)<=c(d.blockNumber))return!1;const o=d.address&&d.address.toLowerCase();return this.params.address&&o&&!this.params.address.includes(o)?!1:this.params.topics.every((s,p)=>{let m=d.topics[p];if(!m)return!1;m=m.toLowerCase();let b=Array.isArray(s)?s:[s];return b.includes(null)?!0:(b=b.map(w=>w.toLowerCase()),b.includes(m))})}}return fs=l,fs}var hs,au;function Js(){if(au)return hs;au=1,hs=e;async function e({provider:i,fromBlock:a,toBlock:h}){a||(a=h);const l=r(a),d=r(h)-l+1,o=Array(d).fill().map((s,p)=>l+p).map(n);let u=await Promise.all(o.map(s=>c(i,"eth_getBlockByNumber",[s,!1])));return u=u.filter(s=>s!==null),u}function r(i){return i==null?i:Number.parseInt(i,16)}function n(i){return i==null?i:"0x"+i.toString(16)}function t(i,a){return new Promise((h,l)=>{i.sendAsync(a,(f,d)=>{f?l(f):d.error?l(d.error):d.result?h(d.result):l(new Error("Result was empty"))})})}async function c(i,a,h){for(let l=0;l<3;l++)try{return await t(i,{id:1,jsonrpc:"2.0",method:a,params:h})}catch(f){console.error(`provider.sendAsync failed: ${f.stack||f.message||f}`)}return null}return hs}var gs,cu;function Mh(){if(cu)return gs;cu=1;const e=zs(),r=Js(),{incrementHexInt:n}=Kt();class t extends e{constructor({provider:i,params:a}){super(),this.type="block",this.provider=i}async update({oldBlock:i,newBlock:a}){const h=a,l=n(i),d=(await r({provider:this.provider,fromBlock:l,toBlock:h})).map(o=>o.hash);this.addResults(d)}}return gs=t,gs}var ps,uu;function Lh(){if(uu)return ps;uu=1;const e=zs(),r=Js(),{incrementHexInt:n}=Kt();class t extends e{constructor({provider:i}){super(),this.type="tx",this.provider=i}async update({oldBlock:i}){const a=i,h=n(i),l=await r({provider:this.provider,fromBlock:h,toBlock:a}),f=[];for(const d of l)f.push(...d.transactions);this.addResults(f)}}return ps=t,ps}var ms,lu;function Ph(){if(lu)return ms;lu=1;const e=Sh().Mutex,{createAsyncMiddleware:r,createScaffoldMiddleware:n}=Il(),t=Th(),c=Mh(),i=Lh(),{intToHex:a,hexToInt:h}=Kt();ms=l;function l({blockTracker:s,provider:p}){let m=0,b={};const g=new e,y=o({mutex:g}),w=n({eth_newFilter:y(f(v)),eth_newBlockFilter:y(f(C)),eth_newPendingTransactionFilter:y(f(S)),eth_uninstallFilter:y(d(D)),eth_getFilterChanges:y(d(I)),eth_getFilterLogs:y(d(N))}),_=async({oldBlock:J,newBlock:T})=>{if(b.length===0)return;const M=await g.acquire();try{await Promise.all(u(b).map(async L=>{try{await L.update({oldBlock:J,newBlock:T})}catch(x){console.error(x)}}))}catch(L){console.error(L)}M()};return w.newLogFilter=v,w.newBlockFilter=C,w.newPendingTransactionFilter=S,w.uninstallFilter=D,w.getFilterChanges=I,w.getFilterLogs=N,w.destroy=()=>{X()},w;async function v(J){const T=new t({provider:p,params:J});return await $(T),T}async function C(){const J=new c({provider:p});return await $(J),J}async function S(){const J=new i({provider:p});return await $(J),J}async function I(J){const T=h(J),M=b[T];if(!M)throw new Error(`No filter for index "${T}"`);return M.getChangesAndClear()}async function N(J){const T=h(J),M=b[T];if(!M)throw new Error(`No filter for index "${T}"`);let L=[];return M.type==="log"&&(L=M.getAllResults()),L}async function D(J){const T=h(J),L=!!b[T];return L&&await z(T),L}async function $(J){const T=u(b).length,M=await s.getLatestBlock();await J.initialize({currentBlock:M}),m++,b[m]=J,J.id=m,J.idHex=a(m);const L=u(b).length;return Y({prevFilterCount:T,newFilterCount:L}),m}async function z(J){const T=u(b).length;delete b[J];const M=u(b).length;Y({prevFilterCount:T,newFilterCount:M})}async function X(){const J=u(b).length;b={},Y({prevFilterCount:J,newFilterCount:0})}function Y({prevFilterCount:J,newFilterCount:T}){if(J===0&&T>0){s.on("sync",_);return}if(J>0&&T===0){s.removeListener("sync",_);return}}}function f(s){return d(async(...p)=>{const m=await s(...p);return a(m.id)})}function d(s){return r(async(p,m)=>{const b=await s.apply(null,p.params);m.result=b})}function o({mutex:s}){return p=>async(m,b,g,y)=>{(await s.acquire())(),p(m,b,g,y)}}function u(s,p){const m=[];for(let b in s)m.push(s[b]);return m}return ms}var bs,du;function Nh(){if(du)return bs;du=1;const e=Ps().default,{createAsyncMiddleware:r,createScaffoldMiddleware:n}=Il(),t=Ph(),{unsafeRandomBytes:c,incrementHexInt:i}=Kt(),a=Js();bs=h;function h({blockTracker:f,provider:d}){const o={},u=t({blockTracker:f,provider:d});let s=!1;const p=new e,m=n({eth_subscribe:r(b),eth_unsubscribe:r(g)});return m.destroy=w,{events:p,middleware:m};async function b(_,v){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const C=_.params[0],S=c(16);let I;switch(C){case"newHeads":I=N({subId:S});break;case"logs":const $=_.params[1],z=await u.newLogFilter($);I=D({subId:S,filter:z});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${C}"`)}o[S]=I,v.result=S;return;function N({subId:$}){const z={type:C,destroy:async()=>{f.removeListener("sync",z.update)},update:async({oldBlock:X,newBlock:Y})=>{const J=Y,T=i(X);(await a({provider:d,fromBlock:T,toBlock:J})).map(l).filter(x=>x!==null).forEach(x=>{y($,x)})}};return f.on("sync",z.update),z}function D({subId:$,filter:z}){return z.on("update",Y=>y($,Y)),{type:C,destroy:async()=>await u.uninstallFilter(z.idHex)}}}async function g(_,v){if(s)throw new Error("SubscriptionManager - attempting to use after destroying");const C=_.params[0],S=o[C];if(!S){v.result=!1;return}delete o[C],await S.destroy(),v.result=!0}function y(_,v){p.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:_,result:v}})}function w(){p.removeAllListeners();for(const _ in o)o[_].destroy(),delete o[_];s=!0}}function l(f){return f==null?null:{hash:f.hash,parentHash:f.parentHash,sha3Uncles:f.sha3Uncles,miner:f.miner,stateRoot:f.stateRoot,transactionsRoot:f.transactionsRoot,receiptsRoot:f.receiptsRoot,logsBloom:f.logsBloom,difficulty:f.difficulty,number:f.number,gasLimit:f.gasLimit,gasUsed:f.gasUsed,nonce:f.nonce,mixHash:f.mixHash,timestamp:f.timestamp,extraData:f.extraData}}return bs}var fu;function Oh(){if(fu)return Pt;fu=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.SubscriptionManager=void 0;const e=hh(),r=Nh(),n=()=>{};let t=class{constructor(i){const a=new e.PollingBlockTracker({provider:i,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:h,middleware:l}=r({blockTracker:a,provider:i});this.events=h,this.subscriptionMiddleware=l}async handleRequest(i){const a={};return await this.subscriptionMiddleware(i,a,n,n),a}destroy(){this.subscriptionMiddleware.destroy()}};return Pt.SubscriptionManager=t,Pt}var hu;function vs(){if(hu)return Te;hu=1;var e=Te&&Te.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(Te,"__esModule",{value:!0}),Te.CoinbaseWalletProvider=void 0;const r=e(pr()),n=Pl(),t=wr(),c=Re(),i=Yu(),a=As(),h=Ts(),l=Cs(),f=e(Pd()),d=Is(),o=Nd(),u=Oh(),s="DefaultChainId",p="DefaultJsonRpcUrl";let m=class extends n.EventEmitter{constructor(g){var y,w;super(),this._filterPolyfill=new o.FilterPolyfill(this),this._subscriptionManager=new u.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=g.chainId,this._jsonRpcUrlFromOpts=g.jsonRpcUrl,this._overrideIsMetaMask=g.overrideIsMetaMask,this._relayProvider=g.relayProvider,this._storage=g.storage,this._relayEventManager=g.relayEventManager,this.diagnostic=g.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(y=g.overrideIsCoinbaseWallet)!==null&&y!==void 0?y:!0,this.isCoinbaseBrowser=(w=g.overrideIsCoinbaseBrowser)!==null&&w!==void 0?w:!1,this.qrUrl=g.qrUrl;const _=this.getChainId(),v=(0,c.prepend0x)(_.toString(16));this.emit("connect",{chainIdStr:v});const C=this._storage.getItem(a.LOCAL_STORAGE_ADDRESSES_KEY);if(C){const S=C.split(" ");S[0]!==""&&(this._addresses=S.map(I=>(0,c.ensureAddressString)(I)),this.emit("accountsChanged",S))}this._subscriptionManager.events.on("notification",S=>{this.emit("message",{type:S.method,data:S.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",S=>{var I;if(!(S.origin!==location.origin||S.source!==window)&&S.data.type==="walletLinkMessage"&&S.data.data.action==="dappChainSwitched"){const N=S.data.data.chainId,D=(I=S.data.data.jsonRpcUrl)!==null&&I!==void 0?I:this.jsonRpcUrl;this.updateProviderInfo(D,Number(N))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,c.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var g;return(g=this._storage.getItem(p))!==null&&g!==void 0?g:this._jsonRpcUrlFromOpts}set jsonRpcUrl(g){this._storage.setItem(p,g)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(g,y){this.isCoinbaseBrowser||(this._chainIdFromOpts=y,this._jsonRpcUrlFromOpts=g),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(g,y){this.jsonRpcUrl=g;const w=this.getChainId();this._storage.setItem(s,y.toString(10)),((0,c.ensureIntNumber)(y)!==w||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(g,y,w,_,v,C){const I=await(await this.initializeRelay()).watchAsset(g,y,w,_,v,C==null?void 0:C.toString()).promise;return(0,l.isErrorResponse)(I)?!1:!!I.result}async addEthereumChain(g,y,w,_,v,C){var S,I;if((0,c.ensureIntNumber)(g)===this.getChainId())return!1;const N=await this.initializeRelay(),D=N.inlineAddEthereumChain(g.toString());!this._isAuthorized()&&!D&&await N.requestEthereumAccounts().promise;const $=await N.addEthereumChain(g.toString(),y,v,w,_,C).promise;return(0,l.isErrorResponse)($)?!1:(((S=$.result)===null||S===void 0?void 0:S.isApproved)===!0&&this.updateProviderInfo(y[0],g),((I=$.result)===null||I===void 0?void 0:I.isApproved)===!0)}async switchEthereumChain(g){const w=await(await this.initializeRelay()).switchEthereumChain(g.toString(10),this.selectedAddress||void 0).promise;if((0,l.isErrorResponse)(w)){if(!w.errorCode)return;throw w.errorCode===t.standardErrorCodes.provider.unsupportedChain?t.standardErrors.provider.unsupportedChain():t.standardErrors.provider.custom({message:w.errorMessage,code:w.errorCode})}const _=w.result;_.isApproved&&_.rpcUrl.length>0&&this.updateProviderInfo(_.rpcUrl,g)}setAppInfo(g,y){this.initializeRelay().then(w=>w.setAppInfo(g,y))}async enable(){var g;return(g=this.diagnostic)===null||g===void 0||g.log(d.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?h.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(g,y){try{const w=this._send(g,y);if(w instanceof Promise)return w.catch(_=>{throw(0,t.serializeError)(_,g)})}catch(w){throw(0,t.serializeError)(w,g)}}_send(g,y){if(typeof g=="string"){const _=g,v=Array.isArray(y)?y:y!==void 0?[y]:[],C={jsonrpc:"2.0",id:0,method:_,params:v};return this._sendRequestAsync(C).then(S=>S.result)}if(typeof y=="function"){const _=g,v=y;return this._sendAsync(_,v)}if(Array.isArray(g))return g.map(v=>this._sendRequest(v));const w=g;return this._sendRequest(w)}async sendAsync(g,y){try{return this._sendAsync(g,y).catch(w=>{throw(0,t.serializeError)(w,g)})}catch(w){return Promise.reject((0,t.serializeError)(w,g))}}async _sendAsync(g,y){if(typeof y!="function")throw new Error("callback is required");if(Array.isArray(g)){const _=y;this._sendMultipleRequestsAsync(g).then(v=>_(null,v)).catch(v=>_(v,null));return}const w=y;return this._sendRequestAsync(g).then(_=>w(null,_)).catch(_=>w(_,null))}async request(g){try{return this._request(g).catch(y=>{throw(0,t.serializeError)(y,g.method)})}catch(y){return Promise.reject((0,t.serializeError)(y,g.method))}}async _request(g){if(!g||typeof g!="object"||Array.isArray(g))throw t.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:g});const{method:y,params:w}=g;if(typeof y!="string"||y.length===0)throw t.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:g});if(w!==void 0&&!Array.isArray(w)&&(typeof w!="object"||w===null))throw t.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:g});const _=w===void 0?[]:w,v=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:y,params:_,jsonrpc:"2.0",id:v})).result}async scanQRCode(g){const w=await(await this.initializeRelay()).scanQRCode((0,c.ensureRegExpString)(g)).promise;if((0,l.isErrorResponse)(w))throw(0,t.serializeError)(w.errorMessage,"scanQRCode");if(typeof w.result!="string")throw(0,t.serializeError)("result was not a string","scanQRCode");return w.result}async genericRequest(g,y){const _=await(await this.initializeRelay()).genericRequest(g,y).promise;if((0,l.isErrorResponse)(_))throw(0,t.serializeError)(_.errorMessage,"generic");if(typeof _.result!="string")throw(0,t.serializeError)("result was not a string","generic");return _.result}async connectAndSignIn(g){var y;(y=this.diagnostic)===null||y===void 0||y.log(d.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?h.Session.hash(this._relay.session.id):void 0});let w;try{const v=await this.initializeRelay();if(!(v instanceof i.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(w=await v.connectAndSignIn(g).promise,(0,l.isErrorResponse)(w))throw new Error(w.errorMessage)}catch(v){throw typeof v.message=="string"&&v.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied account authorization"):v}if(!w.result)throw new Error("accounts received is empty");const{accounts:_}=w.result;return this._setAddresses(_),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),w.result}async selectProvider(g){const w=await(await this.initializeRelay()).selectProvider(g).promise;if((0,l.isErrorResponse)(w))throw(0,t.serializeError)(w.errorMessage,"selectProvider");if(typeof w.result!="string")throw(0,t.serializeError)("result was not a string","selectProvider");return w.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(g){const y={jsonrpc:"2.0",id:g.id},{method:w}=g;if(y.result=this._handleSynchronousMethods(g),y.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${w} synchronously without a callback. Please provide a callback parameter to call ${w} asynchronously.`);return y}_setAddresses(g,y){if(!Array.isArray(g))throw new Error("addresses is not an array");const w=g.map(_=>(0,c.ensureAddressString)(_));JSON.stringify(w)!==JSON.stringify(this._addresses)&&(this._addresses=w,this.emit("accountsChanged",this._addresses),this._storage.setItem(a.LOCAL_STORAGE_ADDRESSES_KEY,w.join(" ")))}_sendRequestAsync(g){return new Promise((y,w)=>{try{const _=this._handleSynchronousMethods(g);if(_!==void 0)return y({jsonrpc:"2.0",id:g.id,result:_});const v=this._handleAsynchronousFilterMethods(g);if(v!==void 0){v.then(S=>y(Object.assign(Object.assign({},S),{id:g.id}))).catch(S=>w(S));return}const C=this._handleSubscriptionMethods(g);if(C!==void 0){C.then(S=>y({jsonrpc:"2.0",id:g.id,result:S.result})).catch(S=>w(S));return}}catch(_){return w(_)}this._handleAsynchronousMethods(g).then(_=>_&&y(Object.assign(Object.assign({},_),{id:g.id}))).catch(_=>w(_))})}_sendMultipleRequestsAsync(g){return Promise.all(g.map(y=>this._sendRequestAsync(y)))}_handleSynchronousMethods(g){const{method:y}=g,w=g.params||[];switch(y){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(w);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(g){const{method:y}=g,w=g.params||[];switch(y){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(w);case"eth_ecRecover":return this._eth_ecRecover(w);case"personal_sign":return this._personal_sign(w);case"personal_ecRecover":return this._personal_ecRecover(w);case"eth_signTransaction":return this._eth_signTransaction(w);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(w);case"eth_sendTransaction":return this._eth_sendTransaction(w);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(w);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(w);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(w);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(w);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(w);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(w);case"wallet_watchAsset":return this._wallet_watchAsset(w)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(g,this.jsonRpcUrl).catch(v=>{var C;throw(v.code===t.standardErrorCodes.rpc.methodNotFound||v.code===t.standardErrorCodes.rpc.methodNotSupported)&&((C=this.diagnostic)===null||C===void 0||C.log(d.EVENTS.METHOD_NOT_IMPLEMENTED,{method:g.method,sessionIdHash:this._relay?h.Session.hash(this._relay.session.id):void 0})),v})}_handleAsynchronousFilterMethods(g){const{method:y}=g,w=g.params||[];switch(y){case"eth_newFilter":return this._eth_newFilter(w);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(w);case"eth_getFilterLogs":return this._eth_getFilterLogs(w)}}_handleSubscriptionMethods(g){switch(g.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(g)}}_isKnownAddress(g){try{const y=(0,c.ensureAddressString)(g);return this._addresses.map(_=>(0,c.ensureAddressString)(_)).includes(y)}catch{}return!1}_ensureKnownAddress(g){var y;if(!this._isKnownAddress(g))throw(y=this.diagnostic)===null||y===void 0||y.log(d.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(g){const y=g.from?(0,c.ensureAddressString)(g.from):this.selectedAddress;if(!y)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(y);const w=g.to?(0,c.ensureAddressString)(g.to):null,_=g.value!=null?(0,c.ensureBN)(g.value):new r.default(0),v=g.data?(0,c.ensureBuffer)(g.data):K.alloc(0),C=g.nonce!=null?(0,c.ensureIntNumber)(g.nonce):null,S=g.gasPrice!=null?(0,c.ensureBN)(g.gasPrice):null,I=g.maxFeePerGas!=null?(0,c.ensureBN)(g.maxFeePerGas):null,N=g.maxPriorityFeePerGas!=null?(0,c.ensureBN)(g.maxPriorityFeePerGas):null,D=g.gas!=null?(0,c.ensureBN)(g.gas):null,$=g.chainId?(0,c.ensureIntNumber)(g.chainId):this.getChainId();return{fromAddress:y,toAddress:w,weiValue:_,data:v,nonce:C,gasPriceInWei:S,maxFeePerGas:I,maxPriorityFeePerGas:N,gasLimit:D,chainId:$}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw t.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw t.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(g,y,w,_){this._ensureKnownAddress(y);try{const C=await(await this.initializeRelay()).signEthereumMessage(g,y,w,_).promise;if((0,l.isErrorResponse)(C))throw new Error(C.errorMessage);return{jsonrpc:"2.0",id:0,result:C.result}}catch(v){throw typeof v.message=="string"&&v.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied message signature"):v}}async _ethereumAddressFromSignedMessage(g,y,w){const v=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(g,y,w).promise;if((0,l.isErrorResponse)(v))throw new Error(v.errorMessage);return{jsonrpc:"2.0",id:0,result:v.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,c.hexStringFromIntNumber)(this.getChainId())}getChainId(){const g=this._storage.getItem(s);if(!g)return(0,c.ensureIntNumber)(this._chainIdFromOpts);const y=parseInt(g,10);return(0,c.ensureIntNumber)(y)}async _eth_requestAccounts(){var g;if((g=this.diagnostic)===null||g===void 0||g.log(d.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?h.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let y;try{if(y=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,l.isErrorResponse)(y))throw new Error(y.errorMessage)}catch(w){throw typeof w.message=="string"&&w.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied account authorization"):w}if(!y.result)throw new Error("accounts received is empty");return this._setAddresses(y.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(g){this._requireAuthorization();const y=(0,c.ensureAddressString)(g[0]),w=(0,c.ensureBuffer)(g[1]);return this._signEthereumMessage(w,y,!1)}_eth_ecRecover(g){const y=(0,c.ensureBuffer)(g[0]),w=(0,c.ensureBuffer)(g[1]);return this._ethereumAddressFromSignedMessage(y,w,!1)}_personal_sign(g){this._requireAuthorization();const y=(0,c.ensureBuffer)(g[0]),w=(0,c.ensureAddressString)(g[1]);return this._signEthereumMessage(y,w,!0)}_personal_ecRecover(g){const y=(0,c.ensureBuffer)(g[0]),w=(0,c.ensureBuffer)(g[1]);return this._ethereumAddressFromSignedMessage(y,w,!0)}async _eth_signTransaction(g){this._requireAuthorization();const y=this._prepareTransactionParams(g[0]||{});try{const _=await(await this.initializeRelay()).signEthereumTransaction(y).promise;if((0,l.isErrorResponse)(_))throw new Error(_.errorMessage);return{jsonrpc:"2.0",id:0,result:_.result}}catch(w){throw typeof w.message=="string"&&w.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied transaction signature"):w}}async _eth_sendRawTransaction(g){const y=(0,c.ensureBuffer)(g[0]),_=await(await this.initializeRelay()).submitEthereumTransaction(y,this.getChainId()).promise;if((0,l.isErrorResponse)(_))throw new Error(_.errorMessage);return{jsonrpc:"2.0",id:0,result:_.result}}async _eth_sendTransaction(g){this._requireAuthorization();const y=this._prepareTransactionParams(g[0]||{});try{const _=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(y).promise;if((0,l.isErrorResponse)(_))throw new Error(_.errorMessage);return{jsonrpc:"2.0",id:0,result:_.result}}catch(w){throw typeof w.message=="string"&&w.message.match(/(denied|rejected)/i)?t.standardErrors.provider.userRejectedRequest("User denied transaction signature"):w}}async _eth_signTypedData_v1(g){this._requireAuthorization();const y=(0,c.ensureParsedJSONObject)(g[0]),w=(0,c.ensureAddressString)(g[1]);this._ensureKnownAddress(w);const _=f.default.hashForSignTypedDataLegacy({data:y}),v=JSON.stringify(y,null,2);return this._signEthereumMessage(_,w,!1,v)}async _eth_signTypedData_v3(g){this._requireAuthorization();const y=(0,c.ensureAddressString)(g[0]),w=(0,c.ensureParsedJSONObject)(g[1]);this._ensureKnownAddress(y);const _=f.default.hashForSignTypedData_v3({data:w}),v=JSON.stringify(w,null,2);return this._signEthereumMessage(_,y,!1,v)}async _eth_signTypedData_v4(g){this._requireAuthorization();const y=(0,c.ensureAddressString)(g[0]),w=(0,c.ensureParsedJSONObject)(g[1]);this._ensureKnownAddress(y);const _=f.default.hashForSignTypedData_v4({data:w}),v=JSON.stringify(w,null,2);return this._signEthereumMessage(_,y,!1,v)}async _cbwallet_arbitrary(g){const y=g[0],w=g[1];if(typeof w!="string")throw new Error("parameter must be a string");if(typeof y!="object"||y===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(y,w)}}async _wallet_addEthereumChain(g){var y,w,_,v;const C=g[0];if(((y=C.rpcUrls)===null||y===void 0?void 0:y.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!C.chainName||C.chainName.trim()==="")throw t.standardErrors.rpc.invalidParams("chainName is a required field");if(!C.nativeCurrency)throw t.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const S=parseInt(C.chainId,16);return await this.addEthereumChain(S,(w=C.rpcUrls)!==null&&w!==void 0?w:[],(_=C.blockExplorerUrls)!==null&&_!==void 0?_:[],C.chainName,(v=C.iconUrls)!==null&&v!==void 0?v:[],C.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(g){const y=g[0];return await this.switchEthereumChain(parseInt(y.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(g){const y=Array.isArray(g)?g[0]:g;if(!y.type)throw t.standardErrors.rpc.invalidParams("Type is required");if((y==null?void 0:y.type)!=="ERC20")throw t.standardErrors.rpc.invalidParams(`Asset of type '${y.type}' is not supported`);if(!(y!=null&&y.options))throw t.standardErrors.rpc.invalidParams("Options are required");if(!(y!=null&&y.options.address))throw t.standardErrors.rpc.invalidParams("Address is required");const w=this.getChainId(),{address:_,symbol:v,image:C,decimals:S}=y.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(y.type,_,v,S,C,w)}}_eth_uninstallFilter(g){const y=(0,c.ensureHexString)(g[0]);return this._filterPolyfill.uninstallFilter(y)}async _eth_newFilter(g){const y=g[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(y)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(g){const y=(0,c.ensureHexString)(g[0]);return this._filterPolyfill.getFilterChanges(y)}_eth_getFilterLogs(g){const y=(0,c.ensureHexString)(g[0]);return this._filterPolyfill.getFilterLogs(y)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(g=>(g.setAccountsCallback((y,w)=>this._setAddresses(y,w)),g.setChainCallback((y,w)=>{this.updateProviderInfo(w,parseInt(y,10))}),g.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=g,g))}};return Te.CoinbaseWalletProvider=m,Te}var Ht={},gu;function xh(){if(gu)return Ht;gu=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.RelayEventManager=void 0;const e=Re();let r=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,c=(0,e.prepend0x)(t.toString(16));return this.callbacks.get(c)&&this.callbacks.delete(c),t}};return Ht.RelayEventManager=r,Ht}var pu;function mu(){if(pu)return at;pu=1,Object.defineProperty(at,"__esModule",{value:!0}),at.CoinbaseWalletSDK=void 0;const e=Ul(),r=Wl(),n=Re(),t=Jl(),c=vs(),i=Yu(),a=Qu(),h=xh(),l=Zu(),f=Ku(),d=ks();let o=class Tl{constructor(s){var p,m,b;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const g=s.linkAPIUrl||r.LINK_API_URL;typeof s.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=s.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(p=s.overrideIsCoinbaseWallet)!==null&&p!==void 0?p:!0,this._overrideIsCoinbaseBrowser=(m=s.overrideIsCoinbaseBrowser)!==null&&m!==void 0?m:!1,this._diagnosticLogger=s.diagnosticLogger,this._reloadOnDisconnect=(b=s.reloadOnDisconnect)!==null&&b!==void 0?b:!0;const y=new URL(g),w=`${y.protocol}//${y.host}`;if(this._storage=new t.ScopedLocalStorage(`-walletlink:${w}`),this._storage.setItem("version",Tl.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new h.RelayEventManager;const _=(0,n.isMobileWeb)(),v=s.uiConstructor||(S=>_?new a.MobileRelayUI(S):new l.WalletLinkRelayUI(S)),C={linkAPIUrl:g,version:d.LIB_VERSION,darkMode:!!s.darkMode,headlessMode:!!s.headlessMode,uiConstructor:v,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:s.enableMobileWalletLink};this._relay=_?new i.MobileRelay(C):new f.WalletLinkRelay(C),this.setAppInfo(s.appName,s.appLogoUrl),!s.headlessMode&&this._relay.attachUI()}makeWeb3Provider(s="",p=1){const m=this.walletExtension;if(m)return this.isCipherProvider(m)||m.setProviderInfo(s,p),this._reloadOnDisconnect===!1&&typeof m.disableReloadOnDisconnect=="function"&&m.disableReloadOnDisconnect(),m;const b=this.coinbaseBrowser;if(b)return b;const g=this._relay;if(!g||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return s||g.setConnectDisabled(!0),new c.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(g),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:s,chainId:p,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(s,p){var m;this._appName=s||"DApp",this._appLogoUrl=p||(0,n.getFavicon)();const b=this.walletExtension;b?this.isCipherProvider(b)||b.setAppInfo(this._appName,this._appLogoUrl):(m=this._relay)===null||m===void 0||m.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var s;const p=this===null||this===void 0?void 0:this.walletExtension;p?p.close():(s=this._relay)===null||s===void 0||s.resetAndReload()}getQrUrl(){var s,p;return(p=(s=this._relay)===null||s===void 0?void 0:s.getQRCodeUrl())!==null&&p!==void 0?p:null}getCoinbaseWalletLogo(s,p=240){return(0,e.walletLogo)(s,p)}get walletExtension(){var s;return(s=window.coinbaseWalletExtension)!==null&&s!==void 0?s:window.walletLinkExtension}get coinbaseBrowser(){var s,p;try{const m=(s=window.ethereum)!==null&&s!==void 0?s:(p=window.top)===null||p===void 0?void 0:p.ethereum;return m&&"isCoinbaseBrowser"in m&&m.isCoinbaseBrowser?m:void 0}catch{return}}isCipherProvider(s){return typeof s.isCipher=="boolean"&&s.isCipher}};return at.CoinbaseWalletSDK=o,o.VERSION=d.LIB_VERSION,at}var bu;function Dh(){return bu||(bu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const r=mu(),n=vs();var t=mu();Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return t.CoinbaseWalletSDK}});var c=vs();Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return c.CoinbaseWalletProvider}}),e.default=r.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=r.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=r.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)})(Sn)),Sn}var Ml=Dh();const jh=Ll(Ml),u0=Bl({__proto__:null,default:jh},[Ml]);export{u0 as i};