@xylabs/sdk-react 2.9.10 → 2.9.14

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 (300) hide show
  1. package/dist/calcSpacing.js +3 -3
  2. package/dist/calcSpacing.js.map +1 -1
  3. package/dist/cjs5/components/Portal/Portal.d.ts +3 -0
  4. package/dist/cjs5/components/Portal/PortalProps.d.ts +7 -0
  5. package/dist/cjs5/components/Portal/index.d.ts +2 -0
  6. package/dist/cjs5/components/index.d.ts +1 -0
  7. package/dist/cjs5/index.js +1144 -1651
  8. package/dist/cjs5/index.js.map +1 -1
  9. package/dist/components/AppBarEx/AppBarEx.js +7 -7
  10. package/dist/components/AppBarEx/AppBarEx.js.map +1 -1
  11. package/dist/components/AppBarEx/AppBarEx.stories.js +3 -4
  12. package/dist/components/AppBarEx/AppBarEx.stories.js.map +1 -1
  13. package/dist/components/Background.js +2 -3
  14. package/dist/components/Background.js.map +1 -1
  15. package/dist/components/BasePage/BasePage.js +7 -6
  16. package/dist/components/BasePage/BasePage.js.map +1 -1
  17. package/dist/components/BasePage/BasePage.stories.js +5 -6
  18. package/dist/components/BasePage/BasePage.stories.js.map +1 -1
  19. package/dist/components/Breadcrumbs/BreadcrumbsEx.js +12 -12
  20. package/dist/components/Breadcrumbs/BreadcrumbsEx.js.map +1 -1
  21. package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js +4 -5
  22. package/dist/components/Breadcrumbs/BreadcrumbsEx.stories.js.map +1 -1
  23. package/dist/components/BusyCircularProgress.js +5 -5
  24. package/dist/components/BusyCircularProgress.js.map +1 -1
  25. package/dist/components/BusyLinearProgress.js +5 -5
  26. package/dist/components/BusyLinearProgress.js.map +1 -1
  27. package/dist/components/ButtonEx/ButtonEx.js +5 -5
  28. package/dist/components/ButtonEx/ButtonEx.js.map +1 -1
  29. package/dist/components/ButtonEx/ButtonEx.stories.js +5 -6
  30. package/dist/components/ButtonEx/ButtonEx.stories.js.map +1 -1
  31. package/dist/components/ButtonEx/ButtonExBase.js +6 -6
  32. package/dist/components/ButtonEx/ButtonExBase.js.map +1 -1
  33. package/dist/components/ButtonEx/ButtonExTo.js +6 -6
  34. package/dist/components/ButtonEx/ButtonExTo.js.map +1 -1
  35. package/dist/components/CookieConsent/CookieConsent.js +5 -6
  36. package/dist/components/CookieConsent/CookieConsent.js.map +1 -1
  37. package/dist/components/CookieConsent/CookieConsent.stories.js +10 -11
  38. package/dist/components/CookieConsent/CookieConsent.stories.js.map +1 -1
  39. package/dist/components/CookieConsent/CookieConsentBody.js +11 -11
  40. package/dist/components/CookieConsent/CookieConsentBody.js.map +1 -1
  41. package/dist/components/CoverProgress.js +4 -5
  42. package/dist/components/CoverProgress.js.map +1 -1
  43. package/dist/components/Errors/ErrorViewer.js +5 -5
  44. package/dist/components/Errors/ErrorViewer.js.map +1 -1
  45. package/dist/components/Errors/ErrorViewer.stories.js +3 -4
  46. package/dist/components/Errors/ErrorViewer.stories.js.map +1 -1
  47. package/dist/components/Errors/ErrorsViewer.js +5 -5
  48. package/dist/components/Errors/ErrorsViewer.js.map +1 -1
  49. package/dist/components/Errors/ErrorsViewer.stories.js +3 -4
  50. package/dist/components/Errors/ErrorsViewer.stories.js.map +1 -1
  51. package/dist/components/EthAccount/EthAccount.js +12 -12
  52. package/dist/components/EthAccount/EthAccount.js.map +1 -1
  53. package/dist/components/EthAccount/EthAccount.stories.js +8 -9
  54. package/dist/components/EthAccount/EthAccount.stories.js.map +1 -1
  55. package/dist/components/EthBlock.js +3 -4
  56. package/dist/components/EthBlock.js.map +1 -1
  57. package/dist/components/Experiments/Experiment.js +2 -2
  58. package/dist/components/Experiments/Experiment.js.map +1 -1
  59. package/dist/components/Experiments/Experiments.js +43 -66
  60. package/dist/components/Experiments/Experiments.js.map +1 -1
  61. package/dist/components/Experiments/Experiments.stories.js +5 -6
  62. package/dist/components/Experiments/Experiments.stories.js.map +1 -1
  63. package/dist/components/Experiments/ExperimentsDebugger.js +20 -22
  64. package/dist/components/Experiments/ExperimentsDebugger.js.map +1 -1
  65. package/dist/components/Experiments/ExperimentsDebugger.stories.js +3 -4
  66. package/dist/components/Experiments/ExperimentsDebugger.stories.js.map +1 -1
  67. package/dist/components/Experiments/models/index.js +2 -2
  68. package/dist/components/Experiments/models/index.js.map +1 -1
  69. package/dist/components/FlexBox/BusyBox.js +6 -6
  70. package/dist/components/FlexBox/BusyBox.js.map +1 -1
  71. package/dist/components/FlexBox/BusyBox.stories.js +7 -8
  72. package/dist/components/FlexBox/BusyBox.stories.js.map +1 -1
  73. package/dist/components/FlexBox/FlexCol.js +4 -5
  74. package/dist/components/FlexBox/FlexCol.js.map +1 -1
  75. package/dist/components/FlexBox/FlexCol.stories.js +10 -11
  76. package/dist/components/FlexBox/FlexCol.stories.js.map +1 -1
  77. package/dist/components/FlexBox/FlexRow.js +4 -5
  78. package/dist/components/FlexBox/FlexRow.js.map +1 -1
  79. package/dist/components/FlexBox/FlexRow.stories.js +14 -15
  80. package/dist/components/FlexBox/FlexRow.stories.js.map +1 -1
  81. package/dist/components/HoverScale.js +12 -15
  82. package/dist/components/HoverScale.js.map +1 -1
  83. package/dist/components/Identicon.js +22 -22
  84. package/dist/components/Identicon.js.map +1 -1
  85. package/dist/components/InvertableThemeProvider/InvertableThemeContext.js +1 -1
  86. package/dist/components/InvertableThemeProvider/InvertableThemeContext.js.map +1 -1
  87. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js +7 -9
  88. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.js.map +1 -1
  89. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js +3 -4
  90. package/dist/components/InvertableThemeProvider/InvertableThemeProvider.stories.js.map +1 -1
  91. package/dist/components/LinkEx/LinkToEx.js +4 -4
  92. package/dist/components/LinkEx/LinkToEx.js.map +1 -1
  93. package/dist/components/NumberStatus/NumberStatus.js +10 -10
  94. package/dist/components/NumberStatus/NumberStatus.js.map +1 -1
  95. package/dist/components/NumberStatus/NumberStatus.stories.js +11 -12
  96. package/dist/components/NumberStatus/NumberStatus.stories.js.map +1 -1
  97. package/dist/components/Portal/Portal.d.ts +3 -0
  98. package/dist/components/Portal/Portal.js +20 -0
  99. package/dist/components/Portal/Portal.js.map +1 -0
  100. package/dist/components/Portal/PortalProps.d.ts +7 -0
  101. package/dist/components/Portal/PortalProps.js +2 -0
  102. package/dist/components/Portal/PortalProps.js.map +1 -0
  103. package/dist/components/Portal/index.d.ts +2 -0
  104. package/dist/components/Portal/index.js +3 -0
  105. package/dist/components/Portal/index.js.map +1 -0
  106. package/dist/components/QuickTipButton/QuickTipButton.js +5 -5
  107. package/dist/components/QuickTipButton/QuickTipButton.js.map +1 -1
  108. package/dist/components/QuickTipButton/QuickTipButton.stories.js +3 -4
  109. package/dist/components/QuickTipButton/QuickTipButton.stories.js.map +1 -1
  110. package/dist/components/RedirectWithQuery.js +6 -8
  111. package/dist/components/RedirectWithQuery.js.map +1 -1
  112. package/dist/components/RichResult/RichResult.js +4 -5
  113. package/dist/components/RichResult/RichResult.js.map +1 -1
  114. package/dist/components/ScrollToTop.js +3 -3
  115. package/dist/components/ScrollToTop.js.map +1 -1
  116. package/dist/components/ScrollToTopButton.js +8 -8
  117. package/dist/components/ScrollToTopButton.js.map +1 -1
  118. package/dist/components/TokenAmount/TokenAmount.js +8 -8
  119. package/dist/components/TokenAmount/TokenAmount.js.map +1 -1
  120. package/dist/components/TokenAmount/TokenAmount.stories.js +9 -10
  121. package/dist/components/TokenAmount/TokenAmount.stories.js.map +1 -1
  122. package/dist/components/dialogs/ErrorDialog.js +12 -12
  123. package/dist/components/dialogs/ErrorDialog.js.map +1 -1
  124. package/dist/components/dialogs/ErrorDialog.stories.js +3 -4
  125. package/dist/components/dialogs/ErrorDialog.stories.js.map +1 -1
  126. package/dist/components/dialogs/MessageDialog.js +4 -4
  127. package/dist/components/dialogs/MessageDialog.js.map +1 -1
  128. package/dist/components/dialogs/MessageDialog.stories.js +3 -4
  129. package/dist/components/dialogs/MessageDialog.stories.js.map +1 -1
  130. package/dist/components/index.d.ts +1 -0
  131. package/dist/components/index.js +1 -0
  132. package/dist/components/index.js.map +1 -1
  133. package/dist/contexts/CookieConsent/Context.js +1 -1
  134. package/dist/contexts/CookieConsent/Context.js.map +1 -1
  135. package/dist/contexts/CookieConsent/Loader.js +8 -10
  136. package/dist/contexts/CookieConsent/Loader.js.map +1 -1
  137. package/dist/contexts/CookieConsent/use.js +1 -1
  138. package/dist/contexts/CookieConsent/use.js.map +1 -1
  139. package/dist/contexts/Ethers/Context.js +1 -1
  140. package/dist/contexts/Ethers/Context.js.map +1 -1
  141. package/dist/contexts/Ethers/Infura.js +8 -9
  142. package/dist/contexts/Ethers/Infura.js.map +1 -1
  143. package/dist/contexts/Ethers/Loader.js +3 -3
  144. package/dist/contexts/Ethers/Loader.js.map +1 -1
  145. package/dist/contexts/Ethers/MetaMask.js +73 -100
  146. package/dist/contexts/Ethers/MetaMask.js.map +1 -1
  147. package/dist/contexts/Ethers/MyEtherWallet.js +54 -80
  148. package/dist/contexts/Ethers/MyEtherWallet.js.map +1 -1
  149. package/dist/contexts/Ethers/Opera.js +39 -51
  150. package/dist/contexts/Ethers/Opera.js.map +1 -1
  151. package/dist/contexts/Ethers/Trust.js +30 -42
  152. package/dist/contexts/Ethers/Trust.js.map +1 -1
  153. package/dist/contexts/NetworkSettings/Context.js +1 -1
  154. package/dist/contexts/NetworkSettings/Context.js.map +1 -1
  155. package/dist/contexts/NetworkSettings/Loader.js +3 -4
  156. package/dist/contexts/NetworkSettings/Loader.js.map +1 -1
  157. package/dist/contexts/UserEvents/Context.js +1 -1
  158. package/dist/contexts/UserEvents/Context.js.map +1 -1
  159. package/dist/contexts/UserEvents/Loader.js +2 -4
  160. package/dist/contexts/UserEvents/Loader.js.map +1 -1
  161. package/dist/esm2015/components/Portal/Portal.d.ts +3 -0
  162. package/dist/esm2015/components/Portal/PortalProps.d.ts +7 -0
  163. package/dist/esm2015/components/Portal/index.d.ts +2 -0
  164. package/dist/esm2015/components/index.d.ts +1 -0
  165. package/dist/esm2015/index.js +1144 -1652
  166. package/dist/esm2015/index.js.map +1 -1
  167. package/dist/esm2017/components/Portal/Portal.d.ts +3 -0
  168. package/dist/esm2017/components/Portal/PortalProps.d.ts +7 -0
  169. package/dist/esm2017/components/Portal/index.d.ts +2 -0
  170. package/dist/esm2017/components/index.d.ts +1 -0
  171. package/dist/esm2017/index.js +1144 -1652
  172. package/dist/esm2017/index.js.map +1 -1
  173. package/dist/esm5/components/Portal/Portal.d.ts +3 -0
  174. package/dist/esm5/components/Portal/PortalProps.d.ts +7 -0
  175. package/dist/esm5/components/Portal/index.d.ts +2 -0
  176. package/dist/esm5/components/index.d.ts +1 -0
  177. package/dist/esm5/index.js +1144 -1652
  178. package/dist/esm5/index.js.map +1 -1
  179. package/dist/hooks/useBreakpoint.js +7 -7
  180. package/dist/hooks/useBreakpoint.js.map +1 -1
  181. package/dist/hooks/useLocalStorage.js +5 -6
  182. package/dist/hooks/useLocalStorage.js.map +1 -1
  183. package/dist/hooks/useMounted.js +5 -6
  184. package/dist/hooks/useMounted.js.map +1 -1
  185. package/dist/hooks/useNavigateToEthAddress.js +7 -7
  186. package/dist/hooks/useNavigateToEthAddress.js.map +1 -1
  187. package/dist/hooks/useSpacing.js +2 -2
  188. package/dist/hooks/useSpacing.js.map +1 -1
  189. package/dist/hooks/useUserEvents.js +2 -2
  190. package/dist/hooks/useUserEvents.js.map +1 -1
  191. package/dist/hooks/useWebP.js +19 -32
  192. package/dist/hooks/useWebP.js.map +1 -1
  193. package/dist/hooks/useWindowSize.js +4 -5
  194. package/dist/hooks/useWindowSize.js.map +1 -1
  195. package/dist/lib/Tracking/Drip/BaseEvent.js +18 -28
  196. package/dist/lib/Tracking/Drip/BaseEvent.js.map +1 -1
  197. package/dist/lib/Tracking/Drip/CustomEvent.js +2 -8
  198. package/dist/lib/Tracking/Drip/CustomEvent.js.map +1 -1
  199. package/dist/lib/Tracking/Drip/StandardEvents.js +4 -7
  200. package/dist/lib/Tracking/Drip/StandardEvents.js.map +1 -1
  201. package/dist/lib/Tracking/Facebook/BaseEvent.js +8 -16
  202. package/dist/lib/Tracking/Facebook/BaseEvent.js.map +1 -1
  203. package/dist/lib/Tracking/Facebook/CustomEvent.js +8 -21
  204. package/dist/lib/Tracking/Facebook/CustomEvent.js.map +1 -1
  205. package/dist/lib/Tracking/Facebook/Fbq.js +11 -13
  206. package/dist/lib/Tracking/Facebook/Fbq.js.map +1 -1
  207. package/dist/lib/Tracking/Facebook/StandardEvent.js +8 -21
  208. package/dist/lib/Tracking/Facebook/StandardEvent.js.map +1 -1
  209. package/dist/lib/Tracking/Facebook/StandardEvents.js +38 -42
  210. package/dist/lib/Tracking/Facebook/StandardEvents.js.map +1 -1
  211. package/dist/lib/Tracking/Facebook/UserEventHandler.js +23 -54
  212. package/dist/lib/Tracking/Facebook/UserEventHandler.js.map +1 -1
  213. package/dist/lib/Tracking/Google/BaseEvent.js +23 -45
  214. package/dist/lib/Tracking/Google/BaseEvent.js.map +1 -1
  215. package/dist/lib/Tracking/Google/CustomEvent.js +2 -8
  216. package/dist/lib/Tracking/Google/CustomEvent.js.map +1 -1
  217. package/dist/lib/Tracking/Google/Gtag.js +37 -41
  218. package/dist/lib/Tracking/Google/Gtag.js.map +1 -1
  219. package/dist/lib/Tracking/Google/Gtm.js +18 -21
  220. package/dist/lib/Tracking/Google/Gtm.js.map +1 -1
  221. package/dist/lib/Tracking/Google/StandardEvent.js +2 -8
  222. package/dist/lib/Tracking/Google/StandardEvent.js.map +1 -1
  223. package/dist/lib/Tracking/Google/StandardEvents.js +62 -66
  224. package/dist/lib/Tracking/Google/StandardEvents.js.map +1 -1
  225. package/dist/lib/Tracking/Google/UserEventHandler.js +23 -54
  226. package/dist/lib/Tracking/Google/UserEventHandler.js.map +1 -1
  227. package/dist/lib/Tracking/Reddit/BaseEvent.js +8 -16
  228. package/dist/lib/Tracking/Reddit/BaseEvent.js.map +1 -1
  229. package/dist/lib/Tracking/Reddit/CustomEvent.js +8 -21
  230. package/dist/lib/Tracking/Reddit/CustomEvent.js.map +1 -1
  231. package/dist/lib/Tracking/Reddit/Rdt.js +11 -15
  232. package/dist/lib/Tracking/Reddit/Rdt.js.map +1 -1
  233. package/dist/lib/Tracking/Reddit/StandardEvent.js +8 -21
  234. package/dist/lib/Tracking/Reddit/StandardEvent.js.map +1 -1
  235. package/dist/lib/Tracking/Reddit/StandardEvents.js +18 -21
  236. package/dist/lib/Tracking/Reddit/StandardEvents.js.map +1 -1
  237. package/dist/lib/Tracking/Referrer.js +12 -13
  238. package/dist/lib/Tracking/Referrer.js.map +1 -1
  239. package/dist/lib/Tracking/Snapchat/BaseEvent.js +8 -16
  240. package/dist/lib/Tracking/Snapchat/BaseEvent.js.map +1 -1
  241. package/dist/lib/Tracking/Snapchat/Snaptr.js +10 -21
  242. package/dist/lib/Tracking/Snapchat/Snaptr.js.map +1 -1
  243. package/dist/lib/Tracking/Snapchat/StandardEvent.js +7 -19
  244. package/dist/lib/Tracking/Snapchat/StandardEvent.js.map +1 -1
  245. package/dist/lib/Tracking/Snapchat/StandardEvents.js +60 -64
  246. package/dist/lib/Tracking/Snapchat/StandardEvents.js.map +1 -1
  247. package/dist/lib/Tracking/Tiktok/BaseEvent.js +8 -16
  248. package/dist/lib/Tracking/Tiktok/BaseEvent.js.map +1 -1
  249. package/dist/lib/Tracking/Tiktok/CustomEvent.js +8 -21
  250. package/dist/lib/Tracking/Tiktok/CustomEvent.js.map +1 -1
  251. package/dist/lib/Tracking/Tiktok/StandardEvent.js +8 -21
  252. package/dist/lib/Tracking/Tiktok/StandardEvent.js.map +1 -1
  253. package/dist/lib/Tracking/Tiktok/StandardEvents.js +34 -38
  254. package/dist/lib/Tracking/Tiktok/StandardEvents.js.map +1 -1
  255. package/dist/lib/Tracking/Tiktok/Ttq.js +14 -18
  256. package/dist/lib/Tracking/Tiktok/Ttq.js.map +1 -1
  257. package/dist/lib/Tracking/Xy/BaseEvent.js +8 -16
  258. package/dist/lib/Tracking/Xy/BaseEvent.js.map +1 -1
  259. package/dist/lib/Tracking/Xy/CustomEvent.js +2 -8
  260. package/dist/lib/Tracking/Xy/CustomEvent.js.map +1 -1
  261. package/dist/lib/Tracking/Xy/StandardEvent.js +2 -8
  262. package/dist/lib/Tracking/Xy/StandardEvent.js.map +1 -1
  263. package/dist/lib/Tracking/Xy/UserEventHandler.js +23 -54
  264. package/dist/lib/Tracking/Xy/UserEventHandler.js.map +1 -1
  265. package/dist/lib/Tracking/XyoUserEventHandler.js +22 -54
  266. package/dist/lib/Tracking/XyoUserEventHandler.js.map +1 -1
  267. package/dist/lib/getApiStage.js +1 -1
  268. package/dist/lib/getApiStage.js.map +1 -1
  269. package/dist/lib/global.js +1 -1
  270. package/dist/lib/global.js.map +1 -1
  271. package/dist/lib/isLocalHost.js +1 -1
  272. package/dist/lib/isLocalHost.js.map +1 -1
  273. package/dist/lib/profile.js +13 -22
  274. package/dist/lib/profile.js.map +1 -1
  275. package/dist/lib/safeLocalStorage.js +3 -3
  276. package/dist/lib/safeLocalStorage.js.map +1 -1
  277. package/dist/lib/safeSessionStorage.js +3 -3
  278. package/dist/lib/safeSessionStorage.js.map +1 -1
  279. package/dist/lib/useAsyncEffect.js +5 -5
  280. package/dist/lib/useAsyncEffect.js.map +1 -1
  281. package/dist/mergeBoxlikeStyles.js +19 -5
  282. package/dist/mergeBoxlikeStyles.js.map +1 -1
  283. package/dist/node/components/Portal/Portal.d.ts +3 -0
  284. package/dist/node/components/Portal/PortalProps.d.ts +7 -0
  285. package/dist/node/components/Portal/index.d.ts +2 -0
  286. package/dist/node/components/index.d.ts +1 -0
  287. package/dist/node/index.js +1144 -1651
  288. package/dist/node/index.js.map +1 -1
  289. package/dist/node-esm/components/Portal/Portal.d.ts +3 -0
  290. package/dist/node-esm/components/Portal/PortalProps.d.ts +7 -0
  291. package/dist/node-esm/components/Portal/index.d.ts +2 -0
  292. package/dist/node-esm/components/index.d.ts +1 -0
  293. package/dist/node-esm/index.js +1144 -1652
  294. package/dist/node-esm/index.js.map +1 -1
  295. package/package.json +13 -12
  296. package/src/components/BasePage/BasePage.tsx +2 -0
  297. package/src/components/Portal/Portal.tsx +23 -0
  298. package/src/components/Portal/PortalProps.ts +6 -0
  299. package/src/components/Portal/index.ts +2 -0
  300. package/src/components/index.ts +1 -0
@@ -15,6 +15,7 @@ import { parse, stringify } from 'query-string';
15
15
  import { createTheme } from '@mui/material/styles';
16
16
  import clone from 'lodash/clone';
17
17
  import numeral from 'numeral';
18
+ import { createPortal } from 'react-dom';
18
19
 
19
20
  /*! *****************************************************************************
20
21
  Copyright (c) Microsoft Corporation.
@@ -30,33 +31,6 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
30
31
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
31
32
  PERFORMANCE OF THIS SOFTWARE.
32
33
  ***************************************************************************** */
33
- /* global Reflect, Promise */
34
-
35
- var extendStatics = function(d, b) {
36
- extendStatics = Object.setPrototypeOf ||
37
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
38
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
39
- return extendStatics(d, b);
40
- };
41
-
42
- function __extends(d, b) {
43
- if (typeof b !== "function" && b !== null)
44
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
45
- extendStatics(d, b);
46
- function __() { this.constructor = d; }
47
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
48
- }
49
-
50
- var __assign = function() {
51
- __assign = Object.assign || function __assign(t) {
52
- for (var s, i = 1, n = arguments.length; i < n; i++) {
53
- s = arguments[i];
54
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
55
- }
56
- return t;
57
- };
58
- return __assign.apply(this, arguments);
59
- };
60
34
 
61
35
  function __rest(s, e) {
62
36
  var t = {};
@@ -78,176 +52,107 @@ function __awaiter(thisArg, _arguments, P, generator) {
78
52
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
79
53
  step((generator = generator.apply(thisArg, _arguments || [])).next());
80
54
  });
81
- }
82
-
83
- function __generator(thisArg, body) {
84
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
85
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
86
- function verb(n) { return function (v) { return step([n, v]); }; }
87
- function step(op) {
88
- if (f) throw new TypeError("Generator is already executing.");
89
- while (_) try {
90
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
91
- if (y = 0, t) op = [op[0] & 2, t.value];
92
- switch (op[0]) {
93
- case 0: case 1: t = op; break;
94
- case 4: _.label++; return { value: op[1], done: false };
95
- case 5: _.label++; y = op[1]; op = [0]; continue;
96
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
97
- default:
98
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
99
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
100
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
101
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
102
- if (t[2]) _.ops.pop();
103
- _.trys.pop(); continue;
104
- }
105
- op = body.call(thisArg, _);
106
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
107
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
108
- }
109
- }
110
-
111
- function __values(o) {
112
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
113
- if (m) return m.call(o);
114
- if (o && typeof o.length === "number") return {
115
- next: function () {
116
- if (o && i >= o.length) o = void 0;
117
- return { value: o && o[i++], done: !o };
118
- }
119
- };
120
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
121
- }
122
-
123
- function __read(o, n) {
124
- var m = typeof Symbol === "function" && o[Symbol.iterator];
125
- if (!m) return o;
126
- var i = m.call(o), r, ar = [], e;
127
- try {
128
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
129
- }
130
- catch (error) { e = { error: error }; }
131
- finally {
132
- try {
133
- if (r && !r.done && (m = i["return"])) m.call(i);
134
- }
135
- finally { if (e) throw e.error; }
136
- }
137
- return ar;
138
- }
139
-
140
- function __spreadArray(to, from, pack) {
141
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
142
- if (ar || !(i in from)) {
143
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
144
- ar[i] = from[i];
145
- }
146
- }
147
- return to.concat(ar || Array.prototype.slice.call(from));
148
55
  }
149
56
 
