@dodoex/wallet-web3 0.0.3-1 → 0.0.3-2

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 (113) hide show
  1. package/dist/_commonjsHelpers-70de2c37.js +1 -0
  2. package/dist/bn-16003306.js +1 -0
  3. package/dist/cjs/_commonjsHelpers-66ecbaf8.cjs +1 -0
  4. package/dist/cjs/bn-1bd77809.cjs +1 -0
  5. package/dist/cjs/elliptic-174586a6.cjs +1 -0
  6. package/dist/cjs/hash-121fdd2c.cjs +1 -0
  7. package/dist/cjs/index-23606273.cjs +1 -0
  8. package/dist/cjs/index-33e57d81.cjs +1 -0
  9. package/dist/cjs/index-5976e357.cjs +1 -0
  10. package/dist/cjs/index-6d7369f7.cjs +1 -0
  11. package/dist/cjs/index-a32c3cfa.cjs +22 -0
  12. package/dist/cjs/index-e0e60b3b.cjs +3 -0
  13. package/dist/cjs/index-e948d9e4.cjs +19 -0
  14. package/dist/cjs/index-f7522058.cjs +1 -0
  15. package/dist/cjs/index.cjs +1 -1
  16. package/dist/cjs/inherits-6d52d55b.cjs +1 -0
  17. package/dist/cjs/interface-6a2093d7.cjs +1 -0
  18. package/dist/cjs/node-ponyfill-c08c51bf.cjs +1 -0
  19. package/dist/cjs/portis-cf05b1f4.cjs +1 -0
  20. package/dist/cjs/provider-de4ee5b7.cjs +1 -0
  21. package/dist/cjs/providers/connector/safeGnosis/adapter.d.ts +1 -6
  22. package/dist/cjs/sha256-21fccd26.cjs +1 -0
  23. package/dist/cjs/sha3-499f6bea.cjs +10 -0
  24. package/dist/cjs/uAuth-075fec28.cjs +1 -0
  25. package/dist/cjs/walletConnect-58449a61.cjs +1 -0
  26. package/dist/cjs/walletLink-e3b39e1b.cjs +1 -0
  27. package/dist/elliptic-1100204f.js +1 -0
  28. package/dist/hash-4b8ad136.js +1 -0
  29. package/dist/index-5c16deff.js +1 -0
  30. package/dist/index-632fbf92.js +1 -0
  31. package/dist/index-6cdefd52.js +22 -0
  32. package/dist/index-822c6d78.js +1 -0
  33. package/dist/index-83293e8e.js +2 -0
  34. package/dist/index-9547c0cf.js +1 -0
  35. package/dist/index-e3ab6de5.js +1 -0
  36. package/dist/index-ecbe3d8d.js +19 -0
  37. package/dist/index.js +1 -1
  38. package/dist/inherits-e2363129.js +1 -0
  39. package/dist/interface-36a3c8cf.js +1 -0
  40. package/dist/node-ponyfill-bda9b4f4.js +1 -0
  41. package/dist/portis-b3fee0d6.js +1 -0
  42. package/dist/provider-30d55a46.js +1 -0
  43. package/dist/providers/connector/safeGnosis/adapter.d.ts +1 -6
  44. package/dist/sha256-8f7b3565.js +1 -0
  45. package/dist/sha3-a5661517.js +9 -0
  46. package/dist/uAuth-343d653d.js +1 -0
  47. package/dist/walletConnect-ea07b187.js +1 -0
  48. package/dist/walletLink-39bc8bdc.js +1 -0
  49. package/package.json +8 -8
  50. package/dist/cjs/index-1d035f96.cjs +0 -1
  51. package/dist/cjs/index-20589cad.cjs +0 -1
  52. package/dist/cjs/index-3c0f322c.cjs +0 -1
  53. package/dist/cjs/index-57e7ce01.cjs +0 -1
  54. package/dist/cjs/index-5f524b54.cjs +0 -1
  55. package/dist/cjs/index-809d42db.cjs +0 -1
  56. package/dist/cjs/index-9726ade3.cjs +0 -1
  57. package/dist/cjs/index-a53895dd.cjs +0 -1
  58. package/dist/cjs/index-b3bae54d.cjs +0 -1
  59. package/dist/cjs/index-b787ad60.cjs +0 -1
  60. package/dist/cjs/index-bd507185.cjs +0 -1
  61. package/dist/cjs/index-e43297ee.cjs +0 -1
  62. package/dist/cjs/portis-0d0ed336.cjs +0 -1
  63. package/dist/cjs/portis-139a9e4d.cjs +0 -1
  64. package/dist/cjs/portis-19c00eba.cjs +0 -1
  65. package/dist/cjs/portis-2053ea4b.cjs +0 -1
  66. package/dist/cjs/provider-216c4ecc.cjs +0 -1
  67. package/dist/cjs/provider-664da1b0.cjs +0 -1
  68. package/dist/cjs/provider-9bce34ab.cjs +0 -1
  69. package/dist/cjs/provider-a9b8a548.cjs +0 -1
  70. package/dist/cjs/uAuth-218d5a4e.cjs +0 -1
  71. package/dist/cjs/uAuth-384147c3.cjs +0 -1
  72. package/dist/cjs/uAuth-5d059de5.cjs +0 -1
  73. package/dist/cjs/uAuth-b52b01e0.cjs +0 -1
  74. package/dist/cjs/walletConnect-02bcbc5c.cjs +0 -1
  75. package/dist/cjs/walletConnect-712b3724.cjs +0 -1
  76. package/dist/cjs/walletConnect-9a4bbbc8.cjs +0 -1
  77. package/dist/cjs/walletConnect-b6ac4960.cjs +0 -1
  78. package/dist/cjs/walletLink-2cd8be6e.cjs +0 -1
  79. package/dist/cjs/walletLink-349e1bf5.cjs +0 -1
  80. package/dist/cjs/walletLink-92f211ff.cjs +0 -1
  81. package/dist/cjs/walletLink-f4cbd510.cjs +0 -1
  82. package/dist/index-4025ab08.js +0 -1
  83. package/dist/index-5ced3e7a.js +0 -1
  84. package/dist/index-677159b8.js +0 -1
  85. package/dist/index-6b9ad9a8.js +0 -1
  86. package/dist/index-6f08dc42.js +0 -1
  87. package/dist/index-829e82f9.js +0 -1
  88. package/dist/index-853b673b.js +0 -1
  89. package/dist/index-8dfaf647.js +0 -1
  90. package/dist/index-be16dd4e.js +0 -1
  91. package/dist/index-be47cca9.js +0 -1
  92. package/dist/index-c7eb0cf4.js +0 -1
  93. package/dist/index-fa3d2d50.js +0 -1
  94. package/dist/portis-32658178.js +0 -1
  95. package/dist/portis-5cb50e65.js +0 -1
  96. package/dist/portis-db858db8.js +0 -1
  97. package/dist/portis-fbb3c228.js +0 -1
  98. package/dist/provider-3fe99d2c.js +0 -1
  99. package/dist/provider-9ab2eb6e.js +0 -1
  100. package/dist/provider-e2314677.js +0 -1
  101. package/dist/provider-f7f5cb2b.js +0 -1
  102. package/dist/uAuth-64c3dda3.js +0 -1
  103. package/dist/uAuth-9f7c98e7.js +0 -1
  104. package/dist/uAuth-ddaae2b5.js +0 -1
  105. package/dist/uAuth-e4b5c839.js +0 -1
  106. package/dist/walletConnect-1a1a1062.js +0 -1
  107. package/dist/walletConnect-2b8f3354.js +0 -1
  108. package/dist/walletConnect-4c410280.js +0 -1
  109. package/dist/walletConnect-fb4a3e3c.js +0 -1
  110. package/dist/walletLink-5b9fdf98.js +0 -1
  111. package/dist/walletLink-98193680.js +0 -1
  112. package/dist/walletLink-986484a1.js +0 -1
  113. package/dist/walletLink-cf8da449.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";var t=require("./index-e948d9e4.cjs"),e=require("./_commonjsHelpers-66ecbaf8.cjs"),n=require("./index-6d7369f7.cjs"),r=require("./inherits-6d52d55b.cjs"),i=require("./index-e0e60b3b.cjs"),s=require("util"),o=require("stream"),a=require("events"),u=require("buffer"),c=require("./index-f7522058.cjs");function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}require("@ethersproject/providers"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/address"),require("valtio"),require("tty"),require("os");var h=l(s),d=l(o),f=l(a),p=l(u),b={},y={},g={};Object.defineProperty(g,"__esModule",{value:!0}),g.walletLogo=void 0;g.walletLogo=(t,e)=>{let n;switch(t){case"standard":default:return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 m={};Object.defineProperty(m,"__esModule",{value:!0}),m.ScopedLocalStorage=void 0;m.ScopedLocalStorage=class{constructor(t){this.scope=t}setItem(t,e){localStorage.setItem(this.scopedKey(t),e)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),e=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);"string"==typeof r&&r.startsWith(t)&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}scopedKey(t){return`${this.scope}:${t}`}};var v={},_={exports:{}};!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function i(t,e,n){if(i.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var s;"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(t){}function o(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function a(t,e,n){var r=o(t,n);return n-1>=e&&(r|=o(t,n-1)<<4),r}function u(t,e,r,i){for(var s=0,o=0,a=Math.min(t.length,r),u=e;u<a;u++){var c=t.charCodeAt(u)-48;s*=i,o=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&o<i,"Invalid character"),s+=o}return s}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(i.isBN=function(t){return t instanceof i||null!==t&&"object"==typeof t&&t.constructor.wordSize===i.wordSize&&Array.isArray(t.words)},i.max=function(t,e){return t.cmp(e)>0?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},i.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},i.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var s,o,a=0;if("be"===r)for(i=t.length-1,s=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(i=0,s=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},i.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,s=0,o=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=a(t,e,r)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=a(t,e,r)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this._strip()},i.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var s=t.length-n,o=s%r,a=Math.min(s,s-o)+n,c=0,l=n;l<a;l+=r)c=u(t,l,l+r,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var h=1;for(c=u(t,l,t.length,e),l=0;l<o;l++)h*=e;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},i.prototype._move=function(t){c(t,this)},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,a=67108863&o,u=o/67108864|0;n.words[0]=a;for(var c=1;c<r;c++){for(var l=u>>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(o=(i=0|t.words[p])*(s=0|e.words[f])+h)/67108864|0,h=67108863&o}n.words[c]=0|h,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}i.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,s=0,o=0;o<this.length;o++){var a=this.words[o],u=(16777215&(a<<i|s)).toString(16);s=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==s||o!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modrn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:h[c-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},i.prototype.toJSON=function(){return this.toString(16,2)},s&&(i.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),i.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},i.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,s);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,i),o},i.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|r;t[n++]=255&o,n<t.length&&(t[n++]=o>>8&255),n<t.length&&(t[n++]=o>>16&255),6===s?(n<t.length&&(t[n++]=o>>24&255),r=0,s=0):(r=o>>>24,s+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},i.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,s=0;i<this.length;i++){var o=this.words[i]<<s|r;t[n--]=255&o,n>=0&&(t[n--]=o>>8&255),n>=0&&(t[n--]=o>>16&255),6===s?(n>=0&&(t[n--]=o>>24&255),r=0,s=0):(r=o>>>24,s+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},i.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},i.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},i.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},i.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},i.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(t){return this.clone().inotn(t)},i.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,s=0;s<r.length;s++)e=(0|n.words[s])+(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<n.length;s++)e=(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this},i.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},i.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(e=(0|n.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<n.length;o++)s=(e=(0|n.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(t){return this.clone().isub(t)};var b=function(t,e,n){var r,i,s,o=t.words,a=e.words,u=n.words,c=0,l=0|o[0],h=8191&l,d=l>>>13,f=0|o[1],p=8191&f,b=f>>>13,y=0|o[2],g=8191&y,m=y>>>13,v=0|o[3],_=8191&v,w=v>>>13,S=0|o[4],M=8191&S,E=S>>>13,x=0|o[5],k=8191&x,C=x>>>13,I=0|o[6],A=8191&I,N=I>>>13,R=0|o[7],j=8191&R,T=R>>>13,O=0|o[8],L=8191&O,P=O>>>13,D=0|o[9],B=8191&D,F=D>>>13,W=0|a[0],U=8191&W,H=W>>>13,V=0|a[1],z=8191&V,q=V>>>13,G=0|a[2],Z=8191&G,$=G>>>13,Q=0|a[3],Y=8191&Q,J=Q>>>13,K=0|a[4],X=8191&K,tt=K>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,it=0|a[6],st=8191&it,ot=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,dt=lt>>>13,ft=0|a[9],pt=8191&ft,bt=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var yt=(c+(r=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(d,U)|0))<<13)|0;c=((s=Math.imul(d,H))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,H))+Math.imul(b,U)|0,s=Math.imul(b,H);var gt=(c+(r=r+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(d,z)|0))<<13)|0;c=((s=s+Math.imul(d,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(g,U),i=(i=Math.imul(g,H))+Math.imul(m,U)|0,s=Math.imul(m,H),r=r+Math.imul(p,z)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(b,z)|0,s=s+Math.imul(b,q)|0;var mt=(c+(r=r+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(d,Z)|0))<<13)|0;c=((s=s+Math.imul(d,$)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(_,U),i=(i=Math.imul(_,H))+Math.imul(w,U)|0,s=Math.imul(w,H),r=r+Math.imul(g,z)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(m,z)|0,s=s+Math.imul(m,q)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Z)|0,s=s+Math.imul(b,$)|0;var vt=(c+(r=r+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,Y)|0))<<13)|0;c=((s=s+Math.imul(d,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(M,U),i=(i=Math.imul(M,H))+Math.imul(E,U)|0,s=Math.imul(E,H),r=r+Math.imul(_,z)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,z)|0,s=s+Math.imul(w,q)|0,r=r+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(m,Z)|0,s=s+Math.imul(m,$)|0,r=r+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Y)|0,s=s+Math.imul(b,J)|0;var _t=(c+(r=r+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,X)|0))<<13)|0;c=((s=s+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(k,U),i=(i=Math.imul(k,H))+Math.imul(C,U)|0,s=Math.imul(C,H),r=r+Math.imul(M,z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(E,z)|0,s=s+Math.imul(E,q)|0,r=r+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(w,Z)|0,s=s+Math.imul(w,$)|0,r=r+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,J)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,X)|0,s=s+Math.imul(b,tt)|0;var wt=(c+(r=r+Math.imul(h,nt)|0)|0)+((8191&(i=(i=i+Math.imul(h,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((s=s+Math.imul(d,rt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(A,U),i=(i=Math.imul(A,H))+Math.imul(N,U)|0,s=Math.imul(N,H),r=r+Math.imul(k,z)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(C,z)|0,s=s+Math.imul(C,q)|0,r=r+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(E,Z)|0,s=s+Math.imul(E,$)|0,r=r+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(w,Y)|0,s=s+Math.imul(w,J)|0,r=r+Math.imul(g,X)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(m,X)|0,s=s+Math.imul(m,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(b,nt)|0,s=s+Math.imul(b,rt)|0;var St=(c+(r=r+Math.imul(h,st)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(d,st)|0))<<13)|0;c=((s=s+Math.imul(d,ot)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(j,U),i=(i=Math.imul(j,H))+Math.imul(T,U)|0,s=Math.imul(T,H),r=r+Math.imul(A,z)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(N,z)|0,s=s+Math.imul(N,q)|0,r=r+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(C,Z)|0,s=s+Math.imul(C,$)|0,r=r+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,J)|0,r=r+Math.imul(_,X)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,X)|0,s=s+Math.imul(w,tt)|0,r=r+Math.imul(g,nt)|0,i=(i=i+Math.imul(g,rt)|0)+Math.imul(m,nt)|0,s=s+Math.imul(m,rt)|0,r=r+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ot)|0)+Math.imul(b,st)|0,s=s+Math.imul(b,ot)|0;var Mt=(c+(r=r+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((s=s+Math.imul(d,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,U),i=(i=Math.imul(L,H))+Math.imul(P,U)|0,s=Math.imul(P,H),r=r+Math.imul(j,z)|0,i=(i=i+Math.imul(j,q)|0)+Math.imul(T,z)|0,s=s+Math.imul(T,q)|0,r=r+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(N,Z)|0,s=s+Math.imul(N,$)|0,r=r+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(C,Y)|0,s=s+Math.imul(C,J)|0,r=r+Math.imul(M,X)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(E,X)|0,s=s+Math.imul(E,tt)|0,r=r+Math.imul(_,nt)|0,i=(i=i+Math.imul(_,rt)|0)+Math.imul(w,nt)|0,s=s+Math.imul(w,rt)|0,r=r+Math.imul(g,st)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(m,st)|0,s=s+Math.imul(m,ot)|0,r=r+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(b,ut)|0,s=s+Math.imul(b,ct)|0;var Et=(c+(r=r+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((s=s+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(B,U),i=(i=Math.imul(B,H))+Math.imul(F,U)|0,s=Math.imul(F,H),r=r+Math.imul(L,z)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(P,z)|0,s=s+Math.imul(P,q)|0,r=r+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,$)|0)+Math.imul(T,Z)|0,s=s+Math.imul(T,$)|0,r=r+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(N,Y)|0,s=s+Math.imul(N,J)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,X)|0,s=s+Math.imul(C,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(E,nt)|0,s=s+Math.imul(E,rt)|0,r=r+Math.imul(_,st)|0,i=(i=i+Math.imul(_,ot)|0)+Math.imul(w,st)|0,s=s+Math.imul(w,ot)|0,r=r+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(m,ut)|0,s=s+Math.imul(m,ct)|0,r=r+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,s=s+Math.imul(b,dt)|0;var xt=(c+(r=r+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((s=s+Math.imul(d,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(B,z),i=(i=Math.imul(B,q))+Math.imul(F,z)|0,s=Math.imul(F,q),r=r+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(P,Z)|0,s=s+Math.imul(P,$)|0,r=r+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,J)|0,r=r+Math.imul(A,X)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(N,X)|0,s=s+Math.imul(N,tt)|0,r=r+Math.imul(k,nt)|0,i=(i=i+Math.imul(k,rt)|0)+Math.imul(C,nt)|0,s=s+Math.imul(C,rt)|0,r=r+Math.imul(M,st)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(E,st)|0,s=s+Math.imul(E,ot)|0,r=r+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,ut)|0,s=s+Math.imul(w,ct)|0,r=r+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(m,ht)|0,s=s+Math.imul(m,dt)|0;var kt=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((s=s+Math.imul(b,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(B,Z),i=(i=Math.imul(B,$))+Math.imul(F,Z)|0,s=Math.imul(F,$),r=r+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,J)|0,r=r+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul(T,X)|0,s=s+Math.imul(T,tt)|0,r=r+Math.imul(A,nt)|0,i=(i=i+Math.imul(A,rt)|0)+Math.imul(N,nt)|0,s=s+Math.imul(N,rt)|0,r=r+Math.imul(k,st)|0,i=(i=i+Math.imul(k,ot)|0)+Math.imul(C,st)|0,s=s+Math.imul(C,ot)|0,r=r+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(E,ut)|0,s=s+Math.imul(E,ct)|0,r=r+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(w,ht)|0,s=s+Math.imul(w,dt)|0;var Ct=(c+(r=r+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((s=s+Math.imul(m,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(B,Y),i=(i=Math.imul(B,J))+Math.imul(F,Y)|0,s=Math.imul(F,J),r=r+Math.imul(L,X)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(P,X)|0,s=s+Math.imul(P,tt)|0,r=r+Math.imul(j,nt)|0,i=(i=i+Math.imul(j,rt)|0)+Math.imul(T,nt)|0,s=s+Math.imul(T,rt)|0,r=r+Math.imul(A,st)|0,i=(i=i+Math.imul(A,ot)|0)+Math.imul(N,st)|0,s=s+Math.imul(N,ot)|0,r=r+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,s=s+Math.imul(C,ct)|0,r=r+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(E,ht)|0,s=s+Math.imul(E,dt)|0;var It=(c+(r=r+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,bt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((s=s+Math.imul(w,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(B,X),i=(i=Math.imul(B,tt))+Math.imul(F,X)|0,s=Math.imul(F,tt),r=r+Math.imul(L,nt)|0,i=(i=i+Math.imul(L,rt)|0)+Math.imul(P,nt)|0,s=s+Math.imul(P,rt)|0,r=r+Math.imul(j,st)|0,i=(i=i+Math.imul(j,ot)|0)+Math.imul(T,st)|0,s=s+Math.imul(T,ot)|0,r=r+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(N,ut)|0,s=s+Math.imul(N,ct)|0,r=r+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(C,ht)|0,s=s+Math.imul(C,dt)|0;var At=(c+(r=r+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,bt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((s=s+Math.imul(E,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(B,nt),i=(i=Math.imul(B,rt))+Math.imul(F,nt)|0,s=Math.imul(F,rt),r=r+Math.imul(L,st)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(P,st)|0,s=s+Math.imul(P,ot)|0,r=r+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ct)|0)+Math.imul(T,ut)|0,s=s+Math.imul(T,ct)|0,r=r+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(N,ht)|0,s=s+Math.imul(N,dt)|0;var Nt=(c+(r=r+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((s=s+Math.imul(C,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,r=Math.imul(B,st),i=(i=Math.imul(B,ot))+Math.imul(F,st)|0,s=Math.imul(F,ot),r=r+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(P,ut)|0,s=s+Math.imul(P,ct)|0,r=r+Math.imul(j,ht)|0,i=(i=i+Math.imul(j,dt)|0)+Math.imul(T,ht)|0,s=s+Math.imul(T,dt)|0;var Rt=(c+(r=r+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,bt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((s=s+Math.imul(N,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(F,ut)|0,s=Math.imul(F,ct),r=r+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,dt)|0)+Math.imul(P,ht)|0,s=s+Math.imul(P,dt)|0;var jt=(c+(r=r+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,bt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((s=s+Math.imul(T,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,r=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(F,ht)|0,s=Math.imul(F,dt);var Tt=(c+(r=r+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,bt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((s=s+Math.imul(P,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863;var Ot=(c+(r=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,bt))+Math.imul(F,pt)|0))<<13)|0;return c=((s=Math.imul(F,bt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=yt,u[1]=gt,u[2]=mt,u[3]=vt,u[4]=_t,u[5]=wt,u[6]=St,u[7]=Mt,u[8]=Et,u[9]=xt,u[10]=kt,u[11]=Ct,u[12]=It,u[13]=At,u[14]=Nt,u[15]=Rt,u[16]=jt,u[17]=Tt,u[18]=Ot,0!==c&&(u[19]=c,n.length++),n};function y(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,s=0;s<n.length-1;s++){var o=i;i=0;for(var a=67108863&r,u=Math.min(s,e.length-1),c=Math.max(0,s-t.length+1);c<=u;c++){var l=s-c,h=(0|t.words[l])*(0|e.words[c]),d=67108863&h;a=67108863&(d=d+a|0),i+=(o=(o=o+(h/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}n.words[s]=a,r=o,o=i}return 0!==r?n.words[s]=r:n.length--,n._strip()}function g(t,e,n){return y(t,e,n)}Math.imul||(b=p),i.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):n<63?p(this,t,e):n<1024?y(this,t,e):g(this,t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.mulf=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),g(this,t,e)},i.prototype.imul=function(t){return this.clone().mulTo(t,this)},i.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var s=(0|this.words[i])*t,o=(67108863&s)+(67108863&r);r>>=26,r+=s/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new i(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var s=n.sqr();r<e.length;r++,s=s.sqr())0!==e[r]&&(n=n.mul(s));return n},i.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,u=(0|this.words[e])-a<<r;this.words[e]=u|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},i.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,u=r;if(i-=o,i=Math.max(0,i),u){for(var c=0;c<o;c++)u.words[c]=this.words[c];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-s|h>>>s,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},i.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},i.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,r){var i,s,o=t.length+r;this._expand(o);var a=0;for(i=0;i<t.length;i++){s=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((s-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&s}for(;i<this.length-r;i++)a=(s=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&s;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(s=-(0|this.words[i])+a)>>26,this.words[i]=67108863&s;return this.negative=1,this._strip()},i.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),s=t,o=0|s.words[s.length-1];0!=(n=26-this._countBits(o))&&(s=s.ushln(n),r.iushln(n),o=0|s.words[s.length-1]);var a,u=r.length-s.length;if("mod"!==e){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=r.clone()._ishlnsubmul(s,1,u);0===l.negative&&(r=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*(0|r.words[s.length+h])+(0|r.words[s.length+h-1]);for(d=Math.min(d/o|0,67108863),r._ishlnsubmul(s,d,h);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(s,1,h),r.isZero()||(r.negative^=1);a&&(a.words[h]=d)}return a&&a._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},i.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(s=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:s,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(s=a.div.neg()),{div:s,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modrn(t.words[0]))}:this._wordDiv(t,e);var s,o,a},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),s=n.cmp(r);return s<0||1===i&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,s=this.length-1;s>=0;s--)i=(r*i+(0|this.words[s]))%t;return e?-i:i},i.prototype.modn=function(t){return this.modrn(t)},i.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var s=(0|this.words[i])+67108864*r;this.words[i]=s/t|0,r=s%t}return this._strip(),e?this.ineg():this},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s=new i(1),o=new i(0),a=new i(0),u=new i(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(s.isOdd()||o.isOdd())&&(s.iadd(l),o.isub(h)),s.iushrn(1),o.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a),o.isub(u)):(r.isub(e),a.isub(s),u.isub(o))}return{a:a,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var s,o=new i(1),a=new i(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(a)):(r.isub(e),a.isub(o))}return(s=0===e.cmpn(1)?o:a).cmpn(0)<0&&s.iadd(t),s},i.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var s=e;e=n,n=s}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var s=i,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},i.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},i.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},i.prototype.gtn=function(t){return 1===this.cmpn(t)},i.prototype.gt=function(t){return 1===this.cmp(t)},i.prototype.gten=function(t){return this.cmpn(t)>=0},i.prototype.gte=function(t){return this.cmp(t)>=0},i.prototype.ltn=function(t){return-1===this.cmpn(t)},i.prototype.lt=function(t){return-1===this.cmp(t)},i.prototype.lten=function(t){return this.cmpn(t)<=0},i.prototype.lte=function(t){return this.cmp(t)<=0},i.prototype.eqn=function(t){return 0===this.cmpn(t)},i.prototype.eq=function(t){return 0===this.cmp(t)},i.red=function(t){return new E(t)},i.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},r(_,v),_.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var s=t.words[9];for(e.words[e.length++]=s&n,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(o&n)<<4|s>>>22,s=o}s>>>=22,t.words[i-10]=s,0===s&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(w,v),r(S,v),r(M,v),M.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new w;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return m[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new i(1)).iushrn(2);return this.pow(t,r)}for(var s=this.m.subn(1),o=0;!s.isZero()&&0===s.andln(1);)o++,s.iushrn(1);n(!s.isZero());var a=new i(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,s),d=this.pow(t,s.addn(1).iushrn(1)),f=this.pow(t,s),p=o;0!==f.cmp(a);){for(var b=f,y=0;0!==b.cmp(a);y++)b=b.redSqr();n(y<p);var g=this.pow(h,new i(1).iushln(p-y-1));d=d.redMul(g),h=g.redSqr(),f=f.redMul(h),p=y}return d},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new i(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var s=n[0],o=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),r=e.length-1;r>=0;r--){for(var c=e.words[r],l=u-1;l>=0;l--){var h=c>>l&1;s!==n[0]&&(s=this.sqr(s)),0!==h||0!==o?(o<<=1,o|=h,(4==++a||0===r&&0===l)&&(s=this.mul(s,n[o]),a=0,o=0)):a=0}u=26}return s},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new x(t)},r(x,E),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new i(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),s=n.isub(r).iushrn(this.shift),o=s;return s.cmp(this.m)>=0?o=s.isub(this.m):s.cmpn(0)<0&&(o=s.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(_,e.commonjsGlobal);var w={},S={};Object.defineProperty(S,"__esModule",{value:!0}),S.EthereumProviderError=S.EthereumRpcError=void 0;const M=n.fastSafeStringify;class E extends Error{constructor(t,e,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==n&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return M.default(this.serialize(),x,2)}}S.EthereumRpcError=E;function x(t,e){if("[Circular]"!==e)return e}S.EthereumProviderError=class extends E{constructor(t,e,n){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,n)}};var k={},C={};Object.defineProperty(C,"__esModule",{value:!0}),C.errorValues=C.errorCodes=void 0,C.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}},C.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(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=C,n=S,r=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:r,message:o(r)};function o(n,r=i){if(Number.isInteger(n)){const r=n.toString();if(l(e.errorValues,r))return e.errorValues[r].message;if(u(n))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function a(t){if(!Number.isInteger(t))return!1;const n=t.toString();return!!e.errorValues[n]||!!u(t)}function u(t){return t>=-32099&&t<=-32e3}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=o,t.isValidCode=a,t.serializeError=function(t,{fallbackError:e=s,shouldIncludeStack:r=!1}={}){var i,u;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof n.EthereumRpcError)return t.serialize();const h={};if(t&&"object"==typeof t&&!Array.isArray(t)&&l(t,"code")&&a(t.code)){const e=t;h.code=e.code,e.message&&"string"==typeof e.message?(h.message=e.message,l(e,"data")&&(h.data=e.data)):(h.message=o(h.code),h.data={originalError:c(t)})}else{h.code=e.code;const n=null===(i=t)||void 0===i?void 0:i.message;h.message=n&&"string"==typeof n?n:e.message,h.data={originalError:c(t)}}const d=null===(u=t)||void 0===u?void 0:u.stack;return r&&t&&d&&"string"==typeof d&&(h.stack=d),h}}(k);var I={};Object.defineProperty(I,"__esModule",{value:!0}),I.ethErrors=void 0;const A=S,N=k,R=C;function j(t,e){const[n,r]=O(e);return new A.EthereumRpcError(t,n||N.getMessageFromCode(t),r)}function T(t,e){const[n,r]=O(e);return new A.EthereumProviderError(t,n||N.getMessageFromCode(t),r)}function O(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,n]}}return[]}I.ethErrors={rpc:{parse:t=>j(R.errorCodes.rpc.parse,t),invalidRequest:t=>j(R.errorCodes.rpc.invalidRequest,t),invalidParams:t=>j(R.errorCodes.rpc.invalidParams,t),methodNotFound:t=>j(R.errorCodes.rpc.methodNotFound,t),internal:t=>j(R.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return j(e,t)},invalidInput:t=>j(R.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>j(R.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>j(R.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>j(R.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>j(R.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>j(R.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>T(R.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>T(R.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>T(R.errorCodes.provider.unsupportedMethod,t),disconnected:t=>T(R.errorCodes.provider.disconnected,t),chainDisconnected:t=>T(R.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:r}=t;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new A.EthereumProviderError(e,n,r)}}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=S;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const n=k;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const r=I;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return r.ethErrors}});const i=C;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(w);var L={};Object.defineProperty(L,"__esModule",{value:!0}),L.EVENTS=void 0,L.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 P={},D={exports:{}},B=i.safeBuffer.exports.Buffer;function F(t,e){this._block=B.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}F.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=B.from(t,e));for(var n=this._block,r=this._blockSize,i=t.length,s=this._len,o=0;o<i;){for(var a=s%r,u=Math.min(i-o,r-a),c=0;c<u;c++)n[a+c]=t[o+c];o+=u,(s+=u)%r==0&&this._update(n)}return this._len+=i,this},F.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s},F.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var W=F,U=r.inherits.exports,H=W,V=i.safeBuffer.exports.Buffer,z=[1518500249,1859775393,-1894007588,-899497514],q=new Array(80);function G(){this.init(),this._w=q,H.call(this,64,56)}function Z(t){return t<<30|t>>>2}function $(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}U(G,H),G.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},G.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,s=0|this._c,o=0|this._d,a=0|this._e,u=0;u<16;++u)n[u]=t.readInt32BE(4*u);for(;u<80;++u)n[u]=n[u-3]^n[u-8]^n[u-14]^n[u-16];for(var c=0;c<80;++c){var l=~~(c/20),h=0|((e=r)<<5|e>>>27)+$(l,i,s,o)+a+n[c]+z[l];a=o,o=s,s=Z(i),i=r,r=h}this._a=r+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0},G.prototype._hash=function(){var t=V.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var Q=G,Y=r.inherits.exports,J=W,K=i.safeBuffer.exports.Buffer,X=[1518500249,1859775393,-1894007588,-899497514],tt=new Array(80);function et(){this.init(),this._w=tt,J.call(this,64,56)}function nt(t){return t<<5|t>>>27}function rt(t){return t<<30|t>>>2}function it(t,e,n,r){return 0===t?e&n|~e&r:2===t?e&n|e&r|n&r:e^n^r}Y(et,J),et.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},et.prototype._update=function(t){for(var e,n=this._w,r=0|this._a,i=0|this._b,s=0|this._c,o=0|this._d,a=0|this._e,u=0;u<16;++u)n[u]=t.readInt32BE(4*u);for(;u<80;++u)n[u]=(e=n[u-3]^n[u-8]^n[u-14]^n[u-16])<<1|e>>>31;for(var c=0;c<80;++c){var l=~~(c/20),h=nt(r)+it(l,i,s,o)+a+n[c]+X[l]|0;a=o,o=s,s=rt(i),i=r,r=h}this._a=r+this._a|0,this._b=i+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=a+this._e|0},et.prototype._hash=function(){var t=K.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var st=et,ot=r.inherits.exports,at=W,ut=i.safeBuffer.exports.Buffer,ct=[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],lt=new Array(64);function ht(){this.init(),this._w=lt,at.call(this,64,56)}function dt(t,e,n){return n^t&(e^n)}function ft(t,e,n){return t&e|n&(t|e)}function pt(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function bt(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function yt(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function gt(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}ot(ht,at),ht.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},ht.prototype._update=function(t){for(var e=this._w,n=0|this._a,r=0|this._b,i=0|this._c,s=0|this._d,o=0|this._e,a=0|this._f,u=0|this._g,c=0|this._h,l=0;l<16;++l)e[l]=t.readInt32BE(4*l);for(;l<64;++l)e[l]=gt(e[l-2])+e[l-7]+yt(e[l-15])+e[l-16]|0;for(var h=0;h<64;++h){var d=c+bt(o)+dt(o,a,u)+ct[h]+e[h]|0,f=pt(n)+ft(n,r,i)|0;c=u,u=a,a=o,o=s+d|0,s=i,i=r,r=n,n=d+f|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},ht.prototype._hash=function(){var t=ut.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var mt=ht,vt=r.inherits.exports,_t=mt,wt=W,St=i.safeBuffer.exports.Buffer,Mt=new Array(64);function Et(){this.init(),this._w=Mt,wt.call(this,64,56)}vt(Et,_t),Et.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},Et.prototype._hash=function(){var t=St.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var xt=Et,kt=r.inherits.exports,Ct=W,It=i.safeBuffer.exports.Buffer,At=[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],Nt=new Array(160);function Rt(){this.init(),this._w=Nt,Ct.call(this,128,112)}function jt(t,e,n){return n^t&(e^n)}function Tt(t,e,n){return t&e|n&(t|e)}function Ot(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Lt(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function Pt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function Dt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function Bt(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function Ft(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Wt(t,e){return t>>>0<e>>>0?1:0}kt(Rt,Ct),Rt.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},Rt.prototype._update=function(t){for(var e=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,s=0|this._dh,o=0|this._eh,a=0|this._fh,u=0|this._gh,c=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)e[m]=t.readInt32BE(4*m),e[m+1]=t.readInt32BE(4*m+4);for(;m<160;m+=2){var v=e[m-30],_=e[m-30+1],w=Pt(v,_),S=Dt(_,v),M=Bt(v=e[m-4],_=e[m-4+1]),E=Ft(_,v),x=e[m-14],k=e[m-14+1],C=e[m-32],I=e[m-32+1],A=S+k|0,N=w+x+Wt(A,S)|0;N=(N=N+M+Wt(A=A+E|0,E)|0)+C+Wt(A=A+I|0,I)|0,e[m]=N,e[m+1]=A}for(var R=0;R<160;R+=2){N=e[R],A=e[R+1];var j=Tt(n,r,i),T=Tt(l,h,d),O=Ot(n,l),L=Ot(l,n),P=Lt(o,p),D=Lt(p,o),B=At[R],F=At[R+1],W=jt(o,a,u),U=jt(p,b,y),H=g+D|0,V=c+P+Wt(H,g)|0;V=(V=(V=V+W+Wt(H=H+U|0,U)|0)+B+Wt(H=H+F|0,F)|0)+N+Wt(H=H+A|0,A)|0;var z=L+T|0,q=O+j+Wt(z,L)|0;c=u,g=y,u=a,y=b,a=o,b=p,o=s+V+Wt(p=f+H|0,f)|0,s=i,f=d,i=r,d=h,r=n,h=l,n=V+q+Wt(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+n+Wt(this._al,l)|0,this._bh=this._bh+r+Wt(this._bl,h)|0,this._ch=this._ch+i+Wt(this._cl,d)|0,this._dh=this._dh+s+Wt(this._dl,f)|0,this._eh=this._eh+o+Wt(this._el,p)|0,this._fh=this._fh+a+Wt(this._fl,b)|0,this._gh=this._gh+u+Wt(this._gl,y)|0,this._hh=this._hh+c+Wt(this._hl,g)|0},Rt.prototype._hash=function(){var t=It.allocUnsafe(64);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Ut=Rt,Ht=r.inherits.exports,Vt=Ut,zt=W,qt=i.safeBuffer.exports.Buffer,Gt=new Array(160);function Zt(){this.init(),this._w=Gt,zt.call(this,128,112)}Ht(Zt,Vt),Zt.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},Zt.prototype._hash=function(){var t=qt.allocUnsafe(48);function e(e,n,r){t.writeInt32BE(e,r),t.writeInt32BE(n,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var $t=Zt,Qt=D.exports=function(t){t=t.toLowerCase();var e=Qt[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};Qt.sha=Q,Qt.sha1=st,Qt.sha224=xt,Qt.sha256=mt,Qt.sha384=$t,Qt.sha512=Ut;var Yt,Jt={},Kt="undefined"!=typeof Symbol&&Symbol,Xt=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0},te=Array.prototype.slice,ee=Object.prototype.toString,ne=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==ee.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n,r=te.call(arguments,1),i=Math.max(0,e.length-r.length),s=[],o=0;o<i;o++)s.push("$"+o);if(n=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var i=e.apply(this,r.concat(te.call(arguments)));return Object(i)===i?i:this}return e.apply(t,r.concat(te.call(arguments)))})),e.prototype){var a=function(){};a.prototype=e.prototype,n.prototype=new a,a.prototype=null}return n},re=Function.prototype.bind||ne,ie=re.call(Function.call,Object.prototype.hasOwnProperty),se=SyntaxError,oe=Function,ae=TypeError,ue=function(t){try{return oe('"use strict"; return ('+t+").constructor;")()}catch(t){}},ce=Object.getOwnPropertyDescriptor;if(ce)try{ce({},"")}catch(th){ce=null}var le=function(){throw new ae},he=ce?function(){try{return le}catch(t){try{return ce(arguments,"callee").get}catch(t){return le}}}():le,de="function"==typeof Kt&&"function"==typeof Symbol&&"symbol"==typeof Kt("foo")&&"symbol"==typeof Symbol("bar")&&Xt(),fe=Object.getPrototypeOf||function(t){return t.__proto__},pe={},be="undefined"==typeof Uint8Array?Yt:fe(Uint8Array),ye={"%AggregateError%":"undefined"==typeof AggregateError?Yt:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Yt:ArrayBuffer,"%ArrayIteratorPrototype%":de?fe([][Symbol.iterator]()):Yt,"%AsyncFromSyncIteratorPrototype%":Yt,"%AsyncFunction%":pe,"%AsyncGenerator%":pe,"%AsyncGeneratorFunction%":pe,"%AsyncIteratorPrototype%":pe,"%Atomics%":"undefined"==typeof Atomics?Yt:Atomics,"%BigInt%":"undefined"==typeof BigInt?Yt:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Yt:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Yt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Yt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?Yt:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Yt:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Yt:FinalizationRegistry,"%Function%":oe,"%GeneratorFunction%":pe,"%Int8Array%":"undefined"==typeof Int8Array?Yt:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Yt:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Yt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":de?fe(fe([][Symbol.iterator]())):Yt,"%JSON%":"object"==typeof JSON?JSON:Yt,"%Map%":"undefined"==typeof Map?Yt:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&de?fe((new Map)[Symbol.iterator]()):Yt,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Yt:Promise,"%Proxy%":"undefined"==typeof Proxy?Yt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?Yt:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Yt:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&de?fe((new Set)[Symbol.iterator]()):Yt,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Yt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":de?fe(""[Symbol.iterator]()):Yt,"%Symbol%":de?Symbol:Yt,"%SyntaxError%":se,"%ThrowTypeError%":he,"%TypedArray%":be,"%TypeError%":ae,"%Uint8Array%":"undefined"==typeof Uint8Array?Yt:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Yt:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Yt:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Yt:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?Yt:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Yt:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Yt:WeakSet};try{null.error}catch(th){var ge=fe(fe(th));ye["%Error.prototype%"]=ge}var me=function t(e){var n;if("%AsyncFunction%"===e)n=ue("async function () {}");else if("%GeneratorFunction%"===e)n=ue("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=ue("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(n=fe(i.prototype))}return ye[e]=n,n},ve={"%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"]},_e=re,we=ie,Se=_e.call(Function.call,Array.prototype.concat),Me=_e.call(Function.apply,Array.prototype.splice),Ee=_e.call(Function.call,String.prototype.replace),xe=_e.call(Function.call,String.prototype.slice),ke=_e.call(Function.call,RegExp.prototype.exec),Ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ie=/\\(\\)?/g,Ae=function(t,e){var n,r=t;if(we(ve,r)&&(r="%"+(n=ve[r])[0]+"%"),we(ye,r)){var i=ye[r];if(i===pe&&(i=me(r)),void 0===i&&!e)throw new ae("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:i}}throw new se("intrinsic "+t+" does not exist!")},Ne=function(t,e){if("string"!=typeof t||0===t.length)throw new ae("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new ae('"allowMissing" argument must be a boolean');if(null===ke(/^%?[^%]*%?$/,t))throw new se("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(t){var e=xe(t,0,1),n=xe(t,-1);if("%"===e&&"%"!==n)throw new se("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new se("invalid intrinsic syntax, expected opening `%`");var r=[];return Ee(t,Ce,(function(t,e,n,i){r[r.length]=n?Ee(i,Ie,"$1"):e||t})),r}(t),r=n.length>0?n[0]:"",i=Ae("%"+r+"%",e),s=i.name,o=i.value,a=!1,u=i.alias;u&&(r=u[0],Me(n,Se([0,1],u)));for(var c=1,l=!0;c<n.length;c+=1){var h=n[c],d=xe(h,0,1),f=xe(h,-1);if(('"'===d||"'"===d||"`"===d||'"'===f||"'"===f||"`"===f)&&d!==f)throw new se("property names with quotes must have matching quotes");if("constructor"!==h&&l||(a=!0),we(ye,s="%"+(r+="."+h)+"%"))o=ye[s];else if(null!=o){if(!(h in o)){if(!e)throw new ae("base intrinsic for "+t+" exists, but the property is not available.");return}if(ce&&c+1>=n.length){var p=ce(o,h);o=(l=!!p)&&"get"in p&&!("originalValue"in p.get)?p.get:o[h]}else l=we(o,h),o=o[h];l&&!a&&(ye[s]=o)}}return o},Re={exports:{}};!function(t){var e=re,n=Ne,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),s=n("%Reflect.apply%",!0)||e.call(i,r),o=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch(t){a=null}t.exports=function(t){var n=s(e,i,arguments);o&&a&&(o(n,"length").configurable&&a(n,"length",{value:1+u(0,t.length-(arguments.length-1))}));return n};var c=function(){return s(e,r,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c}(Re);var je=Ne,Te=Re.exports,Oe=Te(je("String.prototype.indexOf")),Le=h.default.inspect,Pe="function"==typeof Map&&Map.prototype,De=Object.getOwnPropertyDescriptor&&Pe?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Be=Pe&&De&&"function"==typeof De.get?De.get:null,Fe=Pe&&Map.prototype.forEach,We="function"==typeof Set&&Set.prototype,Ue=Object.getOwnPropertyDescriptor&&We?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,He=We&&Ue&&"function"==typeof Ue.get?Ue.get:null,Ve=We&&Set.prototype.forEach,ze="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,qe="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Ge="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,Ze=Boolean.prototype.valueOf,$e=Object.prototype.toString,Qe=Function.prototype.toString,Ye=String.prototype.match,Je=String.prototype.slice,Ke=String.prototype.replace,Xe=String.prototype.toUpperCase,tn=String.prototype.toLowerCase,en=RegExp.prototype.test,nn=Array.prototype.concat,rn=Array.prototype.join,sn=Array.prototype.slice,on=Math.floor,an="function"==typeof BigInt?BigInt.prototype.valueOf:null,un=Object.getOwnPropertySymbols,cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,ln="function"==typeof Symbol&&"object"==typeof Symbol.iterator,hn="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ln||"symbol")?Symbol.toStringTag:null,dn=Object.prototype.propertyIsEnumerable,fn=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function pn(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||en.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var r=t<0?-on(-t):on(t);if(r!==t){var i=String(r),s=Je.call(e,i.length+1);return Ke.call(i,n,"$&_")+"."+Ke.call(Ke.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ke.call(e,n,"$&_")}var bn=Le,yn=bn.custom,gn=Sn(yn)?yn:null;function mn(t,e,n){var r="double"===(n.quoteStyle||e)?'"':"'";return r+t+r}function vn(t){return Ke.call(String(t),/"/g,"&quot;")}function _n(t){return!("[object Array]"!==xn(t)||hn&&"object"==typeof t&&hn in t)}function wn(t){return!("[object RegExp]"!==xn(t)||hn&&"object"==typeof t&&hn in t)}function Sn(t){if(ln)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!cn)return!1;try{return cn.call(t),!0}catch(t){}return!1}var Mn=Object.prototype.hasOwnProperty||function(t){return t in this};function En(t,e){return Mn.call(t,e)}function xn(t){return $e.call(t)}function kn(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function Cn(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Cn(Je.call(t,0,e.maxStringLength),e)+r}return mn(Ke.call(Ke.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,In),"single",e)}function In(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+Xe.call(e.toString(16))}function An(t){return"Object("+t+")"}function Nn(t){return t+" { ? }"}function Rn(t,e,n,r){return t+" ("+e+") {"+(r?jn(n,r):rn.call(n,", "))+"}"}function jn(t,e){if(0===t.length)return"";var n="\n"+e.prev+e.base;return n+rn.call(t,","+n)+"\n"+e.prev}function Tn(t,e){var n=_n(t),r=[];if(n){r.length=t.length;for(var i=0;i<t.length;i++)r[i]=En(t,i)?e(t[i],t):""}var s,o="function"==typeof un?un(t):[];if(ln){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var u in t)En(t,u)&&(n&&String(Number(u))===u&&u<t.length||ln&&s["$"+u]instanceof Symbol||(en.call(/[^\w$]/,u)?r.push(e(u,t)+": "+e(t[u],t)):r.push(u+": "+e(t[u],t))));if("function"==typeof un)for(var c=0;c<o.length;c++)dn.call(t,o[c])&&r.push("["+e(o[c])+"]: "+e(t[o[c]],t));return r}var On=Ne,Ln=function(t,e){var n=je(t,!!e);return"function"==typeof n&&Oe(t,".prototype.")>-1?Te(n):n},Pn=function t(e,n,r,i){var s=n||{};if(En(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(En(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=!En(s,"customInspect")||s.customInspect;if("boolean"!=typeof o&&"symbol"!==o)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(En(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(En(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Cn(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var u=String(e);return a?pn(e,u):u}if("bigint"==typeof e){var c=String(e)+"n";return a?pn(e,c):c}var l=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=l&&l>0&&"object"==typeof e)return _n(e)?"[Array]":"[Object]";var h=function(t,e){var n;if("\t"===t.indent)n="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;n=rn.call(Array(t.indent+1)," ")}return{base:n,prev:rn.call(Array(e+1),n)}}(s,r);if(void 0===i)i=[];else if(kn(i,e)>=0)return"[Circular]";function d(e,n,o){if(n&&(i=sn.call(i)).push(n),o){var a={depth:s.depth};return En(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,r+1,i)}return t(e,s,r+1,i)}if("function"==typeof e&&!wn(e)){var f=function(t){if(t.name)return t.name;var e=Ye.call(Qe.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),p=Tn(e,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+rn.call(p,", ")+" }":"")}if(Sn(e)){var b=ln?Ke.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):cn.call(e);return"object"!=typeof e||ln?b:An(b)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var y="<"+tn.call(String(e.nodeName)),g=e.attributes||[],m=0;m<g.length;m++)y+=" "+g[m].name+"="+mn(vn(g[m].value),"double",s);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+tn.call(String(e.nodeName))+">"}if(_n(e)){if(0===e.length)return"[]";var v=Tn(e,d);return h&&!function(t){for(var e=0;e<t.length;e++)if(kn(t[e],"\n")>=0)return!1;return!0}(v)?"["+jn(v,h)+"]":"[ "+rn.call(v,", ")+" ]"}if(function(t){return!("[object Error]"!==xn(t)||hn&&"object"==typeof t&&hn in t)}(e)){var _=Tn(e,d);return"cause"in Error.prototype||!("cause"in e)||dn.call(e,"cause")?0===_.length?"["+String(e)+"]":"{ ["+String(e)+"] "+rn.call(_,", ")+" }":"{ ["+String(e)+"] "+rn.call(nn.call("[cause]: "+d(e.cause),_),", ")+" }"}if("object"==typeof e&&o){if(gn&&"function"==typeof e[gn]&&bn)return bn(e,{depth:l-r});if("symbol"!==o&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!Be||!t||"object"!=typeof t)return!1;try{Be.call(t);try{He.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var w=[];return Fe&&Fe.call(e,(function(t,n){w.push(d(n,e,!0)+" => "+d(t,e))})),Rn("Map",Be.call(e),w,h)}if(function(t){if(!He||!t||"object"!=typeof t)return!1;try{He.call(t);try{Be.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var S=[];return Ve&&Ve.call(e,(function(t){S.push(d(t,e))})),Rn("Set",He.call(e),S,h)}if(function(t){if(!ze||!t||"object"!=typeof t)return!1;try{ze.call(t,ze);try{qe.call(t,qe)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Nn("WeakMap");if(function(t){if(!qe||!t||"object"!=typeof t)return!1;try{qe.call(t,qe);try{ze.call(t,ze)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Nn("WeakSet");if(function(t){if(!Ge||!t||"object"!=typeof t)return!1;try{return Ge.call(t),!0}catch(t){}return!1}(e))return Nn("WeakRef");if(function(t){return!("[object Number]"!==xn(t)||hn&&"object"==typeof t&&hn in t)}(e))return An(d(Number(e)));if(function(t){if(!t||"object"!=typeof t||!an)return!1;try{return an.call(t),!0}catch(t){}return!1}(e))return An(d(an.call(e)));if(function(t){return!("[object Boolean]"!==xn(t)||hn&&"object"==typeof t&&hn in t)}(e))return An(Ze.call(e));if(function(t){return!("[object String]"!==xn(t)||hn&&"object"==typeof t&&hn in t)}(e))return An(d(String(e)));if(!function(t){return!("[object Date]"!==xn(t)||hn&&"object"==typeof t&&hn in t)}(e)&&!wn(e)){var M=Tn(e,d),E=fn?fn(e)===Object.prototype:e instanceof Object||e.constructor===Object,x=e instanceof Object?"":"null prototype",k=!E&&hn&&Object(e)===e&&hn in e?Je.call(xn(e),8,-1):x?"Object":"",C=(E||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(k||x?"["+rn.call(nn.call([],k||[],x||[]),": ")+"] ":"");return 0===M.length?C+"{}":h?C+"{"+jn(M,h)+"}":C+"{ "+rn.call(M,", ")+" }"}return String(e)},Dn=On("%TypeError%"),Bn=On("%WeakMap%",!0),Fn=On("%Map%",!0),Wn=Ln("WeakMap.prototype.get",!0),Un=Ln("WeakMap.prototype.set",!0),Hn=Ln("WeakMap.prototype.has",!0),Vn=Ln("Map.prototype.get",!0),zn=Ln("Map.prototype.set",!0),qn=Ln("Map.prototype.has",!0),Gn=function(t,e){for(var n,r=t;null!==(n=r.next);r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},Zn=String.prototype.replace,$n=/%20/g,Qn="RFC3986",Yn={default:Qn,formatters:{RFC1738:function(t){return Zn.call(t,$n,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:Qn},Jn=Yn,Kn=Object.prototype.hasOwnProperty,Xn=Array.isArray,tr=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),er=function(t,e){for(var n=e&&e.plainObjects?Object.create(null):{},r=0;r<t.length;++r)void 0!==t[r]&&(n[r]=t[r]);return n},nr={arrayToObject:er,assign:function(t,e){return Object.keys(e).reduce((function(t,n){return t[n]=e[n],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],n=[],r=0;r<e.length;++r)for(var i=e[r],s=i.obj[i.prop],o=Object.keys(s),a=0;a<o.length;++a){var u=o[a],c=s[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(e.push({obj:s,prop:u}),n.push(c))}return function(t){for(;t.length>1;){var e=t.pop(),n=e.obj[e.prop];if(Xn(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);e.obj[e.prop]=r}}}(e),t},decode:function(t,e,n){var r=t.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(t){return r}},encode:function(t,e,n,r,i){if(0===t.length)return t;var s=t;if("symbol"==typeof t?s=Symbol.prototype.toString.call(t):"string"!=typeof t&&(s=String(t)),"iso-8859-1"===n)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var o="",a=0;a<s.length;++a){var u=s.charCodeAt(a);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===Jn.RFC1738&&(40===u||41===u)?o+=s.charAt(a):u<128?o+=tr[u]:u<2048?o+=tr[192|u>>6]+tr[128|63&u]:u<55296||u>=57344?o+=tr[224|u>>12]+tr[128|u>>6&63]+tr[128|63&u]:(a+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(a)),o+=tr[240|u>>18]+tr[128|u>>12&63]+tr[128|u>>6&63]+tr[128|63&u])}return o},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(Xn(t)){for(var n=[],r=0;r<t.length;r+=1)n.push(e(t[r]));return n}return e(t)},merge:function t(e,n,r){if(!n)return e;if("object"!=typeof n){if(Xn(e))e.push(n);else{if(!e||"object"!=typeof e)return[e,n];(r&&(r.plainObjects||r.allowPrototypes)||!Kn.call(Object.prototype,n))&&(e[n]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(n);var i=e;return Xn(e)&&!Xn(n)&&(i=er(e,r)),Xn(e)&&Xn(n)?(n.forEach((function(n,i){if(Kn.call(e,i)){var s=e[i];s&&"object"==typeof s&&n&&"object"==typeof n?e[i]=t(s,n,r):e.push(n)}else e[i]=n})),e):Object.keys(n).reduce((function(e,i){var s=n[i];return Kn.call(e,i)?e[i]=t(e[i],s,r):e[i]=s,e}),i)}},rr=function(){var t,e,n,r={assert:function(t){if(!r.has(t))throw new Dn("Side channel does not contain "+Pn(t))},get:function(r){if(Bn&&r&&("object"==typeof r||"function"==typeof r)){if(t)return Wn(t,r)}else if(Fn){if(e)return Vn(e,r)}else if(n)return function(t,e){var n=Gn(t,e);return n&&n.value}(n,r)},has:function(r){if(Bn&&r&&("object"==typeof r||"function"==typeof r)){if(t)return Hn(t,r)}else if(Fn){if(e)return qn(e,r)}else if(n)return function(t,e){return!!Gn(t,e)}(n,r);return!1},set:function(r,i){Bn&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new Bn),Un(t,r,i)):Fn?(e||(e=new Fn),zn(e,r,i)):(n||(n={key:{},next:null}),function(t,e,n){var r=Gn(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}}(n,r,i))}};return r},ir=nr,sr=Yn,or=Object.prototype.hasOwnProperty,ar={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},ur=Array.isArray,cr=Array.prototype.push,lr=function(t,e){cr.apply(t,ur(e)?e:[e])},hr=Date.prototype.toISOString,dr=sr.default,fr={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ir.encode,encodeValuesOnly:!1,format:dr,formatter:sr.formatters[dr],indices:!1,serializeDate:function(t){return hr.call(t)},skipNulls:!1,strictNullHandling:!1},pr={},br=function t(e,n,r,i,s,o,a,u,c,l,h,d,f,p,b,y){for(var g=e,m=y,v=0,_=!1;void 0!==(m=m.get(pr))&&!_;){var w=m.get(e);if(v+=1,void 0!==w){if(w===v)throw new RangeError("Cyclic object value");_=!0}void 0===m.get(pr)&&(v=0)}if("function"==typeof u?g=u(n,g):g instanceof Date?g=h(g):"comma"===r&&ur(g)&&(g=ir.maybeMap(g,(function(t){return t instanceof Date?h(t):t}))),null===g){if(s)return a&&!p?a(n,fr.encoder,b,"key",d):n;g=""}if(function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t}(g)||ir.isBuffer(g))return a?[f(p?n:a(n,fr.encoder,b,"key",d))+"="+f(a(g,fr.encoder,b,"value",d))]:[f(n)+"="+f(String(g))];var S,M=[];if(void 0===g)return M;if("comma"===r&&ur(g))p&&a&&(g=ir.maybeMap(g,a)),S=[{value:g.length>0?g.join(",")||null:void 0}];else if(ur(u))S=u;else{var E=Object.keys(g);S=c?E.sort(c):E}for(var x=i&&ur(g)&&1===g.length?n+"[]":n,k=0;k<S.length;++k){var C=S[k],I="object"==typeof C&&void 0!==C.value?C.value:g[C];if(!o||null!==I){var A=ur(g)?"function"==typeof r?r(x,C):x:x+(l?"."+C:"["+C+"]");y.set(e,v);var N=rr();N.set(pr,y),lr(M,t(I,A,r,i,s,o,"comma"===r&&p&&ur(g)?null:a,u,c,l,h,d,f,p,b,N))}}return M},yr=nr,gr=Object.prototype.hasOwnProperty,mr=Array.isArray,vr={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:yr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},_r=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},wr=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Sr=function(t,e,n,r){if(t){var i=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/g,o=n.depth>0&&/(\[[^[\]]*])/.exec(i),a=o?i.slice(0,o.index):i,u=[];if(a){if(!n.plainObjects&&gr.call(Object.prototype,a)&&!n.allowPrototypes)return;u.push(a)}for(var c=0;n.depth>0&&null!==(o=s.exec(i))&&c<n.depth;){if(c+=1,!n.plainObjects&&gr.call(Object.prototype,o[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(o[1])}return o&&u.push("["+i.slice(o.index)+"]"),function(t,e,n,r){for(var i=r?e:wr(e,n),s=t.length-1;s>=0;--s){var o,a=t[s];if("[]"===a&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(u,10);n.parseArrays||""!==u?!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(o=[])[c]=i:"__proto__"!==u&&(o[u]=i):o={0:i}}i=o}return i}(u,e,n,r)}},Mr=function(t,e){var n,r=t,i=function(t){if(!t)return fr;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||fr.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=sr.default;if(void 0!==t.format){if(!or.call(sr.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var r=sr.formatters[n],i=fr.filter;return("function"==typeof t.filter||ur(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:fr.addQueryPrefix,allowDots:void 0===t.allowDots?fr.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:fr.charsetSentinel,delimiter:void 0===t.delimiter?fr.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:fr.encode,encoder:"function"==typeof t.encoder?t.encoder:fr.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:fr.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:fr.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:fr.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:fr.strictNullHandling}}(e);"function"==typeof i.filter?r=(0,i.filter)("",r):ur(i.filter)&&(n=i.filter);var s,o=[];if("object"!=typeof r||null===r)return"";s=e&&e.arrayFormat in ar?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=ar[s];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u="comma"===a&&e&&e.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var c=rr(),l=0;l<n.length;++l){var h=n[l];i.skipNulls&&null===r[h]||lr(o,br(r[h],h,a,u,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,c))}var d=o.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:""},Er=function(t,e){var n=function(t){if(!t)return vr;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?vr.charset:t.charset;return{allowDots:void 0===t.allowDots?vr.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:vr.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:vr.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:vr.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:vr.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:vr.comma,decoder:"function"==typeof t.decoder?t.decoder:vr.decoder,delimiter:"string"==typeof t.delimiter||yr.isRegExp(t.delimiter)?t.delimiter:vr.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:vr.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:vr.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:vr.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:vr.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:vr.strictNullHandling}}(e);if(""===t||null==t)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof t?function(t,e){var n,r={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,s=e.parameterLimit===1/0?void 0:e.parameterLimit,o=i.split(e.delimiter,s),a=-1,u=e.charset;if(e.charsetSentinel)for(n=0;n<o.length;++n)0===o[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===o[n]?u="utf-8":"utf8=%26%2310003%3B"===o[n]&&(u="iso-8859-1"),a=n,n=o.length);for(n=0;n<o.length;++n)if(n!==a){var c,l,h=o[n],d=h.indexOf("]="),f=-1===d?h.indexOf("="):d+1;-1===f?(c=e.decoder(h,vr.decoder,u,"key"),l=e.strictNullHandling?null:""):(c=e.decoder(h.slice(0,f),vr.decoder,u,"key"),l=yr.maybeMap(wr(h.slice(f+1),e),(function(t){return e.decoder(t,vr.decoder,u,"value")}))),l&&e.interpretNumericEntities&&"iso-8859-1"===u&&(l=_r(l)),h.indexOf("[]=")>-1&&(l=mr(l)?[l]:l),gr.call(r,c)?r[c]=yr.combine(r[c],l):r[c]=l}return r}(t,n):t,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],u=Sr(a,r[a],n,"string"==typeof t);i=yr.merge(i,u,n)}return!0===n.allowSparse?i:yr.compact(i)},xr={formats:Yn,parse:Er,stringify:Mr},kr={};!function(t){function e(){return t=>t}var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0,t.OpaqueType=e,t.HexString=t=>t,t.AddressString=t=>t,t.BigIntString=t=>t,t.IntNumber=function(t){return Math.floor(t)},t.RegExpString=t=>t,(n=t.ProviderType||(t.ProviderType={})).CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(kr);var Cr=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.isInIFrame=Jt.createQrUrl=Jt.getFavicon=Jt.range=Jt.isBigNumber=Jt.ensureParsedJSONObject=Jt.ensureBN=Jt.ensureRegExpString=Jt.ensureIntNumber=Jt.ensureBuffer=Jt.ensureAddressString=Jt.ensureEvenLengthHexString=Jt.ensureHexString=Jt.isHexString=Jt.prepend0x=Jt.strip0x=Jt.has0xPrefix=Jt.hexStringFromIntNumber=Jt.intNumberFromHexString=Jt.bigIntStringFromBN=Jt.hexStringFromBuffer=Jt.hexStringToUint8Array=Jt.uint8ArrayToHex=Jt.randomBytesHex=void 0;const Ir=Cr(_.exports),Ar=xr,Nr=kr,Rr=/^[0-9]*$/,jr=/^[a-f0-9]*$/;function Tr(t){return[...t].map((t=>t.toString(16).padStart(2,"0"))).join("")}function Or(t){return t.startsWith("0x")||t.startsWith("0X")}function Lr(t){return Or(t)?t.slice(2):t}function Pr(t){return Or(t)?"0x"+t.slice(2):"0x"+t}function Dr(t){if("string"!=typeof t)return!1;const e=Lr(t).toLowerCase();return jr.test(e)}function Br(t,e=!1){if("string"==typeof t){const n=Lr(t).toLowerCase();if(jr.test(n))return(0,Nr.HexString)(e?"0x"+n:n)}throw new Error(`"${String(t)}" is not a hexadecimal string`)}function Fr(t,e=!1){let n=Br(t,!1);return n.length%2==1&&(n=(0,Nr.HexString)("0"+n)),e?(0,Nr.HexString)("0x"+n):n}function Wr(t){if("number"==typeof t&&Number.isInteger(t))return(0,Nr.IntNumber)(t);if("string"==typeof t){if(Rr.test(t))return(0,Nr.IntNumber)(Number(t));if(Dr(t))return(0,Nr.IntNumber)(new Ir.default(Fr(t,!1),16).toNumber())}throw new Error(`Not an integer: ${String(t)}`)}function Ur(t){if(null==t||"function"!=typeof t.constructor)return!1;const{constructor:e}=t;return"function"==typeof e.config&&"number"==typeof e.EUCLID}Jt.randomBytesHex=function(t){return Tr(crypto.getRandomValues(new Uint8Array(t)))},Jt.uint8ArrayToHex=Tr,Jt.hexStringToUint8Array=function(t){return new Uint8Array(t.match(/.{1,2}/g).map((t=>parseInt(t,16))))},Jt.hexStringFromBuffer=function(t,e=!1){const n=t.toString("hex");return(0,Nr.HexString)(e?"0x"+n:n)},Jt.bigIntStringFromBN=function(t){return(0,Nr.BigIntString)(t.toString(10))},Jt.intNumberFromHexString=function(t){return(0,Nr.IntNumber)(new Ir.default(Fr(t,!1),16).toNumber())},Jt.hexStringFromIntNumber=function(t){return(0,Nr.HexString)("0x"+new Ir.default(t).toString(16))},Jt.has0xPrefix=Or,Jt.strip0x=Lr,Jt.prepend0x=Pr,Jt.isHexString=Dr,Jt.ensureHexString=Br,Jt.ensureEvenLengthHexString=Fr,Jt.ensureAddressString=function(t){if("string"==typeof t){const e=Lr(t).toLowerCase();if(Dr(e)&&40===e.length)return(0,Nr.AddressString)(Pr(e))}throw new Error(`Invalid Ethereum address: ${String(t)}`)},Jt.ensureBuffer=function(t){if(Buffer.isBuffer(t))return t;if("string"==typeof t){if(Dr(t)){const e=Fr(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw new Error(`Not binary data: ${String(t)}`)},Jt.ensureIntNumber=Wr,Jt.ensureRegExpString=function(t){if(t instanceof RegExp)return(0,Nr.RegExpString)(t.toString());throw new Error(`Not a RegExp: ${String(t)}`)},Jt.ensureBN=function(t){if(null!==t&&(Ir.default.isBN(t)||Ur(t)))return new Ir.default(t.toString(10),10);if("number"==typeof t)return new Ir.default(Wr(t));if("string"==typeof t){if(Rr.test(t))return new Ir.default(t,10);if(Dr(t))return new Ir.default(Fr(t,!1),16)}throw new Error(`Not an integer: ${String(t)}`)},Jt.ensureParsedJSONObject=function(t){if("string"==typeof t)return JSON.parse(t);if("object"==typeof t)return t;throw new Error(`Not a JSON string or an object: ${String(t)}`)},Jt.isBigNumber=Ur,Jt.range=function(t,e){return Array.from({length:e-t},((e,n)=>t+n))},Jt.getFavicon=function(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`},Jt.createQrUrl=function(t,e,n,r,i,s){return`${n}/#/link?${(0,Ar.stringify)({[r?"parent-id":"id"]:t,secret:e,server:n,v:i,chainId:s})}`},Jt.isInIFrame=function(){try{return null!==window.frameElement}catch(t){return!1}},Object.defineProperty(P,"__esModule",{value:!0}),P.Session=void 0;const Hr=D.exports,Vr=Jt,zr="session:id",qr="session:secret",Gr="session:linked";class Zr{constructor(t,e,n,r){this._storage=t,this._id=e||(0,Vr.randomBytesHex)(16),this._secret=n||(0,Vr.randomBytesHex)(32),this._key=(new Hr.sha256).update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!r}static load(t){const e=t.getItem(zr),n=t.getItem(Gr),r=t.getItem(qr);return e&&r?new Zr(t,e,r,"1"===n):null}static hash(t){return(new Hr.sha256).update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(zr,this._id),this._storage.setItem(qr,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Gr,this._linked?"1":"0")}}P.Session=Zr;var $r={};Object.defineProperty($r,"__esModule",{value:!0}),$r.WalletSDKRelayAbstract=$r.APP_VERSION_KEY=$r.LOCAL_STORAGE_ADDRESSES_KEY=$r.WALLET_USER_NAME_KEY=void 0;const Qr=w;$r.WALLET_USER_NAME_KEY="walletUsername",$r.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",$r.APP_VERSION_KEY="AppVersion";$r.WalletSDKRelayAbstract=class{async makeEthereumJSONRPCRequest(t,e){if(!e)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(e,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then((t=>t.json())).then((t=>{if(!t)throw Qr.ethErrors.rpc.parse({});const e=t,{error:n}=e;if(n)throw(0,Qr.serializeError)(n);return e}))}};var Yr,Jr,Kr,Xr,ti,ei={exports:{}},ni={exports:{}};function ri(){return Yr||(Yr=1,ni.exports=d.default),ni.exports}function ii(){if(Kr)return Jr;function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach((function(t){n(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t,e,n){return(e=i(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,i(r.key),r)}}function i(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}Kr=1;var s=p.default.Buffer,o=h.default.inspect,a=o&&o.custom||"inspect";function u(t,e,n){s.prototype.copy.call(t,e,n)}return Jr=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var n,i,c;return n=t,i=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e=s.allocUnsafe(t>>>0),n=this.head,r=0;n;)u(n.data,e,r),r+=n.data.length,n=n.next;return e}},{key:"consume",value:function(t,e){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):n=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,n=1,r=e.data;for(t-=r.length;e=e.next;){var i=e.data,s=t>i.length?i.length:t;if(s===i.length?r+=i:r+=i.slice(0,t),0==(t-=s)){s===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(s));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),n=this.head,r=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var i=n.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,e}},{key:a,value:function(t,n){return o(this,e(e({},n),{},{depth:0,customInspect:!1}))}}],i&&r(n.prototype,i),c&&r(n,c),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Jr}function si(){if(ti)return Xr;function t(t,r){n(t,r),e(t)}function e(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function n(t,e){t.emit("error",e)}return ti=1,Xr={destroy:function(r,i){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,r)):process.nextTick(n,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,(function(n){!i&&n?s._writableState?s._writableState.errorEmitted?process.nextTick(e,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,n)):process.nextTick(t,s,n):i?(process.nextTick(e,s),i(n)):process.nextTick(e,s)})),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(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}},Xr}var oi,ai,ui,ci,li,hi,di,fi={};function pi(){if(oi)return fi;oi=1;const t={};function e(e,n,r){r||(r=Error);class i extends r{constructor(t,e,r){super(function(t,e,r){return"string"==typeof n?n:n(t,e,r)}(t,e,r))}}i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function n(t,e){if(Array.isArray(t)){const n=t.length;return t=t.map((t=>String(t))),n>2?`one of ${e} ${t.slice(0,n-1).join(", ")}, or `+t[n-1]:2===n?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}return`of ${e} ${String(t)}`}return e("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),e("ERR_INVALID_ARG_TYPE",(function(t,e,r){let i;var s,o;let a;if("string"==typeof e&&(s="not ",e.substr(!o||o<0?0:+o,s.length)===s)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))a=`The ${t} ${i} ${n(e,"type")}`;else{const r=function(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";a=`The "${t}" ${r} ${i} ${n(e,"type")}`}return a+=". Received type "+typeof r,a}),TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),fi.codes=t,fi}function bi(){if(ui)return ai;ui=1;var t=pi().codes.ERR_INVALID_OPT_VALUE;return ai={getHighWaterMark:function(e,n,r,i){var s=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(n,i,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new t(i?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}}function yi(){if(li)return ci;function t(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var n;li=1,ci=x,x.WritableState=E;var s={deprecate:i.requireNode()},o=ri(),a=p.default.Buffer,u=(void 0!==e.commonjsGlobal?e.commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,l=si(),h=bi().getHighWaterMark,d=pi().codes,f=d.ERR_INVALID_ARG_TYPE,b=d.ERR_METHOD_NOT_IMPLEMENTED,y=d.ERR_MULTIPLE_CALLBACK,g=d.ERR_STREAM_CANNOT_PIPE,m=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,_=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,S=l.errorOrDestroy;function M(){}function E(e,r,i){n=n||gi(),e=e||{},"boolean"!=typeof i&&(i=r instanceof n),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 s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new y;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?(process.nextTick(i,r),process.nextTick(R,t,e),t._writableState.errorEmitted=!0,S(t,r)):(i(r),t._writableState.errorEmitted=!0,S(t,r),R(t,e))}(t,n,r,e,i);else{var s=A(n)||t.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||I(t,n),r?process.nextTick(C,t,n,s,i):C(t,n,s,i)}}(r,t)},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(t){var e=this instanceof(n=n||gi());if(!e&&!c.call(x,this))return new x(t);this._writableState=new E(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),o.call(this)}function k(t,e,n,r,i,s,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):n?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function C(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),R(t,e)}function I(e,n){n.bufferProcessing=!0;var r=n.bufferedRequest;if(e._writev&&r&&r.next){var i=n.bufferedRequestCount,s=new Array(i),o=n.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)s[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;s.allBuffers=u,k(e,n,!0,n.length,s,"",o.finish),n.pendingcb++,n.lastBufferedRequest=null,o.next?(n.corkedRequestsFree=o.next,o.next=null):n.corkedRequestsFree=new t(n),n.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,h=r.callback;if(k(e,n,!1,n.objectMode?1:c.length,c,l,h),r=r.next,n.bufferedRequestCount--,n.writing)break}null===r&&(n.lastBufferedRequest=null)}n.bufferedRequest=r,n.bufferProcessing=!1}function A(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function N(t,e){t._final((function(n){e.pendingcb--,n&&S(t,n),e.prefinished=!0,t.emit("prefinish"),R(t,e)}))}function R(t,e){var n=A(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(N,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var r=t._readableState;(!r||r.autoDestroy&&r.endEmitted)&&t.destroy()}return n}return r.inherits.exports(x,o),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(t){return!!c.call(this,t)||this===x&&(t&&t._writableState instanceof E)}})):c=function(t){return t instanceof this},x.prototype.pipe=function(){S(this,new g)},x.prototype.write=function(t,e,n){var r,i=this._writableState,s=!1,o=!i.objectMode&&(r=t,a.isBuffer(r)||r instanceof u);return o&&!a.isBuffer(t)&&(t=function(t){return a.from(t)}(t)),"function"==typeof e&&(n=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=M),i.ending?function(t,e){var n=new _;S(t,n),process.nextTick(e,n)}(this,n):(o||function(t,e,n,r){var i;return null===n?i=new v:"string"==typeof n||e.objectMode||(i=new f("chunk",["string","Buffer"],n)),!i||(S(t,i),process.nextTick(r,i),!1)}(this,i,t,n))&&(i.pendingcb++,s=function(t,e,n,r,i,s){if(!n){var o=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,n));return e}(e,r,i);r!==o&&(n=!0,i="buffer",r=o)}var u=e.objectMode?1:r.length;e.length+=u;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:s,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else k(t,e,!1,u,r,i,s);return c}(this,i,o,t,e,n)),s},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||I(this,t))},x.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,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(t,e,n){n(new b("_write()"))},x.prototype._writev=null,x.prototype.end=function(t,e,n){var r=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,n){e.ending=!0,R(t,e),n&&(e.finished?process.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n),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(t){this._writableState&&(this._writableState.destroyed=t)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(t,e){e(t)},ci}function gi(){if(di)return hi;di=1;var t=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};hi=a;var e=Bi(),n=yi();r.inherits.exports(a,e);for(var i=t(n.prototype),s=0;s<i.length;s++){var o=i[s];a.prototype[o]||(a.prototype[o]=n.prototype[o])}function a(t){if(!(this instanceof a))return new a(t);e.call(this,t),n.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||process.nextTick(c,this)}function c(t){t.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),hi}var mi,vi,_i,wi,Si,Mi,Ei,xi,ki,Ci,Ii,Ai,Ni,Ri,ji,Ti={};function Oi(){if(mi)return Ti;mi=1;var t=i.safeBuffer.exports.Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.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 n(n){var r;switch(this.encoding=function(n){var r=function(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(n);if("string"!=typeof r&&(t.isEncoding===e||!e(n)))throw new Error("Unknown encoding: "+n);return r||n}(n),this.encoding){case"utf16le":this.text=o,this.end=a,r=4;break;case"utf8":this.fillLast=s,r=4;break;case"base64":this.text=u,this.end=c,r=3;break;default:return this.write=l,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(r)}function r(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function a(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}return Ti.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},n.prototype.text=function(t,e){var n=function(t,e,n){var i=e.length-1;if(i<n)return 0;var s=r(e[i]);if(s>=0)return s>0&&(t.lastNeed=s-1),s;if(--i<n||-2===s)return 0;if(s=r(e[i]),s>=0)return s>0&&(t.lastNeed=s-2),s;if(--i<n||-2===s)return 0;if(s=r(e[i]),s>=0)return s>0&&(2===s?s=0:t.lastNeed=s-3),s;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},Ti}function Li(){if(_i)return vi;_i=1;var t=pi().codes.ERR_STREAM_PREMATURE_CLOSE;function e(){}return vi=function n(r,i,s){if("function"==typeof i)return n(r,null,i);i||(i={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}}(s||e);var o=i.readable||!1!==i.readable&&r.readable,a=i.writable||!1!==i.writable&&r.writable,u=function(){r.writable||l()},c=r._writableState&&r._writableState.finished,l=function(){a=!1,c=!0,o||s.call(r)},h=r._readableState&&r._readableState.endEmitted,d=function(){o=!1,h=!0,a||s.call(r)},f=function(t){s.call(r,t)},p=function(){var e;return o&&!h?(r._readableState&&r._readableState.ended||(e=new t),s.call(r,e)):a&&!c?(r._writableState&&r._writableState.ended||(e=new t),s.call(r,e)):void 0},b=function(){r.req.on("finish",l)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(r)?a&&!r._writableState&&(r.on("end",u),r.on("close",u)):(r.on("complete",l),r.on("abort",p),r.req?b():r.on("request",b)),r.on("end",d),r.on("finish",l),!1!==i.error&&r.on("error",f),r.on("close",p),function(){r.removeListener("complete",l),r.removeListener("abort",p),r.removeListener("request",b),r.req&&r.req.removeListener("finish",l),r.removeListener("end",u),r.removeListener("close",u),r.removeListener("finish",l),r.removeListener("end",d),r.removeListener("error",f),r.removeListener("close",p)}},vi}function Pi(){if(Si)return wi;var t;function e(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Si=1;var n=Li(),r=Symbol("lastResolve"),i=Symbol("lastReject"),s=Symbol("error"),o=Symbol("ended"),a=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function l(t,e){return{value:t,done:e}}function h(t){var e=t[r];if(null!==e){var n=t[c].read();null!==n&&(t[a]=null,t[r]=null,t[i]=null,e(l(n,!1)))}}function d(t){process.nextTick(h,t)}var f=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((e(t={get stream(){return this[c]},next:function(){var t=this,e=this[s];if(null!==e)return Promise.reject(e);if(this[o])return Promise.resolve(l(void 0,!0));if(this[c].destroyed)return new Promise((function(e,n){process.nextTick((function(){t[s]?n(t[s]):e(l(void 0,!0))}))}));var n,r=this[a];if(r)n=new Promise(function(t,e){return function(n,r){t.then((function(){e[o]?n(l(void 0,!0)):e[u](n,r)}),r)}}(r,this));else{var i=this[c].read();if(null!==i)return Promise.resolve(l(i,!1));n=new Promise(this[u])}return this[a]=n,n}},Symbol.asyncIterator,(function(){return this})),e(t,"return",(function(){var t=this;return new Promise((function(e,n){t[c].destroy(null,(function(t){t?n(t):e(l(void 0,!0))}))}))})),t),f);return wi=function(t){var h,f=Object.create(p,(e(h={},c,{value:t,writable:!0}),e(h,r,{value:null,writable:!0}),e(h,i,{value:null,writable:!0}),e(h,s,{value:null,writable:!0}),e(h,o,{value:t._readableState.endEmitted,writable:!0}),e(h,u,{value:function(t,e){var n=f[c].read();n?(f[a]=null,f[r]=null,f[i]=null,t(l(n,!1))):(f[r]=t,f[i]=e)},writable:!0}),h));return f[a]=null,n(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=f[i];return null!==e&&(f[a]=null,f[r]=null,f[i]=null,e(t)),void(f[s]=t)}var n=f[r];null!==n&&(f[a]=null,f[r]=null,f[i]=null,n(l(void 0,!0))),f[o]=!0})),t.on("readable",d.bind(null,f)),f},wi}function Di(){if(Ei)return Mi;function t(t,e,n,r,i,s,o){try{var a=t[s](o),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Ei=1;var r=pi().codes.ERR_INVALID_ARG_TYPE;return Mi=function(i,s,o){var a;if(s&&"function"==typeof s.next)a=s;else if(s&&s[Symbol.asyncIterator])a=s[Symbol.asyncIterator]();else{if(!s||!s[Symbol.iterator])throw new r("iterable",["Iterable"],s);a=s[Symbol.iterator]()}var u=new i(function(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(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}({objectMode:!0},o)),c=!1;function l(){return h.apply(this,arguments)}function h(){var e;return e=function*(){try{var t=yield a.next(),e=t.value;t.done?u.push(null):u.push(yield e)?l():c=!1}catch(t){u.destroy(t)}},h=function(){var n=this,r=arguments;return new Promise((function(i,s){var o=e.apply(n,r);function a(e){t(o,i,s,a,u,"next",e)}function u(e){t(o,i,s,a,u,"throw",e)}a(void 0)}))},h.apply(this,arguments)}return u._read=function(){c||(c=!0,l())},u},Mi}function Bi(){if(ki)return xi;var t;ki=1,xi=k,k.ReadableState=x,f.default.EventEmitter;var n=function(t,e){return t.listeners(e).length},i=ri(),s=p.default.Buffer,o=(void 0!==e.commonjsGlobal?e.commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a,u=h.default;a=u&&u.debuglog?u.debuglog("stream"):function(){};var c,l,d,b=ii(),y=si(),g=bi().getHighWaterMark,m=pi().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;r.inherits.exports(k,i);var M=y.errorOrDestroy,E=["error","close","destroy","pause","resume"];function x(e,n,r){t=t||gi(),e=e||{},"boolean"!=typeof r&&(r=n instanceof t),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",r),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&&(c||(c=Oi().StringDecoder),this.decoder=new c(e.encoding),this.encoding=e.encoding)}function k(e){if(t=t||gi(),!(this instanceof k))return new k(e);var n=this instanceof t;this._readableState=new x(e,this,n),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),i.call(this)}function C(t,e,n,r,i){a("readableAddChunk",e);var u,c=t._readableState;if(null===e)c.reading=!1,function(t,e){if(a("onEofChunk"),e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,j(t)))}(t,c);else if(i||(u=function(t,e){var n;r=e,s.isBuffer(r)||r instanceof o||"string"==typeof e||void 0===e||t.objectMode||(n=new v("chunk",["string","Buffer","Uint8Array"],e));var r;return n}(c,e)),u)M(t,u);else if(c.objectMode||e&&e.length>0)if("string"==typeof e||c.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),r)c.endEmitted?M(t,new S):I(t,c,e,!0);else if(c.ended)M(t,new _);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!n?(e=c.decoder.write(e),c.objectMode||0!==e.length?I(t,c,e,!1):T(t,c)):I(t,c,e,!1)}else r||(c.reading=!1,T(t,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function I(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&R(t)),T(t,e)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),k.prototype.destroy=y.destroy,k.prototype._undestroy=y.undestroy,k.prototype._destroy=function(t,e){e(t)},k.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=s.from(t,e),e=""),n=!0),C(this,t,e,!1,n)},k.prototype.unshift=function(t){return C(this,t,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(t){c||(c=Oi().StringDecoder);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var A=1073741824;function N(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=A?t=A:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t){var e=t._readableState;a("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(a("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(j,t))}function j(t){var e=t._readableState;a("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function T(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(O,t,e))}function O(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var n=e.length;if(a("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function L(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function P(t){a("readable nexttick read 0"),t.read(0)}function D(t,e){a("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(a("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function W(t){var e=t._readableState;a("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(U,e,t))}function U(t,e){if(a("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function H(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}return k.prototype.read=function(t){a("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return a("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?W(this):R(this),null;if(0===(t=N(t,e))&&e.ended)return 0===e.length&&W(this),null;var r,i=e.needReadable;return a("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&a("length less than watermark",i=!0),e.ended||e.reading?a("reading or ended",i=!1):i&&(a("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=N(n,e))),null===(r=t>0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&W(this)),null!==r&&this.emit("data",r),r},k.prototype._read=function(t){M(this,new w("_read()"))},k.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,a("pipe count=%d opts=%j",i.pipesCount,e);var s=(!e||!1!==e.end)&&t!==process.stdout&&t!==process.stderr?u:b;function o(e,n){a("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,a("cleanup"),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",o),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",h),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function u(){a("onend"),t.end()}i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",o);var c=function(t){return function(){var e=t._readableState;a("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&n(t,"data")&&(e.flowing=!0,B(t))}}(r);t.on("drain",c);var l=!1;function h(e){a("ondata");var n=t.write(e);a("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==H(i.pipes,t))&&!l&&(a("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(e){a("onerror",e),b(),t.removeListener("error",d),0===n(t,"error")&&M(t,e)}function f(){t.removeListener("finish",p),b()}function p(){a("onfinish"),t.removeListener("close",f),b()}function b(){a("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",d),t.once("close",f),t.once("finish",p),t.emit("pipe",r),i.flowing||(a("pipe resume"),r.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)r[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=H(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n)),this},k.prototype.on=function(t,e){var n=i.prototype.on.call(this,t,e),r=this._readableState;return"data"===t?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===t&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,a("on readable",r.length,r.reading),r.length?R(this):r.reading||process.nextTick(P,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var n=i.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(L,this),n},k.prototype.removeAllListeners=function(t){var e=i.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(L,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(a("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(D,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(a("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(a("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s<E.length;s++)t.on(E[s],this.emit.bind(this,E[s]));return this._read=function(e){a("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=Pi()),l(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),k._fromList=F,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(t,e){return void 0===d&&(d=Di()),d(k,t,e)}),xi}function Fi(){if(Ii)return Ci;Ii=1,Ci=u;var t=pi().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,i=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=t.ERR_TRANSFORM_WITH_LENGTH_0,o=gi();function a(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new n);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);o.call(this,t),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",c)}function c(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,n){l(t,e,n)}))}function l(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new s;if(t._transformState.transforming)throw new i;return t.push(null)}return r.inherits.exports(u,o),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,o.prototype.push.call(this,t,e)},u.prototype._transform=function(t,n,r){r(new e("_transform()"))},u.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){o.prototype._destroy.call(this,t,(function(t){e(t)}))},Ci}function Wi(){if(ji)return Ri;var t;ji=1;var e=pi().codes,n=e.ERR_MISSING_ARGS,r=e.ERR_STREAM_DESTROYED;function i(t){if(t)throw t}function s(t){t()}function o(t,e){return t.pipe(e)}return Ri=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];var c,l=function(t){return t.length?"function"!=typeof t[t.length-1]?i:t.pop():i}(a);if(Array.isArray(a[0])&&(a=a[0]),a.length<2)throw new n("streams");var h=a.map((function(e,n){var i=n<a.length-1;return function(e,n,i,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var o=!1;e.on("close",(function(){o=!0})),void 0===t&&(t=Li()),t(e,{readable:n,writable:i},(function(t){if(t)return s(t);o=!0,s()}));var a=!1;return function(t){if(!o&&!a)return a=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new r("pipe"))}}(e,i,n>0,(function(t){c||(c=t),t&&h.forEach(s),i||(h.forEach(s),l(c))}))}));return a.reduce(o)},Ri}!function(t,e){var n=d.default;"disable"===process.env.READABLE_STREAM&&n?(t.exports=n.Readable,Object.assign(t.exports,n),t.exports.Stream=n):((e=t.exports=Bi()).Stream=n||e,e.Readable=e,e.Writable=yi(),e.Duplex=gi(),e.Transform=Fi(),e.PassThrough=function(){if(Ni)return Ai;Ni=1,Ai=e;var t=Fi();function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}return r.inherits.exports(e,t),e.prototype._transform=function(t,e,n){n(null,t)},Ai}(),e.finished=Li(),e.pipeline=Wi())}(ei,ei.exports);const{Transform:Ui}=ei.exports;const{Transform:Hi}=ei.exports;const Vi=t=>class e extends Ui{constructor(e,n,r,i,s){super(s),this._rate=e,this._capacity=n,this._delimitedSuffix=r,this._hashBitLength=i,this._options=s,this._state=new t,this._state.initialize(e,n),this._finalized=!1}_transform(t,e,n){let r=null;try{this.update(t,e)}catch(t){r=t}n(r)}_flush(t){let e=null;try{this.push(this.digest())}catch(t){e=t}t(e)}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},zi=t=>class e extends Hi{constructor(e,n,r,i){super(i),this._rate=e,this._capacity=n,this._delimitedSuffix=r,this._options=i,this._state=new t,this._state.initialize(e,n),this._finalized=!1}_transform(t,e,n){let r=null;try{this.update(t,e)}catch(t){r=t}n(r)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}squeeze(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let n=this._state.squeeze(t);return void 0!==e&&(n=n.toString(e)),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}};var qi={};const Gi=[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];qi.p1600=function(t){for(let e=0;e<24;++e){const n=t[0]^t[10]^t[20]^t[30]^t[40],r=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],u=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let d=l^(i<<1|s>>>31),f=h^(s<<1|i>>>31);const p=t[0]^d,b=t[1]^f,y=t[10]^d,g=t[11]^f,m=t[20]^d,v=t[21]^f,_=t[30]^d,w=t[31]^f,S=t[40]^d,M=t[41]^f;d=n^(o<<1|a>>>31),f=r^(a<<1|o>>>31);const E=t[2]^d,x=t[3]^f,k=t[12]^d,C=t[13]^f,I=t[22]^d,A=t[23]^f,N=t[32]^d,R=t[33]^f,j=t[42]^d,T=t[43]^f;d=i^(u<<1|c>>>31),f=s^(c<<1|u>>>31);const O=t[4]^d,L=t[5]^f,P=t[14]^d,D=t[15]^f,B=t[24]^d,F=t[25]^f,W=t[34]^d,U=t[35]^f,H=t[44]^d,V=t[45]^f;d=o^(l<<1|h>>>31),f=a^(h<<1|l>>>31);const z=t[6]^d,q=t[7]^f,G=t[16]^d,Z=t[17]^f,$=t[26]^d,Q=t[27]^f,Y=t[36]^d,J=t[37]^f,K=t[46]^d,X=t[47]^f;d=u^(n<<1|r>>>31),f=c^(r<<1|n>>>31);const tt=t[8]^d,et=t[9]^f,nt=t[18]^d,rt=t[19]^f,it=t[28]^d,st=t[29]^f,ot=t[38]^d,at=t[39]^f,ut=t[48]^d,ct=t[49]^f,lt=p,ht=b,dt=g<<4|y>>>28,ft=y<<4|g>>>28,pt=m<<3|v>>>29,bt=v<<3|m>>>29,yt=w<<9|_>>>23,gt=_<<9|w>>>23,mt=S<<18|M>>>14,vt=M<<18|S>>>14,_t=E<<1|x>>>31,wt=x<<1|E>>>31,St=C<<12|k>>>20,Mt=k<<12|C>>>20,Et=I<<10|A>>>22,xt=A<<10|I>>>22,kt=R<<13|N>>>19,Ct=N<<13|R>>>19,It=j<<2|T>>>30,At=T<<2|j>>>30,Nt=L<<30|O>>>2,Rt=O<<30|L>>>2,jt=P<<6|D>>>26,Tt=D<<6|P>>>26,Ot=F<<11|B>>>21,Lt=B<<11|F>>>21,Pt=W<<15|U>>>17,Dt=U<<15|W>>>17,Bt=V<<29|H>>>3,Ft=H<<29|V>>>3,Wt=z<<28|q>>>4,Ut=q<<28|z>>>4,Ht=Z<<23|G>>>9,Vt=G<<23|Z>>>9,zt=$<<25|Q>>>7,qt=Q<<25|$>>>7,Gt=Y<<21|J>>>11,Zt=J<<21|Y>>>11,$t=X<<24|K>>>8,Qt=K<<24|X>>>8,Yt=tt<<27|et>>>5,Jt=et<<27|tt>>>5,Kt=nt<<20|rt>>>12,Xt=rt<<20|nt>>>12,te=st<<7|it>>>25,ee=it<<7|st>>>25,ne=ot<<8|at>>>24,re=at<<8|ot>>>24,ie=ut<<14|ct>>>18,se=ct<<14|ut>>>18;t[0]=lt^~St&Ot,t[1]=ht^~Mt&Lt,t[10]=Wt^~Kt&pt,t[11]=Ut^~Xt&bt,t[20]=_t^~jt&zt,t[21]=wt^~Tt&qt,t[30]=Yt^~dt&Et,t[31]=Jt^~ft&xt,t[40]=Nt^~Ht&te,t[41]=Rt^~Vt&ee,t[2]=St^~Ot&Gt,t[3]=Mt^~Lt&Zt,t[12]=Kt^~pt&kt,t[13]=Xt^~bt&Ct,t[22]=jt^~zt&ne,t[23]=Tt^~qt&re,t[32]=dt^~Et&Pt,t[33]=ft^~xt&Dt,t[42]=Ht^~te&yt,t[43]=Vt^~ee&gt,t[4]=Ot^~Gt&ie,t[5]=Lt^~Zt&se,t[14]=pt^~kt&Bt,t[15]=bt^~Ct&Ft,t[24]=zt^~ne&mt,t[25]=qt^~re&vt,t[34]=Et^~Pt&$t,t[35]=xt^~Dt&Qt,t[44]=te^~yt&It,t[45]=ee^~gt&At,t[6]=Gt^~ie&lt,t[7]=Zt^~se&ht,t[16]=kt^~Bt&Wt,t[17]=Ct^~Ft&Ut,t[26]=ne^~mt&_t,t[27]=re^~vt&wt,t[36]=Pt^~$t&Yt,t[37]=Dt^~Qt&Jt,t[46]=yt^~It&Nt,t[47]=gt^~At&Rt,t[8]=ie^~lt&St,t[9]=se^~ht&Mt,t[18]=Bt^~Wt&Kt,t[19]=Ft^~Ut&Xt,t[28]=mt^~_t&jt,t[29]=vt^~wt&Tt,t[38]=$t^~Yt&dt,t[39]=Qt^~Jt&ft,t[48]=It^~Nt&Ht,t[49]=At^~Rt&Vt,t[0]^=Gi[2*e],t[1]^=Gi[2*e+1]}};const Zi=qi;function $i(){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}$i.prototype.initialize=function(t,e){for(let t=0;t<50;++t)this.state[t]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},$i.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(Zi.p1600(this.state),this.count=0)},$i.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<this.count%4*8,0!=(128&t)&&this.count===this.blockSize-1&&Zi.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,Zi.p1600(this.state),this.count=0,this.squeezing=!0},$i.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=Buffer.alloc(t);for(let n=0;n<t;++n)e[n]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(Zi.p1600(this.state),this.count=0);return e},$i.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var Qi=function(t){const e=Vi(t),n=zi(t);return function(t,r){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,r);case"keccak256":return new e(1088,512,null,256,r);case"keccak384":return new e(832,768,null,384,r);case"keccak512":return new e(576,1024,null,512,r);case"sha3-224":return new e(1152,448,6,224,r);case"sha3-256":return new e(1088,512,6,256,r);case"sha3-384":return new e(832,768,6,384,r);case"sha3-512":return new e(576,1024,6,512,r);case"shake128":return new n(1344,256,31,r);case"shake256":return new n(1088,512,31,r);default:throw new Error("Invald algorithm: "+t)}}}($i);const Yi=Qi,Ji=_.exports;function Ki(t){return Buffer.allocUnsafe(t).fill(0)}function Xi(t,e,n){const r=Ki(e);return t=ts(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function ts(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if("string"==typeof t)t=es(t)?Buffer.from((e=ns(t)).length%2?"0"+e:e,"hex"):Buffer.from(t);else if("number"==typeof t)t=intToBuffer(t);else if(null==t)t=Buffer.allocUnsafe(0);else if(Ji.isBN(t))t=t.toArrayLike(Buffer);else{if(!t.toArray)throw new Error("invalid type");t=Buffer.from(t.toArray())}var e;return t}function es(t){return"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]*$/)}function ns(t){return"string"==typeof t&&t.startsWith("0x")?t.slice(2):t}var rs={zeros:Ki,setLength:Xi,setLengthRight:function(t,e){return Xi(t,e,!0)},isHexString:es,stripHexPrefix:ns,toBuffer:ts,bufferToHex:function(t){return"0x"+(t=ts(t)).toString("hex")},keccak:function(t,e){return t=ts(t),e||(e=256),Yi("keccak"+e).update(t).digest()}};const is=rs,ss=_.exports;function os(t){return t.startsWith("int[")?"int256"+t.slice(3):"int"===t?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):"uint"===t?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):"fixed"===t?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):"ufixed"===t?"ufixed128x128":t}function as(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function us(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function cs(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?""===e[2]?"dynamic":parseInt(e[2],10):null}function ls(t){var e=typeof t;if("string"===e)return is.isHexString(t)?new ss(is.stripHexPrefix(t),16):new ss(t,10);if("number"===e)return new ss(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function hs(t,e){var n,r,i,s;if("address"===t)return hs("uint160",ls(e));if("bool"===t)return hs("uint8",e?1:0);if("string"===t)return hs("bytes",new Buffer(e,"utf8"));if(function(t){return t.lastIndexOf("]")===t.length-1}(t)){if(void 0===e.length)throw new Error("Not an array?");if("dynamic"!==(n=cs(t))&&0!==n&&e.length>n)throw new Error("Elements exceed array size: "+n);for(s in i=[],t=t.slice(0,t.lastIndexOf("[")),"string"==typeof e&&(e=JSON.parse(e)),e)i.push(hs(t,e[s]));if("dynamic"===n){var o=hs("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}if("bytes"===t)return e=new Buffer(e),i=Buffer.concat([hs("uint256",e.length),e]),e.length%32!=0&&(i=Buffer.concat([i,is.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if((n=as(t))<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return is.setLengthRight(e,32)}if(t.startsWith("uint")){if((n=as(t))%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if((r=ls(e)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());if(r<0)throw new Error("Supplied uint is negative");return r.toArrayLike(Buffer,"be",32)}if(t.startsWith("int")){if((n=as(t))%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if((r=ls(e)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(Buffer,"be",32)}if(t.startsWith("ufixed")){if(n=us(t),(r=ls(e))<0)throw new Error("Supplied ufixed is negative");return hs("uint256",r.mul(new ss(2).pow(new ss(n[1]))))}if(t.startsWith("fixed"))return n=us(t),hs("int256",ls(e).mul(new ss(2).pow(new ss(n[1]))));throw new Error("Unsupported or invalid type: "+t)}function ds(t){return"string"===t||"bytes"===t||"dynamic"===cs(t)}function fs(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],s=0;s<t.length;s++){var o=os(t[s]),a=e[s];if("bytes"===o)i.push(a);else if("string"===o)i.push(new Buffer(a,"utf8"));else if("bool"===o)i.push(new Buffer(a?"01":"00","hex"));else if("address"===o)i.push(is.setLength(a,20));else if(o.startsWith("bytes")){if((n=as(o))<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(is.setLengthRight(a,n))}else if(o.startsWith("uint")){if((n=as(o))%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if((r=ls(a)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(Buffer,"be",n/8))}else{if(!o.startsWith("int"))throw new Error("Unsupported or invalid type: "+o);if((n=as(o))%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if((r=ls(a)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());i.push(r.toTwos(n).toArrayLike(Buffer,"be",n/8))}}return Buffer.concat(i)}var ps={rawEncode:function(t,e){var n=[],r=[],i=32*t.length;for(var s in t){var o=os(t[s]),a=hs(o,e[s]);ds(o)?(n.push(hs("uint256",i)),r.push(a),i+=a.length):n.push(a)}return Buffer.concat(n.concat(r))},solidityPack:fs,soliditySHA3:function(t,e){return is.keccak(fs(t,e))}};const bs=rs,ys=ps,gs={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"]},ms={encodeData(t,e,n,r=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(r){const o=(t,e,i)=>{if(void 0!==n[e])return["bytes32",null==i?"0x0000000000000000000000000000000000000000000000000000000000000000":bs.keccak(this.encodeData(e,i,n,r))];if(void 0===i)throw new Error(`missing value for field ${t} of type ${e}`);if("bytes"===e)return["bytes32",bs.keccak(i)];if("string"===e)return"string"==typeof i&&(i=Buffer.from(i,"utf8")),["bytes32",bs.keccak(i)];if(e.lastIndexOf("]")===e.length-1){const n=e.slice(0,e.lastIndexOf("[")),r=i.map((e=>o(t,n,e)));return["bytes32",bs.keccak(ys.rawEncode(r.map((([t])=>t)),r.map((([,t])=>t))))]}return[e,i]};for(const r of n[t]){const[t,n]=o(r.name,r.type,e[r.name]);i.push(t),s.push(n)}}else for(const o of n[t]){let t=e[o.name];if(void 0!==t)if("bytes"===o.type)i.push("bytes32"),t=bs.keccak(t),s.push(t);else if("string"===o.type)i.push("bytes32"),"string"==typeof t&&(t=Buffer.from(t,"utf8")),t=bs.keccak(t),s.push(t);else if(void 0!==n[o.type])i.push("bytes32"),t=bs.keccak(this.encodeData(o.type,t,n,r)),s.push(t);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(t)}}return ys.rawEncode(i,s)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter((e=>e!==t));r=[t].concat(r.sort());for(const t of r){if(!e[t])throw new Error("No type definition specified: "+t);n+=t+"("+e[t].map((({name:t,type:e})=>e+" "+t)).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||void 0===e[t])return n;n.push(t);for(const r of e[t])for(const t of this.findTypeDependencies(r.type,e,n))!n.includes(t)&&n.push(t);return n},hashStruct(t,e,n,r=!0){return bs.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return bs.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in gs.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[Buffer.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),"EIP712Domain"!==n.primaryType&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),bs.keccak(Buffer.concat(r))}};var vs={TYPED_MESSAGE_SCHEMA:gs,TypedDataUtils:ms,hashForSignTypedDataLegacy:function(t){return function(t){const e=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!t.length)throw e;const n=t.map((function(t){return"bytes"===t.type?bs.toBuffer(t.value):t.value})),r=t.map((function(t){return t.type})),i=t.map((function(t){if(!t.name)throw e;return t.type+" "+t.name}));return ys.soliditySHA3(["bytes32","bytes32"],[ys.soliditySHA3(new Array(t.length).fill("string"),i),ys.soliditySHA3(r,n)])}(t.data)},hashForSignTypedData_v3:function(t){return ms.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return ms.hash(t.data)}};var _s={};Object.defineProperty(_s,"__esModule",{value:!0}),_s.filterFromParam=_s.FilterPolyfill=void 0;const ws=kr,Ss=Jt,Ms={jsonrpc:"2.0",id:0};function Es(t){return{fromBlock:ks(t.fromBlock),toBlock:ks(t.toBlock),addresses:void 0===t.address?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}function xs(t){const e={fromBlock:Cs(t.fromBlock),toBlock:Cs(t.toBlock),topics:t.topics};return null!==t.addresses&&(e.address=t.addresses),e}function ks(t){if(void 0===t||"latest"===t||"pending"===t)return"latest";if("earliest"===t)return(0,ws.IntNumber)(0);if((0,Ss.isHexString)(t))return(0,Ss.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Cs(t){return"latest"===t?t:(0,Ss.hexStringFromIntNumber)(t)}function Is(){return Object.assign(Object.assign({},Ms),{error:{code:-32e3,message:"filter not found"}})}function As(){return Object.assign(Object.assign({},Ms),{result:[]})}_s.FilterPolyfill=class{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,ws.IntNumber)(1),this.provider=t}async newFilter(t){const e=Es(t),n=this.makeFilterId(),r=await this.setInitialCursorPosition(n,e.fromBlock);return console.log(`Installing new log filter(${n}):`,e,"initial cursor position:",r),this.logFilters.set(n,e),this.setFilterTimeout(n),(0,Ss.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),e=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,e),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Ss.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),e=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,e),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Ss.hexStringFromIntNumber)(t)}uninstallFilter(t){const e=(0,Ss.intNumberFromHexString)(t);return console.log(`Uninstalling filter (${e})`),this.deleteFilter(e),!0}getFilterChanges(t){const e=(0,Ss.intNumberFromHexString)(t);return this.timeouts.has(e)&&this.setFilterTimeout(e),this.logFilters.has(e)?this.getLogFilterChanges(e):this.blockFilters.has(e)?this.getBlockFilterChanges(e):this.pendingTransactionFilters.has(e)?this.getPendingTransactionFilterChanges(e):Promise.resolve(Is())}async getFilterLogs(t){const e=(0,Ss.intNumberFromHexString)(t),n=this.logFilters.get(e);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Ms),{method:"eth_getLogs",params:[xs(n)]})):Is()}makeFilterId(){return(0,ws.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise(((e,n)=>{this.provider.sendAsync(t,((t,r)=>t?n(t):Array.isArray(r)||null==r?n(new Error(`unexpected response received: ${JSON.stringify(r)}`)):void e(r)))}))}deleteFilter(t){console.log(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const e=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!e)return Is();const r=await this.getCurrentBlockHeight(),i="latest"===e.toBlock?r:e.toBlock;if(n>r)return As();if(n>e.toBlock)return As();console.log(`Fetching logs from ${n} to ${i} for filter ${t}`);const s=await this.sendAsyncPromise(Object.assign(Object.assign({},Ms),{method:"eth_getLogs",params:[xs(Object.assign(Object.assign({},e),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(s.result)){const e=s.result.map((t=>(0,Ss.intNumberFromHexString)(t.blockNumber||"0x0"))),r=Math.max(...e);if(r&&r>n){const e=(0,ws.IntNumber)(r+1);console.log(`Moving cursor position for filter (${t}) from ${n} to ${e}`),this.cursors.set(t,e)}}return s}async getBlockFilterChanges(t){const e=this.cursors.get(t);if(!e)return Is();const n=await this.getCurrentBlockHeight();if(e>n)return As();console.log(`Fetching blocks from ${e} to ${n} for filter (${t})`);const r=(await Promise.all((0,Ss.range)(e,n+1).map((t=>this.getBlockHashByNumber((0,ws.IntNumber)(t)))))).filter((t=>!!t)),i=(0,ws.IntNumber)(e+r.length);return console.log(`Moving cursor position for filter (${t}) from ${e} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},Ms),{result:r})}async getPendingTransactionFilterChanges(t){return Promise.resolve(As())}async setInitialCursorPosition(t,e){const n=await this.getCurrentBlockHeight(),r="number"==typeof e&&e>n?e:n;return this.cursors.set(t,r),r}setFilterTimeout(t){const e=this.timeouts.get(t);e&&window.clearTimeout(e);const n=window.setTimeout((()=>{console.log(`Filter (${t}) timed out`),this.deleteFilter(t)}),3e5);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},Ms),{method:"eth_blockNumber",params:[]}));return(0,Ss.intNumberFromHexString)((0,Ss.ensureHexString)(t))}async getBlockHashByNumber(t){const e=await this.sendAsyncPromise(Object.assign(Object.assign({},Ms),{method:"eth_getBlockByNumber",params:[(0,Ss.hexStringFromIntNumber)(t),!1]}));return e.result&&"string"==typeof e.result.hash?(0,Ss.ensureHexString)(e.result.hash):null}},_s.filterFromParam=Es;var Ns={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,(e=t.JSONRPCMethod||(t.JSONRPCMethod={})).eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(Ns);var Rs={},js={},Ts={},Os={},Ls=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Os,"__esModule",{value:!0}),Os.BaseBlockTracker=void 0;const Ps=Ls(n.safeEventEmitter),Ds=(t,e)=>t+e,Bs=["sync","latest"];class Fs extends Ps.default{constructor(t){super(),this._blockResetDuration=t.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((t=>this.once("latest",t)))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){Bs.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Bs.map((t=>this.listenerCount(t))).reduce(Ds)}_newPotentialLatest(t){const e=this._currentBlock;e&&Ws(t)<=Ws(e)||this._setCurrentBlock(t)}_setCurrentBlock(t){const e=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:e,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}function Ws(t){return Number.parseInt(t,16)}Os.BaseBlockTracker=Fs;var Us={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=c.dist;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")}(Us);var Hs=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.PollingBlockTracker=void 0;const Vs=Hs(i.jsonRpcRandomId),zs=Hs(n.pify),qs=Os,Gs=(0,Us.createModuleLogger)(Us.projectLogger,"polling-block-tracker"),Zs=(0,Vs.default)();class $s extends qs.BaseBlockTracker{constructor(t={}){var e;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:null!==(e=t.blockResetDuration)&&void 0!==e?e:t.pollingInterval}),this._provider=t.provider,this._pollingInterval=t.pollingInterval||2e4,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=void 0===t.keepEventLoopActive||t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const t=Qs(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await t}catch(e){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${null!==(t=e.stack)&&void 0!==t?t:e}`);try{this.emit("error",n)}catch(t){console.error(n)}const r=Qs(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Zs(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Gs("Making request",t);const e=await(0,zs.default)((e=>this._provider.sendAsync(t,e)))();if(Gs("Got response",e),e.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${e.error.message}`);return e.result}}function Qs(t,e){return new Promise((n=>{const r=setTimeout(n,t);r.unref&&e&&r.unref()}))}Ts.PollingBlockTracker=$s;var Ys={},Js=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.SubscribeBlockTracker=void 0;const Ks=Js(i.jsonRpcRandomId),Xs=Os,to=(0,Ks.default)();class eo extends Xs.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(void 0===this._subscriptionId||null===this._subscriptionId)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(null!==this._subscriptionId&&void 0!==this._subscriptionId)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...e){return new Promise(((n,r)=>{this._provider.sendAsync({id:to(),method:t,params:e,jsonrpc:"2.0"},((t,e)=>{t?r(t):n(e.result)}))}))}_handleSubData(t,e){var n;"eth_subscription"===e.method&&(null===(n=e.params)||void 0===n?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(e.params.result.number)}}Ys.SubscribeBlockTracker=eo;var no={};Object.defineProperty(no,"__esModule",{value:!0}),function(t){var n=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ts,t),r(Ys,t),r(no,t)}(js);const ro=(t,e,n,r)=>function(...i){return new(0,e.promiseModule)(((s,o)=>{e.multiArgs?i.push(((...t)=>{e.errorFirst?t[0]?o(t):(t.shift(),s(t)):s(t)})):e.errorFirst?i.push(((t,e)=>{t?o(t):s(e)})):i.push(s);const a=this===n?r:this;Reflect.apply(t,a,i)}))},io=new WeakMap;const so=n.safeEventEmitter.default;var oo=class extends so{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach((t=>this.emit("update",t)))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};const ao=oo;var uo=class extends ao{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}},co={minBlockRef:function(...t){return lo(t)[0]},maxBlockRef:function(...t){const e=lo(t);return e[e.length-1]},sortBlockRefs:lo,bnToHex:function(t){return"0x"+t.toString(16)},blockRefIsNumber:function(t){return t&&!["earliest","latest","pending"].includes(t)},hexToInt:ho,incrementHexInt:function(t){if(null==t)return t;return fo(ho(t)+1)},intToHex:fo,unsafeRandomBytes:function(t){let e="0x";for(let n=0;n<t;n++)e+=po(),e+=po();return e}};function lo(t){return t.sort(((t,e)=>"latest"===t||"earliest"===e?1:"latest"===e||"earliest"===t?-1:ho(t)-ho(e)))}function ho(t){return null==t?t:Number.parseInt(t,16)}function fo(t){if(null==t)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function po(){return Math.floor(16*Math.random()).toString(16)}const bo=i.requireEthQuery(),yo=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const n=typeof t;if(null===t||"object"!==n&&"function"!==n)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===t?"null":n}\``);const r=new WeakMap,i=new Proxy(t,{apply(t,n,s){const o=r.get(t);if(o)return Reflect.apply(o,n,s);const a=e.excludeMain?t:ro(t,e,i,t);return r.set(t,a),Reflect.apply(a,n,s)},get(t,n){const s=t[n];if(!((t,n)=>{let r=io.get(t);if(r||(r={},io.set(t,r)),n in r)return r[n];const i=t=>"string"==typeof t||"symbol"==typeof n?n===t:t.test(n),s=Reflect.getOwnPropertyDescriptor(t,n),o=void 0===s||s.writable||s.configurable,a=(e.include?e.include.some(i):!e.exclude.some(i))&&o;return r[n]=a,a})(t,n)||s===Function.prototype[n])return s;const o=r.get(s);if(o)return o;if("function"==typeof s){const n=ro(s,e,i,t);return r.set(s,n),n}return s}});return i},go=uo,{bnToHex:mo,hexToInt:vo,incrementHexInt:_o,minBlockRef:wo,blockRefIsNumber:So}=co;var Mo=class extends go{constructor({provider:t,params:e}){super(),this.type="log",this.ethQuery=new bo(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},e),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map((t=>t.toLowerCase())))}async initialize({currentBlock:t}){let e=this.params.fromBlock;["latest","pending"].includes(e)&&(e=t),"earliest"===e&&(e="0x0"),this.params.fromBlock=e;const n=wo(this.params.toBlock,t),r=Object.assign({},this.params,{toBlock:n}),i=await this._fetchLogs(r);this.addInitialResults(i)}async update({oldBlock:t,newBlock:e}){const n=e;let r;r=t?_o(t):e;const i=Object.assign({},this.params,{fromBlock:r,toBlock:n}),s=(await this._fetchLogs(i)).filter((t=>this.matchLog(t)));this.addResults(s)}async _fetchLogs(t){return await yo((e=>this.ethQuery.getLogs(t,e)))()}matchLog(t){if(vo(this.params.fromBlock)>=vo(t.blockNumber))return!1;if(So(this.params.toBlock)&&vo(this.params.toBlock)<=vo(t.blockNumber))return!1;const e=t.address&&t.address.toLowerCase();if(this.params.address&&e&&!this.params.address.includes(e))return!1;const n=this.params.topics.every(((e,n)=>{let r=t.topics[n];if(!r)return!1;r=r.toLowerCase();let i=Array.isArray(e)?e:[e];if(i.includes(null))return!0;i=i.map((t=>t.toLowerCase()));return i.includes(r)}));return n}},Eo=async function({provider:t,fromBlock:e,toBlock:n}){e||(e=n);const r=xo(e),i=xo(n),s=Array(i-r+1).fill().map(((t,e)=>r+e)).map(ko);return await Promise.all(s.map((e=>async function(t,e,n){for(let r=0;r<3;r++)try{return await Co(t,{id:1,jsonrpc:"2.0",method:e,params:n})}catch(t){console.error(`provider.sendAsync failed: ${t.stack||t.message||t}`)}throw new Error(`Block not found for params: ${JSON.stringify(n)}`)}(t,"eth_getBlockByNumber",[e,!1]))))};function xo(t){return null==t?t:Number.parseInt(t,16)}function ko(t){if(null==t)return t;return"0x"+t.toString(16)}function Co(t,e){return new Promise(((n,r)=>{t.sendAsync(e,((t,e)=>{t?r(t):e.error?r(e.error):e.result?n(e.result):r(new Error("Result was empty"))}))}))}const Io=oo,Ao=Eo,{incrementHexInt:No}=co;var Ro=class extends Io{constructor({provider:t,params:e}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:e}){const n=e,r=No(t),i=(await Ao({provider:this.provider,fromBlock:r,toBlock:n})).map((t=>t.hash));this.addResults(i)}};const jo=oo,To=Eo,{incrementHexInt:Oo}=co;var Lo=class extends jo{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const e=t,n=Oo(t),r=await To({provider:this.provider,fromBlock:n,toBlock:e}),i=[];for(const t of r)i.push(...t.transactions);this.addResults(i)}};const Po=i.requireLib().Mutex,{createAsyncMiddleware:Do,createScaffoldMiddleware:Bo}=n.dist,Fo=Mo,Wo=Ro,Uo=Lo,{intToHex:Ho,hexToInt:Vo}=co;var zo=function({blockTracker:t,provider:e}){let n=0,r={};const i=new Po,s=function({mutex:t}){return e=>async(n,r,i,s)=>{(await t.acquire())(),e(n,r,i,s)}}({mutex:i}),o=Bo({eth_newFilter:s(qo(u)),eth_newBlockFilter:s(qo(c)),eth_newPendingTransactionFilter:s(qo(l)),eth_uninstallFilter:s(Go(f)),eth_getFilterChanges:s(Go(h)),eth_getFilterLogs:s(Go(d))}),a=async({oldBlock:t,newBlock:e})=>{if(0===r.length)return;const n=await i.acquire();try{await Promise.all(Zo(r).map((async n=>{try{await n.update({oldBlock:t,newBlock:e})}catch(t){console.error(t)}})))}catch(t){console.error(t)}n()};return o.newLogFilter=u,o.newBlockFilter=c,o.newPendingTransactionFilter=l,o.uninstallFilter=f,o.getFilterChanges=h,o.getFilterLogs=d,o.destroy=()=>{!async function(){const t=Zo(r).length;r={},b({prevFilterCount:t,newFilterCount:0})}()},o;async function u(t){const n=new Fo({provider:e,params:t});return await p(n),n}async function c(){const t=new Wo({provider:e});return await p(t),t}async function l(){const t=new Uo({provider:e});return await p(t),t}async function h(t){const e=Vo(t),n=r[e];if(!n)throw new Error(`No filter for index "${e}"`);return n.getChangesAndClear()}async function d(t){const e=Vo(t),n=r[e];if(!n)throw new Error(`No filter for index "${e}"`);let i=[];return"log"===n.type&&(i=n.getAllResults()),i}async function f(t){const e=Vo(t),n=r[e],i=Boolean(n);return i&&await async function(t){const e=Zo(r).length;delete r[t];const n=Zo(r).length;b({prevFilterCount:e,newFilterCount:n})}(e),i}async function p(e){const i=Zo(r).length,s=await t.getLatestBlock();await e.initialize({currentBlock:s}),n++,r[n]=e,e.id=n,e.idHex=Ho(n);return b({prevFilterCount:i,newFilterCount:Zo(r).length}),n}function b({prevFilterCount:e,newFilterCount:n}){0===e&&n>0?t.on("sync",a):e>0&&0===n&&t.removeListener("sync",a)}};function qo(t){return Go((async(...e)=>{const n=await t(...e);return Ho(n.id)}))}function Go(t){return Do((async(e,n)=>{const r=await t.apply(null,e.params);n.result=r}))}function Zo(t,e){const n=[];for(let e in t)n.push(t[e]);return n}const $o=n.safeEventEmitter.default,{createAsyncMiddleware:Qo,createScaffoldMiddleware:Yo}=n.dist,Jo=zo,{unsafeRandomBytes:Ko,incrementHexInt:Xo}=co,ta=Eo;var ea=function({blockTracker:t,provider:e}){const n={},r=Jo({blockTracker:t,provider:e});let i=!1;const s=new $o,o=Yo({eth_subscribe:Qo((async function(s,o){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const u=s.params[0],c=Ko(16);let l;switch(u){case"newHeads":l=h({subId:c});break;case"logs":const t=s.params[1];l=d({subId:c,filter:await r.newLogFilter(t)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${u}"`)}return n[c]=l,void(o.result=c);function h({subId:n}){const r={type:u,destroy:async()=>{t.removeListener("sync",r.update)},update:async({oldBlock:t,newBlock:r})=>{const i=r,s=Xo(t);(await ta({provider:e,fromBlock:s,toBlock:i})).map(na).filter((t=>null!==t)).forEach((t=>{a(n,t)}))}};return t.on("sync",r.update),r}function d({subId:t,filter:e}){e.on("update",(e=>a(t,e)));return{type:u,destroy:async()=>await r.uninstallFilter(e.idHex)}}})),eth_unsubscribe:Qo((async function(t,e){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const r=t.params[0],s=n[r];if(!s)return void(e.result=!1);delete n[r],await s.destroy(),e.result=!0}))});return o.destroy=function(){s.removeAllListeners();for(const t in n)n[t].destroy(),delete n[t];i=!0},{events:s,middleware:o};function a(t,e){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:t,result:e}})}};function na(t){return null==t?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.SubscriptionManager=void 0;const ra=js,ia=ea,sa=()=>{};Rs.SubscriptionManager=class{constructor(t){const e=new ra.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:r}=ia({blockTracker:e,provider:t});this.events=n,this.subscriptionMiddleware=r}async handleRequest(t){const e={};return await this.subscriptionMiddleware(t,e,sa,sa),e}destroy(){this.subscriptionMiddleware.destroy()}};var oa=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(v,"__esModule",{value:!0}),v.CoinbaseWalletProvider=void 0;const aa=oa(n.safeEventEmitter),ua=oa(_.exports),ca=w,la=L,ha=P,da=$r,fa=Jt,pa=oa(vs),ba=_s,ya=Ns,ga=Rs,ma="DefaultChainId",va="DefaultJsonRpcUrl";class _a extends aa.default{constructor(t){var e,n;super(),this._filterPolyfill=new ba.FilterPolyfill(this),this._subscriptionManager=new ga.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=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=null===(e=t.overrideIsCoinbaseWallet)||void 0===e||e,this.isCoinbaseBrowser=null!==(n=t.overrideIsCoinbaseBrowser)&&void 0!==n&&n,this.qrUrl=t.qrUrl,this.supportsAddressSwitching=t.supportsAddressSwitching,this.isLedger=t.isLedger;const r=this.getChainId(),i=(0,fa.prepend0x)(r.toString(16));this.emit("connect",{chainIdStr:i});const s=this._storage.getItem(da.LOCAL_STORAGE_ADDRESSES_KEY);if(s){const t=s.split(" ");""!==t[0]&&(this._addresses=t.map((t=>(0,fa.ensureAddressString)(t))),this.emit("accountsChanged",t))}this._subscriptionManager.events.on("notification",(t=>{this.emit("message",{type:t.method,data:t.params})})),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",(t=>{var e;if(t.origin===location.origin&&t.source===window&&"walletLinkMessage"===t.data.type){if("defaultChainChanged"===t.data.data.action||"dappChainSwitched"===t.data.data.action){const n=t.data.data.chainId,r=null!==(e=t.data.data.jsonRpcUrl)&&void 0!==e?e:this.jsonRpcUrl;this.updateProviderInfo(r,Number(n))}"addressChanged"===t.data.data.action&&this._setAddresses([t.data.data.address])}}))}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,fa.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return null!==(t=this._storage.getItem(va))&&void 0!==t?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(va,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,e){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=e,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,e){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(ma,e.toString(10));!((0,fa.ensureIntNumber)(e)!==n)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,e,n,r,i,s){const o=await this.initializeRelay();return!!(await o.watchAsset(t,e,n,r,i,null==s?void 0:s.toString()).promise).result}async addEthereumChain(t,e,n,r,i,s){var o,a;if((0,fa.ensureIntNumber)(t)===this.getChainId())return!1;const u=await this.initializeRelay(),c=u.inlineAddEthereumChain(t.toString());this._isAuthorized()||c||await u.requestEthereumAccounts().promise;const l=await u.addEthereumChain(t.toString(),e,i,n,r,s).promise;return!0===(null===(o=l.result)||void 0===o?void 0:o.isApproved)&&this.updateProviderInfo(e[0],t),!0===(null===(a=l.result)||void 0===a?void 0:a.isApproved)}async switchEthereumChain(t){const e=await this.initializeRelay(),n=await e.switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if(n.errorCode)throw ca.ethErrors.provider.custom({code:n.errorCode});const r=n.result;r.isApproved&&r.rpcUrl.length>0&&this.updateProviderInfo(r.rpcUrl,t)}setAppInfo(t,e){this.initializeRelay().then((n=>n.setAppInfo(t,e)))}async enable(){var t;return null===(t=this.diagnostic)||void 0===t||t.log(la.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?ha.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(ya.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(t,e){if("string"==typeof t){const n={jsonrpc:"2.0",id:0,method:t,params:Array.isArray(e)?e:void 0!==e?[e]:[]};return this._sendRequestAsync(n).then((t=>t.result))}if("function"==typeof e){const n=t,r=e;return this._sendAsync(n,r)}if(Array.isArray(t)){return t.map((t=>this._sendRequest(t)))}const n=t;return this._sendRequest(n)}async sendAsync(t,e){if("function"!=typeof e)throw new Error("callback is required");if(Array.isArray(t)){const n=e;return void this._sendMultipleRequestsAsync(t).then((t=>n(null,t))).catch((t=>n(t,null)))}const n=e;return this._sendRequestAsync(t).then((t=>n(null,t))).catch((t=>n(t,null)))}async request(t){if(!t||"object"!=typeof t||Array.isArray(t))throw ca.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:n}=t;if("string"!=typeof e||0===e.length)throw ca.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw ca.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const r=void 0===n?[]:n,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:e,params:r,jsonrpc:"2.0",id:i})).result}async scanQRCode(t){const e=await this.initializeRelay(),n=await e.scanQRCode((0,fa.ensureRegExpString)(t)).promise;if("string"!=typeof n.result)throw new Error("result was not a string");return n.result}async genericRequest(t,e){const n=await this.initializeRelay(),r=await n.genericRequest(t,e).promise;if("string"!=typeof r.result)throw new Error("result was not a string");return r.result}async selectProvider(t){const e=await this.initializeRelay(),n=await e.selectProvider(t).promise;if("string"!=typeof n.result)throw new Error("result was not a string");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const e={jsonrpc:"2.0",id:t.id},{method:n}=t;if(e.result=this._handleSynchronousMethods(t),void 0===e.result)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return e}_setAddresses(t,e){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map((t=>(0,fa.ensureAddressString)(t)));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!e||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(da.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}_sendRequestAsync(t){return new Promise(((e,n)=>{try{const r=this._handleSynchronousMethods(t);if(void 0!==r)return e({jsonrpc:"2.0",id:t.id,result:r});const i=this._handleAsynchronousFilterMethods(t);if(void 0!==i)return void i.then((n=>e(Object.assign(Object.assign({},n),{id:t.id})))).catch((t=>n(t)));const s=this._handleSubscriptionMethods(t);if(void 0!==s)return void s.then((n=>e({jsonrpc:"2.0",id:t.id,result:n.result}))).catch((t=>n(t)))}catch(t){return n(t)}this._handleAsynchronousMethods(t).then((n=>n&&e(Object.assign(Object.assign({},n),{id:t.id})))).catch((t=>n(t)))}))}_sendMultipleRequestsAsync(t){return Promise.all(t.map((t=>this._sendRequestAsync(t))))}_handleSynchronousMethods(t){const{method:e}=t,n=t.params||[];switch(e){case ya.JSONRPCMethod.eth_accounts:return this._eth_accounts();case ya.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case ya.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case ya.JSONRPCMethod.net_version:return this._net_version();case ya.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:e}=t,n=t.params||[];switch(e){case ya.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case ya.JSONRPCMethod.eth_sign:return this._eth_sign(n);case ya.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case ya.JSONRPCMethod.personal_sign:return this._personal_sign(n);case ya.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case ya.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case ya.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case ya.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case ya.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case ya.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case ya.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case ya.JSONRPCMethod.eth_signTypedData_v4:case ya.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case ya.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case ya.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case ya.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case ya.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(t){const{method:e}=t,n=t.params||[];switch(e){case ya.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case ya.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case ya.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case ya.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case ya.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case ya.JSONRPCMethod.eth_subscribe:case ya.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const e=(0,fa.ensureAddressString)(t);return this._addresses.map((t=>(0,fa.ensureAddressString)(t))).includes(e)}catch(t){}return!1}_ensureKnownAddress(t){var e;if(!this._isKnownAddress(t))throw null===(e=this.diagnostic)||void 0===e||e.log(la.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const e=t.from?(0,fa.ensureAddressString)(t.from):this.selectedAddress;if(!e)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(e);return{fromAddress:e,toAddress:t.to?(0,fa.ensureAddressString)(t.to):null,weiValue:null!=t.value?(0,fa.ensureBN)(t.value):new ua.default(0),data:t.data?(0,fa.ensureBuffer)(t.data):Buffer.alloc(0),nonce:null!=t.nonce?(0,fa.ensureIntNumber)(t.nonce):null,gasPriceInWei:null!=t.gasPrice?(0,fa.ensureBN)(t.gasPrice):null,maxFeePerGas:null!=t.maxFeePerGas?(0,fa.ensureBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:null!=t.maxPriorityFeePerGas?(0,fa.ensureBN)(t.maxPriorityFeePerGas):null,gasLimit:null!=t.gas?(0,fa.ensureBN)(t.gas):null,chainId:this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw ca.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw ca.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,e,n,r){this._ensureKnownAddress(e);try{const i=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await i.signEthereumMessage(t,e,n,r).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw ca.ethErrors.provider.userRejectedRequest("User denied message signature");throw t}}async _ethereumAddressFromSignedMessage(t,e,n){const r=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await r.ethereumAddressFromSignedMessage(t,e,n).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,fa.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(ma);if(!t)return(0,fa.ensureIntNumber)(this._chainIdFromOpts);const e=parseInt(t,10);return(0,fa.ensureIntNumber)(e)}async _eth_requestAccounts(){var t;if(null===(t=this.diagnostic)||void 0===t||t.log(la.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?ha.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{const t=await this.initializeRelay();e=await t.requestEthereumAccounts().promise}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw ca.ethErrors.provider.userRejectedRequest("User denied account authorization");throw t}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const e=(0,fa.ensureAddressString)(t[0]),n=(0,fa.ensureBuffer)(t[1]);return this._signEthereumMessage(n,e,!1)}_eth_ecRecover(t){const e=(0,fa.ensureBuffer)(t[0]),n=(0,fa.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(e,n,!1)}_personal_sign(t){this._requireAuthorization();const e=(0,fa.ensureBuffer)(t[0]),n=(0,fa.ensureAddressString)(t[1]);return this._signEthereumMessage(e,n,!0)}_personal_ecRecover(t){const e=(0,fa.ensureBuffer)(t[0]),n=(0,fa.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(e,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const e=this._prepareTransactionParams(t[0]||{});try{const t=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await t.signEthereumTransaction(e).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw ca.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw t}}async _eth_sendRawTransaction(t){const e=(0,fa.ensureBuffer)(t[0]),n=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await n.submitEthereumTransaction(e,this.getChainId()).promise).result}}async _eth_sendTransaction(t){this._requireAuthorization();const e=this._prepareTransactionParams(t[0]||{});try{const t=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await t.signAndSubmitEthereumTransaction(e).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw ca.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw t}}async _eth_signTypedData_v1(t){this._requireAuthorization();const e=(0,fa.ensureParsedJSONObject)(t[0]),n=(0,fa.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const r=pa.default.hashForSignTypedDataLegacy({data:e}),i=JSON.stringify(e,null,2);return this._signEthereumMessage(r,n,!1,i)}async _eth_signTypedData_v3(t){this._requireAuthorization();const e=(0,fa.ensureAddressString)(t[0]),n=(0,fa.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(e);const r=pa.default.hashForSignTypedData_v3({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(r,e,!1,i)}async _eth_signTypedData_v4(t){this._requireAuthorization();const e=(0,fa.ensureAddressString)(t[0]),n=(0,fa.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(e);const r=pa.default.hashForSignTypedData_v4({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(r,e,!1,i)}async _cbwallet_arbitrary(t){const e=t[0],n=t[1];if("string"!=typeof n)throw new Error("parameter must be a string");if("object"!=typeof e||null===e)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(e,n)}}async _wallet_addEthereumChain(t){var e,n,r,i;const s=t[0];if(0===(null===(e=s.rpcUrls)||void 0===e?void 0:e.length))return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!s.chainName||""===s.chainName.trim())throw ca.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!s.nativeCurrency)throw ca.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});const o=parseInt(s.chainId,16);return await this.addEthereumChain(o,null!==(n=s.rpcUrls)&&void 0!==n?n:[],null!==(r=s.blockExplorerUrls)&&void 0!==r?r:[],s.chainName,null!==(i=s.iconUrls)&&void 0!==i?i:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const e=t[0];return await this.switchEthereumChain(parseInt(e.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const e=Array.isArray(t)?t[0]:t;if(!e.type)throw ca.ethErrors.rpc.invalidParams({message:"Type is required"});if("ERC20"!==(null==e?void 0:e.type))throw ca.ethErrors.rpc.invalidParams({message:`Asset of type '${e.type}' is not supported`});if(!(null==e?void 0:e.options))throw ca.ethErrors.rpc.invalidParams({message:"Options are required"});if(!(null==e?void 0:e.options.address))throw ca.ethErrors.rpc.invalidParams({message:"Address is required"});const n=this.getChainId(),{address:r,symbol:i,image:s,decimals:o}=e.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(e.type,r,i,o,s,n)}}_eth_uninstallFilter(t){const e=(0,fa.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(e)}async _eth_newFilter(t){const e=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(e)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const e=(0,fa.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(e)}_eth_getFilterLogs(t){const e=(0,fa.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(e)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then((t=>(t.setAccountsCallback(((t,e)=>this._setAddresses(t,e))),t.setChainCallback(((t,e)=>{this.updateProviderInfo(e,parseInt(t,10))})),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t)))}}v.CoinbaseWalletProvider=_a;var wa,Sa,Ma,Ea,xa,ka,Ca,Ia,Aa,Na={},Ra={},ja={},Ta={},Oa=[],La=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Pa(t,e){for(var n in e)t[n]=e[n];return t}function Da(t){var e=t.parentNode;e&&e.removeChild(t)}function Ba(t,e,n){var r,i,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?wa.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Fa(t,o,r,i,null)}function Fa(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Ma:i};return null==i&&null!=Sa.vnode&&Sa.vnode(s),s}function Wa(t){return t.children}function Ua(t,e){this.props=t,this.context=e}function Ha(t,e){if(null==e)return t.__?Ha(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Ha(t):null}function Va(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Va(t)}}function za(t){(!t.__d&&(t.__d=!0)&&xa.push(t)&&!qa.__r++||ka!==Sa.debounceRendering)&&((ka=Sa.debounceRendering)||Ca)(qa)}function qa(){var t,e,n,r,i,s,o,a;for(xa.sort(Ia);t=xa.shift();)t.__d&&(e=xa.length,r=void 0,i=void 0,o=(s=(n=t).__v).__e,(a=n.__P)&&(r=[],(i=Pa({},s)).__v=s.__v+1,tu(a,s,i,n.__n,void 0!==a.ownerSVGElement,null!=s.__h?[o]:null,r,null==o?Ha(s):o,s.__h),eu(r,s),s.__e!=o&&Va(s)),xa.length>e&&xa.sort(Ia));qa.__r=0}function Ga(t,e,n,r,i,s,o,a,u,c){var l,h,d,f,p,b,y,g=r&&r.__k||Oa,m=g.length;for(n.__k=[],l=0;l<e.length;l++)if(null!=(f=n.__k[l]=null==(f=e[l])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Fa(null,f,null,null,f):Array.isArray(f)?Fa(Wa,{children:f},null,null,null):f.__b>0?Fa(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__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}tu(t,f,d=d||Ta,i,s,o,a,u,c),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=u=Za(f,u,t):u=$a(t,f,d,g,p,u),"function"==typeof n.type&&(n.__d=u)):u&&d.__e==u&&u.parentNode!=t&&(u=Ha(d))}for(n.__e=b,l=m;l--;)null!=g[l]&&("function"==typeof n.type&&null!=g[l].__e&&g[l].__e==n.__d&&(n.__d=Qa(r).nextSibling),iu(g[l],g[l]));if(y)for(l=0;l<y.length;l++)ru(y[l],y[++l],y[++l])}function Za(t,e,n){for(var r,i=t.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=t,e="function"==typeof r.type?Za(r,e,n):$a(n,r,r,i,r.__e,e));return e}function $a(t,e,n,r,i,s){var o,a,u;if(void 0!==e.__d)o=e.__d,e.__d=void 0;else if(null==n||i!=s||null==i.parentNode)t:if(null==s||s.parentNode!==t)t.appendChild(i),o=null;else{for(a=s,u=0;(a=a.nextSibling)&&u<r.length;u+=1)if(a==i)break t;t.insertBefore(i,s),o=s}return void 0!==o?o:i.nextSibling}function Qa(t){var e,n,r;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(r=Qa(n)))return r;return null}function Ya(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||La.test(e)?n:n+"px"}function Ja(t,e,n,r,i){var s;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||Ya(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||Ya(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r||t.addEventListener(e,s?Xa:Ka,s):t.removeEventListener(e,s?Xa:Ka,s);else if("dangerouslySetInnerHTML"!==e){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function Ka(t){return this.l[t.type+!1](Sa.event?Sa.event(t):t)}function Xa(t){return this.l[t.type+!0](Sa.event?Sa.event(t):t)}function tu(t,e,n,r,i,s,o,a,u){var c,l,h,d,f,p,b,y,g,m,v,_,w,S,M,E=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(u=n.__h,a=e.__e=n.__e,e.__h=null,s=[a]),(c=Sa.__b)&&c(e);try{t:if("function"==typeof E){if(y=e.props,g=(c=E.contextType)&&r[c.__c],m=c?g?g.props.value:c.__:r,n.__c?b=(l=e.__c=n.__c).__=l.__E:("prototype"in E&&E.prototype.render?e.__c=l=new E(y,m):(e.__c=l=new Ua(y,m),l.constructor=E,l.render=su),g&&g.sub(l),l.props=y,l.state||(l.state={}),l.context=m,l.__n=r,h=l.__d=!0,l.__h=[],l._sb=[]),null==l.__s&&(l.__s=l.state),null!=E.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=Pa({},l.__s)),Pa(l.__s,E.getDerivedStateFromProps(y,l.__s))),d=l.props,f=l.state,l.__v=e,h)null==E.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==E.getDerivedStateFromProps&&y!==d&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(y,m),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(y,l.__s,m)||e.__v===n.__v){for(e.__v!==n.__v&&(l.props=y,l.state=l.__s,l.__d=!1),l.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),v=0;v<l._sb.length;v++)l.__h.push(l._sb[v]);l._sb=[],l.__h.length&&o.push(l);break t}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=t,_=Sa.__r,w=0,"prototype"in E&&E.prototype.render){for(l.state=l.__s,l.__d=!1,_&&_(e),c=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,_&&_(e),c=l.render(l.props,l.state,l.context),l.state=l.__s}while(l.__d&&++w<25);l.state=l.__s,null!=l.getChildContext&&(r=Pa(Pa({},r),l.getChildContext())),h||null==l.getSnapshotBeforeUpdate||(p=l.getSnapshotBeforeUpdate(d,f)),M=null!=c&&c.type===Wa&&null==c.key?c.props.children:c,Ga(t,Array.isArray(M)?M:[M],e,n,r,i,s,o,a,u),l.base=e.__e,e.__h=null,l.__h.length&&o.push(l),b&&(l.__E=l.__=null),l.__e=!1}else null==s&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=nu(n.__e,e,n,r,i,s,o,u);(c=Sa.diffed)&&c(e)}catch(t){e.__v=null,(u||null!=s)&&(e.__e=a,e.__h=!!u,s[s.indexOf(a)]=null),Sa.__e(t,e,n)}}function eu(t,e){Sa.__c&&Sa.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Sa.__e(t,e.__v)}}))}function nu(t,e,n,r,i,s,o,a){var u,c,l,h=n.props,d=e.props,f=e.type,p=0;if("svg"===f&&(i=!0),null!=s)for(;p<s.length;p++)if((u=s[p])&&"setAttribute"in u==!!f&&(f?u.localName===f:3===u.nodeType)){t=u,s[p]=null;break}if(null==t){if(null===f)return document.createTextNode(d);t=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),s=null,a=!1}if(null===f)h===d||a&&t.data===d||(t.data=d);else{if(s=s&&wa.call(t.childNodes),c=(h=n.props||Ta).dangerouslySetInnerHTML,l=d.dangerouslySetInnerHTML,!a){if(null!=s)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(l||c)&&(l&&(c&&l.__html==c.__html||l.__html===t.innerHTML)||(t.innerHTML=l&&l.__html||""))}if(function(t,e,n,r,i){var s;for(s in n)"children"===s||"key"===s||s in e||Ja(t,s,null,n[s],r);for(s in e)i&&"function"!=typeof e[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===e[s]||Ja(t,s,e[s],n[s],r)}(t,d,h,i,a),l)e.__k=[];else if(p=e.props.children,Ga(t,Array.isArray(p)?p:[p],e,n,r,i&&"foreignObject"!==f,s,o,s?s[0]:n.__k&&Ha(n,0),a),null!=s)for(p=s.length;p--;)null!=s[p]&&Da(s[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==t.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&Ja(t,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==t.checked&&Ja(t,"checked",p,h.checked,!1))}return t}function ru(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){Sa.__e(t,n)}}function iu(t,e,n){var r,i;if(Sa.unmount&&Sa.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||ru(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Sa.__e(t,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&iu(r[i],e,n||"function"!=typeof t.type);n||null==t.__e||Da(t.__e),t.__=t.__e=t.__d=void 0}function su(t,e,n){return this.constructor(t,n)}function ou(t,e,n){var r,i,s;Sa.__&&Sa.__(t,e),i=(r="function"==typeof n)?null:n&&n.__k||e.__k,s=[],tu(e,t=(!r&&n||e).__k=Ba(Wa,null,[t]),i||Ta,Ta,void 0!==e.ownerSVGElement,!r&&n?[n]:i?null:e.firstChild?wa.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r),eu(s,t)}function au(t){return"function"==typeof t}wa=Oa.slice,Sa={__e:function(t,e,n,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,r||{}),o=i.__d),o)return i.__E=i}catch(e){t=e}throw t}},Ma=0,Ea=function(t){return null!=t&&void 0===t.constructor},Ua.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Pa({},this.state),"function"==typeof t&&(t=t(Pa({},n),this.props)),t&&Pa(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),za(this))},Ua.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),za(this))},Ua.prototype.render=Wa,xa=[],Ca="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ia=function(t,e){return t.__v.__b-e.__v.__b},qa.__r=0,Aa=0,ja.Component=Ua,ja.Fragment=Wa,ja.cloneElement=function(t,e,n){var r,i,s,o=Pa({},t.props);for(s in e)"key"==s?r=e[s]:"ref"==s?i=e[s]:o[s]=e[s];return arguments.length>2&&(o.children=arguments.length>3?wa.call(arguments,2):n),Fa(t.type,o,r||t.key,i||t.ref,null)},ja.createContext=function(t,e){var n={__c:e="__cC"+Aa++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,r;return this.getChildContext||(n=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,za(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n},ja.createElement=Ba,ja.createRef=function(){return{current:null}},ja.h=Ba,ja.hydrate=function t(e,n){ou(e,n,t)},ja.isValidElement=Ea,ja.options=Sa,ja.render=ou,ja.toChildArray=function t(e,n){return n=n||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){t(e,n)})):n.push(e)),n};var uu=!1,cu={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;uu=t},get useDeprecatedSynchronousErrorHandling(){return uu}};function lu(t){setTimeout((function(){throw t}),0)}var hu={closed:!0,next:function(t){},error:function(t){if(cu.useDeprecatedSynchronousErrorHandling)throw t;lu(t)},complete:function(){}},du=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function fu(t){return null!==t&&"object"==typeof t}var pu=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),bu=pu,yu=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this,r=n._parentOrParents,i=n._ctorUnsubscribe,s=n._unsubscribe,o=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var a=0;a<r.length;++a){r[a].remove(this)}if(au(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}catch(t){e=t instanceof bu?gu(t.errors):[t]}}if(du(o)){a=-1;for(var u=o.length;++a<u;){var c=o[a];if(fu(c))try{c.unsubscribe()}catch(t){e=e||[],t instanceof bu?e=e.concat(gu(t.errors)):e.push(t)}}}if(e)throw new bu(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var s=this._subscriptions;return null===s?this._subscriptions=[n]:s.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function gu(t){return t.reduce((function(t,e){return t.concat(e instanceof bu?e.errors:e)}),[])}var mu=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),vu=function(e){function n(t,r,i){var s=e.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=hu;break;case 1:if(!t){s.destination=hu;break}if("object"==typeof t){t instanceof n?(s.syncErrorThrowable=t.syncErrorThrowable,s.destination=t,t.add(s)):(s.syncErrorThrowable=!0,s.destination=new _u(s,t));break}default:s.syncErrorThrowable=!0,s.destination=new _u(s,t,r,i)}return s}return t.__extends(n,e),n.prototype[mu]=function(){return this},n.create=function(t,e,r){var i=new n(t,e,r);return i.syncErrorThrowable=!1,i},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},n}(yu),_u=function(e){function n(t,n,r,i){var s,o=e.call(this)||this;o._parentSubscriber=t;var a=o;return au(n)?s=n:n&&(s=n.next,r=n.error,i=n.complete,n!==hu&&(au((a=Object.create(n)).unsubscribe)&&o.add(a.unsubscribe.bind(a)),a.unsubscribe=o.unsubscribe.bind(o))),o._context=a,o._next=s,o._error=r,o._complete=i,o}return t.__extends(n,e),n.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;cu.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},n.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=cu.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):lu(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;lu(t)}}},n.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};cu.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),cu.useDeprecatedSynchronousErrorHandling)throw t;lu(t)}},n.prototype.__tryOrSetError=function(t,e,n){if(!cu.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return cu.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(lu(e),!0)}return!1},n.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},n}(vu);function wu(t){for(;t;){var e=t,n=e.closed,r=e.destination,i=e.isStopped;if(n||i)return!1;t=r&&r instanceof vu?r:null}return!0}var Su=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Mu(t){return t}function Eu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return xu(t)}function xu(t){return 0===t.length?Mu:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ku=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,i=function(t,e,n){if(t){if(t instanceof vu)return t;if(t[mu])return t[mu]()}return t||e||n?new vu(t,e,n):new vu(hu)}(t,e,n);if(r?i.add(r.call(i,this.source)):i.add(this.source||cu.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),cu.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){cu.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),wu(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=Cu(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),i&&i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[Su]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:xu(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Cu(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function Cu(t){if(t||(t=cu.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var Iu=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Au=function(e){function n(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return t.__extends(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},n}(yu),Nu=function(e){function n(t){var n=e.call(this,t)||this;return n.destination=t,n}return t.__extends(n,e),n}(vu),Ru=function(e){function n(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.__extends(n,e),n.prototype[mu]=function(){return new Nu(this)},n.prototype.lift=function(t){var e=new ju(this,this);return e.operator=t,e},n.prototype.next=function(t){if(this.closed)throw new Iu;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},n.prototype.error=function(t){if(this.closed)throw new Iu;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Iu;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(t){if(this.closed)throw new Iu;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(t){if(this.closed)throw new Iu;return this.hasError?(t.error(this.thrownError),yu.EMPTY):this.isStopped?(t.complete(),yu.EMPTY):(this.observers.push(t),new Au(this,t))},n.prototype.asObservable=function(){var t=new ku;return t.source=this,t},n.create=function(t,e){return new ju(t,e)},n}(ku),ju=function(e){function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.__extends(n,e),n.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},n.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},n.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},n.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):yu.EMPTY},n}(Ru);function Tu(){return function(t){return t.lift(new Ou(t))}}var Ou=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new Lu(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i},t}(),Lu=function(e){function n(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return t.__extends(n,e),n.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},n}(vu),Pu=function(e){function n(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return t.__extends(n,e),n.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},n.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},n.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new yu).add(this.source.subscribe(new Bu(this.getSubject(),this))),t.closed&&(this._connection=null,t=yu.EMPTY)),t},n.prototype.refCount=function(){return Tu()(this)},n}(ku),Du=function(){var t=Pu.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),Bu=function(e){function n(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return t.__extends(n,e),n.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},n.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},n.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},n}(Nu);var Fu=function(){function t(t,e,n,r){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=r}return t.prototype.call=function(t,e){return e.subscribe(new Wu(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),Wu=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;return o.keySelector=n,o.elementSelector=r,o.durationSelector=i,o.subjectSelector=s,o.groups=null,o.attemptedToUnsubscribe=!1,o.count=0,o}return t.__extends(n,e),n.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},n.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,i=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!i){i=this.subjectSelector?this.subjectSelector():new Ru,n.set(e,i);var s=new Hu(e,i,this);if(this.destination.next(s),this.durationSelector){var o=void 0;try{o=this.durationSelector(new Hu(e,i))}catch(t){return void this.error(t)}this.add(o.subscribe(new Uu(e,i,this)))}}i.closed||i.next(r)},n.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,n){e.error(t)})),e.clear()),this.destination.error(t)},n.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},n.prototype.removeGroup=function(t){this.groups.delete(t)},n.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},n}(vu),Uu=function(e){function n(t,n,r){var i=e.call(this,n)||this;return i.key=t,i.group=n,i.parent=r,i}return t.__extends(n,e),n.prototype._next=function(t){this.complete()},n.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},n}(vu),Hu=function(e){function n(t,n,r){var i=e.call(this)||this;return i.key=t,i.groupSubject=n,i.refCountSubscription=r,i}return t.__extends(n,e),n.prototype._subscribe=function(t){var e=new yu,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new Vu(n)),e.add(r.subscribe(t)),e},n}(ku),Vu=function(e){function n(t){var n=e.call(this)||this;return n.parent=t,t.count++,n}return t.__extends(n,e),n.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())},n}(yu),zu=function(e){function n(t){var n=e.call(this)||this;return n._value=t,n}return t.__extends(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Iu;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(Ru),qu=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.__extends(n,e),n.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},n.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},n.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},n.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},n.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},n}(function(e){function n(t,n){return e.call(this)||this}return t.__extends(n,e),n.prototype.schedule=function(t,e){return this},n}(yu)),Gu=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.__extends(n,e),n.prototype.schedule=function(t,n){return void 0===n&&(n=0),n>0?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},n.prototype.execute=function(t,n){return n>0||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},n.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?e.prototype.requestAsyncId.call(this,t,n,r):t.flush(this)},n}(qu),Zu=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}(),$u=function(e){function n(t,r){void 0===r&&(r=Zu.now);var i=e.call(this,t,(function(){return n.delegate&&n.delegate!==i?n.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return t.__extends(n,e),n.prototype.schedule=function(t,r,i){return void 0===r&&(r=0),n.delegate&&n.delegate!==this?n.delegate.schedule(t,r,i):e.prototype.schedule.call(this,t,r,i)},n.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},n}(Zu),Qu=new(function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(n,e),n}($u))(Gu),Yu=Qu,Ju=new ku((function(t){return t.complete()}));function Ku(t){return t?function(t){return new ku((function(e){return t.schedule((function(){return e.complete()}))}))}(t):Ju}function Xu(t){return t&&"function"==typeof t.schedule}var tc,ec=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}};function nc(t,e){return new ku((function(n){var r=new yu,i=0;return r.add(e.schedule((function(){i!==t.length?(n.next(t[i++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}function rc(t,e){return e?nc(t,e):new ku(ec(t))}function ic(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Xu(n)?(t.pop(),nc(t,n)):rc(t)}function sc(t,e){return new ku(e?function(n){return e.schedule(oc,0,{error:t,subscriber:n})}:function(e){return e.error(t)})}function oc(t){var e=t.error;t.subscriber.error(e)}tc||(tc={});var ac=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return ic(this.value);case"E":return sc(this.error);case"C":return Ku()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var uc=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new cc(t,this.scheduler,this.delay))},t}(),cc=function(e){function n(t,n,r){void 0===r&&(r=0);var i=e.call(this,t)||this;return i.scheduler=n,i.delay=r,i}return t.__extends(n,e),n.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},n.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(n.dispatch,this.delay,new lc(t,this.destination)))},n.prototype._next=function(t){this.scheduleMessage(ac.createNext(t))},n.prototype._error=function(t){this.scheduleMessage(ac.createError(t)),this.unsubscribe()},n.prototype._complete=function(){this.scheduleMessage(ac.createComplete()),this.unsubscribe()},n}(vu),lc=function(){return function(t,e){this.notification=t,this.destination=e}}(),hc=function(e){function n(t,n,r){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return t.__extends(n,e),n.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift()}e.prototype.next.call(this,t)},n.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new dc(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},n.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,s=r.length;if(this.closed)throw new Iu;if(this.isStopped||this.hasError?e=yu.EMPTY:(this.observers.push(t),e=new Au(this,t)),i&&t.add(t=new cc(t,i)),n)for(var o=0;o<s&&!t.closed;o++)t.next(r[o]);else for(o=0;o<s&&!t.closed;o++)t.next(r[o].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},n.prototype._getNow=function(){return(this.scheduler||Yu).now()},n.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,s=0;s<i&&!(t-r[s].time<n);)s++;return i>e&&(s=Math.max(s,i-e)),s>0&&r.splice(0,s),r},n}(Ru),dc=function(){return function(t,e){this.time=t,this.value=e}}(),fc=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return t.__extends(n,e),n.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),yu.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),yu.EMPTY):e.prototype._subscribe.call(this,t)},n.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},n.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},n.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},n}(Ru),pc=1,bc=function(){return Promise.resolve()}(),yc={};function gc(t){return t in yc&&(delete yc[t],!0)}var mc=function(t){var e=pc++;return yc[e]=!0,bc.then((function(){return gc(e)&&t()})),e},vc=function(t){gc(t)},_c=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.__extends(n,e),n.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=mc(t.flush.bind(t,null))))},n.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(vc(n),t.scheduled=void 0)},n}(qu),wc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(n,e),n.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},n}($u),Sc=new wc(_c),Mc=Sc,Ec=new $u(qu),xc=Ec,kc=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return t.__extends(n,e),n.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&r>0?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame((function(){return t.flush(null)}))))},n.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(cancelAnimationFrame(n),t.scheduled=void 0)},n}(qu),Cc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(n,e),n.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,i=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<i&&(t=n.shift()));if(this.active=!1,e){for(;++r<i&&(t=n.shift());)t.unsubscribe();throw e}},n}($u),Ic=new Cc(kc),Ac=Ic,Nc=function(e){function n(t,n){void 0===t&&(t=Rc),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=e.call(this,t,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return t.__extends(n,e),n.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},n.frameTimeFactor=10,n}($u),Rc=function(e){function n(t,n,r){void 0===r&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return t.__extends(n,e),n.prototype.schedule=function(t,r){if(void 0===r&&(r=0),!this.id)return e.prototype.schedule.call(this,t,r);this.active=!1;var i=new n(this.scheduler,this.work);return this.add(i),i.schedule(t,r)},n.prototype.requestAsyncId=function(t,e,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(n.sortActions),!0},n.prototype.recycleAsyncId=function(t,e,n){},n.prototype._execute=function(t,n){if(!0===this.active)return e.prototype._execute.call(this,t,n)},n.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},n}(qu);function jc(){}var Tc=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),Oc=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),Lc=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}();function Pc(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Dc(t,e))}}var Dc=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Bc(t,this.project,this.thisArg))},t}(),Bc=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return t.__extends(n,e),n.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(vu);function Fc(t){var e=this,n=t.args,r=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,u=i.subject;if(!u){u=i.subject=new fc;try{s.apply(o,n.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length<=1?t[0]:t;e.add(a.schedule(Wc,0,{value:r,subject:u}))}]))}catch(t){u.error(t)}}this.add(u.subscribe(r))}function Wc(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function Uc(t){var e=this,n=t.params,r=t.subscriber,i=t.context,s=n.callbackFunc,o=n.args,a=n.scheduler,u=n.subject;if(!u){u=n.subject=new fc;try{s.apply(i,o.concat([function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.shift();if(r)e.add(a.schedule(Vc,0,{err:r,subject:u}));else{var i=t.length<=1?t[0]:t;e.add(a.schedule(Hc,0,{value:i,subject:u}))}}]))}catch(t){this.add(a.schedule(Vc,0,{err:t,subject:u}))}}this.add(u.subscribe(r))}function Hc(t){var e=t.value,n=t.subject;n.next(e),n.complete()}function Vc(t){var e=t.err;t.subject.error(e)}var zc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(n,e),n.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},n.prototype.notifyError=function(t,e){this.destination.error(t)},n.prototype.notifyComplete=function(t){this.destination.complete()},n}(vu),qc=function(e){function n(t,n,r){var i=e.call(this)||this;return i.parent=t,i.outerValue=n,i.outerIndex=r,i.index=0,i}return t.__extends(n,e),n.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},n.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},n}(vu);function Gc(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Zc=Gc(),$c=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Qc(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var Yc=function(t){if(t&&"function"==typeof t[Su])return r=t,function(t){var e=r[Su]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if($c(t))return ec(t);if(Qc(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,lu),t};if(t&&"function"==typeof t[Zc])return e=t,function(t){for(var n=e[Zc]();;){var r=void 0;try{r=n.next()}catch(e){return t.error(e),t}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var e,n,r,i=fu(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function Jc(t,e,n,r,i){if(void 0===i&&(i=new qc(t,n,r)),!i.closed)return e instanceof ku?e.subscribe(i):Yc(e)(i)}var Kc={};var Xc=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new tl(t,this.resultSelector))},t}(),tl=function(e){function n(t,n){var r=e.call(this,t)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return t.__extends(n,e),n.prototype._next=function(t){this.values.push(Kc),this.observables.push(t)},n.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Jc(this,r,void 0,n))}}},n.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},n.prototype.notifyNext=function(t,e,n){var r=this.values,i=r[n],s=this.toRespond?i===Kc?--this.toRespond:this.toRespond:0;r[n]=e,0===s&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},n.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(zc);function el(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[Su]}(t))return function(t,e){return new ku((function(n){var r=new yu;return r.add(e.schedule((function(){var i=t[Su]();r.add(i.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}))}(t,e);if(Qc(t))return function(t,e){return new ku((function(n){var r=new yu;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}))}(t,e);if($c(t))return nc(t,e);if(function(t){return t&&"function"==typeof t[Zc]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new ku((function(n){var r,i=new yu;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(e.schedule((function(){r=t[Zc](),i.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),i}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function nl(t,e){return e?el(t,e):t instanceof ku?t:new ku(Yc(t))}var rl=function(e){function n(t){var n=e.call(this)||this;return n.parent=t,n}return t.__extends(n,e),n.prototype._next=function(t){this.parent.notifyNext(t)},n.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},n.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},n}(vu),il=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(n,e),n.prototype.notifyNext=function(t){this.destination.next(t)},n.prototype.notifyError=function(t){this.destination.error(t)},n.prototype.notifyComplete=function(){this.destination.complete()},n}(vu);function sl(t,e){if(!e.closed){if(t instanceof ku)return t.subscribe(e);var n;try{n=Yc(t)(e)}catch(t){e.error(t)}return n}}function ol(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(ol((function(n,r){return nl(t(n,r)).pipe(Pc((function(t,i){return e(n,t,r,i)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new al(t,n))})}var al=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new ul(t,this.project,this.concurrent))},t}(),ul=function(e){function n(t,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return t.__extends(n,e),n.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},n.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},n.prototype._innerSub=function(t){var e=new rl(this),n=this.destination;n.add(e);var r=sl(t,e);r!==e&&n.add(r)},n.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(t){this.destination.next(t)},n.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},n}(il),cl=ol;function ll(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),ol(Mu,t)}function hl(){return ll(1)}function dl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return hl()(ic.apply(void 0,t))}function fl(t){return new ku((function(e){var n;try{n=t()}catch(t){return void e.error(t)}return(n?nl(n):Ku()).subscribe(e)}))}function pl(t,e){return new ku((function(n){var r=t.length;if(0!==r)for(var i=new Array(r),s=0,o=0,a=function(a){var u=nl(t[a]),c=!1;n.add(u.subscribe({next:function(t){c||(c=!0,o++),i[a]=t},error:function(t){return n.error(t)},complete:function(){++s!==r&&c||(o===r&&n.next(e?e.reduce((function(t,e,n){return t[e]=i[n],t}),{}):i),n.complete())}}))},u=0;u<r;u++)a(u);else n.complete()}))}function bl(t,e,n,r,i){var s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var o=t;t.addEventListener(e,n,i),s=function(){return o.removeEventListener(e,n,i)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var a=t;t.on(e,n),s=function(){return a.off(e,n)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var u=t;t.addListener(e,n),s=function(){return u.removeListener(e,n)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var c=0,l=t.length;c<l;c++)bl(t[c],e,n,r,i)}r.add(s)}function yl(t){var e=t.subscriber,n=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(n){var r=void 0;try{r=n(t.state)}catch(t){return void e.error(t)}if(!r)return void e.complete();if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function gl(t){return!du(t)&&t-parseFloat(t)+1>=0}function ml(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}function vl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,i=t[t.length-1];return Xu(i)?(r=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof i&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof ku?t[0]:ll(n)(rc(t,r))}var _l=new ku(jc);function wl(t){var e=t.keys,n=t.index,r=t.subscriber,i=t.subscription,s=t.obj;if(!r.closed)if(n<e.length){var o=e[n];r.next([o,s[o]]),i.add(this.schedule({keys:e,index:n+1,subscriber:r,subscription:i,obj:s}))}else r.complete()}function Sl(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}function Ml(t,e){return function(n){return n.lift(new El(t,e))}}var El=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new xl(t,this.predicate,this.thisArg))},t}(),xl=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return t.__extends(n,e),n.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},n}(vu);function kl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!du(t[0]))return t[0];t=t[0]}return rc(t,void 0).lift(new Cl)}var Cl=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Il(t))},t}(),Il=function(e){function n(t){var n=e.call(this,t)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return t.__extends(n,e),n.prototype._next=function(t){this.observables.push(t)},n.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=Jc(this,t[n],void 0,n);this.subscriptions&&this.subscriptions.push(r),this.add(r)}this.observables=null}},n.prototype.notifyNext=function(t,e,n){if(!this.hasFirst){this.hasFirst=!0;for(var r=0;r<this.subscriptions.length;r++)if(r!==n){var i=this.subscriptions[r];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(e)},n}(zc);function Al(t){var e=t.start,n=t.index,r=t.count,i=t.subscriber;n>=r?i.complete():(i.next(e),i.closed||(t.index=n+1,t.start=e+1,this.schedule(t)))}function Nl(t,e,n){void 0===t&&(t=0);var r=-1;return gl(e)?r=Number(e)<1?1:Number(e):Xu(e)&&(n=e),Xu(n)||(n=xc),new ku((function(e){var i=gl(t)?t:+t-n.now();return n.schedule(Rl,i,{index:0,period:r,subscriber:e})}))}function Rl(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}function jl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return"function"==typeof n&&t.pop(),rc(t,void 0).lift(new Tl(n))}var Tl=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Ol(t,this.resultSelector))},t}(),Ol=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.resultSelector=n,i.iterators=[],i.active=0,i.resultSelector="function"==typeof n?n:void 0,i}return t.__extends(n,e),n.prototype._next=function(t){var e=this.iterators;du(t)?e.push(new Pl(t)):"function"==typeof t[Zc]?e.push(new Ll(t[Zc]())):e.push(new Dl(this.destination,this,t))},n.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var n=0;n<e;n++){var r=t[n];if(r.stillUnsubscribed)this.destination.add(r.subscribe());else this.active--}}else this.destination.complete()},n.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},n.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,n=this.destination,r=0;r<e;r++){if("function"==typeof(o=t[r]).hasValue&&!o.hasValue())return}var i=!1,s=[];for(r=0;r<e;r++){var o,a=(o=t[r]).next();if(o.hasCompleted()&&(i=!0),a.done)return void n.complete();s.push(a.value)}this.resultSelector?this._tryresultSelector(s):n.next(s),i&&n.complete()},n.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(vu),Ll=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),Pl=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[Zc]=function(){return this},t.prototype.next=function(t){var e=this.index++,n=this.array;return e<this.length?{value:n[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Dl=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.parent=n,i.observable=r,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return t.__extends(n,e),n.prototype[Zc]=function(){return this},n.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},n.prototype.hasValue=function(){return this.buffer.length>0},n.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},n.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},n.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},n.prototype.subscribe=function(){return sl(this.observable,new rl(this))},n}(il),Bl=Object.freeze({__proto__:null,Observable:ku,ConnectableObservable:Pu,GroupedObservable:Hu,observable:Su,Subject:Ru,BehaviorSubject:zu,ReplaySubject:hc,AsyncSubject:fc,asap:Mc,asapScheduler:Sc,async:xc,asyncScheduler:Ec,queue:Yu,queueScheduler:Qu,animationFrame:Ac,animationFrameScheduler:Ic,VirtualTimeScheduler:Nc,VirtualAction:Rc,Scheduler:Zu,Subscription:yu,Subscriber:vu,Notification:ac,get NotificationKind(){return tc},pipe:Eu,noop:jc,identity:Mu,isObservable:function(t){return!!t&&(t instanceof ku||"function"==typeof t.lift&&"function"==typeof t.subscribe)},ArgumentOutOfRangeError:Tc,EmptyError:Oc,ObjectUnsubscribedError:Iu,UnsubscriptionError:bu,TimeoutError:Lc,bindCallback:function t(e,n,r){if(n){if(!Xu(n))return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return t(e,r).apply(void 0,i).pipe(Pc((function(t){return du(t)?n.apply(void 0,t):n(t)})))};r=n}return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i,s=this,o={context:s,subject:i,callbackFunc:e,scheduler:r};return new ku((function(n){if(r){var a={args:t,subscriber:n,params:o};return r.schedule(Fc,0,a)}if(!i){i=new fc;try{e.apply(s,t.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.next(t.length<=1?t[0]:t),i.complete()}]))}catch(t){wu(i)?i.error(t):console.warn(t)}}return i.subscribe(n)}))}},bindNodeCallback:function t(e,n,r){if(n){if(!Xu(n))return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return t(e,r).apply(void 0,i).pipe(Pc((function(t){return du(t)?n.apply(void 0,t):n(t)})))};r=n}return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i={subject:void 0,args:t,callbackFunc:e,scheduler:r,context:this};return new ku((function(n){var s=i.context,o=i.subject;if(r)return r.schedule(Uc,0,{params:i,subscriber:n,context:s});if(!o){o=i.subject=new fc;try{e.apply(s,t.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.shift();n?o.error(n):(o.next(t.length<=1?t[0]:t),o.complete())}]))}catch(t){wu(o)?o.error(t):console.warn(t)}}return o.subscribe(n)}))}},combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return Xu(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&du(t[0])&&(t=t[0]),rc(t,r).lift(new Xc(n))},concat:dl,defer:fl,empty:Ku,forkJoin:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var n=t[0];if(du(n))return pl(n,null);if(fu(n)&&Object.getPrototypeOf(n)===Object.prototype){var r=Object.keys(n);return pl(r.map((function(t){return n[t]})),r)}}if("function"==typeof t[t.length-1]){var i=t.pop();return pl(t=1===t.length&&du(t[0])?t[0]:t,null).pipe(Pc((function(t){return i.apply(void 0,t)})))}return pl(t,null)},from:nl,fromEvent:function t(e,n,r,i){return au(r)&&(i=r,r=void 0),i?t(e,n,r).pipe(Pc((function(t){return du(t)?i.apply(void 0,t):i(t)}))):new ku((function(t){bl(e,n,(function(e){arguments.length>1?t.next(Array.prototype.slice.call(arguments)):t.next(e)}),t,r)}))},fromEventPattern:function t(e,n,r){return r?t(e,n).pipe(Pc((function(t){return du(t)?r.apply(void 0,t):r(t)}))):new ku((function(t){var r,i=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1===e.length?e[0]:e)};try{r=e(i)}catch(e){return void t.error(e)}if(au(n))return function(){return n(i,r)}}))},generate:function(t,e,n,r,i){var s,o;if(1==arguments.length){var a=t;o=a.initialState,e=a.condition,n=a.iterate,s=a.resultSelector||Mu,i=a.scheduler}else void 0===r||Xu(r)?(o=t,s=Mu,i=r):(o=t,s=r);return new ku((function(t){var r=o;if(i)return i.schedule(yl,0,{subscriber:t,iterate:n,condition:e,resultSelector:s,state:r});for(;;){if(e){var a=void 0;try{a=e(r)}catch(e){return void t.error(e)}if(!a){t.complete();break}}var u=void 0;try{u=s(r)}catch(e){return void t.error(e)}if(t.next(u),t.closed)break;try{r=n(r)}catch(e){return void t.error(e)}}}))},iif:function(t,e,n){return void 0===e&&(e=Ju),void 0===n&&(n=Ju),fl((function(){return t()?e:n}))},interval:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=xc),(!gl(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=xc),new ku((function(n){return n.add(e.schedule(ml,t,{subscriber:n,counter:0,period:t})),n}))},merge:vl,never:function(){return _l},of:ic,onErrorResumeNext:function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)return Ju;var r=e[0],i=e.slice(1);return 1===e.length&&du(r)?t.apply(void 0,r):new ku((function(e){var n=function(){return e.add(t.apply(void 0,i).subscribe(e))};return nl(r).subscribe({next:function(t){e.next(t)},error:n,complete:n})}))},pairs:function(t,e){return new ku(e?function(n){var r=Object.keys(t),i=new yu;return i.add(e.schedule(wl,0,{keys:r,index:0,subscriber:n,subscription:i,obj:t})),i}:function(e){for(var n=Object.keys(t),r=0;r<n.length&&!e.closed;r++){var i=n[r];t.hasOwnProperty(i)&&e.next([i,t[i]])}e.complete()})},partition:function(t,e,n){return[Ml(e,n)(new ku(Yc(t))),Ml(Sl(e,n))(new ku(Yc(t)))]},race:kl,range:function(t,e,n){return void 0===t&&(t=0),new ku((function(r){void 0===e&&(e=t,t=0);var i=0,s=t;if(n)return n.schedule(Al,0,{index:i,count:e,start:t,subscriber:r});for(;;){if(i++>=e){r.complete();break}if(r.next(s++),r.closed)break}}))},throwError:sc,timer:Nl,using:function(t,e){return new ku((function(n){var r,i;try{r=t()}catch(t){return void n.error(t)}try{i=e(r)}catch(t){return void n.error(t)}var s=(i?nl(i):Ju).subscribe(n);return function(){s.unsubscribe(),r&&r.unsubscribe()}}))},zip:jl,scheduled:el,EMPTY:Ju,NEVER:_l,config:cu}),Fl=e.getAugmentedNamespace(Bl),Wl={};function Ul(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Ul(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Hl(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Ul(t))&&(r&&(r+=" "),r+=e);return r}var Vl,zl,ql,Gl,Zl=Object.freeze({__proto__:null,clsx:Hl,default:Hl}),$l=e.getAugmentedNamespace(Zl),Ql={},Yl=ja,Jl=0,Kl=[],Xl=[],th=Yl.options.__b,eh=Yl.options.__r,nh=Yl.options.diffed,rh=Yl.options.__c,ih=Yl.options.unmount;function sh(t,e){Yl.options.__h&&Yl.options.__h(zl,t,Jl||e),Jl=0;var n=zl.__H||(zl.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:Xl}),n.__[t]}function oh(t){return Jl=1,ah(yh,t)}function ah(t,e,n){var r=sh(Vl++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):yh(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],n=r.t(e,t);e!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=zl,!zl.u)){var i=function(t,e,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(t){return t.__c}));if(i.every((function(t){return!t.__N})))return!s||s.call(this,t,e,n);var o=!1;return i.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),!(!o&&r.__c.props===t)&&(!s||s.call(this,t,e,n))};zl.u=!0;var s=zl.shouldComponentUpdate,o=zl.componentWillUpdate;zl.componentWillUpdate=function(t,e,n){if(this.__e){var r=s;s=void 0,i(t,e,n),s=r}o&&o.call(this,t,e,n)},zl.shouldComponentUpdate=i}return r.__N||r.__}function uh(t,e){var n=sh(Vl++,4);!Yl.options.__s&&bh(n.__H,e)&&(n.__=t,n.o=e,zl.__h.push(n))}function ch(t,e){var n=sh(Vl++,7);return bh(n.__H,e)?(n.__V=t(),n.o=e,n.__h=t,n.__V):n.__}function lh(){for(var t;t=Kl.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(fh),t.__H.__h.forEach(ph),t.__H.__h=[]}catch(e){t.__H.__h=[],Yl.options.__e(e,t.__v)}}Yl.options.__b=function(t){zl=null,th&&th(t)},Yl.options.__r=function(t){eh&&eh(t),Vl=0;var e=(zl=t.__c).__H;e&&(ql===zl?(e.__h=[],zl.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Xl,t.__N=t.o=void 0}))):(e.__h.forEach(fh),e.__h.forEach(ph),e.__h=[])),ql=zl},Yl.options.diffed=function(t){nh&&nh(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Kl.push(e)&&Gl===Yl.options.requestAnimationFrame||((Gl=Yl.options.requestAnimationFrame)||dh)(lh)),e.__H.__.forEach((function(t){t.o&&(t.__H=t.o),t.__V!==Xl&&(t.__=t.__V),t.o=void 0,t.__V=Xl}))),ql=zl=null},Yl.options.__c=function(t,e){e.some((function(t){try{t.__h.forEach(fh),t.__h=t.__h.filter((function(t){return!t.__||ph(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Yl.options.__e(n,t.__v)}})),rh&&rh(t,e)},Yl.options.unmount=function(t){ih&&ih(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{fh(t)}catch(t){e=t}})),n.__H=void 0,e&&Yl.options.__e(e,n.__v))};var hh="function"==typeof requestAnimationFrame;function dh(t){var e,n=function(){clearTimeout(r),hh&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);hh&&(e=requestAnimationFrame(n))}function fh(t){var e=zl,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),zl=e}function ph(t){var e=zl;t.__c=t.__(),zl=e}function bh(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function yh(t,e){return"function"==typeof e?e(t):e}Ql.useCallback=function(t,e){return Jl=8,ch((function(){return t}),e)},Ql.useContext=function(t){var e=zl.context[t.__c],n=sh(Vl++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(zl)),e.props.value):t.__},Ql.useDebugValue=function(t,e){Yl.options.useDebugValue&&Yl.options.useDebugValue(e?e(t):t)},Ql.useEffect=function(t,e){var n=sh(Vl++,3);!Yl.options.__s&&bh(n.__H,e)&&(n.__=t,n.o=e,zl.__H.__h.push(n))},Ql.useErrorBoundary=function(t){var e=sh(Vl++,10),n=oh();return e.__=t,zl.componentDidCatch||(zl.componentDidCatch=function(t,r){e.__&&e.__(t,r),n[1](t)}),[n[0],function(){n[1](void 0)}]},Ql.useId=function(){var t=sh(Vl++,11);if(!t.__){for(var e=zl.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__},Ql.useImperativeHandle=function(t,e,n){Jl=6,uh((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==n?n:n.concat(t))},Ql.useLayoutEffect=uh,Ql.useMemo=ch,Ql.useReducer=ah,Ql.useRef=function(t){return Jl=5,ch((function(){return{current:t}}),[])},Ql.useState=oh;var gh={},mh={};Object.defineProperty(mh,"__esModule",{value:!0}),mh.LIB_VERSION=void 0,mh.LIB_VERSION="3.6.6";var vh={};Object.defineProperty(vh,"__esModule",{value:!0}),vh.CloseIcon=void 0;const _h=ja;vh.CloseIcon=function(t){return(0,_h.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,_h.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 wh={};Object.defineProperty(wh,"__esModule",{value:!0}),wh.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var Sh={};Object.defineProperty(Sh,"__esModule",{value:!0}),Sh.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Mh={};Object.defineProperty(Mh,"__esModule",{value:!0}),Mh.QRCodeIcon=void 0;const Eh=ja;Mh.QRCodeIcon=function(t){return(0,Eh.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Eh.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Eh.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,Eh.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Eh.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,Eh.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Eh.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,Eh.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Eh.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Eh.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))};var xh={};Object.defineProperty(xh,"__esModule",{value:!0});xh.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 kh={};Object.defineProperty(kh,"__esModule",{value:!0}),kh.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 Ch={};Object.defineProperty(Ch,"__esModule",{value:!0}),Ch.StatusDotIcon=void 0;const Ih=ja;Ch.StatusDotIcon=function(t){return(0,Ih.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ih.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 Ah={};function Nh(t){this.mode=jh.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,n=this.data.length;e<n;e++){var r=[],i=this.data.charCodeAt(e);i>65536?(r[0]=240|(1835008&i)>>>18,r[1]=128|(258048&i)>>>12,r[2]=128|(4032&i)>>>6,r[3]=128|63&i):i>2048?(r[0]=224|(61440&i)>>>12,r[1]=128|(4032&i)>>>6,r[2]=128|63&i):i>128?(r[0]=192|(1984&i)>>>6,r[1]=128|63&i):r[0]=i,this.parsedData.push(r)}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 Rh(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Nh.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,n=this.parsedData.length;e<n;e++)t.put(this.parsedData[e],8)}},Rh.prototype={addData:function(t){var e=new Nh(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=Rh.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(var r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[t+n][e+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var t=0,e=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=qh.getLostPoint(this);(0==n||t>r)&&(t=r,e=n)}return e},createMovieClip:function(t,e,n){var r=t.createEmptyMovieClip(e,n);this.make();for(var i=0;i<this.modules.length;i++)for(var s=1*i,o=0;o<this.modules[i].length;o++){var a=1*o;this.modules[i][o]&&(r.beginFill(0,100),r.moveTo(a,s),r.lineTo(a+1,s),r.lineTo(a+1,s+1),r.lineTo(a,s+1),r.endFill())}return r},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=qh.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var n=0;n<t.length;n++){var r=t[e],i=t[n];if(null==this.modules[r][i])for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)this.modules[r+s][i+o]=-2==s||2==s||-2==o||2==o||0==s&&0==o}},setupTypeNumber:function(t){for(var e=qh.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!t&&1==(e>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!t&&1==(e>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(t,e){for(var n=this.errorCorrectLevel<<3|e,r=qh.getBCHTypeInfo(n),i=0;i<15;i++){var s=!t&&1==(r>>i&1);i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(i=0;i<15;i++){s=!t&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var n=-1,r=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(6==o&&o--;;){for(var a=0;a<2;a++)if(null==this.modules[r][o-a]){var u=!1;s<t.length&&(u=1==(t[s]>>>i&1)),qh.getMask(e,r,o-a)&&(u=!u),this.modules[r][o-a]=u,-1==--i&&(s++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},Rh.PAD0=236,Rh.PAD1=17,Rh.createData=function(t,e,n){for(var r=Qh.getRSBlocks(t,e),i=new Yh,s=0;s<n.length;s++){var o=n[s];i.put(o.mode,4),i.put(o.getLength(),qh.getLengthInBits(o.mode,t)),o.write(i)}var a=0;for(s=0;s<r.length;s++)a+=r[s].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(Rh.PAD0,8),i.getLengthInBits()>=8*a));)i.put(Rh.PAD1,8);return Rh.createBytes(i,r)},Rh.createBytes=function(t,e){for(var n=0,r=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a++){var u=e[a].dataCount,c=e[a].totalCount-u;r=Math.max(r,u),i=Math.max(i,c),s[a]=new Array(u);for(var l=0;l<s[a].length;l++)s[a][l]=255&t.buffer[l+n];n+=u;var h=qh.getErrorCorrectPolynomial(c),d=new $h(s[a],h.getLength()-1).mod(h);o[a]=new Array(h.getLength()-1);for(l=0;l<o[a].length;l++){var f=l+d.getLength()-o[a].length;o[a][l]=f>=0?d.get(f):0}}var p=0;for(l=0;l<e.length;l++)p+=e[l].totalCount;var b=new Array(p),y=0;for(l=0;l<r;l++)for(a=0;a<e.length;a++)l<s[a].length&&(b[y++]=s[a][l]);for(l=0;l<i;l++)for(a=0;a<e.length;a++)l<o[a].length&&(b[y++]=o[a][l]);return b};for(var jh={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Th=1,Oh=0,Lh=3,Ph=2,Dh=0,Bh=1,Fh=2,Wh=3,Uh=4,Hh=5,Vh=6,zh=7,qh={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(t){for(var e=t<<10;qh.getBCHDigit(e)-qh.getBCHDigit(qh.G15)>=0;)e^=qh.G15<<qh.getBCHDigit(e)-qh.getBCHDigit(qh.G15);return(t<<10|e)^qh.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;qh.getBCHDigit(e)-qh.getBCHDigit(qh.G18)>=0;)e^=qh.G18<<qh.getBCHDigit(e)-qh.getBCHDigit(qh.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},getPatternPosition:function(t){return qh.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,n){switch(t){case Dh:return(e+n)%2==0;case Bh:return e%2==0;case Fh:return n%3==0;case Wh:return(e+n)%3==0;case Uh:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case Hh:return e*n%2+e*n%3==0;case Vh:return(e*n%2+e*n%3)%2==0;case zh:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new $h([1],0),n=0;n<t;n++)e=e.multiply(new $h([1,Gh.gexp(n)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case jh.MODE_NUMBER:return 10;case jh.MODE_ALPHA_NUM:return 9;case jh.MODE_8BIT_BYTE:case jh.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case jh.MODE_NUMBER:return 12;case jh.MODE_ALPHA_NUM:return 11;case jh.MODE_8BIT_BYTE:return 16;case jh.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case jh.MODE_NUMBER:return 14;case jh.MODE_ALPHA_NUM:return 13;case jh.MODE_8BIT_BYTE:return 16;case jh.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),n=0,r=0;r<e;r++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(r,i),a=-1;a<=1;a++)if(!(r+a<0||e<=r+a))for(var u=-1;u<=1;u++)i+u<0||e<=i+u||0==a&&0==u||o==t.isDark(r+a,i+u)&&s++;s>5&&(n+=3+s-5)}for(r=0;r<e-1;r++)for(i=0;i<e-1;i++){var c=0;t.isDark(r,i)&&c++,t.isDark(r+1,i)&&c++,t.isDark(r,i+1)&&c++,t.isDark(r+1,i+1)&&c++,0!=c&&4!=c||(n+=3)}for(r=0;r<e;r++)for(i=0;i<e-6;i++)t.isDark(r,i)&&!t.isDark(r,i+1)&&t.isDark(r,i+2)&&t.isDark(r,i+3)&&t.isDark(r,i+4)&&!t.isDark(r,i+5)&&t.isDark(r,i+6)&&(n+=40);for(i=0;i<e;i++)for(r=0;r<e-6;r++)t.isDark(r,i)&&!t.isDark(r+1,i)&&t.isDark(r+2,i)&&t.isDark(r+3,i)&&t.isDark(r+4,i)&&!t.isDark(r+5,i)&&t.isDark(r+6,i)&&(n+=40);var l=0;for(i=0;i<e;i++)for(r=0;r<e;r++)t.isDark(r,i)&&l++;return n+=10*(Math.abs(100*l/e/e-50)/5)}},Gh={glog:function(t){if(t<1)throw new Error("glog("+t+")");return Gh.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return Gh.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},Zh=0;Zh<8;Zh++)Gh.EXP_TABLE[Zh]=1<<Zh;for(Zh=8;Zh<256;Zh++)Gh.EXP_TABLE[Zh]=Gh.EXP_TABLE[Zh-4]^Gh.EXP_TABLE[Zh-5]^Gh.EXP_TABLE[Zh-6]^Gh.EXP_TABLE[Zh-8];for(Zh=0;Zh<255;Zh++)Gh.LOG_TABLE[Gh.EXP_TABLE[Zh]]=Zh;function $h(t,e){if(null==t.length)throw new Error(t.length+"/"+e);for(var n=0;n<t.length&&0==t[n];)n++;this.num=new Array(t.length-n+e);for(var r=0;r<t.length-n;r++)this.num[r]=t[r+n]}function Qh(t,e){this.totalCount=t,this.dataCount=e}function Yh(){this.buffer=[],this.length=0}$h.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),n=0;n<this.getLength();n++)for(var r=0;r<t.getLength();r++)e[n+r]^=Gh.gexp(Gh.glog(this.get(n))+Gh.glog(t.get(r)));return new $h(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Gh.glog(this.get(0))-Gh.glog(t.get(0)),n=new Array(this.getLength()),r=0;r<this.getLength();r++)n[r]=this.get(r);for(r=0;r<t.getLength();r++)n[r]^=Gh.gexp(Gh.glog(t.get(r))+e);return new $h(n,0).mod(t)}},Qh.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]],Qh.getRSBlocks=function(t,e){var n=Qh.getRsBlockTable(t,e);if(null==n)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var r=n.length/3,i=[],s=0;s<r;s++)for(var o=n[3*s+0],a=n[3*s+1],u=n[3*s+2],c=0;c<o;c++)i.push(new Qh(a,u));return i},Qh.getRsBlockTable=function(t,e){switch(e){case Th:return Qh.RS_BLOCK_TABLE[4*(t-1)+0];case Oh:return Qh.RS_BLOCK_TABLE[4*(t-1)+1];case Lh:return Qh.RS_BLOCK_TABLE[4*(t-1)+2];case Ph:return Qh.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},Yh.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Jh=[[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 Kh(t){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 t&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];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 n=this.options.content,r=function(t,e){for(var n=function(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}(t),r=1,i=0,s=0,o=Jh.length;s<=o;s++){var a=Jh[s];if(!a)throw new Error("Content too long: expected "+i+" but got "+n);switch(e){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: "+e)}if(n<=i)break;r++}if(r>Jh.length)throw new Error("Content too long");return r}(n,this.options.ecl),i=function(t){switch(t){case"L":return Th;case"M":return Oh;case"Q":return Lh;case"H":return Ph;default:throw new Error("Unknwon error correction level: "+t)}}(this.options.ecl);this.qrcode=new Rh(r,i),this.qrcode.addData(n),this.qrcode.make()}Kh.prototype.svg=function(t){var e=this.options||{},n=this.qrcode.modules;void 0===t&&(t={container:e.container||"svg"});for(var r=void 0===e.pretty||!!e.pretty,i=r?" ":"",s=r?"\r\n":"",o=e.width,a=e.height,u=n.length,c=o/(u+2*e.padding),l=a/(u+2*e.padding),h=void 0!==e.join&&!!e.join,d=void 0!==e.swap&&!!e.swap,f=void 0===e.xmlDeclaration||!!e.xmlDeclaration,p=void 0!==e.predefined&&!!e.predefined,b=p?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+c+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",y=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,g="",m="",v=0;v<u;v++)for(var _=0;_<u;_++){if(n[_][v]){var w=_*c+e.padding*c,S=v*l+e.padding*l;if(d){var M=w;w=S,S=M}if(h){var E=c+w,x=l+S;w=Number.isInteger(w)?Number(w):w.toFixed(2),S=Number.isInteger(S)?Number(S):S.toFixed(2),E=Number.isInteger(E)?Number(E):E.toFixed(2),m+="M"+w+","+S+" V"+(x=Number.isInteger(x)?Number(x):x.toFixed(2))+" H"+E+" V"+S+" H"+w+" Z "}else g+=p?i+'<use x="'+w.toString()+'" y="'+S.toString()+'" href="#qrmodule" />'+s:i+'<rect x="'+w.toString()+'" y="'+S.toString()+'" width="'+c+'" height="'+l+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}h&&(g=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+m+'" />');let k="";if(void 0!==this.options.image&&this.options.image.svg){const t=o*this.options.image.width/100,e=a*this.options.image.height/100;k+=`<svg x="${o/2-t/2}" y="${a/2-e/2}" width="${t}" height="${e}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,k+=this.options.image.svg+s,k+="</svg>"}var C="";switch(t.container){case"svg":f&&(C+='<?xml version="1.0" standalone="yes"?>'+s),C+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,C+=b+y+g,C+=k,C+="</svg>";break;case"svg-viewbox":f&&(C+='<?xml version="1.0" standalone="yes"?>'+s),C+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,C+=b+y+g,C+=k,C+="</svg>";break;case"g":C+='<g width="'+o+'" height="'+a+'">'+s,C+=b+y+g,C+=k,C+="</g>";break;default:C+=(b+y+g+k).replace(/^\s+/,"")}return C};var Xh=Kh,td=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ah,"__esModule",{value:!0}),Ah.QRCode=void 0;const ed=ja,nd=Ql,rd=td(Xh);Ah.QRCode=t=>{const[e,n]=(0,nd.useState)("");return(0,nd.useEffect)((()=>{var e,r;const i=new rd.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(e=t.width)&&void 0!==e?e:256,height:null!==(r=t.height)&&void 0!==r?r:256,padding:0,image:t.image}),s=Buffer.from(i.svg(),"utf8").toString("base64");n(`data:image/svg+xml;base64,${s}`)})),e?(0,ed.h)("img",{src:e,alt:"QR Code"}):null};var id={},sd={};Object.defineProperty(sd,"__esModule",{value:!0}),sd.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 od=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(id,"__esModule",{value:!0}),id.Spinner=void 0;const ad=ja,ud=od(sd);id.Spinner=t=>{var e;const n=null!==(e=t.size)&&void 0!==e?e:64,r=t.color||"#000";return(0,ad.h)("div",{class:"-cbwsdk-spinner"},(0,ad.h)("style",null,ud.default),(0,ad.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},(0,ad.h)("circle",{style:{cx:50,cy:50,r:45,stroke:r}})))};var cd={};Object.defineProperty(cd,"__esModule",{value:!0}),cd.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 ld=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gh,"__esModule",{value:!0}),gh.CoinbaseAppSteps=gh.CoinbaseWalletSteps=gh.ConnectItem=gh.ConnectContent=void 0;const hd=ld($l),dd=ja,fd=Ql,pd=Jt,bd=mh,yd=vh,gd=ld(wh),md=ld(Sh),vd=Mh,_d=ld(xh),wd=ld(kh),Sd=Ch,Md=Ah,Ed=id,xd=ld(cd),kd={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:md.default,steps:Ad},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:gd.default,steps:Nd}},Cd=t=>"light"===t?"#FFFFFF":"#0A0B0D";function Id({title:t,description:e,icon:n,selected:r,theme:i,onClick:s}){return(0,dd.h)("div",{onClick:s,class:(0,hd.default)("-cbwsdk-connect-item",i,{selected:r})},(0,dd.h)("div",null,(0,dd.h)("img",{src:n,alt:t})),(0,dd.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,dd.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,dd.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}function Ad({theme:t}){return(0,dd.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,dd.h)("li",{class:(0,hd.default)("-cbwsdk-wallet-steps-item",t)},(0,dd.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,dd.h)("li",{class:(0,hd.default)("-cbwsdk-wallet-steps-item",t)},(0,dd.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,dd.h)("span",null,"Tap ",(0,dd.h)("strong",null,"Scan")," "),(0,dd.h)("span",{class:(0,hd.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,dd.h)(vd.QRCodeIcon,{fill:Cd(t)})))))}function Nd({theme:t}){return(0,dd.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,dd.h)("li",{class:(0,hd.default)("-cbwsdk-wallet-steps-item",t)},(0,dd.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,dd.h)("li",{class:(0,hd.default)("-cbwsdk-wallet-steps-item",t)},(0,dd.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,dd.h)("span",null,"Tap ",(0,dd.h)("strong",null,"More")),(0,dd.h)("span",{class:(0,hd.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,dd.h)(Sd.StatusDotIcon,{fill:Cd(t)})),(0,dd.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,dd.h)("strong",null,"Scan")),(0,dd.h)("span",{class:(0,hd.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,dd.h)(vd.QRCodeIcon,{fill:Cd(t)})))))}gh.ConnectContent=function(t){const{theme:e}=t,[n,r]=(0,fd.useState)("coinbase-wallet-app"),i=(0,fd.useCallback)((t=>{r(t)}),[]),s=(0,pd.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId);if(!n)return null;const o=kd[n].steps,a="coinbase-app"===n;return(0,dd.h)("div",{"data-testid":"connect-content",class:(0,hd.default)("-cbwsdk-connect-content",e)},(0,dd.h)("style",null,xd.default),(0,dd.h)("div",{class:"-cbwsdk-connect-content-header"},(0,dd.h)("h2",{class:(0,hd.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,dd.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,dd.h)(yd.CloseIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,dd.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,dd.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,dd.h)("div",null,Object.entries(kd).map((([t,r])=>(0,dd.h)(Id,{key:t,title:r.title,description:r.description,icon:r.icon,selected:n===t,onClick:()=>i(t),theme:e})))),a&&(0,dd.h)("div",{class:(0,hd.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,dd.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,dd.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,dd.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,dd.h)(Md.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:(u=n,"coinbase-app"===u?_d.default:wd.default),width:25,height:25}}),(0,dd.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:bd.LIB_VERSION}),(0,dd.h)("input",{type:"hidden",value:s})),(0,dd.h)(o,{theme:e}),!t.isConnected&&(0,dd.h)("div",{"data-testid":"connecting-spinner",class:(0,hd.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,dd.h)(Ed.Spinner,{size:36,color:"dark"===e?"#FFF":"#000"}),(0,dd.h)("p",null,"Connecting...")))));var u},gh.ConnectItem=Id,gh.CoinbaseWalletSteps=Ad,gh.CoinbaseAppSteps=Nd;var Rd={},jd={};Object.defineProperty(jd,"__esModule",{value:!0}),jd.ArrowLeftIcon=void 0;const Td=ja;jd.ArrowLeftIcon=function(t){return(0,Td.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,Td.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 Od={};Object.defineProperty(Od,"__esModule",{value:!0}),Od.LaptopIcon=void 0;const Ld=ja;Od.LaptopIcon=function(t){return(0,Ld.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ld.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ld.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 Pd={};Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.SafeIcon=void 0;const Dd=ja;Pd.SafeIcon=function(t){return(0,Dd.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Dd.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 Bd={};Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.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 Fd=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.TryExtensionContent=void 0;const Wd=Fd($l),Ud=ja,Hd=Ql,Vd=jd,zd=Od,qd=Pd,Gd=Fd(Bd);Rd.TryExtensionContent=function({theme:t}){const[e,n]=(0,Hd.useState)(!1),r=(0,Hd.useCallback)((()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}),[]),i=(0,Hd.useCallback)((()=>{e?window.location.reload():(r(),n(!0))}),[r,e]);return(0,Ud.h)("div",{class:(0,Wd.default)("-cbwsdk-try-extension",t)},(0,Ud.h)("style",null,Gd.default),(0,Ud.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ud.h)("h3",{class:(0,Wd.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,Ud.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ud.h)("button",{class:(0,Wd.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,Ud.h)("div",null,!e&&(0,Ud.h)(Vd.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===t?"#0052FF":"#588AF5"})))),(0,Ud.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ud.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ud.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ud.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ud.h)("span",{class:(0,Wd.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Ud.h)(zd.LaptopIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,Ud.h)("div",{class:(0,Wd.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,Ud.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ud.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ud.h)("span",{class:(0,Wd.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Ud.h)(qd.SafeIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,Ud.h)("div",{class:(0,Wd.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))};var Zd={};Object.defineProperty(Zd,"__esModule",{value:!0}),Zd.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 $d=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.ConnectDialog=void 0;const Qd=$d($l),Yd=ja,Jd=Ql,Kd=gh,Xd=Rd,tf=$d(Zd);Wl.ConnectDialog=t=>{const{isOpen:e,darkMode:n}=t,[r,i]=(0,Jd.useState)(!e),[s,o]=(0,Jd.useState)(!e);(0,Jd.useEffect)((()=>{const t=[window.setTimeout((()=>{o(!e)}),10)];return e?i(!1):t.push(window.setTimeout((()=>{i(!0)}),360)),()=>{t.forEach(window.clearTimeout)}}),[t.isOpen]);const a=n?"dark":"light";return(0,Yd.h)("div",{class:(0,Qd.default)("-cbwsdk-connect-dialog-container",r&&"-cbwsdk-connect-dialog-container-hidden")},(0,Yd.h)("style",null,tf.default),(0,Yd.h)("div",{class:(0,Qd.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Yd.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Yd.h)("div",{class:(0,Qd.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Yd.h)(Kd.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,Yd.h)(Xd.TryExtensionContent,{theme:a}))))},Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.LinkFlow=void 0;const ef=ja,nf=Fl,rf=Wl;Ra.LinkFlow=class{constructor(t){this.extensionUI$=new nf.BehaviorSubject({}),this.subscriptions=new nf.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection,this.connected$=t.connected$,this.chainId$=t.chainId$}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((t=>{this.isConnected!==t&&(this.isConnected=t,this.render())}))),this.subscriptions.add(this.chainId$.subscribe((t=>{this.chainId!==t&&(this.chainId=t,this.render())})))}detach(){var t;this.root&&(this.subscriptions.unsubscribe(),(0,ef.render)(null,this.root),null===(t=this.root.parentElement)||void 0===t||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const t=this.extensionUI$.subscribe((()=>{this.root&&(0,ef.render)((0,ef.h)(rf.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(t)}};var sf={},of={};Object.defineProperty(of,"__esModule",{value:!0}),of.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 n=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=n($l),i=ja,s=Ql,o=n(of);function a(t){return"coinbase-app"===t?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}t.Snackbar=class{constructor(t){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",t.appendChild(this.root),this.render()}presentItem(t){const e=this.nextItemKey++;return this.items.set(e,t),this.render(),()=>{this.items.delete(e),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,n])=>(0,i.h)(t.SnackbarInstance,Object.assign({},n,{key:e})))))),this.root)}};t.SnackbarContainer=t=>(0,i.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,i.h)("style",null,o.default),(0,i.h)("div",{class:"-cbwsdk-snackbar"},t.children));t.SnackbarInstance=({autoExpand:t,message:e,menuItems:n,appSrc:o})=>{const[u,c]=(0,s.useState)(!0),[l,h]=(0,s.useState)(null!=t&&t);(0,s.useEffect)((()=>{const t=[window.setTimeout((()=>{c(!1)}),1),window.setTimeout((()=>{h(!0)}),1e4)];return()=>{t.forEach(window.clearTimeout)}}));return(0,i.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",u&&"-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(o),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),(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"}))),n&&n.length>0&&(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map(((t,e)=>(0,i.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",t.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:t.onClick,key:e},(0,i.h)("svg",{width:t.svgWidth,height:t.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("path",{"fill-rule":t.defaultFillRule,"clip-rule":t.defaultClipRule,d:t.path,fill:"#AAAAAA"})),(0,i.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",t.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},t.info))))))}}(sf);var af={},uf={};Object.defineProperty(uf,"__esModule",{value:!0}),uf.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 cf=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(af,"__esModule",{value:!0}),af.injectCssReset=void 0;const lf=cf(uf);af.injectCssReset=function(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(lf.default)),document.documentElement.appendChild(t)},Object.defineProperty(Na,"__esModule",{value:!0}),Na.WalletSDKUI=void 0;const hf=Ra,df=sf,ff=af;Na.WalletSDKUI=class{constructor(t){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new df.Snackbar({darkMode:t.darkMode}),this.linkFlow=new hf.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,connected$:t.connected$,chainId$:t.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,e=document.createElement("div");e.className="-cbwsdk-css-reset",t.appendChild(e),this.linkFlow.attach(e),this.snackbar.attach(e),this.attached=!0,(0,ff.injectCssReset)()}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(t){}watchAsset(t){}switchEthereumChain(t){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(t){}signEthereumTransaction(t){}submitEthereumTransaction(t){}ethereumAddressFromSignedMessage(t){}showConnecting(t){let e;return e=t.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:t.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:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(e)}setAppSrc(t){this.appSrc=t}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(t){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return null!==(t=this.standalone)&&void 0!==t&&t}};var pf,bf={},yf={};function gf(t,e,n){if(!n||typeof n.value!==pf.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:pf.boolTrue,get:function(){var t=n.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:pf.boolTrue,writable:pf.boolTrue}),t}}}function mf(t){return function(e){return e.lift(new vf(t))}}Object.defineProperty(yf,"__esModule",{value:!0}),function(t){t.typeOfFunction="function",t.boolTrue=!0}(pf||(pf={})),yf.bind=gf,yf.default=gf;var vf=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new _f(t,this.durationSelector))},t}(),_f=function(e){function n(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return t.__extends(n,e),n.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=sl(e,new rl(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},n.prototype.clearThrottle=function(){var t=this,e=t.value,n=t.hasValue,r=t.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),n&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},n.prototype.notifyNext=function(){this.clearThrottle()},n.prototype.notifyComplete=function(){this.clearThrottle()},n}(il);var wf=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Sf(t,this.closingNotifier))},t}(),Sf=function(e){function n(t,n){var r=e.call(this,t)||this;return r.buffer=[],r.add(sl(n,new rl(r))),r}return t.__extends(n,e),n.prototype._next=function(t){this.buffer.push(t)},n.prototype.notifyNext=function(){var t=this.buffer;this.buffer=[],this.destination.next(t)},n}(il);var Mf=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?xf:Ef}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),Ef=function(e){function n(t,n){var r=e.call(this,t)||this;return r.bufferSize=n,r.buffer=[],r}return t.__extends(n,e),n.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},n.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},n}(vu),xf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return t.__extends(n,e),n.prototype._next=function(t){var e=this,n=e.bufferSize,r=e.startBufferEvery,i=e.buffers,s=e.count;this.count++,s%r==0&&i.push([]);for(var o=i.length;o--;){var a=i[o];a.push(t),a.length===n&&(i.splice(o,1),this.destination.next(a))}},n.prototype._complete=function(){for(var t=this.buffers,n=this.destination;t.length>0;){var r=t.shift();r.length>0&&n.next(r)}e.prototype._complete.call(this)},n}(vu);var kf=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new If(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),Cf=function(){return function(){this.buffer=[]}}(),If=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;o.bufferTimeSpan=n,o.bufferCreationInterval=r,o.maxBufferSize=i,o.scheduler=s,o.contexts=[];var a=o.openContext();if(o.timespanOnly=null==r||r<0,o.timespanOnly){var u={subscriber:o,context:a,bufferTimeSpan:n};o.add(a.closeAction=s.schedule(Af,n,u))}else{var c={subscriber:o,context:a},l={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:o,scheduler:s};o.add(a.closeAction=s.schedule(Rf,n,c)),o.add(s.schedule(Nf,r,l))}return o}return t.__extends(n,e),n.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,i=0;i<r;i++){var s=n[i],o=s.buffer;o.push(t),o.length==this.maxBufferSize&&(e=s)}e&&this.onBufferFull(e)},n.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},n.prototype._complete=function(){for(var t=this.contexts,n=this.destination;t.length>0;){var r=t.shift();n.next(r.buffer)}e.prototype._complete.call(this)},n.prototype._unsubscribe=function(){this.contexts=null},n.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(Af,n,r))}},n.prototype.openContext=function(){var t=new Cf;return this.contexts.push(t),t},n.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},n}(vu);function Af(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Nf(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,s=r.openContext();r.closed||(r.add(s.closeAction=i.schedule(Rf,n,{subscriber:r,context:s})),this.schedule(t,e))}function Rf(t){var e=t.subscriber,n=t.context;e.closeContext(n)}var jf=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Tf(t,this.openings,this.closingSelector))},t}(),Tf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.closingSelector=r,i.contexts=[],i.add(Jc(i,n)),i}return t.__extends(n,e),n.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r<n;r++)e[r].buffer.push(t)},n.prototype._error=function(t){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},n.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var n=t.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._complete.call(this)},n.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},n.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},n.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},n.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},n.prototype.trySubscribe=function(t){var e=this.contexts,n=new yu,r={buffer:[],subscription:n};e.push(r);var i=Jc(this,t,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},n}(zc);var Of=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Lf(t,this.closingSelector))},t}(),Lf=function(e){function n(t,n){var r=e.call(this,t)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return t.__extends(n,e),n.prototype._next=function(t){this.buffer.push(t)},n.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},n.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},n.prototype.notifyNext=function(){this.openBuffer()},n.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},n.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new yu,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(sl(e,new rl(this))),this.subscribing=!1},n}(il);var Pf=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Df(t,this.selector,this.caught))},t}(),Df=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.selector=n,i.caught=r,i}return t.__extends(n,e),n.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle();var r=new rl(this);this.add(r);var i=sl(n,r);i!==r&&this.add(i)}},n}(il);function Bf(t,e){return ol(t,e,1)}var Ff=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Wf(t,this.predicate,this.source))},t}(),Wf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return t.__extends(n,e),n.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},n.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},n.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},n}(vu);var Uf=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Hf(t,this.durationSelector))},t}(),Hf=function(e){function n(t,n){var r=e.call(this,t)||this;return r.durationSelector=n,r.hasValue=!1,r}return t.__extends(n,e),n.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},n.prototype._complete=function(){this.emitValue(),this.destination.complete()},n.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=sl(e,new rl(this)))&&!n.closed&&this.add(this.durationSubscription=n)},n.prototype.notifyNext=function(){this.emitValue()},n.prototype.notifyComplete=function(){this.emitValue()},n.prototype.emitValue=function(){if(this.hasValue){var t=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},n}(il);var Vf=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new zf(t,this.dueTime,this.scheduler))},t}(),zf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return t.__extends(n,e),n.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(qf,this.dueTime,this))},n.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},n.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},n.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},n}(vu);function qf(t){t.debouncedNext()}function Gf(t){return void 0===t&&(t=null),function(e){return e.lift(new Zf(t))}}var Zf=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new $f(t,this.defaultValue))},t}(),$f=function(e){function n(t,n){var r=e.call(this,t)||this;return r.defaultValue=n,r.isEmpty=!0,r}return t.__extends(n,e),n.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},n.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},n}(vu);function Qf(t){return t instanceof Date&&!isNaN(+t)}var Yf=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Jf(t,this.delay,this.scheduler))},t}(),Jf=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return t.__extends(n,e),n.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,i=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var s=Math.max(0,n[0].time-r.now());this.schedule(t,s)}else this.unsubscribe(),e.active=!1},n.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(n.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},n.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new Kf(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},n.prototype._next=function(t){this.scheduleNotification(ac.createNext(t))},n.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.scheduleNotification(ac.createComplete()),this.unsubscribe()},n}(vu),Kf=function(){return function(t,e){this.time=t,this.notification=e}}();var Xf=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new tp(t,this.delayDurationSelector))},t}(),tp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return t.__extends(n,e),n.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},n.prototype.notifyError=function(t,e){this._error(t)},n.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},n.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},n.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},n.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},n.prototype.tryDelay=function(t,e){var n=Jc(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},n.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},n}(zc),ep=function(e){function n(t,n){var r=e.call(this)||this;return r.source=t,r.subscriptionDelay=n,r}return t.__extends(n,e),n.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new np(t,this.source))},n}(ku),np=function(e){function n(t,n){var r=e.call(this)||this;return r.parent=t,r.source=n,r.sourceSubscribed=!1,r}return t.__extends(n,e),n.prototype._next=function(t){this.subscribeToSource()},n.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},n.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},n.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},n}(vu);var rp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ip(t))},t}(),ip=function(e){function n(t){return e.call(this,t)||this}return t.__extends(n,e),n.prototype._next=function(t){t.observe(this.destination)},n}(vu);var sp=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new op(t,this.keySelector,this.flushes))},t}(),op=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.keySelector=n,i.values=new Set,r&&i.add(sl(r,new rl(i))),i}return t.__extends(n,e),n.prototype.notifyNext=function(){this.values.clear()},n.prototype.notifyError=function(t){this._error(t)},n.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},n.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},n.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},n}(il);function ap(t,e){return function(n){return n.lift(new up(t,e))}}var up=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new cp(t,this.compare,this.keySelector))},t}(),cp=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return t.__extends(n,e),n.prototype.compare=function(t,e){return t===e},n.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},n}(vu);function lp(t){return void 0===t&&(t=fp),function(e){return e.lift(new hp(t))}}var hp=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new dp(t,this.errorFactory))},t}(),dp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.errorFactory=n,r.hasValue=!1,r}return t.__extends(n,e),n.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},n.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},n}(vu);function fp(){return new Oc}function pp(t){return function(e){return 0===t?Ku():e.lift(new bp(t))}}var bp=function(){function t(t){if(this.total=t,this.total<0)throw new Tc}return t.prototype.call=function(t,e){return e.subscribe(new yp(t,this.total))},t}(),yp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t.__extends(n,e),n.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},n}(vu);var gp=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new mp(t,this.predicate,this.thisArg,this.source))},t}(),mp=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.predicate=n,s.thisArg=r,s.source=i,s.index=0,s.thisArg=r||s,s}return t.__extends(n,e),n.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},n.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},n.prototype._complete=function(){this.notifyComplete(!0)},n}(vu);var vp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new _p(t))},t}(),_p=function(e){function n(t){var n=e.call(this,t)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return t.__extends(n,e),n.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(sl(t,new rl(this))))},n.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},n.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},n}(il);var wp=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Sp(t,this.project))},t}(),Sp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return t.__extends(n,e),n.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},n.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e)},n.prototype._innerSub=function(t){var e=new rl(this),n=this.destination;n.add(e);var r=sl(t,e);r!==e&&n.add(r)},n.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(t){this.destination.next(t)},n.prototype.notifyError=function(t){this.destination.error(t)},n.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},n}(il);var Mp=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new Ep(t,this.project,this.concurrent,this.scheduler))},t}(),Ep=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.project=n,s.concurrent=r,s.scheduler=i,s.index=0,s.active=0,s.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(s.buffer=[]),s}return t.__extends(n,e),n.dispatch=function(t){var e=t.subscriber,n=t.result,r=t.value,i=t.index;e.subscribeToProjection(n,r,i)},n.prototype._next=function(t){var e=this.destination;if(e.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){e.next(t);try{var i=(0,this.project)(t,r);if(this.scheduler){var s={subscriber:this,result:i,value:t,index:r};this.destination.add(this.scheduler.schedule(n.dispatch,0,s))}else this.subscribeToProjection(i,t,r)}catch(t){e.error(t)}}else this.buffer.push(t)}},n.prototype.subscribeToProjection=function(t,e,n){this.active++,this.destination.add(sl(t,new rl(this)))},n.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},n.prototype.notifyNext=function(t){this._next(t)},n.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},n}(il);var xp=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new kp(t,this.callback))},t}(),kp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.add(new yu(n)),r}return t.__extends(n,e),n}(vu);var Cp=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new Ip(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),Ip=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;return o.predicate=n,o.source=r,o.yieldIndex=i,o.thisArg=s,o.index=0,o}return t.__extends(n,e),n.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},n.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},n.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},n}(vu);var Ap=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Np(t))},t}(),Np=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(n,e),n.prototype._next=function(t){},n}(vu);var Rp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new jp(t))},t}(),jp=function(e){function n(t){return e.call(this,t)||this}return t.__extends(n,e),n.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},n.prototype._next=function(t){this.notifyComplete(!1)},n.prototype._complete=function(){this.notifyComplete(!0)},n}(vu);function Tp(t){return function(e){return 0===t?Ku():e.lift(new Op(t))}}var Op=function(){function t(t){if(this.total=t,this.total<0)throw new Tc}return t.prototype.call=function(t,e){return e.subscribe(new Lp(t,this.total))},t}(),Lp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.ring=new Array,r.count=0,r}return t.__extends(n,e),n.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},n.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var s=e++%n;t.next(r[s])}t.complete()},n}(vu);var Pp=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new Dp(t,this.value))},t}(),Dp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.value=n,r}return t.__extends(n,e),n.prototype._next=function(t){this.destination.next(this.value)},n}(vu);var Bp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Fp(t))},t}(),Fp=function(e){function n(t){return e.call(this,t)||this}return t.__extends(n,e),n.prototype._next=function(t){this.destination.next(ac.createNext(t))},n.prototype._error=function(t){var e=this.destination;e.next(ac.createError(t)),e.complete()},n.prototype._complete=function(){var t=this.destination;t.next(ac.createComplete()),t.complete()},n}(vu);function Wp(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new Up(t,e,n))}}var Up=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new Hp(t,this.accumulator,this.seed,this.hasSeed))},t}(),Hp=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.accumulator=n,s._seed=r,s.hasSeed=i,s.index=0,s}return t.__extends(n,e),Object.defineProperty(n.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),n.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},n.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},n}(vu);function Vp(t,e){return arguments.length>=2?function(n){return Eu(Wp(t,e),Tp(1),Gf(e))(n)}:function(e){return Eu(Wp((function(e,n,r){return t(e,n,r+1)})),Tp(1))(e)}}var zp=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new qp(t,this.accumulator,this.seed,this.concurrent))},t}(),qp=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.accumulator=n,s.acc=r,s.concurrent=i,s.hasValue=!1,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return t.__extends(n,e),n.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,t,e)}catch(t){return n.error(t)}this.active++,this._innerSub(r)}else this.buffer.push(t)},n.prototype._innerSub=function(t){var e=new rl(this),n=this.destination;n.add(e);var r=sl(t,e);r!==e&&n.add(r)},n.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()},n.prototype.notifyNext=function(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},n.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},n}(il);function Gp(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new Zp(r,e));var i=Object.create(n,Du);return i.source=n,i.subjectFactory=r,i}}var Zp=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}();var $p=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Qp(t,this.nextSources))},t}(),Qp=function(e){function n(t,n){var r=e.call(this,t)||this;return r.destination=t,r.nextSources=n,r}return t.__extends(n,e),n.prototype.notifyError=function(){this.subscribeToNextSource()},n.prototype.notifyComplete=function(){this.subscribeToNextSource()},n.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},n.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},n.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new rl(this),n=this.destination;n.add(e);var r=sl(t,e);r!==e&&n.add(r)}else this.destination.complete()},n}(il);var Yp=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Jp(t))},t}(),Jp=function(e){function n(t){var n=e.call(this,t)||this;return n.hasPrev=!1,n}return t.__extends(n,e),n.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},n}(vu);var Kp=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Xp(t,this.count,this.source))},t}(),Xp=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.count=n,i.source=r,i}return t.__extends(n,e),n.prototype.complete=function(){if(!this.isStopped){var t=this.source,n=this.count;if(0===n)return e.prototype.complete.call(this);n>-1&&(this.count=n-1),t.subscribe(this._unsubscribeAndRecycle())}},n}(vu);var tb=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new eb(t,this.notifier,e))},t}(),eb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return t.__extends(n,e),n.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},n.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},n.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)}},n.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},n.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},n.prototype.subscribeToRetries=function(){var t;this.notifications=new Ru;try{t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=sl(t,new rl(this))},n}(il);var nb=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new rb(t,this.count,this.source))},t}(),rb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.count=n,i.source=r,i}return t.__extends(n,e),n.prototype.error=function(t){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return e.prototype.error.call(this,t);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},n}(vu);var ib=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new sb(t,this.notifier,this.source))},t}(),sb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.notifier=n,i.source=r,i}return t.__extends(n,e),n.prototype.error=function(t){if(!this.isStopped){var n=this.errors,r=this.retries,i=this.retriesSubscription;if(r)this.errors=void 0,this.retriesSubscription=void 0;else{n=new Ru;try{r=(0,this.notifier)(n)}catch(t){return e.prototype.error.call(this,t)}i=sl(r,new rl(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=i,n.next(t)}},n.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},n.prototype.notifyNext=function(){var t=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=t,this.source.subscribe(this)},n}(il);var ob=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new ab(t),r=e.subscribe(n);return r.add(sl(this.notifier,new rl(n))),r},t}(),ab=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return t.__extends(n,e),n.prototype._next=function(t){this.value=t,this.hasValue=!0},n.prototype.notifyNext=function(){this.emitValue()},n.prototype.notifyComplete=function(){this.emitValue()},n.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},n}(il);var ub=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new cb(t,this.period,this.scheduler))},t}(),cb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(lb,n,{subscriber:i,period:n})),i}return t.__extends(n,e),n.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},n.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},n}(vu);function lb(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}var hb=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new db(t,this.compareTo,this.comparator))},t}(),db=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new fb(t,i))),i}return t.__extends(n,e),n.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},n.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},n.prototype.checkValues=function(){for(var t=this,e=t._a,n=t._b,r=t.comparator;e.length>0&&n.length>0;){var i=e.shift(),s=n.shift(),o=!1;try{o=r?r(i,s):i===s}catch(t){this.destination.error(t)}o||this.emit(!1)}},n.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},n.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},n.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},n}(vu),fb=function(e){function n(t,n){var r=e.call(this,t)||this;return r.parent=n,r}return t.__extends(n,e),n.prototype._next=function(t){this.parent.nextB(t)},n.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},n.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},n}(vu);function pb(){return new Ru}var bb=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new yb(t,this.predicate,this.source))},t}(),yb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return t.__extends(n,e),n.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},n.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},n.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},n.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new Oc)},n}(vu);var gb=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new mb(t,this.total))},t}(),mb=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t.__extends(n,e),n.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},n}(vu);var vb=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Tc}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new vu(t)):e.subscribe(new _b(t,this._skipCount))},t}(),_b=function(e){function n(t,n){var r=e.call(this,t)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return t.__extends(n,e),n.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n<e)this._ring[n]=t;else{var r=n%e,i=this._ring,s=i[r];i[r]=t,this.destination.next(s)}},n}(vu);var wb=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Sb(t,this.notifier))},t}(),Sb=function(e){function n(t,n){var r=e.call(this,t)||this;r.hasValue=!1;var i=new rl(r);r.add(i),r.innerSubscription=i;var s=sl(n,i);return s!==i&&(r.add(s),r.innerSubscription=s),r}return t.__extends(n,e),n.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},n.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},n.prototype.notifyComplete=function(){},n}(il);var Mb=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new Eb(t,this.predicate))},t}(),Eb=function(e){function n(t,n){var r=e.call(this,t)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return t.__extends(n,e),n.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},n.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},n}(vu);var xb=function(e){function n(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Mc);var i=e.call(this)||this;return i.source=t,i.delayTime=n,i.scheduler=r,(!gl(n)||n<0)&&(i.delayTime=0),r&&"function"==typeof r.schedule||(i.scheduler=Mc),i}return t.__extends(n,e),n.create=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Mc),new n(t,e,r)},n.dispatch=function(t){var e=t.source,n=t.subscriber;return this.add(e.subscribe(n))},n.prototype._subscribe=function(t){var e=this.delayTime,r=this.source;return this.scheduler.schedule(n.dispatch,e,{source:r,subscriber:t})},n}(ku);var kb=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new xb(e,this.delay,this.scheduler).subscribe(t)},t}();function Cb(t,e){return"function"==typeof e?function(n){return n.pipe(Cb((function(n,r){return nl(t(n,r)).pipe(Pc((function(t,i){return e(n,t,r,i)})))})))}:function(e){return e.lift(new Ib(t))}}var Ib=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Ab(t,this.project))},t}(),Ab=function(e){function n(t,n){var r=e.call(this,t)||this;return r.project=n,r.index=0,r}return t.__extends(n,e),n.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e)},n.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var n=new rl(this),r=this.destination;r.add(n),this.innerSubscription=sl(t,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},n.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this),this.unsubscribe()},n.prototype._unsubscribe=function(){this.innerSubscription=void 0},n.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},n.prototype.notifyNext=function(t){this.destination.next(t)},n}(il);var Nb=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Rb(t),r=sl(this.notifier,new rl(n));return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),Rb=function(e){function n(t){var n=e.call(this,t)||this;return n.seenValue=!1,n}return t.__extends(n,e),n.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},n.prototype.notifyComplete=function(){},n}(il);var jb=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new Tb(t,this.predicate,this.inclusive))},t}(),Tb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return t.__extends(n,e),n.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},n.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},n}(vu);var Ob=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new Lb(t,this.nextOrObserver,this.error,this.complete))},t}(),Lb=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s._tapNext=jc,s._tapError=jc,s._tapComplete=jc,s._tapError=r||jc,s._tapComplete=i||jc,au(n)?(s._context=s,s._tapNext=n):n&&(s._context=n,s._tapNext=n.next||jc,s._tapError=n.error||jc,s._tapComplete=n.complete||jc),s}return t.__extends(n,e),n.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},n.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},n.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},n}(vu),Pb={leading:!0,trailing:!1};var Db=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new Bb(t,this.durationSelector,this.leading,this.trailing))},t}(),Bb=function(e){function n(t,n,r,i){var s=e.call(this,t)||this;return s.destination=t,s.durationSelector=n,s._leading=r,s._trailing=i,s._hasValue=!1,s}return t.__extends(n,e),n.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},n.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},n.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=sl(e,new rl(this)))},n.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},n.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},n.prototype.notifyNext=function(){this.throttlingDone()},n.prototype.notifyComplete=function(){this.throttlingDone()},n}(il);var Fb=function(){function t(t,e,n,r){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Wb(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Wb=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;return o.duration=n,o.scheduler=r,o.leading=i,o.trailing=s,o._hasTrailingValue=!1,o._trailingValue=null,o}return t.__extends(n,e),n.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Ub,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},n.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},n.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},n}(vu);function Ub(t){t.subscriber.clearThrottle()}var Hb=function(){return function(t,e){this.value=t,this.interval=e}}();function Vb(t,e,n){return void 0===n&&(n=xc),function(r){var i=Qf(t),s=i?+t-n.now():Math.abs(t);return r.lift(new zb(s,i,e,n))}}var zb=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new qb(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),qb=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;return o.absoluteTimeout=n,o.waitFor=r,o.withObservable=i,o.scheduler=s,o.scheduleTimeout(),o}return t.__extends(n,e),n.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(sl(e,new rl(t)))},n.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(n.dispatchTimeout,this.waitFor,this))},n.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},n.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},n}(il);var Gb=function(){return function(t,e){this.value=t,this.timestamp=e}}();function Zb(t,e,n){return 0===n?[e]:(t.push(e),t)}var $b=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var n=new Qb(t),r=e.subscribe(n);return r.closed||n.add(sl(this.windowBoundaries,new rl(n))),r},t}(),Qb=function(e){function n(t){var n=e.call(this,t)||this;return n.window=new Ru,t.next(n.window),n}return t.__extends(n,e),n.prototype.notifyNext=function(){this.openWindow()},n.prototype.notifyError=function(t){this._error(t)},n.prototype.notifyComplete=function(){this._complete()},n.prototype._next=function(t){this.window.next(t)},n.prototype._error=function(t){this.window.error(t),this.destination.error(t)},n.prototype._complete=function(){this.window.complete(),this.destination.complete()},n.prototype._unsubscribe=function(){this.window=null},n.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,n=this.window=new Ru;e.next(n)},n}(il);var Yb=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new Jb(t,this.windowSize,this.startWindowEvery))},t}(),Jb=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=n,i.startWindowEvery=r,i.windows=[new Ru],i.count=0,t.next(i.windows[0]),i}return t.__extends(n,e),n.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,s=i.length,o=0;o<s&&!this.closed;o++)i[o].next(t);var a=this.count-r+1;if(a>=0&&a%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var u=new Ru;i.push(u),n.next(u)}},n.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},n.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},n.prototype._unsubscribe=function(){this.count=0,this.windows=null},n}(vu);var Kb=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ty(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),Xb=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return t.__extends(n,e),n.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(n.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),n}(Ru),ty=function(e){function n(t,n,r,i,s){var o=e.call(this,t)||this;o.destination=t,o.windowTimeSpan=n,o.windowCreationInterval=r,o.maxWindowSize=i,o.scheduler=s,o.windows=[];var a=o.openWindow();if(null!==r&&r>=0){var u={subscriber:o,window:a,context:null},c={windowTimeSpan:n,windowCreationInterval:r,subscriber:o,scheduler:s};o.add(s.schedule(ry,n,u)),o.add(s.schedule(ny,r,c))}else{var l={subscriber:o,window:a,windowTimeSpan:n};o.add(s.schedule(ey,n,l))}return o}return t.__extends(n,e),n.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r<n;r++){var i=e[r];i.closed||(i.next(t),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},n.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},n.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},n.prototype.openWindow=function(){var t=new Xb;return this.windows.push(t),this.destination.next(t),t},n.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},n}(vu);function ey(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function ny(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,s=n.openWindow(),o=this,a={action:o,subscription:null},u={subscriber:n,window:s,context:a};a.subscription=r.schedule(ry,e,u),o.add(a.subscription),o.schedule(t,i)}function ry(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}var iy=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new sy(t,this.openings,this.closingSelector))},t}(),sy=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=Jc(i,n,n)),i}return t.__extends(n,e),n.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r<n;r++)e[r].window.next(t)},n.prototype._error=function(t){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var s=n[i];s.window.error(t),s.subscription.unsubscribe()}e.prototype._error.call(this,t)},n.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var n=t.length,r=-1;++r<n;){var i=t[r];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},n.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,n=-1;++n<e;){var r=t[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},n.prototype.notifyNext=function(t,e,n,r,i){if(t===this.openings){var s=void 0;try{s=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var o=new Ru,a=new yu,u={window:o,subscription:a};this.contexts.push(u);var c=Jc(this,s,u);c.closed?this.closeWindow(this.contexts.length-1):(c.context=u,a.add(c)),this.destination.next(o)}else this.closeWindow(this.contexts.indexOf(t))},n.prototype.notifyError=function(t){this.error(t)},n.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},n.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,n=e[t],r=n.window,i=n.subscription;e.splice(t,1),r.complete(),i.unsubscribe()}},n}(zc);var oy=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new ay(t,this.closingSelector))},t}(),ay=function(e){function n(t,n){var r=e.call(this,t)||this;return r.destination=t,r.closingSelector=n,r.openWindow(),r}return t.__extends(n,e),n.prototype.notifyNext=function(t,e,n,r,i){this.openWindow(i)},n.prototype.notifyError=function(t){this._error(t)},n.prototype.notifyComplete=function(t){this.openWindow(t)},n.prototype._next=function(t){this.window.next(t)},n.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},n.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},n.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},n.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var n,r=this.window=new Ru;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=Jc(this,n))},n}(zc);var uy=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new cy(t,this.observables,this.project))},t}(),cy=function(e){function n(t,n,r){var i=e.call(this,t)||this;i.observables=n,i.project=r,i.toRespond=[];var s=n.length;i.values=new Array(s);for(var o=0;o<s;o++)i.toRespond.push(o);for(o=0;o<s;o++){var a=n[o];i.add(Jc(i,a,void 0,o))}return i}return t.__extends(n,e),n.prototype.notifyNext=function(t,e,n){this.values[n]=e;var r=this.toRespond;if(r.length>0){var i=r.indexOf(n);-1!==i&&r.splice(i,1)}},n.prototype.notifyComplete=function(){},n.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},n.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(zc);var ly=Object.freeze({__proto__:null,audit:mf,auditTime:function(t,e){return void 0===e&&(e=xc),mf((function(){return Nl(t,e)}))},buffer:function(t){return function(e){return e.lift(new wf(t))}},bufferCount:function(t,e){return void 0===e&&(e=null),function(n){return n.lift(new Mf(t,e))}},bufferTime:function(t){var e=arguments.length,n=xc;Xu(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new kf(t,r,i,n))}},bufferToggle:function(t,e){return function(n){return n.lift(new jf(t,e))}},bufferWhen:function(t){return function(e){return e.lift(new Of(t))}},catchError:function(t){return function(e){var n=new Pf(t),r=e.lift(n);return n.caught=r}},combineAll:function(t){return function(e){return e.lift(new Xc(t))}},combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&du(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(nl([e].concat(t)),new Xc(n))}},concat:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(dl.apply(void 0,[e].concat(t)))}},concatAll:hl,concatMap:Bf,concatMapTo:function(t,e){return Bf((function(){return t}),e)},count:function(t){return function(e){return e.lift(new Ff(t,e))}},debounce:function(t){return function(e){return e.lift(new Uf(t))}},debounceTime:function(t,e){return void 0===e&&(e=xc),function(n){return n.lift(new Vf(t,e))}},defaultIfEmpty:Gf,delay:function(t,e){void 0===e&&(e=xc);var n=Qf(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new Yf(n,e))}},delayWhen:function(t,e){return e?function(n){return new ep(n,e).lift(new Xf(t))}:function(e){return e.lift(new Xf(t))}},dematerialize:function(){return function(t){return t.lift(new rp)}},distinct:function(t,e){return function(n){return n.lift(new sp(t,e))}},distinctUntilChanged:ap,distinctUntilKeyChanged:function(t,e){return ap((function(n,r){return e?e(n[t],r[t]):n[t]===r[t]}))},elementAt:function(t,e){if(t<0)throw new Tc;var n=arguments.length>=2;return function(r){return r.pipe(Ml((function(e,n){return n===t})),pp(1),n?Gf(e):lp((function(){return new Tc})))}},endWith:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return dl(e,ic.apply(void 0,t))}},every:function(t,e){return function(n){return n.lift(new gp(t,e,n))}},exhaust:function(){return function(t){return t.lift(new vp)}},exhaustMap:function t(e,n){return n?function(r){return r.pipe(t((function(t,r){return nl(e(t,r)).pipe(Pc((function(e,i){return n(t,e,r,i)})))})))}:function(t){return t.lift(new wp(e))}},expand:function(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new Mp(t,e,n))}},filter:Ml,finalize:function(t){return function(e){return e.lift(new xp(t))}},find:function(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new Cp(t,n,!1,e))}},findIndex:function(t,e){return function(n){return n.lift(new Cp(t,n,!0,e))}},first:function(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Ml((function(e,n){return t(e,n,r)})):Mu,pp(1),n?Gf(e):lp((function(){return new Oc})))}},groupBy:function(t,e,n,r){return function(i){return i.lift(new Fu(t,e,n,r))}},ignoreElements:function(){return function(t){return t.lift(new Ap)}},isEmpty:function(){return function(t){return t.lift(new Rp)}},last:function(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Ml((function(e,n){return t(e,n,r)})):Mu,Tp(1),n?Gf(e):lp((function(){return new Oc})))}},map:Pc,mapTo:function(t){return function(e){return e.lift(new Pp(t))}},materialize:function(){return function(t){return t.lift(new Bp)}},max:function(t){var e="function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e};return Vp(e)},merge:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(vl.apply(void 0,[e].concat(t)))}},mergeAll:ll,mergeMap:ol,flatMap:cl,mergeMapTo:function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?ol((function(){return t}),e,n):("number"==typeof e&&(n=e),ol((function(){return t}),n))},mergeScan:function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new zp(t,e,n))}},min:function(t){var e="function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t<e?t:e};return Vp(e)},multicast:Gp,observeOn:function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new uc(t,e))}},onErrorResumeNext:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&du(t[0])&&(t=t[0]),function(e){return e.lift(new $p(t))}},pairwise:function(){return function(t){return t.lift(new Yp)}},partition:function(t,e){return function(n){return[Ml(t,e)(n),Ml(Sl(t,e))(n)]}},pluck:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(e){return Pc(function(t,e){var n=function(n){for(var r=n,i=0;i<e;i++){var s=null!=r?r[t[i]]:void 0;if(void 0===s)return;r=s}return r};return n}(t,n))(e)}},publish:function(t){return t?Gp((function(){return new Ru}),t):Gp(new Ru)},publishBehavior:function(t){return function(e){return Gp(new zu(t))(e)}},publishLast:function(){return function(t){return Gp(new fc)(t)}},publishReplay:function(t,e,n,r){n&&"function"!=typeof n&&(r=n);var i="function"==typeof n?n:void 0,s=new hc(t,e,r);return function(t){return Gp((function(){return s}),i)(t)}},race:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&du(t[0])&&(t=t[0]),e.lift.call(kl.apply(void 0,[e].concat(t)))}},reduce:Vp,repeat:function(t){return void 0===t&&(t=-1),function(e){return 0===t?Ku():t<0?e.lift(new Kp(-1,e)):e.lift(new Kp(t-1,e))}},repeatWhen:function(t){return function(e){return e.lift(new tb(t))}},retry:function(t){return void 0===t&&(t=-1),function(e){return e.lift(new nb(t,e))}},retryWhen:function(t){return function(e){return e.lift(new ib(t,e))}},refCount:Tu,sample:function(t){return function(e){return e.lift(new ob(t))}},sampleTime:function(t,e){return void 0===e&&(e=xc),function(n){return n.lift(new ub(t,e))}},scan:Wp,sequenceEqual:function(t,e){return function(n){return n.lift(new hb(t,e))}},share:function(){return function(t){return Tu()(Gp(pb)(t))}},shareReplay:function(t,e,n){var r;return r=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,r=t.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY:r,s=t.windowTime,o=void 0===s?Number.POSITIVE_INFINITY:s,a=t.refCount,u=t.scheduler,c=0,l=!1,h=!1;return function(t){var r;c++,!e||l?(l=!1,e=new hc(i,o,u),r=e.subscribe(this),n=t.subscribe({next:function(t){e.next(t)},error:function(t){l=!0,e.error(t)},complete:function(){h=!0,n=void 0,e.complete()}}),h&&(n=void 0)):r=e.subscribe(this),this.add((function(){c--,r.unsubscribe(),r=void 0,n&&!h&&a&&0===c&&(n.unsubscribe(),n=void 0,e=void 0)}))}}(r))}},single:function(t){return function(e){return e.lift(new bb(t,e))}},skip:function(t){return function(e){return e.lift(new gb(t))}},skipLast:function(t){return function(e){return e.lift(new vb(t))}},skipUntil:function(t){return function(e){return e.lift(new wb(t))}},skipWhile:function(t){return function(e){return e.lift(new Mb(t))}},startWith:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Xu(n)?(t.pop(),function(e){return dl(t,e,n)}):function(e){return dl(t,e)}},subscribeOn:function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new kb(t,e))}},switchAll:function(){return Cb(Mu)},switchMap:Cb,switchMapTo:function(t,e){return e?Cb((function(){return t}),e):Cb((function(){return t}))},take:pp,takeLast:Tp,takeUntil:function(t){return function(e){return e.lift(new Nb(t))}},takeWhile:function(t,e){return void 0===e&&(e=!1),function(n){return n.lift(new jb(t,e))}},tap:function(t,e,n){return function(r){return r.lift(new Ob(t,e,n))}},throttle:function(t,e){return void 0===e&&(e=Pb),function(n){return n.lift(new Db(t,!!e.leading,!!e.trailing))}},throttleTime:function(t,e,n){return void 0===e&&(e=xc),void 0===n&&(n=Pb),function(r){return r.lift(new Fb(t,e,n.leading,n.trailing))}},throwIfEmpty:lp,timeInterval:function(t){return void 0===t&&(t=xc),function(e){return fl((function(){return e.pipe(Wp((function(e,n){var r=e.current;return{value:n,current:t.now(),last:r}}),{current:t.now(),value:void 0,last:void 0}),Pc((function(t){var e=t.current,n=t.last,r=t.value;return new Hb(r,e-n)})))}))}},timeout:function(t,e){return void 0===e&&(e=xc),Vb(t,sc(new Lc),e)},timeoutWith:Vb,timestamp:function(t){return void 0===t&&(t=xc),Pc((function(e){return new Gb(e,t.now())}))},toArray:function(){return Vp(Zb,[])},window:function(t){return function(e){return e.lift(new $b(t))}},windowCount:function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new Yb(t,e))}},windowTime:function(t){var e=xc,n=null,r=Number.POSITIVE_INFINITY;return Xu(arguments[3])&&(e=arguments[3]),Xu(arguments[2])?e=arguments[2]:gl(arguments[2])&&(r=Number(arguments[2])),Xu(arguments[1])?e=arguments[1]:gl(arguments[1])&&(n=Number(arguments[1])),function(i){return i.lift(new Kb(t,n,r,e))}},windowToggle:function(t,e){return function(n){return n.lift(new iy(t,e))}},windowWhen:function(t){return function(e){return e.lift(new oy(t))}},withLatestFrom:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new uy(r,n))}},zip:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(jl.apply(void 0,[e].concat(t)))}},zipAll:function(t){return function(e){return e.lift(new Tl(t))}}}),hy=e.getAugmentedNamespace(ly),dy={},fy={};Object.defineProperty(fy,"__esModule",{value:!0}),fy.ClientMessagePublishEvent=fy.ClientMessageSetSessionConfig=fy.ClientMessageGetSessionConfig=fy.ClientMessageIsLinked=fy.ClientMessageHostSession=void 0,fy.ClientMessageHostSession=function(t){return Object.assign({type:"HostSession"},t)},fy.ClientMessageIsLinked=function(t){return Object.assign({type:"IsLinked"},t)},fy.ClientMessageGetSessionConfig=function(t){return Object.assign({type:"GetSessionConfig"},t)},fy.ClientMessageSetSessionConfig=function(t){return Object.assign({type:"SetSessionConfig"},t)},fy.ClientMessagePublishEvent=function(t){return Object.assign({type:"PublishEvent"},t)};var py={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=Fl,n=hy;var r;!function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(r=t.ConnectionState||(t.ConnectionState={}));t.RxWebSocket=class{constructor(t,n=WebSocket){this.WebSocketClass=n,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(r.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=t.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable((t=>{let e;try{this.webSocket=e=new this.WebSocketClass(this.url)}catch(e){return void t.error(e)}this.connectionStateSubject.next(r.CONNECTING),e.onclose=e=>{this.clearWebSocket(),t.error(new Error(`websocket error ${e.code}: ${e.reason}`)),this.connectionStateSubject.next(r.DISCONNECTED)},e.onopen=e=>{t.next(),t.complete(),this.connectionStateSubject.next(r.CONNECTED)},e.onmessage=t=>{this.incomingDataSubject.next(t.data)}})).pipe((0,n.take)(1))}disconnect(){const{webSocket:t}=this;if(t){this.clearWebSocket(),this.connectionStateSubject.next(r.DISCONNECTED);try{t.close()}catch(t){}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,n.flatMap)((t=>{let n;try{n=JSON.parse(t)}catch(t){return(0,e.empty)()}return(0,e.of)(n)})))}sendData(t){const{webSocket:e}=this;if(!e)throw new Error("websocket is not connected");e.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}}(py);var by={};Object.defineProperty(by,"__esModule",{value:!0}),by.isServerMessageFail=void 0,by.isServerMessageFail=function(t){return t&&"Fail"===t.type&&"number"==typeof t.id&&"string"==typeof t.sessionId&&"string"==typeof t.error},Object.defineProperty(dy,"__esModule",{value:!0}),dy.WalletSDKConnection=void 0;const yy=Fl,gy=hy,my=P,vy=kr,_y=fy,wy=L,Sy=py,My=by;dy.WalletSDKConnection=class{constructor(t,e,n,r,i=WebSocket){this.sessionId=t,this.sessionKey=e,this.diagnostic=r,this.subscriptions=new yy.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,vy.IntNumber)(1),this.connectedSubject=new yy.BehaviorSubject(!1),this.linkedSubject=new yy.BehaviorSubject(!1),this.sessionConfigSubject=new yy.ReplaySubject(1);const s=new Sy.RxWebSocket(n+"/rpc",i);this.ws=s,this.subscriptions.add(s.connectionState$.pipe((0,gy.tap)((e=>{var n;return null===(n=this.diagnostic)||void 0===n?void 0:n.log(wy.EVENTS.CONNECTED_STATE_CHANGE,{state:e,sessionIdHash:my.Session.hash(t)})})),(0,gy.skip)(1),(0,gy.filter)((t=>t===Sy.ConnectionState.DISCONNECTED&&!this.destroyed)),(0,gy.delay)(5e3),(0,gy.filter)((t=>!this.destroyed)),(0,gy.flatMap)((t=>s.connect())),(0,gy.retry)()).subscribe()),this.subscriptions.add(s.connectionState$.pipe((0,gy.skip)(2),(0,gy.switchMap)((t=>(0,yy.iif)((()=>t===Sy.ConnectionState.CONNECTED),this.authenticate().pipe((0,gy.tap)((t=>this.sendIsLinked())),(0,gy.tap)((t=>this.sendGetSessionConfig())),(0,gy.map)((t=>!0))),(0,yy.of)(!1)))),(0,gy.distinctUntilChanged)(),(0,gy.catchError)((t=>(0,yy.of)(!1)))).subscribe((t=>this.connectedSubject.next(t)))),this.subscriptions.add(s.connectionState$.pipe((0,gy.skip)(1),(0,gy.switchMap)((t=>(0,yy.iif)((()=>t===Sy.ConnectionState.CONNECTED),(0,yy.timer)(0,1e4))))).subscribe((t=>0===t?this.updateLastHeartbeat():this.heartbeat()))),this.subscriptions.add(s.incomingData$.pipe((0,gy.filter)((t=>"h"===t))).subscribe((t=>this.updateLastHeartbeat()))),this.subscriptions.add(s.incomingJSONData$.pipe((0,gy.filter)((t=>["IsLinkedOK","Linked"].includes(t.type)))).subscribe((e=>{var n;const r=e;null===(n=this.diagnostic)||void 0===n||n.log(wy.EVENTS.LINKED,{sessionIdHash:my.Session.hash(t),linked:r.linked,type:e.type,onlineGuests:r.onlineGuests}),this.linkedSubject.next(r.linked||r.onlineGuests>0)}))),this.subscriptions.add(s.incomingJSONData$.pipe((0,gy.filter)((t=>["GetSessionConfigOK","SessionConfigUpdated"].includes(t.type)))).subscribe((e=>{var n;const r=e;null===(n=this.diagnostic)||void 0===n||n.log(wy.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:my.Session.hash(t),metadata_keys:r&&r.metadata?Object.keys(r.metadata):void 0}),this.sessionConfigSubject.next({webhookId:r.webhookId,webhookUrl:r.webhookUrl,metadata:r.metadata})})))}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");null===(t=this.diagnostic)||void 0===t||t.log(wy.EVENTS.STARTED_CONNECTING,{sessionIdHash:my.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var t;this.subscriptions.unsubscribe(),this.ws.disconnect(),null===(t=this.diagnostic)||void 0===t||t.log(wy.EVENTS.DISCONNECTED,{sessionIdHash:my.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,gy.filter)((t=>t)),(0,gy.take)(1),(0,gy.map)((()=>{})))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,gy.filter)((t=>t)),(0,gy.take)(1),(0,gy.map)((()=>{})))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,gy.filter)((t=>{if("Event"!==t.type)return!1;const e=t;return"string"==typeof e.sessionId&&"string"==typeof e.eventId&&"string"==typeof e.event&&"string"==typeof e.data})),(0,gy.map)((t=>t)))}setSessionMetadata(t,e){const n=(0,_y.ClientMessageSetSessionConfig)({id:(0,vy.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[t]:e}});return this.onceConnected$.pipe((0,gy.flatMap)((t=>this.makeRequest(n))),(0,gy.map)((t=>{if((0,My.isServerMessageFail)(t))throw new Error(t.error||"failed to set session metadata")})))}publishEvent(t,e,n=!1){const r=(0,_y.ClientMessagePublishEvent)({id:(0,vy.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:t,data:e,callWebhook:n});return this.onceLinked$.pipe((0,gy.flatMap)((t=>this.makeRequest(r))),(0,gy.map)((t=>{if((0,My.isServerMessageFail)(t))throw new Error(t.error||"failed to publish event");return t.eventId})))}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(t){}}makeRequest(t,e=6e4){const n=t.id;try{this.sendData(t)}catch(t){return(0,yy.throwError)(t)}return this.ws.incomingJSONData$.pipe((0,gy.timeoutWith)(e,(0,yy.throwError)(new Error(`request ${n} timed out`))),(0,gy.filter)((t=>t.id===n)),(0,gy.take)(1))}authenticate(){const t=(0,_y.ClientMessageHostSession)({id:(0,vy.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(t).pipe((0,gy.map)((t=>{if((0,My.isServerMessageFail)(t))throw new Error(t.error||"failed to authentcate")})))}sendIsLinked(){const t=(0,_y.ClientMessageIsLinked)({id:(0,vy.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}sendGetSessionConfig(){const t=(0,_y.ClientMessageGetSessionConfig)({id:(0,vy.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}};var Ey={};Object.defineProperty(Ey,"__esModule",{value:!0}),Ey.WalletUIError=void 0;class xy extends Error{constructor(t,e){super(t),this.message=t,this.errorCode=e}}Ey.WalletUIError=xy,xy.UserRejectedRequest=new xy("User rejected request"),xy.SwitchEthereumChainUnsupportedChainId=new xy("Unsupported chainId",4902);var ky={};Object.defineProperty(ky,"__esModule",{value:!0}),ky.decrypt=ky.encrypt=void 0;const Cy=Jt;ky.encrypt=async function(t,e){if(64!==e.length)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",(0,Cy.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},r,i.encode(t)),o=s.slice(s.byteLength-16),a=s.slice(0,s.byteLength-16),u=new Uint8Array(o),c=new Uint8Array(a),l=new Uint8Array([...n,...u,...c]);return(0,Cy.uint8ArrayToHex)(l)},ky.decrypt=function(t,e){if(64!==e.length)throw Error("secret must be 256 bits");return new Promise(((n,r)=>{!async function(){const i=await crypto.subtle.importKey("raw",(0,Cy.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,Cy.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),u=s.slice(28),c=new Uint8Array([...u,...a]),l={name:"AES-GCM",iv:new Uint8Array(o)};try{const t=await window.crypto.subtle.decrypt(l,i,c),e=new TextDecoder;n(e.decode(t))}catch(t){r(t)}}()}))};var Iy={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(t){t.requestEthereumAccounts="requestEthereumAccounts",t.signEthereumMessage="signEthereumMessage",t.signEthereumTransaction="signEthereumTransaction",t.submitEthereumTransaction="submitEthereumTransaction",t.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",t.scanQRCode="scanQRCode",t.generic="generic",t.childRequestEthereumAccounts="childRequestEthereumAccounts",t.addEthereumChain="addEthereumChain",t.switchEthereumChain="switchEthereumChain",t.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",t.watchAsset="watchAsset",t.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))}(Iy);var Ay={},Ny={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,(e=t.RelayMessageType||(t.RelayMessageType={})).SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(Ny),Object.defineProperty(Ay,"__esModule",{value:!0}),Ay.Web3RequestCanceledMessage=void 0;const Ry=Ny;Ay.Web3RequestCanceledMessage=function(t){return{type:Ry.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}};var jy={};Object.defineProperty(jy,"__esModule",{value:!0}),jy.Web3RequestMessage=void 0;const Ty=Ny;jy.Web3RequestMessage=function(t){return Object.assign({type:Ty.RelayMessageType.WEB3_REQUEST},t)};var Oy={};Object.defineProperty(Oy,"__esModule",{value:!0}),Oy.EthereumAddressFromSignedMessageResponse=Oy.SubmitEthereumTransactionResponse=Oy.SignEthereumTransactionResponse=Oy.SignEthereumMessageResponse=Oy.isRequestEthereumAccountsResponse=Oy.SelectProviderResponse=Oy.WatchAssetReponse=Oy.RequestEthereumAccountsResponse=Oy.SwitchEthereumChainResponse=Oy.AddEthereumChainResponse=Oy.ErrorResponse=void 0;const Ly=Iy;Oy.ErrorResponse=function(t,e,n){return{method:t,errorMessage:e,errorCode:n}},Oy.AddEthereumChainResponse=function(t){return{method:Ly.Web3Method.addEthereumChain,result:t}},Oy.SwitchEthereumChainResponse=function(t){return{method:Ly.Web3Method.switchEthereumChain,result:t}},Oy.RequestEthereumAccountsResponse=function(t){return{method:Ly.Web3Method.requestEthereumAccounts,result:t}},Oy.WatchAssetReponse=function(t){return{method:Ly.Web3Method.watchAsset,result:t}},Oy.SelectProviderResponse=function(t){return{method:Ly.Web3Method.selectProvider,result:t}},Oy.isRequestEthereumAccountsResponse=function(t){return t&&t.method===Ly.Web3Method.requestEthereumAccounts},Oy.SignEthereumMessageResponse=function(t){return{method:Ly.Web3Method.signEthereumMessage,result:t}},Oy.SignEthereumTransactionResponse=function(t){return{method:Ly.Web3Method.signEthereumTransaction,result:t}},Oy.SubmitEthereumTransactionResponse=function(t){return{method:Ly.Web3Method.submitEthereumTransaction,result:t}},Oy.EthereumAddressFromSignedMessageResponse=function(t){return{method:Ly.Web3Method.ethereumAddressFromSignedMessage,result:t}};var Py={};Object.defineProperty(Py,"__esModule",{value:!0}),Py.isWeb3ResponseMessage=Py.Web3ResponseMessage=void 0;const Dy=Ny;Py.Web3ResponseMessage=function(t){return Object.assign({type:Dy.RelayMessageType.WEB3_RESPONSE},t)},Py.isWeb3ResponseMessage=function(t){return t&&t.type===Dy.RelayMessageType.WEB3_RESPONSE};var By=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),Fy=e.commonjsGlobal&&e.commonjsGlobal.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Wy=e.commonjsGlobal&&e.commonjsGlobal.__decorate||function(t,e,n,r){var i,s=arguments.length,o=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s<3?i(o):s>3?i(e,n,o):i(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Uy=e.commonjsGlobal&&e.commonjsGlobal.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&By(e,t,n);return Fy(e,t),e},Hy=e.commonjsGlobal&&e.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bf,"__esModule",{value:!0}),bf.WalletSDKRelay=void 0;const Vy=Hy(yf),zy=w,qy=Fl,Gy=hy,Zy=L,$y=dy,Qy=Ey,Yy=kr,Jy=Jt,Ky=Uy(ky),Xy=P,tg=$r,eg=Iy,ng=Ay,rg=jy,ig=Oy,sg=Py;class og extends tg.WalletSDKRelayAbstract{constructor(t){var e;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new qy.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new qy.Subscription,this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:r,connection:i}=this.subscribe();if(this._session=n,this.connection=i,this.relayEventManager=t.relayEventManager,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this.diagnostic={log:t.eventListener.onEvent}:this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=null===(e=t.reloadOnDisconnect)||void 0===e||e,this.ui=r}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe((t=>{this.dappDefaultChain!==t&&(this.dappDefaultChain=t)})));const t=Xy.Session.load(this.storage)||new Xy.Session(this.storage).save(),e=new $y.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(e.sessionConfig$.subscribe({next:t=>{this.onSessionConfigChanged(t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Zy.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(e.incomingEvent$.pipe((0,Gy.filter)((t=>"Web3Response"===t.event))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(e.linked$.pipe((0,Gy.skip)(1),(0,Gy.tap)((t=>{var e;this.isLinked=t;const n=this.storage.getItem(tg.LOCAL_STORAGE_ADDRESSES_KEY);if(t&&(this.session.linked=t),this.isUnlinkedErrorState=!1,n){const r=n.split(" "),i="true"===this.storage.getItem("IsStandaloneSigning");if(""!==r[0]&&!t&&this.session.linked&&!i){this.isUnlinkedErrorState=!0;const t=this.getSessionIdHash();null===(e=this.diagnostic)||void 0===e||e.log(Zy.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:t})}}}))).subscribe()),this.subscriptions.add(e.sessionConfig$.pipe((0,Gy.filter)((t=>!!t.metadata&&"1"===t.metadata.__destroyed))).subscribe((()=>{var t;const n=e.isDestroyed;return null===(t=this.diagnostic)||void 0===t||t.log(Zy.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:n,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()}))),this.subscriptions.add(e.sessionConfig$.pipe((0,Gy.filter)((t=>t.metadata&&void 0!==t.metadata.WalletUsername))).pipe((0,Gy.mergeMap)((e=>Ky.decrypt(e.metadata.WalletUsername,t.secret)))).subscribe({next:t=>{this.storage.setItem(tg.WALLET_USER_NAME_KEY,t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Zy.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Gy.filter)((t=>t.metadata&&void 0!==t.metadata.AppVersion))).pipe((0,Gy.mergeMap)((e=>Ky.decrypt(e.metadata.AppVersion,t.secret)))).subscribe({next:t=>{this.storage.setItem(tg.APP_VERSION_KEY,t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Zy.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Gy.filter)((t=>t.metadata&&void 0!==t.metadata.ChainId&&void 0!==t.metadata.JsonRpcUrl))).pipe((0,Gy.mergeMap)((e=>(0,qy.zip)(Ky.decrypt(e.metadata.ChainId,t.secret),Ky.decrypt(e.metadata.JsonRpcUrl,t.secret))))).pipe((0,Gy.distinctUntilChanged)()).subscribe({next:([t,e])=>{this.chainCallback&&this.chainCallback(t,e)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Zy.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Gy.filter)((t=>t.metadata&&void 0!==t.metadata.EthereumAddress))).pipe((0,Gy.mergeMap)((e=>Ky.decrypt(e.metadata.EthereumAddress,t.secret)))).subscribe({next:t=>{this.accountsCallback&&this.accountsCallback([t]),og.accountRequestCallbackIds.size>0&&(Array.from(og.accountRequestCallbackIds.values()).forEach((e=>{const n=(0,sg.Web3ResponseMessage)({id:e,response:(0,ig.RequestEthereumAccountsResponse)([t])});this.invokeCallback(Object.assign(Object.assign({},n),{id:e}))})),og.accountRequestCallbackIds.clear())},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Zy.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Gy.filter)((t=>t.metadata&&void 0!==t.metadata.AppSrc))).pipe((0,Gy.mergeMap)((e=>Ky.decrypt(e.metadata.AppSrc,t.secret)))).subscribe({next:t=>{this.ui.setAppSrc(t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Zy.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:t,connected$:e.connected$,chainId$:this.dappDefaultChainSubject});return e.connect(),{session:t,ui:n,connection:e}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Gy.timeout)(1e3),(0,Gy.catchError)((t=>(0,qy.of)(null)))).subscribe((t=>{var e,n,r;const i=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch(t){null===(e=this.diagnostic)||void 0===e||e.log(Zy.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(n=this.diagnostic)||void 0===n||n.log(Zy.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=Xy.Session.load(this.storage);if((null==s?void 0:s.id)===this._session.id?this.storage.clear():s&&(null===(r=this.diagnostic)||void 0===r||r.log(Zy.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Xy.Session.hash(s.id)})),this._reloadOnDisconnect)return void this.ui.reloadUI();this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new qy.Subscription;const{session:o,ui:a,connection:u}=this.subscribe();this._session=o,this.connection=u,this.ui=a,i&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}),(t=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Zy.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})}))}setAppInfo(t,e){this.appName=t,this.appLogoUrl=e}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,e){this.storage.setItem(t,e)}signEthereumMessage(t,e,n,r){return this.sendRequest({method:eg.Web3Method.signEthereumMessage,params:{message:(0,Jy.hexStringFromBuffer)(t,!0),address:e,addPrefix:n,typedDataJson:r||null}})}ethereumAddressFromSignedMessage(t,e,n){return this.sendRequest({method:eg.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,Jy.hexStringFromBuffer)(t,!0),signature:(0,Jy.hexStringFromBuffer)(e,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:eg.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Jy.bigIntStringFromBN)(t.weiValue),data:(0,Jy.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Jy.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Jy.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Jy.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Jy.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:eg.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Jy.bigIntStringFromBN)(t.weiValue),data:(0,Jy.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Jy.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Jy.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Jy.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Jy.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,e){return this.sendRequest({method:eg.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,Jy.hexStringFromBuffer)(t,!0),chainId:e}})}scanQRCode(t){return this.sendRequest({method:eg.Web3Method.scanQRCode,params:{regExp:t}})}getQRCodeUrl(){return(0,Jy.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,e){return this.sendRequest({method:eg.Web3Method.generic,params:{action:e,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let e=null;const n=(0,Jy.randomBytesHex)(8),r=r=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,r),null==e||e()};return{promise:new Promise(((i,s)=>{this.ui.isStandalone()||(e=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,(t=>{if(null==e||e(),t.errorMessage)return s(new Error(t.errorMessage));i(t)})),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)})),cancel:r}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChainSubject.next(t)}publishWeb3RequestEvent(t,e){var n;const r=(0,rg.Web3RequestMessage)({id:t,request:e}),i=Xy.Session.load(this.storage);null===(n=this.diagnostic)||void 0===n||n.log(Zy.EVENTS.WEB3_REQUEST,{eventId:r.id,method:`relay::${r.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?Xy.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",r,!0).subscribe({next:t=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Zy.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:r.id,method:`relay::${r.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?Xy.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()})},error:t=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:r.id,response:{method:r.request.method,errorMessage:t.message}}))}}))}publishWeb3RequestCanceledEvent(t){const e=(0,ng.Web3RequestCanceledMessage)(t);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",e,!1).subscribe())}publishEvent(t,e,n){const r=this.session.secret;return new qy.Observable((t=>{Ky.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{origin:location.origin})),r).then((e=>{t.next(e),t.complete()}))})).pipe((0,Gy.mergeMap)((e=>this.connection.publishEvent(t,e,n))))}handleIncomingEvent(t){try{this.subscriptions.add((0,qy.from)(Ky.decrypt(t.data,this.session.secret)).pipe((0,Gy.map)((t=>JSON.parse(t)))).subscribe({next:t=>{const e=(0,sg.isWeb3ResponseMessage)(t)?t:null;e&&this.handleWeb3ResponseMessage(e)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Zy.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(t){return}}handleWeb3ResponseMessage(t){var e;const{response:n}=t;if(null===(e=this.diagnostic)||void 0===e||e.log(Zy.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,ig.isRequestEthereumAccountsResponse)(n))return og.accountRequestCallbackIds.forEach((e=>this.invokeCallback(Object.assign(Object.assign({},t),{id:e})))),void og.accountRequestCallbackIds.clear();this.invokeCallback(t)}handleErrorResponse(t,e,n,r){this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:t,response:(0,ig.ErrorResponse)(e,(null!=n?n:Qy.WalletUIError.UserRejectedRequest).message,r)}))}invokeCallback(t){const e=this.relayEventManager.callbacks.get(t.id);e&&(e(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:eg.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},e=(0,Jy.randomBytesHex)(8),n=n=>{this.publishWeb3RequestCanceledEvent(e),this.handleErrorResponse(e,t.method,n)};return{promise:new Promise(((r,i)=>{var s;this.relayEventManager.callbacks.set(e,(t=>{if(this.ui.hideRequestEthereumAccounts(),t.errorMessage)return i(new Error(t.errorMessage));r(t)}));const o=(null===(s=null===window||void 0===window?void 0:window.navigator)||void 0===s?void 0:s.userAgent)||null;if(o&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(o)){let t;try{t=(0,Jy.isInIFrame)()&&window.top?window.top.location:window.location}catch(e){t=window.location}t.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(t.href)}`}else{if(this.ui.inlineAccountsResponse()){const t=t=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:e,response:(0,ig.RequestEthereumAccountsResponse)(t)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:t})}else{const t=zy.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(t)})}og.accountRequestCallbackIds.add(e),this.ui.inlineAccountsResponse()||this.ui.isStandalone()||this.publishWeb3RequestEvent(e,t)}})),cancel:n}}selectProvider(t){const e={method:eg.Web3Method.selectProvider,params:{providerOptions:t}},n=(0,Jy.randomBytesHex)(8);return{cancel:t=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,t)},promise:new Promise(((e,r)=>{this.relayEventManager.callbacks.set(n,(t=>{if(t.errorMessage)return r(new Error(t.errorMessage));e(t)}));this.ui.selectProvider&&this.ui.selectProvider({onApprove:t=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:n,response:(0,ig.SelectProviderResponse)(t)}))},onCancel:t=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:n,response:(0,ig.SelectProviderResponse)(Yy.ProviderType.Unselected)}))},providerOptions:t})}))}}watchAsset(t,e,n,r,i,s){const o={method:eg.Web3Method.watchAsset,params:{type:t,options:{address:e,symbol:n,decimals:r,image:i},chainId:s}};let a=null;const u=(0,Jy.randomBytesHex)(8),c=t=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,t),null==a||a()};this.ui.inlineWatchAsset()||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:c,onResetConnection:this.resetAndReload}));return{cancel:c,promise:new Promise(((c,l)=>{this.relayEventManager.callbacks.set(u,(t=>{if(null==a||a(),t.errorMessage)return l(new Error(t.errorMessage));c(t)}));const h=t=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:u,response:(0,ig.WatchAssetReponse)(!1)}))},d=()=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:u,response:(0,ig.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:d,onCancel:h,type:t,address:e,symbol:n,decimals:r,image:i,chainId:s}),this.ui.inlineWatchAsset()||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,o)}))}}addEthereumChain(t,e,n,r,i,s){const o={method:eg.Web3Method.addEthereumChain,params:{chainId:t,rpcUrls:e,blockExplorerUrls:r,chainName:i,iconUrls:n,nativeCurrency:s}};let a=null;const u=(0,Jy.randomBytesHex)(8),c=t=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,t),null==a||a()};this.ui.inlineAddEthereumChain(t)||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:c,onResetConnection:this.resetAndReload}));return{promise:new Promise(((e,n)=>{this.relayEventManager.callbacks.set(u,(t=>{if(null==a||a(),t.errorMessage)return n(new Error(t.errorMessage));e(t)}));const r=t=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:u,response:(0,ig.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},i=t=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:u,response:(0,ig.AddEthereumChainResponse)({isApproved:!0,rpcUrl:t})}))};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:r,onApprove:i,chainId:o.params.chainId,rpcUrls:o.params.rpcUrls,blockExplorerUrls:o.params.blockExplorerUrls,chainName:o.params.chainName,iconUrls:o.params.iconUrls,nativeCurrency:o.params.nativeCurrency}),this.ui.inlineAddEthereumChain(t)||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,o)})),cancel:c}}switchEthereumChain(t,e){const n={method:eg.Web3Method.switchEthereumChain,params:Object.assign({chainId:t},{address:e})},r=(0,Jy.randomBytesHex)(8);return{promise:new Promise(((t,e)=>{this.relayEventManager.callbacks.set(r,(n=>n.errorMessage&&n.errorCode?e(zy.ethErrors.provider.custom({code:n.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):n.errorMessage?e(new Error(n.errorMessage)):void t(n)));this.ui.switchEthereumChain({onCancel:t=>{if("number"==typeof t){const e=t;this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:r,response:(0,ig.ErrorResponse)(eg.Web3Method.switchEthereumChain,Qy.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,e)}))}else t instanceof Qy.WalletUIError?this.handleErrorResponse(r,eg.Web3Method.switchEthereumChain,t,t.errorCode):this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:r,response:(0,ig.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:t=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:r,response:(0,ig.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:t})}))},chainId:n.params.chainId,address:n.params.address}),this.ui.inlineSwitchEthereumChain()||this.ui.isStandalone()||this.publishWeb3RequestEvent(r,n)})),cancel:t=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,n.method,t)}}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return Xy.Session.hash(this._session.id)}sendRequestStandalone(t,e){const n=n=>{this.handleErrorResponse(t,e.method,n)},r=e=>{this.handleWeb3ResponseMessage((0,sg.Web3ResponseMessage)({id:t,response:e}))};switch(e.method){case eg.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:e,onSuccess:r,onCancel:n});break;case eg.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:e,onSuccess:r,onCancel:n});break;case eg.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:e,onSuccess:r,onCancel:n});break;case eg.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:e,onSuccess:r});break;default:n()}}onSessionConfigChanged(t){}}og.accountRequestCallbackIds=new Set,Wy([Vy.default],og.prototype,"resetAndReload",null),Wy([Vy.default],og.prototype,"handleIncomingEvent",null),bf.WalletSDKRelay=og;var ag={};Object.defineProperty(ag,"__esModule",{value:!0}),ag.WalletSDKRelayEventManager=void 0;const ug=Jt;ag.WalletSDKRelayEventManager=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,e=(0,ug.prepend0x)(t.toString(16));return this.callbacks.get(e)&&this.callbacks.delete(e),t}};var cg="3.6.6";Object.defineProperty(y,"__esModule",{value:!0}),y.CoinbaseWalletSDK=void 0;const lg=g,hg=m,dg=v,fg=Na,pg=bf,bg=ag,yg=Jt,gg=process.env.LINK_API_URL||"https://www.walletlink.org",mg=process.env.SDK_VERSION||cg||"unknown";class vg{constructor(t){var e,n,r;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=t.linkAPIUrl||gg;let s;if(s=t.uiConstructor?t.uiConstructor:t=>new fg.WalletSDKUI(t),void 0===t.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(e=t.overrideIsCoinbaseWallet)||void 0===e||e,this._overrideIsCoinbaseBrowser=null!==(n=t.overrideIsCoinbaseBrowser)&&void 0!==n&&n,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this._diagnosticLogger={log:t.eventListener.onEvent}:this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=null===(r=t.reloadOnDisconnect)||void 0===r||r;const o=new URL(i),a=`${o.protocol}//${o.host}`;this._storage=new hg.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",vg.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new bg.WalletSDKRelayEventManager,this._relay=new pg.WalletSDKRelay({linkAPIUrl:i,version:mg,darkMode:!!t.darkMode,uiConstructor:s,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(t.appName,t.appLogoUrl),t.headlessMode||this._relay.attachUI())}makeWeb3Provider(t="",e=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,e),!1===this._reloadOnDisconnect&&"function"==typeof n.disableReloadOnDisconnect&&n.disableReloadOnDisconnect(),n;const r=this.coinbaseBrowser;if(r)return r;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||i.setConnectDisabled(!0),new dg.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:e,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,e){var n;this._appName=t||"DApp",this._appLogoUrl=e||(0,yg.getFavicon)();const r=this.walletExtension;r?this.isCipherProvider(r)||r.setAppInfo(this._appName,this._appLogoUrl):null===(n=this._relay)||void 0===n||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const e=this.walletExtension;e?e.close():null===(t=this._relay)||void 0===t||t.resetAndReload()}getQrUrl(){var t,e;return null!==(e=null===(t=this._relay)||void 0===t?void 0:t.getQRCodeUrl())&&void 0!==e?e:null}getCoinbaseWalletLogo(t,e=240){return(0,lg.walletLogo)(t,e)}get walletExtension(){var t;return null!==(t=window.coinbaseWalletExtension)&&void 0!==t?t:window.walletLinkExtension}get coinbaseBrowser(){var t,e;try{const n=null!==(t=window.ethereum)&&void 0!==t?t:null===(e=window.top)||void 0===e?void 0:e.ethereum;if(!n)return;return"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch(t){return}}isCipherProvider(t){return"boolean"==typeof t.isCipher&&t.isCipher}}y.CoinbaseWalletSDK=vg,vg.VERSION=mg,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=y,n=v;var r=y;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}});var i=v;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,"undefined"!=typeof window&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=n.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=n.CoinbaseWalletProvider)}(b);var _g=e.getDefaultExportFromCjs(b);exports.default=function(e,n){var r=e.chainId,i=e.rpcUrl,s=e.appName,o=e.appLogoUrl,a=e.darkMode;return t.__awaiter(this,void 0,void 0,(function(){var e,u;return t.__generator(this,(function(c){switch(c.label){case 0:if(window.ethereum&&(window.ethereum.isWalletLink||window.ethereum.isToshi))return[2,t.injectedConnect(window.ethereum,n)];if(!s)throw new Error("walletLink need appName");return e=new _g({appName:s,appLogoUrl:o,darkMode:a}),[4,(u=e.makeWeb3Provider(i,r)).enable()];case 1:return c.sent(),u.on("connect",n.connect),u.on("disconnect",n.disconnect),u.on("accountsChanged",n.accountsChanged),u.on("chainChanged",n.chainChanged),u.on("message",n.message),[2,t.convertWeb3Provider(u)]}}))}))};