@fluidframework/sequence 2.74.0-365691 → 2.74.0-368706
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/dist/intervalCollection.d.ts.map +1 -1
- package/dist/intervalCollection.js +6 -4
- package/dist/intervalCollection.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/intervalCollection.d.ts.map +1 -1
- package/lib/intervalCollection.js +6 -4
- package/lib/intervalCollection.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +17 -17
- package/src/intervalCollection.ts +6 -5
- package/src/packageVersion.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalCollection.d.ts","sourceRoot":"","sources":["../src/intervalCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAOzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EACN,MAAM,EAEN,sBAAsB,EACtB,WAAW,EAKX,IAAI,EACJ,aAAa,EAKb,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EAEN,eAAe,EACf,KAAK,qCAAqC,EAC1C,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAIN,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,kCAAkC,EACvC,KAAK,qBAAqB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,4BAA4B,EAC5B,mBAAmB,EAGnB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EAIvB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAA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AG,GAAG,GAAG,GAChB,+BAA+B,GAAG,+BAA+B;IAQpE;;OAEG;IACI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,0BAA0B;IAKtD;;OAEG;IACI,sCAAsC,CAC5C,aAAa,EAAE,MAAM,GACnB,0BAA0B;IAK7B;;OAEG;IACI,uCAAuC,CAC7C,aAAa,EAAE,MAAM,GACnB,0BAA0B;IAK7B;;OAEG;IACI,oCAAoC,CAC1C,WAAW,EAAE,MAAM,GACjB,0BAA0B;IAK7B;;OAEG;IACI,qCAAqC,CAC3C,WAAW,EAAE,MAAM,GACjB,0BAA0B;IAK7B;;OAEG;IACI,sBAAsB,CAC5B,OAAO,EAAE,qBAAqB,EAAE,EAChC,eAAe,EAAE,OAAO,EACxB,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM;IAcb;;OAEG;IACI,wBAAwB,CAC9B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GACjB,gBAAgB,EAAE;IAWrB;;OAEG;IACI,GAAG,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI;IAUxD;;OAEG;IACI,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAQlE;;OAEG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;CAO9D;AASD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAC1C,iBAAiB,EAAE,sBAAsB,GACvC,eAAe,GAAG,SAAS,CAM7B"}
|
|
@@ -495,7 +495,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
495
495
|
previousInterval.start.refType = internal_2.ReferenceType.Transient;
|
|
496
496
|
previousInterval.end.refType = internal_2.ReferenceType.Transient;
|
|
497
497
|
this.emit("changeInterval", interval, previousInterval, local, op, slide);
|
|
498
|
-
this.emit("changed", interval,
|
|
498
|
+
this.emit("changed", interval, {}, previousInterval ?? undefined, local, slide);
|
|
499
499
|
previousInterval.start.refType = startRefType;
|
|
500
500
|
previousInterval.end.refType = endRefType;
|
|
501
501
|
}
|
|
@@ -697,7 +697,7 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
|
-
if (deltaProps !== undefined && Object.keys(deltaProps).length > 0) {
|
|
700
|
+
if (isLatestInterval && deltaProps !== undefined && Object.keys(deltaProps).length > 0) {
|
|
701
701
|
this.emit("propertyChanged", latestInterval, deltaProps, local, op);
|
|
702
702
|
this.emit("changed", latestInterval, deltaProps, undefined, local, false);
|
|
703
703
|
}
|
|
@@ -737,11 +737,13 @@ class IntervalCollection extends client_utils_1.TypedEventEmitter {
|
|
|
737
737
|
const { id } = (0, index_js_2.getSerializedProperties)(original);
|
|
738
738
|
const rebasedEndpoint = this.computeRebasedPositions(localOpMetadata, squash);
|
|
739
739
|
const localInterval = this.getIntervalById(id);
|
|
740
|
-
// if the interval
|
|
740
|
+
// if the interval slides off the string, rebase the op to be a noop and delete the interval.
|
|
741
741
|
if (rebasedEndpoint === "detached") {
|
|
742
742
|
if (localInterval !== undefined &&
|
|
743
743
|
(localInterval === interval || localOpMetadata.type === "add")) {
|
|
744
|
-
|
|
744
|
+
// Use deleteExistingInterval (not removeExistingInterval) to ensure the deleteInterval
|
|
745
|
+
// event is emitted when intervals slide off during rebasing.
|
|
746
|
+
this.deleteExistingInterval({ interval: localInterval, local: true });
|
|
745
747
|
}
|
|
746
748
|
return undefined;
|
|
747
749
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalCollection.js","sourceRoot":"","sources":["../src/intervalCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA+B;A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AAC;IAED;;OAEG;IACI,gBAAgB,CAAC,GAAW;QAClC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC3B,MAAM,IAAI,uBAAY,CAAC,+BAA+B,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,GAAW;QAC9B,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC3B,MAAM,IAAI,uBAAY,CAAC,+BAA+B,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAChE,CAAC;CACD;AAhlCD,gDAglCC;AAED,SAAS,gBAAgB,CAAC,IAA4B;IACrD,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC3B,OAAO,GAAG,OAAO,GAAG,CAAC,wBAAa,CAAC,YAAY,CAAC;IAChD,OAAO,GAAG,OAAO,GAAG,wBAAa,CAAC,aAAa,CAAC;IAChD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACxB,CAAC;AAiBD;;;;;;GAMG;AACH,SAAgB,2BAA2B,CAC1C,iBAAyC;IAEzC,MAAM,EAAE,QAAQ,EAAE,CAAC,iCAAsB,CAAC,EAAE,mBAAmB,EAAE,GAChE,iBAAiB,CAAC,UAAU,IAAI,EAAE,CAAC;IACpC,OAAO,QAAQ,IAAI,mBAAmB,EAAE,MAAM,KAAK,CAAC;QACnD,CAAC,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE;QAC7C,CAAC,CAAC,SAAS,CAAC;AACd,CAAC;AARD,kEAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IEvent } from \"@fluidframework/core-interfaces\";\nimport {\n\tassert,\n\tDoublyLinkedList,\n\tunreachableCase,\n\ttype ListNode,\n} from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tClient,\n\tISegment,\n\tLocalReferencePosition,\n\tPropertySet,\n\tReferenceType,\n\tgetSlideToSegoff,\n\trefTypeIncludesFlag,\n\treservedRangeLabelsKey,\n\tSide,\n\tSequencePlace,\n\tendpointPosAndSide,\n\ttype ISegmentInternal,\n\tcreateLocalReconnectingPerspective,\n\tSlidingPreference,\n} from \"@fluidframework/merge-tree/internal\";\nimport { LoggingError, UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n\tIntervalMessageLocalMetadata,\n\tSequenceOptions,\n\ttype IIntervalCollectionTypeOperationValue,\n\ttype IntervalAddLocalMetadata,\n\ttype IntervalChangeLocalMetadata,\n} from \"./intervalCollectionMapInterfaces.js\";\nimport {\n\tcreateIdIntervalIndex,\n\tEndpointIndex,\n\tOverlappingIntervalsIndex,\n\ttype IEndpointIndex,\n\ttype IIdIntervalIndex,\n\ttype ISequenceOverlappingIntervalsIndex,\n\ttype SequenceIntervalIndex,\n} from \"./intervalIndex/index.js\";\nimport {\n\tCompressedSerializedInterval,\n\tISerializedInterval,\n\tIntervalStickiness,\n\tIntervalType,\n\tSequenceInterval,\n\tSequenceIntervalClass,\n\tSerializedIntervalDelta,\n\tcreatePositionReferenceFromSegoff,\n\tcreateSequenceInterval,\n\tgetSerializedProperties,\n} from \"./intervals/index.js\";\n\nexport type ISerializedIntervalCollectionV1 = ISerializedInterval[];\n\nexport interface ISerializedIntervalCollectionV2 {\n\tlabel: string;\n\tversion: 2;\n\tintervals: CompressedSerializedInterval[];\n}\n\nfunction sidesFromStickiness(stickiness: IntervalStickiness) {\n\tconst startSide = (stickiness & IntervalStickiness.START) !== 0 ? Side.After : Side.Before;\n\tconst endSide = (stickiness & IntervalStickiness.END) !== 0 ? Side.Before : Side.After;\n\n\treturn { startSide, endSide };\n}\n\n/**\n * Decompress an interval after loading a summary from JSON. The exact format\n * of this compression is unspecified and subject to change\n */\nfunction decompressInterval(\n\tinterval: CompressedSerializedInterval,\n\tlabel?: string,\n): ISerializedInterval {\n\tconst stickiness = interval[5] ?? IntervalStickiness.END;\n\tconst { startSide, endSide } = sidesFromStickiness(stickiness);\n\treturn {\n\t\tstart: interval[0],\n\t\tend: interval[1],\n\t\tsequenceNumber: interval[2],\n\t\tintervalType: interval[3],\n\t\tproperties: { ...interval[4], [reservedRangeLabelsKey]: [label] },\n\t\tstickiness,\n\t\tstartSide,\n\t\tendSide,\n\t};\n}\n\n/**\n * Compress an interval prior to serialization as JSON. The exact format of this\n * compression is unspecified and subject to change\n */\nfunction compressInterval(interval: ISerializedInterval): CompressedSerializedInterval {\n\tconst { start, end, sequenceNumber, intervalType, properties } = interval;\n\n\tlet base: CompressedSerializedInterval = [\n\t\tstart,\n\t\tend,\n\t\tsequenceNumber,\n\t\tintervalType,\n\t\t// remove the `referenceRangeLabels` property as it is already stored\n\t\t// in the `label` field of the summary\n\t\t{ ...properties, [reservedRangeLabelsKey]: undefined },\n\t];\n\n\tif (interval.stickiness !== undefined && interval.stickiness !== IntervalStickiness.END) {\n\t\t// reassignment to make it easier for typescript to reason about types\n\t\tbase = [...base, interval.stickiness];\n\t}\n\n\treturn base;\n}\n\nexport function toSequencePlace(\n\tpos: number | \"start\" | \"end\",\n\tside: Side | undefined,\n): SequencePlace {\n\treturn typeof pos === \"number\" && side !== undefined ? { pos, side } : pos;\n}\n\nexport function toOptionalSequencePlace(\n\tpos: number | \"start\" | \"end\" | undefined,\n\tside: Side | undefined,\n): SequencePlace | undefined {\n\treturn typeof pos === \"number\" && side !== undefined ? { pos, side } : pos;\n}\n\nexport class LocalIntervalCollection {\n\tpublic readonly overlappingIntervalsIndex: ISequenceOverlappingIntervalsIndex;\n\tpublic readonly idIntervalIndex: IIdIntervalIndex;\n\tpublic readonly endIntervalIndex: IEndpointIndex;\n\tprivate readonly indexes: Set<SequenceIntervalIndex>;\n\n\tconstructor(\n\t\tprivate readonly client: Client,\n\t\tprivate readonly label: string,\n\t\tprivate readonly options: Partial<SequenceOptions>,\n\t\t/** Callback invoked each time one of the endpoints of an interval slides. */\n\t\tprivate readonly onPositionChange?: (\n\t\t\tinterval: SequenceIntervalClass,\n\t\t\tpreviousInterval: SequenceIntervalClass,\n\t\t) => void,\n\t) {\n\t\tthis.overlappingIntervalsIndex = new OverlappingIntervalsIndex(client);\n\t\tthis.idIntervalIndex = createIdIntervalIndex();\n\t\tthis.endIntervalIndex = new EndpointIndex(client);\n\t\tthis.indexes = new Set([\n\t\t\tthis.overlappingIntervalsIndex,\n\t\t\tthis.idIntervalIndex,\n\t\t\tthis.endIntervalIndex,\n\t\t]);\n\t}\n\n\t/**\n\t * Validates that a serialized interval has the ID property. Creates an ID\n\t * if one does not already exist\n\t *\n\t * @param serializedInterval - The interval to be checked\n\t * @returns The interval's existing or newly created id\n\t */\n\n\tprivate removeIntervalFromIndexes(interval: SequenceIntervalClass) {\n\t\tfor (const index of this.indexes) {\n\t\t\tindex.remove(interval);\n\t\t}\n\t}\n\n\tpublic appendIndex(index: SequenceIntervalIndex) {\n\t\tthis.indexes.add(index);\n\t}\n\n\tpublic removeIndex(index: SequenceIntervalIndex): boolean {\n\t\treturn this.indexes.delete(index);\n\t}\n\n\tpublic removeExistingInterval(interval: SequenceIntervalClass) {\n\t\tthis.removeIntervalFromIndexes(interval);\n\t\tthis.removeIntervalListeners(interval);\n\t}\n\n\tpublic addInterval(\n\t\tid: string,\n\t\tstart: SequencePlace,\n\t\tend: SequencePlace,\n\t\tprops?: PropertySet,\n\t\top?: ISequencedDocumentMessage,\n\t) {\n\t\t// This check is intended to prevent scenarios where a random interval is created and then\n\t\t// inserted into a collection. The aim is to ensure that the collection is created first\n\t\t// then the user can create/add intervals based on the collection\n\t\tif (\n\t\t\tprops?.[reservedRangeLabelsKey] !== undefined &&\n\t\t\tprops[reservedRangeLabelsKey][0] !== this.label\n\t\t) {\n\t\t\tthrow new LoggingError(\n\t\t\t\t\"Adding an interval that belongs to another interval collection is not permitted\",\n\t\t\t);\n\t\t}\n\t\tconst interval: SequenceIntervalClass = createSequenceInterval(\n\t\t\tthis.label,\n\t\t\tid,\n\t\t\tstart,\n\t\t\tend,\n\t\t\tthis.client,\n\t\t\tIntervalType.SlideOnRemove,\n\t\t\top,\n\t\t\tundefined,\n\t\t\tthis.options.mergeTreeReferencesCanSlideToEndpoint,\n\t\t\tprops,\n\t\t\tfalse,\n\t\t);\n\n\t\tthis.add(interval);\n\t\treturn interval;\n\t}\n\n\tprivate linkEndpointsToInterval(interval: SequenceIntervalClass): void {\n\t\tinterval.start.addProperties({ interval });\n\t\tinterval.end.addProperties({ interval });\n\t}\n\n\tprivate addIntervalToIndexes(interval: SequenceIntervalClass) {\n\t\tfor (const index of this.indexes) {\n\t\t\tindex.add(interval);\n\t\t}\n\t}\n\n\tpublic add(interval: SequenceIntervalClass): void {\n\t\tthis.linkEndpointsToInterval(interval);\n\t\tthis.addIntervalToIndexes(interval);\n\t\tthis.addIntervalListeners(interval);\n\t}\n\n\tpublic changeInterval(\n\t\tinterval: SequenceIntervalClass,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t) {\n\t\tconst newInterval = interval.modify(\n\t\t\tthis.label,\n\t\t\tstart,\n\t\t\tend,\n\t\t\top,\n\t\t\tlocalSeq,\n\t\t\tthis.options.mergeTreeReferencesCanSlideToEndpoint,\n\t\t);\n\t\tif (newInterval) {\n\t\t\tthis.removeExistingInterval(interval);\n\t\t\tthis.add(newInterval);\n\t\t}\n\t\treturn newInterval;\n\t}\n\n\tpublic serialize(\n\t\tversion: \"1\" | \"2\",\n\t): ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2 {\n\t\tif (version === \"1\") {\n\t\t\treturn Array.from(this.idIntervalIndex, (interval) => interval.serialize());\n\t\t}\n\t\treturn {\n\t\t\tlabel: this.label,\n\t\t\tintervals: Array.from(this.idIntervalIndex, (interval) =>\n\t\t\t\tcompressInterval(interval.serialize()),\n\t\t\t),\n\t\t\tversion: 2,\n\t\t};\n\t}\n\n\tprivate addIntervalListeners(interval: SequenceIntervalClass) {\n\t\tconst cloneRef = (ref: LocalReferencePosition) => {\n\t\t\tconst segment = ref.getSegment();\n\t\t\tif (segment === undefined) {\n\t\t\t\t// Cloning is unnecessary: refs which have slid off the string entirely\n\t\t\t\t// never get slid back on. Creation code for refs doesn't accept undefined segment\n\t\t\t\t// either, so this must be special-cased.\n\t\t\t\treturn ref;\n\t\t\t}\n\n\t\t\treturn this.client.createLocalReferencePosition(\n\t\t\t\tsegment,\n\t\t\t\tref.getOffset(),\n\t\t\t\tReferenceType.Transient,\n\t\t\t\tref.properties,\n\t\t\t\tref.slidingPreference,\n\t\t\t\tref.canSlideToEndpoint,\n\t\t\t);\n\t\t};\n\t\tlet previousInterval: SequenceIntervalClass | undefined;\n\t\tlet pendingChanges = 0;\n\t\tinterval.addPositionChangeListeners(\n\t\t\t() => {\n\t\t\t\tpendingChanges++;\n\t\t\t\t// Note: both start and end can change and invoke beforeSlide on each endpoint before afterSlide.\n\t\t\t\tif (!previousInterval) {\n\t\t\t\t\tpreviousInterval = interval.clone();\n\t\t\t\t\tpreviousInterval.start = cloneRef(previousInterval.start);\n\t\t\t\t\tpreviousInterval.end = cloneRef(previousInterval.end);\n\t\t\t\t\tthis.removeIntervalFromIndexes(interval);\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tassert(\n\t\t\t\t\tpreviousInterval !== undefined,\n\t\t\t\t\t0x3fa /* Invalid interleaving of before/after slide */,\n\t\t\t\t);\n\t\t\t\tpendingChanges--;\n\t\t\t\tif (pendingChanges === 0) {\n\t\t\t\t\tthis.addIntervalToIndexes(interval);\n\t\t\t\t\tthis.onPositionChange?.(interval, previousInterval);\n\t\t\t\t\tpreviousInterval = undefined;\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n\n\tprivate removeIntervalListeners(interval: SequenceIntervalClass) {\n\t\tinterval.removePositionChangeListeners();\n\t}\n}\n\n/**\n * @legacy @beta\n */\nexport type DeserializeCallback = (properties: PropertySet) => void;\n\nclass IntervalCollectionIterator implements Iterator<SequenceIntervalClass> {\n\tprivate readonly results: SequenceIntervalClass[];\n\tprivate index: number;\n\n\tconstructor(\n\t\tcollection: IntervalCollection,\n\t\titeratesForward: boolean = true,\n\t\tstart?: number,\n\t\tend?: number,\n\t) {\n\t\tthis.results = [];\n\t\tthis.index = 0;\n\n\t\tcollection.gatherIterationResults(this.results, iteratesForward, start, end);\n\t}\n\n\tpublic next(): IteratorResult<SequenceIntervalClass> {\n\t\tif (this.index < this.results.length) {\n\t\t\treturn {\n\t\t\t\tvalue: this.results[this.index++],\n\t\t\t\tdone: false,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: undefined,\n\t\t\tdone: true,\n\t\t};\n\t}\n}\n\n/**\n * Change events emitted by `IntervalCollection`s\n * @legacy @beta\n */\nexport interface ISequenceIntervalCollectionEvents extends IEvent {\n\t/**\n\t * This event is invoked whenever the endpoints of an interval may have changed.\n\t * This can happen on:\n\t * - local endpoint modification\n\t * - ack of a remote endpoint modification\n\t * - position change due to segment sliding (slides due to mergeTree segment deletion will always appear local)\n\t * The `interval` argument reflects the new values.\n\t * `previousInterval` contains transient `ReferencePosition`s at the same location as the interval's original\n\t * endpoints. These references should be used for position information only.\n\t * `local` reflects whether the change originated locally.\n\t * `op` is defined if and only if the server has acked this change.\n\t * `slide` is true if the change is due to sliding on removal of position\n\t */\n\t(\n\t\tevent: \"changeInterval\",\n\t\tlistener: (\n\t\t\tinterval: SequenceInterval,\n\t\t\tpreviousInterval: SequenceInterval,\n\t\t\tlocal: boolean,\n\t\t\top: ISequencedDocumentMessage | undefined,\n\t\t\tslide: boolean,\n\t\t) => void,\n\t): void;\n\t/**\n\t * This event is invoked whenever an interval is added or removed from the collection.\n\t * `local` reflects whether the change originated locally.\n\t * `op` is defined if and only if the server has acked this change.\n\t */\n\t(\n\t\tevent: \"addInterval\" | \"deleteInterval\",\n\t\tlistener: (\n\t\t\tinterval: SequenceInterval,\n\t\t\tlocal: boolean,\n\t\t\top: ISequencedDocumentMessage | undefined,\n\t\t) => void,\n\t): void;\n\t/**\n\t * This event is invoked whenever an interval's properties have changed.\n\t * `interval` reflects the state of the updated properties.\n\t * `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose\n\t * values contain all previous values of the property set.\n\t * This object can be used directly in a call to `changeProperties` to revert the property change if desired.\n\t * `local` reflects whether the change originated locally.\n\t * `op` is defined if and only if the server has acked this change.\n\t */\n\t(\n\t\tevent: \"propertyChanged\",\n\t\tlistener: (\n\t\t\tinterval: SequenceInterval,\n\t\t\tpropertyDeltas: PropertySet,\n\t\t\tlocal: boolean,\n\t\t\top: ISequencedDocumentMessage | undefined,\n\t\t) => void,\n\t): void;\n\t/**\n\t * This event is invoked whenever an interval's endpoints or properties (or both) have changed.\n\t * `interval` reflects the state of the updated endpoints or properties.\n\t * `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose\n\t * values contain all previous values of the property set.\n\t * This object can be used directly in a call to `changeProperties` to revert the property change if desired.\n\t * 'previousInterval' contains transient `ReferencePosition`s at the same location as the interval's original\n\t * endpoints. These references should be used for position information only. In the case of a property change\n\t * only, this argument should be undefined.\n\t * `local` reflects whether the change originated locally.\n\t * `slide` is true if the change is due to sliding on removal of position.\n\t */\n\t(\n\t\tevent: \"changed\",\n\t\tlistener: (\n\t\t\tinterval: SequenceInterval,\n\t\t\tpropertyDeltas: PropertySet,\n\t\t\tpreviousInterval: SequenceInterval | undefined,\n\t\t\tlocal: boolean,\n\t\t\tslide: boolean,\n\t\t) => void,\n\t): void;\n}\n\n/**\n * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.\n * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).\n * @legacy @beta\n */\nexport interface ISequenceIntervalCollection\n\textends TypedEventEmitter<ISequenceIntervalCollectionEvents> {\n\treadonly attached: boolean;\n\t/**\n\t * Attaches an index to this collection.\n\t * All intervals which are part of this collection will be added to the index, and the index will automatically\n\t * be updated when this collection updates due to local or remote changes.\n\t *\n\t * @remarks After attaching an index to an interval collection, applications should typically store this\n\t * index somewhere in their in-memory data model for future reference and querying.\n\t */\n\tattachIndex(index: SequenceIntervalIndex): void;\n\t/**\n\t * Detaches an index from this collection.\n\t * All intervals which are part of this collection will be removed from the index, and updates to this collection\n\t * due to local or remote changes will no longer incur updates to the index.\n\t *\n\t * @returns `false` if the target index cannot be found in the indexes, otherwise remove all intervals in the index and return `true`.\n\t */\n\tdetachIndex(index: SequenceIntervalIndex): boolean;\n\t/**\n\t * @returns the interval in this collection that has the provided `id`.\n\t * If no interval in the collection has this `id`, returns `undefined`.\n\t */\n\tgetIntervalById(id: string): SequenceInterval | undefined;\n\t/**\n\t * Creates a new interval and add it to the collection.\n\t * @param start - interval start position (inclusive)\n\t * @param end - interval end position (exclusive)\n\t * @param props - properties of the interval\n\t * @returns the created interval\n\t * @remarks See documentation on {@link SequenceInterval} for comments on\n\t * interval endpoint semantics: there are subtleties with how the current\n\t * half-open behavior is represented.\n\t *\n\t * Note that intervals may behave unexpectedly if the entire contents\n\t * of the string are deleted. In this case, it is possible for one endpoint\n\t * of the interval to become detached, while the other remains on the string.\n\t *\n\t * By adjusting the `side` and `pos` values of the `start` and `end` parameters,\n\t * it is possible to control whether the interval expands to include content\n\t * inserted at its start or end.\n\t *\n\t *\tSee {@link @fluidframework/merge-tree#SequencePlace} for more details on the model.\n\t *\n\t *\t@example\n\t *\n\t *\tGiven the string \"ABCD\":\n\t *\n\t *```typescript\n\t *\t// Refers to \"BC\". If any content is inserted before B or after C, this\n\t *\t// interval will include that content\n\t *\t//\n\t *\t// Picture:\n\t *\t// \\{start\\} - A[- B - C -]D - \\{end\\}\n\t *\t// \\{start\\} - A - B - C - D - \\{end\\}\n\t *\tcollection.add(\\{ pos: 0, side: Side.After \\}, \\{ pos: 3, side: Side.Before \\}, IntervalType.SlideOnRemove);\n\t *\t// Equivalent to specifying the same positions and Side.Before.\n\t *\t// Refers to \"ABC\". Content inserted after C will be included in the\n\t *\t// interval, but content inserted before A will not.\n\t *\t// \\{start\\} -[A - B - C -]D - \\{end\\}\n\t *\t// \\{start\\} - A - B - C - D - \\{end\\}\n\t *\tcollection.add(0, 3, IntervalType.SlideOnRemove);\n\t *```\n\t *\n\t * In the case of the first example, if text is deleted,\n\t *\n\t * ```typescript\n\t *\t// Delete the character \"B\"\n\t *\tstring.removeRange(1, 2);\n\t * ```\n\t *\n\t * The start point of the interval will slide to the position immediately\n\t * before \"C\", and the same will be true.\n\t *\n\t * ```\n\t * \\{start\\} - A[- C -]D - \\{end\\}\n\t * ```\n\t *\n\t * In this case, text inserted immediately before \"C\" would be included in\n\t * the interval.\n\t *\n\t * ```typescript\n\t * string.insertText(1, \"EFG\");\n\t * ```\n\t *\n\t * With the string now being,\n\t *\n\t * ```\n\t * \\{start\\} - A[- E - F - G - C -]D - \\{end\\}\n\t * ```\n\t *\n\t * @privateRemarks TODO: ADO:5205 the above comment regarding behavior in\n\t * the case that the entire interval has been deleted should be resolved at\n\t * the same time as this ticket\n\t */\n\tadd({\n\t\tstart,\n\t\tend,\n\t\tprops,\n\t}: {\n\t\tstart: SequencePlace;\n\t\tend: SequencePlace;\n\t\tprops?: PropertySet;\n\t}): SequenceInterval;\n\t/**\n\t * Removes an interval from the collection.\n\t * @param id - Id of the interval to remove\n\t * @returns the removed interval\n\t */\n\tremoveIntervalById(id: string): SequenceInterval | undefined;\n\t/**\n\t * Changes the endpoints, properties, or both of an existing interval.\n\t * @param id - Id of the Interval to change\n\t * @returns the interval that was changed, if it existed in the collection.\n\t * Pass the desired new start position, end position, and/or properties in an object. Start and end positions must be changed\n\t * simultaneously - they must either both be specified or both undefined. To only change the properties, leave both endpoints\n\t * undefined. To only change the endpoints, leave the properties undefined.\n\t */\n\tchange(\n\t\tid: string,\n\t\t{ start, end, props }: { start?: SequencePlace; end?: SequencePlace; props?: PropertySet },\n\t): SequenceInterval | undefined;\n\n\t/**\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t */\n\tattachDeserializer(onDeserialize: DeserializeCallback): void;\n\t/**\n\t * @returns an iterator over all intervals in this collection.\n\t */\n\t[Symbol.iterator](): Iterator<SequenceInterval>;\n\n\t/**\n\t * @returns a forward iterator over all intervals in this collection with start point equal to `startPosition`.\n\t */\n\tCreateForwardIteratorWithStartPosition(startPosition: number): Iterator<SequenceInterval>;\n\n\t/**\n\t * @returns a backward iterator over all intervals in this collection with start point equal to `startPosition`.\n\t */\n\tCreateBackwardIteratorWithStartPosition(startPosition: number): Iterator<SequenceInterval>;\n\n\t/**\n\t * @returns a forward iterator over all intervals in this collection with end point equal to `endPosition`.\n\t */\n\tCreateForwardIteratorWithEndPosition(endPosition: number): Iterator<SequenceInterval>;\n\n\t/**\n\t * @returns a backward iterator over all intervals in this collection with end point equal to `endPosition`.\n\t */\n\tCreateBackwardIteratorWithEndPosition(endPosition: number): Iterator<SequenceInterval>;\n\n\t/**\n\t * Gathers iteration results that optionally match a start/end criteria into the provided array.\n\t * @param results - Array to gather the results into. In lieu of a return value, this array will be populated with\n\t * intervals matching the query upon edit.\n\t * @param iteratesForward - whether or not iteration should be in the forward direction\n\t * @param start - If provided, only match intervals whose start point is equal to `start`.\n\t * @param end - If provided, only match intervals whose end point is equal to `end`.\n\t */\n\tgatherIterationResults(\n\t\tresults: SequenceInterval[],\n\t\titeratesForward: boolean,\n\t\tstart?: number,\n\t\tend?: number,\n\t): void;\n\n\t/**\n\t * @deprecated Users must manually attach the corresponding interval index to utilize this functionality, for instance:\n\t *\n\t * ```typescript\n\t * const overlappingIntervalsIndex = createOverlappingIntervalsIndex(sharedString);\n\t * collection.attachIndex(overlappingIntervalsIndex)\n\t * const result = overlappingIntervalsIndex.findOverlappingIntervals(start, end);\n\t * ```\n\t *\n\t * @returns an array of all intervals in this collection that overlap with the interval\n\t * `[startPosition, endPosition]`.\n\t */\n\tfindOverlappingIntervals(startPosition: number, endPosition: number): SequenceInterval[];\n\n\t/**\n\t * Applies a function to each interval in this collection.\n\t */\n\tmap(fn: (interval: SequenceInterval) => void): void;\n\n\t/**\n\t * @deprecated due to the forthcoming change where the endpointIndex will no longer be\n\t * automatically added to the collection. Users are advised to independently attach the\n\t * index to the collection and utilize the API accordingly, for instance:\n\t * ```typescript\n\t * const endpointIndex = createEndpointIndex(sharedString);\n\t * collection.attachIndex(endpointIndex);\n\t * const result1 = endpointIndex.previousInterval(pos);\n\t * ```\n\t * If an index is used repeatedly, applications should generally attach it once and store it in memory.\n\t */\n\tpreviousInterval(pos: number): SequenceInterval | undefined;\n\n\t/**\n\t * @deprecated due to the forthcoming change where the endpointIndex will no longer be\n\t * automatically added to the collection. Users are advised to independently attach the\n\t * index to the collection and utilize the API accordingly, for instance:\n\t * ```typescript\n\t * const endpointIndex = createEndpointIndex(sharedString);\n\t * collection.attachIndex(endpointIndex);\n\t * const result2 = endpointIndex.nextInterval(pos);\n\t * ```\n\t */\n\tnextInterval(pos: number): SequenceInterval | undefined;\n}\n\ntype PendingChanges = Partial<\n\tRecord<\n\t\tstring,\n\t\t{\n\t\t\t/**\n\t\t\t * The local metadatas are stores in order of submission, FIFO.\n\t\t\t * This matches how ops are ordered, and should maintained\n\t\t\t * across, submit, process, resubmit, and rollback.\n\t\t\t */\n\t\t\tlocal: DoublyLinkedList<IntervalMessageLocalMetadata>;\n\t\t\t/**\n\t\t\t * The endpointChanges are unordered, and are used to determine\n\t\t\t * if any local changes also change the endpoints. The nodes of the\n\t\t\t * list are also stored in the individual change op metadatas, and\n\t\t\t * are removed as those metadatas are handled.\n\t\t\t */\n\t\t\tendpointChanges?: DoublyLinkedList<\n\t\t\t\tIntervalAddLocalMetadata | IntervalChangeLocalMetadata\n\t\t\t>;\n\t\t\tconsensus: SequenceIntervalClass | undefined;\n\t\t}\n\t>\n>;\n\nfunction removeMetadataFromPendingChanges(\n\tlocalOpMetadataNode: ListNode<IntervalMessageLocalMetadata> | unknown,\n): IntervalMessageLocalMetadata {\n\tconst acked = (localOpMetadataNode as ListNode<IntervalMessageLocalMetadata>)?.remove()\n\t\t?.data;\n\tassert(acked !== undefined, 0xbbe /* local change must exist */);\n\tacked.endpointChangesNode?.remove();\n\treturn acked;\n}\n\nfunction clearEmptyPendingEntry(pendingChanges: PendingChanges, id: string) {\n\tconst pending = pendingChanges[id];\n\tif (pending?.local.empty) {\n\t\tassert(\n\t\t\tpending.endpointChanges?.empty !== false,\n\t\t\t0xbc0 /* endpointChanges must be empty if not pending changes */,\n\t\t);\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete pendingChanges[id];\n\t}\n\treturn pending;\n}\n\nfunction hasEndpointChanges(\n\tserialized: SerializedIntervalDelta,\n): serialized is ISerializedInterval {\n\treturn serialized.start !== undefined && serialized.end !== undefined;\n}\n\n/**\n * {@inheritdoc IIntervalCollection}\n */\nexport class IntervalCollection\n\textends TypedEventEmitter<ISequenceIntervalCollectionEvents>\n\timplements ISequenceIntervalCollection\n{\n\tprivate savedSerializedIntervals?: ISerializedIntervalCollectionV1;\n\tprivate localCollection: LocalIntervalCollection | undefined;\n\tprivate onDeserialize: DeserializeCallback | undefined;\n\tprivate client: Client | undefined;\n\n\tprivate readonly pending: PendingChanges = {};\n\n\tpublic get attached(): boolean {\n\t\treturn !!this.localCollection;\n\t}\n\n\tprivate readonly submitDelta: (\n\t\top: IIntervalCollectionTypeOperationValue,\n\t\tmd: IntervalMessageLocalMetadata,\n\t\tconsensus?: SequenceIntervalClass,\n\t) => void;\n\n\tconstructor(\n\t\tsubmitDelta: (op: IIntervalCollectionTypeOperationValue, md: unknown) => void,\n\t\tserializedIntervals: ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2,\n\t\tprivate readonly options: Partial<SequenceOptions> = {},\n\t) {\n\t\tsuper();\n\n\t\tthis.submitDelta = (op, md, consensus) => {\n\t\t\tconst { id } = getSerializedProperties(op.value);\n\t\t\tconst pending = (this.pending[id] ??= {\n\t\t\t\tlocal: new DoublyLinkedList(),\n\t\t\t\tconsensus,\n\t\t\t});\n\t\t\tif (md.type === \"add\" || (md.type === \"change\" && hasEndpointChanges(op.value))) {\n\t\t\t\tconst endpointChanges = (pending.endpointChanges ??= new DoublyLinkedList());\n\t\t\t\tmd.endpointChangesNode = endpointChanges.push(md).last;\n\t\t\t}\n\t\t\tsubmitDelta(op, pending.local.push(md).last);\n\t\t};\n\n\t\tthis.savedSerializedIntervals = Array.isArray(serializedIntervals)\n\t\t\t? serializedIntervals\n\t\t\t: serializedIntervals.intervals.map((i) =>\n\t\t\t\t\tdecompressInterval(i, serializedIntervals.label),\n\t\t\t\t);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.attachIndex}\n\t */\n\tpublic attachIndex(index: SequenceIntervalIndex): void {\n\t\tif (!this.attached) {\n\t\t\tthrow new LoggingError(\"The local interval collection must exist\");\n\t\t}\n\t\tfor (const interval of this) {\n\t\t\tindex.add(interval);\n\t\t}\n\n\t\tthis.localCollection?.appendIndex(index);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.detachIndex}\n\t */\n\tpublic detachIndex(index: SequenceIntervalIndex): boolean {\n\t\tif (!this.attached) {\n\t\t\tthrow new LoggingError(\"The local interval collection must exist\");\n\t\t}\n\n\t\t// Avoid removing intervals if the index does not exist\n\t\tif (!this.localCollection?.removeIndex(index)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (const interval of this) {\n\t\t\tindex.remove(interval);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic rollback(op: IIntervalCollectionTypeOperationValue, maybeMetadata: unknown) {\n\t\tconst localOpMetadata = removeMetadataFromPendingChanges(maybeMetadata);\n\t\tconst { value } = op;\n\t\tconst { id, properties } = getSerializedProperties(value);\n\t\tconst pending = clearEmptyPendingEntry(this.pending, id);\n\t\tconst previous = pending?.local.empty\n\t\t\t? pending.consensus\n\t\t\t: pending?.local.last?.data.interval;\n\t\tconst { type, interval } = localOpMetadata;\n\t\tswitch (type) {\n\t\t\tcase \"add\": {\n\t\t\t\tthis.deleteExistingInterval({ interval, local: true, rollback: true });\n\t\t\t\tinterval.dispose();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"change\": {\n\t\t\t\tconst changeProperties = Object.keys(properties).length > 0;\n\t\t\t\tconst deltaProps = changeProperties\n\t\t\t\t\t? interval.changeProperties(properties, undefined, true)\n\t\t\t\t\t: undefined;\n\t\t\t\tif (localOpMetadata.endpointChangesNode !== undefined) {\n\t\t\t\t\tif (previous !== undefined) {\n\t\t\t\t\t\tthis.localCollection?.removeExistingInterval(interval);\n\t\t\t\t\t\tthis.localCollection?.add(previous);\n\t\t\t\t\t\tthis.emitChange(previous, interval, true, true);\n\t\t\t\t\t}\n\t\t\t\t\tif (previous !== interval) {\n\t\t\t\t\t\tinterval.dispose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (changeProperties) {\n\t\t\t\t\tthis.emit(\"propertyChanged\", previous, deltaProps, true, undefined);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"delete\": {\n\t\t\t\t// a remote could delete the same interval, so it may not exist to re-add\n\t\t\t\tif (previous !== undefined) {\n\t\t\t\t\tthis.localCollection?.add(previous);\n\t\t\t\t\tthis.emit(\"addInterval\", previous, true, undefined);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tunreachableCase(type);\n\t\t}\n\t}\n\n\tpublic process(\n\t\top: IIntervalCollectionTypeOperationValue,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage,\n\t\tmaybeMetadata: unknown,\n\t) {\n\t\tconst localOpMetadata = local\n\t\t\t? removeMetadataFromPendingChanges(maybeMetadata)\n\t\t\t: undefined;\n\n\t\tconst { opName, value } = op;\n\t\tconst { id } = getSerializedProperties(value);\n\t\tassert(\n\t\t\t(local === false && localOpMetadata === undefined) || opName === localOpMetadata?.type,\n\t\t\t0xbc1 /* must be same type */,\n\t\t);\n\t\tlet newConsensus = localOpMetadata?.interval;\n\t\tswitch (opName) {\n\t\t\tcase \"add\": {\n\t\t\t\tnewConsensus = this.ackAdd(\n\t\t\t\t\tvalue,\n\t\t\t\t\tlocal,\n\t\t\t\t\tmessage,\n\t\t\t\t\t// this cast is safe because of the above assert which\n\t\t\t\t\t// validates the op and metadata types match for local changes\n\t\t\t\t\tlocalOpMetadata as IntervalAddLocalMetadata | undefined,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"delete\": {\n\t\t\t\tthis.ackDelete(value, local, message);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"change\": {\n\t\t\t\tnewConsensus = this.ackChange(\n\t\t\t\t\tvalue,\n\t\t\t\t\tlocal,\n\t\t\t\t\tmessage, // this cast is safe because of the above assert which\n\t\t\t\t\t// validates the op and metadata types match for local changes\n\t\t\t\t\tlocalOpMetadata as IntervalChangeLocalMetadata | undefined,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tunreachableCase(opName);\n\t\t}\n\t\tconst pending = clearEmptyPendingEntry(this.pending, id);\n\n\t\tif (pending !== undefined) {\n\t\t\tpending.consensus = newConsensus;\n\t\t}\n\t}\n\n\tpublic resubmitMessage(\n\t\top: IIntervalCollectionTypeOperationValue,\n\t\tmaybeMetadata: unknown,\n\t\tsquash: boolean,\n\t): void {\n\t\tconst { opName, value } = op;\n\n\t\tconst localOpMetadata = removeMetadataFromPendingChanges(maybeMetadata);\n\n\t\tconst rebasedValue =\n\t\t\tlocalOpMetadata.endpointChangesNode === undefined\n\t\t\t\t? value\n\t\t\t\t: this.rebaseLocalInterval(value, localOpMetadata, squash);\n\n\t\tif (rebasedValue === undefined) {\n\t\t\tconst { id } = getSerializedProperties(value);\n\t\t\tclearEmptyPendingEntry(this.pending, id);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.submitDelta({ opName, value: rebasedValue as any }, localOpMetadata);\n\t}\n\n\tpublic applyStashedOp(op: IIntervalCollectionTypeOperationValue): void {\n\t\tconst { opName, value } = op;\n\t\tconst { id, properties } = getSerializedProperties(value);\n\t\tswitch (opName) {\n\t\t\tcase \"add\": {\n\t\t\t\tthis.add({\n\t\t\t\t\tid,\n\t\t\t\t\t// Todo: we should improve typing so we know add ops always have start and end\n\t\t\t\t\tstart: toSequencePlace(value.start, value.startSide),\n\t\t\t\t\tend: toSequencePlace(value.end, value.endSide),\n\t\t\t\t\tprops: properties,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"change\": {\n\t\t\t\tthis.change(id, {\n\t\t\t\t\tstart: toOptionalSequencePlace(value.start, value.startSide),\n\t\t\t\t\tend: toOptionalSequencePlace(value.end, value.endSide),\n\t\t\t\t\tprops: properties,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"delete\": {\n\t\t\t\tthis.removeIntervalById(id);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"unknown ops should not be stashed\");\n\t\t}\n\t}\n\n\tprivate rebaseReferenceWithSegmentSlide(\n\t\tref: LocalReferencePosition,\n\t\tlocalSeq: number,\n\t\tsquash: boolean,\n\t): { segment: ISegment; offset: number } | undefined {\n\t\tif (!this.client) {\n\t\t\tthrow new LoggingError(\"mergeTree client must exist\");\n\t\t}\n\n\t\tconst { clientId } = this.client.getCollabWindow();\n\t\tconst segment: ISegmentInternal | undefined = ref.getSegment();\n\t\tif (segment?.endpointType) {\n\t\t\treturn { segment, offset: 0 };\n\t\t}\n\t\tconst offset = ref.getOffset();\n\n\t\tconst segoff = getSlideToSegoff(\n\t\t\tsegment === undefined ? undefined : { segment, offset },\n\t\t\tref.slidingPreference,\n\t\t\tcreateLocalReconnectingPerspective(\n\t\t\t\tthis.client.getCurrentSeq(),\n\t\t\t\tclientId,\n\t\t\t\tlocalSeq,\n\t\t\t\tsquash,\n\t\t\t),\n\t\t\tref.canSlideToEndpoint,\n\t\t);\n\n\t\t// case happens when rebasing op, but concurrently entire string has been deleted\n\t\tif (segoff === undefined) {\n\t\t\tif (ref.canSlideToEndpoint !== true) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tsegment:\n\t\t\t\t\tref.slidingPreference === SlidingPreference.FORWARD\n\t\t\t\t\t\t? this.client.endOfTree\n\t\t\t\t\t\t: this.client.startOfTree,\n\t\t\t\toffset: 0,\n\t\t\t};\n\t\t}\n\t\treturn segoff;\n\t}\n\n\tprivate computeRebasedPositions(\n\t\tlocalOpMetadata: IntervalAddLocalMetadata | IntervalChangeLocalMetadata,\n\t\tsquash: boolean,\n\t): Record<\"start\" | \"end\", { segment: ISegmentInternal; offset: number }> | \"detached\" {\n\t\tassert(\n\t\t\tthis.client !== undefined,\n\t\t\t0x550 /* Client should be defined when computing rebased position */,\n\t\t);\n\n\t\tconst { localSeq, interval } = localOpMetadata;\n\t\tconst start = this.rebaseReferenceWithSegmentSlide(interval.start, localSeq, squash);\n\t\tif (start === undefined) {\n\t\t\treturn \"detached\";\n\t\t}\n\t\tconst end = this.rebaseReferenceWithSegmentSlide(interval.end, localSeq, squash);\n\t\tif (end === undefined) {\n\t\t\treturn \"detached\";\n\t\t}\n\t\treturn { start, end };\n\t}\n\n\tpublic attachGraph(client: Client, label: string) {\n\t\tif (this.attached) {\n\t\t\tthrow new LoggingError(\"Only supports one Sequence attach\");\n\t\t}\n\n\t\tif (client === undefined) {\n\t\t\tthrow new LoggingError(\"Client required for this collection\");\n\t\t}\n\n\t\t// Instantiate the local interval collection based on the saved intervals\n\t\tthis.client = client;\n\t\tif (client) {\n\t\t\tclient.on(\"normalize\", (squash) => {\n\t\t\t\tfor (const pending of Object.values(this.pending)) {\n\t\t\t\t\tif (pending?.endpointChanges !== undefined) {\n\t\t\t\t\t\tfor (const local of pending.endpointChanges) {\n\t\t\t\t\t\t\tthis.rebaseLocalInterval(local.data.interval.serialize(), local.data, squash);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tthis.localCollection = new LocalIntervalCollection(\n\t\t\tclient,\n\t\t\tlabel,\n\t\t\tthis.options,\n\t\t\t(interval, previousInterval) => this.emitChange(interval, previousInterval, true, true),\n\t\t);\n\t\tif (this.savedSerializedIntervals) {\n\t\t\tfor (const serializedInterval of this.savedSerializedIntervals) {\n\t\t\t\tconst { id, properties } = getSerializedProperties(serializedInterval);\n\t\t\t\tconst {\n\t\t\t\t\tstart: startPos,\n\t\t\t\t\tend: endPos,\n\t\t\t\t\tintervalType,\n\t\t\t\t\tstartSide,\n\t\t\t\t\tendSide,\n\t\t\t\t} = serializedInterval;\n\t\t\t\tconst start =\n\t\t\t\t\ttypeof startPos === \"number\" && startSide !== undefined\n\t\t\t\t\t\t? { pos: startPos, side: startSide }\n\t\t\t\t\t\t: startPos;\n\t\t\t\tconst end =\n\t\t\t\t\ttypeof endPos === \"number\" && endSide !== undefined\n\t\t\t\t\t\t? { pos: endPos, side: endSide }\n\t\t\t\t\t\t: endPos;\n\t\t\t\tconst interval = createSequenceInterval(\n\t\t\t\t\tlabel,\n\t\t\t\t\tid,\n\t\t\t\t\tstart,\n\t\t\t\t\tend,\n\t\t\t\t\tclient,\n\t\t\t\t\tintervalType,\n\t\t\t\t\tundefined,\n\t\t\t\t\ttrue,\n\t\t\t\t\tthis.options.mergeTreeReferencesCanSlideToEndpoint,\n\t\t\t\t\tproperties,\n\t\t\t\t);\n\t\t\t\tthis.localCollection.add(interval);\n\t\t\t}\n\t\t}\n\t\tthis.savedSerializedIntervals = undefined;\n\t}\n\n\t/**\n\t * Gets the next local sequence number, modifying this client's collab window in doing so.\n\t */\n\tprivate getNextLocalSeq(): number {\n\t\tif (this.client) {\n\t\t\treturn ++this.client.getCollabWindow().localSeq;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tprivate emitChange(\n\t\tinterval: SequenceIntervalClass,\n\t\tpreviousInterval: SequenceIntervalClass,\n\t\tlocal: boolean,\n\t\tslide: boolean,\n\t\top?: ISequencedDocumentMessage,\n\t): void {\n\t\t// Temporarily make references transient so that positional queries work (non-transient refs\n\t\t// on resolve to DetachedPosition on any segments that don't contain them). The original refType\n\t\t// is restored as single-endpoint changes re-use previous references.\n\n\t\tconst startRefType = previousInterval.start.refType;\n\t\tconst endRefType = previousInterval.end.refType;\n\t\tpreviousInterval.start.refType = ReferenceType.Transient;\n\t\tpreviousInterval.end.refType = ReferenceType.Transient;\n\t\tthis.emit(\"changeInterval\", interval, previousInterval, local, op, slide);\n\t\tthis.emit(\"changed\", interval, undefined, previousInterval ?? undefined, local, slide);\n\t\tpreviousInterval.start.refType = startRefType;\n\t\tpreviousInterval.end.refType = endRefType;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.getIntervalById}\n\t */\n\tpublic getIntervalById(id: string): SequenceIntervalClass | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attach must be called before accessing intervals\");\n\t\t}\n\t\treturn this.localCollection.idIntervalIndex.getIntervalById(id);\n\t}\n\n\tprivate assertStickinessEnabled(start: SequencePlace, end: SequencePlace) {\n\t\tif (\n\t\t\t!(typeof start === \"number\" && typeof end === \"number\") &&\n\t\t\t!this.options.intervalStickinessEnabled\n\t\t) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"attempted to set interval stickiness without enabling `intervalStickinessEnabled` feature flag\",\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.add}\n\t */\n\tpublic add({\n\t\tid,\n\t\tstart,\n\t\tend,\n\t\tprops,\n\t}: {\n\t\tid?: string;\n\t\tstart: SequencePlace;\n\t\tend: SequencePlace;\n\t\tprops?: PropertySet;\n\t}): SequenceIntervalClass {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attach must be called prior to adding intervals\");\n\t\t}\n\n\t\tconst { startSide, endSide, startPos, endPos } = endpointPosAndSide(start, end);\n\n\t\tassert(\n\t\t\tstartPos !== undefined &&\n\t\t\t\tendPos !== undefined &&\n\t\t\t\tstartSide !== undefined &&\n\t\t\t\tendSide !== undefined,\n\t\t\t0x793 /* start and end cannot be undefined because they were not passed in as undefined */,\n\t\t);\n\n\t\tthis.assertStickinessEnabled(start, end);\n\n\t\tconst intervalId = id ?? uuid();\n\n\t\tconst interval: SequenceIntervalClass = this.localCollection.addInterval(\n\t\t\tintervalId,\n\t\t\ttoSequencePlace(startPos, startSide),\n\t\t\ttoSequencePlace(endPos, endSide),\n\t\t\tprops,\n\t\t\tundefined,\n\t\t);\n\n\t\tif (interval) {\n\t\t\tif (!this.isCollaborating) {\n\t\t\t\tsetSlideOnRemove(interval.start);\n\t\t\t\tsetSlideOnRemove(interval.end);\n\t\t\t}\n\t\t\tconst serializedInterval: ISerializedInterval = interval.serialize();\n\t\t\tconst localSeq = this.getNextLocalSeq();\n\t\t\tif (this.isCollaborating) {\n\t\t\t\tthis.submitDelta(\n\t\t\t\t\t{\n\t\t\t\t\t\topName: \"add\",\n\t\t\t\t\t\tvalue: serializedInterval,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"add\",\n\t\t\t\t\t\tlocalSeq,\n\t\t\t\t\t\tinterval,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.emit(\"addInterval\", interval, true, undefined);\n\n\t\treturn interval;\n\t}\n\n\tprivate deleteExistingInterval({\n\t\tinterval,\n\t\tlocal,\n\t\top,\n\t\trollback,\n\t}: {\n\t\tinterval: SequenceIntervalClass;\n\t\tlocal: boolean;\n\t\top?: ISequencedDocumentMessage;\n\t\trollback?: boolean;\n\t}) {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t}\n\t\t// The given interval is known to exist in the collection.\n\t\tthis.localCollection.removeExistingInterval(interval);\n\n\t\tif (interval) {\n\t\t\t// Local ops get submitted to the server. Remote ops have the deserializer run.\n\t\t\tif (local && rollback !== true) {\n\t\t\t\tconst value = interval.serialize();\n\t\t\t\tthis.submitDelta(\n\t\t\t\t\t{\n\t\t\t\t\t\topName: \"delete\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"delete\",\n\t\t\t\t\t\tlocalSeq: this.getNextLocalSeq(),\n\t\t\t\t\t},\n\t\t\t\t\tinterval,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tif (this.onDeserialize) {\n\t\t\t\t\tthis.onDeserialize(interval);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.emit(\"deleteInterval\", interval, local, op);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.removeIntervalById}\n\t */\n\tpublic removeIntervalById(id: string): SequenceIntervalClass | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t}\n\t\tconst interval = this.getIntervalById(id);\n\t\tif (interval) {\n\t\t\tthis.deleteExistingInterval({ interval, local: true });\n\t\t}\n\t\treturn interval;\n\t}\n\t/**\n\t * {@inheritdoc IIntervalCollection.change}\n\t */\n\tpublic change(\n\t\tid: string,\n\t\t{\n\t\t\tstart,\n\t\t\tend,\n\t\t\tprops,\n\t\t\trollback,\n\t\t}: { start?: SequencePlace; end?: SequencePlace; props?: PropertySet; rollback?: boolean },\n\t): SequenceIntervalClass | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t}\n\n\t\t// Force id to be a string.\n\t\tif (typeof id !== \"string\") {\n\t\t\tthrow new UsageError(\"Change API requires an ID that is a string\");\n\t\t}\n\n\t\t// Ensure that both start and end are defined or both are undefined.\n\t\tif ((start === undefined) !== (end === undefined)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Change API requires both start and end to be defined or undefined\",\n\t\t\t);\n\t\t}\n\n\t\t// prevent the overwriting of an interval label, it should remain unchanged\n\t\t// once it has been inserted into the collection.\n\t\tif (props?.[reservedRangeLabelsKey] !== undefined) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"The label property should not be modified once inserted to the collection\",\n\t\t\t);\n\t\t}\n\n\t\tconst interval = this.getIntervalById(id);\n\t\tif (interval) {\n\t\t\tlet deltaProps: PropertySet | undefined;\n\t\t\tlet newInterval: SequenceIntervalClass | undefined;\n\t\t\tif (props !== undefined) {\n\t\t\t\tdeltaProps = interval.changeProperties(props, undefined, rollback);\n\t\t\t}\n\t\t\tconst changeEndpoints = start !== undefined && end !== undefined;\n\t\t\tif (changeEndpoints) {\n\t\t\t\tnewInterval = this.localCollection.changeInterval(interval, start, end);\n\t\t\t\tif (!this.isCollaborating && newInterval !== undefined) {\n\t\t\t\t\tsetSlideOnRemove(newInterval.start);\n\t\t\t\t\tsetSlideOnRemove(newInterval.end);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.isCollaborating && rollback !== true) {\n\t\t\t\t// Emit a property bag containing the ID and the other (if any) properties changed\n\t\t\t\tconst serializedInterval: SerializedIntervalDelta = (\n\t\t\t\t\tnewInterval ?? interval\n\t\t\t\t).serializeDelta({ props, includeEndpoints: changeEndpoints });\n\t\t\t\tconst localSeq = this.getNextLocalSeq();\n\n\t\t\t\tconst metadata: IntervalChangeLocalMetadata = {\n\t\t\t\t\ttype: \"change\",\n\t\t\t\t\tlocalSeq,\n\t\t\t\t\tinterval: newInterval ?? interval,\n\t\t\t\t};\n\n\t\t\t\tthis.submitDelta(\n\t\t\t\t\t{\n\t\t\t\t\t\topName: \"change\",\n\t\t\t\t\t\tvalue: serializedInterval,\n\t\t\t\t\t},\n\t\t\t\t\tmetadata,\n\t\t\t\t\tinterval,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (deltaProps !== undefined) {\n\t\t\t\tthis.emit(\"propertyChanged\", interval, deltaProps, true, undefined);\n\t\t\t\tthis.emit(\n\t\t\t\t\t\"changed\",\n\t\t\t\t\tnewInterval ?? interval,\n\t\t\t\t\tdeltaProps,\n\t\t\t\t\tnewInterval ? interval : undefined,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (newInterval) {\n\t\t\t\tthis.emitChange(newInterval, interval, true, false);\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tinterval.start.properties!.interval = undefined;\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tinterval.end.properties!.interval = undefined;\n\t\t\t}\n\t\t\treturn newInterval;\n\t\t}\n\t\t// No interval to change\n\t\treturn undefined;\n\t}\n\n\tprivate get isCollaborating(): boolean {\n\t\treturn this.client?.getCollabWindow().collaborating ?? false;\n\t}\n\n\tprivate hasPendingEndpointChanges(id: string) {\n\t\treturn this.pending[id]?.endpointChanges?.empty === false;\n\t}\n\n\tpublic ackChange(\n\t\tserializedInterval: SerializedIntervalDelta,\n\t\tlocal: boolean,\n\t\top: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: IntervalChangeLocalMetadata | undefined,\n\t) {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t}\n\n\t\t// Note that the ID is in the property bag only to allow us to find the interval.\n\t\t// This API cannot change the ID, and writing to the ID property will result in an exception. So we\n\t\t// strip it out of the properties here.\n\t\tconst { id, properties } = getSerializedProperties(serializedInterval);\n\t\tassert(id !== undefined, 0x3fe /* id must exist on the interval */);\n\n\t\tif (local) {\n\t\t\tassert(localOpMetadata !== undefined, 0xbd4 /* local must have metadata */);\n\t\t\tconst { interval } = localOpMetadata;\n\t\t\tinterval.ackPropertiesChange(properties, op);\n\n\t\t\tthis.ackInterval(interval, op);\n\t\t\treturn interval;\n\t\t} else {\n\t\t\tconst latestInterval = this.getIntervalById(id);\n\t\t\tconst intervalToChange: SequenceIntervalClass | undefined =\n\t\t\t\tthis.pending[id]?.consensus ?? latestInterval;\n\n\t\t\tconst isLatestInterval = intervalToChange === latestInterval;\n\n\t\t\tif (!intervalToChange) {\n\t\t\t\treturn intervalToChange;\n\t\t\t}\n\n\t\t\tconst deltaProps = intervalToChange.changeProperties(properties, op);\n\n\t\t\tlet newInterval = intervalToChange;\n\t\t\tif (hasEndpointChanges(serializedInterval)) {\n\t\t\t\tconst { start, end, startSide, endSide } = serializedInterval;\n\t\t\t\tnewInterval = intervalToChange.modify(\n\t\t\t\t\t\"\",\n\t\t\t\t\ttoOptionalSequencePlace(start, startSide ?? Side.Before),\n\t\t\t\t\ttoOptionalSequencePlace(end, endSide ?? Side.Before),\n\t\t\t\t\top,\n\t\t\t\t);\n\t\t\t\tif (isLatestInterval) {\n\t\t\t\t\tthis.localCollection.removeExistingInterval(intervalToChange);\n\t\t\t\t\tthis.localCollection.add(newInterval);\n\t\t\t\t\tthis.emitChange(newInterval, intervalToChange, local, false, op);\n\t\t\t\t\tif (this.onDeserialize) {\n\t\t\t\t\t\tthis.onDeserialize(newInterval);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (deltaProps !== undefined && Object.keys(deltaProps).length > 0) {\n\t\t\t\tthis.emit(\"propertyChanged\", latestInterval, deltaProps, local, op);\n\t\t\t\tthis.emit(\"changed\", latestInterval, deltaProps, undefined, local, false);\n\t\t\t}\n\t\t\treturn newInterval;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.attachDeserializer}\n\t */\n\tpublic attachDeserializer(onDeserialize: DeserializeCallback): void {\n\t\t// If no deserializer is specified can skip all processing work\n\t\tif (!onDeserialize) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Start by storing the callbacks so that any subsequent modifications make use of them\n\t\tthis.onDeserialize = onDeserialize;\n\n\t\t// Trigger the async prepare work across all values in the collection\n\t\tif (this.attached) {\n\t\t\tthis.map(onDeserialize);\n\t\t}\n\t}\n\n\t/**\n\t * Returns new interval after rebasing. If undefined, the interval was\n\t * deleted as a result of rebasing. This can occur if the interval applies\n\t * to a range that no longer exists, and the interval was unable to slide.\n\t *\n\t */\n\tpublic rebaseLocalInterval(\n\t\toriginal: SerializedIntervalDelta,\n\t\tlocalOpMetadata: IntervalAddLocalMetadata | IntervalChangeLocalMetadata,\n\t\tsquash: boolean,\n\t): SerializedIntervalDelta | undefined {\n\t\tif (!this.client || !hasEndpointChanges(original)) {\n\t\t\t// If there's no associated mergeTree client, the originally submitted op is still correct.\n\t\t\treturn original;\n\t\t}\n\t\tif (!this.attached || this.localCollection === undefined) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\tconst { localSeq, interval } = localOpMetadata;\n\t\tconst { id } = getSerializedProperties(original);\n\n\t\tconst rebasedEndpoint = this.computeRebasedPositions(localOpMetadata, squash);\n\t\tconst localInterval = this.getIntervalById(id);\n\n\t\t// if the interval slid off the string, rebase the op to be a noop and delete the interval.\n\t\tif (rebasedEndpoint === \"detached\") {\n\t\t\tif (\n\t\t\t\tlocalInterval !== undefined &&\n\t\t\t\t(localInterval === interval || localOpMetadata.type === \"add\")\n\t\t\t) {\n\t\t\t\tthis.localCollection?.removeExistingInterval(localInterval);\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst { start, end } = rebasedEndpoint;\n\t\tif (\n\t\t\tinterval.start.getSegment() !== start.segment ||\n\t\t\tinterval.start.getOffset() !== start.offset ||\n\t\t\tinterval.end.getSegment() !== end.segment ||\n\t\t\tinterval.end.getOffset() !== end.offset\n\t\t) {\n\t\t\tif (localInterval === interval) {\n\t\t\t\tthis.localCollection.removeExistingInterval(localInterval);\n\t\t\t}\n\t\t\tconst old = interval.clone();\n\t\t\tinterval.moveEndpointReferences(rebasedEndpoint);\n\t\t\tif (localInterval === interval) {\n\t\t\t\tthis.localCollection.add(interval);\n\t\t\t\tthis.emitChange(interval, old, true, true);\n\t\t\t}\n\t\t\told.dispose();\n\t\t}\n\n\t\treturn {\n\t\t\t...original,\n\t\t\tstart:\n\t\t\t\tstart.segment.endpointType ??\n\t\t\t\tthis.client.findReconnectionPosition(start.segment, localSeq) + start.offset,\n\t\t\tend:\n\t\t\t\tend.segment.endpointType ??\n\t\t\t\tthis.client.findReconnectionPosition(end.segment, localSeq) + end.offset,\n\t\t\tsequenceNumber: this.client?.getCurrentSeq() ?? 0,\n\t\t};\n\t}\n\n\tprivate getSlideToSegment(\n\t\tlref: LocalReferencePosition,\n\t): { segment: ISegment; offset: number } | undefined {\n\t\tif (!this.client) {\n\t\t\tthrow new LoggingError(\"client does not exist\");\n\t\t}\n\t\tconst segment: ISegmentInternal | undefined = lref.getSegment();\n\t\tif (segment === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst segoff = {\n\t\t\tsegment,\n\t\t\toffset: lref.getOffset(),\n\t\t};\n\t\tif (segoff.segment.localRefs?.has(lref) !== true) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn getSlideToSegoff(\n\t\t\tsegoff,\n\t\t\tlref.slidingPreference,\n\t\t\tundefined,\n\t\t\tlref.canSlideToEndpoint,\n\t\t);\n\t}\n\n\tprivate ackInterval(interval: SequenceIntervalClass, op: ISequencedDocumentMessage): void {\n\t\tif (\n\t\t\t!refTypeIncludesFlag(interval.start, ReferenceType.StayOnRemove) &&\n\t\t\t!refTypeIncludesFlag(interval.end, ReferenceType.StayOnRemove)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newStart = this.getSlideToSegment(interval.start);\n\t\tconst newEnd = this.getSlideToSegment(interval.end);\n\n\t\tconst id = interval.getIntervalId();\n\t\tconst hasPendingChange = this.hasPendingEndpointChanges(id);\n\n\t\tif (!hasPendingChange) {\n\t\t\tsetSlideOnRemove(interval.start);\n\t\t\tsetSlideOnRemove(interval.end);\n\t\t}\n\n\t\tconst needsStartUpdate =\n\t\t\tnewStart?.segment !== interval.start.getSegment() && !hasPendingChange;\n\t\tconst needsEndUpdate = newEnd?.segment !== interval.end.getSegment() && !hasPendingChange;\n\n\t\tif (needsStartUpdate || needsEndUpdate) {\n\t\t\tif (!this.localCollection) {\n\t\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t\t}\n\n\t\t\t// `interval`'s endpoints will get modified in-place, so clone it prior to doing so for event emission.\n\t\t\tconst oldInterval = interval.clone();\n\n\t\t\tconst isLatestInterval = this.getIntervalById(id) === interval;\n\n\t\t\tif (isLatestInterval) {\n\t\t\t\t// In this case, where we change the start or end of an interval,\n\t\t\t\t// it is necessary to remove and re-add the interval listeners.\n\t\t\t\t// This ensures that the correct listeners are added to the LocalReferencePosition.\n\t\t\t\tthis.localCollection.removeExistingInterval(interval);\n\t\t\t}\n\t\t\tif (!this.client) {\n\t\t\t\tthrow new LoggingError(\"client does not exist\");\n\t\t\t}\n\n\t\t\tif (needsStartUpdate) {\n\t\t\t\tconst props = interval.start.properties;\n\t\t\t\tinterval.start = createPositionReferenceFromSegoff({\n\t\t\t\t\tclient: this.client,\n\t\t\t\t\tsegoff: newStart,\n\t\t\t\t\trefType: interval.start.refType,\n\t\t\t\t\top,\n\t\t\t\t\tslidingPreference: interval.start.slidingPreference,\n\t\t\t\t\tcanSlideToEndpoint: interval.start.canSlideToEndpoint,\n\t\t\t\t});\n\t\t\t\tif (props) {\n\t\t\t\t\tinterval.start.addProperties(props);\n\t\t\t\t}\n\t\t\t\tconst oldSeg: ISegmentInternal | undefined = oldInterval.start.getSegment();\n\t\t\t\t// remove and rebuild start interval as transient for event\n\t\t\t\tthis.client.removeLocalReferencePosition(oldInterval.start);\n\t\t\t\toldInterval.start.refType = ReferenceType.Transient;\n\t\t\t\toldSeg?.localRefs?.addLocalRef(oldInterval.start, oldInterval.start.getOffset());\n\t\t\t}\n\t\t\tif (needsEndUpdate) {\n\t\t\t\tconst props = interval.end.properties;\n\t\t\t\tinterval.end = createPositionReferenceFromSegoff({\n\t\t\t\t\tclient: this.client,\n\t\t\t\t\tsegoff: newEnd,\n\t\t\t\t\trefType: interval.end.refType,\n\t\t\t\t\top,\n\t\t\t\t\tslidingPreference: interval.end.slidingPreference,\n\t\t\t\t\tcanSlideToEndpoint: interval.end.canSlideToEndpoint,\n\t\t\t\t});\n\t\t\t\tif (props) {\n\t\t\t\t\tinterval.end.addProperties(props);\n\t\t\t\t}\n\t\t\t\t// remove and rebuild end interval as transient for event\n\t\t\t\tconst oldSeg: ISegmentInternal | undefined = oldInterval.end.getSegment();\n\t\t\t\tthis.client.removeLocalReferencePosition(oldInterval.end);\n\t\t\t\toldInterval.end.refType = ReferenceType.Transient;\n\t\t\t\toldSeg?.localRefs?.addLocalRef(oldInterval.end, oldInterval.end.getOffset());\n\t\t\t}\n\t\t\tif (isLatestInterval) {\n\t\t\t\tthis.localCollection.add(interval);\n\t\t\t\tthis.emitChange(interval, oldInterval, true, true, op);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic ackAdd(\n\t\tserializedInterval: ISerializedInterval,\n\t\tlocal: boolean,\n\t\top: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: IntervalAddLocalMetadata | undefined,\n\t): SequenceIntervalClass {\n\t\tconst { id, properties } = getSerializedProperties(serializedInterval);\n\n\t\tif (local) {\n\t\t\tassert(\n\t\t\t\tlocalOpMetadata !== undefined,\n\t\t\t\t0x553 /* op metadata should be defined for local op */,\n\t\t\t);\n\t\t\tthis.ackInterval(localOpMetadata.interval, op);\n\t\t\treturn localOpMetadata.interval;\n\t\t}\n\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\tconst interval: SequenceIntervalClass = this.localCollection.addInterval(\n\t\t\tid,\n\t\t\ttoSequencePlace(serializedInterval.start, serializedInterval.startSide ?? Side.Before),\n\t\t\ttoSequencePlace(serializedInterval.end, serializedInterval.endSide ?? Side.Before),\n\t\t\tproperties,\n\t\t\top,\n\t\t);\n\n\t\tif (interval) {\n\t\t\tif (this.onDeserialize) {\n\t\t\t\tthis.onDeserialize(interval);\n\t\t\t}\n\t\t}\n\n\t\tthis.emit(\"addInterval\", interval, local, op);\n\n\t\treturn interval;\n\t}\n\n\tpublic ackDelete(\n\t\tserializedInterval: SerializedIntervalDelta,\n\t\tlocal: boolean,\n\t\top: ISequencedDocumentMessage,\n\t): void {\n\t\tif (local) {\n\t\t\t// Local ops were applied when the message was created and there's no \"pending delete\"\n\t\t\t// state to book keep: remote operation application takes into account possibility of\n\t\t\t// locally deleted interval whenever a lookup happens.\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attach must be called prior to deleting intervals\");\n\t\t}\n\n\t\tconst { id } = getSerializedProperties(serializedInterval);\n\t\tconst interval = this.getIntervalById(id);\n\t\tif (interval) {\n\t\t\tthis.deleteExistingInterval({ interval, local, op });\n\t\t}\n\t}\n\n\tpublic serializeInternal(\n\t\tversion: \"1\" | \"2\",\n\t): ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2 {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\treturn this.localCollection.serialize(version);\n\t}\n\n\t/**\n\t * @returns an iterator over all intervals in this collection.\n\t */\n\tpublic [Symbol.iterator](): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.CreateForwardIteratorWithStartPosition}\n\t */\n\tpublic CreateForwardIteratorWithStartPosition(\n\t\tstartPosition: number,\n\t): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this, true, startPosition);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.CreateBackwardIteratorWithStartPosition}\n\t */\n\tpublic CreateBackwardIteratorWithStartPosition(\n\t\tstartPosition: number,\n\t): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this, false, startPosition);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.CreateForwardIteratorWithEndPosition}\n\t */\n\tpublic CreateForwardIteratorWithEndPosition(\n\t\tendPosition: number,\n\t): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this, true, undefined, endPosition);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.CreateBackwardIteratorWithEndPosition}\n\t */\n\tpublic CreateBackwardIteratorWithEndPosition(\n\t\tendPosition: number,\n\t): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this, false, undefined, endPosition);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.gatherIterationResults}\n\t */\n\tpublic gatherIterationResults(\n\t\tresults: SequenceIntervalClass[],\n\t\titeratesForward: boolean,\n\t\tstart?: number,\n\t\tend?: number,\n\t) {\n\t\tif (!this.localCollection) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.localCollection.overlappingIntervalsIndex.gatherIterationResults(\n\t\t\tresults,\n\t\t\titeratesForward,\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.findOverlappingIntervals}\n\t */\n\tpublic findOverlappingIntervals(\n\t\tstartPosition: number,\n\t\tendPosition: number,\n\t): SequenceInterval[] {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\treturn this.localCollection.overlappingIntervalsIndex.findOverlappingIntervals(\n\t\t\tstartPosition,\n\t\t\tendPosition,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.map}\n\t */\n\tpublic map(fn: (interval: SequenceIntervalClass) => void) {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\tfor (const interval of this.localCollection.idIntervalIndex) {\n\t\t\tfn(interval);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.previousInterval}\n\t */\n\tpublic previousInterval(pos: number): SequenceInterval | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\treturn this.localCollection.endIntervalIndex.previousInterval(pos);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.nextInterval}\n\t */\n\tpublic nextInterval(pos: number): SequenceInterval | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\treturn this.localCollection.endIntervalIndex.nextInterval(pos);\n\t}\n}\n\nfunction setSlideOnRemove(lref: LocalReferencePosition) {\n\tlet refType = lref.refType;\n\trefType = refType & ~ReferenceType.StayOnRemove;\n\trefType = refType | ReferenceType.SlideOnRemove;\n\tlref.refType = refType;\n}\n\n/**\n * Information that identifies an interval within a `Sequence`.\n * @internal\n */\nexport interface IntervalLocator {\n\t/**\n\t * Label for the collection the interval is a part of\n\t */\n\tlabel: string;\n\t/**\n\t * Interval within that collection\n\t */\n\tinterval: SequenceIntervalClass;\n}\n\n/**\n * Returns an object that can be used to find the interval a given LocalReferencePosition belongs to.\n * @returns undefined if the reference position is not the endpoint of any interval (e.g. it was created\n * on the merge tree directly by app code), otherwise an {@link IntervalLocator} for the interval this\n * endpoint is a part of.\n * @internal\n */\nexport function intervalLocatorFromEndpoint(\n\tpotentialEndpoint: LocalReferencePosition,\n): IntervalLocator | undefined {\n\tconst { interval, [reservedRangeLabelsKey]: collectionNameArray } =\n\t\tpotentialEndpoint.properties ?? {};\n\treturn interval && collectionNameArray?.length === 1\n\t\t? { label: collectionName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AAC,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE;QAC7C,CAAC,CAAC,SAAS,CAAC;AACd,CAAC;AARD,kEAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IEvent } from \"@fluidframework/core-interfaces\";\nimport {\n\tassert,\n\tDoublyLinkedList,\n\tunreachableCase,\n\ttype ListNode,\n} from \"@fluidframework/core-utils/internal\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tClient,\n\tISegment,\n\tLocalReferencePosition,\n\tPropertySet,\n\tReferenceType,\n\tgetSlideToSegoff,\n\trefTypeIncludesFlag,\n\treservedRangeLabelsKey,\n\tSide,\n\tSequencePlace,\n\tendpointPosAndSide,\n\ttype ISegmentInternal,\n\tcreateLocalReconnectingPerspective,\n\tSlidingPreference,\n} from \"@fluidframework/merge-tree/internal\";\nimport { LoggingError, UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n\tIntervalMessageLocalMetadata,\n\tSequenceOptions,\n\ttype IIntervalCollectionTypeOperationValue,\n\ttype IntervalAddLocalMetadata,\n\ttype IntervalChangeLocalMetadata,\n} from \"./intervalCollectionMapInterfaces.js\";\nimport {\n\tcreateIdIntervalIndex,\n\tEndpointIndex,\n\tOverlappingIntervalsIndex,\n\ttype IEndpointIndex,\n\ttype IIdIntervalIndex,\n\ttype ISequenceOverlappingIntervalsIndex,\n\ttype SequenceIntervalIndex,\n} from \"./intervalIndex/index.js\";\nimport {\n\tCompressedSerializedInterval,\n\tISerializedInterval,\n\tIntervalStickiness,\n\tIntervalType,\n\tSequenceInterval,\n\tSequenceIntervalClass,\n\tSerializedIntervalDelta,\n\tcreatePositionReferenceFromSegoff,\n\tcreateSequenceInterval,\n\tgetSerializedProperties,\n} from \"./intervals/index.js\";\n\nexport type ISerializedIntervalCollectionV1 = ISerializedInterval[];\n\nexport interface ISerializedIntervalCollectionV2 {\n\tlabel: string;\n\tversion: 2;\n\tintervals: CompressedSerializedInterval[];\n}\n\nfunction sidesFromStickiness(stickiness: IntervalStickiness) {\n\tconst startSide = (stickiness & IntervalStickiness.START) !== 0 ? Side.After : Side.Before;\n\tconst endSide = (stickiness & IntervalStickiness.END) !== 0 ? Side.Before : Side.After;\n\n\treturn { startSide, endSide };\n}\n\n/**\n * Decompress an interval after loading a summary from JSON. The exact format\n * of this compression is unspecified and subject to change\n */\nfunction decompressInterval(\n\tinterval: CompressedSerializedInterval,\n\tlabel?: string,\n): ISerializedInterval {\n\tconst stickiness = interval[5] ?? IntervalStickiness.END;\n\tconst { startSide, endSide } = sidesFromStickiness(stickiness);\n\treturn {\n\t\tstart: interval[0],\n\t\tend: interval[1],\n\t\tsequenceNumber: interval[2],\n\t\tintervalType: interval[3],\n\t\tproperties: { ...interval[4], [reservedRangeLabelsKey]: [label] },\n\t\tstickiness,\n\t\tstartSide,\n\t\tendSide,\n\t};\n}\n\n/**\n * Compress an interval prior to serialization as JSON. The exact format of this\n * compression is unspecified and subject to change\n */\nfunction compressInterval(interval: ISerializedInterval): CompressedSerializedInterval {\n\tconst { start, end, sequenceNumber, intervalType, properties } = interval;\n\n\tlet base: CompressedSerializedInterval = [\n\t\tstart,\n\t\tend,\n\t\tsequenceNumber,\n\t\tintervalType,\n\t\t// remove the `referenceRangeLabels` property as it is already stored\n\t\t// in the `label` field of the summary\n\t\t{ ...properties, [reservedRangeLabelsKey]: undefined },\n\t];\n\n\tif (interval.stickiness !== undefined && interval.stickiness !== IntervalStickiness.END) {\n\t\t// reassignment to make it easier for typescript to reason about types\n\t\tbase = [...base, interval.stickiness];\n\t}\n\n\treturn base;\n}\n\nexport function toSequencePlace(\n\tpos: number | \"start\" | \"end\",\n\tside: Side | undefined,\n): SequencePlace {\n\treturn typeof pos === \"number\" && side !== undefined ? { pos, side } : pos;\n}\n\nexport function toOptionalSequencePlace(\n\tpos: number | \"start\" | \"end\" | undefined,\n\tside: Side | undefined,\n): SequencePlace | undefined {\n\treturn typeof pos === \"number\" && side !== undefined ? { pos, side } : pos;\n}\n\nexport class LocalIntervalCollection {\n\tpublic readonly overlappingIntervalsIndex: ISequenceOverlappingIntervalsIndex;\n\tpublic readonly idIntervalIndex: IIdIntervalIndex;\n\tpublic readonly endIntervalIndex: IEndpointIndex;\n\tprivate readonly indexes: Set<SequenceIntervalIndex>;\n\n\tconstructor(\n\t\tprivate readonly client: Client,\n\t\tprivate readonly label: string,\n\t\tprivate readonly options: Partial<SequenceOptions>,\n\t\t/** Callback invoked each time one of the endpoints of an interval slides. */\n\t\tprivate readonly onPositionChange?: (\n\t\t\tinterval: SequenceIntervalClass,\n\t\t\tpreviousInterval: SequenceIntervalClass,\n\t\t) => void,\n\t) {\n\t\tthis.overlappingIntervalsIndex = new OverlappingIntervalsIndex(client);\n\t\tthis.idIntervalIndex = createIdIntervalIndex();\n\t\tthis.endIntervalIndex = new EndpointIndex(client);\n\t\tthis.indexes = new Set([\n\t\t\tthis.overlappingIntervalsIndex,\n\t\t\tthis.idIntervalIndex,\n\t\t\tthis.endIntervalIndex,\n\t\t]);\n\t}\n\n\t/**\n\t * Validates that a serialized interval has the ID property. Creates an ID\n\t * if one does not already exist\n\t *\n\t * @param serializedInterval - The interval to be checked\n\t * @returns The interval's existing or newly created id\n\t */\n\n\tprivate removeIntervalFromIndexes(interval: SequenceIntervalClass) {\n\t\tfor (const index of this.indexes) {\n\t\t\tindex.remove(interval);\n\t\t}\n\t}\n\n\tpublic appendIndex(index: SequenceIntervalIndex) {\n\t\tthis.indexes.add(index);\n\t}\n\n\tpublic removeIndex(index: SequenceIntervalIndex): boolean {\n\t\treturn this.indexes.delete(index);\n\t}\n\n\tpublic removeExistingInterval(interval: SequenceIntervalClass) {\n\t\tthis.removeIntervalFromIndexes(interval);\n\t\tthis.removeIntervalListeners(interval);\n\t}\n\n\tpublic addInterval(\n\t\tid: string,\n\t\tstart: SequencePlace,\n\t\tend: SequencePlace,\n\t\tprops?: PropertySet,\n\t\top?: ISequencedDocumentMessage,\n\t) {\n\t\t// This check is intended to prevent scenarios where a random interval is created and then\n\t\t// inserted into a collection. The aim is to ensure that the collection is created first\n\t\t// then the user can create/add intervals based on the collection\n\t\tif (\n\t\t\tprops?.[reservedRangeLabelsKey] !== undefined &&\n\t\t\tprops[reservedRangeLabelsKey][0] !== this.label\n\t\t) {\n\t\t\tthrow new LoggingError(\n\t\t\t\t\"Adding an interval that belongs to another interval collection is not permitted\",\n\t\t\t);\n\t\t}\n\t\tconst interval: SequenceIntervalClass = createSequenceInterval(\n\t\t\tthis.label,\n\t\t\tid,\n\t\t\tstart,\n\t\t\tend,\n\t\t\tthis.client,\n\t\t\tIntervalType.SlideOnRemove,\n\t\t\top,\n\t\t\tundefined,\n\t\t\tthis.options.mergeTreeReferencesCanSlideToEndpoint,\n\t\t\tprops,\n\t\t\tfalse,\n\t\t);\n\n\t\tthis.add(interval);\n\t\treturn interval;\n\t}\n\n\tprivate linkEndpointsToInterval(interval: SequenceIntervalClass): void {\n\t\tinterval.start.addProperties({ interval });\n\t\tinterval.end.addProperties({ interval });\n\t}\n\n\tprivate addIntervalToIndexes(interval: SequenceIntervalClass) {\n\t\tfor (const index of this.indexes) {\n\t\t\tindex.add(interval);\n\t\t}\n\t}\n\n\tpublic add(interval: SequenceIntervalClass): void {\n\t\tthis.linkEndpointsToInterval(interval);\n\t\tthis.addIntervalToIndexes(interval);\n\t\tthis.addIntervalListeners(interval);\n\t}\n\n\tpublic changeInterval(\n\t\tinterval: SequenceIntervalClass,\n\t\tstart: SequencePlace | undefined,\n\t\tend: SequencePlace | undefined,\n\t\top?: ISequencedDocumentMessage,\n\t\tlocalSeq?: number,\n\t) {\n\t\tconst newInterval = interval.modify(\n\t\t\tthis.label,\n\t\t\tstart,\n\t\t\tend,\n\t\t\top,\n\t\t\tlocalSeq,\n\t\t\tthis.options.mergeTreeReferencesCanSlideToEndpoint,\n\t\t);\n\t\tif (newInterval) {\n\t\t\tthis.removeExistingInterval(interval);\n\t\t\tthis.add(newInterval);\n\t\t}\n\t\treturn newInterval;\n\t}\n\n\tpublic serialize(\n\t\tversion: \"1\" | \"2\",\n\t): ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2 {\n\t\tif (version === \"1\") {\n\t\t\treturn Array.from(this.idIntervalIndex, (interval) => interval.serialize());\n\t\t}\n\t\treturn {\n\t\t\tlabel: this.label,\n\t\t\tintervals: Array.from(this.idIntervalIndex, (interval) =>\n\t\t\t\tcompressInterval(interval.serialize()),\n\t\t\t),\n\t\t\tversion: 2,\n\t\t};\n\t}\n\n\tprivate addIntervalListeners(interval: SequenceIntervalClass) {\n\t\tconst cloneRef = (ref: LocalReferencePosition) => {\n\t\t\tconst segment = ref.getSegment();\n\t\t\tif (segment === undefined) {\n\t\t\t\t// Cloning is unnecessary: refs which have slid off the string entirely\n\t\t\t\t// never get slid back on. Creation code for refs doesn't accept undefined segment\n\t\t\t\t// either, so this must be special-cased.\n\t\t\t\treturn ref;\n\t\t\t}\n\n\t\t\treturn this.client.createLocalReferencePosition(\n\t\t\t\tsegment,\n\t\t\t\tref.getOffset(),\n\t\t\t\tReferenceType.Transient,\n\t\t\t\tref.properties,\n\t\t\t\tref.slidingPreference,\n\t\t\t\tref.canSlideToEndpoint,\n\t\t\t);\n\t\t};\n\t\tlet previousInterval: SequenceIntervalClass | undefined;\n\t\tlet pendingChanges = 0;\n\t\tinterval.addPositionChangeListeners(\n\t\t\t() => {\n\t\t\t\tpendingChanges++;\n\t\t\t\t// Note: both start and end can change and invoke beforeSlide on each endpoint before afterSlide.\n\t\t\t\tif (!previousInterval) {\n\t\t\t\t\tpreviousInterval = interval.clone();\n\t\t\t\t\tpreviousInterval.start = cloneRef(previousInterval.start);\n\t\t\t\t\tpreviousInterval.end = cloneRef(previousInterval.end);\n\t\t\t\t\tthis.removeIntervalFromIndexes(interval);\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tassert(\n\t\t\t\t\tpreviousInterval !== undefined,\n\t\t\t\t\t0x3fa /* Invalid interleaving of before/after slide */,\n\t\t\t\t);\n\t\t\t\tpendingChanges--;\n\t\t\t\tif (pendingChanges === 0) {\n\t\t\t\t\tthis.addIntervalToIndexes(interval);\n\t\t\t\t\tthis.onPositionChange?.(interval, previousInterval);\n\t\t\t\t\tpreviousInterval = undefined;\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n\n\tprivate removeIntervalListeners(interval: SequenceIntervalClass) {\n\t\tinterval.removePositionChangeListeners();\n\t}\n}\n\n/**\n * @legacy @beta\n */\nexport type DeserializeCallback = (properties: PropertySet) => void;\n\nclass IntervalCollectionIterator implements Iterator<SequenceIntervalClass> {\n\tprivate readonly results: SequenceIntervalClass[];\n\tprivate index: number;\n\n\tconstructor(\n\t\tcollection: IntervalCollection,\n\t\titeratesForward: boolean = true,\n\t\tstart?: number,\n\t\tend?: number,\n\t) {\n\t\tthis.results = [];\n\t\tthis.index = 0;\n\n\t\tcollection.gatherIterationResults(this.results, iteratesForward, start, end);\n\t}\n\n\tpublic next(): IteratorResult<SequenceIntervalClass> {\n\t\tif (this.index < this.results.length) {\n\t\t\treturn {\n\t\t\t\tvalue: this.results[this.index++],\n\t\t\t\tdone: false,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tvalue: undefined,\n\t\t\tdone: true,\n\t\t};\n\t}\n}\n\n/**\n * Change events emitted by `IntervalCollection`s\n * @legacy @beta\n */\nexport interface ISequenceIntervalCollectionEvents extends IEvent {\n\t/**\n\t * This event is invoked whenever the endpoints of an interval may have changed.\n\t * This can happen on:\n\t * - local endpoint modification\n\t * - ack of a remote endpoint modification\n\t * - position change due to segment sliding (slides due to mergeTree segment deletion will always appear local)\n\t * The `interval` argument reflects the new values.\n\t * `previousInterval` contains transient `ReferencePosition`s at the same location as the interval's original\n\t * endpoints. These references should be used for position information only.\n\t * `local` reflects whether the change originated locally.\n\t * `op` is defined if and only if the server has acked this change.\n\t * `slide` is true if the change is due to sliding on removal of position\n\t */\n\t(\n\t\tevent: \"changeInterval\",\n\t\tlistener: (\n\t\t\tinterval: SequenceInterval,\n\t\t\tpreviousInterval: SequenceInterval,\n\t\t\tlocal: boolean,\n\t\t\top: ISequencedDocumentMessage | undefined,\n\t\t\tslide: boolean,\n\t\t) => void,\n\t): void;\n\t/**\n\t * This event is invoked whenever an interval is added or removed from the collection.\n\t * `local` reflects whether the change originated locally.\n\t * `op` is defined if and only if the server has acked this change.\n\t */\n\t(\n\t\tevent: \"addInterval\" | \"deleteInterval\",\n\t\tlistener: (\n\t\t\tinterval: SequenceInterval,\n\t\t\tlocal: boolean,\n\t\t\top: ISequencedDocumentMessage | undefined,\n\t\t) => void,\n\t): void;\n\t/**\n\t * This event is invoked whenever an interval's properties have changed.\n\t * `interval` reflects the state of the updated properties.\n\t * `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose\n\t * values contain all previous values of the property set.\n\t * This object can be used directly in a call to `changeProperties` to revert the property change if desired.\n\t * `local` reflects whether the change originated locally.\n\t * `op` is defined if and only if the server has acked this change.\n\t */\n\t(\n\t\tevent: \"propertyChanged\",\n\t\tlistener: (\n\t\t\tinterval: SequenceInterval,\n\t\t\tpropertyDeltas: PropertySet,\n\t\t\tlocal: boolean,\n\t\t\top: ISequencedDocumentMessage | undefined,\n\t\t) => void,\n\t): void;\n\t/**\n\t * This event is invoked whenever an interval's endpoints or properties (or both) have changed.\n\t * `interval` reflects the state of the updated endpoints or properties.\n\t * `propertyDeltas` is a map-like whose keys contain all values that were changed, and whose\n\t * values contain all previous values of the property set.\n\t * This object can be used directly in a call to `changeProperties` to revert the property change if desired.\n\t * 'previousInterval' contains transient `ReferencePosition`s at the same location as the interval's original\n\t * endpoints. These references should be used for position information only. In the case of a property change\n\t * only, this argument should be undefined.\n\t * `local` reflects whether the change originated locally.\n\t * `slide` is true if the change is due to sliding on removal of position.\n\t */\n\t(\n\t\tevent: \"changed\",\n\t\tlistener: (\n\t\t\tinterval: SequenceInterval,\n\t\t\tpropertyDeltas: PropertySet,\n\t\t\tpreviousInterval: SequenceInterval | undefined,\n\t\t\tlocal: boolean,\n\t\t\tslide: boolean,\n\t\t) => void,\n\t): void;\n}\n\n/**\n * Collection of intervals that supports addition, modification, removal, and efficient spatial querying.\n * Changes to this collection will be incur updates on collaborating clients (i.e. they are not local-only).\n * @legacy @beta\n */\nexport interface ISequenceIntervalCollection\n\textends TypedEventEmitter<ISequenceIntervalCollectionEvents> {\n\treadonly attached: boolean;\n\t/**\n\t * Attaches an index to this collection.\n\t * All intervals which are part of this collection will be added to the index, and the index will automatically\n\t * be updated when this collection updates due to local or remote changes.\n\t *\n\t * @remarks After attaching an index to an interval collection, applications should typically store this\n\t * index somewhere in their in-memory data model for future reference and querying.\n\t */\n\tattachIndex(index: SequenceIntervalIndex): void;\n\t/**\n\t * Detaches an index from this collection.\n\t * All intervals which are part of this collection will be removed from the index, and updates to this collection\n\t * due to local or remote changes will no longer incur updates to the index.\n\t *\n\t * @returns `false` if the target index cannot be found in the indexes, otherwise remove all intervals in the index and return `true`.\n\t */\n\tdetachIndex(index: SequenceIntervalIndex): boolean;\n\t/**\n\t * @returns the interval in this collection that has the provided `id`.\n\t * If no interval in the collection has this `id`, returns `undefined`.\n\t */\n\tgetIntervalById(id: string): SequenceInterval | undefined;\n\t/**\n\t * Creates a new interval and add it to the collection.\n\t * @param start - interval start position (inclusive)\n\t * @param end - interval end position (exclusive)\n\t * @param props - properties of the interval\n\t * @returns the created interval\n\t * @remarks See documentation on {@link SequenceInterval} for comments on\n\t * interval endpoint semantics: there are subtleties with how the current\n\t * half-open behavior is represented.\n\t *\n\t * Note that intervals may behave unexpectedly if the entire contents\n\t * of the string are deleted. In this case, it is possible for one endpoint\n\t * of the interval to become detached, while the other remains on the string.\n\t *\n\t * By adjusting the `side` and `pos` values of the `start` and `end` parameters,\n\t * it is possible to control whether the interval expands to include content\n\t * inserted at its start or end.\n\t *\n\t *\tSee {@link @fluidframework/merge-tree#SequencePlace} for more details on the model.\n\t *\n\t *\t@example\n\t *\n\t *\tGiven the string \"ABCD\":\n\t *\n\t *```typescript\n\t *\t// Refers to \"BC\". If any content is inserted before B or after C, this\n\t *\t// interval will include that content\n\t *\t//\n\t *\t// Picture:\n\t *\t// \\{start\\} - A[- B - C -]D - \\{end\\}\n\t *\t// \\{start\\} - A - B - C - D - \\{end\\}\n\t *\tcollection.add(\\{ pos: 0, side: Side.After \\}, \\{ pos: 3, side: Side.Before \\}, IntervalType.SlideOnRemove);\n\t *\t// Equivalent to specifying the same positions and Side.Before.\n\t *\t// Refers to \"ABC\". Content inserted after C will be included in the\n\t *\t// interval, but content inserted before A will not.\n\t *\t// \\{start\\} -[A - B - C -]D - \\{end\\}\n\t *\t// \\{start\\} - A - B - C - D - \\{end\\}\n\t *\tcollection.add(0, 3, IntervalType.SlideOnRemove);\n\t *```\n\t *\n\t * In the case of the first example, if text is deleted,\n\t *\n\t * ```typescript\n\t *\t// Delete the character \"B\"\n\t *\tstring.removeRange(1, 2);\n\t * ```\n\t *\n\t * The start point of the interval will slide to the position immediately\n\t * before \"C\", and the same will be true.\n\t *\n\t * ```\n\t * \\{start\\} - A[- C -]D - \\{end\\}\n\t * ```\n\t *\n\t * In this case, text inserted immediately before \"C\" would be included in\n\t * the interval.\n\t *\n\t * ```typescript\n\t * string.insertText(1, \"EFG\");\n\t * ```\n\t *\n\t * With the string now being,\n\t *\n\t * ```\n\t * \\{start\\} - A[- E - F - G - C -]D - \\{end\\}\n\t * ```\n\t *\n\t * @privateRemarks TODO: ADO:5205 the above comment regarding behavior in\n\t * the case that the entire interval has been deleted should be resolved at\n\t * the same time as this ticket\n\t */\n\tadd({\n\t\tstart,\n\t\tend,\n\t\tprops,\n\t}: {\n\t\tstart: SequencePlace;\n\t\tend: SequencePlace;\n\t\tprops?: PropertySet;\n\t}): SequenceInterval;\n\t/**\n\t * Removes an interval from the collection.\n\t * @param id - Id of the interval to remove\n\t * @returns the removed interval\n\t */\n\tremoveIntervalById(id: string): SequenceInterval | undefined;\n\t/**\n\t * Changes the endpoints, properties, or both of an existing interval.\n\t * @param id - Id of the Interval to change\n\t * @returns the interval that was changed, if it existed in the collection.\n\t * Pass the desired new start position, end position, and/or properties in an object. Start and end positions must be changed\n\t * simultaneously - they must either both be specified or both undefined. To only change the properties, leave both endpoints\n\t * undefined. To only change the endpoints, leave the properties undefined.\n\t */\n\tchange(\n\t\tid: string,\n\t\t{ start, end, props }: { start?: SequencePlace; end?: SequencePlace; props?: PropertySet },\n\t): SequenceInterval | undefined;\n\n\t/**\n\t * @deprecated This api is not meant or necessary for external consumption and will be removed in subsequent release\n\t */\n\tattachDeserializer(onDeserialize: DeserializeCallback): void;\n\t/**\n\t * @returns an iterator over all intervals in this collection.\n\t */\n\t[Symbol.iterator](): Iterator<SequenceInterval>;\n\n\t/**\n\t * @returns a forward iterator over all intervals in this collection with start point equal to `startPosition`.\n\t */\n\tCreateForwardIteratorWithStartPosition(startPosition: number): Iterator<SequenceInterval>;\n\n\t/**\n\t * @returns a backward iterator over all intervals in this collection with start point equal to `startPosition`.\n\t */\n\tCreateBackwardIteratorWithStartPosition(startPosition: number): Iterator<SequenceInterval>;\n\n\t/**\n\t * @returns a forward iterator over all intervals in this collection with end point equal to `endPosition`.\n\t */\n\tCreateForwardIteratorWithEndPosition(endPosition: number): Iterator<SequenceInterval>;\n\n\t/**\n\t * @returns a backward iterator over all intervals in this collection with end point equal to `endPosition`.\n\t */\n\tCreateBackwardIteratorWithEndPosition(endPosition: number): Iterator<SequenceInterval>;\n\n\t/**\n\t * Gathers iteration results that optionally match a start/end criteria into the provided array.\n\t * @param results - Array to gather the results into. In lieu of a return value, this array will be populated with\n\t * intervals matching the query upon edit.\n\t * @param iteratesForward - whether or not iteration should be in the forward direction\n\t * @param start - If provided, only match intervals whose start point is equal to `start`.\n\t * @param end - If provided, only match intervals whose end point is equal to `end`.\n\t */\n\tgatherIterationResults(\n\t\tresults: SequenceInterval[],\n\t\titeratesForward: boolean,\n\t\tstart?: number,\n\t\tend?: number,\n\t): void;\n\n\t/**\n\t * @deprecated Users must manually attach the corresponding interval index to utilize this functionality, for instance:\n\t *\n\t * ```typescript\n\t * const overlappingIntervalsIndex = createOverlappingIntervalsIndex(sharedString);\n\t * collection.attachIndex(overlappingIntervalsIndex)\n\t * const result = overlappingIntervalsIndex.findOverlappingIntervals(start, end);\n\t * ```\n\t *\n\t * @returns an array of all intervals in this collection that overlap with the interval\n\t * `[startPosition, endPosition]`.\n\t */\n\tfindOverlappingIntervals(startPosition: number, endPosition: number): SequenceInterval[];\n\n\t/**\n\t * Applies a function to each interval in this collection.\n\t */\n\tmap(fn: (interval: SequenceInterval) => void): void;\n\n\t/**\n\t * @deprecated due to the forthcoming change where the endpointIndex will no longer be\n\t * automatically added to the collection. Users are advised to independently attach the\n\t * index to the collection and utilize the API accordingly, for instance:\n\t * ```typescript\n\t * const endpointIndex = createEndpointIndex(sharedString);\n\t * collection.attachIndex(endpointIndex);\n\t * const result1 = endpointIndex.previousInterval(pos);\n\t * ```\n\t * If an index is used repeatedly, applications should generally attach it once and store it in memory.\n\t */\n\tpreviousInterval(pos: number): SequenceInterval | undefined;\n\n\t/**\n\t * @deprecated due to the forthcoming change where the endpointIndex will no longer be\n\t * automatically added to the collection. Users are advised to independently attach the\n\t * index to the collection and utilize the API accordingly, for instance:\n\t * ```typescript\n\t * const endpointIndex = createEndpointIndex(sharedString);\n\t * collection.attachIndex(endpointIndex);\n\t * const result2 = endpointIndex.nextInterval(pos);\n\t * ```\n\t */\n\tnextInterval(pos: number): SequenceInterval | undefined;\n}\n\ntype PendingChanges = Partial<\n\tRecord<\n\t\tstring,\n\t\t{\n\t\t\t/**\n\t\t\t * The local metadatas are stores in order of submission, FIFO.\n\t\t\t * This matches how ops are ordered, and should maintained\n\t\t\t * across, submit, process, resubmit, and rollback.\n\t\t\t */\n\t\t\tlocal: DoublyLinkedList<IntervalMessageLocalMetadata>;\n\t\t\t/**\n\t\t\t * The endpointChanges are unordered, and are used to determine\n\t\t\t * if any local changes also change the endpoints. The nodes of the\n\t\t\t * list are also stored in the individual change op metadatas, and\n\t\t\t * are removed as those metadatas are handled.\n\t\t\t */\n\t\t\tendpointChanges?: DoublyLinkedList<\n\t\t\t\tIntervalAddLocalMetadata | IntervalChangeLocalMetadata\n\t\t\t>;\n\t\t\tconsensus: SequenceIntervalClass | undefined;\n\t\t}\n\t>\n>;\n\nfunction removeMetadataFromPendingChanges(\n\tlocalOpMetadataNode: ListNode<IntervalMessageLocalMetadata> | unknown,\n): IntervalMessageLocalMetadata {\n\tconst acked = (localOpMetadataNode as ListNode<IntervalMessageLocalMetadata>)?.remove()\n\t\t?.data;\n\tassert(acked !== undefined, 0xbbe /* local change must exist */);\n\tacked.endpointChangesNode?.remove();\n\treturn acked;\n}\n\nfunction clearEmptyPendingEntry(pendingChanges: PendingChanges, id: string) {\n\tconst pending = pendingChanges[id];\n\tif (pending?.local.empty) {\n\t\tassert(\n\t\t\tpending.endpointChanges?.empty !== false,\n\t\t\t0xbc0 /* endpointChanges must be empty if not pending changes */,\n\t\t);\n\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\tdelete pendingChanges[id];\n\t}\n\treturn pending;\n}\n\nfunction hasEndpointChanges(\n\tserialized: SerializedIntervalDelta,\n): serialized is ISerializedInterval {\n\treturn serialized.start !== undefined && serialized.end !== undefined;\n}\n\n/**\n * {@inheritdoc IIntervalCollection}\n */\nexport class IntervalCollection\n\textends TypedEventEmitter<ISequenceIntervalCollectionEvents>\n\timplements ISequenceIntervalCollection\n{\n\tprivate savedSerializedIntervals?: ISerializedIntervalCollectionV1;\n\tprivate localCollection: LocalIntervalCollection | undefined;\n\tprivate onDeserialize: DeserializeCallback | undefined;\n\tprivate client: Client | undefined;\n\n\tprivate readonly pending: PendingChanges = {};\n\n\tpublic get attached(): boolean {\n\t\treturn !!this.localCollection;\n\t}\n\n\tprivate readonly submitDelta: (\n\t\top: IIntervalCollectionTypeOperationValue,\n\t\tmd: IntervalMessageLocalMetadata,\n\t\tconsensus?: SequenceIntervalClass,\n\t) => void;\n\n\tconstructor(\n\t\tsubmitDelta: (op: IIntervalCollectionTypeOperationValue, md: unknown) => void,\n\t\tserializedIntervals: ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2,\n\t\tprivate readonly options: Partial<SequenceOptions> = {},\n\t) {\n\t\tsuper();\n\n\t\tthis.submitDelta = (op, md, consensus) => {\n\t\t\tconst { id } = getSerializedProperties(op.value);\n\t\t\tconst pending = (this.pending[id] ??= {\n\t\t\t\tlocal: new DoublyLinkedList(),\n\t\t\t\tconsensus,\n\t\t\t});\n\t\t\tif (md.type === \"add\" || (md.type === \"change\" && hasEndpointChanges(op.value))) {\n\t\t\t\tconst endpointChanges = (pending.endpointChanges ??= new DoublyLinkedList());\n\t\t\t\tmd.endpointChangesNode = endpointChanges.push(md).last;\n\t\t\t}\n\t\t\tsubmitDelta(op, pending.local.push(md).last);\n\t\t};\n\n\t\tthis.savedSerializedIntervals = Array.isArray(serializedIntervals)\n\t\t\t? serializedIntervals\n\t\t\t: serializedIntervals.intervals.map((i) =>\n\t\t\t\t\tdecompressInterval(i, serializedIntervals.label),\n\t\t\t\t);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.attachIndex}\n\t */\n\tpublic attachIndex(index: SequenceIntervalIndex): void {\n\t\tif (!this.attached) {\n\t\t\tthrow new LoggingError(\"The local interval collection must exist\");\n\t\t}\n\t\tfor (const interval of this) {\n\t\t\tindex.add(interval);\n\t\t}\n\n\t\tthis.localCollection?.appendIndex(index);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.detachIndex}\n\t */\n\tpublic detachIndex(index: SequenceIntervalIndex): boolean {\n\t\tif (!this.attached) {\n\t\t\tthrow new LoggingError(\"The local interval collection must exist\");\n\t\t}\n\n\t\t// Avoid removing intervals if the index does not exist\n\t\tif (!this.localCollection?.removeIndex(index)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (const interval of this) {\n\t\t\tindex.remove(interval);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic rollback(op: IIntervalCollectionTypeOperationValue, maybeMetadata: unknown) {\n\t\tconst localOpMetadata = removeMetadataFromPendingChanges(maybeMetadata);\n\t\tconst { value } = op;\n\t\tconst { id, properties } = getSerializedProperties(value);\n\t\tconst pending = clearEmptyPendingEntry(this.pending, id);\n\t\tconst previous = pending?.local.empty\n\t\t\t? pending.consensus\n\t\t\t: pending?.local.last?.data.interval;\n\t\tconst { type, interval } = localOpMetadata;\n\t\tswitch (type) {\n\t\t\tcase \"add\": {\n\t\t\t\tthis.deleteExistingInterval({ interval, local: true, rollback: true });\n\t\t\t\tinterval.dispose();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"change\": {\n\t\t\t\tconst changeProperties = Object.keys(properties).length > 0;\n\t\t\t\tconst deltaProps = changeProperties\n\t\t\t\t\t? interval.changeProperties(properties, undefined, true)\n\t\t\t\t\t: undefined;\n\t\t\t\tif (localOpMetadata.endpointChangesNode !== undefined) {\n\t\t\t\t\tif (previous !== undefined) {\n\t\t\t\t\t\tthis.localCollection?.removeExistingInterval(interval);\n\t\t\t\t\t\tthis.localCollection?.add(previous);\n\t\t\t\t\t\tthis.emitChange(previous, interval, true, true);\n\t\t\t\t\t}\n\t\t\t\t\tif (previous !== interval) {\n\t\t\t\t\t\tinterval.dispose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (changeProperties) {\n\t\t\t\t\tthis.emit(\"propertyChanged\", previous, deltaProps, true, undefined);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"delete\": {\n\t\t\t\t// a remote could delete the same interval, so it may not exist to re-add\n\t\t\t\tif (previous !== undefined) {\n\t\t\t\t\tthis.localCollection?.add(previous);\n\t\t\t\t\tthis.emit(\"addInterval\", previous, true, undefined);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tunreachableCase(type);\n\t\t}\n\t}\n\n\tpublic process(\n\t\top: IIntervalCollectionTypeOperationValue,\n\t\tlocal: boolean,\n\t\tmessage: ISequencedDocumentMessage,\n\t\tmaybeMetadata: unknown,\n\t) {\n\t\tconst localOpMetadata = local\n\t\t\t? removeMetadataFromPendingChanges(maybeMetadata)\n\t\t\t: undefined;\n\n\t\tconst { opName, value } = op;\n\t\tconst { id } = getSerializedProperties(value);\n\t\tassert(\n\t\t\t(local === false && localOpMetadata === undefined) || opName === localOpMetadata?.type,\n\t\t\t0xbc1 /* must be same type */,\n\t\t);\n\t\tlet newConsensus = localOpMetadata?.interval;\n\t\tswitch (opName) {\n\t\t\tcase \"add\": {\n\t\t\t\tnewConsensus = this.ackAdd(\n\t\t\t\t\tvalue,\n\t\t\t\t\tlocal,\n\t\t\t\t\tmessage,\n\t\t\t\t\t// this cast is safe because of the above assert which\n\t\t\t\t\t// validates the op and metadata types match for local changes\n\t\t\t\t\tlocalOpMetadata as IntervalAddLocalMetadata | undefined,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"delete\": {\n\t\t\t\tthis.ackDelete(value, local, message);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase \"change\": {\n\t\t\t\tnewConsensus = this.ackChange(\n\t\t\t\t\tvalue,\n\t\t\t\t\tlocal,\n\t\t\t\t\tmessage, // this cast is safe because of the above assert which\n\t\t\t\t\t// validates the op and metadata types match for local changes\n\t\t\t\t\tlocalOpMetadata as IntervalChangeLocalMetadata | undefined,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tunreachableCase(opName);\n\t\t}\n\t\tconst pending = clearEmptyPendingEntry(this.pending, id);\n\n\t\tif (pending !== undefined) {\n\t\t\tpending.consensus = newConsensus;\n\t\t}\n\t}\n\n\tpublic resubmitMessage(\n\t\top: IIntervalCollectionTypeOperationValue,\n\t\tmaybeMetadata: unknown,\n\t\tsquash: boolean,\n\t): void {\n\t\tconst { opName, value } = op;\n\n\t\tconst localOpMetadata = removeMetadataFromPendingChanges(maybeMetadata);\n\n\t\tconst rebasedValue =\n\t\t\tlocalOpMetadata.endpointChangesNode === undefined\n\t\t\t\t? value\n\t\t\t\t: this.rebaseLocalInterval(value, localOpMetadata, squash);\n\n\t\tif (rebasedValue === undefined) {\n\t\t\tconst { id } = getSerializedProperties(value);\n\t\t\tclearEmptyPendingEntry(this.pending, id);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.submitDelta({ opName, value: rebasedValue as any }, localOpMetadata);\n\t}\n\n\tpublic applyStashedOp(op: IIntervalCollectionTypeOperationValue): void {\n\t\tconst { opName, value } = op;\n\t\tconst { id, properties } = getSerializedProperties(value);\n\t\tswitch (opName) {\n\t\t\tcase \"add\": {\n\t\t\t\tthis.add({\n\t\t\t\t\tid,\n\t\t\t\t\t// Todo: we should improve typing so we know add ops always have start and end\n\t\t\t\t\tstart: toSequencePlace(value.start, value.startSide),\n\t\t\t\t\tend: toSequencePlace(value.end, value.endSide),\n\t\t\t\t\tprops: properties,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"change\": {\n\t\t\t\tthis.change(id, {\n\t\t\t\t\tstart: toOptionalSequencePlace(value.start, value.startSide),\n\t\t\t\t\tend: toOptionalSequencePlace(value.end, value.endSide),\n\t\t\t\t\tprops: properties,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"delete\": {\n\t\t\t\tthis.removeIntervalById(id);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"unknown ops should not be stashed\");\n\t\t}\n\t}\n\n\tprivate rebaseReferenceWithSegmentSlide(\n\t\tref: LocalReferencePosition,\n\t\tlocalSeq: number,\n\t\tsquash: boolean,\n\t): { segment: ISegment; offset: number } | undefined {\n\t\tif (!this.client) {\n\t\t\tthrow new LoggingError(\"mergeTree client must exist\");\n\t\t}\n\n\t\tconst { clientId } = this.client.getCollabWindow();\n\t\tconst segment: ISegmentInternal | undefined = ref.getSegment();\n\t\tif (segment?.endpointType) {\n\t\t\treturn { segment, offset: 0 };\n\t\t}\n\t\tconst offset = ref.getOffset();\n\n\t\tconst segoff = getSlideToSegoff(\n\t\t\tsegment === undefined ? undefined : { segment, offset },\n\t\t\tref.slidingPreference,\n\t\t\tcreateLocalReconnectingPerspective(\n\t\t\t\tthis.client.getCurrentSeq(),\n\t\t\t\tclientId,\n\t\t\t\tlocalSeq,\n\t\t\t\tsquash,\n\t\t\t),\n\t\t\tref.canSlideToEndpoint,\n\t\t);\n\n\t\t// case happens when rebasing op, but concurrently entire string has been deleted\n\t\tif (segoff === undefined) {\n\t\t\tif (ref.canSlideToEndpoint !== true) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tsegment:\n\t\t\t\t\tref.slidingPreference === SlidingPreference.FORWARD\n\t\t\t\t\t\t? this.client.endOfTree\n\t\t\t\t\t\t: this.client.startOfTree,\n\t\t\t\toffset: 0,\n\t\t\t};\n\t\t}\n\t\treturn segoff;\n\t}\n\n\tprivate computeRebasedPositions(\n\t\tlocalOpMetadata: IntervalAddLocalMetadata | IntervalChangeLocalMetadata,\n\t\tsquash: boolean,\n\t): Record<\"start\" | \"end\", { segment: ISegmentInternal; offset: number }> | \"detached\" {\n\t\tassert(\n\t\t\tthis.client !== undefined,\n\t\t\t0x550 /* Client should be defined when computing rebased position */,\n\t\t);\n\n\t\tconst { localSeq, interval } = localOpMetadata;\n\t\tconst start = this.rebaseReferenceWithSegmentSlide(interval.start, localSeq, squash);\n\t\tif (start === undefined) {\n\t\t\treturn \"detached\";\n\t\t}\n\t\tconst end = this.rebaseReferenceWithSegmentSlide(interval.end, localSeq, squash);\n\t\tif (end === undefined) {\n\t\t\treturn \"detached\";\n\t\t}\n\t\treturn { start, end };\n\t}\n\n\tpublic attachGraph(client: Client, label: string) {\n\t\tif (this.attached) {\n\t\t\tthrow new LoggingError(\"Only supports one Sequence attach\");\n\t\t}\n\n\t\tif (client === undefined) {\n\t\t\tthrow new LoggingError(\"Client required for this collection\");\n\t\t}\n\n\t\t// Instantiate the local interval collection based on the saved intervals\n\t\tthis.client = client;\n\t\tif (client) {\n\t\t\tclient.on(\"normalize\", (squash) => {\n\t\t\t\tfor (const pending of Object.values(this.pending)) {\n\t\t\t\t\tif (pending?.endpointChanges !== undefined) {\n\t\t\t\t\t\tfor (const local of pending.endpointChanges) {\n\t\t\t\t\t\t\tthis.rebaseLocalInterval(local.data.interval.serialize(), local.data, squash);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tthis.localCollection = new LocalIntervalCollection(\n\t\t\tclient,\n\t\t\tlabel,\n\t\t\tthis.options,\n\t\t\t(interval, previousInterval) => this.emitChange(interval, previousInterval, true, true),\n\t\t);\n\t\tif (this.savedSerializedIntervals) {\n\t\t\tfor (const serializedInterval of this.savedSerializedIntervals) {\n\t\t\t\tconst { id, properties } = getSerializedProperties(serializedInterval);\n\t\t\t\tconst {\n\t\t\t\t\tstart: startPos,\n\t\t\t\t\tend: endPos,\n\t\t\t\t\tintervalType,\n\t\t\t\t\tstartSide,\n\t\t\t\t\tendSide,\n\t\t\t\t} = serializedInterval;\n\t\t\t\tconst start =\n\t\t\t\t\ttypeof startPos === \"number\" && startSide !== undefined\n\t\t\t\t\t\t? { pos: startPos, side: startSide }\n\t\t\t\t\t\t: startPos;\n\t\t\t\tconst end =\n\t\t\t\t\ttypeof endPos === \"number\" && endSide !== undefined\n\t\t\t\t\t\t? { pos: endPos, side: endSide }\n\t\t\t\t\t\t: endPos;\n\t\t\t\tconst interval = createSequenceInterval(\n\t\t\t\t\tlabel,\n\t\t\t\t\tid,\n\t\t\t\t\tstart,\n\t\t\t\t\tend,\n\t\t\t\t\tclient,\n\t\t\t\t\tintervalType,\n\t\t\t\t\tundefined,\n\t\t\t\t\ttrue,\n\t\t\t\t\tthis.options.mergeTreeReferencesCanSlideToEndpoint,\n\t\t\t\t\tproperties,\n\t\t\t\t);\n\t\t\t\tthis.localCollection.add(interval);\n\t\t\t}\n\t\t}\n\t\tthis.savedSerializedIntervals = undefined;\n\t}\n\n\t/**\n\t * Gets the next local sequence number, modifying this client's collab window in doing so.\n\t */\n\tprivate getNextLocalSeq(): number {\n\t\tif (this.client) {\n\t\t\treturn ++this.client.getCollabWindow().localSeq;\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tprivate emitChange(\n\t\tinterval: SequenceIntervalClass,\n\t\tpreviousInterval: SequenceIntervalClass,\n\t\tlocal: boolean,\n\t\tslide: boolean,\n\t\top?: ISequencedDocumentMessage,\n\t): void {\n\t\t// Temporarily make references transient so that positional queries work (non-transient refs\n\t\t// on resolve to DetachedPosition on any segments that don't contain them). The original refType\n\t\t// is restored as single-endpoint changes re-use previous references.\n\n\t\tconst startRefType = previousInterval.start.refType;\n\t\tconst endRefType = previousInterval.end.refType;\n\t\tpreviousInterval.start.refType = ReferenceType.Transient;\n\t\tpreviousInterval.end.refType = ReferenceType.Transient;\n\t\tthis.emit(\"changeInterval\", interval, previousInterval, local, op, slide);\n\t\tthis.emit(\"changed\", interval, {}, previousInterval ?? undefined, local, slide);\n\t\tpreviousInterval.start.refType = startRefType;\n\t\tpreviousInterval.end.refType = endRefType;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.getIntervalById}\n\t */\n\tpublic getIntervalById(id: string): SequenceIntervalClass | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attach must be called before accessing intervals\");\n\t\t}\n\t\treturn this.localCollection.idIntervalIndex.getIntervalById(id);\n\t}\n\n\tprivate assertStickinessEnabled(start: SequencePlace, end: SequencePlace) {\n\t\tif (\n\t\t\t!(typeof start === \"number\" && typeof end === \"number\") &&\n\t\t\t!this.options.intervalStickinessEnabled\n\t\t) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"attempted to set interval stickiness without enabling `intervalStickinessEnabled` feature flag\",\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.add}\n\t */\n\tpublic add({\n\t\tid,\n\t\tstart,\n\t\tend,\n\t\tprops,\n\t}: {\n\t\tid?: string;\n\t\tstart: SequencePlace;\n\t\tend: SequencePlace;\n\t\tprops?: PropertySet;\n\t}): SequenceIntervalClass {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attach must be called prior to adding intervals\");\n\t\t}\n\n\t\tconst { startSide, endSide, startPos, endPos } = endpointPosAndSide(start, end);\n\n\t\tassert(\n\t\t\tstartPos !== undefined &&\n\t\t\t\tendPos !== undefined &&\n\t\t\t\tstartSide !== undefined &&\n\t\t\t\tendSide !== undefined,\n\t\t\t0x793 /* start and end cannot be undefined because they were not passed in as undefined */,\n\t\t);\n\n\t\tthis.assertStickinessEnabled(start, end);\n\n\t\tconst intervalId = id ?? uuid();\n\n\t\tconst interval: SequenceIntervalClass = this.localCollection.addInterval(\n\t\t\tintervalId,\n\t\t\ttoSequencePlace(startPos, startSide),\n\t\t\ttoSequencePlace(endPos, endSide),\n\t\t\tprops,\n\t\t\tundefined,\n\t\t);\n\n\t\tif (interval) {\n\t\t\tif (!this.isCollaborating) {\n\t\t\t\tsetSlideOnRemove(interval.start);\n\t\t\t\tsetSlideOnRemove(interval.end);\n\t\t\t}\n\t\t\tconst serializedInterval: ISerializedInterval = interval.serialize();\n\t\t\tconst localSeq = this.getNextLocalSeq();\n\t\t\tif (this.isCollaborating) {\n\t\t\t\tthis.submitDelta(\n\t\t\t\t\t{\n\t\t\t\t\t\topName: \"add\",\n\t\t\t\t\t\tvalue: serializedInterval,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"add\",\n\t\t\t\t\t\tlocalSeq,\n\t\t\t\t\t\tinterval,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.emit(\"addInterval\", interval, true, undefined);\n\n\t\treturn interval;\n\t}\n\n\tprivate deleteExistingInterval({\n\t\tinterval,\n\t\tlocal,\n\t\top,\n\t\trollback,\n\t}: {\n\t\tinterval: SequenceIntervalClass;\n\t\tlocal: boolean;\n\t\top?: ISequencedDocumentMessage;\n\t\trollback?: boolean;\n\t}) {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t}\n\t\t// The given interval is known to exist in the collection.\n\t\tthis.localCollection.removeExistingInterval(interval);\n\n\t\tif (interval) {\n\t\t\t// Local ops get submitted to the server. Remote ops have the deserializer run.\n\t\t\tif (local && rollback !== true) {\n\t\t\t\tconst value = interval.serialize();\n\t\t\t\tthis.submitDelta(\n\t\t\t\t\t{\n\t\t\t\t\t\topName: \"delete\",\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"delete\",\n\t\t\t\t\t\tlocalSeq: this.getNextLocalSeq(),\n\t\t\t\t\t},\n\t\t\t\t\tinterval,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tif (this.onDeserialize) {\n\t\t\t\t\tthis.onDeserialize(interval);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.emit(\"deleteInterval\", interval, local, op);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.removeIntervalById}\n\t */\n\tpublic removeIntervalById(id: string): SequenceIntervalClass | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t}\n\t\tconst interval = this.getIntervalById(id);\n\t\tif (interval) {\n\t\t\tthis.deleteExistingInterval({ interval, local: true });\n\t\t}\n\t\treturn interval;\n\t}\n\t/**\n\t * {@inheritdoc IIntervalCollection.change}\n\t */\n\tpublic change(\n\t\tid: string,\n\t\t{\n\t\t\tstart,\n\t\t\tend,\n\t\t\tprops,\n\t\t\trollback,\n\t\t}: { start?: SequencePlace; end?: SequencePlace; props?: PropertySet; rollback?: boolean },\n\t): SequenceIntervalClass | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t}\n\n\t\t// Force id to be a string.\n\t\tif (typeof id !== \"string\") {\n\t\t\tthrow new UsageError(\"Change API requires an ID that is a string\");\n\t\t}\n\n\t\t// Ensure that both start and end are defined or both are undefined.\n\t\tif ((start === undefined) !== (end === undefined)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"Change API requires both start and end to be defined or undefined\",\n\t\t\t);\n\t\t}\n\n\t\t// prevent the overwriting of an interval label, it should remain unchanged\n\t\t// once it has been inserted into the collection.\n\t\tif (props?.[reservedRangeLabelsKey] !== undefined) {\n\t\t\tthrow new UsageError(\n\t\t\t\t\"The label property should not be modified once inserted to the collection\",\n\t\t\t);\n\t\t}\n\n\t\tconst interval = this.getIntervalById(id);\n\t\tif (interval) {\n\t\t\tlet deltaProps: PropertySet | undefined;\n\t\t\tlet newInterval: SequenceIntervalClass | undefined;\n\t\t\tif (props !== undefined) {\n\t\t\t\tdeltaProps = interval.changeProperties(props, undefined, rollback);\n\t\t\t}\n\t\t\tconst changeEndpoints = start !== undefined && end !== undefined;\n\t\t\tif (changeEndpoints) {\n\t\t\t\tnewInterval = this.localCollection.changeInterval(interval, start, end);\n\t\t\t\tif (!this.isCollaborating && newInterval !== undefined) {\n\t\t\t\t\tsetSlideOnRemove(newInterval.start);\n\t\t\t\t\tsetSlideOnRemove(newInterval.end);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.isCollaborating && rollback !== true) {\n\t\t\t\t// Emit a property bag containing the ID and the other (if any) properties changed\n\t\t\t\tconst serializedInterval: SerializedIntervalDelta = (\n\t\t\t\t\tnewInterval ?? interval\n\t\t\t\t).serializeDelta({ props, includeEndpoints: changeEndpoints });\n\t\t\t\tconst localSeq = this.getNextLocalSeq();\n\n\t\t\t\tconst metadata: IntervalChangeLocalMetadata = {\n\t\t\t\t\ttype: \"change\",\n\t\t\t\t\tlocalSeq,\n\t\t\t\t\tinterval: newInterval ?? interval,\n\t\t\t\t};\n\n\t\t\t\tthis.submitDelta(\n\t\t\t\t\t{\n\t\t\t\t\t\topName: \"change\",\n\t\t\t\t\t\tvalue: serializedInterval,\n\t\t\t\t\t},\n\t\t\t\t\tmetadata,\n\t\t\t\t\tinterval,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (deltaProps !== undefined) {\n\t\t\t\tthis.emit(\"propertyChanged\", interval, deltaProps, true, undefined);\n\t\t\t\tthis.emit(\n\t\t\t\t\t\"changed\",\n\t\t\t\t\tnewInterval ?? interval,\n\t\t\t\t\tdeltaProps,\n\t\t\t\t\tnewInterval ? interval : undefined,\n\t\t\t\t\ttrue,\n\t\t\t\t\tfalse,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (newInterval) {\n\t\t\t\tthis.emitChange(newInterval, interval, true, false);\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tinterval.start.properties!.interval = undefined;\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tinterval.end.properties!.interval = undefined;\n\t\t\t}\n\t\t\treturn newInterval;\n\t\t}\n\t\t// No interval to change\n\t\treturn undefined;\n\t}\n\n\tprivate get isCollaborating(): boolean {\n\t\treturn this.client?.getCollabWindow().collaborating ?? false;\n\t}\n\n\tprivate hasPendingEndpointChanges(id: string) {\n\t\treturn this.pending[id]?.endpointChanges?.empty === false;\n\t}\n\n\tpublic ackChange(\n\t\tserializedInterval: SerializedIntervalDelta,\n\t\tlocal: boolean,\n\t\top: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: IntervalChangeLocalMetadata | undefined,\n\t) {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t}\n\n\t\t// Note that the ID is in the property bag only to allow us to find the interval.\n\t\t// This API cannot change the ID, and writing to the ID property will result in an exception. So we\n\t\t// strip it out of the properties here.\n\t\tconst { id, properties } = getSerializedProperties(serializedInterval);\n\t\tassert(id !== undefined, 0x3fe /* id must exist on the interval */);\n\n\t\tif (local) {\n\t\t\tassert(localOpMetadata !== undefined, 0xbd4 /* local must have metadata */);\n\t\t\tconst { interval } = localOpMetadata;\n\t\t\tinterval.ackPropertiesChange(properties, op);\n\n\t\t\tthis.ackInterval(interval, op);\n\t\t\treturn interval;\n\t\t} else {\n\t\t\tconst latestInterval = this.getIntervalById(id);\n\t\t\tconst intervalToChange: SequenceIntervalClass | undefined =\n\t\t\t\tthis.pending[id]?.consensus ?? latestInterval;\n\n\t\t\tconst isLatestInterval = intervalToChange === latestInterval;\n\n\t\t\tif (!intervalToChange) {\n\t\t\t\treturn intervalToChange;\n\t\t\t}\n\n\t\t\tconst deltaProps = intervalToChange.changeProperties(properties, op);\n\n\t\t\tlet newInterval = intervalToChange;\n\t\t\tif (hasEndpointChanges(serializedInterval)) {\n\t\t\t\tconst { start, end, startSide, endSide } = serializedInterval;\n\t\t\t\tnewInterval = intervalToChange.modify(\n\t\t\t\t\t\"\",\n\t\t\t\t\ttoOptionalSequencePlace(start, startSide ?? Side.Before),\n\t\t\t\t\ttoOptionalSequencePlace(end, endSide ?? Side.Before),\n\t\t\t\t\top,\n\t\t\t\t);\n\t\t\t\tif (isLatestInterval) {\n\t\t\t\t\tthis.localCollection.removeExistingInterval(intervalToChange);\n\t\t\t\t\tthis.localCollection.add(newInterval);\n\t\t\t\t\tthis.emitChange(newInterval, intervalToChange, local, false, op);\n\t\t\t\t\tif (this.onDeserialize) {\n\t\t\t\t\t\tthis.onDeserialize(newInterval);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isLatestInterval && deltaProps !== undefined && Object.keys(deltaProps).length > 0) {\n\t\t\t\tthis.emit(\"propertyChanged\", latestInterval, deltaProps, local, op);\n\t\t\t\tthis.emit(\"changed\", latestInterval, deltaProps, undefined, local, false);\n\t\t\t}\n\t\t\treturn newInterval;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.attachDeserializer}\n\t */\n\tpublic attachDeserializer(onDeserialize: DeserializeCallback): void {\n\t\t// If no deserializer is specified can skip all processing work\n\t\tif (!onDeserialize) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Start by storing the callbacks so that any subsequent modifications make use of them\n\t\tthis.onDeserialize = onDeserialize;\n\n\t\t// Trigger the async prepare work across all values in the collection\n\t\tif (this.attached) {\n\t\t\tthis.map(onDeserialize);\n\t\t}\n\t}\n\n\t/**\n\t * Returns new interval after rebasing. If undefined, the interval was\n\t * deleted as a result of rebasing. This can occur if the interval applies\n\t * to a range that no longer exists, and the interval was unable to slide.\n\t *\n\t */\n\tpublic rebaseLocalInterval(\n\t\toriginal: SerializedIntervalDelta,\n\t\tlocalOpMetadata: IntervalAddLocalMetadata | IntervalChangeLocalMetadata,\n\t\tsquash: boolean,\n\t): SerializedIntervalDelta | undefined {\n\t\tif (!this.client || !hasEndpointChanges(original)) {\n\t\t\t// If there's no associated mergeTree client, the originally submitted op is still correct.\n\t\t\treturn original;\n\t\t}\n\t\tif (!this.attached || this.localCollection === undefined) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\tconst { localSeq, interval } = localOpMetadata;\n\t\tconst { id } = getSerializedProperties(original);\n\n\t\tconst rebasedEndpoint = this.computeRebasedPositions(localOpMetadata, squash);\n\t\tconst localInterval = this.getIntervalById(id);\n\n\t\t// if the interval slides off the string, rebase the op to be a noop and delete the interval.\n\t\tif (rebasedEndpoint === \"detached\") {\n\t\t\tif (\n\t\t\t\tlocalInterval !== undefined &&\n\t\t\t\t(localInterval === interval || localOpMetadata.type === \"add\")\n\t\t\t) {\n\t\t\t\t// Use deleteExistingInterval (not removeExistingInterval) to ensure the deleteInterval\n\t\t\t\t// event is emitted when intervals slide off during rebasing.\n\t\t\t\tthis.deleteExistingInterval({ interval: localInterval, local: true });\n\t\t\t}\n\t\t\treturn undefined;\n\t\t}\n\t\tconst { start, end } = rebasedEndpoint;\n\t\tif (\n\t\t\tinterval.start.getSegment() !== start.segment ||\n\t\t\tinterval.start.getOffset() !== start.offset ||\n\t\t\tinterval.end.getSegment() !== end.segment ||\n\t\t\tinterval.end.getOffset() !== end.offset\n\t\t) {\n\t\t\tif (localInterval === interval) {\n\t\t\t\tthis.localCollection.removeExistingInterval(localInterval);\n\t\t\t}\n\t\t\tconst old = interval.clone();\n\t\t\tinterval.moveEndpointReferences(rebasedEndpoint);\n\t\t\tif (localInterval === interval) {\n\t\t\t\tthis.localCollection.add(interval);\n\t\t\t\tthis.emitChange(interval, old, true, true);\n\t\t\t}\n\t\t\told.dispose();\n\t\t}\n\n\t\treturn {\n\t\t\t...original,\n\t\t\tstart:\n\t\t\t\tstart.segment.endpointType ??\n\t\t\t\tthis.client.findReconnectionPosition(start.segment, localSeq) + start.offset,\n\t\t\tend:\n\t\t\t\tend.segment.endpointType ??\n\t\t\t\tthis.client.findReconnectionPosition(end.segment, localSeq) + end.offset,\n\t\t\tsequenceNumber: this.client?.getCurrentSeq() ?? 0,\n\t\t};\n\t}\n\n\tprivate getSlideToSegment(\n\t\tlref: LocalReferencePosition,\n\t): { segment: ISegment; offset: number } | undefined {\n\t\tif (!this.client) {\n\t\t\tthrow new LoggingError(\"client does not exist\");\n\t\t}\n\t\tconst segment: ISegmentInternal | undefined = lref.getSegment();\n\t\tif (segment === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst segoff = {\n\t\t\tsegment,\n\t\t\toffset: lref.getOffset(),\n\t\t};\n\t\tif (segoff.segment.localRefs?.has(lref) !== true) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn getSlideToSegoff(\n\t\t\tsegoff,\n\t\t\tlref.slidingPreference,\n\t\t\tundefined,\n\t\t\tlref.canSlideToEndpoint,\n\t\t);\n\t}\n\n\tprivate ackInterval(interval: SequenceIntervalClass, op: ISequencedDocumentMessage): void {\n\t\tif (\n\t\t\t!refTypeIncludesFlag(interval.start, ReferenceType.StayOnRemove) &&\n\t\t\t!refTypeIncludesFlag(interval.end, ReferenceType.StayOnRemove)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newStart = this.getSlideToSegment(interval.start);\n\t\tconst newEnd = this.getSlideToSegment(interval.end);\n\n\t\tconst id = interval.getIntervalId();\n\t\tconst hasPendingChange = this.hasPendingEndpointChanges(id);\n\n\t\tif (!hasPendingChange) {\n\t\t\tsetSlideOnRemove(interval.start);\n\t\t\tsetSlideOnRemove(interval.end);\n\t\t}\n\n\t\tconst needsStartUpdate =\n\t\t\tnewStart?.segment !== interval.start.getSegment() && !hasPendingChange;\n\t\tconst needsEndUpdate = newEnd?.segment !== interval.end.getSegment() && !hasPendingChange;\n\n\t\tif (needsStartUpdate || needsEndUpdate) {\n\t\t\tif (!this.localCollection) {\n\t\t\t\tthrow new LoggingError(\"Attach must be called before accessing intervals\");\n\t\t\t}\n\n\t\t\t// `interval`'s endpoints will get modified in-place, so clone it prior to doing so for event emission.\n\t\t\tconst oldInterval = interval.clone();\n\n\t\t\tconst isLatestInterval = this.getIntervalById(id) === interval;\n\n\t\t\tif (isLatestInterval) {\n\t\t\t\t// In this case, where we change the start or end of an interval,\n\t\t\t\t// it is necessary to remove and re-add the interval listeners.\n\t\t\t\t// This ensures that the correct listeners are added to the LocalReferencePosition.\n\t\t\t\tthis.localCollection.removeExistingInterval(interval);\n\t\t\t}\n\t\t\tif (!this.client) {\n\t\t\t\tthrow new LoggingError(\"client does not exist\");\n\t\t\t}\n\n\t\t\tif (needsStartUpdate) {\n\t\t\t\tconst props = interval.start.properties;\n\t\t\t\tinterval.start = createPositionReferenceFromSegoff({\n\t\t\t\t\tclient: this.client,\n\t\t\t\t\tsegoff: newStart,\n\t\t\t\t\trefType: interval.start.refType,\n\t\t\t\t\top,\n\t\t\t\t\tslidingPreference: interval.start.slidingPreference,\n\t\t\t\t\tcanSlideToEndpoint: interval.start.canSlideToEndpoint,\n\t\t\t\t});\n\t\t\t\tif (props) {\n\t\t\t\t\tinterval.start.addProperties(props);\n\t\t\t\t}\n\t\t\t\tconst oldSeg: ISegmentInternal | undefined = oldInterval.start.getSegment();\n\t\t\t\t// remove and rebuild start interval as transient for event\n\t\t\t\tthis.client.removeLocalReferencePosition(oldInterval.start);\n\t\t\t\toldInterval.start.refType = ReferenceType.Transient;\n\t\t\t\toldSeg?.localRefs?.addLocalRef(oldInterval.start, oldInterval.start.getOffset());\n\t\t\t}\n\t\t\tif (needsEndUpdate) {\n\t\t\t\tconst props = interval.end.properties;\n\t\t\t\tinterval.end = createPositionReferenceFromSegoff({\n\t\t\t\t\tclient: this.client,\n\t\t\t\t\tsegoff: newEnd,\n\t\t\t\t\trefType: interval.end.refType,\n\t\t\t\t\top,\n\t\t\t\t\tslidingPreference: interval.end.slidingPreference,\n\t\t\t\t\tcanSlideToEndpoint: interval.end.canSlideToEndpoint,\n\t\t\t\t});\n\t\t\t\tif (props) {\n\t\t\t\t\tinterval.end.addProperties(props);\n\t\t\t\t}\n\t\t\t\t// remove and rebuild end interval as transient for event\n\t\t\t\tconst oldSeg: ISegmentInternal | undefined = oldInterval.end.getSegment();\n\t\t\t\tthis.client.removeLocalReferencePosition(oldInterval.end);\n\t\t\t\toldInterval.end.refType = ReferenceType.Transient;\n\t\t\t\toldSeg?.localRefs?.addLocalRef(oldInterval.end, oldInterval.end.getOffset());\n\t\t\t}\n\t\t\tif (isLatestInterval) {\n\t\t\t\tthis.localCollection.add(interval);\n\t\t\t\tthis.emitChange(interval, oldInterval, true, true, op);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic ackAdd(\n\t\tserializedInterval: ISerializedInterval,\n\t\tlocal: boolean,\n\t\top: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: IntervalAddLocalMetadata | undefined,\n\t): SequenceIntervalClass {\n\t\tconst { id, properties } = getSerializedProperties(serializedInterval);\n\n\t\tif (local) {\n\t\t\tassert(\n\t\t\t\tlocalOpMetadata !== undefined,\n\t\t\t\t0x553 /* op metadata should be defined for local op */,\n\t\t\t);\n\t\t\tthis.ackInterval(localOpMetadata.interval, op);\n\t\t\treturn localOpMetadata.interval;\n\t\t}\n\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\tconst interval: SequenceIntervalClass = this.localCollection.addInterval(\n\t\t\tid,\n\t\t\ttoSequencePlace(serializedInterval.start, serializedInterval.startSide ?? Side.Before),\n\t\t\ttoSequencePlace(serializedInterval.end, serializedInterval.endSide ?? Side.Before),\n\t\t\tproperties,\n\t\t\top,\n\t\t);\n\n\t\tif (interval) {\n\t\t\tif (this.onDeserialize) {\n\t\t\t\tthis.onDeserialize(interval);\n\t\t\t}\n\t\t}\n\n\t\tthis.emit(\"addInterval\", interval, local, op);\n\n\t\treturn interval;\n\t}\n\n\tpublic ackDelete(\n\t\tserializedInterval: SerializedIntervalDelta,\n\t\tlocal: boolean,\n\t\top: ISequencedDocumentMessage,\n\t): void {\n\t\tif (local) {\n\t\t\t// Local ops were applied when the message was created and there's no \"pending delete\"\n\t\t\t// state to book keep: remote operation application takes into account possibility of\n\t\t\t// locally deleted interval whenever a lookup happens.\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attach must be called prior to deleting intervals\");\n\t\t}\n\n\t\tconst { id } = getSerializedProperties(serializedInterval);\n\t\tconst interval = this.getIntervalById(id);\n\t\tif (interval) {\n\t\t\tthis.deleteExistingInterval({ interval, local, op });\n\t\t}\n\t}\n\n\tpublic serializeInternal(\n\t\tversion: \"1\" | \"2\",\n\t): ISerializedIntervalCollectionV1 | ISerializedIntervalCollectionV2 {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\treturn this.localCollection.serialize(version);\n\t}\n\n\t/**\n\t * @returns an iterator over all intervals in this collection.\n\t */\n\tpublic [Symbol.iterator](): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.CreateForwardIteratorWithStartPosition}\n\t */\n\tpublic CreateForwardIteratorWithStartPosition(\n\t\tstartPosition: number,\n\t): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this, true, startPosition);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.CreateBackwardIteratorWithStartPosition}\n\t */\n\tpublic CreateBackwardIteratorWithStartPosition(\n\t\tstartPosition: number,\n\t): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this, false, startPosition);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.CreateForwardIteratorWithEndPosition}\n\t */\n\tpublic CreateForwardIteratorWithEndPosition(\n\t\tendPosition: number,\n\t): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this, true, undefined, endPosition);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.CreateBackwardIteratorWithEndPosition}\n\t */\n\tpublic CreateBackwardIteratorWithEndPosition(\n\t\tendPosition: number,\n\t): IntervalCollectionIterator {\n\t\tconst iterator = new IntervalCollectionIterator(this, false, undefined, endPosition);\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.gatherIterationResults}\n\t */\n\tpublic gatherIterationResults(\n\t\tresults: SequenceIntervalClass[],\n\t\titeratesForward: boolean,\n\t\tstart?: number,\n\t\tend?: number,\n\t) {\n\t\tif (!this.localCollection) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.localCollection.overlappingIntervalsIndex.gatherIterationResults(\n\t\t\tresults,\n\t\t\titeratesForward,\n\t\t\tstart,\n\t\t\tend,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.findOverlappingIntervals}\n\t */\n\tpublic findOverlappingIntervals(\n\t\tstartPosition: number,\n\t\tendPosition: number,\n\t): SequenceInterval[] {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\treturn this.localCollection.overlappingIntervalsIndex.findOverlappingIntervals(\n\t\t\tstartPosition,\n\t\t\tendPosition,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.map}\n\t */\n\tpublic map(fn: (interval: SequenceIntervalClass) => void) {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\tfor (const interval of this.localCollection.idIntervalIndex) {\n\t\t\tfn(interval);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.previousInterval}\n\t */\n\tpublic previousInterval(pos: number): SequenceInterval | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\treturn this.localCollection.endIntervalIndex.previousInterval(pos);\n\t}\n\n\t/**\n\t * {@inheritdoc IIntervalCollection.nextInterval}\n\t */\n\tpublic nextInterval(pos: number): SequenceInterval | undefined {\n\t\tif (!this.localCollection) {\n\t\t\tthrow new LoggingError(\"attachSequence must be called\");\n\t\t}\n\n\t\treturn this.localCollection.endIntervalIndex.nextInterval(pos);\n\t}\n}\n\nfunction setSlideOnRemove(lref: LocalReferencePosition) {\n\tlet refType = lref.refType;\n\trefType = refType & ~ReferenceType.StayOnRemove;\n\trefType = refType | ReferenceType.SlideOnRemove;\n\tlref.refType = refType;\n}\n\n/**\n * Information that identifies an interval within a `Sequence`.\n * @internal\n */\nexport interface IntervalLocator {\n\t/**\n\t * Label for the collection the interval is a part of\n\t */\n\tlabel: string;\n\t/**\n\t * Interval within that collection\n\t */\n\tinterval: SequenceIntervalClass;\n}\n\n/**\n * Returns an object that can be used to find the interval a given LocalReferencePosition belongs to.\n * @returns undefined if the reference position is not the endpoint of any interval (e.g. it was created\n * on the merge tree directly by app code), otherwise an {@link IntervalLocator} for the interval this\n * endpoint is a part of.\n * @internal\n */\nexport function intervalLocatorFromEndpoint(\n\tpotentialEndpoint: LocalReferencePosition,\n): IntervalLocator | undefined {\n\tconst { interval, [reservedRangeLabelsKey]: collectionNameArray } =\n\t\tpotentialEndpoint.properties ?? {};\n\treturn interval && collectionNameArray?.length === 1\n\t\t? { label: collectionNameArray[0], interval }\n\t\t: undefined;\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/sequence";
|
|
8
|
-
export declare const pkgVersion = "2.74.0-
|
|
8
|
+
export declare const pkgVersion = "2.74.0-368706";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/sequence";
|
|
11
|
-
exports.pkgVersion = "2.74.0-
|
|
11
|
+
exports.pkgVersion = "2.74.0-368706";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,0BAA0B,CAAC;AACrC,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/sequence\";\nexport const pkgVersion = \"2.74.0-
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,0BAA0B,CAAC;AACrC,QAAA,UAAU,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/sequence\";\nexport const pkgVersion = \"2.74.0-368706\";\n"]}
|