150
- var BusyCircularProgress = function (_a) {
151
- var bgcolor = _a.bgcolor, style = _a.style, rounded = _a.rounded, size = _a.size, _b = _a.opacity, opacity = _b === void 0 ? 0.85 : _b, props = __rest(_a, ["bgcolor", "style", "rounded", "size", "opacity"]);
152
- var theme = useTheme();
153
- return (jsx(Box, __assign({ display: "flex", bgcolor: alpha(bgcolor !== null && bgcolor !== void 0 ? bgcolor : theme.palette.background.default, parseFloat("".concat(opacity))), flexGrow: 1, position: "absolute", left: 0, right: 0, top: 0, bottom: 0, justifyContent: "center", alignItems: "center", overflow: "hidden", style: __assign({ borderRadius: rounded ? theme.shape.borderRadius : 0 }, style) }, { children: jsx(CircularProgress, __assign({ size: size }, props), void 0) }), void 0));
57
+ const BusyCircularProgress = (_a) => {
58
+ var { bgcolor, style, rounded, size, opacity = 0.85 } = _a, props = __rest(_a, ["bgcolor", "style", "rounded", "size", "opacity"]);
59
+ const theme = useTheme();
60
+ return (jsx(Box, Object.assign({ display: "flex", bgcolor: alpha(bgcolor !== null && bgcolor !== void 0 ? bgcolor : theme.palette.background.default, parseFloat(`${opacity}`)), flexGrow: 1, position: "absolute", left: 0, right: 0, top: 0, bottom: 0, justifyContent: "center", alignItems: "center", overflow: "hidden", style: Object.assign({ borderRadius: rounded ? theme.shape.borderRadius : 0 }, style) }, { children: jsx(CircularProgress, Object.assign({ size: size }, props), void 0) }), void 0));
154
61
  };
155
62
 
156
- var BusyLinearProgress = function (_a) {
157
- var bgcolor = _a.bgcolor, style = _a.style, rounded = _a.rounded, _b = _a.opacity, opacity = _b === void 0 ? 0.85 : _b, props = __rest(_a, ["bgcolor", "style", "rounded", "opacity"]);
158
- var theme = useTheme();
159
- return (jsx(Box, __assign({ display: "flex", flexDirection: "column", bgcolor: alpha(bgcolor !== null && bgcolor !== void 0 ? bgcolor : theme.palette.background.default, parseFloat("".concat(opacity))), position: "absolute", left: 0, right: 0, top: 0, bottom: 0, justifyContent: "flex-start", alignItems: "stretch", overflow: "hidden", style: __assign({ borderRadius: rounded ? theme.shape.borderRadius : 0 }, style) }, { children: jsx(LinearProgress, __assign({}, props), void 0) }), void 0));
63
+ const BusyLinearProgress = (_a) => {
64
+ var { bgcolor, style, rounded, opacity = 0.85 } = _a, props = __rest(_a, ["bgcolor", "style", "rounded", "opacity"]);
65
+ const theme = useTheme();
66
+ return (jsx(Box, Object.assign({ display: "flex", flexDirection: "column", bgcolor: alpha(bgcolor !== null && bgcolor !== void 0 ? bgcolor : theme.palette.background.default, parseFloat(`${opacity}`)), position: "absolute", left: 0, right: 0, top: 0, bottom: 0, justifyContent: "flex-start", alignItems: "stretch", overflow: "hidden", style: Object.assign({ borderRadius: rounded ? theme.shape.borderRadius : 0 }, style) }, { children: jsx(LinearProgress, Object.assign({}, props), void 0) }), void 0));
160
67
  };
161
68
 
162
- var BusyBox = function (_a) {
163
- var background = _a.background, children = _a.children, component = _a.component, _b = _a.busyVariant, busyVariant = _b === void 0 ? 'circular' : _b, busySize = _a.busySize, _c = _a.busyOpacity, busyOpacity = _c === void 0 ? 0.85 : _c, busyColor = _a.busyColor, busy = _a.busy, busyCircularProps = _a.busyCircularProps, busyLinearProps = _a.busyLinearProps, paper = _a.paper, style = _a.style, props = __rest(_a, ["background", "children", "component", "busyVariant", "busySize", "busyOpacity", "busyColor", "busy", "busyCircularProps", "busyLinearProps", "paper", "style"]);
164
- var theme = useTheme();
165
- return (jsxs(Box, __assign({ component: paper ? Paper : component, position: "relative", style: background
166
- ? __assign({ backgroundColor: theme.palette.background.default, color: theme.palette.text.primary }, style) : style }, props, { children: [children, busy && busyVariant === 'linear' ? (jsx(BusyLinearProgress, __assign({ color: busyColor, opacity: busyOpacity }, busyLinearProps), void 0)) : null, busy && busyVariant === 'circular' ? (jsx(BusyCircularProgress, __assign({ color: busyColor, opacity: busyOpacity, size: busySize }, busyCircularProps), void 0)) : null] }), void 0));
69
+ const BusyBox = (_a) => {
70
+ var { background, children, component, busyVariant = 'circular', busySize, busyOpacity = 0.85, busyColor, busy, busyCircularProps, busyLinearProps, paper, style } = _a, props = __rest(_a, ["background", "children", "component", "busyVariant", "busySize", "busyOpacity", "busyColor", "busy", "busyCircularProps", "busyLinearProps", "paper", "style"]);
71
+ const theme = useTheme();
72
+ return (jsxs(Box, Object.assign({ component: paper ? Paper : component, position: "relative", style: background
73
+ ? Object.assign({ backgroundColor: theme.palette.background.default, color: theme.palette.text.primary }, style) : style }, props, { children: [children, busy && busyVariant === 'linear' ? (jsx(BusyLinearProgress, Object.assign({ color: busyColor, opacity: busyOpacity }, busyLinearProps), void 0)) : null, busy && busyVariant === 'circular' ? (jsx(BusyCircularProgress, Object.assign({ color: busyColor, opacity: busyOpacity, size: busySize }, busyCircularProps), void 0)) : null] }), void 0));
167
74
  };
168
75
 
169
- var FlexCol = function (props) {
170
- return jsx(BusyBox, __assign({ alignItems: "center", display: "flex", flexDirection: "column", justifyContent: "center" }, props), void 0);
76
+ const FlexCol = (props) => {
77
+ return jsx(BusyBox, Object.assign({ alignItems: "center", display: "flex", flexDirection: "column", justifyContent: "center" }, props), void 0);
171
78
  };
172
- var FlexGrowCol = function (props) {
173
- return jsx(FlexCol, __assign({ flexGrow: 1 }, props), void 0);
79
+ const FlexGrowCol = (props) => {
80
+ return jsx(FlexCol, Object.assign({ flexGrow: 1 }, props), void 0);
174
81
  };
175
82
 
176
- var FlexRow = function (props) {
177
- return jsx(BusyBox, __assign({ alignItems: "center", display: "flex", flexDirection: "row", justifyContent: "center" }, props), void 0);
83
+ const FlexRow = (props) => {
84
+ return jsx(BusyBox, Object.assign({ alignItems: "center", display: "flex", flexDirection: "row", justifyContent: "center" }, props), void 0);
178
85
  };
179
- var FlexGrowRow = function (props) {
180
- return jsx(FlexRow, __assign({ flexGrow: 1 }, props), void 0);
86
+ const FlexGrowRow = (props) => {
87
+ return jsx(FlexRow, Object.assign({ flexGrow: 1 }, props), void 0);
181
88
  };
182
89
 
183
90
  /**
184
91
  * @deprecated The functionality of Background is now part of FlexBox. Use the 'background' property to enable the background.
185
92
  */
186
- var Background = function (props) {
187
- return jsx(FlexRow, __assign({}, props), void 0);
93
+ const Background = (props) => {
94
+ return jsx(FlexRow, Object.assign({}, props), void 0);
188
95
  };
189
96
 
190
- var ErrorViewer = function (props) {
191
- var error = props.error, boxProps = __rest(props, ["error"]);
192
- var theme = useTheme();
193
- return (jsxs(FlexCol, __assign({ color: theme.palette.error.main }, boxProps, { children: [jsx(Typography, __assign({ align: "center", variant: "subtitle1" }, { children: error === null || error === void 0 ? void 0 : error.name }), void 0), jsx(Typography, __assign({ align: "center", variant: "body2" }, { children: error === null || error === void 0 ? void 0 : error.message }), void 0)] }), void 0));
97
+ const ErrorViewer = (props) => {
98
+ const { error } = props, boxProps = __rest(props, ["error"]);
99
+ const theme = useTheme();
100
+ return (jsxs(FlexCol, Object.assign({ color: theme.palette.error.main }, boxProps, { children: [jsx(Typography, Object.assign({ align: "center", variant: "subtitle1" }, { children: error === null || error === void 0 ? void 0 : error.name }), void 0), jsx(Typography, Object.assign({ align: "center", variant: "body2" }, { children: error === null || error === void 0 ? void 0 : error.message }), void 0)] }), void 0));
194
101
  };
195
102
 
196
- var ErrorsViewer = function (props) {
197
- var onRetry = props.onRetry, errors = props.errors, boxProps = __rest(props, ["onRetry", "errors"]);
198
- return (jsxs(FlexGrowCol, __assign({ padding: 1 }, boxProps, { children: [errors === null || errors === void 0 ? void 0 : errors.map(function (error, index) {
103
+ const ErrorsViewer = (props) => {
104
+ const { onRetry, errors } = props, boxProps = __rest(props, ["onRetry", "errors"]);
105
+ return (jsxs(FlexGrowCol, Object.assign({ padding: 1 }, boxProps, { children: [errors === null || errors === void 0 ? void 0 : errors.map((error, index) => {
199
106
  return jsx(ErrorViewer, { error: error }, index);
200
- }), onRetry ? (jsx(IconButton, __assign({ onClick: onRetry }, { children: jsx(AiOutlineReload, {}, void 0) }), void 0)) : null] }), void 0));
107
+ }), onRetry ? (jsx(IconButton, Object.assign({ onClick: onRetry }, { children: jsx(AiOutlineReload, {}, void 0) }), void 0)) : null] }), void 0));
201
108
  };
202
109
 
203
- var CoverProgress = function (props) {
110
+ const CoverProgress = (props) => {
204
111
  var _a;
205
- var _b = props.paper, paper = _b === void 0 ? true : _b, open = props.open, _c = props.opacity, opacity = _c === void 0 ? 0.25 : _c, errors = props.errors, onRetry = props.onRetry;
206
- var theme = useTheme();
112
+ const { paper = true, open, opacity = 0.25, errors, onRetry } = props;
113
+ const theme = useTheme();
207
114
  if (open) {
208
- return (jsx(FlexGrowRow, __assign({ position: "absolute", margin: -1, top: 0, bottom: 0, right: 0, left: 0, bgcolor: paper ? theme.palette.background.paper : theme.palette.background.default }, { children: ((_a = errors === null || errors === void 0 ? void 0 : errors.length) !== null && _a !== void 0 ? _a : 0) === 0 ? (jsx(CircularProgress, { style: { opacity: opacity } }, void 0)) : (jsx(ErrorsViewer, { margin: 1, errors: errors, onRetry: onRetry }, void 0)) }), void 0));
115
+ return (jsx(FlexGrowRow, Object.assign({ position: "absolute", margin: -1, top: 0, bottom: 0, right: 0, left: 0, bgcolor: paper ? theme.palette.background.paper : theme.palette.background.default }, { children: ((_a = errors === null || errors === void 0 ? void 0 : errors.length) !== null && _a !== void 0 ? _a : 0) === 0 ? (jsx(CircularProgress, { style: { opacity } }, void 0)) : (jsx(ErrorsViewer, { margin: 1, errors: errors, onRetry: onRetry }, void 0)) }), void 0));
209
116
  }
210
117
  return null;
211
118
  };
212
119
 
213
- var HoverScale = function (props) {
214
- var children = props.children, _a = props.scale, scale = _a === void 0 ? 1.1 : _a;
215
- var useStyles = makeStyles(function () {
216
- return createStyles({
217
- zoomdiv: {
218
- '&:hover': {
219
- transform: "scale(".concat(scale, ")"),
220
- transitionDuration: '0.2s',
221
- transitionTimingFunction: 'ease',
222
- },
120
+ const HoverScale = (props) => {
121
+ const { children, scale = 1.1 } = props;
122
+ const useStyles = makeStyles(() => createStyles({
123
+ zoomdiv: {
124
+ '&:hover': {
125
+ transform: `scale(${scale})`,
126
+ transitionDuration: '0.2s',
127
+ transitionTimingFunction: 'ease',
223
128
  },
224
- });
225
- });
226
- var classes = useStyles();
227
- return (jsx(FlexRow, { children: jsx(Box, __assign({ className: classes.zoomdiv }, { children: children }), void 0) }, void 0));
129
+ },
130
+ }));
131
+ const classes = useStyles();
132
+ return (jsx(FlexRow, { children: jsx(Box, Object.assign({ className: classes.zoomdiv }, { children: children }), void 0) }, void 0));
228
133
  };
229
134
 
230
- var range = function (n, in_min, in_max, out_min, out_max) {
135
+ const range = (n, in_min, in_max, out_min, out_max) => {
231
136
  return ((n - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min;
232
137
  };
233
- var updateCanvas = function (canvas, props) {
234
- var _a = props.value, value = _a === void 0 ? '' : _a, _b = props.size, size = _b === void 0 ? 400 : _b, _c = props.bg, bg = _c === void 0 ? 'transparent' : _c, _d = props.count, count = _d === void 0 ? 5 : _d, palette = props.palette, _e = props.iconPadding, iconPadding = _e === void 0 ? 0 : _e;
235
- var fg = props.fg;
236
- var hash = md5(value);
237
- var block = Math.floor(size / count);
238
- var hashcolor = hash.slice(0, 6);
239
- var current = canvas.current;
138
+ const updateCanvas = (canvas, props) => {
139
+ const { value = '', size = 400, bg = 'transparent', count = 5, palette, iconPadding = 0 } = props;
140
+ let { fg } = props;
141
+ const hash = md5(value);
142
+ const block = Math.floor(size / count);
143
+ const hashcolor = hash.slice(0, 6);
144
+ const current = canvas.current;
240
145
  if (!current) {
241
146
  return;
242
147
  }
243
148
  if (palette && palette.length) {
244
- var index = Math.floor(range(parseInt(hash.slice(-3), 16), 0, 4095, 0, palette.length));
149
+ const index = Math.floor(range(parseInt(hash.slice(-3), 16), 0, 4095, 0, palette.length));
245
150
  fg = palette[index];
246
151
  }
247
152
  current.width = block * count + iconPadding;
248
153
  current.height = block * count + iconPadding;
249
- var arr = hash.split('').map(function (el) {
250
- var parsedEl = parseInt(el, 16);
154
+ const arr = hash.split('').map((el) => {
155
+ const parsedEl = parseInt(el, 16);
251
156
  if (parsedEl < 8) {
252
157
  return 0;
253
158
  }
@@ -255,16 +160,16 @@ var updateCanvas = function (canvas, props) {
255
160
  return 1;
256
161
  }
257
162
  });
258
- var map = [];
163
+ const map = [];
259
164
  map[0] = map[4] = arr.slice(0, 5);
260
165
  map[1] = map[3] = arr.slice(5, 10);
261
166
  map[2] = arr.slice(10, 15);
262
- var ctx = current.getContext('2d');
167
+ const ctx = current.getContext('2d');
263
168
  if (ctx) {
264
169
  ctx.imageSmoothingEnabled = false;
265
170
  ctx.clearRect(0, 0, current.width, current.height);
266
- map.forEach(function (row, i) {
267
- row.forEach(function (el, j) {
171
+ map.forEach((row, i) => {
172
+ row.forEach((el, j) => {
268
173
  if (el) {
269
174
  ctx.fillStyle = fg ? fg : '#' + hashcolor;
270
175
  ctx.fillRect(block * i + iconPadding, block * j + iconPadding, block - iconPadding, block - iconPadding);
@@ -277,101 +182,99 @@ var updateCanvas = function (canvas, props) {
277
182
  });
278
183
  }
279
184
  };
280
- var Identicon = function (_a) {
281
- var _b = _a.size, size = _b === void 0 ? 400 : _b, _c = _a.className, className = _c === void 0 ? 'identicon' : _c, bg = _a.bg, count = _a.count, fg = _a.fg, iconPadding = _a.iconPadding, palette = _a.palette, value = _a.value, props = __rest(_a, ["size", "className", "bg", "count", "fg", "iconPadding", "palette", "value"]);
282
- var canvas = useRef(null);
283
- useEffect(function () {
284
- updateCanvas(canvas, { bg: bg, className: className, count: count, fg: fg, iconPadding: iconPadding, palette: palette, size: size, value: value });
185
+ const Identicon = (_a) => {
186
+ var { size = 400, className = 'identicon', bg, count, fg, iconPadding, palette, value } = _a, props = __rest(_a, ["size", "className", "bg", "count", "fg", "iconPadding", "palette", "value"]);
187
+ const canvas = useRef(null);
188
+ useEffect(() => {
189
+ updateCanvas(canvas, { bg, className, count, fg, iconPadding, palette, size, value });
285
190
  });
286
- return (jsx(FlexRow, __assign({}, props, { children: jsx("canvas", { className: className, ref: canvas, style: { height: size, width: size } }, void 0) }), void 0));
191
+ return (jsx(FlexRow, Object.assign({}, props, { children: jsx("canvas", { className: className, ref: canvas, style: { height: size, width: size } }, void 0) }), void 0));
287
192
  };
288
193
 
289
- var RedirectWithQuery = function (_a) {
290
- var to = _a.to, toOptions = _a.toOptions;
291
- var newPath = "".concat(to).concat(document.location.search);
292
- var navigate = useNavigate();
293
- var pathname = useLocation().pathname;
294
- useEffect(function () {
194
+ const RedirectWithQuery = ({ to, toOptions }) => {
195
+ const newPath = `${to}${document.location.search}`;
196
+ const navigate = useNavigate();
197
+ const { pathname } = useLocation();
198
+ useEffect(() => {
295
199
  if (newPath !== pathname) {
296
- navigate(newPath, __assign({ replace: true }, toOptions));
200
+ navigate(newPath, Object.assign({ replace: true }, toOptions));
297
201
  }
298
202
  });
299
203
  return jsx("div", {}, void 0);
300
204
  };
301
205
 
302
- var ScrollToTopButton = function (_a) {
303
- var children = _a.children, anchorId = _a.anchorId, props = __rest(_a, ["children", "anchorId"]);
304
- var trigger = useScrollTrigger({
206
+ const ScrollToTopButton = (_a) => {
207
+ var { children, anchorId } = _a, props = __rest(_a, ["children", "anchorId"]);
208
+ const trigger = useScrollTrigger({
305
209
  disableHysteresis: true,
306
210
  threshold: 100,
307
211
  });
308
- var handleClick = function (event) {
309
- var anchor = (event.target.ownerDocument || document).querySelector("#".concat(anchorId));
212
+ const handleClick = (event) => {
213
+ const anchor = (event.target.ownerDocument || document).querySelector(`#${anchorId}`);
310
214
  if (anchor) {
311
215
  anchor.scrollIntoView({ behavior: 'smooth', block: 'center' });
312
216
  }
313
217
  };
314
- var theme = useTheme();
315
- return (jsx(Zoom, __assign({ in: trigger }, props, { children: jsx(Box, __assign({ zIndex: 10, position: "fixed", right: theme.spacing(2), bottom: theme.spacing(2), onClick: handleClick, role: "presentation" }, { children: children }), void 0) }), void 0));
218
+ const theme = useTheme();
219
+ return (jsx(Zoom, Object.assign({ in: trigger }, props, { children: jsx(Box, Object.assign({ zIndex: 10, position: "fixed", right: theme.spacing(2), bottom: theme.spacing(2), onClick: handleClick, role: "presentation" }, { children: children }), void 0) }), void 0));
316
220
  };
317
221
 
318
- var AppBarEx = function (props) {
319
- var contextToolbar = props.contextToolbar, systemToolbar = props.systemToolbar, container = props.container, style = props.style, appbarProps = __rest(props, ["contextToolbar", "systemToolbar", "container", "style"]);
320
- var theme = useTheme();
321
- var AppBarExInner = function () {
322
- return (jsxs(FlexGrowRow, __assign({ justifyContent: "space-between" }, { children: [contextToolbar !== null && contextToolbar !== void 0 ? contextToolbar : jsx(Toolbar, {}, void 0), systemToolbar !== null && systemToolbar !== void 0 ? systemToolbar : jsx(Toolbar, {}, void 0)] }), void 0));
222
+ const AppBarEx = (props) => {
223
+ const { contextToolbar, systemToolbar, container, style } = props, appbarProps = __rest(props, ["contextToolbar", "systemToolbar", "container", "style"]);
224
+ const theme = useTheme();
225
+ const AppBarExInner = () => {
226
+ return (jsxs(FlexGrowRow, Object.assign({ justifyContent: "space-between" }, { children: [contextToolbar !== null && contextToolbar !== void 0 ? contextToolbar : jsx(Toolbar, {}, void 0), systemToolbar !== null && systemToolbar !== void 0 ? systemToolbar : jsx(Toolbar, {}, void 0)] }), void 0));
323
227
  };
324
- return (jsx(AppBar, __assign({ position: "static", style: __assign({ backgroundColor: theme.palette.background.paper, color: theme.palette.text.primary, display: 'flex' }, style) }, appbarProps, { children: container ? (jsx(Container, __assign({ maxWidth: container }, { children: jsx(AppBarExInner, {}, void 0) }), void 0)) : (jsx(AppBarExInner, {}, void 0)) }), void 0));
228
+ return (jsx(AppBar, Object.assign({ position: "static", style: Object.assign({ backgroundColor: theme.palette.background.paper, color: theme.palette.text.primary, display: 'flex' }, style) }, appbarProps, { children: container ? (jsx(Container, Object.assign({ maxWidth: container }, { children: jsx(AppBarExInner, {}, void 0) }), void 0)) : (jsx(AppBarExInner, {}, void 0)) }), void 0));
325
229
  };
326
230
 
327
- var CookieConsentContext = createContext({});
231
+ const CookieConsentContext = createContext({});
328
232
 
329
- var CookiesAcceptedLocalStorageName = 'CookiesAccepted';
330
- var CookieConsentLoader = function (_a) {
331
- var children = _a.children;
332
- var getAcceptedFromLocalStorage = function () {
233
+ const CookiesAcceptedLocalStorageName = 'CookiesAccepted';
234
+ const CookieConsentLoader = ({ children }) => {
235
+ const getAcceptedFromLocalStorage = () => {
333
236
  return localStorage.getItem(CookiesAcceptedLocalStorageName) === 'true';
334
237
  };
335
- var setAcceptedToLocalStorage = function (accepted) {
238
+ const setAcceptedToLocalStorage = (accepted) => {
336
239
  localStorage.setItem(CookiesAcceptedLocalStorageName, accepted ? 'true' : 'false');
337
240
  };
338
- var _b = __read(useState(getAcceptedFromLocalStorage()), 2), accepted = _b[0], setAccepted = _b[1];
339
- var setAcceptedHandler = function (accepted) {
241
+ const [accepted, setAccepted] = useState(getAcceptedFromLocalStorage());
242
+ const setAcceptedHandler = (accepted) => {
340
243
  setAcceptedToLocalStorage(accepted);
341
244
  setAccepted(accepted);
342
245
  };
343
- var clearAccepted = function () {
246
+ const clearAccepted = () => {
344
247
  localStorage.removeItem(CookiesAcceptedLocalStorageName);
345
248
  setAccepted(getAcceptedFromLocalStorage());
346
249
  };
347
- return (jsx(CookieConsentContext.Provider, __assign({ value: { accepted: accepted, clearAccepted: clearAccepted, setAccepted: setAcceptedHandler, storageName: CookiesAcceptedLocalStorageName } }, { children: children }), void 0));
250
+ return (jsx(CookieConsentContext.Provider, Object.assign({ value: { accepted, clearAccepted, setAccepted: setAcceptedHandler, storageName: CookiesAcceptedLocalStorageName } }, { children: children }), void 0));
348
251
  };
349
252
 
350
- var useCookieConsent = function () {
253
+ const useCookieConsent = () => {
351
254
  return useContext(CookieConsentContext);
352
255
  };
353
256
 
354
- var EthersContext = createContext({});
257
+ const EthersContext = createContext({});
355
258
 
356
- var infuraKey = '1d9f8053c65a49cfb99fafaa8ef201c0';
357
- var InfuraEthersLoader = function (props) {
358
- var children = props.children;
359
- var chainId = 1;
360
- var provider = new InfuraProvider(1, infuraKey);
361
- return (jsx(EthersContext.Provider, __assign({ value: {
259
+ const infuraKey = '1d9f8053c65a49cfb99fafaa8ef201c0';
260
+ const InfuraEthersLoader = (props) => {
261
+ const { children } = props;
262
+ const chainId = 1;
263
+ const provider = new InfuraProvider(1, infuraKey);
264
+ return (jsx(EthersContext.Provider, Object.assign({ value: {
362
265
  busy: false,
363
- chainId: chainId,
266
+ chainId,
364
267
  isConnected: true,
365
- provider: provider,
268
+ provider,
366
269
  signer: null,
367
270
  } }, { children: children }), void 0));
368
271
  };
369
272
 
370
- var getApiStage = function () {
273
+ const getApiStage = () => {
371
274
  return getApiStage$1(document.location.hostname);
372
275
  };
373
276
 
374
- var isLocalhost = !!(window.location.hostname === 'localhost' ||
277
+ const isLocalhost = !!(window.location.hostname === 'localhost' ||
375
278
  // [::1] is the IPv6 localhost address.
376
279
  window.location.hostname === '[::1]' ||
377
280
  // 127.0.0.0/8 are considered localhost for IPv4.
@@ -380,18 +283,18 @@ var isLocalhost = !!(window.location.hostname === 'localhost' ||
380
283
  /* eslint-disable react-hooks/exhaustive-deps */
381
284
  function useAsyncEffect(effect, inputs) {
382
285
  useEffect(function () {
383
- var mounted = true;
384
- var promise = effect(function () {
286
+ let mounted = true;
287
+ const promise = effect(() => {
385
288
  return mounted;
386
289
  });
387
290
  Promise.resolve(promise)
388
- .then(function (callback) {
291
+ .then((callback) => {
389
292
  if (callback) {
390
293
  callback === null || callback === void 0 ? void 0 : callback();
391
294
  }
392
295
  })
393
- .catch(function (reason) {
394
- console.log("useAsyncEffect Excepted: ".concat(reason));
296
+ .catch((reason) => {
297
+ console.log(`useAsyncEffect Excepted: ${reason}`);
395
298
  });
396
299
  return function () {
397
300
  mounted = false;
@@ -399,33 +302,24 @@ function useAsyncEffect(effect, inputs) {
399
302
  }, inputs !== null && inputs !== void 0 ? inputs : []);
400
303
  }
401
304
 
402
- var logProfiling = false;
403
- var enableProfileLogging = function (enabled) {
305
+ let logProfiling = false;
306
+ const enableProfileLogging = (enabled) => {
404
307
  logProfiling = enabled;
405
308
  };
406
- var profileResults = [];
407
- var profileBlock = function (name, closure) { return __awaiter(void 0, void 0, void 0, function () {
408
- var startTime, endTime;
409
- return __generator(this, function (_a) {
410
- switch (_a.label) {
411
- case 0:
412
- startTime = Date.now();
413
- return [4 /*yield*/, closure()];
414
- case 1:
415
- _a.sent();
416
- endTime = Date.now();
417
- profileResults.push({ endTime: endTime, name: name, startTime: startTime });
418
- if (logProfiling) {
419
- console.log("Timed ".concat(name, " [").concat(endTime - startTime, "ms]"));
420
- }
421
- return [2 /*return*/];
422
- }
423
- });
424
- }); };
309
+ const profileResults = [];
310
+ const profileBlock = (name, closure) => __awaiter(void 0, void 0, void 0, function* () {
311
+ const startTime = Date.now();
312
+ yield closure();
313
+ const endTime = Date.now();
314
+ profileResults.push({ endTime, name, startTime });
315
+ if (logProfiling) {
316
+ console.log(`Timed ${name} [${endTime - startTime}ms]`);
317
+ }
318
+ });
425
319
 
426
- var getLocalStorageObject = function (key, log) {
320
+ const getLocalStorageObject = (key, log) => {
427
321
  var _a;
428
- var result = {};
322
+ let result = {};
429
323
  try {
430
324
  result = JSON.parse((_a = localStorage.getItem(key)) !== null && _a !== void 0 ? _a : '{}');
431
325
  }
@@ -434,7 +328,7 @@ var getLocalStorageObject = function (key, log) {
434
328
  }
435
329
  return result;
436
330
  };
437
- var setLocalStorageObject = function (key, value, log) {
331
+ const setLocalStorageObject = (key, value, log) => {
438
332
  try {
439
333
  localStorage.setItem(key, JSON.stringify(value));
440
334
  }
@@ -443,9 +337,9 @@ var setLocalStorageObject = function (key, value, log) {
443
337
  }
444
338
  };
445
339
 
446
- var getSessionStorageObject = function (key, log) {
340
+ const getSessionStorageObject = (key, log) => {
447
341
  var _a;
448
- var result = {};
342
+ let result = {};
449
343
  try {
450
344
  result = JSON.parse((_a = sessionStorage.getItem(key)) !== null && _a !== void 0 ? _a : '{}');
451
345
  }
@@ -454,7 +348,7 @@ var getSessionStorageObject = function (key, log) {
454
348
  }
455
349
  return result;
456
350
  };
457
- var setSessionStorageObject = function (key, value, log) {
351
+ const setSessionStorageObject = (key, value, log) => {
458
352
  try {
459
353
  sessionStorage.setItem(key, JSON.stringify(value));
460
354
  }
@@ -463,161 +357,110 @@ var setSessionStorageObject = function (key, value, log) {
463
357
  }
464
358
  };
465
359
 
466
- var Referrer = /** @class */ (function () {
467
- function Referrer() {
360
+ class Referrer {
361
+ constructor() {
468
362
  var _a, _b;
469
363
  this.session = (_a = this.getFromSession()) !== null && _a !== void 0 ? _a : document.referrer;
470
364
  sessionStorage.setItem(Referrer.storageId, this.session);
471
365
  this.local = (_b = this.getFromLocal()) !== null && _b !== void 0 ? _b : document.referrer;
472
366
  localStorage.setItem(Referrer.storageId, this.local);
473
367
  }
474
- Referrer.prototype.getFromLocal = function () {
475
- var value = localStorage.getItem(Referrer.storageId);
368
+ getFromLocal() {
369
+ const value = localStorage.getItem(Referrer.storageId);
476
370
  if (value && value.length > 0) {
477
371
  return value;
478
372
  }
479
- };
480
- Referrer.prototype.getFromSession = function () {
481
- var value = sessionStorage.getItem(Referrer.storageId);
373
+ }
374
+ getFromSession() {
375
+ const value = sessionStorage.getItem(Referrer.storageId);
482
376
  if (value && value.length > 0) {
483
377
  return value;
484
378
  }
485
- };
486
- Referrer.prototype.toJson = function () {
379
+ }
380
+ toJson() {
487
381
  if ((this.local && this.local.length > 0) || (this.session && this.session.length > 0)) {
488
382
  return {
489
383
  local: this.local,
490
384
  session: this.session,
491
385
  };
492
386
  }
493
- };
494
- Referrer.storageId = '_coin_referrer';
495
- return Referrer;
496
- }());
497
-
498
- var XyoUserEventHandler = /** @class */ (function (_super) {
499
- __extends(XyoUserEventHandler, _super);
500
- function XyoUserEventHandler(handlers) {
501
- if (handlers === void 0) { handlers = []; }
502
- var _this = _super.call(this) || this;
503
- _this.handlers = handlers;
504
- return _this;
505
- }
506
- XyoUserEventHandler.prototype.testStarted = function (data) {
507
- return __awaiter(this, void 0, void 0, function () {
508
- return __generator(this, function (_a) {
509
- switch (_a.label) {
510
- case 0: return [4 /*yield*/, Promise.allSettled(this.handlers.map(function (handler) { return handler.testStarted(data); }))];
511
- case 1:
512
- _a.sent();
513
- return [2 /*return*/];
514
- }
515
- });
387
+ }
388
+ }
389
+ Referrer.storageId = '_coin_referrer';
390
+
391
+ class XyoUserEventHandler extends UserEventHandler {
392
+ constructor(handlers = []) {
393
+ super();
394
+ this.handlers = handlers;
395
+ }
396
+ testStarted(data) {
397
+ return __awaiter(this, void 0, void 0, function* () {
398
+ yield Promise.allSettled(this.handlers.map((handler) => handler.testStarted(data)));
516
399
  });
517
- };
518
- XyoUserEventHandler.prototype.funnelStarted = function (data) {
519
- return __awaiter(this, void 0, void 0, function () {
520
- return __generator(this, function (_a) {
521
- switch (_a.label) {
522
- case 0: return [4 /*yield*/, Promise.allSettled(this.handlers.map(function (handler) { return handler.funnelStarted(data); }))];
523
- case 1:
524
- _a.sent();
525
- return [2 /*return*/];
526
- }
527
- });
400
+ }
401
+ funnelStarted(data) {
402
+ return __awaiter(this, void 0, void 0, function* () {
403
+ yield Promise.allSettled(this.handlers.map((handler) => handler.funnelStarted(data)));
528
404
  });
529
- };
530
- XyoUserEventHandler.prototype.viewContent = function (data) {
531
- return __awaiter(this, void 0, void 0, function () {
532
- return __generator(this, function (_a) {
533
- switch (_a.label) {
534
- case 0: return [4 /*yield*/, Promise.allSettled(this.handlers.map(function (handler) { return handler.viewContent(data); }))];
535
- case 1:
536
- _a.sent();
537
- return [2 /*return*/];
538
- }
539
- });
405
+ }
406
+ viewContent(data) {
407
+ return __awaiter(this, void 0, void 0, function* () {
408
+ yield Promise.allSettled(this.handlers.map((handler) => handler.viewContent(data)));
540
409
  });
541
- };
542
- XyoUserEventHandler.prototype.userClick = function (data) {
543
- return __awaiter(this, void 0, void 0, function () {
544
- return __generator(this, function (_a) {
545
- switch (_a.label) {
546
- case 0: return [4 /*yield*/, Promise.allSettled(this.handlers.map(function (handler) { return handler.userClick(data); }))];
547
- case 1:
548
- _a.sent();
549
- return [2 /*return*/];
550
- }
551
- });
410
+ }
411
+ userClick(data) {
412
+ return __awaiter(this, void 0, void 0, function* () {
413
+ yield Promise.allSettled(this.handlers.map((handler) => handler.userClick(data)));
552
414
  });
553
- };
554
- return XyoUserEventHandler;
555
- }(UserEventHandler));
415
+ }
416
+ }
556
417
 
557
418
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
558
- var global = window;
419
+ const global = window;
559
420
 
560
- var DripBaseEvent = /** @class */ (function () {
561
- function DripBaseEvent(name, param) {
421
+ class DripBaseEvent {
422
+ constructor(name, param) {
562
423
  this.name = name;
563
424
  this.param = param;
564
425
  this.dcq = this.getDcq();
565
426
  this.dcs = this.getDcs();
566
427
  }
567
- DripBaseEvent.prototype.send = function (data) {
568
- return __awaiter(this, void 0, void 0, function () {
569
- var payload;
570
- return __generator(this, function (_a) {
571
- switch (_a.label) {
572
- case 0:
573
- payload = [this.name];
574
- if (this.param) {
575
- payload.push(this.param);
576
- }
577
- payload.push(data);
578
- this.dcq.push(payload);
579
- return [4 /*yield*/, delay(0)];
580
- case 1:
581
- _a.sent();
582
- return [2 /*return*/];
583
- }
584
- });
428
+ send(data) {
429
+ return __awaiter(this, void 0, void 0, function* () {
430
+ const payload = [this.name];
431
+ if (this.param) {
432
+ payload.push(this.param);
433
+ }
434
+ payload.push(data);
435
+ this.dcq.push(payload);
436
+ yield delay(0);
585
437
  });
586
- };
587
- DripBaseEvent.prototype.getDcq = function () {
438
+ }
439
+ getDcq() {
588
440
  if (!global._dcq) {
589
441
  throw Error('DCQ not found');
590
442
  }
591
443
  return global._dcq;
592
- };
593
- DripBaseEvent.prototype.getDcs = function () {
444
+ }
445
+ getDcs() {
594
446
  if (!global._dcs) {
595
447
  throw Error('DCS not found');
596
448
  }
597
449
  return global._dcs;
598
- };
599
- return DripBaseEvent;
600
- }());
601
-
602
- var DripCustomEvent = /** @class */ (function (_super) {
603
- __extends(DripCustomEvent, _super);
604
- function DripCustomEvent() {
605
- return _super !== null && _super.apply(this, arguments) || this;
606
450
  }
607
- return DripCustomEvent;
608
- }(DripBaseEvent));
451
+ }
609
452
 
610
- var DripStandardEvents = /** @class */ (function () {
611
- function DripStandardEvents() {
612
- }
613
- DripStandardEvents.prototype.identify = function () {
453
+ class DripCustomEvent extends DripBaseEvent {
454
+ }
455
+
456
+ class DripStandardEvents {
457
+ identify() {
614
458
  return new DripBaseEvent('identify');
615
- };
616
- return DripStandardEvents;
617
- }());
459
+ }
460
+ }
618
461
 
619
- var Fbq = /** @class */ (function () {
620
- function Fbq(pixelId) {
462
+ class Fbq {
463
+ constructor(pixelId) {
621
464
  this.pixelId = pixelId;
622
465
  this.fbq = function () {
623
466
  // eslint-disable-next-line prefer-rest-params,prefer-spread
@@ -633,147 +476,109 @@ var Fbq = /** @class */ (function () {
633
476
  this.fbq('init', pixelId);
634
477
  this.fbq('track', 'PageView');
635
478
  }
636
- Fbq.init = function (pixelId) {
479
+ static init(pixelId) {
637
480
  if (!this.instance) {
638
481
  this.instance = new Fbq(pixelId);
639
482
  }
640
483
  return this.instance;
641
- };
642
- Fbq.prototype.track = function (event, data) {
643
- this.fbq('track', event, __assign({}, data));
644
- };
645
- Fbq.prototype.trackCustom = function (event, data) {
646
- this.fbq('trackCustom', event, __assign({}, data));
647
- };
648
- return Fbq;
649
- }());
484
+ }
485
+ track(event, data) {
486
+ this.fbq('track', event, Object.assign({}, data));
487
+ }
488
+ trackCustom(event, data) {
489
+ this.fbq('trackCustom', event, Object.assign({}, data));
490
+ }
491
+ }
650
492
 
651
- var FacebookBaseEvent = /** @class */ (function () {
652
- function FacebookBaseEvent(name) {
493
+ class FacebookBaseEvent {
494
+ constructor(name) {
653
495
  this.name = name;
654
496
  this.fbq = assertEx(Fbq.instance, 'Missing Fbq');
655
497
  }
656
- FacebookBaseEvent.prototype.send = function (_data) {
657
- return __awaiter(this, void 0, void 0, function () {
658
- return __generator(this, function (_a) {
659
- switch (_a.label) {
660
- case 0: return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
661
- case 1:
662
- _a.sent(); //force async to increase reporting odds
663
- return [2 /*return*/];
664
- }
665
- });
666
- });
667
- };
668
- return FacebookBaseEvent;
669
- }());
670
-
671
- var FacebookCustomEvent = /** @class */ (function (_super) {
672
- __extends(FacebookCustomEvent, _super);
673
- function FacebookCustomEvent() {
674
- return _super !== null && _super.apply(this, arguments) || this;
675
- }
676
- FacebookCustomEvent.prototype.send = function (data) {
677
- return __awaiter(this, void 0, void 0, function () {
678
- return __generator(this, function (_a) {
679
- switch (_a.label) {
680
- case 0:
681
- this.fbq.trackCustom(this.name, data);
682
- return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
683
- case 1:
684
- _a.sent(); //force async to increase reporting odds
685
- return [2 /*return*/];
686
- }
687
- });
498
+ send(_data) {
499
+ return __awaiter(this, void 0, void 0, function* () {
500
+ yield delay(0); //force async to increase reporting odds
688
501
  });
689
- };
690
- return FacebookCustomEvent;
691
- }(FacebookBaseEvent));
692
-
693
- var FacebookStandardEvent = /** @class */ (function (_super) {
694
- __extends(FacebookStandardEvent, _super);
695
- function FacebookStandardEvent() {
696
- return _super !== null && _super.apply(this, arguments) || this;
697
- }
698
- FacebookStandardEvent.prototype.send = function (data) {
699
- return __awaiter(this, void 0, void 0, function () {
700
- return __generator(this, function (_a) {
701
- switch (_a.label) {
702
- case 0:
703
- this.fbq.track(this.name, data);
704
- return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
705
- case 1:
706
- _a.sent(); //force async to increase reporting odds
707
- return [2 /*return*/];
708
- }
709
- });
502
+ }
503
+ }
504
+
505
+ class FacebookCustomEvent extends FacebookBaseEvent {
506
+ send(data) {
507
+ return __awaiter(this, void 0, void 0, function* () {
508
+ this.fbq.trackCustom(this.name, data);
509
+ yield delay(0); //force async to increase reporting odds
710
510
  });
711
- };
712
- return FacebookStandardEvent;
713
- }(FacebookBaseEvent));
511
+ }
512
+ }
714
513
 
715
- var FacebookStandardEvents = /** @class */ (function () {
716
- function FacebookStandardEvents() {
514
+ class FacebookStandardEvent extends FacebookBaseEvent {
515
+ send(data) {
516
+ return __awaiter(this, void 0, void 0, function* () {
517
+ this.fbq.track(this.name, data);
518
+ yield delay(0); //force async to increase reporting odds
519
+ });
717
520
  }
718
- FacebookStandardEvents.prototype.addPaymentInfo = function () {
521
+ }
522
+
523
+ class FacebookStandardEvents {
524
+ addPaymentInfo() {
719
525
  return new FacebookStandardEvent('AddPaymentInfo');
720
- };
721
- FacebookStandardEvents.prototype.addToCart = function () {
526
+ }
527
+ addToCart() {
722
528
  return new FacebookStandardEvent('AddToCart');
723
- };
724
- FacebookStandardEvents.prototype.addToWishList = function () {
529
+ }
530
+ addToWishList() {
725
531
  return new FacebookStandardEvent('AddToWishList');
726
- };
727
- FacebookStandardEvents.prototype.completedRegistration = function () {
532
+ }
533
+ completedRegistration() {
728
534
  return new FacebookStandardEvent('CompleteRegistration');
729
- };
730
- FacebookStandardEvents.prototype.contact = function () {
535
+ }
536
+ contact() {
731
537
  return new FacebookStandardEvent('Contact');
732
- };
733
- FacebookStandardEvents.prototype.customizeProduct = function () {
538
+ }
539
+ customizeProduct() {
734
540
  return new FacebookStandardEvent('CustomizeProduct');
735
- };
736
- FacebookStandardEvents.prototype.donate = function () {
541
+ }
542
+ donate() {
737
543
  return new FacebookStandardEvent('Donate');
738
- };
739
- FacebookStandardEvents.prototype.findLocation = function () {
544
+ }
545
+ findLocation() {
740
546
  return new FacebookStandardEvent('FindLocation');
741
- };
742
- FacebookStandardEvents.prototype.initiateCheckout = function () {
547
+ }
548
+ initiateCheckout() {
743
549
  return new FacebookStandardEvent('InitiateCheckout');
744
- };
745
- FacebookStandardEvents.prototype.lead = function () {
550
+ }
551
+ lead() {
746
552
  return new FacebookStandardEvent('Lead');
747
- };
748
- FacebookStandardEvents.prototype.pageView = function () {
553
+ }
554
+ pageView() {
749
555
  return new FacebookStandardEvent('PageView');
750
- };
751
- FacebookStandardEvents.prototype.purchase = function () {
556
+ }
557
+ purchase() {
752
558
  return new FacebookStandardEvent('Purchase');
753
- };
754
- FacebookStandardEvents.prototype.schedule = function () {
559
+ }
560
+ schedule() {
755
561
  return new FacebookStandardEvent('Schedule');
756
- };
757
- FacebookStandardEvents.prototype.search = function () {
562
+ }
563
+ search() {
758
564
  return new FacebookStandardEvent('Search');
759
- };
760
- FacebookStandardEvents.prototype.startTrial = function () {
565
+ }
566
+ startTrial() {
761
567
  return new FacebookStandardEvent('StartTrial');
762
- };
763
- FacebookStandardEvents.prototype.submitApplication = function () {
568
+ }
569
+ submitApplication() {
764
570
  return new FacebookStandardEvent('SubmitApplication');
765
- };
766
- FacebookStandardEvents.prototype.subscribe = function () {
571
+ }
572
+ subscribe() {
767
573
  return new FacebookStandardEvent('Subscribe');
768
- };
769
- FacebookStandardEvents.prototype.viewContent = function () {
574
+ }
575
+ viewContent() {
770
576
  return new FacebookStandardEvent('ViewContent');
771
- };
772
- return FacebookStandardEvents;
773
- }());
577
+ }
578
+ }
774
579
 
775
- var Gtag = /** @class */ (function () {
776
- function Gtag(ga4id, awid, domains) {
580
+ class Gtag {
581
+ constructor(ga4id, awid, domains) {
777
582
  var _a, _b, _c, _d;
778
583
  this.ga4id = ga4id;
779
584
  this.awid = awid;
@@ -788,328 +593,255 @@ var Gtag = /** @class */ (function () {
788
593
  this.gtag('js', new Date());
789
594
  this.gtag('config', ga4id);
790
595
  //this.gtag('config', awid) - this is configured in the Data Stream in Google Analytics
791
- var parsedQueryString = parse(document.location.search);
596
+ const parsedQueryString = parse(document.location.search);
792
597
  //we handle the utm_referrer here incase a referrer was forwarded (special.coinapp.co does this)
793
598
  sessionStorage.setItem('initialReferrer', decodeURIComponent((_d = (_c = parsedQueryString['utm_referrer']) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : document.referrer));
794
599
  delete parsedQueryString['utm_referrer'];
795
- var remainingSearch = parsedQueryString ? stringify(parsedQueryString) : '';
600
+ const remainingSearch = parsedQueryString ? stringify(parsedQueryString) : '';
796
601
  sessionStorage.setItem('initialQuery', remainingSearch);
797
602
  sessionStorage.setItem('initialPage', document.location.href);
798
603
  }
799
- Gtag.prototype.updatePagePath = function (page_path) {
800
- var ga4id = assertEx(this.ga4id, 'Missing GA4ID');
801
- var pathOnly = page_path.split('?')[0];
802
- var search = Gtag.getInitialQuery();
803
- this.gtag('config', ga4id, { page_path: "".concat(pathOnly).concat(search) });
804
- };
604
+ updatePagePath(page_path) {
605
+ const ga4id = assertEx(this.ga4id, 'Missing GA4ID');
606
+ const pathOnly = page_path.split('?')[0];
607
+ const search = Gtag.getInitialQuery();
608
+ this.gtag('config', ga4id, { page_path: `${pathOnly}${search}` });
609
+ }
805
610
  //
806
- Gtag.getInitialQuery = function () {
611
+ static getInitialQuery() {
807
612
  return sessionStorage.getItem('initialQuery') || '';
808
- };
809
- Gtag.getInitialPage = function () {
613
+ }
614
+ static getInitialPage() {
810
615
  return sessionStorage.getItem('initialPage') || '';
811
- };
812
- Gtag.getInitialReferrer = function () {
616
+ }
617
+ static getInitialReferrer() {
813
618
  return sessionStorage.getItem('initialReferrer') || '';
814
- };
815
- Gtag.clearDataLayer = function () {
816
- var dataLayer = global.dataLayer;
619
+ }
620
+ static clearDataLayer() {
621
+ const dataLayer = global.dataLayer;
817
622
  dataLayer.length = 0;
818
- };
819
- Gtag.init = function (ga4id, awid, domains) {
623
+ }
624
+ static init(ga4id, awid, domains) {
820
625
  if (!this.instance) {
821
626
  return this.reinit(ga4id, awid, domains);
822
627
  }
823
628
  return this.instance;
824
- };
825
- Gtag.reinit = function (ga4id, awid, domains) {
629
+ }
630
+ static reinit(ga4id, awid, domains) {
826
631
  this.instance = new Gtag(ga4id, awid, domains);
827
632
  return this.instance;
828
- };
829
- Gtag.updatePagePath = function (page_path) {
830
- var instance = assertEx(this.instance, 'Not initialized');
633
+ }
634
+ static updatePagePath(page_path) {
635
+ const instance = assertEx(this.instance, 'Not initialized');
831
636
  return instance.updatePagePath(page_path);
832
- };
833
- Gtag.prototype.sendAnalytics = function (event, data) {
834
- var _this = this;
835
- return new Promise(function (resolve) {
836
- _this.gtag('event', event, __assign(__assign({}, data), { event_callback: function () {
637
+ }
638
+ sendAnalytics(event, data) {
639
+ return new Promise((resolve) => {
640
+ this.gtag('event', event, Object.assign(Object.assign({}, data), { event_callback: () => {
837
641
  resolve();
838
- }, event_timeout: 2000, page_location: Gtag.getInitialPage(), page_referrer: Gtag.getInitialReferrer(), send_to: _this.ga4id }));
642
+ }, event_timeout: 2000, page_location: Gtag.getInitialPage(), page_referrer: Gtag.getInitialReferrer(), send_to: this.ga4id }));
839
643
  });
840
- };
841
- Gtag.prototype.sendAdwords = function (event, data) {
842
- var _this = this;
843
- return new Promise(function (resolve) {
844
- _this.gtag('event', 'conversion', __assign(__assign({}, data), { event_callback: function () {
644
+ }
645
+ sendAdwords(event, data) {
646
+ return new Promise((resolve) => {
647
+ this.gtag('event', 'conversion', Object.assign(Object.assign({}, data), { event_callback: () => {
845
648
  resolve();
846
- }, event_timeout: 2000, send_to: "".concat(_this.awid, "/").concat(event) }));
649
+ }, event_timeout: 2000, send_to: `${this.awid}/${event}` }));
847
650
  });
848
- };
849
- return Gtag;
850
- }());
651
+ }
652
+ }
851
653
 
852
- var Gtm = /** @class */ (function () {
853
- function Gtm(containerId) {
654
+ class Gtm {
655
+ constructor(containerId) {
854
656
  this.containerId = containerId;
855
- var global = window;
657
+ const global = window;
856
658
  global.dataLayer = global.dataLayer || [];
857
659
  global.dataLayer.push({ event: 'gtm.js', 'gtm.start': new Date().getTime() });
858
660
  }
859
- Gtm.getInitialQuery = function () {
661
+ static getInitialQuery() {
860
662
  return sessionStorage.getItem('initialQuery') || '';
861
- };
862
- Gtm.clearDataLayer = function () {
863
- var global = window;
864
- var dataLayer = global.dataLayer;
663
+ }
664
+ static clearDataLayer() {
665
+ const global = window;
666
+ const dataLayer = global.dataLayer;
865
667
  dataLayer.length = 0;
866
- };
867
- Gtm.init = function (containerId) {
668
+ }
669
+ static init(containerId) {
868
670
  if (!this.instance) {
869
671
  this.instance = new Gtm(containerId);
870
672
  }
871
673
  return this.instance;
872
- };
873
- Gtm.prototype.send = function (event, data, eventTimeout) {
874
- if (eventTimeout === void 0) { eventTimeout = 500; }
875
- return new Promise(function (resolve) {
674
+ }
675
+ send(event, data, eventTimeout = 500) {
676
+ return new Promise((resolve) => {
876
677
  var _a;
877
- var global = window;
878
- (_a = global.dataLayer) === null || _a === void 0 ? void 0 : _a.push(__assign(__assign({ event: event }, data), { eventCallback: function () {
678
+ const global = window;
679
+ (_a = global.dataLayer) === null || _a === void 0 ? void 0 : _a.push(Object.assign(Object.assign({ event }, data), { eventCallback: () => {
879
680
  resolve();
880
- }, eventTimeout: eventTimeout }));
681
+ }, eventTimeout }));
881
682
  });
882
- };
883
- return Gtm;
884
- }());
683
+ }
684
+ }
885
685
 
886
- var GoogleBaseEvent = /** @class */ (function () {
887
- function GoogleBaseEvent(name, adwordConversionId) {
686
+ class GoogleBaseEvent {
687
+ constructor(name, adwordConversionId) {
888
688
  this.name = name;
889
689
  this.adwordConversionId = adwordConversionId;
890
690
  }
891
- GoogleBaseEvent.prototype.send = function (data) {
892
- return __awaiter(this, void 0, void 0, function () {
893
- return __generator(this, function (_a) {
894
- switch (_a.label) {
895
- case 0: return [4 /*yield*/, this.sendGtag(data)];
896
- case 1: return [2 /*return*/, _a.sent()];
897
- }
898
- });
691
+ send(data) {
692
+ return __awaiter(this, void 0, void 0, function* () {
693
+ return yield this.sendGtag(data);
899
694
  });
900
- };
901
- GoogleBaseEvent.prototype.sendGtag = function (data) {
902
- return __awaiter(this, void 0, void 0, function () {
903
- return __generator(this, function (_a) {
904
- switch (_a.label) {
905
- case 0: return [4 /*yield*/, this.gtag().sendAnalytics(this.name, data)];
906
- case 1:
907
- _a.sent();
908
- if (!this.adwordConversionId) return [3 /*break*/, 3];
909
- return [4 /*yield*/, this.gtag().sendAdwords(this.adwordConversionId, data)];
910
- case 2:
911
- _a.sent();
912
- _a.label = 3;
913
- case 3: return [2 /*return*/];
914
- }
915
- });
695
+ }
696
+ sendGtag(data) {
697
+ return __awaiter(this, void 0, void 0, function* () {
698
+ yield this.gtag().sendAnalytics(this.name, data);
699
+ if (this.adwordConversionId) {
700
+ yield this.gtag().sendAdwords(this.adwordConversionId, data);
701
+ }
916
702
  });
917
- };
918
- GoogleBaseEvent.prototype.sendGtm = function (data) {
919
- return __awaiter(this, void 0, void 0, function () {
920
- return __generator(this, function (_a) {
921
- switch (_a.label) {
922
- case 0: return [4 /*yield*/, this.gtm().send(this.name, data)];
923
- case 1:
924
- _a.sent();
925
- return [2 /*return*/];
926
- }
927
- });
703
+ }
704
+ sendGtm(data) {
705
+ return __awaiter(this, void 0, void 0, function* () {
706
+ yield this.gtm().send(this.name, data);
928
707
  });
929
- };
930
- GoogleBaseEvent.prototype.gtag = function () {
708
+ }
709
+ gtag() {
931
710
  return assertEx(Gtag.instance, 'Missing/uninitialized gtag');
932
- };
933
- GoogleBaseEvent.prototype.gtm = function () {
711
+ }
712
+ gtm() {
934
713
  return assertEx(Gtm.instance, 'Missing/uninitialized gtm');
935
- };
936
- return GoogleBaseEvent;
937
- }());
938
-
939
- var GoogleCustomEvent = /** @class */ (function (_super) {
940
- __extends(GoogleCustomEvent, _super);
941
- function GoogleCustomEvent() {
942
- return _super !== null && _super.apply(this, arguments) || this;
943
- }
944
- return GoogleCustomEvent;
945
- }(GoogleBaseEvent));
946
-
947
- var GoogleUserEventHandler = /** @class */ (function () {
948
- function GoogleUserEventHandler() {
949
- }
950
- GoogleUserEventHandler.prototype.testStarted = function (data) {
951
- return __awaiter(this, void 0, void 0, function () {
952
- var event;
953
- return __generator(this, function (_a) {
954
- switch (_a.label) {
955
- case 0:
956
- event = new GoogleCustomEvent('TestStarted');
957
- return [4 /*yield*/, event.send(data)];
958
- case 1: return [2 /*return*/, _a.sent()];
959
- }
960
- });
714
+ }
715
+ }
716
+
717
+ class GoogleCustomEvent extends GoogleBaseEvent {
718
+ }
719
+
720
+ class GoogleUserEventHandler {
721
+ testStarted(data) {
722
+ return __awaiter(this, void 0, void 0, function* () {
723
+ const event = new GoogleCustomEvent('TestStarted');
724
+ return yield event.send(data);
961
725
  });
962
- };
963
- GoogleUserEventHandler.prototype.funnelStarted = function (data) {
964
- return __awaiter(this, void 0, void 0, function () {
965
- var event;
966
- return __generator(this, function (_a) {
967
- switch (_a.label) {
968
- case 0:
969
- event = new GoogleCustomEvent('FunnelStarted');
970
- return [4 /*yield*/, event.send(data)];
971
- case 1: return [2 /*return*/, _a.sent()];
972
- }
973
- });
726
+ }
727
+ funnelStarted(data) {
728
+ return __awaiter(this, void 0, void 0, function* () {
729
+ const event = new GoogleCustomEvent('FunnelStarted');
730
+ return yield event.send(data);
974
731
  });
975
- };
976
- GoogleUserEventHandler.prototype.viewContent = function (data) {
977
- return __awaiter(this, void 0, void 0, function () {
978
- var event;
979
- return __generator(this, function (_a) {
980
- switch (_a.label) {
981
- case 0:
982
- event = new GoogleCustomEvent('ViewContent');
983
- return [4 /*yield*/, event.send(data)];
984
- case 1: return [2 /*return*/, _a.sent()];
985
- }
986
- });
732
+ }
733
+ viewContent(data) {
734
+ return __awaiter(this, void 0, void 0, function* () {
735
+ const event = new GoogleCustomEvent('ViewContent');
736
+ return yield event.send(data);
987
737
  });
988
- };
989
- GoogleUserEventHandler.prototype.userClick = function (data) {
990
- return __awaiter(this, void 0, void 0, function () {
991
- var event;
992
- return __generator(this, function (_a) {
993
- switch (_a.label) {
994
- case 0:
995
- event = new GoogleCustomEvent('UserClick');
996
- return [4 /*yield*/, event.send(data)];
997
- case 1: return [2 /*return*/, _a.sent()];
998
- }
999
- });
738
+ }
739
+ userClick(data) {
740
+ return __awaiter(this, void 0, void 0, function* () {
741
+ const event = new GoogleCustomEvent('UserClick');
742
+ return yield event.send(data);
1000
743
  });
1001
- };
1002
- return GoogleUserEventHandler;
1003
- }());
1004
-
1005
- var GoogleStandardEvent = /** @class */ (function (_super) {
1006
- __extends(GoogleStandardEvent, _super);
1007
- function GoogleStandardEvent() {
1008
- return _super !== null && _super.apply(this, arguments) || this;
1009
744
  }
1010
- return GoogleStandardEvent;
1011
- }(GoogleBaseEvent));
745
+ }
1012
746
 
1013
- var GoogleStandardEvents = /** @class */ (function () {
1014
- function GoogleStandardEvents() {
1015
- }
1016
- GoogleStandardEvents.prototype.addPaymentInfo = function () {
747
+ class GoogleStandardEvent extends GoogleBaseEvent {
748
+ }
749
+
750
+ class GoogleStandardEvents {
751
+ addPaymentInfo() {
1017
752
  return new GoogleStandardEvent('add_paymennt_info');
1018
- };
1019
- GoogleStandardEvents.prototype.addShippingInfo = function () {
753
+ }
754
+ addShippingInfo() {
1020
755
  return new GoogleStandardEvent('add_shipping_info');
1021
- };
1022
- GoogleStandardEvents.prototype.addToCart = function () {
756
+ }
757
+ addToCart() {
1023
758
  return new GoogleStandardEvent('add_to_cart');
1024
- };
1025
- GoogleStandardEvents.prototype.addToWishList = function () {
759
+ }
760
+ addToWishList() {
1026
761
  return new GoogleStandardEvent('add_to_wishlist');
1027
- };
1028
- GoogleStandardEvents.prototype.beginCheckout = function () {
762
+ }
763
+ beginCheckout() {
1029
764
  return new GoogleStandardEvent('begin_checkout');
1030
- };
1031
- GoogleStandardEvents.prototype.earnVirtualCurrency = function () {
765
+ }
766
+ earnVirtualCurrency() {
1032
767
  return new GoogleStandardEvent('earn_virtual_currency');
1033
- };
1034
- GoogleStandardEvents.prototype.generateLead = function () {
768
+ }
769
+ generateLead() {
1035
770
  return new GoogleStandardEvent('generate_lead');
1036
- };
1037
- GoogleStandardEvents.prototype.joinGroup = function () {
771
+ }
772
+ joinGroup() {
1038
773
  return new GoogleStandardEvent('join_group');
1039
- };
1040
- GoogleStandardEvents.prototype.levelEnd = function () {
774
+ }
775
+ levelEnd() {
1041
776
  return new GoogleStandardEvent('level_end');
1042
- };
1043
- GoogleStandardEvents.prototype.levelStart = function () {
777
+ }
778
+ levelStart() {
1044
779
  return new GoogleStandardEvent('level_start');
1045
- };
1046
- GoogleStandardEvents.prototype.levelUp = function () {
780
+ }
781
+ levelUp() {
1047
782
  return new GoogleStandardEvent('level_up');
1048
- };
1049
- GoogleStandardEvents.prototype.login = function () {
783
+ }
784
+ login() {
1050
785
  return new GoogleStandardEvent('login');
1051
- };
1052
- GoogleStandardEvents.prototype.postScore = function () {
786
+ }
787
+ postScore() {
1053
788
  return new GoogleStandardEvent('post_score');
1054
- };
1055
- GoogleStandardEvents.prototype.purchase = function () {
789
+ }
790
+ purchase() {
1056
791
  return new GoogleStandardEvent('purchase');
1057
- };
1058
- GoogleStandardEvents.prototype.refund = function () {
792
+ }
793
+ refund() {
1059
794
  return new GoogleStandardEvent('refund');
1060
- };
1061
- GoogleStandardEvents.prototype.removeFromCart = function () {
795
+ }
796
+ removeFromCart() {
1062
797
  return new GoogleStandardEvent('remove_from_cart');
1063
- };
1064
- GoogleStandardEvents.prototype.search = function () {
798
+ }
799
+ search() {
1065
800
  return new GoogleStandardEvent('search');
1066
- };
1067
- GoogleStandardEvents.prototype.selectContent = function () {
801
+ }
802
+ selectContent() {
1068
803
  return new GoogleStandardEvent('select_content');
1069
- };
1070
- GoogleStandardEvents.prototype.selectItem = function () {
804
+ }
805
+ selectItem() {
1071
806
  return new GoogleStandardEvent('select_item');
1072
- };
1073
- GoogleStandardEvents.prototype.selectPromotion = function () {
807
+ }
808
+ selectPromotion() {
1074
809
  return new GoogleStandardEvent('select_promotion');
1075
- };
1076
- GoogleStandardEvents.prototype.share = function () {
810
+ }
811
+ share() {
1077
812
  return new GoogleStandardEvent('share');
1078
- };
1079
- GoogleStandardEvents.prototype.signUp = function () {
813
+ }
814
+ signUp() {
1080
815
  return new GoogleStandardEvent('sign_up');
1081
- };
1082
- GoogleStandardEvents.prototype.spendVirtualCurrency = function () {
816
+ }
817
+ spendVirtualCurrency() {
1083
818
  return new GoogleStandardEvent('spend_virtual_currency');
1084
- };
1085
- GoogleStandardEvents.prototype.tutorialBegin = function () {
819
+ }
820
+ tutorialBegin() {
1086
821
  return new GoogleStandardEvent('tutorial_begin');
1087
- };
1088
- GoogleStandardEvents.prototype.tutorialComplete = function () {
822
+ }
823
+ tutorialComplete() {
1089
824
  return new GoogleStandardEvent('tutorial_complete');
1090
- };
1091
- GoogleStandardEvents.prototype.unlockAchievement = function () {
825
+ }
826
+ unlockAchievement() {
1092
827
  return new GoogleStandardEvent('unlock_achievement');
1093
- };
1094
- GoogleStandardEvents.prototype.viewCart = function () {
828
+ }
829
+ viewCart() {
1095
830
  return new GoogleStandardEvent('view_cart');
1096
- };
1097
- GoogleStandardEvents.prototype.viewItem = function () {
831
+ }
832
+ viewItem() {
1098
833
  return new GoogleStandardEvent('view_item');
1099
- };
1100
- GoogleStandardEvents.prototype.viewItemList = function () {
834
+ }
835
+ viewItemList() {
1101
836
  return new GoogleStandardEvent('view_item_list');
1102
- };
1103
- GoogleStandardEvents.prototype.viewPromotion = function () {
837
+ }
838
+ viewPromotion() {
1104
839
  return new GoogleStandardEvent('view_promotion');
1105
- };
1106
- return GoogleStandardEvents;
1107
- }());
1108
-
1109
- var Rdt = /** @class */ (function () {
1110
- function Rdt() {
1111
840
  }
1112
- Rdt.init = function (pixelId) {
841
+ }
842
+
843
+ class Rdt {
844
+ static init(pixelId) {
1113
845
  try {
1114
846
  Rdt.instance = new Rdt();
1115
847
  Rdt.instance.load(pixelId);
@@ -1118,553 +850,391 @@ var Rdt = /** @class */ (function () {
1118
850
  catch (ex) {
1119
851
  console.error(ex);
1120
852
  }
1121
- };
1122
- Rdt.getRdt = function () {
853
+ }
854
+ static getRdt() {
1123
855
  if (global.rdt) {
1124
856
  return global.rdt;
1125
857
  }
1126
858
  console.warn('Missing rdt');
1127
- };
1128
- Rdt.prototype.load = function (id) {
859
+ }
860
+ load(id) {
1129
861
  try {
1130
862
  Rdt.getRdt()('init', id);
1131
863
  }
1132
864
  catch (ex) {
1133
865
  console.error(ex);
1134
866
  }
1135
- };
1136
- Rdt.prototype.track = function (event, data) {
867
+ }
868
+ track(event, data) {
1137
869
  try {
1138
- Rdt.getRdt()('track', event, __assign({}, data));
870
+ Rdt.getRdt()('track', event, Object.assign({}, data));
1139
871
  }
1140
872
  catch (ex) {
1141
873
  console.error(ex);
1142
874
  }
1143
- };
1144
- return Rdt;
1145
- }());
875
+ }
876
+ }
1146
877
 
1147
- var RedditBaseEvent = /** @class */ (function () {
1148
- function RedditBaseEvent(name) {
878
+ class RedditBaseEvent {
879
+ constructor(name) {
1149
880
  this.name = name;
1150
881
  this.rdt = assertEx(Rdt.instance, 'Missing Rdt');
1151
882
  }
1152
- RedditBaseEvent.prototype.send = function (_data) {
1153
- return __awaiter(this, void 0, void 0, function () {
1154
- return __generator(this, function (_a) {
1155
- switch (_a.label) {
1156
- case 0: return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
1157
- case 1:
1158
- _a.sent(); //force async to increase reporting odds
1159
- return [2 /*return*/];
1160
- }
1161
- });
883
+ send(_data) {
884
+ return __awaiter(this, void 0, void 0, function* () {
885
+ yield delay(0); //force async to increase reporting odds
1162
886
  });
1163
- };
1164
- return RedditBaseEvent;
1165
- }());
1166
-
1167
- var RedditCustomEvent = /** @class */ (function (_super) {
1168
- __extends(RedditCustomEvent, _super);
1169
- function RedditCustomEvent() {
1170
- return _super !== null && _super.apply(this, arguments) || this;
1171
- }
1172
- RedditCustomEvent.prototype.send = function (data) {
1173
- return __awaiter(this, void 0, void 0, function () {
1174
- return __generator(this, function (_a) {
1175
- switch (_a.label) {
1176
- case 0:
1177
- this.rdt.track(this.name, data);
1178
- return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
1179
- case 1:
1180
- _a.sent(); //force async to increase reporting odds
1181
- return [2 /*return*/];
1182
- }
1183
- });
1184
- });
1185
- };
1186
- return RedditCustomEvent;
1187
- }(RedditBaseEvent));
1188
-
1189
- var RedditStandardEvent = /** @class */ (function (_super) {
1190
- __extends(RedditStandardEvent, _super);
1191
- function RedditStandardEvent() {
1192
- return _super !== null && _super.apply(this, arguments) || this;
1193
- }
1194
- RedditStandardEvent.prototype.send = function (data) {
1195
- return __awaiter(this, void 0, void 0, function () {
1196
- return __generator(this, function (_a) {
1197
- switch (_a.label) {
1198
- case 0:
1199
- this.rdt.track(this.name, data);
1200
- return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
1201
- case 1:
1202
- _a.sent(); //force async to increase reporting odds
1203
- return [2 /*return*/];
1204
- }
1205
- });
887
+ }
888
+ }
889
+
890
+ class RedditCustomEvent extends RedditBaseEvent {
891
+ send(data) {
892
+ return __awaiter(this, void 0, void 0, function* () {
893
+ this.rdt.track(this.name, data);
894
+ yield delay(0); //force async to increase reporting odds
1206
895
  });
1207
- };
1208
- return RedditStandardEvent;
1209
- }(RedditBaseEvent));
896
+ }
897
+ }
1210
898
 
1211
- var RedditStandardEvents = /** @class */ (function () {
1212
- function RedditStandardEvents() {
899
+ class RedditStandardEvent extends RedditBaseEvent {
900
+ send(data) {
901
+ return __awaiter(this, void 0, void 0, function* () {
902
+ this.rdt.track(this.name, data);
903
+ yield delay(0); //force async to increase reporting odds
904
+ });
1213
905
  }
1214
- RedditStandardEvents.prototype.pageView = function () {
906
+ }
907
+
908
+ class RedditStandardEvents {
909
+ pageView() {
1215
910
  return new RedditStandardEvent('PageView');
1216
- };
1217
- RedditStandardEvents.prototype.viewContent = function () {
911
+ }
912
+ viewContent() {
1218
913
  return new RedditStandardEvent('ViewContent');
1219
- };
1220
- RedditStandardEvents.prototype.addToCart = function () {
914
+ }
915
+ addToCart() {
1221
916
  return new RedditStandardEvent('AddToCart');
1222
- };
1223
- RedditStandardEvents.prototype.addToWishlist = function () {
917
+ }
918
+ addToWishlist() {
1224
919
  return new RedditStandardEvent('AddToWishlist');
1225
- };
1226
- RedditStandardEvents.prototype.purchase = function () {
920
+ }
921
+ purchase() {
1227
922
  return new RedditStandardEvent('Purchase');
1228
- };
1229
- RedditStandardEvents.prototype.signup = function () {
923
+ }
924
+ signup() {
1230
925
  return new RedditStandardEvent('SignUp');
1231
- };
1232
- RedditStandardEvents.prototype.lead = function () {
926
+ }
927
+ lead() {
1233
928
  return new RedditStandardEvent('Lead');
1234
- };
1235
- RedditStandardEvents.prototype.search = function () {
929
+ }
930
+ search() {
1236
931
  return new RedditStandardEvent('Search');
1237
- };
1238
- return RedditStandardEvents;
1239
- }());
1240
-
1241
- var SnapTr = /** @class */ (function () {
1242
- function SnapTr() {
1243
932
  }
1244
- SnapTr.getSnapTr = function () {
933
+ }
934
+
935
+ class SnapTr {
936
+ static getSnapTr() {
1245
937
  if (global.snaptr) {
1246
938
  return global.snaptr;
1247
939
  }
1248
940
  console.warn('Missing snaptr');
1249
- };
1250
- SnapTr.track = function (event, data) {
1251
- return __awaiter(this, void 0, void 0, function () {
1252
- return __generator(this, function (_a) {
1253
- switch (_a.label) {
1254
- case 0:
1255
- this.getSnapTr()('track', event, data);
1256
- return [4 /*yield*/, delay(0)];
1257
- case 1:
1258
- _a.sent();
1259
- return [2 /*return*/];
1260
- }
1261
- });
941
+ }
942
+ static track(event, data) {
943
+ return __awaiter(this, void 0, void 0, function* () {
944
+ this.getSnapTr()('track', event, data);
945
+ yield delay(0);
1262
946
  });
1263
- };
1264
- return SnapTr;
1265
- }());
947
+ }
948
+ }
1266
949
 
1267
- var SnapchatBaseEvent = /** @class */ (function () {
1268
- function SnapchatBaseEvent(name) {
950
+ class SnapchatBaseEvent {
951
+ constructor(name) {
1269
952
  this.name = name;
1270
953
  }
1271
- SnapchatBaseEvent.prototype.send = function (_data) {
1272
- return __awaiter(this, void 0, void 0, function () {
1273
- return __generator(this, function (_a) {
1274
- switch (_a.label) {
1275
- case 0: return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
1276
- case 1:
1277
- _a.sent(); //force async to increase reporting odds
1278
- return [2 /*return*/];
1279
- }
1280
- });
954
+ send(_data) {
955
+ return __awaiter(this, void 0, void 0, function* () {
956
+ yield delay(0); //force async to increase reporting odds
1281
957
  });
1282
- };
1283
- return SnapchatBaseEvent;
1284
- }());
1285
-
1286
- var SnapchatStandardEvent = /** @class */ (function (_super) {
1287
- __extends(SnapchatStandardEvent, _super);
1288
- function SnapchatStandardEvent() {
1289
- return _super !== null && _super.apply(this, arguments) || this;
1290
- }
1291
- SnapchatStandardEvent.prototype.send = function (data) {
1292
- return __awaiter(this, void 0, void 0, function () {
1293
- return __generator(this, function (_a) {
1294
- switch (_a.label) {
1295
- case 0: return [4 /*yield*/, SnapTr.track(this.name, data)];
1296
- case 1:
1297
- _a.sent();
1298
- return [2 /*return*/];
1299
- }
1300
- });
1301
- });
1302
- };
1303
- return SnapchatStandardEvent;
1304
- }(SnapchatBaseEvent));
958
+ }
959
+ }
1305
960
 
1306
- var SnapchatStandardEvents = /** @class */ (function () {
1307
- function SnapchatStandardEvents() {
961
+ class SnapchatStandardEvent extends SnapchatBaseEvent {
962
+ send(data) {
963
+ return __awaiter(this, void 0, void 0, function* () {
964
+ yield SnapTr.track(this.name, data);
965
+ });
1308
966
  }
1309
- SnapchatStandardEvents.prototype.pageView = function () {
967
+ }
968
+
969
+ class SnapchatStandardEvents {
970
+ pageView() {
1310
971
  return new SnapchatStandardEvent('PAGE_VIEW');
1311
- };
1312
- SnapchatStandardEvents.prototype.signUp = function () {
972
+ }
973
+ signUp() {
1313
974
  return new SnapchatStandardEvent('SIGN_UP');
1314
- };
1315
- SnapchatStandardEvents.prototype.purchase = function () {
975
+ }
976
+ purchase() {
1316
977
  return new SnapchatStandardEvent('PURCHASE');
1317
- };
1318
- SnapchatStandardEvents.prototype.save = function () {
978
+ }
979
+ save() {
1319
980
  return new SnapchatStandardEvent('SAVE');
1320
- };
1321
- SnapchatStandardEvents.prototype.startCheckout = function () {
981
+ }
982
+ startCheckout() {
1322
983
  return new SnapchatStandardEvent('START_CHECKOUT');
1323
- };
1324
- SnapchatStandardEvents.prototype.addCart = function () {
984
+ }
985
+ addCart() {
1325
986
  return new SnapchatStandardEvent('ADD_CART');
1326
- };
1327
- SnapchatStandardEvents.prototype.openApp = function () {
987
+ }
988
+ openApp() {
1328
989
  return new SnapchatStandardEvent('OPEN_APP');
1329
- };
1330
- SnapchatStandardEvents.prototype.viewContent = function () {
990
+ }
991
+ viewContent() {
1331
992
  return new SnapchatStandardEvent('VIEW_CONTENT');
1332
- };
1333
- SnapchatStandardEvents.prototype.addBilling = function () {
993
+ }
994
+ addBilling() {
1334
995
  return new SnapchatStandardEvent('ADD_BILLING');
1335
- };
1336
- SnapchatStandardEvents.prototype.search = function () {
996
+ }
997
+ search() {
1337
998
  return new SnapchatStandardEvent('SEARCH');
1338
- };
1339
- SnapchatStandardEvents.prototype.subscribe = function () {
999
+ }
1000
+ subscribe() {
1340
1001
  return new SnapchatStandardEvent('SUBSCRIBE');
1341
- };
1342
- SnapchatStandardEvents.prototype.adClick = function () {
1002
+ }
1003
+ adClick() {
1343
1004
  return new SnapchatStandardEvent('AD_CLICK');
1344
- };
1345
- SnapchatStandardEvents.prototype.adView = function () {
1005
+ }
1006
+ adView() {
1346
1007
  return new SnapchatStandardEvent('AD_VIEW');
1347
- };
1348
- SnapchatStandardEvents.prototype.completeTutorial = function () {
1008
+ }
1009
+ completeTutorial() {
1349
1010
  return new SnapchatStandardEvent('COMPLETE_TUTORIAL');
1350
- };
1351
- SnapchatStandardEvents.prototype.invite = function () {
1011
+ }
1012
+ invite() {
1352
1013
  return new SnapchatStandardEvent('INVITE');
1353
- };
1354
- SnapchatStandardEvents.prototype.login = function () {
1014
+ }
1015
+ login() {
1355
1016
  return new SnapchatStandardEvent('LOGIN');
1356
- };
1357
- SnapchatStandardEvents.prototype.share = function () {
1017
+ }
1018
+ share() {
1358
1019
  return new SnapchatStandardEvent('SHARE');
1359
- };
1360
- SnapchatStandardEvents.prototype.reserve = function () {
1020
+ }
1021
+ reserve() {
1361
1022
  return new SnapchatStandardEvent('RESERVE');
1362
- };
1363
- SnapchatStandardEvents.prototype.achievementUnlocked = function () {
1023
+ }
1024
+ achievementUnlocked() {
1364
1025
  return new SnapchatStandardEvent('ACHIEVEMENT_UNLOCKED');
1365
- };
1366
- SnapchatStandardEvents.prototype.addToWishlist = function () {
1026
+ }
1027
+ addToWishlist() {
1367
1028
  return new SnapchatStandardEvent('ADD_TO_WISHLIST');
1368
- };
1369
- SnapchatStandardEvents.prototype.spentCredits = function () {
1029
+ }
1030
+ spentCredits() {
1370
1031
  return new SnapchatStandardEvent('SPENT_CREDITS');
1371
- };
1372
- SnapchatStandardEvents.prototype.rate = function () {
1032
+ }
1033
+ rate() {
1373
1034
  return new SnapchatStandardEvent('RATE');
1374
- };
1375
- SnapchatStandardEvents.prototype.startTrial = function () {
1035
+ }
1036
+ startTrial() {
1376
1037
  return new SnapchatStandardEvent('START_TRIAL');
1377
- };
1378
- SnapchatStandardEvents.prototype.listView = function () {
1038
+ }
1039
+ listView() {
1379
1040
  return new SnapchatStandardEvent('LIST_VIEW');
1380
- };
1381
- SnapchatStandardEvents.prototype.custom1 = function () {
1041
+ }
1042
+ custom1() {
1382
1043
  return new SnapchatStandardEvent('CUSTOM_EVENT_1');
1383
- };
1384
- SnapchatStandardEvents.prototype.custom2 = function () {
1044
+ }
1045
+ custom2() {
1385
1046
  return new SnapchatStandardEvent('CUSTOM_EVENT_2');
1386
- };
1387
- SnapchatStandardEvents.prototype.custom3 = function () {
1047
+ }
1048
+ custom3() {
1388
1049
  return new SnapchatStandardEvent('CUSTOM_EVENT_3');
1389
- };
1390
- SnapchatStandardEvents.prototype.custom4 = function () {
1050
+ }
1051
+ custom4() {
1391
1052
  return new SnapchatStandardEvent('CUSTOM_EVENT_4');
1392
- };
1393
- SnapchatStandardEvents.prototype.custom5 = function () {
1053
+ }
1054
+ custom5() {
1394
1055
  return new SnapchatStandardEvent('CUSTOM_EVENT_5');
1395
- };
1396
- return SnapchatStandardEvents;
1397
- }());
1398
-
1399
- var Ttq = /** @class */ (function () {
1400
- function Ttq() {
1401
1056
  }
1402
- Ttq.init = function (pixelId) {
1057
+ }
1058
+
1059
+ class Ttq {
1060
+ static init(pixelId) {
1403
1061
  try {
1404
1062
  Ttq.instance = new Ttq();
1405
1063
  Ttq.getTtq().load(pixelId);
1406
1064
  Ttq.page();
1407
1065
  }
1408
1066
  catch (ex) {
1409
- console.error("Ttq.init: ".concat(ex));
1067
+ console.error(`Ttq.init: ${ex}`);
1410
1068
  }
1411
- };
1412
- Ttq.getTtq = function () {
1069
+ }
1070
+ static getTtq() {
1413
1071
  if (global.ttq) {
1414
1072
  return global.ttq;
1415
1073
  }
1416
1074
  console.warn('Missing ttq');
1417
- };
1418
- Ttq.page = function () {
1075
+ }
1076
+ static page() {
1419
1077
  try {
1420
1078
  Ttq.getTtq().page();
1421
1079
  }
1422
1080
  catch (ex) {
1423
- console.error("Ttq.page: ".concat(ex));
1081
+ console.error(`Ttq.page: ${ex}`);
1424
1082
  }
1425
- };
1426
- Ttq.prototype.track = function (event, data) {
1083
+ }
1084
+ track(event, data) {
1427
1085
  try {
1428
- Ttq.getTtq().track(event, __assign({}, data));
1086
+ Ttq.getTtq().track(event, Object.assign({}, data));
1429
1087
  }
1430
1088
  catch (ex) {
1431
- console.error("Ttq.track: ".concat(ex));
1089
+ console.error(`Ttq.track: ${ex}`);
1432
1090
  }
1433
- };
1434
- return Ttq;
1435
- }());
1091
+ }
1092
+ }
1436
1093
 
1437
- var TiktokBaseEvent = /** @class */ (function () {
1438
- function TiktokBaseEvent(name) {
1094
+ class TiktokBaseEvent {
1095
+ constructor(name) {
1439
1096
  this.name = name;
1440
1097
  this.ttq = assertEx(Ttq.instance, 'Missing Ttq');
1441
1098
  }
1442
- TiktokBaseEvent.prototype.send = function (_data) {
1443
- return __awaiter(this, void 0, void 0, function () {
1444
- return __generator(this, function (_a) {
1445
- switch (_a.label) {
1446
- case 0: return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
1447
- case 1:
1448
- _a.sent(); //force async to increase reporting odds
1449
- return [2 /*return*/];
1450
- }
1451
- });
1452
- });
1453
- };
1454
- return TiktokBaseEvent;
1455
- }());
1456
-
1457
- var TiktokCustomEvent = /** @class */ (function (_super) {
1458
- __extends(TiktokCustomEvent, _super);
1459
- function TiktokCustomEvent() {
1460
- return _super !== null && _super.apply(this, arguments) || this;
1461
- }
1462
- TiktokCustomEvent.prototype.send = function (data) {
1463
- return __awaiter(this, void 0, void 0, function () {
1464
- return __generator(this, function (_a) {
1465
- switch (_a.label) {
1466
- case 0:
1467
- this.ttq.track(this.name, data);
1468
- return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
1469
- case 1:
1470
- _a.sent(); //force async to increase reporting odds
1471
- return [2 /*return*/];
1472
- }
1473
- });
1099
+ send(_data) {
1100
+ return __awaiter(this, void 0, void 0, function* () {
1101
+ yield delay(0); //force async to increase reporting odds
1474
1102
  });
1475
- };
1476
- return TiktokCustomEvent;
1477
- }(TiktokBaseEvent));
1478
-
1479
- var TiktokStandardEvent = /** @class */ (function (_super) {
1480
- __extends(TiktokStandardEvent, _super);
1481
- function TiktokStandardEvent() {
1482
- return _super !== null && _super.apply(this, arguments) || this;
1483
- }
1484
- TiktokStandardEvent.prototype.send = function (data) {
1485
- return __awaiter(this, void 0, void 0, function () {
1486
- return __generator(this, function (_a) {
1487
- switch (_a.label) {
1488
- case 0:
1489
- this.ttq.track(this.name, data);
1490
- return [4 /*yield*/, delay(0)]; //force async to increase reporting odds
1491
- case 1:
1492
- _a.sent(); //force async to increase reporting odds
1493
- return [2 /*return*/];
1494
- }
1495
- });
1103
+ }
1104
+ }
1105
+
1106
+ class TiktokCustomEvent extends TiktokBaseEvent {
1107
+ send(data) {
1108
+ return __awaiter(this, void 0, void 0, function* () {
1109
+ this.ttq.track(this.name, data);
1110
+ yield delay(0); //force async to increase reporting odds
1496
1111
  });
1497
- };
1498
- return TiktokStandardEvent;
1499
- }(TiktokBaseEvent));
1112
+ }
1113
+ }
1500
1114
 
1501
- var TiktokStandardEvents = /** @class */ (function () {
1502
- function TiktokStandardEvents() {
1115
+ class TiktokStandardEvent extends TiktokBaseEvent {
1116
+ send(data) {
1117
+ return __awaiter(this, void 0, void 0, function* () {
1118
+ this.ttq.track(this.name, data);
1119
+ yield delay(0); //force async to increase reporting odds
1120
+ });
1503
1121
  }
1504
- TiktokStandardEvents.prototype.pageView = function () {
1122
+ }
1123
+
1124
+ class TiktokStandardEvents {
1125
+ pageView() {
1505
1126
  return new TiktokStandardEvent('Browse');
1506
- };
1507
- TiktokStandardEvents.prototype.viewContent = function () {
1127
+ }
1128
+ viewContent() {
1508
1129
  return new TiktokStandardEvent('ViewContent');
1509
- };
1510
- TiktokStandardEvents.prototype.addToCart = function () {
1130
+ }
1131
+ addToCart() {
1511
1132
  return new TiktokStandardEvent('AddToCart');
1512
- };
1513
- TiktokStandardEvents.prototype.checkout = function () {
1133
+ }
1134
+ checkout() {
1514
1135
  return new TiktokStandardEvent('Checkout');
1515
- };
1516
- TiktokStandardEvents.prototype.purchase = function () {
1136
+ }
1137
+ purchase() {
1517
1138
  return new TiktokStandardEvent('Purchase');
1518
- };
1519
- TiktokStandardEvents.prototype.registration = function () {
1139
+ }
1140
+ registration() {
1520
1141
  return new TiktokStandardEvent('Registration');
1521
- };
1522
- TiktokStandardEvents.prototype.startCheckout = function () {
1142
+ }
1143
+ startCheckout() {
1523
1144
  return new TiktokStandardEvent('StartCheckout');
1524
- };
1525
- TiktokStandardEvents.prototype.addBilling = function () {
1145
+ }
1146
+ addBilling() {
1526
1147
  return new TiktokStandardEvent('AddBilling');
1527
- };
1528
- TiktokStandardEvents.prototype.search = function () {
1148
+ }
1149
+ search() {
1529
1150
  return new TiktokStandardEvent('Search');
1530
- };
1531
- TiktokStandardEvents.prototype.viewForm = function () {
1151
+ }
1152
+ viewForm() {
1532
1153
  return new TiktokStandardEvent('ViewForm');
1533
- };
1534
- TiktokStandardEvents.prototype.clickForm = function () {
1154
+ }
1155
+ clickForm() {
1535
1156
  return new TiktokStandardEvent('ClickForm');
1536
- };
1537
- TiktokStandardEvents.prototype.submitForm = function () {
1157
+ }
1158
+ submitForm() {
1538
1159
  return new TiktokStandardEvent('SubmitForm');
1539
- };
1540
- TiktokStandardEvents.prototype.viewDownloadPage = function () {
1160
+ }
1161
+ viewDownloadPage() {
1541
1162
  return new TiktokStandardEvent('ViewDownloadPage');
1542
- };
1543
- TiktokStandardEvents.prototype.clickInDownloadPage = function () {
1163
+ }
1164
+ clickInDownloadPage() {
1544
1165
  return new TiktokStandardEvent('ClickInDownloadPage');
1545
- };
1546
- TiktokStandardEvents.prototype.clickToDownload = function () {
1166
+ }
1167
+ clickToDownload() {
1547
1168
  return new TiktokStandardEvent('ClickToDownload');
1548
- };
1549
- TiktokStandardEvents.prototype.clickButton = function () {
1169
+ }
1170
+ clickButton() {
1550
1171
  return new TiktokStandardEvent('ClickButton');
1551
- };
1552
- return TiktokStandardEvents;
1553
- }());
1172
+ }
1173
+ }
1554
1174
 
1555
- var XyBaseEvent = /** @class */ (function () {
1556
- function XyBaseEvent(name) {
1175
+ class XyBaseEvent {
1176
+ constructor(name) {
1557
1177
  this.name = name;
1558
1178
  }
1559
- XyBaseEvent.prototype.send = function (fields) {
1560
- return __awaiter(this, void 0, void 0, function () {
1561
- return __generator(this, function (_a) {
1562
- switch (_a.label) {
1563
- case 0: return [4 /*yield*/, XyPixel.instance.send(this.name, fields)];
1564
- case 1:
1565
- _a.sent();
1566
- return [2 /*return*/];
1567
- }
1568
- });
1179
+ send(fields) {
1180
+ return __awaiter(this, void 0, void 0, function* () {
1181
+ yield XyPixel.instance.send(this.name, fields);
1569
1182
  });
1570
- };
1571
- return XyBaseEvent;
1572
- }());
1573
-
1574
- var XyCustomEvent = /** @class */ (function (_super) {
1575
- __extends(XyCustomEvent, _super);
1576
- function XyCustomEvent() {
1577
- return _super !== null && _super.apply(this, arguments) || this;
1578
- }
1579
- return XyCustomEvent;
1580
- }(XyBaseEvent));
1581
-
1582
- var XyUserEventHandler = /** @class */ (function () {
1583
- function XyUserEventHandler() {
1584
- }
1585
- XyUserEventHandler.prototype.testStarted = function (data) {
1586
- return __awaiter(this, void 0, void 0, function () {
1587
- var event;
1588
- return __generator(this, function (_a) {
1589
- switch (_a.label) {
1590
- case 0:
1591
- event = new XyCustomEvent('TestStarted');
1592
- return [4 /*yield*/, event.send(data)];
1593
- case 1: return [2 /*return*/, _a.sent()];
1594
- }
1595
- });
1183
+ }
1184
+ }
1185
+
1186
+ class XyCustomEvent extends XyBaseEvent {
1187
+ }
1188
+
1189
+ class XyUserEventHandler {
1190
+ testStarted(data) {
1191
+ return __awaiter(this, void 0, void 0, function* () {
1192
+ const event = new XyCustomEvent('TestStarted');
1193
+ return yield event.send(data);
1596
1194
  });
1597
- };
1598
- XyUserEventHandler.prototype.funnelStarted = function (data) {
1599
- return __awaiter(this, void 0, void 0, function () {
1600
- var event;
1601
- return __generator(this, function (_a) {
1602
- switch (_a.label) {
1603
- case 0:
1604
- event = new XyCustomEvent('FunnelStarted');
1605
- return [4 /*yield*/, event.send(data)];
1606
- case 1: return [2 /*return*/, _a.sent()];
1607
- }
1608
- });
1195
+ }
1196
+ funnelStarted(data) {
1197
+ return __awaiter(this, void 0, void 0, function* () {
1198
+ const event = new XyCustomEvent('FunnelStarted');
1199
+ return yield event.send(data);
1609
1200
  });
1610
- };
1611
- XyUserEventHandler.prototype.viewContent = function (data) {
1612
- return __awaiter(this, void 0, void 0, function () {
1613
- var event;
1614
- return __generator(this, function (_a) {
1615
- switch (_a.label) {
1616
- case 0:
1617
- event = new XyCustomEvent('ViewContent');
1618
- return [4 /*yield*/, event.send(data)];
1619
- case 1: return [2 /*return*/, _a.sent()];
1620
- }
1621
- });
1201
+ }
1202
+ viewContent(data) {
1203
+ return __awaiter(this, void 0, void 0, function* () {
1204
+ const event = new XyCustomEvent('ViewContent');
1205
+ return yield event.send(data);
1622
1206
  });
1623
- };
1624
- XyUserEventHandler.prototype.userClick = function (data) {
1625
- return __awaiter(this, void 0, void 0, function () {
1626
- var event;
1627
- return __generator(this, function (_a) {
1628
- switch (_a.label) {
1629
- case 0:
1630
- event = new XyCustomEvent('UserClick');
1631
- return [4 /*yield*/, event.send(data)];
1632
- case 1: return [2 /*return*/, _a.sent()];
1633
- }
1634
- });
1207
+ }
1208
+ userClick(data) {
1209
+ return __awaiter(this, void 0, void 0, function* () {
1210
+ const event = new XyCustomEvent('UserClick');
1211
+ return yield event.send(data);
1635
1212
  });
1636
- };
1637
- return XyUserEventHandler;
1638
- }());
1213
+ }
1214
+ }
1639
1215
 
1640
- var MetaMaskEthersLoader = function (props) {
1641
- var children = props.children, _a = props.enabled, enabled = _a === void 0 ? true : _a;
1216
+ const MetaMaskEthersLoader = (props) => {
1217
+ const { children, enabled = true } = props;
1642
1218
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1643
- var global = window;
1644
- var ethereum = global.ethereum;
1645
- var _b = __read(useState(), 2), error = _b[0], setError = _b[1];
1646
- var _c = __read(useState(), 2), localAddress = _c[0], setLocalAddress = _c[1];
1647
- var _d = __read(useState(0), 2), resetCount = _d[0], setResetCount = _d[1];
1648
- var _e = __read(useState(), 2), providerName = _e[0], setProviderName = _e[1];
1219
+ const global = window;
1220
+ const ethereum = global.ethereum;
1221
+ const [error, setError] = useState();
1222
+ const [localAddress, setLocalAddress] = useState();
1223
+ const [resetCount, setResetCount] = useState(0);
1224
+ const [providerName, setProviderName] = useState();
1649
1225
  if (ethereum) {
1650
1226
  ethereum.autoRefreshOnNetworkChange = false;
1651
1227
  }
1652
- var connect = function () { return __awaiter(void 0, void 0, void 0, function () {
1228
+ const connect = () => __awaiter(void 0, void 0, void 0, function* () {
1653
1229
  var _a;
1654
- return __generator(this, function (_b) {
1655
- switch (_b.label) {
1656
- case 0: return [4 /*yield*/, ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.enable())];
1657
- case 1:
1658
- _b.sent();
1659
- return [2 /*return*/, localAddress ? [localAddress.toString()] : []];
1660
- }
1661
- });
1662
- }); };
1663
- var _f = __read(useState(), 2), isConnected = _f[0], setIsConnected = _f[1];
1664
- useEffect(function () {
1230
+ yield ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.enable());
1231
+ return localAddress ? [localAddress.toString()] : [];
1232
+ });
1233
+ const [isConnected, setIsConnected] = useState();
1234
+ useEffect(() => {
1665
1235
  if (ethereum && enabled) {
1666
- ethereum.on('accountsChanged', function (accounts) {
1667
- console.log("accountsChanged: ".concat(JSON.stringify(accounts)));
1236
+ ethereum.on('accountsChanged', (accounts) => {
1237
+ console.log(`accountsChanged: ${JSON.stringify(accounts)}`);
1668
1238
  setResetCount(resetCount + 1);
1669
1239
  if (accounts.length > 0) {
1670
1240
  setLocalAddress(EthAddress.fromString(accounts[0]));
@@ -1673,7 +1243,7 @@ var MetaMaskEthersLoader = function (props) {
1673
1243
  setLocalAddress(undefined);
1674
1244
  }
1675
1245
  });
1676
- ethereum.on('chainChanged', function (chainId) {
1246
+ ethereum.on('chainChanged', (chainId) => {
1677
1247
  setResetCount(resetCount + 1);
1678
1248
  if (chainId) {
1679
1249
  setChainId(parseInt(chainId));
@@ -1684,130 +1254,103 @@ var MetaMaskEthersLoader = function (props) {
1684
1254
  });
1685
1255
  }
1686
1256
  }, [ethereum, resetCount, enabled]);
1687
- var _g = __read(useState(), 2), walletProvider = _g[0], setWalletProvider = _g[1];
1688
- var _h = __read(useState(), 2), provider = _h[0], setProvider = _h[1];
1689
- var _j = __read(useState(), 2), signer = _j[0], setSigner = _j[1];
1690
- useEffect(function () {
1257
+ const [walletProvider, setWalletProvider] = useState();
1258
+ const [provider, setProvider] = useState();
1259
+ const [signer, setSigner] = useState();
1260
+ useEffect(() => {
1691
1261
  if (enabled) {
1692
- var walletProvider_1 = ethereum ? new Web3Provider(ethereum) : null;
1693
- var provider_1 = null;
1694
- var providerName_1 = null;
1695
- if (walletProvider_1) {
1696
- provider_1 = walletProvider_1;
1697
- providerName_1 = 'Meta Mask';
1262
+ const walletProvider = ethereum ? new Web3Provider(ethereum) : null;
1263
+ let provider = null;
1264
+ let providerName = null;
1265
+ if (walletProvider) {
1266
+ provider = walletProvider;
1267
+ providerName = 'Meta Mask';
1698
1268
  }
1699
1269
  else {
1700
- provider_1 = new InfuraProvider(1, infuraKey);
1701
- providerName_1 = 'Infura (Default)';
1270
+ provider = new InfuraProvider(1, infuraKey);
1271
+ providerName = 'Infura (Default)';
1702
1272
  }
1703
- provider_1 = walletProvider_1 !== null && walletProvider_1 !== void 0 ? walletProvider_1 : provider_1;
1704
- setProvider(provider_1);
1705
- setProviderName(providerName_1);
1706
- setWalletProvider(walletProvider_1);
1707
- var signer_1 = null;
1273
+ provider = walletProvider !== null && walletProvider !== void 0 ? walletProvider : provider;
1274
+ setProvider(provider);
1275
+ setProviderName(providerName);
1276
+ setWalletProvider(walletProvider);
1277
+ let signer = null;
1708
1278
  try {
1709
- signer_1 = walletProvider_1 === null || walletProvider_1 === void 0 ? void 0 : walletProvider_1.getSigner();
1279
+ signer = walletProvider === null || walletProvider === void 0 ? void 0 : walletProvider.getSigner();
1710
1280
  }
1711
1281
  catch (ex) {
1712
1282
  console.error(ex);
1713
1283
  }
1714
- setSigner(signer_1);
1284
+ setSigner(signer);
1715
1285
  }
1716
1286
  }, [ethereum, isConnected, enabled]);
1717
- useAsyncEffect(function (isMounted) { return __awaiter(void 0, void 0, void 0, function () {
1718
- var localAddress_1, _a, _b, ex_1;
1719
- return __generator(this, function (_c) {
1720
- switch (_c.label) {
1721
- case 0:
1722
- if (!(signer && enabled)) return [3 /*break*/, 4];
1723
- _c.label = 1;
1724
- case 1:
1725
- _c.trys.push([1, 3, , 4]);
1726
- _b = (_a = EthAddress).fromString;
1727
- return [4 /*yield*/, signer.getAddress()];
1728
- case 2:
1729
- localAddress_1 = _b.apply(_a, [_c.sent()]);
1730
- console.log("Setting Local Address: ".concat(localAddress_1));
1731
- if (isMounted()) {
1732
- setLocalAddress(localAddress_1);
1733
- setIsConnected(true);
1734
- }
1735
- return [3 /*break*/, 4];
1736
- case 3:
1737
- ex_1 = _c.sent();
1738
- if (isMounted()) {
1739
- setError(Error("localAddress: ".concat(ex_1)));
1740
- setLocalAddress(undefined);
1741
- setIsConnected(false);
1742
- }
1743
- return [3 /*break*/, 4];
1744
- case 4: return [2 /*return*/];
1287
+ useAsyncEffect((isMounted) => __awaiter(void 0, void 0, void 0, function* () {
1288
+ if (signer && enabled) {
1289
+ try {
1290
+ const localAddress = EthAddress.fromString(yield signer.getAddress());
1291
+ console.log(`Setting Local Address: ${localAddress}`);
1292
+ if (isMounted()) {
1293
+ setLocalAddress(localAddress);
1294
+ setIsConnected(true);
1295
+ }
1745
1296
  }
1746
- });
1747
- }); }, [signer, resetCount, enabled]);
1748
- var _k = __read(useState(), 2), chainId = _k[0], setChainId = _k[1];
1749
- useAsyncEffect(function (isMounted) { return __awaiter(void 0, void 0, void 0, function () {
1750
- var chainId_1;
1751
- var _a;
1752
- return __generator(this, function (_b) {
1753
- switch (_b.label) {
1754
- case 0:
1755
- if (!enabled) return [3 /*break*/, 2];
1756
- return [4 /*yield*/, (provider === null || provider === void 0 ? void 0 : provider.getNetwork())];
1757
- case 1:
1758
- chainId_1 = (_a = (_b.sent())) === null || _a === void 0 ? void 0 : _a.chainId;
1759
- if (!isMounted())
1760
- return [2 /*return*/];
1761
- setChainId(chainId_1);
1762
- _b.label = 2;
1763
- case 2: return [2 /*return*/];
1297
+ catch (ex) {
1298
+ if (isMounted()) {
1299
+ setError(Error(`localAddress: ${ex}`));
1300
+ setLocalAddress(undefined);
1301
+ setIsConnected(false);
1302
+ }
1764
1303
  }
1765
- });
1766
- }); }, [provider, enabled]);
1767
- return (jsx(EthersContext.Provider, __assign({ value: {
1304
+ }
1305
+ }), [signer, resetCount, enabled]);
1306
+ const [chainId, setChainId] = useState();
1307
+ useAsyncEffect((isMounted) => __awaiter(void 0, void 0, void 0, function* () {
1308
+ var _b;
1309
+ if (enabled) {
1310
+ const chainId = (_b = (yield (provider === null || provider === void 0 ? void 0 : provider.getNetwork()))) === null || _b === void 0 ? void 0 : _b.chainId;
1311
+ if (!isMounted())
1312
+ return;
1313
+ setChainId(chainId);
1314
+ }
1315
+ }), [provider, enabled]);
1316
+ return (jsx(EthersContext.Provider, Object.assign({ value: {
1768
1317
  busy: false,
1769
- chainId: chainId,
1770
- connect: connect,
1771
- error: error,
1772
- isConnected: isConnected,
1773
- localAddress: localAddress,
1774
- provider: provider,
1775
- providerName: providerName,
1318
+ chainId,
1319
+ connect,
1320
+ error,
1321
+ isConnected,
1322
+ localAddress,
1323
+ provider,
1324
+ providerName,
1776
1325
  signer: isConnected ? signer : undefined,
1777
- walletProvider: walletProvider,
1326
+ walletProvider,
1778
1327
  } }, { children: children }), void 0));
1779
1328
  };
1780
1329
 
1781
- var MyEtherWalletEthersLoader = function (props) {
1782
- var children = props.children;
1330
+ const MyEtherWalletEthersLoader = (props) => {
1331
+ const { children } = props;
1783
1332
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1784
- var global = window;
1785
- var ethereum = global.ethereum;
1786
- var _a = __read(useState(), 2), error = _a[0], setError = _a[1];
1787
- var _b = __read(useState(), 2), localAddress = _b[0], setLocalAddress = _b[1];
1788
- var _c = __read(useState(), 2), providerName = _c[0], setProviderName = _c[1];
1333
+ const global = window;
1334
+ const ethereum = global.ethereum;
1335
+ const [error, setError] = useState();
1336
+ const [localAddress, setLocalAddress] = useState();
1337
+ const [providerName, setProviderName] = useState();
1789
1338
  if (ethereum) {
1790
1339
  ethereum.autoRefreshOnNetworkChange = false;
1791
1340
  }
1792
- var connect = function () { return __awaiter(void 0, void 0, void 0, function () {
1341
+ const connect = () => __awaiter(void 0, void 0, void 0, function* () {
1793
1342
  var _a;
1794
- return __generator(this, function (_b) {
1795
- switch (_b.label) {
1796
- case 0: return [4 /*yield*/, ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.enable())];
1797
- case 1:
1798
- _b.sent();
1799
- return [2 /*return*/, localAddress ? [localAddress.toString()] : []];
1800
- }
1801
- });
1802
- }); };
1803
- var _d = __read(useState(), 2), isConnected = _d[0], setIsConnected = _d[1];
1804
- var _e = __read(useState(), 2), walletProvider = _e[0], setWalletProvider = _e[1];
1805
- var _f = __read(useState(), 2), provider = _f[0], setProvider = _f[1];
1806
- var _g = __read(useState(), 2), signer = _g[0], setSigner = _g[1];
1807
- useEffect(function () {
1808
- var walletProvider = ethereum ? new Web3Provider(ethereum) : null;
1809
- var provider = null;
1810
- var providerName = null;
1343
+ yield ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.enable());
1344
+ return localAddress ? [localAddress.toString()] : [];
1345
+ });
1346
+ const [isConnected, setIsConnected] = useState();
1347
+ const [walletProvider, setWalletProvider] = useState();
1348
+ const [provider, setProvider] = useState();
1349
+ const [signer, setSigner] = useState();
1350
+ useEffect(() => {
1351
+ const walletProvider = ethereum ? new Web3Provider(ethereum) : null;
1352
+ let provider = null;
1353
+ let providerName = null;
1811
1354
  if (walletProvider) {
1812
1355
  provider = walletProvider;
1813
1356
  providerName = 'MyEtherWallet';
@@ -1819,7 +1362,7 @@ var MyEtherWalletEthersLoader = function (props) {
1819
1362
  setProvider(provider);
1820
1363
  setProviderName(providerName);
1821
1364
  setWalletProvider(walletProvider);
1822
- var signer = null;
1365
+ let signer = null;
1823
1366
  try {
1824
1367
  signer = walletProvider === null || walletProvider === void 0 ? void 0 : walletProvider.getSigner();
1825
1368
  }
@@ -1828,175 +1371,131 @@ var MyEtherWalletEthersLoader = function (props) {
1828
1371
  }
1829
1372
  setSigner(signer);
1830
1373
  }, [ethereum, isConnected]);
1831
- useAsyncEffect(function (isMounted) { return __awaiter(void 0, void 0, void 0, function () {
1832
- var localAddress_1, _a, _b, ex_1;
1833
- return __generator(this, function (_c) {
1834
- switch (_c.label) {
1835
- case 0:
1836
- if (!signer) return [3 /*break*/, 4];
1837
- _c.label = 1;
1838
- case 1:
1839
- _c.trys.push([1, 3, , 4]);
1840
- _b = (_a = EthAddress).fromString;
1841
- return [4 /*yield*/, signer.getAddress()];
1842
- case 2:
1843
- localAddress_1 = _b.apply(_a, [_c.sent()]);
1844
- if (isMounted()) {
1845
- setLocalAddress(localAddress_1);
1846
- setIsConnected(true);
1847
- }
1848
- return [3 /*break*/, 4];
1849
- case 3:
1850
- ex_1 = _c.sent();
1851
- if (isMounted()) {
1852
- setError(Error("localAddress: ".concat(ex_1)));
1853
- setLocalAddress(undefined);
1854
- setIsConnected(false);
1855
- }
1856
- return [3 /*break*/, 4];
1857
- case 4: return [2 /*return*/];
1374
+ useAsyncEffect((isMounted) => __awaiter(void 0, void 0, void 0, function* () {
1375
+ if (signer) {
1376
+ try {
1377
+ const localAddress = EthAddress.fromString(yield signer.getAddress());
1378
+ if (isMounted()) {
1379
+ setLocalAddress(localAddress);
1380
+ setIsConnected(true);
1381
+ }
1858
1382
  }
1859
- });
1860
- }); }, [signer]);
1861
- var _h = __read(useState(), 2), chainId = _h[0], setChainId = _h[1];
1862
- useAsyncEffect(function (isMounted) { return __awaiter(void 0, void 0, void 0, function () {
1863
- var chainId;
1864
- var _a;
1865
- return __generator(this, function (_b) {
1866
- switch (_b.label) {
1867
- case 0: return [4 /*yield*/, (provider === null || provider === void 0 ? void 0 : provider.getNetwork())];
1868
- case 1:
1869
- chainId = (_a = (_b.sent())) === null || _a === void 0 ? void 0 : _a.chainId;
1870
- if (!isMounted())
1871
- return [2 /*return*/];
1872
- setChainId(chainId);
1873
- return [2 /*return*/];
1383
+ catch (ex) {
1384
+ if (isMounted()) {
1385
+ setError(Error(`localAddress: ${ex}`));
1386
+ setLocalAddress(undefined);
1387
+ setIsConnected(false);
1388
+ }
1874
1389
  }
1875
- });
1876
- }); }, [provider]);
1877
- return (jsx(EthersContext.Provider, __assign({ value: {
1390
+ }
1391
+ }), [signer]);
1392
+ const [chainId, setChainId] = useState();
1393
+ useAsyncEffect((isMounted) => __awaiter(void 0, void 0, void 0, function* () {
1394
+ var _b;
1395
+ const chainId = (_b = (yield (provider === null || provider === void 0 ? void 0 : provider.getNetwork()))) === null || _b === void 0 ? void 0 : _b.chainId;
1396
+ if (!isMounted())
1397
+ return;
1398
+ setChainId(chainId);
1399
+ }), [provider]);
1400
+ return (jsx(EthersContext.Provider, Object.assign({ value: {
1878
1401
  busy: false,
1879
- chainId: chainId,
1880
- connect: connect,
1881
- error: error,
1882
- isConnected: isConnected,
1883
- localAddress: localAddress,
1884
- provider: provider,
1885
- providerName: providerName,
1402
+ chainId,
1403
+ connect,
1404
+ error,
1405
+ isConnected,
1406
+ localAddress,
1407
+ provider,
1408
+ providerName,
1886
1409
  signer: isConnected ? signer : undefined,
1887
- walletProvider: walletProvider,
1410
+ walletProvider,
1888
1411
  } }, { children: children }), void 0));
1889
1412
  };
1890
1413
 
1891
- var OperaEthersLoader = function (props) {
1414
+ const OperaEthersLoader = (props) => {
1892
1415
  var _a, _b, _c, _d, _e, _f;
1893
- var children = props.children;
1416
+ const { children } = props;
1894
1417
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1895
- var global = window;
1896
- var ethereum = global.ethereum;
1897
- var _g = __read(useState(), 2), error = _g[0], setError = _g[1];
1898
- var _h = __read(useState(), 2), signer = _h[0], setSigner = _h[1];
1899
- var _j = __read(useState(), 2), provider = _j[0], setProvider = _j[1];
1900
- var _k = __read(useState(((_c = (_b = (_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.addresses) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) > 0 ? EthAddress.fromString((_e = (_d = global.ethereum) === null || _d === void 0 ? void 0 : _d.addresses) === null || _e === void 0 ? void 0 : _e[0]) : null), 2), localAddress = _k[0], setLocalAddress = _k[1];
1901
- var chainId = (ethereum === null || ethereum === void 0 ? void 0 : ethereum.chainId) ? parseInt(ethereum === null || ethereum === void 0 ? void 0 : ethereum.chainId) : 1;
1902
- var isConnected = (_f = ethereum === null || ethereum === void 0 ? void 0 : ethereum.isConnected()) !== null && _f !== void 0 ? _f : false;
1903
- useAsyncEffect(function (mounted) { return __awaiter(void 0, void 0, void 0, function () {
1904
- var operaProvider, provider_1, signer_1, localAddress_1, _a, _b, ex_1;
1905
- return __generator(this, function (_c) {
1906
- switch (_c.label) {
1907
- case 0:
1908
- if (!ethereum) return [3 /*break*/, 4];
1909
- ethereum.enable();
1910
- operaProvider = new Web3Provider(ethereum);
1911
- provider_1 = operaProvider;
1912
- signer_1 = operaProvider.getSigner();
1913
- _c.label = 1;
1914
- case 1:
1915
- _c.trys.push([1, 3, , 4]);
1916
- _b = (_a = EthAddress).fromString;
1917
- return [4 /*yield*/, signer_1.getAddress()];
1918
- case 2:
1919
- localAddress_1 = _b.apply(_a, [_c.sent()]);
1920
- ethereum.autoRefreshOnNetworkChange = false;
1921
- if (mounted()) {
1922
- setSigner(signer_1);
1923
- setProvider(provider_1);
1924
- setLocalAddress(localAddress_1);
1925
- }
1926
- return [3 /*break*/, 4];
1927
- case 3:
1928
- ex_1 = _c.sent();
1929
- if (mounted()) {
1930
- setError(Error("localAddress: ".concat(ex_1)));
1931
- }
1932
- return [3 /*break*/, 4];
1933
- case 4: return [2 /*return*/];
1418
+ const global = window;
1419
+ const ethereum = global.ethereum;
1420
+ const [error, setError] = useState();
1421
+ const [signer, setSigner] = useState();
1422
+ const [provider, setProvider] = useState();
1423
+ const [localAddress, setLocalAddress] = useState(((_c = (_b = (_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.addresses) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) > 0 ? EthAddress.fromString((_e = (_d = global.ethereum) === null || _d === void 0 ? void 0 : _d.addresses) === null || _e === void 0 ? void 0 : _e[0]) : null);
1424
+ const chainId = (ethereum === null || ethereum === void 0 ? void 0 : ethereum.chainId) ? parseInt(ethereum === null || ethereum === void 0 ? void 0 : ethereum.chainId) : 1;
1425
+ const isConnected = (_f = ethereum === null || ethereum === void 0 ? void 0 : ethereum.isConnected()) !== null && _f !== void 0 ? _f : false;
1426
+ useAsyncEffect((mounted) => __awaiter(void 0, void 0, void 0, function* () {
1427
+ if (ethereum) {
1428
+ ethereum.enable();
1429
+ const operaProvider = new Web3Provider(ethereum);
1430
+ const provider = operaProvider;
1431
+ const signer = operaProvider.getSigner();
1432
+ try {
1433
+ const localAddress = EthAddress.fromString(yield signer.getAddress());
1434
+ ethereum.autoRefreshOnNetworkChange = false;
1435
+ if (mounted()) {
1436
+ setSigner(signer);
1437
+ setProvider(provider);
1438
+ setLocalAddress(localAddress);
1439
+ }
1934
1440
  }
1935
- });
1936
- }); }, [ethereum]);
1937
- return (jsx(EthersContext.Provider, __assign({ value: {
1441
+ catch (ex) {
1442
+ if (mounted()) {
1443
+ setError(Error(`localAddress: ${ex}`));
1444
+ }
1445
+ }
1446
+ }
1447
+ }), [ethereum]);
1448
+ return (jsx(EthersContext.Provider, Object.assign({ value: {
1938
1449
  busy: false,
1939
- chainId: chainId,
1940
- error: error,
1941
- isConnected: isConnected,
1942
- localAddress: localAddress,
1943
- provider: provider,
1944
- signer: signer,
1450
+ chainId,
1451
+ error,
1452
+ isConnected,
1453
+ localAddress,
1454
+ provider,
1455
+ signer,
1945
1456
  } }, { children: children }), void 0));
1946
1457
  };
1947
1458
 
1948
- var TrustEthersLoader = function (props) {
1949
- var children = props.children;
1459
+ const TrustEthersLoader = (props) => {
1460
+ const { children } = props;
1950
1461
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1951
- var global = window;
1952
- var _a = __read(useState(), 2), error = _a[0], setError = _a[1];
1953
- var _b = __read(useState(), 2), localAddress = _b[0], setLocalAddress = _b[1];
1954
- var trustProvider = new Web3Provider(global.ethereum);
1955
- var signer = trustProvider.getSigner();
1956
- var chainId = 1;
1957
- var provider = trustProvider;
1958
- useAsyncEffect(function (mounted) { return __awaiter(void 0, void 0, void 0, function () {
1959
- var localAddress_1, _a, _b, ex_1;
1960
- return __generator(this, function (_c) {
1961
- switch (_c.label) {
1962
- case 0:
1963
- if (!signer) return [3 /*break*/, 4];
1964
- _c.label = 1;
1965
- case 1:
1966
- _c.trys.push([1, 3, , 4]);
1967
- _b = (_a = EthAddress).fromString;
1968
- return [4 /*yield*/, signer.getAddress()];
1969
- case 2:
1970
- localAddress_1 = _b.apply(_a, [_c.sent()]);
1971
- if (mounted()) {
1972
- setLocalAddress(localAddress_1);
1973
- }
1974
- return [3 /*break*/, 4];
1975
- case 3:
1976
- ex_1 = _c.sent();
1977
- if (mounted()) {
1978
- setError(Error("localAddress: ".concat(ex_1)));
1979
- }
1980
- return [3 /*break*/, 4];
1981
- case 4: return [2 /*return*/];
1462
+ const global = window;
1463
+ const [error, setError] = useState();
1464
+ const [localAddress, setLocalAddress] = useState();
1465
+ const trustProvider = new Web3Provider(global.ethereum);
1466
+ const signer = trustProvider.getSigner();
1467
+ const chainId = 1;
1468
+ const provider = trustProvider;
1469
+ useAsyncEffect((mounted) => __awaiter(void 0, void 0, void 0, function* () {
1470
+ if (signer) {
1471
+ try {
1472
+ const localAddress = EthAddress.fromString(yield signer.getAddress());
1473
+ if (mounted()) {
1474
+ setLocalAddress(localAddress);
1475
+ }
1982
1476
  }
1983
- });
1984
- }); }, [signer]);
1985
- return (jsx(EthersContext.Provider, __assign({ value: {
1477
+ catch (ex) {
1478
+ if (mounted()) {
1479
+ setError(Error(`localAddress: ${ex}`));
1480
+ }
1481
+ }
1482
+ }
1483
+ }), [signer]);
1484
+ return (jsx(EthersContext.Provider, Object.assign({ value: {
1986
1485
  busy: false,
1987
- chainId: chainId,
1988
- error: error,
1989
- localAddress: localAddress,
1990
- provider: provider,
1991
- signer: signer,
1486
+ chainId,
1487
+ error,
1488
+ localAddress,
1489
+ provider,
1490
+ signer,
1992
1491
  } }, { children: children }), void 0));
1993
1492
  };
1994
1493
 
1995
- var EthersLoader = function (props) {
1494
+ const EthersLoader = (props) => {
1996
1495
  var _a, _b, _c, _d;
1997
1496
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1998
- var global = window;
1999
- var children = props.children;
1497
+ const global = window;
1498
+ const { children } = props;
2000
1499
  if ((_a = global.ethereum) === null || _a === void 0 ? void 0 : _a.isMetaMask) {
2001
1500
  return jsx(MetaMaskEthersLoader, { children: children }, void 0);
2002
1501
  }
@@ -2015,11 +1514,11 @@ var EthersLoader = function (props) {
2015
1514
  return jsx(InfuraEthersLoader, { children: children }, void 0);
2016
1515
  };
2017
1516
 
2018
- var NetworkSettingsContext = createContext({});
1517
+ const NetworkSettingsContext = createContext({});
2019
1518
 
2020
- var NetworkSettingsLoader = function (props) {
2021
- var children = props.children;
2022
- return (jsx(NetworkSettingsContext.Provider, __assign({ value: {
1519
+ const NetworkSettingsLoader = (props) => {
1520
+ const { children } = props;
1521
+ return (jsx(NetworkSettingsContext.Provider, Object.assign({ value: {
2023
1522
  xyBondAddress: EthAddress.fromString('0x1a024A698EEBdB86ccf3fCaF2F589839bdc066AD'),
2024
1523
  xyFhrMerkleSendAddress: EthAddress.fromString('0x46FEEBDffC8076D9E5fd8a11CF1508810472A79f'),
2025
1524
  xyGovernanceAddress: EthAddress.fromString('0x01925d0fFE4a6a6162B51ba611e3D4780Fc2dF42'),
@@ -2027,16 +1526,15 @@ var NetworkSettingsLoader = function (props) {
2027
1526
  } }, { children: children }), void 0));
2028
1527
  };
2029
1528
 
2030
- var UserEventsContext = createContext({});
1529
+ const UserEventsContext = createContext({});
2031
1530
 
2032
- var UserEventsLoader = function (_a) {
2033
- var userEvents = _a.userEvents, children = _a.children;
2034
- return jsx(UserEventsContext.Provider, __assign({ value: { userEvents: userEvents } }, { children: children }), void 0);
1531
+ const UserEventsLoader = ({ userEvents, children }) => {
1532
+ return jsx(UserEventsContext.Provider, Object.assign({ value: { userEvents } }, { children: children }), void 0);
2035
1533
  };
2036
1534
 
2037
- var calcSpacing = function (theme, values) {
2038
- for (var i = 0; i < values.length; i++) {
2039
- var value = values[i];
1535
+ const calcSpacing = (theme, values) => {
1536
+ for (let i = 0; i < values.length; i++) {
1537
+ const value = values[i];
2040
1538
  if (value !== undefined) {
2041
1539
  if (typeof value === 'string') {
2042
1540
  return value;
@@ -2048,63 +1546,77 @@ var calcSpacing = function (theme, values) {
2048
1546
  }
2049
1547
  };
2050
1548
 
2051
- var mergeBoxlikeStyles = function (theme, props, defaultProps) {
2052
- var _a = __assign(__assign({}, defaultProps), props), alignContent = _a.alignContent, alignItems = _a.alignItems, alignSelf = _a.alignSelf, bgcolor = _a.bgcolor, border = _a.border, borderColor = _a.borderColor, display = _a.display, flexGrow = _a.flexGrow, flexShrink = _a.flexShrink, flexDirection = _a.flexDirection, flexWrap = _a.flexWrap, justifyContent = _a.justifyContent, justifyItems = _a.justifyItems, justifySelf = _a.justifySelf, height = _a.height, minHeight = _a.minHeight, minWidth = _a.minWidth, margin = _a.margin, marginX = _a.marginX, marginY = _a.marginY, marginTop = _a.marginTop, marginLeft = _a.marginLeft, marginRight = _a.marginRight, marginBottom = _a.marginBottom, padding = _a.padding, paddingX = _a.paddingX, paddingY = _a.paddingY, paddingTop = _a.paddingTop, paddingLeft = _a.paddingLeft, paddingRight = _a.paddingRight, paddingBottom = _a.paddingBottom, position = _a.position, style = _a.style, width = _a.width, rootProps = __rest(_a, ["alignContent", "alignItems", "alignSelf", "bgcolor", "border", "borderColor", "display", "flexGrow", "flexShrink", "flexDirection", "flexWrap", "justifyContent", "justifyItems", "justifySelf", "height", "minHeight", "minWidth", "margin", "marginX", "marginY", "marginTop", "marginLeft", "marginRight", "marginBottom", "padding", "paddingX", "paddingY", "paddingTop", "paddingLeft", "paddingRight", "paddingBottom", "position", "style", "width"]);
2053
- var mergedStyle = __assign({ alignContent: alignContent, alignItems: alignItems, alignSelf: alignSelf, backgroundColor: bgcolor, border: border, borderColor: borderColor, display: display, flexDirection: flexDirection, flexGrow: flexGrow, flexShrink: flexShrink, flexWrap: flexWrap, height: height, justifyContent: justifyContent, justifyItems: justifyItems, justifySelf: justifySelf, marginBottom: calcSpacing(theme, [marginBottom, marginY, margin]), marginLeft: calcSpacing(theme, [marginLeft, marginX, margin]), marginRight: calcSpacing(theme, [marginRight, marginX, margin]), marginTop: calcSpacing(theme, [marginTop, marginY, margin]), minHeight: minHeight, minWidth: minWidth, paddingBottom: calcSpacing(theme, [paddingBottom, paddingY, padding]), paddingLeft: calcSpacing(theme, [paddingLeft, paddingX, padding]), paddingRight: calcSpacing(theme, [paddingRight, paddingX, padding]), paddingTop: calcSpacing(theme, [paddingTop, paddingY, padding]), position: position, width: width }, style);
2054
- return __assign(__assign({}, rootProps), { style: mergedStyle });
2055
- };
2056
-
2057
- var ButtonExBase = function (props) {
2058
- var theme = useTheme();
2059
- var _a = mergeBoxlikeStyles(theme, props), busy = _a.busy, _b = _a.busyVariant, busyVariant = _b === void 0 ? 'linear' : _b, busyOpacity = _a.busyOpacity, onClick = _a.onClick, children = _a.children, rootProps = __rest(_a, ["busy", "busyVariant", "busyOpacity", "onClick", "children"]);
2060
- var localOnClick = function (event) {
1549
+ const mergeBoxlikeStyles = (theme, props, defaultProps) => {
1550
+ const _a = Object.assign(Object.assign({}, defaultProps), props), { alignContent, alignItems, alignSelf, bgcolor, border, borderColor, display, flexGrow, flexShrink, flexDirection, flexWrap, justifyContent, justifyItems, justifySelf, height, minHeight, minWidth, margin, marginX, marginY, marginTop, marginLeft, marginRight, marginBottom, padding, paddingX, paddingY, paddingTop, paddingLeft, paddingRight, paddingBottom, position, style, width } = _a, rootProps = __rest(_a, ["alignContent", "alignItems", "alignSelf", "bgcolor", "border", "borderColor", "display", "flexGrow", "flexShrink", "flexDirection", "flexWrap", "justifyContent", "justifyItems", "justifySelf", "height", "minHeight", "minWidth", "margin", "marginX", "marginY", "marginTop", "marginLeft", "marginRight", "marginBottom", "padding", "paddingX", "paddingY", "paddingTop", "paddingLeft", "paddingRight", "paddingBottom", "position", "style", "width"]);
1551
+ const mergedStyle = Object.assign({ alignContent,
1552
+ alignItems,
1553
+ alignSelf, backgroundColor: bgcolor, border,
1554
+ borderColor,
1555
+ display,
1556
+ flexDirection,
1557
+ flexGrow,
1558
+ flexShrink,
1559
+ flexWrap,
1560
+ height,
1561
+ justifyContent,
1562
+ justifyItems,
1563
+ justifySelf, marginBottom: calcSpacing(theme, [marginBottom, marginY, margin]), marginLeft: calcSpacing(theme, [marginLeft, marginX, margin]), marginRight: calcSpacing(theme, [marginRight, marginX, margin]), marginTop: calcSpacing(theme, [marginTop, marginY, margin]), minHeight,
1564
+ minWidth, paddingBottom: calcSpacing(theme, [paddingBottom, paddingY, padding]), paddingLeft: calcSpacing(theme, [paddingLeft, paddingX, padding]), paddingRight: calcSpacing(theme, [paddingRight, paddingX, padding]), paddingTop: calcSpacing(theme, [paddingTop, paddingY, padding]), position,
1565
+ width }, style);
1566
+ return Object.assign(Object.assign({}, rootProps), { style: mergedStyle });
1567
+ };
1568
+
1569
+ const ButtonExBase = (props) => {
1570
+ const theme = useTheme();
1571
+ const _a = mergeBoxlikeStyles(theme, props), { busy, busyVariant = 'linear', busyOpacity, onClick, children } = _a, rootProps = __rest(_a, ["busy", "busyVariant", "busyOpacity", "onClick", "children"]);
1572
+ const localOnClick = (event) => {
2061
1573
  if (!busy) {
2062
1574
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
2063
1575
  }
2064
1576
  };
2065
- return (jsxs(Button, __assign({ onClick: localOnClick }, rootProps, { children: [busy && busyVariant === 'linear' ? jsx(BusyLinearProgress, { rounded: true, opacity: busyOpacity !== null && busyOpacity !== void 0 ? busyOpacity : 0 }, void 0) : null, busy && busyVariant === 'circular' ? (jsx(BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity !== null && busyOpacity !== void 0 ? busyOpacity : 0.5 }, void 0)) : null, children] }), void 0));
1577
+ return (jsxs(Button, Object.assign({ onClick: localOnClick }, rootProps, { children: [busy && busyVariant === 'linear' ? jsx(BusyLinearProgress, { rounded: true, opacity: busyOpacity !== null && busyOpacity !== void 0 ? busyOpacity : 0 }, void 0) : null, busy && busyVariant === 'circular' ? (jsx(BusyCircularProgress, { rounded: true, size: 24, opacity: busyOpacity !== null && busyOpacity !== void 0 ? busyOpacity : 0.5 }, void 0)) : null, children] }), void 0));
2066
1578
  };
2067
1579
 
2068
- var ButtonExTo = function (_a) {
2069
- var to = _a.to, toOptions = _a.toOptions, onClick = _a.onClick, props = __rest(_a, ["to", "toOptions", "onClick"]);
2070
- var navigate = useNavigate();
2071
- var localOnClick = function (event) {
1580
+ const ButtonExTo = (_a) => {
1581
+ var { to, toOptions, onClick } = _a, props = __rest(_a, ["to", "toOptions", "onClick"]);
1582
+ const navigate = useNavigate();
1583
+ const localOnClick = (event) => {
2072
1584
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
2073
1585
  if (to) {
2074
1586
  navigate(to, toOptions);
2075
1587
  }
2076
1588
  };
2077
- return jsx(ButtonExBase, __assign({ onClick: localOnClick }, props), void 0);
1589
+ return jsx(ButtonExBase, Object.assign({ onClick: localOnClick }, props), void 0);
2078
1590
  };
2079
1591
 
2080
- var ButtonEx = function (_a) {
2081
- var to = _a.to, props = __rest(_a, ["to"]);
1592
+ const ButtonEx = (_a) => {
1593
+ var { to } = _a, props = __rest(_a, ["to"]);
2082
1594
  if (to) {
2083
- return jsx(ButtonExTo, __assign({ to: to }, props), void 0);
1595
+ return jsx(ButtonExTo, Object.assign({ to: to }, props), void 0);
2084
1596
  }
2085
1597
  else {
2086
- return jsx(ButtonExBase, __assign({}, props), void 0);
1598
+ return jsx(ButtonExBase, Object.assign({}, props), void 0);
2087
1599
  }
2088
1600
  };
2089
1601
 
2090
- var CookieConsentBody = function (_a) {
2091
- var acceptOnScroll = _a.acceptOnScroll, _b = _a.acceptOnTimer, acceptOnTimer = _b === void 0 ? 0 : _b, onAccept = _a.onAccept, props = __rest(_a, ["acceptOnScroll", "acceptOnTimer", "onAccept"]);
2092
- var _c = useCookieConsent(), accepted = _c.accepted, setAccepted = _c.setAccepted, storageName = _c.storageName;
2093
- var onScroll = function () {
1602
+ const CookieConsentBody = (_a) => {
1603
+ var { acceptOnScroll, acceptOnTimer = 0, onAccept } = _a, props = __rest(_a, ["acceptOnScroll", "acceptOnTimer", "onAccept"]);
1604
+ const { accepted, setAccepted, storageName } = useCookieConsent();
1605
+ const onScroll = () => {
2094
1606
  //hide it one the user has scrolled at least one page
2095
1607
  if (window.scrollY > window.innerHeight && !accepted) {
2096
1608
  onAcceptClick();
2097
1609
  }
2098
1610
  };
2099
- useEffect(function () {
1611
+ useEffect(() => {
2100
1612
  if (acceptOnScroll) {
2101
1613
  window.addEventListener('scroll', onScroll);
2102
- return function () {
1614
+ return () => {
2103
1615
  window.removeEventListener('scroll', onScroll);
2104
1616
  };
2105
1617
  }
2106
1618
  });
2107
- var onAcceptClick = function () {
1619
+ const onAcceptClick = () => {
2108
1620
  if (setAccepted) {
2109
1621
  setAccepted === null || setAccepted === void 0 ? void 0 : setAccepted(true);
2110
1622
  }
@@ -2114,21 +1626,21 @@ var CookieConsentBody = function (_a) {
2114
1626
  onAccept === null || onAccept === void 0 ? void 0 : onAccept(true);
2115
1627
  };
2116
1628
  if (acceptOnTimer > 0 && !accepted) {
2117
- setTimeout(function () {
1629
+ setTimeout(() => {
2118
1630
  onAcceptClick();
2119
1631
  }, acceptOnTimer);
2120
1632
  }
2121
1633
  if (!storageName) {
2122
- return (jsx(FlexRow, __assign({ justifyContent: "center", paddingY: 2 }, props, { children: jsx(Typography, __assign({ color: "error", variant: "body1" }, { children: "Missing CookieConsentContext" }), void 0) }), void 0));
1634
+ return (jsx(FlexRow, Object.assign({ justifyContent: "center", paddingY: 2 }, props, { children: jsx(Typography, Object.assign({ color: "error", variant: "body1" }, { children: "Missing CookieConsentContext" }), void 0) }), void 0));
2123
1635
  }
2124
- return accepted ? null : (jsxs(FlexRow, __assign({ justifyContent: "space-between" }, props, { children: [jsxs(Typography, __assign({ variant: "body2", margin: 2 }, { children: ['This site uses ', jsx(Link, __assign({ href: "https://cookiesandyou.com/", rel: "noopener noreferrer", target: "_blank" }, { children: "cookies" }), void 0), ' and ', jsx(Link, __assign({ href: "https://policies.google.com/technologies/partner-sites", rel: "noopener noreferrer", target: "_blank" }, { children: "Google\u00A0tools" }), void 0), ' to analyze traffic and for ads measurement purposes.'] }), void 0), jsx(ButtonEx, __assign({ variant: "contained", color: "secondary", onClick: onAcceptClick, margin: 2 }, { children: "Accept" }), void 0)] }), void 0));
1636
+ return accepted ? null : (jsxs(FlexRow, Object.assign({ justifyContent: "space-between" }, props, { children: [jsxs(Typography, Object.assign({ variant: "body2", margin: 2 }, { children: ['This site uses ', jsx(Link, Object.assign({ href: "https://cookiesandyou.com/", rel: "noopener noreferrer", target: "_blank" }, { children: "cookies" }), void 0), ' and ', jsx(Link, Object.assign({ href: "https://policies.google.com/technologies/partner-sites", rel: "noopener noreferrer", target: "_blank" }, { children: "Google\u00A0tools" }), void 0), ' to analyze traffic and for ads measurement purposes.'] }), void 0), jsx(ButtonEx, Object.assign({ variant: "contained", color: "secondary", onClick: onAcceptClick, margin: 2 }, { children: "Accept" }), void 0)] }), void 0));
2125
1637
  };
2126
1638
 
2127
- var CookieConsent = function (props) {
2128
- var storageName = useCookieConsent().storageName;
2129
- var Inner = function () {
2130
- var accepted = useCookieConsent().accepted;
2131
- return accepted ? null : (jsx(CookieConsentBody, __assign({ background: true, paper: true, position: "fixed", bottom: 0, maxWidth: "100vw", width: "100%", zIndex: 1000 }, props), void 0));
1639
+ const CookieConsent = (props) => {
1640
+ const { storageName } = useCookieConsent();
1641
+ const Inner = () => {
1642
+ const { accepted } = useCookieConsent();
1643
+ return accepted ? null : (jsx(CookieConsentBody, Object.assign({ background: true, paper: true, position: "fixed", bottom: 0, maxWidth: "100vw", width: "100%", zIndex: 1000 }, props), void 0));
2132
1644
  };
2133
1645
  //if not inside a context, make a context
2134
1646
  if (!storageName) {
@@ -2137,96 +1649,104 @@ var CookieConsent = function (props) {
2137
1649
  return jsx(Inner, {}, void 0);
2138
1650
  };
2139
1651
 
2140
- var InvertableThemeContext = createContext({
1652
+ const InvertableThemeContext = createContext({
2141
1653
  options: {},
2142
1654
  });
2143
1655
 
2144
- var InvertableThemeProvider = function (_a) {
2145
- var _b, _c;
2146
- var options = _a.options, children = _a.children, dark = _a.dark, _d = _a.scoped, scoped = _d === void 0 ? false : _d, _e = _a.invert, invert = _e === void 0 ? false : _e, noResponsiveFonts = _a.noResponsiveFonts;
2147
- var contextInvertableTheme = useContext(InvertableThemeContext);
2148
- var clonedOptions = clone((_b = options !== null && options !== void 0 ? options : contextInvertableTheme.options) !== null && _b !== void 0 ? _b : {});
2149
- clonedOptions.palette = (_c = clonedOptions.palette) !== null && _c !== void 0 ? _c : {};
1656
+ const InvertableThemeProvider = ({ options, children, dark, scoped = false, invert = false, noResponsiveFonts, }) => {
1657
+ var _a, _b;
1658
+ const contextInvertableTheme = useContext(InvertableThemeContext);
1659
+ const clonedOptions = clone((_a = options !== null && options !== void 0 ? options : contextInvertableTheme.options) !== null && _a !== void 0 ? _a : {});
1660
+ clonedOptions.palette = (_b = clonedOptions.palette) !== null && _b !== void 0 ? _b : {};
2150
1661
  if (invert) {
2151
1662
  clonedOptions.palette.mode = clonedOptions.palette.mode === 'dark' ? 'light' : 'dark';
2152
1663
  }
2153
1664
  if (dark !== undefined) {
2154
1665
  clonedOptions.palette.mode = dark ? 'dark' : 'light';
2155
1666
  }
2156
- var theme = createTheme(clonedOptions);
1667
+ let theme = createTheme(clonedOptions);
2157
1668
  if (!noResponsiveFonts) {
2158
1669
  theme = responsiveFontSizes(theme);
2159
1670
  }
2160
- return scoped ? (jsx(ScopedCssBaseline, { children: jsx(InvertableThemeContext.Provider, __assign({ value: { options: clonedOptions } }, { children: jsx(ThemeProvider, __assign({ theme: theme }, { children: children }), void 0) }), void 0) }, void 0)) : (jsx(InvertableThemeContext.Provider, __assign({ value: { options: clonedOptions } }, { children: jsx(ThemeProvider, __assign({ theme: theme }, { children: children }), void 0) }), void 0));
1671
+ return scoped ? (jsx(ScopedCssBaseline, { children: jsx(InvertableThemeContext.Provider, Object.assign({ value: { options: clonedOptions } }, { children: jsx(ThemeProvider, Object.assign({ theme: theme }, { children: children }), void 0) }), void 0) }, void 0)) : (jsx(InvertableThemeContext.Provider, Object.assign({ value: { options: clonedOptions } }, { children: jsx(ThemeProvider, Object.assign({ theme: theme }, { children: children }), void 0) }), void 0));
1672
+ };
1673
+
1674
+ // The point of this component it to return to the top of the page on any router navigate
1675
+ const ScrollToTop = () => {
1676
+ const { pathname } = useLocation();
1677
+ useEffect(() => {
1678
+ window.scrollTo(0, 0);
1679
+ }, [pathname]);
1680
+ return null;
2161
1681
  };
2162
1682
 
2163
- var BasePage = function (_a) {
2164
- var disableGutters = _a.disableGutters, children = _a.children, beta = _a.beta, container = _a.container, hideFooter = _a.hideFooter, appFooter = _a.appFooter, appBar = _a.appBar, cookieConsent = _a.cookieConsent, filterBar = _a.filterBar, hideAppBar = _a.hideAppBar, hideFilterBar = _a.hideFilterBar, _b = _a.noindex, noindex = _b === void 0 ? false : _b, _c = _a.scrollToTopButton, scrollToTopButton = _c === void 0 ? false : _c, title = _a.title, props = __rest(_a, ["disableGutters", "children", "beta", "container", "hideFooter", "appFooter", "appBar", "cookieConsent", "filterBar", "hideAppBar", "hideFilterBar", "noindex", "scrollToTopButton", "title"]);
2165
- var theme = useTheme();
2166
- var scrollToTopAnchorId = 'scroll-to-top-anchor';
2167
- return (jsxs(FlexCol, __assign({ justifyContent: "flex-start", color: theme.palette.text.primary, alignItems: "stretch", width: "100%", maxWidth: "100vw", minHeight: "100vh" }, props, { children: [jsx(Helmet, __assign({ title: title }, { children: noindex ? jsx("meta", { content: "noindex", name: "robots" }, void 0) : null }), void 0), scrollToTopButton ? jsx("div", { id: scrollToTopAnchorId }, void 0) : null, hideAppBar ? null : appBar, hideFilterBar ? null : filterBar, beta ? (jsx(FlexRow, __assign({ margin: 1, position: "absolute", top: 0, left: 0, bgcolor: "#cccccc88", paddingX: 1, style: { opacity: 0.5 } }, { children: jsx(Typography, __assign({ variant: "body2" }, { children: "Important: This page is a Beta page. It is possible that some information may not be correct." }), void 0) }), void 0)) : null, container ? (jsx(Container, __assign({ style: { alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1 }, maxWidth: container, disableGutters: disableGutters }, { children: children }), void 0)) : (children), hideFooter ? null : jsx("footer", { children: appFooter }, void 0), cookieConsent !== null && cookieConsent !== void 0 ? cookieConsent : (jsx(ScopedCssBaseline, { children: jsx(InvertableThemeProvider, __assign({ invert: true }, { children: jsx(CookieConsent, { borderRadius: 0 }, void 0) }), void 0) }, void 0)), scrollToTopButton ? (jsx(ScrollToTopButton, __assign({ anchorId: scrollToTopAnchorId }, { children: jsx(Fab, __assign({ "aria-label": "scroll to top", color: "secondary", size: "small" }, { children: jsx(KeyboardArrowUp, {}, void 0) }), void 0) }), void 0)) : null] }), void 0));
1683
+ const BasePage = (_a) => {
1684
+ var { disableGutters, children, beta, container, hideFooter, appFooter, appBar, cookieConsent, filterBar, hideAppBar, hideFilterBar, noindex = false, scrollToTopButton = false, title } = _a, props = __rest(_a, ["disableGutters", "children", "beta", "container", "hideFooter", "appFooter", "appBar", "cookieConsent", "filterBar", "hideAppBar", "hideFilterBar", "noindex", "scrollToTopButton", "title"]);
1685
+ const theme = useTheme();
1686
+ const scrollToTopAnchorId = 'scroll-to-top-anchor';
1687
+ return (jsxs(FlexCol, Object.assign({ justifyContent: "flex-start", color: theme.palette.text.primary, alignItems: "stretch", width: "100%", maxWidth: "100vw", minHeight: "100vh" }, props, { children: [jsx(ScrollToTop, {}, void 0), jsx(Helmet, Object.assign({ title: title }, { children: noindex ? jsx("meta", { content: "noindex", name: "robots" }, void 0) : null }), void 0), scrollToTopButton ? jsx("div", { id: scrollToTopAnchorId }, void 0) : null, hideAppBar ? null : appBar, hideFilterBar ? null : filterBar, beta ? (jsx(FlexRow, Object.assign({ margin: 1, position: "absolute", top: 0, left: 0, bgcolor: "#cccccc88", paddingX: 1, style: { opacity: 0.5 } }, { children: jsx(Typography, Object.assign({ variant: "body2" }, { children: "Important: This page is a Beta page. It is possible that some information may not be correct." }), void 0) }), void 0)) : null, container ? (jsx(Container, Object.assign({ style: { alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1 }, maxWidth: container, disableGutters: disableGutters }, { children: children }), void 0)) : (children), hideFooter ? null : jsx("footer", { children: appFooter }, void 0), cookieConsent !== null && cookieConsent !== void 0 ? cookieConsent : (jsx(ScopedCssBaseline, { children: jsx(InvertableThemeProvider, Object.assign({ invert: true }, { children: jsx(CookieConsent, { borderRadius: 0 }, void 0) }), void 0) }, void 0)), scrollToTopButton ? (jsx(ScrollToTopButton, Object.assign({ anchorId: scrollToTopAnchorId }, { children: jsx(Fab, Object.assign({ "aria-label": "scroll to top", color: "secondary", size: "small" }, { children: jsx(KeyboardArrowUp, {}, void 0) }), void 0) }), void 0)) : null] }), void 0));
2168
1688
  };
2169
1689
 
2170
- var getPartialPath = function (pathParts, index) {
2171
- var result = [];
2172
- for (var i = 0; i <= index; i++) {
2173
- result.push("".concat(pathParts[i], "/"));
1690
+ const getPartialPath = (pathParts, index) => {
1691
+ const result = [];
1692
+ for (let i = 0; i <= index; i++) {
1693
+ result.push(`${pathParts[i]}/`);
2174
1694
  }
2175
1695
  return result.join('');
2176
1696
  };
2177
- var BreadcrumbsEx = function (_a) {
1697
+ const BreadcrumbsEx = (_a) => {
2178
1698
  var _b;
2179
- var titles = _a.titles, _c = _a.path, path = _c === void 0 ? document.location.pathname : _c, _d = _a.separator, separator = _d === void 0 ? '|' : _d, logo = _a.logo, children = _a.children, props = __rest(_a, ["titles", "path", "separator", "logo", "children"]);
2180
- var pathParts = path.split('/');
1699
+ var { titles, path = document.location.pathname, separator = '|', logo, children } = _a, props = __rest(_a, ["titles", "path", "separator", "logo", "children"]);
1700
+ const pathParts = path.split('/');
2181
1701
  //if the url has a trailing '/', remove the last part
2182
1702
  if (((_b = pathParts[pathParts.length - 1]) === null || _b === void 0 ? void 0 : _b.length) === 0) {
2183
1703
  pathParts.pop();
2184
1704
  }
2185
- assertEx(pathParts.length - 1 === (titles === null || titles === void 0 ? void 0 : titles.length), "Path/Title length mismatch: ".concat(JSON.stringify(titles), " with ").concat(JSON.stringify(pathParts)));
2186
- return (jsxs(Breadcrumbs, __assign({ separator: separator }, props, { children: [pathParts.map(function (_pathPart, index) {
2187
- var path = getPartialPath(pathParts, index);
2188
- return (jsx(Link, __assign({ title: index > 0 ? titles === null || titles === void 0 ? void 0 : titles[index - 1] : 'COIN', color: index === pathParts.length - 1 ? 'textPrimary' : 'inherit', component: Link$1, to: path }, { children: index > 0 ? (titles === null || titles === void 0 ? void 0 : titles[index - 1]) : (jsx(FlexRow, { children: typeof logo === 'string' ? jsx("img", { src: logo }, void 0) : logo }, void 0)) }), path));
1705
+ assertEx(pathParts.length - 1 === (titles === null || titles === void 0 ? void 0 : titles.length), `Path/Title length mismatch: ${JSON.stringify(titles)} with ${JSON.stringify(pathParts)}`);
1706
+ return (jsxs(Breadcrumbs, Object.assign({ separator: separator }, props, { children: [pathParts.map((_pathPart, index) => {
1707
+ const path = getPartialPath(pathParts, index);
1708
+ return (jsx(Link, Object.assign({ title: index > 0 ? titles === null || titles === void 0 ? void 0 : titles[index - 1] : 'COIN', color: index === pathParts.length - 1 ? 'textPrimary' : 'inherit', component: Link$1, to: path }, { children: index > 0 ? (titles === null || titles === void 0 ? void 0 : titles[index - 1]) : (jsx(FlexRow, { children: typeof logo === 'string' ? jsx("img", { src: logo }, void 0) : logo }, void 0)) }), path));
2189
1709
  }), children] }), void 0));
2190
1710
  };
2191
1711
 
2192
- var toAxiosError = function (error) {
1712
+ const toAxiosError = (error) => {
2193
1713
  return error.isAxiosError ? error : undefined;
2194
1714
  };
2195
- var ErrorDialogOpen = function (_a) {
1715
+ const ErrorDialogOpen = (_a) => {
2196
1716
  var _b, _c;
2197
- var onAction = _a.onAction, _d = _a.title, title = _d === void 0 ? 'Oops. Something went wrong.' : _d, _e = _a.error, error = _e === void 0 ? Error('Unknown Error') : _e, props = __rest(_a, ["onAction", "title", "error"]);
2198
- var onCloseClicked = function () {
1717
+ var { onAction, title = 'Oops. Something went wrong.', error = Error('Unknown Error') } = _a, props = __rest(_a, ["onAction", "title", "error"]);
1718
+ const onCloseClicked = () => {
2199
1719
  onAction === null || onAction === void 0 ? void 0 : onAction(false);
2200
1720
  };
2201
- var onRetryClicked = function () {
1721
+ const onRetryClicked = () => {
2202
1722
  onAction === null || onAction === void 0 ? void 0 : onAction(true);
2203
1723
  };
2204
- var axiosError = toAxiosError(error);
2205
- var message = (_b = error.message) !== null && _b !== void 0 ? _b : error.toString();
2206
- return (jsxs(Dialog, __assign({}, props, { children: [jsx(DialogTitle, { children: title }, void 0), jsx(DialogContent, { children: jsx(FlexRow, { children: jsx(Typography, __assign({ color: "error" }, { children: axiosError ? "".concat(message, " [").concat((_c = axiosError === null || axiosError === void 0 ? void 0 : axiosError.code) !== null && _c !== void 0 ? _c : 'Connection Failure', "]") : "".concat(message) }), void 0) }, void 0) }, void 0), jsx(DialogActions, { children: jsxs(FlexRow, __assign({ justifyContent: "space-between", width: "100%", minWidth: "300px" }, { children: [jsx(ButtonEx, __assign({ onClick: onCloseClicked, variant: "text" }, { children: "Close" }), void 0), jsx(ButtonEx, __assign({ onClick: onRetryClicked, variant: "text" }, { children: "Retry" }), void 0)] }), void 0) }, void 0)] }), void 0));
1724
+ const axiosError = toAxiosError(error);
1725
+ const message = (_b = error.message) !== null && _b !== void 0 ? _b : error.toString();
1726
+ return (jsxs(Dialog, Object.assign({}, props, { children: [jsx(DialogTitle, { children: title }, void 0), jsx(DialogContent, { children: jsx(FlexRow, { children: jsx(Typography, Object.assign({ color: "error" }, { children: axiosError ? `${message} [${(_c = axiosError === null || axiosError === void 0 ? void 0 : axiosError.code) !== null && _c !== void 0 ? _c : 'Connection Failure'}]` : `${message}` }), void 0) }, void 0) }, void 0), jsx(DialogActions, { children: jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%", minWidth: "300px" }, { children: [jsx(ButtonEx, Object.assign({ onClick: onCloseClicked, variant: "text" }, { children: "Close" }), void 0), jsx(ButtonEx, Object.assign({ onClick: onRetryClicked, variant: "text" }, { children: "Retry" }), void 0)] }), void 0) }, void 0)] }), void 0));
2207
1727
  };
2208
- var ErrorDialog = function (_a) {
2209
- var open = _a.open, error = _a.error, props = __rest(_a, ["open", "error"]);
1728
+ const ErrorDialog = (_a) => {
1729
+ var { open, error } = _a, props = __rest(_a, ["open", "error"]);
2210
1730
  if (error) {
2211
- return jsx(ErrorDialogOpen, __assign({ open: !!error || open, error: error }, props), void 0);
1731
+ return jsx(ErrorDialogOpen, Object.assign({ open: !!error || open, error: error }, props), void 0);
2212
1732
  }
2213
1733
  else {
2214
1734
  return null;
2215
1735
  }
2216
1736
  };
2217
1737
 
2218
- var MessageDialog = function (_a) {
2219
- var onOk = _a.onOk, onCancel = _a.onCancel, children = _a.children, title = _a.title, props = __rest(_a, ["onOk", "onCancel", "children", "title"]);
2220
- return (jsxs(Dialog, __assign({}, props, { children: [jsx(DialogTitle, { children: title }, void 0), jsx(DialogContent, { children: jsx(FlexCol, __assign({ alignItems: "stretch" }, { children: children }), void 0) }, void 0), jsx(DialogActions, { children: jsxs(FlexRow, __assign({ justifyContent: "space-between", width: "100%" }, { children: [jsx(Button, __assign({ onClick: onCancel, variant: "text" }, { children: "Cancel" }), void 0), jsx(Button, __assign({ onClick: onOk, variant: "text" }, { children: "Ok" }), void 0)] }), void 0) }, void 0)] }), void 0));
1738
+ const MessageDialog = (_a) => {
1739
+ var { onOk, onCancel, children, title } = _a, props = __rest(_a, ["onOk", "onCancel", "children", "title"]);
1740
+ return (jsxs(Dialog, Object.assign({}, props, { children: [jsx(DialogTitle, { children: title }, void 0), jsx(DialogContent, { children: jsx(FlexCol, Object.assign({ alignItems: "stretch" }, { children: children }), void 0) }, void 0), jsx(DialogActions, { children: jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%" }, { children: [jsx(Button, Object.assign({ onClick: onCancel, variant: "text" }, { children: "Cancel" }), void 0), jsx(Button, Object.assign({ onClick: onOk, variant: "text" }, { children: "Ok" }), void 0)] }), void 0) }, void 0)] }), void 0));
2221
1741
  };
2222
1742
 
2223
- var useBreakpoint = function () {
2224
- var theme = useTheme();
2225
- var xs = useMediaQuery(theme.breakpoints.only('xs'));
2226
- var sm = useMediaQuery(theme.breakpoints.only('sm'));
2227
- var md = useMediaQuery(theme.breakpoints.only('md'));
2228
- var lg = useMediaQuery(theme.breakpoints.only('lg'));
2229
- var xl = useMediaQuery(theme.breakpoints.only('xl'));
1743
+ const useBreakpoint = () => {
1744
+ const theme = useTheme();
1745
+ const xs = useMediaQuery(theme.breakpoints.only('xs'));
1746
+ const sm = useMediaQuery(theme.breakpoints.only('sm'));
1747
+ const md = useMediaQuery(theme.breakpoints.only('md'));
1748
+ const lg = useMediaQuery(theme.breakpoints.only('lg'));
1749
+ const xl = useMediaQuery(theme.breakpoints.only('xl'));
2230
1750
  if (xs) {
2231
1751
  return 'xs';
2232
1752
  }
@@ -2244,18 +1764,18 @@ var useBreakpoint = function () {
2244
1764
  }
2245
1765
  };
2246
1766
 
2247
- var useLocalStorage = function (key, defaultValue) {
2248
- var _a = __read(useState(function () {
1767
+ const useLocalStorage = (key, defaultValue) => {
1768
+ const [storedValue, setStoredValue] = useState(() => {
2249
1769
  try {
2250
- var item = getLocalStorageObject(key);
1770
+ const item = getLocalStorageObject(key);
2251
1771
  return item || defaultValue;
2252
1772
  }
2253
1773
  catch (ex) {
2254
1774
  //Error is already logged
2255
1775
  return defaultValue;
2256
1776
  }
2257
- }), 2), storedValue = _a[0], setStoredValue = _a[1];
2258
- var setValue = function (value) {
1777
+ });
1778
+ const setValue = (value) => {
2259
1779
  console.log('setValue', value);
2260
1780
  setStoredValue(value);
2261
1781
  setLocalStorageObject(key, value);
@@ -2264,30 +1784,30 @@ var useLocalStorage = function (key, defaultValue) {
2264
1784
  return [storedValue, setValue];
2265
1785
  };
2266
1786
 
2267
- var useMounted = function () {
2268
- var _a = __read(useState(true), 2), mounted = _a[0], setMounted = _a[1];
2269
- useEffect(function () {
1787
+ const useMounted = () => {
1788
+ const [mounted, setMounted] = useState(true);
1789
+ useEffect(() => {
2270
1790
  setMounted(true);
2271
- return function () {
1791
+ return () => {
2272
1792
  // eslint-disable-next-line react-hooks/exhaustive-deps
2273
1793
  setMounted(false);
2274
1794
  };
2275
1795
  }, []);
2276
- return function () {
1796
+ return () => {
2277
1797
  return mounted;
2278
1798
  };
2279
1799
  };
2280
1800
 
2281
- var useNavigateToEthAddress = function () {
2282
- var navigate = useNavigate();
2283
- var navigateToEthAddress = function (address, event, page, to, toOptions, toEtherScan) {
1801
+ const useNavigateToEthAddress = () => {
1802
+ const navigate = useNavigate();
1803
+ const navigateToEthAddress = (address, event, page, to, toOptions, toEtherScan) => {
2284
1804
  var _a;
2285
- var openInEtherScan = toEtherScan || (!to && !page);
1805
+ const openInEtherScan = toEtherScan || (!to && !page);
2286
1806
  if (openInEtherScan) {
2287
- window.open("https://etherscan.io/address/".concat(address.toString()), '_blank');
1807
+ window.open(`https://etherscan.io/address/${address.toString()}`, '_blank');
2288
1808
  }
2289
1809
  else {
2290
- var path = (_a = to === null || to === void 0 ? void 0 : to.toString()) !== null && _a !== void 0 ? _a : "/".concat(page, "/").concat(address.toString());
1810
+ const path = (_a = to === null || to === void 0 ? void 0 : to.toString()) !== null && _a !== void 0 ? _a : `/${page}/${address.toString()}`;
2291
1811
  if (event.metaKey || toEtherScan) {
2292
1812
  window.open(path, '_blank');
2293
1813
  }
@@ -2296,63 +1816,50 @@ var useNavigateToEthAddress = function () {
2296
1816
  }
2297
1817
  }
2298
1818
  };
2299
- return { navigateToEthAddress: navigateToEthAddress };
1819
+ return { navigateToEthAddress };
2300
1820
  };
2301
1821
 
2302
- var useSpacing = function (value) {
2303
- var theme = useTheme();
1822
+ const useSpacing = (value) => {
1823
+ const theme = useTheme();
2304
1824
  return theme.spacing(typeof value === 'string' ? parseInt(value) : value);
2305
1825
  };
2306
1826
 
2307
- var useUserEvents = function () {
2308
- var userEvents = useContext(UserEventsContext).userEvents;
1827
+ const useUserEvents = () => {
1828
+ const { userEvents } = useContext(UserEventsContext);
2309
1829
  if (!userEvents) {
2310
1830
  console.error('useUserEvents must be called inside a UserEventsContext');
2311
1831
  }
2312
1832
  return userEvents;
2313
1833
  };
2314
1834
 
2315
- var supportsWebP = undefined;
2316
- var useWebP = function (webp, alt) {
2317
- var _a = __read(useState(supportsWebP === true ? webp : supportsWebP === false ? alt : undefined), 2), img = _a[0], setImg = _a[1];
2318
- useAsyncEffect(function (mounted) { return __awaiter(void 0, void 0, void 0, function () {
2319
- return __generator(this, function (_a) {
2320
- switch (_a.label) {
2321
- case 0:
2322
- if (!(supportsWebP === undefined)) return [3 /*break*/, 2];
2323
- return [4 /*yield*/, getSupportsWebP()];
2324
- case 1:
2325
- supportsWebP = _a.sent();
2326
- if (mounted()) {
2327
- setImg(supportsWebP ? webp : alt);
2328
- }
2329
- _a.label = 2;
2330
- case 2: return [2 /*return*/];
1835
+ let supportsWebP = undefined;
1836
+ const useWebP = (webp, alt) => {
1837
+ const [img, setImg] = useState(supportsWebP === true ? webp : supportsWebP === false ? alt : undefined);
1838
+ useAsyncEffect((mounted) => __awaiter(void 0, void 0, void 0, function* () {
1839
+ if (supportsWebP === undefined) {
1840
+ supportsWebP = yield getSupportsWebP();
1841
+ if (mounted()) {
1842
+ setImg(supportsWebP ? webp : alt);
2331
1843
  }
2332
- });
2333
- }); }, [supportsWebP]);
1844
+ }
1845
+ }), [supportsWebP]);
2334
1846
  return img;
2335
1847
  };
2336
- var getSupportsWebP = function () { return __awaiter(void 0, void 0, void 0, function () {
2337
- return __generator(this, function (_a) {
2338
- switch (_a.label) {
2339
- case 0: return [4 /*yield*/, new Promise(function (resolve) {
2340
- var image = new Image();
2341
- image.onerror = function () { return resolve(false); };
2342
- image.onload = function () { return resolve(image.width === 1); };
2343
- image.src = 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=';
2344
- }).catch(function () { return false; })];
2345
- case 1: return [2 /*return*/, _a.sent()];
2346
- }
2347
- });
2348
- }); };
1848
+ const getSupportsWebP = () => __awaiter(void 0, void 0, void 0, function* () {
1849
+ return yield new Promise((resolve) => {
1850
+ const image = new Image();
1851
+ image.onerror = () => resolve(false);
1852
+ image.onload = () => resolve(image.width === 1);
1853
+ image.src = 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=';
1854
+ }).catch(() => false);
1855
+ });
2349
1856
 
2350
1857
  function useWindowSize() {
2351
- var _a = __read(useState({
1858
+ const [windowSize, setWindowSize] = useState({
2352
1859
  height: undefined,
2353
1860
  width: undefined,
2354
- }), 2), windowSize = _a[0], setWindowSize = _a[1];
2355
- useEffect(function () {
1861
+ });
1862
+ useEffect(() => {
2356
1863
  function handleResize() {
2357
1864
  setWindowSize({
2358
1865
  height: window.innerHeight,
@@ -2361,25 +1868,25 @@ function useWindowSize() {
2361
1868
  }
2362
1869
  window.addEventListener('resize', handleResize);
2363
1870
  handleResize();
2364
- return function () { return window.removeEventListener('resize', handleResize); };
1871
+ return () => window.removeEventListener('resize', handleResize);
2365
1872
  }, []);
2366
1873
  return windowSize;
2367
1874
  }
2368
1875
 
2369
- var EthAccount = function (_a) {
2370
- var address = _a.address, _b = _a.icon, icon = _b === void 0 ? false : _b, _c = _a.iconSize, iconSize = _c === void 0 ? 16 : _c, _d = _a.iconOnly, iconOnly = _d === void 0 ? false : _d, _e = _a.addressLength, addressLength = _e === void 0 ? 'auto' : _e, _f = _a.fontFamily, fontFamily = _f === void 0 ? '"Source Code Pro",monospace' : _f, toEtherScan = _a.toEtherScan, onButtonClick = _a.onButtonClick, props = __rest(_a, ["address", "icon", "iconSize", "iconOnly", "addressLength", "fontFamily", "toEtherScan", "onButtonClick"]);
2371
- var localAddress = useContext(EthersContext).localAddress;
2372
- var theme = useTheme();
2373
- var large = useMediaQuery(theme.breakpoints.up('md'));
2374
- var isLocalAddress = address ? (localAddress === null || localAddress === void 0 ? void 0 : localAddress.toString()) === address.toString() : false;
2375
- var onClickLocal = function (event) {
1876
+ const EthAccount = (_a) => {
1877
+ var { address, icon = false, iconSize = 16, iconOnly = false, addressLength = 'auto', fontFamily = '"Source Code Pro",monospace', toEtherScan, onButtonClick } = _a, props = __rest(_a, ["address", "icon", "iconSize", "iconOnly", "addressLength", "fontFamily", "toEtherScan", "onButtonClick"]);
1878
+ const { localAddress } = useContext(EthersContext);
1879
+ const theme = useTheme();
1880
+ const large = useMediaQuery(theme.breakpoints.up('md'));
1881
+ const isLocalAddress = address ? (localAddress === null || localAddress === void 0 ? void 0 : localAddress.toString()) === address.toString() : false;
1882
+ const onClickLocal = (event) => {
2376
1883
  onButtonClick === null || onButtonClick === void 0 ? void 0 : onButtonClick(event);
2377
1884
  if (toEtherScan && address) {
2378
- window.open("https://etherscan.io/address/".concat(address.toString()), '_blank');
1885
+ window.open(`https://etherscan.io/address/${address.toString()}`, '_blank');
2379
1886
  }
2380
1887
  };
2381
- var addressToDisplay = assertEx(address !== null && address !== void 0 ? address : EthAddress.fromString('0x00'), 'Bad Eth Address');
2382
- var testToDisplay = addressLength === 'long'
1888
+ const addressToDisplay = assertEx(address !== null && address !== void 0 ? address : EthAddress.fromString('0x00'), 'Bad Eth Address');
1889
+ const testToDisplay = addressLength === 'long'
2383
1890
  ? addressToDisplay.toString()
2384
1891
  : addressLength === 'short'
2385
1892
  ? addressToDisplay.toShortString()
@@ -2387,36 +1894,36 @@ var EthAccount = function (_a) {
2387
1894
  ? addressToDisplay.toString()
2388
1895
  : addressToDisplay.toShortString();
2389
1896
  // Note: We use the all zero address for spacing in case it is
2390
- return (jsx(ButtonEx, __assign({ onClick: onClickLocal, title: "0x".concat(address === null || address === void 0 ? void 0 : address.toHex()) }, props, { children: jsxs(FlexGrowRow, __assign({ justifyContent: "space-between", alignItems: "center" }, { children: [icon && address ? jsx(Identicon, { size: iconSize, value: address === null || address === void 0 ? void 0 : address.toHex() }, void 0) : null, iconOnly ? null : (jsxs(FlexRow, { children: [jsx(Typography, __assign({ marginLeft: icon ? 1 : 0, variant: "body1", fontFamily: fontFamily, visibility: address ? 'inherit' : 'hidden' }, { children: testToDisplay }), void 0), address ? null : (jsx(Typography, __assign({ position: "absolute", marginLeft: icon ? 1 : 0, variant: "body1", fontFamily: fontFamily }, { children: "-- --" }), void 0))] }, void 0)), isLocalAddress ? jsx(FlexRow, __assign({ marginLeft: 0.5 }, { children: "(You)" }), void 0) : null] }), void 0) }), void 0));
1897
+ return (jsx(ButtonEx, Object.assign({ onClick: onClickLocal, title: `0x${address === null || address === void 0 ? void 0 : address.toHex()}` }, props, { children: jsxs(FlexGrowRow, Object.assign({ justifyContent: "space-between", alignItems: "center" }, { children: [icon && address ? jsx(Identicon, { size: iconSize, value: address === null || address === void 0 ? void 0 : address.toHex() }, void 0) : null, iconOnly ? null : (jsxs(FlexRow, { children: [jsx(Typography, Object.assign({ marginLeft: icon ? 1 : 0, variant: "body1", fontFamily: fontFamily, visibility: address ? 'inherit' : 'hidden' }, { children: testToDisplay }), void 0), address ? null : (jsx(Typography, Object.assign({ position: "absolute", marginLeft: icon ? 1 : 0, variant: "body1", fontFamily: fontFamily }, { children: "-- --" }), void 0))] }, void 0)), isLocalAddress ? jsx(FlexRow, Object.assign({ marginLeft: 0.5 }, { children: "(You)" }), void 0) : null] }), void 0) }), void 0));
2391
1898
  };
2392
1899
 
2393
- var Experiment = function (props) {
2394
- var children = props.children;
1900
+ const Experiment = (props) => {
1901
+ const { children } = props;
2395
1902
  return jsx(Fragment, { children: children }, void 0);
2396
1903
  };
2397
1904
 
2398
- var OutcomesLocalStorageKey = 'outcomes';
2399
- var ExperimentsLocalStorageKey = 'experiments';
1905
+ const OutcomesLocalStorageKey = 'outcomes';
1906
+ const ExperimentsLocalStorageKey = 'experiments';
2400
1907
 
2401
- var defaultLocalStorageKey = 'testData';
2402
- var experimentsTestData = {};
2403
- var outcomes = {}; //prevent multi-outcome
2404
- var saveOutcomes = function () {
1908
+ const defaultLocalStorageKey = 'testData';
1909
+ const experimentsTestData = {};
1910
+ let outcomes = {}; //prevent multi-outcome
1911
+ const saveOutcomes = () => {
2405
1912
  setLocalStorageObject(OutcomesLocalStorageKey, outcomes);
2406
1913
  };
2407
- var loadOutcomes = function () {
1914
+ const loadOutcomes = () => {
2408
1915
  outcomes = getLocalStorageObject(OutcomesLocalStorageKey);
2409
1916
  };
2410
- var mergeData = function (data, log) {
2411
- var dataArray = [];
2412
- for (var key in data) {
2413
- dataArray.push("".concat(key, "-").concat(data[key]));
1917
+ const mergeData = (data, log) => {
1918
+ const dataArray = [];
1919
+ for (const key in data) {
1920
+ dataArray.push(`${key}-${data[key]}`);
2414
1921
  }
2415
1922
  log === null || log === void 0 ? void 0 : log.info('MergeData', dataArray.join('|'));
2416
1923
  return dataArray.join('|');
2417
1924
  };
2418
- var missingKeyError = new Error('Experiment Elements must have Keys');
2419
- var makeChildrenArray = function (children) {
1925
+ const missingKeyError = new Error('Experiment Elements must have Keys');
1926
+ const makeChildrenArray = (children) => {
2420
1927
  if (Array.isArray(children)) {
2421
1928
  return children;
2422
1929
  }
@@ -2424,36 +1931,25 @@ var makeChildrenArray = function (children) {
2424
1931
  return [children];
2425
1932
  }
2426
1933
  };
2427
- var buildLocalStorageKey = function (localStorageProp) {
1934
+ const buildLocalStorageKey = (localStorageProp) => {
2428
1935
  return localStorageProp === true
2429
1936
  ? defaultLocalStorageKey
2430
1937
  : typeof localStorageProp === 'string'
2431
1938
  ? localStorageProp !== null && localStorageProp !== void 0 ? localStorageProp : defaultLocalStorageKey
2432
1939
  : '';
2433
1940
  };
2434
- var calcTotalWeight = function (childList) {
2435
- var e_1, _a;
2436
- var totalWeight = 0;
2437
- try {
2438
- for (var childList_1 = __values(childList), childList_1_1 = childList_1.next(); !childList_1_1.done; childList_1_1 = childList_1.next()) {
2439
- var child = childList_1_1.value;
2440
- totalWeight += child.props.weight;
2441
- }
2442
- }
2443
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2444
- finally {
2445
- try {
2446
- if (childList_1_1 && !childList_1_1.done && (_a = childList_1.return)) _a.call(childList_1);
2447
- }
2448
- finally { if (e_1) throw e_1.error; }
1941
+ const calcTotalWeight = (childList) => {
1942
+ let totalWeight = 0;
1943
+ for (const child of childList) {
1944
+ totalWeight += child.props.weight;
2449
1945
  }
2450
1946
  return totalWeight;
2451
1947
  };
2452
- var saveExperimentDebugRanges = function (name, totalWeight, childList) {
2453
- var experiments = getLocalStorageObject(ExperimentsLocalStorageKey) || {};
1948
+ const saveExperimentDebugRanges = (name, totalWeight, childList) => {
1949
+ const experiments = getLocalStorageObject(ExperimentsLocalStorageKey) || {};
2454
1950
  experiments[name] = {
2455
- totalWeight: totalWeight,
2456
- variants: childList.map(function (child) {
1951
+ totalWeight,
1952
+ variants: childList.map((child) => {
2457
1953
  var _a;
2458
1954
  return ({
2459
1955
  name: (_a = child.key) === null || _a === void 0 ? void 0 : _a.toString(),
@@ -2463,109 +1959,114 @@ var saveExperimentDebugRanges = function (name, totalWeight, childList) {
2463
1959
  };
2464
1960
  setLocalStorageObject(ExperimentsLocalStorageKey, experiments);
2465
1961
  };
2466
- var Experiments = function (props) {
2467
- var e_2, _a;
2468
- var _b, _c;
2469
- var name = props.name, children = props.children, _d = props.localStorageProp, localStorageProp = _d === void 0 ? true : _d;
2470
- var userEvents = useUserEvents();
1962
+ const Experiments = (props) => {
1963
+ var _a, _b;
1964
+ const { name, children, localStorageProp = true } = props;
1965
+ const userEvents = useUserEvents();
2471
1966
  loadOutcomes();
2472
- var localStorageKey = buildLocalStorageKey(localStorageProp);
2473
- var childList = makeChildrenArray(children);
2474
- var totalWeight = calcTotalWeight(childList);
1967
+ const localStorageKey = buildLocalStorageKey(localStorageProp);
1968
+ const childList = makeChildrenArray(children);
1969
+ const totalWeight = calcTotalWeight(childList);
2475
1970
  saveExperimentDebugRanges(name, totalWeight, childList);
2476
- var firstTime = outcomes[name] === undefined;
2477
- var targetWeight = (_b = outcomes[name]) !== null && _b !== void 0 ? _b : Math.random() * totalWeight;
1971
+ const firstTime = outcomes[name] === undefined;
1972
+ let targetWeight = (_a = outcomes[name]) !== null && _a !== void 0 ? _a : Math.random() * totalWeight;
2478
1973
  outcomes[name] = targetWeight;
2479
1974
  saveOutcomes();
2480
- try {
2481
- for (var childList_2 = __values(childList), childList_2_1 = childList_2.next(); !childList_2_1.done; childList_2_1 = childList_2.next()) {
2482
- var child = childList_2_1.value;
2483
- targetWeight -= child.props.weight;
2484
- if (targetWeight > 0)
2485
- continue;
2486
- if (!child.key) {
2487
- throw missingKeyError;
1975
+ for (const child of childList) {
1976
+ targetWeight -= child.props.weight;
1977
+ if (targetWeight > 0)
1978
+ continue;
1979
+ if (!child.key) {
1980
+ throw missingKeyError;
1981
+ }
1982
+ experimentsTestData[name] = (_b = child.key) === null || _b === void 0 ? void 0 : _b.toString();
1983
+ if (firstTime) {
1984
+ if (localStorageProp !== false) {
1985
+ localStorage.setItem(localStorageKey, mergeData(experimentsTestData));
2488
1986
  }
2489
- experimentsTestData[name] = (_c = child.key) === null || _c === void 0 ? void 0 : _c.toString();
2490
- if (firstTime) {
2491
- if (localStorageProp !== false) {
2492
- localStorage.setItem(localStorageKey, mergeData(experimentsTestData));
2493
- }
2494
- if (userEvents) {
2495
- forget(userEvents.testStarted({ name: name, variation: child.key }));
2496
- }
1987
+ if (userEvents) {
1988
+ forget(userEvents.testStarted({ name, variation: child.key }));
2497
1989
  }
2498
- return child;
2499
1990
  }
2500
- }
2501
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
2502
- finally {
2503
- try {
2504
- if (childList_2_1 && !childList_2_1.done && (_a = childList_2.return)) _a.call(childList_2);
2505
- }
2506
- finally { if (e_2) throw e_2.error; }
1991
+ return child;
2507
1992
  }
2508
1993
  throw new Error('Experiment Choice Failed');
2509
1994
  };
2510
1995
 
2511
- var ExperimentsDebugger = function (_a) {
1996
+ const ExperimentsDebugger = (_a) => {
2512
1997
  var props = __rest(_a, []);
2513
- var _b = __read(useLocalStorage(ExperimentsLocalStorageKey, {}), 1), experiments = _b[0];
2514
- var _c = __read(useLocalStorage(OutcomesLocalStorageKey, {}), 2), outcomes = _c[0], setOutcomes = _c[1];
2515
- var sumUpVariants = function (items) { return items.reduce(function (acc, curr) { return acc + curr.weight; }, 0); };
2516
- var experimentEntries = Object.entries(experiments);
1998
+ const [experiments] = useLocalStorage(ExperimentsLocalStorageKey, {});
1999
+ const [outcomes, setOutcomes] = useLocalStorage(OutcomesLocalStorageKey, {});
2000
+ const sumUpVariants = (items) => items.reduce((acc, curr) => acc + curr.weight, 0);
2001
+ const experimentEntries = Object.entries(experiments);
2517
2002
  if (!experiments || !experimentEntries.length) {
2518
- return (jsxs(FlexCol, __assign({ alignItems: "stretch" }, props, { children: [jsx(Typography, __assign({ variant: "subtitle1" }, { children: "No Experiments loaded" }), void 0), jsx(Typography, __assign({ variant: "subtitle2" }, { children: "Visit a page with an experiment to load the data" }), void 0)] }), void 0));
2519
- }
2520
- return (jsx(FlexCol, __assign({ alignItems: "stretch" }, props, { children: Object.entries(experiments).map(function (data) {
2521
- var _a = __read(data, 2), name = _a[0], experiment = _a[1];
2522
- var outcome = (outcomes[name] || 0);
2523
- var marks = __spreadArray([
2524
- { label: "".concat(experiment.variants[0].name, " | ").concat(experiment.variants[0].weight), value: 0 }
2525
- ], __read(experiment.variants.map(function (_a, index) {
2526
- var weight = _a.weight;
2527
- return ({
2528
- label: index === experiment.variants.length - 1 ? 'End' : "".concat(experiment.variants[index + 1].name, " | ").concat(weight),
2003
+ return (jsxs(FlexCol, Object.assign({ alignItems: "stretch" }, props, { children: [jsx(Typography, Object.assign({ variant: "subtitle1" }, { children: "No Experiments loaded" }), void 0), jsx(Typography, Object.assign({ variant: "subtitle2" }, { children: "Visit a page with an experiment to load the data" }), void 0)] }), void 0));
2004
+ }
2005
+ return (jsx(FlexCol, Object.assign({ alignItems: "stretch" }, props, { children: Object.entries(experiments).map((data) => {
2006
+ const [name, experiment] = data;
2007
+ const outcome = (outcomes[name] || 0);
2008
+ const marks = [
2009
+ { label: `${experiment.variants[0].name} | ${experiment.variants[0].weight}`, value: 0 },
2010
+ ...experiment.variants.map(({ weight }, index) => ({
2011
+ label: index === experiment.variants.length - 1 ? 'End' : `${experiment.variants[index + 1].name} | ${weight}`,
2529
2012
  value: index === 0 ? weight : sumUpVariants(experiment.variants.slice(0, index + 1)),
2530
- });
2531
- })), false);
2532
- return (jsxs(FlexCol, __assign({ alignItems: "stretch", paddingX: 4, marginBottom: 4 }, props, { children: [jsxs(FlexRow, { children: [name, ":\u00A0", outcome] }, void 0), jsx(FlexRow, { children: jsx(Slider, { "aria-label": "Experiment ".concat(name), defaultValue: outcome, value: outcome, marks: marks, onChange: function (e, value) {
2533
- var truncated = Number((Array.isArray(value) ? value[0] : value).toFixed(2));
2013
+ })),
2014
+ ];
2015
+ return (jsxs(FlexCol, Object.assign({ alignItems: "stretch", paddingX: 4, marginBottom: 4 }, props, { children: [jsxs(FlexRow, { children: [name, ":\u00A0", outcome] }, void 0), jsx(FlexRow, { children: jsx(Slider, { "aria-label": `Experiment ${name}`, defaultValue: outcome, value: outcome, marks: marks, onChange: (e, value) => {
2016
+ const truncated = Number((Array.isArray(value) ? value[0] : value).toFixed(2));
2534
2017
  outcomes[name] = truncated;
2535
2018
  // Spread operator triggers rerender
2536
- setOutcomes(__assign({}, outcomes));
2537
- } }, void 0) }, void 0)] }), "experiment-".concat(name)));
2019
+ setOutcomes(Object.assign({}, outcomes));
2020
+ } }, void 0) }, void 0)] }), `experiment-${name}`));
2538
2021
  }) }), void 0));
2539
2022
  };
2540
2023
 
2541
- var LinkToEx = function (_a) {
2542
- var to = _a.to, props = __rest(_a, ["to"]);
2543
- return jsx(Link, __assign({ component: Link$1, to: to }, props), void 0);
2024
+ const LinkToEx = (_a) => {
2025
+ var { to } = _a, props = __rest(_a, ["to"]);
2026
+ return jsx(Link, Object.assign({ component: Link$1, to: to }, props), void 0);
2544
2027
  };
2545
2028
 
2546
- var NumberStatus = function (_a) {
2029
+ const NumberStatus = (_a) => {
2547
2030
  var _b, _c;
2548
- var error = _a.error, _d = _a.format, format = _d === void 0 ? '0[.]0a' : _d, _e = _a.color, color = _e === void 0 ? 'primary' : _e, title = _a.title, value = _a.value, size = _a.size, fontSize = _a.fontSize, _f = _a.rounded, rounded = _f === void 0 ? false : _f, _g = _a.autoWidth, autoWidth = _g === void 0 ? false : _g, style = _a.style, props = __rest(_a, ["error", "format", "color", "title", "value", "size", "fontSize", "rounded", "autoWidth", "style"]);
2549
- var theme = useTheme();
2550
- var palette = color === 'inherit' ? undefined : theme.palette[color];
2551
- var bgColorTop = (_b = palette === null || palette === void 0 ? void 0 : palette.dark) !== null && _b !== void 0 ? _b : theme.palette.background.paper;
2552
- var bgColorBottom = (_c = palette === null || palette === void 0 ? void 0 : palette.main) !== null && _c !== void 0 ? _c : theme.palette.background.default;
2553
- var sizePixels = size === 'large' ? 96 : size === 'small' ? 64 : 80;
2554
- var calcFontSize = fontSize !== null && fontSize !== void 0 ? fontSize : sizePixels * 0.2;
2555
- return (jsx(ButtonEx, __assign({ size: size, padding: 0, style: __assign({ borderRadius: rounded ? theme.shape.borderRadius : 0, overflow: rounded ? 'hidden' : undefined }, style) }, props, { children: jsxs(FlexCol, __assign({ alignItems: "stretch", height: sizePixels, width: autoWidth ? '100%' : sizePixels, busy: value === undefined && !error }, { children: [jsx(FlexGrowRow, __assign({ bgcolor: bgColorTop, color: theme.palette.getContrastText(bgColorTop), fontSize: calcFontSize, fontFamily: "Source Code Pro,monospace", alignItems: "center", height: sizePixels * 0.75 }, { children: numeral(value).format(format) }), void 0), jsx(FlexGrowRow, __assign({ bgcolor: bgColorBottom, borderTop: "1px", color: theme.palette.getContrastText(bgColorBottom), fontSize: sizePixels * 0.12, fontFamily: theme.typography.fontFamily, height: sizePixels * 0.25 }, { children: title }), void 0)] }), void 0) }), void 0));
2031
+ var { error, format = '0[.]0a', color = 'primary', title, value, size, fontSize, rounded = false, autoWidth = false, style } = _a, props = __rest(_a, ["error", "format", "color", "title", "value", "size", "fontSize", "rounded", "autoWidth", "style"]);
2032
+ const theme = useTheme();
2033
+ const palette = color === 'inherit' ? undefined : theme.palette[color];
2034
+ const bgColorTop = (_b = palette === null || palette === void 0 ? void 0 : palette.dark) !== null && _b !== void 0 ? _b : theme.palette.background.paper;
2035
+ const bgColorBottom = (_c = palette === null || palette === void 0 ? void 0 : palette.main) !== null && _c !== void 0 ? _c : theme.palette.background.default;
2036
+ const sizePixels = size === 'large' ? 96 : size === 'small' ? 64 : 80;
2037
+ const calcFontSize = fontSize !== null && fontSize !== void 0 ? fontSize : sizePixels * 0.2;
2038
+ return (jsx(ButtonEx, Object.assign({ size: size, padding: 0, style: Object.assign({ borderRadius: rounded ? theme.shape.borderRadius : 0, overflow: rounded ? 'hidden' : undefined }, style) }, props, { children: jsxs(FlexCol, Object.assign({ alignItems: "stretch", height: sizePixels, width: autoWidth ? '100%' : sizePixels, busy: value === undefined && !error }, { children: [jsx(FlexGrowRow, Object.assign({ bgcolor: bgColorTop, color: theme.palette.getContrastText(bgColorTop), fontSize: calcFontSize, fontFamily: "Source Code Pro,monospace", alignItems: "center", height: sizePixels * 0.75 }, { children: numeral(value).format(format) }), void 0), jsx(FlexGrowRow, Object.assign({ bgcolor: bgColorBottom, borderTop: "1px", color: theme.palette.getContrastText(bgColorBottom), fontSize: sizePixels * 0.12, fontFamily: theme.typography.fontFamily, height: sizePixels * 0.25 }, { children: title }), void 0)] }), void 0) }), void 0));
2039
+ };
2040
+
2041
+ const Portal = ({ children, className, el = 'div', target = 'body' }) => {
2042
+ const [container] = useState(document.createElement(el));
2043
+ if (className) {
2044
+ container.classList.add(className);
2045
+ }
2046
+ useEffect(() => {
2047
+ const targetElement = document.querySelector(target);
2048
+ if (!targetElement) {
2049
+ console.warn(`Unable to find target element: ${target}`);
2050
+ }
2051
+ targetElement === null || targetElement === void 0 ? void 0 : targetElement.appendChild(container);
2052
+ return () => {
2053
+ targetElement === null || targetElement === void 0 ? void 0 : targetElement.removeChild(container);
2054
+ };
2055
+ }, [container, target]);
2056
+ return createPortal(children, container);
2556
2057
  };
2557
2058
 
2558
- var QuickTipButton = function (_a) {
2559
- var title = _a.title, children = _a.children, props = __rest(_a, ["title", "children"]);
2560
- var _b = __read(useState(false), 2), messageOpen = _b[0], setMessageOpen = _b[1];
2561
- return (jsxs(Fragment, { children: [jsx(IconButton, __assign({ onClick: function () { return setMessageOpen(true); }, size: "small" }, props, { children: jsx(AiOutlineQuestionCircle, { size: 16 }, void 0) }), void 0), jsx(MessageDialog, __assign({ onOk: function () { return setMessageOpen(false); }, onCancel: function () { return setMessageOpen(false); }, onClose: function () { return setMessageOpen(false); }, open: messageOpen, title: title !== null && title !== void 0 ? title : '' }, { children: children }), void 0)] }, void 0));
2059
+ const QuickTipButton = (_a) => {
2060
+ var { title, children } = _a, props = __rest(_a, ["title", "children"]);
2061
+ const [messageOpen, setMessageOpen] = useState(false);
2062
+ return (jsxs(Fragment, { children: [jsx(IconButton, Object.assign({ onClick: () => setMessageOpen(true), size: "small" }, props, { children: jsx(AiOutlineQuestionCircle, { size: 16 }, void 0) }), void 0), jsx(MessageDialog, Object.assign({ onOk: () => setMessageOpen(false), onCancel: () => setMessageOpen(false), onClose: () => setMessageOpen(false), open: messageOpen, title: title !== null && title !== void 0 ? title : '' }, { children: children }), void 0)] }, void 0));
2562
2063
  };
2563
2064
 
2564
- var RichResult = function (props) {
2565
- var thing = props.thing;
2566
- var thingWithContext = thing;
2065
+ const RichResult = (props) => {
2066
+ const { thing } = props;
2067
+ const thingWithContext = thing;
2567
2068
  thingWithContext['@context'] = 'https://schema.org';
2568
- return jsx("script", __assign({ type: "application/ld+json" }, { children: JSON.stringify(thingWithContext) }), void 0);
2069
+ return jsx("script", Object.assign({ type: "application/ld+json" }, { children: JSON.stringify(thingWithContext) }), void 0);
2569
2070
  };
2570
2071
 
2571
2072
  var ActionStatusType;
@@ -2612,19 +2113,10 @@ var MapCategoryType;
2612
2113
  MapCategoryType["VenueMap"] = "VenueMap";
2613
2114
  })(MapCategoryType || (MapCategoryType = {}));
2614
2115
 
2615
- // The point of this component it to return to the top of the page on any router navigate
2616
- var ScrollToTop = function () {
2617
- var pathname = useLocation().pathname;
2618
- useEffect(function () {
2619
- window.scrollTo(0, 0);
2620
- }, [pathname]);
2621
- return null;
2622
- };
2623
-
2624
2116
  var img = "data:image/svg+xml,%3csvg id='Layer_1' data-name='Layer 1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 238'%3e%3cdefs%3e%3cstyle%3e.cls-1%7bfill:%23999%3b%7d%3c/style%3e%3c/defs%3e%3ctitle%3eicon_gray%3c/title%3e%3cpath class='cls-1' d='M74.5%2c28.33%2c21.29%2c120.5%2c74.5%2c212.67H180.94l1.76-3%2c51.46-89.13L180.94%2c28.33ZM84.65%2c40.54h78.83L111.65%2c56.93a15.85%2c15.85%2c0%2c0%2c1%2c2%2c5l59.66-18.81L185.22%2c101a20.12%2c20.12%2c0%2c0%2c1%2c5.36-.78l-10-47.91%2c37.87%2c65.53h-7.62a24.21%2c24.21%2c0%2c0%2c1%2c.15%2c2.68%2c23.29%2c23.29%2c0%2c0%2c1-.15%2c2.68h7.62l-39.1%2c67.75%2c10.92-50.13A20.57%2c20.57%2c0%2c0%2c1%2c185%2c140l-12.88%2c59-58.37-19.53a17.61%2c17.61%2c0%2c0%2c1-1.7%2c5l47.5%2c15.92H84.65l4-6.85A20.17%2c20.17%2c0%2c0%2c1%2c83.93%2c191L80%2c197.78%2c42.67%2c133.13l37%2c32.66a20.52%2c20.52%2c0%2c0%2c1%2c3.6-4L36.69%2c120.66%2c85%2c77.79a17.45%2c17.45%2c0%2c0%2c1-3.19-4.32l-39.46%2c35L80%2c43.22l5.56%2c9.69A17.51%2c17.51%2c0%2c0%2c1%2c90.12%2c50Zm28.24%2c31.17a16.15%2c16.15%2c0%2c0%2c1-2.68%2c4.64l62%2c35.81a19.74%2c19.74%2c0%2c0%2c1%2c2.83-4.54Zm-20%2c10.51v75.33a18%2c18%2c0%2c0%2c1%2c2.47-.16%2c17.18%2c17.18%2c0%2c0%2c1%2c2.89.21v-75a11.21%2c11.21%2c0%2c0%2c1-1.29%2c0%2c17.57%2c17.57%2c0%2c0%2c1-4.07-.47Zm79.34%2c46.63-62.08%2c35.81a18.45%2c18.45%2c0%2c0%2c1%2c2.68%2c4.68l62.23-36a19.68%2c19.68%2c0%2c0%2c1-2.83-4.53Z'/%3e%3cpath class='cls-1' d='M97%2c48.58a17.06%2c17.06%2c0%2c1%2c0%2c17%2c17%2c17.08%2c17.08%2c0%2c0%2c0-17-17Zm0%2c5.36a11.7%2c11.7%2c0%2c1%2c1-11.7%2c11.69A11.65%2c11.65%2c0%2c0%2c1%2c97%2c53.94Z'/%3e%3cpath class='cls-1' d='M95.37%2c157.39a18.73%2c18.73%2c0%2c1%2c0%2c18.7%2c18.7%2c18.74%2c18.74%2c0%2c0%2c0-18.7-18.7Zm0%2c5.31A13.4%2c13.4%2c0%2c1%2c1%2c82%2c176.09a13.37%2c13.37%2c0%2c0%2c1%2c13.4-13.39Z'/%3e%3cpath class='cls-1' d='M190.73%2c100.2A20.3%2c20.3%2c0%2c1%2c0%2c211%2c120.5a20.34%2c20.34%2c0%2c0%2c0-20.3-20.3Zm0%2c5.36a14.94%2c14.94%2c0%2c1%2c1-14.94%2c14.94%2c14.88%2c14.88%2c0%2c0%2c1%2c14.94-14.94Z'/%3e%3c/svg%3e";
2625
2117
 
2626
- var base10Shift = function (bn, places) {
2627
- var factor = new BigNumber(10).pow(new BigNumber(Math.abs(places)));
2118
+ const base10Shift = (bn, places) => {
2119
+ const factor = new BigNumber(10).pow(new BigNumber(Math.abs(places)));
2628
2120
  if (places > 0) {
2629
2121
  return bn.mul(factor);
2630
2122
  }
@@ -2632,12 +2124,12 @@ var base10Shift = function (bn, places) {
2632
2124
  return bn.div(factor);
2633
2125
  }
2634
2126
  };
2635
- var TokenAmount = function (_a) {
2636
- var _b = _a.textFontFamily, textFontFamily = _b === void 0 ? '"Source Code Pro",monospace' : _b, textColor = _a.textColor, statusColor = _a.statusColor, style = _a.style, amount = _a.amount, _c = _a.places, places = _c === void 0 ? -18 : _c, logo = _a.logo, label = _a.label, onButtonClick = _a.onButtonClick, props = __rest(_a, ["textFontFamily", "textColor", "statusColor", "style", "amount", "places", "logo", "label", "onButtonClick"]);
2637
- var adjustedAmount = amount ? base10Shift(amount, places).toNumber() : undefined;
2638
- var amountString = adjustedAmount ? Math.trunc(adjustedAmount).toLocaleString() : '-';
2639
- return (jsx(ButtonEx, __assign({ style: __assign({ backgroundColor: statusColor }, style), variant: "outlined", onClick: onButtonClick }, props, { children: jsxs(FlexRow, __assign({ justifyContent: "space-between", width: "100%", busy: amount === undefined, busySize: 16 }, { children: [jsxs(FlexRow, { children: [logo ? jsx("img", { src: img, height: 24 }, void 0) : null, label ? (jsx(Typography, __assign({ marginRight: 1, marginLeft: logo ? 1 : 0, noWrap: true, fontFamily: textFontFamily, variant: "caption" }, { children: label }), void 0)) : null] }, void 0), jsx(Typography, __assign({ color: textColor, noWrap: true, fontFamily: textFontFamily, variant: "body1", style: { textTransform: 'none' } }, { children: amountString }), void 0)] }), void 0) }), void 0));
2127
+ const TokenAmount = (_a) => {
2128
+ var { textFontFamily = '"Source Code Pro",monospace', textColor, statusColor, style, amount, places = -18, logo, label, onButtonClick } = _a, props = __rest(_a, ["textFontFamily", "textColor", "statusColor", "style", "amount", "places", "logo", "label", "onButtonClick"]);
2129
+ const adjustedAmount = amount ? base10Shift(amount, places).toNumber() : undefined;
2130
+ const amountString = adjustedAmount ? Math.trunc(adjustedAmount).toLocaleString() : '-';
2131
+ return (jsx(ButtonEx, Object.assign({ style: Object.assign({ backgroundColor: statusColor }, style), variant: "outlined", onClick: onButtonClick }, props, { children: jsxs(FlexRow, Object.assign({ justifyContent: "space-between", width: "100%", busy: amount === undefined, busySize: 16 }, { children: [jsxs(FlexRow, { children: [logo ? jsx("img", { src: img, height: 24 }, void 0) : null, label ? (jsx(Typography, Object.assign({ marginRight: 1, marginLeft: logo ? 1 : 0, noWrap: true, fontFamily: textFontFamily, variant: "caption" }, { children: label }), void 0)) : null] }, void 0), jsx(Typography, Object.assign({ color: textColor, noWrap: true, fontFamily: textFontFamily, variant: "body1", style: { textTransform: 'none' } }, { children: amountString }), void 0)] }), void 0) }), void 0));
2640
2132
  };
2641
2133
 
2642
- export { ActionStatusType, AppBarEx, Background, BasePage, BreadcrumbsEx, BusyBox, ButtonEx, ContactPointOption, CookieConsent, CookieConsentBody, CookieConsentContext, CookieConsentLoader, CoverProgress, DripCustomEvent, DripStandardEvents, ErrorDialog, EthAccount, EthersContext, EthersLoader, Experiment, Experiments, ExperimentsDebugger, FacebookCustomEvent, FacebookStandardEvents, Fbq, FlexCol, FlexGrowCol, FlexGrowRow, FlexRow, GoogleBaseEvent, GoogleCustomEvent, GoogleStandardEvents, GoogleUserEventHandler, Gtag, Gtm, HoverScale, Identicon, InvertableThemeProvider, ItemAvailability, LinkToEx, MapCategoryType, MessageDialog, NetworkSettingsContext, NetworkSettingsLoader, NumberStatus, QuickTipButton, Rdt, RedditCustomEvent, RedditStandardEvents, RedirectWithQuery, Referrer, RichResult, ScrollToTop, ScrollToTopButton, SnapTr, SnapchatStandardEvents, TiktokCustomEvent, TiktokStandardEvents, TokenAmount, Ttq, UserEventsContext, UserEventsLoader, XyBaseEvent, XyCustomEvent, XyUserEventHandler, XyoUserEventHandler, enableProfileLogging, getApiStage, getLocalStorageObject, getSessionStorageObject, isLocalhost, profileBlock, profileResults, setLocalStorageObject, setSessionStorageObject, useAsyncEffect, useBreakpoint, useCookieConsent, useLocalStorage, useMounted, useNavigateToEthAddress, useSpacing, useUserEvents, useWebP, useWindowSize };
2134
+ export { ActionStatusType, AppBarEx, Background, BasePage, BreadcrumbsEx, BusyBox, ButtonEx, ContactPointOption, CookieConsent, CookieConsentBody, CookieConsentContext, CookieConsentLoader, CoverProgress, DripCustomEvent, DripStandardEvents, ErrorDialog, EthAccount, EthersContext, EthersLoader, Experiment, Experiments, ExperimentsDebugger, FacebookCustomEvent, FacebookStandardEvents, Fbq, FlexCol, FlexGrowCol, FlexGrowRow, FlexRow, GoogleBaseEvent, GoogleCustomEvent, GoogleStandardEvents, GoogleUserEventHandler, Gtag, Gtm, HoverScale, Identicon, InvertableThemeProvider, ItemAvailability, LinkToEx, MapCategoryType, MessageDialog, NetworkSettingsContext, NetworkSettingsLoader, NumberStatus, Portal, QuickTipButton, Rdt, RedditCustomEvent, RedditStandardEvents, RedirectWithQuery, Referrer, RichResult, ScrollToTop, ScrollToTopButton, SnapTr, SnapchatStandardEvents, TiktokCustomEvent, TiktokStandardEvents, TokenAmount, Ttq, UserEventsContext, UserEventsLoader, XyBaseEvent, XyCustomEvent, XyUserEventHandler, XyoUserEventHandler, enableProfileLogging, getApiStage, getLocalStorageObject, getSessionStorageObject, isLocalhost, profileBlock, profileResults, setLocalStorageObject, setSessionStorageObject, useAsyncEffect, useBreakpoint, useCookieConsent, useLocalStorage, useMounted, useNavigateToEthAddress, useSpacing, useUserEvents, useWebP, useWindowSize };
2643
2135
  //# sourceMappingURL=index.js.map