import { useMemo } from 'react';
import { isTruthy } from '../../utils/isTruthy.mjs';
import { useAdminPortalOrgUIConfig } from '../StytchClientContext.mjs';

const configMfaMethodMap = {
    smsOtp: 'sms_otp',
    totp: 'totp'
};
const useAllowedMfaMethods = ()=>{
    const orgUIConfig = useAdminPortalOrgUIConfig();
    return useMemo(()=>{
        const mfaMethods = orgUIConfig?.allowedMfaAuthMethods ?? Object.keys(configMfaMethodMap);
        return mfaMethods.map((method)=>configMfaMethodMap[method]).filter(isTruthy);
    }, [
        orgUIConfig?.allowedMfaAuthMethods
    ]);
};

export { useAllowedMfaMethods };
//# sourceMappingURL=useAllowedMfaMethods.mjs.map
