@dodoex/wallet-web3 0.0.40 → 0.0.41-1

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 (79) hide show
  1. package/dist/{DefaultJsonRpcProvider-a9b4edef.js → DefaultJsonRpcProvider-ae4e010b.js} +1 -1
  2. package/dist/__node-resolve_empty-adff7651.js +1 -0
  3. package/dist/__tslib-b3416fbd.js +1 -0
  4. package/dist/{blocto-c2f03aa6.js → blocto-6012bcee.js} +1 -1
  5. package/dist/{bn-a80bf6c0.js → bn-f63668bd.js} +1 -1
  6. package/dist/{browser-ponyfill-f38c41bc.js → browser-ponyfill-6a7a565b.js} +1 -1
  7. package/dist/cjs/{DefaultJsonRpcProvider-ca454f8e.cjs → DefaultJsonRpcProvider-2894e1a2.cjs} +1 -1
  8. package/dist/cjs/{__node-resolve_empty-6d7ad87b.cjs → __node-resolve_empty-f57ca5f8.cjs} +1 -1
  9. package/dist/cjs/__tslib-47f6b6a1.cjs +1 -0
  10. package/dist/cjs/{blocto-05a85ecf.cjs → blocto-14265f1b.cjs} +1 -1
  11. package/dist/cjs/{bn-b63aca15.cjs → bn-002a9654.cjs} +1 -1
  12. package/dist/cjs/{browser-ponyfill-b0be11d9.cjs → browser-ponyfill-f8923c78.cjs} +1 -1
  13. package/dist/cjs/core/index.d.ts +1 -1
  14. package/dist/cjs/{draggabilly-f616433b.cjs → draggabilly-7288c192.cjs} +1 -1
  15. package/dist/cjs/{ethers-ba816f82.cjs → ethers-747d32a6.cjs} +1 -1
  16. package/dist/cjs/{id-323e4c90.cjs → id-ef87d991.cjs} +1 -1
  17. package/dist/cjs/{index-6902d1ea.cjs → index-475b4539.cjs} +2 -2
  18. package/dist/cjs/{index-41d4ce9e.cjs → index-4b9cc9db.cjs} +2 -2
  19. package/dist/cjs/{index-0c0e48bd.cjs → index-7de08e81.cjs} +1 -1
  20. package/dist/cjs/{index-a2ac2501.cjs → index-7e3602c5.cjs} +1 -1
  21. package/dist/cjs/{index-56f21973.cjs → index-8e7ec75f.cjs} +1 -1
  22. package/dist/cjs/{index-c40d494c.cjs → index-b30f5999.cjs} +1 -1
  23. package/dist/cjs/index-bec3f245.cjs +9 -0
  24. package/dist/cjs/{index-65d19adb.cjs → index-d291a707.cjs} +1 -1
  25. package/dist/cjs/{index-f529a5e1.cjs → index-e368a1ec.cjs} +1 -1
  26. package/dist/cjs/{index-ad37aa8e.cjs → index-f107e2df.cjs} +1 -1
  27. package/dist/cjs/{index-8c9af5ed.cjs → index-fdec095f.cjs} +1 -1
  28. package/dist/cjs/index.cjs +1 -1
  29. package/dist/cjs/{index.es-8f036e0f.cjs → index.es-8a10cab5.cjs} +1 -1
  30. package/dist/cjs/{interface-b28a2cea.cjs → interface-c5af1d39.cjs} +1 -1
  31. package/dist/cjs/{lib-typedarrays-e979897b.cjs → lib-typedarrays-18eafa57.cjs} +1 -1
  32. package/dist/cjs/{portis-a05f6805.cjs → portis-3e53aa74.cjs} +1 -1
  33. package/dist/cjs/{provider-deee1712.cjs → provider-0765a0c4.cjs} +1 -1
  34. package/dist/cjs/providers/wallets/index.d.ts +5 -1
  35. package/dist/cjs/providers/wallets/types.d.ts +1 -0
  36. package/dist/cjs/{rainbow-69c0a69b.cjs → rainbow-f0553261.cjs} +1 -1
  37. package/dist/cjs/{sha224-9457bb96.cjs → sha224-f39873dc.cjs} +1 -1
  38. package/dist/cjs/{sha256-5fb5de86.cjs → sha256-0f1577ad.cjs} +1 -1
  39. package/dist/cjs/{uAuth-7fa3d23a.cjs → uAuth-9f12e987.cjs} +1 -1
  40. package/dist/cjs/{walletConnect-c603a6a4.cjs → walletConnect-08310517.cjs} +1 -1
  41. package/dist/cjs/{walletLink-899a33a2.cjs → walletLink-695f93b6.cjs} +1 -1
  42. package/dist/core/index.d.ts +1 -1
  43. package/dist/{draggabilly-8b6b21c5.js → draggabilly-be876492.js} +1 -1
  44. package/dist/{ethers-598924c4.js → ethers-a71b41f1.js} +1 -1
  45. package/dist/{id-bce3c131.js → id-aa7002c2.js} +1 -1
  46. package/dist/index-0c189400.js +9 -0
  47. package/dist/{index-b80e350c.js → index-1fa84282.js} +1 -1
  48. package/dist/{index-57766b84.js → index-2ff19703.js} +1 -1
  49. package/dist/{index-a6717e78.js → index-3a56ad18.js} +1 -1
  50. package/dist/index-466c44f8.js +1 -0
  51. package/dist/{index-cf915864.js → index-9d6a1b0f.js} +2 -2
  52. package/dist/{index-7f873c40.js → index-a7fd26b2.js} +1 -1
  53. package/dist/{index-cf9d6206.js → index-c8b61e1c.js} +1 -1
  54. package/dist/{index-0288dfdf.js → index-cae05be8.js} +1 -1
  55. package/dist/{index-19bc04f2.js → index-f19f4eef.js} +1 -1
  56. package/dist/{index-13cee3c1.js → index-f9177065.js} +1 -1
  57. package/dist/{index.es-2b585733.js → index.es-59cd195e.js} +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/{interface-bdaa6e2e.js → interface-9c07cadd.js} +1 -1
  60. package/dist/{lib-typedarrays-b5e70c03.js → lib-typedarrays-fcec28ff.js} +1 -1
  61. package/dist/{portis-58d16f24.js → portis-6134280d.js} +1 -1
  62. package/dist/{provider-62a23419.js → provider-b7f8b65b.js} +1 -1
  63. package/dist/providers/wallets/index.d.ts +5 -1
  64. package/dist/providers/wallets/types.d.ts +1 -0
  65. package/dist/rainbow-9e32f732.js +1 -0
  66. package/dist/sha224-849f74bf.js +1 -0
  67. package/dist/{sha256-c7e66f3f.js → sha256-3dad34ed.js} +1 -1
  68. package/dist/{uAuth-0812723b.js → uAuth-fac6fff4.js} +1 -1
  69. package/dist/{walletConnect-0b1a9181.js → walletConnect-62201bb8.js} +1 -1
  70. package/dist/{walletLink-7080edd7.js → walletLink-82cc3eeb.js} +1 -1
  71. package/package.json +1 -1
  72. package/dist/__node-resolve_empty-ad78977d.js +0 -1
  73. package/dist/__tslib-e712523b.js +0 -1
  74. package/dist/cjs/__tslib-b203abab.cjs +0 -1
  75. package/dist/cjs/index-578427cc.cjs +0 -9
  76. package/dist/index-9b7de542.js +0 -9
  77. package/dist/index-cb9250a0.js +0 -1
  78. package/dist/rainbow-898a2c25.js +0 -1
  79. package/dist/sha224-1c4b79b3.js +0 -1
