@dynamic-labs/sdk-react-core 4.79.2 → 4.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +13 -13
  5. package/src/lib/Main.cjs +2 -2
  6. package/src/lib/Main.js +2 -2
  7. package/src/lib/client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.d.ts +1 -1
  8. package/src/lib/components/LogoutButton/LogoutButton.cjs +2 -2
  9. package/src/lib/components/LogoutButton/LogoutButton.js +2 -2
  10. package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +63 -3
  11. package/src/lib/components/SendBalanceForm/SendBalanceForm.js +63 -3
  12. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.cjs +40 -0
  13. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.d.ts +16 -0
  14. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/TransactionModeSegmentedControl.js +36 -0
  15. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.cjs +17 -0
  16. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.d.ts +8 -0
  17. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/icons.js +12 -0
  18. package/src/lib/components/SendBalanceForm/TransactionModeSegmentedControl/index.d.ts +1 -0
  19. package/src/lib/context/DynamicContext/DynamicContext.cjs +6 -4
  20. package/src/lib/context/DynamicContext/DynamicContext.js +6 -4
  21. package/src/lib/context/DynamicContext/hooks/useHandleLogout/index.d.ts +1 -0
  22. package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +9 -0
  23. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +25 -12
  24. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.d.ts +5 -3
  25. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +24 -11
  26. package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.cjs +3 -3
  27. package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.d.ts +3 -2
  28. package/src/lib/context/DynamicContext/hooks/useRemoveWallet/useRemoveWallet.js +3 -3
  29. package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +2 -0
  30. package/src/lib/context/DynamicContext/types/IInternalDynamicContext.d.ts +8 -1
  31. package/src/lib/events/auth.d.ts +2 -1
  32. package/src/lib/styles/index.shadow.cjs +1 -1
  33. package/src/lib/styles/index.shadow.js +1 -1
  34. package/src/lib/utils/hooks/useAleoShieldedBalances/index.d.ts +1 -0
  35. package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.cjs +372 -0
  36. package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.d.ts +24 -0
  37. package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.js +368 -0
  38. package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs +2 -2
  39. package/src/lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js +2 -2
  40. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +1 -0
  41. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +1 -0
  42. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +1 -0
  43. package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +1 -1
  44. package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +1 -1
  45. package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +3 -3
  46. package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +3 -3
  47. package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.cjs +1 -1
  48. package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.d.ts +2 -1
  49. package/src/lib/utils/hooks/useValidateSession/handleStoreAndEnvironmentMismatch/handleStoreAndEnvironmentMismatch.js +1 -1
  50. package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.cjs +3 -1
  51. package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.d.ts +2 -2
  52. package/src/lib/utils/hooks/useValidateSession/handleWalletInfoOutOfSync/handleWalletInfoOutOfSync.js +3 -1
  53. package/src/lib/utils/hooks/useValidateSession/useValidateSession.cjs +3 -3
  54. package/src/lib/utils/hooks/useValidateSession/useValidateSession.d.ts +3 -3
  55. package/src/lib/utils/hooks/useValidateSession/useValidateSession.js +3 -3
  56. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +2 -2
  57. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +3 -2
  58. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +2 -2
  59. package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +5 -5
  60. package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +5 -5
  61. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -2
  62. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -2
  63. package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs +2 -2
  64. package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js +2 -2
  65. package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.cjs +2 -2
  66. package/src/lib/views/DeviceRegistrationView/DeviceRegistrationView.js +2 -2
  67. package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -2
  68. package/src/lib/views/EmailVerification/EmailVerification.js +2 -2
  69. package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.cjs +2 -2
  70. package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.js +2 -2
  71. package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +7 -7
  72. package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +7 -7
  73. package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.cjs +7 -7
  74. package/src/lib/views/MfaSecureDeviceView/MfaSecureDeviceView.js +7 -7
  75. package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +5 -5
  76. package/src/lib/views/MfaVerificationView/MfaVerificationView.js +5 -5
  77. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
  78. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
  79. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +53 -0
  80. package/src/lib/views/SendBalanceView/SendBalanceView.js +53 -0
  81. package/src/lib/views/SmsVerification/SmsVerification.cjs +2 -2
  82. package/src/lib/views/SmsVerification/SmsVerification.js +2 -2
  83. package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.cjs +2 -2
  84. package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.js +2 -2
  85. package/src/lib/views/WalletLockedView/WalletLockedView.cjs +2 -2
  86. package/src/lib/views/WalletLockedView/WalletLockedView.js +2 -2
  87. package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -2
  88. package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -2
  89. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs +191 -11
  90. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.js +191 -11
  91. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.cjs +5 -2
  92. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.d.ts +10 -1
  93. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/TokenBalanceItem.js +5 -2
  94. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceItem/index.d.ts +1 -0
  95. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.cjs +2 -2
  96. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.d.ts +3 -1
  97. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/TokenBalanceList/TokenBalanceList.js +2 -2
  98. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +2 -2
  99. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +2 -2
  100. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +2 -2
  101. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +2 -2
@@ -1,11 +1,12 @@
1
1
  import { UserProfile } from '@dynamic-labs/types';
2
2
  import type { WalletConnector } from '@dynamic-labs/wallet-connector-core';
