'use client'
import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
import '../../../../constants/values.js';
import '@dynamic-labs/utils';
import '../../../../../../../_virtual/_tslib.js';
import '@dynamic-labs/multi-wallet';
import { logger } from '../../../../../shared/logger.js';
import 'react-international-phone';
import '../../../../constants/colors.js';
import '@dynamic-labs/iconic';
import '@dynamic-labs/wallet-connector-core';
import 'react';
import 'react/jsx-runtime';
import '../../../../../context/ViewContext/ViewContext.js';
import '@dynamic-labs/wallet-book';
import '../../../../../shared/consts/index.js';
import '../../../../../store/state/nonce/nonce.js';
import { isProviderEnabled } from '../../../../functions/isProviderEnabled/isProviderEnabled.js';
import '@dynamic-labs-wallet/browser-wallet-client';
import '@dynamic-labs-sdk/client/core';
import 'eventemitter3';
import '@dynamic-labs-sdk/client';
import '../../../../../config/ApiEndpoint.js';
import '../../../../../events/dynamicEvents.js';
import '@dynamic-labs/locale';
import '../../../../../store/state/dynamicContextProps/dynamicContextProps.js';
import '../../../../../store/state/primaryWalletId/primaryWalletId.js';
import '../../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
import '../../../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';

const zeroDevWalletConnectorKey = 'zerodev';
const verifyZeroDevIsSetup = (projectSettings, walletConnectors) => {
    var _a;
    const isZeroDevEnabled = isProviderEnabled((_a = projectSettings.providers) !== null && _a !== void 0 ? _a : [], ProviderEnum.Zerodev);
    const isZeroDevWalletConnectorPresent = walletConnectors.some(({ key }) => key === zeroDevWalletConnectorKey);
    if (isZeroDevEnabled && !isZeroDevWalletConnectorPresent) {
        // A ZeroDev connector that's enabled in project settings but absent from
        // `walletConnectors` is an explicit decision to migrate off ZeroDev —
        // whether to native EVM gas sponsorship or to plain EOAs with no
        // sponsorship at all. Warn and continue (wallets fall back to the embedded
        // EOA) instead of hard-throwing and white-screening the app.
        logger.warn('ZeroDev is enabled in project settings but ZeroDevSmartWalletConnectors is not in walletConnectors. Continuing without ZeroDev — wallets will fall back to the embedded EOA (gas is sponsored only if native EVM gas sponsorship is enabled).');
    }
};

export { verifyZeroDevIsSetup };
