"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeChangeAtomIdCodec = void 0;
function makeChangeAtomIdCodec(revisionTagCodec) {
    return {
        encode(changeAtomId, originatorId) {
            return changeAtomId.revision === undefined
                ? changeAtomId.localId
                : [
                    changeAtomId.localId,
                    revisionTagCodec.encode(changeAtomId.revision, originatorId),
                ];
        },
        decode(changeAtomId, originatorId) {
            return Array.isArray(changeAtomId)
                ? {
                    localId: changeAtomId[0],
                    revision: revisionTagCodec.decode(changeAtomId[1], originatorId),
                }
                : { localId: changeAtomId };
        },
    };
}
exports.makeChangeAtomIdCodec = makeChangeAtomIdCodec;
//# sourceMappingURL=changeAtomIdCodec.js.map