/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { brand } from "../../../util/index.js";
import { TestChange } from "../../testChange.js";
// eslint-disable-next-line import/no-internal-modules
import { DetachIdOverrideType } from "../../../feature-libraries/sequence-field/index.js";
/**
 * Generates a list of marks with all fields populated.
 *
 * @remarks - New objects are generated every time this function is called. This is to ensure that stable IDs are
 * generated when appropriate.
 */
export function generatePopulatedMarks(idCompressor) {
    const tag = idCompressor.generateCompressedId();
    const lineageEvent = {
        count: 2,
        id: brand(0),
        offset: 1,
        revision: tag,
    };
    const adjacentCell = { count: 2, id: brand(0) };
    const atomId = { localId: brand(0), revision: tag };
    const cellId = {
        localId: brand(0),
        revision: tag,
        lineage: [lineageEvent],
        adjacentCells: [adjacentCell],
    };
    const changes = TestChange.mint([], 1);
    const unattachIdOverride = {
        type: DetachIdOverrideType.Unattach,
        id: cellId,
    };
    const redetachIdOverride = {
        type: DetachIdOverrideType.Redetach,
        id: cellId,
    };
    const attach = {
        type: "MoveIn",
        id: brand(0),
        revision: tag,
        finalEndpoint: atomId,
    };
    const detach = {
        type: "MoveOut",
        id: brand(0),
        revision: tag,
        finalEndpoint: atomId,
        idOverride: unattachIdOverride,
    };
    const populatedMarks = [
        { count: 1, cellId, changes },
        { type: "Insert", count: 1, cellId, changes, id: brand(0), revision: tag },
        {
            type: "MoveIn",
            count: 1,
            cellId,
            changes,
            id: brand(0),
            revision: tag,
            finalEndpoint: atomId,
        },
        {
            type: "MoveOut",
            count: 1,
            cellId,
            changes,
            id: brand(0),
            revision: tag,
            finalEndpoint: atomId,
            idOverride: unattachIdOverride,
        },
        {
            type: "Remove",
            count: 1,
            cellId,
            changes,
            id: brand(0),
            revision: tag,
            idOverride: redetachIdOverride,
        },
        {
            type: "AttachAndDetach",
            count: 1,
            cellId,
            changes,
            attach,
            detach,
        },
    ];
    return populatedMarks;
}
//# sourceMappingURL=populatedMarks.js.map