import { password } from "@inquirer/prompts";
const PasswordPrompter = {
    async prompt(message = "Password:") {
        let enteredText;
        try {
            enteredText = await password({ message });
        }
        catch (error) {
            if (!(error instanceof Error)) {
                throw error;
            }
            if (error.message.includes('User force closed the prompt')) {
                throw new Error("Password prompt was canceled.");
            }
        }
        if (!enteredText) {
            throw new Error("Password was not specified.");
        }
        return enteredText;
    }
};
export default PasswordPrompter;
