@dcl/explore-site 0.0.1-24138829632.commit-0946e16

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 (158) hide show
  1. package/assets/HomePage-CbNrtXMa.js +3 -0
  2. package/assets/QueryClientProvider-DUSjZ_J_.js +2 -0
  3. package/assets/RoobertPRO-Bold-DDyOqNrI.woff2 +0 -0
  4. package/assets/RoobertPRO-Bold-zQ2qeH97.ttf +0 -0
  5. package/assets/SensorsRounded-Ci-z6t1A.js +15 -0
  6. package/assets/___vite-browser-external_commonjs-proxy-BqV5D26a.js +1 -0
  7. package/assets/__federation_expose_App-BckrSixU.js +1 -0
  8. package/assets/__federation_fn_import-WDa0gv1I.js +1 -0
  9. package/assets/__federation_shared_@dcl/hooks-BmGk-LAU.js +535 -0
  10. package/assets/__federation_shared_@dcl/schemas-FcJQcJ28.js +1 -0
  11. package/assets/__federation_shared_@emotion/react-oi_M7gMJ.js +1 -0
  12. package/assets/__federation_shared_@emotion/styled-YrTPT9q1.js +1 -0
  13. package/assets/__federation_shared_@reduxjs/toolkit-R1Ell7gI.js +1 -0
  14. package/assets/__federation_shared_decentraland-ui2-D5N7yacO.js +357 -0
  15. package/assets/__federation_shared_react-B3tlNTLg.js +1 -0
  16. package/assets/__federation_shared_react-dom-Dsn5WX9N.js +1 -0
  17. package/assets/__federation_shared_react-redux-DMak3BVq.js +13 -0
  18. package/assets/__federation_shared_react-router-dom-CSW28ZSI.js +49 -0
  19. package/assets/__federation_shared_viem-DsDw7lUr.js +2 -0
  20. package/assets/__federation_shared_wagmi-h3zhLZbR.js +17 -0
  21. package/assets/__vite-optional-peer-dep_lottie-react_decentraland-ui2-BIHI7g3E.js +1 -0
  22. package/assets/_commonjsHelpers-C4iS2aBk.js +1 -0
  23. package/assets/add-Ccyt7YRh.js +15 -0
  24. package/assets/all-wallets-BIOtzF11.js +6 -0
  25. package/assets/app-store-BqACXnTM.js +17 -0
  26. package/assets/apple-zIEkvR7h.js +18 -0
  27. package/assets/arrow-bottom-CxQ54WH1.js +8 -0
  28. package/assets/arrow-bottom-circle-BjCA11Rn.js +11 -0
  29. package/assets/arrow-left-CsFQBdFD.js +8 -0
  30. package/assets/arrow-right-jT5LSgqq.js +8 -0
  31. package/assets/arrow-top-CA_1oaHw.js +8 -0
  32. package/assets/auto-track-UOggKKzv.js +1 -0
  33. package/assets/bank-81NjtLlm.js +14 -0
  34. package/assets/basic-CvR9b359.js +2128 -0
  35. package/assets/brotli_wasm_bg-NfWIZley.wasm +0 -0
  36. package/assets/browser-BjIqaPVu.js +14 -0
  37. package/assets/card-BJomEEgV.js +14 -0
  38. package/assets/ccip-DotuofV0.js +1 -0
  39. package/assets/checkmark-Cz0VZAkr.js +11 -0
  40. package/assets/checkmark-bold-blkVLUov.js +8 -0
  41. package/assets/chevron-bottom-ClawczSo.js +8 -0
  42. package/assets/chevron-left-DfJ9r4mv.js +8 -0
  43. package/assets/chevron-right-CrxmyW0K.js +8 -0
  44. package/assets/chevron-top-BVIfb-H3.js +8 -0
  45. package/assets/chrome-store-Cb5xVI0B.js +61 -0
  46. package/assets/clock-Bx-Kyhh-.js +8 -0
  47. package/assets/close-DOjpWTZi.js +8 -0
  48. package/assets/coinPlaceholder-BqONZM6Q.js +8 -0
  49. package/assets/compass-ByyIpxD6.js +8 -0
  50. package/assets/copy-BOu2-Xgv.js +15 -0
  51. package/assets/core-BGxUaCGc.js +907 -0
  52. package/assets/create-submenu-Bu20F8-Z.webp +0 -0
  53. package/assets/createClient-CSnZgvsb.js +1 -0
  54. package/assets/cursor-BqYz2L6D.js +3 -0
  55. package/assets/cursor-transparent-CWCRGDtx.js +12 -0
  56. package/assets/custom-welcome-background-BxlFQma9.webp +0 -0
  57. package/assets/defineChain-7I0Ce1VT.js +1 -0
  58. package/assets/desktop-Cd_vx0kT.js +9 -0
  59. package/assets/disconnect-D5AICJhj.js +8 -0
  60. package/assets/discord-26Vqbq7c.js +17 -0
  61. package/assets/emotion-react.browser.esm-5OnyV0Sh.js +8 -0
  62. package/assets/emotion-use-insertion-effect-with-fallbacks.browser.esm-B75LdcJS.js +1 -0
  63. package/assets/etherscan--DKVcYrP.js +6 -0
  64. package/assets/exclamation-triangle-DOsYf3fQ.js +4 -0
  65. package/assets/explore-submenu-BFVuYMi9.webp +0 -0
  66. package/assets/extension-DEaO3Zvk.js +8 -0
  67. package/assets/external-link-DcpG6wpM.js +8 -0
  68. package/assets/facebook-ByV0OclL.js +26 -0
  69. package/assets/farcaster-DI6fsEyh.js +12 -0
  70. package/assets/filters-Djn1aDVs.js +8 -0
  71. package/assets/github-B3p0LLP5.js +18 -0
  72. package/assets/google-ae7qga4R.js +18 -0
  73. package/assets/governance-submenu-VTIKvCIL.webp +0 -0
  74. package/assets/help-circle-BmzUA_Be.js +12 -0
  75. package/assets/hooks.module-Dz_XB4AG.js +1 -0
  76. package/assets/id-2hYEZqNH.js +12 -0
  77. package/assets/image-mDqi4ffo.js +4 -0
  78. package/assets/index-9zCVakoE.js +1 -0
  79. package/assets/index-BKLT1eit.js +2 -0
  80. package/assets/index-Biwg5bHN.js +1 -0
  81. package/assets/index-BzXoRVC1.js +1 -0
  82. package/assets/index-C05H8NDX.js +1 -0
  83. package/assets/index-CGCGB-at.js +1 -0
  84. package/assets/index-CNMKbeE1.js +5 -0
  85. package/assets/index-CVdhIPEJ.js +1 -0
  86. package/assets/index-CdOcIHYV.js +395 -0
  87. package/assets/index-CdrMQoR6.js +1 -0
  88. package/assets/index-Ctl4brHr.js +2 -0
  89. package/assets/index-D6O4pjzC.js +12 -0
  90. package/assets/index-D6ZMQedT.js +1 -0
  91. package/assets/index-DGVKdsht.js +1 -0
  92. package/assets/index-D_fJMF1A.js +1 -0
  93. package/assets/index-Dy0yjznp.js +1 -0
  94. package/assets/index-Dy0yjznp__bundled.js +9 -0
  95. package/assets/index-JFBsW0Hp.js +1 -0
  96. package/assets/index-OQ3TYt4p.js +7 -0
  97. package/assets/index-VfkM29PH.js +1 -0
  98. package/assets/index-VfkM29PH__bundled.js +24 -0
  99. package/assets/index-nibyPLVP.js +1 -0
  100. package/assets/index-pEp_vRda.js +8 -0
  101. package/assets/index.es-D_4_VpXc.js +38 -0
  102. package/assets/index.umd-6zndRFhB.js +1 -0
  103. package/assets/info-Bhf5PLdi.js +3 -0
  104. package/assets/info-circle-CZ5iih32.js +12 -0
  105. package/assets/inherits_browser-BlmhoU4v.js +1 -0
  106. package/assets/is-plan-event-enabled-DeNtQvA5.js +1 -0
  107. package/assets/jsx-runtime-B1l0k91v.js +1 -0
  108. package/assets/jsx-runtime-B1l0k91v__bundled.js +9 -0
  109. package/assets/learn-submenu-sfxVP5Db.webp +0 -0
  110. package/assets/lightbulb-CA3e26a0.js +3 -0
  111. package/assets/localBatchGatewayRequest-vExM5jac.js +1 -0
  112. package/assets/logo-pattern-D4X-bvlg.webp +0 -0
  113. package/assets/mail-BktjMbEk.js +8 -0
  114. package/assets/man-default1-BEO13leF.png +0 -0
  115. package/assets/marketplace-submenu-CixWTv8_.webp +0 -0
  116. package/assets/mobile-zfEM0JzU.js +9 -0
  117. package/assets/more-Dg45xuT9.js +11 -0
  118. package/assets/native-CJ5et6AR.js +1 -0
  119. package/assets/network-placeholder-duQhExzj.js +14 -0
  120. package/assets/nftPlaceholder-C3kMYu-p.js +8 -0
  121. package/assets/off-Cz636L92.js +8 -0
  122. package/assets/play-store-Cch0eiCp.js +32 -0
  123. package/assets/plus-orAhHwVf.js +13 -0
  124. package/assets/preload-helper-BrYcp76J.js +1 -0
  125. package/assets/qr-code-7plug-hj.js +6 -0
  126. package/assets/recycle-horizontal-B6ivY9Sz.js +9 -0
  127. package/assets/refresh-CqfvjhXq.js +8 -0
  128. package/assets/remoteEntry.js +1 -0
  129. package/assets/reown-logo-DGoAljI9.js +12 -0
  130. package/assets/reselect-BfUrOuXx.js +1 -0
  131. package/assets/rich-text-react-renderer_decentraland-ui2-BIHI7g3E.js +1 -0
  132. package/assets/search-nNK2K8mD.js +8 -0
  133. package/assets/secp256k1-D6s48BOl.js +1 -0
  134. package/assets/send-BPz2SBvc.js +15 -0
  135. package/assets/swapHorizontal-TvVHlgjl.js +8 -0
  136. package/assets/swapHorizontalBold-BTw_LG1-.js +8 -0
  137. package/assets/swapHorizontalMedium-C3jJnFs_.js +16 -0
  138. package/assets/swapHorizontalRoundedBold-nTFwdVeT.js +8 -0
  139. package/assets/swapVertical-CHKvPR_7.js +8 -0
  140. package/assets/telegram-C552IoSr.js +16 -0
  141. package/assets/three-dots-Nyfa4nYF.js +5 -0
  142. package/assets/top_background-Bnd2vX_F.webp +0 -0
  143. package/assets/tslib.es6-DbvBTznf.js +1 -0
  144. package/assets/twitch-7SJKGXSa.js +18 -0
  145. package/assets/twitterIcon-BBg9ypIU.js +6 -0
  146. package/assets/uid-CX4a_w4r.js +44 -0
  147. package/assets/verify-BwQ9FKM1.js +8 -0
  148. package/assets/verify-filled-BAdDAZxZ.js +8 -0
  149. package/assets/w3m-modal-BqXXR9rX.js +642 -0
  150. package/assets/wallet-DJsa1d3M.js +8 -0
  151. package/assets/wallet-placeholder-DPIkQ5vM.js +14 -0
  152. package/assets/walletconnect-osdnzzVU.js +30 -0
  153. package/assets/warning-circle-BQ9uHGTL.js +12 -0
  154. package/assets/webSocket-CIn5Ftst.js +3 -0
  155. package/assets/x-5oycQ-0v.js +12 -0
  156. package/dcl-logo.svg +1 -0
  157. package/index.html +41 -0
  158. package/package.json +21 -0
