/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
/**
 * Helper for creating a {@link FieldChangeRebaser} which does not need access to revision tags.
 * This should only be used for fields where the child nodes cannot be edited.
 */
export function referenceFreeFieldChangeRebaser(data) {
    return isolatedFieldChangeRebaser({
        compose: (change1, change2, _composeChild, _genId) => data.compose(change1.change, change2.change),
        invert: (change, _invertChild, _genId) => data.invert(change.change),
        rebase: (change, over, _rebaseChild, _genId) => data.rebase(change, over.change),
    });
}
export function isolatedFieldChangeRebaser(data) {
    return {
        ...data,
        prune: (change) => change,
    };
}
/**
 * @internal
 */
export var NodeExistenceState;
(function (NodeExistenceState) {
    NodeExistenceState[NodeExistenceState["Alive"] = 0] = "Alive";
    NodeExistenceState[NodeExistenceState["Dead"] = 1] = "Dead";
})(NodeExistenceState || (NodeExistenceState = {}));
/**
 * @internal
 */
export function getIntention(rev, revisionMetadata) {
    return revisionMetadata.tryGetInfo(rev)?.rollbackOf ?? rev;
}
//# sourceMappingURL=fieldChangeHandler.js.map