3
+ import { SdkLogoutReason } from '../../../context/DynamicContext/hooks/useHandleLogout';
3
4
  import { IDynamicContext } from '../../../context/DynamicContext/types';
4
5
  import { MultiWalletWidgetState, Wallet, WalletWithAction } from '../../../shared';
5
6
  import { MultiWalletWidgetStateSetter } from '../multiWallet';
6
7
  export type UseWalletEventListenersArgs = {
7
8
  disconnectWallet: (walletId: string) => Promise<void>;
8
- handleLogOut(): Promise<void>;
9
+ handleLogOutWithReason(reason: SdkLogoutReason): Promise<void>;
9
10
  multiWallet: boolean;
10
11
  multiWalletWidgetState: MultiWalletWidgetState;
11
12
  primaryWallet: Wallet | null;
@@ -19,4 +20,4 @@ export type UseWalletEventListenersArgs = {
19
20
  refreshConnectedWallet: (walletId: string, walletConnector: WalletConnector, shouldCallCallback?: boolean) => Promise<void>;
20
21
  detectNewWalletsForLinking: boolean;
21
22
  };
22
- export declare const useWalletEventListeners: ({ disconnectWallet, handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, refreshConnectedWallet, detectNewWalletsForLinking, }: UseWalletEventListenersArgs) => void;
23
+ export declare const useWalletEventListeners: ({ disconnectWallet, handleLogOutWithReason, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, refreshConnectedWallet, detectNewWalletsForLinking, }: UseWalletEventListenersArgs) => void;
@@ -30,7 +30,7 @@ import '@dynamic-labs/locale';
30
30
  import '../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
31
31
  import { getAuthMode } from '../../../store/state/authMode/authMode.js';
32
32
 
33
- const useWalletEventListeners = ({ disconnectWallet, handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, refreshConnectedWallet, detectNewWalletsForLinking, }) => {
33
+ const useWalletEventListeners = ({ disconnectWallet, handleLogOutWithReason, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, refreshConnectedWallet, detectNewWalletsForLinking, }) => {
34
34
  const handleAccountChangeWhenAwaitingAccountSwitch = useCallback((isPrimaryWallet, newAddress) => {
35
35
  logger.debug('handleAccountChangeWhenAwaitingAccountSwitch', {
36
36
  isPrimaryWallet,
@@ -159,7 +159,7 @@ const useWalletEventListeners = ({ disconnectWallet, handleLogOut, multiWallet,
159
159
  logger.debug('primary wallet disconnect');
160
160
  const authMode = getAuthMode();
161
161
  if (authMode === 'connect-only') {
162
- handleLogOut();
162
+ handleLogOutWithReason('primary-wallet-disconnected');
163
163
  }
164
164
  });
165
165
  useWalletConnectorEvent(uniqueNonPrimaryWallets, 'disconnect', (affectedConnector) => {
@@ -24,8 +24,10 @@ require('@dynamic-labs/sdk-api-core');
24
24
  require('../../shared/consts/index.cjs');
25
25
  require('../../components/Alert/Alert.cjs');
26
26
  require('../../events/dynamicEvents.cjs');
27
- var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
28
27
  require('../../context/DynamicContext/DynamicContext.cjs');
28
+ require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
29
+ require('../../store/state/authMode/authMode.cjs');
30
+ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
29
31
  require('../../context/CaptchaContext/CaptchaContext.cjs');
30
32
  require('../../context/ErrorContext/ErrorContext.cjs');
31
33
  require('@dynamic-labs/multi-wallet');
@@ -44,8 +46,6 @@ require('../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.c
44
46
  require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
45
47
  require('../../context/AccountExistsContext/AccountExistsContext.cjs');
46
48
  require('../../context/UserWalletsContext/UserWalletsContext.cjs');
47
- require('../../store/state/authMode/authMode.cjs');
48
- require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
49
49
  require('../../context/VerificationContext/VerificationContext.cjs');
50
50
  require('react-dom');
51
51
  require('../../utils/functions/compareChains/compareChains.cjs');
@@ -128,7 +128,7 @@ const BackupUnsuccessfulView = () => {
128
128
  const supportEmail = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportEmail;
129
129
  const supportUrls = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _b === void 0 ? void 0 : _b.supportUrls;
130
130
  const hasContactInfo = Boolean(supportEmail || Object.keys(supportUrls || {}).length > 0);
131
- const { handleLogOut } = useDynamicContext.useDynamicContext();
131
+ const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
132
132
  const refreshPage = () => {
133
133
  window.location.reload();
134
134
  };
@@ -160,7 +160,7 @@ const BackupUnsuccessfulView = () => {
160
160
  'button-group--with-help-section': hasContactInfo,
161
161
  }), children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'logout-button', buttonVariant: 'tertiary', type: 'submit', onClick: () => {
162
162
  logger.logger.error('BackupUnsuccessfulView: Could not backup wallet, logging out');
163
- handleLogOut();
163
+ handleLogOutWithReason('backup-unsuccessful');
164
164
  }, copykey: 'dyn_waas.backup_unsuccessful.log_out', typographyProps: {
165
165
  color: 'inherit',
166
166
  weight: 'medium',
@@ -20,8 +20,10 @@ import '@dynamic-labs/sdk-api-core';
20
20
  import '../../shared/consts/index.js';
21
21
  import '../../components/Alert/Alert.js';
22
22
  import '../../events/dynamicEvents.js';
23
- import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
24
23
  import '../../context/DynamicContext/DynamicContext.js';
24
+ import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
25
+ import '../../store/state/authMode/authMode.js';
26
+ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
25
27
  import '../../context/CaptchaContext/CaptchaContext.js';
26
28
  import '../../context/ErrorContext/ErrorContext.js';
27
29
  import '@dynamic-labs/multi-wallet';
@@ -40,8 +42,6 @@ import '../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js
40
42
  import '../../context/AccessDeniedContext/AccessDeniedContext.js';
41
43
  import '../../context/AccountExistsContext/AccountExistsContext.js';
42
44
  import '../../context/UserWalletsContext/UserWalletsContext.js';
43
- import '../../store/state/authMode/authMode.js';
44
- import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
45
45
  import '../../context/VerificationContext/VerificationContext.js';
46
46
  import 'react-dom';
47
47
  import '../../utils/functions/compareChains/compareChains.js';
@@ -124,7 +124,7 @@ const BackupUnsuccessfulView = () => {
124
124
  const supportEmail = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportEmail;
125
125
  const supportUrls = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _b === void 0 ? void 0 : _b.supportUrls;
126
126
  const hasContactInfo = Boolean(supportEmail || Object.keys(supportUrls || {}).length > 0);
127
- const { handleLogOut } = useDynamicContext();
127
+ const { handleLogOutWithReason } = useInternalDynamicContext();
128
128
  const refreshPage = () => {
129
129
  window.location.reload();
130
130
  };
@@ -156,7 +156,7 @@ const BackupUnsuccessfulView = () => {
156
156
  'button-group--with-help-section': hasContactInfo,
157
157
  }), children: jsx(TypographyButton, { buttonClassName: 'logout-button', buttonVariant: 'tertiary', type: 'submit', onClick: () => {
158
158
  logger.error('BackupUnsuccessfulView: Could not backup wallet, logging out');
159
- handleLogOut();
159
+ handleLogOutWithReason('backup-unsuccessful');
160
160
  }, copykey: 'dyn_waas.backup_unsuccessful.log_out', typographyProps: {
161
161
  color: 'inherit',
162
162
  weight: 'medium',
@@ -124,7 +124,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
124
124
 
125
125
  const CollectUserDataView = () => {
126
126
  var _a;
127
- const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
127
+ const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOutWithReason, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
128
128
  const nameService = useFetchNameService.useFetchNameService();
129
129
  const { t } = reactI18next.useTranslation();
130
130
  if (!userWithMissingInfo) {
@@ -139,7 +139,7 @@ const CollectUserDataView = () => {
139
139
  'collect-user-data__form--error': shouldDisplayWrongNetworkState,
140
140
  }), children: [jsxRuntime.jsx("div", { className: 'collect-user-data__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { disableSubmit: shouldDisplayWrongNetworkState, userProfile: userWithMissingInfo, children: shouldDisplayWrongNetworkState ? (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
141
141
  t('dyn_collect_user_data.greeting', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
142
- t('dyn_collect_user_data.description') })] })) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
142
+ t('dyn_collect_user_data.description') })] })) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data__log-out', onClick: () => handleLogOutWithReason('user-data-collection-cancelled'), copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
143
143
  };
144
144
 
145
145
  exports.CollectUserDataView = CollectUserDataView;
@@ -120,7 +120,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
120
120
 
121
121
  const CollectUserDataView = () => {
122
122
  var _a;
123
- const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
123
+ const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOutWithReason, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
124
124
  const nameService = useFetchNameService();
125
125
  const { t } = useTranslation();
126
126
  if (!userWithMissingInfo) {
@@ -135,7 +135,7 @@ const CollectUserDataView = () => {
135
135
  'collect-user-data__form--error': shouldDisplayWrongNetworkState,
136
136
  }), children: [jsx("div", { className: 'collect-user-data__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { disableSubmit: shouldDisplayWrongNetworkState, userProfile: userWithMissingInfo, children: shouldDisplayWrongNetworkState ? (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
137
137
  t('dyn_collect_user_data.greeting', { appName }) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
138
- t('dyn_collect_user_data.description') })] })) }), jsx(TextButton, { className: 'collect-user-data__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
138
+ t('dyn_collect_user_data.description') })] })) }), jsx(TextButton, { className: 'collect-user-data__log-out', onClick: () => handleLogOutWithReason('user-data-collection-cancelled'), copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
139
139
  };
140
140
 
141
141
  export { CollectUserDataView };
@@ -119,14 +119,14 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
119
119
 
120
120
  const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
121
121
  var _a;
122
- const { appName, handleLogOut, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
122
+ const { appName, handleLogOutWithReason, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
123
123
  const { t } = reactI18next.useTranslation();
124
124
  if (!userWithMissingInfo) {
125
125
  return null;
126
126
  }
127
127
  return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user: userWithMissingInfo }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userWithMissingInfo[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier.getUserIdentifier(userWithMissingInfo) })] }), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { userProfile: userWithMissingInfo, children: jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
128
128
  t('dyn_collect_user_data.greeting', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
129
- t('dyn_collect_user_data.description') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
129
+ t('dyn_collect_user_data.description') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: () => handleLogOutWithReason('user-data-collection-cancelled'), copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
130
130
  };
131
131
 
132
132
  exports.CollectUserDataViewNoWallet = CollectUserDataViewNoWallet;
@@ -115,14 +115,14 @@ import '../../components/Popper/PopperContext/PopperContext.js';
115
115
 
116
116
  const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
117
117
  var _a;
118
- const { appName, handleLogOut, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
118
+ const { appName, handleLogOutWithReason, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
119
119
  const { t } = useTranslation();
120
120
  if (!userWithMissingInfo) {
121
121
  return null;
122
122
  }
123
123
  return (jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsx(UserAvatar, { user: userWithMissingInfo }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userWithMissingInfo[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier(userWithMissingInfo) })] }), jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { userProfile: userWithMissingInfo, children: jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
124
124
  t('dyn_collect_user_data.greeting', { appName }) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
125
- t('dyn_collect_user_data.description') })] }) }), jsx(TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
125
+ t('dyn_collect_user_data.description') })] }) }), jsx(TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: () => handleLogOutWithReason('user-data-collection-cancelled'), copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
126
126
  };
