import { useMemo } from 'react';
import { readB2CInternals } from '../../../../utils/internal.mjs';
import { safeLocalStorage } from '../../../../utils/storage.mjs';
import { useStytch } from '../../GlobalContextProvider.mjs';

function useLastUsedOAuth() {
    const stytch = useStytch();
    const { publicToken } = readB2CInternals(stytch);
    const lastUsedOAuth = useMemo(()=>safeLocalStorage.getItem(publicToken, 'b2c_last_used_oauth'), [
        publicToken
    ]);
    const setLastUsedOAuth = (providerType)=>{
        safeLocalStorage.setItem(publicToken, 'b2c_last_used_oauth', providerType);
    };
    return [
        lastUsedOAuth,
        setLastUsedOAuth
    ];
}

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