@fluidframework/merge-tree 2.0.0-internal.8.0.0 → 2.0.0-rc.1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +0 -6
- package/api-extractor-esm.json +17 -0
- package/api-extractor-lint.json +1 -10
- package/api-extractor.json +0 -4
- package/api-report/merge-tree.api.md +4 -9
- package/dist/client.d.ts +0 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +0 -7
- package/dist/client.js.map +1 -1
- package/dist/merge-tree-alpha.d.ts +27 -12
- package/dist/merge-tree-beta.d.ts +0 -16
- package/dist/merge-tree-public.d.ts +0 -16
- package/dist/merge-tree-untrimmed.d.ts +5 -29
- package/dist/mergeTree.d.ts +0 -17
- package/dist/mergeTree.d.ts.map +1 -1
- package/dist/mergeTree.js +0 -130
- package/dist/mergeTree.js.map +1 -1
- package/dist/ops.d.ts +1 -1
- package/dist/ops.js +1 -1
- package/dist/ops.js.map +1 -1
- package/dist/revertibles.d.ts +4 -4
- package/dist/revertibles.js +3 -3
- package/dist/revertibles.js.map +1 -1
- package/dist/test/Insertion.perf.spec.d.ts +6 -0
- package/dist/test/Insertion.perf.spec.d.ts.map +1 -0
- package/dist/test/Insertion.perf.spec.js +113 -0
- package/dist/test/Insertion.perf.spec.js.map +1 -0
- package/dist/test/PartialLengths.perf.spec.d.ts +6 -0
- package/dist/test/PartialLengths.perf.spec.d.ts.map +1 -0
- package/dist/test/PartialLengths.perf.spec.js +67 -0
- package/dist/test/PartialLengths.perf.spec.js.map +1 -0
- package/dist/test/Removal.perf.spec.d.ts +6 -0
- package/dist/test/Removal.perf.spec.d.ts.map +1 -0
- package/dist/test/Removal.perf.spec.js +166 -0
- package/dist/test/Removal.perf.spec.js.map +1 -0
- package/dist/test/Snapshot.perf.spec.d.ts +6 -0
- package/dist/test/Snapshot.perf.spec.d.ts.map +1 -0
- package/dist/test/Snapshot.perf.spec.js +33 -0
- package/dist/test/Snapshot.perf.spec.js.map +1 -0
- package/dist/test/attributionCollection.perf.spec.d.ts +6 -0
- package/dist/test/attributionCollection.perf.spec.d.ts.map +1 -0
- package/dist/test/attributionCollection.perf.spec.js +231 -0
- package/dist/test/attributionCollection.perf.spec.js.map +1 -0
- package/dist/test/attributionCollection.spec.d.ts +6 -0
- package/dist/test/attributionCollection.spec.d.ts.map +1 -0
- package/dist/test/attributionCollection.spec.js +486 -0
- package/dist/test/attributionCollection.spec.js.map +1 -0
- package/dist/test/attributionPolicy.spec.d.ts +6 -0
- package/dist/test/attributionPolicy.spec.d.ts.map +1 -0
- package/dist/test/attributionPolicy.spec.js +189 -0
- package/dist/test/attributionPolicy.spec.js.map +1 -0
- package/dist/test/beastTest.d.ts +54 -0
- package/dist/test/beastTest.d.ts.map +1 -0
- package/dist/test/beastTest.js +1333 -0
- package/dist/test/beastTest.js.map +1 -0
- package/dist/test/client.annotateMarker.spec.d.ts +6 -0
- package/dist/test/client.annotateMarker.spec.d.ts.map +1 -0
- package/dist/test/client.annotateMarker.spec.js +45 -0
- package/dist/test/client.annotateMarker.spec.js.map +1 -0
- package/dist/test/client.apis.d.ts +7 -0
- package/dist/test/client.apis.d.ts.map +1 -0
- package/dist/test/client.apis.js +72 -0
- package/dist/test/client.apis.js.map +1 -0
- package/dist/test/client.applyMsg.spec.d.ts +6 -0
- package/dist/test/client.applyMsg.spec.d.ts.map +1 -0
- package/dist/test/client.applyMsg.spec.js +500 -0
- package/dist/test/client.applyMsg.spec.js.map +1 -0
- package/dist/test/client.applyStashedOpFarm.spec.d.ts +12 -0
- package/dist/test/client.applyStashedOpFarm.spec.d.ts.map +1 -0
- package/dist/test/client.applyStashedOpFarm.spec.js +144 -0
- package/dist/test/client.applyStashedOpFarm.spec.js.map +1 -0
- package/dist/test/client.attributionFarm.spec.d.ts +7 -0
- package/dist/test/client.attributionFarm.spec.d.ts.map +1 -0
- package/dist/test/client.attributionFarm.spec.js +96 -0
- package/dist/test/client.attributionFarm.spec.js.map +1 -0
- package/dist/test/client.conflictFarm.spec.d.ts +15 -0
- package/dist/test/client.conflictFarm.spec.d.ts.map +1 -0
- package/dist/test/client.conflictFarm.spec.js +88 -0
- package/dist/test/client.conflictFarm.spec.js.map +1 -0
- package/dist/test/client.getPosition.spec.d.ts +6 -0
- package/dist/test/client.getPosition.spec.d.ts.map +1 -0
- package/dist/test/client.getPosition.spec.js +54 -0
- package/dist/test/client.getPosition.spec.js.map +1 -0
- package/dist/test/client.localReference.spec.d.ts +6 -0
- package/dist/test/client.localReference.spec.d.ts.map +1 -0
- package/dist/test/client.localReference.spec.js +439 -0
- package/dist/test/client.localReference.spec.js.map +1 -0
- package/dist/test/client.localReferenceFarm.spec.d.ts +6 -0
- package/dist/test/client.localReferenceFarm.spec.d.ts.map +1 -0
- package/dist/test/client.localReferenceFarm.spec.js +88 -0
- package/dist/test/client.localReferenceFarm.spec.js.map +1 -0
- package/dist/test/client.rebasePosition.spec.d.ts +6 -0
- package/dist/test/client.rebasePosition.spec.d.ts.map +1 -0
- package/dist/test/client.rebasePosition.spec.js +102 -0
- package/dist/test/client.rebasePosition.spec.js.map +1 -0
- package/dist/test/client.reconnectFarm.spec.d.ts +12 -0
- package/dist/test/client.reconnectFarm.spec.d.ts.map +1 -0
- package/dist/test/client.reconnectFarm.spec.js +91 -0
- package/dist/test/client.reconnectFarm.spec.js.map +1 -0
- package/dist/test/client.replay.spec.d.ts +6 -0
- package/dist/test/client.replay.spec.d.ts.map +1 -0
- package/dist/test/client.replay.spec.js +85 -0
- package/dist/test/client.replay.spec.js.map +1 -0
- package/dist/test/client.rollback.spec.d.ts +6 -0
- package/dist/test/client.rollback.spec.d.ts.map +1 -0
- package/dist/test/client.rollback.spec.js +453 -0
- package/dist/test/client.rollback.spec.js.map +1 -0
- package/dist/test/client.rollbackFarm.spec.d.ts +6 -0
- package/dist/test/client.rollbackFarm.spec.d.ts.map +1 -0
- package/dist/test/client.rollbackFarm.spec.js +48 -0
- package/dist/test/client.rollbackFarm.spec.js.map +1 -0
- package/dist/test/client.searchForMarker.spec.d.ts +6 -0
- package/dist/test/client.searchForMarker.spec.d.ts.map +1 -0
- package/dist/test/client.searchForMarker.spec.js +446 -0
- package/dist/test/client.searchForMarker.spec.js.map +1 -0
- package/dist/test/client.walkSegments.spec.d.ts +6 -0
- package/dist/test/client.walkSegments.spec.d.ts.map +1 -0
- package/dist/test/client.walkSegments.spec.js +54 -0
- package/dist/test/client.walkSegments.spec.js.map +1 -0
- package/dist/test/collections.list.spec.d.ts +6 -0
- package/dist/test/collections.list.spec.d.ts.map +1 -0
- package/dist/test/collections.list.spec.js +84 -0
- package/dist/test/collections.list.spec.js.map +1 -0
- package/dist/test/createInsertOnlyAttributionPolicy.spec.d.ts +6 -0
- package/dist/test/createInsertOnlyAttributionPolicy.spec.d.ts.map +1 -0
- package/dist/test/createInsertOnlyAttributionPolicy.spec.js +35 -0
- package/dist/test/createInsertOnlyAttributionPolicy.spec.js.map +1 -0
- package/dist/test/index.d.ts +13 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +88 -0
- package/dist/test/index.js.map +1 -0
- package/dist/test/mergeTree.annotate.deltaCallback.spec.d.ts +6 -0
- package/dist/test/mergeTree.annotate.deltaCallback.spec.d.ts.map +1 -0
- package/dist/test/mergeTree.annotate.deltaCallback.spec.js +142 -0
- package/dist/test/mergeTree.annotate.deltaCallback.spec.js.map +1 -0
- package/dist/test/mergeTree.annotate.spec.d.ts +6 -0
- package/dist/test/mergeTree.annotate.spec.d.ts.map +1 -0
- package/dist/test/mergeTree.annotate.spec.js +448 -0
- package/dist/test/mergeTree.annotate.spec.js.map +1 -0
- package/dist/test/mergeTree.insert.deltaCallback.spec.d.ts +6 -0
- package/dist/test/mergeTree.insert.deltaCallback.spec.d.ts.map +1 -0
- package/dist/test/mergeTree.insert.deltaCallback.spec.js +126 -0
- package/dist/test/mergeTree.insert.deltaCallback.spec.js.map +1 -0
- package/dist/test/mergeTree.insertingWalk.spec.d.ts +6 -0
- package/dist/test/mergeTree.insertingWalk.spec.d.ts.map +1 -0
- package/dist/test/mergeTree.insertingWalk.spec.js +279 -0
- package/dist/test/mergeTree.insertingWalk.spec.js.map +1 -0
- package/dist/test/mergeTree.markRangeRemoved.deltaCallback.spec.d.ts +6 -0
- package/dist/test/mergeTree.markRangeRemoved.deltaCallback.spec.d.ts.map +1 -0
- package/dist/test/mergeTree.markRangeRemoved.deltaCallback.spec.js +178 -0
- package/dist/test/mergeTree.markRangeRemoved.deltaCallback.spec.js.map +1 -0
- package/dist/test/mergeTree.markRangeRemoved.spec.d.ts +6 -0
- package/dist/test/mergeTree.markRangeRemoved.spec.d.ts.map +1 -0
- package/dist/test/mergeTree.markRangeRemoved.spec.js +130 -0
- package/dist/test/mergeTree.markRangeRemoved.spec.js.map +1 -0
- package/dist/test/mergeTree.walk.spec.d.ts +6 -0
- package/dist/test/mergeTree.walk.spec.d.ts.map +1 -0
- package/dist/test/mergeTree.walk.spec.js +63 -0
- package/dist/test/mergeTree.walk.spec.js.map +1 -0
- package/dist/test/mergeTree.zamboni.spec.d.ts +6 -0
- package/dist/test/mergeTree.zamboni.spec.d.ts.map +1 -0
- package/dist/test/mergeTree.zamboni.spec.js +52 -0
- package/dist/test/mergeTree.zamboni.spec.js.map +1 -0
- package/dist/test/mergeTreeOperationRunner.d.ts +63 -0
- package/dist/test/mergeTreeOperationRunner.d.ts.map +1 -0
- package/dist/test/mergeTreeOperationRunner.js +245 -0
- package/dist/test/mergeTreeOperationRunner.js.map +1 -0
- package/dist/test/mergeTreeOperationRunner.spec.d.ts +6 -0
- package/dist/test/mergeTreeOperationRunner.spec.d.ts.map +1 -0
- package/dist/test/mergeTreeOperationRunner.spec.js +156 -0
- package/dist/test/mergeTreeOperationRunner.spec.js.map +1 -0
- package/dist/test/obliterate.concurrent.spec.d.ts +6 -0
- package/dist/test/obliterate.concurrent.spec.d.ts.map +1 -0
- package/dist/test/obliterate.concurrent.spec.js +1446 -0
- package/dist/test/obliterate.concurrent.spec.js.map +1 -0
- package/dist/test/obliterate.partialLength.spec.d.ts +6 -0
- package/dist/test/obliterate.partialLength.spec.d.ts.map +1 -0
- package/dist/test/obliterate.partialLength.spec.js +279 -0
- package/dist/test/obliterate.partialLength.spec.js.map +1 -0
- package/dist/test/obliterate.reconnect.spec.d.ts +6 -0
- package/dist/test/obliterate.reconnect.spec.d.ts.map +1 -0
- package/dist/test/obliterate.reconnect.spec.js +164 -0
- package/dist/test/obliterate.reconnect.spec.js.map +1 -0
- package/dist/test/obliterate.spec.d.ts +6 -0
- package/dist/test/obliterate.spec.d.ts.map +1 -0
- package/dist/test/obliterate.spec.js +162 -0
- package/dist/test/obliterate.spec.js.map +1 -0
- package/dist/test/ordinal.spec.d.ts +2 -0
- package/dist/test/ordinal.spec.d.ts.map +1 -0
- package/dist/test/ordinal.spec.js +43 -0
- package/dist/test/ordinal.spec.js.map +1 -0
- package/dist/test/partialLength.spec.d.ts +6 -0
- package/dist/test/partialLength.spec.d.ts.map +1 -0
- package/dist/test/partialLength.spec.js +282 -0
- package/dist/test/partialLength.spec.js.map +1 -0
- package/dist/test/properties.spec.d.ts +6 -0
- package/dist/test/properties.spec.d.ts.map +1 -0
- package/dist/test/properties.spec.js +55 -0
- package/dist/test/properties.spec.js.map +1 -0
- package/dist/test/reconnectHelper.d.ts +48 -0
- package/dist/test/reconnectHelper.d.ts.map +1 -0
- package/dist/test/reconnectHelper.js +86 -0
- package/dist/test/reconnectHelper.js.map +1 -0
- package/dist/test/resetPendingSegmentsToOp.spec.d.ts +6 -0
- package/dist/test/resetPendingSegmentsToOp.spec.d.ts.map +1 -0
- package/dist/test/resetPendingSegmentsToOp.spec.js +218 -0
- package/dist/test/resetPendingSegmentsToOp.spec.js.map +1 -0
- package/dist/test/revertibleFarm.spec.d.ts +6 -0
- package/dist/test/revertibleFarm.spec.d.ts.map +1 -0
- package/dist/test/revertibleFarm.spec.js +124 -0
- package/dist/test/revertibleFarm.spec.js.map +1 -0
- package/dist/test/revertibles.spec.d.ts +17 -0
- package/dist/test/revertibles.spec.d.ts.map +1 -0
- package/dist/test/revertibles.spec.js +385 -0
- package/dist/test/revertibles.spec.js.map +1 -0
- package/dist/test/segmentGroupCollection.spec.d.ts +6 -0
- package/dist/test/segmentGroupCollection.spec.d.ts.map +1 -0
- package/dist/test/segmentGroupCollection.spec.js +60 -0
- package/dist/test/segmentGroupCollection.spec.js.map +1 -0
- package/dist/test/snapshot.spec.d.ts +6 -0
- package/dist/test/snapshot.spec.d.ts.map +1 -0
- package/dist/test/snapshot.spec.js +178 -0
- package/dist/test/snapshot.spec.js.map +1 -0
- package/dist/test/snapshot.utils.d.ts +33 -0
- package/dist/test/snapshot.utils.d.ts.map +1 -0
- package/dist/test/snapshot.utils.js +109 -0
- package/dist/test/snapshot.utils.js.map +1 -0
- package/dist/test/snapshotlegacy.spec.d.ts +6 -0
- package/dist/test/snapshotlegacy.spec.d.ts.map +1 -0
- package/dist/test/snapshotlegacy.spec.js +139 -0
- package/dist/test/snapshotlegacy.spec.js.map +1 -0
- package/dist/test/sortedSegmentSet.spec.d.ts +6 -0
- package/dist/test/sortedSegmentSet.spec.d.ts.map +1 -0
- package/dist/test/sortedSegmentSet.spec.js +95 -0
- package/dist/test/sortedSegmentSet.spec.js.map +1 -0
- package/dist/test/testClient.d.ts +119 -0
- package/dist/test/testClient.d.ts.map +1 -0
- package/dist/test/testClient.js +439 -0
- package/dist/test/testClient.js.map +1 -0
- package/dist/test/testClientLogger.d.ts +44 -0
- package/dist/test/testClientLogger.d.ts.map +1 -0
- package/dist/test/testClientLogger.js +287 -0
- package/dist/test/testClientLogger.js.map +1 -0
- package/dist/test/testSerializer.d.ts +18 -0
- package/dist/test/testSerializer.d.ts.map +1 -0
- package/dist/test/testSerializer.js +33 -0
- package/dist/test/testSerializer.js.map +1 -0
- package/dist/test/testServer.d.ts +36 -0
- package/dist/test/testServer.d.ts.map +1 -0
- package/dist/test/testServer.js +138 -0
- package/dist/test/testServer.js.map +1 -0
- package/dist/test/testUtils.d.ts +69 -0
- package/dist/test/testUtils.d.ts.map +1 -0
- package/dist/test/testUtils.js +149 -0
- package/dist/test/testUtils.js.map +1 -0
- package/dist/test/text.d.ts +9 -0
- package/dist/test/text.d.ts.map +1 -0
- package/dist/test/text.js +76 -0
- package/dist/test/text.js.map +1 -0
- package/dist/test/tracking.spec.d.ts +6 -0
- package/dist/test/tracking.spec.d.ts.map +1 -0
- package/dist/test/tracking.spec.js +120 -0
- package/dist/test/tracking.spec.js.map +1 -0
- package/dist/test/wordUnitTests.d.ts +6 -0
- package/dist/test/wordUnitTests.d.ts.map +1 -0
- package/dist/test/wordUnitTests.js +172 -0
- package/dist/test/wordUnitTests.js.map +1 -0
- package/lib/{MergeTreeTextHelper.d.ts → MergeTreeTextHelper.d.mts} +3 -3
- package/lib/MergeTreeTextHelper.d.mts.map +1 -0
- package/lib/{MergeTreeTextHelper.js → MergeTreeTextHelper.mjs} +5 -10
- package/lib/MergeTreeTextHelper.mjs.map +1 -0
- package/lib/{attributionCollection.d.ts → attributionCollection.d.mts} +2 -2
- package/lib/attributionCollection.d.mts.map +1 -0
- package/lib/{attributionCollection.js → attributionCollection.mjs} +9 -14
- package/lib/attributionCollection.mjs.map +1 -0
- package/lib/{attributionPolicy.d.ts → attributionPolicy.d.mts} +2 -2
- package/lib/attributionPolicy.d.mts.map +1 -0
- package/lib/{attributionPolicy.js → attributionPolicy.mjs} +21 -27
- package/lib/attributionPolicy.mjs.map +1 -0
- package/lib/{client.d.ts → client.d.mts} +9 -16
- package/lib/client.d.mts.map +1 -0
- package/lib/{client.js → client.mjs} +101 -110
- package/lib/client.mjs.map +1 -0
- package/lib/collections/{index.d.ts → index.d.mts} +3 -3
- package/lib/collections/index.d.mts.map +1 -0
- package/lib/collections/index.mjs +7 -0
- package/lib/collections/index.mjs.map +1 -0
- package/lib/collections/{list.d.ts → list.d.mts} +1 -1
- package/lib/collections/list.d.mts.map +1 -0
- package/lib/collections/{list.js → list.mjs} +6 -11
- package/lib/collections/list.mjs.map +1 -0
- package/lib/collections/{rbTree.d.ts → rbTree.d.mts} +1 -1
- package/lib/collections/rbTree.d.mts.map +1 -0
- package/lib/collections/{rbTree.js → rbTree.mjs} +16 -20
- package/lib/collections/rbTree.mjs.map +1 -0
- package/lib/{constants.d.ts → constants.d.mts} +1 -1
- package/lib/constants.d.mts.map +1 -0
- package/lib/constants.mjs +32 -0
- package/lib/constants.mjs.map +1 -0
- package/lib/{endOfTreeSegment.d.ts → endOfTreeSegment.d.mts} +4 -4
- package/lib/endOfTreeSegment.d.mts.map +1 -0
- package/lib/{endOfTreeSegment.js → endOfTreeSegment.mjs} +13 -18
- package/lib/endOfTreeSegment.mjs.map +1 -0
- package/lib/{index.d.ts → index.d.mts} +21 -21
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +24 -0
- package/lib/index.mjs.map +1 -0
- package/lib/{localReference.d.ts → localReference.d.mts} +7 -7
- package/lib/localReference.d.mts.map +1 -0
- package/lib/{localReference.js → localReference.mjs} +38 -47
- package/lib/localReference.mjs.map +1 -0
- package/lib/{merge-tree-alpha.d.ts → merge-tree-alpha.d.mts} +27 -12
- package/lib/{merge-tree-beta.d.ts → merge-tree-beta.d.mts} +0 -16
- package/lib/{merge-tree-public.d.ts → merge-tree-public.d.mts} +0 -16
- package/lib/{merge-tree-untrimmed.d.ts → merge-tree-untrimmed.d.mts} +5 -29
- package/lib/{mergeTree.d.ts → mergeTree.d.mts} +12 -29
- package/lib/mergeTree.d.mts.map +1 -0
- package/lib/{mergeTree.js → mergeTree.mjs} +203 -340
- package/lib/mergeTree.mjs.map +1 -0
- package/lib/{mergeTreeDeltaCallback.d.ts → mergeTreeDeltaCallback.d.mts} +4 -8
- package/lib/mergeTreeDeltaCallback.d.mts.map +1 -0
- package/lib/{mergeTreeDeltaCallback.js → mergeTreeDeltaCallback.mjs} +2 -5
- package/lib/mergeTreeDeltaCallback.mjs.map +1 -0
- package/lib/{mergeTreeNodeWalk.d.ts → mergeTreeNodeWalk.d.mts} +2 -2
- package/lib/mergeTreeNodeWalk.d.mts.map +1 -0
- package/lib/{mergeTreeNodeWalk.js → mergeTreeNodeWalk.mjs} +14 -21
- package/lib/mergeTreeNodeWalk.mjs.map +1 -0
- package/lib/{mergeTreeNodes.d.ts → mergeTreeNodes.d.mts} +12 -12
- package/lib/mergeTreeNodes.d.mts.map +1 -0
- package/lib/{mergeTreeNodes.js → mergeTreeNodes.mjs} +60 -76
- package/lib/mergeTreeNodes.mjs.map +1 -0
- package/lib/{mergeTreeTracking.d.ts → mergeTreeTracking.d.mts} +3 -3
- package/lib/mergeTreeTracking.d.mts.map +1 -0
- package/lib/{mergeTreeTracking.js → mergeTreeTracking.mjs} +6 -13
- package/lib/mergeTreeTracking.mjs.map +1 -0
- package/lib/{opBuilder.d.ts → opBuilder.d.mts} +4 -4
- package/lib/opBuilder.d.mts.map +1 -0
- package/lib/{opBuilder.js → opBuilder.mjs} +15 -25
- package/lib/opBuilder.mjs.map +1 -0
- package/lib/{ops.d.ts → ops.d.mts} +2 -2
- package/lib/ops.d.mts.map +1 -0
- package/lib/{ops.js → ops.mjs} +5 -8
- package/lib/ops.mjs.map +1 -0
- package/lib/{ordinal.d.ts → ordinal.d.mts} +1 -1
- package/lib/ordinal.d.mts.map +1 -0
- package/lib/{ordinal.js → ordinal.mjs} +4 -9
- package/lib/ordinal.mjs.map +1 -0
- package/lib/{partialLengths.d.ts → partialLengths.d.mts} +4 -4
- package/lib/partialLengths.d.mts.map +1 -0
- package/lib/{partialLengths.js → partialLengths.mjs} +38 -46
- package/lib/partialLengths.mjs.map +1 -0
- package/lib/{properties.d.ts → properties.d.mts} +1 -1
- package/lib/properties.d.mts.map +1 -0
- package/lib/{properties.js → properties.mjs} +7 -16
- package/lib/properties.mjs.map +1 -0
- package/lib/{referencePositions.d.ts → referencePositions.d.mts} +5 -5
- package/lib/referencePositions.d.mts.map +1 -0
- package/lib/referencePositions.mjs +70 -0
- package/lib/referencePositions.mjs.map +1 -0
- package/lib/{revertibles.d.ts → revertibles.d.mts} +12 -12
- package/lib/revertibles.d.mts.map +1 -0
- package/lib/{revertibles.js → revertibles.mjs} +60 -67
- package/lib/revertibles.mjs.map +1 -0
- package/lib/{segmentGroupCollection.d.ts → segmentGroupCollection.d.mts} +2 -2
- package/lib/segmentGroupCollection.d.mts.map +1 -0
- package/lib/{segmentGroupCollection.js → segmentGroupCollection.mjs} +5 -9
- package/lib/segmentGroupCollection.mjs.map +1 -0
- package/lib/{segmentPropertiesManager.d.ts → segmentPropertiesManager.d.mts} +3 -3
- package/lib/segmentPropertiesManager.d.mts.map +1 -0
- package/lib/{segmentPropertiesManager.js → segmentPropertiesManager.mjs} +14 -20
- package/lib/{segmentPropertiesManager.js.map → segmentPropertiesManager.mjs.map} +1 -1
- package/lib/{snapshotChunks.d.ts → snapshotChunks.d.mts} +4 -4
- package/lib/snapshotChunks.d.mts.map +1 -0
- package/lib/{snapshotChunks.js → snapshotChunks.mjs} +10 -17
- package/lib/snapshotChunks.mjs.map +1 -0
- package/lib/{snapshotLoader.d.ts → snapshotLoader.d.mts} +3 -3
- package/lib/snapshotLoader.d.mts.map +1 -0
- package/lib/{snapshotLoader.js → snapshotLoader.mjs} +33 -38
- package/lib/snapshotLoader.mjs.map +1 -0
- package/lib/{snapshotV1.d.ts → snapshotV1.d.mts} +4 -4
- package/lib/snapshotV1.d.mts.map +1 -0
- package/lib/{snapshotV1.js → snapshotV1.mjs} +28 -32
- package/lib/snapshotV1.mjs.map +1 -0
- package/lib/{snapshotlegacy.d.ts → snapshotlegacy.d.mts} +3 -3
- package/lib/snapshotlegacy.d.mts.map +1 -0
- package/lib/{snapshotlegacy.js → snapshotlegacy.mjs} +21 -26
- package/lib/snapshotlegacy.mjs.map +1 -0
- package/lib/{sortedSegmentSet.d.ts → sortedSegmentSet.d.mts} +4 -4
- package/lib/sortedSegmentSet.d.mts.map +1 -0
- package/lib/{sortedSegmentSet.js → sortedSegmentSet.mjs} +3 -8
- package/lib/sortedSegmentSet.mjs.map +1 -0
- package/lib/{sortedSet.d.ts → sortedSet.d.mts} +1 -1
- package/lib/sortedSet.d.mts.map +1 -0
- package/lib/{sortedSet.js → sortedSet.mjs} +2 -6
- package/lib/sortedSet.mjs.map +1 -0
- package/lib/{textSegment.d.ts → textSegment.d.mts} +4 -4
- package/lib/textSegment.d.mts.map +1 -0
- package/lib/{textSegment.js → textSegment.mjs} +8 -12
- package/lib/textSegment.mjs.map +1 -0
- package/lib/{zamboni.d.ts → zamboni.d.mts} +3 -3
- package/lib/zamboni.d.mts.map +1 -0
- package/lib/{zamboni.js → zamboni.mjs} +22 -28
- package/lib/zamboni.mjs.map +1 -0
- package/package.json +95 -164
- package/src/client.ts +0 -8
- package/src/mergeTree.ts +0 -226
- package/src/ops.ts +1 -1
- package/src/revertibles.ts +4 -4
- package/lib/MergeTreeTextHelper.d.ts.map +0 -1
- package/lib/MergeTreeTextHelper.js.map +0 -1
- package/lib/attributionCollection.d.ts.map +0 -1
- package/lib/attributionCollection.js.map +0 -1
- package/lib/attributionPolicy.d.ts.map +0 -1
- package/lib/attributionPolicy.js.map +0 -1
- package/lib/client.d.ts.map +0 -1
- package/lib/client.js.map +0 -1
- package/lib/collections/index.d.ts.map +0 -1
- package/lib/collections/index.js +0 -14
- package/lib/collections/index.js.map +0 -1
- package/lib/collections/list.d.ts.map +0 -1
- package/lib/collections/list.js.map +0 -1
- package/lib/collections/rbTree.d.ts.map +0 -1
- package/lib/collections/rbTree.js.map +0 -1
- package/lib/constants.d.ts.map +0 -1
- package/lib/constants.js +0 -35
- package/lib/constants.js.map +0 -1
- package/lib/endOfTreeSegment.d.ts.map +0 -1
- package/lib/endOfTreeSegment.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -80
- package/lib/index.js.map +0 -1
- package/lib/localReference.d.ts.map +0 -1
- package/lib/localReference.js.map +0 -1
- package/lib/mergeTree.d.ts.map +0 -1
- package/lib/mergeTree.js.map +0 -1
- package/lib/mergeTreeDeltaCallback.d.ts.map +0 -1
- package/lib/mergeTreeDeltaCallback.js.map +0 -1
- package/lib/mergeTreeNodeWalk.d.ts.map +0 -1
- package/lib/mergeTreeNodeWalk.js.map +0 -1
- package/lib/mergeTreeNodes.d.ts.map +0 -1
- package/lib/mergeTreeNodes.js.map +0 -1
- package/lib/mergeTreeTracking.d.ts.map +0 -1
- package/lib/mergeTreeTracking.js.map +0 -1
- package/lib/opBuilder.d.ts.map +0 -1
- package/lib/opBuilder.js.map +0 -1
- package/lib/ops.d.ts.map +0 -1
- package/lib/ops.js.map +0 -1
- package/lib/ordinal.d.ts.map +0 -1
- package/lib/ordinal.js.map +0 -1
- package/lib/partialLengths.d.ts.map +0 -1
- package/lib/partialLengths.js.map +0 -1
- package/lib/properties.d.ts.map +0 -1
- package/lib/properties.js.map +0 -1
- package/lib/referencePositions.d.ts.map +0 -1
- package/lib/referencePositions.js +0 -80
- package/lib/referencePositions.js.map +0 -1
- package/lib/revertibles.d.ts.map +0 -1
- package/lib/revertibles.js.map +0 -1
- package/lib/segmentGroupCollection.d.ts.map +0 -1
- package/lib/segmentGroupCollection.js.map +0 -1
- package/lib/segmentPropertiesManager.d.ts.map +0 -1
- package/lib/snapshotChunks.d.ts.map +0 -1
- package/lib/snapshotChunks.js.map +0 -1
- package/lib/snapshotLoader.d.ts.map +0 -1
- package/lib/snapshotLoader.js.map +0 -1
- package/lib/snapshotV1.d.ts.map +0 -1
- package/lib/snapshotV1.js.map +0 -1
- package/lib/snapshotlegacy.d.ts.map +0 -1
- package/lib/snapshotlegacy.js.map +0 -1
- package/lib/sortedSegmentSet.d.ts.map +0 -1
- package/lib/sortedSegmentSet.js.map +0 -1
- package/lib/sortedSet.d.ts.map +0 -1
- package/lib/sortedSet.js.map +0 -1
- package/lib/textSegment.d.ts.map +0 -1
- package/lib/textSegment.js.map +0 -1
- package/lib/zamboni.d.ts.map +0 -1
- package/lib/zamboni.js.map +0 -1
- package/merge-tree.test-files.tar +0 -0
- package/src/mergeTreeExample1.pdf +0 -0
- package/tsconfig.esnext.json +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @fluidframework/merge-tree
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.1.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
|
|
8
|
+
|
|
9
|
+
The following Fluid server dependencies have been updated to the latest version, 3.0.0. [See the full changelog.](https://github.com/microsoft/FluidFramework/releases/tag/server_v3.0.0)
|
|
10
|
+
|
|
11
|
+
- @fluidframework/gitresources
|
|
12
|
+
- @fluidframework/server-kafka-orderer
|
|
13
|
+
- @fluidframework/server-lambdas
|
|
14
|
+
- @fluidframework/server-lambdas-driver
|
|
15
|
+
- @fluidframework/server-local-server
|
|
16
|
+
- @fluidframework/server-memory-orderer
|
|
17
|
+
- @fluidframework/protocol-base
|
|
18
|
+
- @fluidframework/server-routerlicious
|
|
19
|
+
- @fluidframework/server-routerlicious-base
|
|
20
|
+
- @fluidframework/server-services
|
|
21
|
+
- @fluidframework/server-services-client
|
|
22
|
+
- @fluidframework/server-services-core
|
|
23
|
+
- @fluidframework/server-services-ordering-kafkanode
|
|
24
|
+
- @fluidframework/server-services-ordering-rdkafka
|
|
25
|
+
- @fluidframework/server-services-ordering-zookeeper
|
|
26
|
+
- @fluidframework/server-services-shared
|
|
27
|
+
- @fluidframework/server-services-telemetry
|
|
28
|
+
- @fluidframework/server-services-utils
|
|
29
|
+
- @fluidframework/server-test-utils
|
|
30
|
+
- tinylicious
|
|
31
|
+
|
|
32
|
+
- Updated @fluidframework/protocol-definitions ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
|
|
33
|
+
|
|
34
|
+
The @fluidframework/protocol-definitions dependency has been upgraded to v3.1.0. [See the full
|
|
35
|
+
changelog.](https://github.com/microsoft/FluidFramework/blob/main/common/lib/protocol-definitions/CHANGELOG.md#310)
|
|
36
|
+
|
|
37
|
+
- sequence: Remove the findTile API ([#18908](https://github.com/microsoft/FluidFramework/issues/18908)) [29b093e55c](https://github.com/microsoft/FluidFramework/commits/29b093e55cb2a7e98c9445b735783f463acfb3bb)
|
|
38
|
+
|
|
39
|
+
The `findTile` API that was previously deprecated is now being removed. The new `searchForMarker` function provides similar functionality, and can be called with the start position, the client ID, the desired marker label to find, and the search direction, where a value of `true` indicates a forward search.
|
|
40
|
+
|
|
3
41
|
## 2.0.0-internal.8.0.0
|
|
4
42
|
|
|
5
43
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -16,12 +16,6 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
|
|
|
16
16
|
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
17
17
|
library consumers should always prefer `^`.
|
|
18
18
|
|
|
19
|
-
Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
|
|
20
|
-
you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
|
|
21
|
-
Standard `^` and `~` ranges will not work as expected.
|
|
22
|
-
See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
|
|
23
|
-
package for more information including tools to convert between version schemes.
|
|
24
|
-
|
|
25
19
|
<!-- prettier-ignore-end -->
|
|
26
20
|
|
|
27
21
|
<!-- AUTO-GENERATED-CONTENT:END -->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base-esm.json",
|
|
4
|
+
"messages": {
|
|
5
|
+
"extractorMessageReporting": {
|
|
6
|
+
// The ESM types complain about missing exports; I don't understand why CJS doesn't. The errors are:
|
|
7
|
+
//
|
|
8
|
+
// Error: src/localReference.ts:241:2 - (ae-forgotten-export) The symbol "IRefsAtOffset" needs to be exported by the entry point index.d.mts
|
|
9
|
+
// Error: src/mergeTreeNodes.ts:402:2 - (ae-forgotten-export) The symbol "ISegmentLeaf" needs to be exported by
|
|
10
|
+
// the entry point index.d.mts
|
|
11
|
+
// TODO: AB#6647
|
|
12
|
+
"ae-forgotten-export": {
|
|
13
|
+
"logLevel": "none"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/api-extractor-lint.json
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "../../../common/build/build-common/api-extractor-lint.json"
|
|
4
|
-
"messages": {
|
|
5
|
-
"extractorMessageReporting": {
|
|
6
|
-
// TODO: remove once base config has this enabled as an error
|
|
7
|
-
"ae-incompatible-release-tags": {
|
|
8
|
-
"logLevel": "error",
|
|
9
|
-
"addToApiReportFile": false
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-lint.json"
|
|
13
4
|
}
|
package/api-extractor.json
CHANGED
|
@@ -19,7 +19,7 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
|
19
19
|
// @internal @deprecated (undocumented)
|
|
20
20
|
export function addProperties(oldProps: PropertySet | undefined, newProps: PropertySet): PropertySet;
|
|
21
21
|
|
|
22
|
-
// @
|
|
22
|
+
// @alpha (undocumented)
|
|
23
23
|
export function appendToMergeTreeDeltaRevertibles(deltaArgs: IMergeTreeDeltaCallbackArgs, revertibles: MergeTreeDeltaRevertible[]): void;
|
|
24
24
|
|
|
25
25
|
// @alpha @sealed
|
|
@@ -114,11 +114,6 @@ export class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
114
114
|
// (undocumented)
|
|
115
115
|
createTextHelper(): IMergeTreeTextHelper;
|
|
116
116
|
findReconnectionPosition(segment: ISegment, localSeq: number): number;
|
|
117
|
-
// @deprecated (undocumented)
|
|
118
|
-
findTile(startPos: number, tileLabel: string, preceding?: boolean): {
|
|
119
|
-
tile: ReferencePosition;
|
|
120
|
-
pos: number;
|
|
121
|
-
} | undefined;
|
|
122
117
|
// (undocumented)
|
|
123
118
|
getClientId(): number;
|
|
124
119
|
// (undocumented)
|
|
@@ -253,7 +248,7 @@ export interface Dictionary<TKey, TData> {
|
|
|
253
248
|
remove(key: TKey): void;
|
|
254
249
|
}
|
|
255
250
|
|
|
256
|
-
// @
|
|
251
|
+
// @alpha (undocumented)
|
|
257
252
|
export function discardMergeTreeDeltaRevertible(revertibles: MergeTreeDeltaRevertible[]): void;
|
|
258
253
|
|
|
259
254
|
// @internal
|
|
@@ -697,7 +692,7 @@ export type MergeTreeDeltaOperationType = typeof MergeTreeDeltaType.ANNOTATE | t
|
|
|
697
692
|
// @alpha (undocumented)
|
|
698
693
|
export type MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationType | MergeTreeMaintenanceType;
|
|
699
694
|
|
|
700
|
-
// @
|
|
695
|
+
// @alpha (undocumented)
|
|
701
696
|
export type MergeTreeDeltaRevertible = {
|
|
702
697
|
operation: typeof MergeTreeDeltaType.INSERT;
|
|
703
698
|
trackingGroup: ITrackingGroup;
|
|
@@ -918,7 +913,7 @@ export const reservedRangeLabelsKey = "referenceRangeLabels";
|
|
|
918
913
|
// @internal (undocumented)
|
|
919
914
|
export const reservedTileLabelsKey = "referenceTileLabels";
|
|
920
915
|
|
|
921
|
-
// @
|
|
916
|
+
// @alpha (undocumented)
|
|
922
917
|
export function revertMergeTreeDeltaRevertibles(driver: MergeTreeRevertibleDriver, revertibles: MergeTreeDeltaRevertible[]): void;
|
|
923
918
|
|
|
924
919
|
// @alpha @deprecated (undocumented)
|
package/dist/client.d.ts
CHANGED
|
@@ -238,13 +238,6 @@ export declare class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
238
238
|
getClientId(): number;
|
|
239
239
|
getLength(): number;
|
|
240
240
|
startOrUpdateCollaboration(longClientId: string | undefined, minSeq?: number, currentSeq?: number): void;
|
|
241
|
-
/**
|
|
242
|
-
* @deprecated Use searchForMarker instead.
|
|
243
|
-
*/
|
|
244
|
-
findTile(startPos: number, tileLabel: string, preceding?: boolean): {
|
|
245
|
-
tile: ReferencePosition;
|
|
246
|
-
pos: number;
|
|
247
|
-
} | undefined;
|
|
248
241
|
/**
|
|
249
242
|
* Searches a string for the nearest marker in either direction to a given start position.
|
|
250
243
|
* The search will include the start position, so markers at the start position are valid
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAe,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EACN,sBAAsB,EACtB,sBAAsB,EACtB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAA4B,MAAM,iCAAiC,CAAC;AAGhG,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAEN,mBAAmB,EAInB,QAAQ,EACR,cAAc,EACd,MAAM,EAEN,YAAY,EACZ,MAAM,kBAAkB,CAAC;AAU1B,OAAO,EACN,YAAY,EACZ,qBAAqB,EACrB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AAY,EAErB,YAAY,EAAE,YAAY,GAAG,YAAY,EAAE,GACzC,YAAY;IAmER,gBAAgB,IAAI,oBAAoB;IAIxC,SAAS,CACf,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,gBAAgB,EAC5B,WAAW,EAAE,yBAAyB,EAAE,GACtC,qBAAqB;IAoCX,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,OAAO,EAAE,sBAAsB,EAC/B,UAAU,EAAE,gBAAgB,GAC1B,OAAO,CAAC;QAAE,WAAW,EAAE,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAAA;KAAE,CAAC;IAMjE,OAAO,CAAC,sBAAsB;IAM9B,gBAAgB,CAAC,OAAO,EAAE,kBAAkB;IAyB5C,YAAY,CAAC,MAAM,EAAE,MAAM;IAI3B,oBAAoB,CAAC,CAAC,SAAS,QAAQ,EACtC,GAAG,EAAE,MAAM,EACX,YAAY,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,yBAAyB,GAAG,UAAU,CAAC,EACtF,QAAQ,CAAC,EAAE,MAAM;;;;IAYlB,uBAAuB,CAAC,GAAG,EAAE,MAAM;IAUnC,yBAAyB,CAAC,GAAG,EAAE,MAAM;;;;IAarC,aAAa;IAIb,WAAW;IAIX,SAAS;IAIT,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,SAAI,EAAE,UAAU,SAAI;IAyBvF;;;;;;;;OAQG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,UAAO;CAItE"}
|
package/dist/client.js
CHANGED
|
@@ -809,13 +809,6 @@ class Client extends client_utils_1.TypedEventEmitter {
|
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
/**
|
|
813
|
-
* @deprecated Use searchForMarker instead.
|
|
814
|
-
*/
|
|
815
|
-
findTile(startPos, tileLabel, preceding = true) {
|
|
816
|
-
const clientId = this.getClientId();
|
|
817
|
-
return this._mergeTree.findTile(startPos, clientId, tileLabel, preceding);
|
|
818
|
-
}
|
|
819
812
|
/**
|
|
820
813
|
* Searches a string for the nearest marker in either direction to a given start position.
|
|
821
814
|
* The search will include the start position, so markers at the start position are valid
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,+EAA8F;AAM9F,2DAAqE;AACrE,+DAAiE;AACjE,qEAAgG;AAChG,+CAA+D;AAC/D,2CAAgF;AAEhF,qDAW0B;AAC1B,2CAQqB;AACrB,+BAce;AAEf,qDAAkD;AAClD,qDAAkD;AAGlD,6CAA0C;AAC1C,6DAAoF;AACpF,2CAA2D;AAC3D,+DAA4D;AAC5D,2DAA2D;AAW3D,SAAS,cAAc,CAAC,OAA2B;IAClD,OAAO,OAAO,CAAC,QAAQ,CAAC;IACxB,OAAO,OAAO,CAAC,SAAS,CAAC;IACzB,OAAO,OAAO,CAAC,aAAa,CAAC;IAC7B,OAAO,OAAO,CAAC,cAAc,CAAC;IAC9B,OAAO,OAAO,CAAC,gBAAgB,CAAC;AACjC,CAAC;AAqCD;;;GAGG;AACH,MAAa,MAAO,SAAQ,gCAAgC;IAQ3D;IACC,8FAA8F;IAC9E,aAA+C,EAC/C,MAA2B,EAC3C,OAAyC;QAEzC,KAAK,EAAE,CAAC;QAJQ,kBAAa,GAAb,aAAa,CAAkC;QAC/C,WAAM,GAAN,MAAM,CAAqB;QAN3B,oBAAe,GAAG,IAAI,0BAAY,CAAiB,+BAAc,CAAC,CAAC;QACnE,qBAAgB,GAAa,EAAE,CAAC;QA01BzC,4BAAuB,GAAG,CAAC,CAAC;QAj1BnC,IAAI,CAAC,UAAU,GAAG,IAAI,qBAAS,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,UAAU,CAAC,sBAAsB,GAAG,CAAC,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AC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;OAQG;IACH,eAAe,CAAC,QAAgB,EAAE,WAAmB,EAAE,QAAQ,GAAG,IAAI;QACrE,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnF,CAAC;CACD;AA5mCD,wBA4mCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\nimport { IFluidHandle, type IEventThisPlaceHolder } from \"@fluidframework/core-interfaces\";\nimport { IFluidSerializer } from \"@fluidframework/shared-object-base\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { ITelemetryLoggerExt, LoggingError, UsageError } from \"@fluidframework/telemetry-utils\";\nimport { DoublyLinkedList, RedBlackTree } from \"./collections\";\nimport { UnassignedSequenceNumber, UniversalSequenceNumber } from \"./constants\";\nimport { LocalReferencePosition, SlidingPreference } from \"./localReference\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tCollaborationWindow,\n\tcompareStrings,\n\tIMoveInfo,\n\tIMergeLeaf,\n\tISegment,\n\tISegmentAction,\n\tMarker,\n\t// eslint-disable-next-line import/no-deprecated\n\tSegmentGroup,\n} from \"./mergeTreeNodes\";\nimport {\n\tcreateAnnotateMarkerOp,\n\tcreateAnnotateRangeOp,\n\t// eslint-disable-next-line import/no-deprecated\n\tcreateGroupOp,\n\tcreateInsertSegmentOp,\n\tcreateObliterateRangeOp,\n\tcreateRemoveRangeOp,\n} from \"./opBuilder\";\nimport {\n\tIJSONSegment,\n\tIMergeTreeAnnotateMsg,\n\tIMergeTreeDeltaOp,\n\t// eslint-disable-next-line import/no-deprecated\n\tIMergeTreeGroupMsg,\n\tIMergeTreeInsertMsg,\n\tIMergeTreeRemoveMsg,\n\tIMergeTreeOp,\n\tIRelativePosition,\n\tMergeTreeDeltaType,\n\tReferenceType,\n\t// eslint-disable-next-line import/no-deprecated\n\tIMergeTreeObliterateMsg,\n} from \"./ops\";\nimport { PropertySet } from \"./properties\";\nimport { SnapshotLegacy } from \"./snapshotlegacy\";\nimport { SnapshotLoader } from \"./snapshotLoader\";\n// eslint-disable-next-line import/no-deprecated\nimport { IMergeTreeTextHelper } from \"./textSegment\";\nimport { SnapshotV1 } from \"./snapshotV1\";\nimport { ReferencePosition, DetachedReferencePosition } from \"./referencePositions\";\nimport { IMergeTreeOptions, MergeTree } from \"./mergeTree\";\nimport { MergeTreeTextHelper } from \"./MergeTreeTextHelper\";\nimport { walkAllChildSegments } from \"./mergeTreeNodeWalk\";\nimport {\n\tIMergeTreeClientSequenceArgs,\n\tIMergeTreeDeltaCallbackArgs,\n\tIMergeTreeDeltaOpArgs,\n\tIMergeTreeMaintenanceCallbackArgs,\n} from \"./index\";\n\ntype IMergeTreeDeltaRemoteOpArgs = Omit<IMergeTreeDeltaOpArgs, \"sequencedMessage\"> &\n\tRequired<Pick<IMergeTreeDeltaOpArgs, \"sequencedMessage\">>;\n\nfunction removeMoveInfo(segment: Partial<IMoveInfo>): void {\n\tdelete segment.movedSeq;\n\tdelete segment.movedSeqs;\n\tdelete segment.localMovedSeq;\n\tdelete segment.movedClientIds;\n\tdelete segment.wasMovedOnInsert;\n}\n\n/**\n * A range [start, end)\n * @internal\n */\nexport interface IIntegerRange {\n\tstart: number;\n\tend: number;\n}\n\n/**\n * Emitted before this client's merge-tree normalizes its segments on reconnect, potentially\n * ordering them. Useful for DDS-like consumers built atop the merge-tree to compute any information\n * they need for rebasing their ops on reconnection.\n * @alpha\n */\nexport interface IClientEvents {\n\t(event: \"normalize\", listener: (target: IEventThisPlaceHolder) => void): void;\n\t(\n\t\tevent: \"delta\",\n\t\tlistener: (\n\t\t\topArgs: IMergeTreeDeltaOpArgs,\n\t\t\tdeltaArgs: IMergeTreeDeltaCallbackArgs,\n\t\t\ttarget: IEventThisPlaceHolder,\n\t\t) => void,\n\t): void;\n\t(\n\t\tevent: \"maintenance\",\n\t\tlistener: (\n\t\t\targs: IMergeTreeMaintenanceCallbackArgs,\n\t\t\tdeltaArgs: IMergeTreeDeltaOpArgs | undefined,\n\t\t\ttarget: IEventThisPlaceHolder,\n\t\t) => void,\n\t): void;\n}\n\n/**\n * @deprecated This functionality was not meant to be exported and will be removed in a future release\n * @alpha\n */\nexport class Client extends TypedEventEmitter<IClientEvents> {\n\tpublic longClientId: string | undefined;\n\n\tprivate readonly _mergeTree: MergeTree;\n\n\tprivate readonly clientNameToIds = new RedBlackTree<string, number>(compareStrings);\n\tprivate readonly shortClientIdMap: string[] = [];\n\n\tconstructor(\n\t\t// Passing this callback would be unnecessary if Client were merged with SharedSegmentSequence\n\t\tpublic readonly specToSegment: (spec: IJSONSegment) => ISegment,\n\t\tpublic readonly logger: ITelemetryLoggerExt,\n\t\toptions?: IMergeTreeOptions & PropertySet,\n\t) {\n\t\tsuper();\n\t\tthis._mergeTree = new MergeTree(options);\n\t\tthis._mergeTree.mergeTreeDeltaCallback = (opArgs, deltaArgs) => {\n\t\t\tthis.emit(\"delta\", opArgs, deltaArgs, this);\n\t\t};\n\t\tthis._mergeTree.mergeTreeMaintenanceCallback = (args, opArgs) => {\n\t\t\tthis.emit(\"maintenance\", args, opArgs, this);\n\t\t};\n\n\t\tif (options?.attribution?.track) {\n\t\t\tconst policy = this._mergeTree?.attributionPolicy;\n\t\t\tif (policy === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Attribution policy must be provided when attribution tracking is requested.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tpolicy.attach(this);\n\t\t}\n\t}\n\n\t/**\n\t * The merge tree maintains a queue of segment groups for each local operation.\n\t * These segment groups track segments modified by an operation.\n\t * This method peeks the tail of that queue, and returns the segments groups there.\n\t * It is used to get the segment group(s) for the previous operations.\n\t * @param count - The number segment groups to get peek from the tail of the queue. Default 1.\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic peekPendingSegmentGroups(count: number = 1): SegmentGroup | SegmentGroup[] | undefined {\n\t\tconst pending = this._mergeTree.pendingSegments;\n\t\tlet node = pending?.last;\n\t\tif (count === 1 || pending === undefined) {\n\t\t\treturn node?.data;\n\t\t}\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tconst taken: SegmentGroup[] = new Array(Math.min(count, pending.length));\n\t\tfor (let i = taken.length - 1; i >= 0; i--) {\n\t\t\ttaken[i] = node!.data;\n\t\t\tnode = node!.prev;\n\t\t}\n\t\treturn taken;\n\t}\n\n\t/**\n\t * Annotates the markers with the provided properties\n\t * @param marker - The marker to annotate\n\t * @param props - The properties to annotate the marker with\n\t * @returns The annotate op if valid, otherwise undefined\n\t */\n\tpublic annotateMarker(marker: Marker, props: PropertySet): IMergeTreeAnnotateMsg | undefined {\n\t\tconst annotateOp = createAnnotateMarkerOp(marker, props)!;\n\t\tthis.applyAnnotateRangeOp({ op: annotateOp });\n\t\treturn annotateOp;\n\t}\n\n\t/**\n\t * Annotates the range with the provided properties\n\t * @param start - The inclusive start position of the range to annotate\n\t * @param end - The exclusive end position of the range to annotate\n\t * @param props - The properties to annotate the range with\n\t * @returns The annotate op if valid, otherwise undefined\n\t */\n\tpublic annotateRangeLocal(\n\t\tstart: number,\n\t\tend: number,\n\t\tprops: PropertySet,\n\t): IMergeTreeAnnotateMsg | undefined {\n\t\tconst annotateOp = createAnnotateRangeOp(start, end, props);\n\t\tthis.applyAnnotateRangeOp({ op: annotateOp });\n\t\treturn annotateOp;\n\t}\n\n\t/**\n\t * Removes the range\n\t *\n\t * @param start - The inclusive start of the range to remove\n\t * @param end - The exclusive end of the range to remove\n\t */\n\tpublic removeRangeLocal(start: number, end: number): IMergeTreeRemoveMsg {\n\t\tconst removeOp = createRemoveRangeOp(start, end);\n\t\tthis.applyRemoveRangeOp({ op: removeOp });\n\t\treturn removeOp;\n\t}\n\n\t/**\n\t * Obliterates the range. This is similar to removing the range, but also\n\t * includes any concurrently inserted content.\n\t *\n\t * @param start - The inclusive start of the range to obliterate\n\t * @param end - The exclusive end of the range to obliterate\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic obliterateRangeLocal(start: number, end: number): IMergeTreeObliterateMsg {\n\t\tconst obliterateOp = createObliterateRangeOp(start, end);\n\t\tthis.applyObliterateRangeOp({ op: obliterateOp });\n\t\treturn obliterateOp;\n\t}\n\n\t/**\n\t * @param pos - The position to insert the segment at\n\t * @param segment - The segment to insert\n\t */\n\tpublic insertSegmentLocal(pos: number, segment: ISegment): IMergeTreeInsertMsg | undefined {\n\t\tif (segment.cachedLength <= 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst insertOp = createInsertSegmentOp(pos, segment);\n\t\tif (this.applyInsertOp({ op: insertOp })) {\n\t\t\treturn insertOp;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * @param refPos - The reference position to insert the segment at\n\t * @param segment - The segment to insert\n\t */\n\tpublic insertAtReferencePositionLocal(\n\t\trefPos: ReferencePosition,\n\t\tsegment: ISegment,\n\t): IMergeTreeInsertMsg | undefined {\n\t\tconst pos = this._mergeTree.referencePositionToLocalPosition(\n\t\t\trefPos,\n\t\t\tthis.getCurrentSeq(),\n\t\t\tthis.getClientId(),\n\t\t);\n\n\t\tif (pos === DetachedReferencePosition) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst op = createInsertSegmentOp(pos, segment);\n\n\t\tif (this.applyInsertOp({ op })) {\n\t\t\treturn op;\n\t\t}\n\t}\n\n\tpublic walkSegments<TClientData>(\n\t\thandler: ISegmentAction<TClientData>,\n\t\tstart: number | undefined,\n\t\tend: number | undefined,\n\t\taccum: TClientData,\n\t\tsplitRange?: boolean,\n\t): void;\n\tpublic walkSegments<undefined>(\n\t\thandler: ISegmentAction<undefined>,\n\t\tstart?: number,\n\t\tend?: number,\n\t\taccum?: undefined,\n\t\tsplitRange?: boolean,\n\t): void;\n\tpublic walkSegments<TClientData>(\n\t\thandler: ISegmentAction<TClientData>,\n\t\tstart: number | undefined,\n\t\tend: number | undefined,\n\t\taccum: TClientData,\n\t\tsplitRange: boolean = false,\n\t): void {\n\t\tthis._mergeTree.mapRange(\n\t\t\thandler,\n\t\t\tthis.getCurrentSeq(),\n\t\t\tthis.getClientId(),\n\t\t\taccum,\n\t\t\tstart,\n\t\t\tend,\n\t\t\tsplitRange,\n\t\t);\n\t}\n\n\tprotected walkAllSegments<TClientData>(\n\t\taction: (segment: ISegment, accum?: TClientData) => boolean,\n\t\taccum?: TClientData,\n\t): boolean {\n\t\treturn walkAllChildSegments(\n\t\t\tthis._mergeTree.root,\n\t\t\taccum === undefined ? action : (seg) => action(seg, accum),\n\t\t);\n\t}\n\n\t/**\n\t * Serializes the data required for garbage collection. The IFluidHandles stored in all segments that haven't\n\t * been removed represent routes to other objects. We serialize the data in these segments using the passed in\n\t * serializer which keeps track of all serialized handles.\n\t */\n\tpublic serializeGCData(\n\t\thandle: IFluidHandle,\n\t\thandleCollectingSerializer: IFluidSerializer,\n\t): void {\n\t\tlet localInserts = 0;\n\t\tlet localRemoves = 0;\n\t\twalkAllChildSegments(this._mergeTree.root, (seg) => {\n\t\t\tif (seg.seq === UnassignedSequenceNumber) {\n\t\t\t\tlocalInserts++;\n\t\t\t}\n\t\t\tif (seg.removedSeq === UnassignedSequenceNumber) {\n\t\t\t\tlocalRemoves++;\n\t\t\t}\n\t\t\t// Only serialize segments that have not been removed.\n\t\t\tif (seg.removedSeq === undefined) {\n\t\t\t\thandleCollectingSerializer.stringify(seg.clone().toJSONObject(), handle);\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\n\t\tif (localInserts > 0 || localRemoves > 0) {\n\t\t\tthis.logger.sendErrorEvent({\n\t\t\t\teventName: \"LocalEditsInProcessGCData\",\n\t\t\t\tlocalInserts,\n\t\t\t\tlocalRemoves,\n\t\t\t});\n\t\t}\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic getCollabWindow(): CollaborationWindow {\n\t\treturn this._mergeTree.collabWindow;\n\t}\n\n\t/**\n\t * Returns the current position of a segment, and -1 if the segment\n\t * does not exist in this merge tree\n\t * @param segment - The segment to get the position of\n\t */\n\tpublic getPosition(segment: ISegment | undefined, localSeq?: number): number {\n\t\tconst mergeSegment: IMergeLeaf | undefined = segment;\n\t\tif (mergeSegment?.parent === undefined) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._mergeTree.getPosition(\n\t\t\tmergeSegment,\n\t\t\tthis.getCurrentSeq(),\n\t\t\tthis.getClientId(),\n\t\t\tlocalSeq,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a `LocalReferencePosition` on this client. If the refType does not include ReferenceType.Transient,\n\t * the returned reference will be added to the localRefs on the provided segment.\n\t * @param segment - Segment to add the local reference on\n\t * @param offset - Offset on the segment at which to place the local reference\n\t * @param refType - ReferenceType for the created local reference\n\t * @param properties - PropertySet to place on the created local reference\n\t * @param canSlideToEndpoint - Whether or not the created local reference can\n\t * slide onto one of the special endpoint segments denoting the position\n\t * before the start of or after the end of the tree\n\t */\n\tpublic createLocalReferencePosition(\n\t\tsegment: ISegment | \"start\" | \"end\",\n\t\toffset: number | undefined,\n\t\trefType: ReferenceType,\n\t\tproperties: PropertySet | undefined,\n\t\tslidingPreference?: SlidingPreference,\n\t\tcanSlideToEndpoint?: boolean,\n\t): LocalReferencePosition {\n\t\treturn this._mergeTree.createLocalReferencePosition(\n\t\t\tsegment,\n\t\t\toffset ?? 0,\n\t\t\trefType,\n\t\t\tproperties,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\n\t/**\n\t * Removes a `LocalReferencePosition` from this client.\n\t */\n\tpublic removeLocalReferencePosition(lref: LocalReferencePosition) {\n\t\treturn this._mergeTree.removeLocalReferencePosition(lref);\n\t}\n\n\t/**\n\t * Resolves a `ReferencePosition` into a character position using this client's perspective.\n\t */\n\tpublic localReferencePositionToPosition(lref: ReferencePosition): number {\n\t\treturn this._mergeTree.referencePositionToLocalPosition(lref);\n\t}\n\n\t/**\n\t * Given a position specified relative to a marker id, lookup the marker\n\t * and convert the position to a character position.\n\t * @param relativePos - Id of marker (may be indirect) and whether position is before or after marker.\n\t */\n\tpublic posFromRelativePos(relativePos: IRelativePosition) {\n\t\treturn this._mergeTree.posFromRelativePos(relativePos);\n\t}\n\n\tpublic getMarkerFromId(id: string): ISegment | undefined {\n\t\treturn this._mergeTree.getMarkerFromId(id);\n\t}\n\n\t/**\n\t * Revert an op\n\t */\n\tpublic rollback?(op: any, localOpMetadata: unknown) {\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tthis._mergeTree.rollback(op as IMergeTreeDeltaOp, localOpMetadata as SegmentGroup);\n\t}\n\n\tprivate applyObliterateRangeOp(opArgs: IMergeTreeDeltaOpArgs): void {\n\t\tassert(\n\t\t\topArgs.op.type === MergeTreeDeltaType.OBLITERATE,\n\t\t\t0x866 /* Unexpected op type on range obliterate! */,\n\t\t);\n\t\tconst op = opArgs.op;\n\t\tconst clientArgs = this.getClientSequenceArgs(opArgs);\n\t\tconst range = this.getValidOpRange(op, clientArgs);\n\n\t\tthis._mergeTree.obliterateRange(\n\t\t\trange.start,\n\t\t\trange.end,\n\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\tclientArgs.clientId,\n\t\t\tclientArgs.sequenceNumber,\n\t\t\tfalse,\n\t\t\topArgs,\n\t\t);\n\t}\n\n\t/**\n\t * Performs the remove based on the provided op\n\t * @param opArgs - The ops args for the op\n\t */\n\tprivate applyRemoveRangeOp(opArgs: IMergeTreeDeltaOpArgs): void {\n\t\tassert(\n\t\t\topArgs.op.type === MergeTreeDeltaType.REMOVE,\n\t\t\t0x02d /* \"Unexpected op type on range remove!\" */,\n\t\t);\n\t\tconst op = opArgs.op;\n\t\tconst clientArgs = this.getClientSequenceArgs(opArgs);\n\t\tconst range = this.getValidOpRange(op, clientArgs);\n\n\t\tthis._mergeTree.markRangeRemoved(\n\t\t\trange.start,\n\t\t\trange.end,\n\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\tclientArgs.clientId,\n\t\t\tclientArgs.sequenceNumber,\n\t\t\tfalse,\n\t\t\topArgs,\n\t\t);\n\t}\n\n\t/**\n\t * Performs the annotate based on the provided op\n\t * @param opArgs - The ops args for the op\n\t */\n\tprivate applyAnnotateRangeOp(opArgs: IMergeTreeDeltaOpArgs): void {\n\t\tassert(\n\t\t\topArgs.op.type === MergeTreeDeltaType.ANNOTATE,\n\t\t\t0x02e /* \"Unexpected op type on range annotate!\" */,\n\t\t);\n\t\tconst op = opArgs.op;\n\t\tconst clientArgs = this.getClientSequenceArgs(opArgs);\n\t\tconst range = this.getValidOpRange(op, clientArgs);\n\n\t\tthis._mergeTree.annotateRange(\n\t\t\trange.start,\n\t\t\trange.end,\n\t\t\top.props,\n\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\tclientArgs.clientId,\n\t\t\tclientArgs.sequenceNumber,\n\t\t\topArgs,\n\t\t);\n\t}\n\n\t/**\n\t * Performs the insert based on the provided op\n\t * @param opArgs - The ops args for the op\n\t * @returns True if the insert was applied. False if it could not be.\n\t */\n\tprivate applyInsertOp(opArgs: IMergeTreeDeltaOpArgs): boolean {\n\t\tassert(\n\t\t\topArgs.op.type === MergeTreeDeltaType.INSERT,\n\t\t\t0x02f /* \"Unexpected op type on range insert!\" */,\n\t\t);\n\t\tconst op = opArgs.op;\n\t\tconst clientArgs = this.getClientSequenceArgs(opArgs);\n\t\tconst range = this.getValidOpRange(op, clientArgs);\n\n\t\tlet segments: ISegment[] | undefined;\n\t\tif (op.seg) {\n\t\t\tsegments = [this.specToSegment(op.seg)];\n\t\t}\n\n\t\tif (!segments || segments.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._mergeTree.insertSegments(\n\t\t\trange.start,\n\t\t\tsegments,\n\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\tclientArgs.clientId,\n\t\t\tclientArgs.sequenceNumber,\n\t\t\topArgs,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns a valid range for the op, or undefined\n\t * @param op - The op to generate the range for\n\t * @param clientArgs - The client args for the op\n\t */\n\tprivate getValidOpRange(\n\t\top:\n\t\t\t| IMergeTreeAnnotateMsg\n\t\t\t| IMergeTreeInsertMsg\n\t\t\t| IMergeTreeRemoveMsg\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t| IMergeTreeObliterateMsg,\n\t\tclientArgs: IMergeTreeClientSequenceArgs,\n\t): IIntegerRange {\n\t\tlet start: number | undefined = op.pos1;\n\t\tif (start === undefined && op.relativePos1) {\n\t\t\tstart = this._mergeTree.posFromRelativePos(\n\t\t\t\top.relativePos1,\n\t\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\t\tclientArgs.clientId,\n\t\t\t);\n\t\t}\n\n\t\tlet end: number | undefined = op.pos2;\n\t\tif (end === undefined && op.relativePos2) {\n\t\t\tend = this._mergeTree.posFromRelativePos(\n\t\t\t\top.relativePos2,\n\t\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\t\tclientArgs.clientId,\n\t\t\t);\n\t\t}\n\n\t\t// Validate if local op\n\t\tif (clientArgs.clientId === this.getClientId()) {\n\t\t\tconst length = this.getLength();\n\n\t\t\tconst invalidPositions: string[] = [];\n\n\t\t\t// Validate start position\n\t\t\t//\n\t\t\tif (\n\t\t\t\tstart === undefined ||\n\t\t\t\tstart < 0 ||\n\t\t\t\tstart > length ||\n\t\t\t\t(start === length && op.type !== MergeTreeDeltaType.INSERT)\n\t\t\t) {\n\t\t\t\tinvalidPositions.push(\"start\");\n\t\t\t}\n\t\t\t// Validate end if not insert, or insert has end\n\t\t\t//\n\t\t\tif (op.type !== MergeTreeDeltaType.INSERT || end !== undefined) {\n\t\t\t\tif (end === undefined || end <= start!) {\n\t\t\t\t\tinvalidPositions.push(\"end\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (op.type === MergeTreeDeltaType.OBLITERATE && end !== undefined && end > length) {\n\t\t\t\tinvalidPositions.push(\"end\");\n\t\t\t}\n\n\t\t\tif (invalidPositions.length > 0) {\n\t\t\t\tthrow new LoggingError(\"RangeOutOfBounds\", {\n\t\t\t\t\tusageError: true,\n\t\t\t\t\tend,\n\t\t\t\t\tinvalidPositions: invalidPositions.toString(),\n\t\t\t\t\tlength,\n\t\t\t\t\topPos1: op.pos1,\n\t\t\t\t\topPos1Relative: op.relativePos1 !== undefined,\n\t\t\t\t\topPos2: op.pos2,\n\t\t\t\t\topPos2Relative: op.relativePos2 !== undefined,\n\t\t\t\t\topType: op.type,\n\t\t\t\t\tstart,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// start and end are guaranteed to be non-null here, otherwise we throw above.\n\t\treturn { start: start!, end: end! };\n\t}\n\n\t/**\n\t * Gets the client args from the op if remote, otherwise uses the local clients info\n\t * @param sequencedMessage - The sequencedMessage to get the client sequence args for\n\t */\n\tprivate getClientSequenceArgsForMessage(\n\t\tsequencedMessage:\n\t\t\t| ISequencedDocumentMessage\n\t\t\t| Pick<ISequencedDocumentMessage, \"referenceSequenceNumber\" | \"clientId\">\n\t\t\t| undefined,\n\t) {\n\t\t// If there this no sequenced message, then the op is local\n\t\t// and unacked, so use this clients sequenced args\n\t\t//\n\t\tif (!sequencedMessage) {\n\t\t\tconst segWindow = this.getCollabWindow();\n\t\t\treturn {\n\t\t\t\tclientId: segWindow.clientId,\n\t\t\t\treferenceSequenceNumber: segWindow.currentSeq,\n\t\t\t\tsequenceNumber: this.getLocalSequenceNumber(),\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tclientId: this.getOrAddShortClientIdFromMessage(sequencedMessage),\n\t\t\t\treferenceSequenceNumber: sequencedMessage.referenceSequenceNumber,\n\t\t\t\t// Note: return value satisfies overload signatures despite the cast, as if input argument doesn't contain sequenceNumber,\n\t\t\t\t// return value isn't expected to have it either.\n\t\t\t\tsequenceNumber: (sequencedMessage as ISequencedDocumentMessage).sequenceNumber,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Gets the client args from the op if remote, otherwise uses the local clients info\n\t * @param opArgs - The op arg to get the client sequence args for\n\t */\n\tprivate getClientSequenceArgs(opArgs: IMergeTreeDeltaOpArgs): IMergeTreeClientSequenceArgs {\n\t\treturn this.getClientSequenceArgsForMessage(opArgs.sequencedMessage);\n\t}\n\n\tprivate ackPendingSegment(opArgs: IMergeTreeDeltaRemoteOpArgs) {\n\t\tif (opArgs.op.type === MergeTreeDeltaType.GROUP) {\n\t\t\tfor (const memberOp of opArgs.op.ops) {\n\t\t\t\tthis._mergeTree.ackPendingSegment({\n\t\t\t\t\tgroupOp: opArgs.op,\n\t\t\t\t\top: memberOp,\n\t\t\t\t\tsequencedMessage: opArgs.sequencedMessage,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis._mergeTree.ackPendingSegment(opArgs);\n\t\t}\n\t}\n\n\tgetOrAddShortClientId(longClientId: string) {\n\t\tif (!this.clientNameToIds.get(longClientId)) {\n\t\t\tthis.addLongClientId(longClientId);\n\t\t}\n\t\treturn this.getShortClientId(longClientId);\n\t}\n\n\tprotected getShortClientId(longClientId: string) {\n\t\treturn this.clientNameToIds.get(longClientId)!.data;\n\t}\n\n\tgetLongClientId(shortClientId: number) {\n\t\treturn shortClientId >= 0 ? this.shortClientIdMap[shortClientId] : \"original\";\n\t}\n\n\taddLongClientId(longClientId: string) {\n\t\tthis.clientNameToIds.put(longClientId, this.shortClientIdMap.length);\n\t\tthis.shortClientIdMap.push(longClientId);\n\t}\n\n\tprivate getOrAddShortClientIdFromMessage(msg: Pick<ISequencedDocumentMessage, \"clientId\">) {\n\t\treturn this.getOrAddShortClientId(msg.clientId ?? \"server\");\n\t}\n\n\t/**\n\t * During reconnect, we must find the positions to pending segments\n\t * relative to other pending segments. This methods computes that\n\t * position relative to a localSeq. Pending segments above the localSeq\n\t * will be ignored.\n\t *\n\t * @param segment - The segment to find the position for\n\t * @param localSeq - The localSeq to find the position of the segment at\n\t */\n\tpublic findReconnectionPosition(segment: ISegment, localSeq: number) {\n\t\tassert(\n\t\t\tlocalSeq <= this._mergeTree.collabWindow.localSeq,\n\t\t\t0x032 /* \"localSeq greater than collab window\" */,\n\t\t);\n\t\tconst { currentSeq, clientId } = this.getCollabWindow();\n\t\treturn this._mergeTree.getPosition(segment, currentSeq, clientId, localSeq);\n\t}\n\n\tprivate resetPendingDeltaToOps(\n\t\tresetOp: IMergeTreeDeltaOp,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tsegmentGroup: SegmentGroup,\n\t): IMergeTreeDeltaOp[] {\n\t\tassert(!!segmentGroup, 0x033 /* \"Segment group undefined\" */);\n\t\tconst NACKedSegmentGroup = this.pendingRebase?.shift()?.data;\n\t\tassert(\n\t\t\tsegmentGroup === NACKedSegmentGroup,\n\t\t\t0x034 /* \"Segment group not at head of pending rebase queue\" */,\n\t\t);\n\t\tif (this.pendingRebase?.empty) {\n\t\t\tthis.pendingRebase = undefined;\n\t\t}\n\n\t\t// if this is an obliterate op, keep all segments in same segment group\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tconst obliterateSegmentGroup: SegmentGroup = {\n\t\t\tsegments: [],\n\t\t\tlocalSeq: segmentGroup.localSeq,\n\t\t\trefSeq: this.getCollabWindow().currentSeq,\n\t\t};\n\n\t\tconst opList: IMergeTreeDeltaOp[] = [];\n\t\t// We need to sort the segments by ordinal, as the segments are not sorted in the segment group.\n\t\t// The reason they need them sorted, as they have the same local sequence number and which means\n\t\t// farther segments will take into account nearer segments when calculating their position.\n\t\t// By sorting we ensure the nearer segment will be applied and sequenced before the farther segments\n\t\t// so their recalculated positions will be correct.\n\t\tfor (const segment of segmentGroup.segments.sort((a, b) =>\n\t\t\ta.ordinal < b.ordinal ? -1 : 1,\n\t\t)) {\n\t\t\tconst segmentSegGroup = segment.segmentGroups.dequeue();\n\t\t\tassert(\n\t\t\t\tsegmentGroup === segmentSegGroup,\n\t\t\t\t0x035 /* \"Segment group not at head of segment pending queue\" */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tsegmentGroup.localSeq !== undefined,\n\t\t\t\t0x867 /* expected segment group localSeq to be defined */,\n\t\t\t);\n\t\t\tconst segmentPosition = this.findReconnectionPosition(segment, segmentGroup.localSeq);\n\t\t\tlet newOp: IMergeTreeDeltaOp | undefined;\n\t\t\tswitch (resetOp.type) {\n\t\t\t\tcase MergeTreeDeltaType.ANNOTATE:\n\t\t\t\t\tassert(\n\t\t\t\t\t\tsegment.propertyManager?.hasPendingProperties() === true,\n\t\t\t\t\t\t0x036 /* \"Segment has no pending properties\" */,\n\t\t\t\t\t);\n\t\t\t\t\t// if the segment has been removed or obliterated, there's no need to send the annotate op\n\t\t\t\t\t// unless the remove was local, in which case the annotate must have come\n\t\t\t\t\t// before the remove\n\t\t\t\t\tif (\n\t\t\t\t\t\t(segment.removedSeq === undefined ||\n\t\t\t\t\t\t\t(segment.localRemovedSeq !== undefined &&\n\t\t\t\t\t\t\t\tsegment.removedSeq === UnassignedSequenceNumber)) &&\n\t\t\t\t\t\t(segment.movedSeq === undefined ||\n\t\t\t\t\t\t\t(segment.localMovedSeq !== undefined &&\n\t\t\t\t\t\t\t\tsegment.movedSeq === UnassignedSequenceNumber))\n\t\t\t\t\t) {\n\t\t\t\t\t\tnewOp = createAnnotateRangeOp(\n\t\t\t\t\t\t\tsegmentPosition,\n\t\t\t\t\t\t\tsegmentPosition + segment.cachedLength,\n\t\t\t\t\t\t\tresetOp.props,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MergeTreeDeltaType.INSERT:\n\t\t\t\t\tassert(\n\t\t\t\t\t\tsegment.seq === UnassignedSequenceNumber,\n\t\t\t\t\t\t0x037 /* \"Segment already has assigned sequence number\" */,\n\t\t\t\t\t);\n\t\t\t\t\tlet segInsertOp = segment;\n\t\t\t\t\tif (typeof resetOp.seg === \"object\" && resetOp.seg.props !== undefined) {\n\t\t\t\t\t\tsegInsertOp = segment.clone();\n\t\t\t\t\t\tsegInsertOp.properties = resetOp.seg.props;\n\t\t\t\t\t}\n\t\t\t\t\tif (segment.movedSeq !== UnassignedSequenceNumber) {\n\t\t\t\t\t\tremoveMoveInfo(segment);\n\t\t\t\t\t}\n\t\t\t\t\tnewOp = createInsertSegmentOp(segmentPosition, segInsertOp);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MergeTreeDeltaType.REMOVE:\n\t\t\t\t\tif (\n\t\t\t\t\t\tsegment.localRemovedSeq !== undefined &&\n\t\t\t\t\t\tsegment.removedSeq === UnassignedSequenceNumber &&\n\t\t\t\t\t\t(segment.movedSeq === undefined ||\n\t\t\t\t\t\t\t(segment.localMovedSeq !== undefined &&\n\t\t\t\t\t\t\t\tsegment.movedSeq === UnassignedSequenceNumber))\n\t\t\t\t\t) {\n\t\t\t\t\t\tnewOp = createRemoveRangeOp(\n\t\t\t\t\t\t\tsegmentPosition,\n\t\t\t\t\t\t\tsegmentPosition + segment.cachedLength,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase MergeTreeDeltaType.OBLITERATE:\n\t\t\t\t\tif (\n\t\t\t\t\t\tsegment.localMovedSeq !== undefined &&\n\t\t\t\t\t\tsegment.movedSeq === UnassignedSequenceNumber &&\n\t\t\t\t\t\t(segment.removedSeq === undefined ||\n\t\t\t\t\t\t\t(segment.localRemovedSeq !== undefined &&\n\t\t\t\t\t\t\t\tsegment.removedSeq === UnassignedSequenceNumber))\n\t\t\t\t\t) {\n\t\t\t\t\t\tnewOp = createObliterateRangeOp(\n\t\t\t\t\t\t\tsegmentPosition,\n\t\t\t\t\t\t\tsegmentPosition + segment.cachedLength,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`Invalid op type`);\n\t\t\t}\n\n\t\t\tif (newOp && resetOp.type === MergeTreeDeltaType.OBLITERATE) {\n\t\t\t\tsegment.segmentGroups.enqueue(obliterateSegmentGroup);\n\n\t\t\t\tconst first = opList[0];\n\n\t\t\t\tif (!!first && first.pos2 !== undefined) {\n\t\t\t\t\tfirst.pos2 += newOp.pos2! - newOp.pos1!;\n\t\t\t\t} else {\n\t\t\t\t\topList.push(newOp);\n\t\t\t\t}\n\t\t\t} else if (newOp) {\n\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\tconst newSegmentGroup: SegmentGroup = {\n\t\t\t\t\tsegments: [],\n\t\t\t\t\tlocalSeq: segmentGroup.localSeq,\n\t\t\t\t\trefSeq: this.getCollabWindow().currentSeq,\n\t\t\t\t};\n\t\t\t\tsegment.segmentGroups.enqueue(newSegmentGroup);\n\n\t\t\t\tthis._mergeTree.pendingSegments.push(newSegmentGroup);\n\n\t\t\t\topList.push(newOp);\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tresetOp.type === MergeTreeDeltaType.OBLITERATE &&\n\t\t\tobliterateSegmentGroup.segments.length > 0\n\t\t) {\n\t\t\tthis._mergeTree.pendingSegments.push(obliterateSegmentGroup);\n\t\t}\n\n\t\treturn opList;\n\t}\n\n\tprivate applyRemoteOp(opArgs: IMergeTreeDeltaRemoteOpArgs) {\n\t\tconst op = opArgs.op;\n\t\tconst msg = opArgs.sequencedMessage;\n\t\tthis.getOrAddShortClientIdFromMessage(msg);\n\t\tswitch (op.type) {\n\t\t\tcase MergeTreeDeltaType.INSERT:\n\t\t\t\tthis.applyInsertOp(opArgs);\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.REMOVE:\n\t\t\t\tthis.applyRemoveRangeOp(opArgs);\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.ANNOTATE:\n\t\t\t\tthis.applyAnnotateRangeOp(opArgs);\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.OBLITERATE:\n\t\t\t\tthis.applyObliterateRangeOp(opArgs);\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.GROUP: {\n\t\t\t\tfor (const memberOp of op.ops) {\n\t\t\t\t\tthis.applyRemoteOp({\n\t\t\t\t\t\top: memberOp,\n\t\t\t\t\t\tgroupOp: op,\n\t\t\t\t\t\tsequencedMessage: msg,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic applyStashedOp(op: IMergeTreeDeltaOp): SegmentGroup;\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic applyStashedOp(op: IMergeTreeGroupMsg): SegmentGroup[];\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic applyStashedOp(op: IMergeTreeOp): SegmentGroup | SegmentGroup[];\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic applyStashedOp(op: IMergeTreeOp): SegmentGroup | SegmentGroup[] {\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tlet metadata: SegmentGroup | SegmentGroup[] | undefined;\n\t\tconst stashed = true;\n\t\tswitch (op.type) {\n\t\t\tcase MergeTreeDeltaType.INSERT:\n\t\t\t\tthis.applyInsertOp({ op, stashed });\n\t\t\t\tmetadata = this.peekPendingSegmentGroups();\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.REMOVE:\n\t\t\t\tthis.applyRemoveRangeOp({ op, stashed });\n\t\t\t\tmetadata = this.peekPendingSegmentGroups();\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.ANNOTATE:\n\t\t\t\tthis.applyAnnotateRangeOp({ op, stashed });\n\t\t\t\tmetadata = this.peekPendingSegmentGroups();\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.OBLITERATE:\n\t\t\t\tthis.applyObliterateRangeOp({ op });\n\t\t\t\tmetadata = this.peekPendingSegmentGroups();\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.GROUP:\n\t\t\t\treturn op.ops.map((o) => this.applyStashedOp(o));\n\t\t\tdefault:\n\t\t\t\tunreachableCase(op, \"unrecognized op type\");\n\t\t}\n\t\tassert(!!metadata, 0x2db /* \"Applying op must generate a pending segment\" */);\n\t\treturn metadata;\n\t}\n\n\tpublic applyMsg(msg: ISequencedDocumentMessage, local: boolean = false) {\n\t\t// Ensure client ID is registered\n\t\tthis.getOrAddShortClientIdFromMessage(msg);\n\t\t// Apply if an operation message\n\t\tif (msg.type === MessageType.Operation) {\n\t\t\tconst opArgs: IMergeTreeDeltaRemoteOpArgs = {\n\t\t\t\top: msg.contents as IMergeTreeOp,\n\t\t\t\tsequencedMessage: msg,\n\t\t\t};\n\t\t\tif (opArgs.sequencedMessage?.clientId === this.longClientId || local) {\n\t\t\t\tthis.ackPendingSegment(opArgs);\n\t\t\t} else {\n\t\t\t\tthis.applyRemoteOp(opArgs);\n\t\t\t}\n\t\t}\n\n\t\tthis.updateSeqNumbers(msg.minimumSequenceNumber, msg.sequenceNumber);\n\t}\n\n\tprivate updateSeqNumbers(min: number, seq: number) {\n\t\tconst collabWindow = this.getCollabWindow();\n\t\t// Equal is fine here due to SharedSegmentSequence<>.snapshotContent() potentially updating with same #\n\t\tassert(\n\t\t\tcollabWindow.currentSeq <= seq,\n\t\t\t0x038 /* \"Incoming op sequence# < local collabWindow's currentSequence#\" */,\n\t\t);\n\t\tcollabWindow.currentSeq = seq;\n\t\tassert(min <= seq, 0x039 /* \"Incoming op sequence# < minSequence#\" */);\n\t\tthis.updateMinSeq(min);\n\t}\n\n\t/**\n\t * Resolves a remote client's position against the local sequence\n\t * and returns the remote client's position relative to the local\n\t * sequence\n\t * @param remoteClientPosition - The remote client's position to resolve\n\t * @param remoteClientRefSeq - The reference sequence number of the remote client\n\t * @param remoteClientId - The client id of the remote client\n\t */\n\tpublic resolveRemoteClientPosition(\n\t\tremoteClientPosition: number,\n\t\tremoteClientRefSeq: number,\n\t\tremoteClientId: string,\n\t): number | undefined {\n\t\tconst shortRemoteClientId = this.getOrAddShortClientId(remoteClientId);\n\t\treturn this._mergeTree.resolveRemoteClientPosition(\n\t\t\tremoteClientPosition,\n\t\t\tremoteClientRefSeq,\n\t\t\tshortRemoteClientId,\n\t\t);\n\t}\n\n\tprivate lastNormalizationRefSeq = 0;\n\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate pendingRebase: DoublyLinkedList<SegmentGroup> | undefined;\n\n\t/**\n\t * Given a pending operation and segment group, regenerate the op, so it\n\t * can be resubmitted\n\t * @param resetOp - The op to reset\n\t * @param segmentGroup - The segment group associated with the op\n\t */\n\tpublic regeneratePendingOp(\n\t\tresetOp: IMergeTreeOp,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tsegmentGroup: SegmentGroup | SegmentGroup[],\n\t): IMergeTreeOp {\n\t\tif (this.pendingRebase === undefined || this.pendingRebase.empty) {\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tlet firstGroup: SegmentGroup;\n\t\t\tif (Array.isArray(segmentGroup)) {\n\t\t\t\tif (segmentGroup.length === 0) {\n\t\t\t\t\t// sometimes we rebase to an empty op\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\treturn createGroupOp();\n\t\t\t\t}\n\t\t\t\tfirstGroup = segmentGroup[0];\n\t\t\t} else {\n\t\t\t\tfirstGroup = segmentGroup;\n\t\t\t}\n\t\t\tconst firstGroupNode = this._mergeTree.pendingSegments.find(\n\t\t\t\t(node) => node.data === firstGroup,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tfirstGroupNode !== undefined,\n\t\t\t\t0x70e /* segment group must exist in pending list */,\n\t\t\t);\n\t\t\tthis.pendingRebase = this._mergeTree.pendingSegments.splice(firstGroupNode);\n\t\t}\n\n\t\tconst rebaseTo = this.getCollabWindow().currentSeq;\n\t\tif (rebaseTo !== this.lastNormalizationRefSeq) {\n\t\t\tthis.emit(\"normalize\", this);\n\t\t\tthis._mergeTree.normalizeSegmentsOnRebase();\n\t\t\tthis.lastNormalizationRefSeq = rebaseTo;\n\t\t}\n\n\t\tconst opList: IMergeTreeDeltaOp[] = [];\n\t\tif (resetOp.type === MergeTreeDeltaType.GROUP) {\n\t\t\tif (Array.isArray(segmentGroup)) {\n\t\t\t\tassert(\n\t\t\t\t\tresetOp.ops.length === segmentGroup.length,\n\t\t\t\t\t0x03a /* \"Number of ops in 'resetOp' must match the number of segment groups provided.\" */,\n\t\t\t\t);\n\n\t\t\t\tfor (let i = 0; i < resetOp.ops.length; i++) {\n\t\t\t\t\topList.push(...this.resetPendingDeltaToOps(resetOp.ops[i], segmentGroup[i]));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// A group op containing a single op will pass a direct reference to 'segmentGroup'\n\t\t\t\t// rather than an array of segment groups. (See 'peekPendingSegmentGroups()')\n\t\t\t\tassert(\n\t\t\t\t\tresetOp.ops.length === 1,\n\t\t\t\t\t0x03b /* \"Number of ops in 'resetOp' must match the number of segment groups provided.\" */,\n\t\t\t\t);\n\t\t\t\topList.push(...this.resetPendingDeltaToOps(resetOp.ops[0], segmentGroup));\n\t\t\t}\n\t\t} else {\n\t\t\tassert(\n\t\t\t\t(resetOp.type as any) !== MergeTreeDeltaType.GROUP,\n\t\t\t\t0x03c /* \"Reset op has 'group' delta type!\" */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\t!Array.isArray(segmentGroup),\n\t\t\t\t0x03d /* \"segmentGroup is array rather than singleton!\" */,\n\t\t\t);\n\t\t\topList.push(...this.resetPendingDeltaToOps(resetOp, segmentGroup));\n\t\t}\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\treturn opList.length === 1 ? opList[0] : createGroupOp(...opList);\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic createTextHelper(): IMergeTreeTextHelper {\n\t\treturn new MergeTreeTextHelper(this._mergeTree);\n\t}\n\n\tpublic summarize(\n\t\truntime: IFluidDataStoreRuntime,\n\t\thandle: IFluidHandle,\n\t\tserializer: IFluidSerializer,\n\t\tcatchUpMsgs: ISequencedDocumentMessage[],\n\t): ISummaryTreeWithStats {\n\t\tconst deltaManager = runtime.deltaManager;\n\t\tconst minSeq = deltaManager.minimumSequenceNumber;\n\n\t\t// Catch up to latest MSN, if we have not had a chance to do it.\n\t\t// Required for case where FluidDataStoreRuntime.attachChannel()\n\t\t// generates summary right after loading data store.\n\n\t\tthis.updateSeqNumbers(minSeq, deltaManager.lastSequenceNumber);\n\n\t\t// One of the summaries (from SPO) I observed to have chunk.chunkSequenceNumber > minSeq!\n\t\t// Not sure why - need to catch it sooner\n\t\tassert(\n\t\t\tthis.getCollabWindow().minSeq === minSeq,\n\t\t\t0x03e /* \"minSeq mismatch between collab window and delta manager!\" */,\n\t\t);\n\n\t\t// Must continue to support legacy\n\t\t// (See https://github.com/microsoft/FluidFramework/issues/84)\n\t\tif (this._mergeTree.options?.newMergeTreeSnapshotFormat === true) {\n\t\t\tassert(\n\t\t\t\tcatchUpMsgs === undefined || catchUpMsgs.length === 0,\n\t\t\t\t0x03f /* \"New format should not emit catchup ops\" */,\n\t\t\t);\n\t\t\tconst snap = new SnapshotV1(this._mergeTree, this.logger, (id) =>\n\t\t\t\tthis.getLongClientId(id),\n\t\t\t);\n\t\t\tsnap.extractSync();\n\t\t\treturn snap.emit(serializer, handle);\n\t\t} else {\n\t\t\tconst snap = new SnapshotLegacy(this._mergeTree, this.logger);\n\t\t\tsnap.extractSync();\n\t\t\treturn snap.emit(catchUpMsgs, serializer, handle);\n\t\t}\n\t}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tstorage: IChannelStorageService,\n\t\tserializer: IFluidSerializer,\n\t): Promise<{ catchupOpsP: Promise<ISequencedDocumentMessage[]> }> {\n\t\tconst loader = new SnapshotLoader(runtime, this, this._mergeTree, this.logger, serializer);\n\n\t\treturn loader.initialize(storage);\n\t}\n\n\tprivate getLocalSequenceNumber() {\n\t\tconst segWindow = this.getCollabWindow();\n\t\treturn segWindow.collaborating ? UnassignedSequenceNumber : UniversalSequenceNumber;\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tlocalTransaction(groupOp: IMergeTreeGroupMsg) {\n\t\tfor (const op of groupOp.ops) {\n\t\t\tconst opArgs: IMergeTreeDeltaOpArgs = {\n\t\t\t\top,\n\t\t\t\tgroupOp,\n\t\t\t};\n\t\t\tswitch (op.type) {\n\t\t\t\tcase MergeTreeDeltaType.INSERT:\n\t\t\t\t\tthis.applyInsertOp(opArgs);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MergeTreeDeltaType.ANNOTATE:\n\t\t\t\t\tthis.applyAnnotateRangeOp(opArgs);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MergeTreeDeltaType.REMOVE:\n\t\t\t\t\tthis.applyRemoveRangeOp(opArgs);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MergeTreeDeltaType.OBLITERATE:\n\t\t\t\t\tthis.applyObliterateRangeOp(opArgs);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tupdateMinSeq(minSeq: number) {\n\t\tthis._mergeTree.setMinSeq(minSeq);\n\t}\n\n\tgetContainingSegment<T extends ISegment>(\n\t\tpos: number,\n\t\tsequenceArgs?: Pick<ISequencedDocumentMessage, \"referenceSequenceNumber\" | \"clientId\">,\n\t\tlocalSeq?: number,\n\t) {\n\t\tconst { referenceSequenceNumber, clientId } =\n\t\t\tthis.getClientSequenceArgsForMessage(sequenceArgs);\n\t\treturn this._mergeTree.getContainingSegment<T>(\n\t\t\tpos,\n\t\t\treferenceSequenceNumber,\n\t\t\tclientId,\n\t\t\tlocalSeq,\n\t\t);\n\t}\n\n\tgetPropertiesAtPosition(pos: number) {\n\t\tlet propertiesAtPosition: PropertySet | undefined;\n\t\tconst segoff = this.getContainingSegment(pos);\n\t\tconst seg = segoff.segment;\n\t\tif (seg) {\n\t\t\tpropertiesAtPosition = seg.properties;\n\t\t}\n\t\treturn propertiesAtPosition;\n\t}\n\n\tgetRangeExtentsOfPosition(pos: number) {\n\t\tlet posStart: number | undefined;\n\t\tlet posAfterEnd: number | undefined;\n\n\t\tconst segoff = this.getContainingSegment(pos);\n\t\tconst seg = segoff.segment;\n\t\tif (seg) {\n\t\t\tposStart = this.getPosition(seg);\n\t\t\tposAfterEnd = posStart + seg.cachedLength;\n\t\t}\n\t\treturn { posStart, posAfterEnd };\n\t}\n\n\tgetCurrentSeq() {\n\t\treturn this.getCollabWindow().currentSeq;\n\t}\n\n\tgetClientId() {\n\t\treturn this.getCollabWindow().clientId;\n\t}\n\n\tgetLength() {\n\t\treturn this._mergeTree.length ?? 0;\n\t}\n\n\tstartOrUpdateCollaboration(longClientId: string | undefined, minSeq = 0, currentSeq = 0) {\n\t\t// we should always have a client id if we are collaborating\n\t\t// if the client id is undefined we are likely bound to a detached\n\t\t// container, so we should keep going in local mode. once\n\t\t// the container attaches this will be called again on connect with the\n\t\t// client id\n\t\tif (longClientId !== undefined) {\n\t\t\tif (this.longClientId === undefined) {\n\t\t\t\tthis.longClientId = longClientId;\n\t\t\t\tthis.addLongClientId(this.longClientId);\n\t\t\t\tthis._mergeTree.startCollaboration(\n\t\t\t\t\tthis.getShortClientId(this.longClientId),\n\t\t\t\t\tminSeq,\n\t\t\t\t\tcurrentSeq,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst oldClientId = this.longClientId;\n\t\t\t\tconst oldData = this.clientNameToIds.get(oldClientId)!.data;\n\t\t\t\tthis.longClientId = longClientId;\n\t\t\t\tthis.clientNameToIds.put(longClientId, oldData);\n\t\t\t\tthis.shortClientIdMap[oldData] = longClientId;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @deprecated Use searchForMarker instead.\n\t */\n\tfindTile(startPos: number, tileLabel: string, preceding = true) {\n\t\tconst clientId = this.getClientId();\n\t\treturn this._mergeTree.findTile(startPos, clientId, tileLabel, preceding);\n\t}\n\n\t/**\n\t * Searches a string for the nearest marker in either direction to a given start position.\n\t * The search will include the start position, so markers at the start position are valid\n\t * results of the search. Makes use of block-accelerated search functions for log(n) complexity.\n\t *\n\t * @param startPos - Position at which to start the search\n\t * @param markerLabel - Label of the marker to search for\n\t * @param forwards - Whether the desired marker comes before (false) or after (true) `startPos`\n\t */\n\tsearchForMarker(startPos: number, markerLabel: string, forwards = true) {\n\t\tconst clientId = this.getClientId();\n\t\treturn this._mergeTree.searchForMarker(startPos, clientId, markerLabel, forwards);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,+EAA8F;AAM9F,2DAAqE;AACrE,+DAAiE;AACjE,qEAAgG;AAChG,+CAA+D;AAC/D,2CAAgF;AAEhF,qDAW0B;AAC1B,2CAQqB;AACrB,+BAce;AAEf,qDAAkD;AAClD,qDAAkD;AAGlD,6CAA0C;AAC1C,6DAAoF;AACpF,2CAA2D;AAC3D,+DAA4D;AAC5D,2DAA2D;AAW3D,SAAS,cAAc,CAAC,OAA2B;IAClD,OAAO,OAAO,CAAC,QAAQ,CAAC;IACxB,OAAO,OAAO,CAAC,SAAS,CAAC;IACzB,OAAO,OAAO,CAAC,aAAa,CAAC;IAC7B,OAAO,OAAO,CAAC,cAAc,CAAC;IAC9B,OAAO,OAAO,CAAC,gBAAgB,CAAC;AACjC,CAAC;AAqCD;;;GAGG;AACH,MAAa,MAAO,SAAQ,gCAAgC;IAQ3D;IACC,8FAA8F;IAC9E,aAA+C,EAC/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AC,YAAY,GAAG,YAAY,CAAC;gBACjC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;gBAChD,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC;aAC9C;SACD;IACF,CAAC;IAED;;;;;;;;OAQG;IACH,eAAe,CAAC,QAAgB,EAAE,WAAmB,EAAE,QAAQ,GAAG,IAAI;QACrE,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnF,CAAC;CACD;AApmCD,wBAomCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\n\nimport { IFluidHandle, type IEventThisPlaceHolder } from \"@fluidframework/core-interfaces\";\nimport { IFluidSerializer } from \"@fluidframework/shared-object-base\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { ITelemetryLoggerExt, LoggingError, UsageError } from \"@fluidframework/telemetry-utils\";\nimport { DoublyLinkedList, RedBlackTree } from \"./collections\";\nimport { UnassignedSequenceNumber, UniversalSequenceNumber } from \"./constants\";\nimport { LocalReferencePosition, SlidingPreference } from \"./localReference\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tCollaborationWindow,\n\tcompareStrings,\n\tIMoveInfo,\n\tIMergeLeaf,\n\tISegment,\n\tISegmentAction,\n\tMarker,\n\t// eslint-disable-next-line import/no-deprecated\n\tSegmentGroup,\n} from \"./mergeTreeNodes\";\nimport {\n\tcreateAnnotateMarkerOp,\n\tcreateAnnotateRangeOp,\n\t// eslint-disable-next-line import/no-deprecated\n\tcreateGroupOp,\n\tcreateInsertSegmentOp,\n\tcreateObliterateRangeOp,\n\tcreateRemoveRangeOp,\n} from \"./opBuilder\";\nimport {\n\tIJSONSegment,\n\tIMergeTreeAnnotateMsg,\n\tIMergeTreeDeltaOp,\n\t// eslint-disable-next-line import/no-deprecated\n\tIMergeTreeGroupMsg,\n\tIMergeTreeInsertMsg,\n\tIMergeTreeRemoveMsg,\n\tIMergeTreeOp,\n\tIRelativePosition,\n\tMergeTreeDeltaType,\n\tReferenceType,\n\t// eslint-disable-next-line import/no-deprecated\n\tIMergeTreeObliterateMsg,\n} from \"./ops\";\nimport { PropertySet } from \"./properties\";\nimport { SnapshotLegacy } from \"./snapshotlegacy\";\nimport { SnapshotLoader } from \"./snapshotLoader\";\n// eslint-disable-next-line import/no-deprecated\nimport { IMergeTreeTextHelper } from \"./textSegment\";\nimport { SnapshotV1 } from \"./snapshotV1\";\nimport { ReferencePosition, DetachedReferencePosition } from \"./referencePositions\";\nimport { IMergeTreeOptions, MergeTree } from \"./mergeTree\";\nimport { MergeTreeTextHelper } from \"./MergeTreeTextHelper\";\nimport { walkAllChildSegments } from \"./mergeTreeNodeWalk\";\nimport {\n\tIMergeTreeClientSequenceArgs,\n\tIMergeTreeDeltaCallbackArgs,\n\tIMergeTreeDeltaOpArgs,\n\tIMergeTreeMaintenanceCallbackArgs,\n} from \"./index\";\n\ntype IMergeTreeDeltaRemoteOpArgs = Omit<IMergeTreeDeltaOpArgs, \"sequencedMessage\"> &\n\tRequired<Pick<IMergeTreeDeltaOpArgs, \"sequencedMessage\">>;\n\nfunction removeMoveInfo(segment: Partial<IMoveInfo>): void {\n\tdelete segment.movedSeq;\n\tdelete segment.movedSeqs;\n\tdelete segment.localMovedSeq;\n\tdelete segment.movedClientIds;\n\tdelete segment.wasMovedOnInsert;\n}\n\n/**\n * A range [start, end)\n * @internal\n */\nexport interface IIntegerRange {\n\tstart: number;\n\tend: number;\n}\n\n/**\n * Emitted before this client's merge-tree normalizes its segments on reconnect, potentially\n * ordering them. Useful for DDS-like consumers built atop the merge-tree to compute any information\n * they need for rebasing their ops on reconnection.\n * @alpha\n */\nexport interface IClientEvents {\n\t(event: \"normalize\", listener: (target: IEventThisPlaceHolder) => void): void;\n\t(\n\t\tevent: \"delta\",\n\t\tlistener: (\n\t\t\topArgs: IMergeTreeDeltaOpArgs,\n\t\t\tdeltaArgs: IMergeTreeDeltaCallbackArgs,\n\t\t\ttarget: IEventThisPlaceHolder,\n\t\t) => void,\n\t): void;\n\t(\n\t\tevent: \"maintenance\",\n\t\tlistener: (\n\t\t\targs: IMergeTreeMaintenanceCallbackArgs,\n\t\t\tdeltaArgs: IMergeTreeDeltaOpArgs | undefined,\n\t\t\ttarget: IEventThisPlaceHolder,\n\t\t) => void,\n\t): void;\n}\n\n/**\n * @deprecated This functionality was not meant to be exported and will be removed in a future release\n * @alpha\n */\nexport class Client extends TypedEventEmitter<IClientEvents> {\n\tpublic longClientId: string | undefined;\n\n\tprivate readonly _mergeTree: MergeTree;\n\n\tprivate readonly clientNameToIds = new RedBlackTree<string, number>(compareStrings);\n\tprivate readonly shortClientIdMap: string[] = [];\n\n\tconstructor(\n\t\t// Passing this callback would be unnecessary if Client were merged with SharedSegmentSequence\n\t\tpublic readonly specToSegment: (spec: IJSONSegment) => ISegment,\n\t\tpublic readonly logger: ITelemetryLoggerExt,\n\t\toptions?: IMergeTreeOptions & PropertySet,\n\t) {\n\t\tsuper();\n\t\tthis._mergeTree = new MergeTree(options);\n\t\tthis._mergeTree.mergeTreeDeltaCallback = (opArgs, deltaArgs) => {\n\t\t\tthis.emit(\"delta\", opArgs, deltaArgs, this);\n\t\t};\n\t\tthis._mergeTree.mergeTreeMaintenanceCallback = (args, opArgs) => {\n\t\t\tthis.emit(\"maintenance\", args, opArgs, this);\n\t\t};\n\n\t\tif (options?.attribution?.track) {\n\t\t\tconst policy = this._mergeTree?.attributionPolicy;\n\t\t\tif (policy === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Attribution policy must be provided when attribution tracking is requested.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tpolicy.attach(this);\n\t\t}\n\t}\n\n\t/**\n\t * The merge tree maintains a queue of segment groups for each local operation.\n\t * These segment groups track segments modified by an operation.\n\t * This method peeks the tail of that queue, and returns the segments groups there.\n\t * It is used to get the segment group(s) for the previous operations.\n\t * @param count - The number segment groups to get peek from the tail of the queue. Default 1.\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic peekPendingSegmentGroups(count: number = 1): SegmentGroup | SegmentGroup[] | undefined {\n\t\tconst pending = this._mergeTree.pendingSegments;\n\t\tlet node = pending?.last;\n\t\tif (count === 1 || pending === undefined) {\n\t\t\treturn node?.data;\n\t\t}\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tconst taken: SegmentGroup[] = new Array(Math.min(count, pending.length));\n\t\tfor (let i = taken.length - 1; i >= 0; i--) {\n\t\t\ttaken[i] = node!.data;\n\t\t\tnode = node!.prev;\n\t\t}\n\t\treturn taken;\n\t}\n\n\t/**\n\t * Annotates the markers with the provided properties\n\t * @param marker - The marker to annotate\n\t * @param props - The properties to annotate the marker with\n\t * @returns The annotate op if valid, otherwise undefined\n\t */\n\tpublic annotateMarker(marker: Marker, props: PropertySet): IMergeTreeAnnotateMsg | undefined {\n\t\tconst annotateOp = createAnnotateMarkerOp(marker, props)!;\n\t\tthis.applyAnnotateRangeOp({ op: annotateOp });\n\t\treturn annotateOp;\n\t}\n\n\t/**\n\t * Annotates the range with the provided properties\n\t * @param start - The inclusive start position of the range to annotate\n\t * @param end - The exclusive end position of the range to annotate\n\t * @param props - The properties to annotate the range with\n\t * @returns The annotate op if valid, otherwise undefined\n\t */\n\tpublic annotateRangeLocal(\n\t\tstart: number,\n\t\tend: number,\n\t\tprops: PropertySet,\n\t): IMergeTreeAnnotateMsg | undefined {\n\t\tconst annotateOp = createAnnotateRangeOp(start, end, props);\n\t\tthis.applyAnnotateRangeOp({ op: annotateOp });\n\t\treturn annotateOp;\n\t}\n\n\t/**\n\t * Removes the range\n\t *\n\t * @param start - The inclusive start of the range to remove\n\t * @param end - The exclusive end of the range to remove\n\t */\n\tpublic removeRangeLocal(start: number, end: number): IMergeTreeRemoveMsg {\n\t\tconst removeOp = createRemoveRangeOp(start, end);\n\t\tthis.applyRemoveRangeOp({ op: removeOp });\n\t\treturn removeOp;\n\t}\n\n\t/**\n\t * Obliterates the range. This is similar to removing the range, but also\n\t * includes any concurrently inserted content.\n\t *\n\t * @param start - The inclusive start of the range to obliterate\n\t * @param end - The exclusive end of the range to obliterate\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic obliterateRangeLocal(start: number, end: number): IMergeTreeObliterateMsg {\n\t\tconst obliterateOp = createObliterateRangeOp(start, end);\n\t\tthis.applyObliterateRangeOp({ op: obliterateOp });\n\t\treturn obliterateOp;\n\t}\n\n\t/**\n\t * @param pos - The position to insert the segment at\n\t * @param segment - The segment to insert\n\t */\n\tpublic insertSegmentLocal(pos: number, segment: ISegment): IMergeTreeInsertMsg | undefined {\n\t\tif (segment.cachedLength <= 0) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst insertOp = createInsertSegmentOp(pos, segment);\n\t\tif (this.applyInsertOp({ op: insertOp })) {\n\t\t\treturn insertOp;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * @param refPos - The reference position to insert the segment at\n\t * @param segment - The segment to insert\n\t */\n\tpublic insertAtReferencePositionLocal(\n\t\trefPos: ReferencePosition,\n\t\tsegment: ISegment,\n\t): IMergeTreeInsertMsg | undefined {\n\t\tconst pos = this._mergeTree.referencePositionToLocalPosition(\n\t\t\trefPos,\n\t\t\tthis.getCurrentSeq(),\n\t\t\tthis.getClientId(),\n\t\t);\n\n\t\tif (pos === DetachedReferencePosition) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst op = createInsertSegmentOp(pos, segment);\n\n\t\tif (this.applyInsertOp({ op })) {\n\t\t\treturn op;\n\t\t}\n\t}\n\n\tpublic walkSegments<TClientData>(\n\t\thandler: ISegmentAction<TClientData>,\n\t\tstart: number | undefined,\n\t\tend: number | undefined,\n\t\taccum: TClientData,\n\t\tsplitRange?: boolean,\n\t): void;\n\tpublic walkSegments<undefined>(\n\t\thandler: ISegmentAction<undefined>,\n\t\tstart?: number,\n\t\tend?: number,\n\t\taccum?: undefined,\n\t\tsplitRange?: boolean,\n\t): void;\n\tpublic walkSegments<TClientData>(\n\t\thandler: ISegmentAction<TClientData>,\n\t\tstart: number | undefined,\n\t\tend: number | undefined,\n\t\taccum: TClientData,\n\t\tsplitRange: boolean = false,\n\t): void {\n\t\tthis._mergeTree.mapRange(\n\t\t\thandler,\n\t\t\tthis.getCurrentSeq(),\n\t\t\tthis.getClientId(),\n\t\t\taccum,\n\t\t\tstart,\n\t\t\tend,\n\t\t\tsplitRange,\n\t\t);\n\t}\n\n\tprotected walkAllSegments<TClientData>(\n\t\taction: (segment: ISegment, accum?: TClientData) => boolean,\n\t\taccum?: TClientData,\n\t): boolean {\n\t\treturn walkAllChildSegments(\n\t\t\tthis._mergeTree.root,\n\t\t\taccum === undefined ? action : (seg) => action(seg, accum),\n\t\t);\n\t}\n\n\t/**\n\t * Serializes the data required for garbage collection. The IFluidHandles stored in all segments that haven't\n\t * been removed represent routes to other objects. We serialize the data in these segments using the passed in\n\t * serializer which keeps track of all serialized handles.\n\t */\n\tpublic serializeGCData(\n\t\thandle: IFluidHandle,\n\t\thandleCollectingSerializer: IFluidSerializer,\n\t): void {\n\t\tlet localInserts = 0;\n\t\tlet localRemoves = 0;\n\t\twalkAllChildSegments(this._mergeTree.root, (seg) => {\n\t\t\tif (seg.seq === UnassignedSequenceNumber) {\n\t\t\t\tlocalInserts++;\n\t\t\t}\n\t\t\tif (seg.removedSeq === UnassignedSequenceNumber) {\n\t\t\t\tlocalRemoves++;\n\t\t\t}\n\t\t\t// Only serialize segments that have not been removed.\n\t\t\tif (seg.removedSeq === undefined) {\n\t\t\t\thandleCollectingSerializer.stringify(seg.clone().toJSONObject(), handle);\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\n\t\tif (localInserts > 0 || localRemoves > 0) {\n\t\t\tthis.logger.sendErrorEvent({\n\t\t\t\teventName: \"LocalEditsInProcessGCData\",\n\t\t\t\tlocalInserts,\n\t\t\t\tlocalRemoves,\n\t\t\t});\n\t\t}\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic getCollabWindow(): CollaborationWindow {\n\t\treturn this._mergeTree.collabWindow;\n\t}\n\n\t/**\n\t * Returns the current position of a segment, and -1 if the segment\n\t * does not exist in this merge tree\n\t * @param segment - The segment to get the position of\n\t */\n\tpublic getPosition(segment: ISegment | undefined, localSeq?: number): number {\n\t\tconst mergeSegment: IMergeLeaf | undefined = segment;\n\t\tif (mergeSegment?.parent === undefined) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn this._mergeTree.getPosition(\n\t\t\tmergeSegment,\n\t\t\tthis.getCurrentSeq(),\n\t\t\tthis.getClientId(),\n\t\t\tlocalSeq,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a `LocalReferencePosition` on this client. If the refType does not include ReferenceType.Transient,\n\t * the returned reference will be added to the localRefs on the provided segment.\n\t * @param segment - Segment to add the local reference on\n\t * @param offset - Offset on the segment at which to place the local reference\n\t * @param refType - ReferenceType for the created local reference\n\t * @param properties - PropertySet to place on the created local reference\n\t * @param canSlideToEndpoint - Whether or not the created local reference can\n\t * slide onto one of the special endpoint segments denoting the position\n\t * before the start of or after the end of the tree\n\t */\n\tpublic createLocalReferencePosition(\n\t\tsegment: ISegment | \"start\" | \"end\",\n\t\toffset: number | undefined,\n\t\trefType: ReferenceType,\n\t\tproperties: PropertySet | undefined,\n\t\tslidingPreference?: SlidingPreference,\n\t\tcanSlideToEndpoint?: boolean,\n\t): LocalReferencePosition {\n\t\treturn this._mergeTree.createLocalReferencePosition(\n\t\t\tsegment,\n\t\t\toffset ?? 0,\n\t\t\trefType,\n\t\t\tproperties,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\n\t/**\n\t * Removes a `LocalReferencePosition` from this client.\n\t */\n\tpublic removeLocalReferencePosition(lref: LocalReferencePosition) {\n\t\treturn this._mergeTree.removeLocalReferencePosition(lref);\n\t}\n\n\t/**\n\t * Resolves a `ReferencePosition` into a character position using this client's perspective.\n\t */\n\tpublic localReferencePositionToPosition(lref: ReferencePosition): number {\n\t\treturn this._mergeTree.referencePositionToLocalPosition(lref);\n\t}\n\n\t/**\n\t * Given a position specified relative to a marker id, lookup the marker\n\t * and convert the position to a character position.\n\t * @param relativePos - Id of marker (may be indirect) and whether position is before or after marker.\n\t */\n\tpublic posFromRelativePos(relativePos: IRelativePosition) {\n\t\treturn this._mergeTree.posFromRelativePos(relativePos);\n\t}\n\n\tpublic getMarkerFromId(id: string): ISegment | undefined {\n\t\treturn this._mergeTree.getMarkerFromId(id);\n\t}\n\n\t/**\n\t * Revert an op\n\t */\n\tpublic rollback?(op: any, localOpMetadata: unknown) {\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tthis._mergeTree.rollback(op as IMergeTreeDeltaOp, localOpMetadata as SegmentGroup);\n\t}\n\n\tprivate applyObliterateRangeOp(opArgs: IMergeTreeDeltaOpArgs): void {\n\t\tassert(\n\t\t\topArgs.op.type === MergeTreeDeltaType.OBLITERATE,\n\t\t\t0x866 /* Unexpected op type on range obliterate! */,\n\t\t);\n\t\tconst op = opArgs.op;\n\t\tconst clientArgs = this.getClientSequenceArgs(opArgs);\n\t\tconst range = this.getValidOpRange(op, clientArgs);\n\n\t\tthis._mergeTree.obliterateRange(\n\t\t\trange.start,\n\t\t\trange.end,\n\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\tclientArgs.clientId,\n\t\t\tclientArgs.sequenceNumber,\n\t\t\tfalse,\n\t\t\topArgs,\n\t\t);\n\t}\n\n\t/**\n\t * Performs the remove based on the provided op\n\t * @param opArgs - The ops args for the op\n\t */\n\tprivate applyRemoveRangeOp(opArgs: IMergeTreeDeltaOpArgs): void {\n\t\tassert(\n\t\t\topArgs.op.type === MergeTreeDeltaType.REMOVE,\n\t\t\t0x02d /* \"Unexpected op type on range remove!\" */,\n\t\t);\n\t\tconst op = opArgs.op;\n\t\tconst clientArgs = this.getClientSequenceArgs(opArgs);\n\t\tconst range = this.getValidOpRange(op, clientArgs);\n\n\t\tthis._mergeTree.markRangeRemoved(\n\t\t\trange.start,\n\t\t\trange.end,\n\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\tclientArgs.clientId,\n\t\t\tclientArgs.sequenceNumber,\n\t\t\tfalse,\n\t\t\topArgs,\n\t\t);\n\t}\n\n\t/**\n\t * Performs the annotate based on the provided op\n\t * @param opArgs - The ops args for the op\n\t */\n\tprivate applyAnnotateRangeOp(opArgs: IMergeTreeDeltaOpArgs): void {\n\t\tassert(\n\t\t\topArgs.op.type === MergeTreeDeltaType.ANNOTATE,\n\t\t\t0x02e /* \"Unexpected op type on range annotate!\" */,\n\t\t);\n\t\tconst op = opArgs.op;\n\t\tconst clientArgs = this.getClientSequenceArgs(opArgs);\n\t\tconst range = this.getValidOpRange(op, clientArgs);\n\n\t\tthis._mergeTree.annotateRange(\n\t\t\trange.start,\n\t\t\trange.end,\n\t\t\top.props,\n\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\tclientArgs.clientId,\n\t\t\tclientArgs.sequenceNumber,\n\t\t\topArgs,\n\t\t);\n\t}\n\n\t/**\n\t * Performs the insert based on the provided op\n\t * @param opArgs - The ops args for the op\n\t * @returns True if the insert was applied. False if it could not be.\n\t */\n\tprivate applyInsertOp(opArgs: IMergeTreeDeltaOpArgs): boolean {\n\t\tassert(\n\t\t\topArgs.op.type === MergeTreeDeltaType.INSERT,\n\t\t\t0x02f /* \"Unexpected op type on range insert!\" */,\n\t\t);\n\t\tconst op = opArgs.op;\n\t\tconst clientArgs = this.getClientSequenceArgs(opArgs);\n\t\tconst range = this.getValidOpRange(op, clientArgs);\n\n\t\tlet segments: ISegment[] | undefined;\n\t\tif (op.seg) {\n\t\t\tsegments = [this.specToSegment(op.seg)];\n\t\t}\n\n\t\tif (!segments || segments.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._mergeTree.insertSegments(\n\t\t\trange.start,\n\t\t\tsegments,\n\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\tclientArgs.clientId,\n\t\t\tclientArgs.sequenceNumber,\n\t\t\topArgs,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns a valid range for the op, or undefined\n\t * @param op - The op to generate the range for\n\t * @param clientArgs - The client args for the op\n\t */\n\tprivate getValidOpRange(\n\t\top:\n\t\t\t| IMergeTreeAnnotateMsg\n\t\t\t| IMergeTreeInsertMsg\n\t\t\t| IMergeTreeRemoveMsg\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t| IMergeTreeObliterateMsg,\n\t\tclientArgs: IMergeTreeClientSequenceArgs,\n\t): IIntegerRange {\n\t\tlet start: number | undefined = op.pos1;\n\t\tif (start === undefined && op.relativePos1) {\n\t\t\tstart = this._mergeTree.posFromRelativePos(\n\t\t\t\top.relativePos1,\n\t\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\t\tclientArgs.clientId,\n\t\t\t);\n\t\t}\n\n\t\tlet end: number | undefined = op.pos2;\n\t\tif (end === undefined && op.relativePos2) {\n\t\t\tend = this._mergeTree.posFromRelativePos(\n\t\t\t\top.relativePos2,\n\t\t\t\tclientArgs.referenceSequenceNumber,\n\t\t\t\tclientArgs.clientId,\n\t\t\t);\n\t\t}\n\n\t\t// Validate if local op\n\t\tif (clientArgs.clientId === this.getClientId()) {\n\t\t\tconst length = this.getLength();\n\n\t\t\tconst invalidPositions: string[] = [];\n\n\t\t\t// Validate start position\n\t\t\t//\n\t\t\tif (\n\t\t\t\tstart === undefined ||\n\t\t\t\tstart < 0 ||\n\t\t\t\tstart > length ||\n\t\t\t\t(start === length && op.type !== MergeTreeDeltaType.INSERT)\n\t\t\t) {\n\t\t\t\tinvalidPositions.push(\"start\");\n\t\t\t}\n\t\t\t// Validate end if not insert, or insert has end\n\t\t\t//\n\t\t\tif (op.type !== MergeTreeDeltaType.INSERT || end !== undefined) {\n\t\t\t\tif (end === undefined || end <= start!) {\n\t\t\t\t\tinvalidPositions.push(\"end\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (op.type === MergeTreeDeltaType.OBLITERATE && end !== undefined && end > length) {\n\t\t\t\tinvalidPositions.push(\"end\");\n\t\t\t}\n\n\t\t\tif (invalidPositions.length > 0) {\n\t\t\t\tthrow new LoggingError(\"RangeOutOfBounds\", {\n\t\t\t\t\tusageError: true,\n\t\t\t\t\tend,\n\t\t\t\t\tinvalidPositions: invalidPositions.toString(),\n\t\t\t\t\tlength,\n\t\t\t\t\topPos1: op.pos1,\n\t\t\t\t\topPos1Relative: op.relativePos1 !== undefined,\n\t\t\t\t\topPos2: op.pos2,\n\t\t\t\t\topPos2Relative: op.relativePos2 !== undefined,\n\t\t\t\t\topType: op.type,\n\t\t\t\t\tstart,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// start and end are guaranteed to be non-null here, otherwise we throw above.\n\t\treturn { start: start!, end: end! };\n\t}\n\n\t/**\n\t * Gets the client args from the op if remote, otherwise uses the local clients info\n\t * @param sequencedMessage - The sequencedMessage to get the client sequence args for\n\t */\n\tprivate getClientSequenceArgsForMessage(\n\t\tsequencedMessage:\n\t\t\t| ISequencedDocumentMessage\n\t\t\t| Pick<ISequencedDocumentMessage, \"referenceSequenceNumber\" | \"clientId\">\n\t\t\t| undefined,\n\t) {\n\t\t// If there this no sequenced message, then the op is local\n\t\t// and unacked, so use this clients sequenced args\n\t\t//\n\t\tif (!sequencedMessage) {\n\t\t\tconst segWindow = this.getCollabWindow();\n\t\t\treturn {\n\t\t\t\tclientId: segWindow.clientId,\n\t\t\t\treferenceSequenceNumber: segWindow.currentSeq,\n\t\t\t\tsequenceNumber: this.getLocalSequenceNumber(),\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tclientId: this.getOrAddShortClientIdFromMessage(sequencedMessage),\n\t\t\t\treferenceSequenceNumber: sequencedMessage.referenceSequenceNumber,\n\t\t\t\t// Note: return value satisfies overload signatures despite the cast, as if input argument doesn't contain sequenceNumber,\n\t\t\t\t// return value isn't expected to have it either.\n\t\t\t\tsequenceNumber: (sequencedMessage as ISequencedDocumentMessage).sequenceNumber,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Gets the client args from the op if remote, otherwise uses the local clients info\n\t * @param opArgs - The op arg to get the client sequence args for\n\t */\n\tprivate getClientSequenceArgs(opArgs: IMergeTreeDeltaOpArgs): IMergeTreeClientSequenceArgs {\n\t\treturn this.getClientSequenceArgsForMessage(opArgs.sequencedMessage);\n\t}\n\n\tprivate ackPendingSegment(opArgs: IMergeTreeDeltaRemoteOpArgs) {\n\t\tif (opArgs.op.type === MergeTreeDeltaType.GROUP) {\n\t\t\tfor (const memberOp of opArgs.op.ops) {\n\t\t\t\tthis._mergeTree.ackPendingSegment({\n\t\t\t\t\tgroupOp: opArgs.op,\n\t\t\t\t\top: memberOp,\n\t\t\t\t\tsequencedMessage: opArgs.sequencedMessage,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis._mergeTree.ackPendingSegment(opArgs);\n\t\t}\n\t}\n\n\tgetOrAddShortClientId(longClientId: string) {\n\t\tif (!this.clientNameToIds.get(longClientId)) {\n\t\t\tthis.addLongClientId(longClientId);\n\t\t}\n\t\treturn this.getShortClientId(longClientId);\n\t}\n\n\tprotected getShortClientId(longClientId: string) {\n\t\treturn this.clientNameToIds.get(longClientId)!.data;\n\t}\n\n\tgetLongClientId(shortClientId: number) {\n\t\treturn shortClientId >= 0 ? this.shortClientIdMap[shortClientId] : \"original\";\n\t}\n\n\taddLongClientId(longClientId: string) {\n\t\tthis.clientNameToIds.put(longClientId, this.shortClientIdMap.length);\n\t\tthis.shortClientIdMap.push(longClientId);\n\t}\n\n\tprivate getOrAddShortClientIdFromMessage(msg: Pick<ISequencedDocumentMessage, \"clientId\">) {\n\t\treturn this.getOrAddShortClientId(msg.clientId ?? \"server\");\n\t}\n\n\t/**\n\t * During reconnect, we must find the positions to pending segments\n\t * relative to other pending segments. This methods computes that\n\t * position relative to a localSeq. Pending segments above the localSeq\n\t * will be ignored.\n\t *\n\t * @param segment - The segment to find the position for\n\t * @param localSeq - The localSeq to find the position of the segment at\n\t */\n\tpublic findReconnectionPosition(segment: ISegment, localSeq: number) {\n\t\tassert(\n\t\t\tlocalSeq <= this._mergeTree.collabWindow.localSeq,\n\t\t\t0x032 /* \"localSeq greater than collab window\" */,\n\t\t);\n\t\tconst { currentSeq, clientId } = this.getCollabWindow();\n\t\treturn this._mergeTree.getPosition(segment, currentSeq, clientId, localSeq);\n\t}\n\n\tprivate resetPendingDeltaToOps(\n\t\tresetOp: IMergeTreeDeltaOp,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tsegmentGroup: SegmentGroup,\n\t): IMergeTreeDeltaOp[] {\n\t\tassert(!!segmentGroup, 0x033 /* \"Segment group undefined\" */);\n\t\tconst NACKedSegmentGroup = this.pendingRebase?.shift()?.data;\n\t\tassert(\n\t\t\tsegmentGroup === NACKedSegmentGroup,\n\t\t\t0x034 /* \"Segment group not at head of pending rebase queue\" */,\n\t\t);\n\t\tif (this.pendingRebase?.empty) {\n\t\t\tthis.pendingRebase = undefined;\n\t\t}\n\n\t\t// if this is an obliterate op, keep all segments in same segment group\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tconst obliterateSegmentGroup: SegmentGroup = {\n\t\t\tsegments: [],\n\t\t\tlocalSeq: segmentGroup.localSeq,\n\t\t\trefSeq: this.getCollabWindow().currentSeq,\n\t\t};\n\n\t\tconst opList: IMergeTreeDeltaOp[] = [];\n\t\t// We need to sort the segments by ordinal, as the segments are not sorted in the segment group.\n\t\t// The reason they need them sorted, as they have the same local sequence number and which means\n\t\t// farther segments will take into account nearer segments when calculating their position.\n\t\t// By sorting we ensure the nearer segment will be applied and sequenced before the farther segments\n\t\t// so their recalculated positions will be correct.\n\t\tfor (const segment of segmentGroup.segments.sort((a, b) =>\n\t\t\ta.ordinal < b.ordinal ? -1 : 1,\n\t\t)) {\n\t\t\tconst segmentSegGroup = segment.segmentGroups.dequeue();\n\t\t\tassert(\n\t\t\t\tsegmentGroup === segmentSegGroup,\n\t\t\t\t0x035 /* \"Segment group not at head of segment pending queue\" */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tsegmentGroup.localSeq !== undefined,\n\t\t\t\t0x867 /* expected segment group localSeq to be defined */,\n\t\t\t);\n\t\t\tconst segmentPosition = this.findReconnectionPosition(segment, segmentGroup.localSeq);\n\t\t\tlet newOp: IMergeTreeDeltaOp | undefined;\n\t\t\tswitch (resetOp.type) {\n\t\t\t\tcase MergeTreeDeltaType.ANNOTATE:\n\t\t\t\t\tassert(\n\t\t\t\t\t\tsegment.propertyManager?.hasPendingProperties() === true,\n\t\t\t\t\t\t0x036 /* \"Segment has no pending properties\" */,\n\t\t\t\t\t);\n\t\t\t\t\t// if the segment has been removed or obliterated, there's no need to send the annotate op\n\t\t\t\t\t// unless the remove was local, in which case the annotate must have come\n\t\t\t\t\t// before the remove\n\t\t\t\t\tif (\n\t\t\t\t\t\t(segment.removedSeq === undefined ||\n\t\t\t\t\t\t\t(segment.localRemovedSeq !== undefined &&\n\t\t\t\t\t\t\t\tsegment.removedSeq === UnassignedSequenceNumber)) &&\n\t\t\t\t\t\t(segment.movedSeq === undefined ||\n\t\t\t\t\t\t\t(segment.localMovedSeq !== undefined &&\n\t\t\t\t\t\t\t\tsegment.movedSeq === UnassignedSequenceNumber))\n\t\t\t\t\t) {\n\t\t\t\t\t\tnewOp = createAnnotateRangeOp(\n\t\t\t\t\t\t\tsegmentPosition,\n\t\t\t\t\t\t\tsegmentPosition + segment.cachedLength,\n\t\t\t\t\t\t\tresetOp.props,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MergeTreeDeltaType.INSERT:\n\t\t\t\t\tassert(\n\t\t\t\t\t\tsegment.seq === UnassignedSequenceNumber,\n\t\t\t\t\t\t0x037 /* \"Segment already has assigned sequence number\" */,\n\t\t\t\t\t);\n\t\t\t\t\tlet segInsertOp = segment;\n\t\t\t\t\tif (typeof resetOp.seg === \"object\" && resetOp.seg.props !== undefined) {\n\t\t\t\t\t\tsegInsertOp = segment.clone();\n\t\t\t\t\t\tsegInsertOp.properties = resetOp.seg.props;\n\t\t\t\t\t}\n\t\t\t\t\tif (segment.movedSeq !== UnassignedSequenceNumber) {\n\t\t\t\t\t\tremoveMoveInfo(segment);\n\t\t\t\t\t}\n\t\t\t\t\tnewOp = createInsertSegmentOp(segmentPosition, segInsertOp);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MergeTreeDeltaType.REMOVE:\n\t\t\t\t\tif (\n\t\t\t\t\t\tsegment.localRemovedSeq !== undefined &&\n\t\t\t\t\t\tsegment.removedSeq === UnassignedSequenceNumber &&\n\t\t\t\t\t\t(segment.movedSeq === undefined ||\n\t\t\t\t\t\t\t(segment.localMovedSeq !== undefined &&\n\t\t\t\t\t\t\t\tsegment.movedSeq === UnassignedSequenceNumber))\n\t\t\t\t\t) {\n\t\t\t\t\t\tnewOp = createRemoveRangeOp(\n\t\t\t\t\t\t\tsegmentPosition,\n\t\t\t\t\t\t\tsegmentPosition + segment.cachedLength,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase MergeTreeDeltaType.OBLITERATE:\n\t\t\t\t\tif (\n\t\t\t\t\t\tsegment.localMovedSeq !== undefined &&\n\t\t\t\t\t\tsegment.movedSeq === UnassignedSequenceNumber &&\n\t\t\t\t\t\t(segment.removedSeq === undefined ||\n\t\t\t\t\t\t\t(segment.localRemovedSeq !== undefined &&\n\t\t\t\t\t\t\t\tsegment.removedSeq === UnassignedSequenceNumber))\n\t\t\t\t\t) {\n\t\t\t\t\t\tnewOp = createObliterateRangeOp(\n\t\t\t\t\t\t\tsegmentPosition,\n\t\t\t\t\t\t\tsegmentPosition + segment.cachedLength,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`Invalid op type`);\n\t\t\t}\n\n\t\t\tif (newOp && resetOp.type === MergeTreeDeltaType.OBLITERATE) {\n\t\t\t\tsegment.segmentGroups.enqueue(obliterateSegmentGroup);\n\n\t\t\t\tconst first = opList[0];\n\n\t\t\t\tif (!!first && first.pos2 !== undefined) {\n\t\t\t\t\tfirst.pos2 += newOp.pos2! - newOp.pos1!;\n\t\t\t\t} else {\n\t\t\t\t\topList.push(newOp);\n\t\t\t\t}\n\t\t\t} else if (newOp) {\n\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\tconst newSegmentGroup: SegmentGroup = {\n\t\t\t\t\tsegments: [],\n\t\t\t\t\tlocalSeq: segmentGroup.localSeq,\n\t\t\t\t\trefSeq: this.getCollabWindow().currentSeq,\n\t\t\t\t};\n\t\t\t\tsegment.segmentGroups.enqueue(newSegmentGroup);\n\n\t\t\t\tthis._mergeTree.pendingSegments.push(newSegmentGroup);\n\n\t\t\t\topList.push(newOp);\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tresetOp.type === MergeTreeDeltaType.OBLITERATE &&\n\t\t\tobliterateSegmentGroup.segments.length > 0\n\t\t) {\n\t\t\tthis._mergeTree.pendingSegments.push(obliterateSegmentGroup);\n\t\t}\n\n\t\treturn opList;\n\t}\n\n\tprivate applyRemoteOp(opArgs: IMergeTreeDeltaRemoteOpArgs) {\n\t\tconst op = opArgs.op;\n\t\tconst msg = opArgs.sequencedMessage;\n\t\tthis.getOrAddShortClientIdFromMessage(msg);\n\t\tswitch (op.type) {\n\t\t\tcase MergeTreeDeltaType.INSERT:\n\t\t\t\tthis.applyInsertOp(opArgs);\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.REMOVE:\n\t\t\t\tthis.applyRemoveRangeOp(opArgs);\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.ANNOTATE:\n\t\t\t\tthis.applyAnnotateRangeOp(opArgs);\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.OBLITERATE:\n\t\t\t\tthis.applyObliterateRangeOp(opArgs);\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.GROUP: {\n\t\t\t\tfor (const memberOp of op.ops) {\n\t\t\t\t\tthis.applyRemoteOp({\n\t\t\t\t\t\top: memberOp,\n\t\t\t\t\t\tgroupOp: op,\n\t\t\t\t\t\tsequencedMessage: msg,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic applyStashedOp(op: IMergeTreeDeltaOp): SegmentGroup;\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic applyStashedOp(op: IMergeTreeGroupMsg): SegmentGroup[];\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic applyStashedOp(op: IMergeTreeOp): SegmentGroup | SegmentGroup[];\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic applyStashedOp(op: IMergeTreeOp): SegmentGroup | SegmentGroup[] {\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tlet metadata: SegmentGroup | SegmentGroup[] | undefined;\n\t\tconst stashed = true;\n\t\tswitch (op.type) {\n\t\t\tcase MergeTreeDeltaType.INSERT:\n\t\t\t\tthis.applyInsertOp({ op, stashed });\n\t\t\t\tmetadata = this.peekPendingSegmentGroups();\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.REMOVE:\n\t\t\t\tthis.applyRemoveRangeOp({ op, stashed });\n\t\t\t\tmetadata = this.peekPendingSegmentGroups();\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.ANNOTATE:\n\t\t\t\tthis.applyAnnotateRangeOp({ op, stashed });\n\t\t\t\tmetadata = this.peekPendingSegmentGroups();\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.OBLITERATE:\n\t\t\t\tthis.applyObliterateRangeOp({ op });\n\t\t\t\tmetadata = this.peekPendingSegmentGroups();\n\t\t\t\tbreak;\n\t\t\tcase MergeTreeDeltaType.GROUP:\n\t\t\t\treturn op.ops.map((o) => this.applyStashedOp(o));\n\t\t\tdefault:\n\t\t\t\tunreachableCase(op, \"unrecognized op type\");\n\t\t}\n\t\tassert(!!metadata, 0x2db /* \"Applying op must generate a pending segment\" */);\n\t\treturn metadata;\n\t}\n\n\tpublic applyMsg(msg: ISequencedDocumentMessage, local: boolean = false) {\n\t\t// Ensure client ID is registered\n\t\tthis.getOrAddShortClientIdFromMessage(msg);\n\t\t// Apply if an operation message\n\t\tif (msg.type === MessageType.Operation) {\n\t\t\tconst opArgs: IMergeTreeDeltaRemoteOpArgs = {\n\t\t\t\top: msg.contents as IMergeTreeOp,\n\t\t\t\tsequencedMessage: msg,\n\t\t\t};\n\t\t\tif (opArgs.sequencedMessage?.clientId === this.longClientId || local) {\n\t\t\t\tthis.ackPendingSegment(opArgs);\n\t\t\t} else {\n\t\t\t\tthis.applyRemoteOp(opArgs);\n\t\t\t}\n\t\t}\n\n\t\tthis.updateSeqNumbers(msg.minimumSequenceNumber, msg.sequenceNumber);\n\t}\n\n\tprivate updateSeqNumbers(min: number, seq: number) {\n\t\tconst collabWindow = this.getCollabWindow();\n\t\t// Equal is fine here due to SharedSegmentSequence<>.snapshotContent() potentially updating with same #\n\t\tassert(\n\t\t\tcollabWindow.currentSeq <= seq,\n\t\t\t0x038 /* \"Incoming op sequence# < local collabWindow's currentSequence#\" */,\n\t\t);\n\t\tcollabWindow.currentSeq = seq;\n\t\tassert(min <= seq, 0x039 /* \"Incoming op sequence# < minSequence#\" */);\n\t\tthis.updateMinSeq(min);\n\t}\n\n\t/**\n\t * Resolves a remote client's position against the local sequence\n\t * and returns the remote client's position relative to the local\n\t * sequence\n\t * @param remoteClientPosition - The remote client's position to resolve\n\t * @param remoteClientRefSeq - The reference sequence number of the remote client\n\t * @param remoteClientId - The client id of the remote client\n\t */\n\tpublic resolveRemoteClientPosition(\n\t\tremoteClientPosition: number,\n\t\tremoteClientRefSeq: number,\n\t\tremoteClientId: string,\n\t): number | undefined {\n\t\tconst shortRemoteClientId = this.getOrAddShortClientId(remoteClientId);\n\t\treturn this._mergeTree.resolveRemoteClientPosition(\n\t\t\tremoteClientPosition,\n\t\t\tremoteClientRefSeq,\n\t\t\tshortRemoteClientId,\n\t\t);\n\t}\n\n\tprivate lastNormalizationRefSeq = 0;\n\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate pendingRebase: DoublyLinkedList<SegmentGroup> | undefined;\n\n\t/**\n\t * Given a pending operation and segment group, regenerate the op, so it\n\t * can be resubmitted\n\t * @param resetOp - The op to reset\n\t * @param segmentGroup - The segment group associated with the op\n\t */\n\tpublic regeneratePendingOp(\n\t\tresetOp: IMergeTreeOp,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tsegmentGroup: SegmentGroup | SegmentGroup[],\n\t): IMergeTreeOp {\n\t\tif (this.pendingRebase === undefined || this.pendingRebase.empty) {\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tlet firstGroup: SegmentGroup;\n\t\t\tif (Array.isArray(segmentGroup)) {\n\t\t\t\tif (segmentGroup.length === 0) {\n\t\t\t\t\t// sometimes we rebase to an empty op\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\treturn createGroupOp();\n\t\t\t\t}\n\t\t\t\tfirstGroup = segmentGroup[0];\n\t\t\t} else {\n\t\t\t\tfirstGroup = segmentGroup;\n\t\t\t}\n\t\t\tconst firstGroupNode = this._mergeTree.pendingSegments.find(\n\t\t\t\t(node) => node.data === firstGroup,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tfirstGroupNode !== undefined,\n\t\t\t\t0x70e /* segment group must exist in pending list */,\n\t\t\t);\n\t\t\tthis.pendingRebase = this._mergeTree.pendingSegments.splice(firstGroupNode);\n\t\t}\n\n\t\tconst rebaseTo = this.getCollabWindow().currentSeq;\n\t\tif (rebaseTo !== this.lastNormalizationRefSeq) {\n\t\t\tthis.emit(\"normalize\", this);\n\t\t\tthis._mergeTree.normalizeSegmentsOnRebase();\n\t\t\tthis.lastNormalizationRefSeq = rebaseTo;\n\t\t}\n\n\t\tconst opList: IMergeTreeDeltaOp[] = [];\n\t\tif (resetOp.type === MergeTreeDeltaType.GROUP) {\n\t\t\tif (Array.isArray(segmentGroup)) {\n\t\t\t\tassert(\n\t\t\t\t\tresetOp.ops.length === segmentGroup.length,\n\t\t\t\t\t0x03a /* \"Number of ops in 'resetOp' must match the number of segment groups provided.\" */,\n\t\t\t\t);\n\n\t\t\t\tfor (let i = 0; i < resetOp.ops.length; i++) {\n\t\t\t\t\topList.push(...this.resetPendingDeltaToOps(resetOp.ops[i], segmentGroup[i]));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// A group op containing a single op will pass a direct reference to 'segmentGroup'\n\t\t\t\t// rather than an array of segment groups. (See 'peekPendingSegmentGroups()')\n\t\t\t\tassert(\n\t\t\t\t\tresetOp.ops.length === 1,\n\t\t\t\t\t0x03b /* \"Number of ops in 'resetOp' must match the number of segment groups provided.\" */,\n\t\t\t\t);\n\t\t\t\topList.push(...this.resetPendingDeltaToOps(resetOp.ops[0], segmentGroup));\n\t\t\t}\n\t\t} else {\n\t\t\tassert(\n\t\t\t\t(resetOp.type as any) !== MergeTreeDeltaType.GROUP,\n\t\t\t\t0x03c /* \"Reset op has 'group' delta type!\" */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\t!Array.isArray(segmentGroup),\n\t\t\t\t0x03d /* \"segmentGroup is array rather than singleton!\" */,\n\t\t\t);\n\t\t\topList.push(...this.resetPendingDeltaToOps(resetOp, segmentGroup));\n\t\t}\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\treturn opList.length === 1 ? opList[0] : createGroupOp(...opList);\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic createTextHelper(): IMergeTreeTextHelper {\n\t\treturn new MergeTreeTextHelper(this._mergeTree);\n\t}\n\n\tpublic summarize(\n\t\truntime: IFluidDataStoreRuntime,\n\t\thandle: IFluidHandle,\n\t\tserializer: IFluidSerializer,\n\t\tcatchUpMsgs: ISequencedDocumentMessage[],\n\t): ISummaryTreeWithStats {\n\t\tconst deltaManager = runtime.deltaManager;\n\t\tconst minSeq = deltaManager.minimumSequenceNumber;\n\n\t\t// Catch up to latest MSN, if we have not had a chance to do it.\n\t\t// Required for case where FluidDataStoreRuntime.attachChannel()\n\t\t// generates summary right after loading data store.\n\n\t\tthis.updateSeqNumbers(minSeq, deltaManager.lastSequenceNumber);\n\n\t\t// One of the summaries (from SPO) I observed to have chunk.chunkSequenceNumber > minSeq!\n\t\t// Not sure why - need to catch it sooner\n\t\tassert(\n\t\t\tthis.getCollabWindow().minSeq === minSeq,\n\t\t\t0x03e /* \"minSeq mismatch between collab window and delta manager!\" */,\n\t\t);\n\n\t\t// Must continue to support legacy\n\t\t// (See https://github.com/microsoft/FluidFramework/issues/84)\n\t\tif (this._mergeTree.options?.newMergeTreeSnapshotFormat === true) {\n\t\t\tassert(\n\t\t\t\tcatchUpMsgs === undefined || catchUpMsgs.length === 0,\n\t\t\t\t0x03f /* \"New format should not emit catchup ops\" */,\n\t\t\t);\n\t\t\tconst snap = new SnapshotV1(this._mergeTree, this.logger, (id) =>\n\t\t\t\tthis.getLongClientId(id),\n\t\t\t);\n\t\t\tsnap.extractSync();\n\t\t\treturn snap.emit(serializer, handle);\n\t\t} else {\n\t\t\tconst snap = new SnapshotLegacy(this._mergeTree, this.logger);\n\t\t\tsnap.extractSync();\n\t\t\treturn snap.emit(catchUpMsgs, serializer, handle);\n\t\t}\n\t}\n\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tstorage: IChannelStorageService,\n\t\tserializer: IFluidSerializer,\n\t): Promise<{ catchupOpsP: Promise<ISequencedDocumentMessage[]> }> {\n\t\tconst loader = new SnapshotLoader(runtime, this, this._mergeTree, this.logger, serializer);\n\n\t\treturn loader.initialize(storage);\n\t}\n\n\tprivate getLocalSequenceNumber() {\n\t\tconst segWindow = this.getCollabWindow();\n\t\treturn segWindow.collaborating ? UnassignedSequenceNumber : UniversalSequenceNumber;\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tlocalTransaction(groupOp: IMergeTreeGroupMsg) {\n\t\tfor (const op of groupOp.ops) {\n\t\t\tconst opArgs: IMergeTreeDeltaOpArgs = {\n\t\t\t\top,\n\t\t\t\tgroupOp,\n\t\t\t};\n\t\t\tswitch (op.type) {\n\t\t\t\tcase MergeTreeDeltaType.INSERT:\n\t\t\t\t\tthis.applyInsertOp(opArgs);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MergeTreeDeltaType.ANNOTATE:\n\t\t\t\t\tthis.applyAnnotateRangeOp(opArgs);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MergeTreeDeltaType.REMOVE:\n\t\t\t\t\tthis.applyRemoveRangeOp(opArgs);\n\t\t\t\t\tbreak;\n\t\t\t\tcase MergeTreeDeltaType.OBLITERATE:\n\t\t\t\t\tthis.applyObliterateRangeOp(opArgs);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tupdateMinSeq(minSeq: number) {\n\t\tthis._mergeTree.setMinSeq(minSeq);\n\t}\n\n\tgetContainingSegment<T extends ISegment>(\n\t\tpos: number,\n\t\tsequenceArgs?: Pick<ISequencedDocumentMessage, \"referenceSequenceNumber\" | \"clientId\">,\n\t\tlocalSeq?: number,\n\t) {\n\t\tconst { referenceSequenceNumber, clientId } =\n\t\t\tthis.getClientSequenceArgsForMessage(sequenceArgs);\n\t\treturn this._mergeTree.getContainingSegment<T>(\n\t\t\tpos,\n\t\t\treferenceSequenceNumber,\n\t\t\tclientId,\n\t\t\tlocalSeq,\n\t\t);\n\t}\n\n\tgetPropertiesAtPosition(pos: number) {\n\t\tlet propertiesAtPosition: PropertySet | undefined;\n\t\tconst segoff = this.getContainingSegment(pos);\n\t\tconst seg = segoff.segment;\n\t\tif (seg) {\n\t\t\tpropertiesAtPosition = seg.properties;\n\t\t}\n\t\treturn propertiesAtPosition;\n\t}\n\n\tgetRangeExtentsOfPosition(pos: number) {\n\t\tlet posStart: number | undefined;\n\t\tlet posAfterEnd: number | undefined;\n\n\t\tconst segoff = this.getContainingSegment(pos);\n\t\tconst seg = segoff.segment;\n\t\tif (seg) {\n\t\t\tposStart = this.getPosition(seg);\n\t\t\tposAfterEnd = posStart + seg.cachedLength;\n\t\t}\n\t\treturn { posStart, posAfterEnd };\n\t}\n\n\tgetCurrentSeq() {\n\t\treturn this.getCollabWindow().currentSeq;\n\t}\n\n\tgetClientId() {\n\t\treturn this.getCollabWindow().clientId;\n\t}\n\n\tgetLength() {\n\t\treturn this._mergeTree.length ?? 0;\n\t}\n\n\tstartOrUpdateCollaboration(longClientId: string | undefined, minSeq = 0, currentSeq = 0) {\n\t\t// we should always have a client id if we are collaborating\n\t\t// if the client id is undefined we are likely bound to a detached\n\t\t// container, so we should keep going in local mode. once\n\t\t// the container attaches this will be called again on connect with the\n\t\t// client id\n\t\tif (longClientId !== undefined) {\n\t\t\tif (this.longClientId === undefined) {\n\t\t\t\tthis.longClientId = longClientId;\n\t\t\t\tthis.addLongClientId(this.longClientId);\n\t\t\t\tthis._mergeTree.startCollaboration(\n\t\t\t\t\tthis.getShortClientId(this.longClientId),\n\t\t\t\t\tminSeq,\n\t\t\t\t\tcurrentSeq,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst oldClientId = this.longClientId;\n\t\t\t\tconst oldData = this.clientNameToIds.get(oldClientId)!.data;\n\t\t\t\tthis.longClientId = longClientId;\n\t\t\t\tthis.clientNameToIds.put(longClientId, oldData);\n\t\t\t\tthis.shortClientIdMap[oldData] = longClientId;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Searches a string for the nearest marker in either direction to a given start position.\n\t * The search will include the start position, so markers at the start position are valid\n\t * results of the search. Makes use of block-accelerated search functions for log(n) complexity.\n\t *\n\t * @param startPos - Position at which to start the search\n\t * @param markerLabel - Label of the marker to search for\n\t * @param forwards - Whether the desired marker comes before (false) or after (true) `startPos`\n\t */\n\tsearchForMarker(startPos: number, markerLabel: string, forwards = true) {\n\t\tconst clientId = this.getClientId();\n\t\treturn this._mergeTree.searchForMarker(startPos, clientId, markerLabel, forwards);\n\t}\n}\n"]}
|
|
@@ -12,7 +12,10 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
|
12
12
|
|
|
13
13
|
/* Excluded from this release type: addProperties */
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
export declare function appendToMergeTreeDeltaRevertibles(deltaArgs: IMergeTreeDeltaCallbackArgs, revertibles: MergeTreeDeltaRevertible[]): void;
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
21
|
* Implements policy dictating which kinds of operations should be attributed and how.
|
|
@@ -336,13 +339,6 @@ export declare class Client extends TypedEventEmitter<IClientEvents> {
|
|
|
336
339
|
getClientId(): number;
|
|
337
340
|
getLength(): number;
|
|
338
341
|
startOrUpdateCollaboration(longClientId: string | undefined, minSeq?: number, currentSeq?: number): void;
|
|
339
|
-
/**
|
|
340
|
-
* @deprecated Use searchForMarker instead.
|
|
341
|
-
*/
|
|
342
|
-
findTile(startPos: number, tileLabel: string, preceding?: boolean): {
|
|
343
|
-
tile: ReferencePosition;
|
|
344
|
-
pos: number;
|
|
345
|
-
} | undefined;
|
|
346
342
|
/**
|
|
347
343
|
* Searches a string for the nearest marker in either direction to a given start position.
|
|
348
344
|
* The search will include the start position, so markers at the start position are valid
|
|
@@ -465,7 +461,10 @@ export declare class CollaborationWindow {
|
|
|
465
461
|
|
|
466
462
|
/* Excluded from this release type: Dictionary */
|
|
467
463
|
|
|
468
|
-
|
|
464
|
+
/**
|
|
465
|
+
* @alpha
|
|
466
|
+
*/
|
|
467
|
+
export declare function discardMergeTreeDeltaRevertible(revertibles: MergeTreeDeltaRevertible[]): void;
|
|
469
468
|
|
|
470
469
|
declare class DoublyLinkedList<T> implements Iterable<ListNode<T>>, Partial<ListNodeRange<T>>, Pick<ListNode<T>[], "pop" | "shift" | "length" | "includes"> {
|
|
471
470
|
find(predicate: (value: ListNode<T>, obj: DoublyLinkedList<T>) => unknown): ListNode<T> | undefined;
|
|
@@ -1315,7 +1314,20 @@ export declare type MergeTreeDeltaOperationType = typeof MergeTreeDeltaType.ANNO
|
|
|
1315
1314
|
*/
|
|
1316
1315
|
export declare type MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationType | MergeTreeMaintenanceType;
|
|
1317
1316
|
|
|
1318
|
-
|
|
1317
|
+
/**
|
|
1318
|
+
* @alpha
|
|
1319
|
+
*/
|
|
1320
|
+
export declare type MergeTreeDeltaRevertible = {
|
|
1321
|
+
operation: typeof MergeTreeDeltaType.INSERT;
|
|
1322
|
+
trackingGroup: ITrackingGroup;
|
|
1323
|
+
} | {
|
|
1324
|
+
operation: typeof MergeTreeDeltaType.REMOVE;
|
|
1325
|
+
trackingGroup: ITrackingGroup;
|
|
1326
|
+
} | {
|
|
1327
|
+
operation: typeof MergeTreeDeltaType.ANNOTATE;
|
|
1328
|
+
trackingGroup: ITrackingGroup;
|
|
1329
|
+
propertyDeltas: PropertySet;
|
|
1330
|
+
};
|
|
1319
1331
|
|
|
1320
1332
|
/**
|
|
1321
1333
|
* @alpha
|
|
@@ -1743,7 +1755,7 @@ export declare interface ReferencePosition {
|
|
|
1743
1755
|
export declare enum ReferenceType {
|
|
1744
1756
|
Simple = 0,
|
|
1745
1757
|
/**
|
|
1746
|
-
* Allows this reference to be located using the `
|
|
1758
|
+
* Allows this reference to be located using the `searchForMarker` API on merge-tree.
|
|
1747
1759
|
*/
|
|
1748
1760
|
Tile = 1,
|
|
1749
1761
|
/**
|
|
@@ -1793,7 +1805,10 @@ export declare enum ReferenceType {
|
|
|
1793
1805
|
|
|
1794
1806
|
/* Excluded from this release type: reservedTileLabelsKey */
|
|
1795
1807
|
|
|
1796
|
-
|
|
1808
|
+
/**
|
|
1809
|
+
* @alpha
|
|
1810
|
+
*/
|
|
1811
|
+
export declare function revertMergeTreeDeltaRevertibles(driver: MergeTreeRevertibleDriver, revertibles: MergeTreeDeltaRevertible[]): void;
|
|
1797
1812
|
|
|
1798
1813
|
/**
|
|
1799
1814
|
* @deprecated This functionality was not meant to be exported and will be removed in a future release
|