@wormhole-foundation/wormhole-connect 2.5.0-beta.15-development → 2.5.0-beta.16-development

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 (114) hide show
  1. package/dist/assets/{aptos-Cutllx5i.js → aptos-r6k7eJCM.js} +2 -2
  2. package/dist/assets/{ccip-C6cz5NqJ.js → ccip-DoYNnipC.js} +1 -1
  3. package/dist/assets/{evm-DzwJdvcV.js → evm-C5Ivowrf.js} +2 -2
  4. package/dist/assets/{evm-LJDXipdh.js → evm-DSNDNefN.js} +3 -3
  5. package/dist/assets/{index-DwJjUFus.js → index-7lgoK4KP.js} +1 -1
  6. package/dist/assets/{index-D3R8fZfr.js → index-BQQC6_X5.js} +1 -1
  7. package/dist/assets/{index-RZp63Yuv.js → index-BiBNC4RU.js} +1 -1
  8. package/dist/assets/{index-BVJL1orJ.js → index-BtCNeMnf.js} +1 -1
  9. package/dist/assets/{index-iiAA6CTH.js → index-CD-O7bSQ.js} +1 -1
  10. package/dist/assets/{index-CSiH4dly.js → index-CItGJ_dO.js} +1 -1
  11. package/dist/assets/{index-CJZzjIow.js → index-CKNeANkQ.js} +1 -1
  12. package/dist/assets/{index-C6UKJUdm.js → index-CLAfmegc.js} +1 -1
  13. package/dist/assets/{index-wwvQRwKh.js → index-Cefdj6j_.js} +1 -1
  14. package/dist/assets/{index-CqEHg303.js → index-CrZXNnmG.js} +1 -1
  15. package/dist/assets/{index-m7pOREIu.js → index-Cts3aOUg.js} +1 -1
  16. package/dist/assets/{index-BwNyYZxM.js → index-CuW_tQti.js} +1 -1
  17. package/dist/assets/{index-Ds_BlDdN.js → index-DPi-hS0A.js} +2 -2
  18. package/dist/assets/{index-BECoIARf.js → index-DQWOpudg.js} +1 -1
  19. package/dist/assets/{index-BO5vFz_J.js → index-TjYk9nid.js} +1 -1
  20. package/dist/assets/{index-EvC_Tjca.js → index-XgkrTsoW.js} +1 -1
  21. package/dist/assets/{index-Dxpp9NXJ.js → index-mE5izIg0.js} +1 -1
  22. package/dist/assets/{index.es-C9O0OD76.js → index.es-e2znZrg8.js} +6 -6
  23. package/dist/assets/solana-BNhbIgt5.js +2 -0
  24. package/dist/assets/{solana-BGWrrBcM.js → solana-DCCw_nmt.js} +2 -2
  25. package/dist/assets/solanaEmbed.esm-D6aTKNPa.js +37 -0
  26. package/dist/assets/{sui-COEHPNCD.js → sui-CqkItMnZ.js} +2 -2
  27. package/dist/assets/{tokens-CzZADlQh.js → tokens-BSV7gluG.js} +1 -1
  28. package/dist/main.js +53 -53
  29. package/lib/{aptos-CeQAnpez.mjs → aptos-B_0vi8q5.mjs} +5 -5
  30. package/lib/{aptos-DM8l3csb.js → aptos-Bq95ywod.js} +1 -1
  31. package/lib/{aptos-BQFmduMd.js → aptos-CZeHb71O.js} +2 -2
  32. package/lib/{aptos-CFJxiJmC.mjs → aptos-DT2vzzvi.mjs} +2 -2
  33. package/lib/{base64-CHhsJk6A.mjs → base64-COK36zSs.mjs} +1 -1
  34. package/lib/{base64-D9lqOebt.js → base64-CZQMgJPg.js} +1 -1
  35. package/lib/{ccip-CgZgkY8Y.js → ccip-BMWN6mUe.js} +1 -1
  36. package/lib/{ccip-DIBA7ZPU.mjs → ccip-OItyAOfS.mjs} +1 -1
  37. package/lib/{chunk-IMTC3J2M-CZ9g11yQ.mjs → chunk-IMTC3J2M-BDC_vQUG.mjs} +3 -3
  38. package/lib/{chunk-IMTC3J2M-CMDaOJhu.js → chunk-IMTC3J2M-CdK66Gd0.js} +1 -1
  39. package/lib/{evm-B4FdqIm_.js → evm-B8do5bRe.js} +2 -2
  40. package/lib/{evm-DIChhZyr.mjs → evm-BlmFliMr.mjs} +5 -5
  41. package/lib/{evm-ue5IlD46.js → evm-CQ-_bicP.js} +3 -3
  42. package/lib/{evm-Dc_rWE9Y.mjs → evm-YzP22UIh.mjs} +6 -6
  43. package/lib/{index-BVUd-qAx.js → index-9QDfPDAt.js} +1 -1
  44. package/lib/{index-D6rdTBQ_.mjs → index-B1ZLlUX_.mjs} +1 -1
  45. package/lib/{index-CJReTDxB.js → index-B2rKFKuc.js} +1 -1
  46. package/lib/{index-DGDFGoDX.mjs → index-B8-yYDbb.mjs} +2 -2
  47. package/lib/{index-DQJ5IMd3.mjs → index-B9a8iQAY.mjs} +1 -1
  48. package/lib/{index-BcZ5yPJ4.mjs → index-B9ceWZWn.mjs} +1 -1
  49. package/lib/{index-BGjIKUEk.mjs → index-BBDgOG5m.mjs} +1 -1
  50. package/lib/{index-Bnnn4cdG.mjs → index-BOD0JbTK.mjs} +15 -17
  51. package/lib/{index-D5JrYq_0.js → index-BRgpPBei.js} +1 -1
  52. package/lib/{index-B2ab2XtW.mjs → index-BRnbVNBB.mjs} +1 -1
  53. package/lib/{index-bjRbczrw.mjs → index-BTrEvW5f.mjs} +3 -3
  54. package/lib/{index-PZieeYNW.mjs → index-BW0PVtoo.mjs} +1 -1
  55. package/lib/{index-Bt1Gnf-O.mjs → index-BrjkSw_2.mjs} +2 -2
  56. package/lib/{index-Ghp7efN9.js → index-BulciDEP.js} +1 -1
  57. package/lib/{index-CRvTBc48.js → index-C-GPWLns.js} +1 -1
  58. package/lib/{index-Dcz-16pD.mjs → index-C0a9Lr6a.mjs} +2 -2
  59. package/lib/{index-DlgBKu9O.js → index-C52V666L.js} +1 -1
  60. package/lib/{index-CXtp5GKq.js → index-C6lC72hy.js} +1 -1
  61. package/lib/{index-BZyf12j0.js → index-C8i0VBfG.js} +1 -1
  62. package/lib/{index-HjrA7REP.js → index-CIL_hNIg.js} +1 -1
  63. package/lib/{index-wTziIUpS.js → index-CUgFK5ex.js} +1 -1
  64. package/lib/{index-BSsBLI7m.js → index-CUnIraeu.js} +1 -1
  65. package/lib/{index-B5xcX9Pc.js → index-CWv9euDC.js} +1 -1
  66. package/lib/{index-DkuruFPE.mjs → index-CY6GX-7w.mjs} +1 -1
  67. package/lib/{index-Bu697BJP.js → index-CliZ4E05.js} +1 -1
  68. package/lib/{index-BskY1_ip.mjs → index-CqYIha8G.mjs} +2 -2
  69. package/lib/{index-DTxneAkn.js → index-Cs5YQSh6.js} +1 -1
  70. package/lib/{index-Bo7Tv5Eo.mjs → index-CwfZcLrv.mjs} +3 -3
  71. package/lib/{index-WwuUq9Aw.js → index-D1aACi02.js} +1 -1
  72. package/lib/{index-BDu7oYbW.js → index-D4jfCW8J.js} +1 -1
  73. package/lib/{index-D5cipXo-.js → index-D74R0bwx.js} +1 -1
  74. package/lib/{index-DcaoqeHs.mjs → index-DBNmOAMs.mjs} +2 -2
  75. package/lib/{index-BCVTOYpu.mjs → index-DIql-M62.mjs} +2 -2
  76. package/lib/{index-MlkcvO4G.js → index-DIvEOa-k.js} +1 -1
  77. package/lib/{index-CsLUIX2T.mjs → index-DJILvbYp.mjs} +2 -2
  78. package/lib/{index-DekUp2hz.mjs → index-DLUeHBim.mjs} +4 -4
  79. package/lib/{index-BFSevX7g.js → index-DMhLZESv.js} +1 -1
  80. package/lib/{index-CZM3CbIN.mjs → index-DOyZRNfq.mjs} +2 -2
  81. package/lib/{index-2NJ-Uc1n.mjs → index-DhHyV5Rf.mjs} +1 -1
  82. package/lib/{index-X1wTeN-B.js → index-DoE4VQhB.js} +3 -3
  83. package/lib/{index-C9vy8VuD.js → index-Drp6LJGk.js} +1 -1
  84. package/lib/{index-DXY3TcAw.mjs → index-DtMVR4Z_.mjs} +2 -2
  85. package/lib/{index-CLwJAWXV.js → index-OvtkwIrm.js} +1 -1
  86. package/lib/{index-C4e6Tr94.mjs → index-RRzYEpPP.mjs} +1 -1
  87. package/lib/{index-CuQ35zWu.mjs → index-XZFtH_Uh.mjs} +1 -1
  88. package/lib/{index-CcgIIKqT.js → index-_UjA-Vft.js} +1 -1
  89. package/lib/{index-B5ZPnsOX.js → index-f2frXUPl.js} +1 -1
  90. package/lib/{index-DVI7iWJA.mjs → index-qdz_PIx9.mjs} +1 -1
  91. package/lib/{index.es-CQrihLMh.mjs → index.es-D2nwWIpj.mjs} +5 -5
  92. package/lib/{index.es-BFV_Hq98.js → index.es-DLocQOXa.js} +2 -2
  93. package/lib/index.js +1 -1
  94. package/lib/index.mjs +1 -1
  95. package/lib/{signer-BGahG9Lx.mjs → signer-DJ1HF-CK.mjs} +1 -1
  96. package/lib/{signer-DVlvBrTY.js → signer-DZOcy7cH.js} +1 -1
  97. package/lib/{solana-DZVSRj8-.mjs → solana-CFnSQELF.mjs} +4 -4
  98. package/lib/solana-CrWCptDL.mjs +17 -0
  99. package/lib/{solana-25r-MPDz.js → solana-Ct8Sn9KJ.js} +1 -1
  100. package/lib/solana-CyM9Bqyp.js +1 -0
  101. package/lib/{solanaEmbed.esm-D6F7GU7N.js → solanaEmbed.esm-BD__0VpK.js} +1 -1
  102. package/lib/{solanaEmbed.esm-ea6sDZ8N.mjs → solanaEmbed.esm-CPaTID-O.mjs} +2 -2
  103. package/lib/{sui-ZMZ9Uq_a.js → sui-Bh4bUzgA.js} +1 -1
  104. package/lib/{sui-BHAlSArP.js → sui-CbwKq8Oh.js} +1 -1
  105. package/lib/{sui-CG9oss4-.mjs → sui-Da5D6kut.mjs} +1 -1
  106. package/lib/{sui-9tHCVvtM.mjs → sui-DnkD0Bxo.mjs} +5 -5
  107. package/lib/{tokens-BZf6dpqe.mjs → tokens-C4Y28hR0.mjs} +2 -2
  108. package/lib/{tokens-B2mOzW4r.js → tokens-CAwPmit8.js} +1 -1
  109. package/package.json +1 -1
  110. package/dist/assets/events-MYC_Tkdh.js +0 -1
  111. package/dist/assets/solana-B0Eox3vZ.js +0 -2
  112. package/dist/assets/solanaEmbed.esm-C9Mwa0DJ.js +0 -37
  113. package/lib/solana-5YorGJTB.mjs +0 -17
  114. package/lib/solana-Dg31-6OS.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const ge=require("./index-C9vy8VuD.js"),$=require("./index-X1wTeN-B.js");function Rn(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Fo(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=Rn(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}const Zr={...ge.identityBase,...ge.base2,...ge.base8,...ge.base10,...ge.base16,...ge.base32,...ge.base36,...ge.base58,...ge.base64,...ge.base256emoji};function Ln(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Yr=Ln("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),er=Ln("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Rn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Pn={utf8:Yr,"utf-8":Yr,hex:Zr.base16,latin1:er,ascii:er,binary:er,...Zr};function So(e,t="utf8"){const r=Pn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}function Ao(e,t="utf8"){const r=Pn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var Xr=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},Bo=function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e}(),Io=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=$.dist.process.platform}return e}(),Oo=function(){function e(t,r,n,i){this.name=t,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return e}(),To=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Co=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Ro=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Lo=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Qr=3,Po=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Ro]],en=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function jo(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Co:typeof navigator<"u"?zo(navigator.userAgent):Do()}function No(e){return e!==""&&Po.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1)}function zo(e){var t=No(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new To;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Qr&&(i=Xr(Xr([],i,!0),Mo(Qr-i.length),!0)):i=[];var o=i.join("."),f=Uo(e),d=Lo.exec(e);return d&&d[1]?new Oo(r,o,f,d[1]):new Bo(r,o,f)}function Uo(e){for(var t=0,r=en.length;t<r;t++){var n=en[t],i=n[0],o=n[1],f=o.exec(e);if(f)return i}return null}function Do(){var e=typeof $.dist.process<"u"&&$.dist.process.version;return e?new Io($.dist.process.version.slice(1)):null}function Mo(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}const $o={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},Ko=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Ho=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Wo=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Go(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Vo(e);return}return t}function Vo(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function At(e,t={}){if(typeof e!="string")return e;const r=e.trim();if(e[0]==='"'&&e.endsWith('"')&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!Wo.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(Ko.test(e)||Ho.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,Go)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function qo(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Y(e,...t){try{return qo(e(...t))}catch(r){return Promise.reject(r)}}function Jo(e){const t=typeof e;return e===null||t!=="object"&&t!=="function"}function ko(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function Rt(e){if(Jo(e))return String(e);if(ko(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Rt(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const hr="base64:";function Zo(e){return typeof e=="string"?e:hr+Qo(e)}function Yo(e){return typeof e!="string"||!e.startsWith(hr)?e:Xo(e.slice(hr.length))}function Xo(e){return globalThis.Buffer?$.dist.Buffer.from(e,"base64"):Uint8Array.from(globalThis.atob(e),t=>t.codePointAt(0))}function Qo(e){return globalThis.Buffer?$.dist.Buffer.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function oe(e){var t;return e&&((t=e.split("?")[0])==null?void 0:t.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function es(...e){return oe(e.join(":"))}function Bt(e){return e=oe(e),e?e+":":""}const ts="memory",rs=()=>{const e=new Map;return{name:ts,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}};function ns(e={}){const t={mounts:{"":e.driver||rs()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=a=>{for(const u of t.mountpoints)if(a.startsWith(u))return{base:u,relativeKey:a.slice(u.length),driver:t.mounts[u]};return{base:"",relativeKey:a,driver:t.mounts[""]}},n=(a,u)=>t.mountpoints.filter(h=>h.startsWith(a)||u&&a.startsWith(h)).map(h=>({relativeBase:a.length>h.length?a.slice(h.length):void 0,mountpoint:h,driver:t.mounts[h]})),i=(a,u)=>{if(t.watching){u=oe(u);for(const h of t.watchListeners)h(a,u)}},o=async()=>{if(!t.watching){t.watching=!0;for(const a in t.mounts)t.unwatch[a]=await tn(t.mounts[a],i,a)}},f=async()=>{if(t.watching){for(const a in t.unwatch)await t.unwatch[a]();t.unwatch={},t.watching=!1}},d=(a,u,h)=>{const p=new Map,b=g=>{let _=p.get(g.base);return _||(_={driver:g.driver,base:g.base,items:[]},p.set(g.base,_)),_};for(const g of a){const _=typeof g=="string",O=oe(_?g:g.key),R=_?void 0:g.value,T=_||!g.options?u:{...u,...g.options},m=r(O);b(m).items.push({key:O,value:R,relativeKey:m.relativeKey,options:T})}return Promise.all([...p.values()].map(g=>h(g))).then(g=>g.flat())},c={hasItem(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return Y(p.hasItem,h,u)},getItem(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return Y(p.getItem,h,u).then(b=>At(b))},getItems(a,u={}){return d(a,u,h=>h.driver.getItems?Y(h.driver.getItems,h.items.map(p=>({key:p.relativeKey,options:p.options})),u).then(p=>p.map(b=>({key:es(h.base,b.key),value:At(b.value)}))):Promise.all(h.items.map(p=>Y(h.driver.getItem,p.relativeKey,p.options).then(b=>({key:p.key,value:At(b)})))))},getItemRaw(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return p.getItemRaw?Y(p.getItemRaw,h,u):Y(p.getItem,h,u).then(b=>Yo(b))},async setItem(a,u,h={}){if(u===void 0)return c.removeItem(a);a=oe(a);const{relativeKey:p,driver:b}=r(a);b.setItem&&(await Y(b.setItem,p,Rt(u),h),b.watch||i("update",a))},async setItems(a,u){await d(a,u,async h=>{if(h.driver.setItems)return Y(h.driver.setItems,h.items.map(p=>({key:p.relativeKey,value:Rt(p.value),options:p.options})),u);h.driver.setItem&&await Promise.all(h.items.map(p=>Y(h.driver.setItem,p.relativeKey,Rt(p.value),p.options)))})},async setItemRaw(a,u,h={}){if(u===void 0)return c.removeItem(a,h);a=oe(a);const{relativeKey:p,driver:b}=r(a);if(b.setItemRaw)await Y(b.setItemRaw,p,u,h);else if(b.setItem)await Y(b.setItem,p,Zo(u),h);else return;b.watch||i("update",a)},async removeItem(a,u={}){typeof u=="boolean"&&(u={removeMeta:u}),a=oe(a);const{relativeKey:h,driver:p}=r(a);p.removeItem&&(await Y(p.removeItem,h,u),(u.removeMeta||u.removeMata)&&await Y(p.removeItem,h+"$",u),p.watch||i("remove",a))},async getMeta(a,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),a=oe(a);const{relativeKey:h,driver:p}=r(a),b=Object.create(null);if(p.getMeta&&Object.assign(b,await Y(p.getMeta,h,u)),!u.nativeOnly){const g=await Y(p.getItem,h+"$",u).then(_=>At(_));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(b,g))}return b},setMeta(a,u,h={}){return this.setItem(a+"$",u,h)},removeMeta(a,u={}){return this.removeItem(a+"$",u)},async getKeys(a,u={}){a=Bt(a);const h=n(a,!0);let p=[];const b=[];for(const g of h){const _=await Y(g.driver.getKeys,g.relativeBase,u);for(const O of _){const R=g.mountpoint+oe(O);p.some(T=>R.startsWith(T))||b.push(R)}p=[g.mountpoint,...p.filter(O=>!O.startsWith(g.mountpoint))]}return a?b.filter(g=>g.startsWith(a)&&g[g.length-1]!=="$"):b.filter(g=>g[g.length-1]!=="$")},async clear(a,u={}){a=Bt(a),await Promise.all(n(a,!1).map(async h=>{if(h.driver.clear)return Y(h.driver.clear,h.relativeBase,u);if(h.driver.removeItem){const p=await h.driver.getKeys(h.relativeBase||"",u);return Promise.all(p.map(b=>h.driver.removeItem(b,u)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(a=>rn(a)))},async watch(a){return await o(),t.watchListeners.push(a),async()=>{t.watchListeners=t.watchListeners.filter(u=>u!==a),t.watchListeners.length===0&&await f()}},async unwatch(){t.watchListeners=[],await f()},mount(a,u){if(a=Bt(a),a&&t.mounts[a])throw new Error(`already mounted at ${a}`);return a&&(t.mountpoints.push(a),t.mountpoints.sort((h,p)=>p.length-h.length)),t.mounts[a]=u,t.watching&&Promise.resolve(tn(u,i,a)).then(h=>{t.unwatch[a]=h}).catch(console.error),c},async unmount(a,u=!0){var h,p;a=Bt(a),!(!a||!t.mounts[a])&&(t.watching&&a in t.unwatch&&((p=(h=t.unwatch)[a])==null||p.call(h),delete t.unwatch[a]),u&&await rn(t.mounts[a]),t.mountpoints=t.mountpoints.filter(b=>b!==a),delete t.mounts[a])},getMount(a=""){a=oe(a)+":";const u=r(a);return{driver:u.driver,base:u.base}},getMounts(a="",u={}){return a=oe(a),n(a,u.parents).map(p=>({driver:p.driver,base:p.mountpoint}))},keys:(a,u={})=>c.getKeys(a,u),get:(a,u={})=>c.getItem(a,u),set:(a,u,h={})=>c.setItem(a,u,h),has:(a,u={})=>c.hasItem(a,u),del:(a,u={})=>c.removeItem(a,u),remove:(a,u={})=>c.removeItem(a,u)};return c}function tn(e,t,r){return e.watch?e.watch((n,i)=>t(n,r+i)):()=>{}}async function rn(e){typeof e.dispose=="function"&&await Y(e.dispose)}function Me(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function jn(e,t){const r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);const n=Me(r);return(i,o)=>n.then(f=>o(f.transaction(t,i).objectStore(t)))}let tr;function ut(){return tr||(tr=jn("keyval-store","keyval")),tr}function nn(e,t=ut()){return t("readonly",r=>Me(r.get(e)))}function is(e,t,r=ut()){return r("readwrite",n=>(n.put(t,e),Me(n.transaction)))}function os(e,t=ut()){return t("readwrite",r=>(r.delete(e),Me(r.transaction)))}function ss(e=ut()){return e("readwrite",t=>(t.clear(),Me(t.transaction)))}function as(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},Me(e.transaction)}function us(e=ut()){return e("readonly",t=>{if(t.getAllKeys)return Me(t.getAllKeys());const r=[];return as(t,n=>r.push(n.key)).then(()=>r)})}const cs=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),fs=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Nn(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return fs(e)}catch{return e}}function zn(e){return typeof e=="string"?e:cs(e)||""}const ls="idb-keyval";var hs=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",r=i=>t+i;let n;return e.dbName&&e.storeName&&(n=jn(e.dbName,e.storeName)),{name:ls,options:e,async hasItem(i){return!(typeof await nn(r(i),n)>"u")},async getItem(i){return await nn(r(i),n)??null},setItem(i,o){return is(r(i),o,n)},removeItem(i){return os(r(i),n)},getKeys(){return us(n)},clear(){return ss(n)}}};const ds="WALLET_CONNECT_V2_INDEXED_DB",ps="keyvaluestorage";let gs=class{constructor(){this.indexedDb=ns({driver:hs({dbName:ds,storeName:ps})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const r=await this.indexedDb.getItem(t);if(r!==null)return r}async setItem(t,r){await this.indexedDb.setItem(t,zn(r))}async removeItem(t){await this.indexedDb.removeItem(t)}};var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof $.dist.global<"u"?$.dist.global:typeof self<"u"?self:{},Lt={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},e.prototype.setItem=function(r,n){this[r]=String(n)},e.prototype.removeItem=function(r){delete this[r]},e.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},e.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof rr<"u"&&rr.localStorage?Lt.exports=rr.localStorage:typeof window<"u"&&window.localStorage?Lt.exports=window.localStorage:Lt.exports=new t})();function bs(e){var t;return[e[0],Nn((t=e[1])!=null?t:"")]}let ys=class{constructor(){this.localStorage=Lt.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(bs)}async getItem(t){const r=this.localStorage.getItem(t);if(r!==null)return Nn(r)}async setItem(t,r){this.localStorage.setItem(t,zn(r))}async removeItem(t){this.localStorage.removeItem(t)}};const ws="wc_storage_version",on=1,ms=async(e,t,r)=>{const n=ws,i=await t.getItem(n);if(i&&i>=on){r(t);return}const o=await e.getKeys();if(!o.length){r(t);return}const f=[];for(;o.length;){const d=o.shift();if(!d)continue;const c=d.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const a=await e.getItem(d);await t.setItem(d,a),f.push(d)}}await t.setItem(n,on),r(t),vs(e,f)},vs=async(e,t)=>{t.length&&t.forEach(async r=>{await e.removeItem(r)})};class _s{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const t=new ys;this.storage=t;try{const r=new gs;ms(t,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,r){return await this.initialize(),this.storage.setItem(t,r)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),t())},20)})}}class Es{}function xs(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Fs=Ss;function Ss(e,t,r){var n=r&&r.stringify||xs,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var f=new Array(o);f[0]=n(e);for(var d=1;d<o;d++)f[d]=n(t[d]);return f.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var a="",u=1-i,h=-1,p=e&&e.length||0,b=0;b<p;){if(e.charCodeAt(b)===37&&b+1<p){switch(h=h>-1?h:0,e.charCodeAt(b+1)){case 100:case 102:if(u>=c||t[u]==null)break;h<b&&(a+=e.slice(h,b)),a+=Number(t[u]),h=b+2,b++;break;case 105:if(u>=c||t[u]==null)break;h<b&&(a+=e.slice(h,b)),a+=Math.floor(Number(t[u])),h=b+2,b++;break;case 79:case 111:case 106:if(u>=c||t[u]===void 0)break;h<b&&(a+=e.slice(h,b));var g=typeof t[u];if(g==="string"){a+="'"+t[u]+"'",h=b+2,b++;break}if(g==="function"){a+=t[u].name||"<anonymous>",h=b+2,b++;break}a+=n(t[u]),h=b+2,b++;break;case 115:if(u>=c)break;h<b&&(a+=e.slice(h,b)),a+=String(t[u]),h=b+2,b++;break;case 37:h<b&&(a+=e.slice(h,b)),a+="%",h=b+2,b++,u--;break}++u}++b}return h===-1?e:(h<p&&(a+=e.slice(h)),a)}const sn=Fs;var Ve=ve;const ot=js().console||{},As={mapHttpRequest:It,mapHttpResponse:It,wrapRequestSerializer:nr,wrapResponseSerializer:nr,wrapErrorSerializer:nr,req:It,res:It,err:Cs};function Bs(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function ve(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const r=e.browser.write||ot;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},i=Bs(e.browser.serialize,n);let o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const f=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),e.enabled===!1&&(e.level="silent");const d=e.level||"info",c=Object.create(r);c.log||(c.log=st),Object.defineProperty(c,"levelVal",{get:u}),Object.defineProperty(c,"level",{get:h,set:p});const a={transmit:t,serialize:i,asObject:e.browser.asObject,levels:f,timestamp:Rs(e)};c.levels=ve.levels,c.level=d,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=st,c.serializers=n,c._serialize=i,c._stdErrSerialize=o,c.child=b,t&&(c._logEvent=dr());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function h(){return this._level}function p(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,He(a,c,"error","log"),He(a,c,"fatal","error"),He(a,c,"warn","error"),He(a,c,"info","log"),He(a,c,"debug","log"),He(a,c,"trace","log")}function b(g,_){if(!g)throw new Error("missing bindings for child Pino");_=_||{},i&&g.serializers&&(_.serializers=g.serializers);const O=_.serializers;if(i&&O){var R=Object.assign({},n,O),T=e.browser.serialize===!0?Object.keys(R):i;delete g.serializers,Mt([g],T,R,this._stdErrSerialize)}function m(I){this._childLevel=(I._childLevel|0)+1,this.error=We(I,g,"error"),this.fatal=We(I,g,"fatal"),this.warn=We(I,g,"warn"),this.info=We(I,g,"info"),this.debug=We(I,g,"debug"),this.trace=We(I,g,"trace"),R&&(this.serializers=R,this._serialize=T),t&&(this._logEvent=dr([].concat(I._logEvent.bindings,g)))}return m.prototype=this,new m(this)}return c}ve.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};ve.stdSerializers=As;ve.stdTimeFunctions=Object.assign({},{nullTime:Un,epochTime:Dn,unixTime:Ls,isoTime:Ps});function He(e,t,r,n){const i=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?st:i[r]?i[r]:ot[r]||ot[n]||st,Is(e,t,r)}function Is(e,t,r){!e.transmit&&t[r]===st||(t[r]=function(n){return function(){const o=e.timestamp(),f=new Array(arguments.length),d=Object.getPrototypeOf&&Object.getPrototypeOf(this)===ot?ot:this;for(var c=0;c<f.length;c++)f[c]=arguments[c];if(e.serialize&&!e.asObject&&Mt(f,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?n.call(d,Os(this,r,f,o)):n.apply(d,f),e.transmit){const a=e.transmit.level||t.level,u=ve.levels.values[a],h=ve.levels.values[r];if(h<u)return;Ts(this,{ts:o,methodLevel:r,methodValue:h,transmitValue:ve.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},f)}}}(t[r]))}function Os(e,t,r,n){e._serialize&&Mt(r,e._serialize,e.serializers,e._stdErrSerialize);const i=r.slice();let o=i[0];const f={};n&&(f.time=n),f.level=ve.levels.values[t];let d=(e._childLevel|0)+1;if(d<1&&(d=1),o!==null&&typeof o=="object"){for(;d--&&typeof i[0]=="object";)Object.assign(f,i.shift());o=i.length?sn(i.shift(),i):void 0}else typeof o=="string"&&(o=sn(i.shift(),i));return o!==void 0&&(f.msg=o),f}function Mt(e,t,r,n){for(const i in e)if(n&&e[i]instanceof Error)e[i]=ve.stdSerializers.err(e[i]);else if(typeof e[i]=="object"&&!Array.isArray(e[i]))for(const o in e[i])t&&t.indexOf(o)>-1&&o in r&&(e[i][o]=r[o](e[i][o]))}function We(e,t,r){return function(){const n=new Array(1+arguments.length);n[0]=t;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return e[r].apply(this,n)}}function Ts(e,t,r){const n=t.send,i=t.ts,o=t.methodLevel,f=t.methodValue,d=t.val,c=e._logEvent.bindings;Mt(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(a){return c.indexOf(a)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=f,n(o,e._logEvent,d),e._logEvent=dr(c)}function dr(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Cs(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)t[r]===void 0&&(t[r]=e[r]);return t}function Rs(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Un:Dn}function It(){return{}}function nr(e){return e}function st(){}function Un(){return!1}function Dn(){return Date.now()}function Ls(){return Math.round(Date.now()/1e3)}function Ps(){return new Date(Date.now()).toISOString()}function js(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const Er=$.getDefaultExportFromCjs(Ve),Ns=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r);function an(e){return typeof e=="string"?e:Ns(e)||""}const zs={level:"info"},ct="custom_context",xr=1e3*1024;class Us{constructor(t){this.nodeValue=t,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class un{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const r=new Us(t);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let r=this.head;for(;r!==null;)t.push(r.value),r=r.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const r=t.value;return t=t.next,{done:!1,value:r}}}}}class Mn{constructor(t,r=xr){this.level=t??"error",this.levelValue=Ve.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new un(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,r){r===Ve.levels.values.error?console.error(t):r===Ve.levels.values.warn?console.warn(t):r===Ve.levels.values.debug?console.debug(t):r===Ve.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(an({timestamp:new Date().toISOString(),log:t}));const r=typeof t=="string"?JSON.parse(t).level:t.level;r>=this.levelValue&&this.forwardToConsole(t,r)}getLogs(){return this.logs}clearLogs(){this.logs=new un(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const r=this.getLogArray();return r.push(an({extraMetadata:t})),new Blob(r,{type:"application/json"})}}class Ds{constructor(t,r=xr){this.baseChunkLogger=new Mn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const r=URL.createObjectURL(this.logsToBlob(t)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}class Ms{constructor(t,r=xr){this.baseChunkLogger=new Mn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}}var $s=Object.defineProperty,Ks=Object.defineProperties,Hs=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,Ws=Object.prototype.hasOwnProperty,Gs=Object.prototype.propertyIsEnumerable,fn=(e,t,r)=>t in e?$s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jt=(e,t)=>{for(var r in t||(t={}))Ws.call(t,r)&&fn(e,r,t[r]);if(cn)for(var r of cn(t))Gs.call(t,r)&&fn(e,r,t[r]);return e},Nt=(e,t)=>Ks(e,Hs(t));function Vs(e){return Nt(jt({},e),{level:(e==null?void 0:e.level)||zs.level})}function qs(e,t=ct){return e[t]||""}function Js(e,t,r=ct){return e[r]=t,e}function $n(e,t=ct){let r="";return typeof e.bindings>"u"?r=qs(e,t):r=e.bindings().context||"",r}function ks(e,t,r=ct){const n=$n(e,r);return n.trim()?`${n}/${t}`:t}function Zs(e,t,r=ct){const n=ks(e,t,r),i=e.child({context:n});return Js(i,n,r)}function Ys(e){var t,r;const n=new Ds((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Er(Nt(jt({},e.opts),{level:"trace",browser:Nt(jt({},(r=e.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function Xs(e){var t;const r=new Ms((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Er(Nt(jt({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}function Qs(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?Ys(e):Xs(e)}const ea=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),ta=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function ra(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return ta(e)}catch{return e}}function na(e){return typeof e=="string"?e:ea(e)||""}function ia(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Kn(e,...t){if(!ia(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ln(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function oa(e,t){Kn(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const Ge=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ir=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function sa(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Hn(e){return typeof e=="string"&&(e=sa(e)),Kn(e),e}class aa{clone(){return this._cloneInto()}}function ua(e){const t=n=>e().update(Hn(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Wn(e=32){if(Ge&&typeof Ge.getRandomValues=="function")return Ge.getRandomValues(new Uint8Array(e));if(Ge&&typeof Ge.randomBytes=="function")return Ge.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function ca(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),f=Number(r>>i&o),d=Number(r&o),c=n?4:0,a=n?0:4;e.setUint32(t+c,f,n),e.setUint32(t+a,d,n)}class fa extends aa{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ir(this.buffer)}update(t){ln(this);const{view:r,buffer:n,blockLen:i}=this;t=Hn(t);const o=t.length;for(let f=0;f<o;){const d=Math.min(i-this.pos,o-f);if(d===i){const c=ir(t);for(;i<=o-f;f+=i)this.process(c,f);continue}n.set(t.subarray(f,f+d),this.pos),this.pos+=d,f+=d,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ln(this),oa(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:o}=this;let{pos:f}=this;r[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>i-f&&(this.process(n,0),f=0);for(let h=f;h<i;h++)r[h]=0;ca(n,i-8,BigInt(this.length*8),o),this.process(n,0);const d=ir(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const a=c/4,u=this.get();if(a>u.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<a;h++)d.setUint32(4*h,u[h],o)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:o,destroyed:f,pos:d}=this;return t.length=i,t.pos=d,t.finished=o,t.destroyed=f,i%r&&t.buffer.set(n),t}}const Ot=BigInt(2**32-1),pr=BigInt(32);function Gn(e,t=!1){return t?{h:Number(e&Ot),l:Number(e>>pr&Ot)}:{h:Number(e>>pr&Ot)|0,l:Number(e&Ot)|0}}function la(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:f}=Gn(e[i],t);[r[i],n[i]]=[o,f]}return[r,n]}const ha=(e,t)=>BigInt(e>>>0)<<pr|BigInt(t>>>0),da=(e,t,r)=>e>>>r,pa=(e,t,r)=>e<<32-r|t>>>r,ga=(e,t,r)=>e>>>r|t<<32-r,ba=(e,t,r)=>e<<32-r|t>>>r,ya=(e,t,r)=>e<<64-r|t>>>r-32,wa=(e,t,r)=>e>>>r-32|t<<64-r,ma=(e,t)=>t,va=(e,t)=>e,_a=(e,t,r)=>e<<r|t>>>32-r,Ea=(e,t,r)=>t<<r|e>>>32-r,xa=(e,t,r)=>t<<r-32|e>>>64-r,Fa=(e,t,r)=>e<<r-32|t>>>64-r;function Sa(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const Aa=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Ba=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Ia=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Oa=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,Ta=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Ca=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,B={fromBig:Gn,split:la,toBig:ha,shrSH:da,shrSL:pa,rotrSH:ga,rotrSL:ba,rotrBH:ya,rotrBL:wa,rotr32H:ma,rotr32L:va,rotlSH:_a,rotlSL:Ea,rotlBH:xa,rotlBL:Fa,add:Sa,add3L:Aa,add3H:Ba,add4L:Ia,add4H:Oa,add5H:Ca,add5L:Ta},[Ra,La]=B.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Ce=new Uint32Array(80),Re=new Uint32Array(80);class Pa extends fa{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:i,Ch:o,Cl:f,Dh:d,Dl:c,Eh:a,El:u,Fh:h,Fl:p,Gh:b,Gl:g,Hh:_,Hl:O}=this;return[t,r,n,i,o,f,d,c,a,u,h,p,b,g,_,O]}set(t,r,n,i,o,f,d,c,a,u,h,p,b,g,_,O){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=f|0,this.Dh=d|0,this.Dl=c|0,this.Eh=a|0,this.El=u|0,this.Fh=h|0,this.Fl=p|0,this.Gh=b|0,this.Gl=g|0,this.Hh=_|0,this.Hl=O|0}process(t,r){for(let m=0;m<16;m++,r+=4)Ce[m]=t.getUint32(r),Re[m]=t.getUint32(r+=4);for(let m=16;m<80;m++){const I=Ce[m-15]|0,z=Re[m-15]|0,H=B.rotrSH(I,z,1)^B.rotrSH(I,z,8)^B.shrSH(I,z,7),G=B.rotrSL(I,z,1)^B.rotrSL(I,z,8)^B.shrSL(I,z,7),U=Ce[m-2]|0,V=Re[m-2]|0,be=B.rotrSH(U,V,19)^B.rotrBH(U,V,61)^B.shrSH(U,V,6),ye=B.rotrSL(U,V,19)^B.rotrBL(U,V,61)^B.shrSL(U,V,6),fe=B.add4L(G,ye,Re[m-7],Re[m-16]),Le=B.add4H(fe,H,be,Ce[m-7],Ce[m-16]);Ce[m]=Le|0,Re[m]=fe|0}let{Ah:n,Al:i,Bh:o,Bl:f,Ch:d,Cl:c,Dh:a,Dl:u,Eh:h,El:p,Fh:b,Fl:g,Gh:_,Gl:O,Hh:R,Hl:T}=this;for(let m=0;m<80;m++){const I=B.rotrSH(h,p,14)^B.rotrSH(h,p,18)^B.rotrBH(h,p,41),z=B.rotrSL(h,p,14)^B.rotrSL(h,p,18)^B.rotrBL(h,p,41),H=h&b^~h&_,G=p&g^~p&O,U=B.add5L(T,z,G,La[m],Re[m]),V=B.add5H(U,R,I,H,Ra[m],Ce[m]),be=U|0,ye=B.rotrSH(n,i,28)^B.rotrBH(n,i,34)^B.rotrBH(n,i,39),fe=B.rotrSL(n,i,28)^B.rotrBL(n,i,34)^B.rotrBL(n,i,39),Le=n&o^n&d^o&d,Je=i&f^i&c^f&c;R=_|0,T=O|0,_=b|0,O=g|0,b=h|0,g=p|0,{h,l:p}=B.add(a|0,u|0,V|0,be|0),a=d|0,u=c|0,d=o|0,c=f|0,o=n|0,f=i|0;const x=B.add3L(be,fe,Je);n=B.add3H(x,V,ye,Le),i=x|0}({h:n,l:i}=B.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:f}=B.add(this.Bh|0,this.Bl|0,o|0,f|0),{h:d,l:c}=B.add(this.Ch|0,this.Cl|0,d|0,c|0),{h:a,l:u}=B.add(this.Dh|0,this.Dl|0,a|0,u|0),{h,l:p}=B.add(this.Eh|0,this.El|0,h|0,p|0),{h:b,l:g}=B.add(this.Fh|0,this.Fl|0,b|0,g|0),{h:_,l:O}=B.add(this.Gh|0,this.Gl|0,_|0,O|0),{h:R,l:T}=B.add(this.Hh|0,this.Hl|0,R|0,T|0),this.set(n,i,o,f,d,c,a,u,h,p,b,g,_,O,R,T)}roundClean(){Ce.fill(0),Re.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const ja=ua(()=>new Pa);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Fr=BigInt(0),Vn=BigInt(1),Na=BigInt(2);function Sr(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ar(e){if(!Sr(e))throw new Error("Uint8Array expected")}function or(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const za=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Br(e){Ar(e);let t="";for(let r=0;r<e.length;r++)t+=za[e[r]];return t}function qn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Fr:BigInt("0x"+e)}const xe={_0:48,_9:57,A:65,F:70,a:97,f:102};function hn(e){if(e>=xe._0&&e<=xe._9)return e-xe._0;if(e>=xe.A&&e<=xe.F)return e-(xe.A-10);if(e>=xe.a&&e<=xe.f)return e-(xe.a-10)}function Jn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){const f=hn(e.charCodeAt(o)),d=hn(e.charCodeAt(o+1));if(f===void 0||d===void 0){const c=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}n[i]=f*16+d}return n}function Ua(e){return qn(Br(e))}function Pt(e){return Ar(e),qn(Br(Uint8Array.from(e).reverse()))}function kn(e,t){return Jn(e.toString(16).padStart(t*2,"0"))}function gr(e,t){return kn(e,t).reverse()}function Fe(e,t,r){let n;if(typeof t=="string")try{n=Jn(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else if(Sr(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(e+" of length "+r+" expected, got "+i);return n}function dn(...e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];Ar(i),t+=i.length}const r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){const o=e[n];r.set(o,i),i+=o.length}return r}const sr=e=>typeof e=="bigint"&&Fr<=e;function Da(e,t,r){return sr(e)&&sr(t)&&sr(r)&&t<=e&&e<r}function nt(e,t,r,n){if(!Da(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function Ma(e){let t;for(t=0;e>Fr;e>>=Vn,t+=1);return t}const $a=e=>(Na<<BigInt(e-1))-Vn,Ka={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Sr(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ir(e,t,r={}){const n=(i,o,f)=>{const d=Ka[o];if(typeof d!="function")throw new Error("invalid validator function");const c=e[i];if(!(f&&c===void 0)&&!d(c,e))throw new Error("param "+String(i)+" is invalid. Expected "+o+", got "+c)};for(const[i,o]of Object.entries(t))n(i,o,!1);for(const[i,o]of Object.entries(r))n(i,o,!0);return e}function pn(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(i!==void 0)return i;const o=e(r,...n);return t.set(r,o),o}}const X=BigInt(0),q=BigInt(1),De=BigInt(2),Ha=BigInt(3),br=BigInt(4),gn=BigInt(5),bn=BigInt(8);function k(e,t){const r=e%t;return r>=X?r:t+r}function Wa(e,t,r){if(t<X)throw new Error("invalid exponent, negatives unsupported");if(r<=X)throw new Error("invalid modulus");if(r===q)return X;let n=q;for(;t>X;)t&q&&(n=n*e%r),e=e*e%r,t>>=q;return n}function me(e,t,r){let n=e;for(;t-- >X;)n*=n,n%=r;return n}function yn(e,t){if(e===X)throw new Error("invert: expected non-zero number");if(t<=X)throw new Error("invert: expected positive modulus, got "+t);let r=k(e,t),n=t,i=X,o=q;for(;r!==X;){const f=n/r,d=n%r,c=i-o*f;n=r,r=d,i=o,o=c}if(n!==q)throw new Error("invert: does not exist");return k(i,t)}function Ga(e){const t=(e-q)/De;let r,n,i;for(r=e-q,n=0;r%De===X;r/=De,n++);for(i=De;i<e&&Wa(i,t,e)!==e-q;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const f=(e+q)/br;return function(d,c){const a=d.pow(c,f);if(!d.eql(d.sqr(a),c))throw new Error("Cannot find square root");return a}}const o=(r+q)/De;return function(f,d){if(f.pow(d,t)===f.neg(f.ONE))throw new Error("Cannot find square root");let c=n,a=f.pow(f.mul(f.ONE,i),r),u=f.pow(d,o),h=f.pow(d,r);for(;!f.eql(h,f.ONE);){if(f.eql(h,f.ZERO))return f.ZERO;let p=1;for(let g=f.sqr(h);p<c&&!f.eql(g,f.ONE);p++)g=f.sqr(g);const b=f.pow(a,q<<BigInt(c-p-1));a=f.sqr(b),u=f.mul(u,b),h=f.mul(h,a),c=p}return u}}function Va(e){if(e%br===Ha){const t=(e+q)/br;return function(r,n){const i=r.pow(n,t);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(e%bn===gn){const t=(e-gn)/bn;return function(r,n){const i=r.mul(n,De),o=r.pow(i,t),f=r.mul(n,o),d=r.mul(r.mul(f,De),o),c=r.mul(f,r.sub(d,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return Ga(e)}const qa=(e,t)=>(k(e,t)&q)===q,Ja=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ka(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Ja.reduce((n,i)=>(n[i]="function",n),t);return Ir(e,r)}function Za(e,t,r){if(r<X)throw new Error("invalid exponent, negatives unsupported");if(r===X)return e.ONE;if(r===q)return t;let n=e.ONE,i=t;for(;r>X;)r&q&&(n=e.mul(n,i)),i=e.sqr(i),r>>=q;return n}function Ya(e,t){const r=new Array(t.length),n=t.reduce((o,f,d)=>e.is0(f)?o:(r[d]=o,e.mul(o,f)),e.ONE),i=e.inv(n);return t.reduceRight((o,f,d)=>e.is0(f)?o:(r[d]=e.mul(o,r[d]),e.mul(o,f)),i),r}function Zn(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Yn(e,t,r=!1,n={}){if(e<=X)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:i,nByteLength:o}=Zn(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let f;const d=Object.freeze({ORDER:e,isLE:r,BITS:i,BYTES:o,MASK:$a(i),ZERO:X,ONE:q,create:c=>k(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return X<=c&&c<e},is0:c=>c===X,isOdd:c=>(c&q)===q,neg:c=>k(-c,e),eql:(c,a)=>c===a,sqr:c=>k(c*c,e),add:(c,a)=>k(c+a,e),sub:(c,a)=>k(c-a,e),mul:(c,a)=>k(c*a,e),pow:(c,a)=>Za(d,c,a),div:(c,a)=>k(c*yn(a,e),e),sqrN:c=>c*c,addN:(c,a)=>c+a,subN:(c,a)=>c-a,mulN:(c,a)=>c*a,inv:c=>yn(c,e),sqrt:n.sqrt||(c=>(f||(f=Va(e)),f(d,c))),invertBatch:c=>Ya(d,c),cmov:(c,a,u)=>u?a:c,toBytes:c=>r?gr(c,o):kn(c,o),fromBytes:c=>{if(c.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+c.length);return r?Pt(c):Ua(c)}});return Object.freeze(d)}const wn=BigInt(0),Tt=BigInt(1);function ar(e,t){const r=t.negate();return e?r:t}function Xn(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ur(e,t){Xn(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function Xa(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function Qa(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const cr=new WeakMap,Qn=new WeakMap;function fr(e){return Qn.get(e)||1}function eu(e,t){return{constTimeNegate:ar,hasPrecomputes(r){return fr(r)!==1},unsafeLadder(r,n,i=e.ZERO){let o=r;for(;n>wn;)n&Tt&&(i=i.add(o)),o=o.double(),n>>=Tt;return i},precomputeWindow(r,n){const{windows:i,windowSize:o}=ur(n,t),f=[];let d=r,c=d;for(let a=0;a<i;a++){c=d,f.push(c);for(let u=1;u<o;u++)c=c.add(d),f.push(c);d=c.double()}return f},wNAF(r,n,i){const{windows:o,windowSize:f}=ur(r,t);let d=e.ZERO,c=e.BASE;const a=BigInt(2**r-1),u=2**r,h=BigInt(r);for(let p=0;p<o;p++){const b=p*f;let g=Number(i&a);i>>=h,g>f&&(g-=u,i+=Tt);const _=b,O=b+Math.abs(g)-1,R=p%2!==0,T=g<0;g===0?c=c.add(ar(R,n[_])):d=d.add(ar(T,n[O]))}return{p:d,f:c}},wNAFUnsafe(r,n,i,o=e.ZERO){const{windows:f,windowSize:d}=ur(r,t),c=BigInt(2**r-1),a=2**r,u=BigInt(r);for(let h=0;h<f;h++){const p=h*d;if(i===wn)break;let b=Number(i&c);if(i>>=u,b>d&&(b-=a,i+=Tt),b===0)continue;let g=n[p+Math.abs(b)-1];b<0&&(g=g.negate()),o=o.add(g)}return o},getPrecomputes(r,n,i){let o=cr.get(n);return o||(o=this.precomputeWindow(n,r),r!==1&&cr.set(n,i(o))),o},wNAFCached(r,n,i){const o=fr(r);return this.wNAF(o,this.getPrecomputes(o,r,i),n)},wNAFCachedUnsafe(r,n,i,o){const f=fr(r);return f===1?this.unsafeLadder(r,n,o):this.wNAFUnsafe(f,this.getPrecomputes(f,r,i),n,o)},setWindowSize(r,n){Xn(n,t),Qn.set(r,n),cr.delete(r)}}}function tu(e,t,r,n){if(Xa(r,e),Qa(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,o=Ma(BigInt(r.length)),f=o>12?o-3:o>4?o-2:o?2:1,d=(1<<f)-1,c=new Array(d+1).fill(i),a=Math.floor((t.BITS-1)/f)*f;let u=i;for(let h=a;h>=0;h-=f){c.fill(i);for(let b=0;b<n.length;b++){const g=n[b],_=Number(g>>BigInt(h)&BigInt(d));c[_]=c[_].add(r[b])}let p=i;for(let b=c.length-1,g=i;b>0;b--)g=g.add(c[b]),p=p.add(g);if(u=u.add(p),h!==0)for(let b=0;b<f;b++)u=u.double()}return u}function ru(e){return ka(e.Fp),Ir(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Zn(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const pe=BigInt(0),ie=BigInt(1),Ct=BigInt(2),nu=BigInt(8),iu={zip215:!0};function ou(e){const t=ru(e);return Ir(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function su(e){const t=ou(e),{Fp:r,n,prehash:i,hash:o,randomBytes:f,nByteLength:d,h:c}=t,a=Ct<<BigInt(d*8)-ie,u=r.create,h=Yn(t.n,t.nBitLength),p=t.uvRatio||((x,w)=>{try{return{isValid:!0,value:r.sqrt(x*r.inv(w))}}catch{return{isValid:!1,value:pe}}}),b=t.adjustScalarBytes||(x=>x),g=t.domain||((x,w,E)=>{if(or("phflag",E),w.length||E)throw new Error("Contexts/pre-hash are not supported");return x});function _(x,w){nt("coordinate "+x,w,pe,a)}function O(x){if(!(x instanceof m))throw new Error("ExtendedPoint expected")}const R=pn((x,w)=>{const{ex:E,ey:F,ez:C}=x,L=x.is0();w==null&&(w=L?nu:r.inv(C));const P=u(E*w),D=u(F*w),j=u(C*w);if(L)return{x:pe,y:ie};if(j!==ie)throw new Error("invZ was invalid");return{x:P,y:D}}),T=pn(x=>{const{a:w,d:E}=t;if(x.is0())throw new Error("bad point: ZERO");const{ex:F,ey:C,ez:L,et:P}=x,D=u(F*F),j=u(C*C),M=u(L*L),S=u(M*M),Q=u(D*w),le=u(M*u(Q+j)),J=u(S+u(E*u(D*j)));if(le!==J)throw new Error("bad point: equation left != right (1)");const ne=u(F*C),he=u(L*P);if(ne!==he)throw new Error("bad point: equation left != right (2)");return!0});class m{constructor(w,E,F,C){this.ex=w,this.ey=E,this.ez=F,this.et=C,_("x",w),_("y",E),_("z",F),_("t",C),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof m)throw new Error("extended point not allowed");const{x:E,y:F}=w||{};return _("x",E),_("y",F),new m(E,F,ie,u(E*F))}static normalizeZ(w){const E=r.invertBatch(w.map(F=>F.ez));return w.map((F,C)=>F.toAffine(E[C])).map(m.fromAffine)}static msm(w,E){return tu(m,h,w,E)}_setWindowSize(w){H.setWindowSize(this,w)}assertValidity(){T(this)}equals(w){O(w);const{ex:E,ey:F,ez:C}=this,{ex:L,ey:P,ez:D}=w,j=u(E*D),M=u(L*C),S=u(F*D),Q=u(P*C);return j===M&&S===Q}is0(){return this.equals(m.ZERO)}negate(){return new m(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:w}=t,{ex:E,ey:F,ez:C}=this,L=u(E*E),P=u(F*F),D=u(Ct*u(C*C)),j=u(w*L),M=E+F,S=u(u(M*M)-L-P),Q=j+P,le=Q-D,J=j-P,ne=u(S*le),he=u(Q*J),we=u(S*J),Be=u(le*Q);return new m(ne,he,Be,we)}add(w){O(w);const{a:E,d:F}=t,{ex:C,ey:L,ez:P,et:D}=this,{ex:j,ey:M,ez:S,et:Q}=w;if(E===BigInt(-1)){const lt=u((L-C)*(M+j)),ht=u((L+C)*(M-j)),Ye=u(ht-lt);if(Ye===pe)return this.double();const dt=u(P*Ct*Q),pt=u(D*Ct*S),gt=pt+dt,bt=ht+lt,yt=pt-dt,$e=u(gt*Ye),Xe=u(bt*yt),wt=u(gt*yt),ae=u(Ye*bt);return new m($e,Xe,ae,wt)}const le=u(C*j),J=u(L*M),ne=u(D*F*Q),he=u(P*S),we=u((C+L)*(j+M)-le-J),Be=he-ne,ke=he+ne,Ze=u(J-E*le),Wt=u(we*Be),Gt=u(ke*Ze),Vt=u(we*Ze),qt=u(Be*ke);return new m(Wt,Gt,qt,Vt)}subtract(w){return this.add(w.negate())}wNAF(w){return H.wNAFCached(this,w,m.normalizeZ)}multiply(w){const E=w;nt("scalar",E,ie,n);const{p:F,f:C}=this.wNAF(E);return m.normalizeZ([F,C])[0]}multiplyUnsafe(w,E=m.ZERO){const F=w;return nt("scalar",F,pe,n),F===pe?z:this.is0()||F===ie?this:H.wNAFCachedUnsafe(this,F,m.normalizeZ,E)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return H.unsafeLadder(this,n).is0()}toAffine(w){return R(this,w)}clearCofactor(){const{h:w}=t;return w===ie?this:this.multiplyUnsafe(w)}static fromHex(w,E=!1){const{d:F,a:C}=t,L=r.BYTES;w=Fe("pointHex",w,L),or("zip215",E);const P=w.slice(),D=w[L-1];P[L-1]=D&-129;const j=Pt(P),M=E?a:r.ORDER;nt("pointHex.y",j,pe,M);const S=u(j*j),Q=u(S-ie),le=u(F*S-C);let{isValid:J,value:ne}=p(Q,le);if(!J)throw new Error("Point.fromHex: invalid y coordinate");const he=(ne&ie)===ie,we=(D&128)!==0;if(!E&&ne===pe&&we)throw new Error("Point.fromHex: x=0 and x_0=1");return we!==he&&(ne=u(-ne)),m.fromAffine({x:ne,y:j})}static fromPrivateKey(w){return V(w).point}toRawBytes(){const{x:w,y:E}=this.toAffine(),F=gr(E,r.BYTES);return F[F.length-1]|=w&ie?128:0,F}toHex(){return Br(this.toRawBytes())}}m.BASE=new m(t.Gx,t.Gy,ie,u(t.Gx*t.Gy)),m.ZERO=new m(pe,ie,ie,pe);const{BASE:I,ZERO:z}=m,H=eu(m,d*8);function G(x){return k(x,n)}function U(x){return G(Pt(x))}function V(x){const w=r.BYTES;x=Fe("private key",x,w);const E=Fe("hashed private key",o(x),2*w),F=b(E.slice(0,w)),C=E.slice(w,2*w),L=U(F),P=I.multiply(L),D=P.toRawBytes();return{head:F,prefix:C,scalar:L,point:P,pointBytes:D}}function be(x){return V(x).pointBytes}function ye(x=new Uint8Array,...w){const E=dn(...w);return U(o(g(E,Fe("context",x),!!i)))}function fe(x,w,E={}){x=Fe("message",x),i&&(x=i(x));const{prefix:F,scalar:C,pointBytes:L}=V(w),P=ye(E.context,F,x),D=I.multiply(P).toRawBytes(),j=ye(E.context,D,L,x),M=G(P+j*C);nt("signature.s",M,pe,n);const S=dn(D,gr(M,r.BYTES));return Fe("result",S,r.BYTES*2)}const Le=iu;function Je(x,w,E,F=Le){const{context:C,zip215:L}=F,P=r.BYTES;x=Fe("signature",x,2*P),w=Fe("message",w),E=Fe("publicKey",E,P),L!==void 0&&or("zip215",L),i&&(w=i(w));const D=Pt(x.slice(P,2*P));let j,M,S;try{j=m.fromHex(E,L),M=m.fromHex(x.slice(0,P),L),S=I.multiplyUnsafe(D)}catch{return!1}if(!L&&j.isSmallOrder())return!1;const Q=ye(C,M.toRawBytes(),j.toRawBytes(),w);return M.add(j.multiplyUnsafe(Q)).subtract(S).clearCofactor().equals(m.ZERO)}return I._setWindowSize(8),{CURVE:t,getPublicKey:be,sign:fe,verify:Je,ExtendedPoint:m,utils:{getExtendedPublicKey:V,randomPrivateKey:()=>f(r.BYTES),precompute(x=8,w=m.BASE){return w._setWindowSize(x),w.multiply(BigInt(3)),w}}}}BigInt(0),BigInt(1);const Or=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),mn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const au=BigInt(1),vn=BigInt(2);BigInt(3);const uu=BigInt(5),cu=BigInt(8);function fu(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=Or,f=e*e%o*e%o,d=me(f,vn,o)*f%o,c=me(d,au,o)*e%o,a=me(c,uu,o)*c%o,u=me(a,t,o)*a%o,h=me(u,r,o)*u%o,p=me(h,n,o)*h%o,b=me(p,i,o)*p%o,g=me(b,i,o)*p%o,_=me(g,t,o)*a%o;return{pow_p_5_8:me(_,vn,o)*e%o,b2:f}}function lu(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function hu(e,t){const r=Or,n=k(t*t*t,r),i=k(n*n*t,r),o=fu(e*i).pow_p_5_8;let f=k(e*n*o,r);const d=k(t*f*f,r),c=f,a=k(f*mn,r),u=d===e,h=d===k(-e,r),p=d===k(-e*mn,r);return u&&(f=c),(h||p)&&(f=a),qa(f,r)&&(f=k(-f,r)),{isValid:u||h,value:f}}const du=Yn(Or,void 0,!0),pu={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:du,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:cu,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ja,randomBytes:Wn,adjustScalarBytes:lu,uvRatio:hu},ei=su(pu),gu="EdDSA",bu="JWT",zt=".",$t="base64url",ti="utf8",ri="utf8",yu=":",wu="did",mu="key",_n="base58btc",vu="z",_u="K36",Eu=32;function Tr(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function ni(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Tr(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ii(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=ni(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return Tr(r)}function xu(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),f=o.charCodeAt(0);if(r[f]!==255)throw new TypeError(o+" is ambiguous");r[f]=i}var d=e.length,c=e.charAt(0),a=Math.log(d)/Math.log(256),u=Math.log(256)/Math.log(d);function h(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var _=0,O=0,R=0,T=g.length;R!==T&&g[R]===0;)R++,_++;for(var m=(T-R)*u+1>>>0,I=new Uint8Array(m);R!==T;){for(var z=g[R],H=0,G=m-1;(z!==0||H<O)&&G!==-1;G--,H++)z+=256*I[G]>>>0,I[G]=z%d>>>0,z=z/d>>>0;if(z!==0)throw new Error("Non-zero carry");O=H,R++}for(var U=m-O;U!==m&&I[U]===0;)U++;for(var V=c.repeat(_);U<m;++U)V+=e.charAt(I[U]);return V}function p(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var _=0;if(g[_]!==" "){for(var O=0,R=0;g[_]===c;)O++,_++;for(var T=(g.length-_)*a+1>>>0,m=new Uint8Array(T);g[_];){var I=r[g.charCodeAt(_)];if(I===255)return;for(var z=0,H=T-1;(I!==0||z<R)&&H!==-1;H--,z++)I+=d*m[H]>>>0,m[H]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");R=z,_++}if(g[_]!==" "){for(var G=T-R;G!==T&&m[G]===0;)G++;for(var U=new Uint8Array(O+(T-G)),V=O;G!==T;)U[V++]=m[G++];return U}}}function b(g){var _=p(g);if(_)return _;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:b}}var Fu=xu,Su=Fu;const oi=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Au=e=>new TextEncoder().encode(e),Bu=e=>new TextDecoder().decode(e);class Iu{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Ou{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return si(this,t)}}class Tu{constructor(t){this.decoders=t}or(t){return si(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const si=(e,t)=>new Tu({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Cu{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Iu(t,r,n),this.decoder=new Ou(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Kt=({name:e,prefix:t,encode:r,decode:n})=>new Cu(e,t,r,n),ft=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=Su(r,t);return Kt({prefix:e,name:t,encode:n,decode:o=>oi(i(o))})},Ru=(e,t,r,n)=>{const i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let o=e.length;for(;e[o-1]==="=";)--o;const f=new Uint8Array(o*r/8|0);let d=0,c=0,a=0;for(let u=0;u<o;++u){const h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,d+=r,d>=8&&(d-=8,f[a++]=255&c>>d)}if(d>=r||255&c<<8-d)throw new SyntaxError("Unexpected end of data");return f},Lu=(e,t,r)=>{const n=t[t.length-1]==="=",i=(1<<r)-1;let o="",f=0,d=0;for(let c=0;c<e.length;++c)for(d=d<<8|e[c],f+=8;f>r;)f-=r,o+=t[i&d>>f];if(f&&(o+=t[i&d<<r-f]),n)for(;o.length*r&7;)o+="=";return o},te=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Kt({prefix:t,name:e,encode(i){return Lu(i,n,r)},decode(i){return Ru(i,n,r,e)}}),Pu=Kt({prefix:"\0",name:"identity",encode:e=>Bu(e),decode:e=>Au(e)});var ju=Object.freeze({__proto__:null,identity:Pu});const Nu=te({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var zu=Object.freeze({__proto__:null,base2:Nu});const Uu=te({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Du=Object.freeze({__proto__:null,base8:Uu});const Mu=ft({prefix:"9",name:"base10",alphabet:"0123456789"});var $u=Object.freeze({__proto__:null,base10:Mu});const Ku=te({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Hu=te({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Wu=Object.freeze({__proto__:null,base16:Ku,base16upper:Hu});const Gu=te({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vu=te({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qu=te({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ju=te({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ku=te({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Zu=te({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Yu=te({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xu=te({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qu=te({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ec=Object.freeze({__proto__:null,base32:Gu,base32upper:Vu,base32pad:qu,base32padupper:Ju,base32hex:ku,base32hexupper:Zu,base32hexpad:Yu,base32hexpadupper:Xu,base32z:Qu});const tc=ft({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rc=ft({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var nc=Object.freeze({__proto__:null,base36:tc,base36upper:rc});const ic=ft({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),oc=ft({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var sc=Object.freeze({__proto__:null,base58btc:ic,base58flickr:oc});const ac=te({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),uc=te({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cc=te({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fc=te({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var lc=Object.freeze({__proto__:null,base64:ac,base64pad:uc,base64url:cc,base64urlpad:fc});const ai=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),hc=ai.reduce((e,t,r)=>(e[r]=t,e),[]),dc=ai.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function pc(e){return e.reduce((t,r)=>(t+=hc[r],t),"")}function gc(e){const t=[];for(const r of e){const n=dc[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const bc=Kt({prefix:"🚀",name:"base256emoji",encode:pc,decode:gc});var yc=Object.freeze({__proto__:null,base256emoji:bc}),wc=ui,En=128,mc=-128,vc=Math.pow(2,31);function ui(e,t,r){t=t||[],r=r||0;for(var n=r;e>=vc;)t[r++]=e&255|En,e/=128;for(;e&mc;)t[r++]=e&255|En,e>>>=7;return t[r]=e|0,ui.bytes=r-n+1,t}var _c=yr,Ec=128,xn=127;function yr(e,n){var r=0,n=n||0,i=0,o=n,f,d=e.length;do{if(o>=d)throw yr.bytes=0,new RangeError("Could not decode varint");f=e[o++],r+=i<28?(f&xn)<<i:(f&xn)*Math.pow(2,i),i+=7}while(f>=Ec);return yr.bytes=o-n,r}var xc=Math.pow(2,7),Fc=Math.pow(2,14),Sc=Math.pow(2,21),Ac=Math.pow(2,28),Bc=Math.pow(2,35),Ic=Math.pow(2,42),Oc=Math.pow(2,49),Tc=Math.pow(2,56),Cc=Math.pow(2,63),Rc=function(e){return e<xc?1:e<Fc?2:e<Sc?3:e<Ac?4:e<Bc?5:e<Ic?6:e<Oc?7:e<Tc?8:e<Cc?9:10},Lc={encode:wc,decode:_c,encodingLength:Rc},ci=Lc;const Fn=(e,t,r=0)=>(ci.encode(e,t,r),t),Sn=e=>ci.encodingLength(e),wr=(e,t)=>{const r=t.byteLength,n=Sn(e),i=n+Sn(r),o=new Uint8Array(i+r);return Fn(e,o,0),Fn(r,o,n),o.set(t,i),new Pc(e,r,t,o)};class Pc{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}}const fi=({name:e,code:t,encode:r})=>new jc(e,t,r);class jc{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?wr(this.code,r):r.then(n=>wr(this.code,n))}else throw Error("Unknown type, must be binary type")}}const li=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Nc=fi({name:"sha2-256",code:18,encode:li("SHA-256")}),zc=fi({name:"sha2-512",code:19,encode:li("SHA-512")});var Uc=Object.freeze({__proto__:null,sha256:Nc,sha512:zc});const hi=0,Dc="identity",di=oi,Mc=e=>wr(hi,di(e)),$c={code:hi,name:Dc,encode:di,digest:Mc};var Kc=Object.freeze({__proto__:null,identity:$c});new TextEncoder,new TextDecoder;const An={...ju,...zu,...Du,...$u,...Wu,...ec,...nc,...sc,...lc,...yc};({...Uc,...Kc});function pi(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Bn=pi("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),lr=pi("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=ni(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),gi={utf8:Bn,"utf-8":Bn,hex:An.base16,latin1:lr,ascii:lr,binary:lr,...An};function Ht(e,t="utf8"){const r=gi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function qe(e,t="utf8"){const r=gi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Tr(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function In(e){return ra(Ht(qe(e,$t),ti))}function Ut(e){return Ht(qe(na(e),ti),$t)}function bi(e){const t=qe(_u,_n),r=vu+Ht(ii([t,e]),_n);return[wu,mu,r].join(yu)}function Hc(e){return Ht(e,$t)}function Wc(e){return qe(e,$t)}function Gc(e){return qe([Ut(e.header),Ut(e.payload)].join(zt),ri)}function Vc(e){return[Ut(e.header),Ut(e.payload),Hc(e.signature)].join(zt)}function qc(e){const t=e.split(zt),r=In(t[0]),n=In(t[1]),i=Wc(t[2]),o=qe(t.slice(0,2).join(zt),ri);return{header:r,payload:n,signature:i,data:o}}function Jc(e=Wn(Eu)){const t=ei.getPublicKey(e);return{secretKey:ii([e,t]),publicKey:t}}async function kc(e,t,r,n,i=ge.cjs.fromMiliseconds(Date.now())){const o={alg:gu,typ:bu},f=bi(n.publicKey),d=i+r,c={iss:f,sub:e,aud:t,iat:i,exp:d},a=Gc({header:o,payload:c}),u=ei.sign(a,n.secretKey.slice(0,32));return Vc({header:o,payload:c,signature:u})}const Zc="PARSE_ERROR",Yc="INVALID_REQUEST",Xc="METHOD_NOT_FOUND",Qc="INVALID_PARAMS",yi="INTERNAL_ERROR",Cr="SERVER_ERROR",ef=[-32700,-32600,-32601,-32602,-32603],it={[Zc]:{code:-32700,message:"Parse error"},[Yc]:{code:-32600,message:"Invalid Request"},[Xc]:{code:-32601,message:"Method not found"},[Qc]:{code:-32602,message:"Invalid params"},[yi]:{code:-32603,message:"Internal error"},[Cr]:{code:-32e3,message:"Server error"}},wi=Cr;function tf(e){return ef.includes(e)}function On(e){return Object.keys(it).includes(e)?it[e]:it[wi]}function rf(e){const t=Object.values(it).find(r=>r.code===e);return t||it[wi]}function nf(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var mi={};/*! *****************************************************************************
1
+ "use strict";const ge=require("./index-Drp6LJGk.js"),$=require("./index-DoE4VQhB.js");function Rn(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Fo(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=Rn(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}const Zr={...ge.identityBase,...ge.base2,...ge.base8,...ge.base10,...ge.base16,...ge.base32,...ge.base36,...ge.base58,...ge.base64,...ge.base256emoji};function Ln(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Yr=Ln("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),er=Ln("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Rn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Pn={utf8:Yr,"utf-8":Yr,hex:Zr.base16,latin1:er,ascii:er,binary:er,...Zr};function So(e,t="utf8"){const r=Pn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}function Ao(e,t="utf8"){const r=Pn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var Xr=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},Bo=function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e}(),Io=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=$.dist.process.platform}return e}(),Oo=function(){function e(t,r,n,i){this.name=t,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return e}(),To=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Co=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Ro=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Lo=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Qr=3,Po=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Ro]],en=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function jo(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Co:typeof navigator<"u"?zo(navigator.userAgent):Do()}function No(e){return e!==""&&Po.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1)}function zo(e){var t=No(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new To;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Qr&&(i=Xr(Xr([],i,!0),Mo(Qr-i.length),!0)):i=[];var o=i.join("."),f=Uo(e),d=Lo.exec(e);return d&&d[1]?new Oo(r,o,f,d[1]):new Bo(r,o,f)}function Uo(e){for(var t=0,r=en.length;t<r;t++){var n=en[t],i=n[0],o=n[1],f=o.exec(e);if(f)return i}return null}function Do(){var e=typeof $.dist.process<"u"&&$.dist.process.version;return e?new Io($.dist.process.version.slice(1)):null}function Mo(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}const $o={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},Ko=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Ho=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Wo=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Go(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Vo(e);return}return t}function Vo(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function At(e,t={}){if(typeof e!="string")return e;const r=e.trim();if(e[0]==='"'&&e.endsWith('"')&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!Wo.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(Ko.test(e)||Ho.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,Go)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function qo(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Y(e,...t){try{return qo(e(...t))}catch(r){return Promise.reject(r)}}function Jo(e){const t=typeof e;return e===null||t!=="object"&&t!=="function"}function ko(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function Rt(e){if(Jo(e))return String(e);if(ko(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Rt(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const hr="base64:";function Zo(e){return typeof e=="string"?e:hr+Qo(e)}function Yo(e){return typeof e!="string"||!e.startsWith(hr)?e:Xo(e.slice(hr.length))}function Xo(e){return globalThis.Buffer?$.dist.Buffer.from(e,"base64"):Uint8Array.from(globalThis.atob(e),t=>t.codePointAt(0))}function Qo(e){return globalThis.Buffer?$.dist.Buffer.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function oe(e){var t;return e&&((t=e.split("?")[0])==null?void 0:t.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function es(...e){return oe(e.join(":"))}function Bt(e){return e=oe(e),e?e+":":""}const ts="memory",rs=()=>{const e=new Map;return{name:ts,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}};function ns(e={}){const t={mounts:{"":e.driver||rs()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=a=>{for(const u of t.mountpoints)if(a.startsWith(u))return{base:u,relativeKey:a.slice(u.length),driver:t.mounts[u]};return{base:"",relativeKey:a,driver:t.mounts[""]}},n=(a,u)=>t.mountpoints.filter(h=>h.startsWith(a)||u&&a.startsWith(h)).map(h=>({relativeBase:a.length>h.length?a.slice(h.length):void 0,mountpoint:h,driver:t.mounts[h]})),i=(a,u)=>{if(t.watching){u=oe(u);for(const h of t.watchListeners)h(a,u)}},o=async()=>{if(!t.watching){t.watching=!0;for(const a in t.mounts)t.unwatch[a]=await tn(t.mounts[a],i,a)}},f=async()=>{if(t.watching){for(const a in t.unwatch)await t.unwatch[a]();t.unwatch={},t.watching=!1}},d=(a,u,h)=>{const p=new Map,b=g=>{let _=p.get(g.base);return _||(_={driver:g.driver,base:g.base,items:[]},p.set(g.base,_)),_};for(const g of a){const _=typeof g=="string",O=oe(_?g:g.key),R=_?void 0:g.value,T=_||!g.options?u:{...u,...g.options},m=r(O);b(m).items.push({key:O,value:R,relativeKey:m.relativeKey,options:T})}return Promise.all([...p.values()].map(g=>h(g))).then(g=>g.flat())},c={hasItem(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return Y(p.hasItem,h,u)},getItem(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return Y(p.getItem,h,u).then(b=>At(b))},getItems(a,u={}){return d(a,u,h=>h.driver.getItems?Y(h.driver.getItems,h.items.map(p=>({key:p.relativeKey,options:p.options})),u).then(p=>p.map(b=>({key:es(h.base,b.key),value:At(b.value)}))):Promise.all(h.items.map(p=>Y(h.driver.getItem,p.relativeKey,p.options).then(b=>({key:p.key,value:At(b)})))))},getItemRaw(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return p.getItemRaw?Y(p.getItemRaw,h,u):Y(p.getItem,h,u).then(b=>Yo(b))},async setItem(a,u,h={}){if(u===void 0)return c.removeItem(a);a=oe(a);const{relativeKey:p,driver:b}=r(a);b.setItem&&(await Y(b.setItem,p,Rt(u),h),b.watch||i("update",a))},async setItems(a,u){await d(a,u,async h=>{if(h.driver.setItems)return Y(h.driver.setItems,h.items.map(p=>({key:p.relativeKey,value:Rt(p.value),options:p.options})),u);h.driver.setItem&&await Promise.all(h.items.map(p=>Y(h.driver.setItem,p.relativeKey,Rt(p.value),p.options)))})},async setItemRaw(a,u,h={}){if(u===void 0)return c.removeItem(a,h);a=oe(a);const{relativeKey:p,driver:b}=r(a);if(b.setItemRaw)await Y(b.setItemRaw,p,u,h);else if(b.setItem)await Y(b.setItem,p,Zo(u),h);else return;b.watch||i("update",a)},async removeItem(a,u={}){typeof u=="boolean"&&(u={removeMeta:u}),a=oe(a);const{relativeKey:h,driver:p}=r(a);p.removeItem&&(await Y(p.removeItem,h,u),(u.removeMeta||u.removeMata)&&await Y(p.removeItem,h+"$",u),p.watch||i("remove",a))},async getMeta(a,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),a=oe(a);const{relativeKey:h,driver:p}=r(a),b=Object.create(null);if(p.getMeta&&Object.assign(b,await Y(p.getMeta,h,u)),!u.nativeOnly){const g=await Y(p.getItem,h+"$",u).then(_=>At(_));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(b,g))}return b},setMeta(a,u,h={}){return this.setItem(a+"$",u,h)},removeMeta(a,u={}){return this.removeItem(a+"$",u)},async getKeys(a,u={}){a=Bt(a);const h=n(a,!0);let p=[];const b=[];for(const g of h){const _=await Y(g.driver.getKeys,g.relativeBase,u);for(const O of _){const R=g.mountpoint+oe(O);p.some(T=>R.startsWith(T))||b.push(R)}p=[g.mountpoint,...p.filter(O=>!O.startsWith(g.mountpoint))]}return a?b.filter(g=>g.startsWith(a)&&g[g.length-1]!=="$"):b.filter(g=>g[g.length-1]!=="$")},async clear(a,u={}){a=Bt(a),await Promise.all(n(a,!1).map(async h=>{if(h.driver.clear)return Y(h.driver.clear,h.relativeBase,u);if(h.driver.removeItem){const p=await h.driver.getKeys(h.relativeBase||"",u);return Promise.all(p.map(b=>h.driver.removeItem(b,u)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(a=>rn(a)))},async watch(a){return await o(),t.watchListeners.push(a),async()=>{t.watchListeners=t.watchListeners.filter(u=>u!==a),t.watchListeners.length===0&&await f()}},async unwatch(){t.watchListeners=[],await f()},mount(a,u){if(a=Bt(a),a&&t.mounts[a])throw new Error(`already mounted at ${a}`);return a&&(t.mountpoints.push(a),t.mountpoints.sort((h,p)=>p.length-h.length)),t.mounts[a]=u,t.watching&&Promise.resolve(tn(u,i,a)).then(h=>{t.unwatch[a]=h}).catch(console.error),c},async unmount(a,u=!0){var h,p;a=Bt(a),!(!a||!t.mounts[a])&&(t.watching&&a in t.unwatch&&((p=(h=t.unwatch)[a])==null||p.call(h),delete t.unwatch[a]),u&&await rn(t.mounts[a]),t.mountpoints=t.mountpoints.filter(b=>b!==a),delete t.mounts[a])},getMount(a=""){a=oe(a)+":";const u=r(a);return{driver:u.driver,base:u.base}},getMounts(a="",u={}){return a=oe(a),n(a,u.parents).map(p=>({driver:p.driver,base:p.mountpoint}))},keys:(a,u={})=>c.getKeys(a,u),get:(a,u={})=>c.getItem(a,u),set:(a,u,h={})=>c.setItem(a,u,h),has:(a,u={})=>c.hasItem(a,u),del:(a,u={})=>c.removeItem(a,u),remove:(a,u={})=>c.removeItem(a,u)};return c}function tn(e,t,r){return e.watch?e.watch((n,i)=>t(n,r+i)):()=>{}}async function rn(e){typeof e.dispose=="function"&&await Y(e.dispose)}function Me(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function jn(e,t){const r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);const n=Me(r);return(i,o)=>n.then(f=>o(f.transaction(t,i).objectStore(t)))}let tr;function ut(){return tr||(tr=jn("keyval-store","keyval")),tr}function nn(e,t=ut()){return t("readonly",r=>Me(r.get(e)))}function is(e,t,r=ut()){return r("readwrite",n=>(n.put(t,e),Me(n.transaction)))}function os(e,t=ut()){return t("readwrite",r=>(r.delete(e),Me(r.transaction)))}function ss(e=ut()){return e("readwrite",t=>(t.clear(),Me(t.transaction)))}function as(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},Me(e.transaction)}function us(e=ut()){return e("readonly",t=>{if(t.getAllKeys)return Me(t.getAllKeys());const r=[];return as(t,n=>r.push(n.key)).then(()=>r)})}const cs=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),fs=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Nn(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return fs(e)}catch{return e}}function zn(e){return typeof e=="string"?e:cs(e)||""}const ls="idb-keyval";var hs=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",r=i=>t+i;let n;return e.dbName&&e.storeName&&(n=jn(e.dbName,e.storeName)),{name:ls,options:e,async hasItem(i){return!(typeof await nn(r(i),n)>"u")},async getItem(i){return await nn(r(i),n)??null},setItem(i,o){return is(r(i),o,n)},removeItem(i){return os(r(i),n)},getKeys(){return us(n)},clear(){return ss(n)}}};const ds="WALLET_CONNECT_V2_INDEXED_DB",ps="keyvaluestorage";let gs=class{constructor(){this.indexedDb=ns({driver:hs({dbName:ds,storeName:ps})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const r=await this.indexedDb.getItem(t);if(r!==null)return r}async setItem(t,r){await this.indexedDb.setItem(t,zn(r))}async removeItem(t){await this.indexedDb.removeItem(t)}};var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof $.dist.global<"u"?$.dist.global:typeof self<"u"?self:{},Lt={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},e.prototype.setItem=function(r,n){this[r]=String(n)},e.prototype.removeItem=function(r){delete this[r]},e.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},e.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof rr<"u"&&rr.localStorage?Lt.exports=rr.localStorage:typeof window<"u"&&window.localStorage?Lt.exports=window.localStorage:Lt.exports=new t})();function bs(e){var t;return[e[0],Nn((t=e[1])!=null?t:"")]}let ys=class{constructor(){this.localStorage=Lt.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(bs)}async getItem(t){const r=this.localStorage.getItem(t);if(r!==null)return Nn(r)}async setItem(t,r){this.localStorage.setItem(t,zn(r))}async removeItem(t){this.localStorage.removeItem(t)}};const ws="wc_storage_version",on=1,ms=async(e,t,r)=>{const n=ws,i=await t.getItem(n);if(i&&i>=on){r(t);return}const o=await e.getKeys();if(!o.length){r(t);return}const f=[];for(;o.length;){const d=o.shift();if(!d)continue;const c=d.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const a=await e.getItem(d);await t.setItem(d,a),f.push(d)}}await t.setItem(n,on),r(t),vs(e,f)},vs=async(e,t)=>{t.length&&t.forEach(async r=>{await e.removeItem(r)})};class _s{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const t=new ys;this.storage=t;try{const r=new gs;ms(t,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,r){return await this.initialize(),this.storage.setItem(t,r)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),t())},20)})}}class Es{}function xs(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Fs=Ss;function Ss(e,t,r){var n=r&&r.stringify||xs,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var f=new Array(o);f[0]=n(e);for(var d=1;d<o;d++)f[d]=n(t[d]);return f.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var a="",u=1-i,h=-1,p=e&&e.length||0,b=0;b<p;){if(e.charCodeAt(b)===37&&b+1<p){switch(h=h>-1?h:0,e.charCodeAt(b+1)){case 100:case 102:if(u>=c||t[u]==null)break;h<b&&(a+=e.slice(h,b)),a+=Number(t[u]),h=b+2,b++;break;case 105:if(u>=c||t[u]==null)break;h<b&&(a+=e.slice(h,b)),a+=Math.floor(Number(t[u])),h=b+2,b++;break;case 79:case 111:case 106:if(u>=c||t[u]===void 0)break;h<b&&(a+=e.slice(h,b));var g=typeof t[u];if(g==="string"){a+="'"+t[u]+"'",h=b+2,b++;break}if(g==="function"){a+=t[u].name||"<anonymous>",h=b+2,b++;break}a+=n(t[u]),h=b+2,b++;break;case 115:if(u>=c)break;h<b&&(a+=e.slice(h,b)),a+=String(t[u]),h=b+2,b++;break;case 37:h<b&&(a+=e.slice(h,b)),a+="%",h=b+2,b++,u--;break}++u}++b}return h===-1?e:(h<p&&(a+=e.slice(h)),a)}const sn=Fs;var Ve=ve;const ot=js().console||{},As={mapHttpRequest:It,mapHttpResponse:It,wrapRequestSerializer:nr,wrapResponseSerializer:nr,wrapErrorSerializer:nr,req:It,res:It,err:Cs};function Bs(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function ve(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const r=e.browser.write||ot;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},i=Bs(e.browser.serialize,n);let o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const f=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),e.enabled===!1&&(e.level="silent");const d=e.level||"info",c=Object.create(r);c.log||(c.log=st),Object.defineProperty(c,"levelVal",{get:u}),Object.defineProperty(c,"level",{get:h,set:p});const a={transmit:t,serialize:i,asObject:e.browser.asObject,levels:f,timestamp:Rs(e)};c.levels=ve.levels,c.level=d,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=st,c.serializers=n,c._serialize=i,c._stdErrSerialize=o,c.child=b,t&&(c._logEvent=dr());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function h(){return this._level}function p(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,He(a,c,"error","log"),He(a,c,"fatal","error"),He(a,c,"warn","error"),He(a,c,"info","log"),He(a,c,"debug","log"),He(a,c,"trace","log")}function b(g,_){if(!g)throw new Error("missing bindings for child Pino");_=_||{},i&&g.serializers&&(_.serializers=g.serializers);const O=_.serializers;if(i&&O){var R=Object.assign({},n,O),T=e.browser.serialize===!0?Object.keys(R):i;delete g.serializers,Mt([g],T,R,this._stdErrSerialize)}function m(I){this._childLevel=(I._childLevel|0)+1,this.error=We(I,g,"error"),this.fatal=We(I,g,"fatal"),this.warn=We(I,g,"warn"),this.info=We(I,g,"info"),this.debug=We(I,g,"debug"),this.trace=We(I,g,"trace"),R&&(this.serializers=R,this._serialize=T),t&&(this._logEvent=dr([].concat(I._logEvent.bindings,g)))}return m.prototype=this,new m(this)}return c}ve.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};ve.stdSerializers=As;ve.stdTimeFunctions=Object.assign({},{nullTime:Un,epochTime:Dn,unixTime:Ls,isoTime:Ps});function He(e,t,r,n){const i=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?st:i[r]?i[r]:ot[r]||ot[n]||st,Is(e,t,r)}function Is(e,t,r){!e.transmit&&t[r]===st||(t[r]=function(n){return function(){const o=e.timestamp(),f=new Array(arguments.length),d=Object.getPrototypeOf&&Object.getPrototypeOf(this)===ot?ot:this;for(var c=0;c<f.length;c++)f[c]=arguments[c];if(e.serialize&&!e.asObject&&Mt(f,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?n.call(d,Os(this,r,f,o)):n.apply(d,f),e.transmit){const a=e.transmit.level||t.level,u=ve.levels.values[a],h=ve.levels.values[r];if(h<u)return;Ts(this,{ts:o,methodLevel:r,methodValue:h,transmitValue:ve.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},f)}}}(t[r]))}function Os(e,t,r,n){e._serialize&&Mt(r,e._serialize,e.serializers,e._stdErrSerialize);const i=r.slice();let o=i[0];const f={};n&&(f.time=n),f.level=ve.levels.values[t];let d=(e._childLevel|0)+1;if(d<1&&(d=1),o!==null&&typeof o=="object"){for(;d--&&typeof i[0]=="object";)Object.assign(f,i.shift());o=i.length?sn(i.shift(),i):void 0}else typeof o=="string"&&(o=sn(i.shift(),i));return o!==void 0&&(f.msg=o),f}function Mt(e,t,r,n){for(const i in e)if(n&&e[i]instanceof Error)e[i]=ve.stdSerializers.err(e[i]);else if(typeof e[i]=="object"&&!Array.isArray(e[i]))for(const o in e[i])t&&t.indexOf(o)>-1&&o in r&&(e[i][o]=r[o](e[i][o]))}function We(e,t,r){return function(){const n=new Array(1+arguments.length);n[0]=t;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return e[r].apply(this,n)}}function Ts(e,t,r){const n=t.send,i=t.ts,o=t.methodLevel,f=t.methodValue,d=t.val,c=e._logEvent.bindings;Mt(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(a){return c.indexOf(a)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=f,n(o,e._logEvent,d),e._logEvent=dr(c)}function dr(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Cs(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)t[r]===void 0&&(t[r]=e[r]);return t}function Rs(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Un:Dn}function It(){return{}}function nr(e){return e}function st(){}function Un(){return!1}function Dn(){return Date.now()}function Ls(){return Math.round(Date.now()/1e3)}function Ps(){return new Date(Date.now()).toISOString()}function js(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const Er=$.getDefaultExportFromCjs(Ve),Ns=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r);function an(e){return typeof e=="string"?e:Ns(e)||""}const zs={level:"info"},ct="custom_context",xr=1e3*1024;class Us{constructor(t){this.nodeValue=t,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class un{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const r=new Us(t);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let r=this.head;for(;r!==null;)t.push(r.value),r=r.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const r=t.value;return t=t.next,{done:!1,value:r}}}}}class Mn{constructor(t,r=xr){this.level=t??"error",this.levelValue=Ve.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new un(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,r){r===Ve.levels.values.error?console.error(t):r===Ve.levels.values.warn?console.warn(t):r===Ve.levels.values.debug?console.debug(t):r===Ve.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(an({timestamp:new Date().toISOString(),log:t}));const r=typeof t=="string"?JSON.parse(t).level:t.level;r>=this.levelValue&&this.forwardToConsole(t,r)}getLogs(){return this.logs}clearLogs(){this.logs=new un(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const r=this.getLogArray();return r.push(an({extraMetadata:t})),new Blob(r,{type:"application/json"})}}class Ds{constructor(t,r=xr){this.baseChunkLogger=new Mn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const r=URL.createObjectURL(this.logsToBlob(t)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}class Ms{constructor(t,r=xr){this.baseChunkLogger=new Mn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}}var $s=Object.defineProperty,Ks=Object.defineProperties,Hs=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,Ws=Object.prototype.hasOwnProperty,Gs=Object.prototype.propertyIsEnumerable,fn=(e,t,r)=>t in e?$s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jt=(e,t)=>{for(var r in t||(t={}))Ws.call(t,r)&&fn(e,r,t[r]);if(cn)for(var r of cn(t))Gs.call(t,r)&&fn(e,r,t[r]);return e},Nt=(e,t)=>Ks(e,Hs(t));function Vs(e){return Nt(jt({},e),{level:(e==null?void 0:e.level)||zs.level})}function qs(e,t=ct){return e[t]||""}function Js(e,t,r=ct){return e[r]=t,e}function $n(e,t=ct){let r="";return typeof e.bindings>"u"?r=qs(e,t):r=e.bindings().context||"",r}function ks(e,t,r=ct){const n=$n(e,r);return n.trim()?`${n}/${t}`:t}function Zs(e,t,r=ct){const n=ks(e,t,r),i=e.child({context:n});return Js(i,n,r)}function Ys(e){var t,r;const n=new Ds((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Er(Nt(jt({},e.opts),{level:"trace",browser:Nt(jt({},(r=e.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function Xs(e){var t;const r=new Ms((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Er(Nt(jt({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}function Qs(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?Ys(e):Xs(e)}const ea=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),ta=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function ra(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return ta(e)}catch{return e}}function na(e){return typeof e=="string"?e:ea(e)||""}function ia(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Kn(e,...t){if(!ia(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ln(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function oa(e,t){Kn(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const Ge=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ir=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function sa(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Hn(e){return typeof e=="string"&&(e=sa(e)),Kn(e),e}class aa{clone(){return this._cloneInto()}}function ua(e){const t=n=>e().update(Hn(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Wn(e=32){if(Ge&&typeof Ge.getRandomValues=="function")return Ge.getRandomValues(new Uint8Array(e));if(Ge&&typeof Ge.randomBytes=="function")return Ge.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function ca(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),f=Number(r>>i&o),d=Number(r&o),c=n?4:0,a=n?0:4;e.setUint32(t+c,f,n),e.setUint32(t+a,d,n)}class fa extends aa{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ir(this.buffer)}update(t){ln(this);const{view:r,buffer:n,blockLen:i}=this;t=Hn(t);const o=t.length;for(let f=0;f<o;){const d=Math.min(i-this.pos,o-f);if(d===i){const c=ir(t);for(;i<=o-f;f+=i)this.process(c,f);continue}n.set(t.subarray(f,f+d),this.pos),this.pos+=d,f+=d,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ln(this),oa(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:o}=this;let{pos:f}=this;r[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>i-f&&(this.process(n,0),f=0);for(let h=f;h<i;h++)r[h]=0;ca(n,i-8,BigInt(this.length*8),o),this.process(n,0);const d=ir(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const a=c/4,u=this.get();if(a>u.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<a;h++)d.setUint32(4*h,u[h],o)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:o,destroyed:f,pos:d}=this;return t.length=i,t.pos=d,t.finished=o,t.destroyed=f,i%r&&t.buffer.set(n),t}}const Ot=BigInt(2**32-1),pr=BigInt(32);function Gn(e,t=!1){return t?{h:Number(e&Ot),l:Number(e>>pr&Ot)}:{h:Number(e>>pr&Ot)|0,l:Number(e&Ot)|0}}function la(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:f}=Gn(e[i],t);[r[i],n[i]]=[o,f]}return[r,n]}const ha=(e,t)=>BigInt(e>>>0)<<pr|BigInt(t>>>0),da=(e,t,r)=>e>>>r,pa=(e,t,r)=>e<<32-r|t>>>r,ga=(e,t,r)=>e>>>r|t<<32-r,ba=(e,t,r)=>e<<32-r|t>>>r,ya=(e,t,r)=>e<<64-r|t>>>r-32,wa=(e,t,r)=>e>>>r-32|t<<64-r,ma=(e,t)=>t,va=(e,t)=>e,_a=(e,t,r)=>e<<r|t>>>32-r,Ea=(e,t,r)=>t<<r|e>>>32-r,xa=(e,t,r)=>t<<r-32|e>>>64-r,Fa=(e,t,r)=>e<<r-32|t>>>64-r;function Sa(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const Aa=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Ba=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Ia=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Oa=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,Ta=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Ca=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,B={fromBig:Gn,split:la,toBig:ha,shrSH:da,shrSL:pa,rotrSH:ga,rotrSL:ba,rotrBH:ya,rotrBL:wa,rotr32H:ma,rotr32L:va,rotlSH:_a,rotlSL:Ea,rotlBH:xa,rotlBL:Fa,add:Sa,add3L:Aa,add3H:Ba,add4L:Ia,add4H:Oa,add5H:Ca,add5L:Ta},[Ra,La]=B.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Ce=new Uint32Array(80),Re=new Uint32Array(80);class Pa extends fa{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:i,Ch:o,Cl:f,Dh:d,Dl:c,Eh:a,El:u,Fh:h,Fl:p,Gh:b,Gl:g,Hh:_,Hl:O}=this;return[t,r,n,i,o,f,d,c,a,u,h,p,b,g,_,O]}set(t,r,n,i,o,f,d,c,a,u,h,p,b,g,_,O){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=f|0,this.Dh=d|0,this.Dl=c|0,this.Eh=a|0,this.El=u|0,this.Fh=h|0,this.Fl=p|0,this.Gh=b|0,this.Gl=g|0,this.Hh=_|0,this.Hl=O|0}process(t,r){for(let m=0;m<16;m++,r+=4)Ce[m]=t.getUint32(r),Re[m]=t.getUint32(r+=4);for(let m=16;m<80;m++){const I=Ce[m-15]|0,z=Re[m-15]|0,H=B.rotrSH(I,z,1)^B.rotrSH(I,z,8)^B.shrSH(I,z,7),G=B.rotrSL(I,z,1)^B.rotrSL(I,z,8)^B.shrSL(I,z,7),U=Ce[m-2]|0,V=Re[m-2]|0,be=B.rotrSH(U,V,19)^B.rotrBH(U,V,61)^B.shrSH(U,V,6),ye=B.rotrSL(U,V,19)^B.rotrBL(U,V,61)^B.shrSL(U,V,6),fe=B.add4L(G,ye,Re[m-7],Re[m-16]),Le=B.add4H(fe,H,be,Ce[m-7],Ce[m-16]);Ce[m]=Le|0,Re[m]=fe|0}let{Ah:n,Al:i,Bh:o,Bl:f,Ch:d,Cl:c,Dh:a,Dl:u,Eh:h,El:p,Fh:b,Fl:g,Gh:_,Gl:O,Hh:R,Hl:T}=this;for(let m=0;m<80;m++){const I=B.rotrSH(h,p,14)^B.rotrSH(h,p,18)^B.rotrBH(h,p,41),z=B.rotrSL(h,p,14)^B.rotrSL(h,p,18)^B.rotrBL(h,p,41),H=h&b^~h&_,G=p&g^~p&O,U=B.add5L(T,z,G,La[m],Re[m]),V=B.add5H(U,R,I,H,Ra[m],Ce[m]),be=U|0,ye=B.rotrSH(n,i,28)^B.rotrBH(n,i,34)^B.rotrBH(n,i,39),fe=B.rotrSL(n,i,28)^B.rotrBL(n,i,34)^B.rotrBL(n,i,39),Le=n&o^n&d^o&d,Je=i&f^i&c^f&c;R=_|0,T=O|0,_=b|0,O=g|0,b=h|0,g=p|0,{h,l:p}=B.add(a|0,u|0,V|0,be|0),a=d|0,u=c|0,d=o|0,c=f|0,o=n|0,f=i|0;const x=B.add3L(be,fe,Je);n=B.add3H(x,V,ye,Le),i=x|0}({h:n,l:i}=B.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:f}=B.add(this.Bh|0,this.Bl|0,o|0,f|0),{h:d,l:c}=B.add(this.Ch|0,this.Cl|0,d|0,c|0),{h:a,l:u}=B.add(this.Dh|0,this.Dl|0,a|0,u|0),{h,l:p}=B.add(this.Eh|0,this.El|0,h|0,p|0),{h:b,l:g}=B.add(this.Fh|0,this.Fl|0,b|0,g|0),{h:_,l:O}=B.add(this.Gh|0,this.Gl|0,_|0,O|0),{h:R,l:T}=B.add(this.Hh|0,this.Hl|0,R|0,T|0),this.set(n,i,o,f,d,c,a,u,h,p,b,g,_,O,R,T)}roundClean(){Ce.fill(0),Re.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const ja=ua(()=>new Pa);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Fr=BigInt(0),Vn=BigInt(1),Na=BigInt(2);function Sr(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ar(e){if(!Sr(e))throw new Error("Uint8Array expected")}function or(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const za=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Br(e){Ar(e);let t="";for(let r=0;r<e.length;r++)t+=za[e[r]];return t}function qn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Fr:BigInt("0x"+e)}const xe={_0:48,_9:57,A:65,F:70,a:97,f:102};function hn(e){if(e>=xe._0&&e<=xe._9)return e-xe._0;if(e>=xe.A&&e<=xe.F)return e-(xe.A-10);if(e>=xe.a&&e<=xe.f)return e-(xe.a-10)}function Jn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){const f=hn(e.charCodeAt(o)),d=hn(e.charCodeAt(o+1));if(f===void 0||d===void 0){const c=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}n[i]=f*16+d}return n}function Ua(e){return qn(Br(e))}function Pt(e){return Ar(e),qn(Br(Uint8Array.from(e).reverse()))}function kn(e,t){return Jn(e.toString(16).padStart(t*2,"0"))}function gr(e,t){return kn(e,t).reverse()}function Fe(e,t,r){let n;if(typeof t=="string")try{n=Jn(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else if(Sr(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(e+" of length "+r+" expected, got "+i);return n}function dn(...e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];Ar(i),t+=i.length}const r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){const o=e[n];r.set(o,i),i+=o.length}return r}const sr=e=>typeof e=="bigint"&&Fr<=e;function Da(e,t,r){return sr(e)&&sr(t)&&sr(r)&&t<=e&&e<r}function nt(e,t,r,n){if(!Da(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function Ma(e){let t;for(t=0;e>Fr;e>>=Vn,t+=1);return t}const $a=e=>(Na<<BigInt(e-1))-Vn,Ka={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Sr(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ir(e,t,r={}){const n=(i,o,f)=>{const d=Ka[o];if(typeof d!="function")throw new Error("invalid validator function");const c=e[i];if(!(f&&c===void 0)&&!d(c,e))throw new Error("param "+String(i)+" is invalid. Expected "+o+", got "+c)};for(const[i,o]of Object.entries(t))n(i,o,!1);for(const[i,o]of Object.entries(r))n(i,o,!0);return e}function pn(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(i!==void 0)return i;const o=e(r,...n);return t.set(r,o),o}}const X=BigInt(0),q=BigInt(1),De=BigInt(2),Ha=BigInt(3),br=BigInt(4),gn=BigInt(5),bn=BigInt(8);function k(e,t){const r=e%t;return r>=X?r:t+r}function Wa(e,t,r){if(t<X)throw new Error("invalid exponent, negatives unsupported");if(r<=X)throw new Error("invalid modulus");if(r===q)return X;let n=q;for(;t>X;)t&q&&(n=n*e%r),e=e*e%r,t>>=q;return n}function me(e,t,r){let n=e;for(;t-- >X;)n*=n,n%=r;return n}function yn(e,t){if(e===X)throw new Error("invert: expected non-zero number");if(t<=X)throw new Error("invert: expected positive modulus, got "+t);let r=k(e,t),n=t,i=X,o=q;for(;r!==X;){const f=n/r,d=n%r,c=i-o*f;n=r,r=d,i=o,o=c}if(n!==q)throw new Error("invert: does not exist");return k(i,t)}function Ga(e){const t=(e-q)/De;let r,n,i;for(r=e-q,n=0;r%De===X;r/=De,n++);for(i=De;i<e&&Wa(i,t,e)!==e-q;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const f=(e+q)/br;return function(d,c){const a=d.pow(c,f);if(!d.eql(d.sqr(a),c))throw new Error("Cannot find square root");return a}}const o=(r+q)/De;return function(f,d){if(f.pow(d,t)===f.neg(f.ONE))throw new Error("Cannot find square root");let c=n,a=f.pow(f.mul(f.ONE,i),r),u=f.pow(d,o),h=f.pow(d,r);for(;!f.eql(h,f.ONE);){if(f.eql(h,f.ZERO))return f.ZERO;let p=1;for(let g=f.sqr(h);p<c&&!f.eql(g,f.ONE);p++)g=f.sqr(g);const b=f.pow(a,q<<BigInt(c-p-1));a=f.sqr(b),u=f.mul(u,b),h=f.mul(h,a),c=p}return u}}function Va(e){if(e%br===Ha){const t=(e+q)/br;return function(r,n){const i=r.pow(n,t);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(e%bn===gn){const t=(e-gn)/bn;return function(r,n){const i=r.mul(n,De),o=r.pow(i,t),f=r.mul(n,o),d=r.mul(r.mul(f,De),o),c=r.mul(f,r.sub(d,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return Ga(e)}const qa=(e,t)=>(k(e,t)&q)===q,Ja=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ka(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Ja.reduce((n,i)=>(n[i]="function",n),t);return Ir(e,r)}function Za(e,t,r){if(r<X)throw new Error("invalid exponent, negatives unsupported");if(r===X)return e.ONE;if(r===q)return t;let n=e.ONE,i=t;for(;r>X;)r&q&&(n=e.mul(n,i)),i=e.sqr(i),r>>=q;return n}function Ya(e,t){const r=new Array(t.length),n=t.reduce((o,f,d)=>e.is0(f)?o:(r[d]=o,e.mul(o,f)),e.ONE),i=e.inv(n);return t.reduceRight((o,f,d)=>e.is0(f)?o:(r[d]=e.mul(o,r[d]),e.mul(o,f)),i),r}function Zn(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Yn(e,t,r=!1,n={}){if(e<=X)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:i,nByteLength:o}=Zn(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let f;const d=Object.freeze({ORDER:e,isLE:r,BITS:i,BYTES:o,MASK:$a(i),ZERO:X,ONE:q,create:c=>k(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return X<=c&&c<e},is0:c=>c===X,isOdd:c=>(c&q)===q,neg:c=>k(-c,e),eql:(c,a)=>c===a,sqr:c=>k(c*c,e),add:(c,a)=>k(c+a,e),sub:(c,a)=>k(c-a,e),mul:(c,a)=>k(c*a,e),pow:(c,a)=>Za(d,c,a),div:(c,a)=>k(c*yn(a,e),e),sqrN:c=>c*c,addN:(c,a)=>c+a,subN:(c,a)=>c-a,mulN:(c,a)=>c*a,inv:c=>yn(c,e),sqrt:n.sqrt||(c=>(f||(f=Va(e)),f(d,c))),invertBatch:c=>Ya(d,c),cmov:(c,a,u)=>u?a:c,toBytes:c=>r?gr(c,o):kn(c,o),fromBytes:c=>{if(c.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+c.length);return r?Pt(c):Ua(c)}});return Object.freeze(d)}const wn=BigInt(0),Tt=BigInt(1);function ar(e,t){const r=t.negate();return e?r:t}function Xn(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ur(e,t){Xn(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function Xa(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function Qa(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const cr=new WeakMap,Qn=new WeakMap;function fr(e){return Qn.get(e)||1}function eu(e,t){return{constTimeNegate:ar,hasPrecomputes(r){return fr(r)!==1},unsafeLadder(r,n,i=e.ZERO){let o=r;for(;n>wn;)n&Tt&&(i=i.add(o)),o=o.double(),n>>=Tt;return i},precomputeWindow(r,n){const{windows:i,windowSize:o}=ur(n,t),f=[];let d=r,c=d;for(let a=0;a<i;a++){c=d,f.push(c);for(let u=1;u<o;u++)c=c.add(d),f.push(c);d=c.double()}return f},wNAF(r,n,i){const{windows:o,windowSize:f}=ur(r,t);let d=e.ZERO,c=e.BASE;const a=BigInt(2**r-1),u=2**r,h=BigInt(r);for(let p=0;p<o;p++){const b=p*f;let g=Number(i&a);i>>=h,g>f&&(g-=u,i+=Tt);const _=b,O=b+Math.abs(g)-1,R=p%2!==0,T=g<0;g===0?c=c.add(ar(R,n[_])):d=d.add(ar(T,n[O]))}return{p:d,f:c}},wNAFUnsafe(r,n,i,o=e.ZERO){const{windows:f,windowSize:d}=ur(r,t),c=BigInt(2**r-1),a=2**r,u=BigInt(r);for(let h=0;h<f;h++){const p=h*d;if(i===wn)break;let b=Number(i&c);if(i>>=u,b>d&&(b-=a,i+=Tt),b===0)continue;let g=n[p+Math.abs(b)-1];b<0&&(g=g.negate()),o=o.add(g)}return o},getPrecomputes(r,n,i){let o=cr.get(n);return o||(o=this.precomputeWindow(n,r),r!==1&&cr.set(n,i(o))),o},wNAFCached(r,n,i){const o=fr(r);return this.wNAF(o,this.getPrecomputes(o,r,i),n)},wNAFCachedUnsafe(r,n,i,o){const f=fr(r);return f===1?this.unsafeLadder(r,n,o):this.wNAFUnsafe(f,this.getPrecomputes(f,r,i),n,o)},setWindowSize(r,n){Xn(n,t),Qn.set(r,n),cr.delete(r)}}}function tu(e,t,r,n){if(Xa(r,e),Qa(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,o=Ma(BigInt(r.length)),f=o>12?o-3:o>4?o-2:o?2:1,d=(1<<f)-1,c=new Array(d+1).fill(i),a=Math.floor((t.BITS-1)/f)*f;let u=i;for(let h=a;h>=0;h-=f){c.fill(i);for(let b=0;b<n.length;b++){const g=n[b],_=Number(g>>BigInt(h)&BigInt(d));c[_]=c[_].add(r[b])}let p=i;for(let b=c.length-1,g=i;b>0;b--)g=g.add(c[b]),p=p.add(g);if(u=u.add(p),h!==0)for(let b=0;b<f;b++)u=u.double()}return u}function ru(e){return ka(e.Fp),Ir(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Zn(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const pe=BigInt(0),ie=BigInt(1),Ct=BigInt(2),nu=BigInt(8),iu={zip215:!0};function ou(e){const t=ru(e);return Ir(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function su(e){const t=ou(e),{Fp:r,n,prehash:i,hash:o,randomBytes:f,nByteLength:d,h:c}=t,a=Ct<<BigInt(d*8)-ie,u=r.create,h=Yn(t.n,t.nBitLength),p=t.uvRatio||((x,w)=>{try{return{isValid:!0,value:r.sqrt(x*r.inv(w))}}catch{return{isValid:!1,value:pe}}}),b=t.adjustScalarBytes||(x=>x),g=t.domain||((x,w,E)=>{if(or("phflag",E),w.length||E)throw new Error("Contexts/pre-hash are not supported");return x});function _(x,w){nt("coordinate "+x,w,pe,a)}function O(x){if(!(x instanceof m))throw new Error("ExtendedPoint expected")}const R=pn((x,w)=>{const{ex:E,ey:F,ez:C}=x,L=x.is0();w==null&&(w=L?nu:r.inv(C));const P=u(E*w),D=u(F*w),j=u(C*w);if(L)return{x:pe,y:ie};if(j!==ie)throw new Error("invZ was invalid");return{x:P,y:D}}),T=pn(x=>{const{a:w,d:E}=t;if(x.is0())throw new Error("bad point: ZERO");const{ex:F,ey:C,ez:L,et:P}=x,D=u(F*F),j=u(C*C),M=u(L*L),S=u(M*M),Q=u(D*w),le=u(M*u(Q+j)),J=u(S+u(E*u(D*j)));if(le!==J)throw new Error("bad point: equation left != right (1)");const ne=u(F*C),he=u(L*P);if(ne!==he)throw new Error("bad point: equation left != right (2)");return!0});class m{constructor(w,E,F,C){this.ex=w,this.ey=E,this.ez=F,this.et=C,_("x",w),_("y",E),_("z",F),_("t",C),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof m)throw new Error("extended point not allowed");const{x:E,y:F}=w||{};return _("x",E),_("y",F),new m(E,F,ie,u(E*F))}static normalizeZ(w){const E=r.invertBatch(w.map(F=>F.ez));return w.map((F,C)=>F.toAffine(E[C])).map(m.fromAffine)}static msm(w,E){return tu(m,h,w,E)}_setWindowSize(w){H.setWindowSize(this,w)}assertValidity(){T(this)}equals(w){O(w);const{ex:E,ey:F,ez:C}=this,{ex:L,ey:P,ez:D}=w,j=u(E*D),M=u(L*C),S=u(F*D),Q=u(P*C);return j===M&&S===Q}is0(){return this.equals(m.ZERO)}negate(){return new m(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:w}=t,{ex:E,ey:F,ez:C}=this,L=u(E*E),P=u(F*F),D=u(Ct*u(C*C)),j=u(w*L),M=E+F,S=u(u(M*M)-L-P),Q=j+P,le=Q-D,J=j-P,ne=u(S*le),he=u(Q*J),we=u(S*J),Be=u(le*Q);return new m(ne,he,Be,we)}add(w){O(w);const{a:E,d:F}=t,{ex:C,ey:L,ez:P,et:D}=this,{ex:j,ey:M,ez:S,et:Q}=w;if(E===BigInt(-1)){const lt=u((L-C)*(M+j)),ht=u((L+C)*(M-j)),Ye=u(ht-lt);if(Ye===pe)return this.double();const dt=u(P*Ct*Q),pt=u(D*Ct*S),gt=pt+dt,bt=ht+lt,yt=pt-dt,$e=u(gt*Ye),Xe=u(bt*yt),wt=u(gt*yt),ae=u(Ye*bt);return new m($e,Xe,ae,wt)}const le=u(C*j),J=u(L*M),ne=u(D*F*Q),he=u(P*S),we=u((C+L)*(j+M)-le-J),Be=he-ne,ke=he+ne,Ze=u(J-E*le),Wt=u(we*Be),Gt=u(ke*Ze),Vt=u(we*Ze),qt=u(Be*ke);return new m(Wt,Gt,qt,Vt)}subtract(w){return this.add(w.negate())}wNAF(w){return H.wNAFCached(this,w,m.normalizeZ)}multiply(w){const E=w;nt("scalar",E,ie,n);const{p:F,f:C}=this.wNAF(E);return m.normalizeZ([F,C])[0]}multiplyUnsafe(w,E=m.ZERO){const F=w;return nt("scalar",F,pe,n),F===pe?z:this.is0()||F===ie?this:H.wNAFCachedUnsafe(this,F,m.normalizeZ,E)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return H.unsafeLadder(this,n).is0()}toAffine(w){return R(this,w)}clearCofactor(){const{h:w}=t;return w===ie?this:this.multiplyUnsafe(w)}static fromHex(w,E=!1){const{d:F,a:C}=t,L=r.BYTES;w=Fe("pointHex",w,L),or("zip215",E);const P=w.slice(),D=w[L-1];P[L-1]=D&-129;const j=Pt(P),M=E?a:r.ORDER;nt("pointHex.y",j,pe,M);const S=u(j*j),Q=u(S-ie),le=u(F*S-C);let{isValid:J,value:ne}=p(Q,le);if(!J)throw new Error("Point.fromHex: invalid y coordinate");const he=(ne&ie)===ie,we=(D&128)!==0;if(!E&&ne===pe&&we)throw new Error("Point.fromHex: x=0 and x_0=1");return we!==he&&(ne=u(-ne)),m.fromAffine({x:ne,y:j})}static fromPrivateKey(w){return V(w).point}toRawBytes(){const{x:w,y:E}=this.toAffine(),F=gr(E,r.BYTES);return F[F.length-1]|=w&ie?128:0,F}toHex(){return Br(this.toRawBytes())}}m.BASE=new m(t.Gx,t.Gy,ie,u(t.Gx*t.Gy)),m.ZERO=new m(pe,ie,ie,pe);const{BASE:I,ZERO:z}=m,H=eu(m,d*8);function G(x){return k(x,n)}function U(x){return G(Pt(x))}function V(x){const w=r.BYTES;x=Fe("private key",x,w);const E=Fe("hashed private key",o(x),2*w),F=b(E.slice(0,w)),C=E.slice(w,2*w),L=U(F),P=I.multiply(L),D=P.toRawBytes();return{head:F,prefix:C,scalar:L,point:P,pointBytes:D}}function be(x){return V(x).pointBytes}function ye(x=new Uint8Array,...w){const E=dn(...w);return U(o(g(E,Fe("context",x),!!i)))}function fe(x,w,E={}){x=Fe("message",x),i&&(x=i(x));const{prefix:F,scalar:C,pointBytes:L}=V(w),P=ye(E.context,F,x),D=I.multiply(P).toRawBytes(),j=ye(E.context,D,L,x),M=G(P+j*C);nt("signature.s",M,pe,n);const S=dn(D,gr(M,r.BYTES));return Fe("result",S,r.BYTES*2)}const Le=iu;function Je(x,w,E,F=Le){const{context:C,zip215:L}=F,P=r.BYTES;x=Fe("signature",x,2*P),w=Fe("message",w),E=Fe("publicKey",E,P),L!==void 0&&or("zip215",L),i&&(w=i(w));const D=Pt(x.slice(P,2*P));let j,M,S;try{j=m.fromHex(E,L),M=m.fromHex(x.slice(0,P),L),S=I.multiplyUnsafe(D)}catch{return!1}if(!L&&j.isSmallOrder())return!1;const Q=ye(C,M.toRawBytes(),j.toRawBytes(),w);return M.add(j.multiplyUnsafe(Q)).subtract(S).clearCofactor().equals(m.ZERO)}return I._setWindowSize(8),{CURVE:t,getPublicKey:be,sign:fe,verify:Je,ExtendedPoint:m,utils:{getExtendedPublicKey:V,randomPrivateKey:()=>f(r.BYTES),precompute(x=8,w=m.BASE){return w._setWindowSize(x),w.multiply(BigInt(3)),w}}}}BigInt(0),BigInt(1);const Or=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),mn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const au=BigInt(1),vn=BigInt(2);BigInt(3);const uu=BigInt(5),cu=BigInt(8);function fu(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=Or,f=e*e%o*e%o,d=me(f,vn,o)*f%o,c=me(d,au,o)*e%o,a=me(c,uu,o)*c%o,u=me(a,t,o)*a%o,h=me(u,r,o)*u%o,p=me(h,n,o)*h%o,b=me(p,i,o)*p%o,g=me(b,i,o)*p%o,_=me(g,t,o)*a%o;return{pow_p_5_8:me(_,vn,o)*e%o,b2:f}}function lu(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function hu(e,t){const r=Or,n=k(t*t*t,r),i=k(n*n*t,r),o=fu(e*i).pow_p_5_8;let f=k(e*n*o,r);const d=k(t*f*f,r),c=f,a=k(f*mn,r),u=d===e,h=d===k(-e,r),p=d===k(-e*mn,r);return u&&(f=c),(h||p)&&(f=a),qa(f,r)&&(f=k(-f,r)),{isValid:u||h,value:f}}const du=Yn(Or,void 0,!0),pu={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:du,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:cu,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ja,randomBytes:Wn,adjustScalarBytes:lu,uvRatio:hu},ei=su(pu),gu="EdDSA",bu="JWT",zt=".",$t="base64url",ti="utf8",ri="utf8",yu=":",wu="did",mu="key",_n="base58btc",vu="z",_u="K36",Eu=32;function Tr(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function ni(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Tr(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ii(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=ni(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return Tr(r)}function xu(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),f=o.charCodeAt(0);if(r[f]!==255)throw new TypeError(o+" is ambiguous");r[f]=i}var d=e.length,c=e.charAt(0),a=Math.log(d)/Math.log(256),u=Math.log(256)/Math.log(d);function h(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var _=0,O=0,R=0,T=g.length;R!==T&&g[R]===0;)R++,_++;for(var m=(T-R)*u+1>>>0,I=new Uint8Array(m);R!==T;){for(var z=g[R],H=0,G=m-1;(z!==0||H<O)&&G!==-1;G--,H++)z+=256*I[G]>>>0,I[G]=z%d>>>0,z=z/d>>>0;if(z!==0)throw new Error("Non-zero carry");O=H,R++}for(var U=m-O;U!==m&&I[U]===0;)U++;for(var V=c.repeat(_);U<m;++U)V+=e.charAt(I[U]);return V}function p(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var _=0;if(g[_]!==" "){for(var O=0,R=0;g[_]===c;)O++,_++;for(var T=(g.length-_)*a+1>>>0,m=new Uint8Array(T);g[_];){var I=r[g.charCodeAt(_)];if(I===255)return;for(var z=0,H=T-1;(I!==0||z<R)&&H!==-1;H--,z++)I+=d*m[H]>>>0,m[H]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");R=z,_++}if(g[_]!==" "){for(var G=T-R;G!==T&&m[G]===0;)G++;for(var U=new Uint8Array(O+(T-G)),V=O;G!==T;)U[V++]=m[G++];return U}}}function b(g){var _=p(g);if(_)return _;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:b}}var Fu=xu,Su=Fu;const oi=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Au=e=>new TextEncoder().encode(e),Bu=e=>new TextDecoder().decode(e);class Iu{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Ou{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return si(this,t)}}class Tu{constructor(t){this.decoders=t}or(t){return si(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const si=(e,t)=>new Tu({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Cu{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Iu(t,r,n),this.decoder=new Ou(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Kt=({name:e,prefix:t,encode:r,decode:n})=>new Cu(e,t,r,n),ft=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=Su(r,t);return Kt({prefix:e,name:t,encode:n,decode:o=>oi(i(o))})},Ru=(e,t,r,n)=>{const i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let o=e.length;for(;e[o-1]==="=";)--o;const f=new Uint8Array(o*r/8|0);let d=0,c=0,a=0;for(let u=0;u<o;++u){const h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,d+=r,d>=8&&(d-=8,f[a++]=255&c>>d)}if(d>=r||255&c<<8-d)throw new SyntaxError("Unexpected end of data");return f},Lu=(e,t,r)=>{const n=t[t.length-1]==="=",i=(1<<r)-1;let o="",f=0,d=0;for(let c=0;c<e.length;++c)for(d=d<<8|e[c],f+=8;f>r;)f-=r,o+=t[i&d>>f];if(f&&(o+=t[i&d<<r-f]),n)for(;o.length*r&7;)o+="=";return o},te=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Kt({prefix:t,name:e,encode(i){return Lu(i,n,r)},decode(i){return Ru(i,n,r,e)}}),Pu=Kt({prefix:"\0",name:"identity",encode:e=>Bu(e),decode:e=>Au(e)});var ju=Object.freeze({__proto__:null,identity:Pu});const Nu=te({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var zu=Object.freeze({__proto__:null,base2:Nu});const Uu=te({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Du=Object.freeze({__proto__:null,base8:Uu});const Mu=ft({prefix:"9",name:"base10",alphabet:"0123456789"});var $u=Object.freeze({__proto__:null,base10:Mu});const Ku=te({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Hu=te({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Wu=Object.freeze({__proto__:null,base16:Ku,base16upper:Hu});const Gu=te({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vu=te({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qu=te({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ju=te({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ku=te({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Zu=te({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Yu=te({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xu=te({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qu=te({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ec=Object.freeze({__proto__:null,base32:Gu,base32upper:Vu,base32pad:qu,base32padupper:Ju,base32hex:ku,base32hexupper:Zu,base32hexpad:Yu,base32hexpadupper:Xu,base32z:Qu});const tc=ft({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rc=ft({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var nc=Object.freeze({__proto__:null,base36:tc,base36upper:rc});const ic=ft({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),oc=ft({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var sc=Object.freeze({__proto__:null,base58btc:ic,base58flickr:oc});const ac=te({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),uc=te({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cc=te({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fc=te({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var lc=Object.freeze({__proto__:null,base64:ac,base64pad:uc,base64url:cc,base64urlpad:fc});const ai=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),hc=ai.reduce((e,t,r)=>(e[r]=t,e),[]),dc=ai.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function pc(e){return e.reduce((t,r)=>(t+=hc[r],t),"")}function gc(e){const t=[];for(const r of e){const n=dc[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const bc=Kt({prefix:"🚀",name:"base256emoji",encode:pc,decode:gc});var yc=Object.freeze({__proto__:null,base256emoji:bc}),wc=ui,En=128,mc=-128,vc=Math.pow(2,31);function ui(e,t,r){t=t||[],r=r||0;for(var n=r;e>=vc;)t[r++]=e&255|En,e/=128;for(;e&mc;)t[r++]=e&255|En,e>>>=7;return t[r]=e|0,ui.bytes=r-n+1,t}var _c=yr,Ec=128,xn=127;function yr(e,n){var r=0,n=n||0,i=0,o=n,f,d=e.length;do{if(o>=d)throw yr.bytes=0,new RangeError("Could not decode varint");f=e[o++],r+=i<28?(f&xn)<<i:(f&xn)*Math.pow(2,i),i+=7}while(f>=Ec);return yr.bytes=o-n,r}var xc=Math.pow(2,7),Fc=Math.pow(2,14),Sc=Math.pow(2,21),Ac=Math.pow(2,28),Bc=Math.pow(2,35),Ic=Math.pow(2,42),Oc=Math.pow(2,49),Tc=Math.pow(2,56),Cc=Math.pow(2,63),Rc=function(e){return e<xc?1:e<Fc?2:e<Sc?3:e<Ac?4:e<Bc?5:e<Ic?6:e<Oc?7:e<Tc?8:e<Cc?9:10},Lc={encode:wc,decode:_c,encodingLength:Rc},ci=Lc;const Fn=(e,t,r=0)=>(ci.encode(e,t,r),t),Sn=e=>ci.encodingLength(e),wr=(e,t)=>{const r=t.byteLength,n=Sn(e),i=n+Sn(r),o=new Uint8Array(i+r);return Fn(e,o,0),Fn(r,o,n),o.set(t,i),new Pc(e,r,t,o)};class Pc{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}}const fi=({name:e,code:t,encode:r})=>new jc(e,t,r);class jc{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?wr(this.code,r):r.then(n=>wr(this.code,n))}else throw Error("Unknown type, must be binary type")}}const li=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Nc=fi({name:"sha2-256",code:18,encode:li("SHA-256")}),zc=fi({name:"sha2-512",code:19,encode:li("SHA-512")});var Uc=Object.freeze({__proto__:null,sha256:Nc,sha512:zc});const hi=0,Dc="identity",di=oi,Mc=e=>wr(hi,di(e)),$c={code:hi,name:Dc,encode:di,digest:Mc};var Kc=Object.freeze({__proto__:null,identity:$c});new TextEncoder,new TextDecoder;const An={...ju,...zu,...Du,...$u,...Wu,...ec,...nc,...sc,...lc,...yc};({...Uc,...Kc});function pi(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Bn=pi("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),lr=pi("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=ni(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),gi={utf8:Bn,"utf-8":Bn,hex:An.base16,latin1:lr,ascii:lr,binary:lr,...An};function Ht(e,t="utf8"){const r=gi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function qe(e,t="utf8"){const r=gi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Tr(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function In(e){return ra(Ht(qe(e,$t),ti))}function Ut(e){return Ht(qe(na(e),ti),$t)}function bi(e){const t=qe(_u,_n),r=vu+Ht(ii([t,e]),_n);return[wu,mu,r].join(yu)}function Hc(e){return Ht(e,$t)}function Wc(e){return qe(e,$t)}function Gc(e){return qe([Ut(e.header),Ut(e.payload)].join(zt),ri)}function Vc(e){return[Ut(e.header),Ut(e.payload),Hc(e.signature)].join(zt)}function qc(e){const t=e.split(zt),r=In(t[0]),n=In(t[1]),i=Wc(t[2]),o=qe(t.slice(0,2).join(zt),ri);return{header:r,payload:n,signature:i,data:o}}function Jc(e=Wn(Eu)){const t=ei.getPublicKey(e);return{secretKey:ii([e,t]),publicKey:t}}async function kc(e,t,r,n,i=ge.cjs.fromMiliseconds(Date.now())){const o={alg:gu,typ:bu},f=bi(n.publicKey),d=i+r,c={iss:f,sub:e,aud:t,iat:i,exp:d},a=Gc({header:o,payload:c}),u=ei.sign(a,n.secretKey.slice(0,32));return Vc({header:o,payload:c,signature:u})}const Zc="PARSE_ERROR",Yc="INVALID_REQUEST",Xc="METHOD_NOT_FOUND",Qc="INVALID_PARAMS",yi="INTERNAL_ERROR",Cr="SERVER_ERROR",ef=[-32700,-32600,-32601,-32602,-32603],it={[Zc]:{code:-32700,message:"Parse error"},[Yc]:{code:-32600,message:"Invalid Request"},[Xc]:{code:-32601,message:"Method not found"},[Qc]:{code:-32602,message:"Invalid params"},[yi]:{code:-32603,message:"Internal error"},[Cr]:{code:-32e3,message:"Server error"}},wi=Cr;function tf(e){return ef.includes(e)}function On(e){return Object.keys(it).includes(e)?it[e]:it[wi]}function rf(e){const t=Object.values(it).find(r=>r.code===e);return t||it[wi]}function nf(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var mi={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-BFSevX7g.js"),ko=require("./dijkstra-CtFxn7S9.js"),Mo=require("./index-X1wTeN-B.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-DMhLZESv.js"),ko=require("./dijkstra-CtFxn7S9.js"),Mo=require("./index-DoE4VQhB.js");/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,7 +1,7 @@
1
1
  var k = Object.defineProperty;
2
2
  var v = (u, s, t) => s in u ? k(u, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[s] = t;
3
3
  var i = (u, s, t) => v(u, typeof s != "symbol" ? s + "" : s, t);
4
- import { cX as C, c1 as S, d4 as f, b$ as _, aD as w, c0 as b, ap as y, c2 as T, dh as M, bW as x } from "./index-Bnnn4cdG.mjs";
4
+ import { cX as C, c1 as S, d4 as f, b$ as _, aD as w, c0 as b, ap as y, c2 as T, dh as M, bW as x } from "./index-BOD0JbTK.mjs";
5
5
  const j = [
6
6
  [
7
7
  "Testnet",
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>m(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-X1wTeN-B.js");class d{constructor(e,r,t,n){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"chainId");o(this,"coreBridgePackageId");this.network=e,this.chain=r,this.provider=t,this.contracts=n,this.chainId=c.toChainId(r);const s=n.coreBridge;if(!s)throw new Error(`CoreBridge contract Address for chain ${r} not found`);this.coreBridgePackageId=s}getGuardianSet(e){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,r){const[t,n]=await c.SuiPlatform.chainFromRpc(e),s=r[n];if(s.network!==t)throw new Error(`Network mismatch: ${s.network} !== ${t}`);return new d(t,n,e,s.contracts)}async*verifyMessage(e,r){throw new Error("Method not implemented.")}async*publishMessage(e,r){throw new Error("Method not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(t=>({emitter:t.emitterAddress,sequence:t.sequence,chain:this.chain}))}async getGuardianSetIndex(){throw new Error("Method not implemented.")}async parseMessages(e){var n;const t=(n=(await this.provider.getTransactionBlock({digest:e,options:{showEvents:!0,showEffects:!0,showInput:!0}})).events)==null?void 0:n.filter(s=>s.type.endsWith("WormholeMessage"));if(!t||t.length==0)throw new Error("WormholeMessage not found");return t.map(s=>{const i=s.parsedJson;return c.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:new c.SuiAddress(i.sender).toUniversalAddress(),sequence:BigInt(i.sequence),guardianSet:0,timestamp:Number(i.timestamp),consistencyLevel:i.consistency_level,nonce:i.nonce,signatures:[],payload:new Uint8Array(i.payload)})})}}c.registerProtocol("Sui","WormholeCore",d);exports.SuiWormholeCore=d;
1
+ "use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>m(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-DoE4VQhB.js");class d{constructor(e,r,t,n){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"chainId");o(this,"coreBridgePackageId");this.network=e,this.chain=r,this.provider=t,this.contracts=n,this.chainId=c.toChainId(r);const s=n.coreBridge;if(!s)throw new Error(`CoreBridge contract Address for chain ${r} not found`);this.coreBridgePackageId=s}getGuardianSet(e){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,r){const[t,n]=await c.SuiPlatform.chainFromRpc(e),s=r[n];if(s.network!==t)throw new Error(`Network mismatch: ${s.network} !== ${t}`);return new d(t,n,e,s.contracts)}async*verifyMessage(e,r){throw new Error("Method not implemented.")}async*publishMessage(e,r){throw new Error("Method not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(t=>({emitter:t.emitterAddress,sequence:t.sequence,chain:this.chain}))}async getGuardianSetIndex(){throw new Error("Method not implemented.")}async parseMessages(e){var n;const t=(n=(await this.provider.getTransactionBlock({digest:e,options:{showEvents:!0,showEffects:!0,showInput:!0}})).events)==null?void 0:n.filter(s=>s.type.endsWith("WormholeMessage"));if(!t||t.length==0)throw new Error("WormholeMessage not found");return t.map(s=>{const i=s.parsedJson;return c.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:new c.SuiAddress(i.sender).toUniversalAddress(),sequence:BigInt(i.sequence),guardianSet:0,timestamp:Number(i.timestamp),consistencyLevel:i.consistency_level,nonce:i.nonce,signatures:[],payload:new Uint8Array(i.payload)})})}}c.registerProtocol("Sui","WormholeCore",d);exports.SuiWormholeCore=d;
@@ -1,6 +1,6 @@
1
- import { s as ce, T as N, o as ot, n as _t, R as Do, t as H, y as gt, a as C, p as K } from "./index-DQJ5IMd3.mjs";
1
+ import { s as ce, T as N, o as ot, n as _t, R as Do, t as H, y as gt, a as C, p as K } from "./index-B9a8iQAY.mjs";
2
2
  import { d as Uo } from "./dijkstra-BZM-8g-B.mjs";
3
- import { d as Wo } from "./index-Bnnn4cdG.mjs";
3
+ import { d as Wo } from "./index-BOD0JbTK.mjs";
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2019 Google LLC
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index-X1wTeN-B.js"),pl=require("./dijkstra-CtFxn7S9.js"),P=require("./index-C9vy8VuD.js"),_=require("./index-BSsBLI7m.js"),W=require("./index-CJReTDxB.js");let gl=class extends _.r{constructor(e){super(e),this.events=new E.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(_.formatJsonRpcRequest(e.method,e.params||[],e.id||_.getBigIntRpcId().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{_.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,t)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),_.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var yl=function(){var r=document.getSelection();if(!r.rangeCount)return function(){};for(var e=document.activeElement,t=[],i=0;i<r.rangeCount;i++)t.push(r.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return r.removeAllRanges(),function(){r.type==="Caret"&&r.removeAllRanges(),r.rangeCount||t.forEach(function(n){r.addRange(n)}),e&&e.focus()}},ml=yl,Ln={"text/plain":"Text","text/html":"Url",default:"Text"},vl="Copy to clipboard: #{key}, Enter";function wl(r){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return r.replace(/#{\s*key\s*}/g,e)}function _l(r,e){var t,i,n,s,o,a,c=!1;e||(e={}),t=e.debug||!1;try{n=ml(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=r,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),e.format)if(u.preventDefault(),typeof u.clipboardData>"u"){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=Ln[e.format]||Ln.default;window.clipboardData.setData(h,r)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,r);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){t&&console.error("unable to copy using execCommand: ",u),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",r),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(h){t&&console.error("unable to copy using clipboardData: ",h),t&&console.error("falling back to prompt"),i=wl("message"in e?e.message:vl),window.prompt(i,r)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return c}var bl=_l,El={}.toString,tn=Array.isArray||function(r){return El.call(r)=="[object Array]"},Sl=E.requireElliptic(),rn={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});var $o=Q.getLocalStorage=Ko=Q.getLocalStorageOrThrow=zo=Q.getCrypto=jo=Q.getCryptoOrThrow=Uo=Q.getLocation=Bo=Q.getLocationOrThrow=qo=Q.getNavigator=Fo=Q.getNavigatorOrThrow=Do=Q.getDocument=Lo=Q.getDocumentOrThrow=Mo=Q.getFromWindowOrThrow=ko=Q.getFromWindow=void 0;function vt(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}var ko=Q.getFromWindow=vt;function Ft(r){const e=vt(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}var Mo=Q.getFromWindowOrThrow=Ft;function Il(){return Ft("document")}var Lo=Q.getDocumentOrThrow=Il;function xl(){return vt("document")}var Do=Q.getDocument=xl;function Pl(){return Ft("navigator")}var Fo=Q.getNavigatorOrThrow=Pl;function Al(){return vt("navigator")}var qo=Q.getNavigator=Al;function Rl(){return Ft("location")}var Bo=Q.getLocationOrThrow=Rl;function Nl(){return vt("location")}var Uo=Q.getLocation=Nl;function Tl(){return Ft("crypto")}var jo=Q.getCryptoOrThrow=Tl;function Cl(){return vt("crypto")}var zo=Q.getCrypto=Cl;function Ol(){return Ft("localStorage")}var Ko=Q.getLocalStorageOrThrow=Ol;function $l(){return vt("localStorage")}$o=Q.getLocalStorage=$l;Object.defineProperty(rn,"__esModule",{value:!0});var Vo=rn.getWindowMetadata=void 0;const Dn=Q;function kl(){let r,e;try{r=Dn.getDocumentOrThrow(),e=Dn.getLocationOrThrow()}catch{return null}function t(){const h=r.getElementsByTagName("link"),p=[];for(let d=0;d<h.length;d++){const f=h[d],g=f.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){const y=f.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let m=e.protocol+"//"+e.host;if(y.indexOf("/")===0)m+=y;else{const v=e.pathname.split("/");v.pop();const b=v.join("/");m+=b+"/"+y}p.push(m)}else if(y.indexOf("//")===0){const m=e.protocol+y;p.push(m)}else p.push(y)}}return p}function i(...h){const p=r.getElementsByTagName("meta");for(let d=0;d<p.length;d++){const f=p[d],g=["itemprop","property","name"].map(y=>f.getAttribute(y)).filter(y=>y?h.includes(y):!1);if(g.length&&g){const y=f.getAttribute("content");if(y)return y}}return""}function n(){let h=i("name","og:site_name","og:title","twitter:title");return h||(h=r.title),h}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),c=e.origin,l=t();return{description:a,url:c,icons:l,name:o}}Vo=rn.getWindowMetadata=kl;var Ml=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},Ll=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),Dl=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=E.dist.process.platform}return r}(),Fl=function(){function r(e,t,i,n){this.name=e,this.version=t,this.os=i,this.bot=n,this.type="bot-device"}return r}(),ql=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Bl=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Ul=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,jl=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Fn=3,zl=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",Ul]],qn=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Kl(r){return r?Bn(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bl:typeof navigator<"u"?Bn(navigator.userAgent):Hl()}function Vl(r){return r!==""&&zl.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var s=n.exec(r);return!!s&&[i,s]},!1)}function Bn(r){var e=Vl(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new ql;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Fn&&(n=Ml(n,Jl(Fn-n.length))):n=[];var s=n.join("."),o=Wl(r),a=jl.exec(r);return a&&a[1]?new Fl(t,s,o,a[1]):new Ll(t,s,o)}function Wl(r){for(var e=0,t=qn.length;e<t;e++){var i=qn[e],n=i[0],s=i[1],o=s.exec(r);if(o)return n}return null}function Hl(){var r=typeof E.dist.process<"u"&&E.dist.process.version;return r?new Dl(E.dist.process.version.slice(1)):null}function Jl(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function nn(r){return Kl(r)}function Kr(){const r=nn();return r&&r.os?r.os:void 0}function Wo(){const r=Kr();return r?r.toLowerCase().includes("android"):!1}function Ho(){const r=Kr();return r?r.toLowerCase().includes("ios")||r.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function Gl(){return Kr()?Wo()||Ho():!1}function Jo(){const r=nn();return r&&r.name?r.name.toLowerCase()==="node":!1}function Yl(){return!Jo()&&!!Go()}const Ql=ko,Xl=Mo,Zl=Lo,eu=Do,tu=Fo,Go=qo,ru=Bo,iu=Uo,nu=jo,su=zo,ou=Ko,Vr=$o;function au(){return Vo()}function cu(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return JSON.parse(r)}catch{return r}}function lu(r){return typeof r=="string"?r:JSON.stringify(r)}const Yo=cu,Qo=lu;function Xo(r,e){const t=Qo(e),i=Vr();i&&i.setItem(r,t)}function uu(r){let e=null,t=null;const i=Vr();return i&&(t=i.getItem(r)),e=t&&Yo(t),e}function hu(r){const e=Vr();e&&e.removeItem(r)}const Zo="WALLETCONNECT_DEEPLINK_CHOICE";function du(r,e){const t=encodeURIComponent(r);return e.universalLink?`${e.universalLink}/wc?uri=${t}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${t}`:""}function fu(r){const e=r.href.split("?")[0];Xo(Zo,Object.assign(Object.assign({},r),{href:e}))}function ea(r,e){return r.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))[0]}function pu(r,e){let t=r;return e&&(t=e.map(i=>ea(r,i)).filter(Boolean)),t}const ta="https://registry.walletconnect.com";function gu(){return ta+"/api/v2/wallets"}function yu(){return ta+"/api/v2/dapps"}function ra(r,e="mobile"){var t;return{name:r.name||"",shortName:r.metadata.shortName||"",color:r.metadata.colors.primary||"",logo:(t=r.image_url.sm)!==null&&t!==void 0?t:"",universalLink:r[e].universal||"",deepLink:r[e].native||""}}function mu(r,e="mobile"){return Object.values(r).filter(t=>!!t[e].universal||!!t[e].native).map(t=>ra(t,e))}const vu=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:nn,detectOS:Kr,formatIOSMobile:du,formatMobileRegistry:mu,formatMobileRegistryEntry:ra,getClientMeta:au,getCrypto:su,getCryptoOrThrow:nu,getDappRegistryUrl:yu,getDocument:eu,getDocumentOrThrow:Zl,getFromWindow:Ql,getFromWindowOrThrow:Xl,getLocal:uu,getLocalStorage:Vr,getLocalStorageOrThrow:ou,getLocation:iu,getLocationOrThrow:ru,getMobileLinkRegistry:pu,getMobileRegistryEntry:ea,getNavigator:Go,getNavigatorOrThrow:tu,getWalletRegistryUrl:gu,isAndroid:Wo,isBrowser:Yl,isIOS:Ho,isMobile:Gl,isNode:Jo,mobileLinkChoiceKey:Zo,removeLocal:hu,safeJsonParse:Yo,safeJsonStringify:Qo,saveMobileLinkInfo:fu,setLocal:Xo},Symbol.toStringTag,{value:"Module"})),wu=E.getAugmentedNamespace(vu);var ur={},_u=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},ia={},at={},bu=tn;function Eu(){try{var r=new Uint8Array(1);return r.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},r.foo()===42}catch{return!1}}j.TYPED_ARRAY_SUPPORT=Eu();var Un=j.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function j(r,e,t){return!j.TYPED_ARRAY_SUPPORT&&!(this instanceof j)?new j(r,e,t):typeof r=="number"?na(this,r):Nu(this,r,e,t)}j.TYPED_ARRAY_SUPPORT&&(j.prototype.__proto__=Uint8Array.prototype,j.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&j[Symbol.species]===j&&Object.defineProperty(j,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function sn(r){if(r>=Un)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Un.toString(16)+" bytes");return r|0}function Su(r){return r!==r}function Nt(r,e){var t;return j.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=j.prototype):(t=r,t===null&&(t=new j(e)),t.length=e),t}function na(r,e){var t=Nt(r,e<0?0:sn(e)|0);if(!j.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function Iu(r,e){var t=oa(e)|0,i=Nt(r,t),n=i.write(e);return n!==t&&(i=i.slice(0,n)),i}function Oi(r,e){for(var t=e.length<0?0:sn(e.length)|0,i=Nt(r,t),n=0;n<t;n+=1)i[n]=e[n]&255;return i}function xu(r,e,t,i){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");var n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),j.TYPED_ARRAY_SUPPORT?n.__proto__=j.prototype:n=Oi(r,n),n}function Pu(r,e){if(j.isBuffer(e)){var t=sn(e.length)|0,i=Nt(r,t);return i.length===0||e.copy(i,0,0,t),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Su(e.length)?Nt(r,0):Oi(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Oi(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function sa(r,e){e=e||1/0;for(var t,i=r.length,n=null,s=[],o=0;o<i;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function oa(r){if(j.isBuffer(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;return e===0?0:sa(r).length}function Au(r,e,t,i){for(var n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function Ru(r,e,t,i){return Au(sa(e,r.length-t),r,t,i)}function Nu(r,e,t,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?xu(r,e,t,i):typeof e=="string"?Iu(r,e):Pu(r,e)}j.prototype.write=function(e,t,i){t===void 0?(i=this.length,t=0):i===void 0&&typeof t=="string"?(i=this.length,t=0):isFinite(t)&&(t=t|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-t;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return Ru(this,e,t,i)};j.prototype.slice=function(e,t){var i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var n;if(j.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=j.prototype;else{var s=t-e;n=new j(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};j.prototype.copy=function(e,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i,o;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!j.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s};j.prototype.fill=function(e,t,i){if(typeof e=="string"){if(typeof t=="string"?(t=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{var o=j.isBuffer(e)?e:new j(e),a=o.length;for(s=0;s<i-t;++s)this[s+t]=o[s%a]}return this};j.concat=function(e,t){if(!bu(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Nt(null,0);var i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=na(null,t),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!j.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};j.byteLength=oa;j.prototype._isBuffer=!0;j.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};at.alloc=function(r){var e=new j(r);return e.fill(0),e};at.from=function(r){return new j(r)};var _e={},on,Tu=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];_e.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};_e.getSymbolTotalCodewords=function(e){return Tu[e]};_e.getBCHDigit=function(r){for(var e=0;r!==0;)e++,r>>>=1;return e};_e.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');on=e};_e.isKanjiModeEnabled=function(){return typeof on<"u"};_e.toSJIS=function(e){return on(e)};var Wr={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");var i=t.toLowerCase();switch(i){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,n){if(r.isValid(i))return i;try{return e(i)}catch{return n}}})(Wr);function aa(){this.buffer=[],this.length=0}aa.prototype={get:function(r){var e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(var t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Cu=aa,jn=at;function hr(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=jn.alloc(r*r),this.reservedBit=jn.alloc(r*r)}hr.prototype.set=function(r,e,t,i){var n=r*this.size+e;this.data[n]=t,i&&(this.reservedBit[n]=!0)};hr.prototype.get=function(r,e){return this.data[r*this.size+e]};hr.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t};hr.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var Ou=hr,ca={};(function(r){var e=_e.getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],c=1;c<n-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},r.getPositions=function(i){for(var n=[],s=r.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||n.push([s[a],s[c]]);return n}})(ca);var la={},$u=_e.getSymbolSize,zn=7;la.getPositions=function(e){var t=$u(e);return[[0,0],[t-zn,0],[0,t-zn]]};var ua={};(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},r.from=function(n){return r.isValid(n)?parseInt(n,10):void 0},r.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,c=0,l=null,u=null,h=0;h<s;h++){a=c=0,l=u=null;for(var p=0;p<s;p++){var d=n.get(h,p);d===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=d,a=1),d=n.get(p,h),d===u?c++:(c>=5&&(o+=e.N1+(c-5)),u=d,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},r.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var c=0;c<s-1;c++){var l=n.get(a,c)+n.get(a,c+1)+n.get(a+1,c)+n.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},r.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,c=0,l=0;l<s;l++){a=c=0;for(var u=0;u<s;u++)a=a<<1&2047|n.get(l,u),u>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|n.get(u,l),u>=10&&(c===1488||c===93)&&o++}return o*e.N3},r.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var c=Math.abs(Math.ceil(s*100/o/5)-10);return c*e.N4};function t(i,n,s){switch(i){case r.Patterns.PATTERN000:return(n+s)%2===0;case r.Patterns.PATTERN001:return n%2===0;case r.Patterns.PATTERN010:return s%3===0;case r.Patterns.PATTERN011:return(n+s)%3===0;case r.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case r.Patterns.PATTERN101:return n*s%2+n*s%3===0;case r.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case r.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,t(n,c,a))},r.getBestMask=function(n,s){for(var o=Object.keys(r.Patterns).length,a=0,c=1/0,l=0;l<o;l++){s(l),r.applyMask(l,n);var u=r.getPenaltyN1(n)+r.getPenaltyN2(n)+r.getPenaltyN3(n)+r.getPenaltyN4(n);r.applyMask(l,n),u<c&&(c=u,a=l)}return a}})(ua);var Hr={},tt=Wr,wr=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],_r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Hr.getBlocksCount=function(e,t){switch(t){case tt.L:return wr[(e-1)*4+0];case tt.M:return wr[(e-1)*4+1];case tt.Q:return wr[(e-1)*4+2];case tt.H:return wr[(e-1)*4+3];default:return}};Hr.getTotalCodewordsCount=function(e,t){switch(t){case tt.L:return _r[(e-1)*4+0];case tt.M:return _r[(e-1)*4+1];case tt.Q:return _r[(e-1)*4+2];case tt.H:return _r[(e-1)*4+3];default:return}};var ha={},Jr={},da=at,Zt=da.alloc(512),Or=da.alloc(256);(function(){for(var e=1,t=0;t<255;t++)Zt[t]=e,Or[e]=t,e<<=1,e&256&&(e^=285);for(t=255;t<512;t++)Zt[t]=Zt[t-255]})();Jr.log=function(e){if(e<1)throw new Error("log("+e+")");return Or[e]};Jr.exp=function(e){return Zt[e]};Jr.mul=function(e,t){return e===0||t===0?0:Zt[Or[e]+Or[t]]};(function(r){var e=at,t=Jr;r.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var c=0;c<s.length;c++)o[a+c]^=t.mul(n[a],s[c]);return o},r.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],c=0;c<s.length;c++)o[c]^=t.mul(s[c],a);for(var l=0;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},r.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=r.mul(s,[1,t.exp(o)]);return s}})(ha);var Kn=at,fa=ha,ku=E.bufferPolyfill.Buffer;function an(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}an.prototype.initialize=function(e){this.degree=e,this.genPoly=fa.generateECPolynomial(this.degree)};an.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=Kn.alloc(this.degree),i=ku.concat([e,t],e.length+this.degree),n=fa.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=Kn.alloc(this.degree);return n.copy(o,s),o}return n};var Mu=an,pa={},ct={},cn={};cn.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var je={},ga="[0-9]+",Lu="[A-Z $%*+\\-./:]+",nr="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";nr=nr.replace(/u/g,"\\u");var Du="(?:(?![A-Z0-9 $%*+\\-./:]|"+nr+`)(?:.|[\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./index-DoE4VQhB.js"),pl=require("./dijkstra-CtFxn7S9.js"),P=require("./index-Drp6LJGk.js"),_=require("./index-CUnIraeu.js"),W=require("./index-B2rKFKuc.js");let gl=class extends _.r{constructor(e){super(e),this.events=new E.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(_.formatJsonRpcRequest(e.method,e.params||[],e.id||_.getBigIntRpcId().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{_.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,t)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),_.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var yl=function(){var r=document.getSelection();if(!r.rangeCount)return function(){};for(var e=document.activeElement,t=[],i=0;i<r.rangeCount;i++)t.push(r.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return r.removeAllRanges(),function(){r.type==="Caret"&&r.removeAllRanges(),r.rangeCount||t.forEach(function(n){r.addRange(n)}),e&&e.focus()}},ml=yl,Ln={"text/plain":"Text","text/html":"Url",default:"Text"},vl="Copy to clipboard: #{key}, Enter";function wl(r){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return r.replace(/#{\s*key\s*}/g,e)}function _l(r,e){var t,i,n,s,o,a,c=!1;e||(e={}),t=e.debug||!1;try{n=ml(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=r,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),e.format)if(u.preventDefault(),typeof u.clipboardData>"u"){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=Ln[e.format]||Ln.default;window.clipboardData.setData(h,r)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,r);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){t&&console.error("unable to copy using execCommand: ",u),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",r),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(h){t&&console.error("unable to copy using clipboardData: ",h),t&&console.error("falling back to prompt"),i=wl("message"in e?e.message:vl),window.prompt(i,r)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return c}var bl=_l,El={}.toString,tn=Array.isArray||function(r){return El.call(r)=="[object Array]"},Sl=E.requireElliptic(),rn={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});var $o=Q.getLocalStorage=Ko=Q.getLocalStorageOrThrow=zo=Q.getCrypto=jo=Q.getCryptoOrThrow=Uo=Q.getLocation=Bo=Q.getLocationOrThrow=qo=Q.getNavigator=Fo=Q.getNavigatorOrThrow=Do=Q.getDocument=Lo=Q.getDocumentOrThrow=Mo=Q.getFromWindowOrThrow=ko=Q.getFromWindow=void 0;function vt(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}var ko=Q.getFromWindow=vt;function Ft(r){const e=vt(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}var Mo=Q.getFromWindowOrThrow=Ft;function Il(){return Ft("document")}var Lo=Q.getDocumentOrThrow=Il;function xl(){return vt("document")}var Do=Q.getDocument=xl;function Pl(){return Ft("navigator")}var Fo=Q.getNavigatorOrThrow=Pl;function Al(){return vt("navigator")}var qo=Q.getNavigator=Al;function Rl(){return Ft("location")}var Bo=Q.getLocationOrThrow=Rl;function Nl(){return vt("location")}var Uo=Q.getLocation=Nl;function Tl(){return Ft("crypto")}var jo=Q.getCryptoOrThrow=Tl;function Cl(){return vt("crypto")}var zo=Q.getCrypto=Cl;function Ol(){return Ft("localStorage")}var Ko=Q.getLocalStorageOrThrow=Ol;function $l(){return vt("localStorage")}$o=Q.getLocalStorage=$l;Object.defineProperty(rn,"__esModule",{value:!0});var Vo=rn.getWindowMetadata=void 0;const Dn=Q;function kl(){let r,e;try{r=Dn.getDocumentOrThrow(),e=Dn.getLocationOrThrow()}catch{return null}function t(){const h=r.getElementsByTagName("link"),p=[];for(let d=0;d<h.length;d++){const f=h[d],g=f.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){const y=f.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let m=e.protocol+"//"+e.host;if(y.indexOf("/")===0)m+=y;else{const v=e.pathname.split("/");v.pop();const b=v.join("/");m+=b+"/"+y}p.push(m)}else if(y.indexOf("//")===0){const m=e.protocol+y;p.push(m)}else p.push(y)}}return p}function i(...h){const p=r.getElementsByTagName("meta");for(let d=0;d<p.length;d++){const f=p[d],g=["itemprop","property","name"].map(y=>f.getAttribute(y)).filter(y=>y?h.includes(y):!1);if(g.length&&g){const y=f.getAttribute("content");if(y)return y}}return""}function n(){let h=i("name","og:site_name","og:title","twitter:title");return h||(h=r.title),h}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),c=e.origin,l=t();return{description:a,url:c,icons:l,name:o}}Vo=rn.getWindowMetadata=kl;var Ml=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},Ll=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),Dl=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=E.dist.process.platform}return r}(),Fl=function(){function r(e,t,i,n){this.name=e,this.version=t,this.os=i,this.bot=n,this.type="bot-device"}return r}(),ql=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Bl=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Ul=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,jl=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Fn=3,zl=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",Ul]],qn=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Kl(r){return r?Bn(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Bl:typeof navigator<"u"?Bn(navigator.userAgent):Hl()}function Vl(r){return r!==""&&zl.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var s=n.exec(r);return!!s&&[i,s]},!1)}function Bn(r){var e=Vl(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new ql;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Fn&&(n=Ml(n,Jl(Fn-n.length))):n=[];var s=n.join("."),o=Wl(r),a=jl.exec(r);return a&&a[1]?new Fl(t,s,o,a[1]):new Ll(t,s,o)}function Wl(r){for(var e=0,t=qn.length;e<t;e++){var i=qn[e],n=i[0],s=i[1],o=s.exec(r);if(o)return n}return null}function Hl(){var r=typeof E.dist.process<"u"&&E.dist.process.version;return r?new Dl(E.dist.process.version.slice(1)):null}function Jl(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function nn(r){return Kl(r)}function Kr(){const r=nn();return r&&r.os?r.os:void 0}function Wo(){const r=Kr();return r?r.toLowerCase().includes("android"):!1}function Ho(){const r=Kr();return r?r.toLowerCase().includes("ios")||r.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function Gl(){return Kr()?Wo()||Ho():!1}function Jo(){const r=nn();return r&&r.name?r.name.toLowerCase()==="node":!1}function Yl(){return!Jo()&&!!Go()}const Ql=ko,Xl=Mo,Zl=Lo,eu=Do,tu=Fo,Go=qo,ru=Bo,iu=Uo,nu=jo,su=zo,ou=Ko,Vr=$o;function au(){return Vo()}function cu(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return JSON.parse(r)}catch{return r}}function lu(r){return typeof r=="string"?r:JSON.stringify(r)}const Yo=cu,Qo=lu;function Xo(r,e){const t=Qo(e),i=Vr();i&&i.setItem(r,t)}function uu(r){let e=null,t=null;const i=Vr();return i&&(t=i.getItem(r)),e=t&&Yo(t),e}function hu(r){const e=Vr();e&&e.removeItem(r)}const Zo="WALLETCONNECT_DEEPLINK_CHOICE";function du(r,e){const t=encodeURIComponent(r);return e.universalLink?`${e.universalLink}/wc?uri=${t}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${t}`:""}function fu(r){const e=r.href.split("?")[0];Xo(Zo,Object.assign(Object.assign({},r),{href:e}))}function ea(r,e){return r.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))[0]}function pu(r,e){let t=r;return e&&(t=e.map(i=>ea(r,i)).filter(Boolean)),t}const ta="https://registry.walletconnect.com";function gu(){return ta+"/api/v2/wallets"}function yu(){return ta+"/api/v2/dapps"}function ra(r,e="mobile"){var t;return{name:r.name||"",shortName:r.metadata.shortName||"",color:r.metadata.colors.primary||"",logo:(t=r.image_url.sm)!==null&&t!==void 0?t:"",universalLink:r[e].universal||"",deepLink:r[e].native||""}}function mu(r,e="mobile"){return Object.values(r).filter(t=>!!t[e].universal||!!t[e].native).map(t=>ra(t,e))}const vu=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:nn,detectOS:Kr,formatIOSMobile:du,formatMobileRegistry:mu,formatMobileRegistryEntry:ra,getClientMeta:au,getCrypto:su,getCryptoOrThrow:nu,getDappRegistryUrl:yu,getDocument:eu,getDocumentOrThrow:Zl,getFromWindow:Ql,getFromWindowOrThrow:Xl,getLocal:uu,getLocalStorage:Vr,getLocalStorageOrThrow:ou,getLocation:iu,getLocationOrThrow:ru,getMobileLinkRegistry:pu,getMobileRegistryEntry:ea,getNavigator:Go,getNavigatorOrThrow:tu,getWalletRegistryUrl:gu,isAndroid:Wo,isBrowser:Yl,isIOS:Ho,isMobile:Gl,isNode:Jo,mobileLinkChoiceKey:Zo,removeLocal:hu,safeJsonParse:Yo,safeJsonStringify:Qo,saveMobileLinkInfo:fu,setLocal:Xo},Symbol.toStringTag,{value:"Module"})),wu=E.getAugmentedNamespace(vu);var ur={},_u=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},ia={},at={},bu=tn;function Eu(){try{var r=new Uint8Array(1);return r.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},r.foo()===42}catch{return!1}}j.TYPED_ARRAY_SUPPORT=Eu();var Un=j.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function j(r,e,t){return!j.TYPED_ARRAY_SUPPORT&&!(this instanceof j)?new j(r,e,t):typeof r=="number"?na(this,r):Nu(this,r,e,t)}j.TYPED_ARRAY_SUPPORT&&(j.prototype.__proto__=Uint8Array.prototype,j.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&j[Symbol.species]===j&&Object.defineProperty(j,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function sn(r){if(r>=Un)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Un.toString(16)+" bytes");return r|0}function Su(r){return r!==r}function Nt(r,e){var t;return j.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=j.prototype):(t=r,t===null&&(t=new j(e)),t.length=e),t}function na(r,e){var t=Nt(r,e<0?0:sn(e)|0);if(!j.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function Iu(r,e){var t=oa(e)|0,i=Nt(r,t),n=i.write(e);return n!==t&&(i=i.slice(0,n)),i}function Oi(r,e){for(var t=e.length<0?0:sn(e.length)|0,i=Nt(r,t),n=0;n<t;n+=1)i[n]=e[n]&255;return i}function xu(r,e,t,i){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");var n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),j.TYPED_ARRAY_SUPPORT?n.__proto__=j.prototype:n=Oi(r,n),n}function Pu(r,e){if(j.isBuffer(e)){var t=sn(e.length)|0,i=Nt(r,t);return i.length===0||e.copy(i,0,0,t),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Su(e.length)?Nt(r,0):Oi(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return Oi(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function sa(r,e){e=e||1/0;for(var t,i=r.length,n=null,s=[],o=0;o<i;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function oa(r){if(j.isBuffer(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;return e===0?0:sa(r).length}function Au(r,e,t,i){for(var n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function Ru(r,e,t,i){return Au(sa(e,r.length-t),r,t,i)}function Nu(r,e,t,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?xu(r,e,t,i):typeof e=="string"?Iu(r,e):Pu(r,e)}j.prototype.write=function(e,t,i){t===void 0?(i=this.length,t=0):i===void 0&&typeof t=="string"?(i=this.length,t=0):isFinite(t)&&(t=t|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-t;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return Ru(this,e,t,i)};j.prototype.slice=function(e,t){var i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var n;if(j.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=j.prototype;else{var s=t-e;n=new j(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};j.prototype.copy=function(e,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i,o;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!j.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s};j.prototype.fill=function(e,t,i){if(typeof e=="string"){if(typeof t=="string"?(t=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{var o=j.isBuffer(e)?e:new j(e),a=o.length;for(s=0;s<i-t;++s)this[s+t]=o[s%a]}return this};j.concat=function(e,t){if(!bu(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Nt(null,0);var i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=na(null,t),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!j.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};j.byteLength=oa;j.prototype._isBuffer=!0;j.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};at.alloc=function(r){var e=new j(r);return e.fill(0),e};at.from=function(r){return new j(r)};var _e={},on,Tu=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];_e.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};_e.getSymbolTotalCodewords=function(e){return Tu[e]};_e.getBCHDigit=function(r){for(var e=0;r!==0;)e++,r>>>=1;return e};_e.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');on=e};_e.isKanjiModeEnabled=function(){return typeof on<"u"};_e.toSJIS=function(e){return on(e)};var Wr={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");var i=t.toLowerCase();switch(i){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,n){if(r.isValid(i))return i;try{return e(i)}catch{return n}}})(Wr);function aa(){this.buffer=[],this.length=0}aa.prototype={get:function(r){var e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(var t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Cu=aa,jn=at;function hr(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=jn.alloc(r*r),this.reservedBit=jn.alloc(r*r)}hr.prototype.set=function(r,e,t,i){var n=r*this.size+e;this.data[n]=t,i&&(this.reservedBit[n]=!0)};hr.prototype.get=function(r,e){return this.data[r*this.size+e]};hr.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t};hr.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var Ou=hr,ca={};(function(r){var e=_e.getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],c=1;c<n-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},r.getPositions=function(i){for(var n=[],s=r.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||n.push([s[a],s[c]]);return n}})(ca);var la={},$u=_e.getSymbolSize,zn=7;la.getPositions=function(e){var t=$u(e);return[[0,0],[t-zn,0],[0,t-zn]]};var ua={};(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},r.from=function(n){return r.isValid(n)?parseInt(n,10):void 0},r.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,c=0,l=null,u=null,h=0;h<s;h++){a=c=0,l=u=null;for(var p=0;p<s;p++){var d=n.get(h,p);d===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=d,a=1),d=n.get(p,h),d===u?c++:(c>=5&&(o+=e.N1+(c-5)),u=d,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},r.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var c=0;c<s-1;c++){var l=n.get(a,c)+n.get(a,c+1)+n.get(a+1,c)+n.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},r.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,c=0,l=0;l<s;l++){a=c=0;for(var u=0;u<s;u++)a=a<<1&2047|n.get(l,u),u>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|n.get(u,l),u>=10&&(c===1488||c===93)&&o++}return o*e.N3},r.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var c=Math.abs(Math.ceil(s*100/o/5)-10);return c*e.N4};function t(i,n,s){switch(i){case r.Patterns.PATTERN000:return(n+s)%2===0;case r.Patterns.PATTERN001:return n%2===0;case r.Patterns.PATTERN010:return s%3===0;case r.Patterns.PATTERN011:return(n+s)%3===0;case r.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case r.Patterns.PATTERN101:return n*s%2+n*s%3===0;case r.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case r.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,t(n,c,a))},r.getBestMask=function(n,s){for(var o=Object.keys(r.Patterns).length,a=0,c=1/0,l=0;l<o;l++){s(l),r.applyMask(l,n);var u=r.getPenaltyN1(n)+r.getPenaltyN2(n)+r.getPenaltyN3(n)+r.getPenaltyN4(n);r.applyMask(l,n),u<c&&(c=u,a=l)}return a}})(ua);var Hr={},tt=Wr,wr=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],_r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Hr.getBlocksCount=function(e,t){switch(t){case tt.L:return wr[(e-1)*4+0];case tt.M:return wr[(e-1)*4+1];case tt.Q:return wr[(e-1)*4+2];case tt.H:return wr[(e-1)*4+3];default:return}};Hr.getTotalCodewordsCount=function(e,t){switch(t){case tt.L:return _r[(e-1)*4+0];case tt.M:return _r[(e-1)*4+1];case tt.Q:return _r[(e-1)*4+2];case tt.H:return _r[(e-1)*4+3];default:return}};var ha={},Jr={},da=at,Zt=da.alloc(512),Or=da.alloc(256);(function(){for(var e=1,t=0;t<255;t++)Zt[t]=e,Or[e]=t,e<<=1,e&256&&(e^=285);for(t=255;t<512;t++)Zt[t]=Zt[t-255]})();Jr.log=function(e){if(e<1)throw new Error("log("+e+")");return Or[e]};Jr.exp=function(e){return Zt[e]};Jr.mul=function(e,t){return e===0||t===0?0:Zt[Or[e]+Or[t]]};(function(r){var e=at,t=Jr;r.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var c=0;c<s.length;c++)o[a+c]^=t.mul(n[a],s[c]);return o},r.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],c=0;c<s.length;c++)o[c]^=t.mul(s[c],a);for(var l=0;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},r.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=r.mul(s,[1,t.exp(o)]);return s}})(ha);var Kn=at,fa=ha,ku=E.bufferPolyfill.Buffer;function an(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}an.prototype.initialize=function(e){this.degree=e,this.genPoly=fa.generateECPolynomial(this.degree)};an.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=Kn.alloc(this.degree),i=ku.concat([e,t],e.length+this.degree),n=fa.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=Kn.alloc(this.degree);return n.copy(o,s),o}return n};var Mu=an,pa={},ct={},cn={};cn.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var je={},ga="[0-9]+",Lu="[A-Z $%*+\\-./:]+",nr="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";nr=nr.replace(/u/g,"\\u");var Du="(?:(?![A-Z0-9 $%*+\\-./:]|"+nr+`)(?:.|[\r
2
2
  ]))+`;je.KANJI=new RegExp(nr,"g");je.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");je.BYTE=new RegExp(Du,"g");je.NUMERIC=new RegExp(ga,"g");je.ALPHANUMERIC=new RegExp(Lu,"g");var Fu=new RegExp("^"+nr+"$"),qu=new RegExp("^"+ga+"$"),Bu=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");je.testKanji=function(e){return Fu.test(e)};je.testNumeric=function(e){return qu.test(e)};je.testAlphanumeric=function(e){return Bu.test(e)};(function(r){var e=cn,t=je;r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},r.getBestModeForData=function(s){return t.testNumeric(s)?r.NUMERIC:t.testAlphanumeric(s)?r.ALPHANUMERIC:t.testKanji(s)?r.KANJI:r.BYTE},r.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},r.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");var s=n.toLowerCase();switch(s){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+n)}}r.from=function(s,o){if(r.isValid(s))return s;try{return i(s)}catch{return o}}})(ct);(function(r){var e=_e,t=Hr,i=Wr,n=ct,s=cn,o=tn,a=7973,c=e.getBCHDigit(a);function l(d,f,g){for(var y=1;y<=40;y++)if(f<=r.getCapacity(y,g,d))return y}function u(d,f){return n.getCharCountIndicator(d,f)+4}function h(d,f){var g=0;return d.forEach(function(y){var m=u(y.mode,f);g+=m+y.getBitsLength()}),g}function p(d,f){for(var g=1;g<=40;g++){var y=h(d,g);if(y<=r.getCapacity(g,f,n.MIXED))return g}}r.from=function(f,g){return s.isValid(f)?parseInt(f,10):g},r.getCapacity=function(f,g,y){if(!s.isValid(f))throw new Error("Invalid QR Code version");typeof y>"u"&&(y=n.BYTE);var m=e.getSymbolTotalCodewords(f),v=t.getTotalCodewordsCount(f,g),b=(m-v)*8;if(y===n.MIXED)return b;var w=b-u(y,f);switch(y){case n.NUMERIC:return Math.floor(w/10*3);case n.ALPHANUMERIC:return Math.floor(w/11*2);case n.KANJI:return Math.floor(w/13);case n.BYTE:default:return Math.floor(w/8)}},r.getBestVersionForData=function(f,g){var y,m=i.from(g,i.M);if(o(f)){if(f.length>1)return p(f,m);if(f.length===0)return 1;y=f[0]}else y=f;return l(y.mode,y.getLength(),m)},r.getEncodedBits=function(f){if(!s.isValid(f)||f<7)throw new Error("Invalid QR Code version");for(var g=f<<12;e.getBCHDigit(g)-c>=0;)g^=a<<e.getBCHDigit(g)-c;return f<<12|g}})(pa);var ya={},$i=_e,ma=1335,Uu=21522,Vn=$i.getBCHDigit(ma);ya.getEncodedBits=function(e,t){for(var i=e.bit<<3|t,n=i<<10;$i.getBCHDigit(n)-Vn>=0;)n^=ma<<$i.getBCHDigit(n)-Vn;return(i<<10|n)^Uu};var va={},ju=ct;function Tt(r){this.mode=ju.NUMERIC,this.data=r.toString()}Tt.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Tt.prototype.getLength=function(){return this.data.length};Tt.prototype.getBitsLength=function(){return Tt.getBitsLength(this.data.length)};Tt.prototype.write=function(e){var t,i,n;for(t=0;t+3<=this.data.length;t+=3)i=this.data.substr(t,3),n=parseInt(i,10),e.put(n,10);var s=this.data.length-t;s>0&&(i=this.data.substr(t),n=parseInt(i,10),e.put(n,s*3+1))};var zu=Tt,Ku=ct,ui=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Ct(r){this.mode=Ku.ALPHANUMERIC,this.data=r}Ct.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Ct.prototype.getLength=function(){return this.data.length};Ct.prototype.getBitsLength=function(){return Ct.getBitsLength(this.data.length)};Ct.prototype.write=function(e){var t;for(t=0;t+2<=this.data.length;t+=2){var i=ui.indexOf(this.data[t])*45;i+=ui.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(ui.indexOf(this.data[t]),6)};var Vu=Ct,Wu=at,Hu=ct;function Ot(r){this.mode=Hu.BYTE,this.data=Wu.from(r)}Ot.getBitsLength=function(e){return e*8};Ot.prototype.getLength=function(){return this.data.length};Ot.prototype.getBitsLength=function(){return Ot.getBitsLength(this.data.length)};Ot.prototype.write=function(r){for(var e=0,t=this.data.length;e<t;e++)r.put(this.data[e],8)};var Ju=Ot,Gu=ct,Yu=_e;function $t(r){this.mode=Gu.KANJI,this.data=r}$t.getBitsLength=function(e){return e*13};$t.prototype.getLength=function(){return this.data.length};$t.prototype.getBitsLength=function(){return $t.getBitsLength(this.data.length)};$t.prototype.write=function(r){var e;for(e=0;e<this.data.length;e++){var t=Yu.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
3
3
  Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),r.put(t,13)}};var Qu=$t;(function(r){var e=ct,t=zu,i=Vu,n=Ju,s=Qu,o=je,a=_e,c=pl.dijkstraExports;function l(m){return unescape(encodeURIComponent(m)).length}function u(m,v,b){for(var w=[],S;(S=m.exec(b))!==null;)w.push({data:S[0],index:S.index,mode:v,length:S[0].length});return w}function h(m){var v=u(o.NUMERIC,e.NUMERIC,m),b=u(o.ALPHANUMERIC,e.ALPHANUMERIC,m),w,S;a.isKanjiModeEnabled()?(w=u(o.BYTE,e.BYTE,m),S=u(o.KANJI,e.KANJI,m)):(w=u(o.BYTE_KANJI,e.BYTE,m),S=[]);var I=v.concat(b,w,S);return I.sort(function(x,A){return x.index-A.index}).map(function(x){return{data:x.data,mode:x.mode,length:x.length}})}function p(m,v){switch(v){case e.NUMERIC:return t.getBitsLength(m);case e.ALPHANUMERIC:return i.getBitsLength(m);case e.KANJI:return s.getBitsLength(m);case e.BYTE:return n.getBitsLength(m)}}function d(m){return m.reduce(function(v,b){var w=v.length-1>=0?v[v.length-1]:null;return w&&w.mode===b.mode?(v[v.length-1].data+=b.data,v):(v.push(b),v)},[])}function f(m){for(var v=[],b=0;b<m.length;b++){var w=m[b];switch(w.mode){case e.NUMERIC:v.push([w,{data:w.data,mode:e.ALPHANUMERIC,length:w.length},{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.ALPHANUMERIC:v.push([w,{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.KANJI:v.push([w,{data:w.data,mode:e.BYTE,length:l(w.data)}]);break;case e.BYTE:v.push([{data:w.data,mode:e.BYTE,length:l(w.data)}])}}return v}function g(m,v){for(var b={},w={start:{}},S=["start"],I=0;I<m.length;I++){for(var x=m[I],A=[],C=0;C<x.length;C++){var O=x[C],$=""+I+C;A.push($),b[$]={node:O,lastCount:0},w[$]={};for(var D=0;D<S.length;D++){var k=S[D];b[k]&&b[k].node.mode===O.mode?(w[k][$]=p(b[k].lastCount+O.length,O.mode)-p(b[k].lastCount,O.mode),b[k].lastCount+=O.length):(b[k]&&(b[k].lastCount=O.length),w[k][$]=p(O.length,O.mode)+4+e.getCharCountIndicator(O.mode,v))}}S=A}for(D=0;D<S.length;D++)w[S[D]].end=0;return{map:w,table:b}}function y(m,v){var b,w=e.getBestModeForData(m);if(b=e.from(v,w),b!==e.BYTE&&b.bit<w.bit)throw new Error('"'+m+'" cannot be encoded with mode '+e.toString(b)+`.
4
4
  Suggested mode is: `+e.toString(w));switch(b===e.KANJI&&!a.isKanjiModeEnabled()&&(b=e.BYTE),b){case e.NUMERIC:return new t(m);case e.ALPHANUMERIC:return new i(m);case e.KANJI:return new s(m);case e.BYTE:return new n(m)}}r.fromArray=function(v){return v.reduce(function(b,w){return typeof w=="string"?b.push(y(w,null)):w.data&&b.push(y(w.data,w.mode)),b},[])},r.fromString=function(v,b){for(var w=h(v,a.isKanjiModeEnabled()),S=f(w),I=g(S,b),x=c.find_path(I.map,"start","end"),A=[],C=1;C<x.length-1;C++)A.push(I.table[x[C]].node);return r.fromArray(d(A))},r.rawSplit=function(v){return r.fromArray(h(v,a.isKanjiModeEnabled()))}})(va);var Wn=at,Gr=_e,hi=Wr,Xu=Cu,Zu=Ou,eh=ca,th=la,ki=ua,Mi=Hr,rh=Mu,$r=pa,ih=ya,nh=ct,di=va,sh=tn;function oh(r,e){for(var t=r.size,i=th.getPositions(e),n=0;n<i.length;n++)for(var s=i[n][0],o=i[n][1],a=-1;a<=7;a++)if(!(s+a<=-1||t<=s+a))for(var c=-1;c<=7;c++)o+c<=-1||t<=o+c||(a>=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?r.set(s+a,o+c,!0,!0):r.set(s+a,o+c,!1,!0))}function ah(r){for(var e=r.size,t=8;t<e-8;t++){var i=t%2===0;r.set(t,6,i,!0),r.set(6,t,i,!0)}}function ch(r,e){for(var t=eh.getPositions(e),i=0;i<t.length;i++)for(var n=t[i][0],s=t[i][1],o=-2;o<=2;o++)for(var a=-2;a<=2;a++)o===-2||o===2||a===-2||a===2||o===0&&a===0?r.set(n+o,s+a,!0,!0):r.set(n+o,s+a,!1,!0)}function lh(r,e){for(var t=r.size,i=$r.getEncodedBits(e),n,s,o,a=0;a<18;a++)n=Math.floor(a/3),s=a%3+t-8-3,o=(i>>a&1)===1,r.set(n,s,o,!0),r.set(s,n,o,!0)}function fi(r,e,t){var i=r.size,n=ih.getEncodedBits(e,t),s,o;for(s=0;s<15;s++)o=(n>>s&1)===1,s<6?r.set(s,8,o,!0):s<8?r.set(s+1,8,o,!0):r.set(i-15+s,8,o,!0),s<8?r.set(8,i-s-1,o,!0):s<9?r.set(8,15-s-1+1,o,!0):r.set(8,15-s-1,o,!0);r.set(i-8,8,1,!0)}function uh(r,e){for(var t=r.size,i=-1,n=t-1,s=7,o=0,a=t-1;a>0;a-=2)for(a===6&&a--;;){for(var c=0;c<2;c++)if(!r.isReserved(n,a-c)){var l=!1;o<e.length&&(l=(e[o]>>>s&1)===1),r.set(n,a-c,l),s--,s===-1&&(o++,s=7)}if(n+=i,n<0||t<=n){n-=i,i=-i;break}}}function hh(r,e,t){var i=new Xu;t.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),nh.getCharCountIndicator(l.mode,r)),l.write(i)});var n=Gr.getSymbolTotalCodewords(r),s=Mi.getTotalCodewordsCount(r,e),o=(n-s)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);for(var a=(o-i.getLengthInBits())/8,c=0;c<a;c++)i.put(c%2?17:236,8);return dh(i,r,e)}function dh(r,e,t){for(var i=Gr.getSymbolTotalCodewords(e),n=Mi.getTotalCodewordsCount(e,t),s=i-n,o=Mi.getBlocksCount(e,t),a=i%o,c=o-a,l=Math.floor(i/o),u=Math.floor(s/o),h=u+1,p=l-u,d=new rh(p),f=0,g=new Array(o),y=new Array(o),m=0,v=Wn.from(r.buffer),b=0;b<o;b++){var w=b<c?u:h;g[b]=v.slice(f,f+w),y[b]=d.encode(g[b]),f+=w,m=Math.max(m,w)}var S=Wn.alloc(i),I=0,x,A;for(x=0;x<m;x++)for(A=0;A<o;A++)x<g[A].length&&(S[I++]=g[A][x]);for(x=0;x<p;x++)for(A=0;A<o;A++)S[I++]=y[A][x];return S}function fh(r,e,t,i){var n;if(sh(r))n=di.fromArray(r);else if(typeof r=="string"){var s=e;if(!s){var o=di.rawSplit(r);s=$r.getBestVersionForData(o,t)}n=di.fromString(r,s||40)}else throw new Error("Invalid data");var a=$r.getBestVersionForData(n,t);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`