export function mockProvider(answer) {
    return {
        id: "mock",
        async requestApproval(_request) {
            if (typeof answer === "function") {
                return cloneApprovalResult(await answer());
            }
            return cloneApprovalResult(answer);
        },
    };
}
function cloneApprovalResult(result) {
    return result.outcome === "approved"
        ? { outcome: "approved" }
        : result.reason === undefined
            ? { outcome: "declined" }
            : { outcome: "declined", reason: result.reason };
}
