// Initial browse state. Pure — the caller does the archive I/O
// (collectListRows / readProjects) and hands the data in.
export function initialBrowseState(opts) {
    return {
        // Most recent first, guaranteed here rather than trusted from the
        // caller — ISO startedAt compares lexicographically as time.
        rows: [...opts.rows].sort((a, b) => b.startedAt.localeCompare(a.startedAt)),
        knownProjects: opts.knownProjects,
        cursor: 0,
        filters: { kind: "all", outcome: "all", projectKey: null, sinceDays: null },
        searchActive: false,
        searchQuery: "",
        shouldExit: false,
        selectedRunId: null,
        now: opts.now ?? Date.now(),
    };
}
//# sourceMappingURL=init.js.map