127
127
 
128
128
  export { CollectUserDataViewNoWallet };
@@ -116,7 +116,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
116
116
 
117
117
  const DeviceRegistrationView = () => {
118
118
  const { t } = reactI18next.useTranslation();
119
- const { handleLogOut, setShowAuthFlow, clearStatesOnBackClick } = useInternalDynamicContext.useInternalDynamicContext();
119
+ const { handleLogOutWithReason, setShowAuthFlow, clearStatesOnBackClick } = useInternalDynamicContext.useInternalDynamicContext();
120
120
  const user = useUser.useUser();
121
121
  const dynamicClient = client.useDynamicClient();
122
122
  utils.assertDefined(user === null || user === void 0 ? void 0 : user.email, 'User email is not defined');
@@ -134,7 +134,7 @@ const DeviceRegistrationView = () => {
134
134
  setShowAuthFlow(false);
135
135
  },
136
136
  }, dynamicClient), [dynamicClient, setShowAuthFlow, clearStatesOnBackClick]);
137
- return (jsxRuntime.jsxs("div", { className: 'device-registration-view', "data-testid": 'device-registration-view', children: [jsxRuntime.jsx("div", { className: 'device-registration-view__icon', children: jsxRuntime.jsx(securityAlert.ReactComponent, { width: 55, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_device_registration.description', children: t('dyn_device_registration.description', { email: user.email }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'device-registration-view__logout-button', onClick: handleLogOut, copykey: 'dyn_device_registration.logout', children: t('dyn_device_registration.logout') })] }));
137
+ return (jsxRuntime.jsxs("div", { className: 'device-registration-view', "data-testid": 'device-registration-view', children: [jsxRuntime.jsx("div", { className: 'device-registration-view__icon', children: jsxRuntime.jsx(securityAlert.ReactComponent, { width: 55, height: 64 }) }), jsxRuntime.jsx(Typography.Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_device_registration.description', children: t('dyn_device_registration.description', { email: user.email }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'device-registration-view__logout-button', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_device_registration.logout', children: t('dyn_device_registration.logout') })] }));
138
138
  };
139
139
 
140
140
  exports.DeviceRegistrationView = DeviceRegistrationView;
@@ -112,7 +112,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
112
112
 
113
113
  const DeviceRegistrationView = () => {
114
114
  const { t } = useTranslation();
115
- const { handleLogOut, setShowAuthFlow, clearStatesOnBackClick } = useInternalDynamicContext();
115
+ const { handleLogOutWithReason, setShowAuthFlow, clearStatesOnBackClick } = useInternalDynamicContext();
116
116
  const user = useUser();
117
117
  const dynamicClient = useDynamicClient();
118
118
  assertDefined(user === null || user === void 0 ? void 0 : user.email, 'User email is not defined');
@@ -130,7 +130,7 @@ const DeviceRegistrationView = () => {
130
130
  setShowAuthFlow(false);
131
131
  },
132
132
  }, dynamicClient), [dynamicClient, setShowAuthFlow, clearStatesOnBackClick]);
133
- return (jsxs("div", { className: 'device-registration-view', "data-testid": 'device-registration-view', children: [jsx("div", { className: 'device-registration-view__icon', children: jsx(SvgSecurityAlert, { width: 55, height: 64 }) }), jsx(Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_device_registration.description', children: t('dyn_device_registration.description', { email: user.email }) }), jsx(TextButton, { className: 'device-registration-view__logout-button', onClick: handleLogOut, copykey: 'dyn_device_registration.logout', children: t('dyn_device_registration.logout') })] }));
133
+ return (jsxs("div", { className: 'device-registration-view', "data-testid": 'device-registration-view', children: [jsx("div", { className: 'device-registration-view__icon', children: jsx(SvgSecurityAlert, { width: 55, height: 64 }) }), jsx(Typography, { weight: 'regular', variant: 'body_normal', color: 'secondary', copykey: 'dyn_device_registration.description', children: t('dyn_device_registration.description', { email: user.email }) }), jsx(TextButton, { className: 'device-registration-view__logout-button', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_device_registration.logout', children: t('dyn_device_registration.logout') })] }));
134
134
  };
135
135
 
136
136
  export { DeviceRegistrationView };
@@ -141,7 +141,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
141
141
  const SECONDS_TO_RETRY = 15;
142
142
  const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
143
143
  var _a, _b, _c, _d;
144
- const { environmentId, handleLogOut, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
144
+ const { environmentId, handleLogOutWithReason, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
145
145
  const { pushView, clearStackAndPushInitialView } = ViewContext.useViewContext();
146
146
  const { error, setError, setErrorMessage } = ErrorContext.useErrorContext();
147
147
  const { loading, setLoading } = LoadingContext.useLoadingContext();
@@ -372,7 +372,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
372
372
  }, []);
373
373
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [error && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxRuntime.jsxs("div", { className: classNames.classNames('email-verification__container', {
374
374
  'email-verification__container--error': Boolean(error),
375
- }), children: [showTransferMessage && (jsxRuntime.jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsxRuntime.jsx("div", { className: 'email-verification__icon-container', children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: check.ReactComponent }) })) : (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxRuntime.jsxs("div", { className: 'email-verification__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email$1) })] }), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).fill(''), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
375
+ }), children: [showTransferMessage && (jsxRuntime.jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsxRuntime.jsx("div", { className: 'email-verification__icon-container', children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: check.ReactComponent }) })) : (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxRuntime.jsxs("div", { className: 'email-verification__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email$1) })] }), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).fill(''), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
376
376
  };
377
377
 
378
378
  exports.EmailVerification = EmailVerification;
@@ -137,7 +137,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
137
137
  const SECONDS_TO_RETRY = 15;
138
138
  const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
139
139
  var _a, _b, _c, _d;
140
- const { environmentId, handleLogOut, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, primaryWallet, } = useInternalDynamicContext();
140
+ const { environmentId, handleLogOutWithReason, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, primaryWallet, } = useInternalDynamicContext();
141
141
  const { pushView, clearStackAndPushInitialView } = useViewContext();
142
142
  const { error, setError, setErrorMessage } = useErrorContext();
143
143
  const { loading, setLoading } = useLoadingContext();
@@ -368,7 +368,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
368
368
  }, []);
369
369
  return (jsxs(Fragment, { children: [error && (jsx(ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxs("div", { className: classNames('email-verification__container', {
370
370
  'email-verification__container--error': Boolean(error),
371
- }), children: [showTransferMessage && (jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsx("div", { className: 'email-verification__icon-container', children: jsx(IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: SvgCheck }) })) : (jsx(IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxs("div", { className: 'email-verification__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) })] }), jsx(PinField, { initialValue: Array(6).fill(''), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsx(RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsx(TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
371
+ }), children: [showTransferMessage && (jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsx("div", { className: 'email-verification__icon-container', children: jsx(IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: SvgCheck }) })) : (jsx(IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxs("div", { className: 'email-verification__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) })] }), jsx(PinField, { initialValue: Array(6).fill(''), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsx(RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsx(TextButton, { className: 'email-verification__log-out', onClick: () => handleLogOutWithReason('auth-cancelled'), copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
372
372
  };
373
373
 
374
374
  export { EmailVerification };
@@ -120,7 +120,7 @@ require('../../components/Popper/Popper/Popper.cjs');
120
120
  require('../../components/Popper/PopperContext/PopperContext.cjs');
121
121
 
122
122
  const EmbeddedDeleteView = () => {
123
- const { primaryWallet, setShowAuthFlow, environmentId, handleLogOut, user } = useInternalDynamicContext.useInternalDynamicContext();
123
+ const { primaryWallet, setShowAuthFlow, environmentId, handleLogOutWithReason, user, } = useInternalDynamicContext.useInternalDynamicContext();
124
124
  const [isAcknowledgementChecked, setIsAcknowledgementChecked] = React.useState(false);
125
125
  const [error, setError] = React.useState(undefined);
126
126
  const { t } = reactI18next.useTranslation();
@@ -162,7 +162,7 @@ const EmbeddedDeleteView = () => {
162
162
  deleteEmbeddedWalletsRequest: signedDeleteWalletsRequest,
163
163
  environmentId,
164
164
  });
165
- handleLogOut();
165
+ handleLogOutWithReason('user-deleted');
166
166
  }
167
167
  catch (error) {
168
168
  setError(error);
@@ -116,7 +116,7 @@ import '../../components/Popper/Popper/Popper.js';
116
116
  import '../../components/Popper/PopperContext/PopperContext.js';
117
117
 
118
118
  const EmbeddedDeleteView = () => {
119
- const { primaryWallet, setShowAuthFlow, environmentId, handleLogOut, user } = useInternalDynamicContext();
119
+ const { primaryWallet, setShowAuthFlow, environmentId, handleLogOutWithReason, user, } = useInternalDynamicContext();
120
120
  const [isAcknowledgementChecked, setIsAcknowledgementChecked] = useState(false);
121
121
  const [error, setError] = useState(undefined);
122
122
  const { t } = useTranslation();
@@ -158,7 +158,7 @@ const EmbeddedDeleteView = () => {
158
158
  deleteEmbeddedWalletsRequest: signedDeleteWalletsRequest,
159
159
  environmentId,
160
160
  });
161
- handleLogOut();
161
+ handleLogOutWithReason('user-deleted');
162
162
  }
163
163
  catch (error) {
164
164
  setError(error);
@@ -17,16 +17,18 @@ require('@dynamic-labs/utils');
17
17
  require('../../components/Alert/Alert.cjs');
18
18
  require('../../events/dynamicEvents.cjs');
19
19
  require('../../../../_virtual/_tslib.cjs');
20
- var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
21
20
  require('../../context/DynamicContext/DynamicContext.cjs');
21
+ require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
22
22
  require('@dynamic-labs/wallet-connector-core');
23
- require('../../context/CaptchaContext/CaptchaContext.cjs');
24
- require('../../context/ErrorContext/ErrorContext.cjs');
25
23
  var logger = require('../../shared/logger.cjs');
26
24
  require('@dynamic-labs/wallet-book');
27
25
  require('../../utils/constants/colors.cjs');
28
26
  require('../../utils/constants/values.cjs');
29
27
  require('../../shared/consts/index.cjs');
28
+ require('../../store/state/authMode/authMode.cjs');
29
+ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
30
+ require('../../context/CaptchaContext/CaptchaContext.cjs');
31
+ require('../../context/ErrorContext/ErrorContext.cjs');
30
32
  require('@dynamic-labs/multi-wallet');
31
33
  require('react-international-phone');
32
34
  require('../../store/state/nonce/nonce.cjs');
@@ -42,8 +44,6 @@ require('../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.c
42
44
  require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
43
45
  require('../../context/AccountExistsContext/AccountExistsContext.cjs');
44
46
  require('../../context/UserWalletsContext/UserWalletsContext.cjs');
45
- require('../../store/state/authMode/authMode.cjs');
46
- require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
47
47
  require('../../context/VerificationContext/VerificationContext.cjs');
48
48
  require('react-dom');
49
49
  require('../../utils/functions/compareChains/compareChains.cjs');
@@ -120,7 +120,7 @@ require('../../components/Popper/Popper/Popper.cjs');
120
120
  require('../../components/Popper/PopperContext/PopperContext.cjs');
121
121
 
122
122
  const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, requestedScopes, }) => {
123
- const { handleLogOut } = useDynamicContext.useDynamicContext();
123
+ const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
124
124
  const { t } = reactI18next.useTranslation();
125
125
  const { pushView } = ViewContext.useViewContext();
126
126
  const registerPasskey = useRegisterPasskey.useRegisterPasskey();
@@ -189,7 +189,7 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, re
189
189
  ? t('dyn_mfa.choose_device_view.title')
190
190
  : t('dyn_mfa.choose_device_view.choose_another_method') }) }) }), jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__body', "data-testid": 'mfa-choose-device-view', children: [jsxRuntime.jsx(secureAccount.ReactComponent, {}), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', children: isInitialSetup
191
191
  ? t('dyn_mfa.choose_device_view.select_options')
192
- : t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxRuntime.jsxs(Button.Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsxRuntime.jsx(Typography.Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-choose-device-view__logout', onClick: handleLogOut, copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
192
+ : t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxRuntime.jsxs(Button.Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxRuntime.jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsxRuntime.jsx(Typography.Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsxRuntime.jsx(Typography.Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-choose-device-view__logout', onClick: () => handleLogOutWithReason('mfa-choose-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
193
193
  };
194
194
 
195
195
  exports.MfaChooseDeviceView = MfaChooseDeviceView;
@@ -13,16 +13,18 @@ import '@dynamic-labs/utils';
13
13
  import '../../components/Alert/Alert.js';
14
14
  import '../../events/dynamicEvents.js';
15
15
  import '../../../../_virtual/_tslib.js';
16
- import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
17
16
  import '../../context/DynamicContext/DynamicContext.js';
17
+ import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
18
18
  import '@dynamic-labs/wallet-connector-core';
19
- import '../../context/CaptchaContext/CaptchaContext.js';
20
- import '../../context/ErrorContext/ErrorContext.js';
21
19
  import { logger } from '../../shared/logger.js';
22
20
  import '@dynamic-labs/wallet-book';
23
21
  import '../../utils/constants/colors.js';
24
22
  import '../../utils/constants/values.js';
25
23
  import '../../shared/consts/index.js';
24
+ import '../../store/state/authMode/authMode.js';
25
+ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
26
+ import '../../context/CaptchaContext/CaptchaContext.js';
27
+ import '../../context/ErrorContext/ErrorContext.js';
26
28
  import '@dynamic-labs/multi-wallet';
27
29
  import 'react-international-phone';
28
30
  import '../../store/state/nonce/nonce.js';
@@ -38,8 +40,6 @@ import '../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js
38
40
  import '../../context/AccessDeniedContext/AccessDeniedContext.js';
39
41
  import '../../context/AccountExistsContext/AccountExistsContext.js';
40
42
  import '../../context/UserWalletsContext/UserWalletsContext.js';
41
- import '../../store/state/authMode/authMode.js';
42
- import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
43
43
  import '../../context/VerificationContext/VerificationContext.js';
44
44
  import 'react-dom';
45
45
  import '../../utils/functions/compareChains/compareChains.js';
@@ -116,7 +116,7 @@ import '../../components/Popper/Popper/Popper.js';
116
116
  import '../../components/Popper/PopperContext/PopperContext.js';
117
117
 
118
118
  const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, requestedScopes, }) => {
119
- const { handleLogOut } = useDynamicContext();
119
+ const { handleLogOutWithReason } = useInternalDynamicContext();
120
120
  const { t } = useTranslation();
121
121
  const { pushView } = useViewContext();
122
122
  const registerPasskey = useRegisterPasskey();
@@ -185,7 +185,7 @@ const MfaChooseDeviceView = ({ isInitialSetup = true, createMfaToken = false, re
185
185
  ? t('dyn_mfa.choose_device_view.title')
186
186
  : t('dyn_mfa.choose_device_view.choose_another_method') }) }) }), jsxs("div", { className: 'mfa-choose-device-view__body', "data-testid": 'mfa-choose-device-view', children: [jsx(SvgSecureAccount, {}), jsx(Typography, { className: 'mfa-choose-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', children: isInitialSetup
187
187
  ? t('dyn_mfa.choose_device_view.select_options')
188
- : t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxs(Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsx(Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsx(SvgChevronLeft, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsx(Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsx(TextButton, { className: 'mfa-choose-device-view__logout', onClick: handleLogOut, copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
188
+ : t('dyn_mfa.choose_device_view.choose_another_method_description') }), mfaOptions.map((option) => (jsxs(Button, { buttonClassName: 'mfa-choose-device-view__button', expanded: true, onClick: () => handleClick(option), children: [jsxs("div", { className: 'mfa-choose-device-view__button__header', "data-testid": `mfa-device-header-${option.type}`, children: [jsx(Typography, { copykey: option.labelKey, color: 'primary', children: t(option.labelKey) }), jsx(SvgChevronLeft, { className: 'mfa-choose-device-view__icon--rotate' })] }), jsx(Typography, { className: 'mfa-choose-device-view__button__description', color: 'secondary', copykey: option.descriptionKey, children: t(option.descriptionKey) })] }, option.type))), jsx(TextButton, { className: 'mfa-choose-device-view__logout', onClick: () => handleLogOutWithReason('mfa-choose-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.choose_device_view.logout') })] })] }));
189
189
  };
190
190
 
191
191
  export { MfaChooseDeviceView };
@@ -15,17 +15,19 @@ require('@dynamic-labs/utils');
15
15
  var spinner = require('../../components/Spinner/spinner.cjs');
16
16
  require('../../components/Alert/Alert.cjs');
17
17
  require('../../events/dynamicEvents.cjs');
18
- var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
19
18
  require('../../context/DynamicContext/DynamicContext.cjs');
19
+ require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
20
20
  require('@dynamic-labs/wallet-connector-core');
21
- require('../../context/CaptchaContext/CaptchaContext.cjs');
22
- require('../../context/ErrorContext/ErrorContext.cjs');
23
21
  require('../../shared/logger.cjs');
24
22
  require('@dynamic-labs/wallet-book');
25
23
  require('../../utils/constants/colors.cjs');
26
24
  require('../../utils/constants/values.cjs');
27
25
  require('@dynamic-labs/sdk-api-core');
28
26
  require('../../shared/consts/index.cjs');
27
+ require('../../store/state/authMode/authMode.cjs');
28
+ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
29
+ require('../../context/CaptchaContext/CaptchaContext.cjs');
30
+ require('../../context/ErrorContext/ErrorContext.cjs');
29
31
  require('@dynamic-labs/multi-wallet');
30
32
  require('react-international-phone');
31
33
  require('../../store/state/nonce/nonce.cjs');
@@ -41,8 +43,6 @@ require('../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.c
41
43
  require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
42
44
  require('../../context/AccountExistsContext/AccountExistsContext.cjs');
43
45
  require('../../context/UserWalletsContext/UserWalletsContext.cjs');
44
- require('../../store/state/authMode/authMode.cjs');
45
- require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
46
46
  require('../../context/VerificationContext/VerificationContext.cjs');
47
47
  require('react-dom');
48
48
  require('../../utils/functions/compareChains/compareChains.cjs');
@@ -119,7 +119,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
119
119
 
120
120
  const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
121
121
  const { t } = reactI18next.useTranslation();
122
- const { handleLogOut } = useDynamicContext.useDynamicContext();
122
+ const { handleLogOutWithReason } = useInternalDynamicContext.useInternalDynamicContext();
123
123
  const { pushView } = ViewContext.useViewContext();
124
124
  const { addDevice } = useMfa.useMfa();
125
125
  const { data, isLoading } = usePromise.usePromise(() => addDevice(type));
@@ -137,7 +137,7 @@ const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
137
137
  uri,
138
138
  });
139
139
  };
140
- return (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsxRuntime.jsx(Typography.Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsxRuntime.jsx(spinner.Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsxRuntime.jsx(QRCode.QRCode, { Icon: jsxRuntime.jsx(passwordHero.ReactComponent, {}), value: data.uri, logoSize: 50 }), jsxRuntime.jsx("div", { className: 'button-container', children: jsxRuntime.jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-secure-device-view__logout-button', onClick: handleLogOut, copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.secure_device_view.logout') })] }));
140
+ return (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsxRuntime.jsx(Typography.Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsxRuntime.jsx(spinner.Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxRuntime.jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsxRuntime.jsx(QRCode.QRCode, { Icon: jsxRuntime.jsx(passwordHero.ReactComponent, {}), value: data.uri, logoSize: 50 }), jsxRuntime.jsx("div", { className: 'button-container', children: jsxRuntime.jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsxRuntime.jsx(TypographyButton.TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsxRuntime.jsx(TextButton.TextButton, { className: 'mfa-secure-device-view__logout-button', onClick: () => handleLogOutWithReason('mfa-secure-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.secure_device_view.logout') })] }));
141
141
  };
142
142
 
143
143
  exports.MfaSecureDeviceView = MfaSecureDeviceView;
@@ -11,17 +11,19 @@ import '@dynamic-labs/utils';
11
11
  import { Spinner } from '../../components/Spinner/spinner.js';
12
12
  import '../../components/Alert/Alert.js';
13
13
  import '../../events/dynamicEvents.js';
14
- import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
15
14
  import '../../context/DynamicContext/DynamicContext.js';
15
+ import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
16
16
  import '@dynamic-labs/wallet-connector-core';
17
- import '../../context/CaptchaContext/CaptchaContext.js';
18
- import '../../context/ErrorContext/ErrorContext.js';
19
17
  import '../../shared/logger.js';
20
18
  import '@dynamic-labs/wallet-book';
21
19
  import '../../utils/constants/colors.js';
22
20
  import '../../utils/constants/values.js';
23
21
  import '@dynamic-labs/sdk-api-core';
24
22
  import '../../shared/consts/index.js';
23
+ import '../../store/state/authMode/authMode.js';
24
+ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
25
+ import '../../context/CaptchaContext/CaptchaContext.js';
26
+ import '../../context/ErrorContext/ErrorContext.js';
25
27
  import '@dynamic-labs/multi-wallet';
26
28
  import 'react-international-phone';
27
29
  import '../../store/state/nonce/nonce.js';
@@ -37,8 +39,6 @@ import '../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js
37
39
  import '../../context/AccessDeniedContext/AccessDeniedContext.js';
38
40
  import '../../context/AccountExistsContext/AccountExistsContext.js';
39
41
  import '../../context/UserWalletsContext/UserWalletsContext.js';
40
- import '../../store/state/authMode/authMode.js';
41
- import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
42
42
  import '../../context/VerificationContext/VerificationContext.js';
43
43
  import 'react-dom';
44
44
  import '../../utils/functions/compareChains/compareChains.js';
@@ -115,7 +115,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
115
115
 
116
116
  const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
117
117
  const { t } = useTranslation();
118
- const { handleLogOut } = useDynamicContext();
118
+ const { handleLogOutWithReason } = useInternalDynamicContext();
119
119
  const { pushView } = useViewContext();
120
120
  const { addDevice } = useMfa();
121
121
  const { data, isLoading } = usePromise(() => addDevice(type));
@@ -133,7 +133,7 @@ const MfaSecureDeviceView = ({ type, isInitialSetup = false, }) => {
133
133
  uri,
134
134
  });
135
135
  };
136
- return (jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsx(Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsx(Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsx(QRCode, { Icon: jsx(SvgPasswordHero, {}), value: data.uri, logoSize: 50 }), jsx("div", { className: 'button-container', children: jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsx(Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsx(TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsx(TextButton, { className: 'mfa-secure-device-view__logout-button', onClick: handleLogOut, copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.secure_device_view.logout') })] }));
136
+ return (jsxs("div", { className: 'mfa-secure-device-view__body', "data-testid": 'mfa-secure-device-view', children: [jsx(Typography, { className: 'mfa-secure-device-view__copy', variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.body', children: t('dyn_mfa.secure_device_view.body') }), isLoading && (jsx(Spinner, { className: 'mfa-secure-device-view__loading-spinner' })), data && (jsxs("div", { className: 'mfa-secure-device-view__qrcode', children: [jsx(QRCode, { Icon: jsx(SvgPasswordHero, {}), value: data.uri, logoSize: 50 }), jsx("div", { className: 'button-container', children: jsx("button", { onClick: () => onHelpClick({ secret: data.secret, uri: data.uri }), children: jsx(Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_mfa.secure_device_view.helper.button', children: t('dyn_mfa.secure_device_view.helper.button') }) }) })] })), jsx(TypographyButton, { className: 'mfa-secure-device-view__button', expanded: true, onClick: onContinue, copykey: 'dyn_mfa.secure_device_view.continue', children: t('dyn_mfa.secure_device_view.continue') }), jsx(TextButton, { className: 'mfa-secure-device-view__logout-button', onClick: () => handleLogOutWithReason('mfa-secure-device-cancelled'), copykey: 'dyn_mfa.choose_device_view.logout', children: t('dyn_mfa.secure_device_view.logout') })] }));
137
137
  };
138
138
 
139
139
  export { MfaSecureDeviceView };