@@ -0,0 +1,12 @@
1
+ import{c as ee,g as Qr,a as gu}from"./_commonjsHelpers-C4iS2aBk.js";import{r as wr}from"./___vite-browser-external_commonjs-proxy-BqV5D26a.js";import{E as Fo}from"./index-CdrMQoR6.js";import{i as Rt}from"./inherits_browser-BlmhoU4v.js";import{w as mu,t as wu,c as yu,i as bu}from"./index-JFBsW0Hp.js";import{p as vu,a as _u}from"./hooks.module-Dz_XB4AG.js";import{t as Eu}from"./tslib.es6-DbvBTznf.js";const Su=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:Fo,default:Fo},Symbol.toStringTag,{value:"Module"}));var Ws={exports:{}},hs,Do;function Ru(){if(Do)return hs;Do=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;hs=function(p,v){v=v||{};var E=typeof p;if(E==="string"&&p.length>0)return c(p);if(E==="number"&&isFinite(p))return v.long?f(p):a(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function c(p){if(p=String(p),!(p.length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(v){var E=parseFloat(v[1]),A=(v[2]||"ms").toLowerCase();switch(A){case"years":case"year":case"yrs":case"yr":case"y":return E*s;case"weeks":case"week":case"w":return E*i;case"days":case"day":case"d":return E*n;case"hours":case"hour":case"hrs":case"hr":case"h":return E*r;case"minutes":case"minute":case"mins":case"min":case"m":return E*t;case"seconds":case"second":case"secs":case"sec":case"s":return E*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return E;default:return}}}}function a(p){var v=Math.abs(p);return v>=n?Math.round(p/n)+"d":v>=r?Math.round(p/r)+"h":v>=t?Math.round(p/t)+"m":v>=e?Math.round(p/e)+"s":p+"ms"}function f(p){var v=Math.abs(p);return v>=n?g(p,v,n,"day"):v>=r?g(p,v,r,"hour"):v>=t?g(p,v,t,"minute"):v>=e?g(p,v,e,"second"):p+" ms"}function g(p,v,E,A){var U=v>=E*1.5;return Math.round(p/E)+" "+A+(U?"s":"")}return hs}function Mu(e){r.debug=r,r.default=r,r.coerce=f,r.disable=s,r.enable=i,r.enabled=c,r.humanize=Ru(),r.destroy=g,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let v=0;for(let E=0;E<p.length;E++)v=(v<<5)-v+p.charCodeAt(E),v|=0;return r.colors[Math.abs(v)%r.colors.length]}r.selectColor=t;function r(p){let v,E=null,A,U;function F(...H){if(!F.enabled)return;const x=F,L=Number(new Date),O=L-(v||L);x.diff=O,x.prev=v,x.curr=L,v=L,H[0]=r.coerce(H[0]),typeof H[0]!="string"&&H.unshift("%O");let V=0;H[0]=H[0].replace(/%([a-zA-Z%])/g,(z,te)=>{if(z==="%%")return"%";V++;const Y=r.formatters[te];if(typeof Y=="function"){const Q=H[V];z=Y.call(x,Q),H.splice(V,1),V--}return z}),r.formatArgs.call(x,H),(x.log||r.log).apply(x,H)}return F.namespace=p,F.useColors=r.useColors(),F.color=r.selectColor(p),F.extend=n,F.destroy=r.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>E!==null?E:(A!==r.namespaces&&(A=r.namespaces,U=r.enabled(p)),U),set:H=>{E=H}}),typeof r.init=="function"&&r.init(F),F}function n(p,v){const E=r(this.namespace+(typeof v>"u"?":":v)+p);return E.log=this.log,E}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let v;const E=(typeof p=="string"?p:"").split(/[\s,]+/),A=E.length;for(v=0;v<A;v++)E[v]&&(p=E[v].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}function s(){const p=[...r.names.map(a),...r.skips.map(a).map(v=>"-"+v)].join(",");return r.enable(""),p}function c(p){if(p[p.length-1]==="*")return!0;let v,E;for(v=0,E=r.skips.length;v<E;v++)if(r.skips[v].test(p))return!1;for(v=0,E=r.names.length;v<E;v++)if(r.names[v].test(p))return!0;return!1}function a(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function f(p){return p instanceof Error?p.stack||p.message:p}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Cu=Mu;(function(e,t){var r={};t.formatArgs=i,t.save=s,t.load=c,t.useColors=n,t.storage=a(),t.destroy=(()=>{let g=!1;return()=>{g||(g=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(g){if(g[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+g[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;g.splice(1,0,p,"color: inherit");let v=0,E=0;g[0].replace(/%[a-zA-Z%]/g,A=>{A!=="%%"&&(v++,A==="%c"&&(E=v))}),g.splice(E,0,p)}t.log=console.debug||console.log||(()=>{});function s(g){try{g?t.storage.setItem("debug",g):t.storage.removeItem("debug")}catch{}}function c(){let g;try{g=t.storage.getItem("debug")}catch{}return!g&&typeof process<"u"&&"env"in process&&(g=r.DEBUG),g}function a(){try{return localStorage}catch{}}e.exports=Cu(t);const{formatters:f}=e.exports;f.j=function(g){try{return JSON.stringify(g)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(Ws,Ws.exports);var ku=Ws.exports,Iu=fn;fn.default=fn;fn.stable=yc;fn.stableStringify=yc;var oi="[...]",mc="[Circular]",yr=[],pr=[];function wc(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function fn(e,t,r,n){typeof n>"u"&&(n=wc()),Vs(e,"",0,[],void 0,0,n);var i;try{pr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,bc(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;yr.length!==0;){var s=yr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function jr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),yr.push([n,r,t,i])):pr.push([t,r,e]):(n[r]=e,yr.push([n,r,t]))}function Vs(e,t,r,n,i,s,c){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){jr(mc,e,t,i);return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){jr(oi,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){jr(oi,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Vs(e[a],a,a,n,e,s,c);else{var f=Object.keys(e);for(a=0;a<f.length;a++){var g=f[a];Vs(e[g],g,a,n,e,s,c)}}n.pop()}}function xu(e,t){return e<t?-1:e>t?1:0}function yc(e,t,r,n){typeof n>"u"&&(n=wc());var i=qs(e,"",0,[],void 0,0,n)||e,s;try{pr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,bc(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;yr.length!==0;){var c=yr.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function qs(e,t,r,n,i,s,c){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){jr(mc,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){jr(oi,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){jr(oi,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)qs(e[a],a,a,n,e,s,c);else{var f={},g=Object.keys(e).sort(xu);for(a=0;a<g.length;a++){var p=g[a];qs(e[p],p,a,n,e,s,c),f[p]=e[p]}if(typeof i<"u")yr.push([i,t,e]),i[t]=f;else return f}n.pop()}}function bc(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(pr.length>0)for(var n=0;n<pr.length;n++){var i=pr[n];if(i[1]===t&&i[0]===r){r=i[2],pr.splice(n,1);break}}return e.call(this,t,r)}}var vc={},pn={},li={};Object.defineProperty(li,"__esModule",{value:!0});li.walletLogo=void 0;const Au=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.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 r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.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 r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};li.walletLogo=Au;var ui={};Object.defineProperty(ui,"__esModule",{value:!0});ui.LINK_API_URL=void 0;ui.LINK_API_URL="https://www.walletlink.org";var X={},Ys={exports:{}};Ys.exports;(function(e){(function(t,r){function n(I,o){if(!I)throw new Error(o||"Assertion failed")}function i(I,o){I.super_=o;var d=function(){};d.prototype=o.prototype,I.prototype=new d,I.prototype.constructor=I}function s(I,o,d){if(s.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((o==="le"||o==="be")&&(d=o,o=10),this._init(I||0,o||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=wr.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,d){return o.cmp(d)>0?o:d},s.min=function(o,d){return o.cmp(d)<0?o:d},s.prototype._init=function(o,d,w){if(typeof o=="number")return this._initNumber(o,d,w);if(typeof o=="object")return this._initArray(o,d,w);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),o=o.toString().replace(/\s+/g,"");var y=0;o[0]==="-"&&(y++,this.negative=1),y<o.length&&(d===16?this._parseHex(o,y,w):(this._parseBase(o,d,y),w==="le"&&this._initArray(this.toArray(),d,w)))},s.prototype._initNumber=function(o,d,w){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(n(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),w==="le"&&this._initArray(this.toArray(),d,w)},s.prototype._initArray=function(o,d,w){if(n(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var S,k,B=0;if(w==="be")for(y=o.length-1,S=0;y>=0;y-=3)k=o[y]|o[y-1]<<8|o[y-2]<<16,this.words[S]|=k<<B&67108863,this.words[S+1]=k>>>26-B&67108863,B+=24,B>=26&&(B-=26,S++);else if(w==="le")for(y=0,S=0;y<o.length;y+=3)k=o[y]|o[y+1]<<8|o[y+2]<<16,this.words[S]|=k<<B&67108863,this.words[S+1]=k>>>26-B&67108863,B+=24,B>=26&&(B-=26,S++);return this._strip()};function a(I,o){var d=I.charCodeAt(o);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+I)}function f(I,o,d){var w=a(I,d);return d-1>=o&&(w|=a(I,d-1)<<4),w}s.prototype._parseHex=function(o,d,w){this.length=Math.ceil((o.length-d)/6),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var S=0,k=0,B;if(w==="be")for(y=o.length-1;y>=d;y-=2)B=f(o,d,y)<<S,this.words[k]|=B&67108863,S>=18?(S-=18,k+=1,this.words[k]|=B>>>26):S+=8;else{var b=o.length-d;for(y=b%2===0?d+1:d;y<o.length;y+=2)B=f(o,d,y)<<S,this.words[k]|=B&67108863,S>=18?(S-=18,k+=1,this.words[k]|=B>>>26):S+=8}this._strip()};function g(I,o,d,w){for(var y=0,S=0,k=Math.min(I.length,d),B=o;B<k;B++){var b=I.charCodeAt(B)-48;y*=w,b>=49?S=b-49+10:b>=17?S=b-17+10:S=b,n(b>=0&&S<w,"Invalid character"),y+=S}return y}s.prototype._parseBase=function(o,d,w){this.words=[0],this.length=1;for(var y=0,S=1;S<=67108863;S*=d)y++;y--,S=S/d|0;for(var k=o.length-w,B=k%y,b=Math.min(k,k-B)+w,u=0,R=w;R<b;R+=y)u=g(o,R,R+y,d),this.imuln(S),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(B!==0){var K=1;for(u=g(o,R,o.length,d),R=0;R<B;R++)K*=d;this.imuln(K),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},s.prototype.copy=function(o){o.words=new Array(this.length);for(var d=0;d<this.length;d++)o.words[d]=this.words[d];o.length=this.length,o.negative=this.negative,o.red=this.red};function p(I,o){I.words=o.words,I.length=o.length,I.negative=o.negative,I.red=o.red}if(s.prototype._move=function(o){p(o,this)},s.prototype.clone=function(){var o=new s(null);return this.copy(o),o},s.prototype._expand=function(o){for(;this.length<o;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=v}catch{s.prototype.inspect=v}else s.prototype.inspect=v;function v(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],U=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(o,d){o=o||10,d=d|0||1;var w;if(o===16||o==="hex"){w="";for(var y=0,S=0,k=0;k<this.length;k++){var B=this.words[k],b=((B<<y|S)&16777215).toString(16);S=B>>>24-y&16777215,y+=2,y>=26&&(y-=26,k--),S!==0||k!==this.length-1?w=E[6-b.length]+b+w:w=b+w}for(S!==0&&(w=S.toString(16)+w);w.length%d!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(o===(o|0)&&o>=2&&o<=36){var u=A[o],R=U[o];w="";var K=this.clone();for(K.negative=0;!K.isZero();){var J=K.modrn(R).toString(o);K=K.idivn(R),K.isZero()?w=J+w:w=E[u-J.length]+J+w}for(this.isZero()&&(w="0"+w);w.length%d!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},c&&(s.prototype.toBuffer=function(o,d){return this.toArrayLike(c,o,d)}),s.prototype.toArray=function(o,d){return this.toArrayLike(Array,o,d)};var F=function(o,d){return o.allocUnsafe?o.allocUnsafe(d):new o(d)};s.prototype.toArrayLike=function(o,d,w){this._strip();var y=this.byteLength(),S=w||Math.max(1,y);n(y<=S,"byte array longer than desired length"),n(S>0,"Requested array length <= 0");var k=F(o,S),B=d==="le"?"LE":"BE";return this["_toArrayLike"+B](k,y),k},s.prototype._toArrayLikeLE=function(o,d){for(var w=0,y=0,S=0,k=0;S<this.length;S++){var B=this.words[S]<<k|y;o[w++]=B&255,w<o.length&&(o[w++]=B>>8&255),w<o.length&&(o[w++]=B>>16&255),k===6?(w<o.length&&(o[w++]=B>>24&255),y=0,k=0):(y=B>>>24,k+=2)}if(w<o.length)for(o[w++]=y;w<o.length;)o[w++]=0},s.prototype._toArrayLikeBE=function(o,d){for(var w=o.length-1,y=0,S=0,k=0;S<this.length;S++){var B=this.words[S]<<k|y;o[w--]=B&255,w>=0&&(o[w--]=B>>8&255),w>=0&&(o[w--]=B>>16&255),k===6?(w>=0&&(o[w--]=B>>24&255),y=0,k=0):(y=B>>>24,k+=2)}if(w>=0)for(o[w--]=y;w>=0;)o[w--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var d=o,w=0;return d>=4096&&(w+=13,d>>>=13),d>=64&&(w+=7,d>>>=7),d>=8&&(w+=4,d>>>=4),d>=2&&(w+=2,d>>>=2),w+d},s.prototype._zeroBits=function(o){if(o===0)return 26;var d=o,w=0;return d&8191||(w+=13,d>>>=13),d&127||(w+=7,d>>>=7),d&15||(w+=4,d>>>=4),d&3||(w+=2,d>>>=2),d&1||w++,w},s.prototype.bitLength=function(){var o=this.words[this.length-1],d=this._countBits(o);return(this.length-1)*26+d};function H(I){for(var o=new Array(I.bitLength()),d=0;d<o.length;d++){var w=d/26|0,y=d%26;o[d]=I.words[w]>>>y&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,d=0;d<this.length;d++){var w=this._zeroBits(this.words[d]);if(o+=w,w!==26)break}return o},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},s.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var d=0;d<o.length;d++)this.words[d]=this.words[d]|o.words[d];return this._strip()},s.prototype.ior=function(o){return n((this.negative|o.negative)===0),this.iuor(o)},s.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var d;this.length>o.length?d=o:d=this;for(var w=0;w<d.length;w++)this.words[w]=this.words[w]&o.words[w];return this.length=d.length,this._strip()},s.prototype.iand=function(o){return n((this.negative|o.negative)===0),this.iuand(o)},s.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var d,w;this.length>o.length?(d=this,w=o):(d=o,w=this);for(var y=0;y<w.length;y++)this.words[y]=d.words[y]^w.words[y];if(this!==d)for(;y<d.length;y++)this.words[y]=d.words[y];return this.length=d.length,this._strip()},s.prototype.ixor=function(o){return n((this.negative|o.negative)===0),this.iuxor(o)},s.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var d=Math.ceil(o/26)|0,w=o%26;this._expand(d),w>0&&d--;for(var y=0;y<d;y++)this.words[y]=~this.words[y]&67108863;return w>0&&(this.words[y]=~this.words[y]&67108863>>26-w),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,d){n(typeof o=="number"&&o>=0);var w=o/26|0,y=o%26;return this._expand(w+1),d?this.words[w]=this.words[w]|1<<y:this.words[w]=this.words[w]&~(1<<y),this._strip()},s.prototype.iadd=function(o){var d;if(this.negative!==0&&o.negative===0)return this.negative=0,d=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,d=this.isub(o),o.negative=1,d._normSign();var w,y;this.length>o.length?(w=this,y=o):(w=o,y=this);for(var S=0,k=0;k<y.length;k++)d=(w.words[k]|0)+(y.words[k]|0)+S,this.words[k]=d&67108863,S=d>>>26;for(;S!==0&&k<w.length;k++)d=(w.words[k]|0)+S,this.words[k]=d&67108863,S=d>>>26;if(this.length=w.length,S!==0)this.words[this.length]=S,this.length++;else if(w!==this)for(;k<w.length;k++)this.words[k]=w.words[k];return this},s.prototype.add=function(o){var d;return o.negative!==0&&this.negative===0?(o.negative=0,d=this.sub(o),o.negative^=1,d):o.negative===0&&this.negative!==0?(this.negative=0,d=o.sub(this),this.negative=1,d):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var d=this.iadd(o);return o.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var w=this.cmp(o);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;var y,S;w>0?(y=this,S=o):(y=o,S=this);for(var k=0,B=0;B<S.length;B++)d=(y.words[B]|0)-(S.words[B]|0)+k,k=d>>26,this.words[B]=d&67108863;for(;k!==0&&B<y.length;B++)d=(y.words[B]|0)+k,k=d>>26,this.words[B]=d&67108863;if(k===0&&B<y.length&&y!==this)for(;B<y.length;B++)this.words[B]=y.words[B];return this.length=Math.max(this.length,B),y!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(o){return this.clone().isub(o)};function x(I,o,d){d.negative=o.negative^I.negative;var w=I.length+o.length|0;d.length=w,w=w-1|0;var y=I.words[0]|0,S=o.words[0]|0,k=y*S,B=k&67108863,b=k/67108864|0;d.words[0]=B;for(var u=1;u<w;u++){for(var R=b>>>26,K=b&67108863,J=Math.min(u,o.length-1),T=Math.max(0,u-I.length+1);T<=J;T++){var P=u-T|0;y=I.words[P]|0,S=o.words[T]|0,k=y*S+K,R+=k/67108864|0,K=k&67108863}d.words[u]=K|0,b=R|0}return b!==0?d.words[u]=b|0:d.length--,d._strip()}var L=function(o,d,w){var y=o.words,S=d.words,k=w.words,B=0,b,u,R,K=y[0]|0,J=K&8191,T=K>>>13,P=y[1]|0,W=P&8191,Z=P>>>13,le=y[2]|0,M=le&8191,C=le>>>13,q=y[3]|0,G=q&8191,se=q>>>13,ue=y[4]|0,re=ue&8191,be=ue>>>13,dt=y[5]|0,Se=dt&8191,Ee=dt>>>13,Je=y[6]|0,ve=Je&8191,Re=Je>>>13,Qe=y[7]|0,_e=Qe&8191,m=Qe>>>13,l=y[8]|0,h=l&8191,_=l>>>13,N=y[9]|0,$=N&8191,j=N>>>13,he=S[0]|0,ae=he&8191,ie=he>>>13,Me=S[1]|0,ne=Me&8191,Ce=Me>>>13,Rr=S[2]|0,ke=Rr&8191,Ie=Rr>>>13,Mr=S[3]|0,xe=Mr&8191,Ae=Mr>>>13,Cr=S[4]|0,Te=Cr&8191,Be=Cr>>>13,kr=S[5]|0,Ne=kr&8191,Le=kr>>>13,Ir=S[6]|0,Pe=Ir&8191,Oe=Ir>>>13,xr=S[7]|0,$e=xr&8191,Fe=xr>>>13,Ar=S[8]|0,De=Ar&8191,je=Ar>>>13,Tr=S[9]|0,Ue=Tr&8191,He=Tr>>>13;w.negative=o.negative^d.negative,w.length=19,b=Math.imul(J,ae),u=Math.imul(J,ie),u=u+Math.imul(T,ae)|0,R=Math.imul(T,ie);var Jt=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,b=Math.imul(W,ae),u=Math.imul(W,ie),u=u+Math.imul(Z,ae)|0,R=Math.imul(Z,ie),b=b+Math.imul(J,ne)|0,u=u+Math.imul(J,Ce)|0,u=u+Math.imul(T,ne)|0,R=R+Math.imul(T,Ce)|0;var Zt=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,b=Math.imul(M,ae),u=Math.imul(M,ie),u=u+Math.imul(C,ae)|0,R=Math.imul(C,ie),b=b+Math.imul(W,ne)|0,u=u+Math.imul(W,Ce)|0,u=u+Math.imul(Z,ne)|0,R=R+Math.imul(Z,Ce)|0,b=b+Math.imul(J,ke)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(T,ke)|0,R=R+Math.imul(T,Ie)|0;var Kt=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,b=Math.imul(G,ae),u=Math.imul(G,ie),u=u+Math.imul(se,ae)|0,R=Math.imul(se,ie),b=b+Math.imul(M,ne)|0,u=u+Math.imul(M,Ce)|0,u=u+Math.imul(C,ne)|0,R=R+Math.imul(C,Ce)|0,b=b+Math.imul(W,ke)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(Z,ke)|0,R=R+Math.imul(Z,Ie)|0,b=b+Math.imul(J,xe)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(T,xe)|0,R=R+Math.imul(T,Ae)|0;var Qt=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,b=Math.imul(re,ae),u=Math.imul(re,ie),u=u+Math.imul(be,ae)|0,R=Math.imul(be,ie),b=b+Math.imul(G,ne)|0,u=u+Math.imul(G,Ce)|0,u=u+Math.imul(se,ne)|0,R=R+Math.imul(se,Ce)|0,b=b+Math.imul(M,ke)|0,u=u+Math.imul(M,Ie)|0,u=u+Math.imul(C,ke)|0,R=R+Math.imul(C,Ie)|0,b=b+Math.imul(W,xe)|0,u=u+Math.imul(W,Ae)|0,u=u+Math.imul(Z,xe)|0,R=R+Math.imul(Z,Ae)|0,b=b+Math.imul(J,Te)|0,u=u+Math.imul(J,Be)|0,u=u+Math.imul(T,Te)|0,R=R+Math.imul(T,Be)|0;var Yt=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,b=Math.imul(Se,ae),u=Math.imul(Se,ie),u=u+Math.imul(Ee,ae)|0,R=Math.imul(Ee,ie),b=b+Math.imul(re,ne)|0,u=u+Math.imul(re,Ce)|0,u=u+Math.imul(be,ne)|0,R=R+Math.imul(be,Ce)|0,b=b+Math.imul(G,ke)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(se,ke)|0,R=R+Math.imul(se,Ie)|0,b=b+Math.imul(M,xe)|0,u=u+Math.imul(M,Ae)|0,u=u+Math.imul(C,xe)|0,R=R+Math.imul(C,Ae)|0,b=b+Math.imul(W,Te)|0,u=u+Math.imul(W,Be)|0,u=u+Math.imul(Z,Te)|0,R=R+Math.imul(Z,Be)|0,b=b+Math.imul(J,Ne)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(T,Ne)|0,R=R+Math.imul(T,Le)|0;var Xt=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,b=Math.imul(ve,ae),u=Math.imul(ve,ie),u=u+Math.imul(Re,ae)|0,R=Math.imul(Re,ie),b=b+Math.imul(Se,ne)|0,u=u+Math.imul(Se,Ce)|0,u=u+Math.imul(Ee,ne)|0,R=R+Math.imul(Ee,Ce)|0,b=b+Math.imul(re,ke)|0,u=u+Math.imul(re,Ie)|0,u=u+Math.imul(be,ke)|0,R=R+Math.imul(be,Ie)|0,b=b+Math.imul(G,xe)|0,u=u+Math.imul(G,Ae)|0,u=u+Math.imul(se,xe)|0,R=R+Math.imul(se,Ae)|0,b=b+Math.imul(M,Te)|0,u=u+Math.imul(M,Be)|0,u=u+Math.imul(C,Te)|0,R=R+Math.imul(C,Be)|0,b=b+Math.imul(W,Ne)|0,u=u+Math.imul(W,Le)|0,u=u+Math.imul(Z,Ne)|0,R=R+Math.imul(Z,Le)|0,b=b+Math.imul(J,Pe)|0,u=u+Math.imul(J,Oe)|0,u=u+Math.imul(T,Pe)|0,R=R+Math.imul(T,Oe)|0;var er=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(er>>>26)|0,er&=67108863,b=Math.imul(_e,ae),u=Math.imul(_e,ie),u=u+Math.imul(m,ae)|0,R=Math.imul(m,ie),b=b+Math.imul(ve,ne)|0,u=u+Math.imul(ve,Ce)|0,u=u+Math.imul(Re,ne)|0,R=R+Math.imul(Re,Ce)|0,b=b+Math.imul(Se,ke)|0,u=u+Math.imul(Se,Ie)|0,u=u+Math.imul(Ee,ke)|0,R=R+Math.imul(Ee,Ie)|0,b=b+Math.imul(re,xe)|0,u=u+Math.imul(re,Ae)|0,u=u+Math.imul(be,xe)|0,R=R+Math.imul(be,Ae)|0,b=b+Math.imul(G,Te)|0,u=u+Math.imul(G,Be)|0,u=u+Math.imul(se,Te)|0,R=R+Math.imul(se,Be)|0,b=b+Math.imul(M,Ne)|0,u=u+Math.imul(M,Le)|0,u=u+Math.imul(C,Ne)|0,R=R+Math.imul(C,Le)|0,b=b+Math.imul(W,Pe)|0,u=u+Math.imul(W,Oe)|0,u=u+Math.imul(Z,Pe)|0,R=R+Math.imul(Z,Oe)|0,b=b+Math.imul(J,$e)|0,u=u+Math.imul(J,Fe)|0,u=u+Math.imul(T,$e)|0,R=R+Math.imul(T,Fe)|0;var tr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,b=Math.imul(h,ae),u=Math.imul(h,ie),u=u+Math.imul(_,ae)|0,R=Math.imul(_,ie),b=b+Math.imul(_e,ne)|0,u=u+Math.imul(_e,Ce)|0,u=u+Math.imul(m,ne)|0,R=R+Math.imul(m,Ce)|0,b=b+Math.imul(ve,ke)|0,u=u+Math.imul(ve,Ie)|0,u=u+Math.imul(Re,ke)|0,R=R+Math.imul(Re,Ie)|0,b=b+Math.imul(Se,xe)|0,u=u+Math.imul(Se,Ae)|0,u=u+Math.imul(Ee,xe)|0,R=R+Math.imul(Ee,Ae)|0,b=b+Math.imul(re,Te)|0,u=u+Math.imul(re,Be)|0,u=u+Math.imul(be,Te)|0,R=R+Math.imul(be,Be)|0,b=b+Math.imul(G,Ne)|0,u=u+Math.imul(G,Le)|0,u=u+Math.imul(se,Ne)|0,R=R+Math.imul(se,Le)|0,b=b+Math.imul(M,Pe)|0,u=u+Math.imul(M,Oe)|0,u=u+Math.imul(C,Pe)|0,R=R+Math.imul(C,Oe)|0,b=b+Math.imul(W,$e)|0,u=u+Math.imul(W,Fe)|0,u=u+Math.imul(Z,$e)|0,R=R+Math.imul(Z,Fe)|0,b=b+Math.imul(J,De)|0,u=u+Math.imul(J,je)|0,u=u+Math.imul(T,De)|0,R=R+Math.imul(T,je)|0;var rr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(rr>>>26)|0,rr&=67108863,b=Math.imul($,ae),u=Math.imul($,ie),u=u+Math.imul(j,ae)|0,R=Math.imul(j,ie),b=b+Math.imul(h,ne)|0,u=u+Math.imul(h,Ce)|0,u=u+Math.imul(_,ne)|0,R=R+Math.imul(_,Ce)|0,b=b+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Ie)|0,u=u+Math.imul(m,ke)|0,R=R+Math.imul(m,Ie)|0,b=b+Math.imul(ve,xe)|0,u=u+Math.imul(ve,Ae)|0,u=u+Math.imul(Re,xe)|0,R=R+Math.imul(Re,Ae)|0,b=b+Math.imul(Se,Te)|0,u=u+Math.imul(Se,Be)|0,u=u+Math.imul(Ee,Te)|0,R=R+Math.imul(Ee,Be)|0,b=b+Math.imul(re,Ne)|0,u=u+Math.imul(re,Le)|0,u=u+Math.imul(be,Ne)|0,R=R+Math.imul(be,Le)|0,b=b+Math.imul(G,Pe)|0,u=u+Math.imul(G,Oe)|0,u=u+Math.imul(se,Pe)|0,R=R+Math.imul(se,Oe)|0,b=b+Math.imul(M,$e)|0,u=u+Math.imul(M,Fe)|0,u=u+Math.imul(C,$e)|0,R=R+Math.imul(C,Fe)|0,b=b+Math.imul(W,De)|0,u=u+Math.imul(W,je)|0,u=u+Math.imul(Z,De)|0,R=R+Math.imul(Z,je)|0,b=b+Math.imul(J,Ue)|0,u=u+Math.imul(J,He)|0,u=u+Math.imul(T,Ue)|0,R=R+Math.imul(T,He)|0;var nr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(nr>>>26)|0,nr&=67108863,b=Math.imul($,ne),u=Math.imul($,Ce),u=u+Math.imul(j,ne)|0,R=Math.imul(j,Ce),b=b+Math.imul(h,ke)|0,u=u+Math.imul(h,Ie)|0,u=u+Math.imul(_,ke)|0,R=R+Math.imul(_,Ie)|0,b=b+Math.imul(_e,xe)|0,u=u+Math.imul(_e,Ae)|0,u=u+Math.imul(m,xe)|0,R=R+Math.imul(m,Ae)|0,b=b+Math.imul(ve,Te)|0,u=u+Math.imul(ve,Be)|0,u=u+Math.imul(Re,Te)|0,R=R+Math.imul(Re,Be)|0,b=b+Math.imul(Se,Ne)|0,u=u+Math.imul(Se,Le)|0,u=u+Math.imul(Ee,Ne)|0,R=R+Math.imul(Ee,Le)|0,b=b+Math.imul(re,Pe)|0,u=u+Math.imul(re,Oe)|0,u=u+Math.imul(be,Pe)|0,R=R+Math.imul(be,Oe)|0,b=b+Math.imul(G,$e)|0,u=u+Math.imul(G,Fe)|0,u=u+Math.imul(se,$e)|0,R=R+Math.imul(se,Fe)|0,b=b+Math.imul(M,De)|0,u=u+Math.imul(M,je)|0,u=u+Math.imul(C,De)|0,R=R+Math.imul(C,je)|0,b=b+Math.imul(W,Ue)|0,u=u+Math.imul(W,He)|0,u=u+Math.imul(Z,Ue)|0,R=R+Math.imul(Z,He)|0;var ir=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ir>>>26)|0,ir&=67108863,b=Math.imul($,ke),u=Math.imul($,Ie),u=u+Math.imul(j,ke)|0,R=Math.imul(j,Ie),b=b+Math.imul(h,xe)|0,u=u+Math.imul(h,Ae)|0,u=u+Math.imul(_,xe)|0,R=R+Math.imul(_,Ae)|0,b=b+Math.imul(_e,Te)|0,u=u+Math.imul(_e,Be)|0,u=u+Math.imul(m,Te)|0,R=R+Math.imul(m,Be)|0,b=b+Math.imul(ve,Ne)|0,u=u+Math.imul(ve,Le)|0,u=u+Math.imul(Re,Ne)|0,R=R+Math.imul(Re,Le)|0,b=b+Math.imul(Se,Pe)|0,u=u+Math.imul(Se,Oe)|0,u=u+Math.imul(Ee,Pe)|0,R=R+Math.imul(Ee,Oe)|0,b=b+Math.imul(re,$e)|0,u=u+Math.imul(re,Fe)|0,u=u+Math.imul(be,$e)|0,R=R+Math.imul(be,Fe)|0,b=b+Math.imul(G,De)|0,u=u+Math.imul(G,je)|0,u=u+Math.imul(se,De)|0,R=R+Math.imul(se,je)|0,b=b+Math.imul(M,Ue)|0,u=u+Math.imul(M,He)|0,u=u+Math.imul(C,Ue)|0,R=R+Math.imul(C,He)|0;var sr=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,b=Math.imul($,xe),u=Math.imul($,Ae),u=u+Math.imul(j,xe)|0,R=Math.imul(j,Ae),b=b+Math.imul(h,Te)|0,u=u+Math.imul(h,Be)|0,u=u+Math.imul(_,Te)|0,R=R+Math.imul(_,Be)|0,b=b+Math.imul(_e,Ne)|0,u=u+Math.imul(_e,Le)|0,u=u+Math.imul(m,Ne)|0,R=R+Math.imul(m,Le)|0,b=b+Math.imul(ve,Pe)|0,u=u+Math.imul(ve,Oe)|0,u=u+Math.imul(Re,Pe)|0,R=R+Math.imul(Re,Oe)|0,b=b+Math.imul(Se,$e)|0,u=u+Math.imul(Se,Fe)|0,u=u+Math.imul(Ee,$e)|0,R=R+Math.imul(Ee,Fe)|0,b=b+Math.imul(re,De)|0,u=u+Math.imul(re,je)|0,u=u+Math.imul(be,De)|0,R=R+Math.imul(be,je)|0,b=b+Math.imul(G,Ue)|0,u=u+Math.imul(G,He)|0,u=u+Math.imul(se,Ue)|0,R=R+Math.imul(se,He)|0;var or=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(or>>>26)|0,or&=67108863,b=Math.imul($,Te),u=Math.imul($,Be),u=u+Math.imul(j,Te)|0,R=Math.imul(j,Be),b=b+Math.imul(h,Ne)|0,u=u+Math.imul(h,Le)|0,u=u+Math.imul(_,Ne)|0,R=R+Math.imul(_,Le)|0,b=b+Math.imul(_e,Pe)|0,u=u+Math.imul(_e,Oe)|0,u=u+Math.imul(m,Pe)|0,R=R+Math.imul(m,Oe)|0,b=b+Math.imul(ve,$e)|0,u=u+Math.imul(ve,Fe)|0,u=u+Math.imul(Re,$e)|0,R=R+Math.imul(Re,Fe)|0,b=b+Math.imul(Se,De)|0,u=u+Math.imul(Se,je)|0,u=u+Math.imul(Ee,De)|0,R=R+Math.imul(Ee,je)|0,b=b+Math.imul(re,Ue)|0,u=u+Math.imul(re,He)|0,u=u+Math.imul(be,Ue)|0,R=R+Math.imul(be,He)|0;var ar=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,b=Math.imul($,Ne),u=Math.imul($,Le),u=u+Math.imul(j,Ne)|0,R=Math.imul(j,Le),b=b+Math.imul(h,Pe)|0,u=u+Math.imul(h,Oe)|0,u=u+Math.imul(_,Pe)|0,R=R+Math.imul(_,Oe)|0,b=b+Math.imul(_e,$e)|0,u=u+Math.imul(_e,Fe)|0,u=u+Math.imul(m,$e)|0,R=R+Math.imul(m,Fe)|0,b=b+Math.imul(ve,De)|0,u=u+Math.imul(ve,je)|0,u=u+Math.imul(Re,De)|0,R=R+Math.imul(Re,je)|0,b=b+Math.imul(Se,Ue)|0,u=u+Math.imul(Se,He)|0,u=u+Math.imul(Ee,Ue)|0,R=R+Math.imul(Ee,He)|0;var os=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(os>>>26)|0,os&=67108863,b=Math.imul($,Pe),u=Math.imul($,Oe),u=u+Math.imul(j,Pe)|0,R=Math.imul(j,Oe),b=b+Math.imul(h,$e)|0,u=u+Math.imul(h,Fe)|0,u=u+Math.imul(_,$e)|0,R=R+Math.imul(_,Fe)|0,b=b+Math.imul(_e,De)|0,u=u+Math.imul(_e,je)|0,u=u+Math.imul(m,De)|0,R=R+Math.imul(m,je)|0,b=b+Math.imul(ve,Ue)|0,u=u+Math.imul(ve,He)|0,u=u+Math.imul(Re,Ue)|0,R=R+Math.imul(Re,He)|0;var as=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(as>>>26)|0,as&=67108863,b=Math.imul($,$e),u=Math.imul($,Fe),u=u+Math.imul(j,$e)|0,R=Math.imul(j,Fe),b=b+Math.imul(h,De)|0,u=u+Math.imul(h,je)|0,u=u+Math.imul(_,De)|0,R=R+Math.imul(_,je)|0,b=b+Math.imul(_e,Ue)|0,u=u+Math.imul(_e,He)|0,u=u+Math.imul(m,Ue)|0,R=R+Math.imul(m,He)|0;var cs=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(cs>>>26)|0,cs&=67108863,b=Math.imul($,De),u=Math.imul($,je),u=u+Math.imul(j,De)|0,R=Math.imul(j,je),b=b+Math.imul(h,Ue)|0,u=u+Math.imul(h,He)|0,u=u+Math.imul(_,Ue)|0,R=R+Math.imul(_,He)|0;var ls=(B+b|0)+((u&8191)<<13)|0;B=(R+(u>>>13)|0)+(ls>>>26)|0,ls&=67108863,b=Math.imul($,Ue),u=Math.imul($,He),u=u+Math.imul(j,Ue)|0,R=Math.imul(j,He);var us=(B+b|0)+((u&8191)<<13)|0;return B=(R+(u>>>13)|0)+(us>>>26)|0,us&=67108863,k[0]=Jt,k[1]=Zt,k[2]=Kt,k[3]=Qt,k[4]=Yt,k[5]=Xt,k[6]=er,k[7]=tr,k[8]=rr,k[9]=nr,k[10]=ir,k[11]=sr,k[12]=or,k[13]=ar,k[14]=os,k[15]=as,k[16]=cs,k[17]=ls,k[18]=us,B!==0&&(k[19]=B,w.length++),w};Math.imul||(L=x);function O(I,o,d){d.negative=o.negative^I.negative,d.length=I.length+o.length;for(var w=0,y=0,S=0;S<d.length-1;S++){var k=y;y=0;for(var B=w&67108863,b=Math.min(S,o.length-1),u=Math.max(0,S-I.length+1);u<=b;u++){var R=S-u,K=I.words[R]|0,J=o.words[u]|0,T=K*J,P=T&67108863;k=k+(T/67108864|0)|0,P=P+B|0,B=P&67108863,k=k+(P>>>26)|0,y+=k>>>26,k&=67108863}d.words[S]=B,w=k,k=y}return w!==0?d.words[S]=w:d.length--,d._strip()}function V(I,o,d){return O(I,o,d)}s.prototype.mulTo=function(o,d){var w,y=this.length+o.length;return this.length===10&&o.length===10?w=L(this,o,d):y<63?w=x(this,o,d):y<1024?w=O(this,o,d):w=V(this,o,d),w},s.prototype.mul=function(o){var d=new s(null);return d.words=new Array(this.length+o.length),this.mulTo(o,d)},s.prototype.mulf=function(o){var d=new s(null);return d.words=new Array(this.length+o.length),V(this,o,d)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var d=o<0;d&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var w=0,y=0;y<this.length;y++){var S=(this.words[y]|0)*o,k=(S&67108863)+(w&67108863);w>>=26,w+=S/67108864|0,w+=k>>>26,this.words[y]=k&67108863}return w!==0&&(this.words[y]=w,this.length++),this.length=o===0?1:this.length,d?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var d=H(o);if(d.length===0)return new s(1);for(var w=this,y=0;y<d.length&&d[y]===0;y++,w=w.sqr());if(++y<d.length)for(var S=w.sqr();y<d.length;y++,S=S.sqr())d[y]!==0&&(w=w.mul(S));return w},s.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var d=o%26,w=(o-d)/26,y=67108863>>>26-d<<26-d,S;if(d!==0){var k=0;for(S=0;S<this.length;S++){var B=this.words[S]&y,b=(this.words[S]|0)-B<<d;this.words[S]=b|k,k=B>>>26-d}k&&(this.words[S]=k,this.length++)}if(w!==0){for(S=this.length-1;S>=0;S--)this.words[S+w]=this.words[S];for(S=0;S<w;S++)this.words[S]=0;this.length+=w}return this._strip()},s.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},s.prototype.iushrn=function(o,d,w){n(typeof o=="number"&&o>=0);var y;d?y=(d-d%26)/26:y=0;var S=o%26,k=Math.min((o-S)/26,this.length),B=67108863^67108863>>>S<<S,b=w;if(y-=k,y=Math.max(0,y),b){for(var u=0;u<k;u++)b.words[u]=this.words[u];b.length=k}if(k!==0)if(this.length>k)for(this.length-=k,u=0;u<this.length;u++)this.words[u]=this.words[u+k];else this.words[0]=0,this.length=1;var R=0;for(u=this.length-1;u>=0&&(R!==0||u>=y);u--){var K=this.words[u]|0;this.words[u]=R<<26-S|K>>>S,R=K&B}return b&&R!==0&&(b.words[b.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,d,w){return n(this.negative===0),this.iushrn(o,d,w)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var d=o%26,w=(o-d)/26,y=1<<d;if(this.length<=w)return!1;var S=this.words[w];return!!(S&y)},s.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var d=o%26,w=(o-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(d!==0&&w++,this.length=Math.min(w,this.length),d!==0){var y=67108863^67108863>>>d<<d;this.words[this.length-1]&=y}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.maskn=function(o){return this.clone().imaskn(o)},s.prototype.iaddn=function(o){return n(typeof o=="number"),n(o<67108864),o<0?this.isubn(-o):this.negative!==0?this.length===1&&(this.words[0]|0)<=o?(this.words[0]=o-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(o),this.negative=1,this):this._iaddn(o)},s.prototype._iaddn=function(o){this.words[0]+=o;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},s.prototype.addn=function(o){return this.clone().iaddn(o)},s.prototype.subn=function(o){return this.clone().isubn(o)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(o,d,w){var y=o.length+w,S;this._expand(y);var k,B=0;for(S=0;S<o.length;S++){k=(this.words[S+w]|0)+B;var b=(o.words[S]|0)*d;k-=b&67108863,B=(k>>26)-(b/67108864|0),this.words[S+w]=k&67108863}for(;S<this.length-w;S++)k=(this.words[S+w]|0)+B,B=k>>26,this.words[S+w]=k&67108863;if(B===0)return this._strip();for(n(B===-1),B=0,S=0;S<this.length;S++)k=-(this.words[S]|0)+B,B=k>>26,this.words[S]=k&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,d){var w=this.length-o.length,y=this.clone(),S=o,k=S.words[S.length-1]|0,B=this._countBits(k);w=26-B,w!==0&&(S=S.ushln(w),y.iushln(w),k=S.words[S.length-1]|0);var b=y.length-S.length,u;if(d!=="mod"){u=new s(null),u.length=b+1,u.words=new Array(u.length);for(var R=0;R<u.length;R++)u.words[R]=0}var K=y.clone()._ishlnsubmul(S,1,b);K.negative===0&&(y=K,u&&(u.words[b]=1));for(var J=b-1;J>=0;J--){var T=(y.words[S.length+J]|0)*67108864+(y.words[S.length+J-1]|0);for(T=Math.min(T/k|0,67108863),y._ishlnsubmul(S,T,J);y.negative!==0;)T--,y.negative=0,y._ishlnsubmul(S,1,J),y.isZero()||(y.negative^=1);u&&(u.words[J]=T)}return u&&u._strip(),y._strip(),d!=="div"&&w!==0&&y.iushrn(w),{div:u||null,mod:y}},s.prototype.divmod=function(o,d,w){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var y,S,k;return this.negative!==0&&o.negative===0?(k=this.neg().divmod(o,d),d!=="mod"&&(y=k.div.neg()),d!=="div"&&(S=k.mod.neg(),w&&S.negative!==0&&S.iadd(o)),{div:y,mod:S}):this.negative===0&&o.negative!==0?(k=this.divmod(o.neg(),d),d!=="mod"&&(y=k.div.neg()),{div:y,mod:k.mod}):this.negative&o.negative?(k=this.neg().divmod(o.neg(),d),d!=="div"&&(S=k.mod.neg(),w&&S.negative!==0&&S.isub(o)),{div:k.div,mod:S}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?d==="div"?{div:this.divn(o.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,d)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var d=this.divmod(o);if(d.mod.isZero())return d.div;var w=d.div.negative!==0?d.mod.isub(o):d.mod,y=o.ushrn(1),S=o.andln(1),k=w.cmp(y);return k<0||S===1&&k===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(o){var d=o<0;d&&(o=-o),n(o<=67108863);for(var w=(1<<26)%o,y=0,S=this.length-1;S>=0;S--)y=(w*y+(this.words[S]|0))%o;return d?-y:y},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var d=o<0;d&&(o=-o),n(o<=67108863);for(var w=0,y=this.length-1;y>=0;y--){var S=(this.words[y]|0)+w*67108864;this.words[y]=S/o|0,w=S%o}return this._strip(),d?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var d=this,w=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var y=new s(1),S=new s(0),k=new s(0),B=new s(1),b=0;d.isEven()&&w.isEven();)d.iushrn(1),w.iushrn(1),++b;for(var u=w.clone(),R=d.clone();!d.isZero();){for(var K=0,J=1;!(d.words[0]&J)&&K<26;++K,J<<=1);if(K>0)for(d.iushrn(K);K-- >0;)(y.isOdd()||S.isOdd())&&(y.iadd(u),S.isub(R)),y.iushrn(1),S.iushrn(1);for(var T=0,P=1;!(w.words[0]&P)&&T<26;++T,P<<=1);if(T>0)for(w.iushrn(T);T-- >0;)(k.isOdd()||B.isOdd())&&(k.iadd(u),B.isub(R)),k.iushrn(1),B.iushrn(1);d.cmp(w)>=0?(d.isub(w),y.isub(k),S.isub(B)):(w.isub(d),k.isub(y),B.isub(S))}return{a:k,b:B,gcd:w.iushln(b)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var d=this,w=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var y=new s(1),S=new s(0),k=w.clone();d.cmpn(1)>0&&w.cmpn(1)>0;){for(var B=0,b=1;!(d.words[0]&b)&&B<26;++B,b<<=1);if(B>0)for(d.iushrn(B);B-- >0;)y.isOdd()&&y.iadd(k),y.iushrn(1);for(var u=0,R=1;!(w.words[0]&R)&&u<26;++u,R<<=1);if(u>0)for(w.iushrn(u);u-- >0;)S.isOdd()&&S.iadd(k),S.iushrn(1);d.cmp(w)>=0?(d.isub(w),y.isub(S)):(w.isub(d),S.isub(y))}var K;return d.cmpn(1)===0?K=y:K=S,K.cmpn(0)<0&&K.iadd(o),K},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var d=this.clone(),w=o.clone();d.negative=0,w.negative=0;for(var y=0;d.isEven()&&w.isEven();y++)d.iushrn(1),w.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;w.isEven();)w.iushrn(1);var S=d.cmp(w);if(S<0){var k=d;d=w,w=k}else if(S===0||w.cmpn(1)===0)break;d.isub(w)}while(!0);return w.iushln(y)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var d=o%26,w=(o-d)/26,y=1<<d;if(this.length<=w)return this._expand(w+1),this.words[w]|=y,this;for(var S=y,k=w;S!==0&&k<this.length;k++){var B=this.words[k]|0;B+=S,S=B>>>26,B&=67108863,this.words[k]=B}return S!==0&&(this.words[k]=S,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var d=o<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var w;if(this.length>1)w=1;else{d&&(o=-o),n(o<=67108863,"Number is too big");var y=this.words[0]|0;w=y===o?0:y<o?-1:1}return this.negative!==0?-w|0:w},s.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var d=this.ucmp(o);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var d=0,w=this.length-1;w>=0;w--){var y=this.words[w]|0,S=o.words[w]|0;if(y!==S){y<S?d=-1:y>S&&(d=1);break}}return d},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new oe(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var D={k256:null,p224:null,p192:null,p25519:null};function z(I,o){this.name=I,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},z.prototype.ireduce=function(o){var d=o,w;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),w=d.bitLength();while(w>this.n);var y=w<this.n?-1:d.ucmp(this.p);return y===0?(d.words[0]=0,d.length=1):y>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},z.prototype.split=function(o,d){o.iushrn(this.n,0,d)},z.prototype.imulK=function(o){return o.imul(this.k)};function te(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(te,z),te.prototype.split=function(o,d){for(var w=4194303,y=Math.min(o.length,9),S=0;S<y;S++)d.words[S]=o.words[S];if(d.length=y,o.length<=9){o.words[0]=0,o.length=1;return}var k=o.words[9];for(d.words[d.length++]=k&w,S=10;S<o.length;S++){var B=o.words[S]|0;o.words[S-10]=(B&w)<<4|k>>>22,k=B}k>>>=22,o.words[S-10]=k,k===0&&o.length>10?o.length-=10:o.length-=9},te.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var d=0,w=0;w<o.length;w++){var y=o.words[w]|0;d+=y*977,o.words[w]=d&67108863,d=y*64+(d/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function Y(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Y,z);function Q(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(Q,z);function fe(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(fe,z),fe.prototype.imulK=function(o){for(var d=0,w=0;w<o.length;w++){var y=(o.words[w]|0)*19+d,S=y&67108863;y>>>=26,o.words[w]=S,d=y}return d!==0&&(o.words[o.length++]=d),o},s._prime=function(o){if(D[o])return D[o];var d;if(o==="k256")d=new te;else if(o==="p224")d=new Y;else if(o==="p192")d=new Q;else if(o==="p25519")d=new fe;else throw new Error("Unknown prime "+o);return D[o]=d,d};function oe(I){if(typeof I=="string"){var o=s._prime(I);this.m=o.p,this.prime=o}else n(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}oe.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},oe.prototype._verify2=function(o,d){n((o.negative|d.negative)===0,"red works only with positives"),n(o.red&&o.red===d.red,"red works only with red numbers")},oe.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(p(o,o.umod(this.m)._forceRed(this)),o)},oe.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},oe.prototype.add=function(o,d){this._verify2(o,d);var w=o.add(d);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},oe.prototype.iadd=function(o,d){this._verify2(o,d);var w=o.iadd(d);return w.cmp(this.m)>=0&&w.isub(this.m),w},oe.prototype.sub=function(o,d){this._verify2(o,d);var w=o.sub(d);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},oe.prototype.isub=function(o,d){this._verify2(o,d);var w=o.isub(d);return w.cmpn(0)<0&&w.iadd(this.m),w},oe.prototype.shl=function(o,d){return this._verify1(o),this.imod(o.ushln(d))},oe.prototype.imul=function(o,d){return this._verify2(o,d),this.imod(o.imul(d))},oe.prototype.mul=function(o,d){return this._verify2(o,d),this.imod(o.mul(d))},oe.prototype.isqr=function(o){return this.imul(o,o.clone())},oe.prototype.sqr=function(o){return this.mul(o,o)},oe.prototype.sqrt=function(o){if(o.isZero())return o.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var w=this.m.add(new s(1)).iushrn(2);return this.pow(o,w)}for(var y=this.m.subn(1),S=0;!y.isZero()&&y.andln(1)===0;)S++,y.iushrn(1);n(!y.isZero());var k=new s(1).toRed(this),B=k.redNeg(),b=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);this.pow(u,b).cmp(B)!==0;)u.redIAdd(B);for(var R=this.pow(u,y),K=this.pow(o,y.addn(1).iushrn(1)),J=this.pow(o,y),T=S;J.cmp(k)!==0;){for(var P=J,W=0;P.cmp(k)!==0;W++)P=P.redSqr();n(W<T);var Z=this.pow(R,new s(1).iushln(T-W-1));K=K.redMul(Z),R=Z.redSqr(),J=J.redMul(R),T=W}return K},oe.prototype.invm=function(o){var d=o._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},oe.prototype.pow=function(o,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return o.clone();var w=4,y=new Array(1<<w);y[0]=new s(1).toRed(this),y[1]=o;for(var S=2;S<y.length;S++)y[S]=this.mul(y[S-1],o);var k=y[0],B=0,b=0,u=d.bitLength()%26;for(u===0&&(u=26),S=d.length-1;S>=0;S--){for(var R=d.words[S],K=u-1;K>=0;K--){var J=R>>K&1;if(k!==y[0]&&(k=this.sqr(k)),J===0&&B===0){b=0;continue}B<<=1,B|=J,b++,!(b!==w&&(S!==0||K!==0))&&(k=this.mul(k,y[B]),b=0,B=0)}u=26}return k},oe.prototype.convertTo=function(o){var d=o.umod(this.m);return d===o?d.clone():d},oe.prototype.convertFrom=function(o){var d=o.clone();return d.red=null,d},s.mont=function(o){return new pe(o)};function pe(I){oe.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(pe,oe),pe.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},pe.prototype.convertFrom=function(o){var d=this.imod(o.mul(this.rinv));return d.red=null,d},pe.prototype.imul=function(o,d){if(o.isZero()||d.isZero())return o.words[0]=0,o.length=1,o;var w=o.imul(d),y=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=w.isub(y).iushrn(this.shift),k=S;return S.cmp(this.m)>=0?k=S.isub(this.m):S.cmpn(0)<0&&(k=S.iadd(this.m)),k._forceRed(this)},pe.prototype.mul=function(o,d){if(o.isZero()||d.isZero())return new s(0)._forceRed(this);var w=o.mul(d),y=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=w.isub(y).iushrn(this.shift),k=S;return S.cmp(this.m)>=0?k=S.isub(this.m):S.cmpn(0)<0&&(k=S.iadd(this.m)),k._forceRed(this)},pe.prototype.invm=function(o){var d=this.imod(o._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,ee)})(Ys);var hi=Ys.exports,wn={},Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.errorValues=Dt.standardErrorCodes=void 0;Dt.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}};Dt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var di={},fi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Dt,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(E,A=r){if(E&&Number.isInteger(E)){const U=E.toString();if(p(t.errorValues,U))return t.errorValues[U].message;if(f(E))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return A}e.getMessageFromCode=n;function i(E){if(!Number.isInteger(E))return!1;const A=E.toString();return!!(t.errorValues[A]||f(E))}e.isValidCode=i;function s(E){var A;if(typeof E=="number")return E;if(c(E))return(A=E.code)!==null&&A!==void 0?A:E.errorCode}e.getErrorCode=s;function c(E){return typeof E=="object"&&E!==null&&(typeof E.code=="number"||typeof E.errorCode=="number")}function a(E,{shouldIncludeStack:A=!1}={}){const U={};if(E&&typeof E=="object"&&!Array.isArray(E)&&p(E,"code")&&i(E.code)){const F=E;U.code=F.code,F.message&&typeof F.message=="string"?(U.message=F.message,p(F,"data")&&(U.data=F.data)):(U.message=n(U.code),U.data={originalError:g(E)})}else U.code=t.standardErrorCodes.rpc.internal,U.message=v(E,"message")?E.message:r,U.data={originalError:g(E)};return A&&(U.stack=v(E,"stack")?E.stack:void 0),U}e.serialize=a;function f(E){return E>=-32099&&E<=-32e3}function g(E){return E&&typeof E=="object"&&!Array.isArray(E)?Object.assign({},E):E}function p(E,A){return Object.prototype.hasOwnProperty.call(E,A)}function v(E,A){return typeof E=="object"&&E!==null&&A in E&&typeof E[A]=="string"}})(fi);Object.defineProperty(di,"__esModule",{value:!0});di.standardErrors=void 0;const et=Dt,_c=fi;di.standardErrors={rpc:{parse:e=>ft(et.standardErrorCodes.rpc.parse,e),invalidRequest:e=>ft(et.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>ft(et.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>ft(et.standardErrorCodes.rpc.methodNotFound,e),internal:e=>ft(et.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ft(t,e)},invalidInput:e=>ft(et.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>ft(et.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ft(et.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ft(et.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ft(et.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ft(et.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Br(et.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Br(et.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Br(et.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Br(et.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Br(et.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Br(et.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Rc(t,r,n)}}};function ft(e,t){const[r,n]=Ec(t);return new Sc(e,r||(0,_c.getMessageFromCode)(e),n)}function Br(e,t){const[r,n]=Ec(t);return new Rc(e,r||(0,_c.getMessageFromCode)(e),n)}function Ec(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let Sc=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},Rc=class extends Sc{constructor(t,r,n){if(!Tu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Tu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var pi={},Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.isErrorResponse=void 0;function Bu(e){return e.errorMessage!==void 0}Yr.isErrorResponse=Bu;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.LIB_VERSION=void 0;Xr.LIB_VERSION="3.9.3";Object.defineProperty(pi,"__esModule",{value:!0});pi.serializeError=void 0;const Nu=Yr,Lu=Xr,Pu=Dt,Ou=fi;function $u(e,t){const r=(0,Ou.serialize)(Fu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Lu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Du(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}pi.serializeError=$u;function Fu(e){return typeof e=="string"?{message:e,code:Pu.standardErrorCodes.rpc.internal}:(0,Nu.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Du(e,t){const r=e?.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Dt;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=di;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=pi;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=fi;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(wn);var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.ProviderType=Ze.RegExpString=Ze.IntNumber=Ze.BigIntString=Ze.AddressString=Ze.HexString=Ze.OpaqueType=void 0;function yn(){return e=>e}Ze.OpaqueType=yn;Ze.HexString=yn();Ze.AddressString=yn();Ze.BigIntString=yn();function ju(e){return Math.floor(e)}Ze.IntNumber=ju;Ze.RegExpString=yn();var jo;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(jo||(Ze.ProviderType=jo={}));var Uu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0});X.isMobileWeb=X.getLocation=X.isInIFrame=X.createQrUrl=X.getFavicon=X.range=X.isBigNumber=X.ensureParsedJSONObject=X.ensureBN=X.ensureRegExpString=X.ensureIntNumber=X.ensureBuffer=X.ensureAddressString=X.ensureEvenLengthHexString=X.ensureHexString=X.isHexString=X.prepend0x=X.strip0x=X.has0xPrefix=X.hexStringFromIntNumber=X.intNumberFromHexString=X.bigIntStringFromBN=X.hexStringFromBuffer=X.hexStringToUint8Array=X.uint8ArrayToHex=X.randomBytesHex=void 0;const Vt=Uu(hi),vr=wn,yt=Ze,Mc=/^[0-9]*$/,Cc=/^[a-f0-9]*$/;function Hu(e){return kc(crypto.getRandomValues(new Uint8Array(e)))}X.randomBytesHex=Hu;function kc(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}X.uint8ArrayToHex=kc;function Wu(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}X.hexStringToUint8Array=Wu;function Vu(e,t=!1){const r=e.toString("hex");return(0,yt.HexString)(t?`0x${r}`:r)}X.hexStringFromBuffer=Vu;function qu(e){return(0,yt.BigIntString)(e.toString(10))}X.bigIntStringFromBN=qu;function zu(e){return(0,yt.IntNumber)(new Vt.default(vn(e,!1),16).toNumber())}X.intNumberFromHexString=zu;function Gu(e){return(0,yt.HexString)(`0x${new Vt.default(e).toString(16)}`)}X.hexStringFromIntNumber=Gu;function Xs(e){return e.startsWith("0x")||e.startsWith("0X")}X.has0xPrefix=Xs;function gi(e){return Xs(e)?e.slice(2):e}X.strip0x=gi;function Ic(e){return Xs(e)?`0x${e.slice(2)}`:`0x${e}`}X.prepend0x=Ic;function bn(e){if(typeof e!="string")return!1;const t=gi(e).toLowerCase();return Cc.test(t)}X.isHexString=bn;function xc(e,t=!1){if(typeof e=="string"){const r=gi(e).toLowerCase();if(Cc.test(r))return(0,yt.HexString)(t?`0x${r}`:r)}throw vr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}X.ensureHexString=xc;function vn(e,t=!1){let r=xc(e,!1);return r.length%2===1&&(r=(0,yt.HexString)(`0${r}`)),t?(0,yt.HexString)(`0x${r}`):r}X.ensureEvenLengthHexString=vn;function Ju(e){if(typeof e=="string"){const t=gi(e).toLowerCase();if(bn(t)&&t.length===40)return(0,yt.AddressString)(Ic(t))}throw vr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}X.ensureAddressString=Ju;function Zu(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(bn(e)){const t=vn(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw vr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}X.ensureBuffer=Zu;function Ac(e){if(typeof e=="number"&&Number.isInteger(e))return(0,yt.IntNumber)(e);if(typeof e=="string"){if(Mc.test(e))return(0,yt.IntNumber)(Number(e));if(bn(e))return(0,yt.IntNumber)(new Vt.default(vn(e,!1),16).toNumber())}throw vr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureIntNumber=Ac;function Ku(e){if(e instanceof RegExp)return(0,yt.RegExpString)(e.toString());throw vr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}X.ensureRegExpString=Ku;function Qu(e){if(e!==null&&(Vt.default.isBN(e)||Tc(e)))return new Vt.default(e.toString(10),10);if(typeof e=="number")return new Vt.default(Ac(e));if(typeof e=="string"){if(Mc.test(e))return new Vt.default(e,10);if(bn(e))return new Vt.default(vn(e,!1),16)}throw vr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureBN=Qu;function Yu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw vr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}X.ensureParsedJSONObject=Yu;function Tc(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}X.isBigNumber=Tc;function Xu(e,t){return Array.from({length:t-e},(r,n)=>e+n)}X.range=Xu;function eh(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}X.getFavicon=eh;function th(e,t,r,n,i,s){const c=n?"parent-id":"id",a=new URLSearchParams({[c]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${a}`}X.createQrUrl=th;function Bc(){try{return window.frameElement!==null}catch{return!1}}X.isInIFrame=Bc;function rh(){try{return Bc()&&window.top?window.top.location:window.location}catch{return window.location}}X.getLocation=rh;function nh(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window?.navigator)===null||e===void 0?void 0:e.userAgent)}X.isMobileWeb=nh;var mi={};Object.defineProperty(mi,"__esModule",{value:!0});mi.ScopedLocalStorage=void 0;class ih{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}mi.ScopedLocalStorage=ih;var Vr={};const sh=Qr(Su);var _n={},En={},en={};Object.defineProperty(en,"__esModule",{value:!0});en.EVENTS=void 0;en.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.RelayAbstract=wt.APP_VERSION_KEY=wt.LOCAL_STORAGE_ADDRESSES_KEY=wt.WALLET_USER_NAME_KEY=void 0;const Uo=wn;wt.WALLET_USER_NAME_KEY="walletUsername";wt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";wt.APP_VERSION_KEY="AppVersion";class oh{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Uo.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Uo.serializeError)(s,t.method);return i})}}wt.RelayAbstract=oh;var tn={},Nc={exports:{}},zs={exports:{}},Sn={},wi={};wi.byteLength=lh;wi.toByteArray=hh;wi.fromByteArray=ph;var Bt=[],mt=[],ah=typeof Uint8Array<"u"?Uint8Array:Array,ds="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Nr=0,ch=ds.length;Nr<ch;++Nr)Bt[Nr]=ds[Nr],mt[ds.charCodeAt(Nr)]=Nr;mt[45]=62;mt[95]=63;function Lc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function lh(e){var t=Lc(e),r=t[0],n=t[1];return(r+n)*3/4-n}function uh(e,t,r){return(t+r)*3/4-r}function hh(e){var t,r=Lc(e),n=r[0],i=r[1],s=new ah(uh(e,n,i)),c=0,a=i>0?n-4:n,f;for(f=0;f<a;f+=4)t=mt[e.charCodeAt(f)]<<18|mt[e.charCodeAt(f+1)]<<12|mt[e.charCodeAt(f+2)]<<6|mt[e.charCodeAt(f+3)],s[c++]=t>>16&255,s[c++]=t>>8&255,s[c++]=t&255;return i===2&&(t=mt[e.charCodeAt(f)]<<2|mt[e.charCodeAt(f+1)]>>4,s[c++]=t&255),i===1&&(t=mt[e.charCodeAt(f)]<<10|mt[e.charCodeAt(f+1)]<<4|mt[e.charCodeAt(f+2)]>>2,s[c++]=t>>8&255,s[c++]=t&255),s}function dh(e){return Bt[e>>18&63]+Bt[e>>12&63]+Bt[e>>6&63]+Bt[e&63]}function fh(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(dh(n));return i.join("")}function ph(e){for(var t,r=e.length,n=r%3,i=[],s=16383,c=0,a=r-n;c<a;c+=s)i.push(fh(e,c,c+s>a?a:c+s));return n===1?(t=e[r-1],i.push(Bt[t>>2]+Bt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Bt[t>>10]+Bt[t>>4&63]+Bt[t<<2&63]+"=")),i.join("")}var eo={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */eo.read=function(e,t,r,n,i){var s,c,a=i*8-n-1,f=(1<<a)-1,g=f>>1,p=-7,v=r?i-1:0,E=r?-1:1,A=e[t+v];for(v+=E,s=A&(1<<-p)-1,A>>=-p,p+=a;p>0;s=s*256+e[t+v],v+=E,p-=8);for(c=s&(1<<-p)-1,s>>=-p,p+=n;p>0;c=c*256+e[t+v],v+=E,p-=8);if(s===0)s=1-g;else{if(s===f)return c?NaN:(A?-1:1)*(1/0);c=c+Math.pow(2,n),s=s-g}return(A?-1:1)*c*Math.pow(2,s-n)};eo.write=function(e,t,r,n,i,s){var c,a,f,g=s*8-i-1,p=(1<<g)-1,v=p>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:s-1,U=n?1:-1,F=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,c=p):(c=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-c))<1&&(c--,f*=2),c+v>=1?t+=E/f:t+=E*Math.pow(2,1-v),t*f>=2&&(c++,f/=2),c+v>=p?(a=0,c=p):c+v>=1?(a=(t*f-1)*Math.pow(2,i),c=c+v):(a=t*Math.pow(2,v-1)*Math.pow(2,i),c=0));i>=8;e[r+A]=a&255,A+=U,a/=256,i-=8);for(c=c<<i|a,g+=i;g>0;e[r+A]=c&255,A+=U,c/=256,g-=8);e[r+A-U]|=F*128};/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */(function(e){const t=wi,r=eo,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=L,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const m=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(m,l),m.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function c(m){if(m>i)throw new RangeError('The value "'+m+'" is invalid for option "size"');const l=new Uint8Array(m);return Object.setPrototypeOf(l,a.prototype),l}function a(m,l,h){if(typeof m=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(m)}return f(m,l,h)}a.poolSize=8192;function f(m,l,h){if(typeof m=="string")return E(m,l);if(ArrayBuffer.isView(m))return U(m);if(m==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(Je(m,ArrayBuffer)||m&&Je(m.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Je(m,SharedArrayBuffer)||m&&Je(m.buffer,SharedArrayBuffer)))return F(m,l,h);if(typeof m=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const _=m.valueOf&&m.valueOf();if(_!=null&&_!==m)return a.from(_,l,h);const N=H(m);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof m[Symbol.toPrimitive]=="function")return a.from(m[Symbol.toPrimitive]("string"),l,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}a.from=function(m,l,h){return f(m,l,h)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function g(m){if(typeof m!="number")throw new TypeError('"size" argument must be of type number');if(m<0)throw new RangeError('The value "'+m+'" is invalid for option "size"')}function p(m,l,h){return g(m),m<=0?c(m):l!==void 0?typeof h=="string"?c(m).fill(l,h):c(m).fill(l):c(m)}a.alloc=function(m,l,h){return p(m,l,h)};function v(m){return g(m),c(m<0?0:x(m)|0)}a.allocUnsafe=function(m){return v(m)},a.allocUnsafeSlow=function(m){return v(m)};function E(m,l){if((typeof l!="string"||l==="")&&(l="utf8"),!a.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const h=O(m,l)|0;let _=c(h);const N=_.write(m,l);return N!==h&&(_=_.slice(0,N)),_}function A(m){const l=m.length<0?0:x(m.length)|0,h=c(l);for(let _=0;_<l;_+=1)h[_]=m[_]&255;return h}function U(m){if(Je(m,Uint8Array)){const l=new Uint8Array(m);return F(l.buffer,l.byteOffset,l.byteLength)}return A(m)}function F(m,l,h){if(l<0||m.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(m.byteLength<l+(h||0))throw new RangeError('"length" is outside of buffer bounds');let _;return l===void 0&&h===void 0?_=new Uint8Array(m):h===void 0?_=new Uint8Array(m,l):_=new Uint8Array(m,l,h),Object.setPrototypeOf(_,a.prototype),_}function H(m){if(a.isBuffer(m)){const l=x(m.length)|0,h=c(l);return h.length===0||m.copy(h,0,0,l),h}if(m.length!==void 0)return typeof m.length!="number"||ve(m.length)?c(0):A(m);if(m.type==="Buffer"&&Array.isArray(m.data))return A(m.data)}function x(m){if(m>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return m|0}function L(m){return+m!=m&&(m=0),a.alloc(+m)}a.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==a.prototype},a.compare=function(l,h){if(Je(l,Uint8Array)&&(l=a.from(l,l.offset,l.byteLength)),Je(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(l)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===h)return 0;let _=l.length,N=h.length;for(let $=0,j=Math.min(_,N);$<j;++$)if(l[$]!==h[$]){_=l[$],N=h[$];break}return _<N?-1:N<_?1:0},a.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(l,h){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return a.alloc(0);let _;if(h===void 0)for(h=0,_=0;_<l.length;++_)h+=l[_].length;const N=a.allocUnsafe(h);let $=0;for(_=0;_<l.length;++_){let j=l[_];if(Je(j,Uint8Array))$+j.length>N.length?(a.isBuffer(j)||(j=a.from(j)),j.copy(N,$)):Uint8Array.prototype.set.call(N,j,$);else if(a.isBuffer(j))j.copy(N,$);else throw new TypeError('"list" argument must be an Array of Buffers');$+=j.length}return N};function O(m,l){if(a.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||Je(m,ArrayBuffer))return m.byteLength;if(typeof m!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);const h=m.length,_=arguments.length>2&&arguments[2]===!0;if(!_&&h===0)return 0;let N=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return re(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Se(m).length;default:if(N)return _?-1:re(m).length;l=(""+l).toLowerCase(),N=!0}}a.byteLength=O;function V(m,l,h){let _=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,l>>>=0,h<=l))return"";for(m||(m="utf8");;)switch(m){case"hex":return k(this,l,h);case"utf8":case"utf-8":return o(this,l,h);case"ascii":return y(this,l,h);case"latin1":case"binary":return S(this,l,h);case"base64":return I(this,l,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,l,h);default:if(_)throw new TypeError("Unknown encoding: "+m);m=(m+"").toLowerCase(),_=!0}}a.prototype._isBuffer=!0;function D(m,l,h){const _=m[l];m[l]=m[h],m[h]=_}a.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<l;h+=2)D(this,h,h+1);return this},a.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<l;h+=4)D(this,h,h+3),D(this,h+1,h+2);return this},a.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<l;h+=8)D(this,h,h+7),D(this,h+1,h+6),D(this,h+2,h+5),D(this,h+3,h+4);return this},a.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?o(this,0,l):V.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(l){if(!a.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:a.compare(this,l)===0},a.prototype.inspect=function(){let l="";const h=e.INSPECT_MAX_BYTES;return l=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(l+=" ... "),"<Buffer "+l+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(l,h,_,N,$){if(Je(l,Uint8Array)&&(l=a.from(l,l.offset,l.byteLength)),!a.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(h===void 0&&(h=0),_===void 0&&(_=l?l.length:0),N===void 0&&(N=0),$===void 0&&($=this.length),h<0||_>l.length||N<0||$>this.length)throw new RangeError("out of range index");if(N>=$&&h>=_)return 0;if(N>=$)return-1;if(h>=_)return 1;if(h>>>=0,_>>>=0,N>>>=0,$>>>=0,this===l)return 0;let j=$-N,he=_-h;const ae=Math.min(j,he),ie=this.slice(N,$),Me=l.slice(h,_);for(let ne=0;ne<ae;++ne)if(ie[ne]!==Me[ne]){j=ie[ne],he=Me[ne];break}return j<he?-1:he<j?1:0};function z(m,l,h,_,N){if(m.length===0)return-1;if(typeof h=="string"?(_=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,ve(h)&&(h=N?0:m.length-1),h<0&&(h=m.length+h),h>=m.length){if(N)return-1;h=m.length-1}else if(h<0)if(N)h=0;else return-1;if(typeof l=="string"&&(l=a.from(l,_)),a.isBuffer(l))return l.length===0?-1:te(m,l,h,_,N);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(m,l,h):Uint8Array.prototype.lastIndexOf.call(m,l,h):te(m,[l],h,_,N);throw new TypeError("val must be string, number or Buffer")}function te(m,l,h,_,N){let $=1,j=m.length,he=l.length;if(_!==void 0&&(_=String(_).toLowerCase(),_==="ucs2"||_==="ucs-2"||_==="utf16le"||_==="utf-16le")){if(m.length<2||l.length<2)return-1;$=2,j/=2,he/=2,h/=2}function ae(Me,ne){return $===1?Me[ne]:Me.readUInt16BE(ne*$)}let ie;if(N){let Me=-1;for(ie=h;ie<j;ie++)if(ae(m,ie)===ae(l,Me===-1?0:ie-Me)){if(Me===-1&&(Me=ie),ie-Me+1===he)return Me*$}else Me!==-1&&(ie-=ie-Me),Me=-1}else for(h+he>j&&(h=j-he),ie=h;ie>=0;ie--){let Me=!0;for(let ne=0;ne<he;ne++)if(ae(m,ie+ne)!==ae(l,ne)){Me=!1;break}if(Me)return ie}return-1}a.prototype.includes=function(l,h,_){return this.indexOf(l,h,_)!==-1},a.prototype.indexOf=function(l,h,_){return z(this,l,h,_,!0)},a.prototype.lastIndexOf=function(l,h,_){return z(this,l,h,_,!1)};function Y(m,l,h,_){h=Number(h)||0;const N=m.length-h;_?(_=Number(_),_>N&&(_=N)):_=N;const $=l.length;_>$/2&&(_=$/2);let j;for(j=0;j<_;++j){const he=parseInt(l.substr(j*2,2),16);if(ve(he))return j;m[h+j]=he}return j}function Q(m,l,h,_){return Ee(re(l,m.length-h),m,h,_)}function fe(m,l,h,_){return Ee(be(l),m,h,_)}function oe(m,l,h,_){return Ee(Se(l),m,h,_)}function pe(m,l,h,_){return Ee(dt(l,m.length-h),m,h,_)}a.prototype.write=function(l,h,_,N){if(h===void 0)N="utf8",_=this.length,h=0;else if(_===void 0&&typeof h=="string")N=h,_=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(_)?(_=_>>>0,N===void 0&&(N="utf8")):(N=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const $=this.length-h;if((_===void 0||_>$)&&(_=$),l.length>0&&(_<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");N||(N="utf8");let j=!1;for(;;)switch(N){case"hex":return Y(this,l,h,_);case"utf8":case"utf-8":return Q(this,l,h,_);case"ascii":case"latin1":case"binary":return fe(this,l,h,_);case"base64":return oe(this,l,h,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,l,h,_);default:if(j)throw new TypeError("Unknown encoding: "+N);N=(""+N).toLowerCase(),j=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(m,l,h){return l===0&&h===m.length?t.fromByteArray(m):t.fromByteArray(m.slice(l,h))}function o(m,l,h){h=Math.min(m.length,h);const _=[];let N=l;for(;N<h;){const $=m[N];let j=null,he=$>239?4:$>223?3:$>191?2:1;if(N+he<=h){let ae,ie,Me,ne;switch(he){case 1:$<128&&(j=$);break;case 2:ae=m[N+1],(ae&192)===128&&(ne=($&31)<<6|ae&63,ne>127&&(j=ne));break;case 3:ae=m[N+1],ie=m[N+2],(ae&192)===128&&(ie&192)===128&&(ne=($&15)<<12|(ae&63)<<6|ie&63,ne>2047&&(ne<55296||ne>57343)&&(j=ne));break;case 4:ae=m[N+1],ie=m[N+2],Me=m[N+3],(ae&192)===128&&(ie&192)===128&&(Me&192)===128&&(ne=($&15)<<18|(ae&63)<<12|(ie&63)<<6|Me&63,ne>65535&&ne<1114112&&(j=ne))}}j===null?(j=65533,he=1):j>65535&&(j-=65536,_.push(j>>>10&1023|55296),j=56320|j&1023),_.push(j),N+=he}return w(_)}const d=4096;function w(m){const l=m.length;if(l<=d)return String.fromCharCode.apply(String,m);let h="",_=0;for(;_<l;)h+=String.fromCharCode.apply(String,m.slice(_,_+=d));return h}function y(m,l,h){let _="";h=Math.min(m.length,h);for(let N=l;N<h;++N)_+=String.fromCharCode(m[N]&127);return _}function S(m,l,h){let _="";h=Math.min(m.length,h);for(let N=l;N<h;++N)_+=String.fromCharCode(m[N]);return _}function k(m,l,h){const _=m.length;(!l||l<0)&&(l=0),(!h||h<0||h>_)&&(h=_);let N="";for(let $=l;$<h;++$)N+=Re[m[$]];return N}function B(m,l,h){const _=m.slice(l,h);let N="";for(let $=0;$<_.length-1;$+=2)N+=String.fromCharCode(_[$]+_[$+1]*256);return N}a.prototype.slice=function(l,h){const _=this.length;l=~~l,h=h===void 0?_:~~h,l<0?(l+=_,l<0&&(l=0)):l>_&&(l=_),h<0?(h+=_,h<0&&(h=0)):h>_&&(h=_),h<l&&(h=l);const N=this.subarray(l,h);return Object.setPrototypeOf(N,a.prototype),N};function b(m,l,h){if(m%1!==0||m<0)throw new RangeError("offset is not uint");if(m+l>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(l,h,_){l=l>>>0,h=h>>>0,_||b(l,h,this.length);let N=this[l],$=1,j=0;for(;++j<h&&($*=256);)N+=this[l+j]*$;return N},a.prototype.readUintBE=a.prototype.readUIntBE=function(l,h,_){l=l>>>0,h=h>>>0,_||b(l,h,this.length);let N=this[l+--h],$=1;for(;h>0&&($*=256);)N+=this[l+--h]*$;return N},a.prototype.readUint8=a.prototype.readUInt8=function(l,h){return l=l>>>0,h||b(l,1,this.length),this[l]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(l,h){return l=l>>>0,h||b(l,2,this.length),this[l]|this[l+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(l,h){return l=l>>>0,h||b(l,2,this.length),this[l]<<8|this[l+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(l,h){return l=l>>>0,h||b(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(l,h){return l=l>>>0,h||b(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},a.prototype.readBigUInt64LE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],_=this[l+7];(h===void 0||_===void 0)&&G(l,this.length-8);const N=h+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,$=this[++l]+this[++l]*2**8+this[++l]*2**16+_*2**24;return BigInt(N)+(BigInt($)<<BigInt(32))}),a.prototype.readBigUInt64BE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],_=this[l+7];(h===void 0||_===void 0)&&G(l,this.length-8);const N=h*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],$=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+_;return(BigInt(N)<<BigInt(32))+BigInt($)}),a.prototype.readIntLE=function(l,h,_){l=l>>>0,h=h>>>0,_||b(l,h,this.length);let N=this[l],$=1,j=0;for(;++j<h&&($*=256);)N+=this[l+j]*$;return $*=128,N>=$&&(N-=Math.pow(2,8*h)),N},a.prototype.readIntBE=function(l,h,_){l=l>>>0,h=h>>>0,_||b(l,h,this.length);let N=h,$=1,j=this[l+--N];for(;N>0&&($*=256);)j+=this[l+--N]*$;return $*=128,j>=$&&(j-=Math.pow(2,8*h)),j},a.prototype.readInt8=function(l,h){return l=l>>>0,h||b(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},a.prototype.readInt16LE=function(l,h){l=l>>>0,h||b(l,2,this.length);const _=this[l]|this[l+1]<<8;return _&32768?_|4294901760:_},a.prototype.readInt16BE=function(l,h){l=l>>>0,h||b(l,2,this.length);const _=this[l+1]|this[l]<<8;return _&32768?_|4294901760:_},a.prototype.readInt32LE=function(l,h){return l=l>>>0,h||b(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},a.prototype.readInt32BE=function(l,h){return l=l>>>0,h||b(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},a.prototype.readBigInt64LE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],_=this[l+7];(h===void 0||_===void 0)&&G(l,this.length-8);const N=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(_<<24);return(BigInt(N)<<BigInt(32))+BigInt(h+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),a.prototype.readBigInt64BE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],_=this[l+7];(h===void 0||_===void 0)&&G(l,this.length-8);const N=(h<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(N)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+_)}),a.prototype.readFloatLE=function(l,h){return l=l>>>0,h||b(l,4,this.length),r.read(this,l,!0,23,4)},a.prototype.readFloatBE=function(l,h){return l=l>>>0,h||b(l,4,this.length),r.read(this,l,!1,23,4)},a.prototype.readDoubleLE=function(l,h){return l=l>>>0,h||b(l,8,this.length),r.read(this,l,!0,52,8)},a.prototype.readDoubleBE=function(l,h){return l=l>>>0,h||b(l,8,this.length),r.read(this,l,!1,52,8)};function u(m,l,h,_,N,$){if(!a.isBuffer(m))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>N||l<$)throw new RangeError('"value" argument is out of bounds');if(h+_>m.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(l,h,_,N){if(l=+l,h=h>>>0,_=_>>>0,!N){const he=Math.pow(2,8*_)-1;u(this,l,h,_,he,0)}let $=1,j=0;for(this[h]=l&255;++j<_&&($*=256);)this[h+j]=l/$&255;return h+_},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(l,h,_,N){if(l=+l,h=h>>>0,_=_>>>0,!N){const he=Math.pow(2,8*_)-1;u(this,l,h,_,he,0)}let $=_-1,j=1;for(this[h+$]=l&255;--$>=0&&(j*=256);)this[h+$]=l/j&255;return h+_},a.prototype.writeUint8=a.prototype.writeUInt8=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,1,255,0),this[h]=l&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,2,65535,0),this[h]=l&255,this[h+1]=l>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,2,65535,0),this[h]=l>>>8,this[h+1]=l&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,4,4294967295,0),this[h+3]=l>>>24,this[h+2]=l>>>16,this[h+1]=l>>>8,this[h]=l&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,4,4294967295,0),this[h]=l>>>24,this[h+1]=l>>>16,this[h+2]=l>>>8,this[h+3]=l&255,h+4};function R(m,l,h,_,N){C(l,_,N,m,h,7);let $=Number(l&BigInt(4294967295));m[h++]=$,$=$>>8,m[h++]=$,$=$>>8,m[h++]=$,$=$>>8,m[h++]=$;let j=Number(l>>BigInt(32)&BigInt(4294967295));return m[h++]=j,j=j>>8,m[h++]=j,j=j>>8,m[h++]=j,j=j>>8,m[h++]=j,h}function K(m,l,h,_,N){C(l,_,N,m,h,7);let $=Number(l&BigInt(4294967295));m[h+7]=$,$=$>>8,m[h+6]=$,$=$>>8,m[h+5]=$,$=$>>8,m[h+4]=$;let j=Number(l>>BigInt(32)&BigInt(4294967295));return m[h+3]=j,j=j>>8,m[h+2]=j,j=j>>8,m[h+1]=j,j=j>>8,m[h]=j,h+8}a.prototype.writeBigUInt64LE=Qe(function(l,h=0){return R(this,l,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Qe(function(l,h=0){return K(this,l,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(l,h,_,N){if(l=+l,h=h>>>0,!N){const ae=Math.pow(2,8*_-1);u(this,l,h,_,ae-1,-ae)}let $=0,j=1,he=0;for(this[h]=l&255;++$<_&&(j*=256);)l<0&&he===0&&this[h+$-1]!==0&&(he=1),this[h+$]=(l/j>>0)-he&255;return h+_},a.prototype.writeIntBE=function(l,h,_,N){if(l=+l,h=h>>>0,!N){const ae=Math.pow(2,8*_-1);u(this,l,h,_,ae-1,-ae)}let $=_-1,j=1,he=0;for(this[h+$]=l&255;--$>=0&&(j*=256);)l<0&&he===0&&this[h+$+1]!==0&&(he=1),this[h+$]=(l/j>>0)-he&255;return h+_},a.prototype.writeInt8=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,1,127,-128),l<0&&(l=255+l+1),this[h]=l&255,h+1},a.prototype.writeInt16LE=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,2,32767,-32768),this[h]=l&255,this[h+1]=l>>>8,h+2},a.prototype.writeInt16BE=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,2,32767,-32768),this[h]=l>>>8,this[h+1]=l&255,h+2},a.prototype.writeInt32LE=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,4,2147483647,-2147483648),this[h]=l&255,this[h+1]=l>>>8,this[h+2]=l>>>16,this[h+3]=l>>>24,h+4},a.prototype.writeInt32BE=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[h]=l>>>24,this[h+1]=l>>>16,this[h+2]=l>>>8,this[h+3]=l&255,h+4},a.prototype.writeBigInt64LE=Qe(function(l,h=0){return R(this,l,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Qe(function(l,h=0){return K(this,l,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function J(m,l,h,_,N,$){if(h+_>m.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function T(m,l,h,_,N){return l=+l,h=h>>>0,N||J(m,l,h,4),r.write(m,l,h,_,23,4),h+4}a.prototype.writeFloatLE=function(l,h,_){return T(this,l,h,!0,_)},a.prototype.writeFloatBE=function(l,h,_){return T(this,l,h,!1,_)};function P(m,l,h,_,N){return l=+l,h=h>>>0,N||J(m,l,h,8),r.write(m,l,h,_,52,8),h+8}a.prototype.writeDoubleLE=function(l,h,_){return P(this,l,h,!0,_)},a.prototype.writeDoubleBE=function(l,h,_){return P(this,l,h,!1,_)},a.prototype.copy=function(l,h,_,N){if(!a.isBuffer(l))throw new TypeError("argument should be a Buffer");if(_||(_=0),!N&&N!==0&&(N=this.length),h>=l.length&&(h=l.length),h||(h=0),N>0&&N<_&&(N=_),N===_||l.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("sourceEnd out of bounds");N>this.length&&(N=this.length),l.length-h<N-_&&(N=l.length-h+_);const $=N-_;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,_,N):Uint8Array.prototype.set.call(l,this.subarray(_,N),h),$},a.prototype.fill=function(l,h,_,N){if(typeof l=="string"){if(typeof h=="string"?(N=h,h=0,_=this.length):typeof _=="string"&&(N=_,_=this.length),N!==void 0&&typeof N!="string")throw new TypeError("encoding must be a string");if(typeof N=="string"&&!a.isEncoding(N))throw new TypeError("Unknown encoding: "+N);if(l.length===1){const j=l.charCodeAt(0);(N==="utf8"&&j<128||N==="latin1")&&(l=j)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(h<0||this.length<h||this.length<_)throw new RangeError("Out of range index");if(_<=h)return this;h=h>>>0,_=_===void 0?this.length:_>>>0,l||(l=0);let $;if(typeof l=="number")for($=h;$<_;++$)this[$]=l;else{const j=a.isBuffer(l)?l:a.from(l,N),he=j.length;if(he===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for($=0;$<_-h;++$)this[$+h]=j[$%he]}return this};const W={};function Z(m,l,h){W[m]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${m}]`,this.stack,delete this.name}get code(){return m}set code(N){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:N,writable:!0})}toString(){return`${this.name} [${m}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(m){return m?`${m} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(m,l){return`The "${m}" argument must be of type number. Received type ${typeof l}`},TypeError),Z("ERR_OUT_OF_RANGE",function(m,l,h){let _=`The value of "${m}" is out of range.`,N=h;return Number.isInteger(h)&&Math.abs(h)>2**32?N=le(String(h)):typeof h=="bigint"&&(N=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(N=le(N)),N+="n"),_+=` It must be ${l}. Received ${N}`,_},RangeError);function le(m){let l="",h=m.length;const _=m[0]==="-"?1:0;for(;h>=_+4;h-=3)l=`_${m.slice(h-3,h)}${l}`;return`${m.slice(0,h)}${l}`}function M(m,l,h){q(l,"offset"),(m[l]===void 0||m[l+h]===void 0)&&G(l,m.length-(h+1))}function C(m,l,h,_,N,$){if(m>h||m<l){const j=typeof l=="bigint"?"n":"";let he;throw l===0||l===BigInt(0)?he=`>= 0${j} and < 2${j} ** ${($+1)*8}${j}`:he=`>= -(2${j} ** ${($+1)*8-1}${j}) and < 2 ** ${($+1)*8-1}${j}`,new W.ERR_OUT_OF_RANGE("value",he,m)}M(_,N,$)}function q(m,l){if(typeof m!="number")throw new W.ERR_INVALID_ARG_TYPE(l,"number",m)}function G(m,l,h){throw Math.floor(m)!==m?(q(m,h),new W.ERR_OUT_OF_RANGE("offset","an integer",m)):l<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,m)}const se=/[^+/0-9A-Za-z-_]/g;function ue(m){if(m=m.split("=")[0],m=m.trim().replace(se,""),m.length<2)return"";for(;m.length%4!==0;)m=m+"=";return m}function re(m,l){l=l||1/0;let h;const _=m.length;let N=null;const $=[];for(let j=0;j<_;++j){if(h=m.charCodeAt(j),h>55295&&h<57344){if(!N){if(h>56319){(l-=3)>-1&&$.push(239,191,189);continue}else if(j+1===_){(l-=3)>-1&&$.push(239,191,189);continue}N=h;continue}if(h<56320){(l-=3)>-1&&$.push(239,191,189),N=h;continue}h=(N-55296<<10|h-56320)+65536}else N&&(l-=3)>-1&&$.push(239,191,189);if(N=null,h<128){if((l-=1)<0)break;$.push(h)}else if(h<2048){if((l-=2)<0)break;$.push(h>>6|192,h&63|128)}else if(h<65536){if((l-=3)<0)break;$.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((l-=4)<0)break;$.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return $}function be(m){const l=[];for(let h=0;h<m.length;++h)l.push(m.charCodeAt(h)&255);return l}function dt(m,l){let h,_,N;const $=[];for(let j=0;j<m.length&&!((l-=2)<0);++j)h=m.charCodeAt(j),_=h>>8,N=h%256,$.push(N),$.push(_);return $}function Se(m){return t.toByteArray(ue(m))}function Ee(m,l,h,_){let N;for(N=0;N<_&&!(N+h>=l.length||N>=m.length);++N)l[N+h]=m[N];return N}function Je(m,l){return m instanceof l||m!=null&&m.constructor!=null&&m.constructor.name!=null&&m.constructor.name===l.name}function ve(m){return m!==m}const Re=function(){const m="0123456789abcdef",l=new Array(256);for(let h=0;h<16;++h){const _=h*16;for(let N=0;N<16;++N)l[_+N]=m[h]+m[N]}return l}();function Qe(m){return typeof BigInt>"u"?_e:m}function _e(){throw new Error("BigInt not supported")}})(Sn);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=Sn,n=r.Buffer;function i(c,a){for(var f in c)a[f]=c[f]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(c,a,f){return n(c,a,f)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(c,a,f){if(typeof c=="number")throw new TypeError("Argument must not be a number");return n(c,a,f)},s.alloc=function(c,a,f){if(typeof c!="number")throw new TypeError("Argument must be a number");var g=n(c);return a!==void 0?typeof f=="string"?g.fill(a,f):g.fill(a):g.fill(0),g},s.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n(c)},s.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(c)}})(zs,zs.exports);var Ut=zs.exports,fs,Ho;function gh(){if(Ho)return fs;Ho=1;var e=mu;return fs=function(r){return!!e(r)},fs}var mh=wu,wh=yu,yh=wh("TypedArray.prototype.buffer",!0),bh=gh(),vh=yh||function(t){if(!bh(t))throw new mh("Not a Typed Array");return t.buffer},St=Ut.Buffer,_h=bu,Eh=vh,Sh=ArrayBuffer.isView||function(t){try{return Eh(t),!0}catch{return!1}},Rh=typeof Uint8Array<"u",Pc=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Mh=Pc&&(St.prototype instanceof Uint8Array||St.TYPED_ARRAY_SUPPORT),Ch=function(t,r){if(St.isBuffer(t))return t.constructor&&!("isBuffer"in t)?St.from(t):t;if(typeof t=="string")return St.from(t,r);if(Pc&&Sh(t)){if(t.byteLength===0)return St.alloc(0);if(Mh){var n=St.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=St.from(i);if(s.length===t.byteLength)return s}if(Rh&&t instanceof Uint8Array)return St.from(t);var c=_h(t);if(c)for(var a=0;a<t.length;a+=1){var f=t[a];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(c||St.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return St.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},kh=Ut.Buffer,Ih=Ch;function yi(e,t){this._block=kh.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}yi.prototype.update=function(e,t){e=Ih(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,c=0;c<i;){for(var a=s%n,f=Math.min(i-c,n-a),g=0;g<f;g++)r[a+g]=e[c+g];s+=f,c+=f,s%n===0&&this._update(r)}return this._len+=i,this};yi.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};yi.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var rn=yi,xh=Rt,Oc=rn,Ah=Ut.Buffer,Th=[1518500249,1859775393,-1894007588,-899497514],Bh=new Array(80);function Rn(){this.init(),this._w=Bh,Oc.call(this,64,56)}xh(Rn,Oc);Rn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Nh(e){return e<<5|e>>>27}function Lh(e){return e<<30|e>>>2}function Ph(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Rn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,c=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var f=0;f<80;++f){var g=~~(f/20),p=Nh(r)+Ph(g,n,i,s)+c+t[f]+Th[g]|0;c=s,s=i,i=Lh(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0};Rn.prototype._hash=function(){var e=Ah.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Oh=Rn,$h=Rt,$c=rn,Fh=Ut.Buffer,Dh=[1518500249,1859775393,-1894007588,-899497514],jh=new Array(80);function Mn(){this.init(),this._w=jh,$c.call(this,64,56)}$h(Mn,$c);Mn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Uh(e){return e<<1|e>>>31}function Hh(e){return e<<5|e>>>27}function Wh(e){return e<<30|e>>>2}function Vh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Mn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,c=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=Uh(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var f=0;f<80;++f){var g=~~(f/20),p=Hh(r)+Vh(g,n,i,s)+c+t[f]+Dh[g]|0;c=s,s=i,i=Wh(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0};Mn.prototype._hash=function(){var e=Fh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var qh=Mn,zh=Rt,Fc=rn,Gh=Ut.Buffer,Jh=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Zh=new Array(64);function Cn(){this.init(),this._w=Zh,Fc.call(this,64,56)}zh(Cn,Fc);Cn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Kh(e,t,r){return r^e&(t^r)}function Qh(e,t,r){return e&t|r&(e|t)}function Yh(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Xh(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function ed(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function td(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Cn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,c=this._e|0,a=this._f|0,f=this._g|0,g=this._h|0,p=0;p<16;++p)t[p]=e.readInt32BE(p*4);for(;p<64;++p)t[p]=td(t[p-2])+t[p-7]+ed(t[p-15])+t[p-16]|0;for(var v=0;v<64;++v){var E=g+Xh(c)+Kh(c,a,f)+Jh[v]+t[v]|0,A=Yh(r)+Qh(r,n,i)|0;g=f,f=a,a=c,c=s+E|0,s=i,i=n,n=r,r=E+A|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=a+this._f|0,this._g=f+this._g|0,this._h=g+this._h|0};Cn.prototype._hash=function(){var e=Gh.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Dc=Cn,rd=Rt,nd=Dc,id=rn,sd=Ut.Buffer,od=new Array(64);function bi(){this.init(),this._w=od,id.call(this,64,56)}rd(bi,nd);bi.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};bi.prototype._hash=function(){var e=sd.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var ad=bi,cd=Rt,jc=rn,ld=Ut.Buffer,Wo=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],ud=new Array(160);function kn(){this.init(),this._w=ud,jc.call(this,128,112)}cd(kn,jc);kn.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Vo(e,t,r){return r^e&(t^r)}function qo(e,t,r){return e&t|r&(e|t)}function zo(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Go(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function hd(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function dd(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function fd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function pd(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ye(e,t){return e>>>0<t>>>0?1:0}kn.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,c=this._eh|0,a=this._fh|0,f=this._gh|0,g=this._hh|0,p=this._al|0,v=this._bl|0,E=this._cl|0,A=this._dl|0,U=this._el|0,F=this._fl|0,H=this._gl|0,x=this._hl|0,L=0;L<32;L+=2)t[L]=e.readInt32BE(L*4),t[L+1]=e.readInt32BE(L*4+4);for(;L<160;L+=2){var O=t[L-30],V=t[L-15*2+1],D=hd(O,V),z=dd(V,O);O=t[L-2*2],V=t[L-2*2+1];var te=fd(O,V),Y=pd(V,O),Q=t[L-7*2],fe=t[L-7*2+1],oe=t[L-16*2],pe=t[L-16*2+1],I=z+fe|0,o=D+Q+Ye(I,z)|0;I=I+Y|0,o=o+te+Ye(I,Y)|0,I=I+pe|0,o=o+oe+Ye(I,pe)|0,t[L]=o,t[L+1]=I}for(var d=0;d<160;d+=2){o=t[d],I=t[d+1];var w=qo(r,n,i),y=qo(p,v,E),S=zo(r,p),k=zo(p,r),B=Go(c,U),b=Go(U,c),u=Wo[d],R=Wo[d+1],K=Vo(c,a,f),J=Vo(U,F,H),T=x+b|0,P=g+B+Ye(T,x)|0;T=T+J|0,P=P+K+Ye(T,J)|0,T=T+R|0,P=P+u+Ye(T,R)|0,T=T+I|0,P=P+o+Ye(T,I)|0;var W=k+y|0,Z=S+w+Ye(W,k)|0;g=f,x=H,f=a,H=F,a=c,F=U,U=A+T|0,c=s+P+Ye(U,A)|0,s=i,A=E,i=n,E=v,n=r,v=p,p=T+W|0,r=P+Z+Ye(p,T)|0}this._al=this._al+p|0,this._bl=this._bl+v|0,this._cl=this._cl+E|0,this._dl=this._dl+A|0,this._el=this._el+U|0,this._fl=this._fl+F|0,this._gl=this._gl+H|0,this._hl=this._hl+x|0,this._ah=this._ah+r+Ye(this._al,p)|0,this._bh=this._bh+n+Ye(this._bl,v)|0,this._ch=this._ch+i+Ye(this._cl,E)|0,this._dh=this._dh+s+Ye(this._dl,A)|0,this._eh=this._eh+c+Ye(this._el,U)|0,this._fh=this._fh+a+Ye(this._fl,F)|0,this._gh=this._gh+f+Ye(this._gl,H)|0,this._hh=this._hh+g+Ye(this._hl,x)|0};kn.prototype._hash=function(){var e=ld.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Uc=kn,gd=Rt,md=Uc,wd=rn,yd=Ut.Buffer,bd=new Array(160);function vi(){this.init(),this._w=bd,wd.call(this,128,112)}gd(vi,md);vi.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};vi.prototype._hash=function(){var e=yd.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var vd=vi;(function(e){e.exports=function(r){var n=r.toLowerCase(),i=e.exports[n];if(!i)throw new Error(n+" is not supported (we accept pull requests)");return new i},e.exports.sha=Oh,e.exports.sha1=qh,e.exports.sha224=ad,e.exports.sha256=Dc,e.exports.sha384=vd,e.exports.sha512=Uc})(Nc);var _d=Nc.exports;Object.defineProperty(tn,"__esModule",{value:!0});tn.Session=void 0;const Jo=_d,Zo=X,Ko="session:id",Qo="session:secret",Yo="session:linked";class to{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Zo.randomBytesHex)(16),this._secret=n||(0,Zo.randomBytesHex)(32),this._key=new Jo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Ko),n=t.getItem(Yo),i=t.getItem(Qo);return r&&i?new to(t,r,i,n==="1"):null}static hash(t){return new Jo.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Ko,this._id),this._storage.setItem(Qo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Yo,this._linked?"1":"0")}}tn.Session=to;var _i={},Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.Cipher=void 0;const Wn=X;class Ed{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,Wn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),a=16,f=c.slice(c.byteLength-a),g=c.slice(0,c.byteLength-a),p=new Uint8Array(f),v=new Uint8Array(g),E=new Uint8Array([...n,...p,...v]);return(0,Wn.uint8ArrayToHex)(E)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,Wn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=(0,Wn.hexStringToUint8Array)(t),a=c.slice(0,12),f=c.slice(12,28),g=c.slice(28),p=new Uint8Array([...g,...f]),v={name:"AES-GCM",iv:new Uint8Array(a)};try{const E=await window.crypto.subtle.decrypt(v,s,p),A=new TextDecoder;n(A.decode(E))}catch(E){i(E)}})()})}}Ei.Cipher=Ed;var Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.WalletLinkHTTP=void 0;class Sd{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n?.filter(c=>c.event==="Web3Response").map(c=>({type:"Event",sessionId:this.sessionId,eventId:c.id,event:c.event,data:c.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Si.WalletLinkHTTP=Sd;var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.WalletLinkWebSocket=qr.ConnectionState=void 0;var Dr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Dr||(qr.ConnectionState=Dr={}));class Rd{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Dr.CONNECTING),i.onclose=s=>{var c;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(c=this.connectionStateListener)===null||c===void 0||c.call(this,Dr.DISCONNECTED)},i.onopen=s=>{var c;t(),(c=this.connectionStateListener)===null||c===void 0||c.call(this,Dr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(f=>this.sendData(f)),this.pendingData=[])},i.onmessage=s=>{var c,a;if(s.data==="h")(c=this.incomingDataListener)===null||c===void 0||c.call(this,{type:"Heartbeat"});else try{const f=JSON.parse(s.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,f)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Dr.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}qr.WalletLinkWebSocket=Rd;Object.defineProperty(_i,"__esModule",{value:!0});_i.WalletLinkConnection=void 0;const Lr=Ze,Md=Ei,kt=en,Xo=wt,Pr=tn,Cd=Si,Vn=qr,ea=1e4,kd=6e4;class Id{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Lr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",g=>a.JsonRpcUrl&&this.handleChainUpdated(g,a.JsonRpcUrl)]]).forEach((g,p)=>{const v=a[p];v!==void 0&&g(v)})},this.handleDestroyed=a=>{var f,g;a==="1"&&((f=this.listener)===null||f===void 0||f.resetAndReload(),(g=this.diagnostic)===null||g===void 0||g.log(kt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Pr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var f,g;try{const p=await this.cipher.decrypt(a);(f=this.listener)===null||f===void 0||f.accountUpdated(p)}catch{(g=this.diagnostic)===null||g===void 0||g.log(kt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,f)=>{var g,p;try{const v=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.metadataUpdated(a,v)}catch{(p=this.diagnostic)===null||p===void 0||p.log(kt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(Xo.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Xo.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,f)=>{var g,p;try{const v=await this.cipher.decrypt(a),E=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.chainUpdated(v,E)}catch{(p=this.diagnostic)===null||p===void 0||p.log(kt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Md.Cipher(t.secret),this.diagnostic=i,this.listener=n;const c=new Vn.WalletLinkWebSocket(`${r}/rpc`,s);c.setConnectionStateListener(async a=>{var f;(f=this.diagnostic)===null||f===void 0||f.log(kt.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Pr.Session.hash(t.id)});let g=!1;switch(a){case Vn.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(v=>setTimeout(v,5e3)),this.destroyed||c.connect().catch(()=>{p()})};p()}break;case Vn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),g=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},ea),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Vn.ConnectionState.CONNECTING:break}this.connected!==g&&(this.connected=g)}),c.setIncomingDataListener(a=>{var f,g,p;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const v=a.type==="IsLinkedOK"?a.linked:void 0;(f=this.diagnostic)===null||f===void 0||f.log(kt.EVENTS.LINKED,{sessionIdHash:Pr.Session.hash(t.id),linked:v,type:a.type,onlineGuests:a.onlineGuests}),this.linked=v||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(g=this.diagnostic)===null||g===void 0||g.log(kt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Pr.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((p=this.requestResolutions.get(a.id))===null||p===void 0||p(a))}),this.ws=c,this.http=new Cd.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(kt.EVENTS.STARTED_CONNECTING,{sessionIdHash:Pr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(kt.EVENTS.DISCONNECTED,{sessionIdHash:Pr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(kt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Lr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Lr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const c=await this.makeRequest(s);if(c.type==="Fail")throw new Error(c.error||"failed to publish event");return c.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>ea*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=kd){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,c)=>{i=window.setTimeout(()=>{c(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,c=>{clearTimeout(i),s(c),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Lr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Lr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Lr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}_i.WalletLinkConnection=Id;var In={},xn={},ro={};Object.defineProperty(ro,"__esModule",{value:!0});ro.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}';var xd=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xn,"__esModule",{value:!0});xn.injectCssReset=void 0;const Ad=xd(ro);function Td(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Ad.default)),document.documentElement.appendChild(e)}xn.injectCssReset=Td;var Ri={};const at=Qr(vu);var Mi={};function Hc(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Hc(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function ta(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Hc(e))&&(n&&(n+=" "),n+=t);return n}const Bd=Object.freeze(Object.defineProperty({__proto__:null,clsx:ta,default:ta},Symbol.toStringTag,{value:"Module"})),An=Qr(Bd),Ci=Qr(_u);var zr={},ki={};Object.defineProperty(ki,"__esModule",{value:!0});ki.CloseIcon=void 0;const ra=at;function Nd(e){return(0,ra.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ra.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"}))}ki.CloseIcon=Nd;var Ii={};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.CoinbaseWalletRound=void 0;const qn=at;function Ld(e){return(0,qn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,qn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,qn.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,qn.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"}))}Ii.CoinbaseWalletRound=Ld;var xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.QRCodeIcon=void 0;const cn=at;function Pd(e){return(0,cn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,cn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,cn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,cn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,cn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}xi.QRCodeIcon=Pd;var Ai={};function Wc(e){this.mode=ut.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Wc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Lt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Lt.prototype={addData:function(e){var t=new Wc(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Lt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=Ve.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var c=s*i,a=0;a<this.modules[s].length;a++){var f=a*i,g=this.modules[s][a];g&&(n.beginFill(0,100),n.moveTo(f,c),n.lineTo(f+i,c),n.lineTo(f+i,c+i),n.lineTo(f,c+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=Ve.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var c=-2;c<=2;c++)s==-2||s==2||c==-2||c==2||s==0&&c==0?this.modules[n+s][i+c]=!0:this.modules[n+s][i+c]=!1}},setupTypeNumber:function(e){for(var t=Ve.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=Ve.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,c=this.moduleCount-1;c>0;c-=2)for(c==6&&c--;;){for(var a=0;a<2;a++)if(this.modules[n][c-a]==null){var f=!1;s<e.length&&(f=(e[s]>>>i&1)==1);var g=Ve.getMask(t,n,c-a);g&&(f=!f),this.modules[n][c-a]=f,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Lt.PAD0=236;Lt.PAD1=17;Lt.createData=function(e,t,r){for(var n=Nt.getRSBlocks(e,t),i=new Vc,s=0;s<r.length;s++){var c=r[s];i.put(c.mode,4),i.put(c.getLength(),Ve.getLengthInBits(c.mode,e)),c.write(i)}for(var a=0,s=0;s<n.length;s++)a+=n[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(Lt.PAD0,8),i.getLengthInBits()>=a*8));)i.put(Lt.PAD1,8);return Lt.createBytes(i,n)};Lt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),c=new Array(t.length),a=0;a<t.length;a++){var f=t[a].dataCount,g=t[a].totalCount-f;n=Math.max(n,f),i=Math.max(i,g),s[a]=new Array(f);for(var p=0;p<s[a].length;p++)s[a][p]=255&e.buffer[p+r];r+=f;var v=Ve.getErrorCorrectPolynomial(g),E=new Ur(s[a],v.getLength()-1),A=E.mod(v);c[a]=new Array(v.getLength()-1);for(var p=0;p<c[a].length;p++){var U=p+A.getLength()-c[a].length;c[a][p]=U>=0?A.get(U):0}}for(var F=0,p=0;p<t.length;p++)F+=t[p].totalCount;for(var H=new Array(F),x=0,p=0;p<n;p++)for(var a=0;a<t.length;a++)p<s[a].length&&(H[x++]=s[a][p]);for(var p=0;p<i;p++)for(var a=0;a<t.length;a++)p<c[a].length&&(H[x++]=c[a][p]);return H};var ut={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},qt={L:1,M:0,Q:3,H:2},Ht={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Ve={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;Ve.getBCHDigit(t)-Ve.getBCHDigit(Ve.G15)>=0;)t^=Ve.G15<<Ve.getBCHDigit(t)-Ve.getBCHDigit(Ve.G15);return(e<<10|t)^Ve.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Ve.getBCHDigit(t)-Ve.getBCHDigit(Ve.G18)>=0;)t^=Ve.G18<<Ve.getBCHDigit(t)-Ve.getBCHDigit(Ve.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return Ve.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Ht.PATTERN000:return(t+r)%2==0;case Ht.PATTERN001:return t%2==0;case Ht.PATTERN010:return r%3==0;case Ht.PATTERN011:return(t+r)%3==0;case Ht.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Ht.PATTERN101:return t*r%2+t*r%3==0;case Ht.PATTERN110:return(t*r%2+t*r%3)%2==0;case Ht.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Ur([1],0),r=0;r<e;r++)t=t.multiply(new Ur([1,Xe.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ut.MODE_NUMBER:return 10;case ut.MODE_ALPHA_NUM:return 9;case ut.MODE_8BIT_BYTE:return 8;case ut.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ut.MODE_NUMBER:return 12;case ut.MODE_ALPHA_NUM:return 11;case ut.MODE_8BIT_BYTE:return 16;case ut.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ut.MODE_NUMBER:return 14;case ut.MODE_ALPHA_NUM:return 13;case ut.MODE_8BIT_BYTE:return 16;case ut.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,c=e.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var f=-1;f<=1;f++)i+f<0||t<=i+f||a==0&&f==0||c==e.isDark(n+a,i+f)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var g=0;e.isDark(n,i)&&g++,e.isDark(n+1,i)&&g++,e.isDark(n,i+1)&&g++,e.isDark(n+1,i+1)&&g++,(g==0||g==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var p=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&p++;var v=Math.abs(100*p/t/t-50)/5;return r+=v*10,r}},Xe={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Xe.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Xe.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var tt=0;tt<8;tt++)Xe.EXP_TABLE[tt]=1<<tt;for(var tt=8;tt<256;tt++)Xe.EXP_TABLE[tt]=Xe.EXP_TABLE[tt-4]^Xe.EXP_TABLE[tt-5]^Xe.EXP_TABLE[tt-6]^Xe.EXP_TABLE[tt-8];for(var tt=0;tt<255;tt++)Xe.LOG_TABLE[Xe.EXP_TABLE[tt]]=tt;function Ur(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Ur.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Xe.gexp(Xe.glog(this.get(r))+Xe.glog(e.get(n)));return new Ur(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Xe.glog(this.get(0))-Xe.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Xe.gexp(Xe.glog(e.get(n))+t);return new Ur(r,0).mod(e)}};function Nt(e,t){this.totalCount=e,this.dataCount=t}Nt.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]];Nt.getRSBlocks=function(e,t){var r=Nt.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var c=r[s*3+0],a=r[s*3+1],f=r[s*3+2],g=0;g<c;g++)i.push(new Nt(a,f));return i};Nt.getRsBlockTable=function(e,t){switch(t){case qt.L:return Nt.RS_BLOCK_TABLE[(e-1)*4+0];case qt.M:return Nt.RS_BLOCK_TABLE[(e-1)*4+1];case qt.Q:return Nt.RS_BLOCK_TABLE[(e-1)*4+2];case qt.H:return Nt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Vc(){this.buffer=[],this.length=0}Vc.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var ps=[[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 qc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(f){switch(f){case"L":return qt.L;case"M":return qt.M;case"Q":return qt.Q;case"H":return qt.H;default:throw new Error("Unknwon error correction level: "+f)}}function n(f,g){for(var p=i(f),v=1,E=0,A=0,U=ps.length;A<=U;A++){var F=ps[A];if(!F)throw new Error("Content too long: expected "+E+" but got "+p);switch(g){case"L":E=F[0];break;case"M":E=F[1];break;case"Q":E=F[2];break;case"H":E=F[3];break;default:throw new Error("Unknwon error correction level: "+g)}if(p<=E)break;v++}if(v>ps.length)throw new Error("Content too long");return v}function i(f){var g=encodeURI(f).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return g.length+(g.length!=f?3:0)}var s=this.options.content,c=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new Lt(c,a),this.qrcode.addData(s),this.qrcode.make()}qc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r
7
+ `:"",c=t.width,a=t.height,f=r.length,g=c/(f+2*t.padding),p=a/(f+2*t.padding),v=typeof t.join<"u"?!!t.join:!1,E=typeof t.swap<"u"?!!t.swap:!1,A=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,U=typeof t.predefined<"u"?!!t.predefined:!1,F=U?i+'<defs><path id="qrmodule" d="M0 0 h'+p+" v"+g+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",H=i+'<rect x="0" y="0" width="'+c+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,x="",L="",O=0;O<f;O++)for(var V=0;V<f;V++){var D=r[V][O];if(D){var z=V*g+t.padding*g,te=O*p+t.padding*p;if(E){var Y=z;z=te,te=Y}if(v){var Q=g+z,fe=p+te;z=Number.isInteger(z)?Number(z):z.toFixed(2),te=Number.isInteger(te)?Number(te):te.toFixed(2),Q=Number.isInteger(Q)?Number(Q):Q.toFixed(2),fe=Number.isInteger(fe)?Number(fe):fe.toFixed(2),L+="M"+z+","+te+" V"+fe+" H"+Q+" V"+te+" H"+z+" Z "}else U?x+=i+'<use x="'+z.toString()+'" y="'+te.toString()+'" href="#qrmodule" />'+s:x+=i+'<rect x="'+z.toString()+'" y="'+te.toString()+'" width="'+g+'" height="'+p+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}v&&(x=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+L+'" />');let oe="";if(this.options.image!==void 0&&this.options.image.svg){const I=c*this.options.image.width/100,o=a*this.options.image.height/100,d=c/2-I/2,w=a/2-o/2;oe+=`<svg x="${d}" y="${w}" width="${I}" height="${o}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,oe+=this.options.image.svg+s,oe+="</svg>"}var pe="";switch(e.container){case"svg":A&&(pe+='<?xml version="1.0" standalone="yes"?>'+s),pe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+c+'" height="'+a+'">'+s,pe+=F+H+x,pe+=oe,pe+="</svg>";break;case"svg-viewbox":A&&(pe+='<?xml version="1.0" standalone="yes"?>'+s),pe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+c+" "+a+'">'+s,pe+=F+H+x,pe+=oe,pe+="</svg>";break;case"g":pe+='<g width="'+c+'" height="'+a+'">'+s,pe+=F+H+x,pe+=oe,pe+="</g>";break;default:pe+=(F+H+x+oe).replace(/^\s+/,"");break}return pe};var Od=qc,$d=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.QRCode=void 0;const Fd=at,na=Ci,Dd=$d(Od),jd=e=>{const[t,r]=(0,na.useState)("");return(0,na.useEffect)(()=>{var n,i;const s=new Dd.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),c=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${c}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Fd.h)("img",{src:t,alt:"QR Code"}):null};Ai.QRCode=jd;var Ti={},no={};Object.defineProperty(no,"__esModule",{value:!0});no.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)}}";var Ud=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.Spinner=void 0;const zn=at,Hd=Ud(no),Wd=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,zn.h)("div",{class:"-cbwsdk-spinner"},(0,zn.h)("style",null,Hd.default),(0,zn.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,zn.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Ti.Spinner=Wd;var io={};Object.defineProperty(io,"__esModule",{value:!0});io.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}";var zc=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zr,"__esModule",{value:!0});zr.CoinbaseWalletSteps=zr.ConnectContent=void 0;const mr=zc(An),we=at,Vd=X,qd=Xr,zd=ki,Gd=Ii,Jd=xi,Zd=Ai,Kd=Ti,Qd=zc(io),gs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Gc},Yd=e=>e==="light"?"#FFFFFF":"#0A0B0D";function Xd(e){const{theme:t}=e,r=(0,Vd.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=gs.steps;return(0,we.h)("div",{"data-testid":"connect-content",className:(0,mr.default)("-cbwsdk-connect-content",t)},(0,we.h)("style",null,Qd.default),(0,we.h)("div",{className:"-cbwsdk-connect-content-header"},(0,we.h)("h2",{className:(0,mr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,we.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,we.h)(zd.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,we.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,we.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,we.h)(ef,{title:gs.title,description:gs.description,theme:t})),(0,we.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,we.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,we.h)(Zd.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,we.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:qd.LIB_VERSION}),(0,we.h)("input",{type:"hidden",value:r})),(0,we.h)(n,{theme:t}),!e.isConnected&&(0,we.h)("div",{"data-testid":"connecting-spinner",className:(0,mr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,we.h)(Kd.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,we.h)("p",null,"Connecting...")))))}zr.ConnectContent=Xd;function ef({title:e,description:t,theme:r}){return(0,we.h)("div",{className:(0,mr.default)("-cbwsdk-connect-item",r)},(0,we.h)("div",null,(0,we.h)(Gd.CoinbaseWalletRound,null)),(0,we.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,we.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,we.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Gc({theme:e}){return(0,we.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,we.h)("li",{className:(0,mr.default)("-cbwsdk-wallet-steps-item",e)},(0,we.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,we.h)("li",{className:(0,mr.default)("-cbwsdk-wallet-steps-item",e)},(0,we.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,we.h)("span",null,"Tap ",(0,we.h)("strong",null,"Scan")," "),(0,we.h)("span",{className:(0,mr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,we.h)(Jd.QRCodeIcon,{fill:Yd(e)})))))}zr.CoinbaseWalletSteps=Gc;var Bi={},Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});Ni.ArrowLeftIcon=void 0;const ia=at;function tf(e){return(0,ia.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,ia.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"}))}Ni.ArrowLeftIcon=tf;var Li={};Object.defineProperty(Li,"__esModule",{value:!0});Li.LaptopIcon=void 0;const ms=at;function rf(e){return(0,ms.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,ms.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,ms.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"}))}Li.LaptopIcon=rf;var Pi={};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.SafeIcon=void 0;const sa=at;function nf(e){return(0,sa.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,sa.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"}))}Pi.SafeIcon=nf;var so={};Object.defineProperty(so,"__esModule",{value:!0});so.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Jc=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.TryExtensionContent=void 0;const cr=Jc(An),Ge=at,ws=Ci,sf=Ni,of=Li,af=Pi,cf=Jc(so);function lf({theme:e}){const[t,r]=(0,ws.useState)(!1),n=(0,ws.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,ws.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Ge.h)("div",{class:(0,cr.default)("-cbwsdk-try-extension",e)},(0,Ge.h)("style",null,cf.default),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("h3",{class:(0,cr.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ge.h)("button",{class:(0,cr.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Ge.h)("div",null,!t&&(0,Ge.h)(sf.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,cr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(of.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,cr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,cr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(af.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,cr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Bi.TryExtensionContent=lf;var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.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}";var Zc=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.ConnectDialog=void 0;const ys=Zc(An),lr=at,bs=Ci,uf=zr,hf=Bi,df=Zc(oo),ff=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,bs.useState)(!t),[s,c]=(0,bs.useState)(!t);(0,bs.useEffect)(()=>{const f=[window.setTimeout(()=>{c(!t)},10)];return t?i(!1):f.push(window.setTimeout(()=>{i(!0)},360)),()=>{f.forEach(window.clearTimeout)}},[t]);const a=r?"dark":"light";return(0,lr.h)("div",{class:(0,ys.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,lr.h)("style",null,df.default),(0,lr.h)("div",{class:(0,ys.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,lr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,lr.h)("div",{class:(0,ys.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,lr.h)(uf.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,lr.h)(hf.TryExtensionContent,{theme:a}))))};Mi.ConnectDialog=ff;Object.defineProperty(Ri,"__esModule",{value:!0});Ri.LinkFlow=void 0;const vs=at,pf=Mi;class gf{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,vs.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,vs.render)((0,vs.h)(pf.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)}}Ri.LinkFlow=gf;var ao={},co={};Object.defineProperty(co,"__esModule",{value:!0});co.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}";(function(e){var t=ee&&ee.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(An),n=at,i=Ci,s=t(co),c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class f{constructor(E){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=E.darkMode}attach(E){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",E.appendChild(this.root),this.render()}presentItem(E){const A=this.nextItemKey++;return this.items.set(A,E),this.render(),()=>{this.items.delete(A),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([E,A])=>(0,n.h)(e.SnackbarInstance,Object.assign({},A,{key:E}))))),this.root)}}e.Snackbar=f;const g=v=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},v.children));e.SnackbarContainer=g;const p=({autoExpand:v,message:E,menuItems:A})=>{const[U,F]=(0,i.useState)(!0),[H,x]=(0,i.useState)(v??!1);(0,i.useEffect)(()=>{const O=[window.setTimeout(()=>{F(!1)},1),window.setTimeout(()=>{x(!0)},1e4)];return()=>{O.forEach(window.clearTimeout)}});const L=()=>{x(!H)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",U&&"-cbwsdk-snackbar-instance-hidden",H&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:L},(0,n.h)("img",{src:c,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},E),(0,n.h)("div",{class:"-gear-container"},!H&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),A&&A.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},A.map((O,V)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",O.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:O.onClick,key:V},(0,n.h)("svg",{width:O.svgWidth,height:O.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":O.defaultFillRule,"clip-rule":O.defaultClipRule,d:O.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",O.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},O.info)))))};e.SnackbarInstance=p})(ao);Object.defineProperty(In,"__esModule",{value:!0});In.WalletLinkRelayUI=void 0;const mf=xn,wf=Ri,yf=ao;class bf{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new yf.Snackbar({darkMode:t.darkMode}),this.linkFlow=new wf.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,mf.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}In.WalletLinkRelayUI=bf;Object.defineProperty(En,"__esModule",{value:!0});En.WalletLinkRelay=void 0;const Or=wn,vf=Ze,We=X,ur=en,oa=wt,Wt=tn,_f=_i,hr=Yr,Ef=In;class Ft extends oa.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=c=>{var a;this.isLinked=c;const f=this.storage.getItem(oa.LOCAL_STORAGE_ADDRESSES_KEY);if(c&&(this.session.linked=c),this.isUnlinkedErrorState=!1,f){const g=f.split(" "),p=this.storage.getItem("IsStandaloneSigning")==="true";if(g[0]!==""&&!c&&this.session.linked&&!p){this.isUnlinkedErrorState=!0;const v=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(ur.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:v})}}},this.metadataUpdated=(c,a)=>{this.storage.setItem(c,a)},this.chainUpdated=(c,a)=>{this.chainCallbackParams.chainId===c&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:c,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(c,a))},this.accountUpdated=c=>{this.accountsCallback&&this.accountsCallback([c]),Ft.accountRequestCallbackIds.size>0&&(Array.from(Ft.accountRequestCallbackIds.values()).forEach(a=>{const f={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[c]}};this.invokeCallback(Object.assign(Object.assign({},f),{id:a}))}),Ft.accountRequestCallbackIds.clear())},this.connectedUpdated=c=>{this.ui.setConnected(c)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=Wt.Session.load(this.storage)||new Wt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new _f.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:c}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:c,session:t});return i.connect(),{session:t,ui:a,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(ur.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Wt.Session.load(this.storage);if(i?.id===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(ur.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Wt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:c,connection:a}=this.subscribe();this._session=s,this.connection=a,this.ui=c,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(ur.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,We.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,We.hexStringFromBuffer)(t,!0),signature:(0,We.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,We.bigIntStringFromBN)(t.weiValue),data:(0,We.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,We.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,We.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,We.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,We.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,We.bigIntStringFromBN)(t.weiValue),data:(0,We.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,We.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,We.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,We.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,We.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,We.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,We.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,We.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,c),r?.()};return{promise:new Promise((c,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,f=>{if(r?.(),(0,hr.isErrorResponse)(f))return a(new Error(f.errorMessage));c(f)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof Ef.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=Wt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(ur.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Wt.Session.hash(s.id):"",isSessionMismatched:(s?.id!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(c=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(ur.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Wt.Session.hash(s.id):"",isSessionMismatched:(s?.id!==this._session.id).toString()})}).catch(c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:c.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(ur.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Ft.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),Ft.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const c=(s=n?.message)!==null&&s!==void 0?s:(0,Or.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:c,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,We.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,c)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,hr.isErrorResponse)(a))return c(new Error(a.errorMessage));s(a)}),this.ui.inlineAccountsResponse()){const a=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:f}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=Or.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}Ft.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,We.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,c)},s=new Promise((c,a)=>{this.relayEventManager.callbacks.set(n,p=>{if((0,hr.isErrorResponse)(p))return a(new Error(p.errorMessage));c(p)});const f=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:vf.ProviderType.Unselected}})},g=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:p}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:g,onCancel:f,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,c){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:c}};let f=null;const g=(0,We.randomBytesHex)(8),p=E=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,a.method,E),f?.()};this.ui.inlineWatchAsset()||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const v=new Promise((E,A)=>{this.relayEventManager.callbacks.set(g,H=>{if(f?.(),(0,hr.isErrorResponse)(H))return A(new Error(H.errorMessage));E(H)});const U=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!1}})},F=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:F,onCancel:U,type:t,address:r,symbol:n,decimals:i,image:s,chainId:c}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,a)});return{cancel:p,promise:v}}addEthereumChain(t,r,n,i,s,c){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:c}};let f=null;const g=(0,We.randomBytesHex)(8),p=E=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,a.method,E),f?.()};return this.ui.inlineAddEthereumChain(t)||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((E,A)=>{this.relayEventManager.callbacks.set(g,H=>{if(f?.(),(0,hr.isErrorResponse)(H))return A(new Error(H.errorMessage));E(H)});const U=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},F=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:H}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:U,onApprove:F,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,a)}),cancel:p}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,We.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,f)=>{this.relayEventManager.callbacks.set(i,v=>{if((0,hr.isErrorResponse)(v)&&v.errorCode)return f(Or.standardErrors.provider.custom({code:v.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,hr.isErrorResponse)(v))return f(new Error(v.errorMessage));a(v)});const g=v=>{var E;if(v){const A=(E=(0,Or.getErrorCode)(v))!==null&&E!==void 0?E:Or.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",v instanceof Error?v:Or.standardErrors.provider.unsupportedChain(t),A)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=v=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:v}}})};this.ui.switchEthereumChain({onCancel:g,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return Wt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}En.WalletLinkRelay=Ft;Ft.accountRequestCallbackIds=new Set;var Tn={},Oi={},Kc={};(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,a)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(ao,e)})(Kc);var lo={};Object.defineProperty(lo,"__esModule",{value:!0});lo.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Qc=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.RedirectDialog=void 0;const Sf=Qc(An),Tt=at,Rf=xn,Mf=Kc,Cf=Qc(lo);class kf{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,Rf.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Tt.render)(null,this.root),t&&(0,Tt.render)((0,Tt.h)(If,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}Oi.RedirectDialog=kf;const If=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,Tt.h)(Mf.SnackbarContainer,{darkMode:r},(0,Tt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Tt.h)("style",null,Cf.default),(0,Tt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Tt.h)("div",{class:(0,Sf.default)("-cbwsdk-redirect-dialog-box",s)},(0,Tt.h)("p",null,e),(0,Tt.h)("button",{onClick:n},t))))};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.MobileRelayUI=void 0;const xf=Oi;class Af{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new xf.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}Tn.MobileRelayUI=Af;Object.defineProperty(_n,"__esModule",{value:!0});_n.MobileRelay=void 0;const Tf=X,Bf=En,Nf=Tn;class Lf extends Bf.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,Tf.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof Nf.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}_n.MobileRelay=Lf;var Gs={exports:{}},Yc=wr.EventEmitter,_s,aa;function Pf(){if(aa)return _s;aa=1;function e(U,F){var H=Object.keys(U);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(U);F&&(x=x.filter(function(L){return Object.getOwnPropertyDescriptor(U,L).enumerable})),H.push.apply(H,x)}return H}function t(U){for(var F=1;F<arguments.length;F++){var H=arguments[F]!=null?arguments[F]:{};F%2?e(Object(H),!0).forEach(function(x){r(U,x,H[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(U,Object.getOwnPropertyDescriptors(H)):e(Object(H)).forEach(function(x){Object.defineProperty(U,x,Object.getOwnPropertyDescriptor(H,x))})}return U}function r(U,F,H){return F=c(F),F in U?Object.defineProperty(U,F,{value:H,enumerable:!0,configurable:!0,writable:!0}):U[F]=H,U}function n(U,F){if(!(U instanceof F))throw new TypeError("Cannot call a class as a function")}function i(U,F){for(var H=0;H<F.length;H++){var x=F[H];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(U,c(x.key),x)}}function s(U,F,H){return F&&i(U.prototype,F),Object.defineProperty(U,"prototype",{writable:!1}),U}function c(U){var F=a(U,"string");return typeof F=="symbol"?F:String(F)}function a(U,F){if(typeof U!="object"||U===null)return U;var H=U[Symbol.toPrimitive];if(H!==void 0){var x=H.call(U,F||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(U)}var f=Sn,g=f.Buffer,p=wr,v=p.inspect,E=v&&v.custom||"inspect";function A(U,F,H){g.prototype.copy.call(U,F,H)}return _s=function(){function U(){n(this,U),this.head=null,this.tail=null,this.length=0}return s(U,[{key:"push",value:function(H){var x={data:H,next:null};this.length>0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(H){var x={data:H,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var H=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,H}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(H){if(this.length===0)return"";for(var x=this.head,L=""+x.data;x=x.next;)L+=H+x.data;return L}},{key:"concat",value:function(H){if(this.length===0)return g.alloc(0);for(var x=g.allocUnsafe(H>>>0),L=this.head,O=0;L;)A(L.data,x,O),O+=L.data.length,L=L.next;return x}},{key:"consume",value:function(H,x){var L;return H<this.head.data.length?(L=this.head.data.slice(0,H),this.head.data=this.head.data.slice(H)):H===this.head.data.length?L=this.shift():L=x?this._getString(H):this._getBuffer(H),L}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(H){var x=this.head,L=1,O=x.data;for(H-=O.length;x=x.next;){var V=x.data,D=H>V.length?V.length:H;if(D===V.length?O+=V:O+=V.slice(0,H),H-=D,H===0){D===V.length?(++L,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=V.slice(D));break}++L}return this.length-=L,O}},{key:"_getBuffer",value:function(H){var x=g.allocUnsafe(H),L=this.head,O=1;for(L.data.copy(x),H-=L.data.length;L=L.next;){var V=L.data,D=H>V.length?V.length:H;if(V.copy(x,x.length-H,0,D),H-=D,H===0){D===V.length?(++O,L.next?this.head=L.next:this.head=this.tail=null):(this.head=L,L.data=V.slice(D));break}++O}return this.length-=O,x}},{key:E,value:function(H,x){return v(this,t(t({},x),{},{depth:0,customInspect:!1}))}}]),U}(),_s}function Of(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Js,this,e)):process.nextTick(Js,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(ii,r):(r._writableState.errorEmitted=!0,process.nextTick(ca,r,s)):process.nextTick(ca,r,s):t?(process.nextTick(ii,r),t(s)):process.nextTick(ii,r)}),this)}function ca(e,t){Js(e,t),ii(e)}function ii(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function $f(){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 Js(e,t){e.emit("error",t)}function Ff(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Xc={destroy:Of,undestroy:$f,errorOrDestroy:Ff},_r={};function Df(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var el={};function vt(e,t,r){r||(r=Error);function n(s,c,a){return typeof t=="string"?t:t(s,c,a)}var i=function(s){Df(c,s);function c(a,f,g){return s.call(this,n(a,f,g))||this}return c}(r);i.prototype.name=r.name,i.prototype.code=e,el[e]=i}function la(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function jf(e,t,r){return e.substr(0,t.length)===t}function Uf(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Hf(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}vt("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);vt("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&jf(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(Uf(e," argument"))i="The ".concat(e," ").concat(n," ").concat(la(t,"type"));else{var s=Hf(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(la(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);vt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");vt("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});vt("ERR_STREAM_PREMATURE_CLOSE","Premature close");vt("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});vt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");vt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");vt("ERR_STREAM_WRITE_AFTER_END","write after end");vt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);vt("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);vt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");_r.codes=el;var Wf=_r.codes.ERR_INVALID_OPT_VALUE;function Vf(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function qf(e,t,r,n){var i=Vf(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Wf(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var tl={getHighWaterMark:qf},zf=Gf;function Gf(e,t){if(Es("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Es("throwDeprecation"))throw new Error(t);Es("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Es(e){try{if(!ee.localStorage)return!1}catch{return!1}var t=ee.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Ss,ua;function rl(){if(ua)return Ss;ua=1,Ss=Y;function e(T){var P=this;this.next=null,this.entry=null,this.finish=function(){J(P,T)}}var t;Y.WritableState=z;var r={deprecate:zf},n=Yc,i=Sn.Buffer,s=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(T){return i.from(T)}function a(T){return i.isBuffer(T)||T instanceof s}var f=Xc,g=tl,p=g.getHighWaterMark,v=_r.codes,E=v.ERR_INVALID_ARG_TYPE,A=v.ERR_METHOD_NOT_IMPLEMENTED,U=v.ERR_MULTIPLE_CALLBACK,F=v.ERR_STREAM_CANNOT_PIPE,H=v.ERR_STREAM_DESTROYED,x=v.ERR_STREAM_NULL_VALUES,L=v.ERR_STREAM_WRITE_AFTER_END,O=v.ERR_UNKNOWN_ENCODING,V=f.errorOrDestroy;Rt(Y,n);function D(){}function z(T,P,W){t=t||Gr(),T=T||{},typeof W!="boolean"&&(W=P instanceof t),this.objectMode=!!T.objectMode,W&&(this.objectMode=this.objectMode||!!T.writableObjectMode),this.highWaterMark=p(this,T,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Z=T.decodeStrings===!1;this.decodeStrings=!Z,this.defaultEncoding=T.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(le){w(P,le)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=T.emitClose!==!1,this.autoDestroy=!!T.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}z.prototype.getBuffer=function(){for(var P=this.bufferedRequest,W=[];P;)W.push(P),P=P.next;return W},function(){try{Object.defineProperty(z.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var te;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(te=Function.prototype[Symbol.hasInstance],Object.defineProperty(Y,Symbol.hasInstance,{value:function(P){return te.call(this,P)?!0:this!==Y?!1:P&&P._writableState instanceof z}})):te=function(P){return P instanceof this};function Y(T){t=t||Gr();var P=this instanceof t;if(!P&&!te.call(Y,this))return new Y(T);this._writableState=new z(T,this,P),this.writable=!0,T&&(typeof T.write=="function"&&(this._write=T.write),typeof T.writev=="function"&&(this._writev=T.writev),typeof T.destroy=="function"&&(this._destroy=T.destroy),typeof T.final=="function"&&(this._final=T.final)),n.call(this)}Y.prototype.pipe=function(){V(this,new F)};function Q(T,P){var W=new L;V(T,W),process.nextTick(P,W)}function fe(T,P,W,Z){var le;return W===null?le=new x:typeof W!="string"&&!P.objectMode&&(le=new E("chunk",["string","Buffer"],W)),le?(V(T,le),process.nextTick(Z,le),!1):!0}Y.prototype.write=function(T,P,W){var Z=this._writableState,le=!1,M=!Z.objectMode&&a(T);return M&&!i.isBuffer(T)&&(T=c(T)),typeof P=="function"&&(W=P,P=null),M?P="buffer":P||(P=Z.defaultEncoding),typeof W!="function"&&(W=D),Z.ending?Q(this,W):(M||fe(this,Z,T,W))&&(Z.pendingcb++,le=pe(this,Z,M,T,P,W)),le},Y.prototype.cork=function(){this._writableState.corked++},Y.prototype.uncork=function(){var T=this._writableState;T.corked&&(T.corked--,!T.writing&&!T.corked&&!T.bufferProcessing&&T.bufferedRequest&&k(this,T))},Y.prototype.setDefaultEncoding=function(P){if(typeof P=="string"&&(P=P.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((P+"").toLowerCase())>-1))throw new O(P);return this._writableState.defaultEncoding=P,this},Object.defineProperty(Y.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oe(T,P,W){return!T.objectMode&&T.decodeStrings!==!1&&typeof P=="string"&&(P=i.from(P,W)),P}Object.defineProperty(Y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pe(T,P,W,Z,le,M){if(!W){var C=oe(P,Z,le);Z!==C&&(W=!0,le="buffer",Z=C)}var q=P.objectMode?1:Z.length;P.length+=q;var G=P.length<P.highWaterMark;if(G||(P.needDrain=!0),P.writing||P.corked){var se=P.lastBufferedRequest;P.lastBufferedRequest={chunk:Z,encoding:le,isBuf:W,callback:M,next:null},se?se.next=P.lastBufferedRequest:P.bufferedRequest=P.lastBufferedRequest,P.bufferedRequestCount+=1}else I(T,P,!1,q,Z,le,M);return G}function I(T,P,W,Z,le,M,C){P.writelen=Z,P.writecb=C,P.writing=!0,P.sync=!0,P.destroyed?P.onwrite(new H("write")):W?T._writev(le,P.onwrite):T._write(le,M,P.onwrite),P.sync=!1}function o(T,P,W,Z,le){--P.pendingcb,W?(process.nextTick(le,Z),process.nextTick(R,T,P),T._writableState.errorEmitted=!0,V(T,Z)):(le(Z),T._writableState.errorEmitted=!0,V(T,Z),R(T,P))}function d(T){T.writing=!1,T.writecb=null,T.length-=T.writelen,T.writelen=0}function w(T,P){var W=T._writableState,Z=W.sync,le=W.writecb;if(typeof le!="function")throw new U;if(d(W),P)o(T,W,Z,P,le);else{var M=B(W)||T.destroyed;!M&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&k(T,W),Z?process.nextTick(y,T,W,M,le):y(T,W,M,le)}}function y(T,P,W,Z){W||S(T,P),P.pendingcb--,Z(),R(T,P)}function S(T,P){P.length===0&&P.needDrain&&(P.needDrain=!1,T.emit("drain"))}function k(T,P){P.bufferProcessing=!0;var W=P.bufferedRequest;if(T._writev&&W&&W.next){var Z=P.bufferedRequestCount,le=new Array(Z),M=P.corkedRequestsFree;M.entry=W;for(var C=0,q=!0;W;)le[C]=W,W.isBuf||(q=!1),W=W.next,C+=1;le.allBuffers=q,I(T,P,!0,P.length,le,"",M.finish),P.pendingcb++,P.lastBufferedRequest=null,M.next?(P.corkedRequestsFree=M.next,M.next=null):P.corkedRequestsFree=new e(P),P.bufferedRequestCount=0}else{for(;W;){var G=W.chunk,se=W.encoding,ue=W.callback,re=P.objectMode?1:G.length;if(I(T,P,!1,re,G,se,ue),W=W.next,P.bufferedRequestCount--,P.writing)break}W===null&&(P.lastBufferedRequest=null)}P.bufferedRequest=W,P.bufferProcessing=!1}Y.prototype._write=function(T,P,W){W(new A("_write()"))},Y.prototype._writev=null,Y.prototype.end=function(T,P,W){var Z=this._writableState;return typeof T=="function"?(W=T,T=null,P=null):typeof P=="function"&&(W=P,P=null),T!=null&&this.write(T,P),Z.corked&&(Z.corked=1,this.uncork()),Z.ending||K(this,Z,W),this},Object.defineProperty(Y.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function B(T){return T.ending&&T.length===0&&T.bufferedRequest===null&&!T.finished&&!T.writing}function b(T,P){T._final(function(W){P.pendingcb--,W&&V(T,W),P.prefinished=!0,T.emit("prefinish"),R(T,P)})}function u(T,P){!P.prefinished&&!P.finalCalled&&(typeof T._final=="function"&&!P.destroyed?(P.pendingcb++,P.finalCalled=!0,process.nextTick(b,T,P)):(P.prefinished=!0,T.emit("prefinish")))}function R(T,P){var W=B(P);if(W&&(u(T,P),P.pendingcb===0&&(P.finished=!0,T.emit("finish"),P.autoDestroy))){var Z=T._readableState;(!Z||Z.autoDestroy&&Z.endEmitted)&&T.destroy()}return W}function K(T,P,W){P.ending=!0,R(T,P),W&&(P.finished?process.nextTick(W):T.once("finish",W)),P.ended=!0,T.writable=!1}function J(T,P,W){var Z=T.entry;for(T.entry=null;Z;){var le=Z.callback;P.pendingcb--,le(W),Z=Z.next}P.corkedRequestsFree.next=T}return Object.defineProperty(Y.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(P){this._writableState&&(this._writableState.destroyed=P)}}),Y.prototype.destroy=f.destroy,Y.prototype._undestroy=f.undestroy,Y.prototype._destroy=function(T,P){P(T)},Ss}var Rs,ha;function Gr(){if(ha)return Rs;ha=1;var e=Object.keys||function(g){var p=[];for(var v in g)p.push(v);return p};Rs=c;var t=il(),r=rl();Rt(c,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];c.prototype[s]||(c.prototype[s]=r.prototype[s])}function c(g){if(!(this instanceof c))return new c(g);t.call(this,g),r.call(this,g),this.allowHalfOpen=!0,g&&(g.readable===!1&&(this.readable=!1),g.writable===!1&&(this.writable=!1),g.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(f,this)}function f(g){g.end()}return Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(p){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=p,this._writableState.destroyed=p)}}),Rs}var Ms={},da;function fa(){if(da)return Ms;da=1;var e=Ut.Buffer,t=e.isEncoding||function(x){switch(x=""+x,x&&x.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(x){if(!x)return"utf8";for(var L;;)switch(x){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return x;default:if(L)return;x=(""+x).toLowerCase(),L=!0}}function n(x){var L=r(x);if(typeof L!="string"&&(e.isEncoding===t||!t(x)))throw new Error("Unknown encoding: "+x);return L||x}Ms.StringDecoder=i;function i(x){this.encoding=n(x);var L;switch(this.encoding){case"utf16le":this.text=v,this.end=E,L=4;break;case"utf8":this.fillLast=f,L=4;break;case"base64":this.text=A,this.end=U,L=3;break;default:this.write=F,this.end=H;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(L)}i.prototype.write=function(x){if(x.length===0)return"";var L,O;if(this.lastNeed){if(L=this.fillLast(x),L===void 0)return"";O=this.lastNeed,this.lastNeed=0}else O=0;return O<x.length?L?L+this.text(x,O):this.text(x,O):L||""},i.prototype.end=p,i.prototype.text=g,i.prototype.fillLast=function(x){if(this.lastNeed<=x.length)return x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,x.length),this.lastNeed-=x.length};function s(x){return x<=127?0:x>>5===6?2:x>>4===14?3:x>>3===30?4:x>>6===2?-1:-2}function c(x,L,O){var V=L.length-1;if(V<O)return 0;var D=s(L[V]);return D>=0?(D>0&&(x.lastNeed=D-1),D):--V<O||D===-2?0:(D=s(L[V]),D>=0?(D>0&&(x.lastNeed=D-2),D):--V<O||D===-2?0:(D=s(L[V]),D>=0?(D>0&&(D===2?D=0:x.lastNeed=D-3),D):0))}function a(x,L,O){if((L[0]&192)!==128)return x.lastNeed=0,"�";if(x.lastNeed>1&&L.length>1){if((L[1]&192)!==128)return x.lastNeed=1,"�";if(x.lastNeed>2&&L.length>2&&(L[2]&192)!==128)return x.lastNeed=2,"�"}}function f(x){var L=this.lastTotal-this.lastNeed,O=a(this,x);if(O!==void 0)return O;if(this.lastNeed<=x.length)return x.copy(this.lastChar,L,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,L,0,x.length),this.lastNeed-=x.length}function g(x,L){var O=c(this,x,L);if(!this.lastNeed)return x.toString("utf8",L);this.lastTotal=O;var V=x.length-(O-this.lastNeed);return x.copy(this.lastChar,0,V),x.toString("utf8",L,V)}function p(x){var L=x&&x.length?this.write(x):"";return this.lastNeed?L+"�":L}function v(x,L){if((x.length-L)%2===0){var O=x.toString("utf16le",L);if(O){var V=O.charCodeAt(O.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1],O.slice(0,-1)}return O}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=x[x.length-1],x.toString("utf16le",L,x.length-1)}function E(x){var L=x&&x.length?this.write(x):"";if(this.lastNeed){var O=this.lastTotal-this.lastNeed;return L+this.lastChar.toString("utf16le",0,O)}return L}function A(x,L){var O=(x.length-L)%3;return O===0?x.toString("base64",L):(this.lastNeed=3-O,this.lastTotal=3,O===1?this.lastChar[0]=x[x.length-1]:(this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1]),x.toString("base64",L,x.length-O))}function U(x){var L=x&&x.length?this.write(x):"";return this.lastNeed?L+this.lastChar.toString("base64",0,3-this.lastNeed):L}function F(x){return x.toString(this.encoding)}function H(x){return x&&x.length?this.write(x):""}return Ms}var pa=_r.codes.ERR_STREAM_PREMATURE_CLOSE;function Jf(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function Zf(){}function Kf(e){return e.setHeader&&typeof e.abort=="function"}function nl(e,t,r){if(typeof t=="function")return nl(e,null,t);t||(t={}),r=Jf(r||Zf);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||a()},c=e._writableState&&e._writableState.finished,a=function(){i=!1,c=!0,n||r.call(e)},f=e._readableState&&e._readableState.endEmitted,g=function(){n=!1,f=!0,i||r.call(e)},p=function(U){r.call(e,U)},v=function(){var U;if(n&&!f)return(!e._readableState||!e._readableState.ended)&&(U=new pa),r.call(e,U);if(i&&!c)return(!e._writableState||!e._writableState.ended)&&(U=new pa),r.call(e,U)},E=function(){e.req.on("finish",a)};return Kf(e)?(e.on("complete",a),e.on("abort",v),e.req?E():e.on("request",E)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",g),e.on("finish",a),t.error!==!1&&e.on("error",p),e.on("close",v),function(){e.removeListener("complete",a),e.removeListener("abort",v),e.removeListener("request",E),e.req&&e.req.removeListener("finish",a),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",a),e.removeListener("end",g),e.removeListener("error",p),e.removeListener("close",v)}}var uo=nl,Cs,ga;function Qf(){if(ga)return Cs;ga=1;var e;function t(O,V,D){return V=r(V),V in O?Object.defineProperty(O,V,{value:D,enumerable:!0,configurable:!0,writable:!0}):O[V]=D,O}function r(O){var V=n(O,"string");return typeof V=="symbol"?V:String(V)}function n(O,V){if(typeof O!="object"||O===null)return O;var D=O[Symbol.toPrimitive];if(D!==void 0){var z=D.call(O,V||"default");if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(V==="string"?String:Number)(O)}var i=uo,s=Symbol("lastResolve"),c=Symbol("lastReject"),a=Symbol("error"),f=Symbol("ended"),g=Symbol("lastPromise"),p=Symbol("handlePromise"),v=Symbol("stream");function E(O,V){return{value:O,done:V}}function A(O){var V=O[s];if(V!==null){var D=O[v].read();D!==null&&(O[g]=null,O[s]=null,O[c]=null,V(E(D,!1)))}}function U(O){process.nextTick(A,O)}function F(O,V){return function(D,z){O.then(function(){if(V[f]){D(E(void 0,!0));return}V[p](D,z)},z)}}var H=Object.getPrototypeOf(function(){}),x=Object.setPrototypeOf((e={get stream(){return this[v]},next:function(){var V=this,D=this[a];if(D!==null)return Promise.reject(D);if(this[f])return Promise.resolve(E(void 0,!0));if(this[v].destroyed)return new Promise(function(Q,fe){process.nextTick(function(){V[a]?fe(V[a]):Q(E(void 0,!0))})});var z=this[g],te;if(z)te=new Promise(F(z,this));else{var Y=this[v].read();if(Y!==null)return Promise.resolve(E(Y,!1));te=new Promise(this[p])}return this[g]=te,te}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var V=this;return new Promise(function(D,z){V[v].destroy(null,function(te){if(te){z(te);return}D(E(void 0,!0))})})}),e),H),L=function(V){var D,z=Object.create(x,(D={},t(D,v,{value:V,writable:!0}),t(D,s,{value:null,writable:!0}),t(D,c,{value:null,writable:!0}),t(D,a,{value:null,writable:!0}),t(D,f,{value:V._readableState.endEmitted,writable:!0}),t(D,p,{value:function(Y,Q){var fe=z[v].read();fe?(z[g]=null,z[s]=null,z[c]=null,Y(E(fe,!1))):(z[s]=Y,z[c]=Q)},writable:!0}),D));return z[g]=null,i(V,function(te){if(te&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Y=z[c];Y!==null&&(z[g]=null,z[s]=null,z[c]=null,Y(te)),z[a]=te;return}var Q=z[s];Q!==null&&(z[g]=null,z[s]=null,z[c]=null,Q(E(void 0,!0))),z[f]=!0}),V.on("readable",U.bind(null,z)),z};return Cs=L,Cs}var ks,ma;function Yf(){return ma||(ma=1,ks=function(){throw new Error("Readable.from is not available in the browser")}),ks}var Is,wa;function il(){if(wa)return Is;wa=1,Is=Q;var e;Q.ReadableState=Y,wr.EventEmitter;var t=function(C,q){return C.listeners(q).length},r=Yc,n=Sn.Buffer,i=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(M){return n.from(M)}function c(M){return n.isBuffer(M)||M instanceof i}var a=wr,f;a&&a.debuglog?f=a.debuglog("stream"):f=function(){};var g=Pf(),p=Xc,v=tl,E=v.getHighWaterMark,A=_r.codes,U=A.ERR_INVALID_ARG_TYPE,F=A.ERR_STREAM_PUSH_AFTER_EOF,H=A.ERR_METHOD_NOT_IMPLEMENTED,x=A.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,L,O,V;Rt(Q,r);var D=p.errorOrDestroy,z=["error","close","destroy","pause","resume"];function te(M,C,q){if(typeof M.prependListener=="function")return M.prependListener(C,q);!M._events||!M._events[C]?M.on(C,q):Array.isArray(M._events[C])?M._events[C].unshift(q):M._events[C]=[q,M._events[C]]}function Y(M,C,q){e=e||Gr(),M=M||{},typeof q!="boolean"&&(q=C instanceof e),this.objectMode=!!M.objectMode,q&&(this.objectMode=this.objectMode||!!M.readableObjectMode),this.highWaterMark=E(this,M,"readableHighWaterMark",q),this.buffer=new g,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=M.emitClose!==!1,this.autoDestroy=!!M.autoDestroy,this.destroyed=!1,this.defaultEncoding=M.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,M.encoding&&(L||(L=fa().StringDecoder),this.decoder=new L(M.encoding),this.encoding=M.encoding)}function Q(M){if(e=e||Gr(),!(this instanceof Q))return new Q(M);var C=this instanceof e;this._readableState=new Y(M,this,C),this.readable=!0,M&&(typeof M.read=="function"&&(this._read=M.read),typeof M.destroy=="function"&&(this._destroy=M.destroy)),r.call(this)}Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(C){this._readableState&&(this._readableState.destroyed=C)}}),Q.prototype.destroy=p.destroy,Q.prototype._undestroy=p.undestroy,Q.prototype._destroy=function(M,C){C(M)},Q.prototype.push=function(M,C){var q=this._readableState,G;return q.objectMode?G=!0:typeof M=="string"&&(C=C||q.defaultEncoding,C!==q.encoding&&(M=n.from(M,C),C=""),G=!0),fe(this,M,C,!1,G)},Q.prototype.unshift=function(M){return fe(this,M,null,!0,!1)};function fe(M,C,q,G,se){f("readableAddChunk",C);var ue=M._readableState;if(C===null)ue.reading=!1,w(M,ue);else{var re;if(se||(re=pe(ue,C)),re)D(M,re);else if(ue.objectMode||C&&C.length>0)if(typeof C!="string"&&!ue.objectMode&&Object.getPrototypeOf(C)!==n.prototype&&(C=s(C)),G)ue.endEmitted?D(M,new x):oe(M,ue,C,!0);else if(ue.ended)D(M,new F);else{if(ue.destroyed)return!1;ue.reading=!1,ue.decoder&&!q?(C=ue.decoder.write(C),ue.objectMode||C.length!==0?oe(M,ue,C,!1):k(M,ue)):oe(M,ue,C,!1)}else G||(ue.reading=!1,k(M,ue))}return!ue.ended&&(ue.length<ue.highWaterMark||ue.length===0)}function oe(M,C,q,G){C.flowing&&C.length===0&&!C.sync?(C.awaitDrain=0,M.emit("data",q)):(C.length+=C.objectMode?1:q.length,G?C.buffer.unshift(q):C.buffer.push(q),C.needReadable&&y(M)),k(M,C)}function pe(M,C){var q;return!c(C)&&typeof C!="string"&&C!==void 0&&!M.objectMode&&(q=new U("chunk",["string","Buffer","Uint8Array"],C)),q}Q.prototype.isPaused=function(){return this._readableState.flowing===!1},Q.prototype.setEncoding=function(M){L||(L=fa().StringDecoder);var C=new L(M);this._readableState.decoder=C,this._readableState.encoding=this._readableState.decoder.encoding;for(var q=this._readableState.buffer.head,G="";q!==null;)G+=C.write(q.data),q=q.next;return this._readableState.buffer.clear(),G!==""&&this._readableState.buffer.push(G),this._readableState.length=G.length,this};var I=1073741824;function o(M){return M>=I?M=I:(M--,M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M++),M}function d(M,C){return M<=0||C.length===0&&C.ended?0:C.objectMode?1:M!==M?C.flowing&&C.length?C.buffer.head.data.length:C.length:(M>C.highWaterMark&&(C.highWaterMark=o(M)),M<=C.length?M:C.ended?C.length:(C.needReadable=!0,0))}Q.prototype.read=function(M){f("read",M),M=parseInt(M,10);var C=this._readableState,q=M;if(M!==0&&(C.emittedReadable=!1),M===0&&C.needReadable&&((C.highWaterMark!==0?C.length>=C.highWaterMark:C.length>0)||C.ended))return f("read: emitReadable",C.length,C.ended),C.length===0&&C.ended?W(this):y(this),null;if(M=d(M,C),M===0&&C.ended)return C.length===0&&W(this),null;var G=C.needReadable;f("need readable",G),(C.length===0||C.length-M<C.highWaterMark)&&(G=!0,f("length less than watermark",G)),C.ended||C.reading?(G=!1,f("reading or ended",G)):G&&(f("do read"),C.reading=!0,C.sync=!0,C.length===0&&(C.needReadable=!0),this._read(C.highWaterMark),C.sync=!1,C.reading||(M=d(q,C)));var se;return M>0?se=P(M,C):se=null,se===null?(C.needReadable=C.length<=C.highWaterMark,M=0):(C.length-=M,C.awaitDrain=0),C.length===0&&(C.ended||(C.needReadable=!0),q!==M&&C.ended&&W(this)),se!==null&&this.emit("data",se),se};function w(M,C){if(f("onEofChunk"),!C.ended){if(C.decoder){var q=C.decoder.end();q&&q.length&&(C.buffer.push(q),C.length+=C.objectMode?1:q.length)}C.ended=!0,C.sync?y(M):(C.needReadable=!1,C.emittedReadable||(C.emittedReadable=!0,S(M)))}}function y(M){var C=M._readableState;f("emitReadable",C.needReadable,C.emittedReadable),C.needReadable=!1,C.emittedReadable||(f("emitReadable",C.flowing),C.emittedReadable=!0,process.nextTick(S,M))}function S(M){var C=M._readableState;f("emitReadable_",C.destroyed,C.length,C.ended),!C.destroyed&&(C.length||C.ended)&&(M.emit("readable"),C.emittedReadable=!1),C.needReadable=!C.flowing&&!C.ended&&C.length<=C.highWaterMark,T(M)}function k(M,C){C.readingMore||(C.readingMore=!0,process.nextTick(B,M,C))}function B(M,C){for(;!C.reading&&!C.ended&&(C.length<C.highWaterMark||C.flowing&&C.length===0);){var q=C.length;if(f("maybeReadMore read 0"),M.read(0),q===C.length)break}C.readingMore=!1}Q.prototype._read=function(M){D(this,new H("_read()"))},Q.prototype.pipe=function(M,C){var q=this,G=this._readableState;switch(G.pipesCount){case 0:G.pipes=M;break;case 1:G.pipes=[G.pipes,M];break;default:G.pipes.push(M);break}G.pipesCount+=1,f("pipe count=%d opts=%j",G.pipesCount,C);var se=(!C||C.end!==!1)&&M!==process.stdout&&M!==process.stderr,ue=se?be:_e;G.endEmitted?process.nextTick(ue):q.once("end",ue),M.on("unpipe",re);function re(m,l){f("onunpipe"),m===q&&l&&l.hasUnpiped===!1&&(l.hasUnpiped=!0,Ee())}function be(){f("onend"),M.end()}var dt=b(q);M.on("drain",dt);var Se=!1;function Ee(){f("cleanup"),M.removeListener("close",Re),M.removeListener("finish",Qe),M.removeListener("drain",dt),M.removeListener("error",ve),M.removeListener("unpipe",re),q.removeListener("end",be),q.removeListener("end",_e),q.removeListener("data",Je),Se=!0,G.awaitDrain&&(!M._writableState||M._writableState.needDrain)&&dt()}q.on("data",Je);function Je(m){f("ondata");var l=M.write(m);f("dest.write",l),l===!1&&((G.pipesCount===1&&G.pipes===M||G.pipesCount>1&&le(G.pipes,M)!==-1)&&!Se&&(f("false write response, pause",G.awaitDrain),G.awaitDrain++),q.pause())}function ve(m){f("onerror",m),_e(),M.removeListener("error",ve),t(M,"error")===0&&D(M,m)}te(M,"error",ve);function Re(){M.removeListener("finish",Qe),_e()}M.once("close",Re);function Qe(){f("onfinish"),M.removeListener("close",Re),_e()}M.once("finish",Qe);function _e(){f("unpipe"),q.unpipe(M)}return M.emit("pipe",q),G.flowing||(f("pipe resume"),q.resume()),M};function b(M){return function(){var q=M._readableState;f("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&t(M,"data")&&(q.flowing=!0,T(M))}}Q.prototype.unpipe=function(M){var C=this._readableState,q={hasUnpiped:!1};if(C.pipesCount===0)return this;if(C.pipesCount===1)return M&&M!==C.pipes?this:(M||(M=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,M&&M.emit("unpipe",this,q),this);if(!M){var G=C.pipes,se=C.pipesCount;C.pipes=null,C.pipesCount=0,C.flowing=!1;for(var ue=0;ue<se;ue++)G[ue].emit("unpipe",this,{hasUnpiped:!1});return this}var re=le(C.pipes,M);return re===-1?this:(C.pipes.splice(re,1),C.pipesCount-=1,C.pipesCount===1&&(C.pipes=C.pipes[0]),M.emit("unpipe",this,q),this)},Q.prototype.on=function(M,C){var q=r.prototype.on.call(this,M,C),G=this._readableState;return M==="data"?(G.readableListening=this.listenerCount("readable")>0,G.flowing!==!1&&this.resume()):M==="readable"&&!G.endEmitted&&!G.readableListening&&(G.readableListening=G.needReadable=!0,G.flowing=!1,G.emittedReadable=!1,f("on readable",G.length,G.reading),G.length?y(this):G.reading||process.nextTick(R,this)),q},Q.prototype.addListener=Q.prototype.on,Q.prototype.removeListener=function(M,C){var q=r.prototype.removeListener.call(this,M,C);return M==="readable"&&process.nextTick(u,this),q},Q.prototype.removeAllListeners=function(M){var C=r.prototype.removeAllListeners.apply(this,arguments);return(M==="readable"||M===void 0)&&process.nextTick(u,this),C};function u(M){var C=M._readableState;C.readableListening=M.listenerCount("readable")>0,C.resumeScheduled&&!C.paused?C.flowing=!0:M.listenerCount("data")>0&&M.resume()}function R(M){f("readable nexttick read 0"),M.read(0)}Q.prototype.resume=function(){var M=this._readableState;return M.flowing||(f("resume"),M.flowing=!M.readableListening,K(this,M)),M.paused=!1,this};function K(M,C){C.resumeScheduled||(C.resumeScheduled=!0,process.nextTick(J,M,C))}function J(M,C){f("resume",C.reading),C.reading||M.read(0),C.resumeScheduled=!1,M.emit("resume"),T(M),C.flowing&&!C.reading&&M.read(0)}Q.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function T(M){var C=M._readableState;for(f("flow",C.flowing);C.flowing&&M.read()!==null;);}Q.prototype.wrap=function(M){var C=this,q=this._readableState,G=!1;M.on("end",function(){if(f("wrapped end"),q.decoder&&!q.ended){var re=q.decoder.end();re&&re.length&&C.push(re)}C.push(null)}),M.on("data",function(re){if(f("wrapped data"),q.decoder&&(re=q.decoder.write(re)),!(q.objectMode&&re==null)&&!(!q.objectMode&&(!re||!re.length))){var be=C.push(re);be||(G=!0,M.pause())}});for(var se in M)this[se]===void 0&&typeof M[se]=="function"&&(this[se]=function(be){return function(){return M[be].apply(M,arguments)}}(se));for(var ue=0;ue<z.length;ue++)M.on(z[ue],this.emit.bind(this,z[ue]));return this._read=function(re){f("wrapped _read",re),G&&(G=!1,M.resume())},this},typeof Symbol=="function"&&(Q.prototype[Symbol.asyncIterator]=function(){return O===void 0&&(O=Qf()),O(this)}),Object.defineProperty(Q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Q.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Q.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(C){this._readableState&&(this._readableState.flowing=C)}}),Q._fromList=P,Object.defineProperty(Q.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function P(M,C){if(C.length===0)return null;var q;return C.objectMode?q=C.buffer.shift():!M||M>=C.length?(C.decoder?q=C.buffer.join(""):C.buffer.length===1?q=C.buffer.first():q=C.buffer.concat(C.length),C.buffer.clear()):q=C.buffer.consume(M,C.decoder),q}function W(M){var C=M._readableState;f("endReadable",C.endEmitted),C.endEmitted||(C.ended=!0,process.nextTick(Z,C,M))}function Z(M,C){if(f("endReadableNT",M.endEmitted,M.length),!M.endEmitted&&M.length===0&&(M.endEmitted=!0,C.readable=!1,C.emit("end"),M.autoDestroy)){var q=C._writableState;(!q||q.autoDestroy&&q.finished)&&C.destroy()}}typeof Symbol=="function"&&(Q.from=function(M,C){return V===void 0&&(V=Yf()),V(Q,M,C)});function le(M,C){for(var q=0,G=M.length;q<G;q++)if(M[q]===C)return q;return-1}return Is}var sl=jt,$i=_r.codes,Xf=$i.ERR_METHOD_NOT_IMPLEMENTED,e0=$i.ERR_MULTIPLE_CALLBACK,t0=$i.ERR_TRANSFORM_ALREADY_TRANSFORMING,r0=$i.ERR_TRANSFORM_WITH_LENGTH_0,Fi=Gr();Rt(jt,Fi);function n0(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new e0);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function jt(e){if(!(this instanceof jt))return new jt(e);Fi.call(this,e),this._transformState={afterTransform:n0.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",i0)}function i0(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){ya(e,t,r)}):ya(this,null,null)}jt.prototype.push=function(e,t){return this._transformState.needTransform=!1,Fi.prototype.push.call(this,e,t)};jt.prototype._transform=function(e,t,r){r(new Xf("_transform()"))};jt.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};jt.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};jt.prototype._destroy=function(e,t){Fi.prototype._destroy.call(this,e,function(r){t(r)})};function ya(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new r0;if(e._transformState.transforming)throw new t0;return e.push(null)}var s0=gn,ol=sl;Rt(gn,ol);function gn(e){if(!(this instanceof gn))return new gn(e);ol.call(this,e)}gn.prototype._transform=function(e,t,r){r(null,e)};var xs;function o0(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var al=_r.codes,a0=al.ERR_MISSING_ARGS,c0=al.ERR_STREAM_DESTROYED;function ba(e){if(e)throw e}function l0(e){return e.setHeader&&typeof e.abort=="function"}function u0(e,t,r,n){n=o0(n);var i=!1;e.on("close",function(){i=!0}),xs===void 0&&(xs=uo),xs(e,{readable:t,writable:r},function(c){if(c)return n(c);i=!0,n()});var s=!1;return function(c){if(!i&&!s){if(s=!0,l0(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(c||new c0("pipe"))}}}function va(e){e()}function h0(e,t){return e.pipe(t)}function d0(e){return!e.length||typeof e[e.length-1]!="function"?ba:e.pop()}function f0(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=d0(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new a0("streams");var i,s=t.map(function(c,a){var f=a<t.length-1,g=a>0;return u0(c,f,g,function(p){i||(i=p),p&&s.forEach(va),!f&&(s.forEach(va),n(i))})});return t.reduce(h0)}var p0=f0;(function(e,t){t=e.exports=il(),t.Stream=t,t.Readable=t,t.Writable=rl(),t.Duplex=Gr(),t.Transform=sl,t.PassThrough=s0,t.finished=uo,t.pipeline=p0})(Gs,Gs.exports);var cl=Gs.exports;const{Transform:g0}=cl;var m0=e=>class ll extends g0{constructor(r,n,i,s,c){super(c),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=c,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(c){s=c}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new ll(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:w0}=cl;var y0=e=>class ul extends w0{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(c){s=c}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new ul(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const b0=m0,v0=y0;var _0=function(e){const t=b0(e),r=v0(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},hl={};const _a=[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];hl.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],g=e[7]^e[17]^e[27]^e[37]^e[47],p=e[8]^e[18]^e[28]^e[38]^e[48],v=e[9]^e[19]^e[29]^e[39]^e[49];let E=p^(i<<1|s>>>31),A=v^(s<<1|i>>>31);const U=e[0]^E,F=e[1]^A,H=e[10]^E,x=e[11]^A,L=e[20]^E,O=e[21]^A,V=e[30]^E,D=e[31]^A,z=e[40]^E,te=e[41]^A;E=r^(c<<1|a>>>31),A=n^(a<<1|c>>>31);const Y=e[2]^E,Q=e[3]^A,fe=e[12]^E,oe=e[13]^A,pe=e[22]^E,I=e[23]^A,o=e[32]^E,d=e[33]^A,w=e[42]^E,y=e[43]^A;E=i^(f<<1|g>>>31),A=s^(g<<1|f>>>31);const S=e[4]^E,k=e[5]^A,B=e[14]^E,b=e[15]^A,u=e[24]^E,R=e[25]^A,K=e[34]^E,J=e[35]^A,T=e[44]^E,P=e[45]^A;E=c^(p<<1|v>>>31),A=a^(v<<1|p>>>31);const W=e[6]^E,Z=e[7]^A,le=e[16]^E,M=e[17]^A,C=e[26]^E,q=e[27]^A,G=e[36]^E,se=e[37]^A,ue=e[46]^E,re=e[47]^A;E=f^(r<<1|n>>>31),A=g^(n<<1|r>>>31);const be=e[8]^E,dt=e[9]^A,Se=e[18]^E,Ee=e[19]^A,Je=e[28]^E,ve=e[29]^A,Re=e[38]^E,Qe=e[39]^A,_e=e[48]^E,m=e[49]^A,l=U,h=F,_=x<<4|H>>>28,N=H<<4|x>>>28,$=L<<3|O>>>29,j=O<<3|L>>>29,he=D<<9|V>>>23,ae=V<<9|D>>>23,ie=z<<18|te>>>14,Me=te<<18|z>>>14,ne=Y<<1|Q>>>31,Ce=Q<<1|Y>>>31,Rr=oe<<12|fe>>>20,ke=fe<<12|oe>>>20,Ie=pe<<10|I>>>22,Mr=I<<10|pe>>>22,xe=d<<13|o>>>19,Ae=o<<13|d>>>19,Cr=w<<2|y>>>30,Te=y<<2|w>>>30,Be=k<<30|S>>>2,kr=S<<30|k>>>2,Ne=B<<6|b>>>26,Le=b<<6|B>>>26,Ir=R<<11|u>>>21,Pe=u<<11|R>>>21,Oe=K<<15|J>>>17,xr=J<<15|K>>>17,$e=P<<29|T>>>3,Fe=T<<29|P>>>3,Ar=W<<28|Z>>>4,De=Z<<28|W>>>4,je=M<<23|le>>>9,Tr=le<<23|M>>>9,Ue=C<<25|q>>>7,He=q<<25|C>>>7,Jt=G<<21|se>>>11,Zt=se<<21|G>>>11,Kt=re<<24|ue>>>8,Qt=ue<<24|re>>>8,Yt=be<<27|dt>>>5,Xt=dt<<27|be>>>5,er=Se<<20|Ee>>>12,tr=Ee<<20|Se>>>12,rr=ve<<7|Je>>>25,nr=Je<<7|ve>>>25,ir=Re<<8|Qe>>>24,sr=Qe<<8|Re>>>24,or=_e<<14|m>>>18,ar=m<<14|_e>>>18;e[0]=l^~Rr&Ir,e[1]=h^~ke&Pe,e[10]=Ar^~er&$,e[11]=De^~tr&j,e[20]=ne^~Ne&Ue,e[21]=Ce^~Le&He,e[30]=Yt^~_&Ie,e[31]=Xt^~N&Mr,e[40]=Be^~je&rr,e[41]=kr^~Tr&nr,e[2]=Rr^~Ir&Jt,e[3]=ke^~Pe&Zt,e[12]=er^~$&xe,e[13]=tr^~j&Ae,e[22]=Ne^~Ue&ir,e[23]=Le^~He&sr,e[32]=_^~Ie&Oe,e[33]=N^~Mr&xr,e[42]=je^~rr&he,e[43]=Tr^~nr&ae,e[4]=Ir^~Jt&or,e[5]=Pe^~Zt&ar,e[14]=$^~xe&$e,e[15]=j^~Ae&Fe,e[24]=Ue^~ir&ie,e[25]=He^~sr&Me,e[34]=Ie^~Oe&Kt,e[35]=Mr^~xr&Qt,e[44]=rr^~he&Cr,e[45]=nr^~ae&Te,e[6]=Jt^~or&l,e[7]=Zt^~ar&h,e[16]=xe^~$e&Ar,e[17]=Ae^~Fe&De,e[26]=ir^~ie&ne,e[27]=sr^~Me&Ce,e[36]=Oe^~Kt&Yt,e[37]=xr^~Qt&Xt,e[46]=he^~Cr&Be,e[47]=ae^~Te&kr,e[8]=or^~l&Rr,e[9]=ar^~h&ke,e[18]=$e^~Ar&er,e[19]=Fe^~De&tr,e[28]=ie^~ne&Ne,e[29]=Me^~Ce&Le,e[38]=Kt^~Yt&_,e[39]=Qt^~Xt&N,e[48]=Cr^~Be&je,e[49]=Te^~kr&Tr,e[0]^=_a[t*2],e[1]^=_a[t*2+1]}};const ai=hl;function nn(){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}nn.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};nn.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(ai.p1600(this.state),this.count=0)};nn.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&ai.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),ai.p1600(this.state),this.count=0,this.squeezing=!0};nn.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(ai.p1600(this.state),this.count=0);return t};nn.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var E0=nn,S0=_0(E0);const R0=S0,M0=hi;function dl(e){return Buffer.allocUnsafe(e).fill(0)}function fl(e,t,r){const n=dl(t);return e=Di(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function C0(e,t){return fl(e,t,!0)}function Di(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")pl(e)?e=Buffer.from(x0(gl(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(M0.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function k0(e){return e=Di(e),"0x"+e.toString("hex")}function I0(e,t){return e=Di(e),t||(t=256),R0("keccak"+t).update(e).digest()}function x0(e){return e.length%2?"0"+e:e}function pl(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function gl(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var ml={zeros:dl,setLength:fl,setLengthRight:C0,isHexString:pl,stripHexPrefix:gl,toBuffer:Di,bufferToHex:k0,keccak:I0};const br=ml,gr=hi;function wl(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Hr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Ea(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function yl(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function dr(e){var t=typeof e;if(t==="string")return br.isHexString(e)?new gr(br.stripHexPrefix(e),16):new gr(e,10);if(t==="number")return new gr(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function At(e,t){var r,n,i,s;if(e==="address")return At("uint160",dr(t));if(e==="bool")return At("uint8",t?1:0);if(e==="string")return At("bytes",new Buffer(t,"utf8"));if(T0(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=yl(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(At(e,t[s]));if(r==="dynamic"){var c=At("uint256",t.length);i.unshift(c)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([At("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,br.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Hr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return br.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Hr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=dr(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Hr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=dr(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=Ea(e),n=dr(t),n<0)throw new Error("Supplied ufixed is negative");return At("uint256",n.mul(new gr(2).pow(new gr(r[1]))))}else if(e.startsWith("fixed"))return r=Ea(e),At("int256",dr(t).mul(new gr(2).pow(new gr(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function A0(e){return e==="string"||e==="bytes"||yl(e)==="dynamic"}function T0(e){return e.lastIndexOf("]")===e.length-1}function B0(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var c=wl(e[s]),a=t[s],f=At(c,a);A0(c)?(r.push(At("uint256",i)),n.push(f),i+=f.length):r.push(f)}return Buffer.concat(r.concat(n))}function bl(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<e.length;s++){var c=wl(e[s]),a=t[s];if(c==="bytes")i.push(a);else if(c==="string")i.push(new Buffer(a,"utf8"));else if(c==="bool")i.push(new Buffer(a?"01":"00","hex"));else if(c==="address")i.push(br.setLength(a,20));else if(c.startsWith("bytes")){if(r=Hr(c),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(br.setLengthRight(a,r))}else if(c.startsWith("uint")){if(r=Hr(c),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=dr(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(c.startsWith("int")){if(r=Hr(c),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=dr(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+c)}return Buffer.concat(i)}function N0(e,t){return br.keccak(bl(e,t))}var L0={rawEncode:B0,solidityPack:bl,soliditySHA3:N0};const Et=ml,dn=L0,vl={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"]},As={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const c=(a,f,g)=>{if(r[f]!==void 0)return["bytes32",g==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Et.keccak(this.encodeData(f,g,r,n))];if(g===void 0)throw new Error(`missing value for field ${a} of type ${f}`);if(f==="bytes")return["bytes32",Et.keccak(g)];if(f==="string")return typeof g=="string"&&(g=Buffer.from(g,"utf8")),["bytes32",Et.keccak(g)];if(f.lastIndexOf("]")===f.length-1){const p=f.slice(0,f.lastIndexOf("[")),v=g.map(E=>c(a,p,E));return["bytes32",Et.keccak(dn.rawEncode(v.map(([E])=>E),v.map(([,E])=>E)))]}return[f,g]};for(const a of r[e]){const[f,g]=c(a.name,a.type,t[a.name]);i.push(f),s.push(g)}}else for(const c of r[e]){let a=t[c.name];if(a!==void 0)if(c.type==="bytes")i.push("bytes32"),a=Et.keccak(a),s.push(a);else if(c.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=Et.keccak(a),s.push(a);else if(r[c.type]!==void 0)i.push("bytes32"),a=Et.keccak(this.encodeData(c.type,a,r,n)),s.push(a);else{if(c.type.lastIndexOf("]")===c.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(c.type),s.push(a)}}return dn.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:c,type:a})=>a+" "+c).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return Et.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Et.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in vl.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Et.keccak(Buffer.concat(n))}};var P0={TYPED_MESSAGE_SCHEMA:vl,TypedDataUtils:As,hashForSignTypedDataLegacy:function(e){return O0(e.data)},hashForSignTypedData_v3:function(e){return As.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return As.hash(e.data)}};function O0(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?Et.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return dn.soliditySHA3(["bytes32","bytes32"],[dn.soliditySHA3(new Array(e.length).fill("string"),i),dn.soliditySHA3(n,r)])}var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.filterFromParam=Jr.FilterPolyfill=void 0;const Fr=Ze,it=X,$0=5*60*1e3,fr={jsonrpc:"2.0",id:0};class F0{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Fr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=_l(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,it.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,it.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,it.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,it.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,it.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Gn())}async getFilterLogs(t){const r=(0,it.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},fr),{method:"eth_getLogs",params:[Sa(n)]})):Gn()}makeFilterId(){return(0,Fr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return Gn();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return Jn();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const c=await this.sendAsyncPromise(Object.assign(Object.assign({},fr),{method:"eth_getLogs",params:[Sa(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(c.result)){const a=c.result.map(g=>(0,it.intNumberFromHexString)(g.blockNumber||"0x0")),f=Math.max(...a);if(f&&f>n){const g=(0,Fr.IntNumber)(f+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${g}`),this.cursors.set(t,g)}}return c}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return Gn();const n=await this.getCurrentBlockHeight();if(r>n)return Jn();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,it.range)(r,n+1).map(c=>this.getBlockHashByNumber((0,Fr.IntNumber)(c))))).filter(c=>!!c),s=(0,Fr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},fr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(Jn())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},$0);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},fr),{method:"eth_blockNumber",params:[]}));return(0,it.intNumberFromHexString)((0,it.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},fr),{method:"eth_getBlockByNumber",params:[(0,it.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,it.ensureHexString)(r.result.hash):null}}Jr.FilterPolyfill=F0;function _l(e){return{fromBlock:Ra(e.fromBlock),toBlock:Ra(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}Jr.filterFromParam=_l;function Sa(e){const t={fromBlock:Ma(e.fromBlock),toBlock:Ma(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function Ra(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Fr.IntNumber)(0);if((0,it.isHexString)(e))return(0,it.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Ma(e){return e==="latest"?e:(0,it.hexStringFromIntNumber)(e)}function Gn(){return Object.assign(Object.assign({},fr),{error:{code:-32e3,message:"filter not found"}})}function Jn(){return Object.assign(Object.assign({},fr),{result:[]})}var ji={},El={},Ui={},ho=D0;function D0(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const Ca=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{t.errorFirst?n.push(function(c,a){if(t.multiArgs){const f=new Array(arguments.length-1);for(let g=1;g<arguments.length;g++)f[g-1]=arguments[g];c?(f.unshift(c),s(f)):i(f)}else c?s(c):i(a)}):n.push(function(c){if(t.multiArgs){const a=new Array(arguments.length-1);for(let f=0;f<arguments.length;f++)a[f]=arguments[f];i(a)}else i(c)}),e.apply(this,n)})};var j0=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=c=>typeof c=="string"?i===c:c.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):Ca(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?Ca(s,t):s}return n},Bn={},Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});const U0=wr;function ka(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function H0(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let W0=class extends U0.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let c;if(r.length>0&&([c]=r),c instanceof Error)throw c;const a=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw a.context=c,a}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")ka(s,this,r);else{const c=s.length,a=H0(s);for(let f=0;f<c;f+=1)ka(a[f],this,r)}return!0}};Nn.default=W0;var V0=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.BaseBlockTracker=void 0;const q0=V0(Nn),z0=1e3,G0=(e,t)=>e+t,Ia=["sync","latest"];class J0 extends q0.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*z0,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){Ia.includes(t)&&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 Ia.map(t=>this.listenerCount(t)).reduce(G0)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=xa(t),i=xa(r);return this._usePastBlocks&&n<i||n>i}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Bn.BaseBlockTracker=J0;function xa(e){return Number.parseInt(e,16)}var Sl={},Rl={},rt={};class Ml extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...c}=t,{path:a}=t,f=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??f),s!=null&&(this.cause=f),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Z0(e){return bt(e)&&typeof e[Symbol.iterator]=="function"}function bt(e){return typeof e=="object"&&e!=null}function Aa(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ke(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function K0(e){const{done:t,value:r}=e.next();return t?void 0:r}function Q0(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:c}=r,{refinement:a,message:f=`Expected a value of type \`${c}\`${a?` with refinement \`${a}\``:""}, but received: \`${Ke(n)}\``}=e;return{value:n,type:c,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:f}}function*Zs(e,t,r,n){Z0(e)||(e=[e]);for(const i of e){const s=Q0(i,t,r,n);s&&(yield s)}}function*fo(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:c=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),c&&t.type!=="type"&&bt(t.schema)&&bt(e)&&!Array.isArray(e)))for(const g in e)t.schema[g]===void 0&&delete e[g];let f="valid";for(const g of t.validator(e,a))g.explanation=r.message,f="not_valid",yield[g,void 0];for(let[g,p,v]of t.entries(e,a)){const E=fo(p,v,{path:g===void 0?n:[...n,g],branch:g===void 0?i:[...i,p],coerce:s,mask:c,message:r.message});for(const A of E)A[0]?(f=A[0].refinement!=null?"not_refined":"not_valid",yield[A[0],void 0]):s&&(p=A[1],g===void 0?e=p:e instanceof Map?e.set(g,p):e instanceof Set?e.add(p):bt(e)&&(p!==void 0||g in e)&&(e[g]=p))}if(f!=="not_valid")for(const g of t.refiner(e,a))g.explanation=r.message,f="not_refined",yield[g,void 0];f==="valid"&&(yield[void 0,e])}class ze{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:c=f=>f,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=c,i?this.validator=(f,g)=>{const p=i(f,g);return Zs(p,g,this,f)}:this.validator=()=>[],s?this.refiner=(f,g)=>{const p=s(f,g);return Zs(p,g,this,f)}:this.refiner=()=>[]}assert(t,r){return Cl(t,this,r)}create(t,r){return kl(t,this,r)}is(t){return po(t,this)}mask(t,r){return Il(t,this,r)}validate(t,r={}){return sn(t,this,r)}}function Cl(e,t,r){const n=sn(e,t,{message:r});if(n[0])throw n[0]}function kl(e,t,r){const n=sn(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Il(e,t,r){const n=sn(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function po(e,t){return!sn(e,t)[0]}function sn(e,t,r={}){const n=fo(e,t,r),i=K0(n);return i[0]?[new Ml(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function Y0(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Pn(n):Ln(n)}function ct(e,t){return new ze({type:e,schema:null,validator:t})}function X0(e,t){return new ze({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function e1(e){return new ze({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function t1(e){let t;return new ze({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function r1(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Pn(n);default:return Ln(n)}}function n1(e){const t=e instanceof ze,r=t?{...e.schema}:{...e};for(const n in r)r[n]=xl(r[n]);return t&&e.type==="type"?Pn(r):Ln(r)}function i1(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Pn(n);default:return Ln(n)}}function s1(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ct(e,t)}function o1(){return ct("any",()=>!0)}function a1(e){return new ze({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Ke(t)}`}})}function c1(){return ct("bigint",e=>typeof e=="bigint")}function l1(){return ct("boolean",e=>typeof e=="boolean")}function u1(){return ct("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Ke(e)}`)}function h1(e){const t={},r=e.map(n=>Ke(n)).join();for(const n of e)t[n]=n;return new ze({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Ke(n)}`}})}function d1(){return ct("func",e=>typeof e=="function"||`Expected a function, but received: ${Ke(e)}`)}function f1(e){return ct("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ke(t)}`)}function p1(){return ct("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Ke(e)}`)}function g1(e){return new ze({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function m1(e){const t=Ke(e),r=typeof e;return new ze({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Ke(n)}`}})}function w1(e,t){return new ze({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Ke(r)}`}})}function go(){return ct("never",()=>!1)}function y1(e){return new ze({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function b1(){return ct("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ke(e)}`)}function Ln(e){const t=e?Object.keys(e):[],r=go();return new ze({type:"object",schema:e||null,*entries(n){if(e&&bt(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return bt(n)||`Expected an object, but received: ${Ke(n)}`},coercer(n){return bt(n)?{...n}:n}})}function xl(e){return new ze({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function v1(e,t){return new ze({type:"record",schema:null,*entries(r){if(bt(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return bt(r)||`Expected an object, but received: ${Ke(r)}`}})}function _1(){return ct("regexp",e=>e instanceof RegExp)}function E1(e){return new ze({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Ke(t)}`}})}function Al(){return ct("string",e=>typeof e=="string"||`Expected a string, but received: ${Ke(e)}`)}function S1(e){const t=go();return new ze({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${Ke(r)}`}})}function Pn(e){const t=Object.keys(e);return new ze({type:"type",schema:e,*entries(r){if(bt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return bt(r)||`Expected an object, but received: ${Ke(r)}`},coercer(r){return bt(r)?{...r}:r}})}function R1(e){const t=e.map(r=>r.type).join(" | ");return new ze({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...c]=fo(r,s,n),[a]=c;if(a[0])for(const[f]of c)f&&i.push(f);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Ke(r)}`,...i]}})}function Tl(){return ct("unknown",()=>!0)}function mo(e,t,r){return new ze({...e,coercer:(n,i)=>po(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function M1(e,t,r={}){return mo(e,Tl(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&Aa(n)&&Aa(i)){const s={...n};let c=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],c=!0);if(c)return s}return n})}function C1(e){return mo(e,Al(),t=>t.trim())}function k1(e){return Er(e,"empty",t=>{const r=Bl(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Bl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function I1(e,t,r={}){const{exclusive:n}=r;return Er(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function x1(e,t,r={}){const{exclusive:n}=r;return Er(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function A1(e){return Er(e,"nonempty",t=>Bl(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function T1(e,t){return Er(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function B1(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Er(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:c}=s;return t<=c&&c<=r||`${n} with a size ${i} but received one with a size of \`${c}\``}else{const{length:c}=s;return t<=c&&c<=r||`${n} with a length ${i} but received one with a length of \`${c}\``}})}function Er(e,t,r){return new ze({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),c=Zs(s,i,e,n);for(const a of c)yield{...a,refinement:t}}})}const N1=Object.freeze(Object.defineProperty({__proto__:null,Struct:ze,StructError:Ml,any:o1,array:a1,assert:Cl,assign:Y0,bigint:c1,boolean:l1,coerce:mo,create:kl,date:u1,defaulted:M1,define:ct,deprecated:X0,dynamic:e1,empty:k1,enums:h1,func:d1,instance:f1,integer:p1,intersection:g1,is:po,lazy:t1,literal:m1,map:w1,mask:Il,max:I1,min:x1,never:go,nonempty:A1,nullable:y1,number:b1,object:Ln,omit:r1,optional:xl,partial:n1,pattern:T1,pick:i1,record:v1,refine:Er,regexp:_1,set:E1,size:B1,string:Al,struct:s1,trimmed:C1,tuple:S1,type:Pn,union:R1,unknown:Tl,validate:sn},Symbol.toStringTag,{value:"Module"})),Sr=Qr(N1);Object.defineProperty(rt,"__esModule",{value:!0});rt.assertExhaustive=rt.assertStruct=rt.assert=rt.AssertionError=void 0;const L1=Sr;function P1(e){return typeof e=="object"&&e!==null&&"message"in e}function O1(e){var t,r;return typeof((r=(t=e?.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function $1(e){const t=P1(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Nl(e,t){return O1(e)?new e({message:t}):e({message:t})}class wo extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}rt.AssertionError=wo;function F1(e,t="Assertion failed.",r=wo){if(!e)throw t instanceof Error?t:Nl(r,t)}rt.assert=F1;function D1(e,t,r="Assertion failed",n=wo){try{(0,L1.assert)(e,t)}catch(i){throw Nl(n,`${r}: ${$1(i)}.`)}}rt.assertStruct=D1;function j1(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}rt.assertExhaustive=j1;var On={};Object.defineProperty(On,"__esModule",{value:!0});On.base64=void 0;const U1=Sr,H1=rt,W1=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let c;s==="base64"?c=String.raw`[A-Za-z0-9+\/]`:((0,H1.assert)(s==="base64url"),c=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${c}{4})*(?:${c}{3}=|${c}{2}==)?$`,"u"):a=new RegExp(`^(?:${c}{4})*(?:${c}{2,3}|${c}{3}=|${c}{2}==)?$`,"u"),(0,U1.pattern)(e,a)};On.base64=W1;var ye={},$n={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Sr,r=rt;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(g){return(0,t.is)(g,e.HexStruct)}e.isHexString=n;function i(g){return(0,t.is)(g,e.StrictHexStruct)}e.isStrictHexString=i;function s(g){(0,r.assert)(n(g),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function c(g){(0,r.assert)(i(g),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=c;function a(g){return g.startsWith("0x")?g:g.startsWith("0X")?`0x${g.substring(2)}`:`0x${g}`}e.add0x=a;function f(g){return g.startsWith("0x")||g.startsWith("0X")?g.substring(2):g}e.remove0x=f})($n);Object.defineProperty(ye,"__esModule",{value:!0});ye.createDataView=ye.concatBytes=ye.valueToBytes=ye.stringToBytes=ye.numberToBytes=ye.signedBigIntToBytes=ye.bigIntToBytes=ye.hexToBytes=ye.bytesToString=ye.bytesToNumber=ye.bytesToSignedBigInt=ye.bytesToBigInt=ye.bytesToHex=ye.assertIsBytes=ye.isBytes=void 0;const ht=rt,Ks=$n,Ta=48,Ba=58,Na=87;function V1(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const q1=V1();function yo(e){return e instanceof Uint8Array}ye.isBytes=yo;function on(e){(0,ht.assert)(yo(e),"Value must be a Uint8Array.")}ye.assertIsBytes=on;function Ll(e){if(on(e),e.length===0)return"0x";const t=q1(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Ks.add0x)(r.join(""))}ye.bytesToHex=Ll;function Pl(e){on(e);const t=Ll(e);return BigInt(t)}ye.bytesToBigInt=Pl;function z1(e){on(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}ye.bytesToSignedBigInt=z1;function G1(e){on(e);const t=Pl(e);return(0,ht.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}ye.bytesToNumber=G1;function J1(e){return on(e),new TextDecoder().decode(e)}ye.bytesToString=J1;function Hi(e){var t;if(((t=e?.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Ks.assertIsHexString)(e);const r=(0,Ks.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const c=n.charCodeAt(s*2),a=n.charCodeAt(s*2+1),f=c-(c<Ba?Ta:Na),g=a-(a<Ba?Ta:Na);i[s]=f*16+g}return i}ye.hexToBytes=Hi;function Ol(e){(0,ht.assert)(typeof e=="bigint","Value must be a bigint."),(0,ht.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Hi(t)}ye.bigIntToBytes=Ol;function Z1(e,t){(0,ht.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function K1(e,t){(0,ht.assert)(typeof e=="bigint","Value must be a bigint."),(0,ht.assert)(typeof t=="number","Byte length must be a number."),(0,ht.assert)(t>0,"Byte length must be greater than 0."),(0,ht.assert)(Z1(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}ye.signedBigIntToBytes=K1;function $l(e){(0,ht.assert)(typeof e=="number","Value must be a number."),(0,ht.assert)(e>=0,"Value must be a non-negative number."),(0,ht.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Hi(t)}ye.numberToBytes=$l;function Fl(e){return(0,ht.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ye.stringToBytes=Fl;function Dl(e){if(typeof e=="bigint")return Ol(e);if(typeof e=="number")return $l(e);if(typeof e=="string")return e.startsWith("0x")?Hi(e):Fl(e);if(yo(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ye.valueToBytes=Dl;function Q1(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=Dl(e[i]);t[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<t.length;i++)n.set(t[i],s),s+=t[i].length;return n}ye.concatBytes=Q1;function Y1(e){if(typeof Buffer<"u"&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}ye.createDataView=Y1;var Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.ChecksumStruct=void 0;const La=Sr,X1=On;Wi.ChecksumStruct=(0,La.size)((0,X1.base64)((0,La.string)(),{paddingRequired:!0}),44,44);var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.createHex=Pt.createBytes=Pt.createBigInt=Pt.createNumber=void 0;const qe=Sr,ep=rt,jl=ye,Vi=$n,Ul=(0,qe.union)([(0,qe.number)(),(0,qe.bigint)(),(0,qe.string)(),Vi.StrictHexStruct]),tp=(0,qe.coerce)((0,qe.number)(),Ul,Number),rp=(0,qe.coerce)((0,qe.bigint)(),Ul,BigInt);(0,qe.union)([Vi.StrictHexStruct,(0,qe.instance)(Uint8Array)]);const np=(0,qe.coerce)((0,qe.instance)(Uint8Array),(0,qe.union)([Vi.StrictHexStruct]),jl.hexToBytes),ip=(0,qe.coerce)(Vi.StrictHexStruct,(0,qe.instance)(Uint8Array),jl.bytesToHex);function sp(e){try{const t=(0,qe.create)(e,tp);return(0,ep.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof qe.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Pt.createNumber=sp;function op(e){try{return(0,qe.create)(e,rp)}catch(t){throw t instanceof qe.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Pt.createBigInt=op;function ap(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,qe.create)(e,np)}catch(t){throw t instanceof qe.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Pt.createBytes=ap;function cp(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,qe.create)(e,ip)}catch(t){throw t instanceof qe.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Pt.createHex=cp;var Zr={},Hl=ee&&ee.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},st=ee&&ee.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},_t,It;Object.defineProperty(Zr,"__esModule",{value:!0});Zr.FrozenSet=Zr.FrozenMap=void 0;class bo{constructor(t){_t.set(this,void 0),Hl(this,_t,new Map(t),"f"),Object.freeze(this)}get size(){return st(this,_t,"f").size}[(_t=new WeakMap,Symbol.iterator)](){return st(this,_t,"f")[Symbol.iterator]()}entries(){return st(this,_t,"f").entries()}forEach(t,r){return st(this,_t,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return st(this,_t,"f").get(t)}has(t){return st(this,_t,"f").has(t)}keys(){return st(this,_t,"f").keys()}values(){return st(this,_t,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Zr.FrozenMap=bo;class vo{constructor(t){It.set(this,void 0),Hl(this,It,new Set(t),"f"),Object.freeze(this)}get size(){return st(this,It,"f").size}[(It=new WeakMap,Symbol.iterator)](){return st(this,It,"f")[Symbol.iterator]()}entries(){return st(this,It,"f").entries()}forEach(t,r){return st(this,It,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return st(this,It,"f").has(t)}keys(){return st(this,It,"f").keys()}values(){return st(this,It,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Zr.FrozenSet=vo;Object.freeze(bo);Object.freeze(bo.prototype);Object.freeze(vo);Object.freeze(vo.prototype);var Wl={};Object.defineProperty(Wl,"__esModule",{value:!0});var Vl={};(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 t=Sr,r=rt,n=()=>(0,t.define)("finite number",D=>(0,t.is)(D,(0,t.number)())&&Number.isFinite(D));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(D,z)=>{function te(Y,Q){const oe=[...Q.validator(Y,z)];return oe.length>0?oe:!0}try{const Y=te(D,e.UnsafeJsonStruct);return Y!==!0?Y:te(JSON.parse(JSON.stringify(D)),e.UnsafeJsonStruct)}catch(Y){return Y instanceof RangeError?"Circular reference detected":!1}});function i(D){return(0,t.is)(D,e.JsonStruct)}e.isValidJson=i;function s(D){(0,r.assertStruct)(D,e.JsonStruct,"Invalid JSON value");const z=JSON.stringify(D);return new TextEncoder().encode(z).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function c(D){return(0,t.is)(D,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=c;function a(D,z){(0,r.assertStruct)(D,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",z)}e.assertIsJsonRpcNotification=a;function f(D){return(0,t.is)(D,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=f;function g(D,z){(0,r.assertStruct)(D,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",z)}e.assertIsJsonRpcRequest=g,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function p(D){return(0,t.is)(D,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=p;function v(D,z){(0,r.assertStruct)(D,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",z)}e.assertIsPendingJsonRpcResponse=v;function E(D){return(0,t.is)(D,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=E;function A(D,z){(0,r.assertStruct)(D,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",z)}e.assertIsJsonRpcResponse=A;function U(D){return(0,t.is)(D,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=U;function F(D,z){(0,r.assertStruct)(D,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",z)}e.assertIsJsonRpcSuccess=F;function H(D){return(0,t.is)(D,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=H;function x(D,z){(0,r.assertStruct)(D,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",z)}e.assertIsJsonRpcFailure=x;function L(D){return(0,t.is)(D,e.JsonRpcErrorStruct)}e.isJsonRpcError=L;function O(D,z){(0,r.assertStruct)(D,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",z)}e.assertIsJsonRpcError=O;function V(D){const{permitEmptyString:z,permitFractions:te,permitNull:Y}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},D);return fe=>!!(typeof fe=="number"&&(te||Number.isInteger(fe))||typeof fe=="string"&&(z||fe.length>0)||Y&&fe===null)}e.getJsonRpcIdValidator=V})(Vl);var ql={};Object.defineProperty(ql,"__esModule",{value:!0});var Kr={},lp=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.createModuleLogger=Kr.createProjectLogger=void 0;const up=lp(ku),hp=(0,up.default)("metamask");function dp(e){return hp.extend(e)}Kr.createProjectLogger=dp;function fp(e,t){return e.extend(t)}Kr.createModuleLogger=fp;var zl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(g){return Array.isArray(g)&&g.length>0}e.isNonEmptyArray=t;function r(g){return g==null}e.isNullOrUndefined=r;function n(g){return!!g&&typeof g=="object"&&!Array.isArray(g)}e.isObject=n;const i=(g,p)=>Object.hasOwnProperty.call(g,p);e.hasProperty=i,function(g){g[g.Null=4]="Null",g[g.Comma=1]="Comma",g[g.Wrapper=1]="Wrapper",g[g.True=4]="True",g[g.False=5]="False",g[g.Quote=1]="Quote",g[g.Colon=1]="Colon",g[g.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(g){if(typeof g!="object"||g===null)return!1;try{let p=g;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(g)===p}catch{return!1}}e.isPlainObject=s;function c(g){return g.charCodeAt(0)<=127}e.isASCII=c;function a(g){var p;return g.split("").reduce((E,A)=>c(A)?E+1:E+2,0)+((p=g.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}e.calculateStringSize=a;function f(g){return g.toString().length}e.calculateNumberSize=f})(zl);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.hexToBigInt=Ot.hexToNumber=Ot.bigIntToHex=Ot.numberToHex=void 0;const Wr=rt,mn=$n,pp=e=>((0,Wr.assert)(typeof e=="number","Value must be a number."),(0,Wr.assert)(e>=0,"Value must be a non-negative number."),(0,Wr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,mn.add0x)(e.toString(16)));Ot.numberToHex=pp;const gp=e=>((0,Wr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Wr.assert)(e>=0,"Value must be a non-negative bigint."),(0,mn.add0x)(e.toString(16)));Ot.bigIntToHex=gp;const mp=e=>{(0,mn.assertIsHexString)(e);const t=parseInt(e,16);return(0,Wr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Ot.hexToNumber=mp;const wp=e=>((0,mn.assertIsHexString)(e),BigInt((0,mn.add0x)(e)));Ot.hexToBigInt=wp;var Gl={};Object.defineProperty(Gl,"__esModule",{value:!0});var Jl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,c)=>{if(!t(s))throw new Error(`"${c}" must be a non-negative integer. Received: "${s}".`)};function n(s,c){return r(s,"count"),s*c}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(Jl);var Zl={};Object.defineProperty(Zl,"__esModule",{value:!0});var Kl={},Qs={exports:{}};const yp="2.0.0",Ql=256,bp=Number.MAX_SAFE_INTEGER||9007199254740991,vp=16,_p=Ql-6,Ep=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var qi={MAX_LENGTH:Ql,MAX_SAFE_COMPONENT_LENGTH:vp,MAX_SAFE_BUILD_LENGTH:_p,MAX_SAFE_INTEGER:bp,RELEASE_TYPES:Ep,SEMVER_SPEC_VERSION:yp,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ts={};const Sp=typeof process=="object"&&Ts&&Ts.NODE_DEBUG&&/\bsemver\b/i.test(Ts.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var zi=Sp;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=qi,s=zi;t=e.exports={};const c=t.re=[],a=t.safeRe=[],f=t.src=[],g=t.safeSrc=[],p=t.t={};let v=0;const E="[a-zA-Z0-9-]",A=[["\\s",1],["\\d",i],[E,n]],U=H=>{for(const[x,L]of A)H=H.split(`${x}*`).join(`${x}{0,${L}}`).split(`${x}+`).join(`${x}{1,${L}}`);return H},F=(H,x,L)=>{const O=U(x),V=v++;s(H,V,x),p[H]=V,f[V]=x,g[V]=O,c[V]=new RegExp(x,L?"g":void 0),a[V]=new RegExp(O,L?"g":void 0)};F("NUMERICIDENTIFIER","0|[1-9]\\d*"),F("NUMERICIDENTIFIERLOOSE","\\d+"),F("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${E}*`),F("MAINVERSION",`(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})`),F("MAINVERSIONLOOSE",`(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})`),F("PRERELEASEIDENTIFIER",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIER]})`),F("PRERELEASEIDENTIFIERLOOSE",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIERLOOSE]})`),F("PRERELEASE",`(?:-(${f[p.PRERELEASEIDENTIFIER]}(?:\\.${f[p.PRERELEASEIDENTIFIER]})*))`),F("PRERELEASELOOSE",`(?:-?(${f[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[p.PRERELEASEIDENTIFIERLOOSE]})*))`),F("BUILDIDENTIFIER",`${E}+`),F("BUILD",`(?:\\+(${f[p.BUILDIDENTIFIER]}(?:\\.${f[p.BUILDIDENTIFIER]})*))`),F("FULLPLAIN",`v?${f[p.MAINVERSION]}${f[p.PRERELEASE]}?${f[p.BUILD]}?`),F("FULL",`^${f[p.FULLPLAIN]}$`),F("LOOSEPLAIN",`[v=\\s]*${f[p.MAINVERSIONLOOSE]}${f[p.PRERELEASELOOSE]}?${f[p.BUILD]}?`),F("LOOSE",`^${f[p.LOOSEPLAIN]}$`),F("GTLT","((?:<|>)?=?)"),F("XRANGEIDENTIFIERLOOSE",`${f[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),F("XRANGEIDENTIFIER",`${f[p.NUMERICIDENTIFIER]}|x|X|\\*`),F("XRANGEPLAIN",`[v=\\s]*(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:${f[p.PRERELEASE]})?${f[p.BUILD]}?)?)?`),F("XRANGEPLAINLOOSE",`[v=\\s]*(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:${f[p.PRERELEASELOOSE]})?${f[p.BUILD]}?)?)?`),F("XRANGE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAIN]}$`),F("XRANGELOOSE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAINLOOSE]}$`),F("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),F("COERCE",`${f[p.COERCEPLAIN]}(?:$|[^\\d])`),F("COERCEFULL",f[p.COERCEPLAIN]+`(?:${f[p.PRERELEASE]})?(?:${f[p.BUILD]})?(?:$|[^\\d])`),F("COERCERTL",f[p.COERCE],!0),F("COERCERTLFULL",f[p.COERCEFULL],!0),F("LONETILDE","(?:~>?)"),F("TILDETRIM",`(\\s*)${f[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",F("TILDE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAIN]}$`),F("TILDELOOSE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAINLOOSE]}$`),F("LONECARET","(?:\\^)"),F("CARETTRIM",`(\\s*)${f[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",F("CARET",`^${f[p.LONECARET]}${f[p.XRANGEPLAIN]}$`),F("CARETLOOSE",`^${f[p.LONECARET]}${f[p.XRANGEPLAINLOOSE]}$`),F("COMPARATORLOOSE",`^${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]})$|^$`),F("COMPARATOR",`^${f[p.GTLT]}\\s*(${f[p.FULLPLAIN]})$|^$`),F("COMPARATORTRIM",`(\\s*)${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]}|${f[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",F("HYPHENRANGE",`^\\s*(${f[p.XRANGEPLAIN]})\\s+-\\s+(${f[p.XRANGEPLAIN]})\\s*$`),F("HYPHENRANGELOOSE",`^\\s*(${f[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[p.XRANGEPLAINLOOSE]})\\s*$`),F("STAR","(<|>)?=?\\s*\\*"),F("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),F("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Qs,Qs.exports);var Fn=Qs.exports;const Rp=Object.freeze({loose:!0}),Mp=Object.freeze({}),Cp=e=>e?typeof e!="object"?Rp:e:Mp;var _o=Cp;const Pa=/^[0-9]+$/,Yl=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=Pa.test(e),n=Pa.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},kp=(e,t)=>Yl(t,e);var Xl={compareIdentifiers:Yl,rcompareIdentifiers:kp};const Zn=zi,{MAX_LENGTH:Oa,MAX_SAFE_INTEGER:Kn}=qi,{safeRe:Qn,t:Yn}=Fn,Ip=_o,{compareIdentifiers:Bs}=Xl;let xp=class xt{constructor(t,r){if(r=Ip(r),t instanceof xt){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Oa)throw new TypeError(`version is longer than ${Oa} characters`);Zn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Qn[Yn.LOOSE]:Qn[Yn.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Kn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Kn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Kn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<Kn)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Zn("SemVer.compare",this.version,this.options,t),!(t instanceof xt)){if(typeof t=="string"&&t===this.version)return 0;t=new xt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof xt||(t=new xt(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof xt||(t=new xt(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(Zn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Bs(n,i)}while(++r)}compareBuild(t){t instanceof xt||(t=new xt(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(Zn("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Bs(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const i=`-${r}`.match(this.options.loose?Qn[Yn.PRERELEASELOOSE]:Qn[Yn.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"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 i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Bs(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var ot=xp;const $a=ot,Ap=(e,t,r=!1)=>{if(e instanceof $a)return e;try{return new $a(e,t)}catch(n){if(!r)return null;throw n}};var an=Ap;const Tp=an,Bp=(e,t)=>{const r=Tp(e,t);return r?r.version:null};var Np=Bp;const Lp=an,Pp=(e,t)=>{const r=Lp(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var Op=Pp;const Fa=ot,$p=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Fa(e instanceof Fa?e.version:e,r).inc(t,n,i).version}catch{return null}};var Fp=$p;const Da=an,Dp=(e,t)=>{const r=Da(e,null,!0),n=Da(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,c=s?r:n,a=s?n:r,f=!!c.prerelease.length;if(!!a.prerelease.length&&!f){if(!a.patch&&!a.minor)return"major";if(a.compareMain(c)===0)return a.minor&&!a.patch?"minor":"patch"}const p=f?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var jp=Dp;const Up=ot,Hp=(e,t)=>new Up(e,t).major;var Wp=Hp;const Vp=ot,qp=(e,t)=>new Vp(e,t).minor;var zp=qp;const Gp=ot,Jp=(e,t)=>new Gp(e,t).patch;var Zp=Jp;const Kp=an,Qp=(e,t)=>{const r=Kp(e,t);return r&&r.prerelease.length?r.prerelease:null};var Yp=Qp;const ja=ot,Xp=(e,t,r)=>new ja(e,r).compare(new ja(t,r));var Mt=Xp;const eg=Mt,tg=(e,t,r)=>eg(t,e,r);var rg=tg;const ng=Mt,ig=(e,t)=>ng(e,t,!0);var sg=ig;const Ua=ot,og=(e,t,r)=>{const n=new Ua(e,r),i=new Ua(t,r);return n.compare(i)||n.compareBuild(i)};var Eo=og;const ag=Eo,cg=(e,t)=>e.sort((r,n)=>ag(r,n,t));var lg=cg;const ug=Eo,hg=(e,t)=>e.sort((r,n)=>ug(n,r,t));var dg=hg;const fg=Mt,pg=(e,t,r)=>fg(e,t,r)>0;var Gi=pg;const gg=Mt,mg=(e,t,r)=>gg(e,t,r)<0;var So=mg;const wg=Mt,yg=(e,t,r)=>wg(e,t,r)===0;var eu=yg;const bg=Mt,vg=(e,t,r)=>bg(e,t,r)!==0;var tu=vg;const _g=Mt,Eg=(e,t,r)=>_g(e,t,r)>=0;var Ro=Eg;const Sg=Mt,Rg=(e,t,r)=>Sg(e,t,r)<=0;var Mo=Rg;const Mg=eu,Cg=tu,kg=Gi,Ig=Ro,xg=So,Ag=Mo,Tg=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Mg(e,r,n);case"!=":return Cg(e,r,n);case">":return kg(e,r,n);case">=":return Ig(e,r,n);case"<":return xg(e,r,n);case"<=":return Ag(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var ru=Tg;const Bg=ot,Ng=an,{safeRe:Xn,t:ei}=Fn,Lg=(e,t)=>{if(e instanceof Bg)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Xn[ei.COERCEFULL]:Xn[ei.COERCE]);else{const f=t.includePrerelease?Xn[ei.COERCERTLFULL]:Xn[ei.COERCERTL];let g;for(;(g=f.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||g.index+g[0].length!==r.index+r[0].length)&&(r=g),f.lastIndex=g.index+g[1].length+g[2].length;f.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Ng(`${n}.${i}.${s}${c}${a}`,t)};var Pg=Lg;class Og{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var $g=Og,Ns,Ha;function Ct(){if(Ha)return Ns;Ha=1;const e=/\s+/g;class t{constructor(d,w){if(w=i(w),d instanceof t)return d.loose===!!w.loose&&d.includePrerelease===!!w.includePrerelease?d:new t(d.raw,w);if(d instanceof s)return this.raw=d.value,this.set=[[d]],this.formatted=void 0,this;if(this.options=w,this.loose=!!w.loose,this.includePrerelease=!!w.includePrerelease,this.raw=d.trim().replace(e," "),this.set=this.raw.split("||").map(y=>this.parseRange(y.trim())).filter(y=>y.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const y=this.set[0];if(this.set=this.set.filter(S=>!F(S[0])),this.set.length===0)this.set=[y];else if(this.set.length>1){for(const S of this.set)if(S.length===1&&H(S[0])){this.set=[S];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let d=0;d<this.set.length;d++){d>0&&(this.formatted+="||");const w=this.set[d];for(let y=0;y<w.length;y++)y>0&&(this.formatted+=" "),this.formatted+=w[y].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(d){const y=((this.options.includePrerelease&&A)|(this.options.loose&&U))+":"+d,S=n.get(y);if(S)return S;const k=this.options.loose,B=k?f[g.HYPHENRANGELOOSE]:f[g.HYPHENRANGE];d=d.replace(B,pe(this.options.includePrerelease)),c("hyphen replace",d),d=d.replace(f[g.COMPARATORTRIM],p),c("comparator trim",d),d=d.replace(f[g.TILDETRIM],v),c("tilde trim",d),d=d.replace(f[g.CARETTRIM],E),c("caret trim",d);let b=d.split(" ").map(J=>L(J,this.options)).join(" ").split(/\s+/).map(J=>oe(J,this.options));k&&(b=b.filter(J=>(c("loose invalid filter",J,this.options),!!J.match(f[g.COMPARATORLOOSE])))),c("range list",b);const u=new Map,R=b.map(J=>new s(J,this.options));for(const J of R){if(F(J))return[J];u.set(J.value,J)}u.size>1&&u.has("")&&u.delete("");const K=[...u.values()];return n.set(y,K),K}intersects(d,w){if(!(d instanceof t))throw new TypeError("a Range is required");return this.set.some(y=>x(y,w)&&d.set.some(S=>x(S,w)&&y.every(k=>S.every(B=>k.intersects(B,w)))))}test(d){if(!d)return!1;if(typeof d=="string")try{d=new a(d,this.options)}catch{return!1}for(let w=0;w<this.set.length;w++)if(I(this.set[w],d,this.options))return!0;return!1}}Ns=t;const r=$g,n=new r,i=_o,s=Ji(),c=zi,a=ot,{safeRe:f,t:g,comparatorTrimReplace:p,tildeTrimReplace:v,caretTrimReplace:E}=Fn,{FLAG_INCLUDE_PRERELEASE:A,FLAG_LOOSE:U}=qi,F=o=>o.value==="<0.0.0-0",H=o=>o.value==="",x=(o,d)=>{let w=!0;const y=o.slice();let S=y.pop();for(;w&&y.length;)w=y.every(k=>S.intersects(k,d)),S=y.pop();return w},L=(o,d)=>(o=o.replace(f[g.BUILD],""),c("comp",o,d),o=z(o,d),c("caret",o),o=V(o,d),c("tildes",o),o=Y(o,d),c("xrange",o),o=fe(o,d),c("stars",o),o),O=o=>!o||o.toLowerCase()==="x"||o==="*",V=(o,d)=>o.trim().split(/\s+/).map(w=>D(w,d)).join(" "),D=(o,d)=>{const w=d.loose?f[g.TILDELOOSE]:f[g.TILDE];return o.replace(w,(y,S,k,B,b)=>{c("tilde",o,y,S,k,B,b);let u;return O(S)?u="":O(k)?u=`>=${S}.0.0 <${+S+1}.0.0-0`:O(B)?u=`>=${S}.${k}.0 <${S}.${+k+1}.0-0`:b?(c("replaceTilde pr",b),u=`>=${S}.${k}.${B}-${b} <${S}.${+k+1}.0-0`):u=`>=${S}.${k}.${B} <${S}.${+k+1}.0-0`,c("tilde return",u),u})},z=(o,d)=>o.trim().split(/\s+/).map(w=>te(w,d)).join(" "),te=(o,d)=>{c("caret",o,d);const w=d.loose?f[g.CARETLOOSE]:f[g.CARET],y=d.includePrerelease?"-0":"";return o.replace(w,(S,k,B,b,u)=>{c("caret",o,S,k,B,b,u);let R;return O(k)?R="":O(B)?R=`>=${k}.0.0${y} <${+k+1}.0.0-0`:O(b)?k==="0"?R=`>=${k}.${B}.0${y} <${k}.${+B+1}.0-0`:R=`>=${k}.${B}.0${y} <${+k+1}.0.0-0`:u?(c("replaceCaret pr",u),k==="0"?B==="0"?R=`>=${k}.${B}.${b}-${u} <${k}.${B}.${+b+1}-0`:R=`>=${k}.${B}.${b}-${u} <${k}.${+B+1}.0-0`:R=`>=${k}.${B}.${b}-${u} <${+k+1}.0.0-0`):(c("no pr"),k==="0"?B==="0"?R=`>=${k}.${B}.${b}${y} <${k}.${B}.${+b+1}-0`:R=`>=${k}.${B}.${b}${y} <${k}.${+B+1}.0-0`:R=`>=${k}.${B}.${b} <${+k+1}.0.0-0`),c("caret return",R),R})},Y=(o,d)=>(c("replaceXRanges",o,d),o.split(/\s+/).map(w=>Q(w,d)).join(" ")),Q=(o,d)=>{o=o.trim();const w=d.loose?f[g.XRANGELOOSE]:f[g.XRANGE];return o.replace(w,(y,S,k,B,b,u)=>{c("xRange",o,y,S,k,B,b,u);const R=O(k),K=R||O(B),J=K||O(b),T=J;return S==="="&&T&&(S=""),u=d.includePrerelease?"-0":"",R?S===">"||S==="<"?y="<0.0.0-0":y="*":S&&T?(K&&(B=0),b=0,S===">"?(S=">=",K?(k=+k+1,B=0,b=0):(B=+B+1,b=0)):S==="<="&&(S="<",K?k=+k+1:B=+B+1),S==="<"&&(u="-0"),y=`${S+k}.${B}.${b}${u}`):K?y=`>=${k}.0.0${u} <${+k+1}.0.0-0`:J&&(y=`>=${k}.${B}.0${u} <${k}.${+B+1}.0-0`),c("xRange return",y),y})},fe=(o,d)=>(c("replaceStars",o,d),o.trim().replace(f[g.STAR],"")),oe=(o,d)=>(c("replaceGTE0",o,d),o.trim().replace(f[d.includePrerelease?g.GTE0PRE:g.GTE0],"")),pe=o=>(d,w,y,S,k,B,b,u,R,K,J,T)=>(O(y)?w="":O(S)?w=`>=${y}.0.0${o?"-0":""}`:O(k)?w=`>=${y}.${S}.0${o?"-0":""}`:B?w=`>=${w}`:w=`>=${w}${o?"-0":""}`,O(R)?u="":O(K)?u=`<${+R+1}.0.0-0`:O(J)?u=`<${R}.${+K+1}.0-0`:T?u=`<=${R}.${K}.${J}-${T}`:o?u=`<${R}.${K}.${+J+1}-0`:u=`<=${u}`,`${w} ${u}`.trim()),I=(o,d,w)=>{for(let y=0;y<o.length;y++)if(!o[y].test(d))return!1;if(d.prerelease.length&&!w.includePrerelease){for(let y=0;y<o.length;y++)if(c(o[y].semver),o[y].semver!==s.ANY&&o[y].semver.prerelease.length>0){const S=o[y].semver;if(S.major===d.major&&S.minor===d.minor&&S.patch===d.patch)return!0}return!1}return!0};return Ns}var Ls,Wa;function Ji(){if(Wa)return Ls;Wa=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(p,v){if(v=r(v),p instanceof t){if(p.loose===!!v.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),c("comparator",p,v),this.options=v,this.loose=!!v.loose,this.parse(p),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(p){const v=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],E=p.match(v);if(!E)throw new TypeError(`Invalid comparator: ${p}`);this.operator=E[1]!==void 0?E[1]:"",this.operator==="="&&(this.operator=""),E[2]?this.semver=new a(E[2],this.options.loose):this.semver=e}toString(){return this.value}test(p){if(c("Comparator.test",p,this.options.loose),this.semver===e||p===e)return!0;if(typeof p=="string")try{p=new a(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,v){if(!(p instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new f(p.value,v).test(this.value):p.operator===""?p.value===""?!0:new f(this.value,v).test(p.semver):(v=r(v),v.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!v.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,v)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,v)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}Ls=t;const r=_o,{safeRe:n,t:i}=Fn,s=ru,c=zi,a=ot,f=Ct();return Ls}const Fg=Ct(),Dg=(e,t,r)=>{try{t=new Fg(t,r)}catch{return!1}return t.test(e)};var Zi=Dg;const jg=Ct(),Ug=(e,t)=>new jg(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Hg=Ug;const Wg=ot,Vg=Ct(),qg=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Vg(t,r)}catch{return null}return e.forEach(c=>{s.test(c)&&(!n||i.compare(c)===-1)&&(n=c,i=new Wg(n,r))}),n};var zg=qg;const Gg=ot,Jg=Ct(),Zg=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Jg(t,r)}catch{return null}return e.forEach(c=>{s.test(c)&&(!n||i.compare(c)===1)&&(n=c,i=new Gg(n,r))}),n};var Kg=Zg;const Ps=ot,Qg=Ct(),Va=Gi,Yg=(e,t)=>{e=new Qg(e,t);let r=new Ps("0.0.0");if(e.test(r)||(r=new Ps("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const i=e.set[n];let s=null;i.forEach(c=>{const a=new Ps(c.semver.version);switch(c.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Va(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Va(r,s))&&(r=s)}return r&&e.test(r)?r:null};var Xg=Yg;const em=Ct(),tm=(e,t)=>{try{return new em(e,t).range||"*"}catch{return null}};var rm=tm;const nm=ot,nu=Ji(),{ANY:im}=nu,sm=Ct(),om=Zi,qa=Gi,za=So,am=Mo,cm=Ro,lm=(e,t,r,n)=>{e=new nm(e,n),t=new sm(t,n);let i,s,c,a,f;switch(r){case">":i=qa,s=am,c=za,a=">",f=">=";break;case"<":i=za,s=cm,c=qa,a="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(om(e,t,n))return!1;for(let g=0;g<t.set.length;++g){const p=t.set[g];let v=null,E=null;if(p.forEach(A=>{A.semver===im&&(A=new nu(">=0.0.0")),v=v||A,E=E||A,i(A.semver,v.semver,n)?v=A:c(A.semver,E.semver,n)&&(E=A)}),v.operator===a||v.operator===f||(!E.operator||E.operator===a)&&s(e,E.semver))return!1;if(E.operator===f&&c(e,E.semver))return!1}return!0};var Co=lm;const um=Co,hm=(e,t,r)=>um(e,t,">",r);var dm=hm;const fm=Co,pm=(e,t,r)=>fm(e,t,"<",r);var gm=pm;const Ga=Ct(),mm=(e,t,r)=>(e=new Ga(e,r),t=new Ga(t,r),e.intersects(t,r));var wm=mm;const ym=Zi,bm=Mt;var vm=(e,t,r)=>{const n=[];let i=null,s=null;const c=e.sort((p,v)=>bm(p,v,r));for(const p of c)ym(p,t,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[p,v]of n)p===v?a.push(p):!v&&p===c[0]?a.push("*"):v?p===c[0]?a.push(`<=${v}`):a.push(`${p} - ${v}`):a.push(`>=${p}`);const f=a.join(" || "),g=typeof t.raw=="string"?t.raw:String(t);return f.length<g.length?f:t};const Ja=Ct(),ko=Ji(),{ANY:Os}=ko,ln=Zi,Io=Mt,_m=(e,t,r={})=>{if(e===t)return!0;e=new Ja(e,r),t=new Ja(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const c=Sm(i,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},Em=[new ko(">=0.0.0-0")],Za=[new ko(">=0.0.0")],Sm=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Os){if(t.length===1&&t[0].semver===Os)return!0;r.includePrerelease?e=Em:e=Za}if(t.length===1&&t[0].semver===Os){if(r.includePrerelease)return!0;t=Za}const n=new Set;let i,s;for(const A of e)A.operator===">"||A.operator===">="?i=Ka(i,A,r):A.operator==="<"||A.operator==="<="?s=Qa(s,A,r):n.add(A.semver);if(n.size>1)return null;let c;if(i&&s){if(c=Io(i.semver,s.semver,r),c>0)return null;if(c===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const A of n){if(i&&!ln(A,String(i),r)||s&&!ln(A,String(s),r))return null;for(const U of t)if(!ln(A,String(U),r))return!1;return!0}let a,f,g,p,v=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,E=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;v&&v.prerelease.length===1&&s.operator==="<"&&v.prerelease[0]===0&&(v=!1);for(const A of t){if(p=p||A.operator===">"||A.operator===">=",g=g||A.operator==="<"||A.operator==="<=",i){if(E&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===E.major&&A.semver.minor===E.minor&&A.semver.patch===E.patch&&(E=!1),A.operator===">"||A.operator===">="){if(a=Ka(i,A,r),a===A&&a!==i)return!1}else if(i.operator===">="&&!ln(i.semver,String(A),r))return!1}if(s){if(v&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===v.major&&A.semver.minor===v.minor&&A.semver.patch===v.patch&&(v=!1),A.operator==="<"||A.operator==="<="){if(f=Qa(s,A,r),f===A&&f!==s)return!1}else if(s.operator==="<="&&!ln(s.semver,String(A),r))return!1}if(!A.operator&&(s||i)&&c!==0)return!1}return!(i&&g&&!s&&c!==0||s&&p&&!i&&c!==0||E||v)},Ka=(e,t,r)=>{if(!e)return t;const n=Io(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Qa=(e,t,r)=>{if(!e)return t;const n=Io(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Rm=_m;const $s=Fn,Ya=qi,Mm=ot,Xa=Xl,Cm=an,km=Np,Im=Op,xm=Fp,Am=jp,Tm=Wp,Bm=zp,Nm=Zp,Lm=Yp,Pm=Mt,Om=rg,$m=sg,Fm=Eo,Dm=lg,jm=dg,Um=Gi,Hm=So,Wm=eu,Vm=tu,qm=Ro,zm=Mo,Gm=ru,Jm=Pg,Zm=Ji(),Km=Ct(),Qm=Zi,Ym=Hg,Xm=zg,ew=Kg,tw=Xg,rw=rm,nw=Co,iw=dm,sw=gm,ow=wm,aw=vm,cw=Rm;var lw={parse:Cm,valid:km,clean:Im,inc:xm,diff:Am,major:Tm,minor:Bm,patch:Nm,prerelease:Lm,compare:Pm,rcompare:Om,compareLoose:$m,compareBuild:Fm,sort:Dm,rsort:jm,gt:Um,lt:Hm,eq:Wm,neq:Vm,gte:qm,lte:zm,cmp:Gm,coerce:Jm,Comparator:Zm,Range:Km,satisfies:Qm,toComparators:Ym,maxSatisfying:Xm,minSatisfying:ew,minVersion:tw,validRange:rw,outside:nw,gtr:iw,ltr:sw,intersects:ow,simplifyRange:aw,subset:cw,SemVer:Mm,re:$s.re,src:$s.src,tokens:$s.t,SEMVER_SPEC_VERSION:Ya.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ya.RELEASE_TYPES,compareIdentifiers:Xa.compareIdentifiers,rcompareIdentifiers:Xa.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=lw,r=Sr,n=rt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",v=>(0,t.valid)(v)===null?`Expected SemVer version, got "${v}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",v=>(0,t.validRange)(v)===null?`Expected SemVer range, got "${v}"`:!0);function i(v){return(0,r.is)(v,e.VersionStruct)}e.isValidSemVerVersion=i;function s(v){return(0,r.is)(v,e.VersionRangeStruct)}e.isValidSemVerRange=s;function c(v){(0,n.assertStruct)(v,e.VersionStruct)}e.assertIsSemVerVersion=c;function a(v){(0,n.assertStruct)(v,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function f(v,E){return(0,t.gt)(v,E)}e.gtVersion=f;function g(v,E){return(0,t.gtr)(v,E)}e.gtRange=g;function p(v,E){return(0,t.satisfies)(v,E,{includePrerelease:!0})}e.satisfiesVersionRange=p})(Kl);(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,a)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(rt,e),r(On,e),r(ye,e),r(Wi,e),r(Pt,e),r(Zr,e),r(Wl,e),r($n,e),r(Vl,e),r(ql,e),r(Kr,e),r(zl,e),r(Ot,e),r(Gl,e),r(Jl,e),r(Zl,e),r(Kl,e)})(Rl);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Rl;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Sl);var iu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.PollingBlockTracker=void 0;const uw=iu(ho),hw=iu(j0),dw=Bn,ec=Sl,tc=(0,ec.createModuleLogger)(ec.projectLogger,"polling-block-tracker"),fw=(0,uw.default)(),pw=1e3;class gw extends dw.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*pw,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=rc(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
8
+ ${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=rc(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:fw(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),tc("Making request",t);const r=await(0,hw.default)(n=>this._provider.sendAsync(t,n))();if(tc("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
9
+ ${r.error.message}`);return r.result}}Ui.PollingBlockTracker=gw;function rc(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Ki={},mw=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.SubscribeBlockTracker=void 0;const ww=mw(ho),yw=Bn,bw=(0,ww.default)();class vw extends yw.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:bw(),method:t,params:r,jsonrpc:"2.0"},(s,c)=>{s?i(s):n(c.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Ki.SubscribeBlockTracker=vw;(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ui,e),r(Ki,e)})(El);var xo={},Qi={},Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.getUniqueId=void 0;const su=4294967295;let Fs=Math.floor(Math.random()*su);function _w(){return Fs=(Fs+1)%su,Fs}Dn.getUniqueId=_w;Object.defineProperty(Qi,"__esModule",{value:!0});Qi.createIdRemapMiddleware=void 0;const Ew=Dn;function Sw(){return(e,t,r,n)=>{const i=e.id,s=Ew.getUniqueId();e.id=s,t.id=s,r(c=>{e.id=i,t.id=i,c()})}}Qi.createIdRemapMiddleware=Sw;var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.createAsyncMiddleware=void 0;function Rw(e){return async(t,r,n,i)=>{let s;const c=new Promise(p=>{s=p});let a=null,f=!1;const g=async()=>{f=!0,n(p=>{a=p,s()}),await c};try{await e(t,r,g),f?(await c,a(null)):i(null)}catch(p){a?a(p):i(p)}}}Yi.createAsyncMiddleware=Rw;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.createScaffoldMiddleware=void 0;function Mw(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}Xi.createScaffoldMiddleware=Mw;var jn={},Ao={};Object.defineProperty(Ao,"__esModule",{value:!0});const Cw=wr;function nc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function kw(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Iw=class extends Cw.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let c;if(r.length>0&&([c]=r),c instanceof Error)throw c;const a=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw a.context=c,a}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")nc(s,this,r);else{const c=s.length,a=kw(s);for(let f=0;f<c;f+=1)nc(a[f],this,r)}return!0}};Ao.default=Iw;var ou={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.EthereumProviderError=zt.EthereumRpcError=void 0;const xw=Iu;class au extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return xw.default(this.serialize(),Bw,2)}}zt.EthereumRpcError=au;class Aw extends au{constructor(t,r,n){if(!Tw(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}zt.EthereumProviderError=Aw;function Tw(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Bw(e,t){if(t!=="[Circular]")return t}var To={},Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.errorValues=Gt.errorCodes=void 0;Gt.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}};Gt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Gt,r=zt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:c(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function c(E,A=i){if(Number.isInteger(E)){const U=E.toString();if(v(t.errorValues,U))return t.errorValues[U].message;if(g(E))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return A}e.getMessageFromCode=c;function a(E){if(!Number.isInteger(E))return!1;const A=E.toString();return!!(t.errorValues[A]||g(E))}e.isValidCode=a;function f(E,{fallbackError:A=s,shouldIncludeStack:U=!1}={}){var F,H;if(!A||!Number.isInteger(A.code)||typeof A.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(E instanceof r.EthereumRpcError)return E.serialize();const x={};if(E&&typeof E=="object"&&!Array.isArray(E)&&v(E,"code")&&a(E.code)){const O=E;x.code=O.code,O.message&&typeof O.message=="string"?(x.message=O.message,v(O,"data")&&(x.data=O.data)):(x.message=c(x.code),x.data={originalError:p(E)})}else{x.code=A.code;const O=(F=E)===null||F===void 0?void 0:F.message;x.message=O&&typeof O=="string"?O:A.message,x.data={originalError:p(E)}}const L=(H=E)===null||H===void 0?void 0:H.stack;return U&&E&&L&&typeof L=="string"&&(x.stack=L),x}e.serializeError=f;function g(E){return E>=-32099&&E<=-32e3}function p(E){return E&&typeof E=="object"&&!Array.isArray(E)?Object.assign({},E):E}function v(E,A){return Object.prototype.hasOwnProperty.call(E,A)}})(To);var es={};Object.defineProperty(es,"__esModule",{value:!0});es.ethErrors=void 0;const Bo=zt,cu=To,nt=Gt;es.ethErrors={rpc:{parse:e=>pt(nt.errorCodes.rpc.parse,e),invalidRequest:e=>pt(nt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>pt(nt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>pt(nt.errorCodes.rpc.methodNotFound,e),internal:e=>pt(nt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return pt(t,e)},invalidInput:e=>pt(nt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>pt(nt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>pt(nt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>pt(nt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>pt(nt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>pt(nt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>un(nt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>un(nt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>un(nt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>un(nt.errorCodes.provider.disconnected,e),chainDisconnected:e=>un(nt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Bo.EthereumProviderError(t,r,n)}}};function pt(e,t){const[r,n]=lu(t);return new Bo.EthereumRpcError(e,r||cu.getMessageFromCode(e),n)}function un(e,t){const[r,n]=lu(t);return new Bo.EthereumProviderError(e,r||cu.getMessageFromCode(e),n)}function lu(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=zt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=To;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=es;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Gt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(ou);var Nw=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jn,"__esModule",{value:!0});jn.JsonRpcEngine=void 0;const Lw=Nw(Ao),gt=ou;class $t extends Lw.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,c,a]=await $t._runAllMiddleware(t,r,this._middleware);return c?(await $t._runReturnHandlers(a),i(s)):n(async f=>{try{await $t._runReturnHandlers(a)}catch(g){return f(g)}return f()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const c=new gt.EthereumRpcError(gt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(c,{id:void 0,jsonrpc:"2.0",error:c})}if(typeof t.method!="string"){const c=new gt.EthereumRpcError(gt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(c,{id:t.id,jsonrpc:"2.0",error:c})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(c){s=c}return s&&(delete i.result,i.error||(i.error=gt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await $t._runAllMiddleware(t,r,this._middleware);if($t._checkForCompletion(t,r,i),await $t._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,c=!1;for(const a of n)if([s,c]=await $t._runMiddleware(t,r,a,i),c)break;return[s,c,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const c=f=>{const g=f||r.error;g&&(r.error=gt.serializeError(g)),s([g,!0])},a=f=>{r.error?c(r.error):(f&&(typeof f!="function"&&c(new gt.EthereumRpcError(gt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof f}" for request:
10
+ ${Ds(t)}`,{request:t})),i.push(f)),s([null,!1]))};try{n(t,r,a,c)}catch(f){c(f)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new gt.EthereumRpcError(gt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
11
+ ${Ds(t)}`,{request:t});if(!n)throw new gt.EthereumRpcError(gt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
12
+ ${Ds(t)}`,{request:t})}}jn.JsonRpcEngine=$t;function Ds(e){return JSON.stringify(e,null,2)}var ts={};Object.defineProperty(ts,"__esModule",{value:!0});ts.mergeMiddleware=void 0;const Pw=jn;function Ow(e){const t=new Pw.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}ts.mergeMiddleware=Ow;(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Qi,e),r(Yi,e),r(Xi,e),r(Dn,e),r(jn,e),r(ts,e)})(xo);var uu={},No={};const Lo=Qr(Eu);var rs={};Object.defineProperty(rs,"__esModule",{value:!0});var ic=Lo,$w=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return ic.__awaiter(this,void 0,void 0,function(){var r,n,i;return ic.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();rs.default=$w;Object.defineProperty(No,"__esModule",{value:!0});var sc=Lo,Fw=rs,Dw=function(){function e(){this._semaphore=new Fw.default(1)}return e.prototype.acquire=function(){return sc.__awaiter(this,void 0,void 0,function(){var t,r;return sc.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();No.default=Dw;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});ns.withTimeout=void 0;var ti=Lo;function jw(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return ti.__awaiter(n,void 0,void 0,function(){var c,a,f;return ti.__generator(this,function(g){switch(g.label){case 0:return c=!1,setTimeout(function(){c=!0,s(r)},t),[4,e.acquire()];case 1:return a=g.sent(),c?(f=Array.isArray(a)?a[1]:a,f()):i(a),[2]}})})})},runExclusive:function(i){return ti.__awaiter(this,void 0,void 0,function(){var s,c;return ti.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return c=a.sent(),Array.isArray(c)?(s=c[1],[4,i(c[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=c,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}ns.withTimeout=jw;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=No;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=rs;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=ns;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(uu);var Uw=Ww,Hw=Object.prototype.hasOwnProperty;function Ww(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)Hw.call(r,n)&&(e[n]=r[n])}return e}const Vw=Uw,qw=ho();var zw=ce;function ce(e){const t=this;t.currentProvider=e}ce.prototype.getBalance=Un(2,"eth_getBalance");ce.prototype.getCode=Un(2,"eth_getCode");ce.prototype.getTransactionCount=Un(2,"eth_getTransactionCount");ce.prototype.getStorageAt=Un(3,"eth_getStorageAt");ce.prototype.call=Un(2,"eth_call");ce.prototype.protocolVersion=ge("eth_protocolVersion");ce.prototype.syncing=ge("eth_syncing");ce.prototype.coinbase=ge("eth_coinbase");ce.prototype.mining=ge("eth_mining");ce.prototype.hashrate=ge("eth_hashrate");ce.prototype.gasPrice=ge("eth_gasPrice");ce.prototype.accounts=ge("eth_accounts");ce.prototype.blockNumber=ge("eth_blockNumber");ce.prototype.getBlockTransactionCountByHash=ge("eth_getBlockTransactionCountByHash");ce.prototype.getBlockTransactionCountByNumber=ge("eth_getBlockTransactionCountByNumber");ce.prototype.getUncleCountByBlockHash=ge("eth_getUncleCountByBlockHash");ce.prototype.getUncleCountByBlockNumber=ge("eth_getUncleCountByBlockNumber");ce.prototype.sign=ge("eth_sign");ce.prototype.sendTransaction=ge("eth_sendTransaction");ce.prototype.sendRawTransaction=ge("eth_sendRawTransaction");ce.prototype.estimateGas=ge("eth_estimateGas");ce.prototype.getBlockByHash=ge("eth_getBlockByHash");ce.prototype.getBlockByNumber=ge("eth_getBlockByNumber");ce.prototype.getTransactionByHash=ge("eth_getTransactionByHash");ce.prototype.getTransactionByBlockHashAndIndex=ge("eth_getTransactionByBlockHashAndIndex");ce.prototype.getTransactionByBlockNumberAndIndex=ge("eth_getTransactionByBlockNumberAndIndex");ce.prototype.getTransactionReceipt=ge("eth_getTransactionReceipt");ce.prototype.getUncleByBlockHashAndIndex=ge("eth_getUncleByBlockHashAndIndex");ce.prototype.getUncleByBlockNumberAndIndex=ge("eth_getUncleByBlockNumberAndIndex");ce.prototype.getCompilers=ge("eth_getCompilers");ce.prototype.compileLLL=ge("eth_compileLLL");ce.prototype.compileSolidity=ge("eth_compileSolidity");ce.prototype.compileSerpent=ge("eth_compileSerpent");ce.prototype.newFilter=ge("eth_newFilter");ce.prototype.newBlockFilter=ge("eth_newBlockFilter");ce.prototype.newPendingTransactionFilter=ge("eth_newPendingTransactionFilter");ce.prototype.uninstallFilter=ge("eth_uninstallFilter");ce.prototype.getFilterChanges=ge("eth_getFilterChanges");ce.prototype.getFilterLogs=ge("eth_getFilterLogs");ce.prototype.getLogs=ge("eth_getLogs");ce.prototype.getWork=ge("eth_getWork");ce.prototype.submitWork=ge("eth_submitWork");ce.prototype.submitHashrate=ge("eth_submitHashrate");ce.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(Gw(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function ge(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function Un(e,t){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},i)}}function Gw(e){return Vw({id:qw(),jsonrpc:"2.0",params:[]},e)}const oc=(e,t,r,n)=>function(...i){const s=t.promiseModule;return new s((c,a)=>{t.multiArgs?i.push((...g)=>{t.errorFirst?g[0]?a(g):(g.shift(),c(g)):c(g)}):t.errorFirst?i.push((g,p)=>{g?a(g):c(p)}):i.push(c),Reflect.apply(e,this===r?n:this,i)})},ac=new WeakMap;var Jw=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(c,a)=>{let f=ac.get(c);if(f||(f={},ac.set(c,f)),a in f)return f[a];const g=U=>typeof U=="string"||typeof a=="symbol"?a===U:U.test(a),p=Reflect.getOwnPropertyDescriptor(c,a),v=p===void 0||p.writable||p.configurable,A=(t.include?t.include.some(g):!t.exclude.some(g))&&v;return f[a]=A,A},i=new WeakMap,s=new Proxy(e,{apply(c,a,f){const g=i.get(c);if(g)return Reflect.apply(g,a,f);const p=t.excludeMain?c:oc(c,t,s,c);return i.set(c,p),Reflect.apply(p,a,f)},get(c,a){const f=c[a];if(!n(c,a)||f===Function.prototype[a])return f;const g=i.get(f);if(g)return g;if(typeof f=="function"){const p=oc(f,t,s,c);return i.set(f,p),p}return f}});return s};const Zw=Nn.default;let Kw=class extends Zw{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var Po=Kw;const Qw=Po;let Yw=class extends Qw{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var Xw=Yw,Hn={minBlockRef:ey,maxBlockRef:ty,sortBlockRefs:Oo,bnToHex:ry,blockRefIsNumber:ny,hexToInt:ci,incrementHexInt:iy,intToHex:hu,unsafeRandomBytes:sy};function ey(...e){return Oo(e)[0]}function ty(...e){const t=Oo(e);return t[t.length-1]}function Oo(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:ci(t)-ci(r))}function ry(e){return"0x"+e.toString(16)}function ny(e){return e&&!["earliest","latest","pending"].includes(e)}function ci(e){return e==null?e:Number.parseInt(e,16)}function iy(e){if(e==null)return e;const t=ci(e);return hu(t+1)}function hu(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function sy(e){let t="0x";for(let r=0;r<e;r++)t+=cc(),t+=cc();return t}function cc(){return Math.floor(Math.random()*16).toString(16)}const oy=zw,ay=Jw,cy=Xw,{bnToHex:kb,hexToInt:ri,incrementHexInt:ly,minBlockRef:uy,blockRefIsNumber:hy}=Hn;let dy=class extends cy{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new oy(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=uy(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=ly(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(f=>this.matchLog(f));this.addResults(a)}async _fetchLogs(t){return await ay(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(ri(this.params.fromBlock)>=ri(t.blockNumber)||hy(this.params.toBlock)&&ri(this.params.toBlock)<=ri(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let c=t.topics[s];if(!c)return!1;c=c.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(p=>p.toLowerCase()),a.includes(c))})}};var fy=dy,$o=py;async function py({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=lc(t),s=lc(r)-n+1,c=Array(s).fill().map((f,g)=>n+g).map(gy);let a=await Promise.all(c.map(f=>wy(e,"eth_getBlockByNumber",[f,!1])));return a=a.filter(f=>f!==null),a}function lc(e){return e==null?e:Number.parseInt(e,16)}function gy(e){return e==null?e:"0x"+e.toString(16)}function my(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function wy(e,t,r){for(let n=0;n<3;n++)try{return await my(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const yy=Po,by=$o,{incrementHexInt:vy}=Hn;let _y=class extends yy{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=vy(t),c=(await by({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(c)}};var Ey=_y;const Sy=Po,Ry=$o,{incrementHexInt:My}=Hn;let Cy=class extends Sy{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=My(t),i=await Ry({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const c of i)s.push(...c.transactions);this.addResults(s)}};var ky=Cy;const Iy=uu.Mutex,{createAsyncMiddleware:xy,createScaffoldMiddleware:Ay}=xo,Ty=fy,By=Ey,Ny=ky,{intToHex:du,hexToInt:js}=Hn;var Ly=Py;function Py({blockTracker:e,provider:t}){let r=0,n={};const i=new Iy,s=Oy({mutex:i}),c=Ay({eth_newFilter:s(Us(f)),eth_newBlockFilter:s(Us(g)),eth_newPendingTransactionFilter:s(Us(p)),eth_uninstallFilter:s(si(A)),eth_getFilterChanges:s(si(v)),eth_getFilterLogs:s(si(E))}),a=async({oldBlock:L,newBlock:O})=>{if(n.length===0)return;const V=await i.acquire();try{await Promise.all($r(n).map(async D=>{try{await D.update({oldBlock:L,newBlock:O})}catch(z){console.error(z)}}))}catch(D){console.error(D)}V()};return c.newLogFilter=f,c.newBlockFilter=g,c.newPendingTransactionFilter=p,c.uninstallFilter=A,c.getFilterChanges=v,c.getFilterLogs=E,c.destroy=()=>{H()},c;async function f(L){const O=new Ty({provider:t,params:L});return await U(O),O}async function g(){const L=new By({provider:t});return await U(L),L}async function p(){const L=new Ny({provider:t});return await U(L),L}async function v(L){const O=js(L),V=n[O];if(!V)throw new Error(`No filter for index "${O}"`);return V.getChangesAndClear()}async function E(L){const O=js(L),V=n[O];if(!V)throw new Error(`No filter for index "${O}"`);let D=[];return V.type==="log"&&(D=V.getAllResults()),D}async function A(L){const O=js(L),D=!!n[O];return D&&await F(O),D}async function U(L){const O=$r(n).length,V=await e.getLatestBlock();await L.initialize({currentBlock:V}),r++,n[r]=L,L.id=r,L.idHex=du(r);const D=$r(n).length;return x({prevFilterCount:O,newFilterCount:D}),r}async function F(L){const O=$r(n).length;delete n[L];const V=$r(n).length;x({prevFilterCount:O,newFilterCount:V})}async function H(){const L=$r(n).length;n={},x({prevFilterCount:L,newFilterCount:0})}function x({prevFilterCount:L,newFilterCount:O}){if(L===0&&O>0){e.on("sync",a);return}if(L>0&&O===0){e.removeListener("sync",a);return}}}function Us(e){return si(async(...t)=>{const r=await e(...t);return du(r.id)})}function si(e){return xy(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function Oy({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function $r(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const $y=Nn.default,{createAsyncMiddleware:uc,createScaffoldMiddleware:Fy}=xo,Dy=Ly,{unsafeRandomBytes:jy,incrementHexInt:Uy}=Hn,Hy=$o;var Wy=Vy;function Vy({blockTracker:e,provider:t}){const r={},n=Dy({blockTracker:e,provider:t});let i=!1;const s=new $y,c=Fy({eth_subscribe:uc(a),eth_unsubscribe:uc(f)});return c.destroy=p,{events:s,middleware:c};async function a(v,E){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const A=v.params[0],U=jy(16);let F;switch(A){case"newHeads":F=H({subId:U});break;case"logs":const L=v.params[1],O=await n.newLogFilter(L);F=x({subId:U,filter:O});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${A}"`)}r[U]=F,E.result=U;return;function H({subId:L}){const O={type:A,destroy:async()=>{e.removeListener("sync",O.update)},update:async({oldBlock:V,newBlock:D})=>{const z=D,te=Uy(V);(await Hy({provider:t,fromBlock:te,toBlock:z})).map(qy).filter(fe=>fe!==null).forEach(fe=>{g(L,fe)})}};return e.on("sync",O.update),O}function x({subId:L,filter:O}){return O.on("update",D=>g(L,D)),{type:A,destroy:async()=>await n.uninstallFilter(O.idHex)}}}async function f(v,E){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const A=v.params[0],U=r[A];if(!U){E.result=!1;return}delete r[A],await U.destroy(),E.result=!0}function g(v,E){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:v,result:E}})}function p(){s.removeAllListeners();for(const v in r)r[v].destroy(),delete r[v];i=!0}}function qy(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(ji,"__esModule",{value:!0});ji.SubscriptionManager=void 0;const zy=El,Gy=Wy,hc=()=>{};class Jy{constructor(t){const r=new zy.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=Gy({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,hc,hc),r}destroy(){this.subscriptionMiddleware.destroy()}}ji.SubscriptionManager=Jy;var fu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.CoinbaseWalletProvider=void 0;const Zy=fu(hi),Ky=sh,me=wn,de=X,Qy=_n,dc=wt,ni=tn,lt=Yr,Hs=fu(P0),hn=en,Yy=Jr,Xy=ji,fc="DefaultChainId",pc="DefaultJsonRpcUrl";class eb extends Ky.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new Yy.FilterPolyfill(this),this._subscriptionManager=new Xy.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,de.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const c=this._storage.getItem(dc.LOCAL_STORAGE_ADDRESSES_KEY);if(c){const a=c.split(" ");a[0]!==""&&(this._addresses=a.map(f=>(0,de.ensureAddressString)(f)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var f;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"&&a.data.data.action==="dappChainSwitched"){const g=a.data.data.chainId,p=(f=a.data.data.jsonRpcUrl)!==null&&f!==void 0?f:this.jsonRpcUrl;this.updateProviderInfo(p,Number(g))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,de.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(pc))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(pc,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(fc,r.toString(10)),((0,de.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,c){const f=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,c?.toString()).promise;return(0,lt.isErrorResponse)(f)?!1:!!f.result}async addEthereumChain(t,r,n,i,s,c){var a,f;if((0,de.ensureIntNumber)(t)===this.getChainId())return!1;const g=await this.initializeRelay(),p=g.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!p&&await g.requestEthereumAccounts().promise;const v=await g.addEthereumChain(t.toString(),r,s,n,i,c).promise;return(0,lt.isErrorResponse)(v)?!1:(((a=v.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],t),((f=v.result)===null||f===void 0?void 0:f.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,lt.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===me.standardErrorCodes.provider.unsupportedChain?me.standardErrors.provider.unsupportedChain():me.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(hn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?ni.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,me.serializeError)(i,t)})}catch(n){throw(0,me.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],c={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(c).then(a=>a.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,me.serializeError)(n,t)})}catch(n){return Promise.reject((0,me.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,me.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,me.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw me.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw me.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw me.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,de.ensureRegExpString)(t)).promise;if((0,lt.isErrorResponse)(n))throw(0,me.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,me.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,lt.isErrorResponse)(i))throw(0,me.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,me.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(hn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?ni.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof Qy.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,lt.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,lt.isErrorResponse)(n))throw(0,me.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,me.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,de.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(dc.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:t.id}))).catch(a=>n(a));return}const c=this._handleSubscriptionMethods(t);if(c!==void 0){c.then(a=>r({jsonrpc:"2.0",id:t.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var c;throw(s.code===me.standardErrorCodes.rpc.methodNotFound||s.code===me.standardErrorCodes.rpc.methodNotSupported)&&((c=this.diagnostic)===null||c===void 0||c.log(hn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?ni.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,de.ensureAddressString)(t);return this._addresses.map(i=>(0,de.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(hn.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,de.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,de.ensureAddressString)(t.to):null,i=t.value!=null?(0,de.ensureBN)(t.value):new Zy.default(0),s=t.data?(0,de.ensureBuffer)(t.data):Buffer.alloc(0),c=t.nonce!=null?(0,de.ensureIntNumber)(t.nonce):null,a=t.gasPrice!=null?(0,de.ensureBN)(t.gasPrice):null,f=t.maxFeePerGas!=null?(0,de.ensureBN)(t.maxFeePerGas):null,g=t.maxPriorityFeePerGas!=null?(0,de.ensureBN)(t.maxPriorityFeePerGas):null,p=t.gas!=null?(0,de.ensureBN)(t.gas):null,v=t.chainId?(0,de.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:c,gasPriceInWei:a,maxFeePerGas:f,maxPriorityFeePerGas:g,gasLimit:p,chainId:v}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw me.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw me.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const c=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,lt.isErrorResponse)(c))throw new Error(c.errorMessage);return{jsonrpc:"2.0",id:0,result:c.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,lt.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,de.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(fc);if(!t)return(0,de.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,de.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(hn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?ni.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,lt.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,de.ensureAddressString)(t[0]),n=(0,de.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,de.ensureBuffer)(t[0]),n=(0,de.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,de.ensureBuffer)(t[0]),n=(0,de.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,de.ensureBuffer)(t[0]),n=(0,de.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,de.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,de.ensureParsedJSONObject)(t[0]),n=(0,de.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=Hs.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,de.ensureAddressString)(t[0]),n=(0,de.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Hs.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,de.ensureAddressString)(t[0]),n=(0,de.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Hs.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,i,s;const c=t[0];if(((r=c.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!c.chainName||c.chainName.trim()==="")throw me.standardErrors.rpc.invalidParams("chainName is a required field");if(!c.nativeCurrency)throw me.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(c.chainId,16);return await this.addEthereumChain(a,(n=c.rpcUrls)!==null&&n!==void 0?n:[],(i=c.blockExplorerUrls)!==null&&i!==void 0?i:[],c.chainName,(s=c.iconUrls)!==null&&s!==void 0?s:[],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(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw me.standardErrors.rpc.invalidParams("Type is required");if(r?.type!=="ERC20")throw me.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!r?.options)throw me.standardErrors.rpc.invalidParams("Options are required");if(!r?.options.address)throw me.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:c,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,c,n)}}_eth_uninstallFilter(t){const r=(0,de.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,de.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,de.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}Vr.CoinbaseWalletProvider=eb;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.RelayEventManager=void 0;const tb=X;class rb{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,tb.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}is.RelayEventManager=rb;Object.defineProperty(pn,"__esModule",{value:!0});pn.CoinbaseWalletSDK=void 0;const nb=li,ib=ui,gc=X,sb=mi,ob=Vr,ab=_n,cb=Tn,lb=is,ub=In,hb=En,pu=Xr;class ss{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||ib.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const c=new URL(s),a=`${c.protocol}//${c.host}`;if(this._storage=new sb.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",ss.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new lb.RelayEventManager;const f=(0,gc.isMobileWeb)(),g=t.uiConstructor||(v=>f?new cb.MobileRelayUI(v):new ub.WalletLinkRelayUI(v)),p={linkAPIUrl:s,version:pu.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:g,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=f?new ab.MobileRelay(p):new hb.WalletLinkRelay(p),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||s.setConnectDisabled(!0),new ob.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,gc.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,nb.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}pn.CoinbaseWalletSDK=ss;ss.VERSION=pu.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=pn,r=Vr;var n=pn;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Vr;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(vc);const db=gu(vc),Tb=Object.freeze(Object.defineProperty({__proto__:null,default:db},Symbol.toStringTag,{value:"Module"}));export{Tb as i};