@fluidframework/map 2.74.0-370705 → 2.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"directory.js","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAM9E,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAQrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EACX,YAAY,GACZ,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACN,4BAA4B,EAG5B,UAAU,GACV,MAAM,0CAA0C,CAAC;AAClD,OAAO,IAAI,MAAM,iBAAiB,CAAC;AAenC,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErD,sFAAsF;AACtF,oDAAoD;AACpD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AAEzB,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AA2RlC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,iBAAiB,GAAG,CAAC,CAAe,EAAE,CAAe,EAAU,EAAE;IACtE,IAAI,wBAAwB,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,IAAI,wBAAwB,CAAC,CAAC,CAAC,EAAE,CAAC;YACjC,oEAAoE;YACpE,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAU,GAAG,CAAC,CAA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KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,UAAU,CAAC,CAAC;IACzD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { MessageType } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport type {\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tIRuntimeMessageCollection,\n\tIRuntimeMessagesContent,\n\tISequencedMessageEnvelope,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\nimport type { IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tSharedObject,\n\tValueType,\n\tbindHandles,\n\tparseHandles,\n} from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tcreateChildMonitoringContext,\n\ttype ITelemetryLoggerExt,\n\ttype MonitoringContext,\n\tUsageError,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport path from \"path-browserify\";\n\nimport type {\n\tIDirectory,\n\tIDirectoryEvents,\n\tIDirectoryValueChanged,\n\tISharedDirectory,\n\tISharedDirectoryEventsInternal,\n\tIValueChanged,\n} from \"./interfaces.js\";\nimport type {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tISerializableValue,\n\tISerializedValue,\n} from \"./internalInterfaces.js\";\nimport { serializeValue, migrateIfSharedSerializable } from \"./localValues.js\";\nimport { findLast, findLastIndex } from \"./utils.js\";\n\n// We use path-browserify since this code can run safely on the server or the browser.\n// We standardize on using posix slashes everywhere.\nconst posix = path.posix;\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the means to process and submit a given op on a directory.\n */\ninterface IDirectoryMessageHandler {\n\t/**\n\t * Apply the given operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The directory operation to apply\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t * @param clientSequenceNumber - The client sequence number of the message.\n\t */\n\tprocess(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: DirectoryLocalOpMetadata | undefined,\n\t\tclientSequenceNumber: number,\n\t): void;\n\n\t/**\n\t * Resubmit a previously submitted operation that was not delivered.\n\t * @param op - The directory operation to resubmit\n\t * @param localOpMetadata - The metadata that was originally submitted with the message.\n\t */\n\tresubmit(op: IDirectoryOperation, localOpMetadata: DirectoryLocalOpMetadata): void;\n}\n\n/**\n * Operation indicating a value should be set for a key.\n */\nexport interface IDirectorySetOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"set\";\n\n\t/**\n\t * Directory key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Absolute path of the directory where the modified key is located.\n\t */\n\tpath: string;\n\n\t/**\n\t * Value to be set on the key.\n\t */\n\t// eslint-disable-next-line import-x/no-deprecated\n\tvalue: ISerializableValue;\n}\n\n/**\n * Operation indicating a key should be deleted from the directory.\n */\nexport interface IDirectoryDeleteOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"delete\";\n\n\t/**\n\t * Directory key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Absolute path of the directory where the modified key is located.\n\t */\n\tpath: string;\n}\n\n/**\n * An operation on a specific key within a directory.\n */\nexport type IDirectoryKeyOperation = IDirectorySetOperation | IDirectoryDeleteOperation;\n\n/**\n * Operation indicating the directory should be cleared.\n */\nexport interface IDirectoryClearOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"clear\";\n\n\t/**\n\t * Absolute path of the directory being cleared.\n\t */\n\tpath: string;\n}\n\n/**\n * An operation on one or more of the keys within a directory.\n */\nexport type IDirectoryStorageOperation = IDirectoryKeyOperation | IDirectoryClearOperation;\n\n/**\n * Operation indicating a subdirectory should be created.\n */\nexport interface IDirectoryCreateSubDirectoryOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"createSubDirectory\";\n\n\t/**\n\t * Absolute path of the directory that will contain the new subdirectory.\n\t */\n\tpath: string;\n\n\t/**\n\t * Name of the new subdirectory.\n\t */\n\tsubdirName: string;\n}\n\n/**\n * Operation indicating a subdirectory should be deleted.\n */\nexport interface IDirectoryDeleteSubDirectoryOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"deleteSubDirectory\";\n\n\t/**\n\t * Absolute path of the directory that contains the directory to be deleted.\n\t */\n\tpath: string;\n\n\t/**\n\t * Name of the subdirectory to be deleted.\n\t */\n\tsubdirName: string;\n}\n\n/**\n * An operation on the subdirectories within a directory.\n */\nexport type IDirectorySubDirectoryOperation =\n\t| IDirectoryCreateSubDirectoryOperation\n\t| IDirectoryDeleteSubDirectoryOperation;\n\n/**\n * Any operation on a directory.\n */\nexport type IDirectoryOperation = IDirectoryStorageOperation | IDirectorySubDirectoryOperation;\n\ninterface PendingKeySet {\n\ttype: \"set\";\n\tpath: string;\n\tvalue: unknown;\n\tsubdir: SubDirectory;\n}\n\ninterface PendingKeyDelete {\n\ttype: \"delete\";\n\tpath: string;\n\tkey: string;\n\tsubdir: SubDirectory;\n}\n\ninterface PendingClear {\n\ttype: \"clear\";\n\tpath: string;\n\tsubdir: SubDirectory;\n}\n\n/**\n * Represents the \"lifetime\" of a series of pending set operations before the pending\n * set operations are ack'd.\n */\ninterface PendingKeyLifetime {\n\ttype: \"lifetime\";\n\tkey: string;\n\tpath: string;\n\t/**\n\t * A non-empty array of pending key sets that occurred during this lifetime. If the list\n\t * becomes empty (e.g. during processing or rollback), the lifetime no longer exists and\n\t * must be removed from the pending data.\n\t */\n\tkeySets: PendingKeySet[];\n\tsubdir: SubDirectory;\n}\n\n/**\n * A member of the pendingStorageData array, which tracks outstanding changes and can be used to\n * compute optimistic values. Local sets are aggregated into lifetimes.\n */\ntype PendingStorageEntry = PendingKeyLifetime | PendingKeyDelete | PendingClear;\n\ninterface PendingSubDirectoryCreate {\n\ttype: \"createSubDirectory\";\n\tsubdirName: string;\n\tsubdir: SubDirectory;\n}\n\ninterface PendingSubDirectoryDelete {\n\ttype: \"deleteSubDirectory\";\n\tsubdirName: string;\n\tsubdir: SubDirectory;\n}\n\ntype PendingSubDirectoryEntry = PendingSubDirectoryCreate | PendingSubDirectoryDelete;\n\n/**\n * Create info for the subdirectory.\n *\n * @deprecated This interface will no longer be exported in the future(AB#8004).\n *\n * @legacy @beta\n */\nexport interface ICreateInfo {\n\t/**\n\t * Sequence number at which this subdirectory was created.\n\t */\n\tcsn: number;\n\n\t/**\n\t * clientids of the clients which created this sub directory.\n\t */\n\tccIds: string[];\n}\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n *\n * @remarks Directly used in\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify\n * | JSON.stringify}, direct result from\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse | JSON.parse}.\n *\n * @deprecated This interface will no longer be exported in the future(AB#8004).\n *\n * @legacy @beta\n */\nexport interface IDirectoryDataObject {\n\t/**\n\t * Key/value date set by the user.\n\t */\n\t// eslint-disable-next-line import-x/no-deprecated\n\tstorage?: Record<string, ISerializableValue>;\n\n\t/**\n\t * Recursive sub-directories {@link IDirectoryDataObject | objects}.\n\t */\n\tsubdirectories?: Record<string, IDirectoryDataObject>;\n\n\t/**\n\t * Create info for the sub directory. Since directories with same name can get deleted/created by multiple clients\n\t * asynchronously, this info helps us to determine whether the ops where for the current instance of sub directory\n\t * or not and whether to process them or not based on that. Summaries which were not produced which this change\n\t * will not have this info and in that case we can still run in eventual consistency issues but that is no worse\n\t * than the state before this change.\n\t */\n\tci?: ICreateInfo;\n}\n\n/**\n * {@link IDirectory} storage format.\n *\n * @deprecated This interface will no longer be exported in the future(AB#8004).\n *\n * @legacy @beta\n */\nexport interface IDirectoryNewStorageFormat {\n\t/**\n\t * Blob IDs representing larger directory data that was serialized.\n\t */\n\tblobs: string[];\n\n\t/**\n\t * Storage content representing directory data that was not serialized.\n\t */\n\tcontent: IDirectoryDataObject;\n}\n\n/**\n * The comparator essentially performs the following procedure to determine the order of subdirectory creation:\n * 1. If subdirectory A has a non-negative 'seq' and subdirectory B has a negative 'seq', subdirectory A is always placed first due to\n * the policy that acknowledged subdirectories precede locally created ones that have not been committed yet.\n *\n * 2. When both subdirectories A and B have a non-negative 'seq', they are compared as follows:\n * - If A and B have different 'seq', they are ordered based on 'seq', and the one with the lower 'seq' will be positioned ahead. Notably this rule\n * should not be applied in the directory ordering, since the lowest 'seq' is -1, when the directory is created locally but not acknowledged yet.\n * - In the case where A and B have equal 'seq', the one with the lower 'clientSeq' will be positioned ahead. This scenario occurs when grouped\n * batching is enabled, and a lower 'clientSeq' indicates that it was processed earlier after the batch was ungrouped.\n *\n * 3. When both subdirectories A and B have a negative 'seq', they are compared as follows:\n * - If A and B have different 'seq', the one with lower 'seq' will be positioned ahead, which indicates the corresponding creation message was\n * acknowledged by the server earlier.\n * - If A and B have equal 'seq', the one with lower 'clientSeq' will be placed at the front. This scenario suggests that both subdirectories A\n * and B were created locally and not acknowledged yet, with the one possessing the lower 'clientSeq' being created earlier.\n *\n * 4. A 'seq' value of zero indicates that the subdirectory was created in detached state, and it is considered acknowledged for the\n * purpose of ordering.\n */\nconst seqDataComparator = (a: SequenceData, b: SequenceData): number => {\n\tif (isAcknowledgedOrDetached(a)) {\n\t\tif (isAcknowledgedOrDetached(b)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn a.seq === b.seq ? a.clientSeq! - b.clientSeq! : a.seq - b.seq;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t} else {\n\t\tif (isAcknowledgedOrDetached(b)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn a.seq === b.seq ? a.clientSeq! - b.clientSeq! : a.seq - b.seq;\n\t\t}\n\t}\n};\n\nfunction isAcknowledgedOrDetached(seqData: SequenceData): boolean {\n\treturn seqData.seq >= 0;\n}\n\n/**\n * The combination of sequence numebr and client sequence number of a subdirectory\n */\ninterface SequenceData {\n\tseq: number;\n\tclientSeq?: number;\n}\n\n/**\n * {@inheritDoc ISharedDirectory}\n *\n * @example\n *\n * ```typescript\n * mySharedDirectory.createSubDirectory(\"a\").createSubDirectory(\"b\").createSubDirectory(\"c\").set(\"foo\", val1);\n * const mySubDir = mySharedDirectory.getWorkingDirectory(\"/a/b/c\");\n * mySubDir.get(\"foo\"); // returns val1\n * ```\n *\n * @sealed\n */\nexport class SharedDirectory\n\textends SharedObject<ISharedDirectoryEventsInternal>\n\timplements ISharedDirectory\n{\n\t/**\n\t * String representation for the class.\n\t */\n\tpublic [Symbol.toStringTag]: string = \"SharedDirectory\";\n\n\t/**\n\t * {@inheritDoc IDirectory.absolutePath}\n\t */\n\tpublic get absolutePath(): string {\n\t\treturn this.root.absolutePath;\n\t}\n\n\t/**\n\t * Root of the SharedDirectory, most operations on the SharedDirectory itself act on the root.\n\t */\n\tprivate readonly root: SubDirectory = new SubDirectory(\n\t\t{ seq: 0, clientSeq: 0 },\n\t\tnew Set(),\n\t\tthis,\n\t\tthis.runtime,\n\t\tthis.serializer,\n\t\tposix.sep,\n\t\tthis.logger,\n\t);\n\n\t/**\n\t * Mapping of op types to message handlers.\n\t */\n\tprivate readonly messageHandlers = new Map<string, IDirectoryMessageHandler>();\n\n\t/**\n\t * Constructs a new shared directory. If the object is non-local an id and service interfaces will\n\t * be provided.\n\t * @param id - String identifier for the SharedDirectory\n\t * @param runtime - Data store runtime\n\t * @param type - Type identifier\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_directory_\");\n\t\tthis.setMessageHandlers();\n\t\t// Mirror the containedValueChanged op on the SharedDirectory\n\t\tthis.root.on(\"containedValueChanged\", (changed: IValueChanged, local: boolean) => {\n\t\t\tthis.emit(\"containedValueChanged\", changed, local, this);\n\t\t});\n\t\tthis.root.on(\"subDirectoryCreated\", (relativePath: string, local: boolean) => {\n\t\t\tthis.emit(\"subDirectoryCreated\", relativePath, local, this);\n\t\t});\n\t\tthis.root.on(\"subDirectoryDeleted\", (relativePath: string, local: boolean) => {\n\t\t\tthis.emit(\"subDirectoryDeleted\", relativePath, local, this);\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.get}\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic get<T = any>(key: string): T | undefined {\n\t\treturn this.root.get<T>(key);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.set}\n\t */\n\tpublic set<T = unknown>(key: string, value: T): this {\n\t\tthis.root.set(key, value);\n\t\treturn this;\n\t}\n\n\tpublic dispose(error?: Error): void {\n\t\tthis.root.dispose(error);\n\t}\n\n\tpublic get disposed(): boolean {\n\t\treturn this.root.disposed;\n\t}\n\n\t/**\n\t * Deletes the given key from within this IDirectory.\n\t * @param key - The key to delete\n\t * @returns True if the key existed and was deleted, false if it did not exist\n\t */\n\tpublic delete(key: string): boolean {\n\t\treturn this.root.delete(key);\n\t}\n\n\t/**\n\t * Deletes all keys from within this IDirectory.\n\t */\n\tpublic clear(): void {\n\t\tthis.root.clear();\n\t}\n\n\t/**\n\t * Checks whether the given key exists in this IDirectory.\n\t * @param key - The key to check\n\t * @returns True if the key exists, false otherwise\n\t */\n\tpublic has(key: string): boolean {\n\t\treturn this.root.has(key);\n\t}\n\n\t/**\n\t * The number of entries under this IDirectory.\n\t */\n\tpublic get size(): number {\n\t\treturn this.root.size;\n\t}\n\n\t/**\n\t * Issue a callback on each entry under this IDirectory.\n\t * @param callback - Callback to issue\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic forEach(callback: (value: any, key: string, map: Map<string, any>) => void): void {\n\t\t// eslint-disable-next-line unicorn/no-array-for-each, unicorn/no-array-callback-reference\n\t\tthis.root.forEach(callback);\n\t}\n\n\t/**\n\t * Get an iterator over the entries under this IDirectory.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic [Symbol.iterator](): IterableIterator<[string, any]> {\n\t\treturn this.root[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Get an iterator over the entries under this IDirectory.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic entries(): IterableIterator<[string, any]> {\n\t\treturn this.root.entries();\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.countSubDirectory}\n\t */\n\tpublic countSubDirectory(): number {\n\t\treturn this.root.countSubDirectory();\n\t}\n\n\t/**\n\t * Get an iterator over the keys under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\treturn this.root.keys();\n\t}\n\n\t/**\n\t * Get an iterator over the values under this IDirectory.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic values(): IterableIterator<any> {\n\t\treturn this.root.values();\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.createSubDirectory}\n\t */\n\tpublic createSubDirectory(subdirName: string): IDirectory {\n\t\treturn this.root.createSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.getSubDirectory}\n\t */\n\tpublic getSubDirectory(subdirName: string): IDirectory | undefined {\n\t\treturn this.root.getSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.hasSubDirectory}\n\t */\n\tpublic hasSubDirectory(subdirName: string): boolean {\n\t\treturn this.root.hasSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.deleteSubDirectory}\n\t */\n\tpublic deleteSubDirectory(subdirName: string): boolean {\n\t\treturn this.root.deleteSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.subdirectories}\n\t */\n\tpublic subdirectories(): IterableIterator<[string, IDirectory]> {\n\t\treturn this.root.subdirectories();\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.getWorkingDirectory}\n\t */\n\tpublic getWorkingDirectory(relativePath: string): IDirectory | undefined {\n\t\tconst absolutePath = this.makeAbsolute(relativePath);\n\t\tif (absolutePath === posix.sep) {\n\t\t\treturn this.root;\n\t\t}\n\n\t\tlet currentSubDir = this.root;\n\t\tconst subdirs = absolutePath.slice(1).split(posix.sep);\n\t\tfor (const subdir of subdirs) {\n\t\t\tcurrentSubDir = currentSubDir.getSubDirectory(subdir) as SubDirectory;\n\t\t\tif (!currentSubDir) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\treturn currentSubDir;\n\t}\n\n\t/**\n\t * Similar to `getWorkingDirectory`, but only returns directories that are sequenced.\n\t * This can be useful for op processing since we only process ops on sequenced directories.\n\t */\n\tprivate getSequencedWorkingDirectory(relativePath: string): IDirectory | undefined {\n\t\tconst absolutePath = this.makeAbsolute(relativePath);\n\t\tif (absolutePath === posix.sep) {\n\t\t\treturn this.root;\n\t\t}\n\n\t\tlet currentSubDir: SubDirectory | undefined = this.root;\n\t\tconst subdirs = absolutePath.slice(1).split(posix.sep);\n\t\tfor (const subdir of subdirs) {\n\t\t\tcurrentSubDir = currentSubDir.sequencedSubdirectories.get(subdir);\n\t\t\tif (!currentSubDir) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\treturn currentSubDir;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\treturn this.serializeDirectory(this.root, serializer);\n\t}\n\n\t/**\n\t * Submits an operation\n\t * @param op - Op to submit\n\t * @param localOpMetadata - The local metadata associated with the op. We send a unique id that is used to track\n\t * this op while it has not been ack'd. This will be sent when we receive this op back from the server.\n\t */\n\tpublic submitDirectoryMessage(\n\t\top: IDirectoryOperation,\n\t\tlocalOpMetadata: DirectoryLocalOpMetadata,\n\t): void {\n\t\tthis.submitLocalMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect(): void {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}\n\t */\n\tprotected override reSubmitCore(\n\t\tcontent: unknown,\n\t\tlocalOpMetadata: DirectoryLocalOpMetadata,\n\t): void {\n\t\tconst message = content as IDirectoryOperation;\n\t\tconst handler = this.messageHandlers.get(message.type);\n\t\tassert(handler !== undefined, 0x00d /* Missing message handler for message type */);\n\t\thandler.resubmit(message, localOpMetadata);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst data = await readAndParse(storage, snapshotFileName);\n\t\tconst newFormat = data as IDirectoryNewStorageFormat;\n\t\tif (Array.isArray(newFormat.blobs)) {\n\t\t\t// New storage format\n\t\t\tthis.populate(newFormat.content);\n\t\t\tconst blobContents = await Promise.all(\n\t\t\t\tnewFormat.blobs.map(async (blobName) => readAndParse(storage, blobName)),\n\t\t\t);\n\t\t\tfor (const blobContent of blobContents) {\n\t\t\t\tthis.populate(blobContent as IDirectoryDataObject);\n\t\t\t}\n\t\t} else {\n\t\t\t// Old storage format\n\t\t\tthis.populate(data as IDirectoryDataObject);\n\t\t}\n\t}\n\n\t/**\n\t * Populate the directory with the given directory data.\n\t * @param data - A JSON string containing serialized directory data\n\t */\n\tprotected populate(data: IDirectoryDataObject): void {\n\t\tconst stack: [SubDirectory, IDirectoryDataObject][] = [];\n\t\tstack.push([this.root, data]);\n\n\t\twhile (stack.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst [currentSubDir, currentSubDirObject] = stack.pop()!;\n\t\t\tif (currentSubDirObject.subdirectories) {\n\t\t\t\t// Utilize a map to store the seq -> clientSeq for the newly created subdirectory\n\t\t\t\tconst tempSeqNums = new Map<number, number>();\n\t\t\t\tfor (const [subdirName, subdirObject] of Object.entries(\n\t\t\t\t\tcurrentSubDirObject.subdirectories,\n\t\t\t\t)) {\n\t\t\t\t\tlet newSubDir = currentSubDir.getSubDirectory(subdirName) as SubDirectory;\n\t\t\t\t\tlet seqData: SequenceData;\n\t\t\t\t\tif (!newSubDir) {\n\t\t\t\t\t\tconst createInfo = subdirObject.ci;\n\t\t\t\t\t\t// We do not store the client sequence number in the storage because the order has already been\n\t\t\t\t\t\t// guaranteed during the serialization process. As a result, it is only essential to utilize the\n\t\t\t\t\t\t// \"fake\" client sequence number to signify the loading order, and there is no need to retain\n\t\t\t\t\t\t// the actual client sequence number at this point.\n\t\t\t\t\t\tif (createInfo !== undefined && createInfo.csn > 0) {\n\t\t\t\t\t\t\tif (!tempSeqNums.has(createInfo.csn)) {\n\t\t\t\t\t\t\t\ttempSeqNums.set(createInfo.csn, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet fakeClientSeq = tempSeqNums.get(createInfo.csn) as number;\n\t\t\t\t\t\t\tseqData = { seq: createInfo.csn, clientSeq: fakeClientSeq };\n\t\t\t\t\t\t\ttempSeqNums.set(createInfo.csn, ++fakeClientSeq);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * 1. If csn is -1, then initialize it with 0, otherwise we will never process ops for this\n\t\t\t\t\t\t\t * sub directory. This could be done at serialization time too, but we need to maintain\n\t\t\t\t\t\t\t * back compat too and also we will actually know the state when it was serialized.\n\t\t\t\t\t\t\t * 2. We need to make the csn = -1 and csn = 0 share the same counter, there are cases\n\t\t\t\t\t\t\t * where both -1 and 0 coexist within a single document.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tseqData = {\n\t\t\t\t\t\t\t\tseq: 0,\n\t\t\t\t\t\t\t\tclientSeq: ++currentSubDir.localCreationSeq,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewSubDir = new SubDirectory(\n\t\t\t\t\t\t\tseqData,\n\t\t\t\t\t\t\tcreateInfo === undefined ? new Set() : new Set<string>(createInfo.ccIds),\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\tthis.runtime,\n\t\t\t\t\t\t\tthis.serializer,\n\t\t\t\t\t\t\tposix.join(currentSubDir.absolutePath, subdirName),\n\t\t\t\t\t\t\tthis.logger,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcurrentSubDir.populateSubDirectory(subdirName, newSubDir);\n\t\t\t\t\t}\n\t\t\t\t\tstack.push([newSubDir, subdirObject]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentSubDirObject.storage) {\n\t\t\t\tfor (const [key, serializable] of Object.entries(currentSubDirObject.storage)) {\n\t\t\t\t\tconst parsedSerializable = parseHandles(\n\t\t\t\t\t\tserializable,\n\t\t\t\t\t\tthis.serializer,\n\t\t\t\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\t\t\t) as ISerializableValue;\n\t\t\t\t\tmigrateIfSharedSerializable(parsedSerializable, this.serializer, this.handle);\n\t\t\t\t\tcurrentSubDir.populateStorage(key, parsedSerializable.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}\n\t */\n\tprotected override processMessagesCore(messagesCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, local, messagesContent } = messagesCollection;\n\t\tfor (const messageContent of messagesContent) {\n\t\t\tthis.processMessage(envelope, messageContent, local);\n\t\t}\n\t}\n\n\tprivate processMessage(\n\t\tmessageEnvelope: ISequencedMessageEnvelope,\n\t\tmessageContent: IRuntimeMessagesContent,\n\t\tlocal: boolean,\n\t): void {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n\t\tif (messageEnvelope.type === MessageType.Operation) {\n\t\t\tconst op: IDirectoryOperation = messageContent.contents as IDirectoryOperation;\n\t\t\tconst handler = this.messageHandlers.get(op.type);\n\t\t\tassert(\n\t\t\t\thandler !== undefined,\n\t\t\t\t0x00e /* \"Missing message handler for message type: op may be from a newer version */,\n\t\t\t);\n\t\t\thandler.process(\n\t\t\t\tmessageEnvelope,\n\t\t\t\top,\n\t\t\t\tlocal,\n\t\t\t\tmessageContent.localOpMetadata as DirectoryLocalOpMetadata | undefined,\n\t\t\t\tmessageContent.clientSequenceNumber,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}\n\t */\n\tprotected override rollback(\n\t\tcontent: unknown,\n\t\tlocalOpMetadata: DirectoryLocalOpMetadata,\n\t): void {\n\t\tconst op: IDirectoryOperation = content as IDirectoryOperation;\n\t\tconst subdir = this.getWorkingDirectory(op.path) as SubDirectory | undefined;\n\t\tif (subdir) {\n\t\t\tsubdir.rollback(op, localOpMetadata);\n\t\t}\n\t}\n\n\t/**\n\t * Converts the given relative path to absolute against the root.\n\t * @param relativePath - The path to convert\n\t */\n\tprivate makeAbsolute(relativePath: string): string {\n\t\treturn posix.resolve(posix.sep, relativePath);\n\t}\n\n\t/**\n\t * Set the message handlers for the directory.\n\t */\n\tprivate setMessageHandlers(): void {\n\t\t// Notes on how we target the correct subdirectory:\n\t\t// `process`: When processing ops, we only ever want to process ops on sequenced directories. This prevents\n\t\t// scenarios where ops could be processed on a pending directory instead of a sequenced directory,\n\t\t// leading to ops effectively being processed out of order.\n\t\t// `resubmit`: When resubmitting ops, we use `localOpMetadata` to get a reference to the subdirectory that\n\t\t// the op was originally targeting.\n\t\tthis.messageHandlers.set(\"clear\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectoryClearOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: ClearLocalOpMetadata | undefined,\n\t\t\t\tclientSequenceNumber: number,\n\t\t\t) => {\n\t\t\t\tconst subdir = this.getSequencedWorkingDirectory(op.path) as SubDirectory | undefined;\n\t\t\t\tif (subdir !== undefined && !subdir?.disposed) {\n\t\t\t\t\tsubdir.processClearMessage(msgEnvelope, op, local, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (op: IDirectoryClearOperation, localOpMetadata: ClearLocalOpMetadata) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.subdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\ttargetSubdir.resubmitClearMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t\tthis.messageHandlers.set(\"delete\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectoryDeleteOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: EditLocalOpMetadata | undefined,\n\t\t\t\tclientSequenceNumber: number,\n\t\t\t) => {\n\t\t\t\tconst subdir = this.getSequencedWorkingDirectory(op.path) as SubDirectory | undefined;\n\t\t\t\tif (subdir !== undefined && !subdir?.disposed) {\n\t\t\t\t\tsubdir.processDeleteMessage(msgEnvelope, op, local, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (op: IDirectoryDeleteOperation, localOpMetadata: EditLocalOpMetadata) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.subdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\ttargetSubdir.resubmitKeyMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t\tthis.messageHandlers.set(\"set\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectorySetOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: EditLocalOpMetadata | undefined,\n\t\t\t\tclientSequenceNumber: number,\n\t\t\t) => {\n\t\t\t\tconst subdir = this.getSequencedWorkingDirectory(op.path) as SubDirectory | undefined;\n\t\t\t\tif (subdir !== undefined && !subdir?.disposed) {\n\t\t\t\t\tmigrateIfSharedSerializable(op.value, this.serializer, this.handle);\n\t\t\t\t\tconst localValue: unknown = local ? undefined : op.value.value;\n\t\t\t\t\tsubdir.processSetMessage(msgEnvelope, op, localValue, local, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (op: IDirectorySetOperation, localOpMetadata: EditLocalOpMetadata) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.subdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\ttargetSubdir.resubmitKeyMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tthis.messageHandlers.set(\"createSubDirectory\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectoryCreateSubDirectoryOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: SubDirLocalOpMetadata | undefined,\n\t\t\t\tclientSequenceNumber: number,\n\t\t\t) => {\n\t\t\t\tconst parentSubdir = this.getSequencedWorkingDirectory(op.path) as\n\t\t\t\t\t| SubDirectory\n\t\t\t\t\t| undefined;\n\t\t\t\tif (parentSubdir !== undefined && !parentSubdir?.disposed) {\n\t\t\t\t\tparentSubdir.processCreateSubDirectoryMessage(\n\t\t\t\t\t\tmsgEnvelope,\n\t\t\t\t\t\top,\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\tlocalOpMetadata,\n\t\t\t\t\t\tclientSequenceNumber,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (\n\t\t\t\top: IDirectoryCreateSubDirectoryOperation,\n\t\t\t\tlocalOpMetadata: SubDirLocalOpMetadata,\n\t\t\t) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.parentSubdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\t// We don't reuse the metadata but send a new one on each submit.\n\t\t\t\t\ttargetSubdir.resubmitSubDirectoryMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tthis.messageHandlers.set(\"deleteSubDirectory\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectoryDeleteSubDirectoryOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: SubDirLocalOpMetadata | undefined,\n\t\t\t) => {\n\t\t\t\tconst parentSubdir = this.getSequencedWorkingDirectory(op.path) as\n\t\t\t\t\t| SubDirectory\n\t\t\t\t\t| undefined;\n\t\t\t\tif (parentSubdir !== undefined && !parentSubdir?.disposed) {\n\t\t\t\t\tparentSubdir.processDeleteSubDirectoryMessage(\n\t\t\t\t\t\tmsgEnvelope,\n\t\t\t\t\t\top,\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\tlocalOpMetadata,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (\n\t\t\t\top: IDirectoryDeleteSubDirectoryOperation,\n\t\t\t\tlocalOpMetadata: SubDirLocalOpMetadata,\n\t\t\t) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.parentSubdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\t// We don't reuse the metadata but send a new one on each submit.\n\t\t\t\t\ttargetSubdir.resubmitSubDirectoryMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n\t */\n\tprotected applyStashedOp(op: unknown): void {\n\t\tconst directoryOp = op as IDirectoryOperation;\n\t\tconst dir = this.getWorkingDirectory(directoryOp.path);\n\t\tswitch (directoryOp.type) {\n\t\t\tcase \"clear\": {\n\t\t\t\tdir?.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"createSubDirectory\": {\n\t\t\t\tdir?.createSubDirectory(directoryOp.subdirName);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"delete\": {\n\t\t\t\tdir?.delete(directoryOp.key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"deleteSubDirectory\": {\n\t\t\t\tdir?.deleteSubDirectory(directoryOp.subdirName);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"set\": {\n\t\t\t\tmigrateIfSharedSerializable(directoryOp.value, this.serializer, this.handle);\n\t\t\t\tdir?.set(directoryOp.key, directoryOp.value.value);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(directoryOp);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate serializeDirectory(\n\t\troot: SubDirectory,\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\tconst MinValueSizeSeparateSnapshotBlob = 8 * 1024;\n\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tlet counter = 0;\n\t\tconst blobs: string[] = [];\n\n\t\tconst stack: [SubDirectory, IDirectoryDataObject][] = [];\n\t\tconst content: IDirectoryDataObject = {};\n\t\tstack.push([root, content]);\n\n\t\twhile (stack.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst [currentSubDir, currentSubDirObject] = stack.pop()!;\n\t\t\tcurrentSubDirObject.ci = currentSubDir.getSerializableCreateInfo();\n\t\t\tfor (const [key, value] of currentSubDir.getSerializedStorage(serializer)) {\n\t\t\t\tif (!currentSubDirObject.storage) {\n\t\t\t\t\tcurrentSubDirObject.storage = {};\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\t\tconst result: ISerializableValue = {\n\t\t\t\t\ttype: value.type,\n\t\t\t\t\tvalue: value.value && (JSON.parse(value.value) as object),\n\t\t\t\t};\n\t\t\t\tif (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {\n\t\t\t\t\tconst extraContent: IDirectoryDataObject = {};\n\t\t\t\t\tlet largeContent = extraContent;\n\t\t\t\t\tif (currentSubDir.absolutePath !== posix.sep) {\n\t\t\t\t\t\tfor (const dir of currentSubDir.absolutePath.slice(1).split(posix.sep)) {\n\t\t\t\t\t\t\tconst subDataObject: IDirectoryDataObject = {};\n\t\t\t\t\t\t\tlargeContent.subdirectories = { [dir]: subDataObject };\n\t\t\t\t\t\t\tlargeContent = subDataObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlargeContent.storage = { [key]: result };\n\t\t\t\t\tconst blobName = `blob${counter}`;\n\t\t\t\t\tcounter++;\n\t\t\t\t\tblobs.push(blobName);\n\t\t\t\t\tbuilder.addBlob(blobName, JSON.stringify(extraContent));\n\t\t\t\t} else {\n\t\t\t\t\tcurrentSubDirObject.storage[key] = result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const [subdirName, subdir] of currentSubDir.subdirectories()) {\n\t\t\t\tif (!currentSubDirObject.subdirectories) {\n\t\t\t\t\tcurrentSubDirObject.subdirectories = {};\n\t\t\t\t}\n\t\t\t\tconst subDataObject: IDirectoryDataObject = {};\n\t\t\t\tcurrentSubDirObject.subdirectories[subdirName] = subDataObject;\n\t\t\t\tstack.push([subdir as SubDirectory, subDataObject]);\n\t\t\t}\n\t\t}\n\n\t\tconst newFormat: IDirectoryNewStorageFormat = {\n\t\t\tblobs,\n\t\t\tcontent,\n\t\t};\n\t\tbuilder.addBlob(snapshotFileName, JSON.stringify(newFormat));\n\n\t\treturn builder.getSummaryTree();\n\t}\n}\n\ninterface ICreateSubDirLocalOpMetadata {\n\ttype: \"createSubDir\";\n\tparentSubdir: SubDirectory;\n}\n\ninterface IDeleteSubDirLocalOpMetadata {\n\ttype: \"deleteSubDir\";\n\tsubDirectory: SubDirectory | undefined;\n\tparentSubdir: SubDirectory;\n}\n\ntype SubDirLocalOpMetadata = ICreateSubDirLocalOpMetadata | IDeleteSubDirLocalOpMetadata;\n\ntype EditLocalOpMetadata = PendingKeySet | PendingKeyDelete;\n\ntype ClearLocalOpMetadata = PendingClear;\n\ntype StorageLocalOpMetadata = EditLocalOpMetadata | ClearLocalOpMetadata;\n\n/**\n * Types of local op metadata.\n */\nexport type DirectoryLocalOpMetadata = StorageLocalOpMetadata | SubDirLocalOpMetadata;\n\n// eslint-disable-next-line @rushstack/no-new-null\nfunction assertNonNullClientId(clientId: string | null): asserts clientId is string {\n\tassert(clientId !== null, 0x6af /* client id should never be null */);\n}\n\n/**\n * Node of the directory tree.\n * @sealed\n */\nclass SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirectory {\n\t/**\n\t * Tells if the sub directory is deleted or not.\n\t */\n\tprivate _deleted = false;\n\n\t/**\n\t * String representation for the class.\n\t */\n\tpublic [Symbol.toStringTag]: string = \"SubDirectory\";\n\n\t/**\n\t * The sequenced subdirectories the directory is holding independent of any pending\n\t * create/delete subdirectory operations.\n\t */\n\tprivate readonly _sequencedSubdirectories = new Map<string, SubDirectory>();\n\n\t/**\n\t * Assigns a unique ID to each subdirectory created locally but pending for acknowledgement, facilitating the tracking\n\t * of the creation order.\n\t */\n\tpublic localCreationSeq: number = 0;\n\n\tprivate readonly mc: MonitoringContext;\n\n\t/**\n\t * Constructor.\n\t * @param sequenceNumber - Message seq number at which this was created.\n\t * @param clientIds - Ids of client which created this directory.\n\t * @param directory - Reference back to the SharedDirectory to perform operations\n\t * @param runtime - The data store runtime this directory is associated with\n\t * @param serializer - The serializer to serialize / parse handles\n\t * @param absolutePath - The absolute path of this IDirectory\n\t */\n\tpublic constructor(\n\t\tprivate readonly seqData: SequenceData,\n\t\tprivate readonly clientIds: Set<string>,\n\t\tprivate readonly directory: SharedDirectory,\n\t\tprivate readonly runtime: IFluidDataStoreRuntime,\n\t\tprivate readonly serializer: IFluidSerializer,\n\t\tpublic readonly absolutePath: string,\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\tsuper();\n\t\tthis.mc = createChildMonitoringContext({ logger, namespace: \"Directory\" });\n\t}\n\n\tpublic dispose(error?: Error): void {\n\t\tthis._deleted = true;\n\t\tthis.emit(\"disposed\", this);\n\t}\n\n\t/**\n\t * Unmark the deleted property only when rolling back delete.\n\t */\n\tprivate undispose(): void {\n\t\tthis._deleted = false;\n\t\tthis.emit(\"undisposed\", this);\n\t}\n\n\tpublic get disposed(): boolean {\n\t\treturn this._deleted;\n\t}\n\n\tprivate throwIfDisposed(): void {\n\t\tif (this._deleted) {\n\t\t\tthrow new UsageError(\"Cannot access Disposed subDirectory\");\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether the given key exists in this IDirectory.\n\t * @param key - The key to check\n\t * @returns True if the key exists, false otherwise\n\t */\n\tpublic has(key: string): boolean {\n\t\tthis.throwIfDisposed();\n\t\treturn this.optimisticallyHas(key);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.get}\n\t */\n\tpublic get<T = unknown>(key: string): T | undefined {\n\t\treturn this.getOptimisticValue(key) as T | undefined;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.set}\n\t */\n\tpublic set<T = unknown>(key: string, value: T): this {\n\t\tthis.throwIfDisposed();\n\t\t// Undefined/null keys can't be serialized to JSON in the manner we currently snapshot.\n\t\tif (key === undefined || key === null) {\n\t\t\tthrow new Error(\"Undefined and null keys are not supported\");\n\t\t}\n\t\tconst previousOptimisticLocalValue = this.getOptimisticValue(key);\n\n\t\tconst detachedBind =\n\t\t\tthis.mc.config.getBoolean(\"Fluid.Directory.AllowDetachedResolve\") ?? false;\n\t\tif (detachedBind) {\n\t\t\t// Create a local value and serialize it.\n\t\t\t// AB#47081: This will be removed once we can validate that it is no longer needed.\n\t\t\tbindHandles(value, this.directory.handle);\n\t\t}\n\n\t\t// If we are not attached, don't submit the op.\n\t\tif (!this.directory.isAttached()) {\n\t\t\tthis.sequencedStorageData.set(key, value);\n\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\tkey,\n\t\t\t\tpath: this.absolutePath,\n\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t};\n\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\tkey,\n\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t};\n\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\treturn this;\n\t\t}\n\n\t\t// A new pending key lifetime is created if:\n\t\t// 1. There isn't any pending entry for the key yet\n\t\t// 2. The most recent pending entry for the key was a deletion (as this terminates the prior lifetime)\n\t\t// 3. A clear was sent after the last pending entry for the key (which also terminates the prior lifetime)\n\t\tlet latestPendingEntry = findLast(\n\t\t\tthis.pendingStorageData,\n\t\t\t(entry) => entry.type === \"clear\" || entry.key === key,\n\t\t);\n\t\tif (\n\t\t\tlatestPendingEntry === undefined ||\n\t\t\tlatestPendingEntry.type === \"delete\" ||\n\t\t\tlatestPendingEntry.type === \"clear\"\n\t\t) {\n\t\t\tlatestPendingEntry = {\n\t\t\t\ttype: \"lifetime\",\n\t\t\t\tpath: this.absolutePath,\n\t\t\t\tkey,\n\t\t\t\tkeySets: [],\n\t\t\t\tsubdir: this,\n\t\t\t};\n\t\t\tthis.pendingStorageData.push(latestPendingEntry);\n\t\t}\n\t\tconst pendingKeySet: PendingKeySet = {\n\t\t\ttype: \"set\",\n\t\t\tpath: this.absolutePath,\n\t\t\tvalue,\n\t\t\tsubdir: this,\n\t\t};\n\t\tlatestPendingEntry.keySets.push(pendingKeySet);\n\n\t\tconst op: IDirectoryOperation = {\n\t\t\tkey,\n\t\t\tpath: this.absolutePath,\n\t\t\ttype: \"set\",\n\t\t\tvalue: { type: ValueType[ValueType.Plain], value },\n\t\t};\n\t\tthis.submitKeyMessage(op, pendingKeySet);\n\n\t\tconst directoryValueChanged: IDirectoryValueChanged = {\n\t\t\tkey,\n\t\t\tpath: this.absolutePath,\n\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t};\n\t\tthis.directory.emit(\"valueChanged\", directoryValueChanged, true, this.directory);\n\t\tconst valueChanged: IValueChanged = {\n\t\t\tkey,\n\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t};\n\t\tthis.emit(\"containedValueChanged\", valueChanged, true, this);\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.countSubDirectory}\n\t */\n\tpublic countSubDirectory(): number {\n\t\treturn [...this.subdirectories()].length;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.createSubDirectory}\n\t */\n\tpublic createSubDirectory(subdirName: string): IDirectory {\n\t\tthis.throwIfDisposed();\n\t\t// Undefined/null subdirectory names can't be serialized to JSON in the manner we currently snapshot.\n\t\tif (subdirName === undefined || subdirName === null) {\n\t\t\tthrow new Error(\"SubDirectory name may not be undefined or null\");\n\t\t}\n\n\t\tif (subdirName.includes(posix.sep)) {\n\t\t\tthrow new Error(`SubDirectory name may not contain ${posix.sep}`);\n\t\t}\n\n\t\tlet subDir = this.getOptimisticSubDirectory(subdirName, true);\n\t\tconst seqData = this.getLocalSeq();\n\t\tconst clientId = this.runtime.clientId ?? \"detached\";\n\t\tconst isNewSubDirectory = subDir === undefined;\n\n\t\tif (subDir === undefined) {\n\t\t\t// If we do not have optimistically have this subdirectory yet, we should create a new one\n\t\t\tconst absolutePath = posix.join(this.absolutePath, subdirName);\n\t\t\tsubDir = new SubDirectory(\n\t\t\t\t{ ...seqData },\n\t\t\t\tnew Set([clientId]),\n\t\t\t\tthis.directory,\n\t\t\t\tthis.runtime,\n\t\t\t\tthis.serializer,\n\t\t\t\tabsolutePath,\n\t\t\t\tthis.mc.logger,\n\t\t\t);\n\t\t} else {\n\t\t\tif (subDir.disposed) {\n\t\t\t\t// In the case that the subdir exists but is disposed, we should\n\t\t\t\t// still use the existing subdir to maintain any pending changes but\n\t\t\t\t// ensure it is no longer disposed.\n\t\t\t\tthis.undisposeSubdirectoryTree(subDir);\n\t\t\t}\n\t\t\tsubDir.clientIds.add(clientId);\n\t\t}\n\n\t\tthis.registerEventsOnSubDirectory(subDir, subdirName);\n\n\t\t// Only submit the op/emit event if we actually created a new subdir.\n\t\tif (isNewSubDirectory) {\n\t\t\tif (this.directory.isAttached()) {\n\t\t\t\tconst pendingSubDirectoryCreate: PendingSubDirectoryCreate = {\n\t\t\t\t\ttype: \"createSubDirectory\",\n\t\t\t\t\tsubdirName,\n\t\t\t\t\tsubdir: subDir,\n\t\t\t\t};\n\t\t\t\tthis.pendingSubDirectoryData.push(pendingSubDirectoryCreate);\n\t\t\t\tconst op: IDirectoryCreateSubDirectoryOperation = {\n\t\t\t\t\tsubdirName,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\ttype: \"createSubDirectory\",\n\t\t\t\t};\n\t\t\t\tthis.submitCreateSubDirectoryMessage(op);\n\t\t\t} else {\n\t\t\t\t// If we are detached, don't submit the op and directly commit\n\t\t\t\t// the subdir to _sequencedSubdirectories.\n\t\t\t\tthis._sequencedSubdirectories.set(subdirName, subDir);\n\t\t\t}\n\t\t\tthis.emit(\"subDirectoryCreated\", subdirName, true, this);\n\t\t}\n\t\treturn subDir;\n\t}\n\n\t/**\n\t * Gets the Sequence Data which should be used for local changes.\n\t *\n\t * @remarks While detached, 0 is used rather than -1 to represent a change which should be universally known (as opposed to known\n\t * only by the local client). This ensures that if the directory is later attached, none of its data needs to be updated (the values\n\t * last set while detached will now be known to any new client, until they are changed).\n\t *\n\t * The client sequence number is incremented by 1 for maintaining the internal order of locally created subdirectories\n\t *\n\t * @privateRemarks TODO: Convert these conventions to named constants. The semantics used here match those for merge-tree.\n\t */\n\tprivate getLocalSeq(): SequenceData {\n\t\treturn this.directory.isAttached()\n\t\t\t? { seq: -1, clientSeq: ++this.localCreationSeq }\n\t\t\t: { seq: 0, clientSeq: ++this.localCreationSeq };\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.getSubDirectory}\n\t */\n\tpublic getSubDirectory(subdirName: string): IDirectory | undefined {\n\t\tthis.throwIfDisposed();\n\t\treturn this.getOptimisticSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.hasSubDirectory}\n\t */\n\tpublic hasSubDirectory(subdirName: string): boolean {\n\t\tthis.throwIfDisposed();\n\t\treturn this.getOptimisticSubDirectory(subdirName) !== undefined;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.deleteSubDirectory}\n\t */\n\tpublic deleteSubDirectory(subdirName: string): boolean {\n\t\tthis.throwIfDisposed();\n\n\t\tif (!this.directory.isAttached()) {\n\t\t\tconst previousValue = this._sequencedSubdirectories.get(subdirName);\n\t\t\tconst successfullyRemoved = this._sequencedSubdirectories.delete(subdirName);\n\t\t\t// Only emit if we actually deleted something.\n\t\t\tif (successfullyRemoved) {\n\t\t\t\tthis.disposeSubDirectoryTree(previousValue);\n\t\t\t\tthis.emit(\"subDirectoryDeleted\", subdirName, true, this);\n\t\t\t}\n\t\t\treturn successfullyRemoved;\n\t\t}\n\n\t\tconst previousOptimisticSubDirectory = this.getOptimisticSubDirectory(subdirName);\n\t\tif (previousOptimisticSubDirectory === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\tconst pendingSubdirDelete: PendingSubDirectoryDelete = {\n\t\t\ttype: \"deleteSubDirectory\",\n\t\t\tsubdirName,\n\t\t\tsubdir: this,\n\t\t};\n\t\tthis.pendingSubDirectoryData.push(pendingSubdirDelete);\n\n\t\tconst op: IDirectoryOperation = {\n\t\t\tsubdirName,\n\t\t\ttype: \"deleteSubDirectory\",\n\t\t\tpath: this.absolutePath,\n\t\t};\n\t\tthis.submitDeleteSubDirectoryMessage(op, previousOptimisticSubDirectory);\n\t\tthis.emit(\"subDirectoryDeleted\", subdirName, true, this);\n\t\t// We don't want to fully dispose the subdir tree since this is only a pending\n\t\t// local delete. Instead we will only emit the dispose event to reflect the\n\t\t// local state.\n\t\tthis.emitDisposeForSubdirTree(previousOptimisticSubDirectory);\n\t\treturn true;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.subdirectories}\n\t */\n\tpublic subdirectories(): IterableIterator<[string, IDirectory]> {\n\t\tthis.throwIfDisposed();\n\n\t\t// subdirectories() should reflect the optimistic state of subdirectories.\n\t\t// This means that we should return both sequenced and pending subdirectories\n\t\t// that do not also have a pending deletion.\n\t\tconst sequencedSubdirs: [string, SubDirectory][] = [];\n\t\tconst sequencedSubdirNames = new Set([...this._sequencedSubdirectories.keys()]);\n\t\tfor (const subdirName of sequencedSubdirNames) {\n\t\t\tconst optimisticSubdir = this.getOptimisticSubDirectory(subdirName);\n\t\t\tif (optimisticSubdir !== undefined) {\n\t\t\t\tsequencedSubdirs.push([subdirName, optimisticSubdir]);\n\t\t\t}\n\t\t}\n\t\tconst pendingSubdirNames = [\n\t\t\t...new Set(\n\t\t\t\tthis.pendingSubDirectoryData\n\t\t\t\t\t.map((entry) => entry.subdirName)\n\t\t\t\t\t.filter((subdirName) => !sequencedSubdirNames.has(subdirName)),\n\t\t\t),\n\t\t];\n\t\tconst pendingSubdirs: [string, SubDirectory][] = [];\n\t\tfor (const subdirName of pendingSubdirNames) {\n\t\t\tconst optimisticSubdir = this.getOptimisticSubDirectory(subdirName);\n\t\t\tif (optimisticSubdir !== undefined) {\n\t\t\t\tpendingSubdirs.push([subdirName, optimisticSubdir]);\n\t\t\t}\n\t\t}\n\t\tconst allSubdirs = [...sequencedSubdirs, ...pendingSubdirs];\n\t\tconst orderedSubdirs = allSubdirs.sort((a, b) => {\n\t\t\tconst aSeqData = a[1].seqData;\n\t\t\tconst bSeqData = b[1].seqData;\n\t\t\treturn seqDataComparator(aSeqData, bSeqData);\n\t\t});\n\n\t\treturn orderedSubdirs[Symbol.iterator]();\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.getWorkingDirectory}\n\t */\n\tpublic getWorkingDirectory(relativePath: string): IDirectory | undefined {\n\t\tthis.throwIfDisposed();\n\t\treturn this.directory.getWorkingDirectory(this.makeAbsolute(relativePath));\n\t}\n\n\t/**\n\t * This checks if there is pending delete op for local delete for a given child subdirectory.\n\t * @param subDirName - directory name.\n\t * @returns true if there is pending delete.\n\t */\n\tpublic isSubDirectoryDeletePending(subDirName: string): boolean {\n\t\tconst lastPendingEntry = findLast(this.pendingSubDirectoryData, (entry) => {\n\t\t\treturn entry.subdirName === subDirName && entry.type === \"deleteSubDirectory\";\n\t\t});\n\t\treturn lastPendingEntry !== undefined;\n\t}\n\n\t/**\n\t * Deletes the given key from within this IDirectory.\n\t * @param key - The key to delete\n\t * @returns True if the key existed and was deleted, false if it did not exist\n\t */\n\tpublic delete(key: string): boolean {\n\t\tthis.throwIfDisposed();\n\t\tconst previousOptimisticLocalValue = this.getOptimisticValue(key);\n\n\t\tif (!this.directory.isAttached()) {\n\t\t\tconst successfullyRemoved = this.sequencedStorageData.delete(key);\n\t\t\t// Only emit if we actually deleted something.\n\t\t\tif (previousOptimisticLocalValue !== undefined && successfullyRemoved) {\n\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\tkey,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t\t};\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\t\tkey,\n\t\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t\t};\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\t}\n\t\t\treturn successfullyRemoved;\n\t\t}\n\n\t\tconst pendingKeyDelete: PendingKeyDelete = {\n\t\t\ttype: \"delete\",\n\t\t\tpath: this.absolutePath,\n\t\t\tkey,\n\t\t\tsubdir: this,\n\t\t};\n\t\tthis.pendingStorageData.push(pendingKeyDelete);\n\n\t\tconst op: IDirectoryOperation = {\n\t\t\tkey,\n\t\t\ttype: \"delete\",\n\t\t\tpath: this.absolutePath,\n\t\t};\n\t\tthis.submitKeyMessage(op, pendingKeyDelete);\n\t\t// Only emit if we locally believe we deleted something. Otherwise we still send the op\n\t\t// (permitting speculative deletion even if we don't see anything locally) but don't emit\n\t\t// a valueChanged since we in fact did not locally observe a value change.\n\t\tif (previousOptimisticLocalValue !== undefined) {\n\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\tkey,\n\t\t\t\tpath: this.absolutePath,\n\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t};\n\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\tkey,\n\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t};\n\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes all keys from within this IDirectory.\n\t */\n\tpublic clear(): void {\n\t\tthis.throwIfDisposed();\n\n\t\tif (!this.directory.isAttached()) {\n\t\t\tthis.sequencedStorageData.clear();\n\t\t\tthis.directory.emit(\"clear\", true, this.directory);\n\t\t\tthis.directory.emit(\"clearInternal\", this.absolutePath, true, this.directory);\n\t\t\treturn;\n\t\t}\n\n\t\tconst pendingClear: PendingClear = {\n\t\t\ttype: \"clear\",\n\t\t\tpath: this.absolutePath,\n\t\t\tsubdir: this,\n\t\t};\n\t\tthis.pendingStorageData.push(pendingClear);\n\n\t\tthis.directory.emit(\"clear\", true, this.directory);\n\t\tthis.directory.emit(\"clearInternal\", this.absolutePath, true, this.directory);\n\t\tconst op: IDirectoryOperation = {\n\t\t\ttype: \"clear\",\n\t\t\tpath: this.absolutePath,\n\t\t};\n\t\tthis.submitClearMessage(op, pendingClear);\n\t}\n\n\t/**\n\t * Issue a callback on each entry under this IDirectory.\n\t * @param callback - Callback to issue\n\t */\n\tpublic forEach(\n\t\tcallback: (value: unknown, key: string, map: Map<string, unknown>) => void,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tfor (const [key, localValue] of this.internalIterator()) {\n\t\t\tcallback(localValue, key, this);\n\t\t}\n\t}\n\n\t/**\n\t * The number of entries under this IDirectory.\n\t */\n\tpublic get size(): number {\n\t\tthis.throwIfDisposed();\n\t\treturn [...this.internalIterator()].length;\n\t}\n\n\t/**\n\t * Get an iterator over the entries under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic entries(): IterableIterator<[string, unknown]> {\n\t\tthis.throwIfDisposed();\n\t\tconst internalIterator = this.internalIterator();\n\t\tconst next = (): IteratorResult<[string, unknown]> => {\n\t\t\tconst nextResult = internalIterator.next();\n\t\t\tif (nextResult.done) {\n\t\t\t\treturn { value: undefined, done: true };\n\t\t\t}\n\t\t\t// Unpack the stored value\n\t\t\tconst [key, localValue] = nextResult.value;\n\t\t\treturn { value: [key, localValue], done: false };\n\t\t};\n\n\t\tconst iterator = {\n\t\t\tnext,\n\t\t\t[Symbol.iterator](): IterableIterator<[string, unknown]> {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the keys under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\tthis.throwIfDisposed();\n\t\tconst internalIterator = this.internalIterator();\n\t\tconst next = (): IteratorResult<string> => {\n\t\t\tconst nextResult = internalIterator.next();\n\t\t\tif (nextResult.done) {\n\t\t\t\treturn { value: undefined, done: true };\n\t\t\t}\n\t\t\tconst [key] = nextResult.value;\n\t\t\treturn { value: key, done: false };\n\t\t};\n\t\tconst iterator = {\n\t\t\tnext,\n\t\t\t[Symbol.iterator](): IterableIterator<string> {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the values under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic values(): IterableIterator<unknown> {\n\t\tthis.throwIfDisposed();\n\t\tconst internalIterator = this.internalIterator();\n\t\tconst next = (): IteratorResult<unknown> => {\n\t\t\tconst nextResult = internalIterator.next();\n\t\t\tif (nextResult.done) {\n\t\t\t\treturn { value: undefined, done: true };\n\t\t\t}\n\t\t\tconst [, localValue] = nextResult.value;\n\t\t\treturn { value: localValue, done: false };\n\t\t};\n\t\tconst iterator = {\n\t\t\tnext,\n\t\t\t[Symbol.iterator](): IterableIterator<unknown> {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the entries under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic [Symbol.iterator](): IterableIterator<[string, unknown]> {\n\t\tthis.throwIfDisposed();\n\t\treturn this.internalIterator();\n\t}\n\n\t/**\n\t * The data this SubDirectory instance is storing, but only including sequenced values (no local pending\n\t * modifications are included).\n\t */\n\tprivate readonly sequencedStorageData = new Map<string, unknown>();\n\n\t/**\n\t * A data structure containing all local pending storage modifications, which is used in combination\n\t * with the sequencedStorageData to compute optimistic values.\n\t *\n\t * Pending sets are aggregated into \"lifetimes\", which permit correct relative iteration order\n\t * even across remote operations and rollbacks.\n\t */\n\tprivate readonly pendingStorageData: PendingStorageEntry[] = [];\n\n\t/**\n\t * A data structure containing all local pending subdirectory create/deletes, which is used in combination\n\t * with the _sequencedSubdirectories to compute optimistic values.\n\t */\n\tprivate readonly pendingSubDirectoryData: PendingSubDirectoryEntry[] = [];\n\n\t/**\n\t * An internal iterator that iterates over the entries in the directory.\n\t */\n\tprivate readonly internalIterator = (): IterableIterator<[string, unknown]> => {\n\t\t// We perform iteration in two steps - first by iterating over members of the sequenced storage data that are not\n\t\t// optimistically deleted or cleared, and then over the pending data lifetimes that have not subsequently\n\t\t// been deleted or cleared. In total, this give an ordering of members based on when they were initially\n\t\t// added to the sub directory (even if they were later modified), similar to the native Map.\n\t\tconst sequencedStorageDataIterator = this.sequencedStorageData.keys();\n\t\tconst pendingStorageDataIterator = this.pendingStorageData.values();\n\t\tconst next = (): IteratorResult<[string, unknown]> => {\n\t\t\tlet nextSequencedKey = sequencedStorageDataIterator.next();\n\t\t\twhile (!nextSequencedKey.done) {\n\t\t\t\tconst key = nextSequencedKey.value;\n\t\t\t\t// If we have any pending deletes or clears, then we won't iterate to this key yet (if at all).\n\t\t\t\t// Either it is optimistically deleted and will not be part of the iteration, or it was\n\t\t\t\t// re-added later and we'll iterate to it when we get to the pending data.\n\t\t\t\tif (\n\t\t\t\t\t!this.pendingStorageData.some(\n\t\t\t\t\t\t(entry) =>\n\t\t\t\t\t\t\tentry.type === \"clear\" || (entry.type === \"delete\" && entry.key === key),\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tassert(this.has(key), 0xc03 /* key should exist in sequenced or pending data */);\n\t\t\t\t\tconst optimisticValue = this.getOptimisticValue(key);\n\t\t\t\t\treturn { value: [key, optimisticValue], done: false };\n\t\t\t\t}\n\t\t\t\tnextSequencedKey = sequencedStorageDataIterator.next();\n\t\t\t}\n\n\t\t\tlet nextPending = pendingStorageDataIterator.next();\n\t\t\twhile (!nextPending.done) {\n\t\t\t\tconst nextPendingEntry = nextPending.value;\n\t\t\t\t// A lifetime entry may need to be iterated.\n\t\t\t\tif (nextPendingEntry.type === \"lifetime\") {\n\t\t\t\t\tconst nextPendingEntryIndex = this.pendingStorageData.indexOf(nextPendingEntry);\n\t\t\t\t\tconst mostRecentDeleteOrClearIndex = findLastIndex(\n\t\t\t\t\t\tthis.pendingStorageData,\n\t\t\t\t\t\t(entry) =>\n\t\t\t\t\t\t\tentry.type === \"clear\" ||\n\t\t\t\t\t\t\t(entry.type === \"delete\" && entry.key === nextPendingEntry.key),\n\t\t\t\t\t);\n\t\t\t\t\t// Only iterate the pending entry now if it hasn't been deleted or cleared.\n\t\t\t\t\tif (nextPendingEntryIndex > mostRecentDeleteOrClearIndex) {\n\t\t\t\t\t\tconst latestPendingValue =\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\t\tnextPendingEntry.keySets[nextPendingEntry.keySets.length - 1]!;\n\t\t\t\t\t\t// Skip iterating if we would have would have already iterated it as part of the sequenced data.\n\t\t\t\t\t\t// This is not a perfect check in the case the map has changed since the iterator was created\n\t\t\t\t\t\t// (e.g. if a remote client added the same key in the meantime).\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!this.sequencedStorageData.has(nextPendingEntry.key) ||\n\t\t\t\t\t\t\tmostRecentDeleteOrClearIndex !== -1\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn { value: [nextPendingEntry.key, latestPendingValue.value], done: false };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextPending = pendingStorageDataIterator.next();\n\t\t\t}\n\n\t\t\treturn { value: undefined, done: true };\n\t\t};\n\n\t\tconst iterator = {\n\t\t\tnext,\n\t\t\t[Symbol.iterator](): IterableIterator<[string, unknown]> {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t};\n\n\t/**\n\t * Compute the optimistic local value for a given key. This combines the sequenced data with\n\t * any pending changes that have not yet been sequenced.\n\t */\n\tprivate readonly getOptimisticValue = (key: string): unknown => {\n\t\tconst latestPendingEntry = findLast(\n\t\t\tthis.pendingStorageData,\n\t\t\t(entry) => entry.type === \"clear\" || entry.key === key,\n\t\t);\n\n\t\tif (latestPendingEntry === undefined) {\n\t\t\treturn this.sequencedStorageData.get(key);\n\t\t} else if (latestPendingEntry.type === \"lifetime\") {\n\t\t\tconst latestPendingSet =\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tlatestPendingEntry.keySets[latestPendingEntry.keySets.length - 1]!;\n\t\t\treturn latestPendingSet.value;\n\t\t} else {\n\t\t\t// Delete or clear\n\t\t\treturn undefined;\n\t\t}\n\t};\n\n\t/**\n\t * Determine if the directory optimistically has the key.\n\t * This will return true even if the value is undefined.\n\t */\n\tprivate readonly optimisticallyHas = (key: string): boolean => {\n\t\tconst latestPendingEntry = findLast(\n\t\t\tthis.pendingStorageData,\n\t\t\t(entry) => entry.type === \"clear\" || entry.key === key,\n\t\t);\n\n\t\treturn latestPendingEntry === undefined\n\t\t\t? this.sequencedStorageData.has(key)\n\t\t\t: latestPendingEntry.type === \"lifetime\";\n\t};\n\n\t/**\n\t * Get the optimistic local subdirectory. This combines the sequenced data with\n\t * any pending changes that have not yet been sequenced. By default, we do not\n\t * consider disposed directories as optimistically existing, but if `getIfDisposed`\n\t * is true, we will include them since some scenarios require this.\n\t */\n\tprivate readonly getOptimisticSubDirectory = (\n\t\tsubdirName: string,\n\t\tgetIfDisposed: boolean = false,\n\t): SubDirectory | undefined => {\n\t\tconst latestPendingEntry = findLast(\n\t\t\tthis.pendingSubDirectoryData,\n\t\t\t(entry) => entry.subdirName === subdirName,\n\t\t);\n\t\tlet subdir: SubDirectory | undefined;\n\t\tif (latestPendingEntry === undefined) {\n\t\t\tsubdir = this._sequencedSubdirectories.get(subdirName);\n\t\t} else if (latestPendingEntry.type === \"createSubDirectory\") {\n\t\t\tsubdir = latestPendingEntry.subdir;\n\t\t\tassert(subdir !== undefined, 0xc2f /* Subdirectory should exist in pending data */);\n\t\t} else {\n\t\t\t// Pending delete\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// If the subdirectory is disposed, treat it as non-existent for optimistic reads (unless specified otherwise)\n\t\tif (subdir?.disposed && !getIfDisposed) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn subdir;\n\t};\n\n\tpublic get sequencedSubdirectories(): ReadonlyMap<string, SubDirectory> {\n\t\tthis.throwIfDisposed();\n\t\treturn this._sequencedSubdirectories;\n\t}\n\n\t/**\n\t * Process a clear operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tpublic processClearMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryClearOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: ClearLocalOpMetadata | undefined,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.subdir)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (local) {\n\t\t\tthis.sequencedStorageData.clear();\n\t\t\tconst pendingClear = this.pendingStorageData.shift();\n\t\t\tassert(\n\t\t\t\tpendingClear !== undefined &&\n\t\t\t\t\tpendingClear.type === \"clear\" &&\n\t\t\t\t\tpendingClear === localOpMetadata,\n\t\t\t\t0xc04 /* Got a local clear message we weren't expecting */,\n\t\t\t);\n\t\t} else {\n\t\t\t// For pending set operations, collect the previous values before clearing sequenced data\n\t\t\tconst pendingSets: { key: string; previousValue: unknown }[] = [];\n\t\t\tfor (const entry of this.pendingStorageData) {\n\t\t\t\tif (entry.type === \"lifetime\") {\n\t\t\t\t\tconst previousValue = this.sequencedStorageData.get(entry.key);\n\t\t\t\t\tpendingSets.push({ key: entry.key, previousValue });\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.sequencedStorageData.clear();\n\n\t\t\t// Only emit for remote ops, we would have already emitted for local ops. Only emit if there\n\t\t\t// is no optimistically-applied local pending clear that would supersede this remote clear.\n\t\t\tif (!this.pendingStorageData.some((entry) => entry.type === \"clear\")) {\n\t\t\t\tthis.directory.emit(\"clear\", local, this.directory);\n\t\t\t\tthis.directory.emit(\"clearInternal\", this.absolutePath, local, this.directory);\n\t\t\t}\n\n\t\t\t// For pending set operations, emit valueChanged events\n\t\t\t// Include 'path' so listeners can identify which subdirectory the change occurred in\n\t\t\tfor (const { key, previousValue } of pendingSets) {\n\t\t\t\tthis.directory.emit(\n\t\t\t\t\t\"valueChanged\",\n\t\t\t\t\t{\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\t\tpreviousValue,\n\t\t\t\t\t},\n\t\t\t\t\tlocal,\n\t\t\t\t\tthis.directory,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process a delete operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tpublic processDeleteMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryDeleteOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: EditLocalOpMetadata | undefined,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.subdir)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tif (local) {\n\t\t\tconst pendingEntryIndex = this.pendingStorageData.findIndex(\n\t\t\t\t(entry) => entry.type !== \"clear\" && entry.key === op.key,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined &&\n\t\t\t\t\tpendingEntry.type === \"delete\" &&\n\t\t\t\t\tpendingEntry.key === op.key,\n\t\t\t\t0xc05 /* Got a local delete message we weren't expecting */,\n\t\t\t);\n\t\t\tthis.pendingStorageData.splice(pendingEntryIndex, 1);\n\t\t\tthis.sequencedStorageData.delete(op.key);\n\t\t} else {\n\t\t\tconst previousValue: unknown = this.sequencedStorageData.get(op.key);\n\t\t\tthis.sequencedStorageData.delete(op.key);\n\t\t\t// Suppress the event if local changes would cause the incoming change to be invisible optimistically.\n\t\t\tif (\n\t\t\t\t!this.pendingStorageData.some(\n\t\t\t\t\t(entry) => entry.type === \"clear\" || entry.key === op.key,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\tkey: op.key,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\tpreviousValue,\n\t\t\t\t};\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, local, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = { key: op.key, previousValue };\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, local, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process a set operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tpublic processSetMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectorySetOperation,\n\t\tvalue: unknown,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: EditLocalOpMetadata | undefined,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.subdir)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { key } = op;\n\n\t\tif (local) {\n\t\t\tconst pendingEntryIndex = this.pendingStorageData.findIndex(\n\t\t\t\t(entry) => entry.type !== \"clear\" && entry.key === key,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined && pendingEntry.type === \"lifetime\",\n\t\t\t\t0xc06 /* Couldn't match local set message to pending lifetime */,\n\t\t\t);\n\t\t\tconst pendingKeySet = pendingEntry.keySets.shift();\n\t\t\tassert(\n\t\t\t\tpendingKeySet !== undefined && pendingKeySet === localOpMetadata,\n\t\t\t\t0xc07 /* Got a local set message we weren't expecting */,\n\t\t\t);\n\t\t\tif (pendingEntry.keySets.length === 0) {\n\t\t\t\tthis.pendingStorageData.splice(pendingEntryIndex, 1);\n\t\t\t}\n\t\t\tthis.sequencedStorageData.set(key, pendingKeySet.value);\n\t\t} else {\n\t\t\t// Get the previous value before setting the new value\n\t\t\tconst previousValue: unknown = this.sequencedStorageData.get(key);\n\t\t\tthis.sequencedStorageData.set(key, value);\n\n\t\t\t// Suppress the event if local changes would cause the incoming change to be invisible optimistically.\n\t\t\tif (\n\t\t\t\t!this.pendingStorageData.some((entry) => entry.type === \"clear\" || entry.key === key)\n\t\t\t) {\n\t\t\t\tconst event: IDirectoryValueChanged = { key, path: this.absolutePath, previousValue };\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, local, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = { key, previousValue };\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, local, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process a create subdirectory operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t * @param clientSequenceNumber - The client sequence number of the message.\n\t */\n\tpublic processCreateSubDirectoryMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryCreateSubDirectoryOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: SubDirLocalOpMetadata | undefined,\n\t\tclientSequenceNumber: number,\n\t): void {\n\t\tthis.throwIfDisposed();\n\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(\n\t\t\t\tmsgEnvelope,\n\t\t\t\tlocalOpMetadata?.parentSubdir,\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tassertNonNullClientId(msgEnvelope.clientId);\n\n\t\tlet subDir: SubDirectory | undefined;\n\t\tif (local) {\n\t\t\tconst pendingEntryIndex = this.pendingSubDirectoryData.findIndex(\n\t\t\t\t(entry) => entry.subdirName === op.subdirName,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined && pendingEntry.type === \"createSubDirectory\",\n\t\t\t\t0xc30 /* Got a local subdir create message we weren't expecting */,\n\t\t\t);\n\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\t\t\tsubDir = pendingEntry.subdir;\n\n\t\t\tconst existingSubdir = this._sequencedSubdirectories.get(op.subdirName);\n\t\t\tif (existingSubdir !== undefined) {\n\t\t\t\t// If the subdirectory already exists, we don't need to create it again.\n\t\t\t\t// This can happen if remote clients also create the same subdir and we processed\n\t\t\t\t// that message first.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (subDir.disposed) {\n\t\t\t\tthis.undisposeSubdirectoryTree(subDir);\n\t\t\t}\n\n\t\t\tthis._sequencedSubdirectories.set(op.subdirName, subDir);\n\t\t} else {\n\t\t\tsubDir = this.getOptimisticSubDirectory(op.subdirName, true);\n\t\t\tif (subDir === undefined) {\n\t\t\t\tconst absolutePath = posix.join(this.absolutePath, op.subdirName);\n\t\t\t\tsubDir = new SubDirectory(\n\t\t\t\t\t{ seq: msgEnvelope.sequenceNumber, clientSeq: clientSequenceNumber },\n\t\t\t\t\tnew Set([msgEnvelope.clientId]),\n\t\t\t\t\tthis.directory,\n\t\t\t\t\tthis.runtime,\n\t\t\t\t\tthis.serializer,\n\t\t\t\t\tabsolutePath,\n\t\t\t\t\tthis.mc.logger,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// If the subdirectory already optimistically exists, we don't need to create it again.\n\t\t\t\t// This can happen if remote clients also created the same subdir.\n\t\t\t\tif (subDir.disposed) {\n\t\t\t\t\tthis.undisposeSubdirectoryTree(subDir);\n\t\t\t\t}\n\t\t\t\tsubDir.clientIds.add(msgEnvelope.clientId);\n\t\t\t}\n\t\t\tthis.registerEventsOnSubDirectory(subDir, op.subdirName);\n\t\t\tthis._sequencedSubdirectories.set(op.subdirName, subDir);\n\n\t\t\t// Suppress the event if local changes would cause the incoming change to be invisible optimistically.\n\t\t\tif (!this.pendingSubDirectoryData.some((entry) => entry.subdirName === op.subdirName)) {\n\t\t\t\tthis.emit(\"subDirectoryCreated\", op.subdirName, local, this);\n\t\t\t}\n\t\t}\n\n\t\t// Ensure correct seqData. This can be necessary if in scenarios where a subdir was created, deleted, and\n\t\t// then later recreated.\n\t\tif (\n\t\t\tthis.seqData.seq !== -1 &&\n\t\t\tthis.seqData.seq <= msgEnvelope.sequenceNumber &&\n\t\t\tsubDir.seqData.seq === -1\n\t\t) {\n\t\t\tsubDir.seqData.seq = msgEnvelope.sequenceNumber;\n\t\t\tsubDir.seqData.clientSeq = clientSequenceNumber;\n\t\t}\n\t}\n\n\t/**\n\t * Process a delete subdirectory operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tpublic processDeleteSubDirectoryMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryDeleteSubDirectoryOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: SubDirLocalOpMetadata | undefined,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(\n\t\t\t\tmsgEnvelope,\n\t\t\t\tlocalOpMetadata?.parentSubdir,\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousValue = this._sequencedSubdirectories.get(op.subdirName);\n\t\tif (previousValue === undefined) {\n\t\t\t// We are trying to delete a subdirectory that does not exist.\n\t\t\t// If this is a local delete, we should remove the pending delete entry.\n\t\t\t// This could happen if we already processed a remote delete op for\n\t\t\t// the same subdirectory.\n\t\t\tif (local) {\n\t\t\t\tconst pendingEntryIndex = this.pendingSubDirectoryData.findIndex(\n\t\t\t\t\t(entry) => entry.subdirName === op.subdirName,\n\t\t\t\t);\n\t\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\t\tassert(\n\t\t\t\t\tpendingEntry !== undefined &&\n\t\t\t\t\t\tpendingEntry.type === \"deleteSubDirectory\" &&\n\t\t\t\t\t\tpendingEntry.subdirName === op.subdirName,\n\t\t\t\t\t0xc31 /* Got a local deleteSubDirectory message we weren't expecting */,\n\t\t\t\t);\n\t\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tthis._sequencedSubdirectories.delete(op.subdirName);\n\t\tthis.disposeSubDirectoryTree(previousValue);\n\n\t\tif (local) {\n\t\t\tconst pendingEntryIndex = this.pendingSubDirectoryData.findIndex(\n\t\t\t\t(entry) => entry.subdirName === op.subdirName,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined &&\n\t\t\t\t\tpendingEntry.type === \"deleteSubDirectory\" &&\n\t\t\t\t\tpendingEntry.subdirName === op.subdirName,\n\t\t\t\t0xc32 /* Got a local deleteSubDirectory message we weren't expecting */,\n\t\t\t);\n\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\t\t} else {\n\t\t\t// Suppress the event if local changes would cause the incoming change to be invisible optimistically.\n\t\t\tconst pendingEntryIndex = this.pendingSubDirectoryData.findIndex(\n\t\t\t\t(entry) => entry.subdirName === op.subdirName && entry.type === \"deleteSubDirectory\",\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tif (pendingEntry === undefined) {\n\t\t\t\tthis.emit(\"subDirectoryDeleted\", op.subdirName, local, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Submit a clear operation.\n\t * @param op - The operation\n\t * @param localOpMetadata - The pending operation metadata\n\t */\n\tprivate submitClearMessage(\n\t\top: IDirectoryClearOperation,\n\t\tlocalOpMetadata: ClearLocalOpMetadata,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tthis.directory.submitDirectoryMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * Resubmit a clear operation.\n\t * @param op - The operation\n\t */\n\tpublic resubmitClearMessage(\n\t\top: IDirectoryClearOperation,\n\t\tlocalOpMetadata: ClearLocalOpMetadata,\n\t): void {\n\t\t// Only submit the op, if we have record for it, otherwise it is possible that the older instance\n\t\t// is already deleted, in which case we don't need to submit the op.\n\t\tconst pendingEntryIndex = this.pendingStorageData.findIndex(\n\t\t\t(entry) => entry.type === \"clear\",\n\t\t);\n\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\tif (pendingEntry !== undefined) {\n\t\t\tthis.submitClearMessage(op, localOpMetadata);\n\t\t}\n\t}\n\n\t/**\n\t * Submit a key operation.\n\t * @param op - The operation\n\t * @param localOpMetadata - The pending operation metadata\n\t */\n\tprivate submitKeyMessage(\n\t\top: IDirectoryKeyOperation,\n\t\tlocalOpMetadata: PendingKeySet | PendingKeyDelete,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tthis.directory.submitDirectoryMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * Submit a key message to remote clients based on a previous submit.\n\t * @param op - The map key message\n\t * @param localOpMetadata - Metadata from the previous submit\n\t */\n\tpublic resubmitKeyMessage(\n\t\top: IDirectoryKeyOperation,\n\t\tlocalOpMetadata: EditLocalOpMetadata,\n\t): void {\n\t\t// Only submit the op, if we have record for it, otherwise it is possible that the older instance\n\t\t// is already deleted, in which case we don't need to submit the op.\n\t\tconst pendingEntryIndex = this.pendingStorageData.findIndex((entry) => {\n\t\t\treturn op.type === \"set\"\n\t\t\t\t? entry.type === \"lifetime\" &&\n\t\t\t\t\t\tentry.key === op.key &&\n\t\t\t\t\t\t// We also check that the keySets include the localOpMetadata. It's possible we have new\n\t\t\t\t\t\t// pending key sets that are not the op we are looking for.\n\t\t\t\t\t\tentry.keySets.includes(localOpMetadata as PendingKeySet)\n\t\t\t\t: entry.type === \"delete\" && entry.key === op.key;\n\t\t});\n\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\tif (pendingEntry !== undefined) {\n\t\t\tthis.submitKeyMessage(op, localOpMetadata as PendingKeySet | PendingKeyDelete);\n\t\t}\n\t}\n\t/**\n\t * Submit a create subdirectory operation.\n\t * @param op - The operation\n\t */\n\tprivate submitCreateSubDirectoryMessage(op: IDirectorySubDirectoryOperation): void {\n\t\tconst localOpMetadata: ICreateSubDirLocalOpMetadata = {\n\t\t\ttype: \"createSubDir\",\n\t\t\tparentSubdir: this,\n\t\t};\n\t\tthis.directory.submitDirectoryMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * Submit a delete subdirectory operation.\n\t * @param op - The operation\n\t * @param subDir - Any subdirectory deleted by the op\n\t */\n\tprivate submitDeleteSubDirectoryMessage(\n\t\top: IDirectorySubDirectoryOperation,\n\t\tsubDir: SubDirectory,\n\t): void {\n\t\tconst localOpMetadata: IDeleteSubDirLocalOpMetadata = {\n\t\t\ttype: \"deleteSubDir\",\n\t\t\tsubDirectory: subDir,\n\t\t\tparentSubdir: this,\n\t\t};\n\t\tthis.directory.submitDirectoryMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * Submit a subdirectory operation again\n\t * @param op - The operation\n\t * @param localOpMetadata - metadata submitted with the op originally\n\t */\n\tpublic resubmitSubDirectoryMessage(\n\t\top: IDirectorySubDirectoryOperation,\n\t\tlocalOpMetadata: SubDirLocalOpMetadata,\n\t): void {\n\t\t// Only submit the op, if we have record for it, otherwise it is possible that the older instance\n\t\t// is already deleted, in which case we don't need to submit the op.\n\t\tif (localOpMetadata.type === \"createSubDir\") {\n\t\t\t// For create operations, look specifically for createSubDirectory entries\n\t\t\tconst pendingEntry = findLast(\n\t\t\t\tthis.pendingSubDirectoryData,\n\t\t\t\t(entry) => entry.subdirName === op.subdirName && entry.type === \"createSubDirectory\",\n\t\t\t);\n\t\t\tif (pendingEntry !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tpendingEntry.type === \"createSubDirectory\",\n\t\t\t\t\t0xc33 /* pending entry should be createSubDirectory */,\n\t\t\t\t);\n\t\t\t\t// We should add the client id, since when reconnecting it can have a different client id.\n\t\t\t\tpendingEntry.subdir.clientIds.add(this.runtime.clientId ?? \"detached\");\n\t\t\t\t// We also need to undelete the subdirectory tree if it was previously deleted\n\t\t\t\tthis.undisposeSubdirectoryTree(pendingEntry.subdir);\n\t\t\t\tthis.submitCreateSubDirectoryMessage(op);\n\t\t\t}\n\t\t} else if (localOpMetadata.type === \"deleteSubDir\") {\n\t\t\tassert(\n\t\t\t\tlocalOpMetadata.subDirectory !== undefined,\n\t\t\t\t0xc34 /* Subdirectory should exist */,\n\t\t\t);\n\t\t\t// For delete operations, look specifically for deleteSubDirectory entries\n\t\t\tconst pendingEntry = findLast(\n\t\t\t\tthis.pendingSubDirectoryData,\n\t\t\t\t(entry) => entry.subdirName === op.subdirName && entry.type === \"deleteSubDirectory\",\n\t\t\t);\n\t\t\tif (pendingEntry !== undefined) {\n\t\t\t\tthis.submitDeleteSubDirectoryMessage(op, localOpMetadata.subDirectory);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get the storage of this subdirectory in a serializable format, to be used in snapshotting.\n\t * @param serializer - The serializer to use to serialize handles in its values.\n\t * @returns The JSONable string representing the storage of this subdirectory\n\t */\n\tpublic *getSerializedStorage(\n\t\tserializer: IFluidSerializer,\n\t): Generator<[string, ISerializedValue], void> {\n\t\tthis.throwIfDisposed();\n\t\tfor (const [key, value] of this.sequencedStorageData.entries()) {\n\t\t\tconst serializedValue = serializeValue(value, serializer, this.directory.handle);\n\t\t\tconst res: [string, ISerializedValue] = [key, serializedValue];\n\t\t\tyield res;\n\t\t}\n\t}\n\n\tpublic getSerializableCreateInfo(): ICreateInfo {\n\t\tthis.throwIfDisposed();\n\t\tconst createInfo: ICreateInfo = {\n\t\t\tcsn: this.seqData.seq,\n\t\t\tccIds: [...this.clientIds],\n\t\t};\n\t\treturn createInfo;\n\t}\n\n\t/**\n\t * Populate a key value in this subdirectory's storage, to be used when loading from snapshot.\n\t * @param key - The key to populate\n\t * @param localValue - The local value to populate into it\n\t */\n\tpublic populateStorage(key: string, value: unknown): void {\n\t\tthis.throwIfDisposed();\n\t\tthis.sequencedStorageData.set(key, value);\n\t}\n\n\t/**\n\t * Populate a subdirectory into this subdirectory, to be used when loading from snapshot.\n\t * @param subdirName - The name of the subdirectory to add\n\t * @param newSubDir - The new subdirectory to add\n\t */\n\tpublic populateSubDirectory(subdirName: string, newSubDir: SubDirectory): void {\n\t\tthis.throwIfDisposed();\n\t\tthis.registerEventsOnSubDirectory(newSubDir, subdirName);\n\t\tthis._sequencedSubdirectories.set(subdirName, newSubDir);\n\t}\n\n\t/**\n\t * Rollback a local op\n\t * @param op - The operation to rollback\n\t * @param localOpMetadata - The local metadata associated with the op.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic rollback(op: any, localOpMetadata: DirectoryLocalOpMetadata): void {\n\t\tconst directoryOp = op as IDirectoryOperation;\n\n\t\tif (directoryOp.type === \"clear\") {\n\t\t\t// A pending clear will be last in the list, since it terminates all prior lifetimes.\n\t\t\tconst pendingClear = this.pendingStorageData.pop();\n\t\t\tif (pendingClear === undefined) {\n\t\t\t\t// If we can't find a pending entry then it's possible that we deleted an ack'd subdir\n\t\t\t\t// from a remote delete subdir op. If that's the case then there is nothing to rollback\n\t\t\t\t// since the pending data was removed with the subdirectory deletion.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tassert(\n\t\t\t\tpendingClear.type === \"clear\" && localOpMetadata.type === \"clear\",\n\t\t\t\t0xc35 /* Unexpected clear rollback */,\n\t\t\t);\n\t\t\tfor (const [key] of this.internalIterator()) {\n\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\tkey,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\tpreviousValue: undefined,\n\t\t\t\t};\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = { key, previousValue: undefined };\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\t}\n\t\t} else if (\n\t\t\t(directoryOp.type === \"delete\" || directoryOp.type === \"set\") &&\n\t\t\t(localOpMetadata.type === \"set\" || localOpMetadata.type === \"delete\")\n\t\t) {\n\t\t\t// A pending set/delete may not be last in the list, as the lifetimes' order is based on when\n\t\t\t// they were created, not when they were last modified.\n\t\t\tconst pendingEntryIndex = findLastIndex(\n\t\t\t\tthis.pendingStorageData,\n\t\t\t\t(entry) => entry.type !== \"clear\" && entry.key === directoryOp.key,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\t\tif (pendingEntry === undefined) {\n\t\t\t\t// If we can't find a pending entry then it's possible that we deleted an ack'd subdir\n\t\t\t\t// from a remote delete subdir op. If that's the case then there is nothing to rollback\n\t\t\t\t// since the pending data was removed with the subdirectory deletion.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tassert(\n\t\t\t\tpendingEntry.type === \"delete\" || pendingEntry.type === \"lifetime\",\n\t\t\t\t0xc36 /* Unexpected pending data for set/delete op */,\n\t\t\t);\n\t\t\tif (pendingEntry.type === \"delete\") {\n\t\t\t\tassert(pendingEntry === localOpMetadata, 0xc0b /* Unexpected delete rollback */);\n\t\t\t\tthis.pendingStorageData.splice(pendingEntryIndex, 1);\n\t\t\t\t// Only emit if rolling back the delete actually results in a value becoming visible.\n\t\t\t\tif (this.getOptimisticValue(directoryOp.key) !== undefined) {\n\t\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\t\tkey: directoryOp.key,\n\t\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\t\tpreviousValue: undefined,\n\t\t\t\t\t};\n\t\t\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\t\t\tkey: directoryOp.key,\n\t\t\t\t\t\tpreviousValue: undefined,\n\t\t\t\t\t};\n\t\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\t\t}\n\t\t\t} else if (pendingEntry.type === \"lifetime\") {\n\t\t\t\tconst pendingKeySet = pendingEntry.keySets.pop();\n\t\t\t\tassert(\n\t\t\t\t\tpendingKeySet !== undefined && pendingKeySet === localOpMetadata,\n\t\t\t\t\t0xc0c /* Unexpected set rollback */,\n\t\t\t\t);\n\t\t\t\tif (pendingEntry.keySets.length === 0) {\n\t\t\t\t\tthis.pendingStorageData.splice(pendingEntryIndex, 1);\n\t\t\t\t}\n\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\tkey: directoryOp.key,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\tpreviousValue: pendingKeySet.value,\n\t\t\t\t};\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\t\tkey: directoryOp.key,\n\t\t\t\t\tpreviousValue: pendingKeySet.value,\n\t\t\t\t};\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\t}\n\t\t} else if (\n\t\t\tdirectoryOp.type === \"createSubDirectory\" &&\n\t\t\tlocalOpMetadata.type === \"createSubDir\"\n\t\t) {\n\t\t\tconst subdirName = directoryOp.subdirName;\n\n\t\t\tconst pendingEntryIndex = findLastIndex(\n\t\t\t\tthis.pendingSubDirectoryData,\n\t\t\t\t(entry) => entry.type === \"createSubDirectory\" && entry.subdirName === subdirName,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tif (pendingEntry === undefined) {\n\t\t\t\t// If we can't find a pending entry then it's likely we deleted and re-created this\n\t\t\t\t// subdirectory from a remote delete subdir op. If that's the case then there is\n\t\t\t\t// nothing to rollback since the pending data was removed with the subdirectory deletion.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tassert(\n\t\t\t\tpendingEntry.type === \"createSubDirectory\",\n\t\t\t\t0xc71 /* Unexpected pending data for createSubDirectory op */,\n\t\t\t);\n\n\t\t\t// We still need to emit the disposed event for any locally created (and now\n\t\t\t// rolled back) subdirectory trees so listeners can observer the lifecycle\n\t\t\t// changes properly. We don't want to fully delete in case there is another\n\t\t\t// operation that references the same subdirectory.\n\t\t\tthis.emitDisposeForSubdirTree(pendingEntry.subdir);\n\n\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\t\t\tthis.emit(\"subDirectoryDeleted\", subdirName, true, this);\n\t\t} else if (\n\t\t\tdirectoryOp.type === \"deleteSubDirectory\" &&\n\t\t\tlocalOpMetadata.type === \"deleteSubDir\"\n\t\t) {\n\t\t\tconst subdirName = directoryOp.subdirName;\n\n\t\t\tconst pendingEntryIndex = findLastIndex(\n\t\t\t\tthis.pendingSubDirectoryData,\n\t\t\t\t(entry) => entry.type === \"deleteSubDirectory\" && entry.subdirName === subdirName,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tif (pendingEntry === undefined) {\n\t\t\t\t// If we can't find a pending entry then it's likely we deleted and re-created this\n\t\t\t\t// subdirectory from a remote delete subdir op. If that's the case then there is\n\t\t\t\t// nothing to rollback since the pending data was removed with the subdirectory deletion.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tassert(\n\t\t\t\tpendingEntry.type === \"deleteSubDirectory\",\n\t\t\t\t0xc72 /* Unexpected pending data for deleteSubDirectory op */,\n\t\t\t);\n\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\n\t\t\t// Restore the subdirectory\n\t\t\tconst subDirectoryToRestore = localOpMetadata.subDirectory;\n\t\t\tassert(subDirectoryToRestore !== undefined, 0xc39 /* Subdirectory should exist */);\n\t\t\t// Recursively undispose all nested subdirectories before adding to the map\n\t\t\t// This ensures the subdirectory is properly restored before being exposed\n\t\t\tthis.undisposeSubdirectoryTree(subDirectoryToRestore);\n\t\t\t// Re-register events\n\t\t\tthis.registerEventsOnSubDirectory(subDirectoryToRestore, subdirName);\n\t\t\tthis.emit(\"subDirectoryCreated\", subdirName, true, this);\n\t\t} else {\n\t\t\tthrow new Error(\"Unsupported op for rollback\");\n\t\t}\n\t}\n\n\t/**\n\t * Converts the given relative path into an absolute path.\n\t * @param path - Relative path to convert\n\t * @returns The equivalent absolute path\n\t */\n\tprivate makeAbsolute(relativePath: string): string {\n\t\treturn posix.resolve(this.absolutePath, relativePath);\n\t}\n\n\t/**\n\t * This return true if the message is for the current instance of this sub directory. As the sub directory\n\t * can be deleted and created again, then this finds if the message is for current instance of directory or not.\n\t * @param msgEnvelope - message envelope for the directory\n\t * @param targetSubdir - subdirectory instance we are targeting from local op metadata (if a local op)\n\t */\n\tprivate isMessageForCurrentInstanceOfSubDirectory(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\ttargetSubdir?: SubDirectory | undefined,\n\t): boolean {\n\t\t// The message must be from this instance of the directory (if a local op) AND one of the following must be true:\n\t\t// 1. The message was from the creator of this directory\n\t\t// 2. This directory was created while detached\n\t\t// 3. This directory was already live (known to other clients) and the op was created after the directory was created.\n\t\treturn (\n\t\t\t(targetSubdir === undefined || targetSubdir === this) &&\n\t\t\t((msgEnvelope.clientId !== null && this.clientIds.has(msgEnvelope.clientId)) ||\n\t\t\t\tthis.clientIds.has(\"detached\") ||\n\t\t\t\t(this.seqData.seq !== -1 && this.seqData.seq <= msgEnvelope.referenceSequenceNumber))\n\t\t);\n\t}\n\n\tprivate registerEventsOnSubDirectory(subDirectory: SubDirectory, subDirName: string): void {\n\t\tsubDirectory.on(\"subDirectoryCreated\", (relativePath: string, local: boolean) => {\n\t\t\tthis.emit(\"subDirectoryCreated\", posix.join(subDirName, relativePath), local, this);\n\t\t});\n\t\tsubDirectory.on(\"subDirectoryDeleted\", (relativePath: string, local: boolean) => {\n\t\t\tthis.emit(\"subDirectoryDeleted\", posix.join(subDirName, relativePath), local, this);\n\t\t});\n\t}\n\n\tprivate disposeSubDirectoryTree(directory: SubDirectory | undefined): void {\n\t\tif (directory === undefined) {\n\t\t\treturn;\n\t\t}\n\t\t// Dispose the subdirectory tree. This will dispose the subdirectories from bottom to top.\n\t\tconst subDirectories = directory.subdirectories();\n\t\tfor (const [_, subDirectory] of subDirectories) {\n\t\t\tthis.disposeSubDirectoryTree(subDirectory as SubDirectory);\n\t\t}\n\n\t\t// We need to reset the sequenced data as the previous directory is getting deleted and we will\n\t\t// initialize again when we will receive op for the create again.\n\t\tdirectory.clearSubDirectorySequencedData();\n\n\t\tdirectory.dispose();\n\t}\n\n\tprivate emitDisposeForSubdirTree(directory: SubDirectory): void {\n\t\tif (directory === undefined || directory.disposed) {\n\t\t\treturn;\n\t\t}\n\t\t// Dispose the subdirectory tree. This will dispose the subdirectories from bottom to top.\n\t\tconst subDirectories = directory.subdirectories();\n\t\tfor (const [_, subDirectory] of subDirectories) {\n\t\t\tthis.emitDisposeForSubdirTree(subDirectory as SubDirectory);\n\t\t}\n\n\t\tif (typeof directory.dispose === \"function\") {\n\t\t\tdirectory.emit(\"disposed\", directory);\n\t\t}\n\t}\n\n\tprivate undisposeSubdirectoryTree(directory: SubDirectory): void {\n\t\t// This will unmark \"deleted\" from the subdirectories from bottom to top.\n\t\tfor (const [_, subDirectory] of directory.getSubdirectoriesEvenIfDisposed()) {\n\t\t\tthis.undisposeSubdirectoryTree(subDirectory as SubDirectory);\n\t\t}\n\t\tdirectory.undispose();\n\t}\n\n\t/**\n\t * Similar to {@link subdirectories}, but also includes subdirectories that are disposed.\n\t */\n\tprivate getSubdirectoriesEvenIfDisposed(): IterableIterator<[string, IDirectory]> {\n\t\tconst sequencedSubdirs: [string, SubDirectory][] = [];\n\t\tconst sequencedSubdirNames = new Set([...this._sequencedSubdirectories.keys()]);\n\t\tfor (const subdirName of sequencedSubdirNames) {\n\t\t\tconst optimisticSubdir = this.getOptimisticSubDirectory(subdirName, true);\n\t\t\tif (optimisticSubdir !== undefined) {\n\t\t\t\tsequencedSubdirs.push([subdirName, optimisticSubdir]);\n\t\t\t}\n\t\t}\n\n\t\tconst pendingSubdirNames = [\n\t\t\t...new Set(\n\t\t\t\tthis.pendingSubDirectoryData\n\t\t\t\t\t.map((entry) => entry.subdirName)\n\t\t\t\t\t.filter((subdirName) => !sequencedSubdirNames.has(subdirName)),\n\t\t\t),\n\t\t];\n\t\tconst pendingSubdirs: [string, SubDirectory][] = [];\n\t\tfor (const subdirName of pendingSubdirNames) {\n\t\t\tconst optimisticSubdir = this.getOptimisticSubDirectory(subdirName, true);\n\t\t\tif (optimisticSubdir !== undefined) {\n\t\t\t\tpendingSubdirs.push([subdirName, optimisticSubdir]);\n\t\t\t}\n\t\t}\n\n\t\tconst allSubdirs = [...sequencedSubdirs, ...pendingSubdirs];\n\n\t\tconst orderedSubdirs = allSubdirs.sort((a, b) => {\n\t\t\tconst aSeqData = a[1].seqData;\n\t\t\tconst bSeqData = b[1].seqData;\n\t\t\tassert(\n\t\t\t\taSeqData !== undefined && bSeqData !== undefined,\n\t\t\t\t0xc3a /* seqData should be defined */,\n\t\t\t);\n\t\t\treturn seqDataComparator(aSeqData, bSeqData);\n\t\t});\n\n\t\treturn orderedSubdirs[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Clears the sequenced data of a subdirectory but notably retains the pending\n\t * storage data. This is done when disposing of a directory so if we need to\n\t * re-create it, then we still have the pending ops.\n\t */\n\tpublic clearSubDirectorySequencedData(): void {\n\t\tthis.seqData.seq = -1;\n\t\tthis.seqData.clientSeq = -1;\n\t\tthis.sequencedStorageData.clear();\n\t\tthis._sequencedSubdirectories.clear();\n\t\tthis.clientIds.clear();\n\t\tthis.clientIds.add(this.runtime.clientId ?? \"detached\");\n\t}\n}\n"]}
1
+ {"version":3,"file":"directory.js","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAM9E,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAQrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EACX,YAAY,GACZ,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACN,4BAA4B,EAG5B,UAAU,GACV,MAAM,0CAA0C,CAAC;AAClD,OAAO,IAAI,MAAM,iBAAiB,CAAC;AAenC,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErD,sFAAsF;AACtF,oDAAoD;AACpD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;AAEzB,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AA2RlC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,iBAAiB,GAAG,CAAC,CAAe,EAAE,CAAe,EA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AE,CAAC,EAAE,EAAE;YAC/C,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC9B,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC9B,MAAM,CACL,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAChD,KAAK,CAAC,+BAA+B,CACrC,CAAC;YACF,OAAO,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,OAAO,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACI,8BAA8B;QACpC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,UAAU,CAAC,CAAC;IACzD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport { MessageType } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport type {\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tIRuntimeMessageCollection,\n\tIRuntimeMessagesContent,\n\tISequencedMessageEnvelope,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\nimport type { IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tSharedObject,\n\tValueType,\n\tbindHandles,\n\tparseHandles,\n} from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tcreateChildMonitoringContext,\n\ttype ITelemetryLoggerExt,\n\ttype MonitoringContext,\n\tUsageError,\n} from \"@fluidframework/telemetry-utils/internal\";\nimport path from \"path-browserify\";\n\nimport type {\n\tIDirectory,\n\tIDirectoryEvents,\n\tIDirectoryValueChanged,\n\tISharedDirectory,\n\tISharedDirectoryEventsInternal,\n\tIValueChanged,\n} from \"./interfaces.js\";\nimport type {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tISerializableValue,\n\tISerializedValue,\n} from \"./internalInterfaces.js\";\nimport { serializeValue, migrateIfSharedSerializable } from \"./localValues.js\";\nimport { findLast, findLastIndex } from \"./utils.js\";\n\n// We use path-browserify since this code can run safely on the server or the browser.\n// We standardize on using posix slashes everywhere.\nconst posix = path.posix;\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the means to process and submit a given op on a directory.\n */\ninterface IDirectoryMessageHandler {\n\t/**\n\t * Apply the given operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The directory operation to apply\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t * @param clientSequenceNumber - The client sequence number of the message.\n\t */\n\tprocess(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: DirectoryLocalOpMetadata | undefined,\n\t\tclientSequenceNumber: number,\n\t): void;\n\n\t/**\n\t * Resubmit a previously submitted operation that was not delivered.\n\t * @param op - The directory operation to resubmit\n\t * @param localOpMetadata - The metadata that was originally submitted with the message.\n\t */\n\tresubmit(op: IDirectoryOperation, localOpMetadata: DirectoryLocalOpMetadata): void;\n}\n\n/**\n * Operation indicating a value should be set for a key.\n */\nexport interface IDirectorySetOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"set\";\n\n\t/**\n\t * Directory key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Absolute path of the directory where the modified key is located.\n\t */\n\tpath: string;\n\n\t/**\n\t * Value to be set on the key.\n\t */\n\t// eslint-disable-next-line import-x/no-deprecated\n\tvalue: ISerializableValue;\n}\n\n/**\n * Operation indicating a key should be deleted from the directory.\n */\nexport interface IDirectoryDeleteOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"delete\";\n\n\t/**\n\t * Directory key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Absolute path of the directory where the modified key is located.\n\t */\n\tpath: string;\n}\n\n/**\n * An operation on a specific key within a directory.\n */\nexport type IDirectoryKeyOperation = IDirectorySetOperation | IDirectoryDeleteOperation;\n\n/**\n * Operation indicating the directory should be cleared.\n */\nexport interface IDirectoryClearOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"clear\";\n\n\t/**\n\t * Absolute path of the directory being cleared.\n\t */\n\tpath: string;\n}\n\n/**\n * An operation on one or more of the keys within a directory.\n */\nexport type IDirectoryStorageOperation = IDirectoryKeyOperation | IDirectoryClearOperation;\n\n/**\n * Operation indicating a subdirectory should be created.\n */\nexport interface IDirectoryCreateSubDirectoryOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"createSubDirectory\";\n\n\t/**\n\t * Absolute path of the directory that will contain the new subdirectory.\n\t */\n\tpath: string;\n\n\t/**\n\t * Name of the new subdirectory.\n\t */\n\tsubdirName: string;\n}\n\n/**\n * Operation indicating a subdirectory should be deleted.\n */\nexport interface IDirectoryDeleteSubDirectoryOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"deleteSubDirectory\";\n\n\t/**\n\t * Absolute path of the directory that contains the directory to be deleted.\n\t */\n\tpath: string;\n\n\t/**\n\t * Name of the subdirectory to be deleted.\n\t */\n\tsubdirName: string;\n}\n\n/**\n * An operation on the subdirectories within a directory.\n */\nexport type IDirectorySubDirectoryOperation =\n\t| IDirectoryCreateSubDirectoryOperation\n\t| IDirectoryDeleteSubDirectoryOperation;\n\n/**\n * Any operation on a directory.\n */\nexport type IDirectoryOperation = IDirectoryStorageOperation | IDirectorySubDirectoryOperation;\n\ninterface PendingKeySet {\n\ttype: \"set\";\n\tpath: string;\n\tvalue: unknown;\n\tsubdir: SubDirectory;\n}\n\ninterface PendingKeyDelete {\n\ttype: \"delete\";\n\tpath: string;\n\tkey: string;\n\tsubdir: SubDirectory;\n}\n\ninterface PendingClear {\n\ttype: \"clear\";\n\tpath: string;\n\tsubdir: SubDirectory;\n}\n\n/**\n * Represents the \"lifetime\" of a series of pending set operations before the pending\n * set operations are ack'd.\n */\ninterface PendingKeyLifetime {\n\ttype: \"lifetime\";\n\tkey: string;\n\tpath: string;\n\t/**\n\t * A non-empty array of pending key sets that occurred during this lifetime. If the list\n\t * becomes empty (e.g. during processing or rollback), the lifetime no longer exists and\n\t * must be removed from the pending data.\n\t */\n\tkeySets: PendingKeySet[];\n\tsubdir: SubDirectory;\n}\n\n/**\n * A member of the pendingStorageData array, which tracks outstanding changes and can be used to\n * compute optimistic values. Local sets are aggregated into lifetimes.\n */\ntype PendingStorageEntry = PendingKeyLifetime | PendingKeyDelete | PendingClear;\n\ninterface PendingSubDirectoryCreate {\n\ttype: \"createSubDirectory\";\n\tsubdirName: string;\n\tsubdir: SubDirectory;\n}\n\ninterface PendingSubDirectoryDelete {\n\ttype: \"deleteSubDirectory\";\n\tsubdirName: string;\n\tsubdir: SubDirectory;\n}\n\ntype PendingSubDirectoryEntry = PendingSubDirectoryCreate | PendingSubDirectoryDelete;\n\n/**\n * Create info for the subdirectory.\n *\n * @deprecated This interface will no longer be exported in the future(AB#8004).\n *\n * @legacy @beta\n */\nexport interface ICreateInfo {\n\t/**\n\t * Sequence number at which this subdirectory was created.\n\t */\n\tcsn: number;\n\n\t/**\n\t * clientids of the clients which created this sub directory.\n\t */\n\tccIds: string[];\n}\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n *\n * @remarks Directly used in\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify\n * | JSON.stringify}, direct result from\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse | JSON.parse}.\n *\n * @deprecated This interface will no longer be exported in the future(AB#8004).\n *\n * @legacy @beta\n */\nexport interface IDirectoryDataObject {\n\t/**\n\t * Key/value date set by the user.\n\t */\n\t// eslint-disable-next-line import-x/no-deprecated\n\tstorage?: Record<string, ISerializableValue>;\n\n\t/**\n\t * Recursive sub-directories {@link IDirectoryDataObject | objects}.\n\t */\n\tsubdirectories?: Record<string, IDirectoryDataObject>;\n\n\t/**\n\t * Create info for the sub directory. Since directories with same name can get deleted/created by multiple clients\n\t * asynchronously, this info helps us to determine whether the ops where for the current instance of sub directory\n\t * or not and whether to process them or not based on that. Summaries which were not produced which this change\n\t * will not have this info and in that case we can still run in eventual consistency issues but that is no worse\n\t * than the state before this change.\n\t */\n\tci?: ICreateInfo;\n}\n\n/**\n * {@link IDirectory} storage format.\n *\n * @deprecated This interface will no longer be exported in the future(AB#8004).\n *\n * @legacy @beta\n */\nexport interface IDirectoryNewStorageFormat {\n\t/**\n\t * Blob IDs representing larger directory data that was serialized.\n\t */\n\tblobs: string[];\n\n\t/**\n\t * Storage content representing directory data that was not serialized.\n\t */\n\tcontent: IDirectoryDataObject;\n}\n\n/**\n * The comparator essentially performs the following procedure to determine the order of subdirectory creation:\n * 1. If subdirectory A has a non-negative 'seq' and subdirectory B has a negative 'seq', subdirectory A is always placed first due to\n * the policy that acknowledged subdirectories precede locally created ones that have not been committed yet.\n *\n * 2. When both subdirectories A and B have a non-negative 'seq', they are compared as follows:\n * - If A and B have different 'seq', they are ordered based on 'seq', and the one with the lower 'seq' will be positioned ahead. Notably this rule\n * should not be applied in the directory ordering, since the lowest 'seq' is -1, when the directory is created locally but not acknowledged yet.\n * - In the case where A and B have equal 'seq', the one with the lower 'clientSeq' will be positioned ahead. This scenario occurs when grouped\n * batching is enabled, and a lower 'clientSeq' indicates that it was processed earlier after the batch was ungrouped.\n *\n * 3. When both subdirectories A and B have a negative 'seq', they are compared as follows:\n * - If A and B have different 'seq', the one with lower 'seq' will be positioned ahead, which indicates the corresponding creation message was\n * acknowledged by the server earlier.\n * - If A and B have equal 'seq', the one with lower 'clientSeq' will be placed at the front. This scenario suggests that both subdirectories A\n * and B were created locally and not acknowledged yet, with the one possessing the lower 'clientSeq' being created earlier.\n *\n * 4. A 'seq' value of zero indicates that the subdirectory was created in detached state, and it is considered acknowledged for the\n * purpose of ordering.\n */\nconst seqDataComparator = (a: SequenceData, b: SequenceData): number => {\n\tif (isAcknowledgedOrDetached(a)) {\n\t\tif (isAcknowledgedOrDetached(b)) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn a.seq === b.seq ? a.clientSeq! - b.clientSeq! : a.seq - b.seq;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t} else {\n\t\tif (isAcknowledgedOrDetached(b)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\treturn a.seq === b.seq ? a.clientSeq! - b.clientSeq! : a.seq - b.seq;\n\t\t}\n\t}\n};\n\nfunction isAcknowledgedOrDetached(seqData: SequenceData): boolean {\n\treturn seqData.seq >= 0;\n}\n\n/**\n * The combination of sequence numebr and client sequence number of a subdirectory\n */\ninterface SequenceData {\n\tseq: number;\n\tclientSeq?: number;\n}\n\n/**\n * {@inheritDoc ISharedDirectory}\n *\n * @example\n *\n * ```typescript\n * mySharedDirectory.createSubDirectory(\"a\").createSubDirectory(\"b\").createSubDirectory(\"c\").set(\"foo\", val1);\n * const mySubDir = mySharedDirectory.getWorkingDirectory(\"/a/b/c\");\n * mySubDir.get(\"foo\"); // returns val1\n * ```\n *\n * @sealed\n */\nexport class SharedDirectory\n\textends SharedObject<ISharedDirectoryEventsInternal>\n\timplements ISharedDirectory\n{\n\t/**\n\t * String representation for the class.\n\t */\n\tpublic [Symbol.toStringTag]: string = \"SharedDirectory\";\n\n\t/**\n\t * {@inheritDoc IDirectory.absolutePath}\n\t */\n\tpublic get absolutePath(): string {\n\t\treturn this.root.absolutePath;\n\t}\n\n\t/**\n\t * Root of the SharedDirectory, most operations on the SharedDirectory itself act on the root.\n\t */\n\tprivate readonly root: SubDirectory = new SubDirectory(\n\t\t{ seq: 0, clientSeq: 0 },\n\t\tnew Set(),\n\t\tthis,\n\t\tthis.runtime,\n\t\tthis.serializer,\n\t\tposix.sep,\n\t\tthis.logger,\n\t);\n\n\t/**\n\t * Mapping of op types to message handlers.\n\t */\n\tprivate readonly messageHandlers = new Map<string, IDirectoryMessageHandler>();\n\n\t/**\n\t * Constructs a new shared directory. If the object is non-local an id and service interfaces will\n\t * be provided.\n\t * @param id - String identifier for the SharedDirectory\n\t * @param runtime - Data store runtime\n\t * @param type - Type identifier\n\t */\n\tpublic constructor(\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t) {\n\t\tsuper(id, runtime, attributes, \"fluid_directory_\");\n\t\tthis.setMessageHandlers();\n\t\t// Mirror the containedValueChanged op on the SharedDirectory\n\t\tthis.root.on(\"containedValueChanged\", (changed: IValueChanged, local: boolean) => {\n\t\t\tthis.emit(\"containedValueChanged\", changed, local, this);\n\t\t});\n\t\tthis.root.on(\"subDirectoryCreated\", (relativePath: string, local: boolean) => {\n\t\t\tthis.emit(\"subDirectoryCreated\", relativePath, local, this);\n\t\t});\n\t\tthis.root.on(\"subDirectoryDeleted\", (relativePath: string, local: boolean) => {\n\t\t\tthis.emit(\"subDirectoryDeleted\", relativePath, local, this);\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.get}\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic get<T = any>(key: string): T | undefined {\n\t\treturn this.root.get<T>(key);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.set}\n\t */\n\tpublic set<T = unknown>(key: string, value: T): this {\n\t\tthis.root.set(key, value);\n\t\treturn this;\n\t}\n\n\tpublic dispose(error?: Error): void {\n\t\tthis.root.dispose(error);\n\t}\n\n\tpublic get disposed(): boolean {\n\t\treturn this.root.disposed;\n\t}\n\n\t/**\n\t * Deletes the given key from within this IDirectory.\n\t * @param key - The key to delete\n\t * @returns True if the key existed and was deleted, false if it did not exist\n\t */\n\tpublic delete(key: string): boolean {\n\t\treturn this.root.delete(key);\n\t}\n\n\t/**\n\t * Deletes all keys from within this IDirectory.\n\t */\n\tpublic clear(): void {\n\t\tthis.root.clear();\n\t}\n\n\t/**\n\t * Checks whether the given key exists in this IDirectory.\n\t * @param key - The key to check\n\t * @returns True if the key exists, false otherwise\n\t */\n\tpublic has(key: string): boolean {\n\t\treturn this.root.has(key);\n\t}\n\n\t/**\n\t * The number of entries under this IDirectory.\n\t */\n\tpublic get size(): number {\n\t\treturn this.root.size;\n\t}\n\n\t/**\n\t * Issue a callback on each entry under this IDirectory.\n\t * @param callback - Callback to issue\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic forEach(callback: (value: any, key: string, map: Map<string, any>) => void): void {\n\t\t// eslint-disable-next-line unicorn/no-array-for-each, unicorn/no-array-callback-reference\n\t\tthis.root.forEach(callback);\n\t}\n\n\t/**\n\t * Get an iterator over the entries under this IDirectory.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic [Symbol.iterator](): IterableIterator<[string, any]> {\n\t\treturn this.root[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Get an iterator over the entries under this IDirectory.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic entries(): IterableIterator<[string, any]> {\n\t\treturn this.root.entries();\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.countSubDirectory}\n\t */\n\tpublic countSubDirectory(): number {\n\t\treturn this.root.countSubDirectory();\n\t}\n\n\t/**\n\t * Get an iterator over the keys under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\treturn this.root.keys();\n\t}\n\n\t/**\n\t * Get an iterator over the values under this IDirectory.\n\t * @returns The iterator\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic values(): IterableIterator<any> {\n\t\treturn this.root.values();\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.createSubDirectory}\n\t */\n\tpublic createSubDirectory(subdirName: string): IDirectory {\n\t\treturn this.root.createSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.getSubDirectory}\n\t */\n\tpublic getSubDirectory(subdirName: string): IDirectory | undefined {\n\t\treturn this.root.getSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.hasSubDirectory}\n\t */\n\tpublic hasSubDirectory(subdirName: string): boolean {\n\t\treturn this.root.hasSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.deleteSubDirectory}\n\t */\n\tpublic deleteSubDirectory(subdirName: string): boolean {\n\t\treturn this.root.deleteSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.subdirectories}\n\t */\n\tpublic subdirectories(): IterableIterator<[string, IDirectory]> {\n\t\treturn this.root.subdirectories();\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.getWorkingDirectory}\n\t */\n\tpublic getWorkingDirectory(relativePath: string): IDirectory | undefined {\n\t\tconst absolutePath = this.makeAbsolute(relativePath);\n\t\tif (absolutePath === posix.sep) {\n\t\t\treturn this.root;\n\t\t}\n\n\t\tlet currentSubDir = this.root;\n\t\tconst subdirs = absolutePath.slice(1).split(posix.sep);\n\t\tfor (const subdir of subdirs) {\n\t\t\tcurrentSubDir = currentSubDir.getSubDirectory(subdir) as SubDirectory;\n\t\t\tif (!currentSubDir) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\treturn currentSubDir;\n\t}\n\n\t/**\n\t * Similar to `getWorkingDirectory`, but only returns directories that are sequenced.\n\t * This can be useful for op processing since we only process ops on sequenced directories.\n\t */\n\tprivate getSequencedWorkingDirectory(relativePath: string): IDirectory | undefined {\n\t\tconst absolutePath = this.makeAbsolute(relativePath);\n\t\tif (absolutePath === posix.sep) {\n\t\t\treturn this.root;\n\t\t}\n\n\t\tlet currentSubDir: SubDirectory | undefined = this.root;\n\t\tconst subdirs = absolutePath.slice(1).split(posix.sep);\n\t\tfor (const subdir of subdirs) {\n\t\t\tcurrentSubDir = currentSubDir.sequencedSubdirectories.get(subdir);\n\t\t\tif (!currentSubDir) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t\treturn currentSubDir;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\treturn this.serializeDirectory(this.root, serializer);\n\t}\n\n\t/**\n\t * Submits an operation\n\t * @param op - Op to submit\n\t * @param localOpMetadata - The local metadata associated with the op. We send a unique id that is used to track\n\t * this op while it has not been ack'd. This will be sent when we receive this op back from the server.\n\t */\n\tpublic submitDirectoryMessage(\n\t\top: IDirectoryOperation,\n\t\tlocalOpMetadata: DirectoryLocalOpMetadata,\n\t): void {\n\t\tthis.submitLocalMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect(): void {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}\n\t */\n\tprotected override reSubmitCore(\n\t\tcontent: unknown,\n\t\tlocalOpMetadata: DirectoryLocalOpMetadata,\n\t): void {\n\t\tconst message = content as IDirectoryOperation;\n\t\tconst handler = this.messageHandlers.get(message.type);\n\t\tassert(handler !== undefined, 0x00d /* Missing message handler for message type */);\n\t\thandler.resubmit(message, localOpMetadata);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst data = await readAndParse(storage, snapshotFileName);\n\t\tconst newFormat = data as IDirectoryNewStorageFormat;\n\t\tif (Array.isArray(newFormat.blobs)) {\n\t\t\t// New storage format\n\t\t\tthis.populate(newFormat.content);\n\t\t\tconst blobContents = await Promise.all(\n\t\t\t\tnewFormat.blobs.map(async (blobName) => readAndParse(storage, blobName)),\n\t\t\t);\n\t\t\tfor (const blobContent of blobContents) {\n\t\t\t\tthis.populate(blobContent as IDirectoryDataObject);\n\t\t\t}\n\t\t} else {\n\t\t\t// Old storage format\n\t\t\tthis.populate(data as IDirectoryDataObject);\n\t\t}\n\t}\n\n\t/**\n\t * Populate the directory with the given directory data.\n\t * @param data - A JSON string containing serialized directory data\n\t */\n\tprotected populate(data: IDirectoryDataObject): void {\n\t\tconst stack: [SubDirectory, IDirectoryDataObject][] = [];\n\t\tstack.push([this.root, data]);\n\n\t\twhile (stack.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst [currentSubDir, currentSubDirObject] = stack.pop()!;\n\t\t\tif (currentSubDirObject.subdirectories) {\n\t\t\t\t// Utilize a map to store the seq -> clientSeq for the newly created subdirectory\n\t\t\t\tconst tempSeqNums = new Map<number, number>();\n\t\t\t\tfor (const [subdirName, subdirObject] of Object.entries(\n\t\t\t\t\tcurrentSubDirObject.subdirectories,\n\t\t\t\t)) {\n\t\t\t\t\tlet newSubDir = currentSubDir.getSubDirectory(subdirName) as SubDirectory;\n\t\t\t\t\tlet seqData: SequenceData;\n\t\t\t\t\tif (!newSubDir) {\n\t\t\t\t\t\tconst createInfo = subdirObject.ci;\n\t\t\t\t\t\t// We do not store the client sequence number in the storage because the order has already been\n\t\t\t\t\t\t// guaranteed during the serialization process. As a result, it is only essential to utilize the\n\t\t\t\t\t\t// \"fake\" client sequence number to signify the loading order, and there is no need to retain\n\t\t\t\t\t\t// the actual client sequence number at this point.\n\t\t\t\t\t\tif (createInfo !== undefined && createInfo.csn > 0) {\n\t\t\t\t\t\t\tif (!tempSeqNums.has(createInfo.csn)) {\n\t\t\t\t\t\t\t\ttempSeqNums.set(createInfo.csn, 0);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet fakeClientSeq = tempSeqNums.get(createInfo.csn) as number;\n\t\t\t\t\t\t\tseqData = { seq: createInfo.csn, clientSeq: fakeClientSeq };\n\t\t\t\t\t\t\ttempSeqNums.set(createInfo.csn, ++fakeClientSeq);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * 1. If csn is -1, then initialize it with 0, otherwise we will never process ops for this\n\t\t\t\t\t\t\t * sub directory. This could be done at serialization time too, but we need to maintain\n\t\t\t\t\t\t\t * back compat too and also we will actually know the state when it was serialized.\n\t\t\t\t\t\t\t * 2. We need to make the csn = -1 and csn = 0 share the same counter, there are cases\n\t\t\t\t\t\t\t * where both -1 and 0 coexist within a single document.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tseqData = {\n\t\t\t\t\t\t\t\tseq: 0,\n\t\t\t\t\t\t\t\tclientSeq: ++currentSubDir.localCreationSeq,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnewSubDir = new SubDirectory(\n\t\t\t\t\t\t\tseqData,\n\t\t\t\t\t\t\tcreateInfo === undefined ? new Set() : new Set<string>(createInfo.ccIds),\n\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\tthis.runtime,\n\t\t\t\t\t\t\tthis.serializer,\n\t\t\t\t\t\t\tposix.join(currentSubDir.absolutePath, subdirName),\n\t\t\t\t\t\t\tthis.logger,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcurrentSubDir.populateSubDirectory(subdirName, newSubDir);\n\t\t\t\t\t}\n\t\t\t\t\tstack.push([newSubDir, subdirObject]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (currentSubDirObject.storage) {\n\t\t\t\tfor (const [key, serializable] of Object.entries(currentSubDirObject.storage)) {\n\t\t\t\t\tconst parsedSerializable = parseHandles(\n\t\t\t\t\t\tserializable,\n\t\t\t\t\t\tthis.serializer,\n\t\t\t\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\t\t\t) as ISerializableValue;\n\t\t\t\t\tmigrateIfSharedSerializable(parsedSerializable, this.serializer, this.handle);\n\t\t\t\t\tcurrentSubDir.populateStorage(key, parsedSerializable.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processMessagesCore}\n\t */\n\tprotected override processMessagesCore(messagesCollection: IRuntimeMessageCollection): void {\n\t\tconst { envelope, local, messagesContent } = messagesCollection;\n\t\tfor (const messageContent of messagesContent) {\n\t\t\tthis.processMessage(envelope, messageContent, local);\n\t\t}\n\t}\n\n\tprivate processMessage(\n\t\tmessageEnvelope: ISequencedMessageEnvelope,\n\t\tmessageContent: IRuntimeMessagesContent,\n\t\tlocal: boolean,\n\t): void {\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n\t\tif (messageEnvelope.type === MessageType.Operation) {\n\t\t\tconst op: IDirectoryOperation = messageContent.contents as IDirectoryOperation;\n\t\t\tconst handler = this.messageHandlers.get(op.type);\n\t\t\tassert(\n\t\t\t\thandler !== undefined,\n\t\t\t\t0x00e /* \"Missing message handler for message type: op may be from a newer version */,\n\t\t\t);\n\t\t\thandler.process(\n\t\t\t\tmessageEnvelope,\n\t\t\t\top,\n\t\t\t\tlocal,\n\t\t\t\tmessageContent.localOpMetadata as DirectoryLocalOpMetadata | undefined,\n\t\t\t\tmessageContent.clientSequenceNumber,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}\n\t */\n\tprotected override rollback(\n\t\tcontent: unknown,\n\t\tlocalOpMetadata: DirectoryLocalOpMetadata,\n\t): void {\n\t\tconst op: IDirectoryOperation = content as IDirectoryOperation;\n\t\tconst subdir = this.getWorkingDirectory(op.path) as SubDirectory | undefined;\n\t\tif (subdir) {\n\t\t\tsubdir.rollback(op, localOpMetadata);\n\t\t}\n\t}\n\n\t/**\n\t * Converts the given relative path to absolute against the root.\n\t * @param relativePath - The path to convert\n\t */\n\tprivate makeAbsolute(relativePath: string): string {\n\t\treturn posix.resolve(posix.sep, relativePath);\n\t}\n\n\t/**\n\t * Set the message handlers for the directory.\n\t */\n\tprivate setMessageHandlers(): void {\n\t\t// Notes on how we target the correct subdirectory:\n\t\t// `process`: When processing ops, we only ever want to process ops on sequenced directories. This prevents\n\t\t// scenarios where ops could be processed on a pending directory instead of a sequenced directory,\n\t\t// leading to ops effectively being processed out of order.\n\t\t// `resubmit`: When resubmitting ops, we use `localOpMetadata` to get a reference to the subdirectory that\n\t\t// the op was originally targeting.\n\t\tthis.messageHandlers.set(\"clear\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectoryClearOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: ClearLocalOpMetadata | undefined,\n\t\t\t\tclientSequenceNumber: number,\n\t\t\t) => {\n\t\t\t\tconst subdir = this.getSequencedWorkingDirectory(op.path) as SubDirectory | undefined;\n\t\t\t\tif (subdir !== undefined && !subdir?.disposed) {\n\t\t\t\t\tsubdir.processClearMessage(msgEnvelope, op, local, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (op: IDirectoryClearOperation, localOpMetadata: ClearLocalOpMetadata) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.subdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\ttargetSubdir.resubmitClearMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t\tthis.messageHandlers.set(\"delete\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectoryDeleteOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: EditLocalOpMetadata | undefined,\n\t\t\t\tclientSequenceNumber: number,\n\t\t\t) => {\n\t\t\t\tconst subdir = this.getSequencedWorkingDirectory(op.path) as SubDirectory | undefined;\n\t\t\t\tif (subdir !== undefined && !subdir?.disposed) {\n\t\t\t\t\tsubdir.processDeleteMessage(msgEnvelope, op, local, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (op: IDirectoryDeleteOperation, localOpMetadata: EditLocalOpMetadata) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.subdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\ttargetSubdir.resubmitKeyMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t\tthis.messageHandlers.set(\"set\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectorySetOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: EditLocalOpMetadata | undefined,\n\t\t\t\tclientSequenceNumber: number,\n\t\t\t) => {\n\t\t\t\tconst subdir = this.getSequencedWorkingDirectory(op.path) as SubDirectory | undefined;\n\t\t\t\tif (subdir !== undefined && !subdir?.disposed) {\n\t\t\t\t\tmigrateIfSharedSerializable(op.value, this.serializer, this.handle);\n\t\t\t\t\tconst localValue: unknown = local ? undefined : op.value.value;\n\t\t\t\t\tsubdir.processSetMessage(msgEnvelope, op, localValue, local, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (op: IDirectorySetOperation, localOpMetadata: EditLocalOpMetadata) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.subdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\ttargetSubdir.resubmitKeyMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tthis.messageHandlers.set(\"createSubDirectory\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectoryCreateSubDirectoryOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: SubDirLocalOpMetadata | undefined,\n\t\t\t\tclientSequenceNumber: number,\n\t\t\t) => {\n\t\t\t\tconst parentSubdir = this.getSequencedWorkingDirectory(op.path) as\n\t\t\t\t\t| SubDirectory\n\t\t\t\t\t| undefined;\n\t\t\t\tif (parentSubdir !== undefined && !parentSubdir?.disposed) {\n\t\t\t\t\tparentSubdir.processCreateSubDirectoryMessage(\n\t\t\t\t\t\tmsgEnvelope,\n\t\t\t\t\t\top,\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\tlocalOpMetadata,\n\t\t\t\t\t\tclientSequenceNumber,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (\n\t\t\t\top: IDirectoryCreateSubDirectoryOperation,\n\t\t\t\tlocalOpMetadata: SubDirLocalOpMetadata,\n\t\t\t) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.parentSubdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\t// We don't reuse the metadata but send a new one on each submit.\n\t\t\t\t\ttargetSubdir.resubmitSubDirectoryMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tthis.messageHandlers.set(\"deleteSubDirectory\", {\n\t\t\tprocess: (\n\t\t\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\t\t\top: IDirectoryDeleteSubDirectoryOperation,\n\t\t\t\tlocal: boolean,\n\t\t\t\tlocalOpMetadata: SubDirLocalOpMetadata | undefined,\n\t\t\t) => {\n\t\t\t\tconst parentSubdir = this.getSequencedWorkingDirectory(op.path) as\n\t\t\t\t\t| SubDirectory\n\t\t\t\t\t| undefined;\n\t\t\t\tif (parentSubdir !== undefined && !parentSubdir?.disposed) {\n\t\t\t\t\tparentSubdir.processDeleteSubDirectoryMessage(\n\t\t\t\t\t\tmsgEnvelope,\n\t\t\t\t\t\top,\n\t\t\t\t\t\tlocal,\n\t\t\t\t\t\tlocalOpMetadata,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\tresubmit: (\n\t\t\t\top: IDirectoryDeleteSubDirectoryOperation,\n\t\t\t\tlocalOpMetadata: SubDirLocalOpMetadata,\n\t\t\t) => {\n\t\t\t\tconst targetSubdir = localOpMetadata.parentSubdir;\n\t\t\t\tif (!targetSubdir.disposed) {\n\t\t\t\t\t// We don't reuse the metadata but send a new one on each submit.\n\t\t\t\t\ttargetSubdir.resubmitSubDirectoryMessage(op, localOpMetadata);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n\t */\n\tprotected applyStashedOp(op: unknown): void {\n\t\tconst directoryOp = op as IDirectoryOperation;\n\t\tconst dir = this.getWorkingDirectory(directoryOp.path);\n\t\tswitch (directoryOp.type) {\n\t\t\tcase \"clear\": {\n\t\t\t\tdir?.clear();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"createSubDirectory\": {\n\t\t\t\tdir?.createSubDirectory(directoryOp.subdirName);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"delete\": {\n\t\t\t\tdir?.delete(directoryOp.key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"deleteSubDirectory\": {\n\t\t\t\tdir?.deleteSubDirectory(directoryOp.subdirName);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"set\": {\n\t\t\t\tmigrateIfSharedSerializable(directoryOp.value, this.serializer, this.handle);\n\t\t\t\tdir?.set(directoryOp.key, directoryOp.value.value);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(directoryOp);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate serializeDirectory(\n\t\troot: SubDirectory,\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\tconst MinValueSizeSeparateSnapshotBlob = 8 * 1024;\n\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tlet counter = 0;\n\t\tconst blobs: string[] = [];\n\n\t\tconst stack: [SubDirectory, IDirectoryDataObject][] = [];\n\t\tconst content: IDirectoryDataObject = {};\n\t\tstack.push([root, content]);\n\n\t\twhile (stack.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst [currentSubDir, currentSubDirObject] = stack.pop()!;\n\t\t\tcurrentSubDirObject.ci = currentSubDir.getSerializableCreateInfo();\n\t\t\tfor (const [key, value] of currentSubDir.getSerializedStorage(serializer)) {\n\t\t\t\tif (!currentSubDirObject.storage) {\n\t\t\t\t\tcurrentSubDirObject.storage = {};\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line import-x/no-deprecated\n\t\t\t\tconst result: ISerializableValue = {\n\t\t\t\t\ttype: value.type,\n\t\t\t\t\tvalue: value.value && (JSON.parse(value.value) as object),\n\t\t\t\t};\n\t\t\t\tif (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {\n\t\t\t\t\tconst extraContent: IDirectoryDataObject = {};\n\t\t\t\t\tlet largeContent = extraContent;\n\t\t\t\t\tif (currentSubDir.absolutePath !== posix.sep) {\n\t\t\t\t\t\tfor (const dir of currentSubDir.absolutePath.slice(1).split(posix.sep)) {\n\t\t\t\t\t\t\tconst subDataObject: IDirectoryDataObject = {};\n\t\t\t\t\t\t\tlargeContent.subdirectories = { [dir]: subDataObject };\n\t\t\t\t\t\t\tlargeContent = subDataObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlargeContent.storage = { [key]: result };\n\t\t\t\t\tconst blobName = `blob${counter}`;\n\t\t\t\t\tcounter++;\n\t\t\t\t\tblobs.push(blobName);\n\t\t\t\t\tbuilder.addBlob(blobName, JSON.stringify(extraContent));\n\t\t\t\t} else {\n\t\t\t\t\tcurrentSubDirObject.storage[key] = result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const [subdirName, subdir] of currentSubDir.subdirectories()) {\n\t\t\t\tif (!currentSubDirObject.subdirectories) {\n\t\t\t\t\tcurrentSubDirObject.subdirectories = {};\n\t\t\t\t}\n\t\t\t\tconst subDataObject: IDirectoryDataObject = {};\n\t\t\t\tcurrentSubDirObject.subdirectories[subdirName] = subDataObject;\n\t\t\t\tstack.push([subdir as SubDirectory, subDataObject]);\n\t\t\t}\n\t\t}\n\n\t\tconst newFormat: IDirectoryNewStorageFormat = {\n\t\t\tblobs,\n\t\t\tcontent,\n\t\t};\n\t\tbuilder.addBlob(snapshotFileName, JSON.stringify(newFormat));\n\n\t\treturn builder.getSummaryTree();\n\t}\n}\n\ninterface ICreateSubDirLocalOpMetadata {\n\ttype: \"createSubDir\";\n\tparentSubdir: SubDirectory;\n}\n\ninterface IDeleteSubDirLocalOpMetadata {\n\ttype: \"deleteSubDir\";\n\tsubDirectory: SubDirectory | undefined;\n\tparentSubdir: SubDirectory;\n}\n\ntype SubDirLocalOpMetadata = ICreateSubDirLocalOpMetadata | IDeleteSubDirLocalOpMetadata;\n\ntype EditLocalOpMetadata = PendingKeySet | PendingKeyDelete;\n\ntype ClearLocalOpMetadata = PendingClear;\n\ntype StorageLocalOpMetadata = EditLocalOpMetadata | ClearLocalOpMetadata;\n\n/**\n * Types of local op metadata.\n */\nexport type DirectoryLocalOpMetadata = StorageLocalOpMetadata | SubDirLocalOpMetadata;\n\n// eslint-disable-next-line @rushstack/no-new-null\nfunction assertNonNullClientId(clientId: string | null): asserts clientId is string {\n\tassert(clientId !== null, 0x6af /* client id should never be null */);\n}\n\n/**\n * Node of the directory tree.\n * @sealed\n */\nclass SubDirectory extends TypedEventEmitter<IDirectoryEvents> implements IDirectory {\n\t/**\n\t * Tells if the sub directory is deleted or not.\n\t */\n\tprivate _deleted = false;\n\n\t/**\n\t * String representation for the class.\n\t */\n\tpublic [Symbol.toStringTag]: string = \"SubDirectory\";\n\n\t/**\n\t * The sequenced subdirectories the directory is holding independent of any pending\n\t * create/delete subdirectory operations.\n\t */\n\tprivate readonly _sequencedSubdirectories = new Map<string, SubDirectory>();\n\n\t/**\n\t * Assigns a unique ID to each subdirectory created locally but pending for acknowledgement, facilitating the tracking\n\t * of the creation order.\n\t */\n\tpublic localCreationSeq: number = 0;\n\n\tprivate readonly mc: MonitoringContext;\n\n\t/**\n\t * Constructor.\n\t * @param sequenceNumber - Message seq number at which this was created.\n\t * @param clientIds - Ids of client which created this directory.\n\t * @param directory - Reference back to the SharedDirectory to perform operations\n\t * @param runtime - The data store runtime this directory is associated with\n\t * @param serializer - The serializer to serialize / parse handles\n\t * @param absolutePath - The absolute path of this IDirectory\n\t */\n\tpublic constructor(\n\t\tprivate readonly seqData: SequenceData,\n\t\tprivate readonly clientIds: Set<string>,\n\t\tprivate readonly directory: SharedDirectory,\n\t\tprivate readonly runtime: IFluidDataStoreRuntime,\n\t\tprivate readonly serializer: IFluidSerializer,\n\t\tpublic readonly absolutePath: string,\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\tsuper();\n\t\tthis.mc = createChildMonitoringContext({ logger, namespace: \"Directory\" });\n\t}\n\n\tpublic dispose(error?: Error): void {\n\t\tthis._deleted = true;\n\t\tthis.emit(\"disposed\", this);\n\t}\n\n\t/**\n\t * Unmark the deleted property only when rolling back delete.\n\t */\n\tprivate undispose(): void {\n\t\tthis._deleted = false;\n\t\tthis.emit(\"undisposed\", this);\n\t}\n\n\tpublic get disposed(): boolean {\n\t\treturn this._deleted;\n\t}\n\n\tprivate throwIfDisposed(): void {\n\t\tif (this._deleted) {\n\t\t\tthrow new UsageError(\"Cannot access Disposed subDirectory\");\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether the given key exists in this IDirectory.\n\t * @param key - The key to check\n\t * @returns True if the key exists, false otherwise\n\t */\n\tpublic has(key: string): boolean {\n\t\tthis.throwIfDisposed();\n\t\treturn this.optimisticallyHas(key);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.get}\n\t */\n\tpublic get<T = unknown>(key: string): T | undefined {\n\t\treturn this.getOptimisticValue(key) as T | undefined;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.set}\n\t */\n\tpublic set<T = unknown>(key: string, value: T): this {\n\t\tthis.throwIfDisposed();\n\t\t// Undefined/null keys can't be serialized to JSON in the manner we currently snapshot.\n\t\tif (key === undefined || key === null) {\n\t\t\tthrow new Error(\"Undefined and null keys are not supported\");\n\t\t}\n\t\tconst previousOptimisticLocalValue = this.getOptimisticValue(key);\n\n\t\tconst detachedBind =\n\t\t\tthis.mc.config.getBoolean(\"Fluid.Directory.AllowDetachedResolve\") ?? false;\n\t\tif (detachedBind) {\n\t\t\t// Create a local value and serialize it.\n\t\t\t// AB#47081: This will be removed once we can validate that it is no longer needed.\n\t\t\tbindHandles(value, this.directory.handle);\n\t\t}\n\n\t\t// If we are not attached, don't submit the op.\n\t\tif (!this.directory.isAttached()) {\n\t\t\tthis.sequencedStorageData.set(key, value);\n\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\tkey,\n\t\t\t\tpath: this.absolutePath,\n\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t};\n\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\tkey,\n\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t};\n\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\treturn this;\n\t\t}\n\n\t\t// A new pending key lifetime is created if:\n\t\t// 1. There isn't any pending entry for the key yet\n\t\t// 2. The most recent pending entry for the key was a deletion (as this terminates the prior lifetime)\n\t\t// 3. A clear was sent after the last pending entry for the key (which also terminates the prior lifetime)\n\t\tlet latestPendingEntry = findLast(\n\t\t\tthis.pendingStorageData,\n\t\t\t(entry) => entry.type === \"clear\" || entry.key === key,\n\t\t);\n\t\tif (\n\t\t\tlatestPendingEntry === undefined ||\n\t\t\tlatestPendingEntry.type === \"delete\" ||\n\t\t\tlatestPendingEntry.type === \"clear\"\n\t\t) {\n\t\t\tlatestPendingEntry = {\n\t\t\t\ttype: \"lifetime\",\n\t\t\t\tpath: this.absolutePath,\n\t\t\t\tkey,\n\t\t\t\tkeySets: [],\n\t\t\t\tsubdir: this,\n\t\t\t};\n\t\t\tthis.pendingStorageData.push(latestPendingEntry);\n\t\t}\n\t\tconst pendingKeySet: PendingKeySet = {\n\t\t\ttype: \"set\",\n\t\t\tpath: this.absolutePath,\n\t\t\tvalue,\n\t\t\tsubdir: this,\n\t\t};\n\t\tlatestPendingEntry.keySets.push(pendingKeySet);\n\n\t\tconst op: IDirectoryOperation = {\n\t\t\tkey,\n\t\t\tpath: this.absolutePath,\n\t\t\ttype: \"set\",\n\t\t\tvalue: { type: ValueType[ValueType.Plain], value },\n\t\t};\n\t\tthis.submitKeyMessage(op, pendingKeySet);\n\n\t\tconst directoryValueChanged: IDirectoryValueChanged = {\n\t\t\tkey,\n\t\t\tpath: this.absolutePath,\n\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t};\n\t\tthis.directory.emit(\"valueChanged\", directoryValueChanged, true, this.directory);\n\t\tconst valueChanged: IValueChanged = {\n\t\t\tkey,\n\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t};\n\t\tthis.emit(\"containedValueChanged\", valueChanged, true, this);\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.countSubDirectory}\n\t */\n\tpublic countSubDirectory(): number {\n\t\treturn [...this.subdirectories()].length;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.createSubDirectory}\n\t */\n\tpublic createSubDirectory(subdirName: string): IDirectory {\n\t\tthis.throwIfDisposed();\n\t\t// Undefined/null subdirectory names can't be serialized to JSON in the manner we currently snapshot.\n\t\tif (subdirName === undefined || subdirName === null) {\n\t\t\tthrow new Error(\"SubDirectory name may not be undefined or null\");\n\t\t}\n\n\t\tif (subdirName.includes(posix.sep)) {\n\t\t\tthrow new Error(`SubDirectory name may not contain ${posix.sep}`);\n\t\t}\n\n\t\tlet subDir = this.getOptimisticSubDirectory(subdirName, true);\n\t\tconst seqData = this.getLocalSeq();\n\t\tconst clientId = this.runtime.clientId ?? \"detached\";\n\t\tconst isNewSubDirectory = subDir === undefined;\n\n\t\tif (subDir === undefined) {\n\t\t\t// If we do not have optimistically have this subdirectory yet, we should create a new one\n\t\t\tconst absolutePath = posix.join(this.absolutePath, subdirName);\n\t\t\tsubDir = new SubDirectory(\n\t\t\t\t{ ...seqData },\n\t\t\t\tnew Set([clientId]),\n\t\t\t\tthis.directory,\n\t\t\t\tthis.runtime,\n\t\t\t\tthis.serializer,\n\t\t\t\tabsolutePath,\n\t\t\t\tthis.mc.logger,\n\t\t\t);\n\t\t} else {\n\t\t\tif (subDir.disposed) {\n\t\t\t\t// In the case that the subdir exists but is disposed, we should\n\t\t\t\t// still use the existing subdir to maintain any pending changes but\n\t\t\t\t// ensure it is no longer disposed.\n\t\t\t\tthis.undisposeSubdirectoryTree(subDir);\n\t\t\t}\n\t\t\tsubDir.clientIds.add(clientId);\n\t\t}\n\n\t\tthis.registerEventsOnSubDirectory(subDir, subdirName);\n\n\t\t// Only submit the op/emit event if we actually created a new subdir.\n\t\tif (isNewSubDirectory) {\n\t\t\tif (this.directory.isAttached()) {\n\t\t\t\tconst pendingSubDirectoryCreate: PendingSubDirectoryCreate = {\n\t\t\t\t\ttype: \"createSubDirectory\",\n\t\t\t\t\tsubdirName,\n\t\t\t\t\tsubdir: subDir,\n\t\t\t\t};\n\t\t\t\tthis.pendingSubDirectoryData.push(pendingSubDirectoryCreate);\n\t\t\t\tconst op: IDirectoryCreateSubDirectoryOperation = {\n\t\t\t\t\tsubdirName,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\ttype: \"createSubDirectory\",\n\t\t\t\t};\n\t\t\t\tthis.submitCreateSubDirectoryMessage(op);\n\t\t\t} else {\n\t\t\t\t// If we are detached, don't submit the op and directly commit\n\t\t\t\t// the subdir to _sequencedSubdirectories.\n\t\t\t\tthis._sequencedSubdirectories.set(subdirName, subDir);\n\t\t\t}\n\t\t\tthis.emit(\"subDirectoryCreated\", subdirName, true, this);\n\t\t}\n\t\treturn subDir;\n\t}\n\n\t/**\n\t * Gets the Sequence Data which should be used for local changes.\n\t *\n\t * @remarks While detached, 0 is used rather than -1 to represent a change which should be universally known (as opposed to known\n\t * only by the local client). This ensures that if the directory is later attached, none of its data needs to be updated (the values\n\t * last set while detached will now be known to any new client, until they are changed).\n\t *\n\t * The client sequence number is incremented by 1 for maintaining the internal order of locally created subdirectories\n\t *\n\t * @privateRemarks TODO: Convert these conventions to named constants. The semantics used here match those for merge-tree.\n\t */\n\tprivate getLocalSeq(): SequenceData {\n\t\treturn this.directory.isAttached()\n\t\t\t? { seq: -1, clientSeq: ++this.localCreationSeq }\n\t\t\t: { seq: 0, clientSeq: ++this.localCreationSeq };\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.getSubDirectory}\n\t */\n\tpublic getSubDirectory(subdirName: string): IDirectory | undefined {\n\t\tthis.throwIfDisposed();\n\t\treturn this.getOptimisticSubDirectory(subdirName);\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.hasSubDirectory}\n\t */\n\tpublic hasSubDirectory(subdirName: string): boolean {\n\t\tthis.throwIfDisposed();\n\t\treturn this.getOptimisticSubDirectory(subdirName) !== undefined;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.deleteSubDirectory}\n\t */\n\tpublic deleteSubDirectory(subdirName: string): boolean {\n\t\tthis.throwIfDisposed();\n\n\t\tif (!this.directory.isAttached()) {\n\t\t\tconst previousValue = this._sequencedSubdirectories.get(subdirName);\n\t\t\tconst successfullyRemoved = this._sequencedSubdirectories.delete(subdirName);\n\t\t\t// Only emit if we actually deleted something.\n\t\t\tif (successfullyRemoved) {\n\t\t\t\tthis.disposeSubDirectoryTree(previousValue);\n\t\t\t\tthis.emit(\"subDirectoryDeleted\", subdirName, true, this);\n\t\t\t}\n\t\t\treturn successfullyRemoved;\n\t\t}\n\n\t\tconst previousOptimisticSubDirectory = this.getOptimisticSubDirectory(subdirName);\n\t\tif (previousOptimisticSubDirectory === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\tconst pendingSubdirDelete: PendingSubDirectoryDelete = {\n\t\t\ttype: \"deleteSubDirectory\",\n\t\t\tsubdirName,\n\t\t\tsubdir: this,\n\t\t};\n\t\tthis.pendingSubDirectoryData.push(pendingSubdirDelete);\n\n\t\tconst op: IDirectoryOperation = {\n\t\t\tsubdirName,\n\t\t\ttype: \"deleteSubDirectory\",\n\t\t\tpath: this.absolutePath,\n\t\t};\n\t\tthis.submitDeleteSubDirectoryMessage(op, previousOptimisticSubDirectory);\n\t\tthis.emit(\"subDirectoryDeleted\", subdirName, true, this);\n\t\t// We don't want to fully dispose the subdir tree since this is only a pending\n\t\t// local delete. Instead we will only emit the dispose event to reflect the\n\t\t// local state.\n\t\tthis.emitDisposeForSubdirTree(previousOptimisticSubDirectory);\n\t\treturn true;\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.subdirectories}\n\t */\n\tpublic subdirectories(): IterableIterator<[string, IDirectory]> {\n\t\tthis.throwIfDisposed();\n\n\t\t// subdirectories() should reflect the optimistic state of subdirectories.\n\t\t// This means that we should return both sequenced and pending subdirectories\n\t\t// that do not also have a pending deletion.\n\t\tconst sequencedSubdirs: [string, SubDirectory][] = [];\n\t\tconst sequencedSubdirNames = new Set([...this._sequencedSubdirectories.keys()]);\n\t\tfor (const subdirName of sequencedSubdirNames) {\n\t\t\tconst optimisticSubdir = this.getOptimisticSubDirectory(subdirName);\n\t\t\tif (optimisticSubdir !== undefined) {\n\t\t\t\tsequencedSubdirs.push([subdirName, optimisticSubdir]);\n\t\t\t}\n\t\t}\n\t\tconst pendingSubdirNames = [\n\t\t\t...new Set(\n\t\t\t\tthis.pendingSubDirectoryData\n\t\t\t\t\t.map((entry) => entry.subdirName)\n\t\t\t\t\t.filter((subdirName) => !sequencedSubdirNames.has(subdirName)),\n\t\t\t),\n\t\t];\n\t\tconst pendingSubdirs: [string, SubDirectory][] = [];\n\t\tfor (const subdirName of pendingSubdirNames) {\n\t\t\tconst optimisticSubdir = this.getOptimisticSubDirectory(subdirName);\n\t\t\tif (optimisticSubdir !== undefined) {\n\t\t\t\tpendingSubdirs.push([subdirName, optimisticSubdir]);\n\t\t\t}\n\t\t}\n\t\tconst allSubdirs = [...sequencedSubdirs, ...pendingSubdirs];\n\t\tconst orderedSubdirs = allSubdirs.sort((a, b) => {\n\t\t\tconst aSeqData = a[1].seqData;\n\t\t\tconst bSeqData = b[1].seqData;\n\t\t\treturn seqDataComparator(aSeqData, bSeqData);\n\t\t});\n\n\t\treturn orderedSubdirs[Symbol.iterator]();\n\t}\n\n\t/**\n\t * {@inheritDoc IDirectory.getWorkingDirectory}\n\t */\n\tpublic getWorkingDirectory(relativePath: string): IDirectory | undefined {\n\t\tthis.throwIfDisposed();\n\t\treturn this.directory.getWorkingDirectory(this.makeAbsolute(relativePath));\n\t}\n\n\t/**\n\t * This checks if there is pending delete op for local delete for a given child subdirectory.\n\t * @param subDirName - directory name.\n\t * @returns true if there is pending delete.\n\t */\n\tpublic isSubDirectoryDeletePending(subDirName: string): boolean {\n\t\tconst lastPendingEntry = findLast(this.pendingSubDirectoryData, (entry) => {\n\t\t\treturn entry.subdirName === subDirName && entry.type === \"deleteSubDirectory\";\n\t\t});\n\t\treturn lastPendingEntry !== undefined;\n\t}\n\n\t/**\n\t * Deletes the given key from within this IDirectory.\n\t * @param key - The key to delete\n\t * @returns True if the key existed and was deleted, false if it did not exist\n\t */\n\tpublic delete(key: string): boolean {\n\t\tthis.throwIfDisposed();\n\t\tconst previousOptimisticLocalValue = this.getOptimisticValue(key);\n\n\t\tif (!this.directory.isAttached()) {\n\t\t\tconst successfullyRemoved = this.sequencedStorageData.delete(key);\n\t\t\t// Only emit if we actually deleted something.\n\t\t\tif (\n\t\t\t\tthis.isNotDisposedAndReachable() &&\n\t\t\t\tpreviousOptimisticLocalValue !== undefined &&\n\t\t\t\tsuccessfullyRemoved\n\t\t\t) {\n\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\tkey,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t\t};\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\t\tkey,\n\t\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t\t};\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\t}\n\t\t\treturn successfullyRemoved;\n\t\t}\n\n\t\tconst pendingKeyDelete: PendingKeyDelete = {\n\t\t\ttype: \"delete\",\n\t\t\tpath: this.absolutePath,\n\t\t\tkey,\n\t\t\tsubdir: this,\n\t\t};\n\t\tthis.pendingStorageData.push(pendingKeyDelete);\n\n\t\tconst op: IDirectoryOperation = {\n\t\t\tkey,\n\t\t\ttype: \"delete\",\n\t\t\tpath: this.absolutePath,\n\t\t};\n\t\tthis.submitKeyMessage(op, pendingKeyDelete);\n\t\t// Only emit if we locally believe we deleted something. Otherwise we still send the op\n\t\t// (permitting speculative deletion even if we don't see anything locally) but don't emit\n\t\t// a valueChanged since we in fact did not locally observe a value change.\n\t\tif (this.isNotDisposedAndReachable() && previousOptimisticLocalValue !== undefined) {\n\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\tkey,\n\t\t\t\tpath: this.absolutePath,\n\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t};\n\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\tkey,\n\t\t\t\tpreviousValue: previousOptimisticLocalValue,\n\t\t\t};\n\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Deletes all keys from within this IDirectory.\n\t */\n\tpublic clear(): void {\n\t\tthis.throwIfDisposed();\n\n\t\tif (!this.directory.isAttached()) {\n\t\t\tthis.sequencedStorageData.clear();\n\t\t\tthis.directory.emit(\"clear\", true, this.directory);\n\t\t\tthis.directory.emit(\"clearInternal\", this.absolutePath, true, this.directory);\n\t\t\treturn;\n\t\t}\n\n\t\tconst pendingClear: PendingClear = {\n\t\t\ttype: \"clear\",\n\t\t\tpath: this.absolutePath,\n\t\t\tsubdir: this,\n\t\t};\n\t\tthis.pendingStorageData.push(pendingClear);\n\n\t\tthis.directory.emit(\"clear\", true, this.directory);\n\t\tthis.directory.emit(\"clearInternal\", this.absolutePath, true, this.directory);\n\t\tconst op: IDirectoryOperation = {\n\t\t\ttype: \"clear\",\n\t\t\tpath: this.absolutePath,\n\t\t};\n\t\tthis.submitClearMessage(op, pendingClear);\n\t}\n\n\t/**\n\t * Issue a callback on each entry under this IDirectory.\n\t * @param callback - Callback to issue\n\t */\n\tpublic forEach(\n\t\tcallback: (value: unknown, key: string, map: Map<string, unknown>) => void,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tfor (const [key, localValue] of this.internalIterator()) {\n\t\t\tcallback(localValue, key, this);\n\t\t}\n\t}\n\n\t/**\n\t * The number of entries under this IDirectory.\n\t */\n\tpublic get size(): number {\n\t\tthis.throwIfDisposed();\n\t\treturn [...this.internalIterator()].length;\n\t}\n\n\t/**\n\t * Get an iterator over the entries under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic entries(): IterableIterator<[string, unknown]> {\n\t\tthis.throwIfDisposed();\n\t\tconst internalIterator = this.internalIterator();\n\t\tconst next = (): IteratorResult<[string, unknown]> => {\n\t\t\tconst nextResult = internalIterator.next();\n\t\t\tif (nextResult.done) {\n\t\t\t\treturn { value: undefined, done: true };\n\t\t\t}\n\t\t\t// Unpack the stored value\n\t\t\tconst [key, localValue] = nextResult.value;\n\t\t\treturn { value: [key, localValue], done: false };\n\t\t};\n\n\t\tconst iterator = {\n\t\t\tnext,\n\t\t\t[Symbol.iterator](): IterableIterator<[string, unknown]> {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the keys under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic keys(): IterableIterator<string> {\n\t\tthis.throwIfDisposed();\n\t\tconst internalIterator = this.internalIterator();\n\t\tconst next = (): IteratorResult<string> => {\n\t\t\tconst nextResult = internalIterator.next();\n\t\t\tif (nextResult.done) {\n\t\t\t\treturn { value: undefined, done: true };\n\t\t\t}\n\t\t\tconst [key] = nextResult.value;\n\t\t\treturn { value: key, done: false };\n\t\t};\n\t\tconst iterator = {\n\t\t\tnext,\n\t\t\t[Symbol.iterator](): IterableIterator<string> {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the values under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic values(): IterableIterator<unknown> {\n\t\tthis.throwIfDisposed();\n\t\tconst internalIterator = this.internalIterator();\n\t\tconst next = (): IteratorResult<unknown> => {\n\t\t\tconst nextResult = internalIterator.next();\n\t\t\tif (nextResult.done) {\n\t\t\t\treturn { value: undefined, done: true };\n\t\t\t}\n\t\t\tconst [, localValue] = nextResult.value;\n\t\t\treturn { value: localValue, done: false };\n\t\t};\n\t\tconst iterator = {\n\t\t\tnext,\n\t\t\t[Symbol.iterator](): IterableIterator<unknown> {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t}\n\n\t/**\n\t * Get an iterator over the entries under this IDirectory.\n\t * @returns The iterator\n\t */\n\tpublic [Symbol.iterator](): IterableIterator<[string, unknown]> {\n\t\tthis.throwIfDisposed();\n\t\treturn this.internalIterator();\n\t}\n\n\t/**\n\t * The data this SubDirectory instance is storing, but only including sequenced values (no local pending\n\t * modifications are included).\n\t */\n\tprivate readonly sequencedStorageData = new Map<string, unknown>();\n\n\t/**\n\t * A data structure containing all local pending storage modifications, which is used in combination\n\t * with the sequencedStorageData to compute optimistic values.\n\t *\n\t * Pending sets are aggregated into \"lifetimes\", which permit correct relative iteration order\n\t * even across remote operations and rollbacks.\n\t */\n\tprivate readonly pendingStorageData: PendingStorageEntry[] = [];\n\n\t/**\n\t * A data structure containing all local pending subdirectory create/deletes, which is used in combination\n\t * with the _sequencedSubdirectories to compute optimistic values.\n\t */\n\tprivate readonly pendingSubDirectoryData: PendingSubDirectoryEntry[] = [];\n\n\t/**\n\t * An internal iterator that iterates over the entries in the directory.\n\t */\n\tprivate readonly internalIterator = (): IterableIterator<[string, unknown]> => {\n\t\t// We perform iteration in two steps - first by iterating over members of the sequenced storage data that are not\n\t\t// optimistically deleted or cleared, and then over the pending data lifetimes that have not subsequently\n\t\t// been deleted or cleared. In total, this give an ordering of members based on when they were initially\n\t\t// added to the sub directory (even if they were later modified), similar to the native Map.\n\t\tconst sequencedStorageDataIterator = this.sequencedStorageData.keys();\n\t\tconst pendingStorageDataIterator = this.pendingStorageData.values();\n\t\tconst next = (): IteratorResult<[string, unknown]> => {\n\t\t\tlet nextSequencedKey = sequencedStorageDataIterator.next();\n\t\t\twhile (!nextSequencedKey.done) {\n\t\t\t\tconst key = nextSequencedKey.value;\n\t\t\t\t// If we have any pending deletes or clears, then we won't iterate to this key yet (if at all).\n\t\t\t\t// Either it is optimistically deleted and will not be part of the iteration, or it was\n\t\t\t\t// re-added later and we'll iterate to it when we get to the pending data.\n\t\t\t\tif (\n\t\t\t\t\t!this.pendingStorageData.some(\n\t\t\t\t\t\t(entry) =>\n\t\t\t\t\t\t\tentry.type === \"clear\" || (entry.type === \"delete\" && entry.key === key),\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tassert(this.has(key), 0xc03 /* key should exist in sequenced or pending data */);\n\t\t\t\t\tconst optimisticValue = this.getOptimisticValue(key);\n\t\t\t\t\treturn { value: [key, optimisticValue], done: false };\n\t\t\t\t}\n\t\t\t\tnextSequencedKey = sequencedStorageDataIterator.next();\n\t\t\t}\n\n\t\t\tlet nextPending = pendingStorageDataIterator.next();\n\t\t\twhile (!nextPending.done) {\n\t\t\t\tconst nextPendingEntry = nextPending.value;\n\t\t\t\t// A lifetime entry may need to be iterated.\n\t\t\t\tif (nextPendingEntry.type === \"lifetime\") {\n\t\t\t\t\tconst nextPendingEntryIndex = this.pendingStorageData.indexOf(nextPendingEntry);\n\t\t\t\t\tconst mostRecentDeleteOrClearIndex = findLastIndex(\n\t\t\t\t\t\tthis.pendingStorageData,\n\t\t\t\t\t\t(entry) =>\n\t\t\t\t\t\t\tentry.type === \"clear\" ||\n\t\t\t\t\t\t\t(entry.type === \"delete\" && entry.key === nextPendingEntry.key),\n\t\t\t\t\t);\n\t\t\t\t\t// Only iterate the pending entry now if it hasn't been deleted or cleared.\n\t\t\t\t\tif (nextPendingEntryIndex > mostRecentDeleteOrClearIndex) {\n\t\t\t\t\t\tconst latestPendingValue =\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\t\tnextPendingEntry.keySets[nextPendingEntry.keySets.length - 1]!;\n\t\t\t\t\t\t// Skip iterating if we would have would have already iterated it as part of the sequenced data.\n\t\t\t\t\t\t// This is not a perfect check in the case the map has changed since the iterator was created\n\t\t\t\t\t\t// (e.g. if a remote client added the same key in the meantime).\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!this.sequencedStorageData.has(nextPendingEntry.key) ||\n\t\t\t\t\t\t\tmostRecentDeleteOrClearIndex !== -1\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn { value: [nextPendingEntry.key, latestPendingValue.value], done: false };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnextPending = pendingStorageDataIterator.next();\n\t\t\t}\n\n\t\t\treturn { value: undefined, done: true };\n\t\t};\n\n\t\tconst iterator = {\n\t\t\tnext,\n\t\t\t[Symbol.iterator](): IterableIterator<[string, unknown]> {\n\t\t\t\treturn this;\n\t\t\t},\n\t\t};\n\t\treturn iterator;\n\t};\n\n\t/**\n\t * Compute the optimistic local value for a given key. This combines the sequenced data with\n\t * any pending changes that have not yet been sequenced.\n\t */\n\tprivate readonly getOptimisticValue = (key: string): unknown => {\n\t\tconst latestPendingEntry = findLast(\n\t\t\tthis.pendingStorageData,\n\t\t\t(entry) => entry.type === \"clear\" || entry.key === key,\n\t\t);\n\n\t\tif (latestPendingEntry === undefined) {\n\t\t\treturn this.sequencedStorageData.get(key);\n\t\t} else if (latestPendingEntry.type === \"lifetime\") {\n\t\t\tconst latestPendingSet =\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tlatestPendingEntry.keySets[latestPendingEntry.keySets.length - 1]!;\n\t\t\treturn latestPendingSet.value;\n\t\t} else {\n\t\t\t// Delete or clear\n\t\t\treturn undefined;\n\t\t}\n\t};\n\n\t/**\n\t * Determine if the directory optimistically has the key.\n\t * This will return true even if the value is undefined.\n\t */\n\tprivate readonly optimisticallyHas = (key: string): boolean => {\n\t\tconst latestPendingEntry = findLast(\n\t\t\tthis.pendingStorageData,\n\t\t\t(entry) => entry.type === \"clear\" || entry.key === key,\n\t\t);\n\n\t\treturn latestPendingEntry === undefined\n\t\t\t? this.sequencedStorageData.has(key)\n\t\t\t: latestPendingEntry.type === \"lifetime\";\n\t};\n\n\t/**\n\t * Get the optimistic local subdirectory. This combines the sequenced data with\n\t * any pending changes that have not yet been sequenced. By default, we do not\n\t * consider disposed directories as optimistically existing, but if `getIfDisposed`\n\t * is true, we will include them since some scenarios require this.\n\t */\n\tprivate readonly getOptimisticSubDirectory = (\n\t\tsubdirName: string,\n\t\tgetIfDisposed: boolean = false,\n\t): SubDirectory | undefined => {\n\t\tconst latestPendingEntry = findLast(\n\t\t\tthis.pendingSubDirectoryData,\n\t\t\t(entry) => entry.subdirName === subdirName,\n\t\t);\n\t\tlet subdir: SubDirectory | undefined;\n\t\tif (latestPendingEntry === undefined) {\n\t\t\tsubdir = this._sequencedSubdirectories.get(subdirName);\n\t\t} else if (latestPendingEntry.type === \"createSubDirectory\") {\n\t\t\tsubdir = latestPendingEntry.subdir;\n\t\t\tassert(subdir !== undefined, 0xc2f /* Subdirectory should exist in pending data */);\n\t\t} else {\n\t\t\t// Pending delete\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// If the subdirectory is disposed, treat it as non-existent for optimistic reads (unless specified otherwise)\n\t\tif (subdir?.disposed && !getIfDisposed) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn subdir;\n\t};\n\n\t/**\n\t * Checks if this directory should be considered visible in the optimistic view.\n\t * This requires both:\n\t * 1. The directory object must not be disposed (disposed = true means fully deleted)\n\t * 2. The directory must be reachable via getWorkingDirectory (respects pending deletes)\n\t *\n\t * There's a timing window where a directory has a pending delete but is not yet disposed:\n\t * - When deleteSubDirectory is called locally, it adds a pending delete entry and emits a\n\t * \"dispose\" event, but doesn't set disposed = true yet.\n\t * - The directory only gets fully disposed when the delete message is sequenced.\n\t * - During this window, !disposed is true but getWorkingDirectory returns undefined.\n\t *\n\t * This method should be used before emitting events during remote message processing to ensure\n\t * events aren't emitted for directories that are invisible in the optimistic view.\n\t *\n\t * @returns true if this directory is visible in the optimistic view, false otherwise\n\t */\n\tprivate isNotDisposedAndReachable(): boolean {\n\t\treturn (\n\t\t\t!this.disposed && this.directory.getWorkingDirectory(this.absolutePath) !== undefined\n\t\t);\n\t}\n\n\tpublic get sequencedSubdirectories(): ReadonlyMap<string, SubDirectory> {\n\t\tthis.throwIfDisposed();\n\t\treturn this._sequencedSubdirectories;\n\t}\n\n\t/**\n\t * Process a clear operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tpublic processClearMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryClearOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: ClearLocalOpMetadata | undefined,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.subdir)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (local) {\n\t\t\tthis.sequencedStorageData.clear();\n\t\t\tconst pendingClear = this.pendingStorageData.shift();\n\t\t\tassert(\n\t\t\t\tpendingClear !== undefined &&\n\t\t\t\t\tpendingClear.type === \"clear\" &&\n\t\t\t\t\tpendingClear === localOpMetadata,\n\t\t\t\t0xc04 /* Got a local clear message we weren't expecting */,\n\t\t\t);\n\t\t} else {\n\t\t\t// For pending set operations, collect the previous values before clearing sequenced data\n\t\t\tconst pendingSets: { key: string; previousValue: unknown }[] = [];\n\t\t\tfor (const entry of this.pendingStorageData) {\n\t\t\t\tif (entry.type === \"lifetime\") {\n\t\t\t\t\tconst previousValue = this.sequencedStorageData.get(entry.key);\n\t\t\t\t\tpendingSets.push({ key: entry.key, previousValue });\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.sequencedStorageData.clear();\n\n\t\t\t// Only emit for remote ops, we would have already emitted for local ops. Only emit if there\n\t\t\t// is no optimistically-applied local pending clear that would supersede this remote clear.\n\t\t\t// Don't emit events if this directory has been disposed or no longer exists\n\t\t\tif (!this.pendingStorageData.some((entry) => entry.type === \"clear\")) {\n\t\t\t\tthis.directory.emit(\"clear\", local, this.directory);\n\t\t\t\tthis.directory.emit(\"clearInternal\", this.absolutePath, local, this.directory);\n\t\t\t}\n\n\t\t\t// For pending set operations, emit valueChanged events\n\t\t\t// Include 'path' so listeners can identify which subdirectory the change occurred in\n\t\t\tfor (const { key, previousValue } of pendingSets) {\n\t\t\t\t// Stop emitting events if this directory has been disposed or is no longer reachable\n\t\t\t\tif (!this.isNotDisposedAndReachable()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis.directory.emit(\n\t\t\t\t\t\"valueChanged\",\n\t\t\t\t\t{\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\t\tpreviousValue,\n\t\t\t\t\t},\n\t\t\t\t\tlocal,\n\t\t\t\t\tthis.directory,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process a delete operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tpublic processDeleteMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryDeleteOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: EditLocalOpMetadata | undefined,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.subdir)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tif (local) {\n\t\t\tconst pendingEntryIndex = this.pendingStorageData.findIndex(\n\t\t\t\t(entry) => entry.type !== \"clear\" && entry.key === op.key,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined &&\n\t\t\t\t\tpendingEntry.type === \"delete\" &&\n\t\t\t\t\tpendingEntry.key === op.key,\n\t\t\t\t0xc05 /* Got a local delete message we weren't expecting */,\n\t\t\t);\n\t\t\tthis.pendingStorageData.splice(pendingEntryIndex, 1);\n\t\t\tthis.sequencedStorageData.delete(op.key);\n\t\t} else {\n\t\t\tconst previousValue: unknown = this.sequencedStorageData.get(op.key);\n\t\t\tthis.sequencedStorageData.delete(op.key);\n\t\t\t// Suppress the event if local changes would cause the incoming change to be invisible optimistically.\n\t\t\tif (\n\t\t\t\tthis.isNotDisposedAndReachable() &&\n\t\t\t\t!this.pendingStorageData.some(\n\t\t\t\t\t(entry) => entry.type === \"clear\" || entry.key === op.key,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\tkey: op.key,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\tpreviousValue,\n\t\t\t\t};\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, local, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = { key: op.key, previousValue };\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, local, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process a set operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tpublic processSetMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectorySetOperation,\n\t\tvalue: unknown,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: EditLocalOpMetadata | undefined,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(msgEnvelope, localOpMetadata?.subdir)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { key } = op;\n\n\t\tif (local) {\n\t\t\tconst pendingEntryIndex = this.pendingStorageData.findIndex(\n\t\t\t\t(entry) => entry.type !== \"clear\" && entry.key === key,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined && pendingEntry.type === \"lifetime\",\n\t\t\t\t0xc06 /* Couldn't match local set message to pending lifetime */,\n\t\t\t);\n\t\t\tconst pendingKeySet = pendingEntry.keySets.shift();\n\t\t\tassert(\n\t\t\t\tpendingKeySet !== undefined && pendingKeySet === localOpMetadata,\n\t\t\t\t0xc07 /* Got a local set message we weren't expecting */,\n\t\t\t);\n\t\t\tif (pendingEntry.keySets.length === 0) {\n\t\t\t\tthis.pendingStorageData.splice(pendingEntryIndex, 1);\n\t\t\t}\n\t\t\tthis.sequencedStorageData.set(key, pendingKeySet.value);\n\t\t} else {\n\t\t\t// Get the previous value before setting the new value\n\t\t\tconst previousValue: unknown = this.sequencedStorageData.get(key);\n\t\t\tthis.sequencedStorageData.set(key, value);\n\n\t\t\t// Suppress the event if local changes would cause the incoming change to be invisible optimistically.\n\t\t\tif (\n\t\t\t\tthis.isNotDisposedAndReachable() &&\n\t\t\t\t!this.pendingStorageData.some((entry) => entry.type === \"clear\" || entry.key === key)\n\t\t\t) {\n\t\t\t\tconst event: IDirectoryValueChanged = { key, path: this.absolutePath, previousValue };\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, local, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = { key, previousValue };\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, local, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Process a create subdirectory operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t * @param clientSequenceNumber - The client sequence number of the message.\n\t */\n\tpublic processCreateSubDirectoryMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryCreateSubDirectoryOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: SubDirLocalOpMetadata | undefined,\n\t\tclientSequenceNumber: number,\n\t): void {\n\t\tthis.throwIfDisposed();\n\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(\n\t\t\t\tmsgEnvelope,\n\t\t\t\tlocalOpMetadata?.parentSubdir,\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tassertNonNullClientId(msgEnvelope.clientId);\n\n\t\tlet subDir: SubDirectory | undefined;\n\t\tif (local) {\n\t\t\tconst pendingEntryIndex = this.pendingSubDirectoryData.findIndex(\n\t\t\t\t(entry) => entry.subdirName === op.subdirName,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined && pendingEntry.type === \"createSubDirectory\",\n\t\t\t\t0xc30 /* Got a local subdir create message we weren't expecting */,\n\t\t\t);\n\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\t\t\tsubDir = pendingEntry.subdir;\n\n\t\t\tconst existingSubdir = this._sequencedSubdirectories.get(op.subdirName);\n\t\t\tif (existingSubdir !== undefined) {\n\t\t\t\t// If the subdirectory already exists, we don't need to create it again.\n\t\t\t\t// This can happen if remote clients also create the same subdir and we processed\n\t\t\t\t// that message first.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (subDir.disposed) {\n\t\t\t\tthis.undisposeSubdirectoryTree(subDir);\n\t\t\t}\n\n\t\t\tthis._sequencedSubdirectories.set(op.subdirName, subDir);\n\t\t} else {\n\t\t\tsubDir = this.getOptimisticSubDirectory(op.subdirName, true);\n\t\t\tif (subDir === undefined) {\n\t\t\t\tconst absolutePath = posix.join(this.absolutePath, op.subdirName);\n\t\t\t\tsubDir = new SubDirectory(\n\t\t\t\t\t{ seq: msgEnvelope.sequenceNumber, clientSeq: clientSequenceNumber },\n\t\t\t\t\tnew Set([msgEnvelope.clientId]),\n\t\t\t\t\tthis.directory,\n\t\t\t\t\tthis.runtime,\n\t\t\t\t\tthis.serializer,\n\t\t\t\t\tabsolutePath,\n\t\t\t\t\tthis.mc.logger,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// If the subdirectory already optimistically exists, we don't need to create it again.\n\t\t\t\t// This can happen if remote clients also created the same subdir.\n\t\t\t\tif (subDir.disposed) {\n\t\t\t\t\tthis.undisposeSubdirectoryTree(subDir);\n\t\t\t\t}\n\t\t\t\tsubDir.clientIds.add(msgEnvelope.clientId);\n\t\t\t}\n\t\t\tthis.registerEventsOnSubDirectory(subDir, op.subdirName);\n\t\t\tthis._sequencedSubdirectories.set(op.subdirName, subDir);\n\n\t\t\t// Suppress the event if local changes would cause the incoming change to be invisible optimistically.\n\t\t\tif (\n\t\t\t\t!this.pendingSubDirectoryData.some((entry) => entry.subdirName === op.subdirName) &&\n\t\t\t\tsubDir.isNotDisposedAndReachable()\n\t\t\t) {\n\t\t\t\tthis.emit(\"subDirectoryCreated\", op.subdirName, local, this);\n\t\t\t}\n\t\t}\n\n\t\t// Ensure correct seqData. This can be necessary if in scenarios where a subdir was created, deleted, and\n\t\t// then later recreated.\n\t\tif (\n\t\t\tthis.seqData.seq !== -1 &&\n\t\t\tthis.seqData.seq <= msgEnvelope.sequenceNumber &&\n\t\t\tsubDir.seqData.seq === -1\n\t\t) {\n\t\t\tsubDir.seqData.seq = msgEnvelope.sequenceNumber;\n\t\t\tsubDir.seqData.clientSeq = clientSequenceNumber;\n\t\t}\n\t}\n\n\t/**\n\t * Process a delete subdirectory operation.\n\t * @param msgEnvelope - The envelope of the message from the server to apply.\n\t * @param op - The op to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tpublic processDeleteSubDirectoryMessage(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\top: IDirectoryDeleteSubDirectoryOperation,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: SubDirLocalOpMetadata | undefined,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tif (\n\t\t\t!this.isMessageForCurrentInstanceOfSubDirectory(\n\t\t\t\tmsgEnvelope,\n\t\t\t\tlocalOpMetadata?.parentSubdir,\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousValue = this._sequencedSubdirectories.get(op.subdirName);\n\t\tif (previousValue === undefined) {\n\t\t\t// We are trying to delete a subdirectory that does not exist.\n\t\t\t// If this is a local delete, we should remove the pending delete entry.\n\t\t\t// This could happen if we already processed a remote delete op for\n\t\t\t// the same subdirectory.\n\t\t\tif (local) {\n\t\t\t\tconst pendingEntryIndex = this.pendingSubDirectoryData.findIndex(\n\t\t\t\t\t(entry) => entry.subdirName === op.subdirName,\n\t\t\t\t);\n\t\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\t\tassert(\n\t\t\t\t\tpendingEntry !== undefined &&\n\t\t\t\t\t\tpendingEntry.type === \"deleteSubDirectory\" &&\n\t\t\t\t\t\tpendingEntry.subdirName === op.subdirName,\n\t\t\t\t\t0xc31 /* Got a local deleteSubDirectory message we weren't expecting */,\n\t\t\t\t);\n\t\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tthis._sequencedSubdirectories.delete(op.subdirName);\n\t\tthis.disposeSubDirectoryTree(previousValue);\n\n\t\tif (local) {\n\t\t\tconst pendingEntryIndex = this.pendingSubDirectoryData.findIndex(\n\t\t\t\t(entry) => entry.subdirName === op.subdirName,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tassert(\n\t\t\t\tpendingEntry !== undefined &&\n\t\t\t\t\tpendingEntry.type === \"deleteSubDirectory\" &&\n\t\t\t\t\tpendingEntry.subdirName === op.subdirName,\n\t\t\t\t0xc32 /* Got a local deleteSubDirectory message we weren't expecting */,\n\t\t\t);\n\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\t\t} else {\n\t\t\t// Suppress the event if local changes would cause the incoming change to be invisible optimistically.\n\t\t\tconst pendingEntryIndex = this.pendingSubDirectoryData.findIndex(\n\t\t\t\t(entry) => entry.subdirName === op.subdirName && entry.type === \"deleteSubDirectory\",\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tif (pendingEntry === undefined) {\n\t\t\t\tthis.emit(\"subDirectoryDeleted\", op.subdirName, local, this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Submit a clear operation.\n\t * @param op - The operation\n\t * @param localOpMetadata - The pending operation metadata\n\t */\n\tprivate submitClearMessage(\n\t\top: IDirectoryClearOperation,\n\t\tlocalOpMetadata: ClearLocalOpMetadata,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tthis.directory.submitDirectoryMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * Resubmit a clear operation.\n\t * @param op - The operation\n\t */\n\tpublic resubmitClearMessage(\n\t\top: IDirectoryClearOperation,\n\t\tlocalOpMetadata: ClearLocalOpMetadata,\n\t): void {\n\t\t// Only submit the op, if we have record for it, otherwise it is possible that the older instance\n\t\t// is already deleted, in which case we don't need to submit the op.\n\t\tconst pendingEntryIndex = this.pendingStorageData.findIndex(\n\t\t\t(entry) => entry.type === \"clear\",\n\t\t);\n\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\tif (pendingEntry !== undefined) {\n\t\t\tthis.submitClearMessage(op, localOpMetadata);\n\t\t}\n\t}\n\n\t/**\n\t * Submit a key operation.\n\t * @param op - The operation\n\t * @param localOpMetadata - The pending operation metadata\n\t */\n\tprivate submitKeyMessage(\n\t\top: IDirectoryKeyOperation,\n\t\tlocalOpMetadata: PendingKeySet | PendingKeyDelete,\n\t): void {\n\t\tthis.throwIfDisposed();\n\t\tthis.directory.submitDirectoryMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * Submit a key message to remote clients based on a previous submit.\n\t * @param op - The map key message\n\t * @param localOpMetadata - Metadata from the previous submit\n\t */\n\tpublic resubmitKeyMessage(\n\t\top: IDirectoryKeyOperation,\n\t\tlocalOpMetadata: EditLocalOpMetadata,\n\t): void {\n\t\t// Only submit the op, if we have record for it, otherwise it is possible that the older instance\n\t\t// is already deleted, in which case we don't need to submit the op.\n\t\tconst pendingEntryIndex = this.pendingStorageData.findIndex((entry) => {\n\t\t\treturn op.type === \"set\"\n\t\t\t\t? entry.type === \"lifetime\" &&\n\t\t\t\t\t\tentry.key === op.key &&\n\t\t\t\t\t\t// We also check that the keySets include the localOpMetadata. It's possible we have new\n\t\t\t\t\t\t// pending key sets that are not the op we are looking for.\n\t\t\t\t\t\tentry.keySets.includes(localOpMetadata as PendingKeySet)\n\t\t\t\t: entry.type === \"delete\" && entry.key === op.key;\n\t\t});\n\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\tif (pendingEntry !== undefined) {\n\t\t\tthis.submitKeyMessage(op, localOpMetadata as PendingKeySet | PendingKeyDelete);\n\t\t}\n\t}\n\t/**\n\t * Submit a create subdirectory operation.\n\t * @param op - The operation\n\t */\n\tprivate submitCreateSubDirectoryMessage(op: IDirectorySubDirectoryOperation): void {\n\t\tconst localOpMetadata: ICreateSubDirLocalOpMetadata = {\n\t\t\ttype: \"createSubDir\",\n\t\t\tparentSubdir: this,\n\t\t};\n\t\tthis.directory.submitDirectoryMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * Submit a delete subdirectory operation.\n\t * @param op - The operation\n\t * @param subDir - Any subdirectory deleted by the op\n\t */\n\tprivate submitDeleteSubDirectoryMessage(\n\t\top: IDirectorySubDirectoryOperation,\n\t\tsubDir: SubDirectory,\n\t): void {\n\t\tconst localOpMetadata: IDeleteSubDirLocalOpMetadata = {\n\t\t\ttype: \"deleteSubDir\",\n\t\t\tsubDirectory: subDir,\n\t\t\tparentSubdir: this,\n\t\t};\n\t\tthis.directory.submitDirectoryMessage(op, localOpMetadata);\n\t}\n\n\t/**\n\t * Submit a subdirectory operation again\n\t * @param op - The operation\n\t * @param localOpMetadata - metadata submitted with the op originally\n\t */\n\tpublic resubmitSubDirectoryMessage(\n\t\top: IDirectorySubDirectoryOperation,\n\t\tlocalOpMetadata: SubDirLocalOpMetadata,\n\t): void {\n\t\t// Only submit the op, if we have record for it, otherwise it is possible that the older instance\n\t\t// is already deleted, in which case we don't need to submit the op.\n\t\tif (localOpMetadata.type === \"createSubDir\") {\n\t\t\t// For create operations, look specifically for createSubDirectory entries\n\t\t\tconst pendingEntry = findLast(\n\t\t\t\tthis.pendingSubDirectoryData,\n\t\t\t\t(entry) => entry.subdirName === op.subdirName && entry.type === \"createSubDirectory\",\n\t\t\t);\n\t\t\tif (pendingEntry !== undefined) {\n\t\t\t\tassert(\n\t\t\t\t\tpendingEntry.type === \"createSubDirectory\",\n\t\t\t\t\t0xc33 /* pending entry should be createSubDirectory */,\n\t\t\t\t);\n\t\t\t\t// We should add the client id, since when reconnecting it can have a different client id.\n\t\t\t\tpendingEntry.subdir.clientIds.add(this.runtime.clientId ?? \"detached\");\n\t\t\t\t// We also need to undelete the subdirectory tree if it was previously deleted\n\t\t\t\tthis.undisposeSubdirectoryTree(pendingEntry.subdir);\n\t\t\t\tthis.submitCreateSubDirectoryMessage(op);\n\t\t\t}\n\t\t} else if (localOpMetadata.type === \"deleteSubDir\") {\n\t\t\tassert(\n\t\t\t\tlocalOpMetadata.subDirectory !== undefined,\n\t\t\t\t0xc34 /* Subdirectory should exist */,\n\t\t\t);\n\t\t\t// For delete operations, look specifically for deleteSubDirectory entries\n\t\t\tconst pendingEntry = findLast(\n\t\t\t\tthis.pendingSubDirectoryData,\n\t\t\t\t(entry) => entry.subdirName === op.subdirName && entry.type === \"deleteSubDirectory\",\n\t\t\t);\n\t\t\tif (pendingEntry !== undefined) {\n\t\t\t\tthis.submitDeleteSubDirectoryMessage(op, localOpMetadata.subDirectory);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Get the storage of this subdirectory in a serializable format, to be used in snapshotting.\n\t * @param serializer - The serializer to use to serialize handles in its values.\n\t * @returns The JSONable string representing the storage of this subdirectory\n\t */\n\tpublic *getSerializedStorage(\n\t\tserializer: IFluidSerializer,\n\t): Generator<[string, ISerializedValue], void> {\n\t\tthis.throwIfDisposed();\n\t\tfor (const [key, value] of this.sequencedStorageData.entries()) {\n\t\t\tconst serializedValue = serializeValue(value, serializer, this.directory.handle);\n\t\t\tconst res: [string, ISerializedValue] = [key, serializedValue];\n\t\t\tyield res;\n\t\t}\n\t}\n\n\tpublic getSerializableCreateInfo(): ICreateInfo {\n\t\tthis.throwIfDisposed();\n\t\tconst createInfo: ICreateInfo = {\n\t\t\tcsn: this.seqData.seq,\n\t\t\tccIds: [...this.clientIds],\n\t\t};\n\t\treturn createInfo;\n\t}\n\n\t/**\n\t * Populate a key value in this subdirectory's storage, to be used when loading from snapshot.\n\t * @param key - The key to populate\n\t * @param localValue - The local value to populate into it\n\t */\n\tpublic populateStorage(key: string, value: unknown): void {\n\t\tthis.throwIfDisposed();\n\t\tthis.sequencedStorageData.set(key, value);\n\t}\n\n\t/**\n\t * Populate a subdirectory into this subdirectory, to be used when loading from snapshot.\n\t * @param subdirName - The name of the subdirectory to add\n\t * @param newSubDir - The new subdirectory to add\n\t */\n\tpublic populateSubDirectory(subdirName: string, newSubDir: SubDirectory): void {\n\t\tthis.throwIfDisposed();\n\t\tthis.registerEventsOnSubDirectory(newSubDir, subdirName);\n\t\tthis._sequencedSubdirectories.set(subdirName, newSubDir);\n\t}\n\n\t/**\n\t * Rollback a local op\n\t * @param op - The operation to rollback\n\t * @param localOpMetadata - The local metadata associated with the op.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic rollback(op: any, localOpMetadata: DirectoryLocalOpMetadata): void {\n\t\tconst directoryOp = op as IDirectoryOperation;\n\n\t\tif (directoryOp.type === \"clear\") {\n\t\t\t// A pending clear will be last in the list, since it terminates all prior lifetimes.\n\t\t\tconst pendingClear = this.pendingStorageData.pop();\n\t\t\tif (pendingClear === undefined) {\n\t\t\t\t// If we can't find a pending entry then it's possible that we deleted an ack'd subdir\n\t\t\t\t// from a remote delete subdir op. If that's the case then there is nothing to rollback\n\t\t\t\t// since the pending data was removed with the subdirectory deletion.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tassert(\n\t\t\t\tpendingClear.type === \"clear\" && localOpMetadata.type === \"clear\",\n\t\t\t\t0xc35 /* Unexpected clear rollback */,\n\t\t\t);\n\t\t\tfor (const [key] of this.internalIterator()) {\n\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\tkey,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\tpreviousValue: undefined,\n\t\t\t\t};\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = { key, previousValue: undefined };\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\t}\n\t\t} else if (\n\t\t\t(directoryOp.type === \"delete\" || directoryOp.type === \"set\") &&\n\t\t\t(localOpMetadata.type === \"set\" || localOpMetadata.type === \"delete\")\n\t\t) {\n\t\t\t// A pending set/delete may not be last in the list, as the lifetimes' order is based on when\n\t\t\t// they were created, not when they were last modified.\n\t\t\tconst pendingEntryIndex = findLastIndex(\n\t\t\t\tthis.pendingStorageData,\n\t\t\t\t(entry) => entry.type !== \"clear\" && entry.key === directoryOp.key,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingStorageData[pendingEntryIndex];\n\t\t\tif (pendingEntry === undefined) {\n\t\t\t\t// If we can't find a pending entry then it's possible that we deleted an ack'd subdir\n\t\t\t\t// from a remote delete subdir op. If that's the case then there is nothing to rollback\n\t\t\t\t// since the pending data was removed with the subdirectory deletion.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tassert(\n\t\t\t\tpendingEntry.type === \"delete\" || pendingEntry.type === \"lifetime\",\n\t\t\t\t0xc36 /* Unexpected pending data for set/delete op */,\n\t\t\t);\n\t\t\tif (pendingEntry.type === \"delete\") {\n\t\t\t\tassert(pendingEntry === localOpMetadata, 0xc0b /* Unexpected delete rollback */);\n\t\t\t\tthis.pendingStorageData.splice(pendingEntryIndex, 1);\n\t\t\t\t// Only emit if rolling back the delete actually results in a value becoming visible.\n\t\t\t\tif (this.getOptimisticValue(directoryOp.key) !== undefined) {\n\t\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\t\tkey: directoryOp.key,\n\t\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\t\tpreviousValue: undefined,\n\t\t\t\t\t};\n\t\t\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\t\t\tkey: directoryOp.key,\n\t\t\t\t\t\tpreviousValue: undefined,\n\t\t\t\t\t};\n\t\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\t\t}\n\t\t\t} else if (pendingEntry.type === \"lifetime\") {\n\t\t\t\tconst pendingKeySet = pendingEntry.keySets.pop();\n\t\t\t\tassert(\n\t\t\t\t\tpendingKeySet !== undefined && pendingKeySet === localOpMetadata,\n\t\t\t\t\t0xc0c /* Unexpected set rollback */,\n\t\t\t\t);\n\t\t\t\tif (pendingEntry.keySets.length === 0) {\n\t\t\t\t\tthis.pendingStorageData.splice(pendingEntryIndex, 1);\n\t\t\t\t}\n\t\t\t\tconst event: IDirectoryValueChanged = {\n\t\t\t\t\tkey: directoryOp.key,\n\t\t\t\t\tpath: this.absolutePath,\n\t\t\t\t\tpreviousValue: pendingKeySet.value,\n\t\t\t\t};\n\t\t\t\tthis.directory.emit(\"valueChanged\", event, true, this.directory);\n\t\t\t\tconst containedEvent: IValueChanged = {\n\t\t\t\t\tkey: directoryOp.key,\n\t\t\t\t\tpreviousValue: pendingKeySet.value,\n\t\t\t\t};\n\t\t\t\tthis.emit(\"containedValueChanged\", containedEvent, true, this);\n\t\t\t}\n\t\t} else if (\n\t\t\tdirectoryOp.type === \"createSubDirectory\" &&\n\t\t\tlocalOpMetadata.type === \"createSubDir\"\n\t\t) {\n\t\t\tconst subdirName = directoryOp.subdirName;\n\n\t\t\tconst pendingEntryIndex = findLastIndex(\n\t\t\t\tthis.pendingSubDirectoryData,\n\t\t\t\t(entry) => entry.type === \"createSubDirectory\" && entry.subdirName === subdirName,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tif (pendingEntry === undefined) {\n\t\t\t\t// If we can't find a pending entry then it's likely we deleted and re-created this\n\t\t\t\t// subdirectory from a remote delete subdir op. If that's the case then there is\n\t\t\t\t// nothing to rollback since the pending data was removed with the subdirectory deletion.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tassert(\n\t\t\t\tpendingEntry.type === \"createSubDirectory\",\n\t\t\t\t0xc71 /* Unexpected pending data for createSubDirectory op */,\n\t\t\t);\n\n\t\t\t// We still need to emit the disposed event for any locally created (and now\n\t\t\t// rolled back) subdirectory trees so listeners can observer the lifecycle\n\t\t\t// changes properly. We don't want to fully delete in case there is another\n\t\t\t// operation that references the same subdirectory.\n\t\t\tthis.emitDisposeForSubdirTree(pendingEntry.subdir);\n\n\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\t\t\tthis.emit(\"subDirectoryDeleted\", subdirName, true, this);\n\t\t} else if (\n\t\t\tdirectoryOp.type === \"deleteSubDirectory\" &&\n\t\t\tlocalOpMetadata.type === \"deleteSubDir\"\n\t\t) {\n\t\t\tconst subdirName = directoryOp.subdirName;\n\n\t\t\tconst pendingEntryIndex = findLastIndex(\n\t\t\t\tthis.pendingSubDirectoryData,\n\t\t\t\t(entry) => entry.type === \"deleteSubDirectory\" && entry.subdirName === subdirName,\n\t\t\t);\n\t\t\tconst pendingEntry = this.pendingSubDirectoryData[pendingEntryIndex];\n\t\t\tif (pendingEntry === undefined) {\n\t\t\t\t// If we can't find a pending entry then it's likely we deleted and re-created this\n\t\t\t\t// subdirectory from a remote delete subdir op. If that's the case then there is\n\t\t\t\t// nothing to rollback since the pending data was removed with the subdirectory deletion.\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tassert(\n\t\t\t\tpendingEntry.type === \"deleteSubDirectory\",\n\t\t\t\t0xc72 /* Unexpected pending data for deleteSubDirectory op */,\n\t\t\t);\n\t\t\tthis.pendingSubDirectoryData.splice(pendingEntryIndex, 1);\n\n\t\t\t// Restore the subdirectory\n\t\t\tconst subDirectoryToRestore = localOpMetadata.subDirectory;\n\t\t\tassert(subDirectoryToRestore !== undefined, 0xc39 /* Subdirectory should exist */);\n\t\t\t// Recursively undispose all nested subdirectories before adding to the map\n\t\t\t// This ensures the subdirectory is properly restored before being exposed\n\t\t\tthis.undisposeSubdirectoryTree(subDirectoryToRestore);\n\t\t\t// Re-register events\n\t\t\tthis.registerEventsOnSubDirectory(subDirectoryToRestore, subdirName);\n\t\t\tthis.emit(\"subDirectoryCreated\", subdirName, true, this);\n\t\t} else {\n\t\t\tthrow new Error(\"Unsupported op for rollback\");\n\t\t}\n\t}\n\n\t/**\n\t * Converts the given relative path into an absolute path.\n\t * @param path - Relative path to convert\n\t * @returns The equivalent absolute path\n\t */\n\tprivate makeAbsolute(relativePath: string): string {\n\t\treturn posix.resolve(this.absolutePath, relativePath);\n\t}\n\n\t/**\n\t * This return true if the message is for the current instance of this sub directory. As the sub directory\n\t * can be deleted and created again, then this finds if the message is for current instance of directory or not.\n\t * @param msgEnvelope - message envelope for the directory\n\t * @param targetSubdir - subdirectory instance we are targeting from local op metadata (if a local op)\n\t */\n\tprivate isMessageForCurrentInstanceOfSubDirectory(\n\t\tmsgEnvelope: ISequencedMessageEnvelope,\n\t\ttargetSubdir?: SubDirectory | undefined,\n\t): boolean {\n\t\t// The message must be from this instance of the directory (if a local op) AND one of the following must be true:\n\t\t// 1. The message was from the creator of this directory\n\t\t// 2. This directory was created while detached\n\t\t// 3. This directory was already live (known to other clients) and the op was created after the directory was created.\n\t\treturn (\n\t\t\t(targetSubdir === undefined || targetSubdir === this) &&\n\t\t\t((msgEnvelope.clientId !== null && this.clientIds.has(msgEnvelope.clientId)) ||\n\t\t\t\tthis.clientIds.has(\"detached\") ||\n\t\t\t\t(this.seqData.seq !== -1 && this.seqData.seq <= msgEnvelope.referenceSequenceNumber))\n\t\t);\n\t}\n\n\tprivate registerEventsOnSubDirectory(subDirectory: SubDirectory, subDirName: string): void {\n\t\tsubDirectory.on(\"subDirectoryCreated\", (relativePath: string, local: boolean) => {\n\t\t\tthis.emit(\"subDirectoryCreated\", posix.join(subDirName, relativePath), local, this);\n\t\t});\n\t\tsubDirectory.on(\"subDirectoryDeleted\", (relativePath: string, local: boolean) => {\n\t\t\tthis.emit(\"subDirectoryDeleted\", posix.join(subDirName, relativePath), local, this);\n\t\t});\n\t}\n\n\tprivate disposeSubDirectoryTree(directory: SubDirectory | undefined): void {\n\t\tif (directory === undefined) {\n\t\t\treturn;\n\t\t}\n\t\t// Dispose the subdirectory tree. This will dispose the subdirectories from bottom to top.\n\t\tconst subDirectories = directory.subdirectories();\n\t\tfor (const [_, subDirectory] of subDirectories) {\n\t\t\tthis.disposeSubDirectoryTree(subDirectory as SubDirectory);\n\t\t}\n\n\t\t// We need to reset the sequenced data as the previous directory is getting deleted and we will\n\t\t// initialize again when we will receive op for the create again.\n\t\tdirectory.clearSubDirectorySequencedData();\n\n\t\tdirectory.dispose();\n\t}\n\n\tprivate emitDisposeForSubdirTree(directory: SubDirectory): void {\n\t\tif (directory === undefined || directory.disposed) {\n\t\t\treturn;\n\t\t}\n\t\t// Dispose the subdirectory tree. This will dispose the subdirectories from bottom to top.\n\t\tconst subDirectories = directory.subdirectories();\n\t\tfor (const [_, subDirectory] of subDirectories) {\n\t\t\tthis.emitDisposeForSubdirTree(subDirectory as SubDirectory);\n\t\t}\n\n\t\tif (typeof directory.dispose === \"function\") {\n\t\t\tdirectory.emit(\"disposed\", directory);\n\t\t}\n\t}\n\n\tprivate undisposeSubdirectoryTree(directory: SubDirectory): void {\n\t\t// This will unmark \"deleted\" from the subdirectories from bottom to top.\n\t\tfor (const [_, subDirectory] of directory.getSubdirectoriesEvenIfDisposed()) {\n\t\t\tthis.undisposeSubdirectoryTree(subDirectory as SubDirectory);\n\t\t}\n\t\tdirectory.undispose();\n\t}\n\n\t/**\n\t * Similar to {@link subdirectories}, but also includes subdirectories that are disposed.\n\t */\n\tprivate getSubdirectoriesEvenIfDisposed(): IterableIterator<[string, IDirectory]> {\n\t\tconst sequencedSubdirs: [string, SubDirectory][] = [];\n\t\tconst sequencedSubdirNames = new Set([...this._sequencedSubdirectories.keys()]);\n\t\tfor (const subdirName of sequencedSubdirNames) {\n\t\t\tconst optimisticSubdir = this.getOptimisticSubDirectory(subdirName, true);\n\t\t\tif (optimisticSubdir !== undefined) {\n\t\t\t\tsequencedSubdirs.push([subdirName, optimisticSubdir]);\n\t\t\t}\n\t\t}\n\n\t\tconst pendingSubdirNames = [\n\t\t\t...new Set(\n\t\t\t\tthis.pendingSubDirectoryData\n\t\t\t\t\t.map((entry) => entry.subdirName)\n\t\t\t\t\t.filter((subdirName) => !sequencedSubdirNames.has(subdirName)),\n\t\t\t),\n\t\t];\n\t\tconst pendingSubdirs: [string, SubDirectory][] = [];\n\t\tfor (const subdirName of pendingSubdirNames) {\n\t\t\tconst optimisticSubdir = this.getOptimisticSubDirectory(subdirName, true);\n\t\t\tif (optimisticSubdir !== undefined) {\n\t\t\t\tpendingSubdirs.push([subdirName, optimisticSubdir]);\n\t\t\t}\n\t\t}\n\n\t\tconst allSubdirs = [...sequencedSubdirs, ...pendingSubdirs];\n\n\t\tconst orderedSubdirs = allSubdirs.sort((a, b) => {\n\t\t\tconst aSeqData = a[1].seqData;\n\t\t\tconst bSeqData = b[1].seqData;\n\t\t\tassert(\n\t\t\t\taSeqData !== undefined && bSeqData !== undefined,\n\t\t\t\t0xc3a /* seqData should be defined */,\n\t\t\t);\n\t\t\treturn seqDataComparator(aSeqData, bSeqData);\n\t\t});\n\n\t\treturn orderedSubdirs[Symbol.iterator]();\n\t}\n\n\t/**\n\t * Clears the sequenced data of a subdirectory but notably retains the pending\n\t * storage data. This is done when disposing of a directory so if we need to\n\t * re-create it, then we still have the pending ops.\n\t */\n\tpublic clearSubDirectorySequencedData(): void {\n\t\tthis.seqData.seq = -1;\n\t\tthis.seqData.clientSeq = -1;\n\t\tthis.sequencedStorageData.clear();\n\t\tthis._sequencedSubdirectories.clear();\n\t\tthis.clientIds.clear();\n\t\tthis.clientIds.add(this.runtime.clientId ?? \"detached\");\n\t}\n}\n"]}