@xylabs/sdk-react 2.9.9 → 2.9.13

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