'use client'
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var reactI18next = require('react-i18next');
var iconic = require('@dynamic-labs/iconic');
require('../../../context/DynamicContext/DynamicContext.cjs');
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
require('@dynamic-labs/wallet-connector-core');
require('../../../context/ViewContext/ViewContext.cjs');
require('../../../shared/logger.cjs');
require('@dynamic-labs/wallet-book');
require('@dynamic-labs/utils');
require('../../constants/colors.cjs');
require('../../constants/values.cjs');
require('@dynamic-labs/sdk-api-core');
require('../../../shared/consts/index.cjs');
require('../../../events/dynamicEvents.cjs');
require('../../../../../_virtual/_tslib.cjs');
require('../../../context/CaptchaContext/CaptchaContext.cjs');
require('../../../context/ErrorContext/ErrorContext.cjs');
require('@dynamic-labs/multi-wallet');
require('react-international-phone');
require('../../../store/state/nonce/nonce.cjs');
require('@dynamic-labs-sdk/client/core');
require('../../../client/client.cjs');
require('@dynamic-labs-sdk/client');
require('../../../config/ApiEndpoint.cjs');
require('@dynamic-labs/locale');
require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
var authMode = require('../../../store/state/authMode/authMode.cjs');
require('../../../context/VerificationContext/VerificationContext.cjs');
require('react-dom');
require('../../functions/compareChains/compareChains.cjs');
require('../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
require('../../../context/ThemeContext/ThemeContext.cjs');
require('../useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
var useIsTurnkeyWallet = require('../useIsTurnkeyWallet/useIsTurnkeyWallet.cjs');
require('bs58');
require('@dynamic-labs/types');
require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
require('../../../context/LoadingContext/LoadingContext.cjs');
require('../../../context/WalletContext/WalletContext.cjs');
require('../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
require('yup');
require('../../../context/MockContext/MockContext.cjs');
require('../../../views/CollectUserDataView/useFields.cjs');
require('../../../context/FieldsStateContext/FieldsStateContext.cjs');
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
require('@dynamic-labs/rpc-providers');
require('../../../store/state/walletOptions/walletOptions.cjs');
require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
require('../../../components/Alert/Alert.cjs');
require('../../../components/ShadowDOM/ShadowDOM.cjs');
require('../../../components/IconButton/IconButton.cjs');
require('../../../components/InlineWidget/InlineWidget.cjs');
require('../../../components/Input/Input.cjs');
require('../../../components/IsBrowser/IsBrowser.cjs');
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
require('../../../components/OverlayCard/OverlayCard.cjs');
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
require('../../../components/Popper/Popper/Popper.cjs');
require('../../../components/Popper/PopperContext/PopperContext.cjs');
require('react-focus-lock');
require('qrcode');
require('formik');
require('../useSubdomainCheck/useSubdomainCheck.cjs');
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
require('../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
require('../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
require('@hcaptcha/react-hcaptcha');
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
require('../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
require('../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
require('../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
require('../../../context/FooterAnimationContext/index.cjs');
require('../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
require('../../../context/PasskeyContext/PasskeyContext.cjs');
require('../../../context/OnrampContext/OnrampContext.cjs');
require('../../../store/state/sendBalances.cjs');
require('../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
require('../../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
require('../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.cjs');
require('../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.cjs');
require('../../../../index.cjs');
require('../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
require('../../../store/state/tokenBalances.cjs');
require('../../../store/state/multichainBalances.cjs');
require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');

const useDynamicLayoutData = ({ view }) => {
    const { t } = reactI18next.useTranslation();
    const { isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
    const { selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
    const authMode$1 = authMode.useAuthMode();
    const helpHeaderMap = React.useMemo(() => ({
        'login-with-email-or-wallet-full-wallet-list': {
            copykey: 'dyn_login.helper.all_wallet_list',
            heading: t('dyn_login.helper.all_wallet_list'),
        },
        'login-with-wallet-only': {
            copykey: 'dyn_login.helper.wallet_only',
            heading: t('dyn_login.helper.wallet_only'),
        },
        'passkey-intro': {
            copykey: 'dyn_passkey_intro.helper.title',
            heading: t('dyn_passkey_intro.helper.title'),
        },
        'pending-connect': {
            copykey: 'dyn_login.helper.pending_connect.title',
            heading: t('dyn_login.helper.pending_connect.title'),
        },
        'pending-signature': {
            copykey: 'dyn_login.helper.pending_signature.title',
            heading: t('dyn_login.helper.pending_signature.title'),
        },
        'pending-signature-without-back-button': {
            copykey: 'dyn_login.helper.pending_signature_without_back_button.title',
            heading: t('dyn_login.helper.pending_signature_without_back_button.title'),
        },
        'qr-code': {
            copykey: 'dyn_login.helper.qr_code.title',
            heading: t('dyn_login.helper.qr_code.title'),
        },
        'wallet-connect-mobile-wallets-list': {
            copykey: 'dyn_wallet_conect.mobile.wallet_list.helper',
            heading: t('dyn_wallet_conect.mobile.wallet_list.helper'),
        },
        'wallet-list': {
            copykey: 'dyn_wallet_list.helper',
            heading: t('dyn_wallet_list.helper'),
        },
    }), [t]);
    const headerMap = React.useMemo(() => {
        var _a;
        return ({
            'account-exists': {
                copykey: 'dyn_account_exists.title',
                heading: t('dyn_account_exists.title'),
            },
            'backup-unsuccessful': {
                copykey: 'dyn_waas.backup_unsuccessful.title',
                heading: t('dyn_waas.backup_unsuccessful.title'),
            },
            'chainalysis-blocked-wallet': {
                copykey: 'dyn_chainalysis_blocked_wallet.title',
                heading: t('dyn_chainalysis_blocked_wallet.title'),
            },
            'confirm-exchange-transfer': {
                copykey: 'dyn_exchange_transfer_confirmation.title',
                heading: t('dyn_exchange_transfer_confirmation.title'),
            },
            'deposit-view': {
                copykey: 'dyn_deposit.title',
                heading: t('dyn_deposit.title'),
            },
            'duplicate-wallet': {
                copykey: 'dyn_duplicate_wallet.title',
                heading: t('dyn_duplicate_wallet.title'),
            },
            'embedded-delete-view': {
                copykey: 'dyn_embedded_delete.title',
                heading: t('dyn_embedded_delete.title'),
            },
            'embedded-wallet-exists': {
                copykey: 'dyn_wallet_link.already_exists.title',
                heading: t('dyn_wallet_link.already_exists.title'),
            },
            'external-funding-exchange-list': {
                copykey: 'dyn_wallet_funding.from_exchange.title',
                heading: t('dyn_wallet_funding.from_exchange.title'),
            },
            'external-funding-wallet-list': {
                copykey: 'dyn_wallet_funding.from_external_wallet.title',
                heading: t('dyn_wallet_funding.from_external_wallet.title'),
            },
            'farcaster-connect-view': {
                copykey: 'dyn_login.qr_code.title',
                heading: t('dyn_login.qr_code.title'),
            },
            'login-with-email-or-wallet': {
                copykey: 'dyn_login.title.all',
                heading: t('dyn_login.title.all'),
            },
            'login-with-email-or-wallet-full-wallet-list': {
                copykey: 'dyn_login.title.all_wallet_list',
                heading: t('dyn_login.title.all_wallet_list'),
            },
            'login-with-email-verification': {
                copykey: 'dyn_otp_verification.confirm_code',
                heading: t('dyn_otp_verification.confirm_code'),
            },
            'login-with-sms-verification': {
                copykey: 'dyn_otp_verification.confirm_code',
                heading: t('dyn_otp_verification.confirm_code'),
            },
            'login-with-wallet-only': {
                copykey: 'dyn_login.title.wallet_only',
                heading: t('dyn_login.title.wallet_only'),
            },
            'merge-user-accounts': {
                copykey: 'dyn_merge_user_accounts.wallet.title',
                heading: t('dyn_merge_user_accounts.wallet.title'),
            },
            'merge-user-accounts-conflicts': {
                copykey: 'dyn_merge_user_accounts_conflicts.title',
                heading: t('dyn_merge_user_accounts_conflicts.title'),
            },
            'mfa-choose-device': {
                copykey: 'dyn_mfa.choose_device_view.title',
                heading: t('dyn_mfa.choose_device_view.title'),
            },
            'mfa-display-backup-codes': {
                copykey: 'dyn_mfa.display_backup_codes_view.title',
                heading: t('dyn_mfa.display_backup_codes_view.title'),
            },
            'mfa-recovery': {
                copykey: 'dyn_mfa.recovery_view.title',
                heading: t('dyn_mfa.recovery_view.title'),
            },
            'mfa-secure-device': {
                copykey: 'dyn_mfa.secure_device_view.title',
                heading: t('dyn_mfa.secure_device_view.title'),
            },
            'mfa-secure-device-help': {
                copykey: 'dyn_mfa.secure_device_view.helper.title',
                heading: t('dyn_mfa.secure_device_view.helper.title'),
            },
            'mfa-verification': {
                copykey: 'dyn_mfa.otp_verification_view.title',
                heading: t('dyn_mfa.otp_verification_view.title'),
            },
            'mobile-wallet-redirect-view': {
                copykey: 'dyn_login.mobile_wallet_redirect.backup_title',
                heading: (_a = selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name) !== null && _a !== void 0 ? _a : t('dyn_login.mobile_wallet_redirect.backup_title'),
            },
            'multi-wallet-wallet-list': {
                copykey: authMode$1 === 'connect-only'
                    ? 'dyn_wallet_list.title.connect'
                    : 'dyn_wallet_list.title.link',
                heading: authMode$1 === 'connect-only'
                    ? t('dyn_wallet_list.title.connect')
                    : t('dyn_wallet_list.title.link'),
            },
            'network-not-supported': {
                copykey: 'dyn_network_not_supported.title',
                heading: t('dyn_network_not_supported.title'),
            },
            'passkey-recovery-complete': {
                copykey: isTurnkeyWalletWithoutAuthenticator
                    ? 'dyn_passkey_secure_modal.complete.title'
                    : 'dyn_passkey_recovery.complete.title',
                heading: isTurnkeyWalletWithoutAuthenticator
                    ? t('dyn_passkey_secure_modal.complete.title')
                    : t('dyn_passkey_recovery.complete.title'),
            },
            'passkey-recovery-start': {
                copykey: isTurnkeyWalletWithoutAuthenticator
                    ? 'dyn_passkey_secure_modal.start.title'
                    : 'dyn_passkey_recovery.start.title',
                heading: isTurnkeyWalletWithoutAuthenticator
                    ? t('dyn_passkey_secure_modal.start.title')
                    : t('dyn_passkey_recovery.start.title'),
            },
            'pending-connect': {
                copykey: 'dyn_login.connect_wallet.title',
                heading: t('dyn_login.connect_wallet.title'),
            },
            'pending-signature': {
                copykey: 'dyn_login.sign_wallet.title',
                heading: t('dyn_login.sign_wallet.title'),
            },
            'qr-code': {
                copykey: 'dyn_login.qr_code.title',
                heading: t('dyn_login.qr_code.title'),
            },
            'select-hardware-wallet': {
                copykey: 'dyn_select_hardware_wallet.title',
                heading: t('dyn_select_hardware_wallet.title'),
            },
            'select-wallet-in-wallet-group': {
                copykey: 'dyn_login.select_wallet_in_wallet_group.title',
                heading: t('dyn_login.select_wallet_in_wallet_group.title'),
            },
            'unified-wallet-exchange-list': {
                copykey: 'dyn_unified_list.title',
                heading: t('dyn_unified_list.title'),
            },
            'user-delete-account': {
                copykey: 'dyn_settings.delete_account.title',
                heading: t('dyn_settings.delete_account.title'),
            },
            'verify-email': {
                copykey: 'dyn_otp_verification.confirm_code',
                heading: t('dyn_otp_verification.confirm_code'),
            },
            'verify-sms': {
                copykey: 'dyn_otp_verification.confirm_code',
                heading: t('dyn_otp_verification.confirm_code'),
            },
            'wallet-connect-mobile-wallets-list': {
                copykey: 'dyn_wallet_conect.mobile.wallet_list.title',
                heading: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(iconic.WalletConnectIcon, { style: { height: '1.5rem', width: '1.5rem' } }), ' ', t('dyn_wallet_conect.mobile.wallet_list.title')] })),
            },
            'wallet-group': {
                copykey: 'dyn_login.wallet_group.title',
                heading: t('dyn_login.wallet_group.title'),
            },
            'wallet-list': {
                copykey: 'dyn_wallet_list.title.select',
                heading: t('dyn_wallet_list.title.select'),
            },
            'wallet-sign': {
                copykey: 'dyn_wallet_transfer.sign.title',
                heading: t('dyn_wallet_transfer.sign.title'),
            },
            'wallet-used': {
                copykey: 'dyn_wallet_link.title',
                heading: t('dyn_wallet_link.title'),
            },
        });
    }, [isTurnkeyWalletWithoutAuthenticator, selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name, t]);
    const descriptionMap = React.useMemo(() => ({}), []);
    if (view === 'no-access') {
        const headerData = {
            copykey: 'dyn_no_access.title',
            heading: t('dyn_no_access.title'),
        };
        return { headerData };
    }
    if (view === 'access-blocked') {
        const headerData = {
            copykey: 'dyn_access_blocked.title',
            heading: t('dyn_access_blocked.title'),
        };
        return { headerData };
    }
    const helpHeaderData = helpHeaderMap[view];
    const headerData = headerMap[view];
    const descriptionData = descriptionMap[view];
    return {
        descriptionData,
        headerData,
        helpHeaderData,
    };
};

exports.useDynamicLayoutData = useDynamicLayoutData;
