const CHAT_WEB_ARCHIVED_AT_KEY = "chatWebArchivedAt";
export function isChatWebSessionArchived(session) {
    return typeof session.metadata?.[CHAT_WEB_ARCHIVED_AT_KEY] === "string";
}
export function withChatWebArchived(metadata, archived) {
    const next = { ...(metadata ?? {}) };
    if (archived) {
        next[CHAT_WEB_ARCHIVED_AT_KEY] = new Date().toISOString();
    }
    else {
        delete next[CHAT_WEB_ARCHIVED_AT_KEY];
    }
    return next;
}
