/**
 * TtdMergeObstructionWitness — deterministic object-key collision evidence.
 *
 * @module domain/services/merge/TtdMergeObstructionWitness
 */
import { requireNonEmptyText } from "./TtdMergeValidation.js";
function requireOptionalText(value, fieldName) {
    if (value === null) {
        return null;
    }
    return requireNonEmptyText(value, fieldName);
}
export default class TtdMergeObstructionWitness {
    fieldKey;
    precursorValue;
    leftValue;
    rightValue;
    constructor(fields) {
        this.fieldKey = requireNonEmptyText(fields.fieldKey, 'fieldKey');
        this.precursorValue = requireOptionalText(fields.precursorValue, 'precursorValue');
        this.leftValue = requireOptionalText(fields.leftValue, 'leftValue');
        this.rightValue = requireOptionalText(fields.rightValue, 'rightValue');
        Object.freeze(this);
    }
}