@@ -1,3 +1,3 @@
1
- import{c as e,g as t,e as r,b as n,_ as i,i as o,d as s}from"./index-9b7de542.js";import a from"events";import{b as c}from"./bn-a80bf6c0.js";import{i as u}from"./inherits_browser-51bb8c3c.js";import l from"buffer";import{r as h}from"./__node-resolve_empty-ad78977d.js";import{s as d}from"./index-6be6f872.js";import{r as f}from"./__tslib-e712523b.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/address";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/properties";import"@ethersproject/transactions";import"@ethersproject/bytes";import"util";var p={},b={},y={};Object.defineProperty(y,"__esModule",{value:!0}),y.walletLogo=void 0;y.walletLogo=(e,t)=>{let r;switch(e){case"standard":default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}};var g={};Object.defineProperty(g,"__esModule",{value:!0}),g.ScopedLocalStorage=void 0;g.ScopedLocalStorage=class{constructor(e){this.scope=e}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let r=0;r<localStorage.length;r++){const n=localStorage.key(r);"string"==typeof n&&n.startsWith(e)&&t.push(n)}t.forEach((e=>localStorage.removeItem(e)))}scopedKey(e){return`${this.scope}:${e}`}};var m={},v={};Object.defineProperty(v,"__esModule",{value:!0});const _=a;function w(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class S extends _.EventEmitter{emit(e,...t){let r="error"===e;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const i=n[e];if(void 0===i)return!1;if("function"==typeof i)w(i,this,t);else{const e=i.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(i);for(let n=0;n<e;n+=1)w(r[n],this,t)}return!0}}v.default=S;var E={},x={},k=N;N.default=N,N.stable=P,N.stableStringify=P;var C="[...]",M="[Circular]",I=[],R=[];function A(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function N(e,t,r,n){var i;void 0===n&&(n=A()),O(e,"",0,[],void 0,0,n);try{i=0===R.length?JSON.stringify(e,t,r):JSON.stringify(e,D(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==I.length;){var o=I.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function j(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);void 0!==i.get?i.configurable?(Object.defineProperty(n,r,{value:e}),I.push([n,r,t,i])):R.push([t,r,e]):(n[r]=e,I.push([n,r,t]))}function O(e,t,r,n,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<n.length;a++)if(n[a]===e)return void j(M,e,t,i);if(void 0!==s.depthLimit&&o>s.depthLimit)return void j(C,e,t,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void j(C,e,t,i);if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)O(e[a],a,a,n,e,o,s);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var u=c[a];O(e[u],u,a,n,e,o,s)}}n.pop()}}function T(e,t){return e<t?-1:e>t?1:0}function P(e,t,r,n){void 0===n&&(n=A());var i,o=L(e,"",0,[],void 0,0,n)||e;try{i=0===R.length?JSON.stringify(o,t,r):JSON.stringify(o,D(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==I.length;){var s=I.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function L(e,t,r,n,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<n.length;a++)if(n[a]===e)return void j(M,e,t,i);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==s.depthLimit&&o>s.depthLimit)return void j(C,e,t,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void j(C,e,t,i);if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)L(e[a],a,a,n,e,o,s);else{var c={},u=Object.keys(e).sort(T);for(a=0;a<u.length;a++){var l=u[a];L(e[l],l,a,n,e,o,s),c[l]=e[l]}if(void 0===i)return c;I.push([i,t,e]),i[t]=c}n.pop()}}function D(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(R.length>0)for(var n=0;n<R.length;n++){var i=R[n];if(i[1]===t&&i[0]===r){r=i[2],R.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(x,"__esModule",{value:!0}),x.EthereumProviderError=x.EthereumRpcError=void 0;const B=k;class F extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return B.default(this.serialize(),U,2)}}x.EthereumRpcError=F;function U(e,t){if("[Circular]"!==t)return t}x.EthereumProviderError=class extends F{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}};var V={},H={};Object.defineProperty(H,"__esModule",{value:!0}),H.errorValues=H.errorCodes=void 0,H.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},H.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=H,r=x,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};function s(r,n=i){if(Number.isInteger(r)){const n=r.toString();if(l(t.errorValues,n))return t.errorValues[n].message;if(c(r))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function a(e){if(!Number.isInteger(e))return!1;const r=e.toString();return!!t.errorValues[r]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function u(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=s,e.isValidCode=a,e.serializeError=function(e,{fallbackError:t=o,shouldIncludeStack:n=!1}={}){var i,c;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof r.EthereumRpcError)return e.serialize();const h={};if(e&&"object"==typeof e&&!Array.isArray(e)&&l(e,"code")&&a(e.code)){const t=e;h.code=t.code,t.message&&"string"==typeof t.message?(h.message=t.message,l(t,"data")&&(h.data=t.data)):(h.message=s(h.code),h.data={originalError:u(e)})}else{h.code=t.code;const r=null===(i=e)||void 0===i?void 0:i.message;h.message=r&&"string"==typeof r?r:t.message,h.data={originalError:u(e)}}const d=null===(c=e)||void 0===c?void 0:c.stack;return n&&e&&d&&"string"==typeof d&&(h.stack=d),h}}(V);var W={};Object.defineProperty(W,"__esModule",{value:!0}),W.ethErrors=void 0;const z=x,q=V,J=H;function $(e,t){const[r,n]=Z(t);return new z.EthereumRpcError(e,r||q.getMessageFromCode(e),n)}function G(e,t){const[r,n]=Z(t);return new z.EthereumProviderError(e,r||q.getMessageFromCode(e),n)}function Z(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}W.ethErrors={rpc:{parse:e=>$(J.errorCodes.rpc.parse,e),invalidRequest:e=>$(J.errorCodes.rpc.invalidRequest,e),invalidParams:e=>$(J.errorCodes.rpc.invalidParams,e),methodNotFound:e=>$(J.errorCodes.rpc.methodNotFound,e),internal:e=>$(J.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return $(t,e)},invalidInput:e=>$(J.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>$(J.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>$(J.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>$(J.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>$(J.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>$(J.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>G(J.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>G(J.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>G(J.errorCodes.provider.unsupportedMethod,e),disconnected:e=>G(J.errorCodes.provider.disconnected,e),chainDisconnected:e=>G(J.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new z.EthereumProviderError(t,r,n)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=x;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=V;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=W;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=H;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(E);var Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.EVENTS=void 0,Q.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Y={},K={exports:{}},X={exports:{}};
1
+ import{c as e,g as t,e as r,b as n,_ as i,i as o,d as s}from"./index-0c189400.js";import a from"events";import{b as c}from"./bn-f63668bd.js";import{i as u}from"./inherits_browser-51bb8c3c.js";import l from"buffer";import{r as h}from"./__node-resolve_empty-adff7651.js";import{s as d}from"./index-6be6f872.js";import{r as f}from"./__tslib-b3416fbd.js";import"@ethersproject/providers";import"zustand";import"@ethersproject/address";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/properties";import"@ethersproject/transactions";import"@ethersproject/bytes";import"util";var p={},b={},y={};Object.defineProperty(y,"__esModule",{value:!0}),y.walletLogo=void 0;y.walletLogo=(e,t)=>{let r;switch(e){case"standard":default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}};var g={};Object.defineProperty(g,"__esModule",{value:!0}),g.ScopedLocalStorage=void 0;g.ScopedLocalStorage=class{constructor(e){this.scope=e}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let r=0;r<localStorage.length;r++){const n=localStorage.key(r);"string"==typeof n&&n.startsWith(e)&&t.push(n)}t.forEach((e=>localStorage.removeItem(e)))}scopedKey(e){return`${this.scope}:${e}`}};var m={},v={};Object.defineProperty(v,"__esModule",{value:!0});const _=a;function w(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class S extends _.EventEmitter{emit(e,...t){let r="error"===e;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const i=n[e];if(void 0===i)return!1;if("function"==typeof i)w(i,this,t);else{const e=i.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(i);for(let n=0;n<e;n+=1)w(r[n],this,t)}return!0}}v.default=S;var E={},x={},k=N;N.default=N,N.stable=P,N.stableStringify=P;var C="[...]",M="[Circular]",I=[],R=[];function A(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function N(e,t,r,n){var i;void 0===n&&(n=A()),O(e,"",0,[],void 0,0,n);try{i=0===R.length?JSON.stringify(e,t,r):JSON.stringify(e,D(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==I.length;){var o=I.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function j(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);void 0!==i.get?i.configurable?(Object.defineProperty(n,r,{value:e}),I.push([n,r,t,i])):R.push([t,r,e]):(n[r]=e,I.push([n,r,t]))}function O(e,t,r,n,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<n.length;a++)if(n[a]===e)return void j(M,e,t,i);if(void 0!==s.depthLimit&&o>s.depthLimit)return void j(C,e,t,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void j(C,e,t,i);if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)O(e[a],a,a,n,e,o,s);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var u=c[a];O(e[u],u,a,n,e,o,s)}}n.pop()}}function T(e,t){return e<t?-1:e>t?1:0}function P(e,t,r,n){void 0===n&&(n=A());var i,o=L(e,"",0,[],void 0,0,n)||e;try{i=0===R.length?JSON.stringify(o,t,r):JSON.stringify(o,D(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==I.length;){var s=I.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function L(e,t,r,n,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<n.length;a++)if(n[a]===e)return void j(M,e,t,i);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==s.depthLimit&&o>s.depthLimit)return void j(C,e,t,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void j(C,e,t,i);if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)L(e[a],a,a,n,e,o,s);else{var c={},u=Object.keys(e).sort(T);for(a=0;a<u.length;a++){var l=u[a];L(e[l],l,a,n,e,o,s),c[l]=e[l]}if(void 0===i)return c;I.push([i,t,e]),i[t]=c}n.pop()}}function D(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(R.length>0)for(var n=0;n<R.length;n++){var i=R[n];if(i[1]===t&&i[0]===r){r=i[2],R.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(x,"__esModule",{value:!0}),x.EthereumProviderError=x.EthereumRpcError=void 0;const B=k;class F extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return B.default(this.serialize(),U,2)}}x.EthereumRpcError=F;function U(e,t){if("[Circular]"!==t)return t}x.EthereumProviderError=class extends F{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}};var V={},H={};Object.defineProperty(H,"__esModule",{value:!0}),H.errorValues=H.errorCodes=void 0,H.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},H.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=H,r=x,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};function s(r,n=i){if(Number.isInteger(r)){const n=r.toString();if(l(t.errorValues,n))return t.errorValues[n].message;if(c(r))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function a(e){if(!Number.isInteger(e))return!1;const r=e.toString();return!!t.errorValues[r]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function u(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=s,e.isValidCode=a,e.serializeError=function(e,{fallbackError:t=o,shouldIncludeStack:n=!1}={}){var i,c;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof r.EthereumRpcError)return e.serialize();const h={};if(e&&"object"==typeof e&&!Array.isArray(e)&&l(e,"code")&&a(e.code)){const t=e;h.code=t.code,t.message&&"string"==typeof t.message?(h.message=t.message,l(t,"data")&&(h.data=t.data)):(h.message=s(h.code),h.data={originalError:u(e)})}else{h.code=t.code;const r=null===(i=e)||void 0===i?void 0:i.message;h.message=r&&"string"==typeof r?r:t.message,h.data={originalError:u(e)}}const d=null===(c=e)||void 0===c?void 0:c.stack;return n&&e&&d&&"string"==typeof d&&(h.stack=d),h}}(V);var W={};Object.defineProperty(W,"__esModule",{value:!0}),W.ethErrors=void 0;const z=x,q=V,J=H;function $(e,t){const[r,n]=Z(t);return new z.EthereumRpcError(e,r||q.getMessageFromCode(e),n)}function G(e,t){const[r,n]=Z(t);return new z.EthereumProviderError(e,r||q.getMessageFromCode(e),n)}function Z(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}W.ethErrors={rpc:{parse:e=>$(J.errorCodes.rpc.parse,e),invalidRequest:e=>$(J.errorCodes.rpc.invalidRequest,e),invalidParams:e=>$(J.errorCodes.rpc.invalidParams,e),methodNotFound:e=>$(J.errorCodes.rpc.methodNotFound,e),internal:e=>$(J.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return $(t,e)},invalidInput:e=>$(J.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>$(J.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>$(J.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>$(J.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>$(J.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>$(J.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>G(J.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>G(J.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>G(J.errorCodes.provider.unsupportedMethod,e),disconnected:e=>G(J.errorCodes.provider.disconnected,e),chainDisconnected:e=>G(J.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new z.EthereumProviderError(t,r,n)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=x;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=V;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=W;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=H;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(E);var Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.EVENTS=void 0,Q.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Y={},K={exports:{}},X={exports:{}};
2
2
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
3
  !function(e,t){var r=l,n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(X,X.exports);var ee=X.exports.Buffer;function te(e,t){this._block=ee.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}te.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=ee.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,s=0;s<i;){for(var a=o%n,c=Math.min(i-s,n-a),u=0;u<c;u++)r[a+u]=e[s+u];s+=c,(o+=c)%n==0&&this._update(r)}return this._len+=i,this},te.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},te.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var re=te,ne=u.exports,ie=re,oe=X.exports.Buffer,se=[1518500249,1859775393,-1894007588,-899497514],ae=new Array(80);function ce(){this.init(),this._w=ae,ie.call(this,64,56)}function ue(e){return e<<30|e>>>2}function le(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}ne(ce,ie),ce.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},ce.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var u=0;u<80;++u){var l=~~(u/20),h=0|((t=n)<<5|t>>>27)+le(l,i,o,s)+a+r[u]+se[l];a=s,s=o,o=ue(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},ce.prototype._hash=function(){var e=oe.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var he=ce,de=u.exports,fe=re,pe=X.exports.Buffer,be=[1518500249,1859775393,-1894007588,-899497514],ye=new Array(80);function ge(){this.init(),this._w=ye,fe.call(this,64,56)}function me(e){return e<<5|e>>>27}function ve(e){return e<<30|e>>>2}function _e(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}de(ge,fe),ge.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},ge.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var u=0;u<80;++u){var l=~~(u/20),h=me(n)+_e(l,i,o,s)+a+r[u]+be[l]|0;a=s,s=o,o=ve(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},ge.prototype._hash=function(){var e=pe.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var we=ge,Se=u.exports,Ee=re,xe=X.exports.Buffer,ke=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ce=new Array(64);function Me(){this.init(),this._w=Ce,Ee.call(this,64,56)}function Ie(e,t,r){return r^e&(t^r)}function Re(e,t,r){return e&t|r&(e|t)}function Ae(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Ne(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function je(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Oe(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Se(Me,Ee),Me.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Me.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0|this._f,c=0|this._g,u=0|this._h,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<64;++l)t[l]=Oe(t[l-2])+t[l-7]+je(t[l-15])+t[l-16]|0;for(var h=0;h<64;++h){var d=u+Ne(s)+Ie(s,a,c)+ke[h]+t[h]|0,f=Ae(r)+Re(r,n,i)|0;u=c,c=a,a=s,s=o+d|0,o=i,i=n,n=r,r=d+f|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0},Me.prototype._hash=function(){var e=xe.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Te=Me,Pe=u.exports,Le=Te,De=re,Be=X.exports.Buffer,Fe=new Array(64);function Ue(){this.init(),this._w=Fe,De.call(this,64,56)}Pe(Ue,Le),Ue.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Ue.prototype._hash=function(){var e=Be.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Ve=Ue,He=u.exports,We=re,ze=X.exports.Buffer,qe=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Je=new Array(160);function $e(){this.init(),this._w=Je,We.call(this,128,112)}function Ge(e,t,r){return r^e&(t^r)}function Ze(e,t,r){return e&t|r&(e|t)}function Qe(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Ye(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Ke(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Xe(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function et(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function tt(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function rt(e,t){return e>>>0<t>>>0?1:0}He($e,We),$e.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},$e.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,c=0|this._gh,u=0|this._hh,l=0|this._al,h=0|this._bl,d=0|this._cl,f=0|this._dl,p=0|this._el,b=0|this._fl,y=0|this._gl,g=0|this._hl,m=0;m<32;m+=2)t[m]=e.readInt32BE(4*m),t[m+1]=e.readInt32BE(4*m+4);for(;m<160;m+=2){var v=t[m-30],_=t[m-30+1],w=Ke(v,_),S=Xe(_,v),E=et(v=t[m-4],_=t[m-4+1]),x=tt(_,v),k=t[m-14],C=t[m-14+1],M=t[m-32],I=t[m-32+1],R=S+C|0,A=w+k+rt(R,S)|0;A=(A=A+E+rt(R=R+x|0,x)|0)+M+rt(R=R+I|0,I)|0,t[m]=A,t[m+1]=R}for(var N=0;N<160;N+=2){A=t[N],R=t[N+1];var j=Ze(r,n,i),O=Ze(l,h,d),T=Qe(r,l),P=Qe(l,r),L=Ye(s,p),D=Ye(p,s),B=qe[N],F=qe[N+1],U=Ge(s,a,c),V=Ge(p,b,y),H=g+D|0,W=u+L+rt(H,g)|0;W=(W=(W=W+U+rt(H=H+V|0,V)|0)+B+rt(H=H+F|0,F)|0)+A+rt(H=H+R|0,R)|0;var z=P+O|0,q=T+j+rt(z,P)|0;u=c,g=y,c=a,y=b,a=s,b=p,s=o+W+rt(p=f+H|0,f)|0,o=i,f=d,i=n,d=h,n=r,h=l,r=W+q+rt(l=H+z|0,H)|0}this._al=this._al+l|0,this._bl=this._bl+h|0,this._cl=this._cl+d|0,this._dl=this._dl+f|0,this._el=this._el+p|0,this._fl=this._fl+b|0,this._gl=this._gl+y|0,this._hl=this._hl+g|0,this._ah=this._ah+r+rt(this._al,l)|0,this._bh=this._bh+n+rt(this._bl,h)|0,this._ch=this._ch+i+rt(this._cl,d)|0,this._dh=this._dh+o+rt(this._dl,f)|0,this._eh=this._eh+s+rt(this._el,p)|0,this._fh=this._fh+a+rt(this._fl,b)|0,this._gh=this._gh+c+rt(this._gl,y)|0,this._hh=this._hh+u+rt(this._hl,g)|0},$e.prototype._hash=function(){var e=ze.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var nt=$e,it=u.exports,ot=nt,st=re,at=X.exports.Buffer,ct=new Array(160);function ut(){this.init(),this._w=ct,st.call(this,128,112)}it(ut,ot),ut.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},ut.prototype._hash=function(){var e=at.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var lt=ut,ht=K.exports=function(e){e=e.toLowerCase();var t=ht[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};ht.sha=he,ht.sha1=we,ht.sha224=Ve,ht.sha256=Te,ht.sha384=lt,ht.sha512=nt;var dt,ft={},pt="undefined"!=typeof Symbol&&Symbol,bt=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0},yt=Array.prototype.slice,gt=Object.prototype.toString,mt=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==gt.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var r,n=yt.call(arguments,1),i=Math.max(0,t.length-n.length),o=[],s=0;s<i;s++)o.push("$"+s);if(r=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var i=t.apply(this,n.concat(yt.call(arguments)));return Object(i)===i?i:this}return t.apply(e,n.concat(yt.call(arguments)))})),t.prototype){var a=function(){};a.prototype=t.prototype,r.prototype=new a,a.prototype=null}return r},vt=Function.prototype.bind||mt,_t=Array.prototype.slice,wt=Object.prototype.toString,St=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==wt.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var r,n=_t.call(arguments,1),i=Math.max(0,t.length-n.length),o=[],s=0;s<i;s++)o.push("$"+s);if(r=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var i=t.apply(this,n.concat(_t.call(arguments)));return Object(i)===i?i:this}return t.apply(e,n.concat(_t.call(arguments)))})),t.prototype){var a=function(){};a.prototype=t.prototype,r.prototype=new a,a.prototype=null}return r},Et=(Function.prototype.bind||St).call(Function.call,Object.prototype.hasOwnProperty),xt=SyntaxError,kt=Function,Ct=TypeError,Mt=function(e){try{return kt('"use strict"; return ('+e+").constructor;")()}catch(e){}},It=Object.getOwnPropertyDescriptor;if(It)try{It({},"")}catch(up){It=null}var Rt=function(){throw new Ct},At=It?function(){try{return Rt}catch(e){try{return It(arguments,"callee").get}catch(e){return Rt}}}():Rt,Nt="function"==typeof pt&&"function"==typeof Symbol&&"symbol"==typeof pt("foo")&&"symbol"==typeof Symbol("bar")&&bt(),jt=Object.getPrototypeOf||function(e){return e.__proto__},Ot={},Tt="undefined"==typeof Uint8Array?dt:jt(Uint8Array),Pt={"%AggregateError%":"undefined"==typeof AggregateError?dt:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?dt:ArrayBuffer,"%ArrayIteratorPrototype%":Nt?jt([][Symbol.iterator]()):dt,"%AsyncFromSyncIteratorPrototype%":dt,"%AsyncFunction%":Ot,"%AsyncGenerator%":Ot,"%AsyncGeneratorFunction%":Ot,"%AsyncIteratorPrototype%":Ot,"%Atomics%":"undefined"==typeof Atomics?dt:Atomics,"%BigInt%":"undefined"==typeof BigInt?dt:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?dt:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?dt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?dt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?dt:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?dt:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?dt:FinalizationRegistry,"%Function%":kt,"%GeneratorFunction%":Ot,"%Int8Array%":"undefined"==typeof Int8Array?dt:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?dt:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?dt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Nt?jt(jt([][Symbol.iterator]())):dt,"%JSON%":"object"==typeof JSON?JSON:dt,"%Map%":"undefined"==typeof Map?dt:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&Nt?jt((new Map)[Symbol.iterator]()):dt,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?dt:Promise,"%Proxy%":"undefined"==typeof Proxy?dt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?dt:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?dt:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&Nt?jt((new Set)[Symbol.iterator]()):dt,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?dt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Nt?jt(""[Symbol.iterator]()):dt,"%Symbol%":Nt?Symbol:dt,"%SyntaxError%":xt,"%ThrowTypeError%":At,"%TypedArray%":Tt,"%TypeError%":Ct,"%Uint8Array%":"undefined"==typeof Uint8Array?dt:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?dt:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?dt:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?dt:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?dt:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?dt:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?dt:WeakSet};try{null.error}catch(up){var Lt=jt(jt(up));Pt["%Error.prototype%"]=Lt}var Dt=function e(t){var r;if("%AsyncFunction%"===t)r=Mt("async function () {}");else if("%GeneratorFunction%"===t)r=Mt("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=Mt("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=jt(i.prototype))}return Pt[t]=r,r},Bt={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ft=vt,Ut=Et,Vt=Ft.call(Function.call,Array.prototype.concat),Ht=Ft.call(Function.apply,Array.prototype.splice),Wt=Ft.call(Function.call,String.prototype.replace),zt=Ft.call(Function.call,String.prototype.slice),qt=Ft.call(Function.call,RegExp.prototype.exec),Jt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$t=/\\(\\)?/g,Gt=function(e,t){var r,n=e;if(Ut(Bt,n)&&(n="%"+(r=Bt[n])[0]+"%"),Ut(Pt,n)){var i=Pt[n];if(i===Ot&&(i=Dt(n)),void 0===i&&!t)throw new Ct("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new xt("intrinsic "+e+" does not exist!")},Zt=function(e,t){if("string"!=typeof e||0===e.length)throw new Ct("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new Ct('"allowMissing" argument must be a boolean');if(null===qt(/^%?[^%]*%?$/,e))throw new xt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=zt(e,0,1),r=zt(e,-1);if("%"===t&&"%"!==r)throw new xt("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new xt("invalid intrinsic syntax, expected opening `%`");var n=[];return Wt(e,Jt,(function(e,t,r,i){n[n.length]=r?Wt(i,$t,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=Gt("%"+n+"%",t),o=i.name,s=i.value,a=!1,c=i.alias;c&&(n=c[0],Ht(r,Vt([0,1],c)));for(var u=1,l=!0;u<r.length;u+=1){var h=r[u],d=zt(h,0,1),f=zt(h,-1);if(('"'===d||"'"===d||"`"===d||'"'===f||"'"===f||"`"===f)&&d!==f)throw new xt("property names with quotes must have matching quotes");if("constructor"!==h&&l||(a=!0),Ut(Pt,o="%"+(n+="."+h)+"%"))s=Pt[o];else if(null!=s){if(!(h in s)){if(!t)throw new Ct("base intrinsic for "+e+" exists, but the property is not available.");return}if(It&&u+1>=r.length){var p=It(s,h);s=(l=!!p)&&"get"in p&&!("originalValue"in p.get)?p.get:s[h]}else l=Ut(s,h),s=s[h];l&&!a&&(Pt[o]=s)}}return s},Qt={exports:{}},Yt=Array.prototype.slice,Kt=Object.prototype.toString,Xt=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==Kt.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var r,n=Yt.call(arguments,1),i=Math.max(0,t.length-n.length),o=[],s=0;s<i;s++)o.push("$"+s);if(r=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var i=t.apply(this,n.concat(Yt.call(arguments)));return Object(i)===i?i:this}return t.apply(e,n.concat(Yt.call(arguments)))})),t.prototype){var a=function(){};a.prototype=t.prototype,r.prototype=new a,a.prototype=null}return r},er=Function.prototype.bind||Xt;!function(e){var t=er,r=Zt,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),o=r("%Reflect.apply%",!0)||t.call(i,n),s=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),c=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch(e){a=null}e.exports=function(e){var r=o(t,i,arguments);s&&a&&(s(r,"length").configurable&&a(r,"length",{value:1+c(0,e.length-(arguments.length-1))}));return r};var u=function(){return o(t,n,arguments)};a?a(e.exports,"apply",{value:u}):e.exports.apply=u}(Qt);var tr=Zt,rr=Qt.exports,nr=rr(tr("String.prototype.indexOf")),ir="function"==typeof Map&&Map.prototype,or=Object.getOwnPropertyDescriptor&&ir?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,sr=ir&&or&&"function"==typeof or.get?or.get:null,ar=ir&&Map.prototype.forEach,cr="function"==typeof Set&&Set.prototype,ur=Object.getOwnPropertyDescriptor&&cr?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,lr=cr&&ur&&"function"==typeof ur.get?ur.get:null,hr=cr&&Set.prototype.forEach,dr="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,fr="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,pr="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,br=Boolean.prototype.valueOf,yr=Object.prototype.toString,gr=Function.prototype.toString,mr=String.prototype.match,vr=String.prototype.slice,_r=String.prototype.replace,wr=String.prototype.toUpperCase,Sr=String.prototype.toLowerCase,Er=RegExp.prototype.test,xr=Array.prototype.concat,kr=Array.prototype.join,Cr=Array.prototype.slice,Mr=Math.floor,Ir="function"==typeof BigInt?BigInt.prototype.valueOf:null,Rr=Object.getOwnPropertySymbols,Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Nr="function"==typeof Symbol&&"object"==typeof Symbol.iterator,jr="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Nr||"symbol")?Symbol.toStringTag:null,Or=Object.prototype.propertyIsEnumerable,Tr=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Pr(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||Er.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-Mr(-e):Mr(e);if(n!==e){var i=String(n),o=vr.call(t,i.length+1);return _r.call(i,r,"$&_")+"."+_r.call(_r.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _r.call(t,r,"$&_")}var Lr=h,Dr=Lr.custom,Br=Wr(Dr)?Dr:null;function Fr(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function Ur(e){return _r.call(String(e),/"/g,"&quot;")}function Vr(e){return!("[object Array]"!==Jr(e)||jr&&"object"==typeof e&&jr in e)}function Hr(e){return!("[object RegExp]"!==Jr(e)||jr&&"object"==typeof e&&jr in e)}function Wr(e){if(Nr)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!Ar)return!1;try{return Ar.call(e),!0}catch(e){}return!1}var zr=Object.prototype.hasOwnProperty||function(e){return e in this};function qr(e,t){return zr.call(e,t)}function Jr(e){return yr.call(e)}function $r(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function Gr(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Gr(vr.call(e,0,t.maxStringLength),t)+n}return Fr(_r.call(_r.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Zr),"single",t)}function Zr(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+wr.call(t.toString(16))}function Qr(e){return"Object("+e+")"}function Yr(e){return e+" { ? }"}function Kr(e,t,r,n){return e+" ("+t+") {"+(n?Xr(r,n):kr.call(r,", "))+"}"}function Xr(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+kr.call(e,","+r)+"\n"+t.prev}function en(e,t){var r=Vr(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=qr(e,i)?t(e[i],e):""}var o,s="function"==typeof Rr?Rr(e):[];if(Nr){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var c in e)qr(e,c)&&(r&&String(Number(c))===c&&c<e.length||Nr&&o["$"+c]instanceof Symbol||(Er.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if("function"==typeof Rr)for(var u=0;u<s.length;u++)Or.call(e,s[u])&&n.push("["+t(s[u])+"]: "+t(e[s[u]],e));return n}var tn=Zt,rn=function(e,t){var r=tr(e,!!t);return"function"==typeof r&&nr(e,".prototype.")>-1?rr(r):r},nn=function e(t,r,n,i){var o=r||{};if(qr(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(qr(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!qr(o,"customInspect")||o.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(qr(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(qr(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return Gr(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?Pr(t,c):c}if("bigint"==typeof t){var u=String(t)+"n";return a?Pr(t,u):u}var l=void 0===o.depth?5:o.depth;if(void 0===n&&(n=0),n>=l&&l>0&&"object"==typeof t)return Vr(t)?"[Array]":"[Object]";var h=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=kr.call(Array(e.indent+1)," ")}return{base:r,prev:kr.call(Array(t+1),r)}}(o,n);if(void 0===i)i=[];else if($r(i,t)>=0)return"[Circular]";function d(t,r,s){if(r&&(i=Cr.call(i)).push(r),s){var a={depth:o.depth};return qr(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),e(t,a,n+1,i)}return e(t,o,n+1,i)}if("function"==typeof t&&!Hr(t)){var f=function(e){if(e.name)return e.name;var t=mr.call(gr.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),p=en(t,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+kr.call(p,", ")+" }":"")}if(Wr(t)){var b=Nr?_r.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ar.call(t);return"object"!=typeof t||Nr?b:Qr(b)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var y="<"+Sr.call(String(t.nodeName)),g=t.attributes||[],m=0;m<g.length;m++)y+=" "+g[m].name+"="+Fr(Ur(g[m].value),"double",o);return y+=">",t.childNodes&&t.childNodes.length&&(y+="..."),y+="</"+Sr.call(String(t.nodeName))+">"}if(Vr(t)){if(0===t.length)return"[]";var v=en(t,d);return h&&!function(e){for(var t=0;t<e.length;t++)if($r(e[t],"\n")>=0)return!1;return!0}(v)?"["+Xr(v,h)+"]":"[ "+kr.call(v,", ")+" ]"}if(function(e){return!("[object Error]"!==Jr(e)||jr&&"object"==typeof e&&jr in e)}(t)){var _=en(t,d);return"cause"in Error.prototype||!("cause"in t)||Or.call(t,"cause")?0===_.length?"["+String(t)+"]":"{ ["+String(t)+"] "+kr.call(_,", ")+" }":"{ ["+String(t)+"] "+kr.call(xr.call("[cause]: "+d(t.cause),_),", ")+" }"}if("object"==typeof t&&s){if(Br&&"function"==typeof t[Br]&&Lr)return Lr(t,{depth:l-n});if("symbol"!==s&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!sr||!e||"object"!=typeof e)return!1;try{sr.call(e);try{lr.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var w=[];return ar&&ar.call(t,(function(e,r){w.push(d(r,t,!0)+" => "+d(e,t))})),Kr("Map",sr.call(t),w,h)}if(function(e){if(!lr||!e||"object"!=typeof e)return!1;try{lr.call(e);try{sr.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var S=[];return hr&&hr.call(t,(function(e){S.push(d(e,t))})),Kr("Set",lr.call(t),S,h)}if(function(e){if(!dr||!e||"object"!=typeof e)return!1;try{dr.call(e,dr);try{fr.call(e,fr)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Yr("WeakMap");if(function(e){if(!fr||!e||"object"!=typeof e)return!1;try{fr.call(e,fr);try{dr.call(e,dr)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Yr("WeakSet");if(function(e){if(!pr||!e||"object"!=typeof e)return!1;try{return pr.call(e),!0}catch(e){}return!1}(t))return Yr("WeakRef");if(function(e){return!("[object Number]"!==Jr(e)||jr&&"object"==typeof e&&jr in e)}(t))return Qr(d(Number(t)));if(function(e){if(!e||"object"!=typeof e||!Ir)return!1;try{return Ir.call(e),!0}catch(e){}return!1}(t))return Qr(d(Ir.call(t)));if(function(e){return!("[object Boolean]"!==Jr(e)||jr&&"object"==typeof e&&jr in e)}(t))return Qr(br.call(t));if(function(e){return!("[object String]"!==Jr(e)||jr&&"object"==typeof e&&jr in e)}(t))return Qr(d(String(t)));if(!function(e){return!("[object Date]"!==Jr(e)||jr&&"object"==typeof e&&jr in e)}(t)&&!Hr(t)){var E=en(t,d),x=Tr?Tr(t)===Object.prototype:t instanceof Object||t.constructor===Object,k=t instanceof Object?"":"null prototype",C=!x&&jr&&Object(t)===t&&jr in t?vr.call(Jr(t),8,-1):k?"Object":"",M=(x||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(C||k?"["+kr.call(xr.call([],C||[],k||[]),": ")+"] ":"");return 0===E.length?M+"{}":h?M+"{"+Xr(E,h)+"}":M+"{ "+kr.call(E,", ")+" }"}return String(t)},on=tn("%TypeError%"),sn=tn("%WeakMap%",!0),an=tn("%Map%",!0),cn=rn("WeakMap.prototype.get",!0),un=rn("WeakMap.prototype.set",!0),ln=rn("WeakMap.prototype.has",!0),hn=rn("Map.prototype.get",!0),dn=rn("Map.prototype.set",!0),fn=rn("Map.prototype.has",!0),pn=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},bn=String.prototype.replace,yn=/%20/g,gn="RFC3986",mn={default:gn,formatters:{RFC1738:function(e){return bn.call(e,yn,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:gn},vn=mn,_n=Object.prototype.hasOwnProperty,wn=Array.isArray,Sn=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),En=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},xn={arrayToObject:En,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],o=i.obj[i.prop],s=Object.keys(o),a=0;a<s.length;++a){var c=s[a],u=o[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:o,prop:c}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(wn(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,n,i){if(0===e.length)return e;var o=e;if("symbol"==typeof e?o=Symbol.prototype.toString.call(e):"string"!=typeof e&&(o=String(e)),"iso-8859-1"===r)return escape(o).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var s="",a=0;a<o.length;++a){var c=o.charCodeAt(a);45===c||46===c||95===c||126===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===vn.RFC1738&&(40===c||41===c)?s+=o.charAt(a):c<128?s+=Sn[c]:c<2048?s+=Sn[192|c>>6]+Sn[128|63&c]:c<55296||c>=57344?s+=Sn[224|c>>12]+Sn[128|c>>6&63]+Sn[128|63&c]:(a+=1,c=65536+((1023&c)<<10|1023&o.charCodeAt(a)),s+=Sn[240|c>>18]+Sn[128|c>>12&63]+Sn[128|c>>6&63]+Sn[128|63&c])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(wn(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(wn(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!_n.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var i=t;return wn(t)&&!wn(r)&&(i=En(t,n)),wn(t)&&wn(r)?(r.forEach((function(r,i){if(_n.call(t,i)){var o=t[i];o&&"object"==typeof o&&r&&"object"==typeof r?t[i]=e(o,r,n):t.push(r)}else t[i]=r})),t):Object.keys(r).reduce((function(t,i){var o=r[i];return _n.call(t,i)?t[i]=e(t[i],o,n):t[i]=o,t}),i)}},kn=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new on("Side channel does not contain "+nn(e))},get:function(n){if(sn&&n&&("object"==typeof n||"function"==typeof n)){if(e)return cn(e,n)}else if(an){if(t)return hn(t,n)}else if(r)return function(e,t){var r=pn(e,t);return r&&r.value}(r,n)},has:function(n){if(sn&&n&&("object"==typeof n||"function"==typeof n)){if(e)return ln(e,n)}else if(an){if(t)return fn(t,n)}else if(r)return function(e,t){return!!pn(e,t)}(r,n);return!1},set:function(n,i){sn&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new sn),un(e,n,i)):an?(t||(t=new an),dn(t,n,i)):(r||(r={key:{},next:null}),function(e,t,r){var n=pn(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,i))}};return n},Cn=xn,Mn=mn,In=Object.prototype.hasOwnProperty,Rn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},An=Array.isArray,Nn=Array.prototype.push,jn=function(e,t){Nn.apply(e,An(t)?t:[t])},On=Date.prototype.toISOString,Tn=Mn.default,Pn={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Cn.encode,encodeValuesOnly:!1,format:Tn,formatter:Mn.formatters[Tn],indices:!1,serializeDate:function(e){return On.call(e)},skipNulls:!1,strictNullHandling:!1},Ln={},Dn=function e(t,r,n,i,o,s,a,c,u,l,h,d,f,p,b,y){for(var g=t,m=y,v=0,_=!1;void 0!==(m=m.get(Ln))&&!_;){var w=m.get(t);if(v+=1,void 0!==w){if(w===v)throw new RangeError("Cyclic object value");_=!0}void 0===m.get(Ln)&&(v=0)}if("function"==typeof c?g=c(r,g):g instanceof Date?g=h(g):"comma"===n&&An(g)&&(g=Cn.maybeMap(g,(function(e){return e instanceof Date?h(e):e}))),null===g){if(o)return a&&!p?a(r,Pn.encoder,b,"key",d):r;g=""}if(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e}(g)||Cn.isBuffer(g))return a?[f(p?r:a(r,Pn.encoder,b,"key",d))+"="+f(a(g,Pn.encoder,b,"value",d))]:[f(r)+"="+f(String(g))];var S,E=[];if(void 0===g)return E;if("comma"===n&&An(g))p&&a&&(g=Cn.maybeMap(g,a)),S=[{value:g.length>0?g.join(",")||null:void 0}];else if(An(c))S=c;else{var x=Object.keys(g);S=u?x.sort(u):x}for(var k=i&&An(g)&&1===g.length?r+"[]":r,C=0;C<S.length;++C){var M=S[C],I="object"==typeof M&&void 0!==M.value?M.value:g[M];if(!s||null!==I){var R=An(g)?"function"==typeof n?n(k,M):k:k+(l?"."+M:"["+M+"]");y.set(t,v);var A=kn();A.set(Ln,y),jn(E,e(I,R,n,i,o,s,"comma"===n&&p&&An(g)?null:a,c,u,l,h,d,f,p,b,A))}}return E},Bn=xn,Fn=Object.prototype.hasOwnProperty,Un=Array.isArray,Vn={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Bn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Hn=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},Wn=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},zn=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),a=s?i.slice(0,s.index):i,c=[];if(a){if(!r.plainObjects&&Fn.call(Object.prototype,a)&&!r.allowPrototypes)return;c.push(a)}for(var u=0;r.depth>0&&null!==(s=o.exec(i))&&u<r.depth;){if(u+=1,!r.plainObjects&&Fn.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(s[1])}return s&&c.push("["+i.slice(s.index)+"]"),function(e,t,r,n){for(var i=n?t:Wn(t,r),o=e.length-1;o>=0;--o){var s,a=e[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[])[u]=i:"__proto__"!==c&&(s[c]=i):s={0:i}}i=s}return i}(c,t,r,n)}},qn=function(e,t){var r,n=e,i=function(e){if(!e)return Pn;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||Pn.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Mn.default;if(void 0!==e.format){if(!In.call(Mn.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=Mn.formatters[r],i=Pn.filter;return("function"==typeof e.filter||An(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:Pn.addQueryPrefix,allowDots:void 0===e.allowDots?Pn.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Pn.charsetSentinel,delimiter:void 0===e.delimiter?Pn.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:Pn.encode,encoder:"function"==typeof e.encoder?e.encoder:Pn.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:Pn.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:Pn.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:Pn.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Pn.strictNullHandling}}(t);"function"==typeof i.filter?n=(0,i.filter)("",n):An(i.filter)&&(r=i.filter);var o,s=[];if("object"!=typeof n||null===n)return"";o=t&&t.arrayFormat in Rn?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var a=Rn[o];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c="comma"===a&&t&&t.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var u=kn(),l=0;l<r.length;++l){var h=r[l];i.skipNulls&&null===n[h]||jn(s,Dn(n[h],h,a,c,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,u))}var d=s.join(i.delimiter),f=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),d.length>0?f+d:""},Jn=function(e,t){var r=function(e){if(!e)return Vn;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?Vn.charset:e.charset;return{allowDots:void 0===e.allowDots?Vn.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:Vn.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:Vn.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:Vn.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Vn.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:Vn.comma,decoder:"function"==typeof e.decoder?e.decoder:Vn.decoder,delimiter:"string"==typeof e.delimiter||Bn.isRegExp(e.delimiter)?e.delimiter:Vn.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:Vn.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:Vn.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:Vn.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:Vn.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Vn.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof e?function(e,t){var r,n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=i.split(t.delimiter,o),a=-1,c=t.charset;if(t.charsetSentinel)for(r=0;r<s.length;++r)0===s[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[r]?c="utf-8":"utf8=%26%2310003%3B"===s[r]&&(c="iso-8859-1"),a=r,r=s.length);for(r=0;r<s.length;++r)if(r!==a){var u,l,h=s[r],d=h.indexOf("]="),f=-1===d?h.indexOf("="):d+1;-1===f?(u=t.decoder(h,Vn.decoder,c,"key"),l=t.strictNullHandling?null:""):(u=t.decoder(h.slice(0,f),Vn.decoder,c,"key"),l=Bn.maybeMap(Wn(h.slice(f+1),t),(function(e){return t.decoder(e,Vn.decoder,c,"value")}))),l&&t.interpretNumericEntities&&"iso-8859-1"===c&&(l=Hn(l)),h.indexOf("[]=")>-1&&(l=Un(l)?[l]:l),Fn.call(n,u)?n[u]=Bn.combine(n[u],l):n[u]=l}return n}(e,r):e,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var a=o[s],c=zn(a,n[a],r,"string"==typeof e);i=Bn.merge(i,c,r)}return!0===r.allowSparse?i:Bn.compact(i)},$n={formats:mn,parse:Jn,stringify:qn},Gn={};!function(e){function t(){return e=>e}var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderType=e.RegExpString=e.IntNumber=e.BigIntString=e.AddressString=e.HexString=e.OpaqueType=void 0,e.OpaqueType=t,e.HexString=e=>e,e.AddressString=e=>e,e.BigIntString=e=>e,e.IntNumber=function(e){return Math.floor(e)},e.RegExpString=e=>e,(r=e.ProviderType||(e.ProviderType={})).CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(Gn);var Zn=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ft,"__esModule",{value:!0}),ft.isInIFrame=ft.createQrUrl=ft.getFavicon=ft.range=ft.isBigNumber=ft.ensureParsedJSONObject=ft.ensureBN=ft.ensureRegExpString=ft.ensureIntNumber=ft.ensureBuffer=ft.ensureAddressString=ft.ensureEvenLengthHexString=ft.ensureHexString=ft.isHexString=ft.prepend0x=ft.strip0x=ft.has0xPrefix=ft.hexStringFromIntNumber=ft.intNumberFromHexString=ft.bigIntStringFromBN=ft.hexStringFromBuffer=ft.hexStringToUint8Array=ft.uint8ArrayToHex=ft.randomBytesHex=void 0;const Qn=Zn(c.exports),Yn=$n,Kn=Gn,Xn=/^[0-9]*$/,ei=/^[a-f0-9]*$/;function ti(e){return[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function ri(e){return e.startsWith("0x")||e.startsWith("0X")}function ni(e){return ri(e)?e.slice(2):e}function ii(e){return ri(e)?"0x"+e.slice(2):"0x"+e}function oi(e){if("string"!=typeof e)return!1;const t=ni(e).toLowerCase();return ei.test(t)}function si(e,t=!1){if("string"==typeof e){const r=ni(e).toLowerCase();if(ei.test(r))return(0,Kn.HexString)(t?"0x"+r:r)}throw new Error(`"${String(e)}" is not a hexadecimal string`)}function ai(e,t=!1){let r=si(e,!1);return r.length%2==1&&(r=(0,Kn.HexString)("0"+r)),t?(0,Kn.HexString)("0x"+r):r}function ci(e){if("number"==typeof e&&Number.isInteger(e))return(0,Kn.IntNumber)(e);if("string"==typeof e){if(Xn.test(e))return(0,Kn.IntNumber)(Number(e));if(oi(e))return(0,Kn.IntNumber)(new Qn.default(ai(e,!1),16).toNumber())}throw new Error(`Not an integer: ${String(e)}`)}function ui(e){if(null==e||"function"!=typeof e.constructor)return!1;const{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}ft.randomBytesHex=function(e){return ti(crypto.getRandomValues(new Uint8Array(e)))},ft.uint8ArrayToHex=ti,ft.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))},ft.hexStringFromBuffer=function(e,t=!1){const r=e.toString("hex");return(0,Kn.HexString)(t?"0x"+r:r)},ft.bigIntStringFromBN=function(e){return(0,Kn.BigIntString)(e.toString(10))},ft.intNumberFromHexString=function(e){return(0,Kn.IntNumber)(new Qn.default(ai(e,!1),16).toNumber())},ft.hexStringFromIntNumber=function(e){return(0,Kn.HexString)("0x"+new Qn.default(e).toString(16))},ft.has0xPrefix=ri,ft.strip0x=ni,ft.prepend0x=ii,ft.isHexString=oi,ft.ensureHexString=si,ft.ensureEvenLengthHexString=ai,ft.ensureAddressString=function(e){if("string"==typeof e){const t=ni(e).toLowerCase();if(oi(t)&&40===t.length)return(0,Kn.AddressString)(ii(t))}throw new Error(`Invalid Ethereum address: ${String(e)}`)},ft.ensureBuffer=function(e){if(Buffer.isBuffer(e))return e;if("string"==typeof e){if(oi(e)){const t=ai(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw new Error(`Not binary data: ${String(e)}`)},ft.ensureIntNumber=ci,ft.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,Kn.RegExpString)(e.toString());throw new Error(`Not a RegExp: ${String(e)}`)},ft.ensureBN=function(e){if(null!==e&&(Qn.default.isBN(e)||ui(e)))return new Qn.default(e.toString(10),10);if("number"==typeof e)return new Qn.default(ci(e));if("string"==typeof e){if(Xn.test(e))return new Qn.default(e,10);if(oi(e))return new Qn.default(ai(e,!1),16)}throw new Error(`Not an integer: ${String(e)}`)},ft.ensureParsedJSONObject=function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw new Error(`Not a JSON string or an object: ${String(e)}`)},ft.isBigNumber=ui,ft.range=function(e,t){return Array.from({length:t-e},((t,r)=>e+r))},ft.getFavicon=function(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`},ft.createQrUrl=function(e,t,r,n,i,o){return`${r}/#/link?${(0,Yn.stringify)({[n?"parent-id":"id"]:e,secret:t,server:r,v:i,chainId:o})}`},ft.isInIFrame=function(){try{return null!==window.frameElement}catch(e){return!1}},Object.defineProperty(Y,"__esModule",{value:!0}),Y.Session=void 0;const li=K.exports,hi=ft,di="session:id",fi="session:secret",pi="session:linked";class bi{constructor(e,t,r,n){this._storage=e,this._id=t||(0,hi.randomBytesHex)(16),this._secret=r||(0,hi.randomBytesHex)(32),this._key=(new li.sha256).update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!n}static load(e){const t=e.getItem(di),r=e.getItem(pi),n=e.getItem(fi);return t&&n?new bi(e,t,n,"1"===r):null}static hash(e){return(new li.sha256).update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(di,this._id),this._storage.setItem(fi,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(pi,this._linked?"1":"0")}}Y.Session=bi;var yi={};Object.defineProperty(yi,"__esModule",{value:!0}),yi.WalletSDKRelayAbstract=yi.APP_VERSION_KEY=yi.LOCAL_STORAGE_ADDRESSES_KEY=yi.WALLET_USER_NAME_KEY=void 0;const gi=E;yi.WALLET_USER_NAME_KEY="walletUsername",yi.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",yi.APP_VERSION_KEY="AppVersion";yi.WalletSDKRelayAbstract=class{async makeEthereumJSONRPCRequest(e,t){if(!t)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(t,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{if(!e)throw gi.ethErrors.rpc.parse({});const t=e,{error:r}=t;if(r)throw(0,gi.serializeError)(r);return t}))}};var mi,vi,_i={exports:{}},wi=a.EventEmitter;function Si(){if(vi)return mi;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}vi=1;var o=l.Buffer,s=h.inspect,a=s&&s.custom||"inspect";function c(e,t,r){o.prototype.copy.call(e,t,r)}return mi=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var r,i,u;return r=e,i=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t=o.allocUnsafe(e>>>0),r=this.head,n=0;r;)c(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,t}},{key:a,value:function(e,r){return s(this,t(t({},r),{},{depth:0,customInspect:!1}))}}],i&&n(r.prototype,i),u&&n(r,u),Object.defineProperty(r,"prototype",{writable:!1}),e}(),mi}function Ei(e,t){ki(e,t),xi(e)}function xi(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function ki(e,t){e.emit("error",t)}var Ci={destroy:function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(ki,this,e)):process.nextTick(ki,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?process.nextTick(xi,r):(r._writableState.errorEmitted=!0,process.nextTick(Ei,r,e)):process.nextTick(Ei,r,e):t?(process.nextTick(xi,r),t(e)):process.nextTick(xi,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}},Mi={};var Ii={};function Ri(e,t,r){r||(r=Error);var n=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);n.prototype.name=r.name,n.prototype.code=e,Ii[e]=n}function Ai(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}Ri("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),Ri("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,o,s;if("string"==typeof t&&(i="not ",t.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(Ai(t,"type"));else{var a=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(Ai(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),Ri("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Ri("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),Ri("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Ri("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),Ri("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Ri("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Ri("ERR_STREAM_WRITE_AFTER_END","write after end"),Ri("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Ri("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),Ri("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Mi.codes=Ii;var Ni=Mi.codes.ERR_INVALID_OPT_VALUE;var ji,Oi,Ti,Pi,Li,Di,Bi={getHighWaterMark:function(e,t,r,n){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,n,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new Ni(n?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}};function Fi(){if(Oi)return ji;function t(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}return Oi=1,ji=function(e,r){if(t("noDeprecation"))return e;var n=!1;return function(){if(!n){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return e.apply(this,arguments)}},ji}function Ui(){if(Pi)return Ti;function t(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var r;Pi=1,Ti=x,x.WritableState=E;var n={deprecate:Fi()},i=wi,o=l.Buffer,s=(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,c=Ci,h=Bi.getHighWaterMark,d=Mi.codes,f=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,b=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,g=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,w=c.errorOrDestroy;function S(){}function E(e,n,i){r=r||Vi(),e=e||{},"boolean"!=typeof i&&(i=n instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(A,e,t),e._writableState.errorEmitted=!0,w(e,n)):(i(n),e._writableState.errorEmitted=!0,w(e,n),A(e,t))}(e,r,n,t,i);else{var o=I(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||M(e,r),n?process.nextTick(C,e,r,o,i):C(e,r,o,i)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function x(e){var t=this instanceof(r=r||Vi());if(!t&&!a.call(x,this))return new x(e);this._writableState=new E(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),i.call(this)}function k(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function C(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function M(e,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(e._writev&&n&&n.next){var i=r.bufferedRequestCount,o=new Array(i),s=r.corkedRequestsFree;s.entry=n;for(var a=0,c=!0;n;)o[a]=n,n.isBuf||(c=!1),n=n.next,a+=1;o.allBuffers=c,k(e,r,!0,r.length,o,"",s.finish),r.pendingcb++,r.lastBufferedRequest=null,s.next?(r.corkedRequestsFree=s.next,s.next=null):r.corkedRequestsFree=new t(r),r.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,l=n.encoding,h=n.callback;if(k(e,r,!1,r.objectMode?1:u.length,u,l,h),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function R(e,t){e._final((function(r){t.pendingcb--,r&&w(e,r),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var r=I(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(R,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}return u.exports(x,i),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:n.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===x&&(e&&e._writableState instanceof E)}})):a=function(e){return e instanceof this},x.prototype.pipe=function(){w(this,new y)},x.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,c=!i.objectMode&&(n=e,o.isBuffer(n)||n instanceof s);return c&&!o.isBuffer(e)&&(e=function(e){return o.from(e)}(e)),"function"==typeof t&&(r=t,t=null),c?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=S),i.ending?function(e,t){var r=new v;w(e,r),process.nextTick(t,r)}(this,r):(c||function(e,t,r,n){var i;return null===r?i=new m:"string"==typeof r||t.objectMode||(i=new f("chunk",["string","Buffer"],r)),!i||(w(e,i),process.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,s){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=o.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var c=t.objectMode?1:n.length;t.length+=c;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else k(e,t,!1,c,n,i,s);return u}(this,i,c,e,t,r)),a},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||M(this,e))},x.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,r){r(new p("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,A(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=c.destroy,x.prototype._undestroy=c.undestroy,x.prototype._destroy=function(e,t){t(e)},Ti}function Vi(){if(Di)return Li;Di=1;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Li=s;var t=to(),r=Ui();u.exports(s,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var o=n[i];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(e){if(!(this instanceof s))return new s(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||process.nextTick(c,this)}function c(e){e.end()}return Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),Li}var Hi,Wi={};function zi(){if(Hi)return Wi;Hi=1;var e=X.exports.Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof n&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=o,this.end=s,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=a,this.end=c,n=3;break;default:return this.write=u,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(n)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function o(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function a(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function l(e){return e&&e.length?this.write(e):""}return Wi.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var i=t.length-1;if(i<r)return 0;var o=n(t[i]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--i<r||-2===o)return 0;if(o=n(t[i]),o>=0)return o>0&&(e.lastNeed=o-2),o;if(--i<r||-2===o)return 0;if(o=n(t[i]),o>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length},Wi}var qi=Mi.codes.ERR_STREAM_PREMATURE_CLOSE;function Ji(){}var $i,Gi,Zi,Qi,Yi,Ki,Xi=function e(t,r,n){if("function"==typeof r)return e(t,null,r);r||(r={}),n=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(n||Ji);var i=r.readable||!1!==r.readable&&t.readable,o=r.writable||!1!==r.writable&&t.writable,s=function(){t.writable||c()},a=t._writableState&&t._writableState.finished,c=function(){o=!1,a=!0,i||n.call(t)},u=t._readableState&&t._readableState.endEmitted,l=function(){i=!1,u=!0,o||n.call(t)},h=function(e){n.call(t,e)},d=function(){var e;return i&&!u?(t._readableState&&t._readableState.ended||(e=new qi),n.call(t,e)):o&&!a?(t._writableState&&t._writableState.ended||(e=new qi),n.call(t,e)):void 0},f=function(){t.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?o&&!t._writableState&&(t.on("end",s),t.on("close",s)):(t.on("complete",c),t.on("abort",d),t.req?f():t.on("request",f)),t.on("end",l),t.on("finish",c),!1!==r.error&&t.on("error",h),t.on("close",d),function(){t.removeListener("complete",c),t.removeListener("abort",d),t.removeListener("request",f),t.req&&t.req.removeListener("finish",c),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",c),t.removeListener("end",l),t.removeListener("error",h),t.removeListener("close",d)}};function eo(){if(Gi)return $i;var e;function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Gi=1;var r=Xi,n=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),a=Symbol("lastPromise"),c=Symbol("handlePromise"),u=Symbol("stream");function l(e,t){return{value:e,done:t}}function h(e){var t=e[n];if(null!==t){var r=e[u].read();null!==r&&(e[a]=null,e[n]=null,e[i]=null,t(l(r,!1)))}}function d(e){process.nextTick(h,e)}var f=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((t(e={get stream(){return this[u]},next:function(){var e=this,t=this[o];if(null!==t)return Promise.reject(t);if(this[s])return Promise.resolve(l(void 0,!0));if(this[u].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[o]?r(e[o]):t(l(void 0,!0))}))}));var r,n=this[a];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[s]?r(l(void 0,!0)):t[c](r,n)}),n)}}(n,this));else{var i=this[u].read();if(null!==i)return Promise.resolve(l(i,!1));r=new Promise(this[c])}return this[a]=r,r}},Symbol.asyncIterator,(function(){return this})),t(e,"return",(function(){var e=this;return new Promise((function(t,r){e[u].destroy(null,(function(e){e?r(e):t(l(void 0,!0))}))}))})),e),f);return $i=function(e){var h,f=Object.create(p,(t(h={},u,{value:e,writable:!0}),t(h,n,{value:null,writable:!0}),t(h,i,{value:null,writable:!0}),t(h,o,{value:null,writable:!0}),t(h,s,{value:e._readableState.endEmitted,writable:!0}),t(h,c,{value:function(e,t){var r=f[u].read();r?(f[a]=null,f[n]=null,f[i]=null,e(l(r,!1))):(f[n]=e,f[i]=t)},writable:!0}),h));return f[a]=null,r(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=f[i];return null!==t&&(f[a]=null,f[n]=null,f[i]=null,t(e)),void(f[o]=e)}var r=f[n];null!==r&&(f[a]=null,f[n]=null,f[i]=null,r(l(void 0,!0))),f[s]=!0})),e.on("readable",d.bind(null,f)),f},$i}function to(){if(Ki)return Yi;var t;Ki=1,Yi=C,C.ReadableState=k,a.EventEmitter;var r=function(e,t){return e.listeners(t).length},n=wi,i=l.Buffer,o=(void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var s,c=h;s=c&&c.debuglog?c.debuglog("stream"):function(){};var d,f,p,b=Si(),y=Ci,g=Bi.getHighWaterMark,m=Mi.codes,v=m.ERR_INVALID_ARG_TYPE,_=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,S=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;u.exports(C,n);var E=y.errorOrDestroy,x=["error","close","destroy","pause","resume"];function k(e,r,n){t=t||Vi(),e=e||{},"boolean"!=typeof n&&(n=r instanceof t),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",n),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=zi().StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function C(e){if(t=t||Vi(),!(this instanceof C))return new C(e);var r=this instanceof t;this._readableState=new k(e,this,r),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function M(e,t,r,n,a){s("readableAddChunk",t);var c,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(s("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?N(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}(e,u);else if(a||(c=function(e,t){var r;n=t,i.isBuffer(n)||n instanceof o||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(u,t)),c)E(e,c);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===i.prototype||(t=function(e){return i.from(e)}(t)),n)u.endEmitted?E(e,new S):I(e,u,t,!0);else if(u.ended)E(e,new _);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?I(e,u,t,!1):O(e,u)):I(e,u,t,!1)}else n||(u.reading=!1,O(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function I(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&N(e)),O(e,t)}Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),C.prototype.destroy=y.destroy,C.prototype._undestroy=y.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=i.from(e,t),t=""),r=!0),M(this,e,t,!1,r)},C.prototype.unshift=function(e){return M(this,e,null,!0,!1)},C.prototype.isPaused=function(){return!1===this._readableState.flowing},C.prototype.setEncoding=function(e){d||(d=zi().StringDecoder);var t=new d(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var R=1073741824;function A(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=R?e=R:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function N(e){var t=e._readableState;s("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(s("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(j,e))}function j(e){var t=e._readableState;s("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function O(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(T,e,t))}function T(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(s("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function P(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){s("readable nexttick read 0"),e.read(0)}function D(e,t){s("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(s("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;s("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(V,t,e))}function V(e,t){if(s("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function H(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}return C.prototype.read=function(e){s("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return s("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):N(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return s("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&s("length less than watermark",i=!0),t.ended||t.reading?s("reading or ended",i=!1):i&&(s("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=A(r,t))),null===(n=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},C.prototype._read=function(e){E(this,new w("_read()"))},C.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,s("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?c:b;function a(t,r){s("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,s("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",a),n.removeListener("end",c),n.removeListener("end",b),n.removeListener("data",h),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function c(){s("onend"),e.end()}i.endEmitted?process.nextTick(o):n.once("end",o),e.on("unpipe",a);var u=function(e){return function(){var t=e._readableState;s("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&r(e,"data")&&(t.flowing=!0,B(e))}}(n);e.on("drain",u);var l=!1;function h(t){s("ondata");var r=e.write(t);s("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==H(i.pipes,e))&&!l&&(s("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function d(t){s("onerror",t),b(),e.removeListener("error",d),0===r(e,"error")&&E(e,t)}function f(){e.removeListener("finish",p),b()}function p(){s("onfinish"),e.removeListener("close",f),b()}function b(){s("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",n),i.flowing||(s("pipe resume"),n.resume()),e},C.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=H(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},C.prototype.on=function(e,t){var r=n.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,s("on readable",i.length,i.reading),i.length?N(this):i.reading||process.nextTick(L,this))),r},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(e,t){var r=n.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(P,this),r},C.prototype.removeAllListeners=function(e){var t=n.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(P,this),t},C.prototype.resume=function(){var e=this._readableState;return e.flowing||(s("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(D,e,t))}(this,e)),e.paused=!1,this},C.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(s("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(s("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<x.length;o++)e.on(x[o],this.emit.bind(this,x[o]));return this._read=function(t){s("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(C.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=eo()),f(this)}),Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(C.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(C.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),C._fromList=F,Object.defineProperty(C.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(C.from=function(e,t){return void 0===p&&(p=Qi?Zi:(Qi=1,Zi=function(){throw new Error("Readable.from is not available in the browser")})),p(C,e,t)}),Yi}var ro=lo,no=Mi.codes,io=no.ERR_METHOD_NOT_IMPLEMENTED,oo=no.ERR_MULTIPLE_CALLBACK,so=no.ERR_TRANSFORM_ALREADY_TRANSFORMING,ao=no.ERR_TRANSFORM_WITH_LENGTH_0,co=Vi();function uo(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new oo);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function lo(e){if(!(this instanceof lo))return new lo(e);co.call(this,e),this._transformState={afterTransform:uo.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",ho)}function ho(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?fo(this,null,null):this._flush((function(t,r){fo(e,t,r)}))}function fo(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new ao;if(e._transformState.transforming)throw new so;return e.push(null)}u.exports(lo,co),lo.prototype.push=function(e,t){return this._transformState.needTransform=!1,co.prototype.push.call(this,e,t)},lo.prototype._transform=function(e,t,r){r(new io("_transform()"))},lo.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},lo.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},lo.prototype._destroy=function(e,t){co.prototype._destroy.call(this,e,(function(e){t(e)}))};var po,bo=go,yo=ro;function go(e){if(!(this instanceof go))return new go(e);yo.call(this,e)}u.exports(go,yo),go.prototype._transform=function(e,t,r){r(null,e)};var mo=Mi.codes,vo=mo.ERR_MISSING_ARGS,_o=mo.ERR_STREAM_DESTROYED;function wo(e){if(e)throw e}function So(e){e()}function Eo(e,t){return e.pipe(t)}var xo=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=function(e){return e.length?"function"!=typeof e[e.length-1]?wo:e.pop():wo}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new vo("streams");var o=t.map((function(e,r){var s=r<t.length-1;return function(e,t,r,n){n=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(n);var i=!1;e.on("close",(function(){i=!0})),void 0===po&&(po=Xi),po(e,{readable:t,writable:r},(function(e){if(e)return n(e);i=!0,n()}));var o=!1;return function(t){if(!i&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void n(t||new _o("pipe"))}}(e,s,r>0,(function(e){n||(n=e),e&&o.forEach(So),s||(o.forEach(So),i(n))}))}));return t.reduce(Eo)};!function(e,t){(t=_i.exports=to()).Stream=t,t.Readable=t,t.Writable=Ui(),t.Duplex=Vi(),t.Transform=ro,t.PassThrough=bo,t.finished=Xi,t.pipeline=xo}(0,_i.exports);const{Transform:ko}=_i.exports;const{Transform:Co}=_i.exports;const Mo=e=>class t extends ko{constructor(t,r,n,i,o){super(o),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}},Io=e=>class t extends Co{constructor(t,r,n,i){super(i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}};var Ro={};const Ao=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Ro.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],s=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],l=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49];let d=l^(i<<1|o>>>31),f=h^(o<<1|i>>>31);const p=e[0]^d,b=e[1]^f,y=e[10]^d,g=e[11]^f,m=e[20]^d,v=e[21]^f,_=e[30]^d,w=e[31]^f,S=e[40]^d,E=e[41]^f;d=r^(s<<1|a>>>31),f=n^(a<<1|s>>>31);const x=e[2]^d,k=e[3]^f,C=e[12]^d,M=e[13]^f,I=e[22]^d,R=e[23]^f,A=e[32]^d,N=e[33]^f,j=e[42]^d,O=e[43]^f;d=i^(c<<1|u>>>31),f=o^(u<<1|c>>>31);const T=e[4]^d,P=e[5]^f,L=e[14]^d,D=e[15]^f,B=e[24]^d,F=e[25]^f,U=e[34]^d,V=e[35]^f,H=e[44]^d,W=e[45]^f;d=s^(l<<1|h>>>31),f=a^(h<<1|l>>>31);const z=e[6]^d,q=e[7]^f,J=e[16]^d,$=e[17]^f,G=e[26]^d,Z=e[27]^f,Q=e[36]^d,Y=e[37]^f,K=e[46]^d,X=e[47]^f;d=c^(r<<1|n>>>31),f=u^(n<<1|r>>>31);const ee=e[8]^d,te=e[9]^f,re=e[18]^d,ne=e[19]^f,ie=e[28]^d,oe=e[29]^f,se=e[38]^d,ae=e[39]^f,ce=e[48]^d,ue=e[49]^f,le=p,he=b,de=g<<4|y>>>28,fe=y<<4|g>>>28,pe=m<<3|v>>>29,be=v<<3|m>>>29,ye=w<<9|_>>>23,ge=_<<9|w>>>23,me=S<<18|E>>>14,ve=E<<18|S>>>14,_e=x<<1|k>>>31,we=k<<1|x>>>31,Se=M<<12|C>>>20,Ee=C<<12|M>>>20,xe=I<<10|R>>>22,ke=R<<10|I>>>22,Ce=N<<13|A>>>19,Me=A<<13|N>>>19,Ie=j<<2|O>>>30,Re=O<<2|j>>>30,Ae=P<<30|T>>>2,Ne=T<<30|P>>>2,je=L<<6|D>>>26,Oe=D<<6|L>>>26,Te=F<<11|B>>>21,Pe=B<<11|F>>>21,Le=U<<15|V>>>17,De=V<<15|U>>>17,Be=W<<29|H>>>3,Fe=H<<29|W>>>3,Ue=z<<28|q>>>4,Ve=q<<28|z>>>4,He=$<<23|J>>>9,We=J<<23|$>>>9,ze=G<<25|Z>>>7,qe=Z<<25|G>>>7,Je=Q<<21|Y>>>11,$e=Y<<21|Q>>>11,Ge=X<<24|K>>>8,Ze=K<<24|X>>>8,Qe=ee<<27|te>>>5,Ye=te<<27|ee>>>5,Ke=re<<20|ne>>>12,Xe=ne<<20|re>>>12,et=oe<<7|ie>>>25,tt=ie<<7|oe>>>25,rt=se<<8|ae>>>24,nt=ae<<8|se>>>24,it=ce<<14|ue>>>18,ot=ue<<14|ce>>>18;e[0]=le^~Se&Te,e[1]=he^~Ee&Pe,e[10]=Ue^~Ke&pe,e[11]=Ve^~Xe&be,e[20]=_e^~je&ze,e[21]=we^~Oe&qe,e[30]=Qe^~de&xe,e[31]=Ye^~fe&ke,e[40]=Ae^~He&et,e[41]=Ne^~We&tt,e[2]=Se^~Te&Je,e[3]=Ee^~Pe&$e,e[12]=Ke^~pe&Ce,e[13]=Xe^~be&Me,e[22]=je^~ze&rt,e[23]=Oe^~qe&nt,e[32]=de^~xe&Le,e[33]=fe^~ke&De,e[42]=He^~et&ye,e[43]=We^~tt&ge,e[4]=Te^~Je&it,e[5]=Pe^~$e&ot,e[14]=pe^~Ce&Be,e[15]=be^~Me&Fe,e[24]=ze^~rt&me,e[25]=qe^~nt&ve,e[34]=xe^~Le&Ge,e[35]=ke^~De&Ze,e[44]=et^~ye&Ie,e[45]=tt^~ge&Re,e[6]=Je^~it&le,e[7]=$e^~ot&he,e[16]=Ce^~Be&Ue,e[17]=Me^~Fe&Ve,e[26]=rt^~me&_e,e[27]=nt^~ve&we,e[36]=Le^~Ge&Qe,e[37]=De^~Ze&Ye,e[46]=ye^~Ie&Ae,e[47]=ge^~Re&Ne,e[8]=it^~le&Se,e[9]=ot^~he&Ee,e[18]=Be^~Ue&Ke,e[19]=Fe^~Ve&Xe,e[28]=me^~_e&je,e[29]=ve^~we&Oe,e[38]=Ge^~Qe&de,e[39]=Ze^~Ye&fe,e[48]=Ie^~Ae&He,e[49]=Re^~Ne&We,e[0]^=Ao[2*t],e[1]^=Ao[2*t+1]}};const No=Ro;function jo(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}jo.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},jo.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(No.p1600(this.state),this.count=0)},jo.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,0!=(128&e)&&this.count===this.blockSize-1&&No.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,No.p1600(this.state),this.count=0,this.squeezing=!0},jo.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(No.p1600(this.state),this.count=0);return t},jo.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Oo=function(e){const t=Mo(e),r=Io(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}(jo);const To=Oo,Po=c.exports;function Lo(e){return Buffer.allocUnsafe(e).fill(0)}function Do(e,t,r){const n=Lo(t);return e=Bo(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function Bo(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if("string"==typeof e)e=Fo(e)?Buffer.from((t=Uo(e)).length%2?"0"+t:t,"hex"):Buffer.from(e);else if("number"==typeof e)e=intToBuffer(e);else if(null==e)e=Buffer.allocUnsafe(0);else if(Po.isBN(e))e=e.toArrayLike(Buffer);else{if(!e.toArray)throw new Error("invalid type");e=Buffer.from(e.toArray())}var t;return e}function Fo(e){return"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)}function Uo(e){return"string"==typeof e&&e.startsWith("0x")?e.slice(2):e}var Vo={zeros:Lo,setLength:Do,setLengthRight:function(e,t){return Do(e,t,!0)},isHexString:Fo,stripHexPrefix:Uo,toBuffer:Bo,bufferToHex:function(e){return"0x"+(e=Bo(e)).toString("hex")},keccak:function(e,t){return e=Bo(e),t||(t=256),To("keccak"+t).update(e).digest()}};const Ho=Vo,Wo=c.exports;function zo(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function qo(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Jo(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function $o(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function Go(e){var t=typeof e;if("string"===t)return Ho.isHexString(e)?new Wo(Ho.stripHexPrefix(e),16):new Wo(e,10);if("number"===t)return new Wo(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Zo(e,t){var r,n,i,o;if("address"===e)return Zo("uint160",Go(t));if("bool"===e)return Zo("uint8",t?1:0);if("string"===e)return Zo("bytes",new Buffer(t,"utf8"));if(function(e){return e.lastIndexOf("]")===e.length-1}(e)){if(void 0===t.length)throw new Error("Not an array?");if("dynamic"!==(r=$o(e))&&0!==r&&t.length>r)throw new Error("Elements exceed array size: "+r);for(o in i=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)i.push(Zo(e,t[o]));if("dynamic"===r){var s=Zo("uint256",t.length);i.unshift(s)}return Buffer.concat(i)}if("bytes"===e)return t=new Buffer(t),i=Buffer.concat([Zo("uint256",t.length),t]),t.length%32!=0&&(i=Buffer.concat([i,Ho.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if((r=qo(e))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return Ho.setLengthRight(t,32)}if(e.startsWith("uint")){if((r=qo(e))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((n=Go(t)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}if(e.startsWith("int")){if((r=qo(e))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((n=Go(t)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}if(e.startsWith("ufixed")){if(r=Jo(e),(n=Go(t))<0)throw new Error("Supplied ufixed is negative");return Zo("uint256",n.mul(new Wo(2).pow(new Wo(r[1]))))}if(e.startsWith("fixed"))return r=Jo(e),Zo("int256",Go(t).mul(new Wo(2).pow(new Wo(r[1]))));throw new Error("Unsupported or invalid type: "+e)}function Qo(e){return"string"===e||"bytes"===e||"dynamic"===$o(e)}function Yo(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],o=0;o<e.length;o++){var s=zo(e[o]),a=t[o];if("bytes"===s)i.push(a);else if("string"===s)i.push(new Buffer(a,"utf8"));else if("bool"===s)i.push(new Buffer(a?"01":"00","hex"));else if("address"===s)i.push(Ho.setLength(a,20));else if(s.startsWith("bytes")){if((r=qo(s))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(Ho.setLengthRight(a,r))}else if(s.startsWith("uint")){if((r=qo(s))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((n=Go(a)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else{if(!s.startsWith("int"))throw new Error("Unsupported or invalid type: "+s);if((r=qo(s))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((n=Go(a)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}}return Buffer.concat(i)}var Ko={rawEncode:function(e,t){var r=[],n=[],i=32*e.length;for(var o in e){var s=zo(e[o]),a=Zo(s,t[o]);Qo(s)?(r.push(Zo("uint256",i)),n.push(a),i+=a.length):r.push(a)}return Buffer.concat(r.concat(n))},solidityPack:Yo,soliditySHA3:function(e,t){return Ho.keccak(Yo(e,t))}};const Xo=Vo,es=Ko,ts={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},rs={encodeData(e,t,r,n=!0){const i=["bytes32"],o=[this.hashType(e,r)];if(n){const s=(e,t,i)=>{if(void 0!==r[t])return["bytes32",null==i?"0x0000000000000000000000000000000000000000000000000000000000000000":Xo.keccak(this.encodeData(t,i,r,n))];if(void 0===i)throw new Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",Xo.keccak(i)];if("string"===t)return"string"==typeof i&&(i=Buffer.from(i,"utf8")),["bytes32",Xo.keccak(i)];if(t.lastIndexOf("]")===t.length-1){const r=t.slice(0,t.lastIndexOf("[")),n=i.map((t=>s(e,r,t)));return["bytes32",Xo.keccak(es.rawEncode(n.map((([e])=>e)),n.map((([,e])=>e))))]}return[t,i]};for(const n of r[e]){const[e,r]=s(n.name,n.type,t[n.name]);i.push(e),o.push(r)}}else for(const s of r[e]){let e=t[s.name];if(void 0!==e)if("bytes"===s.type)i.push("bytes32"),e=Xo.keccak(e),o.push(e);else if("string"===s.type)i.push("bytes32"),"string"==typeof e&&(e=Buffer.from(e,"utf8")),e=Xo.keccak(e),o.push(e);else if(void 0!==r[s.type])i.push("bytes32"),e=Xo.keccak(this.encodeData(s.type,e,r,n)),o.push(e);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),o.push(e)}}return es.rawEncode(i,o)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter((t=>t!==e));n=[e].concat(n.sort());for(const e of n){if(!t[e])throw new Error("No type definition specified: "+e);r+=e+"("+t[e].map((({name:e,type:t})=>t+" "+e)).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||void 0===t[e])return r;r.push(e);for(const n of t[e])for(const e of this.findTypeDependencies(n.type,t,r))!r.includes(e)&&r.push(e);return r},hashStruct(e,t,r,n=!0){return Xo.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Xo.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in ts.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),"EIP712Domain"!==r.primaryType&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Xo.keccak(Buffer.concat(n))}};var ns={TYPED_MESSAGE_SCHEMA:ts,TypedDataUtils:rs,hashForSignTypedDataLegacy:function(e){return function(e){const t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;const r=e.map((function(e){return"bytes"===e.type?Xo.toBuffer(e.value):e.value})),n=e.map((function(e){return e.type})),i=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return es.soliditySHA3(["bytes32","bytes32"],[es.soliditySHA3(new Array(e.length).fill("string"),i),es.soliditySHA3(n,r)])}(e.data)},hashForSignTypedData_v3:function(e){return rs.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return rs.hash(e.data)}};var is={};Object.defineProperty(is,"__esModule",{value:!0}),is.filterFromParam=is.FilterPolyfill=void 0;const os=Gn,ss=ft,as={jsonrpc:"2.0",id:0};function cs(e){return{fromBlock:ls(e.fromBlock),toBlock:ls(e.toBlock),addresses:void 0===e.address?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}function us(e){const t={fromBlock:hs(e.fromBlock),toBlock:hs(e.toBlock),topics:e.topics};return null!==e.addresses&&(t.address=e.addresses),t}function ls(e){if(void 0===e||"latest"===e||"pending"===e)return"latest";if("earliest"===e)return(0,os.IntNumber)(0);if((0,ss.isHexString)(e))return(0,ss.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function hs(e){return"latest"===e?e:(0,ss.hexStringFromIntNumber)(e)}function ds(){return Object.assign(Object.assign({},as),{error:{code:-32e3,message:"filter not found"}})}function fs(){return Object.assign(Object.assign({},as),{result:[]})}is.FilterPolyfill=class{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,os.IntNumber)(1),this.provider=e}async newFilter(e){const t=cs(e),r=this.makeFilterId(),n=await this.setInitialCursorPosition(r,t.fromBlock);return console.log(`Installing new log filter(${r}):`,t,"initial cursor position:",n),this.logFilters.set(r,t),this.setFilterTimeout(r),(0,ss.hexStringFromIntNumber)(r)}async newBlockFilter(){const e=this.makeFilterId(),t=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,t),this.blockFilters.add(e),this.setFilterTimeout(e),(0,ss.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),t=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,t),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,ss.hexStringFromIntNumber)(e)}uninstallFilter(e){const t=(0,ss.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${t})`),this.deleteFilter(t),!0}getFilterChanges(e){const t=(0,ss.intNumberFromHexString)(e);return this.timeouts.has(t)&&this.setFilterTimeout(t),this.logFilters.has(t)?this.getLogFilterChanges(t):this.blockFilters.has(t)?this.getBlockFilterChanges(t):this.pendingTransactionFilters.has(t)?this.getPendingTransactionFilterChanges(t):Promise.resolve(ds())}async getFilterLogs(e){const t=(0,ss.intNumberFromHexString)(e),r=this.logFilters.get(t);return r?this.sendAsyncPromise(Object.assign(Object.assign({},as),{method:"eth_getLogs",params:[us(r)]})):ds()}makeFilterId(){return(0,os.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise(((t,r)=>{this.provider.sendAsync(e,((e,n)=>e?r(e):Array.isArray(n)||null==n?r(new Error(`unexpected response received: ${JSON.stringify(n)}`)):void t(n)))}))}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const t=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!t)return ds();const n=await this.getCurrentBlockHeight(),i="latest"===t.toBlock?n:t.toBlock;if(r>n)return fs();if(r>t.toBlock)return fs();console.log(`Fetching logs from ${r} to ${i} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},as),{method:"eth_getLogs",params:[us(Object.assign(Object.assign({},t),{fromBlock:r,toBlock:i}))]}));if(Array.isArray(o.result)){const t=o.result.map((e=>(0,ss.intNumberFromHexString)(e.blockNumber||"0x0"))),n=Math.max(...t);if(n&&n>r){const t=(0,os.IntNumber)(n+1);console.log(`Moving cursor position for filter (${e}) from ${r} to ${t}`),this.cursors.set(e,t)}}return o}async getBlockFilterChanges(e){const t=this.cursors.get(e);if(!t)return ds();const r=await this.getCurrentBlockHeight();if(t>r)return fs();console.log(`Fetching blocks from ${t} to ${r} for filter (${e})`);const n=(await Promise.all((0,ss.range)(t,r+1).map((e=>this.getBlockHashByNumber((0,os.IntNumber)(e)))))).filter((e=>!!e)),i=(0,os.IntNumber)(t+n.length);return console.log(`Moving cursor position for filter (${e}) from ${t} to ${i}`),this.cursors.set(e,i),Object.assign(Object.assign({},as),{result:n})}async getPendingTransactionFilterChanges(e){return Promise.resolve(fs())}async setInitialCursorPosition(e,t){const r=await this.getCurrentBlockHeight(),n="number"==typeof t&&t>r?t:r;return this.cursors.set(e,n),n}setFilterTimeout(e){const t=this.timeouts.get(e);t&&window.clearTimeout(t);const r=window.setTimeout((()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)}),3e5);this.timeouts.set(e,r)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},as),{method:"eth_blockNumber",params:[]}));return(0,ss.intNumberFromHexString)((0,ss.ensureHexString)(e))}async getBlockHashByNumber(e){const t=await this.sendAsyncPromise(Object.assign(Object.assign({},as),{method:"eth_getBlockByNumber",params:[(0,ss.hexStringFromIntNumber)(e),!1]}));return t.result&&"string"==typeof t.result.hash?(0,ss.ensureHexString)(t.result.hash):null}},is.filterFromParam=cs;var ps={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.JSONRPCMethod=void 0,(t=e.JSONRPCMethod||(e.JSONRPCMethod={})).eth_accounts="eth_accounts",t.eth_coinbase="eth_coinbase",t.net_version="net_version",t.eth_chainId="eth_chainId",t.eth_uninstallFilter="eth_uninstallFilter",t.eth_requestAccounts="eth_requestAccounts",t.eth_sign="eth_sign",t.eth_ecRecover="eth_ecRecover",t.personal_sign="personal_sign",t.personal_ecRecover="personal_ecRecover",t.eth_signTransaction="eth_signTransaction",t.eth_sendRawTransaction="eth_sendRawTransaction",t.eth_sendTransaction="eth_sendTransaction",t.eth_signTypedData_v1="eth_signTypedData_v1",t.eth_signTypedData_v2="eth_signTypedData_v2",t.eth_signTypedData_v3="eth_signTypedData_v3",t.eth_signTypedData_v4="eth_signTypedData_v4",t.eth_signTypedData="eth_signTypedData",t.cbWallet_arbitrary="walletlink_arbitrary",t.wallet_addEthereumChain="wallet_addEthereumChain",t.wallet_switchEthereumChain="wallet_switchEthereumChain",t.wallet_watchAsset="wallet_watchAsset",t.eth_subscribe="eth_subscribe",t.eth_unsubscribe="eth_unsubscribe",t.eth_newFilter="eth_newFilter",t.eth_newBlockFilter="eth_newBlockFilter",t.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",t.eth_getFilterChanges="eth_getFilterChanges",t.eth_getFilterLogs="eth_getFilterLogs"}(ps);var bs={},ys={},gs={},ms=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==e.start?e.start:Math.floor(Math.random()*t);return function(){return r%=t,r++}};const vs=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let e=0;e<arguments.length;e++)n[e]=arguments[e];return new r(((r,i)=>{t.errorFirst?n.push((function(e,n){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e<arguments.length;e++)t[e-1]=arguments[e];e?(t.unshift(e),i(t)):r(t)}else e?i(e):r(n)})):n.push((function(e){if(t.multiArgs){const e=new Array(arguments.length-1);for(let t=0;t<arguments.length;t++)e[t]=arguments[t];r(e)}else r(e)})),e.apply(this,n)}))};var _s={},ws=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_s,"__esModule",{value:!0}),_s.BaseBlockTracker=void 0;const Ss=ws(v),Es=(e,t)=>e+t,xs=["sync","latest"];class ks extends Ss.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||2e4,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){if(this._currentBlock)return this._currentBlock;return await new Promise((e=>this.once("latest",e)))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){xs.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return xs.map((e=>this.listenerCount(e))).reduce(Es)}_newPotentialLatest(e){const t=this._currentBlock;t&&Cs(e)<=Cs(t)||this._setCurrentBlock(e)}_setCurrentBlock(e){const t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}function Cs(e){return Number.parseInt(e,16)}_s.BaseBlockTracker=ks;var Ms={},Is={},Rs={};class As extends TypeError{constructor(e,t){let r;const{message:n,explanation:i,...o}=e,{path:s}=e,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function Ns(e){return"object"==typeof e&&null!=e}function js(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Os(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function Ts(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:s}=r,{refinement:a,message:c=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${Os(n)}\``}=e;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:c}}function*Ps(e,t,r,n){(function(e){return Ns(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const i of e){const e=Ts(i,t,r,n);e&&(yield e)}}function*Ls(e,t,r={}){const{path:n=[],branch:i=[e],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i};if(o&&(e=t.coercer(e,a),s&&"type"!==t.type&&Ns(t.schema)&&Ns(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let c="valid";for(const n of t.validator(e,a))n.explanation=r.message,c="not_valid",yield[n,void 0];for(let[u,l,h]of t.entries(e,a)){const t=Ls(l,h,{path:void 0===u?n:[...n,u],branch:void 0===u?i:[...i,l],coerce:o,mask:s,message:r.message});for(const r of t)r[0]?(c=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):o&&(l=r[1],void 0===u?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):Ns(e)&&(void 0!==l||u in e)&&(e[u]=l))}if("not_valid"!==c)for(const n of t.refiner(e,a))n.explanation=r.message,c="not_refined",yield[n,void 0];"valid"===c&&(yield[void 0,e])}class Ds{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:o=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(e,t)=>Ps(n(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>Ps(i(e,t),t,this,e):()=>[]}assert(e,t){return Bs(e,this,t)}create(e,t){return Fs(e,this,t)}is(e){return Vs(e,this)}mask(e,t){return Us(e,this,t)}validate(e,t={}){return Hs(e,this,t)}}function Bs(e,t,r){const n=Hs(e,t,{message:r});if(n[0])throw n[0]}function Fs(e,t,r){const n=Hs(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Us(e,t,r){const n=Hs(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Vs(e,t){return!Hs(e,t)[0]}function Hs(e,t,r={}){const n=Ls(e,t,r),i=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(i[0]){const e=new As(i[0],(function*(){for(const e of n)e[0]&&(yield e[0])}));return[e,void 0]}return[void 0,i[1]]}function Ws(e,t){return new Ds({type:e,schema:null,validator:t})}function zs(){return Ws("never",(()=>!1))}function qs(e){const t=e?Object.keys(e):[],r=zs();return new Ds({type:"object",schema:e||null,*entries(n){if(e&&Ns(n)){const i=new Set(Object.keys(n));for(const r of t)i.delete(r),yield[r,n[r],e[r]];for(const e of i)yield[e,n[e],r]}},validator:e=>Ns(e)||`Expected an object, but received: ${Os(e)}`,coercer:e=>Ns(e)?{...e}:e})}function Js(e){return new Ds({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function $s(){return Ws("string",(e=>"string"==typeof e||`Expected a string, but received: ${Os(e)}`))}function Gs(e){const t=Object.keys(e);return new Ds({type:"type",schema:e,*entries(r){if(Ns(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>Ns(e)||`Expected an object, but received: ${Os(e)}`,coercer:e=>Ns(e)?{...e}:e})}function Zs(){return Ws("unknown",(()=>!0))}function Qs(e,t,r){return new Ds({...e,coercer:(n,i)=>Vs(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function Ys(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Ks(e,t,r){return new Ds({...e,*refiner(n,i){yield*e.refiner(n,i);const o=Ps(r(n,i),i,e,n);for(const e of o)yield{...e,refinement:t}}})}var Xs=Object.freeze({__proto__:null,Struct:Ds,StructError:As,any:function(){return Ws("any",(()=>!0))},array:function(e){return new Ds({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${Os(e)}`})},assert:Bs,assign:function(...e){const t="type"===e[0].type,r=e.map((e=>e.schema)),n=Object.assign({},...r);return t?Gs(n):qs(n)},bigint:function(){return Ws("bigint",(e=>"bigint"==typeof e))},boolean:function(){return Ws("boolean",(e=>"boolean"==typeof e))},coerce:Qs,create:Fs,date:function(){return Ws("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Os(e)}`))},defaulted:function(e,t,r={}){return Qs(e,Zs(),(e=>{const n="function"==typeof t?t():t;if(void 0===e)return n;if(!r.strict&&js(e)&&js(n)){const t={...e};let r=!1;for(const e in n)void 0===t[e]&&(t[e]=n[e],r=!0);if(r)return t}return e}))},define:Ws,deprecated:function(e,t){return new Ds({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(r,n)=>void 0===r||(t(r,n),e.validator(r,n))})},dynamic:function(e){return new Ds({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})},empty:function(e){return Ks(e,"empty",(t=>{const r=Ys(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))},enums:function(e){const t={},r=e.map((e=>Os(e))).join();for(const r of e)t[r]=r;return new Ds({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${Os(t)}`})},func:function(){return Ws("func",(e=>"function"==typeof e||`Expected a function, but received: ${Os(e)}`))},instance:function(e){return Ws("instance",(t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Os(t)}`))},integer:function(){return Ws("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Os(e)}`))},intersection:function(e){return new Ds({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})},is:Vs,lazy:function(e){let t;return new Ds({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})},literal:function(e){const t=Os(e),r=typeof e;return new Ds({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${Os(r)}`})},map:function(e,t){return new Ds({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${Os(e)}`})},mask:Us,max:function(e,t,r={}){const{exclusive:n}=r;return Ks(e,"max",(r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``))},min:function(e,t,r={}){const{exclusive:n}=r;return Ks(e,"min",(r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))},never:zs,nonempty:function(e){return Ks(e,"nonempty",(t=>Ys(t)>0||`Expected a nonempty ${e.type} but received an empty one`))},nullable:function(e){return new Ds({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})},number:function(){return Ws("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${Os(e)}`))},object:qs,omit:function(e,t){const{schema:r}=e,n={...r};for(const e of t)delete n[e];return"type"===e.type?Gs(n):qs(n)},optional:Js,partial:function(e){const t=e instanceof Ds?{...e.schema}:{...e};for(const e in t)t[e]=Js(t[e]);return qs(t)},pattern:function(e,t){return Ks(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))},pick:function(e,t){const{schema:r}=e,n={};for(const e of t)n[e]=r[e];return qs(n)},record:function(e,t){return new Ds({type:"record",schema:null,*entries(r){if(Ns(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>Ns(e)||`Expected an object, but received: ${Os(e)}`})},refine:Ks,regexp:function(){return Ws("regexp",(e=>e instanceof RegExp))},set:function(e){return new Ds({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${Os(e)}`})},size:function(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Ks(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${i} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:o}=e;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}{const{length:o}=e;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}}))},string:$s,struct:function(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Ws(e,t)},trimmed:function(e){return Qs(e,$s(),(e=>e.trim()))},tuple:function(e){const t=zs();return new Ds({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${Os(e)}`})},type:Gs,union:function(e){const t=e.map((e=>e.type)).join(" | ");return new Ds({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const i=[];for(const t of e){const[...e]=Ls(r,t,n),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Os(r)}`,...i]}})},unknown:Zs,validate:Hs}),ea=t(Xs);Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.assertExhaustive=Rs.assertStruct=Rs.assert=Rs.AssertionError=void 0;const ta=ea;function ra(e,t){return r=e,Boolean("string"==typeof(null===(i=null===(n=null==r?void 0:r.prototype)||void 0===n?void 0:n.constructor)||void 0===i?void 0:i.name))?new e({message:t}):e({message:t});var r,n,i}class na extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}Rs.AssertionError=na,Rs.assert=function(e,t="Assertion failed.",r=na){if(!e){if(t instanceof Error)throw t;throw ra(r,t)}},Rs.assertStruct=function(e,t,r="Assertion failed",n=na){try{(0,ta.assert)(e,t)}catch(e){throw ra(n,`${r}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},Rs.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")};var ia={};Object.defineProperty(ia,"__esModule",{value:!0}),ia.base64=void 0;const oa=ea,sa=Rs;ia.base64=(e,t={})=>{var r,n;const i=null!==(r=t.paddingRequired)&&void 0!==r&&r,o=null!==(n=t.characterSet)&&void 0!==n?n:"base64";let s,a;return"base64"===o?s=String.raw`[A-Za-z0-9+\/]`:((0,sa.assert)("base64url"===o),s=String.raw`[-_A-Za-z0-9]`),a=i?new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,oa.pattern)(e,a)};var aa={},ca={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=ea,r=Rs;function n(r){return(0,t.is)(r,e.HexStruct)}function i(r){return(0,t.is)(r,e.StrictHexStruct)}e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu),e.isHexString=n,e.isStrictHexString=i,e.assertIsHexString=function(e){(0,r.assert)(n(e),"Value must be a hexadecimal string.")},e.assertIsStrictHexString=function(e){(0,r.assert)(i(e),'Value must be a hexadecimal string, starting with "0x".')},e.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},e.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}}(ca),Object.defineProperty(aa,"__esModule",{value:!0}),aa.createDataView=aa.concatBytes=aa.valueToBytes=aa.stringToBytes=aa.numberToBytes=aa.signedBigIntToBytes=aa.bigIntToBytes=aa.hexToBytes=aa.bytesToString=aa.bytesToNumber=aa.bytesToSignedBigInt=aa.bytesToBigInt=aa.bytesToHex=aa.assertIsBytes=aa.isBytes=void 0;const ua=Rs,la=ca,ha=48,da=58,fa=87;const pa=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function ba(e){return e instanceof Uint8Array}function ya(e){(0,ua.assert)(ba(e),"Value must be a Uint8Array.")}function ga(e){if(ya(e),0===e.length)return"0x";const t=pa(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,la.add0x)(r.join(""))}function ma(e){ya(e);const t=ga(e);return BigInt(t)}function va(e){var t;if("0x"===(null===(t=null==e?void 0:e.toLowerCase)||void 0===t?void 0:t.call(e)))return new Uint8Array;(0,la.assertIsHexString)(e);const r=(0,la.remove0x)(e).toLowerCase(),n=r.length%2==0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let e=0;e<i.length;e++){const t=n.charCodeAt(2*e),r=n.charCodeAt(2*e+1),o=t-(t<da?ha:fa),s=r-(r<da?ha:fa);i[e]=16*o+s}return i}function _a(e){(0,ua.assert)("bigint"==typeof e,"Value must be a bigint."),(0,ua.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return va(e.toString(16))}function wa(e){(0,ua.assert)("number"==typeof e,"Value must be a number."),(0,ua.assert)(e>=0,"Value must be a non-negative number."),(0,ua.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return va(e.toString(16))}function Sa(e){return(0,ua.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function Ea(e){if("bigint"==typeof e)return _a(e);if("number"==typeof e)return wa(e);if("string"==typeof e)return e.startsWith("0x")?va(e):Sa(e);if(ba(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}aa.isBytes=ba,aa.assertIsBytes=ya,aa.bytesToHex=ga,aa.bytesToBigInt=ma,aa.bytesToSignedBigInt=function(e){ya(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},aa.bytesToNumber=function(e){ya(e);const t=ma(e);return(0,ua.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},aa.bytesToString=function(e){return ya(e),(new TextDecoder).decode(e)},aa.hexToBytes=va,aa.bigIntToBytes=_a,aa.signedBigIntToBytes=function(e,t){(0,ua.assert)("bigint"==typeof e,"Value must be a bigint."),(0,ua.assert)("number"==typeof t,"Byte length must be a number."),(0,ua.assert)(t>0,"Byte length must be greater than 0."),(0,ua.assert)(function(e,t){(0,ua.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},aa.numberToBytes=wa,aa.stringToBytes=Sa,aa.valueToBytes=Ea,aa.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const i=Ea(e[n]);t[n]=i,r+=i.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},aa.createDataView=function(e){if("undefined"!=typeof Buffer&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)};var xa={};Object.defineProperty(xa,"__esModule",{value:!0}),xa.ChecksumStruct=void 0;const ka=ea,Ca=ia;xa.ChecksumStruct=(0,ka.size)((0,Ca.base64)((0,ka.string)(),{paddingRequired:!0}),44,44);var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.createHex=Ma.createBytes=Ma.createBigInt=Ma.createNumber=void 0;const Ia=ea,Ra=Rs,Aa=aa,Na=ca,ja=(0,Ia.union)([(0,Ia.number)(),(0,Ia.bigint)(),(0,Ia.string)(),Na.StrictHexStruct]),Oa=(0,Ia.coerce)((0,Ia.number)(),ja,Number),Ta=(0,Ia.coerce)((0,Ia.bigint)(),ja,BigInt);(0,Ia.union)([Na.StrictHexStruct,(0,Ia.instance)(Uint8Array)]);const Pa=(0,Ia.coerce)((0,Ia.instance)(Uint8Array),(0,Ia.union)([Na.StrictHexStruct]),Aa.hexToBytes),La=(0,Ia.coerce)(Na.StrictHexStruct,(0,Ia.instance)(Uint8Array),Aa.bytesToHex);Ma.createNumber=function(e){try{const t=(0,Ia.create)(e,Oa);return(0,Ra.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof Ia.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},Ma.createBigInt=function(e){try{return(0,Ia.create)(e,Ta)}catch(e){if(e instanceof Ia.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},Ma.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,Ia.create)(e,Pa)}catch(e){if(e instanceof Ia.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},Ma.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,Ia.create)(e,La)}catch(e){if(e instanceof Ia.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}};var Da,Ba,Fa={},Ua=e&&e.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},Va=e&&e.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.FrozenSet=Fa.FrozenMap=void 0;class Ha{constructor(e){Da.set(this,void 0),Ua(this,Da,new Map(e),"f"),Object.freeze(this)}get size(){return Va(this,Da,"f").size}[(Da=new WeakMap,Symbol.iterator)](){return Va(this,Da,"f")[Symbol.iterator]()}entries(){return Va(this,Da,"f").entries()}forEach(e,t){return Va(this,Da,"f").forEach(((r,n,i)=>e.call(t,r,n,this)))}get(e){return Va(this,Da,"f").get(e)}has(e){return Va(this,Da,"f").has(e)}keys(){return Va(this,Da,"f").keys()}values(){return Va(this,Da,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}Fa.FrozenMap=Ha;class Wa{constructor(e){Ba.set(this,void 0),Ua(this,Ba,new Set(e),"f"),Object.freeze(this)}get size(){return Va(this,Ba,"f").size}[(Ba=new WeakMap,Symbol.iterator)](){return Va(this,Ba,"f")[Symbol.iterator]()}entries(){return Va(this,Ba,"f").entries()}forEach(e,t){return Va(this,Ba,"f").forEach(((r,n,i)=>e.call(t,r,n,this)))}has(e){return Va(this,Ba,"f").has(e)}keys(){return Va(this,Ba,"f").keys()}values(){return Va(this,Ba,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}Fa.FrozenSet=Wa,Object.freeze(Ha),Object.freeze(Ha.prototype),Object.freeze(Wa),Object.freeze(Wa.prototype);var za={},qa={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0,e.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},e.isNullOrUndefined=function(e){return null==e},e.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};var t;function r(e){return e.charCodeAt(0)<=127}e.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),(t=e.JsonSize||(e.JsonSize={}))[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date",e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,e.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},e.isASCII=r,e.calculateStringSize=function(t){var n;return t.split("").reduce(((e,t)=>r(t)?e+1:e+2),0)+(null!==(n=t.match(e.ESCAPE_CHARACTERS_REGEXP))&&void 0!==n?n:[]).length},e.calculateNumberSize=function(e){return e.toString().length}}(qa),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateJsonAndGetSize=e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.isValidJson=e.JsonStruct=void 0;const t=ea,r=Rs,n=qa;function i(e,t=!1){const r=new Set;return function e(t,i){if(void 0===t)return[!1,0];if(null===t)return[!0,i?0:n.JsonSize.Null];const o=typeof t;try{if("function"===o)return[!1,0];if("string"===o||t instanceof String)return[!0,i?0:(0,n.calculateStringSize)(t)+2*n.JsonSize.Quote];if("boolean"===o||t instanceof Boolean)return i?[!0,0]:[!0,1==t?n.JsonSize.True:n.JsonSize.False];if("number"===o||t instanceof Number)return i?[!0,0]:[!0,(0,n.calculateNumberSize)(t)];if(t instanceof Date)return i?[!0,0]:[!0,isNaN(t.getDate())?n.JsonSize.Null:n.JsonSize.Date+2*n.JsonSize.Quote]}catch(e){return[!1,0]}if(!(0,n.isPlainObject)(t)&&!Array.isArray(t))return[!1,0];if(r.has(t))return[!1,0];r.add(t);try{return[!0,Object.entries(t).reduce(((o,[s,a],c,u)=>{let[l,h]=e(a,i);if(!l)throw new Error("JSON validation did not pass. Validation process stopped.");if(r.delete(t),i)return 0;return o+(Array.isArray(t)?0:s.length+n.JsonSize.Comma+2*n.JsonSize.Colon)+h+(c<u.length-1?n.JsonSize.Comma:0)}),i?0:2*n.JsonSize.Wrapper)]}catch(e){return[!1,0]}}(e,t)}e.JsonStruct=(0,t.define)("Json",(e=>{const[t]=i(e,!0);return!!t||"Expected a valid JSON-serializable value"})),e.isValidJson=function(r){return(0,t.is)(r,e.JsonStruct)},e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]),e.isJsonRpcNotification=function(r){return(0,t.is)(r,e.JsonRpcNotificationStruct)},e.assertIsJsonRpcNotification=function(t,n){(0,r.assertStruct)(t,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",n)},e.isJsonRpcRequest=function(r){return(0,t.is)(r,e.JsonRpcRequestStruct)},e.assertIsJsonRpcRequest=function(t,n){(0,r.assertStruct)(t,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",n)},e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]),e.isPendingJsonRpcResponse=function(r){return(0,t.is)(r,e.PendingJsonRpcResponseStruct)},e.assertIsPendingJsonRpcResponse=function(t,n){(0,r.assertStruct)(t,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",n)},e.isJsonRpcResponse=function(r){return(0,t.is)(r,e.JsonRpcResponseStruct)},e.assertIsJsonRpcResponse=function(t,n){(0,r.assertStruct)(t,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",n)},e.isJsonRpcSuccess=function(r){return(0,t.is)(r,e.JsonRpcSuccessStruct)},e.assertIsJsonRpcSuccess=function(t,n){(0,r.assertStruct)(t,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",n)},e.isJsonRpcFailure=function(r){return(0,t.is)(r,e.JsonRpcFailureStruct)},e.assertIsJsonRpcFailure=function(t,n){(0,r.assertStruct)(t,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",n)},e.isJsonRpcError=function(r){return(0,t.is)(r,e.JsonRpcErrorStruct)},e.assertIsJsonRpcError=function(t,n){(0,r.assertStruct)(t,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",n)},e.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},e);return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)},e.validateJsonAndGetSize=i}(za);var Ja,$a,Ga={},Za={exports:{}};function Qa(){if($a)return Ja;$a=1;var e=1e3,t=60*e,r=60*t,n=24*r,i=7*n,o=365.25*n;function s(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}return Ja=function(a,c){c=c||{};var u=typeof a;if("string"===u&&a.length>0)return function(s){if((s=String(s)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*n;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===u&&isFinite(a))return c.long?function(i){var o=Math.abs(i);if(o>=n)return s(i,o,n,"day");if(o>=r)return s(i,o,r,"hour");if(o>=t)return s(i,o,t,"minute");if(o>=e)return s(i,o,e,"second");return i+" ms"}(a):function(i){var o=Math.abs(i);if(o>=n)return Math.round(i/n)+"d";if(o>=r)return Math.round(i/r)+"h";if(o>=t)return Math.round(i/t)+"m";if(o>=e)return Math.round(i/e)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},Ja}var Ya=function(e){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=Qa(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Ya(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Za,Za.exports);var Ka=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.createModuleLogger=Ga.createProjectLogger=void 0;const Xa=(0,Ka(Za.exports).default)("metamask");Ga.createProjectLogger=function(e){return Xa.extend(e)},Ga.createModuleLogger=function(e,t){return e.extend(t)};var ec={};Object.defineProperty(ec,"__esModule",{value:!0}),ec.hexToBigInt=ec.hexToNumber=ec.bigIntToHex=ec.numberToHex=void 0;const tc=Rs,rc=ca;ec.numberToHex=e=>((0,tc.assert)("number"==typeof e,"Value must be a number."),(0,tc.assert)(e>=0,"Value must be a non-negative number."),(0,tc.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,rc.add0x)(e.toString(16)));ec.bigIntToHex=e=>((0,tc.assert)("bigint"==typeof e,"Value must be a bigint."),(0,tc.assert)(e>=0,"Value must be a non-negative bigint."),(0,rc.add0x)(e.toString(16)));ec.hexToNumber=e=>{(0,rc.assertIsHexString)(e);const t=parseInt(e,16);return(0,tc.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};ec.hexToBigInt=e=>((0,rc.assertIsHexString)(e),BigInt((0,rc.add0x)(e)));var nc={};Object.defineProperty(nc,"__esModule",{value:!0});var ic={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,(t=e.Duration||(e.Duration={}))[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year";const r=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};e.inMilliseconds=function(e,t){return r(e,"count"),e*t},e.timeSince=function(e){return r(e,"timestamp"),Date.now()-e}}(ic);var oc={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=d,r=ea,n=Rs;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",(e=>null!==(0,t.valid)(e)||`Expected SemVer version, got "${e}"`)),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",(e=>null!==(0,t.validRange)(e)||`Expected SemVer range, got "${e}"`)),e.isValidSemVerVersion=function(t){return(0,r.is)(t,e.VersionStruct)},e.isValidSemVerRange=function(t){return(0,r.is)(t,e.VersionRangeStruct)},e.assertIsSemVerVersion=function(t){(0,n.assertStruct)(t,e.VersionStruct)},e.assertIsSemVerRange=function(t){(0,n.assertStruct)(t,e.VersionRangeStruct)},e.gtVersion=function(e,r){return(0,t.gt)(e,r)},e.gtRange=function(e,r){return(0,t.gtr)(e,r)},e.satisfiesVersionRange=function(e,r){return(0,t.satisfies)(e,r,{includePrerelease:!0})}}(oc),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(Rs,t),n(ia,t),n(aa,t),n(xa,t),n(Ma,t),n(Fa,t),n(ca,t),n(za,t),n(Ga,t),n(qa,t),n(ec,t),n(nc,t),n(ic,t),n(oc,t)}(Is),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Is;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")}(Ms);var sc=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gs,"__esModule",{value:!0}),gs.PollingBlockTracker=void 0;const ac=sc(ms),cc=sc(((e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=e=>{const r=t=>"string"==typeof t?e===t:t.test(e);return t.include?t.include.some(r):!t.exclude.some(r)};let n;n="function"==typeof e?function(){return t.excludeMain?e.apply(this,arguments):vs(e,t).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e));for(const i in e){const o=e[i];n[i]="function"==typeof o&&r(i)?vs(o,t):o}return n})),uc=_s,lc=(0,Ms.createModuleLogger)(Ms.projectLogger,"polling-block-tracker"),hc=(0,ac.default)();class dc extends uc.BaseBlockTracker{constructor(e={}){var t;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:null!==(t=e.blockResetDuration)&&void 0!==t?t:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||2e4,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=void 0===e.keepEventLoopActive||e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const e=fc(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await e}catch(t){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${null!==(e=t.stack)&&void 0!==e?e:t}`);try{this.emit("error",r)}catch(e){console.error(r)}const n=fc(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:hc(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),lc("Making request",e);const t=await(0,cc.default)((t=>this._provider.sendAsync(e,t)))();if(lc("Got response",t),t.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${t.error.message}`);return t.result}}function fc(e,t){return new Promise((r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()}))}gs.PollingBlockTracker=dc;var pc={},bc=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pc,"__esModule",{value:!0}),pc.SubscribeBlockTracker=void 0;const yc=bc(ms),gc=_s,mc=(0,yc.default)();class vc extends gc.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(void 0===this._subscriptionId||null===this._subscriptionId)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(null!==this._subscriptionId&&void 0!==this._subscriptionId)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...t){return new Promise(((r,n)=>{this._provider.sendAsync({id:mc(),method:e,params:t,jsonrpc:"2.0"},((e,t)=>{e?n(e):r(t.result)}))}))}_handleSubData(e,t){var r;"eth_subscription"===t.method&&(null===(r=t.params)||void 0===r?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(t.params.result.number)}}pc.SubscribeBlockTracker=vc;var _c={};Object.defineProperty(_c,"__esModule",{value:!0}),function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(gs,t),n(pc,t),n(_c,t)}(ys);var wc={},Sc={},Ec={};Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.getUniqueId=void 0;const xc=4294967295;let kc=Math.floor(Math.random()*xc);Ec.getUniqueId=function(){return kc=(kc+1)%xc,kc},Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.createIdRemapMiddleware=void 0;const Cc=Ec;Sc.createIdRemapMiddleware=function(){return(e,t,r,n)=>{const i=e.id,o=Cc.getUniqueId();e.id=o,t.id=o,r((r=>{e.id=i,t.id=i,r()}))}};var Mc={};Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.createAsyncMiddleware=void 0,Mc.createAsyncMiddleware=function(e){return async(t,r,n,i)=>{let o;const s=new Promise((e=>{o=e}));let a=null,c=!1;const u=async()=>{c=!0,n((e=>{a=e,o()})),await s};try{await e(t,r,u),c?(await s,a(null)):i(null)}catch(e){a?a(e):i(e)}}};var Ic={};Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.createScaffoldMiddleware=void 0,Ic.createScaffoldMiddleware=function(e){return(t,r,n,i)=>{const o=e[t.method];return void 0===o?n():"function"==typeof o?o(t,r,n,i):(r.result=o,i())}};var Rc={},Ac={},Nc={};Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.EthereumProviderError=Nc.EthereumRpcError=void 0;const jc=k;class Oc extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return jc.default(this.serialize(),Tc,2)}}Nc.EthereumRpcError=Oc;function Tc(e,t){if("[Circular]"!==t)return t}Nc.EthereumProviderError=class extends Oc{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}};var Pc={},Lc={};Object.defineProperty(Lc,"__esModule",{value:!0}),Lc.errorValues=Lc.errorCodes=void 0,Lc.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},Lc.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Lc,r=Nc,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};function s(r,n=i){if(Number.isInteger(r)){const n=r.toString();if(l(t.errorValues,n))return t.errorValues[n].message;if(c(r))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function a(e){if(!Number.isInteger(e))return!1;const r=e.toString();return!!t.errorValues[r]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function u(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=s,e.isValidCode=a,e.serializeError=function(e,{fallbackError:t=o,shouldIncludeStack:n=!1}={}){var i,c;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof r.EthereumRpcError)return e.serialize();const h={};if(e&&"object"==typeof e&&!Array.isArray(e)&&l(e,"code")&&a(e.code)){const t=e;h.code=t.code,t.message&&"string"==typeof t.message?(h.message=t.message,l(t,"data")&&(h.data=t.data)):(h.message=s(h.code),h.data={originalError:u(e)})}else{h.code=t.code;const r=null===(i=e)||void 0===i?void 0:i.message;h.message=r&&"string"==typeof r?r:t.message,h.data={originalError:u(e)}}const d=null===(c=e)||void 0===c?void 0:c.stack;return n&&e&&d&&"string"==typeof d&&(h.stack=d),h}}(Pc);var Dc={};Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.ethErrors=void 0;const Bc=Nc,Fc=Pc,Uc=Lc;function Vc(e,t){const[r,n]=Wc(t);return new Bc.EthereumRpcError(e,r||Fc.getMessageFromCode(e),n)}function Hc(e,t){const[r,n]=Wc(t);return new Bc.EthereumProviderError(e,r||Fc.getMessageFromCode(e),n)}function Wc(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}Dc.ethErrors={rpc:{parse:e=>Vc(Uc.errorCodes.rpc.parse,e),invalidRequest:e=>Vc(Uc.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Vc(Uc.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Vc(Uc.errorCodes.rpc.methodNotFound,e),internal:e=>Vc(Uc.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Vc(t,e)},invalidInput:e=>Vc(Uc.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Vc(Uc.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Vc(Uc.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Vc(Uc.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Vc(Uc.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Vc(Uc.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Hc(Uc.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Hc(Uc.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Hc(Uc.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Hc(Uc.errorCodes.provider.disconnected,e),chainDisconnected:e=>Hc(Uc.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new Bc.EthereumProviderError(t,r,n)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Nc;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Pc;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Dc;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Lc;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(Ac);var zc=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.JsonRpcEngine=void 0;const qc=zc(v),Jc=Ac;class $c extends qc.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,n)=>{try{const[i,o,s]=await $c._runAllMiddleware(e,t,this._middleware);return o?(await $c._runReturnHandlers(s),n(i)):r((async e=>{try{await $c._runReturnHandlers(s)}catch(t){return e(t)}return e()}))}catch(e){return n(e)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise((t=>{this._handle(e,((e,r)=>{t(r)}))}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const r=new Jc.EthereumRpcError(Jc.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(r,{id:void 0,jsonrpc:"2.0",error:r})}if("string"!=typeof e.method){const r=new Jc.EthereumRpcError(Jc.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}const r=Object.assign({},e),n={id:r.id,jsonrpc:r.jsonrpc};let i=null;try{await this._processRequest(r,n)}catch(e){i=e}return i&&(delete n.result,n.error||(n.error=Jc.serializeError(i))),t(i,n)}async _processRequest(e,t){const[r,n,i]=await $c._runAllMiddleware(e,t,this._middleware);if($c._checkForCompletion(e,t,n),await $c._runReturnHandlers(i),r)throw r}static async _runAllMiddleware(e,t,r){const n=[];let i=null,o=!1;for(const s of r)if([i,o]=await $c._runMiddleware(e,t,s,n),o)break;return[i,o,n.reverse()]}static _runMiddleware(e,t,r,n){return new Promise((i=>{const o=e=>{const r=e||t.error;r&&(t.error=Jc.serializeError(r)),i([r,!0])},s=r=>{t.error?o(t.error):(r&&("function"!=typeof r&&o(new Jc.EthereumRpcError(Jc.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request:\n${Gc(e)}`,{request:e})),n.push(r)),i([null,!1]))};try{r(e,t,s,o)}catch(e){o(e)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,r)=>{t((t=>t?r(t):e()))}))}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new Jc.EthereumRpcError(Jc.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${Gc(e)}`,{request:e});if(!r)throw new Jc.EthereumRpcError(Jc.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${Gc(e)}`,{request:e})}}function Gc(e){return JSON.stringify(e,null,2)}Rc.JsonRpcEngine=$c;var Zc={};Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.mergeMiddleware=void 0;const Qc=Rc;Zc.mergeMiddleware=function(e){const t=new Qc.JsonRpcEngine;return e.forEach((e=>t.push(e))),t.asMiddleware()},function(t){var r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),n(Sc,t),n(Mc,t),n(Ic,t),n(Ec,t),n(Rc,t),n(Zc,t)}(wc);var Yc={},Kc={},Xc={};Object.defineProperty(Xc,"__esModule",{value:!0});var eu=f,tu=function(){function e(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return e.prototype.acquire=function(){var e=this,t=this.isLocked(),r=new Promise((function(t){return e._queue.push(t)}));return t||this._dispatch(),r},e.prototype.runExclusive=function(e){return eu.__awaiter(this,void 0,void 0,(function(){var t,r,n;return eu.__generator(this,(function(i){switch(i.label){case 0:return[4,this.acquire()];case 1:t=i.sent(),r=t[0],n=t[1],i.label=2;case 2:return i.trys.push([2,,4,5]),[4,e(r)];case 3:return[2,i.sent()];case 4:return n(),[7];case 5:return[2]}}))}))},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},e.prototype._dispatch=function(){var e=this,t=this._queue.shift();if(t){var r=!1;this._currentReleaser=function(){r||(r=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}();Xc.default=tu,Object.defineProperty(Kc,"__esModule",{value:!0});var ru=f,nu=Xc,iu=function(){function e(){this._semaphore=new nu.default(1)}return e.prototype.acquire=function(){return ru.__awaiter(this,void 0,void 0,(function(){var e;return ru.__generator(this,(function(t){switch(t.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=t.sent(),[2,e[1]]}}))}))},e.prototype.runExclusive=function(e){return this._semaphore.runExclusive((function(){return e()}))},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();Kc.default=iu;var ou={};Object.defineProperty(ou,"__esModule",{value:!0}),ou.withTimeout=void 0;var su=f;ou.withTimeout=function(e,t,r){var n=this;return void 0===r&&(r=new Error("timeout")),{acquire:function(){return new Promise((function(i,o){return su.__awaiter(n,void 0,void 0,(function(){var n,s;return su.__generator(this,(function(a){switch(a.label){case 0:return n=!1,setTimeout((function(){n=!0,o(r)}),t),[4,e.acquire()];case 1:return s=a.sent(),n?(Array.isArray(s)?s[1]:s)():i(s),[2]}}))}))}))},runExclusive:function(e){return su.__awaiter(this,void 0,void 0,(function(){var t,r;return su.__generator(this,(function(n){switch(n.label){case 0:t=function(){},n.label=1;case 1:return n.trys.push([1,,7,8]),[4,this.acquire()];case 2:return r=n.sent(),Array.isArray(r)?(t=r[1],[4,e(r[0])]):[3,4];case 3:return[2,n.sent()];case 4:return t=r,[4,e()];case 5:return[2,n.sent()];case 6:return[3,8];case 7:return t(),[7];case 8:return[2]}}))}))},release:function(){e.release()},isLocked:function(){return e.isLocked()}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=Kc;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Xc;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=ou;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})}(Yc);var au=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)cu.call(r,n)&&(e[n]=r[n])}return e},cu=Object.prototype.hasOwnProperty;const uu=au,lu=ms();var hu=du;function du(e){this.currentProvider=e}function fu(e){return function(){var t=[].slice.call(arguments),r=t.pop();this.sendAsync({method:e,params:t},r)}}function pu(e,t){return function(){var r=[].slice.call(arguments),n=r.pop();r.length<e&&r.push("latest"),this.sendAsync({method:t,params:r},n)}}du.prototype.getBalance=pu(2,"eth_getBalance"),du.prototype.getCode=pu(2,"eth_getCode"),du.prototype.getTransactionCount=pu(2,"eth_getTransactionCount"),du.prototype.getStorageAt=pu(3,"eth_getStorageAt"),du.prototype.call=pu(2,"eth_call"),du.prototype.protocolVersion=fu("eth_protocolVersion"),du.prototype.syncing=fu("eth_syncing"),du.prototype.coinbase=fu("eth_coinbase"),du.prototype.mining=fu("eth_mining"),du.prototype.hashrate=fu("eth_hashrate"),du.prototype.gasPrice=fu("eth_gasPrice"),du.prototype.accounts=fu("eth_accounts"),du.prototype.blockNumber=fu("eth_blockNumber"),du.prototype.getBlockTransactionCountByHash=fu("eth_getBlockTransactionCountByHash"),du.prototype.getBlockTransactionCountByNumber=fu("eth_getBlockTransactionCountByNumber"),du.prototype.getUncleCountByBlockHash=fu("eth_getUncleCountByBlockHash"),du.prototype.getUncleCountByBlockNumber=fu("eth_getUncleCountByBlockNumber"),du.prototype.sign=fu("eth_sign"),du.prototype.sendTransaction=fu("eth_sendTransaction"),du.prototype.sendRawTransaction=fu("eth_sendRawTransaction"),du.prototype.estimateGas=fu("eth_estimateGas"),du.prototype.getBlockByHash=fu("eth_getBlockByHash"),du.prototype.getBlockByNumber=fu("eth_getBlockByNumber"),du.prototype.getTransactionByHash=fu("eth_getTransactionByHash"),du.prototype.getTransactionByBlockHashAndIndex=fu("eth_getTransactionByBlockHashAndIndex"),du.prototype.getTransactionByBlockNumberAndIndex=fu("eth_getTransactionByBlockNumberAndIndex"),du.prototype.getTransactionReceipt=fu("eth_getTransactionReceipt"),du.prototype.getUncleByBlockHashAndIndex=fu("eth_getUncleByBlockHashAndIndex"),du.prototype.getUncleByBlockNumberAndIndex=fu("eth_getUncleByBlockNumberAndIndex"),du.prototype.getCompilers=fu("eth_getCompilers"),du.prototype.compileLLL=fu("eth_compileLLL"),du.prototype.compileSolidity=fu("eth_compileSolidity"),du.prototype.compileSerpent=fu("eth_compileSerpent"),du.prototype.newFilter=fu("eth_newFilter"),du.prototype.newBlockFilter=fu("eth_newBlockFilter"),du.prototype.newPendingTransactionFilter=fu("eth_newPendingTransactionFilter"),du.prototype.uninstallFilter=fu("eth_uninstallFilter"),du.prototype.getFilterChanges=fu("eth_getFilterChanges"),du.prototype.getFilterLogs=fu("eth_getFilterLogs"),du.prototype.getLogs=fu("eth_getLogs"),du.prototype.getWork=fu("eth_getWork"),du.prototype.submitWork=fu("eth_submitWork"),du.prototype.submitHashrate=fu("eth_submitHashrate"),du.prototype.sendAsync=function(e,t){var r;this.currentProvider.sendAsync((r=e,uu({id:lu(),jsonrpc:"2.0",params:[]},r)),(function(e,r){if(!e&&r.error&&(e=new Error("EthQuery - RPC Error - "+r.error.message)),e)return t(e);t(null,r.result)}))};const bu=(e,t,r,n)=>function(...i){return new(0,t.promiseModule)(((o,s)=>{t.multiArgs?i.push(((...e)=>{t.errorFirst?e[0]?s(e):(e.shift(),o(e)):o(e)})):t.errorFirst?i.push(((e,t)=>{e?s(e):o(t)})):i.push(o);const a=this===r?n:this;Reflect.apply(e,a,i)}))},yu=new WeakMap;const gu=v.default;var mu=class extends gu{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach((e=>this.emit("update",e)))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};const vu=mu;var _u={minBlockRef:function(...e){return wu(e)[0]},maxBlockRef:function(...e){const t=wu(e);return t[t.length-1]},sortBlockRefs:wu,bnToHex:function(e){return"0x"+e.toString(16)},blockRefIsNumber:function(e){return e&&!["earliest","latest","pending"].includes(e)},hexToInt:Su,incrementHexInt:function(e){if(null==e)return e;return Eu(Su(e)+1)},intToHex:Eu,unsafeRandomBytes:function(e){let t="0x";for(let r=0;r<e;r++)t+=xu(),t+=xu();return t}};function wu(e){return e.sort(((e,t)=>"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:Su(e)-Su(t)))}function Su(e){return null==e?e:Number.parseInt(e,16)}function Eu(e){if(null==e)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function xu(){return Math.floor(16*Math.random()).toString(16)}const ku=hu,Cu=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(null===e||"object"!==r&&"function"!==r)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":r}\``);const n=new WeakMap,i=new Proxy(e,{apply(e,r,o){const s=n.get(e);if(s)return Reflect.apply(s,r,o);const a=t.excludeMain?e:bu(e,t,i,e);return n.set(e,a),Reflect.apply(a,r,o)},get(e,r){const o=e[r];if(!((e,r)=>{let n=yu.get(e);if(n||(n={},yu.set(e,n)),r in n)return n[r];const i=e=>"string"==typeof e||"symbol"==typeof r?r===e:e.test(r),o=Reflect.getOwnPropertyDescriptor(e,r),s=void 0===o||o.writable||o.configurable,a=(t.include?t.include.some(i):!t.exclude.some(i))&&s;return n[r]=a,a})(e,r)||o===Function.prototype[r])return o;const s=n.get(o);if(s)return s;if("function"==typeof o){const r=bu(o,t,i,e);return n.set(o,r),r}return o}});return i},Mu=class extends vu{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}},{bnToHex:Iu,hexToInt:Ru,incrementHexInt:Au,minBlockRef:Nu,blockRefIsNumber:ju}=_u;var Ou=class extends Mu{constructor({provider:e,params:t}){super(),this.type="log",this.ethQuery=new ku(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},t),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map((e=>e.toLowerCase())))}async initialize({currentBlock:e}){let t=this.params.fromBlock;["latest","pending"].includes(t)&&(t=e),"earliest"===t&&(t="0x0"),this.params.fromBlock=t;const r=Nu(this.params.toBlock,e),n=Object.assign({},this.params,{toBlock:r}),i=await this._fetchLogs(n);this.addInitialResults(i)}async update({oldBlock:e,newBlock:t}){const r=t;let n;n=e?Au(e):t;const i=Object.assign({},this.params,{fromBlock:n,toBlock:r}),o=(await this._fetchLogs(i)).filter((e=>this.matchLog(e)));this.addResults(o)}async _fetchLogs(e){return await Cu((t=>this.ethQuery.getLogs(e,t)))()}matchLog(e){if(Ru(this.params.fromBlock)>=Ru(e.blockNumber))return!1;if(ju(this.params.toBlock)&&Ru(this.params.toBlock)<=Ru(e.blockNumber))return!1;const t=e.address&&e.address.toLowerCase();if(this.params.address&&t&&!this.params.address.includes(t))return!1;return this.params.topics.every(((t,r)=>{let n=e.topics[r];if(!n)return!1;n=n.toLowerCase();let i=Array.isArray(t)?t:[t];if(i.includes(null))return!0;i=i.map((e=>e.toLowerCase()));return i.includes(n)}))}},Tu=async function({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=Pu(t),i=Pu(r),o=Array(i-n+1).fill().map(((e,t)=>n+t)).map(Lu);return await Promise.all(o.map((t=>async function(e,t,r){for(let n=0;n<3;n++)try{return await Du(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(e){console.error(`provider.sendAsync failed: ${e.stack||e.message||e}`)}throw new Error(`Block not found for params: ${JSON.stringify(r)}`)}(e,"eth_getBlockByNumber",[t,!1]))))};function Pu(e){return null==e?e:Number.parseInt(e,16)}function Lu(e){if(null==e)return e;return"0x"+e.toString(16)}function Du(e,t){return new Promise(((r,n)=>{e.sendAsync(t,((e,t)=>{e?n(e):t.error?n(t.error):t.result?r(t.result):n(new Error("Result was empty"))}))}))}const Bu=mu,Fu=Tu,{incrementHexInt:Uu}=_u;var Vu=class extends Bu{constructor({provider:e,params:t}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:t}){const r=t,n=Uu(e),i=(await Fu({provider:this.provider,fromBlock:n,toBlock:r})).map((e=>e.hash));this.addResults(i)}};const Hu=mu,Wu=Tu,{incrementHexInt:zu}=_u;var qu=class extends Hu{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const t=e,r=zu(e),n=await Wu({provider:this.provider,fromBlock:r,toBlock:t}),i=[];for(const e of n)i.push(...e.transactions);this.addResults(i)}};const Ju=Yc.Mutex,{createAsyncMiddleware:$u,createScaffoldMiddleware:Gu}=wc,Zu=Ou,Qu=Vu,Yu=qu,{intToHex:Ku,hexToInt:Xu}=_u;var el=function({blockTracker:e,provider:t}){let r=0,n={};const i=new Ju,o=function({mutex:e}){return t=>async(r,n,i,o)=>{(await e.acquire())(),t(r,n,i,o)}}({mutex:i}),s=Gu({eth_newFilter:o(tl(c)),eth_newBlockFilter:o(tl(u)),eth_newPendingTransactionFilter:o(tl(l)),eth_uninstallFilter:o(rl(f)),eth_getFilterChanges:o(rl(h)),eth_getFilterLogs:o(rl(d))}),a=async({oldBlock:e,newBlock:t})=>{if(0===n.length)return;const r=await i.acquire();try{await Promise.all(nl(n).map((async r=>{try{await r.update({oldBlock:e,newBlock:t})}catch(e){console.error(e)}})))}catch(e){console.error(e)}r()};return s.newLogFilter=c,s.newBlockFilter=u,s.newPendingTransactionFilter=l,s.uninstallFilter=f,s.getFilterChanges=h,s.getFilterLogs=d,s.destroy=()=>{!async function(){const e=nl(n).length;n={},b({prevFilterCount:e,newFilterCount:0})}()},s;async function c(e){const r=new Zu({provider:t,params:e});return await p(r),r}async function u(){const e=new Qu({provider:t});return await p(e),e}async function l(){const e=new Yu({provider:t});return await p(e),e}async function h(e){const t=Xu(e),r=n[t];if(!r)throw new Error(`No filter for index "${t}"`);return r.getChangesAndClear()}async function d(e){const t=Xu(e),r=n[t];if(!r)throw new Error(`No filter for index "${t}"`);let i=[];return"log"===r.type&&(i=r.getAllResults()),i}async function f(e){const t=Xu(e),r=n[t],i=Boolean(r);return i&&await async function(e){const t=nl(n).length;delete n[e];const r=nl(n).length;b({prevFilterCount:t,newFilterCount:r})}(t),i}async function p(t){const i=nl(n).length,o=await e.getLatestBlock();await t.initialize({currentBlock:o}),r++,n[r]=t,t.id=r,t.idHex=Ku(r);return b({prevFilterCount:i,newFilterCount:nl(n).length}),r}function b({prevFilterCount:t,newFilterCount:r}){0===t&&r>0?e.on("sync",a):t>0&&0===r&&e.removeListener("sync",a)}};function tl(e){return rl((async(...t)=>{const r=await e(...t);return Ku(r.id)}))}function rl(e){return $u((async(t,r)=>{const n=await e.apply(null,t.params);r.result=n}))}function nl(e,t){const r=[];for(let t in e)r.push(e[t]);return r}const il=v.default,{createAsyncMiddleware:ol,createScaffoldMiddleware:sl}=wc,al=el,{unsafeRandomBytes:cl,incrementHexInt:ul}=_u,ll=Tu;var hl=function({blockTracker:e,provider:t}){const r={},n=al({blockTracker:e,provider:t});let i=!1;const o=new il,s=sl({eth_subscribe:ol((async function(o,s){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const c=o.params[0],u=cl(16);let l;switch(c){case"newHeads":l=h({subId:u});break;case"logs":const e=o.params[1];l=d({subId:u,filter:await n.newLogFilter(e)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${c}"`)}return r[u]=l,void(s.result=u);function h({subId:r}){const n={type:c,destroy:async()=>{e.removeListener("sync",n.update)},update:async({oldBlock:e,newBlock:n})=>{const i=n,o=ul(e);(await ll({provider:t,fromBlock:o,toBlock:i})).map(dl).filter((e=>null!==e)).forEach((e=>{a(r,e)}))}};return e.on("sync",n.update),n}function d({subId:e,filter:t}){t.on("update",(t=>a(e,t)));return{type:c,destroy:async()=>await n.uninstallFilter(t.idHex)}}})),eth_unsubscribe:ol((async function(e,t){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const n=e.params[0],o=r[n];if(!o)return void(t.result=!1);delete r[n],await o.destroy(),t.result=!0}))});return s.destroy=function(){o.removeAllListeners();for(const e in r)r[e].destroy(),delete r[e];i=!0},{events:o,middleware:s};function a(e,t){o.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}};function dl(e){return null==e?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(bs,"__esModule",{value:!0}),bs.SubscriptionManager=void 0;const fl=ys,pl=hl,bl=()=>{};bs.SubscriptionManager=class{constructor(e){const t=new fl.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:r,middleware:n}=pl({blockTracker:t,provider:e});this.events=r,this.subscriptionMiddleware=n}async handleRequest(e){const t={};return await this.subscriptionMiddleware(e,t,bl,bl),t}destroy(){this.subscriptionMiddleware.destroy()}};var yl=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(m,"__esModule",{value:!0}),m.CoinbaseWalletProvider=void 0;const gl=yl(v),ml=yl(c.exports),vl=E,_l=Q,wl=Y,Sl=yi,El=ft,xl=yl(ns),kl=is,Cl=ps,Ml=bs,Il="DefaultChainId",Rl="DefaultJsonRpcUrl";class Al extends gl.default{constructor(e){var t,r;super(),this._filterPolyfill=new kl.FilterPolyfill(this),this._subscriptionManager=new Ml.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this._send=this.send.bind(this),this._sendAsync=this.sendAsync.bind(this),this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=null===(t=e.overrideIsCoinbaseWallet)||void 0===t||t,this.isCoinbaseBrowser=null!==(r=e.overrideIsCoinbaseBrowser)&&void 0!==r&&r,this.qrUrl=e.qrUrl,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;const n=this.getChainId(),i=(0,El.prepend0x)(n.toString(16));this.emit("connect",{chainIdStr:i});const o=this._storage.getItem(Sl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const e=o.split(" ");""!==e[0]&&(this._addresses=e.map((e=>(0,El.ensureAddressString)(e))),this.emit("accountsChanged",e))}this._subscriptionManager.events.on("notification",(e=>{this.emit("message",{type:e.method,data:e.params})})),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",(e=>{var t;if(e.origin===location.origin&&e.source===window&&"walletLinkMessage"===e.data.type){if("defaultChainChanged"===e.data.data.action||"dappChainSwitched"===e.data.data.action){const r=e.data.data.chainId,n=null!==(t=e.data.data.jsonRpcUrl)&&void 0!==t?t:this.jsonRpcUrl;this.updateProviderInfo(n,Number(r))}"addressChanged"===e.data.data.action&&this._setAddresses([e.data.data.address])}}))}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,El.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(Rl))&&void 0!==e?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(Rl,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,t){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=t,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,t){this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(Il,t.toString(10));!((0,El.ensureIntNumber)(t)!==r)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,r,n,i,o){const s=await this.initializeRelay();return!!(await s.watchAsset(e,t,r,n,i,null==o?void 0:o.toString()).promise).result}async addEthereumChain(e,t,r,n,i,o){var s,a;if((0,El.ensureIntNumber)(e)===this.getChainId())return!1;const c=await this.initializeRelay(),u=c.inlineAddEthereumChain(e.toString());this._isAuthorized()||u||await c.requestEthereumAccounts().promise;const l=await c.addEthereumChain(e.toString(),t,i,r,n,o).promise;return!0===(null===(s=l.result)||void 0===s?void 0:s.isApproved)&&this.updateProviderInfo(t[0],e),!0===(null===(a=l.result)||void 0===a?void 0:a.isApproved)}async switchEthereumChain(e){const t=await this.initializeRelay(),r=await t.switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if(r.errorCode)throw vl.ethErrors.provider.custom({code:r.errorCode});const n=r.result;n.isApproved&&n.rpcUrl.length>0&&this.updateProviderInfo(n.rpcUrl,e)}setAppInfo(e,t){this.initializeRelay().then((r=>r.setAppInfo(e,t)))}async enable(){var e;return null===(e=this.diagnostic)||void 0===e||e.log(_l.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?wl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(Cl.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,t){if("string"==typeof e){const r={jsonrpc:"2.0",id:0,method:e,params:Array.isArray(t)?t:void 0!==t?[t]:[]};return this._sendRequestAsync(r).then((e=>e.result))}if("function"==typeof t){const r=e,n=t;return this._sendAsync(r,n)}if(Array.isArray(e)){return e.map((e=>this._sendRequest(e)))}const r=e;return this._sendRequest(r)}async sendAsync(e,t){if("function"!=typeof t)throw new Error("callback is required");if(Array.isArray(e)){const r=t;return void this._sendMultipleRequestsAsync(e).then((e=>r(null,e))).catch((e=>r(e,null)))}const r=t;return this._sendRequestAsync(e).then((e=>r(null,e))).catch((e=>r(e,null)))}async request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw vl.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:r}=e;if("string"!=typeof t||0===t.length)throw vl.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw vl.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const n=void 0===r?[]:r,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:n,jsonrpc:"2.0",id:i})).result}async scanQRCode(e){const t=await this.initializeRelay(),r=await t.scanQRCode((0,El.ensureRegExpString)(e)).promise;if("string"!=typeof r.result)throw new Error("result was not a string");return r.result}async genericRequest(e,t){const r=await this.initializeRelay(),n=await r.genericRequest(e,t).promise;if("string"!=typeof n.result)throw new Error("result was not a string");return n.result}async selectProvider(e){const t=await this.initializeRelay(),r=await t.selectProvider(e).promise;if("string"!=typeof r.result)throw new Error("result was not a string");return r.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const t={jsonrpc:"2.0",id:e.id},{method:r}=e;if(t.result=this._handleSynchronousMethods(e),void 0===t.result)throw new Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return t}_setAddresses(e,t){if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map((e=>(0,El.ensureAddressString)(e)));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!t||(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(Sl.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" "))))}_sendRequestAsync(e){return new Promise(((t,r)=>{try{const n=this._handleSynchronousMethods(e);if(void 0!==n)return t({jsonrpc:"2.0",id:e.id,result:n});const i=this._handleAsynchronousFilterMethods(e);if(void 0!==i)return void i.then((r=>t(Object.assign(Object.assign({},r),{id:e.id})))).catch((e=>r(e)));const o=this._handleSubscriptionMethods(e);if(void 0!==o)return void o.then((r=>t({jsonrpc:"2.0",id:e.id,result:r.result}))).catch((e=>r(e)))}catch(e){return r(e)}this._handleAsynchronousMethods(e).then((r=>r&&t(Object.assign(Object.assign({},r),{id:e.id})))).catch((e=>r(e)))}))}_sendMultipleRequestsAsync(e){return Promise.all(e.map((e=>this._sendRequestAsync(e))))}_handleSynchronousMethods(e){const{method:t}=e,r=e.params||[];switch(t){case Cl.JSONRPCMethod.eth_accounts:return this._eth_accounts();case Cl.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case Cl.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(r);case Cl.JSONRPCMethod.net_version:return this._net_version();case Cl.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:t}=e,r=e.params||[];switch(t){case Cl.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case Cl.JSONRPCMethod.eth_sign:return this._eth_sign(r);case Cl.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(r);case Cl.JSONRPCMethod.personal_sign:return this._personal_sign(r);case Cl.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(r);case Cl.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(r);case Cl.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(r);case Cl.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(r);case Cl.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(r);case Cl.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case Cl.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(r);case Cl.JSONRPCMethod.eth_signTypedData_v4:case Cl.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(r);case Cl.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(r);case Cl.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(r);case Cl.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(r);case Cl.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:t}=e,r=e.params||[];switch(t){case Cl.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(r);case Cl.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case Cl.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case Cl.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(r);case Cl.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(e){switch(e.method){case Cl.JSONRPCMethod.eth_subscribe:case Cl.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const t=(0,El.ensureAddressString)(e);return this._addresses.map((e=>(0,El.ensureAddressString)(e))).includes(t)}catch(e){}return!1}_ensureKnownAddress(e){var t;if(!this._isKnownAddress(e))throw null===(t=this.diagnostic)||void 0===t||t.log(_l.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?(0,El.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);return{fromAddress:t,toAddress:e.to?(0,El.ensureAddressString)(e.to):null,weiValue:null!=e.value?(0,El.ensureBN)(e.value):new ml.default(0),data:e.data?(0,El.ensureBuffer)(e.data):Buffer.alloc(0),nonce:null!=e.nonce?(0,El.ensureIntNumber)(e.nonce):null,gasPriceInWei:null!=e.gasPrice?(0,El.ensureBN)(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?(0,El.ensureBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,El.ensureBN)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,El.ensureBN)(e.gas):null,chainId:this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw vl.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw vl.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,r,n){this._ensureKnownAddress(t);try{const i=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await i.signEthereumMessage(e,t,r,n).promise).result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw vl.ethErrors.provider.userRejectedRequest("User denied message signature");throw e}}async _ethereumAddressFromSignedMessage(e,t,r){const n=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await n.ethereumAddressFromSignedMessage(e,t,r).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,El.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(Il);if(!e)return(0,El.ensureIntNumber)(this._chainIdFromOpts);const t=parseInt(e,10);return(0,El.ensureIntNumber)(t)}async _eth_requestAccounts(){var e;if(null===(e=this.diagnostic)||void 0===e||e.log(_l.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?wl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let t;try{const e=await this.initializeRelay();t=await e.requestEthereumAccounts().promise}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw vl.ethErrors.provider.userRejectedRequest("User denied account authorization");throw e}if(!t.result)throw new Error("accounts received is empty");return this._setAddresses(t.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const t=(0,El.ensureAddressString)(e[0]),r=(0,El.ensureBuffer)(e[1]);return this._signEthereumMessage(r,t,!1)}_eth_ecRecover(e){const t=(0,El.ensureBuffer)(e[0]),r=(0,El.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!1)}_personal_sign(e){this._requireAuthorization();const t=(0,El.ensureBuffer)(e[0]),r=(0,El.ensureAddressString)(e[1]);return this._signEthereumMessage(t,r,!0)}_personal_ecRecover(e){const t=(0,El.ensureBuffer)(e[0]),r=(0,El.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const e=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await e.signEthereumTransaction(t).promise).result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw vl.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_sendRawTransaction(e){const t=(0,El.ensureBuffer)(e[0]),r=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await r.submitEthereumTransaction(t,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const e=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await e.signAndSubmitEthereumTransaction(t).promise).result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw vl.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_signTypedData_v1(e){this._requireAuthorization();const t=(0,El.ensureParsedJSONObject)(e[0]),r=(0,El.ensureAddressString)(e[1]);this._ensureKnownAddress(r);const n=xl.default.hashForSignTypedDataLegacy({data:t}),i=JSON.stringify(t,null,2);return this._signEthereumMessage(n,r,!1,i)}async _eth_signTypedData_v3(e){this._requireAuthorization();const t=(0,El.ensureAddressString)(e[0]),r=(0,El.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const n=xl.default.hashForSignTypedData_v3({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,t,!1,i)}async _eth_signTypedData_v4(e){this._requireAuthorization();const t=(0,El.ensureAddressString)(e[0]),r=(0,El.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const n=xl.default.hashForSignTypedData_v4({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,t,!1,i)}async _cbwallet_arbitrary(e){const t=e[0],r=e[1];if("string"!=typeof r)throw new Error("parameter must be a string");if("object"!=typeof t||null===t)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(t,r)}}async _wallet_addEthereumChain(e){var t,r,n,i;const o=e[0];if(0===(null===(t=o.rpcUrls)||void 0===t?void 0:t.length))return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||""===o.chainName.trim())throw vl.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!o.nativeCurrency)throw vl.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});const s=parseInt(o.chainId,16);return await this.addEthereumChain(s,null!==(r=o.rpcUrls)&&void 0!==r?r:[],null!==(n=o.blockExplorerUrls)&&void 0!==n?n:[],o.chainName,null!==(i=o.iconUrls)&&void 0!==i?i:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw vl.ethErrors.rpc.invalidParams({message:"Type is required"});if("ERC20"!==(null==t?void 0:t.type))throw vl.ethErrors.rpc.invalidParams({message:`Asset of type '${t.type}' is not supported`});if(!(null==t?void 0:t.options))throw vl.ethErrors.rpc.invalidParams({message:"Options are required"});if(!(null==t?void 0:t.options.address))throw vl.ethErrors.rpc.invalidParams({message:"Address is required"});const r=this.getChainId(),{address:n,symbol:i,image:o,decimals:s}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,n,i,s,o,r)}}_eth_uninstallFilter(e){const t=(0,El.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(t)}async _eth_newFilter(e){const t=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(t)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const t=(0,El.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(t)}_eth_getFilterLogs(e){const t=(0,El.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(t)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then((e=>(e.setAccountsCallback(((e,t)=>this._setAddresses(e,t))),e.setChainCallback(((e,t)=>{this.updateProviderInfo(t,parseInt(e,10))})),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e)))}}m.CoinbaseWalletProvider=Al;var Nl,jl,Ol,Tl,Pl,Ll,Dl,Bl,Fl,Ul={},Vl={},Hl={},Wl=[],zl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ql(e,t){for(var r in t)e[r]=t[r];return e}function Jl(e){var t=e.parentNode;t&&t.removeChild(e)}function $l(e,t,r){var n,i,o,s={};for(o in t)"key"==o?n=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Nl.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Gl(e,s,n,i,null)}function Gl(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Ol:i};return null==i&&null!=jl.vnode&&jl.vnode(o),o}function Zl(e){return e.children}function Ql(e,t){this.props=e,this.context=t}function Yl(e,t){if(null==t)return e.__?Yl(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?Yl(e):null}function Kl(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return Kl(e)}}function Xl(e){(!e.__d&&(e.__d=!0)&&Pl.push(e)&&!eh.__r++||Ll!==jl.debounceRendering)&&((Ll=jl.debounceRendering)||Dl)(eh)}function eh(){var e,t,r,n,i,o,s,a;for(Pl.sort(Bl);e=Pl.shift();)e.__d&&(t=Pl.length,n=void 0,i=void 0,s=(o=(r=e).__v).__e,(a=r.__P)&&(n=[],(i=ql({},o)).__v=o.__v+1,uh(a,o,i,r.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,n,null==s?Yl(o):s,o.__h),lh(n,o),o.__e!=s&&Kl(o)),Pl.length>t&&Pl.sort(Bl));eh.__r=0}function th(e,t,r,n,i,o,s,a,c,u){var l,h,d,f,p,b,y,g=n&&n.__k||Wl,m=g.length;for(r.__k=[],l=0;l<t.length;l++)if(null!=(f=r.__k[l]=null==(f=t[l])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Gl(null,f,null,null,f):Array.isArray(f)?Gl(Zl,{children:f},null,null,null):f.__b>0?Gl(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=r,f.__b=r.__b+1,null===(d=g[l])||d&&f.key==d.key&&f.type===d.type)g[l]=void 0;else for(h=0;h<m;h++){if((d=g[h])&&f.key==d.key&&f.type===d.type){g[h]=void 0;break}d=null}uh(e,f,d=d||Hl,i,o,s,a,c,u),p=f.__e,(h=f.ref)&&d.ref!=h&&(y||(y=[]),d.ref&&y.push(d.ref,null,f),y.push(h,f.__c||p,f)),null!=p?(null==b&&(b=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=c=rh(f,c,e):c=nh(e,f,d,g,p,c),"function"==typeof r.type&&(r.__d=c)):c&&d.__e==c&&c.parentNode!=e&&(c=Yl(d))}for(r.__e=b,l=m;l--;)null!=g[l]&&("function"==typeof r.type&&null!=g[l].__e&&g[l].__e==r.__d&&(r.__d=ih(n).nextSibling),fh(g[l],g[l]));if(y)for(l=0;l<y.length;l++)dh(y[l],y[++l],y[++l])}function rh(e,t,r){for(var n,i=e.__k,o=0;i&&o<i.length;o++)(n=i[o])&&(n.__=e,t="function"==typeof n.type?rh(n,t,r):nh(r,n,n,i,n.__e,t));return t}function nh(e,t,r,n,i,o){var s,a,c;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==r||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),s=null;else{for(a=o,c=0;(a=a.nextSibling)&&c<n.length;c+=1)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function ih(e){var t,r,n;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((r=e.__k[t])&&(n=ih(r)))return n;return null}function oh(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||zl.test(t)?r:r+"px"}function sh(e,t,r,n,i){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||oh(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||oh(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n||e.addEventListener(t,o?ch:ah,o):e.removeEventListener(t,o?ch:ah,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function ah(e){return this.l[e.type+!1](jl.event?jl.event(e):e)}function ch(e){return this.l[e.type+!0](jl.event?jl.event(e):e)}function uh(e,t,r,n,i,o,s,a,c){var u,l,h,d,f,p,b,y,g,m,v,_,w,S,E,x=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(c=r.__h,a=t.__e=r.__e,t.__h=null,o=[a]),(u=jl.__b)&&u(t);try{e:if("function"==typeof x){if(y=t.props,g=(u=x.contextType)&&n[u.__c],m=u?g?g.props.value:u.__:n,r.__c?b=(l=t.__c=r.__c).__=l.__E:("prototype"in x&&x.prototype.render?t.__c=l=new x(y,m):(t.__c=l=new Ql(y,m),l.constructor=x,l.render=ph),g&&g.sub(l),l.props=y,l.state||(l.state={}),l.context=m,l.__n=n,h=l.__d=!0,l.__h=[],l._sb=[]),null==l.__s&&(l.__s=l.state),null!=x.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=ql({},l.__s)),ql(l.__s,x.getDerivedStateFromProps(y,l.__s))),d=l.props,f=l.state,l.__v=t,h)null==x.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==x.getDerivedStateFromProps&&y!==d&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(y,m),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(y,l.__s,m)||t.__v===r.__v){for(t.__v!==r.__v&&(l.props=y,l.state=l.__s,l.__d=!1),l.__e=!1,t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),v=0;v<l._sb.length;v++)l.__h.push(l._sb[v]);l._sb=[],l.__h.length&&s.push(l);break e}null!=l.componentWillUpdate&&l.componentWillUpdate(y,l.__s,m),null!=l.componentDidUpdate&&l.__h.push((function(){l.componentDidUpdate(d,f,p)}))}if(l.context=m,l.props=y,l.__P=e,_=jl.__r,w=0,"prototype"in x&&x.prototype.render){for(l.state=l.__s,l.__d=!1,_&&_(t),u=l.render(l.props,l.state,l.context),S=0;S<l._sb.length;S++)l.__h.push(l._sb[S]);l._sb=[]}else do{l.__d=!1,_&&_(t),u=l.render(l.props,l.state,l.context),l.state=l.__s}while(l.__d&&++w<25);l.state=l.__s,null!=l.getChildContext&&(n=ql(ql({},n),l.getChildContext())),h||null==l.getSnapshotBeforeUpdate||(p=l.getSnapshotBeforeUpdate(d,f)),E=null!=u&&u.type===Zl&&null==u.key?u.props.children:u,th(e,Array.isArray(E)?E:[E],t,r,n,i,o,s,a,c),l.base=t.__e,t.__h=null,l.__h.length&&s.push(l),b&&(l.__E=l.__=null),l.__e=!1}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=hh(r.__e,t,r,n,i,o,s,c);(u=jl.diffed)&&u(t)}catch(e){t.__v=null,(c||null!=o)&&(t.__e=a,t.__h=!!c,o[o.indexOf(a)]=null),jl.__e(e,t,r)}}function lh(e,t){jl.__c&&jl.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){jl.__e(e,t.__v)}}))}function hh(e,t,r,n,i,o,s,a){var c,u,l,h=r.props,d=t.props,f=t.type,p=0;if("svg"===f&&(i=!0),null!=o)for(;p<o.length;p++)if((c=o[p])&&"setAttribute"in c==!!f&&(f?c.localName===f:3===c.nodeType)){e=c,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,a=!1}if(null===f)h===d||a&&e.data===d||(e.data=d);else{if(o=o&&Nl.call(e.childNodes),u=(h=r.props||Hl).dangerouslySetInnerHTML,l=d.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(l||u)&&(l&&(u&&l.__html==u.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(function(e,t,r,n,i){var o;for(o in r)"children"===o||"key"===o||o in t||sh(e,o,null,r[o],n);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||r[o]===t[o]||sh(e,o,t[o],r[o],n)}(e,d,h,i,a),l)t.__k=[];else if(p=t.props.children,th(e,Array.isArray(p)?p:[p],t,r,n,i&&"foreignObject"!==f,o,s,o?o[0]:r.__k&&Yl(r,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&Jl(o[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&sh(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&sh(e,"checked",p,h.checked,!1))}return e}function dh(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){jl.__e(e,r)}}function fh(e,t,r){var n,i;if(jl.unmount&&jl.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||dh(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){jl.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&fh(n[i],t,r||"function"!=typeof e.type);r||null==e.__e||Jl(e.__e),e.__=e.__e=e.__d=void 0}function ph(e,t,r){return this.constructor(e,r)}function bh(e,t,r){var n,i,o;jl.__&&jl.__(e,t),i=(n="function"==typeof r)?null:r&&r.__k||t.__k,o=[],uh(t,e=(!n&&r||t).__k=$l(Zl,null,[e]),i||Hl,Hl,void 0!==t.ownerSVGElement,!n&&r?[r]:i?null:t.firstChild?Nl.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n),lh(o,e)}Nl=Wl.slice,jl={__e:function(e,t,r,n){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Ol=0,Tl=function(e){return null!=e&&void 0===e.constructor},Ql.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ql({},this.state),"function"==typeof e&&(e=e(ql({},r),this.props)),e&&ql(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Xl(this))},Ql.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Xl(this))},Ql.prototype.render=Zl,Pl=[],Dl="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Bl=function(e,t){return e.__v.__b-t.__v.__b},eh.__r=0,Fl=0;var yh=Object.freeze({__proto__:null,Component:Ql,Fragment:Zl,cloneElement:function(e,t,r){var n,i,o,s=ql({},e.props);for(o in t)"key"==o?n=t[o]:"ref"==o?i=t[o]:s[o]=t[o];return arguments.length>2&&(s.children=arguments.length>3?Nl.call(arguments,2):r),Gl(e.type,s,n||e.key,i||e.ref,null)},createContext:function(e,t){var r={__c:t="__cC"+Fl++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,Xl(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r},createElement:$l,createRef:function(){return{current:null}},h:$l,hydrate:function e(t,r){bh(t,r,e)},get isValidElement(){return Tl},get options(){return jl},render:bh,toChildArray:function e(t,r){return r=r||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,r)})):r.push(t)),r}}),gh=t(yh);function mh(e){return"function"==typeof e}var vh=!1,_h={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;vh=e},get useDeprecatedSynchronousErrorHandling(){return vh}};function wh(e){setTimeout((function(){throw e}),0)}var Sh={closed:!0,next:function(e){},error:function(e){if(_h.useDeprecatedSynchronousErrorHandling)throw e;wh(e)},complete:function(){}},Eh=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();function xh(e){return null!==e&&"object"==typeof e}var kh=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),Ch=kh,Mh=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,o=r._unsubscribe,s=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(var a=0;a<n.length;++a){n[a].remove(this)}if(mh(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){t=e instanceof Ch?Ih(e.errors):[e]}}if(Eh(s)){a=-1;for(var c=s.length;++a<c;){var u=s[a];if(xh(u))try{u.unsubscribe()}catch(e){t=t||[],e instanceof Ch?t=t.concat(Ih(e.errors)):t.push(e)}}}if(t)throw new Ch(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function Ih(e){return e.reduce((function(e,t){return e.concat(t instanceof Ch?t.errors:t)}),[])}var Rh=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),Ah=function(e){function t(r,n,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=Sh;break;case 1:if(!r){o.destination=Sh;break}if("object"==typeof r){r instanceof t?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new Nh(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new Nh(o,r,n,i)}return o}return r(t,e),t.prototype[Rh]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(Mh),Nh=function(e){function t(t,r,n,i){var o,s=e.call(this)||this;s._parentSubscriber=t;var a=s;return mh(r)?o=r:r&&(o=r.next,n=r.error,i=r.complete,r!==Sh&&(mh((a=Object.create(r)).unsubscribe)&&s.add(a.unsubscribe.bind(a)),a.unsubscribe=s.unsubscribe.bind(s))),s._context=a,s._next=o,s._error=n,s._complete=i,s}return r(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;_h.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=_h.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):wh(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;wh(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};_h.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),_h.useDeprecatedSynchronousErrorHandling)throw e;wh(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!_h.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return _h.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(wh(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(Ah);function jh(e){for(;e;){var t=e,r=t.closed,n=t.destination,i=t.isStopped;if(r||i)return!1;e=n&&n instanceof Ah?n:null}return!0}var Oh=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Th(e){return e}function Ph(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Lh(e)}function Lh(e){return 0===e.length?Th:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var Dh=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,i=function(e,t,r){if(e){if(e instanceof Ah)return e;if(e[Rh])return e[Rh]()}return e||t||r?new Ah(e,t,r):new Ah(Sh)}(e,t,r);if(n?i.add(n.call(i,this.source)):i.add(this.source||_h.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),_h.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){_h.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),jh(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=Bh(t))((function(t,n){var i;i=r.subscribe((function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}}),n,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[Oh]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:Lh(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Bh(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function Bh(e){if(e||(e=_h.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var Fh=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),Uh=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return r(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(Mh),Vh=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return r(t,e),t}(Ah),Hh=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return r(t,e),t.prototype[Rh]=function(){return new Vh(this)},t.prototype.lift=function(e){var t=new Wh(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new Fh;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new Fh;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new Fh;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new Fh;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new Fh;return this.hasError?(e.error(this.thrownError),Mh.EMPTY):this.isStopped?(e.complete(),Mh.EMPTY):(this.observers.push(e),new Uh(this,e))},t.prototype.asObservable=function(){var e=new Dh;return e.source=this,e},t.create=function(e,t){return new Wh(e,t)},t}(Dh),Wh=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return r(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):Mh.EMPTY},t}(Hh);function zh(){return function(e){return e.lift(new qh(e))}}var qh=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new Jh(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i},e}(),Jh=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return r(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var r=this.connection,n=e._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},t}(Ah),$h=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return r(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new Mh).add(this.source.subscribe(new Zh(this.getSubject(),this))),e.closed&&(this._connection=null,e=Mh.EMPTY)),e},t.prototype.refCount=function(){return zh()(this)},t}(Dh),Gh=function(){var e=$h.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}(),Zh=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return r(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(Vh);var Qh=function(){function e(e,t,r,n){this.keySelector=e,this.elementSelector=t,this.durationSelector=r,this.subjectSelector=n}return e.prototype.call=function(e,t){return t.subscribe(new Yh(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),Yh=function(e){function t(t,r,n,i,o){var s=e.call(this,t)||this;return s.keySelector=r,s.elementSelector=n,s.durationSelector=i,s.subjectSelector=o,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return r(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){return void this.error(e)}this._group(e,t)},t.prototype._group=function(e,t){var r=this.groups;r||(r=this.groups=new Map);var n,i=r.get(t);if(this.elementSelector)try{n=this.elementSelector(e)}catch(e){this.error(e)}else n=e;if(!i){i=this.subjectSelector?this.subjectSelector():new Hh,r.set(t,i);var o=new Xh(t,i,this);if(this.destination.next(o),this.durationSelector){var s=void 0;try{s=this.durationSelector(new Xh(t,i))}catch(e){return void this.error(e)}this.add(s.subscribe(new Kh(t,i,this)))}}i.closed||i.next(n)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach((function(t,r){t.error(e)})),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach((function(e,t){e.complete()})),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(Ah),Kh=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.key=t,i.group=r,i.parent=n,i}return r(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(Ah),Xh=function(e){function t(t,r,n){var i=e.call(this)||this;return i.key=t,i.groupSubject=r,i.refCountSubscription=n,i}return r(t,e),t.prototype._subscribe=function(e){var t=new Mh,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&t.add(new ed(r)),t.add(n.subscribe(e)),t},t}(Dh),ed=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,t.count++,r}return r(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(Mh),td=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return r(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Fh;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Hh),rd=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return r(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r=!1,n=void 0;try{this.work(e)}catch(e){r=!0,n=!!e&&e||new Error(e)}if(r)return this.unsubscribe(),n},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,r=t.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(function(e){function t(t,r){return e.call(this)||this}return r(t,e),t.prototype.schedule=function(e,t){return this},t}(Mh)),nd=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(rd),id=function(){function e(t,r){void 0===r&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(r,t)},e.now=function(){return Date.now()},e}(),od=function(e){function t(r,n){void 0===n&&(n=id.now);var i=e.call(this,r,(function(){return t.delegate&&t.delegate!==i?t.delegate.now():n()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return r(t,e),t.prototype.schedule=function(r,n,i){return void 0===n&&(n=0),t.delegate&&t.delegate!==this?t.delegate.schedule(r,n,i):e.prototype.schedule.call(this,r,n,i)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var r;this.active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(id),sd=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(od))(nd),ad=sd,cd=new Dh((function(e){return e.complete()}));function ud(e){return e?function(e){return new Dh((function(t){return e.schedule((function(){return t.complete()}))}))}(e):cd}function ld(e){return e&&"function"==typeof e.schedule}var hd,dd=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}};function fd(e,t){return new Dh((function(r){var n=new Mh,i=0;return n.add(t.schedule((function(){i!==e.length?(r.next(e[i++]),r.closed||n.add(this.schedule())):r.complete()}))),n}))}function pd(e,t){return t?fd(e,t):new Dh(dd(e))}function bd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return ld(r)?(e.pop(),fd(e,r)):pd(e)}function yd(e,t){return new Dh(t?function(r){return t.schedule(gd,0,{error:e,subscriber:r})}:function(t){return t.error(e)})}function gd(e){var t=e.error;e.subscriber.error(t)}hd||(hd={});var md=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,r){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return r&&r()}},e.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){switch(this.kind){case"N":return bd(this.value);case"E":return yd(this.error);case"C":return ud()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();var vd=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new _d(e,this.scheduler,this.delay))},e}(),_d=function(e){function t(t,r,n){void 0===n&&(n=0);var i=e.call(this,t)||this;return i.scheduler=r,i.delay=n,i}return r(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new wd(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(md.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(md.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(md.createComplete()),this.unsubscribe()},t}(Ah),wd=function(){return function(e,t){this.notification=e,this.destination=t}}(),Sd=function(e){function t(t,r,n){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=e.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return r(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var r=this._events;r.push(t),r.length>this._bufferSize&&r.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new Ed(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=n.length;if(this.closed)throw new Fh;if(this.isStopped||this.hasError?t=Mh.EMPTY:(this.observers.push(e),t=new Uh(this,e)),i&&e.add(e=new _d(e,i)),r)for(var s=0;s<o&&!e.closed;s++)e.next(n[s]);else for(s=0;s<o&&!e.closed;s++)e.next(n[s].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||ad).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(e-n[o].time<r);)o++;return i>t&&(o=Math.max(o,i-t)),o>0&&n.splice(0,o),n},t}(Hh),Ed=function(){return function(e,t){this.time=e,this.value=t}}(),xd=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return r(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),Mh.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),Mh.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(Hh),kd=1,Cd=function(){return Promise.resolve()}(),Md={};function Id(e){return e in Md&&(delete Md[e],!0)}var Rd=function(e){var t=kd++;return Md[t]=!0,Cd.then((function(){return Id(t)&&e()})),t},Ad=function(e){Id(e)},Nd=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=Rd(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(Ad(r),t.scheduled=void 0)},t}(rd),jd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do{if(t=e.execute(e.state,e.delay))break}while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},t}(od),Od=new jd(Nd),Td=Od,Pd=new od(rd),Ld=Pd,Dd=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return r(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame((function(){return t.flush(null)}))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(cancelAnimationFrame(r),t.scheduled=void 0)},t}(rd),Bd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do{if(t=e.execute(e.state,e.delay))break}while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},t}(od),Fd=new Bd(Dd),Ud=Fd,Vd=function(e){function t(t,r){void 0===t&&(t=Hd),void 0===r&&(r=Number.POSITIVE_INFINITY);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return r(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(od),Hd=function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return r(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,r){},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(rd);function Wd(){}var zd=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}(),qd=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}(),Jd=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}();function $d(e,t){return function(r){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new Gd(e,t))}}var Gd=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Zd(e,this.project,this.thisArg))},e}(),Zd=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return r(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(Ah);function Qd(e){var t=this,r=e.args,n=e.subscriber,i=e.params,o=i.callbackFunc,s=i.context,a=i.scheduler,c=i.subject;if(!c){c=i.subject=new xd;try{o.apply(s,r.concat([function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e.length<=1?e[0]:e;t.add(a.schedule(Yd,0,{value:n,subject:c}))}]))}catch(e){c.error(e)}}this.add(c.subscribe(n))}function Yd(e){var t=e.value,r=e.subject;r.next(t),r.complete()}function Kd(e){var t=this,r=e.params,n=e.subscriber,i=e.context,o=r.callbackFunc,s=r.args,a=r.scheduler,c=r.subject;if(!c){c=r.subject=new xd;try{o.apply(i,s.concat([function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e.shift();if(n)t.add(a.schedule(ef,0,{err:n,subject:c}));else{var i=e.length<=1?e[0]:e;t.add(a.schedule(Xd,0,{value:i,subject:c}))}}]))}catch(e){this.add(a.schedule(ef,0,{err:e,subject:c}))}}this.add(c.subscribe(n))}function Xd(e){var t=e.value,r=e.subject;r.next(t),r.complete()}function ef(e){var t=e.err;e.subject.error(t)}var tf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(Ah),rf=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i.index=0,i}return r(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(Ah);function nf(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var of=nf(),sf=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function af(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}var cf=function(e){if(e&&"function"==typeof e[Oh])return n=e,function(e){var t=n[Oh]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if(sf(e))return dd(e);if(af(e))return r=e,function(e){return r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,wh),e};if(e&&"function"==typeof e[of])return t=e,function(e){for(var r=t[of]();;){var n=void 0;try{n=r.next()}catch(t){return e.error(t),e}if(n.done){e.complete();break}if(e.next(n.value),e.closed)break}return"function"==typeof r.return&&e.add((function(){r.return&&r.return()})),e};var t,r,n,i=xh(e)?"an invalid object":"'"+e+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function uf(e,t,r,n,i){if(void 0===i&&(i=new rf(e,r,n)),!i.closed)return t instanceof Dh?t.subscribe(i):cf(t)(i)}var lf={};var hf=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new df(e,this.resultSelector))},e}(),df=function(e){function t(t,r){var n=e.call(this,t)||this;return n.resultSelector=r,n.active=0,n.values=[],n.observables=[],n}return r(t,e),t.prototype._next=function(e){this.values.push(lf),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var r=0;r<t;r++){var n=e[r];this.add(uf(this,n,void 0,r))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r){var n=this.values,i=n[r],o=this.toRespond?i===lf?--this.toRespond:this.toRespond:0;n[r]=t,0===o&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(tf);function ff(e,t){if(null!=e){if(function(e){return e&&"function"==typeof e[Oh]}(e))return function(e,t){return new Dh((function(r){var n=new Mh;return n.add(t.schedule((function(){var i=e[Oh]();n.add(i.subscribe({next:function(e){n.add(t.schedule((function(){return r.next(e)})))},error:function(e){n.add(t.schedule((function(){return r.error(e)})))},complete:function(){n.add(t.schedule((function(){return r.complete()})))}}))}))),n}))}(e,t);if(af(e))return function(e,t){return new Dh((function(r){var n=new Mh;return n.add(t.schedule((function(){return e.then((function(e){n.add(t.schedule((function(){r.next(e),n.add(t.schedule((function(){return r.complete()})))})))}),(function(e){n.add(t.schedule((function(){return r.error(e)})))}))}))),n}))}(e,t);if(sf(e))return fd(e,t);if(function(e){return e&&"function"==typeof e[of]}(e)||"string"==typeof e)return function(e,t){if(!e)throw new Error("Iterable cannot be null");return new Dh((function(r){var n,i=new Mh;return i.add((function(){n&&"function"==typeof n.return&&n.return()})),i.add(t.schedule((function(){n=e[of](),i.add(t.schedule((function(){if(!r.closed){var e,t;try{var i=n.next();e=i.value,t=i.done}catch(e){return void r.error(e)}t?r.complete():(r.next(e),this.schedule())}})))}))),i}))}(e,t)}throw new TypeError((null!==e&&typeof e||e)+" is not observable")}function pf(e,t){return t?ff(e,t):e instanceof Dh?e:new Dh(cf(e))}var bf=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,r}return r(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(Ah),yf=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(Ah);function gf(e,t){if(!t.closed){if(e instanceof Dh)return e.subscribe(t);var r;try{r=cf(e)(t)}catch(e){t.error(e)}return r}}function mf(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof t?function(n){return n.pipe(mf((function(r,n){return pf(e(r,n)).pipe($d((function(e,i){return t(r,e,n,i)})))}),r))}:("number"==typeof t&&(r=t),function(t){return t.lift(new vf(e,r))})}var vf=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new _f(e,this.project,this.concurrent))},e}(),_f=function(e){function t(t,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new bf(this),r=this.destination;r.add(t);var n=gf(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(yf),wf=mf;function Sf(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),mf(Th,e)}function Ef(){return Sf(1)}function xf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ef()(bd.apply(void 0,e))}function kf(e){return new Dh((function(t){var r;try{r=e()}catch(e){return void t.error(e)}return(r?pf(r):ud()).subscribe(t)}))}function Cf(e,t){return new Dh((function(r){var n=e.length;if(0!==n)for(var i=new Array(n),o=0,s=0,a=function(a){var c=pf(e[a]),u=!1;r.add(c.subscribe({next:function(e){u||(u=!0,s++),i[a]=e},error:function(e){return r.error(e)},complete:function(){++o!==n&&u||(s===n&&r.next(t?t.reduce((function(e,t,r){return e[t]=i[r],e}),{}):i),r.complete())}}))},c=0;c<n;c++)a(c);else r.complete()}))}function Mf(e,t,r,n,i){var o;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(e)){var s=e;e.addEventListener(t,r,i),o=function(){return s.removeEventListener(t,r,i)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(e)){var a=e;e.on(t,r),o=function(){return a.off(t,r)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(e)){var c=e;e.addListener(t,r),o=function(){return c.removeListener(t,r)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var u=0,l=e.length;u<l;u++)Mf(e[u],t,r,n,i)}n.add(o)}function If(e){var t=e.subscriber,r=e.condition;if(!t.closed){if(e.needIterate)try{e.state=e.iterate(e.state)}catch(e){return void t.error(e)}else e.needIterate=!0;if(r){var n=void 0;try{n=r(e.state)}catch(e){return void t.error(e)}if(!n)return void t.complete();if(t.closed)return}var i;try{i=e.resultSelector(e.state)}catch(e){return void t.error(e)}if(!t.closed&&(t.next(i),!t.closed))return this.schedule(e)}}function Rf(e){return!Eh(e)&&e-parseFloat(e)+1>=0}function Af(e){var t=e.subscriber,r=e.counter,n=e.period;t.next(r),this.schedule({subscriber:t,counter:r+1,period:n},n)}function Nf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Number.POSITIVE_INFINITY,n=null,i=e[e.length-1];return ld(i)?(n=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof i&&(r=e.pop()),null===n&&1===e.length&&e[0]instanceof Dh?e[0]:Sf(r)(pd(e,n))}var jf=new Dh(Wd);function Of(e){var t=e.keys,r=e.index,n=e.subscriber,i=e.subscription,o=e.obj;if(!n.closed)if(r<t.length){var s=t[r];n.next([s,o[s]]),i.add(this.schedule({keys:t,index:r+1,subscriber:n,subscription:i,obj:o}))}else n.complete()}function Tf(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}function Pf(e,t){return function(r){return r.lift(new Lf(e,t))}}var Lf=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Df(e,this.predicate,this.thisArg))},e}(),Df=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return r(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(Ah);function Bf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){if(!Eh(e[0]))return e[0];e=e[0]}return pd(e,void 0).lift(new Ff)}var Ff=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Uf(e))},e}(),Uf=function(e){function t(t){var r=e.call(this,t)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return r(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var r=0;r<t&&!this.hasFirst;r++){var n=uf(this,e[r],void 0,r);this.subscriptions&&this.subscriptions.push(n),this.add(n)}this.observables=null}},t.prototype.notifyNext=function(e,t,r){if(!this.hasFirst){this.hasFirst=!0;for(var n=0;n<this.subscriptions.length;n++)if(n!==r){var i=this.subscriptions[n];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(t)},t}(tf);function Vf(e){var t=e.start,r=e.index,n=e.count,i=e.subscriber;r>=n?i.complete():(i.next(t),i.closed||(e.index=r+1,e.start=t+1,this.schedule(e)))}function Hf(e,t,r){void 0===e&&(e=0);var n=-1;return Rf(t)?n=Number(t)<1?1:Number(t):ld(t)&&(r=t),ld(r)||(r=Ld),new Dh((function(t){var i=Rf(e)?e:+e-r.now();return r.schedule(Wf,i,{index:0,period:n,subscriber:t})}))}function Wf(e){var t=e.index,r=e.period,n=e.subscriber;if(n.next(t),!n.closed){if(-1===r)return n.complete();e.index=t+1,this.schedule(e,r)}}function zf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return"function"==typeof r&&e.pop(),pd(e,void 0).lift(new qf(r))}var qf=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new Jf(e,this.resultSelector))},e}(),Jf=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return r(t,e),t.prototype._next=function(e){var t=this.iterators;Eh(e)?t.push(new Gf(e)):"function"==typeof e[of]?t.push(new $f(e[of]())):t.push(new Zf(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0!==t){this.active=t;for(var r=0;r<t;r++){var n=e[r];if(n.stillUnsubscribed)this.destination.add(n.subscribe());else this.active--}}else this.destination.complete()},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,r=this.destination,n=0;n<t;n++){if("function"==typeof(s=e[n]).hasValue&&!s.hasValue())return}var i=!1,o=[];for(n=0;n<t;n++){var s,a=(s=e[n]).next();if(s.hasCompleted()&&(i=!0),a.done)return void r.complete();o.push(a.value)}this.resultSelector?this._tryresultSelector(o):r.next(o),i&&r.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(Ah),$f=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return Boolean(e&&e.done)},e}(),Gf=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[of]=function(){return this},e.prototype.next=function(e){var t=this.index++,r=this.array;return t<this.length?{value:r[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),Zf=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return r(t,e),t.prototype[of]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return gf(this.observable,new bf(this))},t}(yf),Qf=Object.freeze({__proto__:null,Observable:Dh,ConnectableObservable:$h,GroupedObservable:Xh,observable:Oh,Subject:Hh,BehaviorSubject:td,ReplaySubject:Sd,AsyncSubject:xd,asap:Td,asapScheduler:Od,async:Ld,asyncScheduler:Pd,queue:ad,queueScheduler:sd,animationFrame:Ud,animationFrameScheduler:Fd,VirtualTimeScheduler:Vd,VirtualAction:Hd,Scheduler:id,Subscription:Mh,Subscriber:Ah,Notification:md,get NotificationKind(){return hd},pipe:Ph,noop:Wd,identity:Th,isObservable:function(e){return!!e&&(e instanceof Dh||"function"==typeof e.lift&&"function"==typeof e.subscribe)},ArgumentOutOfRangeError:zd,EmptyError:qd,ObjectUnsubscribedError:Fh,UnsubscriptionError:Ch,TimeoutError:Jd,bindCallback:function e(t,r,n){if(r){if(!ld(r))return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return e(t,n).apply(void 0,i).pipe($d((function(e){return Eh(e)?r.apply(void 0,e):r(e)})))};n=r}return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i,o=this,s={context:o,subject:i,callbackFunc:t,scheduler:n};return new Dh((function(r){if(n){var a={args:e,subscriber:r,params:s};return n.schedule(Qd,0,a)}if(!i){i=new xd;try{t.apply(o,e.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.next(e.length<=1?e[0]:e),i.complete()}]))}catch(e){jh(i)?i.error(e):console.warn(e)}}return i.subscribe(r)}))}},bindNodeCallback:function e(t,r,n){if(r){if(!ld(r))return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return e(t,n).apply(void 0,i).pipe($d((function(e){return Eh(e)?r.apply(void 0,e):r(e)})))};n=r}return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i={subject:void 0,args:e,callbackFunc:t,scheduler:n,context:this};return new Dh((function(r){var o=i.context,s=i.subject;if(n)return n.schedule(Kd,0,{params:i,subscriber:r,context:o});if(!s){s=i.subject=new xd;try{t.apply(o,e.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.shift();r?s.error(r):(s.next(e.length<=1?e[0]:e),s.complete())}]))}catch(e){jh(s)?s.error(e):console.warn(e)}}return s.subscribe(r)}))}},combineLatest:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0,n=void 0;return ld(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&Eh(e[0])&&(e=e[0]),pd(e,n).lift(new hf(r))},concat:xf,defer:kf,empty:ud,forkJoin:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var r=e[0];if(Eh(r))return Cf(r,null);if(xh(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return Cf(n.map((function(e){return r[e]})),n)}}if("function"==typeof e[e.length-1]){var i=e.pop();return Cf(e=1===e.length&&Eh(e[0])?e[0]:e,null).pipe($d((function(e){return i.apply(void 0,e)})))}return Cf(e,null)},from:pf,fromEvent:function e(t,r,n,i){return mh(n)&&(i=n,n=void 0),i?e(t,r,n).pipe($d((function(e){return Eh(e)?i.apply(void 0,e):i(e)}))):new Dh((function(e){Mf(t,r,(function(t){arguments.length>1?e.next(Array.prototype.slice.call(arguments)):e.next(t)}),e,n)}))},fromEventPattern:function e(t,r,n){return n?e(t,r).pipe($d((function(e){return Eh(e)?n.apply(void 0,e):n(e)}))):new Dh((function(e){var n,i=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1===t.length?t[0]:t)};try{n=t(i)}catch(t){return void e.error(t)}if(mh(r))return function(){return r(i,n)}}))},generate:function(e,t,r,n,i){var o,s;if(1==arguments.length){var a=e;s=a.initialState,t=a.condition,r=a.iterate,o=a.resultSelector||Th,i=a.scheduler}else void 0===n||ld(n)?(s=e,o=Th,i=n):(s=e,o=n);return new Dh((function(e){var n=s;if(i)return i.schedule(If,0,{subscriber:e,iterate:r,condition:t,resultSelector:o,state:n});for(;;){if(t){var a=void 0;try{a=t(n)}catch(t){return void e.error(t)}if(!a){e.complete();break}}var c=void 0;try{c=o(n)}catch(t){return void e.error(t)}if(e.next(c),e.closed)break;try{n=r(n)}catch(t){return void e.error(t)}}}))},iif:function(e,t,r){return void 0===t&&(t=cd),void 0===r&&(r=cd),kf((function(){return e()?t:r}))},interval:function(e,t){return void 0===e&&(e=0),void 0===t&&(t=Ld),(!Rf(e)||e<0)&&(e=0),t&&"function"==typeof t.schedule||(t=Ld),new Dh((function(r){return r.add(t.schedule(Af,e,{subscriber:r,counter:0,period:e})),r}))},merge:Nf,never:function(){return jf},of:bd,onErrorResumeNext:function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(0===t.length)return cd;var n=t[0],i=t.slice(1);return 1===t.length&&Eh(n)?e.apply(void 0,n):new Dh((function(t){var r=function(){return t.add(e.apply(void 0,i).subscribe(t))};return pf(n).subscribe({next:function(e){t.next(e)},error:r,complete:r})}))},pairs:function(e,t){return new Dh(t?function(r){var n=Object.keys(e),i=new Mh;return i.add(t.schedule(Of,0,{keys:n,index:0,subscriber:r,subscription:i,obj:e})),i}:function(t){for(var r=Object.keys(e),n=0;n<r.length&&!t.closed;n++){var i=r[n];e.hasOwnProperty(i)&&t.next([i,e[i]])}t.complete()})},partition:function(e,t,r){return[Pf(t,r)(new Dh(cf(e))),Pf(Tf(t,r))(new Dh(cf(e)))]},race:Bf,range:function(e,t,r){return void 0===e&&(e=0),new Dh((function(n){void 0===t&&(t=e,e=0);var i=0,o=e;if(r)return r.schedule(Vf,0,{index:i,count:t,start:e,subscriber:n});for(;;){if(i++>=t){n.complete();break}if(n.next(o++),n.closed)break}}))},throwError:yd,timer:Hf,using:function(e,t){return new Dh((function(r){var n,i;try{n=e()}catch(e){return void r.error(e)}try{i=t(n)}catch(e){return void r.error(e)}var o=(i?pf(i):cd).subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}}))},zip:zf,scheduled:ff,EMPTY:cd,NEVER:jf,config:_h}),Yf=t(Qf),Kf={};function Xf(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Xf(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function ep(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Xf(e))&&(n&&(n+=" "),n+=t);return n}var tp,rp,np,ip,op=t(Object.freeze({__proto__:null,clsx:ep,default:ep})),sp=0,ap=[],cp=[],up=jl.__b,lp=jl.__r,hp=jl.diffed,dp=jl.__c,fp=jl.unmount;function pp(e,t){jl.__h&&jl.__h(rp,e,sp||t),sp=0;var r=rp.__H||(rp.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:cp}),r.__[e]}function bp(e){return sp=1,yp(kp,e)}function yp(e,t,r){var n=pp(tp++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):kp(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=rp,!rp.u)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};rp.u=!0;var o=rp.shouldComponentUpdate,s=rp.componentWillUpdate;rp.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,i(e,t,r),o=n}s&&s.call(this,e,t,r)},rp.shouldComponentUpdate=i}return n.__N||n.__}function gp(e,t){var r=pp(tp++,4);!jl.__s&&xp(r.__H,t)&&(r.__=e,r.i=t,rp.__h.push(r))}function mp(e,t){var r=pp(tp++,7);return xp(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function vp(){for(var e;e=ap.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Sp),e.__H.__h.forEach(Ep),e.__H.__h=[]}catch(t){e.__H.__h=[],jl.__e(t,e.__v)}}jl.__b=function(e){rp=null,up&&up(e)},jl.__r=function(e){lp&&lp(e),tp=0;var t=(rp=e.__c).__H;t&&(np===rp?(t.__h=[],rp.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=cp,e.__N=e.i=void 0}))):(t.__h.forEach(Sp),t.__h.forEach(Ep),t.__h=[])),np=rp},jl.diffed=function(e){hp&&hp(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ap.push(t)&&ip===jl.requestAnimationFrame||((ip=jl.requestAnimationFrame)||wp)(vp)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==cp&&(e.__=e.__V),e.i=void 0,e.__V=cp}))),np=rp=null},jl.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Sp),e.__h=e.__h.filter((function(e){return!e.__||Ep(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],jl.__e(r,e.__v)}})),dp&&dp(e,t)},jl.unmount=function(e){fp&&fp(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{Sp(e)}catch(e){t=e}})),r.__H=void 0,t&&jl.__e(t,r.__v))};var _p="function"==typeof requestAnimationFrame;function wp(e){var t,r=function(){clearTimeout(n),_p&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);_p&&(t=requestAnimationFrame(r))}function Sp(e){var t=rp,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),rp=t}function Ep(e){var t=rp;e.__c=e.__(),rp=t}function xp(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function kp(e,t){return"function"==typeof t?t(e):t}var Cp=Object.freeze({__proto__:null,useCallback:function(e,t){return sp=8,mp((function(){return e}),t)},useContext:function(e){var t=rp.context[e.__c],r=pp(tp++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(rp)),t.props.value):e.__},useDebugValue:function(e,t){jl.useDebugValue&&jl.useDebugValue(t?t(e):e)},useEffect:function(e,t){var r=pp(tp++,3);!jl.__s&&xp(r.__H,t)&&(r.__=e,r.i=t,rp.__H.__h.push(r))},useErrorBoundary:function(e){var t=pp(tp++,10),r=bp();return t.__=e,rp.componentDidCatch||(rp.componentDidCatch=function(e,n){t.__&&t.__(e,n),r[1](e)}),[r[0],function(){r[1](void 0)}]},useId:function(){var e=pp(tp++,11);if(!e.__){for(var t=rp.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__},useImperativeHandle:function(e,t,r){sp=6,gp((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==r?r:r.concat(e))},useLayoutEffect:gp,useMemo:mp,useReducer:yp,useRef:function(e){return sp=5,mp((function(){return{current:e}}),[])},useState:bp}),Mp=t(Cp),Ip={},Rp={};Object.defineProperty(Rp,"__esModule",{value:!0}),Rp.LIB_VERSION=void 0,Rp.LIB_VERSION="3.6.6";var Ap={};Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.CloseIcon=void 0;const Np=gh;Ap.CloseIcon=function(e){return(0,Np.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Np.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))};var jp={};Object.defineProperty(jp,"__esModule",{value:!0}),jp.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var Op={};Object.defineProperty(Op,"__esModule",{value:!0}),Op.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Tp={};Object.defineProperty(Tp,"__esModule",{value:!0}),Tp.QRCodeIcon=void 0;const Pp=gh;Tp.QRCodeIcon=function(e){return(0,Pp.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,Pp.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Pp.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,Pp.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Pp.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,Pp.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Pp.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,Pp.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Pp.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Pp.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))};var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.default='\n <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>\n <path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>\n <path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>\n </svg>\n';var Dp={};Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.default='\n <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">\n <circle cx="50" cy="50" r="50" fill="white"/>\n <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>\n <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>\n </svg>\n';var Bp={};Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.StatusDotIcon=void 0;const Fp=gh;Bp.StatusDotIcon=function(e){return(0,Fp.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,Fp.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))};var Up={};function Vp(e){this.mode=Wp.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(1835008&i)>>>18,n[1]=128|(258048&i)>>>12,n[2]=128|(4032&i)>>>6,n[3]=128|63&i):i>2048?(n[0]=224|(61440&i)>>>12,n[1]=128|(4032&i)>>>6,n[2]=128|63&i):i>128?(n[0]=192|(1984&i)>>>6,n[1]=128|63&i):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function Hp(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Vp.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}},Hp.prototype={addData:function(e){var t=new Vp(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=Hp.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(this.modules[e+r][t+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=rb.getLostPoint(this);(0==r||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r);this.make();for(var i=0;i<this.modules.length;i++)for(var o=1*i,s=0;s<this.modules[i].length;s++){var a=1*s;this.modules[i][s]&&(n.beginFill(0,100),n.moveTo(a,o),n.lineTo(a+1,o),n.lineTo(a+1,o+1),n.lineTo(a,o+1),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=rb.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(null==this.modules[n][i])for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)this.modules[n+o][i+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},setupTypeNumber:function(e){for(var t=rb.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&1==(t>>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(r=0;r<18;r++){n=!e&&1==(t>>r&1);this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=rb.getBCHTypeInfo(r),i=0;i<15;i++){var o=!e&&1==(n>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++){o=!e&&1==(n>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var a=0;a<2;a++)if(null==this.modules[n][s-a]){var c=!1;o<e.length&&(c=1==(e[o]>>>i&1)),rb.getMask(t,n,s-a)&&(c=!c),this.modules[n][s-a]=c,-1==--i&&(o++,i=7)}if((n+=r)<0||this.moduleCount<=n){n-=r,r=-r;break}}}},Hp.PAD0=236,Hp.PAD1=17,Hp.createData=function(e,t,r){for(var n=sb.getRSBlocks(e,t),i=new ab,o=0;o<r.length;o++){var s=r[o];i.put(s.mode,4),i.put(s.getLength(),rb.getLengthInBits(s.mode,e)),s.write(i)}var a=0;for(o=0;o<n.length;o++)a+=n[o].dataCount;if(i.getLengthInBits()>8*a)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*a+")");for(i.getLengthInBits()+4<=8*a&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*a||(i.put(Hp.PAD0,8),i.getLengthInBits()>=8*a));)i.put(Hp.PAD1,8);return Hp.createBytes(i,n)},Hp.createBytes=function(e,t){for(var r=0,n=0,i=0,o=new Array(t.length),s=new Array(t.length),a=0;a<t.length;a++){var c=t[a].dataCount,u=t[a].totalCount-c;n=Math.max(n,c),i=Math.max(i,u),o[a]=new Array(c);for(var l=0;l<o[a].length;l++)o[a][l]=255&e.buffer[l+r];r+=c;var h=rb.getErrorCorrectPolynomial(u),d=new ob(o[a],h.getLength()-1).mod(h);s[a]=new Array(h.getLength()-1);for(l=0;l<s[a].length;l++){var f=l+d.getLength()-s[a].length;s[a][l]=f>=0?d.get(f):0}}var p=0;for(l=0;l<t.length;l++)p+=t[l].totalCount;var b=new Array(p),y=0;for(l=0;l<n;l++)for(a=0;a<t.length;a++)l<o[a].length&&(b[y++]=o[a][l]);for(l=0;l<i;l++)for(a=0;a<t.length;a++)l<s[a].length&&(b[y++]=s[a][l]);return b};for(var Wp={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},zp=1,qp=0,Jp=3,$p=2,Gp=0,Zp=1,Qp=2,Yp=3,Kp=4,Xp=5,eb=6,tb=7,rb={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;rb.getBCHDigit(t)-rb.getBCHDigit(rb.G15)>=0;)t^=rb.G15<<rb.getBCHDigit(t)-rb.getBCHDigit(rb.G15);return(e<<10|t)^rb.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;rb.getBCHDigit(t)-rb.getBCHDigit(rb.G18)>=0;)t^=rb.G18<<rb.getBCHDigit(t)-rb.getBCHDigit(rb.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return rb.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Gp:return(t+r)%2==0;case Zp:return t%2==0;case Qp:return r%3==0;case Yp:return(t+r)%3==0;case Kp:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Xp:return t*r%2+t*r%3==0;case eb:return(t*r%2+t*r%3)%2==0;case tb:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new ob([1],0),r=0;r<e;r++)t=t.multiply(new ob([1,nb.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case Wp.MODE_NUMBER:return 10;case Wp.MODE_ALPHA_NUM:return 9;case Wp.MODE_8BIT_BYTE:case Wp.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case Wp.MODE_NUMBER:return 12;case Wp.MODE_ALPHA_NUM:return 11;case Wp.MODE_8BIT_BYTE:return 16;case Wp.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case Wp.MODE_NUMBER:return 14;case Wp.MODE_ALPHA_NUM:return 13;case Wp.MODE_8BIT_BYTE:return 16;case Wp.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var o=0,s=e.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var c=-1;c<=1;c++)i+c<0||t<=i+c||0==a&&0==c||s==e.isDark(n+a,i+c)&&o++;o>5&&(r+=3+o-5)}for(n=0;n<t-1;n++)for(i=0;i<t-1;i++){var u=0;e.isDark(n,i)&&u++,e.isDark(n+1,i)&&u++,e.isDark(n,i+1)&&u++,e.isDark(n+1,i+1)&&u++,0!=u&&4!=u||(r+=3)}for(n=0;n<t;n++)for(i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(i=0;i<t;i++)for(n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);var l=0;for(i=0;i<t;i++)for(n=0;n<t;n++)e.isDark(n,i)&&l++;return r+=10*(Math.abs(100*l/t/t-50)/5)}},nb={glog:function(e){if(e<1)throw new Error("glog("+e+")");return nb.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return nb.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},ib=0;ib<8;ib++)nb.EXP_TABLE[ib]=1<<ib;for(ib=8;ib<256;ib++)nb.EXP_TABLE[ib]=nb.EXP_TABLE[ib-4]^nb.EXP_TABLE[ib-5]^nb.EXP_TABLE[ib-6]^nb.EXP_TABLE[ib-8];for(ib=0;ib<255;ib++)nb.LOG_TABLE[nb.EXP_TABLE[ib]]=ib;function ob(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&0==e[r];)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}function sb(e,t){this.totalCount=e,this.dataCount=t}function ab(){this.buffer=[],this.length=0}ob.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=nb.gexp(nb.glog(this.get(r))+nb.glog(e.get(n)));return new ob(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=nb.glog(this.get(0))-nb.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(n=0;n<e.getLength();n++)r[n]^=nb.gexp(nb.glog(e.get(n))+t);return new ob(r,0).mod(e)}},sb.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],sb.getRSBlocks=function(e,t){var r=sb.getRsBlockTable(e,t);if(null==r)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],o=0;o<n;o++)for(var s=r[3*o+0],a=r[3*o+1],c=r[3*o+2],u=0;u<s;u++)i.push(new sb(a,c));return i},sb.getRsBlockTable=function(e,t){switch(t){case zp:return sb.RS_BLOCK_TABLE[4*(e-1)+0];case qp:return sb.RS_BLOCK_TABLE[4*(e-1)+1];case Jp:return sb.RS_BLOCK_TABLE[4*(e-1)+2];case $p:return sb.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},ab.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var cb=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function ub(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},"string"==typeof e&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if("string"!=typeof this.options.content)throw new Error("Expected 'content' as string!");if(0===this.options.content.length)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0&&this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");var r=this.options.content,n=function(e,t){for(var r=function(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}(e),n=1,i=0,o=0,s=cb.length;o<=s;o++){var a=cb[o];if(!a)throw new Error("Content too long: expected "+i+" but got "+r);switch(t){case"L":i=a[0];break;case"M":i=a[1];break;case"Q":i=a[2];break;case"H":i=a[3];break;default:throw new Error("Unknwon error correction level: "+t)}if(r<=i)break;n++}if(n>cb.length)throw new Error("Content too long");return n}(r,this.options.ecl),i=function(e){switch(e){case"L":return zp;case"M":return qp;case"Q":return Jp;case"H":return $p;default:throw new Error("Unknwon error correction level: "+e)}}(this.options.ecl);this.qrcode=new Hp(n,i),this.qrcode.addData(r),this.qrcode.make()}ub.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;void 0===e&&(e={container:t.container||"svg"});for(var n=void 0===t.pretty||!!t.pretty,i=n?" ":"",o=n?"\r\n":"",s=t.width,a=t.height,c=r.length,u=s/(c+2*t.padding),l=a/(c+2*t.padding),h=void 0!==t.join&&!!t.join,d=void 0!==t.swap&&!!t.swap,f=void 0===t.xmlDeclaration||!!t.xmlDeclaration,p=void 0!==t.predefined&&!!t.predefined,b=p?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+u+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+o:"",y=i+'<rect x="0" y="0" width="'+s+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+o,g="",m="",v=0;v<c;v++)for(var _=0;_<c;_++){if(r[_][v]){var w=_*u+t.padding*u,S=v*l+t.padding*l;if(d){var E=w;w=S,S=E}if(h){var x=u+w,k=l+S;w=Number.isInteger(w)?Number(w):w.toFixed(2),S=Number.isInteger(S)?Number(S):S.toFixed(2),x=Number.isInteger(x)?Number(x):x.toFixed(2),m+="M"+w+","+S+" V"+(k=Number.isInteger(k)?Number(k):k.toFixed(2))+" H"+x+" V"+S+" H"+w+" Z "}else g+=p?i+'<use x="'+w.toString()+'" y="'+S.toString()+'" href="#qrmodule" />'+o:i+'<rect x="'+w.toString()+'" y="'+S.toString()+'" width="'+u+'" height="'+l+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+o}}h&&(g=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+m+'" />');let C="";if(void 0!==this.options.image&&this.options.image.svg){const e=s*this.options.image.width/100,t=a*this.options.image.height/100;C+=`<svg x="${s/2-e/2}" y="${a/2-t/2}" width="${e}" height="${t}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,C+=this.options.image.svg+o,C+="</svg>"}var M="";switch(e.container){case"svg":f&&(M+='<?xml version="1.0" standalone="yes"?>'+o),M+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+s+'" height="'+a+'">'+o,M+=b+y+g,M+=C,M+="</svg>";break;case"svg-viewbox":f&&(M+='<?xml version="1.0" standalone="yes"?>'+o),M+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+s+" "+a+'">'+o,M+=b+y+g,M+=C,M+="</svg>";break;case"g":M+='<g width="'+s+'" height="'+a+'">'+o,M+=b+y+g,M+=C,M+="</g>";break;default:M+=(b+y+g+C).replace(/^\s+/,"")}return M};var lb=ub,hb=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Up,"__esModule",{value:!0}),Up.QRCode=void 0;const db=gh,fb=Mp,pb=hb(lb);Up.QRCode=e=>{const[t,r]=(0,fb.useState)("");return(0,fb.useEffect)((()=>{var t,n;const i=new pb.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(t=e.width)&&void 0!==t?t:256,height:null!==(n=e.height)&&void 0!==n?n:256,padding:0,image:e.image}),o=Buffer.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)})),t?(0,db.h)("img",{src:t,alt:"QR Code"}):null};var bb={},yb={};Object.defineProperty(yb,"__esModule",{value:!0}),yb.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var gb=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bb,"__esModule",{value:!0}),bb.Spinner=void 0;const mb=gh,vb=gb(yb);bb.Spinner=e=>{var t;const r=null!==(t=e.size)&&void 0!==t?t:64,n=e.color||"#000";return(0,mb.h)("div",{class:"-cbwsdk-spinner"},(0,mb.h)("style",null,vb.default),(0,mb.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,mb.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};var _b={};Object.defineProperty(_b,"__esModule",{value:!0}),_b.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var wb=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ip,"__esModule",{value:!0}),Ip.CoinbaseAppSteps=Ip.CoinbaseWalletSteps=Ip.ConnectItem=Ip.ConnectContent=void 0;const Sb=wb(op),Eb=gh,xb=Mp,kb=ft,Cb=Rp,Mb=Ap,Ib=wb(jp),Rb=wb(Op),Ab=Tp,Nb=wb(Lp),jb=wb(Dp),Ob=Bp,Tb=Up,Pb=bb,Lb=wb(_b),Db={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:Rb.default,steps:Ub},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:Ib.default,steps:Vb}},Bb=e=>"light"===e?"#FFFFFF":"#0A0B0D";function Fb({title:e,description:t,icon:r,selected:n,theme:i,onClick:o}){return(0,Eb.h)("div",{onClick:o,class:(0,Sb.default)("-cbwsdk-connect-item",i,{selected:n})},(0,Eb.h)("div",null,(0,Eb.h)("img",{src:r,alt:e})),(0,Eb.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,Eb.h)("h3",{class:"-cbwsdk-connect-item-title"},e),(0,Eb.h)("p",{class:"-cbwsdk-connect-item-description"},t)))}function Ub({theme:e}){return(0,Eb.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,Eb.h)("li",{class:(0,Sb.default)("-cbwsdk-wallet-steps-item",e)},(0,Eb.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,Eb.h)("li",{class:(0,Sb.default)("-cbwsdk-wallet-steps-item",e)},(0,Eb.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,Eb.h)("span",null,"Tap ",(0,Eb.h)("strong",null,"Scan")," "),(0,Eb.h)("span",{class:(0,Sb.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,Eb.h)(Ab.QRCodeIcon,{fill:Bb(e)})))))}function Vb({theme:e}){return(0,Eb.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,Eb.h)("li",{class:(0,Sb.default)("-cbwsdk-wallet-steps-item",e)},(0,Eb.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,Eb.h)("li",{class:(0,Sb.default)("-cbwsdk-wallet-steps-item",e)},(0,Eb.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,Eb.h)("span",null,"Tap ",(0,Eb.h)("strong",null,"More")),(0,Eb.h)("span",{class:(0,Sb.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,Eb.h)(Ob.StatusDotIcon,{fill:Bb(e)})),(0,Eb.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,Eb.h)("strong",null,"Scan")),(0,Eb.h)("span",{class:(0,Sb.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,Eb.h)(Ab.QRCodeIcon,{fill:Bb(e)})))))}Ip.ConnectContent=function(e){const{theme:t}=e,[r,n]=(0,xb.useState)("coinbase-wallet-app"),i=(0,xb.useCallback)((e=>{n(e)}),[]),o=(0,kb.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId);if(!r)return null;const s=Db[r].steps,a="coinbase-app"===r;return(0,Eb.h)("div",{"data-testid":"connect-content",class:(0,Sb.default)("-cbwsdk-connect-content",t)},(0,Eb.h)("style",null,Lb.default),(0,Eb.h)("div",{class:"-cbwsdk-connect-content-header"},(0,Eb.h)("h2",{class:(0,Sb.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with one of our mobile apps"),e.onCancel&&(0,Eb.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,Eb.h)(Mb.CloseIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,Eb.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,Eb.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,Eb.h)("div",null,Object.entries(Db).map((([e,n])=>(0,Eb.h)(Fb,{key:e,title:n.title,description:n.description,icon:n.icon,selected:r===e,onClick:()=>i(e),theme:t})))),a&&(0,Eb.h)("div",{class:(0,Sb.default)("-cbwsdk-connect-content-update-app",t)},"Don’t see a ",(0,Eb.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,Eb.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,Eb.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,Eb.h)(Tb.QRCode,{content:o,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:(c=r,"coinbase-app"===c?Nb.default:jb.default),width:25,height:25}}),(0,Eb.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Cb.LIB_VERSION}),(0,Eb.h)("input",{type:"hidden",value:o})),(0,Eb.h)(s,{theme:t}),!e.isConnected&&(0,Eb.h)("div",{"data-testid":"connecting-spinner",class:(0,Sb.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,Eb.h)(Pb.Spinner,{size:36,color:"dark"===t?"#FFF":"#000"}),(0,Eb.h)("p",null,"Connecting...")))));var c},Ip.ConnectItem=Fb,Ip.CoinbaseWalletSteps=Ub,Ip.CoinbaseAppSteps=Vb;var Hb={},Wb={};Object.defineProperty(Wb,"__esModule",{value:!0}),Wb.ArrowLeftIcon=void 0;const zb=gh;Wb.ArrowLeftIcon=function(e){return(0,zb.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,zb.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))};var qb={};Object.defineProperty(qb,"__esModule",{value:!0}),qb.LaptopIcon=void 0;const Jb=gh;qb.LaptopIcon=function(e){return(0,Jb.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Jb.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Jb.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))};var $b={};Object.defineProperty($b,"__esModule",{value:!0}),$b.SafeIcon=void 0;const Gb=gh;$b.SafeIcon=function(e){return(0,Gb.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Gb.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))};var Zb={};Object.defineProperty(Zb,"__esModule",{value:!0}),Zb.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Qb=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hb,"__esModule",{value:!0}),Hb.TryExtensionContent=void 0;const Yb=Qb(op),Kb=gh,Xb=Mp,ey=Wb,ty=qb,ry=$b,ny=Qb(Zb);Hb.TryExtensionContent=function({theme:e}){const[t,r]=(0,Xb.useState)(!1),n=(0,Xb.useCallback)((()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}),[]),i=(0,Xb.useCallback)((()=>{t?window.location.reload():(n(),r(!0))}),[n,t]);return(0,Kb.h)("div",{class:(0,Yb.default)("-cbwsdk-try-extension",e)},(0,Kb.h)("style",null,ny.default),(0,Kb.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Kb.h)("h3",{class:(0,Yb.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Kb.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Kb.h)("button",{class:(0,Yb.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Kb.h)("div",null,!t&&(0,Kb.h)(ey.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===e?"#0052FF":"#588AF5"})))),(0,Kb.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Kb.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Kb.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Kb.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Kb.h)("span",{class:(0,Yb.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Kb.h)(ty.LaptopIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,Kb.h)("div",{class:(0,Yb.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Kb.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Kb.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Kb.h)("span",{class:(0,Yb.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Kb.h)(ry.SafeIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,Kb.h)("div",{class:(0,Yb.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))};var iy={};Object.defineProperty(iy,"__esModule",{value:!0}),iy.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var oy=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.ConnectDialog=void 0;const sy=oy(op),ay=gh,cy=Mp,uy=Ip,ly=Hb,hy=oy(iy);Kf.ConnectDialog=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,cy.useState)(!t),[o,s]=(0,cy.useState)(!t);(0,cy.useEffect)((()=>{const e=[window.setTimeout((()=>{s(!t)}),10)];return t?i(!1):e.push(window.setTimeout((()=>{i(!0)}),360)),()=>{e.forEach(window.clearTimeout)}}),[e.isOpen]);const a=r?"dark":"light";return(0,ay.h)("div",{class:(0,sy.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,ay.h)("style",null,hy.default),(0,ay.h)("div",{class:(0,sy.default)("-cbwsdk-connect-dialog-backdrop",a,o&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,ay.h)("div",{class:"-cbwsdk-connect-dialog"},(0,ay.h)("div",{class:(0,sy.default)("-cbwsdk-connect-dialog-box",o&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,ay.h)(uy.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,ay.h)(ly.TryExtensionContent,{theme:a}))))},Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.LinkFlow=void 0;const dy=gh,fy=Yf,py=Kf;Vl.LinkFlow=class{constructor(e){this.extensionUI$=new fy.BehaviorSubject({}),this.subscriptions=new fy.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((e=>{this.isConnected!==e&&(this.isConnected=e,this.render())}))),this.subscriptions.add(this.chainId$.subscribe((e=>{this.chainId!==e&&(this.chainId=e,this.render())})))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,dy.render)(null,this.root),null===(e=this.root.parentElement)||void 0===e||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe((()=>{this.root&&(0,dy.render)((0,dy.h)(py.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}));this.subscriptions.add(e)}};var by={},yy={};Object.defineProperty(yy,"__esModule",{value:!0}),yy.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",function(t){var r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const n=r(op),i=gh,o=Mp,s=r(yy);function a(e){return"coinbase-app"===e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}t.Snackbar=class{constructor(e){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=e.darkMode}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){const t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,i.render)((0,i.h)("div",null,(0,i.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((([e,r])=>(0,i.h)(t.SnackbarInstance,Object.assign({},r,{key:e})))))),this.root)}};t.SnackbarContainer=e=>(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,i.h)("style",null,s.default),(0,i.h)("div",{class:"-cbwsdk-snackbar"},e.children));t.SnackbarInstance=({autoExpand:e,message:t,menuItems:r,appSrc:s})=>{const[c,u]=(0,o.useState)(!0),[l,h]=(0,o.useState)(null!=e&&e);(0,o.useEffect)((()=>{const e=[window.setTimeout((()=>{u(!1)}),1),window.setTimeout((()=>{h(!0)}),1e4)];return()=>{e.forEach(window.clearTimeout)}}));return(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",c&&"-cbwsdk-snackbar-instance-hidden",l&&"-cbwsdk-snackbar-instance-expanded")},(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{h(!l)}},(0,i.h)("img",{src:a(s),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,i.h)("div",{class:"-gear-container"},!l&&(0,i.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,i.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map(((e,t)=>(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,i.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,i.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info))))))}}(by);var gy={},my={};Object.defineProperty(my,"__esModule",{value:!0}),my.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var vy=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gy,"__esModule",{value:!0}),gy.injectCssReset=void 0;const _y=vy(my);gy.injectCssReset=function(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(_y.default)),document.documentElement.appendChild(e)},Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.WalletSDKUI=void 0;const wy=Vl,Sy=by,Ey=gy;Ul.WalletSDKUI=class{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new Sy.Snackbar({darkMode:e.darkMode}),this.linkFlow=new wy.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.linkFlow.attach(t),this.snackbar.attach(t),this.attached=!0,(0,Ey.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:{message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return null!==(e=this.standalone)&&void 0!==e&&e}};var xy,ky={},Cy={};function My(e,t,r){if(!r||typeof r.value!==xy.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+t+"> is not a method!");return{configurable:xy.boolTrue,get:function(){var e=r.value.bind(this);return Object.defineProperty(this,t,{value:e,configurable:xy.boolTrue,writable:xy.boolTrue}),e}}}function Iy(e){return function(t){return t.lift(new Ry(e))}}Object.defineProperty(Cy,"__esModule",{value:!0}),function(e){e.typeOfFunction="function",e.boolTrue=!0}(xy||(xy={})),Cy.bind=My,Cy.default=My;var Ry=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new Ay(e,this.durationSelector))},e}(),Ay=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return r(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var r=gf(t,new bf(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},t.prototype.clearThrottle=function(){var e=this,t=e.value,r=e.hasValue,n=e.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),r&&(this.value=void 0,this.hasValue=!1,this.destination.next(t))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(yf);var Ny=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new jy(e,this.closingNotifier))},e}(),jy=function(e){function t(t,r){var n=e.call(this,t)||this;return n.buffer=[],n.add(gf(r,new bf(n))),n}return r(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(yf);var Oy=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,this.subscriberClass=t&&e!==t?Py:Ty}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),Ty=function(e){function t(t,r){var n=e.call(this,t)||this;return n.bufferSize=r,n.buffer=[],n}return r(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(Ah),Py=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.bufferSize=r,i.startBufferEvery=n,i.buffers=[],i.count=0,i}return r(t,e),t.prototype._next=function(e){var t=this,r=t.bufferSize,n=t.startBufferEvery,i=t.buffers,o=t.count;this.count++,o%n==0&&i.push([]);for(var s=i.length;s--;){var a=i[s];a.push(e),a.length===r&&(i.splice(s,1),this.destination.next(a))}},t.prototype._complete=function(){for(var t=this.buffers,r=this.destination;t.length>0;){var n=t.shift();n.length>0&&r.next(n)}e.prototype._complete.call(this)},t}(Ah);var Ly=function(){function e(e,t,r,n){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new By(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),Dy=function(){return function(){this.buffer=[]}}(),By=function(e){function t(t,r,n,i,o){var s=e.call(this,t)||this;s.bufferTimeSpan=r,s.bufferCreationInterval=n,s.maxBufferSize=i,s.scheduler=o,s.contexts=[];var a=s.openContext();if(s.timespanOnly=null==n||n<0,s.timespanOnly){var c={subscriber:s,context:a,bufferTimeSpan:r};s.add(a.closeAction=o.schedule(Fy,r,c))}else{var u={subscriber:s,context:a},l={bufferTimeSpan:r,bufferCreationInterval:n,subscriber:s,scheduler:o};s.add(a.closeAction=o.schedule(Vy,r,u)),s.add(o.schedule(Uy,n,l))}return s}return r(t,e),t.prototype._next=function(e){for(var t,r=this.contexts,n=r.length,i=0;i<n;i++){var o=r[i],s=o.buffer;s.push(e),s.length==this.maxBufferSize&&(t=o)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,r=this.destination;t.length>0;){var n=t.shift();r.next(n.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var r=this.bufferTimeSpan,n={subscriber:this,context:e,bufferTimeSpan:r};this.add(e.closeAction=this.scheduler.schedule(Fy,r,n))}},t.prototype.openContext=function(){var e=new Dy;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(Ah);function Fy(e){var t=e.subscriber,r=e.context;r&&t.closeContext(r),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function Uy(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openContext();n.closed||(n.add(o.closeAction=i.schedule(Vy,r,{subscriber:n,context:o})),this.schedule(e,t))}function Vy(e){var t=e.subscriber,r=e.context;t.closeContext(r)}var Hy=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new Wy(e,this.openings,this.closingSelector))},e}(),Wy=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.closingSelector=n,i.contexts=[],i.add(uf(i,r)),i}return r(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,n=0;n<r;n++)t[n].buffer.push(e)},t.prototype._error=function(t){for(var r=this.contexts;r.length>0;){var n=r.shift();n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var r=t.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var r=e.buffer,n=e.subscription;this.destination.next(r),t.splice(t.indexOf(e),1),this.remove(n),n.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,r=new Mh,n={buffer:[],subscription:r};t.push(n);var i=uf(this,e,n);!i||i.closed?this.closeBuffer(n):(i.context=n,this.add(i),r.add(i))},t}(tf);var zy=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new qy(e,this.closingSelector))},e}(),qy=function(e){function t(t,r){var n=e.call(this,t)||this;return n.closingSelector=r,n.subscribing=!1,n.openBuffer(),n}return r(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e=this.closingSubscription;e&&(this.remove(e),e.unsubscribe());var t,r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{t=(0,this.closingSelector)()}catch(e){return this.error(e)}e=new Mh,this.closingSubscription=e,this.add(e),this.subscribing=!0,e.add(gf(t,new bf(this))),this.subscribing=!1},t}(yf);var Jy=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new $y(e,this.selector,this.caught))},e}(),$y=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.selector=r,i.caught=n,i}return r(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle();var n=new bf(this);this.add(n);var i=gf(r,n);i!==n&&this.add(i)}},t}(yf);function Gy(e,t){return mf(e,t,1)}var Zy=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new Qy(e,this.predicate,this.source))},e}(),Qy=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.count=0,i.index=0,i}return r(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){return void this.destination.error(e)}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(Ah);var Yy=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new Ky(e,this.durationSelector))},e}(),Ky=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return r(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var r=this.durationSubscription;this.value=e,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=gf(t,new bf(this)))&&!r.closed&&this.add(this.durationSubscription=r)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(yf);var Xy=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new eg(e,this.dueTime,this.scheduler))},e}(),eg=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.dueTime=r,i.scheduler=n,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return r(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(tg,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(Ah);function tg(e){e.debouncedNext()}function rg(e){return void 0===e&&(e=null),function(t){return t.lift(new ng(e))}}var ng=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new ig(e,this.defaultValue))},e}(),ig=function(e){function t(t,r){var n=e.call(this,t)||this;return n.defaultValue=r,n.isEmpty=!0,n}return r(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(Ah);function og(e){return e instanceof Date&&!isNaN(+e)}var sg=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new ag(e,this.delay,this.scheduler))},e}(),ag=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.delay=r,i.scheduler=n,i.queue=[],i.active=!1,i.errored=!1,i}return r(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,n=e.scheduler,i=e.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,r=new cg(t.now()+this.delay,e);this.queue.push(r),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(md.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(md.createComplete()),this.unsubscribe()},t}(Ah),cg=function(){return function(e,t){this.time=e,this.notification=t}}();var ug=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new lg(e,this.delayDurationSelector))},e}(),lg=function(e){function t(t,r){var n=e.call(this,t)||this;return n.delayDurationSelector=r,n.completed=!1,n.delayNotifierSubscriptions=[],n.index=0,n}return r(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(e),this.removeSubscription(i),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){var t=this.index++;try{var r=this.delayDurationSelector(e,t);r&&this.tryDelay(r,e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return-1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var r=uf(this,e,t);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(tf),hg=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subscriptionDelay=r,n}return r(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new dg(e,this.source))},t}(Dh),dg=function(e){function t(t,r){var n=e.call(this)||this;return n.parent=t,n.source=r,n.sourceSubscribed=!1,n}return r(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(Ah);var fg=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new pg(e))},e}(),pg=function(e){function t(t){return e.call(this,t)||this}return r(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(Ah);var bg=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new yg(e,this.keySelector,this.flushes))},e}(),yg=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=r,i.values=new Set,n&&i.add(gf(n,new bf(i))),i}return r(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,r=this.destination;try{t=this.keySelector(e)}catch(e){return void r.error(e)}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var r=this.values;r.has(e)||(r.add(e),this.destination.next(t))},t}(yf);function gg(e,t){return function(r){return r.lift(new mg(e,t))}}var mg=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new vg(e,this.compare,this.keySelector))},e}(),vg=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=n,i.hasKey=!1,"function"==typeof r&&(i.compare=r),i}return r(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t;try{var r=this.keySelector;t=r?r(e):e}catch(e){return this.destination.error(e)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))},t}(Ah);function _g(e){return void 0===e&&(e=Eg),function(t){return t.lift(new wg(e))}}var wg=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new Sg(e,this.errorFactory))},e}(),Sg=function(e){function t(t,r){var n=e.call(this,t)||this;return n.errorFactory=r,n.hasValue=!1,n}return r(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(Ah);function Eg(){return new qd}function xg(e){return function(t){return 0===e?ud():t.lift(new kg(e))}}var kg=function(){function e(e){if(this.total=e,this.total<0)throw new zd}return e.prototype.call=function(e,t){return t.subscribe(new Cg(e,this.total))},e}(),Cg=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return r(t,e),t.prototype._next=function(e){var t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))},t}(Ah);var Mg=function(){function e(e,t,r){this.predicate=e,this.thisArg=t,this.source=r}return e.prototype.call=function(e,t){return t.subscribe(new Ig(e,this.predicate,this.thisArg,this.source))},e}(),Ig=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.predicate=r,o.thisArg=n,o.source=i,o.index=0,o.thisArg=n||o,o}return r(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){return void this.destination.error(e)}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(Ah);var Rg=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Ag(e))},e}(),Ag=function(e){function t(t){var r=e.call(this,t)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return r(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(gf(e,new bf(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(yf);var Ng=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new jg(e,this.project))},e}(),jg=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.hasSubscription=!1,n.hasCompleted=!1,n.index=0,n}return r(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this.hasSubscription=!0,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new bf(this),r=this.destination;r.add(t);var n=gf(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(yf);var Og=function(){function e(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new Tg(e,this.project,this.concurrent,this.scheduler))},e}(),Tg=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.project=r,o.concurrent=n,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,n<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return r(t,e),t.dispatch=function(e){var t=e.subscriber,r=e.result,n=e.value,i=e.index;t.subscribeToProjection(r,n,i)},t.prototype._next=function(e){var r=this.destination;if(r.closed)this._complete();else{var n=this.index++;if(this.active<this.concurrent){r.next(e);try{var i=(0,this.project)(e,n);if(this.scheduler){var o={subscriber:this,result:i,value:e,index:n};this.destination.add(this.scheduler.schedule(t.dispatch,0,o))}else this.subscribeToProjection(i,e,n)}catch(e){r.error(e)}}else this.buffer.push(e)}},t.prototype.subscribeToProjection=function(e,t,r){this.active++,this.destination.add(gf(e,new bf(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this._next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(yf);var Pg=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new Lg(e,this.callback))},e}(),Lg=function(e){function t(t,r){var n=e.call(this,t)||this;return n.add(new Mh(r)),n}return r(t,e),t}(Ah);var Dg=function(){function e(e,t,r,n){this.predicate=e,this.source=t,this.yieldIndex=r,this.thisArg=n}return e.prototype.call=function(e,t){return t.subscribe(new Bg(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}(),Bg=function(e){function t(t,r,n,i,o){var s=e.call(this,t)||this;return s.predicate=r,s.source=n,s.yieldIndex=i,s.thisArg=o,s.index=0,s}return r(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,r=this.thisArg,n=this.index++;try{t.call(r||this,e,n,this.source)&&this.notifyComplete(this.yieldIndex?n:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(Ah);var Fg=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Ug(e))},e}(),Ug=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype._next=function(e){},t}(Ah);var Vg=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Hg(e))},e}(),Hg=function(e){function t(t){return e.call(this,t)||this}return r(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(Ah);function Wg(e){return function(t){return 0===e?ud():t.lift(new zg(e))}}var zg=function(){function e(e){if(this.total=e,this.total<0)throw new zd}return e.prototype.call=function(e,t){return t.subscribe(new qg(e,this.total))},e}(),qg=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.ring=new Array,n.count=0,n}return r(t,e),t.prototype._next=function(e){var t=this.ring,r=this.total,n=this.count++;t.length<r?t.push(e):t[n%r]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,i=0;i<r;i++){var o=t++%r;e.next(n[o])}e.complete()},t}(Ah);var Jg=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new $g(e,this.value))},e}(),$g=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return r(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(Ah);var Gg=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Zg(e))},e}(),Zg=function(e){function t(t){return e.call(this,t)||this}return r(t,e),t.prototype._next=function(e){this.destination.next(md.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(md.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(md.createComplete()),e.complete()},t}(Ah);function Qg(e,t){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new Yg(e,t,r))}}var Yg=function(){function e(e,t,r){void 0===r&&(r=!1),this.accumulator=e,this.seed=t,this.hasSeed=r}return e.prototype.call=function(e,t){return t.subscribe(new Kg(e,this.accumulator,this.seed,this.hasSeed))},e}(),Kg=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o._seed=n,o.hasSeed=i,o.index=0,o}return r(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.accumulator(this.seed,e,r)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(Ah);function Xg(e,t){return arguments.length>=2?function(r){return Ph(Qg(e,t),Wg(1),rg(t))(r)}:function(t){return Ph(Qg((function(t,r,n){return e(t,r,n+1)})),Wg(1))(t)}}var em=function(){function e(e,t,r){this.accumulator=e,this.seed=t,this.concurrent=r}return e.prototype.call=function(e,t){return t.subscribe(new tm(e,this.accumulator,this.seed,this.concurrent))},e}(),tm=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o.acc=n,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return r(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,r=this.destination,n=void 0;try{n=(0,this.accumulator)(this.acc,e,t)}catch(e){return r.error(e)}this.active++,this._innerSub(n)}else this.buffer.push(e)},t.prototype._innerSub=function(e){var t=new bf(this),r=this.destination;r.add(t);var n=gf(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(yf);function rm(e,t){return function(r){var n;if(n="function"==typeof e?e:function(){return e},"function"==typeof t)return r.lift(new nm(n,t));var i=Object.create(r,Gh);return i.source=r,i.subjectFactory=n,i}}var nm=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(e);return i.add(t.subscribe(n)),i},e}();var im=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new om(e,this.nextSources))},e}(),om=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.nextSources=r,n}return r(t,e),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new bf(this),r=this.destination;r.add(t);var n=gf(e,t);n!==t&&r.add(n)}else this.destination.complete()},t}(yf);var sm=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new am(e))},e}(),am=function(e){function t(t){var r=e.call(this,t)||this;return r.hasPrev=!1,r}return r(t,e),t.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},t}(Ah);var cm=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new um(e,this.count,this.source))},e}(),um=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return r(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,r=this.count;if(0===r)return e.prototype.complete.call(this);r>-1&&(this.count=r-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(Ah);var lm=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new hm(e,this.notifier,t))},e}(),hm=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i.sourceIsBeingSubscribedTo=!0,i}return r(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){var t;this.notifications=new Hh;try{t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=gf(t,new bf(this))},t}(yf);var dm=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new fm(e,this.count,this.source))},e}(),fm=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return r(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.source,n=this.count;if(0===n)return e.prototype.error.call(this,t);n>-1&&(this.count=n-1),r.subscribe(this._unsubscribeAndRecycle())}},t}(Ah);var pm=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new bm(e,this.notifier,this.source))},e}(),bm=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i}return r(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.errors,n=this.retries,i=this.retriesSubscription;if(n)this.errors=void 0,this.retriesSubscription=void 0;else{r=new Hh;try{n=(0,this.notifier)(r)}catch(t){return e.prototype.error.call(this,t)}i=gf(n,new bf(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=n,this.retriesSubscription=i,r.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(yf);var ym=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new gm(e),n=t.subscribe(r);return n.add(gf(this.notifier,new bf(r))),n},e}(),gm=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return r(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(yf);var mm=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new vm(e,this.period,this.scheduler))},e}(),vm=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.period=r,i.scheduler=n,i.hasValue=!1,i.add(n.schedule(_m,r,{subscriber:i,period:r})),i}return r(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(Ah);function _m(e){var t=e.subscriber,r=e.period;t.notifyNext(),this.schedule(e,r)}var wm=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new Sm(e,this.compareTo,this.comparator))},e}(),Sm=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.compareTo=r,i.comparator=n,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(r.subscribe(new Em(t,i))),i}return r(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this,t=e._a,r=e._b,n=e.comparator;t.length>0&&r.length>0;){var i=t.shift(),o=r.shift(),s=!1;try{s=n?n(i,o):i===o}catch(e){this.destination.error(e)}s||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t}(Ah),Em=function(e){function t(t,r){var n=e.call(this,t)||this;return n.parent=r,n}return r(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(Ah);function xm(){return new Hh}var km=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new Cm(e,this.predicate,this.source))},e}(),Cm=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.seenValue=!1,i.index=0,i}return r(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new qd)},t}(Ah);var Mm=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new Im(e,this.total))},e}(),Im=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return r(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(Ah);var Rm=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new zd}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new Ah(e)):t.subscribe(new Am(e,this._skipCount))},e}(),Am=function(e){function t(t,r){var n=e.call(this,t)||this;return n._skipCount=r,n._count=0,n._ring=new Array(r),n}return r(t,e),t.prototype._next=function(e){var t=this._skipCount,r=this._count++;if(r<t)this._ring[r]=e;else{var n=r%t,i=this._ring,o=i[n];i[n]=e,this.destination.next(o)}},t}(Ah);var Nm=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new jm(e,this.notifier))},e}(),jm=function(e){function t(t,r){var n=e.call(this,t)||this;n.hasValue=!1;var i=new bf(n);n.add(i),n.innerSubscription=i;var o=gf(r,i);return o!==i&&(n.add(o),n.innerSubscription=o),n}return r(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(yf);var Om=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new Tm(e,this.predicate))},e}(),Tm=function(e){function t(t,r){var n=e.call(this,t)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return r(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=Boolean(t)}catch(e){this.destination.error(e)}},t}(Ah);var Pm=function(e){function t(t,r,n){void 0===r&&(r=0),void 0===n&&(n=Td);var i=e.call(this)||this;return i.source=t,i.delayTime=r,i.scheduler=n,(!Rf(r)||r<0)&&(i.delayTime=0),n&&"function"==typeof n.schedule||(i.scheduler=Td),i}return r(t,e),t.create=function(e,r,n){return void 0===r&&(r=0),void 0===n&&(n=Td),new t(e,r,n)},t.dispatch=function(e){var t=e.source,r=e.subscriber;return this.add(t.subscribe(r))},t.prototype._subscribe=function(e){var r=this.delayTime,n=this.source;return this.scheduler.schedule(t.dispatch,r,{source:n,subscriber:e})},t}(Dh);var Lm=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new Pm(t,this.delay,this.scheduler).subscribe(e)},e}();function Dm(e,t){return"function"==typeof t?function(r){return r.pipe(Dm((function(r,n){return pf(e(r,n)).pipe($d((function(e,i){return t(r,e,n,i)})))})))}:function(t){return t.lift(new Bm(e))}}var Bm=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new Fm(e,this.project))},e}(),Fm=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.index=0,n}return r(t,e),t.prototype._next=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){return void this.destination.error(e)}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var r=new bf(this),n=this.destination;n.add(r),this.innerSubscription=gf(e,r),this.innerSubscription!==r&&n.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(yf);var Um=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new Vm(e),n=gf(this.notifier,new bf(r));return n&&!r.seenValue?(r.add(n),t.subscribe(r)):r},e}(),Vm=function(e){function t(t){var r=e.call(this,t)||this;return r.seenValue=!1,r}return r(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(yf);var Hm=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new Wm(e,this.predicate,this.inclusive))},e}(),Wm=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.inclusive=n,i.index=0,i}return r(t,e),t.prototype._next=function(e){var t,r=this.destination;try{t=this.predicate(e,this.index++)}catch(e){return void r.error(e)}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var r=this.destination;Boolean(t)?r.next(e):(this.inclusive&&r.next(e),r.complete())},t}(Ah);var zm=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new qm(e,this.nextOrObserver,this.error,this.complete))},e}(),qm=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o._tapNext=Wd,o._tapError=Wd,o._tapComplete=Wd,o._tapError=n||Wd,o._tapComplete=i||Wd,mh(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||Wd,o._tapError=r.error||Wd,o._tapComplete=r.complete||Wd),o}return r(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},t}(Ah),Jm={leading:!0,trailing:!1};var $m=function(){function e(e,t,r){this.durationSelector=e,this.leading=t,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new Gm(e,this.durationSelector,this.leading,this.trailing))},e}(),Gm=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.destination=t,o.durationSelector=r,o._leading=n,o._trailing=i,o._hasValue=!1,o}return r(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=gf(t,new bf(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(yf);var Zm=function(){function e(e,t,r,n){this.duration=e,this.scheduler=t,this.leading=r,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new Qm(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),Qm=function(e){function t(t,r,n,i,o){var s=e.call(this,t)||this;return s.duration=r,s.scheduler=n,s.leading=i,s.trailing=o,s._hasTrailingValue=!1,s._trailingValue=null,s}return r(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Ym,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(Ah);function Ym(e){e.subscriber.clearThrottle()}var Km=function(){return function(e,t){this.value=e,this.interval=t}}();function Xm(e,t,r){return void 0===r&&(r=Ld),function(n){var i=og(e),o=i?+e-r.now():Math.abs(e);return n.lift(new ev(o,i,t,r))}}var ev=function(){function e(e,t,r,n){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new tv(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),tv=function(e){function t(t,r,n,i,o){var s=e.call(this,t)||this;return s.absoluteTimeout=r,s.waitFor=n,s.withObservable=i,s.scheduler=o,s.scheduleTimeout(),s}return r(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(gf(t,new bf(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(yf);var rv=function(){return function(e,t){this.value=e,this.timestamp=t}}();function nv(e,t,r){return 0===r?[t]:(e.push(t),e)}var iv=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var r=new ov(e),n=t.subscribe(r);return n.closed||r.add(gf(this.windowBoundaries,new bf(r))),n},e}(),ov=function(e){function t(t){var r=e.call(this,t)||this;return r.window=new Hh,t.next(r.window),r}return r(t,e),t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,r=this.window=new Hh;t.next(r)},t}(yf);var sv=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new av(e,this.windowSize,this.startWindowEvery))},e}(),av=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=r,i.startWindowEvery=n,i.windows=[new Hh],i.count=0,t.next(i.windows[0]),i}return r(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,n=this.windowSize,i=this.windows,o=i.length,s=0;s<o&&!this.closed;s++)i[s].next(e);var a=this.count-n+1;if(a>=0&&a%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var c=new Hh;i.push(c),r.next(c)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(Ah);var cv=function(){function e(e,t,r,n){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new lv(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),uv=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return r(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(Hh),lv=function(e){function t(t,r,n,i,o){var s=e.call(this,t)||this;s.destination=t,s.windowTimeSpan=r,s.windowCreationInterval=n,s.maxWindowSize=i,s.scheduler=o,s.windows=[];var a=s.openWindow();if(null!==n&&n>=0){var c={subscriber:s,window:a,context:null},u={windowTimeSpan:r,windowCreationInterval:n,subscriber:s,scheduler:o};s.add(o.schedule(fv,r,c)),s.add(o.schedule(dv,n,u))}else{var l={subscriber:s,window:a,windowTimeSpan:r};s.add(o.schedule(hv,r,l))}return s}return r(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,n=0;n<r;n++){var i=t[n];i.closed||(i.next(e),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new uv;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(Ah);function hv(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&t.closeWindow(n),e.window=t.openWindow(),this.schedule(e,r)}function dv(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,o=r.openWindow(),s=this,a={action:s,subscription:null},c={subscriber:r,window:o,context:a};a.subscription=n.schedule(fv,t,c),s.add(a.subscription),s.schedule(e,i)}function fv(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}var pv=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new bv(e,this.openings,this.closingSelector))},e}(),bv=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.openings=r,i.closingSelector=n,i.contexts=[],i.add(i.openSubscription=uf(i,r,r)),i}return r(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var r=t.length,n=0;n<r;n++)t[n].window.next(e)},t.prototype._error=function(t){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.error(t),o.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var r=t.length,n=-1;++n<r;){var i=t[n];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,r=-1;++r<t;){var n=e[r];n.window.unsubscribe(),n.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,r,n,i){if(e===this.openings){var o=void 0;try{o=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var s=new Hh,a=new Mh,c={window:s,subscription:a};this.contexts.push(c);var u=uf(this,o,c);u.closed?this.closeWindow(this.contexts.length-1):(u.context=c,a.add(u)),this.destination.next(s)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,r=t[e],n=r.window,i=r.subscription;t.splice(e,1),n.complete(),i.unsubscribe()}},t}(tf);var yv=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new gv(e,this.closingSelector))},e}(),gv=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.closingSelector=r,n.openWindow(),n}return r(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.openWindow(i)},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t=this.window;t&&t.complete();var r,n=this.window=new Hh;this.destination.next(n);try{r=(0,this.closingSelector)()}catch(e){return this.destination.error(e),void this.window.error(e)}this.add(this.closingNotification=uf(this,r))},t}(tf);var mv=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new vv(e,this.observables,this.project))},e}(),vv=function(e){function t(t,r,n){var i=e.call(this,t)||this;i.observables=r,i.project=n,i.toRespond=[];var o=r.length;i.values=new Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(s=0;s<o;s++){var a=r[s];i.add(uf(i,a,void 0,s))}return i}return r(t,e),t.prototype.notifyNext=function(e,t,r){this.values[r]=t;var n=this.toRespond;if(n.length>0){var i=n.indexOf(r);-1!==i&&n.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(tf);var _v=Object.freeze({__proto__:null,audit:Iy,auditTime:function(e,t){return void 0===t&&(t=Ld),Iy((function(){return Hf(e,t)}))},buffer:function(e){return function(t){return t.lift(new Ny(e))}},bufferCount:function(e,t){return void 0===t&&(t=null),function(r){return r.lift(new Oy(e,t))}},bufferTime:function(e){var t=arguments.length,r=Ld;ld(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],t--);var n=null;t>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return t>=3&&(i=arguments[2]),function(t){return t.lift(new Ly(e,n,i,r))}},bufferToggle:function(e,t){return function(r){return r.lift(new Hy(e,t))}},bufferWhen:function(e){return function(t){return t.lift(new zy(e))}},catchError:function(e){return function(t){var r=new Jy(e),n=t.lift(r);return r.caught=n}},combineAll:function(e){return function(t){return t.lift(new hf(e))}},combineLatest:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=null;return"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&Eh(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(pf([t].concat(e)),new hf(r))}},concat:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(xf.apply(void 0,[t].concat(e)))}},concatAll:Ef,concatMap:Gy,concatMapTo:function(e,t){return Gy((function(){return e}),t)},count:function(e){return function(t){return t.lift(new Zy(e,t))}},debounce:function(e){return function(t){return t.lift(new Yy(e))}},debounceTime:function(e,t){return void 0===t&&(t=Ld),function(r){return r.lift(new Xy(e,t))}},defaultIfEmpty:rg,delay:function(e,t){void 0===t&&(t=Ld);var r=og(e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new sg(r,t))}},delayWhen:function(e,t){return t?function(r){return new hg(r,t).lift(new ug(e))}:function(t){return t.lift(new ug(e))}},dematerialize:function(){return function(e){return e.lift(new fg)}},distinct:function(e,t){return function(r){return r.lift(new bg(e,t))}},distinctUntilChanged:gg,distinctUntilKeyChanged:function(e,t){return gg((function(r,n){return t?t(r[e],n[e]):r[e]===n[e]}))},elementAt:function(e,t){if(e<0)throw new zd;var r=arguments.length>=2;return function(n){return n.pipe(Pf((function(t,r){return r===e})),xg(1),r?rg(t):_g((function(){return new zd})))}},endWith:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return xf(t,bd.apply(void 0,e))}},every:function(e,t){return function(r){return r.lift(new Mg(e,t,r))}},exhaust:function(){return function(e){return e.lift(new Rg)}},exhaustMap:function e(t,r){return r?function(n){return n.pipe(e((function(e,n){return pf(t(e,n)).pipe($d((function(t,i){return r(e,t,n,i)})))})))}:function(e){return e.lift(new Ng(t))}},expand:function(e,t,r){return void 0===t&&(t=Number.POSITIVE_INFINITY),t=(t||0)<1?Number.POSITIVE_INFINITY:t,function(n){return n.lift(new Og(e,t,r))}},filter:Pf,finalize:function(e){return function(t){return t.lift(new Pg(e))}},find:function(e,t){if("function"!=typeof e)throw new TypeError("predicate is not a function");return function(r){return r.lift(new Dg(e,r,!1,t))}},findIndex:function(e,t){return function(r){return r.lift(new Dg(e,r,!0,t))}},first:function(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?Pf((function(t,r){return e(t,r,n)})):Th,xg(1),r?rg(t):_g((function(){return new qd})))}},groupBy:function(e,t,r,n){return function(i){return i.lift(new Qh(e,t,r,n))}},ignoreElements:function(){return function(e){return e.lift(new Fg)}},isEmpty:function(){return function(e){return e.lift(new Vg)}},last:function(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?Pf((function(t,r){return e(t,r,n)})):Th,Wg(1),r?rg(t):_g((function(){return new qd})))}},map:$d,mapTo:function(e){return function(t){return t.lift(new Jg(e))}},materialize:function(){return function(e){return e.lift(new Gg)}},max:function(e){var t="function"==typeof e?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t};return Xg(t)},merge:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(Nf.apply(void 0,[t].concat(e)))}},mergeAll:Sf,mergeMap:mf,flatMap:wf,mergeMapTo:function(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof t?mf((function(){return e}),t,r):("number"==typeof t&&(r=t),mf((function(){return e}),r))},mergeScan:function(e,t,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new em(e,t,r))}},min:function(e){var t="function"==typeof e?function(t,r){return e(t,r)<0?t:r}:function(e,t){return e<t?e:t};return Xg(t)},multicast:rm,observeOn:function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new vd(e,t))}},onErrorResumeNext:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&Eh(e[0])&&(e=e[0]),function(t){return t.lift(new im(e))}},pairwise:function(){return function(e){return e.lift(new sm)}},partition:function(e,t){return function(r){return[Pf(e,t)(r),Pf(Tf(e,t))(r)]}},pluck:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw new Error("list of properties cannot be empty.");return function(t){return $d(function(e,t){var r=function(r){for(var n=r,i=0;i<t;i++){var o=null!=n?n[e[i]]:void 0;if(void 0===o)return;n=o}return n};return r}(e,r))(t)}},publish:function(e){return e?rm((function(){return new Hh}),e):rm(new Hh)},publishBehavior:function(e){return function(t){return rm(new td(e))(t)}},publishLast:function(){return function(e){return rm(new xd)(e)}},publishReplay:function(e,t,r,n){r&&"function"!=typeof r&&(n=r);var i="function"==typeof r?r:void 0,o=new Sd(e,t,n);return function(e){return rm((function(){return o}),i)(e)}},race:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&Eh(e[0])&&(e=e[0]),t.lift.call(Bf.apply(void 0,[t].concat(e)))}},reduce:Xg,repeat:function(e){return void 0===e&&(e=-1),function(t){return 0===e?ud():e<0?t.lift(new cm(-1,t)):t.lift(new cm(e-1,t))}},repeatWhen:function(e){return function(t){return t.lift(new lm(e))}},retry:function(e){return void 0===e&&(e=-1),function(t){return t.lift(new dm(e,t))}},retryWhen:function(e){return function(t){return t.lift(new pm(e,t))}},refCount:zh,sample:function(e){return function(t){return t.lift(new ym(e))}},sampleTime:function(e,t){return void 0===t&&(t=Ld),function(r){return r.lift(new mm(e,t))}},scan:Qg,sequenceEqual:function(e,t){return function(r){return r.lift(new wm(e,t))}},share:function(){return function(e){return zh()(rm(xm)(e))}},shareReplay:function(e,t,r){var n;return n=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:r},function(e){return e.lift(function(e){var t,r,n=e.bufferSize,i=void 0===n?Number.POSITIVE_INFINITY:n,o=e.windowTime,s=void 0===o?Number.POSITIVE_INFINITY:o,a=e.refCount,c=e.scheduler,u=0,l=!1,h=!1;return function(e){var n;u++,!t||l?(l=!1,t=new Sd(i,s,c),n=t.subscribe(this),r=e.subscribe({next:function(e){t.next(e)},error:function(e){l=!0,t.error(e)},complete:function(){h=!0,r=void 0,t.complete()}}),h&&(r=void 0)):n=t.subscribe(this),this.add((function(){u--,n.unsubscribe(),n=void 0,r&&!h&&a&&0===u&&(r.unsubscribe(),r=void 0,t=void 0)}))}}(n))}},single:function(e){return function(t){return t.lift(new km(e,t))}},skip:function(e){return function(t){return t.lift(new Mm(e))}},skipLast:function(e){return function(t){return t.lift(new Rm(e))}},skipUntil:function(e){return function(t){return t.lift(new Nm(e))}},skipWhile:function(e){return function(t){return t.lift(new Om(e))}},startWith:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return ld(r)?(e.pop(),function(t){return xf(e,t,r)}):function(t){return xf(e,t)}},subscribeOn:function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new Lm(e,t))}},switchAll:function(){return Dm(Th)},switchMap:Dm,switchMapTo:function(e,t){return t?Dm((function(){return e}),t):Dm((function(){return e}))},take:xg,takeLast:Wg,takeUntil:function(e){return function(t){return t.lift(new Um(e))}},takeWhile:function(e,t){return void 0===t&&(t=!1),function(r){return r.lift(new Hm(e,t))}},tap:function(e,t,r){return function(n){return n.lift(new zm(e,t,r))}},throttle:function(e,t){return void 0===t&&(t=Jm),function(r){return r.lift(new $m(e,!!t.leading,!!t.trailing))}},throttleTime:function(e,t,r){return void 0===t&&(t=Ld),void 0===r&&(r=Jm),function(n){return n.lift(new Zm(e,t,r.leading,r.trailing))}},throwIfEmpty:_g,timeInterval:function(e){return void 0===e&&(e=Ld),function(t){return kf((function(){return t.pipe(Qg((function(t,r){var n=t.current;return{value:r,current:e.now(),last:n}}),{current:e.now(),value:void 0,last:void 0}),$d((function(e){var t=e.current,r=e.last,n=e.value;return new Km(n,t-r)})))}))}},timeout:function(e,t){return void 0===t&&(t=Ld),Xm(e,yd(new Jd),t)},timeoutWith:Xm,timestamp:function(e){return void 0===e&&(e=Ld),$d((function(t){return new rv(t,e.now())}))},toArray:function(){return Xg(nv,[])},window:function(e){return function(t){return t.lift(new iv(e))}},windowCount:function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new sv(e,t))}},windowTime:function(e){var t=Ld,r=null,n=Number.POSITIVE_INFINITY;return ld(arguments[3])&&(t=arguments[3]),ld(arguments[2])?t=arguments[2]:Rf(arguments[2])&&(n=Number(arguments[2])),ld(arguments[1])?t=arguments[1]:Rf(arguments[1])&&(r=Number(arguments[1])),function(i){return i.lift(new cv(e,r,n,t))}},windowToggle:function(e,t){return function(r){return r.lift(new pv(e,t))}},windowWhen:function(e){return function(t){return t.lift(new yv(e))}},withLatestFrom:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var r;"function"==typeof e[e.length-1]&&(r=e.pop());var n=e;return t.lift(new mv(n,r))}},zip:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(zf.apply(void 0,[t].concat(e)))}},zipAll:function(e){return function(t){return t.lift(new qf(e))}}}),wv=t(_v),Sv={},Ev={};Object.defineProperty(Ev,"__esModule",{value:!0}),Ev.ClientMessagePublishEvent=Ev.ClientMessageSetSessionConfig=Ev.ClientMessageGetSessionConfig=Ev.ClientMessageIsLinked=Ev.ClientMessageHostSession=void 0,Ev.ClientMessageHostSession=function(e){return Object.assign({type:"HostSession"},e)},Ev.ClientMessageIsLinked=function(e){return Object.assign({type:"IsLinked"},e)},Ev.ClientMessageGetSessionConfig=function(e){return Object.assign({type:"GetSessionConfig"},e)},Ev.ClientMessageSetSessionConfig=function(e){return Object.assign({type:"SetSessionConfig"},e)},Ev.ClientMessagePublishEvent=function(e){return Object.assign({type:"PublishEvent"},e)};var xv={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RxWebSocket=e.ConnectionState=void 0;const t=Yf,r=wv;var n;!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(n=e.ConnectionState||(e.ConnectionState={}));e.RxWebSocket=class{constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.connectionStateSubject=new t.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=new t.Subject,this.url=e.replace(/^http/,"ws")}connect(){return this.webSocket?(0,t.throwError)(new Error("webSocket object is not null")):new t.Observable((e=>{let t;try{this.webSocket=t=new this.WebSocketClass(this.url)}catch(t){return void e.error(t)}this.connectionStateSubject.next(n.CONNECTING),t.onclose=t=>{this.clearWebSocket(),e.error(new Error(`websocket error ${t.code}: ${t.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},t.onopen=t=>{e.next(),e.complete(),this.connectionStateSubject.next(n.CONNECTED)},t.onmessage=e=>{this.incomingDataSubject.next(e.data)}})).pipe((0,r.take)(1))}disconnect(){const{webSocket:e}=this;if(e){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{e.close()}catch(e){}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)((e=>{let r;try{r=JSON.parse(e)}catch(e){return(0,t.empty)()}return(0,t.of)(r)})))}sendData(e){const{webSocket:t}=this;if(!t)throw new Error("websocket is not connected");t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}}(xv);var kv={};Object.defineProperty(kv,"__esModule",{value:!0}),kv.isServerMessageFail=void 0,kv.isServerMessageFail=function(e){return e&&"Fail"===e.type&&"number"==typeof e.id&&"string"==typeof e.sessionId&&"string"==typeof e.error},Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.WalletSDKConnection=void 0;const Cv=Yf,Mv=wv,Iv=Y,Rv=Gn,Av=Ev,Nv=Q,jv=xv,Ov=kv;Sv.WalletSDKConnection=class{constructor(e,t,r,n,i=WebSocket){this.sessionId=e,this.sessionKey=t,this.diagnostic=n,this.subscriptions=new Cv.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Rv.IntNumber)(1),this.connectedSubject=new Cv.BehaviorSubject(!1),this.linkedSubject=new Cv.BehaviorSubject(!1),this.sessionConfigSubject=new Cv.ReplaySubject(1);const o=new jv.RxWebSocket(r+"/rpc",i);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,Mv.tap)((t=>{var r;return null===(r=this.diagnostic)||void 0===r?void 0:r.log(Nv.EVENTS.CONNECTED_STATE_CHANGE,{state:t,sessionIdHash:Iv.Session.hash(e)})})),(0,Mv.skip)(1),(0,Mv.filter)((e=>e===jv.ConnectionState.DISCONNECTED&&!this.destroyed)),(0,Mv.delay)(5e3),(0,Mv.filter)((e=>!this.destroyed)),(0,Mv.flatMap)((e=>o.connect())),(0,Mv.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,Mv.skip)(2),(0,Mv.switchMap)((e=>(0,Cv.iif)((()=>e===jv.ConnectionState.CONNECTED),this.authenticate().pipe((0,Mv.tap)((e=>this.sendIsLinked())),(0,Mv.tap)((e=>this.sendGetSessionConfig())),(0,Mv.map)((e=>!0))),(0,Cv.of)(!1)))),(0,Mv.distinctUntilChanged)(),(0,Mv.catchError)((e=>(0,Cv.of)(!1)))).subscribe((e=>this.connectedSubject.next(e)))),this.subscriptions.add(o.connectionState$.pipe((0,Mv.skip)(1),(0,Mv.switchMap)((e=>(0,Cv.iif)((()=>e===jv.ConnectionState.CONNECTED),(0,Cv.timer)(0,1e4))))).subscribe((e=>0===e?this.updateLastHeartbeat():this.heartbeat()))),this.subscriptions.add(o.incomingData$.pipe((0,Mv.filter)((e=>"h"===e))).subscribe((e=>this.updateLastHeartbeat()))),this.subscriptions.add(o.incomingJSONData$.pipe((0,Mv.filter)((e=>["IsLinkedOK","Linked"].includes(e.type)))).subscribe((t=>{var r;const n=t;null===(r=this.diagnostic)||void 0===r||r.log(Nv.EVENTS.LINKED,{sessionIdHash:Iv.Session.hash(e),linked:n.linked,type:t.type,onlineGuests:n.onlineGuests}),this.linkedSubject.next(n.linked||n.onlineGuests>0)}))),this.subscriptions.add(o.incomingJSONData$.pipe((0,Mv.filter)((e=>["GetSessionConfigOK","SessionConfigUpdated"].includes(e.type)))).subscribe((t=>{var r;const n=t;null===(r=this.diagnostic)||void 0===r||r.log(Nv.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Iv.Session.hash(e),metadata_keys:n&&n.metadata?Object.keys(n.metadata):void 0}),this.sessionConfigSubject.next({webhookId:n.webhookId,webhookUrl:n.webhookUrl,metadata:n.metadata})})))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");null===(e=this.diagnostic)||void 0===e||e.log(Nv.EVENTS.STARTED_CONNECTING,{sessionIdHash:Iv.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),null===(e=this.diagnostic)||void 0===e||e.log(Nv.EVENTS.DISCONNECTED,{sessionIdHash:Iv.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,Mv.filter)((e=>e)),(0,Mv.take)(1),(0,Mv.map)((()=>{})))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,Mv.filter)((e=>e)),(0,Mv.take)(1),(0,Mv.map)((()=>{})))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,Mv.filter)((e=>{if("Event"!==e.type)return!1;const t=e;return"string"==typeof t.sessionId&&"string"==typeof t.eventId&&"string"==typeof t.event&&"string"==typeof t.data})),(0,Mv.map)((e=>e)))}setSessionMetadata(e,t){const r=(0,Av.ClientMessageSetSessionConfig)({id:(0,Rv.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:t}});return this.onceConnected$.pipe((0,Mv.flatMap)((e=>this.makeRequest(r))),(0,Mv.map)((e=>{if((0,Ov.isServerMessageFail)(e))throw new Error(e.error||"failed to set session metadata")})))}publishEvent(e,t,r=!1){const n=(0,Av.ClientMessagePublishEvent)({id:(0,Rv.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:t,callWebhook:r});return this.onceLinked$.pipe((0,Mv.flatMap)((e=>this.makeRequest(n))),(0,Mv.map)((e=>{if((0,Ov.isServerMessageFail)(e))throw new Error(e.error||"failed to publish event");return e.eventId})))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(e){}}makeRequest(e,t=6e4){const r=e.id;try{this.sendData(e)}catch(e){return(0,Cv.throwError)(e)}return this.ws.incomingJSONData$.pipe((0,Mv.timeoutWith)(t,(0,Cv.throwError)(new Error(`request ${r} timed out`))),(0,Mv.filter)((e=>e.id===r)),(0,Mv.take)(1))}authenticate(){const e=(0,Av.ClientMessageHostSession)({id:(0,Rv.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,Mv.map)((e=>{if((0,Ov.isServerMessageFail)(e))throw new Error(e.error||"failed to authentcate")})))}sendIsLinked(){const e=(0,Av.ClientMessageIsLinked)({id:(0,Rv.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Av.ClientMessageGetSessionConfig)({id:(0,Rv.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}};var Tv={};Object.defineProperty(Tv,"__esModule",{value:!0}),Tv.WalletUIError=void 0;class Pv extends Error{constructor(e,t){super(e),this.message=e,this.errorCode=t}}Tv.WalletUIError=Pv,Pv.UserRejectedRequest=new Pv("User rejected request"),Pv.SwitchEthereumChainUnsupportedChainId=new Pv("Unsupported chainId",4902);var Lv={};Object.defineProperty(Lv,"__esModule",{value:!0}),Lv.decrypt=Lv.encrypt=void 0;const Dv=ft;Lv.encrypt=async function(e,t){if(64!==t.length)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,Dv.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(e)),s=o.slice(o.byteLength-16),a=o.slice(0,o.byteLength-16),c=new Uint8Array(s),u=new Uint8Array(a),l=new Uint8Array([...r,...c,...u]);return(0,Dv.uint8ArrayToHex)(l)},Lv.decrypt=function(e,t){if(64!==t.length)throw Error("secret must be 256 bits");return new Promise(((r,n)=>{!async function(){const i=await crypto.subtle.importKey("raw",(0,Dv.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Dv.hexStringToUint8Array)(e),s=o.slice(0,12),a=o.slice(12,28),c=o.slice(28),u=new Uint8Array([...c,...a]),l={name:"AES-GCM",iv:new Uint8Array(s)};try{const e=await window.crypto.subtle.decrypt(l,i,u),t=new TextDecoder;r(t.decode(e))}catch(e){n(e)}}()}))};var Bv={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(e.Web3Method||(e.Web3Method={}))}(Bv);var Fv={},Uv={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.RelayMessageType=void 0,(t=e.RelayMessageType||(e.RelayMessageType={})).SESSION_ID_REQUEST="SESSION_ID_REQUEST",t.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",t.LINKED="LINKED",t.UNLINKED="UNLINKED",t.WEB3_REQUEST="WEB3_REQUEST",t.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",t.WEB3_RESPONSE="WEB3_RESPONSE"}(Uv),Object.defineProperty(Fv,"__esModule",{value:!0}),Fv.Web3RequestCanceledMessage=void 0;const Vv=Uv;Fv.Web3RequestCanceledMessage=function(e){return{type:Vv.RelayMessageType.WEB3_REQUEST_CANCELED,id:e}};var Hv={};Object.defineProperty(Hv,"__esModule",{value:!0}),Hv.Web3RequestMessage=void 0;const Wv=Uv;Hv.Web3RequestMessage=function(e){return Object.assign({type:Wv.RelayMessageType.WEB3_REQUEST},e)};var zv={};Object.defineProperty(zv,"__esModule",{value:!0}),zv.EthereumAddressFromSignedMessageResponse=zv.SubmitEthereumTransactionResponse=zv.SignEthereumTransactionResponse=zv.SignEthereumMessageResponse=zv.isRequestEthereumAccountsResponse=zv.SelectProviderResponse=zv.WatchAssetReponse=zv.RequestEthereumAccountsResponse=zv.SwitchEthereumChainResponse=zv.AddEthereumChainResponse=zv.ErrorResponse=void 0;const qv=Bv;zv.ErrorResponse=function(e,t,r){return{method:e,errorMessage:t,errorCode:r}},zv.AddEthereumChainResponse=function(e){return{method:qv.Web3Method.addEthereumChain,result:e}},zv.SwitchEthereumChainResponse=function(e){return{method:qv.Web3Method.switchEthereumChain,result:e}},zv.RequestEthereumAccountsResponse=function(e){return{method:qv.Web3Method.requestEthereumAccounts,result:e}},zv.WatchAssetReponse=function(e){return{method:qv.Web3Method.watchAsset,result:e}},zv.SelectProviderResponse=function(e){return{method:qv.Web3Method.selectProvider,result:e}},zv.isRequestEthereumAccountsResponse=function(e){return e&&e.method===qv.Web3Method.requestEthereumAccounts},zv.SignEthereumMessageResponse=function(e){return{method:qv.Web3Method.signEthereumMessage,result:e}},zv.SignEthereumTransactionResponse=function(e){return{method:qv.Web3Method.signEthereumTransaction,result:e}},zv.SubmitEthereumTransactionResponse=function(e){return{method:qv.Web3Method.submitEthereumTransaction,result:e}},zv.EthereumAddressFromSignedMessageResponse=function(e){return{method:qv.Web3Method.ethereumAddressFromSignedMessage,result:e}};var Jv={};Object.defineProperty(Jv,"__esModule",{value:!0}),Jv.isWeb3ResponseMessage=Jv.Web3ResponseMessage=void 0;const $v=Uv;Jv.Web3ResponseMessage=function(e){return Object.assign({type:$v.RelayMessageType.WEB3_RESPONSE},e)},Jv.isWeb3ResponseMessage=function(e){return e&&e.type===$v.RelayMessageType.WEB3_RESPONSE};var Gv=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),Zv=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Qv=e&&e.__decorate||function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Yv=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&Gv(t,e,r);return Zv(t,e),t},Kv=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ky,"__esModule",{value:!0}),ky.WalletSDKRelay=void 0;const Xv=Kv(Cy),e_=E,t_=Yf,r_=wv,n_=Q,i_=Sv,o_=Tv,s_=Gn,a_=ft,c_=Yv(Lv),u_=Y,l_=yi,h_=Bv,d_=Fv,f_=Hv,p_=zv,b_=Jv;class y_ extends l_.WalletSDKRelayAbstract{constructor(e){var t;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new t_.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new t_.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:r,ui:n,connection:i}=this.subscribe();if(this._session=r,this.connection=i,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=null===(t=e.reloadOnDisconnect)||void 0===t||t,this.ui=n}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe((e=>{this.dappDefaultChain!==e&&(this.dappDefaultChain=e)})));const e=u_.Session.load(this.storage)||new u_.Session(this.storage).save(),t=new i_.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(t.sessionConfig$.subscribe({next:e=>{this.onSessionConfigChanged(e)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(n_.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(t.incomingEvent$.pipe((0,r_.filter)((e=>"Web3Response"===e.event))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(t.linked$.pipe((0,r_.skip)(1),(0,r_.tap)((e=>{var t;this.isLinked=e;const r=this.storage.getItem(l_.LOCAL_STORAGE_ADDRESSES_KEY);if(e&&(this.session.linked=e),this.isUnlinkedErrorState=!1,r){const n=r.split(" "),i="true"===this.storage.getItem("IsStandaloneSigning");if(""!==n[0]&&!e&&this.session.linked&&!i){this.isUnlinkedErrorState=!0;const e=this.getSessionIdHash();null===(t=this.diagnostic)||void 0===t||t.log(n_.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:e})}}}))).subscribe()),this.subscriptions.add(t.sessionConfig$.pipe((0,r_.filter)((e=>!!e.metadata&&"1"===e.metadata.__destroyed))).subscribe((()=>{var e;const r=t.isDestroyed;return null===(e=this.diagnostic)||void 0===e||e.log(n_.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:r,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()}))),this.subscriptions.add(t.sessionConfig$.pipe((0,r_.filter)((e=>e.metadata&&void 0!==e.metadata.WalletUsername))).pipe((0,r_.mergeMap)((t=>c_.decrypt(t.metadata.WalletUsername,e.secret)))).subscribe({next:e=>{this.storage.setItem(l_.WALLET_USER_NAME_KEY,e)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(n_.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(t.sessionConfig$.pipe((0,r_.filter)((e=>e.metadata&&void 0!==e.metadata.AppVersion))).pipe((0,r_.mergeMap)((t=>c_.decrypt(t.metadata.AppVersion,e.secret)))).subscribe({next:e=>{this.storage.setItem(l_.APP_VERSION_KEY,e)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(n_.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(t.sessionConfig$.pipe((0,r_.filter)((e=>e.metadata&&void 0!==e.metadata.ChainId&&void 0!==e.metadata.JsonRpcUrl))).pipe((0,r_.mergeMap)((t=>(0,t_.zip)(c_.decrypt(t.metadata.ChainId,e.secret),c_.decrypt(t.metadata.JsonRpcUrl,e.secret))))).pipe((0,r_.distinctUntilChanged)()).subscribe({next:([e,t])=>{this.chainCallback&&this.chainCallback(e,t)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(n_.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(t.sessionConfig$.pipe((0,r_.filter)((e=>e.metadata&&void 0!==e.metadata.EthereumAddress))).pipe((0,r_.mergeMap)((t=>c_.decrypt(t.metadata.EthereumAddress,e.secret)))).subscribe({next:e=>{this.accountsCallback&&this.accountsCallback([e]),y_.accountRequestCallbackIds.size>0&&(Array.from(y_.accountRequestCallbackIds.values()).forEach((t=>{const r=(0,b_.Web3ResponseMessage)({id:t,response:(0,p_.RequestEthereumAccountsResponse)([e])});this.invokeCallback(Object.assign(Object.assign({},r),{id:t}))})),y_.accountRequestCallbackIds.clear())},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(n_.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(t.sessionConfig$.pipe((0,r_.filter)((e=>e.metadata&&void 0!==e.metadata.AppSrc))).pipe((0,r_.mergeMap)((t=>c_.decrypt(t.metadata.AppSrc,e.secret)))).subscribe({next:e=>{this.ui.setAppSrc(e)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(n_.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const r=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:t.connected$,chainId$:this.dappDefaultChainSubject});return t.connect(),{session:e,ui:r,connection:t}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,r_.timeout)(1e3),(0,r_.catchError)((e=>(0,t_.of)(null)))).subscribe((e=>{var t,r,n;const i=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch(e){null===(t=this.diagnostic)||void 0===t||t.log(n_.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(r=this.diagnostic)||void 0===r||r.log(n_.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=u_.Session.load(this.storage);if((null==o?void 0:o.id)===this._session.id?this.storage.clear():o&&(null===(n=this.diagnostic)||void 0===n||n.log(n_.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:u_.Session.hash(o.id)})),this._reloadOnDisconnect)return void this.ui.reloadUI();this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new t_.Subscription;const{session:s,ui:a,connection:c}=this.subscribe();this._session=s,this.connection=c,this.ui=a,i&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}),(e=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(n_.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})}))}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,r,n){return this.sendRequest({method:h_.Web3Method.signEthereumMessage,params:{message:(0,a_.hexStringFromBuffer)(e,!0),address:t,addPrefix:r,typedDataJson:n||null}})}ethereumAddressFromSignedMessage(e,t,r){return this.sendRequest({method:h_.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,a_.hexStringFromBuffer)(e,!0),signature:(0,a_.hexStringFromBuffer)(t,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:h_.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,a_.bigIntStringFromBN)(e.weiValue),data:(0,a_.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,a_.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,a_.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,a_.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,a_.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:h_.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,a_.bigIntStringFromBN)(e.weiValue),data:(0,a_.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,a_.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,a_.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,a_.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,a_.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:h_.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,a_.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:h_.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,a_.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,t){return this.sendRequest({method:h_.Web3Method.generic,params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null;const r=(0,a_.randomBytesHex)(8),n=n=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,n),null==t||t()};return{promise:new Promise(((i,o)=>{this.ui.isStandalone()||(t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:n,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(r,(e=>{if(null==t||t(),e.errorMessage)return o(new Error(e.errorMessage));i(e)})),this.ui.isStandalone()?this.sendRequestStandalone(r,e):this.publishWeb3RequestEvent(r,e)})),cancel:n}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,t){var r;const n=(0,f_.Web3RequestMessage)({id:e,request:t}),i=u_.Session.load(this.storage);null===(r=this.diagnostic)||void 0===r||r.log(n_.EVENTS.WEB3_REQUEST,{eventId:n.id,method:`relay::${n.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?u_.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",n,!0).subscribe({next:e=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(n_.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:n.id,method:`relay::${n.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?u_.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()})},error:e=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:n.id,response:{method:n.request.method,errorMessage:e.message}}))}}))}publishWeb3RequestCanceledEvent(e){const t=(0,d_.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",t,!1).subscribe())}publishEvent(e,t,r){const n=this.session.secret;return new t_.Observable((e=>{c_.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin})),n).then((t=>{e.next(t),e.complete()}))})).pipe((0,r_.mergeMap)((t=>this.connection.publishEvent(e,t,r))))}handleIncomingEvent(e){try{this.subscriptions.add((0,t_.from)(c_.decrypt(e.data,this.session.secret)).pipe((0,r_.map)((e=>JSON.parse(e)))).subscribe({next:e=>{const t=(0,b_.isWeb3ResponseMessage)(e)?e:null;t&&this.handleWeb3ResponseMessage(t)},error:()=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(n_.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(e){return}}handleWeb3ResponseMessage(e){var t;const{response:r}=e;if(null===(t=this.diagnostic)||void 0===t||t.log(n_.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash()}),(0,p_.isRequestEthereumAccountsResponse)(r))return y_.accountRequestCallbackIds.forEach((t=>this.invokeCallback(Object.assign(Object.assign({},e),{id:t})))),void y_.accountRequestCallbackIds.clear();this.invokeCallback(e)}handleErrorResponse(e,t,r,n){this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:e,response:(0,p_.ErrorResponse)(t,(null!=r?r:o_.WalletUIError.UserRejectedRequest).message,n)}))}invokeCallback(e){const t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:h_.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,a_.randomBytesHex)(8),r=r=>{this.publishWeb3RequestCanceledEvent(t),this.handleErrorResponse(t,e.method,r)};return{promise:new Promise(((n,i)=>{var o;this.relayEventManager.callbacks.set(t,(e=>{if(this.ui.hideRequestEthereumAccounts(),e.errorMessage)return i(new Error(e.errorMessage));n(e)}));const s=(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)||null;if(s&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(s)){let e;try{e=(0,a_.isInIFrame)()&&window.top?window.top.location:window.location}catch(t){e=window.location}e.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(e.href)}`}else{if(this.ui.inlineAccountsResponse()){const e=e=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:t,response:(0,p_.RequestEthereumAccountsResponse)(e)}))};this.ui.requestEthereumAccounts({onCancel:r,onAccounts:e})}else{const e=e_.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>r(e)})}y_.accountRequestCallbackIds.add(t),this.ui.inlineAccountsResponse()||this.ui.isStandalone()||this.publishWeb3RequestEvent(t,e)}})),cancel:r}}selectProvider(e){const t={method:h_.Web3Method.selectProvider,params:{providerOptions:e}},r=(0,a_.randomBytesHex)(8);return{cancel:e=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,e)},promise:new Promise(((t,n)=>{this.relayEventManager.callbacks.set(r,(e=>{if(e.errorMessage)return n(new Error(e.errorMessage));t(e)}));this.ui.selectProvider&&this.ui.selectProvider({onApprove:e=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:r,response:(0,p_.SelectProviderResponse)(e)}))},onCancel:e=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:r,response:(0,p_.SelectProviderResponse)(s_.ProviderType.Unselected)}))},providerOptions:e})}))}}watchAsset(e,t,r,n,i,o){const s={method:h_.Web3Method.watchAsset,params:{type:e,options:{address:t,symbol:r,decimals:n,image:i},chainId:o}};let a=null;const c=(0,a_.randomBytesHex)(8),u=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,s.method,e),null==a||a()};this.ui.inlineWatchAsset()||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));return{cancel:u,promise:new Promise(((u,l)=>{this.relayEventManager.callbacks.set(c,(e=>{if(null==a||a(),e.errorMessage)return l(new Error(e.errorMessage));u(e)}));const h=e=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:c,response:(0,p_.WatchAssetReponse)(!1)}))},d=()=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:c,response:(0,p_.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:d,onCancel:h,type:e,address:t,symbol:r,decimals:n,image:i,chainId:o}),this.ui.inlineWatchAsset()||this.ui.isStandalone()||this.publishWeb3RequestEvent(c,s)}))}}addEthereumChain(e,t,r,n,i,o){const s={method:h_.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:t,blockExplorerUrls:n,chainName:i,iconUrls:r,nativeCurrency:o}};let a=null;const c=(0,a_.randomBytesHex)(8),u=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,s.method,e),null==a||a()};this.ui.inlineAddEthereumChain(e)||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));return{promise:new Promise(((t,r)=>{this.relayEventManager.callbacks.set(c,(e=>{if(null==a||a(),e.errorMessage)return r(new Error(e.errorMessage));t(e)}));const n=e=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:c,response:(0,p_.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},i=e=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:c,response:(0,p_.AddEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:n,onApprove:i,chainId:s.params.chainId,rpcUrls:s.params.rpcUrls,blockExplorerUrls:s.params.blockExplorerUrls,chainName:s.params.chainName,iconUrls:s.params.iconUrls,nativeCurrency:s.params.nativeCurrency}),this.ui.inlineAddEthereumChain(e)||this.ui.isStandalone()||this.publishWeb3RequestEvent(c,s)})),cancel:u}}switchEthereumChain(e,t){const r={method:h_.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:t})},n=(0,a_.randomBytesHex)(8);return{promise:new Promise(((e,t)=>{this.relayEventManager.callbacks.set(n,(r=>r.errorMessage&&r.errorCode?t(e_.ethErrors.provider.custom({code:r.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):r.errorMessage?t(new Error(r.errorMessage)):void e(r)));this.ui.switchEthereumChain({onCancel:e=>{if("number"==typeof e){const t=e;this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:n,response:(0,p_.ErrorResponse)(h_.Web3Method.switchEthereumChain,o_.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,t)}))}else e instanceof o_.WalletUIError?this.handleErrorResponse(n,h_.Web3Method.switchEthereumChain,e,e.errorCode):this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:n,response:(0,p_.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:e=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:n,response:(0,p_.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:r.params.chainId,address:r.params.address}),this.ui.inlineSwitchEthereumChain()||this.ui.isStandalone()||this.publishWeb3RequestEvent(n,r)})),cancel:e=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,e)}}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return u_.Session.hash(this._session.id)}sendRequestStandalone(e,t){const r=r=>{this.handleErrorResponse(e,t.method,r)},n=t=>{this.handleWeb3ResponseMessage((0,b_.Web3ResponseMessage)({id:e,response:t}))};switch(t.method){case h_.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:t,onSuccess:n,onCancel:r});break;case h_.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:t,onSuccess:n,onCancel:r});break;case h_.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:t,onSuccess:n,onCancel:r});break;case h_.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:t,onSuccess:n});break;default:r()}}onSessionConfigChanged(e){}}y_.accountRequestCallbackIds=new Set,Qv([Xv.default],y_.prototype,"resetAndReload",null),Qv([Xv.default],y_.prototype,"handleIncomingEvent",null),ky.WalletSDKRelay=y_;var g_={};Object.defineProperty(g_,"__esModule",{value:!0}),g_.WalletSDKRelayEventManager=void 0;const m_=ft;g_.WalletSDKRelayEventManager=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=(0,m_.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}};var v_="3.6.6";Object.defineProperty(b,"__esModule",{value:!0}),b.CoinbaseWalletSDK=void 0;const __=y,w_=g,S_=m,E_=Ul,x_=ky,k_=g_,C_=ft,M_=process.env.LINK_API_URL||"https://www.walletlink.org",I_=process.env.SDK_VERSION||v_||"unknown";class R_{constructor(e){var t,r,n;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=e.linkAPIUrl||M_;let o;if(o=e.uiConstructor?e.uiConstructor:e=>new E_.WalletSDKUI(e),void 0===e.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(t=e.overrideIsCoinbaseWallet)||void 0===t||t,this._overrideIsCoinbaseBrowser=null!==(r=e.overrideIsCoinbaseBrowser)&&void 0!==r&&r,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=null===(n=e.reloadOnDisconnect)||void 0===n||n;const s=new URL(i),a=`${s.protocol}//${s.host}`;this._storage=new w_.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",R_.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new k_.WalletSDKRelayEventManager,this._relay=new x_.WalletSDKRelay({linkAPIUrl:i,version:I_,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),e.headlessMode||this._relay.attachUI())}makeWeb3Provider(e="",t=1){const r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(e,t),!1===this._reloadOnDisconnect&&"function"==typeof r.disableReloadOnDisconnect&&r.disableReloadOnDisconnect(),r;const n=this.coinbaseBrowser;if(n)return n;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||i.setConnectDisabled(!0),new S_.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:t,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,t){var r;this._appName=e||"DApp",this._appLogoUrl=t||(0,C_.getFavicon)();const n=this.walletExtension;n?this.isCipherProvider(n)||n.setAppInfo(this._appName,this._appLogoUrl):null===(r=this._relay)||void 0===r||r.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const t=this.walletExtension;t?t.close():null===(e=this._relay)||void 0===e||e.resetAndReload()}getQrUrl(){var e,t;return null!==(t=null===(e=this._relay)||void 0===e?void 0:e.getQRCodeUrl())&&void 0!==t?t:null}getCoinbaseWalletLogo(e,t=240){return(0,__.walletLogo)(e,t)}get walletExtension(){var e;return null!==(e=window.coinbaseWalletExtension)&&void 0!==e?e:window.walletLinkExtension}get coinbaseBrowser(){var e,t;try{const r=null!==(e=window.ethereum)&&void 0!==e?e:null===(t=window.top)||void 0===t?void 0:t.ethereum;if(!r)return;return"isCoinbaseBrowser"in r&&r.isCoinbaseBrowser?r:void 0}catch(e){return}}isCipherProvider(e){return"boolean"==typeof e.isCipher&&e.isCipher}}b.CoinbaseWalletSDK=R_,R_.VERSION=I_,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=b,r=m;var n=b;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=m;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,"undefined"!=typeof window&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)}(p);var A_=n(p);function N_({chainId:e,rpcUrl:t,appName:r,appLogoUrl:n,darkMode:a},c){return i(this,void 0,void 0,(function*(){if(window.ethereum&&(window.ethereum.isWalletLink||window.ethereum.isToshi))return o(window.ethereum,c);if(!r)throw new Error("walletLink need appName");const i=new A_({appName:r,appLogoUrl:n,darkMode:a}).makeWeb3Provider(t,e);return yield i.enable(),i.on("connect",c.connect),i.on("disconnect",c.disconnect),i.on("accountsChanged",c.accountsChanged),i.on("chainChanged",c.chainChanged),i.on("message",c.message),s(i)}))}export{N_ as default};