import { EventType } from 'rrweb';
import { DEBUG_SESSION_MAX_DURATION_SECONDS } from '../config/constants';
import { SessionType } from '@multiplayer-app/session-recorder-common';
/**
 * Session-related utility functions
 */
export const isSessionActive = (session, sessionType) => {
    if (!session)
        return false;
    if (sessionType === SessionType.CONTINUOUS)
        return true;
    const startedAt = new Date(session.startedAt);
    const now = new Date();
    const diff = now.getTime() - startedAt.getTime();
    return diff < DEBUG_SESSION_MAX_DURATION_SECONDS * 1000;
};
export const isConsoleEvent = (event) => {
    var _a;
    return event.type === EventType.Plugin && ((_a = event.data) === null || _a === void 0 ? void 0 : _a.plugin) === 'rrweb/console@1';
};
//# sourceMappingURL=session.js.map