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