@carbonenginejs/runtime-resource 0.11.1 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CjsResMan.js +4 -4
- package/dist/CjsResMan.js.map +1 -1
- package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -4
- package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/dist/format/CjsByteReader.js +310 -0
- package/dist/format/CjsByteReader.js.map +1 -0
- package/dist/format/CjsByteWriter.js +242 -0
- package/dist/format/CjsByteWriter.js.map +1 -0
- package/dist/format/CjsFormatError.js +41 -0
- package/dist/format/CjsFormatError.js.map +1 -0
- package/dist/format/CjsStringTable.js +268 -0
- package/dist/format/CjsStringTable.js.map +1 -0
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js +361 -0
- package/dist/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -0
- package/dist/format/carbonEffect/CjsCarbonEffectWriter.js +373 -0
- package/dist/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -0
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js +372 -0
- package/dist/format/carbonEffect/carbonDescriptionFromPortable.js.map +1 -0
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js +427 -0
- package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -0
- package/dist/format/carbonEffect/carbonEffectRecords.js +955 -0
- package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -0
- package/dist/format/compareUtf8.js +36 -0
- package/dist/format/compareUtf8.js.map +1 -0
- package/dist/format/index.js +11 -0
- package/dist/format/index.js.map +1 -0
- package/dist/formats/bnk/CjsBnkFormat.js +18 -2
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/eventAction.js +305 -0
- package/dist/formats/bnk/core/eventAction.js.map +1 -0
- package/dist/formats/bnk/core/graph.js +3 -6
- package/dist/formats/bnk/core/graph.js.map +1 -1
- package/dist/formats/bnk/core/helpers.js +62 -11
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/bnk/core/nodeBase.js +532 -0
- package/dist/formats/bnk/core/nodeBase.js.map +1 -0
- package/dist/formats/bnk/core/sfxNodes.js +632 -0
- package/dist/formats/bnk/core/sfxNodes.js.map +1 -0
- package/dist/formats/bnk/core/soundbanksInfo.js +59 -51
- package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -1
- package/dist/formats/gr2/CjsGr2Format.js +256 -13
- package/dist/formats/gr2/CjsGr2Format.js.map +1 -1
- package/dist/formats/gr2/core/helpers.js +15 -15
- package/dist/formats/gr2/core/helpers.js.map +1 -1
- package/dist/formats/gr2/core/json.js +1 -1
- package/dist/formats/gr2/core/json.js.map +1 -1
- package/dist/formats/gr2/core/targets.js +1 -1
- package/dist/formats/gr2/core/targets.js.map +1 -1
- package/dist/formats/gr2/index.js +0 -1
- package/dist/formats/gr2/index.js.map +1 -1
- package/dist/formats/hlsl/core/HlslReader.js +7 -257
- package/dist/formats/hlsl/core/HlslReader.js.map +1 -1
- package/dist/formats/hlsl/core/analysis.js +1 -1
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +781 -0
- package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +21 -1
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -1
- package/dist/formats/hlsl/index.js +1 -0
- package/dist/formats/hlsl/index.js.map +1 -1
- package/dist/formats/index.js +3 -6
- package/dist/formats/index.js.map +1 -1
- package/dist/formats/webgl/core/cewg/CewgPackage.js +2 -1
- package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -1
- package/dist/formats/webgl/core/cewg/binary.js +11 -93
- package/dist/formats/webgl/core/cewg/binary.js.map +1 -1
- package/dist/formats/webgl/core/effectPackage.js +4 -1
- package/dist/formats/webgl/core/effectPackage.js.map +1 -1
- package/dist/formats/webgl/core/errors.js +3 -3
- package/dist/formats/webgl/core/errors.js.map +1 -1
- package/dist/formats/webgpu/CjsWebgpuFormat.js +4 -23
- package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +197 -0
- package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js +368 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/containerViews.js +355 -0
- package/dist/formats/webgpu/core/cewgpu/containerViews.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/validateContainer.js +90 -0
- package/dist/formats/webgpu/core/cewgpu/validateContainer.js.map +1 -0
- package/dist/formats/webgpu/core/effectBackendBodySet.js +21 -20
- package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
- package/dist/formats/webgpu/core/helpers.js +87 -92
- package/dist/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +14 -13
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -1
- package/dist/formats/webgpu/core/ir/inferValueTypes.js +10 -8
- package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -1
- package/dist/formats/webgpu/core/packageEffect.js +94 -9
- package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
- package/dist/formats/webgpu/core/packageMetadata.js +10 -1
- package/dist/formats/webgpu/core/packageMetadata.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +17 -15
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +13 -12
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +9 -8
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +23 -22
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -1
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js +46 -44
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -1
- package/dist/resource/CjsResource.js +700 -684
- package/dist/resource/CjsResource.js.map +1 -1
- package/dist/resource/Tr2LightProfileRes.js +18 -27
- package/dist/resource/Tr2LightProfileRes.js.map +1 -1
- package/dist/resource/audio/CjsAudioBufferRes.js +2 -2
- package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -1
- package/dist/resource/audio/CjsAudioRes.js +2 -2
- package/dist/resource/audio/CjsAudioRes.js.map +1 -1
- package/dist/resource/geometry/TriGeometryRes.js +605 -586
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +21 -30
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
- package/dist/resource/geometry/granny/TriGrannyRes.js +21 -30
- package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
- package/dist/resource/shader/Tr2EffectRes.js +9 -7
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialArea.js +5 -3
- package/dist/resource/shader/Tr2MaterialArea.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialMesh.js +4 -2
- package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -1
- package/dist/resource/shader/Tr2MaterialRes.js +5 -3
- package/dist/resource/shader/Tr2MaterialRes.js.map +1 -1
- package/dist/resource/shader/Tr2Shader.js +26 -21
- package/dist/resource/shader/Tr2Shader.js.map +1 -1
- package/dist/resource/shader/Tr2ShaderPermutation.js +8 -6
- package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDefine.js +5 -3
- package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +5 -3
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +17 -15
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +11 -9
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +8 -6
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +15 -13
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +7 -5
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +11 -9
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +8 -6
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayRes.js +400 -411
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
- package/dist/resource/texture/Tr2ImageRes.js +99 -95
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
- package/dist/resource/texture/TriTextureRes.js +312 -273
- package/dist/resource/texture/TriTextureRes.js.map +1 -1
- package/docs/README.md +13 -1
- package/docs/architecture.md +3 -3
- package/docs/concepts/resource-lifecycle.md +9 -2
- package/docs/concepts/shader-resource-model.md +114 -0
- package/docs/concepts/writing-an-engine-adapter.md +115 -0
- package/docs/formats/README.md +24 -1
- package/docs/formats/carbon-effect-container.md +452 -0
- package/docs/formats/dxbc/README.md +68 -0
- package/docs/formats/dxbc/architecture.md +80 -0
- package/docs/formats/dxbc/reference/api.md +77 -0
- package/docs/formats/dxbc/reference/classes/README.md +9 -0
- package/docs/formats/dxbc/reference/decoded-output.md +122 -0
- package/docs/formats/gr2.md +3 -4
- package/docs/formats/hlsl/README.md +54 -0
- package/docs/formats/hlsl/architecture.md +67 -0
- package/docs/formats/hlsl/guides/hydrating-json-output.md +62 -0
- package/docs/formats/hlsl/guides/reading-effects.md +64 -0
- package/docs/formats/hlsl/reference/advanced-analysis.md +66 -0
- package/docs/formats/hlsl/reference/api.md +98 -0
- package/docs/formats/hlsl/reference/classes/README.md +11 -0
- package/docs/formats/hlsl/reference/json-graph.md +100 -0
- package/docs/formats/hlsl/reference/portable-reflection.md +141 -0
- package/docs/formats/provenance.md +32 -17
- package/docs/formats/webgl/README.md +57 -0
- package/docs/formats/webgl/architecture.md +70 -0
- package/docs/formats/webgl/carbon-constant-layouts.md +326 -0
- package/docs/formats/webgl/decl-io.md +1234 -0
- package/docs/formats/webgl/effect-reflection.md +127 -0
- package/docs/formats/webgl/memory-structured.md +871 -0
- package/docs/formats/webgl/reference/classes/README.md +9 -0
- package/docs/formats/webgl/texture-sample.md +964 -0
- package/docs/formats/webgpu/README.md +84 -0
- package/docs/formats/webgpu/architecture.md +96 -0
- package/docs/formats/webgpu/formats/cewgpu.md +216 -0
- package/docs/formats/webgpu/guides/effect-packaging.md +191 -0
- package/docs/formats/webgpu/reference/api.md +197 -0
- package/docs/formats/webgpu/reference/classes/README.md +9 -0
- package/docs/formats/webgpu/reference/wgsl-compatibility.md +1543 -0
- package/docs/formats/wwise.md +45 -4
- package/docs/reference/classes/core.md +80 -0
- package/docs/reference/classes/formats.md +24 -34
- package/docs/reference/events.md +25 -0
- package/docs/reference/motherlode-cache.md +22 -8
- package/docs/reference/workers.md +5 -5
- package/docs/roadmap.md +61 -41
- package/format-notices/bnk/NOTICE +5 -4
- package/format-notices/webgl/NOTICE +1 -1
- package/package.json +2 -1
- package/dist/formats/gr2/core/CjsFormatGr2.js +0 -273
- package/dist/formats/gr2/core/CjsFormatGr2.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +0 -415
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +0 -100
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/binary.js +0 -93
- package/dist/formats/webgpu/core/cewgpu/binary.js.map +0 -1
- package/dist/formats/webgpu/core/cewgpu/tags.js +0 -17
- package/dist/formats/webgpu/core/cewgpu/tags.js.map +0 -1
- package/dist/formats/webgpu/core/effectPackageValidation.js +0 -1078
- package/dist/formats/webgpu/core/effectPackageValidation.js.map +0 -1
package/dist/CjsResMan.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CjsResMan.js","sources":["../../src/CjsResMan.js"],"sourcesContent":["import { CjsMotherLode, getMotherLodeKey } from \"./CjsMotherLode.js\";\nimport { CjsEventEmitter } from \"@carbonenginejs/runtime-utils/model\";\nimport { hasOwnThen } from \"@carbonenginejs/runtime-utils/object\";\nimport {\n getResourceExtension,\n normalizePath,\n normalizeResourceExtension,\n normalizeResourcePath\n} from \"@carbonenginejs/runtime-utils/path\";\nimport { CjsResource } from \"./resource/CjsResource.js\";\nimport {\n CjsResManQueue,\n CjsResManWorkQueue\n} from \"./CjsResManWorkQueue.js\";\nimport {\n CjsResManMainThreadLoader\n} from \"./worker/CjsResManMainThreadLoader.js\";\nimport {\n CjsResManWorkerLoader\n} from \"./worker/CjsResManWorkerLoader.js\";\n/** @type {WeakMap<object, CjsResourceReadContext>} */\nconst READ_CONTEXTS = new WeakMap();\n\n/** Small request fields retained only so a released payload can be rebuilt. */\nconst RESOURCE_REQUEST_OPTION_KEYS = Object.freeze([\n \"variant\",\n \"requirement\",\n \"payload\",\n \"emit\",\n \"mediaType\",\n \"format\",\n \"classes\",\n \"formatOptions\"\n]);\n\n/** Requested-output fields pinned by a bound resource handle. */\nconst RESOURCE_OUTPUT_OPTION_KEYS = Object.freeze([\n \"variant\",\n \"emit\",\n \"requirement\",\n \"payload\"\n]);\n\n/** Source provenance retained by a bound resource handle when present. */\nconst RESOURCE_PROVENANCE_OPTION_KEYS = Object.freeze([\n \"source\",\n \"sourceRevision\",\n \"ext\"\n]);\n\n/** Process-local tokens used only by parsed-format operation caching. */\nconst LOCAL_VALUE_IDENTITIES = new WeakMap();\nlet nextLocalValueIdentity = 1;\n\n/**\n * Immutable source provenance used by one read/format operation chain.\n *\n * `sourceRevision` is caller/source-provided opaque content identity. It scopes\n * read caches only and never becomes part of MotherLode resource identity.\n *\n * @typedef {object} CjsResourceReadContext\n * @property {CjsResMan} resMan Owning manager.\n * @property {object|Function} source Selected source implementation.\n * @property {string} path Normalized Carbon-style source path.\n * @property {string} sourcePath Resource path or URL passed to the selected source.\n * @property {string|number|undefined} sourceRevision Caller content token.\n * @property {string} revisionKey Type-stable internal form of the content token.\n */\n\n/**\n * Mutable record retained in a source or format operation ledger.\n *\n * @typedef {object} CjsResourceReadOperationRecord\n * @property {Promise<*>} promise Shared operation promise.\n * @property {string} path Normalized source path used for explicit invalidation.\n * @property {string} revisionKey Type-stable source revision key.\n * @property {boolean} retain Whether any joined caller requested settled retention.\n */\n\n/**\n * Source provenance and tri-state read-cache controls.\n *\n * Omitted cache flags share in-flight or explicitly retained work but do not\n * retain a newly completed operation. `true` retains success, while `false`\n * bypasses sharing and retention. Failures are never retained.\n *\n * @typedef {object} CjsResManReadCacheOptions\n * @property {object|Function} [source] Source override providing `Read(path, options)`.\n * @property {string|number} [sourceRevision] Opaque caller/source content token; finite numbers only.\n * @property {boolean} [reload=false] Invalidate this source/path and begin fresh work once.\n * @property {boolean} [cacheSource] Source operation sharing/retention policy.\n * @property {boolean} [cacheFormat] Parsed-format operation sharing/retention policy.\n */\n\n/**\n * Opt-in time-based inactivity policy run by {@link CjsResMan#Update}.\n *\n * Automatic policy deliberately uses elapsed milliseconds rather than\n * MotherLode activity frames: the latter count explicit activity observations\n * and are not guaranteed to match renderer frames. At least one identity or\n * payload limit is required. The policy is disabled by default.\n *\n * @typedef {object} CjsResManAutoPurgePolicy\n * @property {number} [intervalMilliseconds=1000] Minimum elapsed milliseconds between automatic sweeps; `0` permits every update.\n * @property {number} [maxIdleMilliseconds] Elapsed milliseconds after which an unlocked canonical identity is removed and cleaned.\n * @property {number} [payloadMaxIdleMilliseconds] Elapsed milliseconds after which an unlocked CPU payload is released.\n * @property {boolean} [destroyAdapters=true] Whether identity cleanup destroys adapter allocations.\n * @property {boolean} [releasePayload=true] Whether sweeps may release CPU payloads.\n * @property {false|Function} [cleanup] `false` retains owned state; a function replaces default identity cleanup.\n * @property {() => number} [now=Date.now] Cadence clock. Use the MotherLode activity clock when supplying a custom clock.\n */\n\n/**\n * Per-call controls for {@link CjsResMan#PumpAutoPurge}.\n *\n * @typedef {object} CjsResManAutoPurgePumpOptions\n * @property {number} [time] Explicit non-negative timestamp in milliseconds for deterministic pumping and sweeping.\n */\n\n/**\n * Queue and automatic-purge controls accepted by {@link CjsResMan#Update}.\n * Top-level queue options remain a compatibility form for the prepare pump.\n *\n * @typedef {object} CjsResManUpdateOptions\n * @property {object} [background] Background queue pump options.\n * @property {object} [prepare] Main-thread prepare queue pump options.\n * @property {false|object} [cache] `false` skips recorded-byte housekeeping; otherwise supplies cache-cleanup policy.\n * @property {false|CjsResManAutoPurgePumpOptions} [purge] `false` skips this update's automatic sweep; otherwise supplies its timestamp.\n */\n\n/**\n * Snapshot-fence controls accepted by {@link CjsResMan#Wait}.\n *\n * The default pump uses the manager's ordinary queue budgets and honors queue\n * pause state. `pump: false` leaves all progress to an external driver. The\n * yield callback is used only while this call is pumping and may return either\n * a promise or an immediate value.\n *\n * @typedef {object} CjsResManWaitOptions\n * @property {boolean} [pump=true] Whether this call pumps the two queues while awaiting its snapshot.\n * @property {object} [background] Options forwarded to `PumpBackgroundQueue`.\n * @property {object} [prepare] Options forwarded to `PumpMainThreadQueue`.\n * @property {() => (*|Promise<*>)} [yield] Cooperative wait between pump attempts.\n */\n\n/**\n * Immutable authority captured by asynchronous work that may mutate a\n * canonical resource. A generation changes whenever ResMan removes and later\n * rebinds the same JavaScript handle, even when owner and key are reused.\n *\n * @typedef {object} CjsResourceOwnership\n * @property {number} generation Manager-local ownership generation.\n * @property {CjsMotherLode} owner Exact registry that owns the resource.\n * @property {string} key Exact canonical registry identity.\n * @property {object|Function} resource Canonical resource handle.\n */\n\n/**\n * Immutable authority for one off-registry reload candidate.\n *\n * The newest generation for a canonical key is the only candidate permitted\n * to commit. `expectedOwnership` keeps the former canonical handle protected\n * by the same exact-owner generation checks used by ordinary asynchronous\n * resource work.\n *\n * @typedef {object} CjsResourceReloadCandidate\n * @property {true} reloadCandidate Distinguishes staged authority from canonical ownership.\n * @property {number} generation Manager-local reload request generation.\n * @property {CjsMotherLode} owner Exact registry expected to receive the candidate.\n * @property {string} key Exact canonical registry identity.\n * @property {object|Function} expected Former canonical resource preserved until commit.\n * @property {CjsResourceOwnership} expectedOwnership Captured authority of the former owner.\n * @property {object|Function} resource Off-registry candidate resource.\n * @property {Readonly<object>} loaderOptions Durable identity/source options restored after commit.\n */\n\n/**\n * Hidden authority accepted by guarded CPU read/publication helpers.\n *\n * @typedef {CjsResourceOwnership|CjsResourceReloadCandidate} CjsResourceMutationAuthority\n */\n\nexport class CjsResMan extends CjsEventEmitter\n{\n\n #autoPurgePolicy = null;\n #activeResourceOperations = 0;\n #invalidResourceOwnership = new WeakSet();\n #lastAutoPurgeTime = null;\n #nextResourceReloadGeneration = 1;\n #nextResourceOwnershipGeneration = 1;\n #nextResourceOperationId = 1;\n #queueOperations = new Map();\n #resourceOwnership = new WeakMap();\n #resourceOperations = new Map();\n #reloadCandidates = new WeakMap();\n #reloadGenerations = new Map();\n #reloadOperations = new WeakMap();\n\n /**\n * Create a GPU-free resource manager and apply its initial registration.\n *\n * @param {object} [options={}] Configuration forwarded to {@link CjsResMan#Register}.\n * @throws {TypeError} If registration, queue, source, or format options are invalid.\n */\n constructor(options = {}) {\n super();\n this.motherLode = new CjsMotherLode();\n this.source = null;\n this.paths = new Map();\n this.pathResolver = null;\n this.resourceTypes = new Map();\n this.objectLoaders = new Map();\n this.formats = new Map();\n this.objectOperations = new WeakMap();\n this.sourceOperations = new WeakMap();\n this.queuedSourceOperations = new WeakMap();\n this.formatOperations = new WeakMap();\n this.mainThreadLoader = new CjsResManMainThreadLoader();\n this.workerLoader = new CjsResManWorkerLoader({\n fallback: this.mainThreadLoader\n });\n this.resourceLoader = this.workerLoader;\n this.maxConcurrentLoads = 8;\n this.maxPrepareTime = 0.005;\n this.maxPrepareItemsPerTick = 0;\n this.autoPumpMainThreadQueue = true;\n this.queueScheduler = defaultQueueScheduler;\n this.urgentResourceLoads = false;\n this._backgroundPumpScheduled = false;\n this._mainThreadPumpScheduled = false;\n this._loadQueue = new CjsResManWorkQueue(CjsResManQueue.BACKGROUND, {\n concurrency: this.maxConcurrentLoads,\n onReady: () => this.ScheduleBackgroundQueue()\n });\n this._prepareQueue = new CjsResManWorkQueue(CjsResManQueue.MAIN, {\n concurrency: 1,\n onReady: () => this.ScheduleMainThreadQueue()\n });\n\n this.Register(options);\n }\n\n /**\n * Add or replace resource-manager configuration.\n *\n * The same options object can be forwarded unchanged by CjsLibrary. Format\n * classes continue to own their input extensions; resource types are keyed\n * by semantic requirements such as \"texture\", \"image\", or \"geometry\".\n * Replacing MotherLode shuts down and cleans the former owner before the new\n * registry is activated. Replacement is rejected while queued or direct\n * resource mutations are active so a synchronous configuration call cannot\n * detach ownership underneath asynchronous publication. Normal `Wait()`\n * drains queued roots only; direct callers must await their own promises.\n *\n * @param {object} [options={}] Additive source, registry, queue, format, and resource-type settings.\n * @param {number} [options.cacheSize] Recorded-byte budget immediately installed on the active MotherLode.\n * @param {object} [options.cacheCleanup] Cleanup policy used if a smaller configured budget evicts cached identities.\n * @param {object} [options.mainThreadLoader] Direct execution strategy.\n * @param {object|Map<string,string>} [options.paths] Resource-prefix URL bases.\n * @param {Function|null} [options.pathResolver] Optional complete resource-path-to-URL resolver.\n * @param {object} [options.workerLoader] Worker loader instance or construction options.\n * @param {boolean} [options.useWorkerLoading=true] Whether worker-backed execution is selected.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If options or any configured component are invalid.\n * @throws {Error|AggregateError} If resource mutations are active or replacing MotherLode cannot clean its resources.\n */\n Register(options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.Register options must be an object.\");\n }\n\n hasOwnThen(options, {\n motherLode: value =>\n {\n const nextMotherLode = value || new CjsMotherLode();\n if (nextMotherLode !== this.motherLode)\n {\n if (this.#activeResourceOperations > 0)\n {\n throw activeResourceOperationsError(this.#activeResourceOperations);\n }\n const previousMotherLode = this.motherLode;\n this.#InvalidateMotherLodeOwnership(previousMotherLode);\n previousMotherLode?.Shutdown?.();\n this.motherLode = nextMotherLode;\n this.motherLode.Startup?.();\n this.#BindMotherLodeResources();\n this.#reloadGenerations.clear();\n this.#lastAutoPurgeTime = null;\n }\n },\n cacheSize: value => this.motherLode.SetCacheSize(\n value,\n options.cacheCleanup || {}\n ),\n autoPurgePolicy: this.SetAutoPurgePolicy,\n source: this.SetSource,\n paths: this.SetPaths,\n pathResolver: this.SetPathResolver,\n mainThreadLoader: this.SetMainThreadLoader,\n workerLoader: this.SetWorkerLoader,\n useWorkerLoading: this.UseWorkerLoading,\n maxConcurrentLoads: value =>\n {\n assertPositiveInteger(value, \"maxConcurrentLoads\");\n this.maxConcurrentLoads = value;\n this._loadQueue.SetConcurrency(value);\n },\n maxPrepareTime: value =>\n {\n assertNonNegativeNumber(value, \"maxPrepareTime\");\n this.maxPrepareTime = value;\n },\n maxPrepareItemsPerTick: value =>\n {\n assertNonNegativeInteger(value, \"maxPrepareItemsPerTick\");\n this.maxPrepareItemsPerTick = value;\n },\n autoPumpMainThreadQueue: value =>\n {\n this.autoPumpMainThreadQueue = Boolean(value);\n },\n queueScheduler: value =>\n {\n if (value !== null && typeof value !== \"function\")\n {\n throw new TypeError(\"CjsResMan queueScheduler must be a function or null.\");\n }\n this.queueScheduler = value || defaultQueueScheduler;\n },\n urgentResourceLoads: this.SetUrgentResourceLoads\n }, this);\n\n for (const entry of normalizeRegistrationEntries(options.formats))\n {\n if (typeof entry === \"function\") this.RegisterFormat(entry);\n else this.RegisterFormat(entry.Format || entry.format, entry.defaults || {});\n }\n for (const entry of normalizeRegistrationEntries(options.resourceTypes, true))\n {\n if (typeof entry === \"function\") this.RegisterResourceType(entry);\n else this.RegisterResourceType(entry.requirement || entry.payload || entry.key, entry.Constructor || entry.Resource || entry.resourceType, entry);\n }\n for (const [ ext, loader ] of Object.entries(options.objectLoaders || {}))\n {\n this.RegisterObjectLoader(ext, loader);\n }\n return this;\n }\n\n /**\n * Replace the default source selected by later resource requests.\n * Existing handles retain the effective source captured when they were\n * created, so payload reconstruction does not silently move to this source.\n *\n * @param {object|Function|null} source Source exposing `Read(path, options)`, or a falsey value to clear the default.\n * @returns {CjsResMan} This resource manager.\n */\n SetSource(source) {\n this.source = source || null;\n return this;\n }\n\n /**\n * Add or replace one resource-prefix URL base.\n *\n * @param {string} prefix Resource scheme without `:/`.\n * @param {string} urlBase URL base ending at the scheme root.\n * @returns {CjsResMan} This resource manager.\n */\n SetPath(prefix, urlBase)\n {\n const key = normalizePathPrefix(prefix);\n const value = normalizeUrlBase(urlBase);\n this.paths.set(key, value);\n return this;\n }\n\n /**\n * Add or replace resource-prefix URL bases from an object or Map.\n *\n * @param {object|Map<string,string>} paths Prefix/base entries.\n * @returns {CjsResMan} This resource manager.\n */\n SetPaths(paths)\n {\n if (!paths || (typeof paths !== \"object\" && !(paths instanceof Map)) || Array.isArray(paths))\n {\n throw new TypeError(\"CjsResMan paths must be an object or Map.\");\n }\n const entries = paths instanceof Map\n ? paths.entries()\n : Object.entries(paths);\n for (const [ prefix, urlBase ] of entries)\n {\n this.SetPath(prefix, urlBase);\n }\n return this;\n }\n\n /**\n * Reports whether a resource-prefix URL base is registered.\n *\n * @param {string} prefix Resource scheme without `:/`.\n * @returns {boolean}\n */\n HasPath(prefix)\n {\n return this.paths.has(normalizePathPrefix(prefix));\n }\n\n /**\n * Returns one registered resource-prefix URL base.\n *\n * @param {string} prefix Resource scheme without `:/`.\n * @returns {string|null}\n */\n GetPath(prefix)\n {\n return this.paths.get(normalizePathPrefix(prefix)) || null;\n }\n\n /**\n * Replaces the complete resource-path-to-URL resolver.\n *\n * @param {Function|null} resolver Resolver called as `(resourcePath, resMan)`.\n * @returns {CjsResMan} This resource manager.\n */\n SetPathResolver(resolver)\n {\n if (resolver !== null && resolver !== undefined && typeof resolver !== \"function\")\n {\n throw new TypeError(\"CjsResMan pathResolver must be a function or null.\");\n }\n this.pathResolver = resolver || null;\n return this;\n }\n\n /**\n * Builds the URL used by URL-backed providers while preserving the resource\n * path as the canonical resource identity.\n *\n * @param {string} path Resource path or direct HTTP(S) URL.\n * @returns {string} Resolved URL.\n */\n BuildUrl(path)\n {\n const normalized = normalizeResourcePath(path);\n if (!normalized)\n {\n throw new TypeError(\"CjsResMan resource path must be a non-empty string.\");\n }\n if (this.pathResolver)\n {\n return normalizeResolvedUrl(this.pathResolver(normalized, this));\n }\n\n const prefixIndex = normalized.indexOf(\":/\");\n if (prefixIndex === -1)\n {\n return normalizePath(path);\n }\n const prefix = normalized.slice(0, prefixIndex);\n if (prefix === \"http\" || prefix === \"https\")\n {\n return normalizePath(path);\n }\n const urlBase = this.paths.get(prefix);\n if (!urlBase)\n {\n const error = new Error(`CjsResMan resource path prefix is not registered: ${prefix}`);\n error.code = \"CJS_RESMAN_PATH_PREFIX_UNREGISTERED\";\n error.path = normalized;\n error.prefix = prefix;\n throw error;\n }\n return `${urlBase}${normalized.slice(prefixIndex + 2)}`;\n }\n\n /**\n * Replace the direct execution strategy used by unsupported worker\n * operations and whenever worker loading is not selected.\n *\n * @param {object} loader Loader exposing `Read` and `ReadFormat`.\n * @returns {CjsResMan} This resource manager.\n */\n SetMainThreadLoader(loader) {\n assertResourceLoader(loader, \"mainThreadLoader\");\n const wasSelected = this.resourceLoader === this.mainThreadLoader;\n this.mainThreadLoader = loader;\n this.workerLoader?.SetFallback?.(loader);\n if (wasSelected || !this.resourceLoader) this.resourceLoader = loader;\n return this;\n }\n\n /**\n * Install a worker loader instance or construct one from options.\n *\n * Installation does not select worker execution; call\n * `UseWorkerLoading(true)` or pass `useWorkerLoading: true`.\n *\n * @param {object|null} loader Worker loader or CjsResManWorkerLoader options.\n * @returns {CjsResMan} This resource manager.\n */\n SetWorkerLoader(loader) {\n const wasSelected = this.resourceLoader === this.workerLoader;\n if (loader === null || loader === false) {\n this.workerLoader = null;\n if (wasSelected) this.resourceLoader = this.mainThreadLoader;\n return this;\n }\n\n const resolved = isResourceLoader(loader)\n ? loader\n : new CjsResManWorkerLoader({\n ...(loader || {}),\n fallback: loader?.fallback || this.mainThreadLoader\n });\n assertResourceLoader(resolved, \"workerLoader\");\n this.workerLoader = resolved;\n if (wasSelected) this.resourceLoader = resolved;\n return this;\n }\n\n /**\n * Select worker-backed execution, lazily creating the default module worker\n * loader when required. Unsupported sources and formats still use the\n * configured main-thread loader.\n *\n * @param {boolean} [value=true] Whether worker execution is selected.\n * @returns {CjsResMan} This resource manager.\n */\n UseWorkerLoading(value = true) {\n if (!value) {\n this.resourceLoader = this.mainThreadLoader;\n return this;\n }\n if (!this.workerLoader) this.SetWorkerLoader({});\n this.workerLoader.Reset?.();\n this.resourceLoader = this.workerLoader;\n return this;\n }\n\n /**\n * Report whether worker-backed execution is the selected strategy.\n *\n * @returns {boolean}\n */\n IsWorkerLoading() {\n return Boolean(this.workerLoader && this.resourceLoader === this.workerLoader);\n }\n\n /**\n * Return unresolved requests owned by the selected/installed worker loader.\n *\n * @returns {number}\n */\n GetPendingWorkers() {\n return this.workerLoader?.GetPendingCount?.() || 0;\n }\n\n /**\n * Enqueues a resource task on the selected execution lane for the resource\n * manager.\n */\n AddToQueue(queue, callback, context = null, flags = 0) {\n const task = this.QueueTask(queue, callback, context, { flags });\n task.promise.catch(error => {\n this.EmitEvent?.(\"queueerror\", this, task.queue, task.id, error);\n });\n return task.id;\n }\n\n /** Cancels a queued resource task before it starts for the resource manager. */\n CancelFromQueue(queue, id, reason = \"\") {\n return this.GetWorkQueue(queue).Cancel(id, reason);\n }\n\n /**\n * Allocates the next task identifier for a selected queue for the resource\n * manager.\n */\n GetNextIdForQueue(queue) {\n return this.GetWorkQueue(queue).GetNextId();\n }\n\n /**\n * Starts pending preparation work within the main-thread concurrency limit for\n * the resource manager.\n */\n PumpMainThreadQueue(options = {}) {\n const urgent = options.urgent === true || this.urgentResourceLoads;\n const result = this._prepareQueue.Pump({\n maxItems: urgent ? 0 : (options.maxItems ?? this.maxPrepareItemsPerTick),\n maxTime: urgent ? 0 : (options.maxTime ?? this.maxPrepareTime) * 1000,\n now: options.now\n });\n if (result.queued > 0 && result.active === 0) this.ScheduleMainThreadQueue();\n return result.processed > 0;\n }\n\n /**\n * Starts pending load work within the background concurrency limit for the\n * resource manager.\n */\n PumpBackgroundQueue(options = {}) {\n const result = this._loadQueue.Pump({\n maxItems: options.maxItems ?? 0,\n maxTime: options.maxTime === undefined ? 0 : options.maxTime * 1000,\n now: options.now\n });\n return result.processed > 0;\n }\n\n /**\n * Prevents the selected queue from starting additional work for the resource\n * manager.\n */\n PauseQueue(queue) {\n this.GetWorkQueue(queue).Pause();\n return this;\n }\n\n /**\n * Allows the selected queue to start pending work again for the resource\n * manager.\n */\n ResumeQueue(queue) {\n const name = CjsResManWorkQueue.normalizeName(queue);\n this.GetWorkQueue(name).Resume();\n if (name === CjsResManQueue.MAIN) this.ScheduleMainThreadQueue();\n else this.ScheduleBackgroundQueue();\n return this;\n }\n\n /**\n * Returns the number of load tasks waiting or running for the resource\n * manager.\n */\n GetPendingLoads() {\n return this._loadQueue.GetPendingCount();\n }\n\n /**\n * Returns the number of preparation tasks waiting or running for the resource\n * manager.\n */\n GetPendingPrepares() {\n return this._prepareQueue.GetPendingCount();\n }\n\n /**\n * Returns queue counts and concurrency state for diagnostics for the resource\n * manager.\n */\n GetQueueStats(queue = null) {\n if (queue !== null && queue !== undefined) return this.GetWorkQueue(queue).GetStats();\n return Object.freeze({\n loads: this._loadQueue.GetStats(),\n prepares: this._prepareQueue.GetStats()\n });\n }\n\n /**\n * Switches resource loading between normal and urgent concurrency policy for\n * the resource manager.\n */\n SetUrgentResourceLoads(value) {\n this.urgentResourceLoads = Boolean(value);\n return this;\n }\n\n /**\n * Reports whether urgent resource-load scheduling is active for the resource\n * manager.\n */\n IsUrgentResourceLoads() {\n return this.urgentResourceLoads;\n }\n\n /**\n * Reports whether any resource load or preparation remains pending for the\n * resource manager.\n */\n IsLoading() {\n return this.GetPendingLoads() + this.GetPendingPrepares() + this.GetPendingWorkers() > 0;\n }\n\n /**\n * Pump background and main-thread work, enforce the recorded-byte cache\n * budget, then run a due automatic inactivity sweep when one has been\n * explicitly configured. Queue work is processed before housekeeping, and\n * manager-owned active loads/prepares hold eviction locks. No housekeeping\n * operation fetches, prepares, or reloads source data.\n *\n * @param {CjsResManUpdateOptions} [options={}] Queue budgets and optional automatic-purge controls.\n * @returns {boolean} Whether queue work ran or housekeeping released owned state.\n * @throws {TypeError} If queue, cache, purge timing, or MotherLode policy options are invalid.\n * @throws {AggregateError} If cache or inactivity housekeeping cannot clean one or more resources.\n */\n Update(options = {}) {\n const loaded = this.PumpBackgroundQueue(options.background || {});\n const prepared = this.PumpMainThreadQueue(options.prepare || options);\n const cacheOptions = options.cache === true || options.cache === undefined\n ? {}\n : options.cache;\n const cacheResult = options.cache === false\n ? null\n : this.motherLode.TrimCache?.(cacheOptions);\n const trimmed = Boolean(cacheResult && cacheResult.evicted > 0);\n const purgeOptions = options.purge === true || options.purge === undefined\n ? {}\n : options.purge;\n const purgeResult = options.purge === false\n ? null\n : this.PumpAutoPurge(purgeOptions);\n const purged = Boolean(purgeResult\n && (purgeResult.purged > 0 || purgeResult.payloadsReleased > 0));\n return loaded || prepared || trimmed || purged;\n }\n\n /**\n * Compatibility alias for {@link CjsResMan#Update}. It uses the same queue\n * budgets, byte-cache housekeeping, opt-in purge cadence, return value, and\n * error behavior.\n *\n * @param {CjsResManUpdateOptions} [options={}] Queue budgets and optional automatic-purge controls.\n * @returns {boolean} Whether queue work ran or housekeeping released owned state.\n * @throws {TypeError|AggregateError} If update options or a due purge fail.\n */\n Tick(options = {}) {\n return this.Update(options);\n }\n\n /**\n * Wait for the manager work that exists when this method is called.\n * The snapshot contains active queued resource load roots and direct queue\n * tasks. A captured resource root includes every CPU-work descendant it\n * enqueues later, while unrelated roots/tasks submitted after the call do\n * not postpone this fence. Shared-source joins do not merge distinct roots.\n *\n * Failure and queued cancellation count as terminal settlement: callers\n * observe those errors through the original operation promises, while this\n * method resolves after every captured promise settles. By default it pumps\n * background and main queues directly, so waiting never triggers automatic\n * retention sweeps. Paused queues remain paused. With `pump: false`, an\n * external driver must resume/pump queues or the returned promise may remain\n * pending.\n *\n * A standalone canonical `PrepareResourceObjectQueued()` call opens a\n * resource root. Direct `LoadResourceObject()`, direct\n * `PrepareResourceObject()`, standalone `ReadResource()`, and standalone\n * `ReadFormatOnce()` calls bypass the two queues and are not resource roots\n * unless they also own a captured queue task. `WaitUrgent()` remains absent\n * until per-item priority and urgent membership exist.\n *\n * @param {CjsResManWaitOptions} [options={}] Snapshot pumping and cooperative-yield controls.\n * @returns {Promise<CjsResMan>} This manager after all captured work settles.\n * @throws {TypeError} If options, `pump`, or `yield` are invalid.\n * @throws {Error} If a queue pump or custom yield callback itself fails.\n */\n async Wait(options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.Wait options must be an object.\");\n }\n if (options.pump !== undefined && typeof options.pump !== \"boolean\")\n {\n throw new TypeError(\"CjsResMan.Wait pump must be a boolean when supplied.\");\n }\n if (options.yield !== undefined && typeof options.yield !== \"function\")\n {\n throw new TypeError(\"CjsResMan.Wait yield must be a function when supplied.\");\n }\n\n const snapshot = new Set([\n ...this.#resourceOperations.values(),\n ...this.#queueOperations.values()\n ]);\n if (snapshot.size === 0) return this;\n\n const fence = Promise.allSettled([ ...snapshot ]);\n if (options.pump === false)\n {\n await fence;\n return this;\n }\n\n const yieldQueue = options.yield || defaultQueueYield;\n let settled = false;\n fence.then(() => { settled = true; });\n while (!settled)\n {\n this.PumpBackgroundQueue(options.background || {});\n this.PumpMainThreadQueue(options.prepare || {});\n if (!settled) await Promise.race([ fence, Promise.resolve().then(yieldQueue) ]);\n }\n await fence;\n return this;\n }\n\n /**\n * Returns the execution queue selected by its public lane name for the\n * resource manager.\n */\n GetWorkQueue(queue) {\n return CjsResManWorkQueue.normalizeName(queue) === CjsResManQueue.MAIN\n ? this._prepareQueue\n : this._loadQueue;\n }\n\n /**\n * Add one low-level task to a manager queue and retain its promise only while\n * pending so a contemporaneous {@link CjsResMan#Wait} snapshot can include\n * it. This does not assign resource lineage to tasks the callback may submit\n * later; callers should return/await such work or use a manager resource\n * operation.\n *\n * @param {string} queue Queue name or compatibility alias.\n * @param {Function} callback Queue callback receiving immutable task metadata.\n * @param {*} [context=null] `this` value used to invoke the callback.\n * @param {object|null} [metadata=null] Opaque diagnostics retained on the task.\n * @returns {object} Queue task record containing id, queue, state, metadata, and promise.\n * @throws {TypeError} If the queue or callback is invalid.\n */\n QueueTask(queue, callback, context = null, metadata = null)\n {\n return this.#TrackQueueTask(this.GetWorkQueue(queue).Add(callback, context, metadata));\n }\n\n /** Requests a later background-queue scheduling pass for the resource manager. */\n ScheduleBackgroundQueue() {\n if (this._backgroundPumpScheduled || this._loadQueue.IsPaused()) return this;\n this._backgroundPumpScheduled = true;\n Promise.resolve().then(() => {\n this._backgroundPumpScheduled = false;\n this.PumpBackgroundQueue();\n });\n return this;\n }\n\n /**\n * Requests a later main-thread preparation scheduling pass for the resource\n * manager.\n */\n ScheduleMainThreadQueue() {\n if (!this.autoPumpMainThreadQueue || this._mainThreadPumpScheduled || this._prepareQueue.IsPaused()) return this;\n this._mainThreadPumpScheduled = true;\n try {\n this.queueScheduler(() => {\n this._mainThreadPumpScheduled = false;\n this.PumpMainThreadQueue();\n });\n } catch (error) {\n this._mainThreadPumpScheduled = false;\n throw error;\n }\n return this;\n }\n\n /**\n * Register a resource constructor or factory for one semantic outcome.\n * The constructor is selected by `requirement`/`payload`, never by file\n * extension. It does not enter resource identity: re-registration affects a\n * path/output only after its existing handle is explicitly deleted/cleared.\n *\n * @param {string|Function} requirement Semantic outcome key, or a constructor declaring its own `payload`.\n * @param {Function|object|null} [Constructor=null] Resource constructor/factory, or options when the first argument is the constructor.\n * @param {object} [options={}] Registration aliases and optional requirement/payload override.\n * @param {readonly string[]} [options.aliases=[]] Additional semantic keys mapped to the same constructor.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If the semantic key or constructor/factory is invalid.\n */\n RegisterResourceType(requirement, Constructor = null, options = {})\n {\n if (typeof requirement === \"function\")\n {\n options = Constructor && typeof Constructor === \"object\" ? Constructor : {};\n Constructor = requirement;\n requirement = options.requirement || options.payload || Constructor.payload;\n }\n\n const key = normalizeRequirement(requirement);\n if (!key) throw new TypeError(\"CjsResMan.RegisterResourceType requires a semantic requirement.\");\n if (typeof Constructor !== \"function\")\n {\n throw new TypeError(\"CjsResMan.RegisterResourceType requires a constructor or factory.\");\n }\n\n this.resourceTypes.set(key, Constructor);\n for (const alias of options.aliases || [])\n {\n const aliasKey = normalizeRequirement(alias);\n if (aliasKey) this.resourceTypes.set(aliasKey, Constructor);\n }\n return this;\n }\n\n /**\n * Register the direct byte-to-object reader for one input extension.\n * Direct loaders take precedence over registered format facades and are\n * resolved from current setup-time configuration whenever source is read.\n * A direct loader represents only the extension's unforced default result;\n * multiple named outputs belong on a registered format facade.\n *\n * @param {string} ext Input extension with or without a leading dot.\n * @param {Function} loader Reader receiving source bytes and an immutable preparation context.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If the extension or loader is invalid.\n */\n RegisterObjectLoader(ext, loader) {\n const key = normalizeResourceExtension(ext);\n if (!key) throw new TypeError(\"CjsResMan.RegisterObjectLoader requires an extension.\");\n if (typeof loader !== \"function\") throw new TypeError(\"CjsResMan.RegisterObjectLoader requires a loader function.\");\n this.objectLoaders.set(key, loader);\n return this;\n }\n\n /**\n * Register a reusable format facade for each accepted input extension.\n * Multiple candidates may share an extension and are resolved by requested\n * output/media type or by their support probes. Defaults are copied into a\n * deeply frozen plain-object/array snapshot so later caller mutation cannot\n * rewrite the registered configuration. Format methods are read from the\n * currently registered facade when an operation runs.\n *\n * @param {Function} Format Format facade declaring at least one `inputTypes` extension.\n * @param {object} [defaults={}] Plain reader-option defaults to snapshot for this registration.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If the format declaration or immutable defaults snapshot is invalid.\n */\n RegisterFormat(Format, defaults = {})\n {\n if (typeof Format !== \"function\")\n {\n throw new TypeError(\"CjsResMan.RegisterFormat requires a format class.\");\n }\n if (!Array.isArray(Format.inputTypes) || Format.inputTypes.length === 0)\n {\n throw new TypeError(`${Format.name || \"Format\"} must declare non-empty inputTypes.`);\n }\n\n const descriptor = Object.freeze({\n Format,\n defaults: snapshotFormatDefaults(defaults)\n });\n for (const inputType of Format.inputTypes)\n {\n const key = normalizeResourceExtension(inputType);\n if (!key) continue;\n const candidates = this.formats.get(key) || [];\n const next = candidates.filter(candidate => candidate.Format !== Format);\n next.push(descriptor);\n this.formats.set(key, next);\n }\n return this;\n }\n\n /**\n * Return registered format facades for one normalized input extension.\n *\n * @param {string} inputType Input extension with or without a leading dot.\n * @returns {Function[]} Detached format-class list in registration order.\n */\n GetFormats(inputType)\n {\n return this.GetFormatDescriptors(inputType).map(descriptor => descriptor.Format);\n }\n\n /**\n * Select one registered format facade for an input and requested outcome.\n *\n * @param {string} inputType Input extension with or without a leading dot.\n * @param {object} [options={}] Optional format, output, media type, and source-byte selectors.\n * @returns {Function} Unambiguous selected format facade.\n * @throws {Error} If no candidate matches or multiple candidates remain.\n */\n ResolveFormat(inputType, options = {})\n {\n return this.ResolveFormatDescriptor(inputType, options).Format;\n }\n\n /**\n * Return the immediate canonical resource handle for a source path and\n * promised output. Cache hits explicitly renew MotherLode activity. When\n * `reload: true` finds an existing owner, this synchronous method returns a\n * distinct off-registry candidate and leaves the canonical handle untouched.\n * Calling `Ready()` on that candidate, or using `ReloadResource()` /\n * `ReloadObject()`, prepares it and conditionally commits it through the\n * asynchronous atomic-reload contract.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Promised output, semantic resource, source provenance, and reload settings.\n * @returns {CjsResource} Canonical handle, or an off-registry reload candidate.\n * @throws {TypeError} If the path, identity settings, or resource constructor are invalid.\n * @throws {Error} If MotherLode is inactive or displaced-resource cleanup fails.\n */\n GetResource(path, options = {}) {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.GetResource options must be an object.\");\n }\n const key = normalizeResourcePath(path);\n const variant = this.GetResourceVariant(options);\n const ext = normalizeResourceExtension(options.ext || getResourceExtension(key));\n if (options.emit !== undefined)\n {\n const objectLoader = this.GetObjectLoader(ext);\n if (objectLoader)\n {\n throw createObjectLoaderOutputMissingError(ext, options.emit);\n }\n else\n {\n const descriptors = this.GetFormatDescriptors(ext);\n const candidates = filterFormatDescriptors(descriptors, options);\n if (descriptors.length > 0 && candidates.length === 0)\n {\n throw createFormatOutputMissingError(ext, options.emit, descriptors);\n }\n }\n }\n const cacheKey = getMotherLodeKey(key, variant);\n const existing = this.motherLode.Lookup(cacheKey);\n if (existing && options.reload !== true)\n {\n this.#BindResourceLifecycle(cacheKey, existing);\n this.motherLode.KeepAlive?.(cacheKey);\n return existing;\n }\n if (!existing && options.reload === true)\n {\n this.InvalidateReadCache(key, { source: options.source || this.source });\n }\n\n const Constructor = this.ResolveResourceConstructor(options);\n const resource = this.CreateResource(\n Constructor,\n key,\n ext,\n options,\n existing && options.reload === true ? existing : null\n );\n if (existing && options.reload === true)\n {\n this.#BindResourceLifecycle(cacheKey, existing);\n this.motherLode.KeepAlive?.(cacheKey);\n const expectedOwnership = this.#RequireResourceOwnership(existing, \"reload-candidate:create\");\n const generation = this.#nextResourceReloadGeneration++;\n const loaderOptions = Object.freeze(getResourceLoaderOptions(\n options,\n options.source || this.source\n ));\n const candidate = Object.freeze({\n reloadCandidate: true,\n generation,\n owner: this.motherLode,\n key: cacheKey,\n expected: existing,\n expectedOwnership,\n resource,\n loaderOptions\n });\n this.#reloadCandidates.set(resource, candidate);\n this.#reloadGenerations.set(cacheKey, generation);\n\n if (typeof resource.SetObjectLoader === \"function\")\n {\n const reloadOptions = { ...loaderOptions, reload: true };\n resource.SetObjectLoader(\n loadOptions => this.#GetReloadCandidateObject(resource, {\n ...mergeResourceLoaderOptions(reloadOptions, loadOptions),\n reload: true\n }),\n reloadOptions\n );\n }\n return resource;\n }\n\n const insertion = this.motherLode.Insert(cacheKey, resource, { replace: true });\n const canonical = insertion?.resource || resource;\n if (insertion?.displaced && insertion.displaced !== canonical)\n {\n this.#InvalidateResourceOwnership(insertion.displaced);\n }\n else if (existing && existing !== canonical\n && this.motherLode.Lookup(cacheKey) !== existing)\n {\n this.#InvalidateResourceOwnership(existing);\n }\n this.#BindResourceLifecycle(cacheKey, canonical);\n this.motherLode.KeepAlive?.(cacheKey);\n return canonical;\n }\n\n /**\n * Resolve one object outcome for a canonical resource identity. Concurrent\n * callers share only the active operation. Once settled, a resident payload\n * is returned without rereading source data and its explicit payload lease is\n * renewed. If the payload was released, calling this method explicitly starts\n * reconstruction; liveness queries and purge operations never do so.\n * `sourceRevision` selects read-cache provenance but does not replace a\n * resident payload by itself—use one-shot `reload: true` for replacement.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Identity, source, format, loader, and queue options.\n * @returns {Promise<*>} In-flight, resident, or reconstructed object outcome.\n * @throws {TypeError|Error} If path, identity, source, format, or conversion configuration is invalid.\n */\n GetObject(path, options = {})\n {\n const resource = this.GetResource(path, options);\n const operationOptions = mergeResourceLoaderOptions(\n resource.GetObjectRequest?.() || {},\n options\n );\n if (this.#reloadCandidates.has(resource))\n {\n return this.#GetReloadCandidateObject(resource, operationOptions);\n }\n const ownership = this.#RequireResourceOwnership(resource, \"object:begin\");\n const existing = this.objectOperations.get(resource);\n if (existing?.ownership === ownership)\n {\n return existing.promise;\n }\n\n if (resource.HasPayload?.())\n {\n resource.KeepPayloadAlive?.();\n return Promise.resolve(getPublishedResourceObject(resource));\n }\n\n const promise = this.QueueResourceObject(resource, operationOptions);\n const operation = { promise, ownership };\n this.objectOperations.set(resource, operation);\n promise.then(() =>\n {\n if (this.objectOperations.get(resource) === operation)\n {\n this.objectOperations.delete(resource);\n }\n }, () =>\n {\n if (this.objectOperations.get(resource) === operation)\n {\n this.objectOperations.delete(resource);\n }\n });\n return promise;\n }\n\n /**\n * Loads and hydrates an object graph through the configured resource pipeline\n * for the resource manager.\n */\n LoadObject(path, options = {})\n {\n return this.GetObject(path, options);\n }\n\n /**\n * Fetches and hydrates an object graph without retaining a resource handle for\n * the resource manager.\n */\n FetchObject(path, options = {})\n {\n return this.GetObject(path, options);\n }\n\n /**\n * Read and atomically publish a distinct replacement object while the\n * former canonical resource remains available. This is the explicit form of\n * `GetObject(path, { reload: true })`.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Identity, source, format, and queue settings.\n * @returns {Promise<*>} Published CPU object outcome from the committed candidate.\n * @throws {TypeError|Error|AggregateError} If candidate creation, conversion, conditional publication, or cleanup fails.\n */\n ReloadObject(path, options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.ReloadObject options must be an object.\");\n }\n return this.GetObject(path, { ...options, reload: true });\n }\n\n /**\n * Resolve and load one canonical resource handle. One-shot reload creates\n * a distinct candidate, keeps the former good handle canonical through every\n * asynchronous CPU operation, and returns only after an exact-owner conditional\n * publication succeeds. Readiness receives `reload: false` because the\n * candidate's private loader owns the one-shot freshness request.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Resource identity, source provenance, reload, format, and queue options.\n * @returns {Promise<CjsResource>} Loaded canonical resource selected by this operation.\n * @throws {TypeError|Error} If identity, source, format, conversion, or cleanup fails.\n */\n async FetchResource(path, options = {})\n {\n const resource = this.GetResource(path, options);\n const readinessOptions = options.reload === true\n ? { ...options, reload: false }\n : options;\n await resource.Ready(readinessOptions);\n return resource;\n }\n\n /**\n * Load and atomically publish a distinct replacement resource while the\n * former canonical handle remains available. This is the explicit form of\n * `FetchResource(path, { reload: true })`.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Identity, source, format, and queue settings.\n * @returns {Promise<CjsResource>} Fully loaded committed replacement.\n * @throws {TypeError|Error|AggregateError} If candidate creation, conversion, conditional publication, or cleanup fails.\n */\n ReloadResource(path, options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.ReloadResource options must be an object.\");\n }\n return this.FetchResource(path, { ...options, reload: true });\n }\n\n /**\n * Run or join one off-registry candidate operation. The returned promise\n * resolves only after exact-owner publication and displaced-owner cleanup\n * both succeed. A committed cleanup failure rejects with the new candidate\n * still canonical and attached on the MotherLode error result.\n *\n * @param {object|Function} resource Candidate resource returned by `GetResource`.\n * @param {object} options Reload source, format, and queue options.\n * @returns {Promise<*>} Candidate object outcome after conditional publication.\n */\n #GetReloadCandidateObject(resource, options)\n {\n const candidate = this.#reloadCandidates.get(resource) || null;\n if (!candidate)\n {\n return Promise.reject(reloadCandidateUnavailableError(resource));\n }\n\n const existing = this.#reloadOperations.get(resource);\n if (existing?.candidate === candidate) return existing.promise;\n\n const operation = {\n candidate,\n promise: this.#RunReloadCandidate(candidate, options)\n };\n this.#reloadOperations.set(resource, operation);\n operation.promise.then(() =>\n {\n if (this.#reloadOperations.get(resource) === operation)\n {\n this.#reloadOperations.delete(resource);\n }\n }, () =>\n {\n if (this.#reloadOperations.get(resource) === operation)\n {\n this.#reloadOperations.delete(resource);\n }\n });\n return operation.promise;\n }\n\n /**\n * Queue source/read/publication work against a detached candidate, then commit\n * it only if its former exact owner and newest-request token remain current.\n * Candidate work is a normal queued root visible to `Wait()` and holds one\n * purge lock on the former good owner until settlement.\n *\n * @param {CjsResourceReloadCandidate} candidate Immutable candidate authority.\n * @param {object} options Reload source, format, queue, and prepare options.\n * @returns {Promise<*>} Published object outcome after a successful commit.\n */\n async #RunReloadCandidate(candidate, options)\n {\n let committed = false;\n let releaseLock = noop;\n const finishOperation = this.#BeginResourceOperation(true);\n\n try\n {\n this.#AssertReloadCandidate(candidate, \"reload:begin\");\n releaseLock = this.#AcquireResourcePurgeLock(candidate.expectedOwnership);\n const read = this.#BeginReadOperation(candidate.resource.GetPath(), {\n ...options,\n reload: true\n });\n\n this.#AssertReloadCandidate(candidate, \"reload:requested\");\n candidate.resource.error = null;\n candidate.resource.MarkRequested();\n this.#AssertReloadCandidate(candidate, \"reload:requested-settled\");\n\n const bytes = await this.#QueueReadResource(read.context, read.options);\n this.#AssertReloadCandidate(candidate, \"reload:loading\");\n candidate.resource.MarkLoading();\n this.#AssertReloadCandidate(candidate, \"reload:loading-settled\");\n\n const object = await this.#PrepareResourceObjectQueued(\n candidate.resource,\n bytes,\n read.options,\n candidate\n );\n this.#AssertReloadCandidate(candidate, \"reload:commit\");\n\n try\n {\n const result = candidate.owner.ReplaceExpected(\n candidate.key,\n candidate.expected,\n candidate.resource,\n { commitGuard: () => this.#IsReloadCandidateCurrent(candidate) }\n );\n if (!result.committed)\n {\n throw staleReloadCandidateError(candidate, \"reload:commit-compare\");\n }\n committed = true;\n this.#FinalizeCommittedReload(candidate);\n }\n catch (error)\n {\n if (error?.code === \"CJS_MOTHERLODE_REPLACE_CLEANUP_FAILED\"\n && error.result?.committed === true\n && error.result.resource === candidate.resource)\n {\n committed = true;\n try\n {\n this.#FinalizeCommittedReload(candidate);\n }\n catch (finalizeError)\n {\n const combined = new AggregateError(\n [ error, finalizeError ],\n `CjsResMan reload committed with cleanup and finalization failures for ${candidate.key}.`\n );\n combined.code = \"CJS_RESMAN_RELOAD_COMMIT_FAILED\";\n combined.committed = true;\n combined.resource = candidate.resource;\n combined.result = error.result;\n throw combined;\n }\n }\n throw error;\n }\n\n return object;\n }\n catch (error)\n {\n if (!committed)\n {\n throw this.#CreateReloadCandidateFailure(candidate, error);\n }\n throw error;\n }\n finally\n {\n releaseLock();\n finishOperation();\n if (this.#reloadGenerations.get(candidate.key) === candidate.generation)\n {\n this.#reloadGenerations.delete(candidate.key);\n }\n }\n }\n\n /**\n * Bind a successfully committed candidate and invalidate only the displaced\n * handle's former publication generation. The resource loader is restored\n * to ordinary canonical reconstruction behavior.\n *\n * @param {CjsResourceReloadCandidate} candidate Committed candidate authority.\n * @returns {void}\n */\n #FinalizeCommittedReload(candidate)\n {\n this.#InvalidateResourceOwnership(candidate.expected);\n this.#reloadCandidates.delete(candidate.resource);\n const errors = [];\n try\n {\n if (typeof candidate.resource.SetObjectLoader === \"function\")\n {\n candidate.resource.SetObjectLoader(\n loadOptions => this.GetObject(\n candidate.resource.GetPath(),\n mergeResourceLoaderOptions(candidate.loaderOptions, loadOptions)\n ),\n candidate.loaderOptions\n );\n }\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n this.#BindResourceLifecycle(candidate.key, candidate.resource);\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n candidate.owner.KeepAlive?.(candidate.key);\n }\n catch (error)\n {\n errors.push(error);\n }\n if (errors.length)\n {\n const error = new AggregateError(errors, `CjsResMan committed reload finalization failed for ${candidate.key}.`);\n error.code = \"CJS_RESMAN_RELOAD_COMMIT_FINALIZE_FAILED\";\n error.committed = true;\n error.resource = candidate.resource;\n throw error;\n }\n }\n\n /**\n * Mark and clean a failed or stale detached candidate. The original\n * load/prepare/stale error remains the rejection when cleanup succeeds;\n * state-publication or cleanup errors are aggregated without touching the\n * preserved canonical owner.\n *\n * @param {CjsResourceReloadCandidate} candidate Failed candidate authority.\n * @param {*} cause Original operation failure.\n * @returns {*} Original error or a contextual AggregateError.\n */\n #CreateReloadCandidateFailure(candidate, cause)\n {\n const errors = [ cause ];\n try\n {\n candidate.resource.SetError?.(cause);\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n this.#CleanupReloadCandidate(candidate.resource);\n }\n catch (error)\n {\n errors.push(error);\n }\n\n if (errors.length === 1) return cause;\n const error = new AggregateError(errors, `CjsResMan reload candidate cleanup failed for ${candidate.key}.`);\n error.code = \"CJS_RESMAN_RELOAD_CANDIDATE_CLEANUP_FAILED\";\n error.resource = candidate.resource;\n error.cause = cause;\n return error;\n }\n\n /**\n * Release adapter and CPU-payload ownership accumulated by an off-registry\n * candidate. This cleanup is idempotent for CjsResource-compatible handles\n * and never marks the never-canonical candidate `PURGED`.\n *\n * @param {object|Function} resource Detached reload candidate.\n * @returns {void}\n * @throws {AggregateError} If adapter destruction, payload release, or lifecycle detachment fails.\n */\n #CleanupReloadCandidate(resource)\n {\n const errors = [];\n try\n {\n resource.DestroyAdapterResources?.({ destroy: true });\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n resource.ReleasePayload?.();\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n resource.SetLifecycleController?.(null);\n }\n catch (error)\n {\n errors.push(error);\n }\n if (errors.length)\n {\n throw new AggregateError(errors, \"CjsResMan reload candidate ownership cleanup failed.\");\n }\n }\n\n /**\n * Fetches raw source bytes through the configured resource source for the\n * resource manager.\n */\n Fetch(path, options = {})\n {\n return options.resource === true || options.requirement !== undefined || options.payload !== undefined\n ? this.FetchResource(path, options)\n : this.FetchObject(path, options);\n }\n\n /**\n * Read and prepare an existing resource immediately, outside the manager\n * queues. One balanced purge lock protects the canonical handle for the\n * complete asynchronous operation; any caller-owned locks remain intact.\n * Failure is published to the resource before rejection only while its\n * captured ownership generation remains canonical. A detached operation\n * preserves its original failure without changing the old handle.\n *\n * @param {CjsResource} resource Existing manager-bound resource handle.\n * @param {object} [options={}] Source, format, semantic outcome, and queue options.\n * @returns {Promise<*>} Prepared object, or the semantic resource when it owns the payload.\n * @throws {TypeError|Error} If the resource, source, format, options, or canonical ownership are invalid.\n */\n async LoadResourceObject(resource, options = {})\n {\n const read = this.#BeginReadOperation(resource.GetPath(), options);\n const ownership = this.#RequireResourceOwnership(resource, \"direct-load:begin\");\n const releaseLock = this.#AcquireResourcePurgeLock(ownership);\n const finishOperation = this.#BeginResourceOperation(false);\n\n try {\n this.#AssertResourceOwnership(ownership, \"direct-load:loading\");\n resource.error = null;\n resource.MarkLoading();\n this.#AssertResourceOwnership(ownership, \"direct-load:loading-settled\");\n const bytes = await this.#ReadResource(read.context, read.options);\n this.#AssertResourceOwnership(ownership, \"direct-load:source-settled\");\n return await this.#PrepareResourceObject(resource, bytes, read.options, ownership);\n } catch (error) {\n if (this.#IsResourceOwnershipCurrent(ownership)) resource.SetError(error);\n throw error;\n } finally {\n releaseLock();\n finishOperation();\n }\n }\n\n /**\n * Queue a source read followed by CPU conversion and publication. One balanced\n * purge lock is acquired before request publication and released only after\n * success or failure, preventing inactivity sweeps from detaching an active\n * handle. The lock does not reload data and does not consume caller locks.\n *\n * @param {CjsResource} resource Existing manager-bound resource handle.\n * @param {object} [options={}] Source, format, queue, and semantic outcome options.\n * @returns {Promise<*>} Promise for the loaded object or semantic resource.\n * @throws {TypeError} If the resource cannot be queued or its options are invalid.\n */\n QueueResourceObject(resource, options = {}) {\n const read = this.#BeginReadOperation(resource.GetPath(), options);\n const ownership = this.#RequireResourceOwnership(resource, \"queue:begin\");\n const releaseLock = this.#AcquireResourcePurgeLock(ownership);\n const finishOperation = this.#BeginResourceOperation(true);\n let load;\n\n try {\n this.#AssertResourceOwnership(ownership, \"queue:requested\");\n resource.error = null;\n resource.MarkRequested();\n this.#AssertResourceOwnership(ownership, \"queue:requested-settled\");\n load = this.#QueueReadResource(read.context, read.options);\n } catch (error) {\n releaseLock();\n finishOperation();\n throw error;\n }\n\n const operation = load\n .then(bytes => {\n this.#AssertResourceOwnership(ownership, \"queue:loading\");\n resource.MarkLoading();\n this.#AssertResourceOwnership(ownership, \"queue:loading-settled\");\n return this.#PrepareResourceObjectQueued(resource, bytes, read.options, ownership);\n })\n .catch(error => {\n if (this.#IsResourceOwnershipCurrent(ownership)) resource.SetError(error);\n throw error;\n })\n .finally(releaseLock);\n operation.then(finishOperation, finishOperation);\n return operation;\n }\n\n /**\n * Queue one source read under the selected source/path/revision identity.\n * Cache policy is tri-state: omitted shares an in-flight or explicitly\n * retained record, `true` additionally retains success, and `false` bypasses\n * both sharing and retention. `reload: true` invalidates this source/path\n * before the new task and does not cancel detached existing consumers.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {CjsResManReadCacheOptions} [options={}] Source, revision, reload, and cache controls forwarded to the read.\n * @returns {Promise<*>} Promise for source bytes or source-compatible data.\n * @throws {TypeError} If path, source, revision, or options are invalid.\n */\n QueueReadResource(path, options = {})\n {\n const read = this.#BeginReadOperation(path, options);\n return this.#QueueReadResource(read.context, read.options);\n }\n\n /**\n * Immediately read, transform, and publish one resource payload outside the\n * manager queues. Canonical resources capture their current ownership\n * generation and cannot publish after deletion, clearing, or replacement;\n * historically supported detached resource-like objects remain usable\n * without manager ownership guards.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} bytes Source bytes or reader-compatible source data.\n * @param {object} [options={}] Format and semantic outcome options.\n * @returns {Promise<*>} Final plain payload or semantic resource handle.\n * @throws {Error} If reading/preparation fails or canonical ownership becomes stale.\n */\n async PrepareResourceObject(resource, bytes, options = {}) {\n const ownership = this.#GetResourceOwnership(resource, \"direct-prepare:begin\");\n if (!ownership)\n {\n return this.#PrepareResourceObject(resource, bytes, options, null);\n }\n\n const releaseLock = this.#AcquireResourcePurgeLock(ownership);\n const finishOperation = this.#BeginResourceOperation(false);\n try\n {\n return await this.#PrepareResourceObject(resource, bytes, options, ownership);\n }\n finally\n {\n releaseLock();\n finishOperation();\n }\n }\n\n /**\n * Queue one reader/format conversion and then CPU publication on the main\n * manager queue. A canonical standalone call becomes a queued resource root\n * for `Wait()` and retains one balanced purge lock through settlement.\n * The read and publication items validate the captured canonical generation\n * before dispatch and after asynchronous settlement.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} bytes Source bytes or reader-compatible source data.\n * @param {object} [options={}] Format and semantic outcome options.\n * @returns {Promise<*>} Final plain payload or semantic resource handle.\n * @throws {Error} If queueing/preparation fails or canonical ownership becomes stale.\n */\n async PrepareResourceObjectQueued(resource, bytes, options = {}) {\n const ownership = this.#GetResourceOwnership(resource, \"queued-prepare:begin\");\n if (!ownership)\n {\n return this.#PrepareResourceObjectQueued(resource, bytes, options, null);\n }\n\n const releaseLock = this.#AcquireResourcePurgeLock(ownership);\n const finishOperation = this.#BeginResourceOperation(true);\n try\n {\n return await this.#PrepareResourceObjectQueued(resource, bytes, options, ownership);\n }\n finally\n {\n releaseLock();\n finishOperation();\n }\n }\n\n /**\n * Read and immediately publish one CPU payload with optional hidden\n * ownership authority. Format classes own every requested conversion;\n * backend realization runs separately after this CPU publication.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} bytes Source bytes or reader-compatible source data.\n * @param {object} options Resolved prepare options.\n * @param {CjsResourceMutationAuthority|null} ownership Captured canonical or reload-candidate authority.\n * @returns {Promise<*>} Final plain payload or semantic resource handle.\n */\n async #PrepareResourceObject(resource, bytes, options, ownership) {\n this.#AssertOptionalResourceOwnership(ownership, \"prepare:read\");\n const object = await this.ReadResourceObjectPayload(resource, bytes, options);\n this.#AssertOptionalResourceOwnership(ownership, \"prepare:read-settled\");\n return this.#PublishResourceObject(ownership, resource, object, options);\n }\n\n /**\n * Queue one main-thread reader/format operation followed by guarded CPU\n * publication. Both remain distinct budgeted queue items under one resource\n * root so `Wait()` continues to fence dynamically enqueued publication.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} bytes Source bytes or reader-compatible source data.\n * @param {object} options Resolved prepare options.\n * @param {CjsResourceMutationAuthority|null} ownership Captured canonical or reload-candidate authority.\n * @returns {Promise<*>} Final plain payload or semantic resource handle.\n */\n async #PrepareResourceObjectQueued(resource, bytes, options, ownership) {\n let object = bytes;\n const resolved = this.#ResolveResourceObjectRead(resource, bytes, options);\n const formatOptions = resolved.descriptor\n ? createFormatReadOptions(resolved.descriptor, options)\n : null;\n const runInWorker = Boolean(\n resolved.descriptor\n && typeof this.resourceLoader?.CanReadFormat === \"function\"\n && this.resourceLoader.CanReadFormat(resolved.descriptor, formatOptions)\n );\n\n let read;\n if (runInWorker)\n {\n this.#AssertOptionalResourceOwnership(ownership, \"worker-stage:read:run\");\n read = await this.#ReadResolvedResourceObjectPayload(\n resource,\n bytes,\n options,\n resolved\n );\n }\n else\n {\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:read:enqueue\");\n const readTask = this.QueueTask(CjsResManQueue.MAIN, () =>\n {\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:read:run\");\n return this.#ReadResolvedResourceObjectPayload(\n resource,\n bytes,\n options,\n resolved\n );\n }, resource, {\n kind: \"prepare\",\n stage: \"read\",\n path: resource.GetPath()\n });\n read = await readTask.promise;\n }\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:read:settled\");\n if (read !== undefined) object = read;\n\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:publish:enqueue\");\n const publishTask = this.QueueTask(CjsResManQueue.MAIN, () =>\n {\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:publish:run\");\n return this.#PublishResourceObject(ownership, resource, object, options);\n }, resource, {\n kind: \"prepare\",\n stage: \"publish\",\n path: resource.GetPath()\n });\n const published = await publishTask.promise;\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:publish:settled\");\n if (published !== undefined) object = published;\n return object;\n }\n\n /**\n * Decode source bytes with the currently registered reader for the resource\n * extension. A direct extension loader wins over registered format candidates;\n * byte support probes may disambiguate those candidates.\n *\n * @param {CjsResource} resource Resource whose reader outcome is requested.\n * @param {*} bytes Source byte payload.\n * @param {object} [options={}] Requested output plus per-operation controls.\n * @returns {Promise<*>} Direct-loader or registered-format reader outcome.\n * @throws {Error|TypeError} If no registered reader matches or its read contract fails.\n */\n async ReadResourceObjectPayload(resource, bytes, options = {}) {\n return this.#ReadResolvedResourceObjectPayload(\n resource,\n bytes,\n options,\n this.#ResolveResourceObjectRead(resource, bytes, options)\n );\n }\n\n /**\n * Resolve the configured direct loader or format descriptor once so queue\n * selection and execution use the same registration snapshot.\n *\n * @param {CjsResource} resource Resource whose CPU outcome is requested.\n * @param {*} bytes Source input.\n * @param {object} options Requested output options.\n * @returns {{loader: Function|null, descriptor: object|null}} Resolved reader.\n */\n #ResolveResourceObjectRead(resource, bytes, options) {\n const explicitLoader = this.GetObjectLoader(resource.GetExt());\n if (explicitLoader)\n {\n if (options.emit !== undefined)\n {\n throw createObjectLoaderOutputMissingError(resource.GetExt(), options.emit);\n }\n return { loader: explicitLoader, descriptor: null };\n }\n\n return {\n loader: null,\n descriptor: this.ResolveFormatDescriptor(resource.GetExt(), { ...options, bytes })\n };\n }\n\n /**\n * Execute one already-resolved reader through its direct or format path.\n *\n * @param {CjsResource} resource Resource whose CPU outcome is requested.\n * @param {*} bytes Source input.\n * @param {object} options Requested output options.\n * @param {{loader: Function|null, descriptor: object|null}} resolved Reader selection.\n * @returns {Promise<*>} Reader result.\n */\n #ReadResolvedResourceObjectPayload(resource, bytes, options, resolved) {\n if (resolved.loader)\n {\n return resolved.loader(\n bytes,\n createPrepareContext(this, resource, bytes, options, \"read\")\n );\n }\n return this.ReadFormatOnce(resource, resolved.descriptor, bytes, options);\n }\n\n /**\n * Publish the final CPU object outcome and loaded state. Every\n * CjsResource-compatible handle owns the reader/converter result through\n * `SetPayload`, making CPU payloads visible to MotherLode retention policy.\n * Base resources also expose the payload through the compatibility `object`\n * alias; semantic subclasses continue to return and alias the resource while\n * retaining their validated payload privately.\n *\n * @param {CjsResource} resource Target canonical resource handle.\n * @param {*} object Final reader or format-converter outcome.\n * @param {object} [options={}] Semantic resource validation/publication options.\n * @returns {*} Plain payload for a base resource, or the semantic resource handle.\n * @throws {TypeError|Error} If ownership, semantic payload validation, or loaded-state publication fails.\n */\n PublishResourceObject(resource, object, options = {}) {\n const ownership = this.#GetResourceOwnership(resource, \"publish:begin\");\n if (!ownership)\n {\n return this.#PublishResourceObjectValue(resource, object, options);\n }\n\n const finishOperation = this.#BeginResourceOperation(false);\n try\n {\n return this.#PublishResourceObject(ownership, resource, object, options);\n }\n finally\n {\n finishOperation();\n }\n }\n\n /**\n * Publish only while the captured resource authority remains canonical.\n * The post-publication check catches synchronous reentrant ownership changes\n * from state listeners before the caller can treat obsolete work as success.\n *\n * @param {CjsResourceMutationAuthority|null} ownership Captured canonical or reload-candidate authority.\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} object Final reader/converter outcome.\n * @param {object} options Semantic resource publication options.\n * @returns {*} Plain payload or semantic resource handle.\n */\n #PublishResourceObject(ownership, resource, object, options) {\n this.#AssertOptionalResourceOwnership(ownership, \"publish\");\n const result = this.#PublishResourceObjectValue(resource, object, options);\n this.#AssertOptionalResourceOwnership(ownership, \"publish-settled\");\n return result;\n }\n\n /**\n * Apply the unguarded synchronous payload/state mutation after the caller\n * has established any required canonical authority.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} object Final reader/converter outcome.\n * @param {object} options Semantic resource publication options.\n * @returns {*} Plain payload or semantic resource handle.\n */\n #PublishResourceObjectValue(resource, object, options) {\n let result = object;\n if (resource.constructor !== CjsResource && typeof resource.SetPayload === \"function\") {\n resource.SetPayload(object, options);\n resource.object = resource;\n result = resource;\n }\n else {\n resource.SetPayload?.(object, options);\n resource.object = object;\n }\n // PREPARED, not LOADED: `object` is the reader/converter OUTCOME, so the\n // bytes have already been turned into whatever they needed to become.\n // LOADED means raw source data is in hand and still has to be prepared - a\n // resource in that state is not yet good, and marking it here left IsGood()\n // permanently false for every resource that does not prepare itself.\n if (!resource.IsPrepared?.()) resource.MarkPrepared();\n return result;\n }\n\n /**\n * Warms a resource and its discovered dependencies without returning payload\n * data for the resource manager.\n */\n async Prefetch(paths, options = {}) {\n const entries = Array.isArray(paths) ? paths : [paths];\n return Promise.all(entries.map(path => this.LoadObject(path, options)));\n }\n\n /**\n * Return the currently registered direct reader for an input extension.\n *\n * @param {string} ext Input extension with or without a leading dot.\n * @returns {Function|null} Registered loader or `null`.\n */\n GetObjectLoader(ext) {\n return this.objectLoaders.get(normalizeResourceExtension(ext)) || null;\n }\n\n /**\n * Return detached references to the current format descriptors for one input\n * extension. Each descriptor contains its facade and frozen defaults.\n *\n * @param {string} inputType Input extension with or without a leading dot.\n * @returns {object[]} Descriptor list in registration order.\n */\n GetFormatDescriptors(inputType)\n {\n return [ ...(this.formats.get(normalizeResourceExtension(inputType)) || []) ];\n }\n\n /**\n * Resolve one current format registration descriptor. Output/media filters\n * run first; optional source bytes may then run support probes to disambiguate.\n *\n * @param {string} inputType Input extension with or without a leading dot.\n * @param {object} [options={}] Format, output, media type, and optional byte selectors.\n * @returns {object} Selected immutable registration descriptor.\n * @throws {Error} If no candidate matches or multiple candidates remain.\n */\n ResolveFormatDescriptor(inputType, options = {})\n {\n const key = normalizeResourceExtension(inputType);\n const descriptors = this.GetFormatDescriptors(key);\n const candidates = filterFormatDescriptors(descriptors, options);\n if (descriptors.length > 0 && candidates.length === 0 && options.emit !== undefined)\n {\n throw createFormatOutputMissingError(key, options.emit, descriptors);\n }\n return resolveFormatDescriptorCandidates(candidates, key, options);\n }\n\n /**\n * Invoke one format descriptor using its frozen registration defaults and\n * the request's explicit format options. Static async/sync readers take\n * precedence over instance `ReadAsync`/`Read` compatibility methods.\n *\n * @param {object} descriptor Selected immutable registration descriptor.\n * @param {*} bytes Source bytes supplied to the format facade.\n * @param {object} [options={}] Output, class, and `formatOptions` overrides.\n * @returns {Promise<*>} Parsed format outcome.\n * @throws {TypeError|Error} If the facade lacks a reader or reading fails.\n */\n async ReadFormat(descriptor, bytes, options = {})\n {\n return this.resourceLoader.ReadFormat(\n descriptor,\n bytes,\n createFormatReadOptions(descriptor, options)\n );\n }\n\n /**\n * Look up and explicitly renew an existing canonical resource without\n * creating, loading, or preparing a new handle.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Identity-defining resource outcome settings.\n * @returns {CjsResource|null} Existing canonical handle, or `null` when absent.\n * @throws {TypeError} If the path or identity settings cannot be normalized.\n */\n Lookup(path, options = {}) {\n const normalizedPath = normalizeResourcePath(path);\n const key = getMotherLodeKey(normalizedPath, this.GetResourceVariant(options));\n const resource = this.motherLode.Lookup(key);\n if (resource)\n {\n this.#BindResourceLifecycle(key, resource);\n this.motherLode.KeepAlive?.(key);\n }\n return resource;\n }\n\n /**\n * Forget and clean canonical resources for a source path. Omitting options\n * removes every resolved variant; supplying options removes only the exact\n * identity derived from those outcome settings. Explicitly retained source\n * and format records are independent and remain available; call\n * {@link CjsResMan#InvalidateReadCache} when they must also be forgotten.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object|null} [options=null] Exact identity settings, or `null` for all variants.\n * @returns {boolean} Whether at least one canonical resource was removed.\n * @throws {TypeError} If the path or identity settings cannot be normalized.\n * @throws {Error|AggregateError} If cleanup fails after identities are forgotten.\n */\n Delete(path, options = null) {\n if (options !== null && options !== undefined)\n {\n const normalizedPath = normalizeResourcePath(path);\n const key = getMotherLodeKey(normalizedPath, this.GetResourceVariant(options));\n const resource = this.motherLode.Lookup(key);\n try\n {\n return this.motherLode.Delete(key);\n }\n finally\n {\n if (resource && this.motherLode.Lookup(key) !== resource)\n {\n this.#InvalidateResourceOwnership(resource);\n }\n this.#reloadGenerations.delete(key);\n }\n }\n\n const normalizedPath = normalizeResourcePath(path);\n const prefix = `${normalizedPath}\\u0000`;\n const entries = typeof this.motherLode?.Entries === \"function\"\n ? [ ...this.motherLode.Entries() ].filter(([ key ]) =>\n key === normalizedPath || key.startsWith(prefix))\n : [];\n try\n {\n return this.motherLode.DeleteAllVariants(normalizedPath);\n }\n finally\n {\n for (const [ key, resource ] of entries)\n {\n this.#reloadGenerations.delete(key);\n if (this.motherLode.Lookup(key) !== resource)\n {\n this.#InvalidateResourceOwnership(resource);\n }\n }\n }\n }\n\n /**\n * Run one explicit deterministic identity/payload inactivity sweep.\n * This delegates policy and cleanup to MotherLode; it never fetches or\n * reloads a purged resource.\n *\n * @param {object} [options={}] MotherLode frame/time limits and cleanup policy.\n * @returns {object} Immutable purge counts and affected canonical keys.\n * @throws {TypeError} If the configured MotherLode lacks purge support or policy is invalid.\n * @throws {AggregateError} If one or more candidate resources fail cleanup.\n */\n PurgeInactive(options = {})\n {\n if (typeof this.motherLode?.PurgeInactive !== \"function\")\n {\n throw new TypeError(\"CjsResMan MotherLode does not support PurgeInactive().\");\n }\n return this.motherLode.PurgeInactive(options);\n }\n\n /**\n * Replace or disable the opt-in automatic inactivity policy. Configuration\n * resets cadence, so the first subsequent pump performs a sweep immediately.\n * Frame-based limits are rejected because manager updates are not a reliable\n * renderer-frame clock. The normalized policy is frozen and never reloads\n * resources.\n *\n * @param {CjsResManAutoPurgePolicy|false|null} [policy=null] Time-based policy, or `false`/`null` to disable automatic sweeping.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If the policy, threshold, cleanup control, or clock is invalid.\n */\n SetAutoPurgePolicy(policy = null)\n {\n this.#autoPurgePolicy = normalizeAutoPurgePolicy(policy);\n this.#lastAutoPurgeTime = null;\n return this;\n }\n\n /**\n * Return the immutable normalized automatic inactivity policy.\n *\n * @returns {Readonly<CjsResManAutoPurgePolicy>|null} Active policy, or `null` when automatic sweeping is disabled.\n */\n GetAutoPurgePolicy()\n {\n return this.#autoPurgePolicy;\n }\n\n /**\n * Report whether {@link CjsResMan#Update} may run automatic inactivity\n * sweeps. This is a pure query and does not advance cadence or activity.\n *\n * @returns {boolean} Whether an automatic purge policy is configured.\n */\n IsAutoPurgeEnabled()\n {\n return this.#autoPurgePolicy !== null;\n }\n\n /**\n * Run the configured automatic sweep when its minimum time interval has\n * elapsed. The first pump after configuration runs immediately. A regressing\n * clock rebases cadence and skips that pump; failures consume the interval so\n * repeated updates cannot form a cleanup-error storm. This method never\n * creates, fetches, prepares, or reloads a resource.\n *\n * @param {CjsResManAutoPurgePumpOptions} [options={}] Optional deterministic timestamp.\n * @returns {object|null} Immutable MotherLode purge result when due, otherwise `null`.\n * @throws {TypeError} If options, the clock result, or MotherLode purge policy are invalid.\n * @throws {AggregateError} If a due sweep cannot clean one or more inactive resources.\n */\n PumpAutoPurge(options = {})\n {\n const pump = normalizeAutoPurgePumpOptions(options);\n const policy = this.#autoPurgePolicy;\n if (!policy) return null;\n\n const time = pump.time === undefined ? policy.now() : pump.time;\n assertNonNegativeNumber(time, \"automatic purge time\");\n\n if (this.#lastAutoPurgeTime !== null)\n {\n if (time < this.#lastAutoPurgeTime)\n {\n this.#lastAutoPurgeTime = time;\n return null;\n }\n if (time - this.#lastAutoPurgeTime < policy.intervalMilliseconds)\n {\n return null;\n }\n }\n\n this.#lastAutoPurgeTime = time;\n return this.PurgeInactive({\n time,\n maxIdleMilliseconds: policy.maxIdleMilliseconds,\n payloadMaxIdleMilliseconds: policy.payloadMaxIdleMilliseconds,\n destroyAdapters: policy.destroyAdapters,\n releasePayload: policy.releasePayload,\n ...(policy.cleanup === undefined ? {} : { cleanup: policy.cleanup })\n });\n }\n\n /**\n * Cancel queued-but-not-started work, remove every canonical resource through\n * MotherLode cleanup, and reset all in-flight deduplication ledgers.\n *\n * @returns {CjsResMan} This empty resource manager.\n * @throws {AggregateError} If one or more canonical resources fail cleanup.\n */\n Clear() {\n this.#InvalidateMotherLodeOwnership(this.motherLode);\n this._loadQueue.Clear();\n this._prepareQueue.Clear();\n this.motherLode.Clear();\n this.objectOperations = new WeakMap();\n this.sourceOperations = new WeakMap();\n this.queuedSourceOperations = new WeakMap();\n this.formatOperations = new WeakMap();\n this.#reloadGenerations.clear();\n this.#lastAutoPurgeTime = null;\n return this;\n }\n\n /**\n * Detach reusable source and parsed-format records for one source path.\n * Omitting `sourceRevision` removes every revision for the selected source;\n * supplying it removes only that string/finite-number revision. Existing\n * consumers keep their promises: invalidation does not abort, reject, touch\n * MotherLode/payload ownership, or perform source work.\n *\n * `Delete()` deliberately remains resource-identity-only. Use this method\n * when explicitly retained read caches must also be forgotten; `Clear()`\n * resets every read ledger.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {CjsResManReadCacheOptions} [options={}] Optional `source` and exact `sourceRevision` selection.\n * @returns {Readonly<{path: string, queuedSource: number, source: number, format: number}>} Frozen detached-record counts.\n * @throws {TypeError} If path, source, revision, or options are invalid.\n */\n InvalidateReadCache(path, options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.InvalidateReadCache options must be an object.\");\n }\n const normalizedPath = normalizeResourcePath(path);\n const hasRevision = hasOwn(options, \"sourceRevision\");\n const revisionKey = hasRevision\n ? normalizeSourceRevision(options.sourceRevision)\n : null;\n const source = options.source || this.source;\n if (!source)\n {\n return Object.freeze({\n path: normalizedPath,\n queuedSource: 0,\n source: 0,\n format: 0\n });\n }\n if ((typeof source !== \"object\" && typeof source !== \"function\")\n || typeof source.Read !== \"function\")\n {\n throw new TypeError(\"CjsResMan.InvalidateReadCache source must provide Read(path, options).\");\n }\n\n return this.#InvalidateReadCache(source, normalizedPath, revisionKey);\n }\n\n /**\n * Read source data under source/path/revision cache identity. Cache policy is\n * tri-state: omitted shares in-flight or explicitly retained work, `true`\n * retains success, and `false` bypasses sharing and retention. Failures are\n * never retained. A joining `true` request upgrades the shared record.\n *\n * `reload: true` invalidates the selected source/path synchronously before\n * beginning fresh work; it does not cancel already detached consumers.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {CjsResManReadCacheOptions} [options={}] Source, revision, reload, and cache controls forwarded to the source.\n * @returns {Promise<*>} Promise for bytes or source-compatible data.\n * @throws {TypeError} If path, source, revision, cache policy, or options are invalid.\n */\n ReadResource(path, options = {})\n {\n const read = this.#BeginReadOperation(path, options);\n return this.#ReadResource(read.context, read.options);\n }\n\n /**\n * Normalize one source provenance context and invalidate stale path records\n * once at the outermost reload boundary.\n *\n * @param {string} path Source path.\n * @param {object} options Read options.\n * @returns {{context: Readonly<CjsResourceReadContext>, options: object}} Context and detached operation options.\n * @throws {TypeError} If source provenance or options are invalid.\n */\n #BeginReadOperation(path, options)\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan read options must be an object.\");\n }\n\n const normalizedPath = normalizeResourcePath(path);\n const inherited = READ_CONTEXTS.get(options);\n if (inherited && inherited.resMan === this && inherited.path === normalizedPath)\n {\n return { context: inherited, options };\n }\n\n const source = options.source || this.source;\n if (!source || (typeof source !== \"object\" && typeof source !== \"function\")\n || typeof source.Read !== \"function\")\n {\n throw new TypeError(\"CjsResMan requires a source with Read(path, options) to load objects.\");\n }\n const sourceRevision = options.sourceRevision;\n const revisionKey = normalizeSourceRevision(sourceRevision);\n normalizeCachePolicy(options.cacheSource, \"cacheSource\");\n normalizeCachePolicy(options.cacheFormat, \"cacheFormat\");\n\n const operationOptions = { ...options };\n const context = Object.freeze({\n resMan: this,\n source,\n path: normalizedPath,\n sourcePath: sourceRequiresUrl(source)\n ? this.BuildUrl(normalizedPath)\n : normalizedPath,\n sourceRevision,\n revisionKey\n });\n READ_CONTEXTS.set(operationOptions, context);\n\n if (options.reload === true)\n {\n this.#InvalidateReadCache(source, normalizedPath, null);\n }\n return { context, options: operationOptions };\n }\n\n /**\n * Queue one normalized source operation and deduplicate according to the\n * caller's cache policy.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @param {object} options Detached read options.\n * @returns {Promise<*>} Promise for source bytes/data.\n */\n #QueueReadResource(context, options)\n {\n const cachePolicy = normalizeCachePolicy(options.cacheSource, \"cacheSource\");\n const operations = getOwnerOperations(this.queuedSourceOperations, context.source, true);\n const key = getReadOperationKey(context);\n const bypassExisting = options.reload === true || cachePolicy === false;\n const existing = bypassExisting ? null : operations.get(key);\n if (existing)\n {\n if (cachePolicy === true)\n {\n existing.retain = true;\n const sourceRecord = getOwnerOperations(this.sourceOperations, context.source, false)?.get(key);\n if (sourceRecord) sourceRecord.retain = true;\n }\n return existing.promise;\n }\n\n /** @type {CjsResourceReadOperationRecord} */\n const record = {\n promise: null,\n path: context.path,\n revisionKey: context.revisionKey,\n retain: cachePolicy === true\n };\n record.promise = this.QueueTask(\n CjsResManQueue.BACKGROUND,\n () => this.#ReadResource(context, options, record),\n context.source,\n { kind: \"load\", path: context.path }\n ).promise;\n if (cachePolicy !== false) operations.set(key, record);\n\n record.promise.then(value =>\n {\n if (cachePolicy === false || operations.get(key) !== record) return;\n if (record.retain) this.#RetainSourceResult(context, value);\n operations.delete(key);\n }, () =>\n {\n if (cachePolicy !== false && operations.get(key) === record) operations.delete(key);\n });\n return record.promise;\n }\n\n /**\n * Run or join one normalized direct source operation.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @param {object} options Detached read options.\n * @param {CjsResourceReadOperationRecord|null} [queuedRecord=null] Parent queued record whose retention may be promoted by a later join.\n * @returns {Promise<*>} Promise for source bytes/data.\n */\n #ReadResource(context, options, queuedRecord = null)\n {\n const cachePolicy = normalizeCachePolicy(options.cacheSource, \"cacheSource\");\n const operations = getOwnerOperations(this.sourceOperations, context.source, true);\n const key = getReadOperationKey(context);\n const bypassExisting = options.reload === true || cachePolicy === false;\n const existing = bypassExisting ? null : operations.get(key);\n if (existing)\n {\n if (cachePolicy === true || queuedRecord?.retain) existing.retain = true;\n return existing.promise;\n }\n\n /** @type {CjsResourceReadOperationRecord} */\n const record = {\n promise: null,\n path: context.path,\n revisionKey: context.revisionKey,\n retain: cachePolicy === true || queuedRecord?.retain === true\n };\n record.promise = Promise.resolve().then(() =>\n this.resourceLoader.Read(\n context.source,\n context.sourcePath,\n {\n ...options,\n resourcePath: context.path\n }\n )\n );\n if (cachePolicy !== false) operations.set(key, record);\n record.promise.then(() =>\n {\n if (cachePolicy !== false && !record.retain && operations.get(key) === record)\n {\n operations.delete(key);\n }\n }, () =>\n {\n if (cachePolicy !== false && operations.get(key) === record) operations.delete(key);\n });\n return record.promise;\n }\n\n /**\n * Retain a settled source result when a queued caller upgraded cache policy\n * after the direct source promise had already completed its cleanup reaction.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @param {*} value Settled source result.\n * @returns {void}\n */\n #RetainSourceResult(context, value)\n {\n const operations = getOwnerOperations(this.sourceOperations, context.source, true);\n const key = getReadOperationKey(context);\n const existing = operations.get(key);\n if (existing)\n {\n existing.retain = true;\n return;\n }\n operations.set(key, {\n promise: Promise.resolve(value),\n path: context.path,\n revisionKey: context.revisionKey,\n retain: true\n });\n }\n\n /**\n * Remove future-reuse records matching one selected source and path.\n * A null revision removes all revisions.\n *\n * @param {object|Function} source Selected source.\n * @param {string} path Normalized source path.\n * @param {string|null} revisionKey Exact revision key or `null` for all.\n * @returns {Readonly<{path: string, queuedSource: number, source: number, format: number}>} Frozen detached counts.\n */\n #InvalidateReadCache(source, path, revisionKey)\n {\n const queuedSource = removeOperationRecords(\n getOwnerOperations(this.queuedSourceOperations, source, false),\n path,\n revisionKey\n );\n const sourceCount = removeOperationRecords(\n getOwnerOperations(this.sourceOperations, source, false),\n path,\n revisionKey\n );\n let format = 0;\n const descriptors = this.formatOperations.get(source);\n if (descriptors)\n {\n for (const [ descriptor, operations ] of descriptors)\n {\n format += removeOperationRecords(operations, path, revisionKey);\n if (operations.size === 0) descriptors.delete(descriptor);\n }\n if (descriptors.size === 0) this.formatOperations.delete(source);\n }\n return Object.freeze({ path, queuedSource, source: sourceCount, format });\n }\n\n /**\n * Construct and initialize one resource handle, optionally rejecting a\n * singleton alias before `Initialize()` can mutate the protected owner.\n *\n * @param {Function} Constructor Resource constructor selected for the outcome.\n * @param {string} path Normalized Carbon-style resource path.\n * @param {string} ext Normalized resource extension.\n * @param {object} [options={}] Constructor values, requested output, semantic requirement, and source provenance.\n * @param {object|Function|null} [disallowedAlias=null] Existing owner that a staged candidate must not reuse.\n * @returns {CjsResource} Initialized resource-compatible handle.\n * @throws {TypeError|Error} If construction, candidate identity, or initialization is invalid.\n */\n CreateResource(Constructor, path, ext, options = {}, disallowedAlias = null) {\n const resource = new Constructor(options.values);\n if (!resource || typeof resource.Initialize !== \"function\") {\n throw new TypeError(\"Resource constructor must create a CjsResource-compatible object.\");\n }\n if (disallowedAlias && resource === disallowedAlias)\n {\n throw reloadCandidateAliasError(path, resource);\n }\n resource.Initialize(path, ext, normalizeRequirement(options.requirement || options.payload || \"\"));\n if (typeof resource.SetObjectLoader === \"function\")\n {\n const loaderOptions = getResourceLoaderOptions(options, options.source || this.source);\n resource.SetObjectLoader(\n loadOptions => this.GetObject(\n path,\n mergeResourceLoaderOptions(loaderOptions, loadOptions)\n ),\n loaderOptions\n );\n }\n return resource;\n }\n\n /**\n * Resolve the current resource constructor for a semantic request. Explicit\n * requirement/payload selection precedes an emitted-output registration;\n * otherwise the generic `CjsResource` handle is used.\n *\n * @param {object} [options={}] Semantic requirement, payload, and emit request.\n * @returns {Function} Registered resource constructor or `CjsResource`.\n */\n ResolveResourceConstructor(options = {})\n {\n const requested = normalizeRequirement(options.requirement || options.payload);\n if (requested && this.resourceTypes.has(requested)) return this.resourceTypes.get(requested);\n\n const emitted = normalizeRequirement(options.emit);\n if (emitted && this.resourceTypes.has(emitted)) return this.resourceTypes.get(emitted);\n\n return CjsResource;\n }\n\n /**\n * Resolve the promised output tag used with the normalized source path.\n *\n * An explicit `variant` wins. Otherwise the requested emitted output is the\n * promise, followed by the semantic requirement/payload for resource-only\n * requests. Reader classes, constructors, and format options\n * are execution details and never enter this identity.\n *\n * @param {object} [options={}] Resource request containing an optional output tag.\n * @returns {string} Normalized promised output tag, or an empty string for the default outcome.\n * @throws {TypeError} If options or its selected tag is invalid.\n */\n GetResourceVariant(options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan resource variant options must be an object.\");\n }\n if (hasOwn(options, \"variant\")\n && options.variant !== undefined)\n {\n if (typeof options.variant !== \"string\" || options.variant.trim() === \"\")\n {\n throw new TypeError(\"CjsResMan explicit resource variant must be a non-empty string.\");\n }\n return normalizeResourceVariant(options.variant);\n }\n return normalizeResourceVariant(\n options.emit\n ?? options.requirement\n ?? options.payload\n ?? \"\"\n );\n }\n\n /**\n * Retain a low-level queue task only until settlement so `Wait()` can take a\n * synchronous snapshot without making completed values long-lived.\n *\n * @param {object} task Queue task returned by `CjsResManWorkQueue.Add()`.\n * @returns {object} The supplied task.\n */\n #TrackQueueTask(task)\n {\n this.#queueOperations.set(task, task.promise);\n task.promise.then(() =>\n {\n if (this.#queueOperations.get(task) === task.promise)\n {\n this.#queueOperations.delete(task);\n }\n }, () =>\n {\n if (this.#queueOperations.get(task) === task.promise)\n {\n this.#queueOperations.delete(task);\n }\n });\n return task;\n }\n\n /**\n * Open one active resource-mutation record. Queued records additionally own\n * a settlement promise visible to contemporaneous `Wait()` snapshots;\n * direct records block unsafe MotherLode replacement but remain outside that\n * two-queue fence.\n *\n * @param {boolean} queued Whether the operation belongs to the queued fence.\n * @returns {() => void} Idempotent record completion callback.\n */\n #BeginResourceOperation(queued)\n {\n this.#activeResourceOperations += 1;\n const id = queued ? this.#nextResourceOperationId++ : 0;\n let resolveDone = noop;\n const done = queued\n ? new Promise(resolve => { resolveDone = resolve; })\n : null;\n if (queued) this.#resourceOperations.set(id, done);\n let finished = false;\n return () =>\n {\n if (finished) return;\n finished = true;\n this.#activeResourceOperations = Math.max(0, this.#activeResourceOperations - 1);\n if (queued && this.#resourceOperations.get(id) === done)\n {\n this.#resourceOperations.delete(id);\n }\n resolveDone();\n };\n }\n\n /**\n * Return the known canonical authority for a resource and reject a known\n * stale generation. A never-bound resource returns `null` so historical\n * detached prepare/publication helpers remain compatible.\n *\n * @param {object|Function} resource Candidate resource handle.\n * @param {string} phase Operation phase used for stale diagnostics.\n * @returns {CjsResourceOwnership|null} Current authority or `null` when never bound.\n * @throws {Error} If a previously bound resource is no longer canonical.\n */\n #GetResourceOwnership(resource, phase)\n {\n const ownership = this.#resourceOwnership.get(resource) || null;\n if (!ownership) return null;\n this.#AssertResourceOwnership(ownership, phase);\n return ownership;\n }\n\n /**\n * Require a current manager-owned canonical resource authority.\n *\n * @param {object|Function} resource Candidate resource handle.\n * @param {string} phase Operation phase used for diagnostics.\n * @returns {CjsResourceOwnership} Current canonical authority.\n * @throws {Error} If the resource is unknown or no longer canonical.\n */\n #RequireResourceOwnership(resource, phase)\n {\n const ownership = this.#GetResourceOwnership(resource, phase);\n if (ownership) return ownership;\n throw resourceNotOwnedError(resource, phase);\n }\n\n /**\n * Test whether an asynchronous operation still owns publication authority.\n * Registry lookup failures are treated as stale ownership so they cannot\n * replace an operation's more useful underlying source/stage rejection.\n *\n * @param {CjsResourceOwnership} ownership Captured authority.\n * @returns {boolean} Whether the exact generation remains canonical.\n */\n #IsResourceOwnershipCurrent(ownership)\n {\n try\n {\n return Boolean(ownership\n && this.motherLode === ownership.owner\n && this.#resourceOwnership.get(ownership.resource) === ownership\n && !this.#invalidResourceOwnership.has(ownership.resource)\n && ownership.owner.Lookup(ownership.key) === ownership.resource\n && !ownership.resource.IsPurged?.());\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Assert exact canonical publication authority for one operation phase.\n *\n * @param {CjsResourceOwnership} ownership Captured authority.\n * @param {string} phase Human-readable operation phase.\n * @returns {void}\n * @throws {Error} Stable stale-operation error when ownership changed.\n */\n #AssertResourceOwnership(ownership, phase)\n {\n if (!this.#IsResourceOwnershipCurrent(ownership))\n {\n throw staleResourceOperationError(ownership, phase);\n }\n }\n\n /**\n * Assert a captured authority when a compatibility path supplied one.\n *\n * @param {CjsResourceMutationAuthority|null} ownership Optional canonical or reload-candidate authority.\n * @param {string} phase Human-readable operation phase.\n * @returns {void}\n */\n #AssertOptionalResourceOwnership(ownership, phase)\n {\n if (!ownership) return;\n if (ownership.reloadCandidate === true)\n {\n this.#AssertReloadCandidate(ownership, phase);\n return;\n }\n this.#AssertResourceOwnership(ownership, phase);\n }\n\n /**\n * Test the exact former owner plus newest-request token for an off-registry\n * candidate. Lookup failures are treated as stale so detached work cannot\n * resurrect a deleted, cleared, replaced, or superseded identity.\n *\n * @param {CjsResourceReloadCandidate} candidate Candidate authority.\n * @returns {boolean} Whether this candidate alone may still commit.\n */\n #IsReloadCandidateCurrent(candidate)\n {\n try\n {\n return Boolean(candidate\n && candidate.reloadCandidate === true\n && this.motherLode === candidate.owner\n && this.#reloadCandidates.get(candidate.resource) === candidate\n && this.#reloadGenerations.get(candidate.key) === candidate.generation\n && this.#resourceOwnership.get(candidate.expected) === candidate.expectedOwnership\n && this.#IsResourceOwnershipCurrent(candidate.expectedOwnership)\n && candidate.owner.Lookup(candidate.key) === candidate.expected);\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Assert that a staged candidate still owns newest-request publication\n * authority for one operation phase.\n *\n * @param {CjsResourceReloadCandidate} candidate Candidate authority.\n * @param {string} phase Human-readable operation phase.\n * @returns {void}\n * @throws {Error} Stable stale-candidate error when authority changed.\n */\n #AssertReloadCandidate(candidate, phase)\n {\n if (!this.#IsReloadCandidateCurrent(candidate))\n {\n throw staleReloadCandidateError(candidate, phase);\n }\n }\n\n /**\n * Invalidate the currently recorded generation for a removed resource.\n *\n * @param {object|Function} resource Removed or displaced resource.\n * @returns {void}\n */\n #InvalidateResourceOwnership(resource)\n {\n if (resource && (typeof resource === \"object\" || typeof resource === \"function\"))\n {\n this.#invalidResourceOwnership.add(resource);\n }\n }\n\n /**\n * Invalidate every generation currently owned by one registry. This runs\n * before Clear cancellation/cleanup so reentrant observers cannot retain\n * authority after canonical ownership removal begins.\n *\n * @param {CjsMotherLode|null|undefined} owner Registry losing ownership.\n * @returns {void}\n */\n #InvalidateMotherLodeOwnership(owner)\n {\n if (typeof owner?.Entries !== \"function\") return;\n for (const [ , resource ] of owner.Entries())\n {\n const ownership = this.#resourceOwnership.get(resource);\n if (ownership?.owner === owner) this.#invalidResourceOwnership.add(resource);\n }\n }\n\n /**\n * Add one operation-owned purge lock and release it only while the exact\n * captured canonical record still exists. If removal/replacement made the\n * operation stale, its former MotherLode record (and lock count) no longer\n * exists, so releasing through a rebound resource would corrupt a new owner.\n *\n * @param {CjsResourceOwnership} ownership Captured canonical authority.\n * @returns {() => void} Idempotent balanced release callback.\n */\n #AcquireResourcePurgeLock(ownership)\n {\n const { owner, key } = ownership;\n if (typeof owner?.Lock !== \"function\" || typeof owner?.Unlock !== \"function\")\n {\n return noop;\n }\n\n this.#AssertResourceOwnership(ownership, \"lock:acquire\");\n owner.Lock(key);\n let released = false;\n return () =>\n {\n if (released) return;\n released = true;\n if (this.#IsResourceOwnershipCurrent(ownership)) owner.Unlock(key);\n };\n }\n\n /**\n * Bind resource-facing liveness methods to one canonical MotherLode key.\n * The controller contains no loader/reload callback, so touching a detached\n * or purged handle cannot start browser/network work.\n *\n * @param {string} key Canonical MotherLode identity.\n * @param {object|Function} resource Canonical resource handle.\n * @returns {object|Function} The supplied resource.\n */\n /**\n * Reload a purged handle back into itself.\n *\n * Purge deletes the payload and drops the registry entry, so a consumer left\n * holding the handle has no way to reach a replacement - it cannot discover\n * one, and nothing hands it over. Recovery therefore has to fill THIS handle\n * rather than resolve whatever the manager currently caches for the path.\n *\n * The handle is re-registered BEFORE loading, so the ordinary load path finds\n * it as the canonical identity and loads into it instead of minting another.\n *\n * Declines rather than guesses in two cases: when another resource has since\n * claimed the identity - displacing it would kill whoever holds that one, the\n * very failure being fixed here - and when the retained request no longer\n * resolves to the same identity, which would re-register the handle under the\n * wrong key.\n *\n * @param {string} key Canonical resolved identity key.\n * @param {CjsResource} resource The purged handle to restore.\n * @returns {boolean} Whether a reload was started.\n */\n #ReloadPurgedResource(key, resource)\n {\n if (!resource?.IsPurged?.()) return false;\n\n try\n {\n const current = this.motherLode.Lookup(key);\n if (current && current !== resource) return false;\n\n const request = resource.GetObjectRequest?.() || {};\n const path = normalizeResourcePath(resource.GetPath());\n if (getMotherLodeKey(path, this.GetResourceVariant(request)) !== key) return false;\n\n // Leave PURGED first: ownership is not considered current while purged,\n // so binding before this would produce a controller that no-ops.\n resource.MarkRequested();\n if (!current) this.motherLode.Insert(key, resource, { replace: true });\n this.#invalidResourceOwnership.delete(resource);\n this.#BindResourceLifecycle(key, resource);\n\n // Failure is recorded on the resource and observed through `completed`.\n this.GetObject(path, request).catch(() => {});\n return true;\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Give one resource the liveness callbacks its consumers never manage\n * themselves: activity renewal, payload renewal, lock counting, and the\n * reload hook that revives the handle after a purge.\n *\n * Ownership is captured by generation, so a late release can never renew or\n * unlock a rebound owner. The reload hook is bound outside the lifecycle\n * controller because that controller is detached exactly when canonical\n * ownership ends, which is precisely when a purged handle needs to come back.\n *\n * @param {string} key Canonical resolved key.\n * @param {object} resource Resource handle to bind.\n * @returns {object} The same resource handle.\n */\n #BindResourceLifecycle(key, resource)\n {\n const owner = this.motherLode;\n let ownership = this.#resourceOwnership.get(resource) || null;\n if (!ownership\n || ownership.owner !== owner\n || ownership.key !== key\n || ownership.resource !== resource\n || !this.#IsResourceOwnershipCurrent(ownership))\n {\n ownership = Object.freeze({\n generation: this.#nextResourceOwnershipGeneration++,\n owner,\n key,\n resource\n });\n this.#resourceOwnership.set(resource, ownership);\n this.#invalidResourceOwnership.delete(resource);\n }\n\n // Bound outside the lifecycle controller, which is detached when canonical\n // ownership ends - which is precisely when a handle needs to come back.\n resource?.SetReloadHook?.(() => this.#ReloadPurgedResource(key, resource));\n\n if (typeof resource?.SetLifecycleController !== \"function\") return resource;\n resource.SetLifecycleController(Object.freeze({\n isCurrent: () => this.#IsResourceOwnershipCurrent(ownership),\n keepAlive: options => this.#IsResourceOwnershipCurrent(ownership)\n ? owner.KeepAlive?.(key, options)\n : null,\n keepPayloadAlive: options =>\n {\n if (!this.#IsResourceOwnershipCurrent(ownership)) return null;\n if (typeof owner.KeepPayloadAlive === \"function\")\n {\n return owner.KeepPayloadAlive(key, options);\n }\n return owner.KeepAlive?.(key, options);\n },\n lock: () => this.#IsResourceOwnershipCurrent(ownership)\n ? owner.Lock?.(key) || 0\n : 0,\n unlock: () => this.#IsResourceOwnershipCurrent(ownership)\n ? owner.Unlock?.(key) || 0\n : 0\n }));\n if (resource.HasPayload?.() && this.#IsResourceOwnershipCurrent(ownership))\n {\n owner.KeepPayloadAlive?.(key);\n }\n return resource;\n }\n\n /**\n * Bind lifecycle callbacks for resources supplied by a configured custom\n * MotherLode before CjsResMan begins serving them.\n *\n * @returns {CjsResMan} This resource manager.\n */\n #BindMotherLodeResources()\n {\n if (typeof this.motherLode?.Entries !== \"function\") return this;\n for (const [ key, resource ] of this.motherLode.Entries())\n {\n this.#BindResourceLifecycle(key, resource);\n }\n return this;\n }\n\n /**\n * Run or join one format read under source/path/revision, frozen descriptor,\n * and effective output-option identity. Descriptor identity prevents a\n * re-registration with different defaults from reusing an old parse, while\n * source identity prevents same-path reads from different sources colliding.\n *\n * `cacheFormat` uses the same tri-state policy as source caching: omitted is\n * in-flight by default, `true` retains success, and `false` bypasses sharing\n * and retention. `reload: true` never joins a prior parse. Failures are never\n * retained, and a joining `true` request upgrades a shared record. Requests\n * with option instances that cannot be represented safely bypass format\n * sharing regardless of cache policy.\n *\n * @param {CjsResource} resource Resource whose normalized path identifies the source data.\n * @param {object} descriptor Frozen registered format descriptor.\n * @param {*} bytes Source bytes or source-compatible reader input.\n * @param {object} [options={}] Source provenance, reload, cacheFormat, emit, classes, and format options.\n * @returns {Promise<*>} Promise for the parsed or converted format result.\n * @throws {TypeError|Error} If resource, source, revision, descriptor, cache policy, or format execution is invalid.\n */\n ReadFormatOnce(resource, descriptor, bytes, options = {})\n {\n const read = this.#BeginReadOperation(resource.GetPath(), options);\n const cachePolicy = normalizeCachePolicy(read.options.cacheFormat, \"cacheFormat\");\n const key = getFormatOperationKey(read.context, read.options);\n const cacheableOptions = key !== null && cachePolicy !== false;\n const descriptorOperations = cacheableOptions\n ? getFormatDescriptorOperations(\n this.formatOperations,\n read.context.source,\n descriptor,\n true\n )\n : null;\n const bypassExisting = read.options.reload === true\n || !cacheableOptions;\n const existing = bypassExisting ? null : descriptorOperations.get(key);\n if (existing)\n {\n if (cachePolicy === true) existing.retain = true;\n return existing.promise;\n }\n\n /** @type {CjsResourceReadOperationRecord} */\n const record = {\n promise: Promise.resolve().then(() => this.ReadFormat(descriptor, bytes, read.options)),\n path: read.context.path,\n revisionKey: read.context.revisionKey,\n retain: cachePolicy === true\n };\n if (cacheableOptions) descriptorOperations.set(key, record);\n record.promise.then(() =>\n {\n if (cacheableOptions\n && !record.retain\n && descriptorOperations.get(key) === record)\n {\n descriptorOperations.delete(key);\n }\n }, () =>\n {\n if (cacheableOptions\n && descriptorOperations.get(key) === record)\n {\n descriptorOperations.delete(key);\n }\n });\n return record.promise;\n }\n}\n\n/**\n * Copy supported registered format defaults into a deeply frozen snapshot.\n * Plain objects and arrays may be cyclic. Functions and primitives are stable\n * leaves; values with hidden mutable state are rejected because freezing their\n * wrapper would not make the represented behavior immutable.\n *\n * @param {object} defaults Registered format defaults.\n * @param {WeakMap<object, object>} [seen=new WeakMap()] Source-to-snapshot cycle map.\n * @returns {Readonly<object>} Deeply frozen plain defaults snapshot.\n * @throws {TypeError} If defaults contain unsupported objects, accessors, symbols, or byte buffers.\n */\nfunction snapshotFormatDefaults(defaults, seen = new WeakMap())\n{\n if (!defaults || typeof defaults !== \"object\" || Array.isArray(defaults))\n {\n throw new TypeError(\"CjsResMan format defaults must be a plain object.\");\n }\n return snapshotFormatDefaultValue(defaults, seen, \"defaults\");\n}\n\n/**\n * Snapshot one value in a registered format-default tree.\n *\n * @param {*} value Source value.\n * @param {WeakMap<object, object>} seen Source-to-snapshot cycle map.\n * @param {string} path Diagnostic property path.\n * @returns {*} Frozen snapshot value or stable primitive/function leaf.\n * @throws {TypeError} If the value cannot be made structurally immutable.\n */\nfunction snapshotFormatDefaultValue(value, seen, path)\n{\n if (value === null || value === undefined) return value;\n const type = typeof value;\n if ([ \"string\", \"number\", \"boolean\", \"bigint\" ].includes(type)) return value;\n if (type === \"function\") return value;\n if (type !== \"object\" || ArrayBuffer.isView(value) || value instanceof ArrayBuffer)\n {\n throw new TypeError(`CjsResMan format ${path} cannot be snapshotted immutably.`);\n }\n\n const prior = seen.get(value);\n if (prior) return prior;\n if (Array.isArray(value))\n {\n const snapshot = [];\n seen.set(value, snapshot);\n for (let index = 0; index < value.length; index += 1)\n {\n if (!hasOwn(value, index))\n {\n throw new TypeError(`CjsResMan format ${path} must not contain sparse arrays.`);\n }\n snapshot.push(snapshotFormatDefaultValue(value[index], seen, `${path}[${index}]`));\n }\n return Object.freeze(snapshot);\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null)\n {\n throw new TypeError(`CjsResMan format ${path} must contain only plain objects and arrays.`);\n }\n if (Object.getOwnPropertySymbols(value).length > 0)\n {\n throw new TypeError(`CjsResMan format ${path} must not contain symbol keys.`);\n }\n\n const snapshot = prototype === null ? Object.create(null) : {};\n seen.set(value, snapshot);\n for (const key of Object.getOwnPropertyNames(value))\n {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (!descriptor.enumerable || !(\"value\" in descriptor))\n {\n throw new TypeError(`CjsResMan format ${path}.${key} must be an enumerable data property.`);\n }\n snapshot[key] = snapshotFormatDefaultValue(descriptor.value, seen, `${path}.${key}`);\n }\n return Object.freeze(snapshot);\n}\n\n/**\n * Normalize an opaque caller/source revision without interpreting content.\n * String and number tokens remain type-distinct; finite numeric `-0` and `0`\n * intentionally identify the same revision.\n *\n * @param {string|number|undefined} value Caller-provided source content token.\n * @returns {string} Type-stable internal revision key.\n * @throws {TypeError} If the token is neither a string nor finite number.\n */\nfunction normalizeSourceRevision(value)\n{\n if (value === undefined) return \"undefined\";\n if (typeof value === \"string\") return `string:${value}`;\n if (typeof value === \"number\" && Number.isFinite(value))\n {\n return `number:${Object.is(value, -0) ? 0 : value}`;\n }\n throw new TypeError(\"CjsResMan sourceRevision must be a string or finite number.\");\n}\n\n/**\n * Validate tri-state source/format cache policy.\n *\n * @param {boolean|undefined} value Cache policy value.\n * @param {string} name Option name used in failures.\n * @returns {boolean|undefined} The validated policy.\n * @throws {TypeError} If the value is not boolean or omitted.\n */\nfunction normalizeCachePolicy(value, name)\n{\n if (value !== undefined && typeof value !== \"boolean\")\n {\n throw new TypeError(`CjsResMan ${name} must be a boolean when supplied.`);\n }\n return value;\n}\n\n/**\n * Get the operation map owned by one source object.\n *\n * @param {WeakMap<object|Function, Map<string, CjsResourceReadOperationRecord>>} ledger Source-keyed ledger.\n * @param {object|Function} owner Source owner.\n * @param {boolean} create Whether a missing map should be allocated.\n * @returns {Map<string, CjsResourceReadOperationRecord>|null} Owner map or `null`.\n */\nfunction getOwnerOperations(ledger, owner, create)\n{\n let operations = ledger.get(owner);\n if (!operations && create)\n {\n operations = new Map();\n ledger.set(owner, operations);\n }\n return operations || null;\n}\n\n/**\n * Get the source/path/revision operation key for one normalized read context.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @returns {string} Internal read-operation key.\n */\nfunction getReadOperationKey(context)\n{\n return `${context.path}\\u0000${context.revisionKey}`;\n}\n\n/**\n * Get the descriptor-specific format operation map for a selected source.\n * Frozen descriptor identity isolates changed registration defaults.\n *\n * @param {WeakMap<object|Function, Map<object, Map<string, CjsResourceReadOperationRecord>>>} ledger Format ledger.\n * @param {object|Function} source Selected source owner.\n * @param {object} descriptor Frozen registered descriptor.\n * @param {boolean} create Whether missing maps should be allocated.\n * @returns {Map<string, CjsResourceReadOperationRecord>|null} Descriptor map or `null`.\n */\nfunction getFormatDescriptorOperations(ledger, source, descriptor, create)\n{\n let descriptors = ledger.get(source);\n if (!descriptors && create)\n {\n descriptors = new Map();\n ledger.set(source, descriptors);\n }\n if (!descriptors) return null;\n\n let operations = descriptors.get(descriptor);\n if (!operations && create)\n {\n operations = new Map();\n descriptors.set(descriptor, operations);\n }\n return operations || null;\n}\n\n/**\n * Build a descriptor-local format cache key from source provenance and the\n * output options that materially affect the format reader result.\n * Requests containing non-canonical mutable option objects bypass format-cache\n * sharing instead of risking a false key match.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @param {object} options Format request options.\n * @returns {string|null} Internal format-operation key, or `null` to bypass caching.\n */\nfunction getFormatOperationKey(context, options)\n{\n const material = [\n options.emit,\n options.mediaType,\n options.classes,\n options.formatOptions\n ];\n if (!material.every(value => isCanonicalFormatCacheValue(value))) return null;\n return `${getReadOperationKey(context)}\\u0000${material\n .map(value => serializeFormatCacheValue(value))\n .join(\"\\u0001\")}`;\n}\n\n/**\n * Return true when a format cache option can be represented without guessing\n * hidden mutable state. Plain objects/arrays, functions by identity, and\n * byte-addressable buffers/views are supported. Other class instances bypass\n * format-cache sharing.\n *\n * @param {*} value Candidate material format option.\n * @param {WeakSet<object|Function>} [seen=new WeakSet()] Cycle guard.\n * @returns {boolean} Whether deterministic cache serialization is supported.\n */\nfunction isCanonicalFormatCacheValue(value, seen = new WeakSet())\n{\n if (value === null || value === undefined) return true;\n if ([ \"string\", \"number\", \"boolean\", \"bigint\" ].includes(typeof value)) return true;\n if (typeof value === \"function\") return true;\n if (typeof value !== \"object\") return false;\n if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return true;\n if (seen.has(value)) return true;\n seen.add(value);\n if (Array.isArray(value))\n {\n return value.every(entry => isCanonicalFormatCacheValue(entry, seen));\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) return false;\n if (Object.getOwnPropertySymbols(value).length > 0) return false;\n return Object.getOwnPropertyNames(value).every(key =>\n {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n return descriptor.enumerable\n && \"value\" in descriptor\n && isCanonicalFormatCacheValue(descriptor.value, seen);\n });\n}\n\n/**\n * Serialize one supported material format option with process-local identity\n * for objects and functions. Identity prevents same-named constructors and\n * separate option graphs from colliding; visible plain-object/array/buffer\n * contents ensure mutation changes the next operation key.\n *\n * @param {*} value Canonically supported format option.\n * @param {WeakSet<object|Function>} [seen=new WeakSet()] Cycle guard.\n * @returns {string} Deterministic cache-local representation.\n */\nfunction serializeFormatCacheValue(value, seen = new WeakSet())\n{\n if (value === undefined) return \"undefined\";\n if (value === null) return \"null\";\n if (typeof value === \"string\") return `string:${JSON.stringify(value)}`;\n if (typeof value === \"number\")\n {\n if (Number.isNaN(value)) return \"number:NaN\";\n if (Object.is(value, -0)) return \"number:-0\";\n return `number:${String(value)}`;\n }\n if (typeof value === \"boolean\") return `boolean:${value}`;\n if (typeof value === \"bigint\") return `bigint:${value}`;\n if (typeof value === \"function\") return `function:${getLocalValueIdentity(value)}`;\n\n const identity = getLocalValueIdentity(value);\n if (seen.has(value)) return `reference:${identity}`;\n seen.add(value);\n if (ArrayBuffer.isView(value))\n {\n const bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);\n return `view:${identity}:${value.constructor.name}:${[ ...bytes ].join(\",\")}`;\n }\n if (value instanceof ArrayBuffer)\n {\n return `buffer:${identity}:${[ ...new Uint8Array(value) ].join(\",\")}`;\n }\n if (Array.isArray(value))\n {\n return `array:${identity}:[${value\n .map(entry => serializeFormatCacheValue(entry, seen))\n .join(\",\")}]`;\n }\n return `object:${identity}:{${Object.keys(value)\n .sort()\n .map(key => `${JSON.stringify(key)}:${serializeFormatCacheValue(value[key], seen)}`)\n .join(\",\")}}`;\n}\n\n/**\n * Return a process-local identity for a parsed-format cache object or function.\n *\n * @param {object|Function} value Candidate option identity owner.\n * @returns {number} Stable identity for the life of the value.\n */\nfunction getLocalValueIdentity(value)\n{\n let identity = LOCAL_VALUE_IDENTITIES.get(value);\n if (!identity)\n {\n identity = nextLocalValueIdentity++;\n LOCAL_VALUE_IDENTITIES.set(value, identity);\n }\n return identity;\n}\n\n/**\n * Remove operation records matching a normalized path and optional revision.\n * Detached promises continue for their existing consumers.\n *\n * @param {Map<string, CjsResourceReadOperationRecord>|null} operations Candidate operation map.\n * @param {string} path Normalized source path.\n * @param {string|null} revisionKey Exact revision or `null` for all revisions.\n * @returns {number} Number of detached records.\n */\nfunction removeOperationRecords(operations, path, revisionKey)\n{\n if (!operations) return 0;\n let removed = 0;\n for (const [ key, record ] of operations)\n {\n if (record.path !== path) continue;\n if (revisionKey !== null && record.revisionKey !== revisionKey) continue;\n if (operations.delete(key)) removed += 1;\n }\n return removed;\n}\n\n/**\n * Copy the compact requested-output fields needed for explicit payload\n * reconstruction. This request is retained with the handle but never enters\n * MotherLode identity beyond its `variant`/`emit` output tag.\n *\n * @param {object} [options={}] Original resource request.\n * @returns {object} Shallow reconstruction request without cache/reload policy.\n */\nfunction getResourceRequestOptions(options = {})\n{\n const request = {};\n for (const key of RESOURCE_REQUEST_OPTION_KEYS)\n {\n if (options[key] !== undefined) request[key] = options[key];\n }\n return request;\n}\n\n/**\n * Capture the compact output request plus effective source provenance needed\n * to reconstruct a released resource payload. Cache policy and one-shot reload\n * are intentionally not retained. Retaining the effective source prevents an\n * old revision token from being applied to a later manager default source.\n *\n * @param {object} [options={}] Requested output and source provenance options.\n * @param {object|Function|null} [effectiveSource=null] Source selected when the resource was created.\n * @returns {object} Detached loader options safe to retain with the resource.\n */\nfunction getResourceLoaderOptions(options = {}, effectiveSource = null)\n{\n const loaderOptions = getResourceRequestOptions(options);\n if (effectiveSource) loaderOptions.source = effectiveSource;\n for (const key of [ \"sourceRevision\", \"ext\" ])\n {\n if (hasOwn(options, key))\n {\n loaderOptions[key] = options[key];\n }\n }\n return loaderOptions;\n}\n\n/**\n * Merge per-operation controls with a resource's compact reconstruction\n * request. Once the handle has a promised-output field, all output selectors\n * remain pinned to the retained request so `Ready()` cannot publish a\n * different result under the existing MotherLode identity. Retained source\n * provenance is pinned as well; cache/reload controls remain explicit per-call\n * overrides.\n *\n * @param {object} base Retained reconstruction request.\n * @param {object} [overrides={}] Per-call operation controls.\n * @returns {object} Merged request with stable promised-output fields.\n */\nfunction mergeResourceLoaderOptions(base, overrides = {})\n{\n const result = { ...base, ...overrides };\n const pinsOutput = RESOURCE_OUTPUT_OPTION_KEYS.some(key =>\n hasOwn(base, key)\n && base[key] !== undefined\n );\n if (pinsOutput)\n {\n for (const key of RESOURCE_OUTPUT_OPTION_KEYS)\n {\n if (hasOwn(base, key) && base[key] !== undefined)\n {\n result[key] = base[key];\n }\n else\n {\n delete result[key];\n }\n }\n }\n for (const key of RESOURCE_PROVENANCE_OPTION_KEYS)\n {\n if (hasOwn(base, key)) result[key] = base[key];\n }\n return result;\n}\n\n/**\n * Filter current format descriptors using request material available before\n * source bytes are read. Byte-dependent support probes are deferred.\n *\n * @param {readonly object[]} descriptors Registered descriptors for one extension.\n * @param {object} options Format, output, and media selection.\n * @returns {object[]} Matching descriptors in registration order.\n */\nfunction filterFormatDescriptors(descriptors, options)\n{\n let candidates = [ ...descriptors ];\n if (options.format)\n {\n candidates = candidates.filter(({ Format }) => Format === options.format\n || Format.id === options.format\n || Format.name === options.format);\n }\n if (options.emit !== undefined)\n {\n candidates = candidates.filter(({ Format }) =>\n findDeclaredOutput(getFormatOutputs(Format), options.emit) !== null);\n }\n if (options.mediaType)\n {\n candidates = candidates.filter(({ Format }) =>\n (Format.mediaTypes || []).includes(options.mediaType));\n }\n return candidates;\n}\n\n/**\n * Return one format facade's normal and diagnostic output declarations.\n *\n * @param {Function} Format Registered format facade.\n * @returns {Array<*>} Declared output values in selection order.\n */\nfunction getFormatOutputs(Format)\n{\n return [\n ...(Format.outputTypes || []),\n ...(Format.debugOutputTypes || [])\n ];\n}\n\n/**\n * Resolve a case-insensitive output selector to its canonical declared\n * spelling. MotherLode tags stay lowercase while readers receive declarations\n * such as `cmfJson` or `gr2Json` exactly as authored.\n *\n * @param {readonly *[]} outputs Declared output values.\n * @param {*} requested Requested output selector.\n * @returns {string|null} Canonical declaration, or `null` when unsupported.\n */\nfunction findDeclaredOutput(outputs, requested)\n{\n const normalized = normalizeResourceVariant(requested);\n for (const output of outputs)\n {\n if (typeof output !== \"string\") continue;\n if (normalizeResourceVariant(output) === normalized) return output;\n }\n return null;\n}\n\n/**\n * Create the stable failure used when a registered input format cannot emit a\n * requested output tag.\n *\n * @param {string} ext Normalized source extension.\n * @param {*} emit Requested output tag.\n * @param {readonly object[]} descriptors Registered input-format descriptors.\n * @returns {Error} Contextual unsupported-output error.\n */\nfunction createFormatOutputMissingError(ext, emit, descriptors)\n{\n const error = new Error(`No format registered for .${ext} emits ${JSON.stringify(emit)}.`);\n error.code = \"CJS_RESOURCE_FORMAT_OUTPUT_MISSING\";\n error.ext = ext;\n error.emit = emit;\n error.formats = descriptors.map(({ Format }) => Format.name);\n return error;\n}\n\n/**\n * Create the stable failure used when a direct object loader cannot satisfy a\n * forced output request.\n *\n * @param {string} ext Normalized source extension.\n * @param {*} emit Requested output tag.\n * @returns {Error} Contextual unsupported-output error.\n */\nfunction createObjectLoaderOutputMissingError(ext, emit)\n{\n const error = new Error(\n `Direct loader for .${ext} exposes only its unforced default; it does not emit ${JSON.stringify(emit)}.`\n );\n error.code = \"CJS_RESOURCE_FORMAT_OUTPUT_MISSING\";\n error.ext = ext;\n error.emit = emit;\n error.formats = [];\n return error;\n}\n\n/**\n * Resolve one descriptor from the current candidate set. When bytes are\n * present, support probes may disambiguate candidates.\n *\n * @param {readonly object[]} descriptors Candidate descriptors from current registration.\n * @param {string} ext Normalized resource extension.\n * @param {object} options Effective format options and optional source bytes.\n * @returns {object} Selected descriptor.\n * @throws {Error} If the candidate set is missing or remains ambiguous.\n */\nfunction resolveFormatDescriptorCandidates(descriptors, ext, options)\n{\n let candidates = [ ...descriptors ];\n if (candidates.length > 1 && options.bytes !== undefined)\n {\n const supported = candidates.filter(descriptor =>\n {\n const { Format, defaults } = descriptor;\n const isSupported = Format.isSupported;\n if (typeof isSupported !== \"function\") return false;\n const report = isSupported.call(Format, options.bytes, {\n ...defaults,\n ...(options.formatOptions || {})\n });\n return report && report.supported !== false;\n });\n if (supported.length === 1) candidates = supported;\n }\n\n if (candidates.length === 0)\n {\n const error = new Error(`No format registered for .${ext}`);\n error.code = \"CJS_RESOURCE_FORMAT_MISSING\";\n error.ext = ext;\n throw error;\n }\n if (candidates.length > 1)\n {\n const error = new Error(`Ambiguous formats registered for .${ext}`);\n error.code = \"CJS_RESOURCE_FORMAT_AMBIGUOUS\";\n error.ext = ext;\n error.formats = candidates.map(({ Format }) => Format.name);\n throw error;\n }\n return candidates[0];\n}\n\nfunction normalizeRequirement(value)\n{\n return value === null || value === undefined\n ? \"\"\n : String(value).trim().toLowerCase();\n}\n\n/**\n * Normalize one human-readable promised output tag.\n *\n * @param {*} value Candidate `variant`, `emit`, requirement, or payload tag.\n * @returns {string} Trimmed lowercase tag, or an empty string.\n * @throws {TypeError} If a non-empty tag is not a string or contains the internal key delimiter.\n */\nfunction normalizeResourceVariant(value)\n{\n if (value === null || value === undefined || value === \"\") return \"\";\n if (typeof value !== \"string\")\n {\n throw new TypeError(\"CjsResMan resource variant must be a string.\");\n }\n const normalized = value.trim().toLowerCase();\n if (normalized.includes(\"\\u0000\"))\n {\n throw new TypeError(\"CjsResMan resource variant may not contain a null character.\");\n }\n return normalized;\n}\n\nfunction createPrepareContext(resMan, resource, bytes, options, stage)\n{\n return Object.freeze({\n ...options,\n stage,\n bytes,\n path: resource.GetPath(),\n ext: resource.GetExt(),\n resource,\n resMan\n });\n}\n\n/**\n * Recover the public object result represented by a resident resource payload.\n * The publication contract returns semantic subclasses as their resource\n * handle and base resources as their plain payload.\n *\n * @param {CjsResource} resource Resource with an attached CPU payload.\n * @returns {*} Resident public object outcome.\n */\nfunction getPublishedResourceObject(resource)\n{\n return resource.constructor !== CjsResource\n ? resource\n : resource.GetPayload();\n}\n\nfunction assertPositiveInteger(value, name)\n{\n if (!Number.isInteger(value) || value < 1) {\n throw new TypeError(`CjsResMan ${name} must be a positive integer.`);\n }\n}\n\nfunction assertNonNegativeInteger(value, name)\n{\n if (!Number.isInteger(value) || value < 0) {\n throw new TypeError(`CjsResMan ${name} must be a non-negative integer.`);\n }\n}\n\nfunction assertNonNegativeNumber(value, name)\n{\n if (typeof value !== \"number\" || !Number.isFinite(value) || value < 0) {\n throw new TypeError(`CjsResMan ${name} must be a non-negative finite number.`);\n }\n}\n\n/**\n * Normalize and freeze an opt-in time-based automatic purge policy.\n *\n * @param {CjsResManAutoPurgePolicy|false|null} policy Caller policy or disable marker.\n * @returns {Readonly<CjsResManAutoPurgePolicy>|null} Frozen normalized policy, or `null` when disabled.\n * @throws {TypeError} If fields, limits, cleanup controls, or the cadence clock are invalid.\n */\nfunction normalizeAutoPurgePolicy(policy)\n{\n if (policy === null || policy === undefined || policy === false) return null;\n if (!policy || typeof policy !== \"object\" || Array.isArray(policy))\n {\n throw new TypeError(\"CjsResMan autoPurgePolicy must be an object, false, or null.\");\n }\n\n const allowed = new Set([\n \"intervalMilliseconds\",\n \"maxIdleMilliseconds\",\n \"payloadMaxIdleMilliseconds\",\n \"destroyAdapters\",\n \"releasePayload\",\n \"cleanup\",\n \"now\"\n ]);\n const unsupported = Object.keys(policy).filter(key => !allowed.has(key));\n if (unsupported.length)\n {\n throw new TypeError(`CjsResMan autoPurgePolicy does not support: ${unsupported.join(\", \")}.`);\n }\n\n const intervalMilliseconds = policy.intervalMilliseconds ?? 1000;\n assertNonNegativeNumber(intervalMilliseconds, \"autoPurgePolicy.intervalMilliseconds\");\n for (const name of [ \"maxIdleMilliseconds\", \"payloadMaxIdleMilliseconds\" ])\n {\n if (policy[name] !== undefined)\n {\n assertNonNegativeNumber(policy[name], `autoPurgePolicy.${name}`);\n }\n }\n if (policy.maxIdleMilliseconds === undefined\n && policy.payloadMaxIdleMilliseconds === undefined)\n {\n throw new TypeError(\"CjsResMan autoPurgePolicy requires an identity or payload inactivity limit.\");\n }\n for (const name of [ \"destroyAdapters\", \"releasePayload\" ])\n {\n if (policy[name] !== undefined && typeof policy[name] !== \"boolean\")\n {\n throw new TypeError(`CjsResMan autoPurgePolicy.${name} must be a boolean.`);\n }\n }\n if (policy.cleanup !== undefined\n && policy.cleanup !== false\n && typeof policy.cleanup !== \"function\")\n {\n throw new TypeError(\"CjsResMan autoPurgePolicy.cleanup must be a function or false.\");\n }\n if (policy.now !== undefined && typeof policy.now !== \"function\")\n {\n throw new TypeError(\"CjsResMan autoPurgePolicy.now must be a function.\");\n }\n\n return Object.freeze({\n intervalMilliseconds,\n maxIdleMilliseconds: policy.maxIdleMilliseconds,\n payloadMaxIdleMilliseconds: policy.payloadMaxIdleMilliseconds,\n destroyAdapters: policy.destroyAdapters ?? true,\n releasePayload: policy.releasePayload ?? true,\n ...(policy.cleanup === undefined ? {} : { cleanup: policy.cleanup }),\n now: policy.now || defaultAutoPurgeNow\n });\n}\n\n/**\n * Validate one automatic-purge pump request without advancing cadence.\n *\n * @param {CjsResManAutoPurgePumpOptions} options Per-call pump options.\n * @returns {CjsResManAutoPurgePumpOptions} Validated options.\n * @throws {TypeError} If options or an explicit timestamp are invalid.\n */\nfunction normalizeAutoPurgePumpOptions(options)\n{\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan automatic purge options must be an object.\");\n }\n const unsupported = Object.keys(options).filter(key => key !== \"time\");\n if (unsupported.length)\n {\n throw new TypeError(`CjsResMan automatic purge options do not support: ${unsupported.join(\", \")}.`);\n }\n if (options.time !== undefined)\n {\n assertNonNegativeNumber(options.time, \"automatic purge time\");\n }\n return options;\n}\n\n/**\n * Create the stable failure used when synchronous MotherLode replacement\n * would detach ownership beneath active asynchronous resource mutation.\n *\n * @param {number} activeOperations Number of queued and direct mutations.\n * @returns {Error} Contextual active-operation error.\n */\nfunction activeResourceOperationsError(activeOperations)\n{\n const error = new Error(\n `CjsResMan cannot replace MotherLode while ${activeOperations} resource operation(s) are active.`\n );\n error.code = \"CJS_RESMAN_ACTIVE_RESOURCE_OPERATIONS\";\n error.activeOperations = activeOperations;\n return error;\n}\n\n/**\n * Create the stable failure used when a manager-only load API receives a\n * resource that was never bound to this manager.\n *\n * @param {*} resource Candidate resource.\n * @param {string} phase Operation phase.\n * @returns {Error} Contextual ownership error.\n */\nfunction resourceNotOwnedError(resource, phase)\n{\n const path = getResourceDiagnosticPath(resource);\n const error = new Error(`CjsResMan does not own a canonical resource at ${path}.`);\n error.code = \"CJS_RESMAN_RESOURCE_NOT_OWNED\";\n error.resource = resource;\n error.path = path;\n error.phase = phase;\n return error;\n}\n\n/**\n * Create the stable failure used when otherwise-successful obsolete work\n * reaches a canonical mutation boundary.\n *\n * @param {CjsResourceOwnership} ownership Captured stale authority.\n * @param {string} phase Operation phase that detected staleness.\n * @returns {Error} Contextual stale-operation error.\n */\nfunction staleResourceOperationError(ownership, phase)\n{\n const path = getResourceDiagnosticPath(ownership?.resource);\n const error = new Error(\n `CjsResMan resource operation became stale during ${phase}: ${path}.`\n );\n error.code = \"CJS_RESMAN_STALE_RESOURCE_OPERATION\";\n error.resource = ownership?.resource || null;\n error.path = path;\n error.key = ownership?.key || null;\n error.generation = ownership?.generation || 0;\n error.phase = phase;\n return error;\n}\n\n/**\n * Reject a resource constructor that returns the protected canonical singleton\n * when a distinct reload candidate is required.\n *\n * @param {string} path Requested resource path.\n * @param {object|Function} resource Aliased canonical resource.\n * @returns {Error} Stable candidate-alias error.\n */\nfunction reloadCandidateAliasError(path, resource)\n{\n const error = new Error(`CjsResMan reload candidate aliases the canonical resource: ${path}.`);\n error.code = \"CJS_RESMAN_RELOAD_CANDIDATE_ALIAS\";\n error.path = path;\n error.resource = resource;\n return error;\n}\n\n/**\n * Create the stable failure used when a candidate loader no longer has a\n * staged authority record.\n *\n * @param {object|Function} resource Candidate resource.\n * @returns {Error} Stable unavailable-candidate error.\n */\nfunction reloadCandidateUnavailableError(resource)\n{\n const path = getResourceDiagnosticPath(resource);\n const error = new Error(`CjsResMan reload candidate is no longer available: ${path}.`);\n error.code = \"CJS_RESMAN_RELOAD_CANDIDATE_UNAVAILABLE\";\n error.path = path;\n error.resource = resource;\n return error;\n}\n\n/**\n * Create the stable failure used when a deleted, cleared, replaced, or\n * superseded reload candidate reaches a mutation or commit boundary.\n *\n * @param {CjsResourceReloadCandidate} candidate Captured candidate authority.\n * @param {string} phase Operation phase that detected staleness.\n * @returns {Error} Contextual stale-candidate error.\n */\nfunction staleReloadCandidateError(candidate, phase)\n{\n const path = getResourceDiagnosticPath(candidate?.resource);\n const error = new Error(\n `CjsResMan reload candidate became stale during ${phase}: ${path}.`\n );\n error.code = \"CJS_RESMAN_STALE_RELOAD_CANDIDATE\";\n error.resource = candidate?.resource || null;\n error.expected = candidate?.expected || null;\n error.path = path;\n error.key = candidate?.key || null;\n error.generation = candidate?.generation || 0;\n error.phase = phase;\n return error;\n}\n\n/**\n * Read a resource path for diagnostics without allowing an unusual custom\n * resource getter to hide the primary ownership error.\n *\n * @param {*} resource Candidate resource.\n * @returns {string} Best-effort resource path label.\n */\nfunction getResourceDiagnosticPath(resource)\n{\n try\n {\n return String(resource?.GetPath?.() || resource?.path || \"<unknown>\");\n }\n catch\n {\n return \"<unknown>\";\n }\n}\n\n/**\n * Perform no action for lifecycle-compatible optional operations.\n *\n * @returns {void}\n */\nfunction noop() {}\n\n/**\n * Validate a resource execution strategy.\n *\n * @param {*} loader Candidate loader.\n * @param {string} name Configuration field name.\n * @returns {void}\n */\nfunction assertResourceLoader(loader, name)\n{\n if (!isResourceLoader(loader))\n {\n throw new TypeError(`CjsResMan ${name} must provide Read and ReadFormat.`);\n }\n}\n\n/**\n * Test the structural resource loader contract.\n *\n * @param {*} loader Candidate loader.\n * @returns {boolean}\n */\nfunction isResourceLoader(loader)\n{\n return Boolean(\n loader\n && typeof loader.Read === \"function\"\n && typeof loader.ReadFormat === \"function\"\n );\n}\n\n/**\n * Merge frozen registration defaults with one request's format overrides.\n *\n * @param {object} descriptor Registered format descriptor.\n * @param {object} options Resource read options.\n * @returns {object} Effective format reader options.\n */\nfunction createFormatReadOptions(descriptor, options)\n{\n const { Format, defaults } = descriptor;\n const formatOptions = {\n ...defaults,\n ...(options.formatOptions || {})\n };\n if (options.emit !== undefined)\n {\n formatOptions.emit = findDeclaredOutput(getFormatOutputs(Format), options.emit)\n ?? options.emit;\n }\n if (options.classes !== undefined) formatOptions.classes = options.classes;\n return formatOptions;\n}\n\n/**\n * Reports whether a source requires CjsResMan to build a URL before reading.\n *\n * @param {*} source Selected source/provider.\n * @returns {boolean}\n */\nfunction sourceRequiresUrl(source)\n{\n return source?.requiresUrl === true || source?.constructor?.requiresUrl === true;\n}\n\n/**\n * Tests whether an object owns one property.\n *\n * @param {*} object Candidate object.\n * @param {string|number|symbol} property Property key.\n * @returns {boolean}\n */\nfunction hasOwn(object, property)\n{\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\n/**\n * Normalizes one resource-path scheme key.\n *\n * @param {*} value Candidate scheme.\n * @returns {string}\n */\nfunction normalizePathPrefix(value)\n{\n const prefix = String(value ?? \"\")\n .trim()\n .replace(/:\\/?$/u, \"\")\n .toLowerCase();\n if (!/^[a-z][a-z0-9+.-]*$/u.test(prefix))\n {\n throw new TypeError(\"CjsResMan path prefixes must be URI scheme names.\");\n }\n return prefix;\n}\n\n/**\n * Normalizes one registered URL base without altering case-sensitive path\n * content.\n *\n * @param {*} value Candidate URL base.\n * @returns {string}\n */\nfunction normalizeUrlBase(value)\n{\n const url = normalizePath(value);\n if (!url || url.includes(\"\\0\"))\n {\n throw new TypeError(\"CjsResMan path URL bases must be non-empty strings.\");\n }\n return url.endsWith(\"/\") ? url : `${url}/`;\n}\n\n/**\n * Validates a URL returned by an injected path resolver.\n *\n * @param {*} value Resolver output.\n * @returns {string}\n */\nfunction normalizeResolvedUrl(value)\n{\n const url = normalizePath(value);\n if (!url || url.includes(\"\\0\"))\n {\n throw new TypeError(\"CjsResMan pathResolver must return a non-empty URL string.\");\n }\n return url;\n}\n\n/**\n * Return the wall-clock timestamp used by default automatic purge cadence.\n *\n * @returns {number} Milliseconds since the Unix epoch.\n */\nfunction defaultAutoPurgeNow()\n{\n return Date.now();\n}\n\nfunction defaultQueueScheduler(callback)\n{\n return setTimeout(callback, 0);\n}\n\nfunction defaultQueueYield()\n{\n return new Promise(resolve => setTimeout(resolve, 0));\n}\n\nfunction normalizeRegistrationEntries(value, keyed = false)\n{\n if (value === null || value === undefined) return [];\n if (Array.isArray(value)) return value;\n if (typeof value === \"function\") return [ value ];\n if (typeof value !== \"object\")\n {\n throw new TypeError(\"CjsResMan registration collections must be arrays or objects.\");\n }\n\n if (value.Format || value.format || value.Constructor || value.Resource || value.resourceType)\n {\n return [ value ];\n }\n\n return Object.entries(value).map(([ key, entry ]) =>\n {\n if (!keyed) return typeof entry === \"function\" ? entry : { ...entry, key };\n return typeof entry === \"function\"\n ? { key, requirement: key, Constructor: entry }\n : { ...entry, key, requirement: entry.requirement || entry.payload || key };\n });\n}\n"],"names":["READ_CONTEXTS","WeakMap","RESOURCE_REQUEST_OPTION_KEYS","Object","freeze","RESOURCE_OUTPUT_OPTION_KEYS","RESOURCE_PROVENANCE_OPTION_KEYS","LOCAL_VALUE_IDENTITIES","nextLocalValueIdentity","CjsResMan","CjsEventEmitter","WeakSet","Map","constructor","options","motherLode","CjsMotherLode","source","paths","pathResolver","resourceTypes","objectLoaders","formats","objectOperations","sourceOperations","queuedSourceOperations","formatOperations","mainThreadLoader","CjsResManMainThreadLoader","workerLoader","CjsResManWorkerLoader","fallback","resourceLoader","maxConcurrentLoads","maxPrepareTime","maxPrepareItemsPerTick","autoPumpMainThreadQueue","queueScheduler","defaultQueueScheduler","urgentResourceLoads","_backgroundPumpScheduled","_mainThreadPumpScheduled","_loadQueue","CjsResManWorkQueue","CjsResManQueue","BACKGROUND","concurrency","onReady","ScheduleBackgroundQueue","_prepareQueue","MAIN","ScheduleMainThreadQueue","Register","Array","isArray","TypeError","hasOwnThen","value","nextMotherLode","activeResourceOperationsError","previousMotherLode","Shutdown","Startup","clear","cacheSize","SetCacheSize","cacheCleanup","autoPurgePolicy","SetAutoPurgePolicy","SetSource","SetPaths","SetPathResolver","SetMainThreadLoader","SetWorkerLoader","useWorkerLoading","UseWorkerLoading","assertPositiveInteger","SetConcurrency","assertNonNegativeNumber","assertNonNegativeInteger","Boolean","SetUrgentResourceLoads","entry","normalizeRegistrationEntries","RegisterFormat","Format","format","defaults","RegisterResourceType","requirement","payload","key","Constructor","Resource","resourceType","ext","loader","entries","RegisterObjectLoader","SetPath","prefix","urlBase","normalizePathPrefix","normalizeUrlBase","set","HasPath","has","GetPath","get","resolver","undefined","BuildUrl","path","normalized","normalizeResourcePath","normalizeResolvedUrl","prefixIndex","indexOf","normalizePath","slice","error","Error","code","assertResourceLoader","wasSelected","SetFallback","resolved","isResourceLoader","Reset","IsWorkerLoading","GetPendingWorkers","GetPendingCount","AddToQueue","queue","callback","context","flags","task","QueueTask","promise","catch","EmitEvent","id","CancelFromQueue","reason","GetWorkQueue","Cancel","GetNextIdForQueue","GetNextId","PumpMainThreadQueue","urgent","result","Pump","maxItems","maxTime","now","queued","active","processed","PumpBackgroundQueue","PauseQueue","Pause","ResumeQueue","name","normalizeName","Resume","GetPendingLoads","GetPendingPrepares","GetQueueStats","GetStats","loads","prepares","IsUrgentResourceLoads","IsLoading","Update","loaded","background","prepared","prepare","cacheOptions","cache","cacheResult","TrimCache","trimmed","evicted","purgeOptions","purge","purgeResult","PumpAutoPurge","purged","payloadsReleased","Tick","Wait","pump","yield","snapshot","Set","values","size","fence","Promise","allSettled","yieldQueue","defaultQueueYield","settled","then","race","resolve","metadata","Add","IsPaused","normalizeRequirement","alias","aliases","aliasKey","normalizeResourceExtension","inputTypes","length","descriptor","snapshotFormatDefaults","inputType","candidates","next","filter","candidate","push","GetFormats","GetFormatDescriptors","map","ResolveFormat","ResolveFormatDescriptor","GetResource","variant","GetResourceVariant","getResourceExtension","emit","objectLoader","GetObjectLoader","createObjectLoaderOutputMissingError","descriptors","filterFormatDescriptors","createFormatOutputMissingError","cacheKey","getMotherLodeKey","existing","Lookup","reload","KeepAlive","InvalidateReadCache","ResolveResourceConstructor","resource","CreateResource","expectedOwnership","generation","loaderOptions","getResourceLoaderOptions","reloadCandidate","owner","expected","SetObjectLoader","reloadOptions","loadOptions","mergeResourceLoaderOptions","insertion","Insert","replace","canonical","displaced","GetObject","operationOptions","GetObjectRequest","ownership","HasPayload","KeepPayloadAlive","getPublishedResourceObject","QueueResourceObject","operation","delete","LoadObject","FetchObject","ReloadObject","FetchResource","readinessOptions","Ready","ReloadResource","#GetReloadCandidateObject","reject","reloadCandidateUnavailableError","#RunReloadCandidate","committed","releaseLock","noop","finishOperation","read","MarkRequested","bytes","MarkLoading","object","ReplaceExpected","commitGuard","staleReloadCandidateError","finalizeError","combined","AggregateError","#FinalizeCommittedReload","errors","#CreateReloadCandidateFailure","cause","SetError","#CleanupReloadCandidate","DestroyAdapterResources","destroy","ReleasePayload","SetLifecycleController","Fetch","LoadResourceObject","load","finally","QueueReadResource","PrepareResourceObject","PrepareResourceObjectQueued","#PrepareResourceObject","ReadResourceObjectPayload","#PrepareResourceObjectQueued","formatOptions","createFormatReadOptions","runInWorker","CanReadFormat","readTask","kind","stage","publishTask","published","#ResolveResourceObjectRead","explicitLoader","GetExt","#ReadResolvedResourceObjectPayload","createPrepareContext","ReadFormatOnce","PublishResourceObject","#PublishResourceObject","#PublishResourceObjectValue","CjsResource","SetPayload","IsPrepared","MarkPrepared","Prefetch","all","resolveFormatDescriptorCandidates","ReadFormat","normalizedPath","Delete","Entries","startsWith","DeleteAllVariants","PurgeInactive","policy","normalizeAutoPurgePolicy","GetAutoPurgePolicy","IsAutoPurgeEnabled","normalizeAutoPurgePumpOptions","time","intervalMilliseconds","maxIdleMilliseconds","payloadMaxIdleMilliseconds","destroyAdapters","releasePayload","cleanup","Clear","hasRevision","hasOwn","revisionKey","normalizeSourceRevision","sourceRevision","queuedSource","Read","ReadResource","#BeginReadOperation","inherited","resMan","normalizeCachePolicy","cacheSource","cacheFormat","sourcePath","sourceRequiresUrl","#QueueReadResource","cachePolicy","operations","getOwnerOperations","getReadOperationKey","bypassExisting","retain","sourceRecord","record","#ReadResource","queuedRecord","resourcePath","#RetainSourceResult","#InvalidateReadCache","removeOperationRecords","sourceCount","disallowedAlias","Initialize","reloadCandidateAliasError","requested","emitted","trim","normalizeResourceVariant","#TrackQueueTask","#BeginResourceOperation","resolveDone","done","finished","Math","max","#GetResourceOwnership","phase","#RequireResourceOwnership","resourceNotOwnedError","#IsResourceOwnershipCurrent","IsPurged","#AssertResourceOwnership","staleResourceOperationError","#AssertOptionalResourceOwnership","#IsReloadCandidateCurrent","#AssertReloadCandidate","#InvalidateResourceOwnership","add","#InvalidateMotherLodeOwnership","#AcquireResourcePurgeLock","Lock","Unlock","released","#ReloadPurgedResource","current","request","#BindResourceLifecycle","SetReloadHook","isCurrent","keepAlive","keepPayloadAlive","lock","unlock","#BindMotherLodeResources","getFormatOperationKey","cacheableOptions","descriptorOperations","getFormatDescriptorOperations","seen","snapshotFormatDefaultValue","type","includes","ArrayBuffer","isView","prior","index","prototype","getPrototypeOf","getOwnPropertySymbols","create","getOwnPropertyNames","getOwnPropertyDescriptor","enumerable","Number","isFinite","is","ledger","material","mediaType","classes","every","isCanonicalFormatCacheValue","serializeFormatCacheValue","join","JSON","stringify","isNaN","String","getLocalValueIdentity","identity","Uint8Array","buffer","byteOffset","byteLength","keys","sort","removed","getResourceRequestOptions","effectiveSource","base","overrides","pinsOutput","some","findDeclaredOutput","getFormatOutputs","mediaTypes","outputTypes","debugOutputTypes","outputs","output","supported","isSupported","report","call","toLowerCase","GetPayload","isInteger","allowed","unsupported","defaultAutoPurgeNow","activeOperations","getResourceDiagnosticPath","requiresUrl","property","hasOwnProperty","test","url","endsWith","Date","setTimeout","keyed"],"mappings":";;;;;;;;;AAoBA;AACA,MAAMA,aAAa,GAAG,IAAIC,OAAO,EAAE;;AAEnC;AACA,MAAMC,4BAA4B,GAAGC,MAAM,CAACC,MAAM,CAAC,CACjD,SAAS,EACT,aAAa,EACb,SAAS,EACT,MAAM,EACN,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,CAChB,CAAC;;AAEF;AACA,MAAMC,2BAA2B,GAAGF,MAAM,CAACC,MAAM,CAAC,CAChD,SAAS,EACT,MAAM,EACN,aAAa,EACb,SAAS,CACV,CAAC;;AAEF;AACA,MAAME,+BAA+B,GAAGH,MAAM,CAACC,MAAM,CAAC,CACpD,QAAQ,EACR,gBAAgB,EAChB,KAAK,CACN,CAAC;;AAEF;AACA,MAAMG,sBAAsB,GAAG,IAAIN,OAAO,EAAE;AAC5C,IAAIO,sBAAsB,GAAG,CAAC;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEO,MAAMC,SAAS,SAASC,eAAe,CAC9C;EAEE,gBAAgB,GAAG,IAAI;EACvB,yBAAyB,GAAG,CAAC;AAC7B,EAAA,yBAAyB,GAAG,IAAIC,OAAO,EAAE;EACzC,kBAAkB,GAAG,IAAI;EACzB,6BAA6B,GAAG,CAAC;EACjC,gCAAgC,GAAG,CAAC;EACpC,wBAAwB,GAAG,CAAC;AAC5B,EAAA,gBAAgB,GAAG,IAAIC,GAAG,EAAE;AAC5B,EAAA,kBAAkB,GAAG,IAAIX,OAAO,EAAE;AAClC,EAAA,mBAAmB,GAAG,IAAIW,GAAG,EAAE;AAC/B,EAAA,iBAAiB,GAAG,IAAIX,OAAO,EAAE;AACjC,EAAA,kBAAkB,GAAG,IAA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OA,KAAK;EACtC,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE,OAAO,CAAEA,KAAK,CAAE;AACjD,EAAA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAC7B;AACE,IAAA,MAAM,IAAIF,SAAS,CAAC,+DAA+D,CAAC;AACtF,EAAA;AAEA,EAAA,IAAIE,KAAK,CAAC4B,MAAM,IAAI5B,KAAK,CAAC6B,MAAM,IAAI7B,KAAK,CAACmC,WAAW,IAAInC,KAAK,CAACoC,QAAQ,IAAIpC,KAAK,CAACqC,YAAY,EAC7F;IACE,OAAO,CAAErC,KAAK,CAAE;AAClB,EAAA;AAEA,EAAA,OAAOtD,MAAM,CAAC8F,OAAO,CAACxC,KAAK,CAAC,CAAC2K,GAAG,CAAC,CAAC,CAAEzI,GAAG,EAAET,KAAK,CAAE,KAChD;IACE,IAAI,CAACsb,KAAK,EAAE,OAAO,OAAOtb,KAAK,KAAK,UAAU,GAAGA,KAAK,GAAG;AAAE,MAAA,GAAGA,KAAK;AAAES,MAAAA;KAAK;AAC1E,IAAA,OAAO,OAAOT,KAAK,KAAK,UAAU,GAC9B;MAAES,GAAG;AAAEF,MAAAA,WAAW,EAAEE,GAAG;AAAEC,MAAAA,WAAW,EAAEV;AAAM,KAAC,GAC7C;AAAE,MAAA,GAAGA,KAAK;MAAES,GAAG;MAAEF,WAAW,EAAEP,KAAK,CAACO,WAAW,IAAIP,KAAK,CAACQ,OAAO,IAAIC;KAAK;AAC/E,EAAA,CAAC,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"CjsResMan.js","sources":["../../src/CjsResMan.js"],"sourcesContent":["import { CjsMotherLode, getMotherLodeKey } from \"./CjsMotherLode.js\";\nimport { CjsEventEmitter } from \"@carbonenginejs/runtime-utils/model\";\nimport { hasOwnThen } from \"@carbonenginejs/runtime-utils/object\";\nimport {\n getResourceExtension,\n normalizePath,\n normalizeResourceExtension,\n normalizeResourcePath\n} from \"@carbonenginejs/runtime-utils/path\";\nimport { CjsResource } from \"./resource/CjsResource.js\";\nimport {\n CjsResManQueue,\n CjsResManWorkQueue\n} from \"./CjsResManWorkQueue.js\";\nimport {\n CjsResManMainThreadLoader\n} from \"./worker/CjsResManMainThreadLoader.js\";\nimport {\n CjsResManWorkerLoader\n} from \"./worker/CjsResManWorkerLoader.js\";\n/** @type {WeakMap<object, CjsResourceReadContext>} */\nconst READ_CONTEXTS = new WeakMap();\n\n/** Small request fields retained only so a released payload can be rebuilt. */\nconst RESOURCE_REQUEST_OPTION_KEYS = Object.freeze([\n \"variant\",\n \"requirement\",\n \"payload\",\n \"emit\",\n \"mediaType\",\n \"format\",\n \"classes\",\n \"formatOptions\"\n]);\n\n/** Requested-output fields pinned by a bound resource handle. */\nconst RESOURCE_OUTPUT_OPTION_KEYS = Object.freeze([\n \"variant\",\n \"emit\",\n \"requirement\",\n \"payload\"\n]);\n\n/** Source provenance retained by a bound resource handle when present. */\nconst RESOURCE_PROVENANCE_OPTION_KEYS = Object.freeze([\n \"source\",\n \"sourceRevision\",\n \"ext\"\n]);\n\n/** Process-local tokens used only by parsed-format operation caching. */\nconst LOCAL_VALUE_IDENTITIES = new WeakMap();\nlet nextLocalValueIdentity = 1;\n\n/**\n * Immutable source provenance used by one read/format operation chain.\n *\n * `sourceRevision` is caller/source-provided opaque content identity. It scopes\n * read caches only and never becomes part of MotherLode resource identity.\n *\n * @typedef {object} CjsResourceReadContext\n * @property {CjsResMan} resMan Owning manager.\n * @property {object|Function} source Selected source implementation.\n * @property {string} path Normalized Carbon-style source path.\n * @property {string} sourcePath Resource path or URL passed to the selected source.\n * @property {string|number|undefined} sourceRevision Caller content token.\n * @property {string} revisionKey Type-stable internal form of the content token.\n */\n\n/**\n * Mutable record retained in a source or format operation ledger.\n *\n * @typedef {object} CjsResourceReadOperationRecord\n * @property {Promise<*>} promise Shared operation promise.\n * @property {string} path Normalized source path used for explicit invalidation.\n * @property {string} revisionKey Type-stable source revision key.\n * @property {boolean} retain Whether any joined caller requested settled retention.\n */\n\n/**\n * Source provenance and tri-state read-cache controls.\n *\n * Omitted cache flags share in-flight or explicitly retained work but do not\n * retain a newly completed operation. `true` retains success, while `false`\n * bypasses sharing and retention. Failures are never retained.\n *\n * @typedef {object} CjsResManReadCacheOptions\n * @property {object|Function} [source] Source override providing `Read(path, options)`.\n * @property {string|number} [sourceRevision] Opaque caller/source content token; finite numbers only.\n * @property {boolean} [reload=false] Invalidate this source/path and begin fresh work once.\n * @property {boolean} [cacheSource] Source operation sharing/retention policy.\n * @property {boolean} [cacheFormat] Parsed-format operation sharing/retention policy.\n */\n\n/**\n * Opt-in time-based inactivity policy run by {@link CjsResMan#Update}.\n *\n * Automatic policy deliberately uses elapsed milliseconds rather than\n * MotherLode activity frames: the latter count explicit activity observations\n * and are not guaranteed to match renderer frames. At least one identity or\n * payload limit is required. The policy is disabled by default.\n *\n * @typedef {object} CjsResManAutoPurgePolicy\n * @property {number} [intervalMilliseconds=1000] Minimum elapsed milliseconds between automatic sweeps; `0` permits every update.\n * @property {number} [maxIdleMilliseconds] Elapsed milliseconds after which an unlocked canonical identity is removed and cleaned.\n * @property {number} [payloadMaxIdleMilliseconds] Elapsed milliseconds after which an unlocked CPU payload is released.\n * @property {boolean} [destroyAdapters=true] Whether identity cleanup destroys adapter allocations.\n * @property {boolean} [releasePayload=true] Whether sweeps may release CPU payloads.\n * @property {false|Function} [cleanup] `false` retains owned state; a function replaces default identity cleanup.\n * @property {() => number} [now=Date.now] Cadence clock. Use the MotherLode activity clock when supplying a custom clock.\n */\n\n/**\n * Per-call controls for {@link CjsResMan#PumpAutoPurge}.\n *\n * @typedef {object} CjsResManAutoPurgePumpOptions\n * @property {number} [time] Explicit non-negative timestamp in milliseconds for deterministic pumping and sweeping.\n */\n\n/**\n * Queue and automatic-purge controls accepted by {@link CjsResMan#Update}.\n * Top-level queue options remain a compatibility form for the prepare pump.\n *\n * @typedef {object} CjsResManUpdateOptions\n * @property {object} [background] Background queue pump options.\n * @property {object} [prepare] Main-thread prepare queue pump options.\n * @property {false|object} [cache] `false` skips recorded-byte housekeeping; otherwise supplies cache-cleanup policy.\n * @property {false|CjsResManAutoPurgePumpOptions} [purge] `false` skips this update's automatic sweep; otherwise supplies its timestamp.\n */\n\n/**\n * Snapshot-fence controls accepted by {@link CjsResMan#Wait}.\n *\n * The default pump uses the manager's ordinary queue budgets and honors queue\n * pause state. `pump: false` leaves all progress to an external driver. The\n * yield callback is used only while this call is pumping and may return either\n * a promise or an immediate value.\n *\n * @typedef {object} CjsResManWaitOptions\n * @property {boolean} [pump=true] Whether this call pumps the two queues while awaiting its snapshot.\n * @property {object} [background] Options forwarded to `PumpBackgroundQueue`.\n * @property {object} [prepare] Options forwarded to `PumpMainThreadQueue`.\n * @property {() => (*|Promise<*>)} [yield] Cooperative wait between pump attempts.\n */\n\n/**\n * Immutable authority captured by asynchronous work that may mutate a\n * canonical resource. A generation changes whenever ResMan removes and later\n * rebinds the same JavaScript handle, even when owner and key are reused.\n *\n * @typedef {object} CjsResourceOwnership\n * @property {number} generation Manager-local ownership generation.\n * @property {CjsMotherLode} owner Exact registry that owns the resource.\n * @property {string} key Exact canonical registry identity.\n * @property {object|Function} resource Canonical resource handle.\n */\n\n/**\n * Immutable authority for one off-registry reload candidate.\n *\n * The newest generation for a canonical key is the only candidate permitted\n * to commit. `expectedOwnership` keeps the former canonical handle protected\n * by the same exact-owner generation checks used by ordinary asynchronous\n * resource work.\n *\n * @typedef {object} CjsResourceReloadCandidate\n * @property {true} reloadCandidate Distinguishes staged authority from canonical ownership.\n * @property {number} generation Manager-local reload request generation.\n * @property {CjsMotherLode} owner Exact registry expected to receive the candidate.\n * @property {string} key Exact canonical registry identity.\n * @property {object|Function} expected Former canonical resource preserved until commit.\n * @property {CjsResourceOwnership} expectedOwnership Captured authority of the former owner.\n * @property {object|Function} resource Off-registry candidate resource.\n * @property {Readonly<object>} loaderOptions Durable identity/source options restored after commit.\n */\n\n/**\n * Hidden authority accepted by guarded CPU read/publication helpers.\n *\n * @typedef {CjsResourceOwnership|CjsResourceReloadCandidate} CjsResourceMutationAuthority\n */\n\nexport class CjsResMan extends CjsEventEmitter\n{\n\n #autoPurgePolicy = null;\n #activeResourceOperations = 0;\n #invalidResourceOwnership = new WeakSet();\n #lastAutoPurgeTime = null;\n #nextResourceReloadGeneration = 1;\n #nextResourceOwnershipGeneration = 1;\n #nextResourceOperationId = 1;\n #queueOperations = new Map();\n #resourceOwnership = new WeakMap();\n #resourceOperations = new Map();\n #reloadCandidates = new WeakMap();\n #reloadGenerations = new Map();\n #reloadOperations = new WeakMap();\n\n /**\n * Create a GPU-free resource manager and apply its initial registration.\n *\n * @param {object} [options={}] Configuration forwarded to {@link CjsResMan#Register}.\n * @throws {TypeError} If registration, queue, source, or format options are invalid.\n */\n constructor(options = {}) {\n super();\n this.motherLode = new CjsMotherLode();\n this.source = null;\n this.paths = new Map();\n this.pathResolver = null;\n this.resourceTypes = new Map();\n this.objectLoaders = new Map();\n this.formats = new Map();\n this.objectOperations = new WeakMap();\n this.sourceOperations = new WeakMap();\n this.queuedSourceOperations = new WeakMap();\n this.formatOperations = new WeakMap();\n this.mainThreadLoader = new CjsResManMainThreadLoader();\n this.workerLoader = new CjsResManWorkerLoader({\n fallback: this.mainThreadLoader\n });\n this.resourceLoader = this.workerLoader;\n this.maxConcurrentLoads = 8;\n this.maxPrepareTime = 0.005;\n this.maxPrepareItemsPerTick = 0;\n this.autoPumpMainThreadQueue = true;\n this.queueScheduler = defaultQueueScheduler;\n this.urgentResourceLoads = false;\n this._backgroundPumpScheduled = false;\n this._mainThreadPumpScheduled = false;\n this._loadQueue = new CjsResManWorkQueue(CjsResManQueue.BACKGROUND, {\n concurrency: this.maxConcurrentLoads,\n onReady: () => this.ScheduleBackgroundQueue()\n });\n this._prepareQueue = new CjsResManWorkQueue(CjsResManQueue.MAIN, {\n concurrency: 1,\n onReady: () => this.ScheduleMainThreadQueue()\n });\n\n this.Register(options);\n }\n\n /**\n * Add or replace resource-manager configuration.\n *\n * The same options object can be forwarded unchanged by CjsLibrary. Format\n * classes continue to own their input extensions; resource types are keyed\n * by semantic requirements such as \"texture\", \"image\", or \"geometry\".\n * Replacing MotherLode shuts down and cleans the former owner before the new\n * registry is activated. Replacement is rejected while queued or direct\n * resource mutations are active so a synchronous configuration call cannot\n * detach ownership underneath asynchronous publication. Normal `Wait()`\n * drains queued roots only; direct callers must await their own promises.\n *\n * @param {object} [options={}] Additive source, registry, queue, format, and resource-type settings.\n * @param {number} [options.cacheSize] Recorded-byte budget immediately installed on the active MotherLode.\n * @param {object} [options.cacheCleanup] Cleanup policy used if a smaller configured budget evicts cached identities.\n * @param {object} [options.mainThreadLoader] Direct execution strategy.\n * @param {object|Map<string,string>} [options.paths] Resource-prefix URL bases.\n * @param {Function|null} [options.pathResolver] Optional complete resource-path-to-URL resolver.\n * @param {object} [options.workerLoader] Worker loader instance or construction options.\n * @param {boolean} [options.useWorkerLoading=true] Whether worker-backed execution is selected.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If options or any configured component are invalid.\n * @throws {Error|AggregateError} If resource mutations are active or replacing MotherLode cannot clean its resources.\n */\n Register(options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.Register options must be an object.\");\n }\n\n hasOwnThen(options, {\n motherLode: value =>\n {\n const nextMotherLode = value || new CjsMotherLode();\n if (nextMotherLode !== this.motherLode)\n {\n if (this.#activeResourceOperations > 0)\n {\n throw activeResourceOperationsError(this.#activeResourceOperations);\n }\n const previousMotherLode = this.motherLode;\n this.#InvalidateMotherLodeOwnership(previousMotherLode);\n previousMotherLode?.Shutdown?.();\n this.motherLode = nextMotherLode;\n this.motherLode.Startup?.();\n this.#BindMotherLodeResources();\n this.#reloadGenerations.clear();\n this.#lastAutoPurgeTime = null;\n }\n },\n cacheSize: value => this.motherLode.SetCacheSize(\n value,\n options.cacheCleanup || {}\n ),\n autoPurgePolicy: this.SetAutoPurgePolicy,\n source: this.SetSource,\n paths: this.SetPaths,\n pathResolver: this.SetPathResolver,\n mainThreadLoader: this.SetMainThreadLoader,\n workerLoader: this.SetWorkerLoader,\n useWorkerLoading: this.UseWorkerLoading,\n maxConcurrentLoads: value =>\n {\n assertPositiveInteger(value, \"maxConcurrentLoads\");\n this.maxConcurrentLoads = value;\n this._loadQueue.SetConcurrency(value);\n },\n maxPrepareTime: value =>\n {\n assertNonNegativeNumber(value, \"maxPrepareTime\");\n this.maxPrepareTime = value;\n },\n maxPrepareItemsPerTick: value =>\n {\n assertNonNegativeInteger(value, \"maxPrepareItemsPerTick\");\n this.maxPrepareItemsPerTick = value;\n },\n autoPumpMainThreadQueue: value =>\n {\n this.autoPumpMainThreadQueue = Boolean(value);\n },\n queueScheduler: value =>\n {\n if (value !== null && typeof value !== \"function\")\n {\n throw new TypeError(\"CjsResMan queueScheduler must be a function or null.\");\n }\n this.queueScheduler = value || defaultQueueScheduler;\n },\n urgentResourceLoads: this.SetUrgentResourceLoads\n }, this);\n\n for (const entry of normalizeRegistrationEntries(options.formats))\n {\n if (typeof entry === \"function\") this.RegisterFormat(entry);\n else this.RegisterFormat(entry.Format || entry.format, entry.defaults || {});\n }\n for (const entry of normalizeRegistrationEntries(options.resourceTypes, true))\n {\n if (typeof entry === \"function\") this.RegisterResourceType(entry);\n else this.RegisterResourceType(entry.requirement || entry.payload || entry.key, entry.Constructor || entry.Resource || entry.resourceType, entry);\n }\n for (const [ ext, loader ] of Object.entries(options.objectLoaders || {}))\n {\n this.RegisterObjectLoader(ext, loader);\n }\n return this;\n }\n\n /**\n * Replace the default source selected by later resource requests.\n * Existing handles retain the effective source captured when they were\n * created, so payload reconstruction does not silently move to this source.\n *\n * @param {object|Function|null} source Source exposing `Read(path, options)`, or a falsey value to clear the default.\n * @returns {CjsResMan} This resource manager.\n */\n SetSource(source) {\n this.source = source || null;\n return this;\n }\n\n /**\n * Add or replace one resource-prefix URL base.\n *\n * @param {string} prefix Resource scheme without `:/`.\n * @param {string} urlBase URL base ending at the scheme root.\n * @returns {CjsResMan} This resource manager.\n */\n SetPath(prefix, urlBase)\n {\n const key = normalizePathPrefix(prefix);\n const value = normalizeUrlBase(urlBase);\n this.paths.set(key, value);\n return this;\n }\n\n /**\n * Add or replace resource-prefix URL bases from an object or Map.\n *\n * @param {object|Map<string,string>} paths Prefix/base entries.\n * @returns {CjsResMan} This resource manager.\n */\n SetPaths(paths)\n {\n if (!paths || (typeof paths !== \"object\" && !(paths instanceof Map)) || Array.isArray(paths))\n {\n throw new TypeError(\"CjsResMan paths must be an object or Map.\");\n }\n const entries = paths instanceof Map\n ? paths.entries()\n : Object.entries(paths);\n for (const [ prefix, urlBase ] of entries)\n {\n this.SetPath(prefix, urlBase);\n }\n return this;\n }\n\n /**\n * Reports whether a resource-prefix URL base is registered.\n *\n * @param {string} prefix Resource scheme without `:/`.\n * @returns {boolean}\n */\n HasPath(prefix)\n {\n return this.paths.has(normalizePathPrefix(prefix));\n }\n\n /**\n * Returns one registered resource-prefix URL base.\n *\n * @param {string} prefix Resource scheme without `:/`.\n * @returns {string|null}\n */\n GetPath(prefix)\n {\n return this.paths.get(normalizePathPrefix(prefix)) || null;\n }\n\n /**\n * Replaces the complete resource-path-to-URL resolver.\n *\n * @param {Function|null} resolver Resolver called as `(resourcePath, resMan)`.\n * @returns {CjsResMan} This resource manager.\n */\n SetPathResolver(resolver)\n {\n if (resolver !== null && resolver !== undefined && typeof resolver !== \"function\")\n {\n throw new TypeError(\"CjsResMan pathResolver must be a function or null.\");\n }\n this.pathResolver = resolver || null;\n return this;\n }\n\n /**\n * Builds the URL used by URL-backed providers while preserving the resource\n * path as the canonical resource identity.\n *\n * @param {string} path Resource path or direct HTTP(S) URL.\n * @returns {string} Resolved URL.\n */\n BuildUrl(path)\n {\n const normalized = normalizeResourcePath(path);\n if (!normalized)\n {\n throw new TypeError(\"CjsResMan resource path must be a non-empty string.\");\n }\n if (this.pathResolver)\n {\n return normalizeResolvedUrl(this.pathResolver(normalized, this));\n }\n\n const prefixIndex = normalized.indexOf(\":/\");\n if (prefixIndex === -1)\n {\n return normalizePath(path);\n }\n const prefix = normalized.slice(0, prefixIndex);\n if (prefix === \"http\" || prefix === \"https\")\n {\n return normalizePath(path);\n }\n const urlBase = this.paths.get(prefix);\n if (!urlBase)\n {\n const error = new Error(`CjsResMan resource path prefix is not registered: ${prefix}`);\n error.code = \"CJS_RESMAN_PATH_PREFIX_UNREGISTERED\";\n error.path = normalized;\n error.prefix = prefix;\n throw error;\n }\n return `${urlBase}${normalized.slice(prefixIndex + 2)}`;\n }\n\n /**\n * Replace the direct execution strategy used by unsupported worker\n * operations and whenever worker loading is not selected.\n *\n * @param {object} loader Loader exposing `Read` and `ReadFormat`.\n * @returns {CjsResMan} This resource manager.\n */\n SetMainThreadLoader(loader) {\n assertResourceLoader(loader, \"mainThreadLoader\");\n const wasSelected = this.resourceLoader === this.mainThreadLoader;\n this.mainThreadLoader = loader;\n this.workerLoader?.SetFallback?.(loader);\n if (wasSelected || !this.resourceLoader) this.resourceLoader = loader;\n return this;\n }\n\n /**\n * Install a worker loader instance or construct one from options.\n *\n * Installation does not select worker execution; call\n * `UseWorkerLoading(true)` or pass `useWorkerLoading: true`.\n *\n * @param {object|null} loader Worker loader or CjsResManWorkerLoader options.\n * @returns {CjsResMan} This resource manager.\n */\n SetWorkerLoader(loader) {\n const wasSelected = this.resourceLoader === this.workerLoader;\n if (loader === null || loader === false) {\n this.workerLoader = null;\n if (wasSelected) this.resourceLoader = this.mainThreadLoader;\n return this;\n }\n\n const resolved = isResourceLoader(loader)\n ? loader\n : new CjsResManWorkerLoader({\n ...(loader || {}),\n fallback: loader?.fallback || this.mainThreadLoader\n });\n assertResourceLoader(resolved, \"workerLoader\");\n this.workerLoader = resolved;\n if (wasSelected) this.resourceLoader = resolved;\n return this;\n }\n\n /**\n * Select worker-backed execution, lazily creating the default module worker\n * loader when required. Unsupported sources and formats still use the\n * configured main-thread loader.\n *\n * @param {boolean} [value=true] Whether worker execution is selected.\n * @returns {CjsResMan} This resource manager.\n */\n UseWorkerLoading(value = true) {\n if (!value) {\n this.resourceLoader = this.mainThreadLoader;\n return this;\n }\n if (!this.workerLoader) this.SetWorkerLoader({});\n this.workerLoader.Reset?.();\n this.resourceLoader = this.workerLoader;\n return this;\n }\n\n /**\n * Report whether worker-backed execution is the selected strategy.\n *\n * @returns {boolean}\n */\n IsWorkerLoading() {\n return Boolean(this.workerLoader && this.resourceLoader === this.workerLoader);\n }\n\n /**\n * Return unresolved requests owned by the selected/installed worker loader.\n *\n * @returns {number}\n */\n GetPendingWorkers() {\n return this.workerLoader?.GetPendingCount?.() || 0;\n }\n\n /**\n * Enqueues a resource task on the selected execution lane for the resource\n * manager.\n */\n AddToQueue(queue, callback, context = null, flags = 0) {\n const task = this.QueueTask(queue, callback, context, { flags });\n task.promise.catch(error => {\n this.EmitEvent?.(\"queueerror\", this, task.queue, task.id, error);\n });\n return task.id;\n }\n\n /** Cancels a queued resource task before it starts for the resource manager. */\n CancelFromQueue(queue, id, reason = \"\") {\n return this.GetWorkQueue(queue).Cancel(id, reason);\n }\n\n /**\n * Allocates the next task identifier for a selected queue for the resource\n * manager.\n */\n GetNextIdForQueue(queue) {\n return this.GetWorkQueue(queue).GetNextId();\n }\n\n /**\n * Starts pending preparation work within the main-thread concurrency limit for\n * the resource manager.\n */\n PumpMainThreadQueue(options = {}) {\n const urgent = options.urgent === true || this.urgentResourceLoads;\n const result = this._prepareQueue.Pump({\n maxItems: urgent ? 0 : (options.maxItems ?? this.maxPrepareItemsPerTick),\n maxTime: urgent ? 0 : (options.maxTime ?? this.maxPrepareTime) * 1000,\n now: options.now\n });\n if (result.queued > 0 && result.active === 0) this.ScheduleMainThreadQueue();\n return result.processed > 0;\n }\n\n /**\n * Starts pending load work within the background concurrency limit for the\n * resource manager.\n */\n PumpBackgroundQueue(options = {}) {\n const result = this._loadQueue.Pump({\n maxItems: options.maxItems ?? 0,\n maxTime: options.maxTime === undefined ? 0 : options.maxTime * 1000,\n now: options.now\n });\n return result.processed > 0;\n }\n\n /**\n * Prevents the selected queue from starting additional work for the resource\n * manager.\n */\n PauseQueue(queue) {\n this.GetWorkQueue(queue).Pause();\n return this;\n }\n\n /**\n * Allows the selected queue to start pending work again for the resource\n * manager.\n */\n ResumeQueue(queue) {\n const name = CjsResManWorkQueue.normalizeName(queue);\n this.GetWorkQueue(name).Resume();\n if (name === CjsResManQueue.MAIN) this.ScheduleMainThreadQueue();\n else this.ScheduleBackgroundQueue();\n return this;\n }\n\n /**\n * Returns the number of load tasks waiting or running for the resource\n * manager.\n */\n GetPendingLoads() {\n return this._loadQueue.GetPendingCount();\n }\n\n /**\n * Returns the number of preparation tasks waiting or running for the resource\n * manager.\n */\n GetPendingPrepares() {\n return this._prepareQueue.GetPendingCount();\n }\n\n /**\n * Returns queue counts and concurrency state for diagnostics for the resource\n * manager.\n */\n GetQueueStats(queue = null) {\n if (queue !== null && queue !== undefined) return this.GetWorkQueue(queue).GetStats();\n return Object.freeze({\n loads: this._loadQueue.GetStats(),\n prepares: this._prepareQueue.GetStats()\n });\n }\n\n /**\n * Switches resource loading between normal and urgent concurrency policy for\n * the resource manager.\n */\n SetUrgentResourceLoads(value) {\n this.urgentResourceLoads = Boolean(value);\n return this;\n }\n\n /**\n * Reports whether urgent resource-load scheduling is active for the resource\n * manager.\n */\n IsUrgentResourceLoads() {\n return this.urgentResourceLoads;\n }\n\n /**\n * Reports whether any resource load or preparation remains pending for the\n * resource manager.\n */\n IsLoading() {\n return this.GetPendingLoads() + this.GetPendingPrepares() + this.GetPendingWorkers() > 0;\n }\n\n /**\n * Pump background and main-thread work, enforce the recorded-byte cache\n * budget, then run a due automatic inactivity sweep when one has been\n * explicitly configured. Queue work is processed before housekeeping, and\n * manager-owned active loads/prepares hold eviction locks. No housekeeping\n * operation fetches, prepares, or reloads source data.\n *\n * @param {CjsResManUpdateOptions} [options={}] Queue budgets and optional automatic-purge controls.\n * @returns {boolean} Whether queue work ran or housekeeping released owned state.\n * @throws {TypeError} If queue, cache, purge timing, or MotherLode policy options are invalid.\n * @throws {AggregateError} If cache or inactivity housekeeping cannot clean one or more resources.\n */\n Update(options = {}) {\n const loaded = this.PumpBackgroundQueue(options.background || {});\n const prepared = this.PumpMainThreadQueue(options.prepare || options);\n const cacheOptions = options.cache === true || options.cache === undefined\n ? {}\n : options.cache;\n const cacheResult = options.cache === false\n ? null\n : this.motherLode.TrimCache?.(cacheOptions);\n const trimmed = Boolean(cacheResult && cacheResult.evicted > 0);\n const purgeOptions = options.purge === true || options.purge === undefined\n ? {}\n : options.purge;\n const purgeResult = options.purge === false\n ? null\n : this.PumpAutoPurge(purgeOptions);\n const purged = Boolean(purgeResult\n && (purgeResult.purged > 0 || purgeResult.payloadsReleased > 0));\n return loaded || prepared || trimmed || purged;\n }\n\n /**\n * Compatibility alias for {@link CjsResMan#Update}. It uses the same queue\n * budgets, byte-cache housekeeping, opt-in purge cadence, return value, and\n * error behavior.\n *\n * @param {CjsResManUpdateOptions} [options={}] Queue budgets and optional automatic-purge controls.\n * @returns {boolean} Whether queue work ran or housekeeping released owned state.\n * @throws {TypeError|AggregateError} If update options or a due purge fail.\n */\n Tick(options = {}) {\n return this.Update(options);\n }\n\n /**\n * Wait for the manager work that exists when this method is called.\n * The snapshot contains active queued resource load roots and direct queue\n * tasks. A captured resource root includes every CPU-work descendant it\n * enqueues later, while unrelated roots/tasks submitted after the call do\n * not postpone this fence. Shared-source joins do not merge distinct roots.\n *\n * Failure and queued cancellation count as terminal settlement: callers\n * observe those errors through the original operation promises, while this\n * method resolves after every captured promise settles. By default it pumps\n * background and main queues directly, so waiting never triggers automatic\n * retention sweeps. Paused queues remain paused. With `pump: false`, an\n * external driver must resume/pump queues or the returned promise may remain\n * pending.\n *\n * A standalone canonical `PrepareResourceObjectQueued()` call opens a\n * resource root. Direct `LoadResourceObject()`, direct\n * `PrepareResourceObject()`, standalone `ReadResource()`, and standalone\n * `ReadFormatOnce()` calls bypass the two queues and are not resource roots\n * unless they also own a captured queue task. `WaitUrgent()` remains absent\n * until per-item priority and urgent membership exist.\n *\n * @param {CjsResManWaitOptions} [options={}] Snapshot pumping and cooperative-yield controls.\n * @returns {Promise<CjsResMan>} This manager after all captured work settles.\n * @throws {TypeError} If options, `pump`, or `yield` are invalid.\n * @throws {Error} If a queue pump or custom yield callback itself fails.\n */\n async Wait(options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.Wait options must be an object.\");\n }\n if (options.pump !== undefined && typeof options.pump !== \"boolean\")\n {\n throw new TypeError(\"CjsResMan.Wait pump must be a boolean when supplied.\");\n }\n if (options.yield !== undefined && typeof options.yield !== \"function\")\n {\n throw new TypeError(\"CjsResMan.Wait yield must be a function when supplied.\");\n }\n\n const snapshot = new Set([\n ...this.#resourceOperations.values(),\n ...this.#queueOperations.values()\n ]);\n if (snapshot.size === 0) return this;\n\n const fence = Promise.allSettled([ ...snapshot ]);\n if (options.pump === false)\n {\n await fence;\n return this;\n }\n\n const yieldQueue = options.yield || defaultQueueYield;\n let settled = false;\n fence.then(() => { settled = true; });\n while (!settled)\n {\n this.PumpBackgroundQueue(options.background || {});\n this.PumpMainThreadQueue(options.prepare || {});\n if (!settled) await Promise.race([ fence, Promise.resolve().then(yieldQueue) ]);\n }\n await fence;\n return this;\n }\n\n /**\n * Returns the execution queue selected by its public lane name for the\n * resource manager.\n */\n GetWorkQueue(queue) {\n return CjsResManWorkQueue.normalizeName(queue) === CjsResManQueue.MAIN\n ? this._prepareQueue\n : this._loadQueue;\n }\n\n /**\n * Add one low-level task to a manager queue and retain its promise only while\n * pending so a contemporaneous {@link CjsResMan#Wait} snapshot can include\n * it. This does not assign resource lineage to tasks the callback may submit\n * later; callers should return/await such work or use a manager resource\n * operation.\n *\n * @param {string} queue Queue name or compatibility alias.\n * @param {Function} callback Queue callback receiving immutable task metadata.\n * @param {*} [context=null] `this` value used to invoke the callback.\n * @param {object|null} [metadata=null] Opaque diagnostics retained on the task.\n * @returns {object} Queue task record containing id, queue, state, metadata, and promise.\n * @throws {TypeError} If the queue or callback is invalid.\n */\n QueueTask(queue, callback, context = null, metadata = null)\n {\n return this.#TrackQueueTask(this.GetWorkQueue(queue).Add(callback, context, metadata));\n }\n\n /** Requests a later background-queue scheduling pass for the resource manager. */\n ScheduleBackgroundQueue() {\n if (this._backgroundPumpScheduled || this._loadQueue.IsPaused()) return this;\n this._backgroundPumpScheduled = true;\n Promise.resolve().then(() => {\n this._backgroundPumpScheduled = false;\n this.PumpBackgroundQueue();\n });\n return this;\n }\n\n /**\n * Requests a later main-thread preparation scheduling pass for the resource\n * manager.\n */\n ScheduleMainThreadQueue() {\n if (!this.autoPumpMainThreadQueue || this._mainThreadPumpScheduled || this._prepareQueue.IsPaused()) return this;\n this._mainThreadPumpScheduled = true;\n try {\n this.queueScheduler(() => {\n this._mainThreadPumpScheduled = false;\n this.PumpMainThreadQueue();\n });\n } catch (error) {\n this._mainThreadPumpScheduled = false;\n throw error;\n }\n return this;\n }\n\n /**\n * Register a resource constructor or factory for one semantic outcome.\n * The constructor is selected by `requirement`/`payload`, never by file\n * extension. It does not enter resource identity: re-registration affects a\n * path/output only after its existing handle is explicitly deleted/cleared.\n *\n * @param {string|Function} requirement Semantic outcome key, or a constructor declaring its own `payload`.\n * @param {Function|object|null} [Constructor=null] Resource constructor/factory, or options when the first argument is the constructor.\n * @param {object} [options={}] Registration aliases and optional requirement/payload override.\n * @param {readonly string[]} [options.aliases=[]] Additional semantic keys mapped to the same constructor.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If the semantic key or constructor/factory is invalid.\n */\n RegisterResourceType(requirement, Constructor = null, options = {})\n {\n if (typeof requirement === \"function\")\n {\n options = Constructor && typeof Constructor === \"object\" ? Constructor : {};\n Constructor = requirement;\n requirement = options.requirement || options.payload || Constructor.payload;\n }\n\n const key = normalizeRequirement(requirement);\n if (!key) throw new TypeError(\"CjsResMan.RegisterResourceType requires a semantic requirement.\");\n if (typeof Constructor !== \"function\")\n {\n throw new TypeError(\"CjsResMan.RegisterResourceType requires a constructor or factory.\");\n }\n\n this.resourceTypes.set(key, Constructor);\n for (const alias of options.aliases || [])\n {\n const aliasKey = normalizeRequirement(alias);\n if (aliasKey) this.resourceTypes.set(aliasKey, Constructor);\n }\n return this;\n }\n\n /**\n * Register the direct byte-to-object reader for one input extension.\n * Direct loaders take precedence over registered format facades and are\n * resolved from current setup-time configuration whenever source is read.\n * A direct loader represents only the extension's unforced default result;\n * multiple named outputs belong on a registered format facade.\n *\n * @param {string} ext Input extension with or without a leading dot.\n * @param {Function} loader Reader receiving source bytes and an immutable preparation context.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If the extension or loader is invalid.\n */\n RegisterObjectLoader(ext, loader) {\n const key = normalizeResourceExtension(ext);\n if (!key) throw new TypeError(\"CjsResMan.RegisterObjectLoader requires an extension.\");\n if (typeof loader !== \"function\") throw new TypeError(\"CjsResMan.RegisterObjectLoader requires a loader function.\");\n this.objectLoaders.set(key, loader);\n return this;\n }\n\n /**\n * Register a reusable format facade for each accepted input extension.\n * Multiple candidates may share an extension and are resolved by requested\n * output/media type or by their support probes. Defaults are copied into a\n * deeply frozen plain-object/array snapshot so later caller mutation cannot\n * rewrite the registered configuration. Format methods are read from the\n * currently registered facade when an operation runs.\n *\n * @param {Function} Format Format facade declaring at least one `inputTypes` extension.\n * @param {object} [defaults={}] Plain reader-option defaults to snapshot for this registration.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If the format declaration or immutable defaults snapshot is invalid.\n */\n RegisterFormat(Format, defaults = {})\n {\n if (typeof Format !== \"function\")\n {\n throw new TypeError(\"CjsResMan.RegisterFormat requires a format class.\");\n }\n if (!Array.isArray(Format.inputTypes) || Format.inputTypes.length === 0)\n {\n throw new TypeError(`${Format.name || \"Format\"} must declare non-empty inputTypes.`);\n }\n\n const descriptor = Object.freeze({\n Format,\n defaults: snapshotFormatDefaults(defaults)\n });\n for (const inputType of Format.inputTypes)\n {\n const key = normalizeResourceExtension(inputType);\n if (!key) continue;\n const candidates = this.formats.get(key) || [];\n const next = candidates.filter(candidate => candidate.Format !== Format);\n next.push(descriptor);\n this.formats.set(key, next);\n }\n return this;\n }\n\n /**\n * Return registered format facades for one normalized input extension.\n *\n * @param {string} inputType Input extension with or without a leading dot.\n * @returns {Function[]} Detached format-class list in registration order.\n */\n GetFormats(inputType)\n {\n return this.GetFormatDescriptors(inputType).map(descriptor => descriptor.Format);\n }\n\n /**\n * Select one registered format facade for an input and requested outcome.\n *\n * @param {string} inputType Input extension with or without a leading dot.\n * @param {object} [options={}] Optional format, output, media type, and source-byte selectors.\n * @returns {Function} Unambiguous selected format facade.\n * @throws {Error} If no candidate matches or multiple candidates remain.\n */\n ResolveFormat(inputType, options = {})\n {\n return this.ResolveFormatDescriptor(inputType, options).Format;\n }\n\n /**\n * Return the immediate canonical resource handle for a source path and\n * promised output. Cache hits explicitly renew MotherLode activity. When\n * `reload: true` finds an existing owner, this synchronous method returns a\n * distinct off-registry candidate and leaves the canonical handle untouched.\n * Calling `Ready()` on that candidate, or using `ReloadResource()` /\n * `ReloadObject()`, prepares it and conditionally commits it through the\n * asynchronous atomic-reload contract.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Promised output, semantic resource, source provenance, and reload settings.\n * @returns {CjsResource} Canonical handle, or an off-registry reload candidate.\n * @throws {TypeError} If the path, identity settings, or resource constructor are invalid.\n * @throws {Error} If MotherLode is inactive or displaced-resource cleanup fails.\n */\n GetResource(path, options = {}) {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.GetResource options must be an object.\");\n }\n const key = normalizeResourcePath(path);\n const variant = this.GetResourceVariant(options);\n const ext = normalizeResourceExtension(options.ext || getResourceExtension(key));\n if (options.emit !== undefined)\n {\n const objectLoader = this.GetObjectLoader(ext);\n if (objectLoader)\n {\n throw createObjectLoaderOutputMissingError(ext, options.emit);\n }\n else\n {\n const descriptors = this.GetFormatDescriptors(ext);\n const candidates = filterFormatDescriptors(descriptors, options);\n if (descriptors.length > 0 && candidates.length === 0)\n {\n throw createFormatOutputMissingError(ext, options.emit, descriptors);\n }\n }\n }\n const cacheKey = getMotherLodeKey(key, variant);\n const existing = this.motherLode.Lookup(cacheKey);\n if (existing && options.reload !== true)\n {\n this.#BindResourceLifecycle(cacheKey, existing);\n this.motherLode.KeepAlive?.(cacheKey);\n return existing;\n }\n if (!existing && options.reload === true)\n {\n this.InvalidateReadCache(key, { source: options.source || this.source });\n }\n\n const Constructor = this.ResolveResourceConstructor(options);\n const resource = this.CreateResource(\n Constructor,\n key,\n ext,\n options,\n existing && options.reload === true ? existing : null\n );\n if (existing && options.reload === true)\n {\n this.#BindResourceLifecycle(cacheKey, existing);\n this.motherLode.KeepAlive?.(cacheKey);\n const expectedOwnership = this.#RequireResourceOwnership(existing, \"reload-candidate:create\");\n const generation = this.#nextResourceReloadGeneration++;\n const loaderOptions = Object.freeze(getResourceLoaderOptions(\n options,\n options.source || this.source\n ));\n const candidate = Object.freeze({\n reloadCandidate: true,\n generation,\n owner: this.motherLode,\n key: cacheKey,\n expected: existing,\n expectedOwnership,\n resource,\n loaderOptions\n });\n this.#reloadCandidates.set(resource, candidate);\n this.#reloadGenerations.set(cacheKey, generation);\n\n if (typeof resource.SetObjectLoader === \"function\")\n {\n const reloadOptions = { ...loaderOptions, reload: true };\n resource.SetObjectLoader(\n loadOptions => this.#GetReloadCandidateObject(resource, {\n ...mergeResourceLoaderOptions(reloadOptions, loadOptions),\n reload: true\n }),\n reloadOptions\n );\n }\n return resource;\n }\n\n const insertion = this.motherLode.Insert(cacheKey, resource, { replace: true });\n const canonical = insertion?.resource || resource;\n if (insertion?.displaced && insertion.displaced !== canonical)\n {\n this.#InvalidateResourceOwnership(insertion.displaced);\n }\n else if (existing && existing !== canonical\n && this.motherLode.Lookup(cacheKey) !== existing)\n {\n this.#InvalidateResourceOwnership(existing);\n }\n this.#BindResourceLifecycle(cacheKey, canonical);\n this.motherLode.KeepAlive?.(cacheKey);\n return canonical;\n }\n\n /**\n * Resolve one object outcome for a canonical resource identity. Concurrent\n * callers share only the active operation. Once settled, a resident payload\n * is returned without rereading source data and its explicit payload lease is\n * renewed. If the payload was released, calling this method explicitly starts\n * reconstruction; liveness queries and purge operations never do so.\n * `sourceRevision` selects read-cache provenance but does not replace a\n * resident payload by itself—use one-shot `reload: true` for replacement.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Identity, source, format, loader, and queue options.\n * @returns {Promise<*>} In-flight, resident, or reconstructed object outcome.\n * @throws {TypeError|Error} If path, identity, source, format, or conversion configuration is invalid.\n */\n GetObject(path, options = {})\n {\n const resource = this.GetResource(path, options);\n const operationOptions = mergeResourceLoaderOptions(\n resource.GetObjectRequest?.() || {},\n options\n );\n if (this.#reloadCandidates.has(resource))\n {\n return this.#GetReloadCandidateObject(resource, operationOptions);\n }\n const ownership = this.#RequireResourceOwnership(resource, \"object:begin\");\n const existing = this.objectOperations.get(resource);\n if (existing?.ownership === ownership)\n {\n return existing.promise;\n }\n\n if (resource.HasPayload?.())\n {\n resource.KeepPayloadAlive?.();\n return Promise.resolve(getPublishedResourceObject(resource));\n }\n\n const promise = this.QueueResourceObject(resource, operationOptions);\n const operation = { promise, ownership };\n this.objectOperations.set(resource, operation);\n promise.then(() =>\n {\n if (this.objectOperations.get(resource) === operation)\n {\n this.objectOperations.delete(resource);\n }\n }, () =>\n {\n if (this.objectOperations.get(resource) === operation)\n {\n this.objectOperations.delete(resource);\n }\n });\n return promise;\n }\n\n /**\n * Loads and hydrates an object graph through the configured resource pipeline\n * for the resource manager.\n */\n LoadObject(path, options = {})\n {\n return this.GetObject(path, options);\n }\n\n /**\n * Fetches and hydrates an object graph without retaining a resource handle for\n * the resource manager.\n */\n FetchObject(path, options = {})\n {\n return this.GetObject(path, options);\n }\n\n /**\n * Read and atomically publish a distinct replacement object while the\n * former canonical resource remains available. This is the explicit form of\n * `GetObject(path, { reload: true })`.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Identity, source, format, and queue settings.\n * @returns {Promise<*>} Published CPU object outcome from the committed candidate.\n * @throws {TypeError|Error|AggregateError} If candidate creation, conversion, conditional publication, or cleanup fails.\n */\n ReloadObject(path, options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.ReloadObject options must be an object.\");\n }\n return this.GetObject(path, { ...options, reload: true });\n }\n\n /**\n * Resolve and load one canonical resource handle. One-shot reload creates\n * a distinct candidate, keeps the former good handle canonical through every\n * asynchronous CPU operation, and returns only after an exact-owner conditional\n * publication succeeds. Readiness receives `reload: false` because the\n * candidate's private loader owns the one-shot freshness request.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Resource identity, source provenance, reload, format, and queue options.\n * @returns {Promise<CjsResource>} Loaded canonical resource selected by this operation.\n * @throws {TypeError|Error} If identity, source, format, conversion, or cleanup fails.\n */\n async FetchResource(path, options = {})\n {\n const resource = this.GetResource(path, options);\n const readinessOptions = options.reload === true\n ? { ...options, reload: false }\n : options;\n await resource.Ready(readinessOptions);\n return resource;\n }\n\n /**\n * Load and atomically publish a distinct replacement resource while the\n * former canonical handle remains available. This is the explicit form of\n * `FetchResource(path, { reload: true })`.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Identity, source, format, and queue settings.\n * @returns {Promise<CjsResource>} Fully loaded committed replacement.\n * @throws {TypeError|Error|AggregateError} If candidate creation, conversion, conditional publication, or cleanup fails.\n */\n ReloadResource(path, options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.ReloadResource options must be an object.\");\n }\n return this.FetchResource(path, { ...options, reload: true });\n }\n\n /**\n * Run or join one off-registry candidate operation. The returned promise\n * resolves only after exact-owner publication and displaced-owner cleanup\n * both succeed. A committed cleanup failure rejects with the new candidate\n * still canonical and attached on the MotherLode error result.\n *\n * @param {object|Function} resource Candidate resource returned by `GetResource`.\n * @param {object} options Reload source, format, and queue options.\n * @returns {Promise<*>} Candidate object outcome after conditional publication.\n */\n #GetReloadCandidateObject(resource, options)\n {\n const candidate = this.#reloadCandidates.get(resource) || null;\n if (!candidate)\n {\n return Promise.reject(reloadCandidateUnavailableError(resource));\n }\n\n const existing = this.#reloadOperations.get(resource);\n if (existing?.candidate === candidate) return existing.promise;\n\n const operation = {\n candidate,\n promise: this.#RunReloadCandidate(candidate, options)\n };\n this.#reloadOperations.set(resource, operation);\n operation.promise.then(() =>\n {\n if (this.#reloadOperations.get(resource) === operation)\n {\n this.#reloadOperations.delete(resource);\n }\n }, () =>\n {\n if (this.#reloadOperations.get(resource) === operation)\n {\n this.#reloadOperations.delete(resource);\n }\n });\n return operation.promise;\n }\n\n /**\n * Queue source/read/publication work against a detached candidate, then commit\n * it only if its former exact owner and newest-request token remain current.\n * Candidate work is a normal queued root visible to `Wait()` and holds one\n * purge lock on the former good owner until settlement.\n *\n * @param {CjsResourceReloadCandidate} candidate Immutable candidate authority.\n * @param {object} options Reload source, format, queue, and prepare options.\n * @returns {Promise<*>} Published object outcome after a successful commit.\n */\n async #RunReloadCandidate(candidate, options)\n {\n let committed = false;\n let releaseLock = noop;\n const finishOperation = this.#BeginResourceOperation(true);\n\n try\n {\n this.#AssertReloadCandidate(candidate, \"reload:begin\");\n releaseLock = this.#AcquireResourcePurgeLock(candidate.expectedOwnership);\n const read = this.#BeginReadOperation(candidate.resource.GetPath(), {\n ...options,\n reload: true\n });\n\n this.#AssertReloadCandidate(candidate, \"reload:requested\");\n candidate.resource.error = null;\n candidate.resource.MarkRequested();\n this.#AssertReloadCandidate(candidate, \"reload:requested-settled\");\n\n const bytes = await this.#QueueReadResource(read.context, read.options);\n this.#AssertReloadCandidate(candidate, \"reload:loading\");\n candidate.resource.MarkLoading();\n this.#AssertReloadCandidate(candidate, \"reload:loading-settled\");\n\n const object = await this.#PrepareResourceObjectQueued(\n candidate.resource,\n bytes,\n read.options,\n candidate\n );\n this.#AssertReloadCandidate(candidate, \"reload:commit\");\n\n try\n {\n const result = candidate.owner.ReplaceExpected(\n candidate.key,\n candidate.expected,\n candidate.resource,\n { commitGuard: () => this.#IsReloadCandidateCurrent(candidate) }\n );\n if (!result.committed)\n {\n throw staleReloadCandidateError(candidate, \"reload:commit-compare\");\n }\n committed = true;\n this.#FinalizeCommittedReload(candidate);\n }\n catch (error)\n {\n if (error?.code === \"CJS_MOTHERLODE_REPLACE_CLEANUP_FAILED\"\n && error.result?.committed === true\n && error.result.resource === candidate.resource)\n {\n committed = true;\n try\n {\n this.#FinalizeCommittedReload(candidate);\n }\n catch (finalizeError)\n {\n const combined = new AggregateError(\n [ error, finalizeError ],\n `CjsResMan reload committed with cleanup and finalization failures for ${candidate.key}.`\n );\n combined.code = \"CJS_RESMAN_RELOAD_COMMIT_FAILED\";\n combined.committed = true;\n combined.resource = candidate.resource;\n combined.result = error.result;\n throw combined;\n }\n }\n throw error;\n }\n\n return object;\n }\n catch (error)\n {\n if (!committed)\n {\n throw this.#CreateReloadCandidateFailure(candidate, error);\n }\n throw error;\n }\n finally\n {\n releaseLock();\n finishOperation();\n if (this.#reloadGenerations.get(candidate.key) === candidate.generation)\n {\n this.#reloadGenerations.delete(candidate.key);\n }\n }\n }\n\n /**\n * Bind a successfully committed candidate and invalidate only the displaced\n * handle's former publication generation. The resource loader is restored\n * to ordinary canonical reconstruction behavior.\n *\n * @param {CjsResourceReloadCandidate} candidate Committed candidate authority.\n * @returns {void}\n */\n #FinalizeCommittedReload(candidate)\n {\n this.#InvalidateResourceOwnership(candidate.expected);\n this.#reloadCandidates.delete(candidate.resource);\n const errors = [];\n try\n {\n if (typeof candidate.resource.SetObjectLoader === \"function\")\n {\n candidate.resource.SetObjectLoader(\n loadOptions => this.GetObject(\n candidate.resource.GetPath(),\n mergeResourceLoaderOptions(candidate.loaderOptions, loadOptions)\n ),\n candidate.loaderOptions\n );\n }\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n this.#BindResourceLifecycle(candidate.key, candidate.resource);\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n candidate.owner.KeepAlive?.(candidate.key);\n }\n catch (error)\n {\n errors.push(error);\n }\n if (errors.length)\n {\n const error = new AggregateError(errors, `CjsResMan committed reload finalization failed for ${candidate.key}.`);\n error.code = \"CJS_RESMAN_RELOAD_COMMIT_FINALIZE_FAILED\";\n error.committed = true;\n error.resource = candidate.resource;\n throw error;\n }\n }\n\n /**\n * Mark and clean a failed or stale detached candidate. The original\n * load/prepare/stale error remains the rejection when cleanup succeeds;\n * state-publication or cleanup errors are aggregated without touching the\n * preserved canonical owner.\n *\n * @param {CjsResourceReloadCandidate} candidate Failed candidate authority.\n * @param {*} cause Original operation failure.\n * @returns {*} Original error or a contextual AggregateError.\n */\n #CreateReloadCandidateFailure(candidate, cause)\n {\n const errors = [ cause ];\n try\n {\n candidate.resource.SetError?.(cause);\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n this.#CleanupReloadCandidate(candidate.resource);\n }\n catch (error)\n {\n errors.push(error);\n }\n\n if (errors.length === 1) return cause;\n const error = new AggregateError(errors, `CjsResMan reload candidate cleanup failed for ${candidate.key}.`);\n error.code = \"CJS_RESMAN_RELOAD_CANDIDATE_CLEANUP_FAILED\";\n error.resource = candidate.resource;\n error.cause = cause;\n return error;\n }\n\n /**\n * Release adapter and CPU-payload ownership accumulated by an off-registry\n * candidate. This cleanup is idempotent for CjsResource-compatible handles\n * and never marks the never-canonical candidate `PURGED`.\n *\n * @param {object|Function} resource Detached reload candidate.\n * @returns {void}\n * @throws {AggregateError} If adapter destruction, payload release, or lifecycle detachment fails.\n */\n #CleanupReloadCandidate(resource)\n {\n const errors = [];\n try\n {\n resource.DestroyAdapterResources?.({ destroy: true });\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n resource.ReleasePayload?.();\n }\n catch (error)\n {\n errors.push(error);\n }\n try\n {\n resource.SetLifecycleController?.(null);\n }\n catch (error)\n {\n errors.push(error);\n }\n if (errors.length)\n {\n throw new AggregateError(errors, \"CjsResMan reload candidate ownership cleanup failed.\");\n }\n }\n\n /**\n * Fetches raw source bytes through the configured resource source for the\n * resource manager.\n */\n Fetch(path, options = {})\n {\n return options.resource === true || options.requirement !== undefined || options.payload !== undefined\n ? this.FetchResource(path, options)\n : this.FetchObject(path, options);\n }\n\n /**\n * Read and prepare an existing resource immediately, outside the manager\n * queues. One balanced purge lock protects the canonical handle for the\n * complete asynchronous operation; any caller-owned locks remain intact.\n * Failure is published to the resource before rejection only while its\n * captured ownership generation remains canonical. A detached operation\n * preserves its original failure without changing the old handle.\n *\n * @param {CjsResource} resource Existing manager-bound resource handle.\n * @param {object} [options={}] Source, format, semantic outcome, and queue options.\n * @returns {Promise<*>} Prepared object, or the semantic resource when it owns the payload.\n * @throws {TypeError|Error} If the resource, source, format, options, or canonical ownership are invalid.\n */\n async LoadResourceObject(resource, options = {})\n {\n const read = this.#BeginReadOperation(resource.GetPath(), options);\n const ownership = this.#RequireResourceOwnership(resource, \"direct-load:begin\");\n const releaseLock = this.#AcquireResourcePurgeLock(ownership);\n const finishOperation = this.#BeginResourceOperation(false);\n\n try {\n this.#AssertResourceOwnership(ownership, \"direct-load:loading\");\n resource.error = null;\n resource.MarkLoading();\n this.#AssertResourceOwnership(ownership, \"direct-load:loading-settled\");\n const bytes = await this.#ReadResource(read.context, read.options);\n this.#AssertResourceOwnership(ownership, \"direct-load:source-settled\");\n return await this.#PrepareResourceObject(resource, bytes, read.options, ownership);\n } catch (error) {\n if (this.#IsResourceOwnershipCurrent(ownership)) resource.SetError(error);\n throw error;\n } finally {\n releaseLock();\n finishOperation();\n }\n }\n\n /**\n * Queue a source read followed by CPU conversion and publication. One balanced\n * purge lock is acquired before request publication and released only after\n * success or failure, preventing inactivity sweeps from detaching an active\n * handle. The lock does not reload data and does not consume caller locks.\n *\n * @param {CjsResource} resource Existing manager-bound resource handle.\n * @param {object} [options={}] Source, format, queue, and semantic outcome options.\n * @returns {Promise<*>} Promise for the loaded object or semantic resource.\n * @throws {TypeError} If the resource cannot be queued or its options are invalid.\n */\n QueueResourceObject(resource, options = {}) {\n const read = this.#BeginReadOperation(resource.GetPath(), options);\n const ownership = this.#RequireResourceOwnership(resource, \"queue:begin\");\n const releaseLock = this.#AcquireResourcePurgeLock(ownership);\n const finishOperation = this.#BeginResourceOperation(true);\n let load;\n\n try {\n this.#AssertResourceOwnership(ownership, \"queue:requested\");\n resource.error = null;\n resource.MarkRequested();\n this.#AssertResourceOwnership(ownership, \"queue:requested-settled\");\n load = this.#QueueReadResource(read.context, read.options);\n } catch (error) {\n releaseLock();\n finishOperation();\n throw error;\n }\n\n const operation = load\n .then(bytes => {\n this.#AssertResourceOwnership(ownership, \"queue:loading\");\n resource.MarkLoading();\n this.#AssertResourceOwnership(ownership, \"queue:loading-settled\");\n return this.#PrepareResourceObjectQueued(resource, bytes, read.options, ownership);\n })\n .catch(error => {\n if (this.#IsResourceOwnershipCurrent(ownership)) resource.SetError(error);\n throw error;\n })\n .finally(releaseLock);\n operation.then(finishOperation, finishOperation);\n return operation;\n }\n\n /**\n * Queue one source read under the selected source/path/revision identity.\n * Cache policy is tri-state: omitted shares an in-flight or explicitly\n * retained record, `true` additionally retains success, and `false` bypasses\n * both sharing and retention. `reload: true` invalidates this source/path\n * before the new task and does not cancel detached existing consumers.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {CjsResManReadCacheOptions} [options={}] Source, revision, reload, and cache controls forwarded to the read.\n * @returns {Promise<*>} Promise for source bytes or source-compatible data.\n * @throws {TypeError} If path, source, revision, or options are invalid.\n */\n QueueReadResource(path, options = {})\n {\n const read = this.#BeginReadOperation(path, options);\n return this.#QueueReadResource(read.context, read.options);\n }\n\n /**\n * Immediately read, transform, and publish one resource payload outside the\n * manager queues. Canonical resources capture their current ownership\n * generation and cannot publish after deletion, clearing, or replacement;\n * historically supported detached resource-like objects remain usable\n * without manager ownership guards.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} bytes Source bytes or reader-compatible source data.\n * @param {object} [options={}] Format and semantic outcome options.\n * @returns {Promise<*>} Final plain payload or semantic resource handle.\n * @throws {Error} If reading/preparation fails or canonical ownership becomes stale.\n */\n async PrepareResourceObject(resource, bytes, options = {}) {\n const ownership = this.#GetResourceOwnership(resource, \"direct-prepare:begin\");\n if (!ownership)\n {\n return this.#PrepareResourceObject(resource, bytes, options, null);\n }\n\n const releaseLock = this.#AcquireResourcePurgeLock(ownership);\n const finishOperation = this.#BeginResourceOperation(false);\n try\n {\n return await this.#PrepareResourceObject(resource, bytes, options, ownership);\n }\n finally\n {\n releaseLock();\n finishOperation();\n }\n }\n\n /**\n * Queue one reader/format conversion and then CPU publication on the main\n * manager queue. A canonical standalone call becomes a queued resource root\n * for `Wait()` and retains one balanced purge lock through settlement.\n * The read and publication items validate the captured canonical generation\n * before dispatch and after asynchronous settlement.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} bytes Source bytes or reader-compatible source data.\n * @param {object} [options={}] Format and semantic outcome options.\n * @returns {Promise<*>} Final plain payload or semantic resource handle.\n * @throws {Error} If queueing/preparation fails or canonical ownership becomes stale.\n */\n async PrepareResourceObjectQueued(resource, bytes, options = {}) {\n const ownership = this.#GetResourceOwnership(resource, \"queued-prepare:begin\");\n if (!ownership)\n {\n return this.#PrepareResourceObjectQueued(resource, bytes, options, null);\n }\n\n const releaseLock = this.#AcquireResourcePurgeLock(ownership);\n const finishOperation = this.#BeginResourceOperation(true);\n try\n {\n return await this.#PrepareResourceObjectQueued(resource, bytes, options, ownership);\n }\n finally\n {\n releaseLock();\n finishOperation();\n }\n }\n\n /**\n * Read and immediately publish one CPU payload with optional hidden\n * ownership authority. Format classes own every requested conversion;\n * backend realization runs separately after this CPU publication.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} bytes Source bytes or reader-compatible source data.\n * @param {object} options Resolved prepare options.\n * @param {CjsResourceMutationAuthority|null} ownership Captured canonical or reload-candidate authority.\n * @returns {Promise<*>} Final plain payload or semantic resource handle.\n */\n async #PrepareResourceObject(resource, bytes, options, ownership) {\n this.#AssertOptionalResourceOwnership(ownership, \"prepare:read\");\n const object = await this.ReadResourceObjectPayload(resource, bytes, options);\n this.#AssertOptionalResourceOwnership(ownership, \"prepare:read-settled\");\n return this.#PublishResourceObject(ownership, resource, object, options);\n }\n\n /**\n * Queue one main-thread reader/format operation followed by guarded CPU\n * publication. Both remain distinct budgeted queue items under one resource\n * root so `Wait()` continues to fence dynamically enqueued publication.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} bytes Source bytes or reader-compatible source data.\n * @param {object} options Resolved prepare options.\n * @param {CjsResourceMutationAuthority|null} ownership Captured canonical or reload-candidate authority.\n * @returns {Promise<*>} Final plain payload or semantic resource handle.\n */\n async #PrepareResourceObjectQueued(resource, bytes, options, ownership) {\n let object = bytes;\n const resolved = this.#ResolveResourceObjectRead(resource, bytes, options);\n const formatOptions = resolved.descriptor\n ? createFormatReadOptions(resolved.descriptor, options)\n : null;\n const runInWorker = Boolean(\n resolved.descriptor\n && typeof this.resourceLoader?.CanReadFormat === \"function\"\n && this.resourceLoader.CanReadFormat(resolved.descriptor, formatOptions)\n );\n\n let read;\n if (runInWorker)\n {\n this.#AssertOptionalResourceOwnership(ownership, \"worker-stage:read:run\");\n read = await this.#ReadResolvedResourceObjectPayload(\n resource,\n bytes,\n options,\n resolved\n );\n }\n else\n {\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:read:enqueue\");\n const readTask = this.QueueTask(CjsResManQueue.MAIN, () =>\n {\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:read:run\");\n return this.#ReadResolvedResourceObjectPayload(\n resource,\n bytes,\n options,\n resolved\n );\n }, resource, {\n kind: \"prepare\",\n stage: \"read\",\n path: resource.GetPath()\n });\n read = await readTask.promise;\n }\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:read:settled\");\n if (read !== undefined) object = read;\n\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:publish:enqueue\");\n const publishTask = this.QueueTask(CjsResManQueue.MAIN, () =>\n {\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:publish:run\");\n return this.#PublishResourceObject(ownership, resource, object, options);\n }, resource, {\n kind: \"prepare\",\n stage: \"publish\",\n path: resource.GetPath()\n });\n const published = await publishTask.promise;\n this.#AssertOptionalResourceOwnership(ownership, \"queue-stage:publish:settled\");\n if (published !== undefined) object = published;\n return object;\n }\n\n /**\n * Decode source bytes with the currently registered reader for the resource\n * extension. A direct extension loader wins over registered format candidates;\n * byte support probes may disambiguate those candidates.\n *\n * @param {CjsResource} resource Resource whose reader outcome is requested.\n * @param {*} bytes Source byte payload.\n * @param {object} [options={}] Requested output plus per-operation controls.\n * @returns {Promise<*>} Direct-loader or registered-format reader outcome.\n * @throws {Error|TypeError} If no registered reader matches or its read contract fails.\n */\n async ReadResourceObjectPayload(resource, bytes, options = {}) {\n return this.#ReadResolvedResourceObjectPayload(\n resource,\n bytes,\n options,\n this.#ResolveResourceObjectRead(resource, bytes, options)\n );\n }\n\n /**\n * Resolve the configured direct loader or format descriptor once so queue\n * selection and execution use the same registration snapshot.\n *\n * @param {CjsResource} resource Resource whose CPU outcome is requested.\n * @param {*} bytes Source input.\n * @param {object} options Requested output options.\n * @returns {{loader: Function|null, descriptor: object|null}} Resolved reader.\n */\n #ResolveResourceObjectRead(resource, bytes, options) {\n const explicitLoader = this.GetObjectLoader(resource.GetExt());\n if (explicitLoader)\n {\n if (options.emit !== undefined)\n {\n throw createObjectLoaderOutputMissingError(resource.GetExt(), options.emit);\n }\n return { loader: explicitLoader, descriptor: null };\n }\n\n return {\n loader: null,\n descriptor: this.ResolveFormatDescriptor(resource.GetExt(), { ...options, bytes })\n };\n }\n\n /**\n * Execute one already-resolved reader through its direct or format path.\n *\n * @param {CjsResource} resource Resource whose CPU outcome is requested.\n * @param {*} bytes Source input.\n * @param {object} options Requested output options.\n * @param {{loader: Function|null, descriptor: object|null}} resolved Reader selection.\n * @returns {Promise<*>} Reader result.\n */\n #ReadResolvedResourceObjectPayload(resource, bytes, options, resolved) {\n if (resolved.loader)\n {\n return resolved.loader(\n bytes,\n createPrepareContext(this, resource, bytes, options, \"read\")\n );\n }\n return this.ReadFormatOnce(resource, resolved.descriptor, bytes, options);\n }\n\n /**\n * Publish the final CPU object outcome and loaded state. Every\n * CjsResource-compatible handle owns the reader/converter result through\n * `SetPayload`, making CPU payloads visible to MotherLode retention policy.\n * Base resources also expose the payload through the compatibility `object`\n * alias; semantic subclasses continue to return and alias the resource while\n * retaining their validated payload privately.\n *\n * @param {CjsResource} resource Target canonical resource handle.\n * @param {*} object Final reader or format-converter outcome.\n * @param {object} [options={}] Semantic resource validation/publication options.\n * @returns {*} Plain payload for a base resource, or the semantic resource handle.\n * @throws {TypeError|Error} If ownership, semantic payload validation, or loaded-state publication fails.\n */\n PublishResourceObject(resource, object, options = {}) {\n const ownership = this.#GetResourceOwnership(resource, \"publish:begin\");\n if (!ownership)\n {\n return this.#PublishResourceObjectValue(resource, object, options);\n }\n\n const finishOperation = this.#BeginResourceOperation(false);\n try\n {\n return this.#PublishResourceObject(ownership, resource, object, options);\n }\n finally\n {\n finishOperation();\n }\n }\n\n /**\n * Publish only while the captured resource authority remains canonical.\n * The post-publication check catches synchronous reentrant ownership changes\n * from state listeners before the caller can treat obsolete work as success.\n *\n * @param {CjsResourceMutationAuthority|null} ownership Captured canonical or reload-candidate authority.\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} object Final reader/converter outcome.\n * @param {object} options Semantic resource publication options.\n * @returns {*} Plain payload or semantic resource handle.\n */\n #PublishResourceObject(ownership, resource, object, options) {\n this.#AssertOptionalResourceOwnership(ownership, \"publish\");\n const result = this.#PublishResourceObjectValue(resource, object, options);\n this.#AssertOptionalResourceOwnership(ownership, \"publish-settled\");\n return result;\n }\n\n /**\n * Apply the unguarded synchronous payload/state mutation after the caller\n * has established any required canonical authority.\n *\n * @param {object|Function} resource Resource receiving the final payload.\n * @param {*} object Final reader/converter outcome.\n * @param {object} options Semantic resource publication options.\n * @returns {*} Plain payload or semantic resource handle.\n */\n #PublishResourceObjectValue(resource, object, options) {\n let result = object;\n if (resource.constructor !== CjsResource && typeof resource.SetPayload === \"function\") {\n resource.SetPayload(object, options);\n resource.object = resource;\n result = resource;\n }\n else {\n resource.SetPayload?.(object, options);\n resource.object = object;\n }\n // PREPARED, not LOADED: `object` is the reader/converter OUTCOME, so the\n // bytes have already been turned into whatever they needed to become.\n // LOADED means raw source data is in hand and still has to be prepared - a\n // resource in that state is not yet good, and marking it here left IsGood()\n // permanently false for every resource that does not prepare itself.\n if (!resource.IsPrepared?.()) resource.MarkPrepared();\n return result;\n }\n\n /**\n * Warms a resource and its discovered dependencies without returning payload\n * data for the resource manager.\n */\n async Prefetch(paths, options = {}) {\n const entries = Array.isArray(paths) ? paths : [paths];\n return Promise.all(entries.map(path => this.LoadObject(path, options)));\n }\n\n /**\n * Return the currently registered direct reader for an input extension.\n *\n * @param {string} ext Input extension with or without a leading dot.\n * @returns {Function|null} Registered loader or `null`.\n */\n GetObjectLoader(ext) {\n return this.objectLoaders.get(normalizeResourceExtension(ext)) || null;\n }\n\n /**\n * Return detached references to the current format descriptors for one input\n * extension. Each descriptor contains its facade and frozen defaults.\n *\n * @param {string} inputType Input extension with or without a leading dot.\n * @returns {object[]} Descriptor list in registration order.\n */\n GetFormatDescriptors(inputType)\n {\n return [ ...(this.formats.get(normalizeResourceExtension(inputType)) || []) ];\n }\n\n /**\n * Resolve one current format registration descriptor. Output/media filters\n * run first; optional source bytes may then run support probes to disambiguate.\n *\n * @param {string} inputType Input extension with or without a leading dot.\n * @param {object} [options={}] Format, output, media type, and optional byte selectors.\n * @returns {object} Selected immutable registration descriptor.\n * @throws {Error} If no candidate matches or multiple candidates remain.\n */\n ResolveFormatDescriptor(inputType, options = {})\n {\n const key = normalizeResourceExtension(inputType);\n const descriptors = this.GetFormatDescriptors(key);\n const candidates = filterFormatDescriptors(descriptors, options);\n if (descriptors.length > 0 && candidates.length === 0 && options.emit !== undefined)\n {\n throw createFormatOutputMissingError(key, options.emit, descriptors);\n }\n return resolveFormatDescriptorCandidates(candidates, key, options);\n }\n\n /**\n * Invoke one format descriptor using its frozen registration defaults and\n * the request's explicit format options. Static async/sync readers take\n * precedence over instance `ReadAsync`/`Read` compatibility methods.\n *\n * @param {object} descriptor Selected immutable registration descriptor.\n * @param {*} bytes Source bytes supplied to the format facade.\n * @param {object} [options={}] Output, class, and `formatOptions` overrides.\n * @returns {Promise<*>} Parsed format outcome.\n * @throws {TypeError|Error} If the facade lacks a reader or reading fails.\n */\n async ReadFormat(descriptor, bytes, options = {})\n {\n return this.resourceLoader.ReadFormat(\n descriptor,\n bytes,\n createFormatReadOptions(descriptor, options)\n );\n }\n\n /**\n * Look up and explicitly renew an existing canonical resource without\n * creating, loading, or preparing a new handle.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object} [options={}] Identity-defining resource outcome settings.\n * @returns {CjsResource|null} Existing canonical handle, or `null` when absent.\n * @throws {TypeError} If the path or identity settings cannot be normalized.\n */\n Lookup(path, options = {}) {\n const normalizedPath = normalizeResourcePath(path);\n const key = getMotherLodeKey(normalizedPath, this.GetResourceVariant(options));\n const resource = this.motherLode.Lookup(key);\n if (resource)\n {\n this.#BindResourceLifecycle(key, resource);\n this.motherLode.KeepAlive?.(key);\n }\n return resource;\n }\n\n /**\n * Forget and clean canonical resources for a source path. Omitting options\n * removes every resolved variant; supplying options removes only the exact\n * identity derived from those outcome settings. Explicitly retained source\n * and format records are independent and remain available; call\n * {@link CjsResMan#InvalidateReadCache} when they must also be forgotten.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {object|null} [options=null] Exact identity settings, or `null` for all variants.\n * @returns {boolean} Whether at least one canonical resource was removed.\n * @throws {TypeError} If the path or identity settings cannot be normalized.\n * @throws {Error|AggregateError} If cleanup fails after identities are forgotten.\n */\n Delete(path, options = null) {\n if (options !== null && options !== undefined)\n {\n const normalizedPath = normalizeResourcePath(path);\n const key = getMotherLodeKey(normalizedPath, this.GetResourceVariant(options));\n const resource = this.motherLode.Lookup(key);\n try\n {\n return this.motherLode.Delete(key);\n }\n finally\n {\n if (resource && this.motherLode.Lookup(key) !== resource)\n {\n this.#InvalidateResourceOwnership(resource);\n }\n this.#reloadGenerations.delete(key);\n }\n }\n\n const normalizedPath = normalizeResourcePath(path);\n const prefix = `${normalizedPath}\\u0000`;\n const entries = typeof this.motherLode?.Entries === \"function\"\n ? [ ...this.motherLode.Entries() ].filter(([ key ]) =>\n key === normalizedPath || key.startsWith(prefix))\n : [];\n try\n {\n return this.motherLode.DeleteAllVariants(normalizedPath);\n }\n finally\n {\n for (const [ key, resource ] of entries)\n {\n this.#reloadGenerations.delete(key);\n if (this.motherLode.Lookup(key) !== resource)\n {\n this.#InvalidateResourceOwnership(resource);\n }\n }\n }\n }\n\n /**\n * Run one explicit deterministic identity/payload inactivity sweep.\n * This delegates policy and cleanup to MotherLode; it never fetches or\n * reloads a purged resource.\n *\n * @param {object} [options={}] MotherLode frame/time limits and cleanup policy.\n * @returns {object} Immutable purge counts and affected canonical keys.\n * @throws {TypeError} If the configured MotherLode lacks purge support or policy is invalid.\n * @throws {AggregateError} If one or more candidate resources fail cleanup.\n */\n PurgeInactive(options = {})\n {\n if (typeof this.motherLode?.PurgeInactive !== \"function\")\n {\n throw new TypeError(\"CjsResMan MotherLode does not support PurgeInactive().\");\n }\n return this.motherLode.PurgeInactive(options);\n }\n\n /**\n * Replace or disable the opt-in automatic inactivity policy. Configuration\n * resets cadence, so the first subsequent pump performs a sweep immediately.\n * Frame-based limits are rejected because manager updates are not a reliable\n * renderer-frame clock. The normalized policy is frozen and never reloads\n * resources.\n *\n * @param {CjsResManAutoPurgePolicy|false|null} [policy=null] Time-based policy, or `false`/`null` to disable automatic sweeping.\n * @returns {CjsResMan} This resource manager.\n * @throws {TypeError} If the policy, threshold, cleanup control, or clock is invalid.\n */\n SetAutoPurgePolicy(policy = null)\n {\n this.#autoPurgePolicy = normalizeAutoPurgePolicy(policy);\n this.#lastAutoPurgeTime = null;\n return this;\n }\n\n /**\n * Return the immutable normalized automatic inactivity policy.\n *\n * @returns {Readonly<CjsResManAutoPurgePolicy>|null} Active policy, or `null` when automatic sweeping is disabled.\n */\n GetAutoPurgePolicy()\n {\n return this.#autoPurgePolicy;\n }\n\n /**\n * Report whether {@link CjsResMan#Update} may run automatic inactivity\n * sweeps. This is a pure query and does not advance cadence or activity.\n *\n * @returns {boolean} Whether an automatic purge policy is configured.\n */\n IsAutoPurgeEnabled()\n {\n return this.#autoPurgePolicy !== null;\n }\n\n /**\n * Run the configured automatic sweep when its minimum time interval has\n * elapsed. The first pump after configuration runs immediately. A regressing\n * clock rebases cadence and skips that pump; failures consume the interval so\n * repeated updates cannot form a cleanup-error storm. This method never\n * creates, fetches, prepares, or reloads a resource.\n *\n * @param {CjsResManAutoPurgePumpOptions} [options={}] Optional deterministic timestamp.\n * @returns {object|null} Immutable MotherLode purge result when due, otherwise `null`.\n * @throws {TypeError} If options, the clock result, or MotherLode purge policy are invalid.\n * @throws {AggregateError} If a due sweep cannot clean one or more inactive resources.\n */\n PumpAutoPurge(options = {})\n {\n const pump = normalizeAutoPurgePumpOptions(options);\n const policy = this.#autoPurgePolicy;\n if (!policy) return null;\n\n const time = pump.time === undefined ? policy.now() : pump.time;\n assertNonNegativeNumber(time, \"automatic purge time\");\n\n if (this.#lastAutoPurgeTime !== null)\n {\n if (time < this.#lastAutoPurgeTime)\n {\n this.#lastAutoPurgeTime = time;\n return null;\n }\n if (time - this.#lastAutoPurgeTime < policy.intervalMilliseconds)\n {\n return null;\n }\n }\n\n this.#lastAutoPurgeTime = time;\n return this.PurgeInactive({\n time,\n maxIdleMilliseconds: policy.maxIdleMilliseconds,\n payloadMaxIdleMilliseconds: policy.payloadMaxIdleMilliseconds,\n destroyAdapters: policy.destroyAdapters,\n releasePayload: policy.releasePayload,\n ...(policy.cleanup === undefined ? {} : { cleanup: policy.cleanup })\n });\n }\n\n /**\n * Cancel queued-but-not-started work, remove every canonical resource through\n * MotherLode cleanup, and reset all in-flight deduplication ledgers.\n *\n * @returns {CjsResMan} This empty resource manager.\n * @throws {AggregateError} If one or more canonical resources fail cleanup.\n */\n Clear() {\n this.#InvalidateMotherLodeOwnership(this.motherLode);\n this._loadQueue.Clear();\n this._prepareQueue.Clear();\n this.motherLode.Clear();\n this.objectOperations = new WeakMap();\n this.sourceOperations = new WeakMap();\n this.queuedSourceOperations = new WeakMap();\n this.formatOperations = new WeakMap();\n this.#reloadGenerations.clear();\n this.#lastAutoPurgeTime = null;\n return this;\n }\n\n /**\n * Detach reusable source and parsed-format records for one source path.\n * Omitting `sourceRevision` removes every revision for the selected source;\n * supplying it removes only that string/finite-number revision. Existing\n * consumers keep their promises: invalidation does not abort, reject, touch\n * MotherLode/payload ownership, or perform source work.\n *\n * `Delete()` deliberately remains resource-identity-only. Use this method\n * when explicitly retained read caches must also be forgotten; `Clear()`\n * resets every read ledger.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {CjsResManReadCacheOptions} [options={}] Optional `source` and exact `sourceRevision` selection.\n * @returns {Readonly<{path: string, queuedSource: number, source: number, format: number}>} Frozen detached-record counts.\n * @throws {TypeError} If path, source, revision, or options are invalid.\n */\n InvalidateReadCache(path, options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan.InvalidateReadCache options must be an object.\");\n }\n const normalizedPath = normalizeResourcePath(path);\n const hasRevision = hasOwn(options, \"sourceRevision\");\n const revisionKey = hasRevision\n ? normalizeSourceRevision(options.sourceRevision)\n : null;\n const source = options.source || this.source;\n if (!source)\n {\n return Object.freeze({\n path: normalizedPath,\n queuedSource: 0,\n source: 0,\n format: 0\n });\n }\n if ((typeof source !== \"object\" && typeof source !== \"function\")\n || typeof source.Read !== \"function\")\n {\n throw new TypeError(\"CjsResMan.InvalidateReadCache source must provide Read(path, options).\");\n }\n\n return this.#InvalidateReadCache(source, normalizedPath, revisionKey);\n }\n\n /**\n * Read source data under source/path/revision cache identity. Cache policy is\n * tri-state: omitted shares in-flight or explicitly retained work, `true`\n * retains success, and `false` bypasses sharing and retention. Failures are\n * never retained. A joining `true` request upgrades the shared record.\n *\n * `reload: true` invalidates the selected source/path synchronously before\n * beginning fresh work; it does not cancel already detached consumers.\n *\n * @param {string} path Carbon-style source resource path.\n * @param {CjsResManReadCacheOptions} [options={}] Source, revision, reload, and cache controls forwarded to the source.\n * @returns {Promise<*>} Promise for bytes or source-compatible data.\n * @throws {TypeError} If path, source, revision, cache policy, or options are invalid.\n */\n ReadResource(path, options = {})\n {\n const read = this.#BeginReadOperation(path, options);\n return this.#ReadResource(read.context, read.options);\n }\n\n /**\n * Normalize one source provenance context and invalidate stale path records\n * once at the outermost reload boundary.\n *\n * @param {string} path Source path.\n * @param {object} options Read options.\n * @returns {{context: Readonly<CjsResourceReadContext>, options: object}} Context and detached operation options.\n * @throws {TypeError} If source provenance or options are invalid.\n */\n #BeginReadOperation(path, options)\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan read options must be an object.\");\n }\n\n const normalizedPath = normalizeResourcePath(path);\n const inherited = READ_CONTEXTS.get(options);\n if (inherited && inherited.resMan === this && inherited.path === normalizedPath)\n {\n return { context: inherited, options };\n }\n\n const source = options.source || this.source;\n if (!source || (typeof source !== \"object\" && typeof source !== \"function\")\n || typeof source.Read !== \"function\")\n {\n throw new TypeError(\"CjsResMan requires a source with Read(path, options) to load objects.\");\n }\n const sourceRevision = options.sourceRevision;\n const revisionKey = normalizeSourceRevision(sourceRevision);\n normalizeCachePolicy(options.cacheSource, \"cacheSource\");\n normalizeCachePolicy(options.cacheFormat, \"cacheFormat\");\n\n const operationOptions = { ...options };\n const context = Object.freeze({\n resMan: this,\n source,\n path: normalizedPath,\n sourcePath: sourceRequiresUrl(source)\n ? this.BuildUrl(normalizedPath)\n : normalizedPath,\n sourceRevision,\n revisionKey\n });\n READ_CONTEXTS.set(operationOptions, context);\n\n if (options.reload === true)\n {\n this.#InvalidateReadCache(source, normalizedPath, null);\n }\n return { context, options: operationOptions };\n }\n\n /**\n * Queue one normalized source operation and deduplicate according to the\n * caller's cache policy.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @param {object} options Detached read options.\n * @returns {Promise<*>} Promise for source bytes/data.\n */\n #QueueReadResource(context, options)\n {\n const cachePolicy = normalizeCachePolicy(options.cacheSource, \"cacheSource\");\n const operations = getOwnerOperations(this.queuedSourceOperations, context.source, true);\n const key = getReadOperationKey(context);\n const bypassExisting = options.reload === true || cachePolicy === false;\n const existing = bypassExisting ? null : operations.get(key);\n if (existing)\n {\n if (cachePolicy === true)\n {\n existing.retain = true;\n const sourceRecord = getOwnerOperations(this.sourceOperations, context.source, false)?.get(key);\n if (sourceRecord) sourceRecord.retain = true;\n }\n return existing.promise;\n }\n\n /** @type {CjsResourceReadOperationRecord} */\n const record = {\n promise: null,\n path: context.path,\n revisionKey: context.revisionKey,\n retain: cachePolicy === true\n };\n record.promise = this.QueueTask(\n CjsResManQueue.BACKGROUND,\n () => this.#ReadResource(context, options, record),\n context.source,\n { kind: \"load\", path: context.path }\n ).promise;\n if (cachePolicy !== false) operations.set(key, record);\n\n record.promise.then(value =>\n {\n if (cachePolicy === false || operations.get(key) !== record) return;\n if (record.retain) this.#RetainSourceResult(context, value);\n operations.delete(key);\n }, () =>\n {\n if (cachePolicy !== false && operations.get(key) === record) operations.delete(key);\n });\n return record.promise;\n }\n\n /**\n * Run or join one normalized direct source operation.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @param {object} options Detached read options.\n * @param {CjsResourceReadOperationRecord|null} [queuedRecord=null] Parent queued record whose retention may be promoted by a later join.\n * @returns {Promise<*>} Promise for source bytes/data.\n */\n #ReadResource(context, options, queuedRecord = null)\n {\n const cachePolicy = normalizeCachePolicy(options.cacheSource, \"cacheSource\");\n const operations = getOwnerOperations(this.sourceOperations, context.source, true);\n const key = getReadOperationKey(context);\n const bypassExisting = options.reload === true || cachePolicy === false;\n const existing = bypassExisting ? null : operations.get(key);\n if (existing)\n {\n if (cachePolicy === true || queuedRecord?.retain) existing.retain = true;\n return existing.promise;\n }\n\n /** @type {CjsResourceReadOperationRecord} */\n const record = {\n promise: null,\n path: context.path,\n revisionKey: context.revisionKey,\n retain: cachePolicy === true || queuedRecord?.retain === true\n };\n record.promise = Promise.resolve().then(() =>\n this.resourceLoader.Read(\n context.source,\n context.sourcePath,\n {\n ...options,\n resourcePath: context.path\n }\n )\n );\n if (cachePolicy !== false) operations.set(key, record);\n record.promise.then(() =>\n {\n if (cachePolicy !== false && !record.retain && operations.get(key) === record)\n {\n operations.delete(key);\n }\n }, () =>\n {\n if (cachePolicy !== false && operations.get(key) === record) operations.delete(key);\n });\n return record.promise;\n }\n\n /**\n * Retain a settled source result when a queued caller upgraded cache policy\n * after the direct source promise had already completed its cleanup reaction.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @param {*} value Settled source result.\n * @returns {void}\n */\n #RetainSourceResult(context, value)\n {\n const operations = getOwnerOperations(this.sourceOperations, context.source, true);\n const key = getReadOperationKey(context);\n const existing = operations.get(key);\n if (existing)\n {\n existing.retain = true;\n return;\n }\n operations.set(key, {\n promise: Promise.resolve(value),\n path: context.path,\n revisionKey: context.revisionKey,\n retain: true\n });\n }\n\n /**\n * Remove future-reuse records matching one selected source and path.\n * A null revision removes all revisions.\n *\n * @param {object|Function} source Selected source.\n * @param {string} path Normalized source path.\n * @param {string|null} revisionKey Exact revision key or `null` for all.\n * @returns {Readonly<{path: string, queuedSource: number, source: number, format: number}>} Frozen detached counts.\n */\n #InvalidateReadCache(source, path, revisionKey)\n {\n const queuedSource = removeOperationRecords(\n getOwnerOperations(this.queuedSourceOperations, source, false),\n path,\n revisionKey\n );\n const sourceCount = removeOperationRecords(\n getOwnerOperations(this.sourceOperations, source, false),\n path,\n revisionKey\n );\n let format = 0;\n const descriptors = this.formatOperations.get(source);\n if (descriptors)\n {\n for (const [ descriptor, operations ] of descriptors)\n {\n format += removeOperationRecords(operations, path, revisionKey);\n if (operations.size === 0) descriptors.delete(descriptor);\n }\n if (descriptors.size === 0) this.formatOperations.delete(source);\n }\n return Object.freeze({ path, queuedSource, source: sourceCount, format });\n }\n\n /**\n * Construct and initialize one resource handle, optionally rejecting a\n * singleton alias before `Initialize()` can mutate the protected owner.\n *\n * @param {Function} Constructor Resource constructor selected for the outcome.\n * @param {string} path Normalized Carbon-style resource path.\n * @param {string} ext Normalized resource extension.\n * @param {object} [options={}] Constructor values, requested output, semantic requirement, and source provenance.\n * @param {object|Function|null} [disallowedAlias=null] Existing owner that a staged candidate must not reuse.\n * @returns {CjsResource} Initialized resource-compatible handle.\n * @throws {TypeError|Error} If construction, candidate identity, or initialization is invalid.\n */\n CreateResource(Constructor, path, ext, options = {}, disallowedAlias = null) {\n const resource = new Constructor(options.values);\n if (!resource || typeof resource.Initialize !== \"function\") {\n throw new TypeError(\"Resource constructor must create a CjsResource-compatible object.\");\n }\n if (disallowedAlias && resource === disallowedAlias)\n {\n throw reloadCandidateAliasError(path, resource);\n }\n resource.Initialize(path, ext, normalizeRequirement(options.requirement || options.payload || \"\"));\n if (typeof resource.SetObjectLoader === \"function\")\n {\n const loaderOptions = getResourceLoaderOptions(options, options.source || this.source);\n resource.SetObjectLoader(\n loadOptions => this.GetObject(\n path,\n mergeResourceLoaderOptions(loaderOptions, loadOptions)\n ),\n loaderOptions\n );\n }\n return resource;\n }\n\n /**\n * Resolve the current resource constructor for a semantic request. Explicit\n * requirement/payload selection precedes an emitted-output registration;\n * otherwise the generic `CjsResource` handle is used.\n *\n * @param {object} [options={}] Semantic requirement, payload, and emit request.\n * @returns {Function} Registered resource constructor or `CjsResource`.\n */\n ResolveResourceConstructor(options = {})\n {\n const requested = normalizeRequirement(options.requirement || options.payload);\n if (requested && this.resourceTypes.has(requested)) return this.resourceTypes.get(requested);\n\n const emitted = normalizeRequirement(options.emit);\n if (emitted && this.resourceTypes.has(emitted)) return this.resourceTypes.get(emitted);\n\n return CjsResource;\n }\n\n /**\n * Resolve the promised output tag used with the normalized source path.\n *\n * An explicit `variant` wins. Otherwise the requested emitted output is the\n * promise, followed by the semantic requirement/payload for resource-only\n * requests. Reader classes, constructors, and format options\n * are execution details and never enter this identity.\n *\n * @param {object} [options={}] Resource request containing an optional output tag.\n * @returns {string} Normalized promised output tag, or an empty string for the default outcome.\n * @throws {TypeError} If options or its selected tag is invalid.\n */\n GetResourceVariant(options = {})\n {\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan resource variant options must be an object.\");\n }\n if (hasOwn(options, \"variant\")\n && options.variant !== undefined)\n {\n if (typeof options.variant !== \"string\" || options.variant.trim() === \"\")\n {\n throw new TypeError(\"CjsResMan explicit resource variant must be a non-empty string.\");\n }\n return normalizeResourceVariant(options.variant);\n }\n return normalizeResourceVariant(\n options.emit\n ?? options.requirement\n ?? options.payload\n ?? \"\"\n );\n }\n\n /**\n * Retain a low-level queue task only until settlement so `Wait()` can take a\n * synchronous snapshot without making completed values long-lived.\n *\n * @param {object} task Queue task returned by `CjsResManWorkQueue.Add()`.\n * @returns {object} The supplied task.\n */\n #TrackQueueTask(task)\n {\n this.#queueOperations.set(task, task.promise);\n task.promise.then(() =>\n {\n if (this.#queueOperations.get(task) === task.promise)\n {\n this.#queueOperations.delete(task);\n }\n }, () =>\n {\n if (this.#queueOperations.get(task) === task.promise)\n {\n this.#queueOperations.delete(task);\n }\n });\n return task;\n }\n\n /**\n * Open one active resource-mutation record. Queued records additionally own\n * a settlement promise visible to contemporaneous `Wait()` snapshots;\n * direct records block unsafe MotherLode replacement but remain outside that\n * two-queue fence.\n *\n * @param {boolean} queued Whether the operation belongs to the queued fence.\n * @returns {() => void} Idempotent record completion callback.\n */\n #BeginResourceOperation(queued)\n {\n this.#activeResourceOperations += 1;\n const id = queued ? this.#nextResourceOperationId++ : 0;\n let resolveDone = noop;\n const done = queued\n ? new Promise(resolve => { resolveDone = resolve; })\n : null;\n if (queued) this.#resourceOperations.set(id, done);\n let finished = false;\n return () =>\n {\n if (finished) return;\n finished = true;\n this.#activeResourceOperations = Math.max(0, this.#activeResourceOperations - 1);\n if (queued && this.#resourceOperations.get(id) === done)\n {\n this.#resourceOperations.delete(id);\n }\n resolveDone();\n };\n }\n\n /**\n * Return the known canonical authority for a resource and reject a known\n * stale generation. A never-bound resource returns `null` so historical\n * detached prepare/publication helpers remain compatible.\n *\n * @param {object|Function} resource Candidate resource handle.\n * @param {string} phase Operation phase used for stale diagnostics.\n * @returns {CjsResourceOwnership|null} Current authority or `null` when never bound.\n * @throws {Error} If a previously bound resource is no longer canonical.\n */\n #GetResourceOwnership(resource, phase)\n {\n const ownership = this.#resourceOwnership.get(resource) || null;\n if (!ownership) return null;\n this.#AssertResourceOwnership(ownership, phase);\n return ownership;\n }\n\n /**\n * Require a current manager-owned canonical resource authority.\n *\n * @param {object|Function} resource Candidate resource handle.\n * @param {string} phase Operation phase used for diagnostics.\n * @returns {CjsResourceOwnership} Current canonical authority.\n * @throws {Error} If the resource is unknown or no longer canonical.\n */\n #RequireResourceOwnership(resource, phase)\n {\n const ownership = this.#GetResourceOwnership(resource, phase);\n if (ownership) return ownership;\n throw resourceNotOwnedError(resource, phase);\n }\n\n /**\n * Test whether an asynchronous operation still owns publication authority.\n * Registry lookup failures are treated as stale ownership so they cannot\n * replace an operation's more useful underlying source/stage rejection.\n *\n * @param {CjsResourceOwnership} ownership Captured authority.\n * @returns {boolean} Whether the exact generation remains canonical.\n */\n #IsResourceOwnershipCurrent(ownership)\n {\n try\n {\n return Boolean(ownership\n && this.motherLode === ownership.owner\n && this.#resourceOwnership.get(ownership.resource) === ownership\n && !this.#invalidResourceOwnership.has(ownership.resource)\n && ownership.owner.Lookup(ownership.key) === ownership.resource\n && !ownership.resource.IsPurged?.());\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Assert exact canonical publication authority for one operation phase.\n *\n * @param {CjsResourceOwnership} ownership Captured authority.\n * @param {string} phase Human-readable operation phase.\n * @returns {void}\n * @throws {Error} Stable stale-operation error when ownership changed.\n */\n #AssertResourceOwnership(ownership, phase)\n {\n if (!this.#IsResourceOwnershipCurrent(ownership))\n {\n throw staleResourceOperationError(ownership, phase);\n }\n }\n\n /**\n * Assert a captured authority when a compatibility path supplied one.\n *\n * @param {CjsResourceMutationAuthority|null} ownership Optional canonical or reload-candidate authority.\n * @param {string} phase Human-readable operation phase.\n * @returns {void}\n */\n #AssertOptionalResourceOwnership(ownership, phase)\n {\n if (!ownership) return;\n if (ownership.reloadCandidate === true)\n {\n this.#AssertReloadCandidate(ownership, phase);\n return;\n }\n this.#AssertResourceOwnership(ownership, phase);\n }\n\n /**\n * Test the exact former owner plus newest-request token for an off-registry\n * candidate. Lookup failures are treated as stale so detached work cannot\n * resurrect a deleted, cleared, replaced, or superseded identity.\n *\n * @param {CjsResourceReloadCandidate} candidate Candidate authority.\n * @returns {boolean} Whether this candidate alone may still commit.\n */\n #IsReloadCandidateCurrent(candidate)\n {\n try\n {\n return Boolean(candidate\n && candidate.reloadCandidate === true\n && this.motherLode === candidate.owner\n && this.#reloadCandidates.get(candidate.resource) === candidate\n && this.#reloadGenerations.get(candidate.key) === candidate.generation\n && this.#resourceOwnership.get(candidate.expected) === candidate.expectedOwnership\n && this.#IsResourceOwnershipCurrent(candidate.expectedOwnership)\n && candidate.owner.Lookup(candidate.key) === candidate.expected);\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Assert that a staged candidate still owns newest-request publication\n * authority for one operation phase.\n *\n * @param {CjsResourceReloadCandidate} candidate Candidate authority.\n * @param {string} phase Human-readable operation phase.\n * @returns {void}\n * @throws {Error} Stable stale-candidate error when authority changed.\n */\n #AssertReloadCandidate(candidate, phase)\n {\n if (!this.#IsReloadCandidateCurrent(candidate))\n {\n throw staleReloadCandidateError(candidate, phase);\n }\n }\n\n /**\n * Invalidate the currently recorded generation for a removed resource.\n *\n * @param {object|Function} resource Removed or displaced resource.\n * @returns {void}\n */\n #InvalidateResourceOwnership(resource)\n {\n if (resource && (typeof resource === \"object\" || typeof resource === \"function\"))\n {\n this.#invalidResourceOwnership.add(resource);\n }\n }\n\n /**\n * Invalidate every generation currently owned by one registry. This runs\n * before Clear cancellation/cleanup so reentrant observers cannot retain\n * authority after canonical ownership removal begins.\n *\n * @param {CjsMotherLode|null|undefined} owner Registry losing ownership.\n * @returns {void}\n */\n #InvalidateMotherLodeOwnership(owner)\n {\n if (typeof owner?.Entries !== \"function\") return;\n for (const [ , resource ] of owner.Entries())\n {\n const ownership = this.#resourceOwnership.get(resource);\n if (ownership?.owner === owner) this.#invalidResourceOwnership.add(resource);\n }\n }\n\n /**\n * Add one operation-owned purge lock and release it only while the exact\n * captured canonical record still exists. If removal/replacement made the\n * operation stale, its former MotherLode record (and lock count) no longer\n * exists, so releasing through a rebound resource would corrupt a new owner.\n *\n * @param {CjsResourceOwnership} ownership Captured canonical authority.\n * @returns {() => void} Idempotent balanced release callback.\n */\n #AcquireResourcePurgeLock(ownership)\n {\n const { owner, key } = ownership;\n if (typeof owner?.Lock !== \"function\" || typeof owner?.Unlock !== \"function\")\n {\n return noop;\n }\n\n this.#AssertResourceOwnership(ownership, \"lock:acquire\");\n owner.Lock(key);\n let released = false;\n return () =>\n {\n if (released) return;\n released = true;\n if (this.#IsResourceOwnershipCurrent(ownership)) owner.Unlock(key);\n };\n }\n\n /**\n * Bind resource-facing liveness methods to one canonical MotherLode key.\n * The controller contains no loader/reload callback, so touching a detached\n * or purged handle cannot start browser/network work.\n *\n * @param {string} key Canonical MotherLode identity.\n * @param {object|Function} resource Canonical resource handle.\n * @returns {object|Function} The supplied resource.\n */\n /**\n * Reload a purged handle back into itself.\n *\n * Purge deletes the payload and drops the registry entry, so a consumer left\n * holding the handle has no way to reach a replacement - it cannot discover\n * one, and nothing hands it over. Recovery therefore has to fill THIS handle\n * rather than resolve whatever the manager currently caches for the path.\n *\n * The handle is re-registered BEFORE loading, so the ordinary load path finds\n * it as the canonical identity and loads into it instead of minting another.\n *\n * Declines rather than guesses in two cases: when another resource has since\n * claimed the identity - displacing it would kill whoever holds that one, the\n * very failure being fixed here - and when the retained request no longer\n * resolves to the same identity, which would re-register the handle under the\n * wrong key.\n *\n * @param {string} key Canonical resolved identity key.\n * @param {CjsResource} resource The purged handle to restore.\n * @returns {boolean} Whether a reload was started.\n */\n #ReloadPurgedResource(key, resource)\n {\n if (!resource?.IsPurged?.()) return false;\n\n try\n {\n const current = this.motherLode.Lookup(key);\n if (current && current !== resource) return false;\n\n const request = resource.GetObjectRequest?.() || {};\n const path = normalizeResourcePath(resource.GetPath());\n if (getMotherLodeKey(path, this.GetResourceVariant(request)) !== key) return false;\n\n // Leave PURGED first: ownership is not considered current while purged,\n // so binding before this would produce a controller that no-ops.\n resource.MarkRequested();\n if (!current) this.motherLode.Insert(key, resource, { replace: true });\n this.#invalidResourceOwnership.delete(resource);\n this.#BindResourceLifecycle(key, resource);\n\n // Failure is recorded on the resource and observed through `completed`.\n this.GetObject(path, request).catch(() => {});\n return true;\n }\n catch\n {\n return false;\n }\n }\n\n /**\n * Give one resource the liveness callbacks its consumers never manage\n * themselves: activity renewal, payload renewal, lock counting, and the\n * reload hook that revives the handle after a purge.\n *\n * Ownership is captured by generation, so a late release can never renew or\n * unlock a rebound owner. The reload hook is bound outside the lifecycle\n * controller because that controller is detached exactly when canonical\n * ownership ends, which is precisely when a purged handle needs to come back.\n *\n * @param {string} key Canonical resolved key.\n * @param {object} resource Resource handle to bind.\n * @returns {object} The same resource handle.\n */\n #BindResourceLifecycle(key, resource)\n {\n const owner = this.motherLode;\n let ownership = this.#resourceOwnership.get(resource) || null;\n if (!ownership\n || ownership.owner !== owner\n || ownership.key !== key\n || ownership.resource !== resource\n || !this.#IsResourceOwnershipCurrent(ownership))\n {\n ownership = Object.freeze({\n generation: this.#nextResourceOwnershipGeneration++,\n owner,\n key,\n resource\n });\n this.#resourceOwnership.set(resource, ownership);\n this.#invalidResourceOwnership.delete(resource);\n }\n\n // Bound outside the lifecycle controller, which is detached when canonical\n // ownership ends - which is precisely when a handle needs to come back.\n resource?.SetReloadHook?.(() => this.#ReloadPurgedResource(key, resource));\n\n if (typeof resource?.SetLifecycleController !== \"function\") return resource;\n resource.SetLifecycleController(Object.freeze({\n isCurrent: () => this.#IsResourceOwnershipCurrent(ownership),\n keepAlive: options => this.#IsResourceOwnershipCurrent(ownership)\n ? owner.KeepAlive?.(key, options)\n : null,\n keepPayloadAlive: options =>\n {\n if (!this.#IsResourceOwnershipCurrent(ownership)) return null;\n if (typeof owner.KeepPayloadAlive === \"function\")\n {\n return owner.KeepPayloadAlive(key, options);\n }\n return owner.KeepAlive?.(key, options);\n },\n lock: () => this.#IsResourceOwnershipCurrent(ownership)\n ? owner.Lock?.(key) || 0\n : 0,\n unlock: () => this.#IsResourceOwnershipCurrent(ownership)\n ? owner.Unlock?.(key) || 0\n : 0\n }));\n if (resource.HasPayload?.() && this.#IsResourceOwnershipCurrent(ownership))\n {\n owner.KeepPayloadAlive?.(key);\n }\n return resource;\n }\n\n /**\n * Bind lifecycle callbacks for resources supplied by a configured custom\n * MotherLode before CjsResMan begins serving them.\n *\n * @returns {CjsResMan} This resource manager.\n */\n #BindMotherLodeResources()\n {\n if (typeof this.motherLode?.Entries !== \"function\") return this;\n for (const [ key, resource ] of this.motherLode.Entries())\n {\n this.#BindResourceLifecycle(key, resource);\n }\n return this;\n }\n\n /**\n * Run or join one format read under source/path/revision, frozen descriptor,\n * and effective output-option identity. Descriptor identity prevents a\n * re-registration with different defaults from reusing an old parse, while\n * source identity prevents same-path reads from different sources colliding.\n *\n * `cacheFormat` uses the same tri-state policy as source caching: omitted is\n * in-flight by default, `true` retains success, and `false` bypasses sharing\n * and retention. `reload: true` never joins a prior parse. Failures are never\n * retained, and a joining `true` request upgrades a shared record. Requests\n * with option instances that cannot be represented safely bypass format\n * sharing regardless of cache policy.\n *\n * @param {CjsResource} resource Resource whose normalized path identifies the source data.\n * @param {object} descriptor Frozen registered format descriptor.\n * @param {*} bytes Source bytes or source-compatible reader input.\n * @param {object} [options={}] Source provenance, reload, cacheFormat, emit, classes, and format options.\n * @returns {Promise<*>} Promise for the parsed or converted format result.\n * @throws {TypeError|Error} If resource, source, revision, descriptor, cache policy, or format execution is invalid.\n */\n ReadFormatOnce(resource, descriptor, bytes, options = {})\n {\n const read = this.#BeginReadOperation(resource.GetPath(), options);\n const cachePolicy = normalizeCachePolicy(read.options.cacheFormat, \"cacheFormat\");\n const key = getFormatOperationKey(read.context, read.options);\n const cacheableOptions = key !== null && cachePolicy !== false;\n const descriptorOperations = cacheableOptions\n ? getFormatDescriptorOperations(\n this.formatOperations,\n read.context.source,\n descriptor,\n true\n )\n : null;\n const bypassExisting = read.options.reload === true\n || !cacheableOptions;\n const existing = bypassExisting ? null : descriptorOperations.get(key);\n if (existing)\n {\n if (cachePolicy === true) existing.retain = true;\n return existing.promise;\n }\n\n /** @type {CjsResourceReadOperationRecord} */\n const record = {\n promise: Promise.resolve().then(() => this.ReadFormat(descriptor, bytes, read.options)),\n path: read.context.path,\n revisionKey: read.context.revisionKey,\n retain: cachePolicy === true\n };\n if (cacheableOptions) descriptorOperations.set(key, record);\n record.promise.then(() =>\n {\n if (cacheableOptions\n && !record.retain\n && descriptorOperations.get(key) === record)\n {\n descriptorOperations.delete(key);\n }\n }, () =>\n {\n if (cacheableOptions\n && descriptorOperations.get(key) === record)\n {\n descriptorOperations.delete(key);\n }\n });\n return record.promise;\n }\n}\n\n/**\n * Copy supported registered format defaults into a deeply frozen snapshot.\n * Plain objects and arrays may be cyclic. Functions and primitives are stable\n * leaves; values with hidden mutable state are rejected because freezing their\n * wrapper would not make the represented behavior immutable.\n *\n * @param {object} defaults Registered format defaults.\n * @param {WeakMap<object, object>} [seen=new WeakMap()] Source-to-snapshot cycle map.\n * @returns {Readonly<object>} Deeply frozen plain defaults snapshot.\n * @throws {TypeError} If defaults contain unsupported objects, accessors, symbols, or byte buffers.\n */\nfunction snapshotFormatDefaults(defaults, seen = new WeakMap())\n{\n if (!defaults || typeof defaults !== \"object\" || Array.isArray(defaults))\n {\n throw new TypeError(\"CjsResMan format defaults must be a plain object.\");\n }\n return snapshotFormatDefaultValue(defaults, seen, \"defaults\");\n}\n\n/**\n * Snapshot one value in a registered format-default tree.\n *\n * @param {*} value Source value.\n * @param {WeakMap<object, object>} seen Source-to-snapshot cycle map.\n * @param {string} path Diagnostic property path.\n * @returns {*} Frozen snapshot value or stable primitive/function leaf.\n * @throws {TypeError} If the value cannot be made structurally immutable.\n */\nfunction snapshotFormatDefaultValue(value, seen, path)\n{\n if (value === null || value === undefined) return value;\n const type = typeof value;\n if ([ \"string\", \"number\", \"boolean\", \"bigint\" ].includes(type)) return value;\n if (type === \"function\") return value;\n if (type !== \"object\" || ArrayBuffer.isView(value) || value instanceof ArrayBuffer)\n {\n throw new TypeError(`CjsResMan format ${path} cannot be snapshotted immutably.`);\n }\n\n const prior = seen.get(value);\n if (prior) return prior;\n if (Array.isArray(value))\n {\n const snapshot = [];\n seen.set(value, snapshot);\n for (let index = 0; index < value.length; index += 1)\n {\n if (!hasOwn(value, index))\n {\n throw new TypeError(`CjsResMan format ${path} must not contain sparse arrays.`);\n }\n snapshot.push(snapshotFormatDefaultValue(value[index], seen, `${path}[${index}]`));\n }\n return Object.freeze(snapshot);\n }\n\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null)\n {\n throw new TypeError(`CjsResMan format ${path} must contain only plain objects and arrays.`);\n }\n if (Object.getOwnPropertySymbols(value).length > 0)\n {\n throw new TypeError(`CjsResMan format ${path} must not contain symbol keys.`);\n }\n\n const snapshot = prototype === null ? Object.create(null) : {};\n seen.set(value, snapshot);\n for (const key of Object.getOwnPropertyNames(value))\n {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (!descriptor.enumerable || !(\"value\" in descriptor))\n {\n throw new TypeError(`CjsResMan format ${path}.${key} must be an enumerable data property.`);\n }\n snapshot[key] = snapshotFormatDefaultValue(descriptor.value, seen, `${path}.${key}`);\n }\n return Object.freeze(snapshot);\n}\n\n/**\n * Normalize an opaque caller/source revision without interpreting content.\n * String and number tokens remain type-distinct; finite numeric `-0` and `0`\n * intentionally identify the same revision.\n *\n * @param {string|number|undefined} value Caller-provided source content token.\n * @returns {string} Type-stable internal revision key.\n * @throws {TypeError} If the token is neither a string nor finite number.\n */\nfunction normalizeSourceRevision(value)\n{\n if (value === undefined) return \"undefined\";\n if (typeof value === \"string\") return `string:${value}`;\n if (typeof value === \"number\" && Number.isFinite(value))\n {\n return `number:${Object.is(value, -0) ? 0 : value}`;\n }\n throw new TypeError(\"CjsResMan sourceRevision must be a string or finite number.\");\n}\n\n/**\n * Validate tri-state source/format cache policy.\n *\n * @param {boolean|undefined} value Cache policy value.\n * @param {string} name Option name used in failures.\n * @returns {boolean|undefined} The validated policy.\n * @throws {TypeError} If the value is not boolean or omitted.\n */\nfunction normalizeCachePolicy(value, name)\n{\n if (value !== undefined && typeof value !== \"boolean\")\n {\n throw new TypeError(`CjsResMan ${name} must be a boolean when supplied.`);\n }\n return value;\n}\n\n/**\n * Get the operation map owned by one source object.\n *\n * @param {WeakMap<object|Function, Map<string, CjsResourceReadOperationRecord>>} ledger Source-keyed ledger.\n * @param {object|Function} owner Source owner.\n * @param {boolean} create Whether a missing map should be allocated.\n * @returns {Map<string, CjsResourceReadOperationRecord>|null} Owner map or `null`.\n */\nfunction getOwnerOperations(ledger, owner, create)\n{\n let operations = ledger.get(owner);\n if (!operations && create)\n {\n operations = new Map();\n ledger.set(owner, operations);\n }\n return operations || null;\n}\n\n/**\n * Get the source/path/revision operation key for one normalized read context.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @returns {string} Internal read-operation key.\n */\nfunction getReadOperationKey(context)\n{\n return `${context.path}\\u0000${context.revisionKey}`;\n}\n\n/**\n * Get the descriptor-specific format operation map for a selected source.\n * Frozen descriptor identity isolates changed registration defaults.\n *\n * @param {WeakMap<object|Function, Map<object, Map<string, CjsResourceReadOperationRecord>>>} ledger Format ledger.\n * @param {object|Function} source Selected source owner.\n * @param {object} descriptor Frozen registered descriptor.\n * @param {boolean} create Whether missing maps should be allocated.\n * @returns {Map<string, CjsResourceReadOperationRecord>|null} Descriptor map or `null`.\n */\nfunction getFormatDescriptorOperations(ledger, source, descriptor, create)\n{\n let descriptors = ledger.get(source);\n if (!descriptors && create)\n {\n descriptors = new Map();\n ledger.set(source, descriptors);\n }\n if (!descriptors) return null;\n\n let operations = descriptors.get(descriptor);\n if (!operations && create)\n {\n operations = new Map();\n descriptors.set(descriptor, operations);\n }\n return operations || null;\n}\n\n/**\n * Build a descriptor-local format cache key from source provenance and the\n * output options that materially affect the format reader result.\n * Requests containing non-canonical mutable option objects bypass format-cache\n * sharing instead of risking a false key match.\n *\n * @param {Readonly<CjsResourceReadContext>} context Normalized provenance.\n * @param {object} options Format request options.\n * @returns {string|null} Internal format-operation key, or `null` to bypass caching.\n */\nfunction getFormatOperationKey(context, options)\n{\n const material = [\n options.emit,\n options.mediaType,\n options.classes,\n options.formatOptions\n ];\n if (!material.every(value => isCanonicalFormatCacheValue(value))) return null;\n return `${getReadOperationKey(context)}\\u0000${material\n .map(value => serializeFormatCacheValue(value))\n .join(\"\\u0001\")}`;\n}\n\n/**\n * Return true when a format cache option can be represented without guessing\n * hidden mutable state. Plain objects/arrays, functions by identity, and\n * byte-addressable buffers/views are supported. Other class instances bypass\n * format-cache sharing.\n *\n * @param {*} value Candidate material format option.\n * @param {WeakSet<object|Function>} [seen=new WeakSet()] Cycle guard.\n * @returns {boolean} Whether deterministic cache serialization is supported.\n */\nfunction isCanonicalFormatCacheValue(value, seen = new WeakSet())\n{\n if (value === null || value === undefined) return true;\n if ([ \"string\", \"number\", \"boolean\", \"bigint\" ].includes(typeof value)) return true;\n if (typeof value === \"function\") return true;\n if (typeof value !== \"object\") return false;\n if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return true;\n if (seen.has(value)) return true;\n seen.add(value);\n if (Array.isArray(value))\n {\n return value.every(entry => isCanonicalFormatCacheValue(entry, seen));\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) return false;\n if (Object.getOwnPropertySymbols(value).length > 0) return false;\n return Object.getOwnPropertyNames(value).every(key =>\n {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n return descriptor.enumerable\n && \"value\" in descriptor\n && isCanonicalFormatCacheValue(descriptor.value, seen);\n });\n}\n\n/**\n * Serialize one supported material format option with process-local identity\n * for objects and functions. Identity prevents same-named constructors and\n * separate option graphs from colliding; visible plain-object/array/buffer\n * contents ensure mutation changes the next operation key.\n *\n * @param {*} value Canonically supported format option.\n * @param {WeakSet<object|Function>} [seen=new WeakSet()] Cycle guard.\n * @returns {string} Deterministic cache-local representation.\n */\nfunction serializeFormatCacheValue(value, seen = new WeakSet())\n{\n if (value === undefined) return \"undefined\";\n if (value === null) return \"null\";\n if (typeof value === \"string\") return `string:${JSON.stringify(value)}`;\n if (typeof value === \"number\")\n {\n if (Number.isNaN(value)) return \"number:NaN\";\n if (Object.is(value, -0)) return \"number:-0\";\n return `number:${String(value)}`;\n }\n if (typeof value === \"boolean\") return `boolean:${value}`;\n if (typeof value === \"bigint\") return `bigint:${value}`;\n if (typeof value === \"function\") return `function:${getLocalValueIdentity(value)}`;\n\n const identity = getLocalValueIdentity(value);\n if (seen.has(value)) return `reference:${identity}`;\n seen.add(value);\n if (ArrayBuffer.isView(value))\n {\n const bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);\n return `view:${identity}:${value.constructor.name}:${[ ...bytes ].join(\",\")}`;\n }\n if (value instanceof ArrayBuffer)\n {\n return `buffer:${identity}:${[ ...new Uint8Array(value) ].join(\",\")}`;\n }\n if (Array.isArray(value))\n {\n return `array:${identity}:[${value\n .map(entry => serializeFormatCacheValue(entry, seen))\n .join(\",\")}]`;\n }\n return `object:${identity}:{${Object.keys(value)\n .sort()\n .map(key => `${JSON.stringify(key)}:${serializeFormatCacheValue(value[key], seen)}`)\n .join(\",\")}}`;\n}\n\n/**\n * Return a process-local identity for a parsed-format cache object or function.\n *\n * @param {object|Function} value Candidate option identity owner.\n * @returns {number} Stable identity for the life of the value.\n */\nfunction getLocalValueIdentity(value)\n{\n let identity = LOCAL_VALUE_IDENTITIES.get(value);\n if (!identity)\n {\n identity = nextLocalValueIdentity++;\n LOCAL_VALUE_IDENTITIES.set(value, identity);\n }\n return identity;\n}\n\n/**\n * Remove operation records matching a normalized path and optional revision.\n * Detached promises continue for their existing consumers.\n *\n * @param {Map<string, CjsResourceReadOperationRecord>|null} operations Candidate operation map.\n * @param {string} path Normalized source path.\n * @param {string|null} revisionKey Exact revision or `null` for all revisions.\n * @returns {number} Number of detached records.\n */\nfunction removeOperationRecords(operations, path, revisionKey)\n{\n if (!operations) return 0;\n let removed = 0;\n for (const [ key, record ] of operations)\n {\n if (record.path !== path) continue;\n if (revisionKey !== null && record.revisionKey !== revisionKey) continue;\n if (operations.delete(key)) removed += 1;\n }\n return removed;\n}\n\n/**\n * Copy the compact requested-output fields needed for explicit payload\n * reconstruction. This request is retained with the handle but never enters\n * MotherLode identity beyond its `variant`/`emit` output tag.\n *\n * @param {object} [options={}] Original resource request.\n * @returns {object} Shallow reconstruction request without cache/reload policy.\n */\nfunction getResourceRequestOptions(options = {})\n{\n const request = {};\n for (const key of RESOURCE_REQUEST_OPTION_KEYS)\n {\n if (options[key] !== undefined) request[key] = options[key];\n }\n return request;\n}\n\n/**\n * Capture the compact output request plus effective source provenance needed\n * to reconstruct a released resource payload. Cache policy and one-shot reload\n * are intentionally not retained. Retaining the effective source prevents an\n * old revision token from being applied to a later manager default source.\n *\n * @param {object} [options={}] Requested output and source provenance options.\n * @param {object|Function|null} [effectiveSource=null] Source selected when the resource was created.\n * @returns {object} Detached loader options safe to retain with the resource.\n */\nfunction getResourceLoaderOptions(options = {}, effectiveSource = null)\n{\n const loaderOptions = getResourceRequestOptions(options);\n if (effectiveSource) loaderOptions.source = effectiveSource;\n for (const key of [ \"sourceRevision\", \"ext\" ])\n {\n if (hasOwn(options, key))\n {\n loaderOptions[key] = options[key];\n }\n }\n return loaderOptions;\n}\n\n/**\n * Merge per-operation controls with a resource's compact reconstruction\n * request. Once the handle has a promised-output field, all output selectors\n * remain pinned to the retained request so `Ready()` cannot publish a\n * different result under the existing MotherLode identity. Retained source\n * provenance is pinned as well; cache/reload controls remain explicit per-call\n * overrides.\n *\n * @param {object} base Retained reconstruction request.\n * @param {object} [overrides={}] Per-call operation controls.\n * @returns {object} Merged request with stable promised-output fields.\n */\nfunction mergeResourceLoaderOptions(base, overrides = {})\n{\n const result = { ...base, ...overrides };\n const pinsOutput = RESOURCE_OUTPUT_OPTION_KEYS.some(key =>\n hasOwn(base, key)\n && base[key] !== undefined\n );\n if (pinsOutput)\n {\n for (const key of RESOURCE_OUTPUT_OPTION_KEYS)\n {\n if (hasOwn(base, key) && base[key] !== undefined)\n {\n result[key] = base[key];\n }\n else\n {\n delete result[key];\n }\n }\n }\n for (const key of RESOURCE_PROVENANCE_OPTION_KEYS)\n {\n if (hasOwn(base, key)) result[key] = base[key];\n }\n return result;\n}\n\n/**\n * Filter current format descriptors using request material available before\n * source bytes are read. Byte-dependent support probes are deferred.\n *\n * @param {readonly object[]} descriptors Registered descriptors for one extension.\n * @param {object} options Format, output, and media selection.\n * @returns {object[]} Matching descriptors in registration order.\n */\nfunction filterFormatDescriptors(descriptors, options)\n{\n let candidates = [ ...descriptors ];\n if (options.format)\n {\n candidates = candidates.filter(({ Format }) => Format === options.format\n || Format.id === options.format\n || Format.name === options.format);\n }\n if (options.emit !== undefined)\n {\n candidates = candidates.filter(({ Format }) =>\n findDeclaredOutput(getFormatOutputs(Format), options.emit) !== null);\n }\n if (options.mediaType)\n {\n candidates = candidates.filter(({ Format }) =>\n (Format.mediaTypes || []).includes(options.mediaType));\n }\n return candidates;\n}\n\n/**\n * Return one format facade's normal and diagnostic output declarations.\n *\n * @param {Function} Format Registered format facade.\n * @returns {Array<*>} Declared output values in selection order.\n */\nfunction getFormatOutputs(Format)\n{\n return [\n ...(Format.outputTypes || []),\n ...(Format.debugOutputTypes || [])\n ];\n}\n\n/**\n * Resolve a case-insensitive output selector to its canonical declared\n * spelling. MotherLode tags stay lowercase while readers receive declarations\n * such as `cmfJson` or `gr2Json` exactly as authored.\n *\n * @param {readonly *[]} outputs Declared output values.\n * @param {*} requested Requested output selector.\n * @returns {string|null} Canonical declaration, or `null` when unsupported.\n */\nfunction findDeclaredOutput(outputs, requested)\n{\n const normalized = normalizeResourceVariant(requested);\n for (const output of outputs)\n {\n if (typeof output !== \"string\") continue;\n if (normalizeResourceVariant(output) === normalized) return output;\n }\n return null;\n}\n\n/**\n * Create the stable failure used when a registered input format cannot emit a\n * requested output tag.\n *\n * @param {string} ext Normalized source extension.\n * @param {*} emit Requested output tag.\n * @param {readonly object[]} descriptors Registered input-format descriptors.\n * @returns {Error} Contextual unsupported-output error.\n */\nfunction createFormatOutputMissingError(ext, emit, descriptors)\n{\n const error = new Error(`No format registered for .${ext} emits ${JSON.stringify(emit)}.`);\n error.code = \"CJS_RESOURCE_FORMAT_OUTPUT_MISSING\";\n error.ext = ext;\n error.emit = emit;\n error.formats = descriptors.map(({ Format }) => Format.name);\n return error;\n}\n\n/**\n * Create the stable failure used when a direct object loader cannot satisfy a\n * forced output request.\n *\n * @param {string} ext Normalized source extension.\n * @param {*} emit Requested output tag.\n * @returns {Error} Contextual unsupported-output error.\n */\nfunction createObjectLoaderOutputMissingError(ext, emit)\n{\n const error = new Error(\n `Direct loader for .${ext} exposes only its unforced default; it does not emit ${JSON.stringify(emit)}.`\n );\n error.code = \"CJS_RESOURCE_FORMAT_OUTPUT_MISSING\";\n error.ext = ext;\n error.emit = emit;\n error.formats = [];\n return error;\n}\n\n/**\n * Resolve one descriptor from the current candidate set. When bytes are\n * present, support probes may disambiguate candidates.\n *\n * @param {readonly object[]} descriptors Candidate descriptors from current registration.\n * @param {string} ext Normalized resource extension.\n * @param {object} options Effective format options and optional source bytes.\n * @returns {object} Selected descriptor.\n * @throws {Error} If the candidate set is missing or remains ambiguous.\n */\nfunction resolveFormatDescriptorCandidates(descriptors, ext, options)\n{\n let candidates = [ ...descriptors ];\n if (candidates.length > 1 && options.bytes !== undefined)\n {\n const supported = candidates.filter(descriptor =>\n {\n const { Format, defaults } = descriptor;\n const isSupported = Format.isSupported;\n if (typeof isSupported !== \"function\") return false;\n const report = isSupported.call(Format, options.bytes, {\n ...defaults,\n ...(options.formatOptions || {})\n });\n return report && report.supported !== false;\n });\n if (supported.length === 1) candidates = supported;\n }\n\n if (candidates.length === 0)\n {\n const error = new Error(`No format registered for .${ext}`);\n error.code = \"CJS_RESOURCE_FORMAT_MISSING\";\n error.ext = ext;\n throw error;\n }\n if (candidates.length > 1)\n {\n const error = new Error(`Ambiguous formats registered for .${ext}`);\n error.code = \"CJS_RESOURCE_FORMAT_AMBIGUOUS\";\n error.ext = ext;\n error.formats = candidates.map(({ Format }) => Format.name);\n throw error;\n }\n return candidates[0];\n}\n\nfunction normalizeRequirement(value)\n{\n return value === null || value === undefined\n ? \"\"\n : String(value).trim().toLowerCase();\n}\n\n/**\n * Normalize one human-readable promised output tag.\n *\n * @param {*} value Candidate `variant`, `emit`, requirement, or payload tag.\n * @returns {string} Trimmed lowercase tag, or an empty string.\n * @throws {TypeError} If a non-empty tag is not a string or contains the internal key delimiter.\n */\nfunction normalizeResourceVariant(value)\n{\n if (value === null || value === undefined || value === \"\") return \"\";\n if (typeof value !== \"string\")\n {\n throw new TypeError(\"CjsResMan resource variant must be a string.\");\n }\n const normalized = value.trim().toLowerCase();\n if (normalized.includes(\"\\u0000\"))\n {\n throw new TypeError(\"CjsResMan resource variant may not contain a null character.\");\n }\n return normalized;\n}\n\nfunction createPrepareContext(resMan, resource, bytes, options, stage)\n{\n return Object.freeze({\n ...options,\n stage,\n bytes,\n path: resource.GetPath(),\n ext: resource.GetExt(),\n resource,\n resMan\n });\n}\n\n/**\n * Recover the public object result represented by a resident resource payload.\n * The publication contract returns semantic subclasses as their resource\n * handle and base resources as their plain payload.\n *\n * @param {CjsResource} resource Resource with an attached CPU payload.\n * @returns {*} Resident public object outcome.\n */\nfunction getPublishedResourceObject(resource)\n{\n return resource.constructor !== CjsResource\n ? resource\n : resource.GetPayload();\n}\n\nfunction assertPositiveInteger(value, name)\n{\n if (!Number.isInteger(value) || value < 1) {\n throw new TypeError(`CjsResMan ${name} must be a positive integer.`);\n }\n}\n\nfunction assertNonNegativeInteger(value, name)\n{\n if (!Number.isInteger(value) || value < 0) {\n throw new TypeError(`CjsResMan ${name} must be a non-negative integer.`);\n }\n}\n\nfunction assertNonNegativeNumber(value, name)\n{\n if (typeof value !== \"number\" || !Number.isFinite(value) || value < 0) {\n throw new TypeError(`CjsResMan ${name} must be a non-negative finite number.`);\n }\n}\n\n/**\n * Normalize and freeze an opt-in time-based automatic purge policy.\n *\n * @param {CjsResManAutoPurgePolicy|false|null} policy Caller policy or disable marker.\n * @returns {Readonly<CjsResManAutoPurgePolicy>|null} Frozen normalized policy, or `null` when disabled.\n * @throws {TypeError} If fields, limits, cleanup controls, or the cadence clock are invalid.\n */\nfunction normalizeAutoPurgePolicy(policy)\n{\n if (policy === null || policy === undefined || policy === false) return null;\n if (!policy || typeof policy !== \"object\" || Array.isArray(policy))\n {\n throw new TypeError(\"CjsResMan autoPurgePolicy must be an object, false, or null.\");\n }\n\n const allowed = new Set([\n \"intervalMilliseconds\",\n \"maxIdleMilliseconds\",\n \"payloadMaxIdleMilliseconds\",\n \"destroyAdapters\",\n \"releasePayload\",\n \"cleanup\",\n \"now\"\n ]);\n const unsupported = Object.keys(policy).filter(key => !allowed.has(key));\n if (unsupported.length)\n {\n throw new TypeError(`CjsResMan autoPurgePolicy does not support: ${unsupported.join(\", \")}.`);\n }\n\n const intervalMilliseconds = policy.intervalMilliseconds ?? 1000;\n assertNonNegativeNumber(intervalMilliseconds, \"autoPurgePolicy.intervalMilliseconds\");\n for (const name of [ \"maxIdleMilliseconds\", \"payloadMaxIdleMilliseconds\" ])\n {\n if (policy[name] !== undefined)\n {\n assertNonNegativeNumber(policy[name], `autoPurgePolicy.${name}`);\n }\n }\n if (policy.maxIdleMilliseconds === undefined\n && policy.payloadMaxIdleMilliseconds === undefined)\n {\n throw new TypeError(\"CjsResMan autoPurgePolicy requires an identity or payload inactivity limit.\");\n }\n for (const name of [ \"destroyAdapters\", \"releasePayload\" ])\n {\n if (policy[name] !== undefined && typeof policy[name] !== \"boolean\")\n {\n throw new TypeError(`CjsResMan autoPurgePolicy.${name} must be a boolean.`);\n }\n }\n if (policy.cleanup !== undefined\n && policy.cleanup !== false\n && typeof policy.cleanup !== \"function\")\n {\n throw new TypeError(\"CjsResMan autoPurgePolicy.cleanup must be a function or false.\");\n }\n if (policy.now !== undefined && typeof policy.now !== \"function\")\n {\n throw new TypeError(\"CjsResMan autoPurgePolicy.now must be a function.\");\n }\n\n return Object.freeze({\n intervalMilliseconds,\n maxIdleMilliseconds: policy.maxIdleMilliseconds,\n payloadMaxIdleMilliseconds: policy.payloadMaxIdleMilliseconds,\n destroyAdapters: policy.destroyAdapters ?? true,\n releasePayload: policy.releasePayload ?? true,\n ...(policy.cleanup === undefined ? {} : { cleanup: policy.cleanup }),\n now: policy.now || defaultAutoPurgeNow\n });\n}\n\n/**\n * Validate one automatic-purge pump request without advancing cadence.\n *\n * @param {CjsResManAutoPurgePumpOptions} options Per-call pump options.\n * @returns {CjsResManAutoPurgePumpOptions} Validated options.\n * @throws {TypeError} If options or an explicit timestamp are invalid.\n */\nfunction normalizeAutoPurgePumpOptions(options)\n{\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(\"CjsResMan automatic purge options must be an object.\");\n }\n const unsupported = Object.keys(options).filter(key => key !== \"time\");\n if (unsupported.length)\n {\n throw new TypeError(`CjsResMan automatic purge options do not support: ${unsupported.join(\", \")}.`);\n }\n if (options.time !== undefined)\n {\n assertNonNegativeNumber(options.time, \"automatic purge time\");\n }\n return options;\n}\n\n/**\n * Create the stable failure used when synchronous MotherLode replacement\n * would detach ownership beneath active asynchronous resource mutation.\n *\n * @param {number} activeOperations Number of queued and direct mutations.\n * @returns {Error} Contextual active-operation error.\n */\nfunction activeResourceOperationsError(activeOperations)\n{\n const error = new Error(\n `CjsResMan cannot replace MotherLode while ${activeOperations} resource operation(s) are active.`\n );\n error.code = \"CJS_RESMAN_ACTIVE_RESOURCE_OPERATIONS\";\n error.activeOperations = activeOperations;\n return error;\n}\n\n/**\n * Create the stable failure used when a manager-only load API receives a\n * resource that was never bound to this manager.\n *\n * @param {*} resource Candidate resource.\n * @param {string} phase Operation phase.\n * @returns {Error} Contextual ownership error.\n */\nfunction resourceNotOwnedError(resource, phase)\n{\n const path = getResourceDiagnosticPath(resource);\n const error = new Error(`CjsResMan does not own a canonical resource at ${path}.`);\n error.code = \"CJS_RESMAN_RESOURCE_NOT_OWNED\";\n error.resource = resource;\n error.path = path;\n error.phase = phase;\n return error;\n}\n\n/**\n * Create the stable failure used when otherwise-successful obsolete work\n * reaches a canonical mutation boundary.\n *\n * @param {CjsResourceOwnership} ownership Captured stale authority.\n * @param {string} phase Operation phase that detected staleness.\n * @returns {Error} Contextual stale-operation error.\n */\nfunction staleResourceOperationError(ownership, phase)\n{\n const path = getResourceDiagnosticPath(ownership?.resource);\n const error = new Error(\n `CjsResMan resource operation became stale during ${phase}: ${path}.`\n );\n error.code = \"CJS_RESMAN_STALE_RESOURCE_OPERATION\";\n error.resource = ownership?.resource || null;\n error.path = path;\n error.key = ownership?.key || null;\n error.generation = ownership?.generation || 0;\n error.phase = phase;\n return error;\n}\n\n/**\n * Reject a resource constructor that returns the protected canonical singleton\n * when a distinct reload candidate is required.\n *\n * @param {string} path Requested resource path.\n * @param {object|Function} resource Aliased canonical resource.\n * @returns {Error} Stable candidate-alias error.\n */\nfunction reloadCandidateAliasError(path, resource)\n{\n const error = new Error(`CjsResMan reload candidate aliases the canonical resource: ${path}.`);\n error.code = \"CJS_RESMAN_RELOAD_CANDIDATE_ALIAS\";\n error.path = path;\n error.resource = resource;\n return error;\n}\n\n/**\n * Create the stable failure used when a candidate loader no longer has a\n * staged authority record.\n *\n * @param {object|Function} resource Candidate resource.\n * @returns {Error} Stable unavailable-candidate error.\n */\nfunction reloadCandidateUnavailableError(resource)\n{\n const path = getResourceDiagnosticPath(resource);\n const error = new Error(`CjsResMan reload candidate is no longer available: ${path}.`);\n error.code = \"CJS_RESMAN_RELOAD_CANDIDATE_UNAVAILABLE\";\n error.path = path;\n error.resource = resource;\n return error;\n}\n\n/**\n * Create the stable failure used when a deleted, cleared, replaced, or\n * superseded reload candidate reaches a mutation or commit boundary.\n *\n * @param {CjsResourceReloadCandidate} candidate Captured candidate authority.\n * @param {string} phase Operation phase that detected staleness.\n * @returns {Error} Contextual stale-candidate error.\n */\nfunction staleReloadCandidateError(candidate, phase)\n{\n const path = getResourceDiagnosticPath(candidate?.resource);\n const error = new Error(\n `CjsResMan reload candidate became stale during ${phase}: ${path}.`\n );\n error.code = \"CJS_RESMAN_STALE_RELOAD_CANDIDATE\";\n error.resource = candidate?.resource || null;\n error.expected = candidate?.expected || null;\n error.path = path;\n error.key = candidate?.key || null;\n error.generation = candidate?.generation || 0;\n error.phase = phase;\n return error;\n}\n\n/**\n * Read a resource path for diagnostics without allowing an unusual custom\n * resource getter to hide the primary ownership error.\n *\n * @param {*} resource Candidate resource.\n * @returns {string} Best-effort resource path label.\n */\nfunction getResourceDiagnosticPath(resource)\n{\n try\n {\n return String(resource?.GetPath?.() || resource?.path || \"<unknown>\");\n }\n catch\n {\n return \"<unknown>\";\n }\n}\n\n/**\n * Perform no action for lifecycle-compatible optional operations.\n *\n * @returns {void}\n */\nfunction noop() {}\n\n/**\n * Validate a resource execution strategy.\n *\n * @param {*} loader Candidate loader.\n * @param {string} name Configuration field name.\n * @returns {void}\n */\nfunction assertResourceLoader(loader, name)\n{\n if (!isResourceLoader(loader))\n {\n throw new TypeError(`CjsResMan ${name} must provide Read and ReadFormat.`);\n }\n}\n\n/**\n * Test the structural resource loader contract.\n *\n * @param {*} loader Candidate loader.\n * @returns {boolean}\n */\nfunction isResourceLoader(loader)\n{\n return Boolean(\n loader\n && typeof loader.Read === \"function\"\n && typeof loader.ReadFormat === \"function\"\n );\n}\n\n/**\n * Merge frozen registration defaults with one request's format overrides.\n *\n * @param {object} descriptor Registered format descriptor.\n * @param {object} options Resource read options.\n * @returns {object} Effective format reader options.\n */\nfunction createFormatReadOptions(descriptor, options)\n{\n const { Format, defaults } = descriptor;\n const formatOptions = {\n ...defaults,\n ...(options.formatOptions || {})\n };\n if (options.emit !== undefined)\n {\n formatOptions.emit = findDeclaredOutput(getFormatOutputs(Format), options.emit)\n ?? options.emit;\n }\n if (options.classes !== undefined) formatOptions.classes = options.classes;\n return formatOptions;\n}\n\n/**\n * Reports whether a source requires CjsResMan to build a URL before reading.\n *\n * @param {*} source Selected source/provider.\n * @returns {boolean}\n */\nfunction sourceRequiresUrl(source)\n{\n return source?.requiresUrl === true || source?.constructor?.requiresUrl === true;\n}\n\n/**\n * Tests whether an object owns one property.\n *\n * @param {*} object Candidate object.\n * @param {string|number|symbol} property Property key.\n * @returns {boolean}\n */\nfunction hasOwn(object, property)\n{\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\n/**\n * Normalizes one resource-path scheme key.\n *\n * @param {*} value Candidate scheme.\n * @returns {string}\n */\nfunction normalizePathPrefix(value)\n{\n const prefix = String(value ?? \"\")\n .trim()\n .replace(/:\\/?$/u, \"\")\n .toLowerCase();\n if (!/^[a-z][a-z0-9+.-]*$/u.test(prefix))\n {\n throw new TypeError(\"CjsResMan path prefixes must be URI scheme names.\");\n }\n return prefix;\n}\n\n/**\n * Normalizes one registered URL base without altering case-sensitive path\n * content.\n *\n * @param {*} value Candidate URL base.\n * @returns {string}\n */\nfunction normalizeUrlBase(value)\n{\n const url = normalizePath(value);\n if (!url || url.includes(\"\\0\"))\n {\n throw new TypeError(\"CjsResMan path URL bases must be non-empty strings.\");\n }\n return url.endsWith(\"/\") ? url : `${url}/`;\n}\n\n/**\n * Validates a URL returned by an injected path resolver.\n *\n * @param {*} value Resolver output.\n * @returns {string}\n */\nfunction normalizeResolvedUrl(value)\n{\n const url = normalizePath(value);\n if (!url || url.includes(\"\\0\"))\n {\n throw new TypeError(\"CjsResMan pathResolver must return a non-empty URL string.\");\n }\n return url;\n}\n\n/**\n * Return the wall-clock timestamp used by default automatic purge cadence.\n *\n * @returns {number} Milliseconds since the Unix epoch.\n */\nfunction defaultAutoPurgeNow()\n{\n return Date.now();\n}\n\nfunction defaultQueueScheduler(callback)\n{\n return setTimeout(callback, 0);\n}\n\nfunction defaultQueueYield()\n{\n return new Promise(resolve => setTimeout(resolve, 0));\n}\n\nfunction normalizeRegistrationEntries(value, keyed = false)\n{\n if (value === null || value === undefined) return [];\n if (Array.isArray(value)) return value;\n if (typeof value === \"function\") return [ value ];\n if (typeof value !== \"object\")\n {\n throw new TypeError(\"CjsResMan registration collections must be arrays or objects.\");\n }\n\n if (value.Format || value.format || value.Constructor || value.Resource || value.resourceType)\n {\n return [ value ];\n }\n\n return Object.entries(value).map(([ key, entry ]) =>\n {\n if (!keyed) return typeof entry === \"function\" ? entry : { ...entry, key };\n return typeof entry === \"function\"\n ? { key, requirement: key, Constructor: entry }\n : { ...entry, key, requirement: entry.requirement || entry.payload || key };\n });\n}\n"],"names":["READ_CONTEXTS","WeakMap","RESOURCE_REQUEST_OPTION_KEYS","Object","freeze","RESOURCE_OUTPUT_OPTION_KEYS","RESOURCE_PROVENANCE_OPTION_KEYS","LOCAL_VALUE_IDENTITIES","nextLocalValueIdentity","CjsResMan","CjsEventEmitter","WeakSet","Map","constructor","options","motherLode","CjsMotherLode","source","paths","pathResolver","resourceTypes","objectLoaders","formats","objectOperations","sourceOperations","queuedSourceOperations","formatOperations","mainThreadLoader","CjsResManMainThreadLoader","workerLoader","CjsResManWorkerLoader","fallback","resourceLoader","maxConcurrentLoads","maxPrepareTime","maxPrepareItemsPerTick","autoPumpMainThreadQueue","queueScheduler","defaultQueueScheduler","urgentResourceLoads","_backgroundPumpScheduled","_mainThreadPumpScheduled","_loadQueue","CjsResManWorkQueue","CjsResManQueue","BACKGROUND","concurrency","onReady","ScheduleBackgroundQueue","_prepareQueue","MAIN","ScheduleMainThreadQueue","Register","Array","isArray","TypeError","hasOwnThen","value","nextMotherLode","activeResourceOperationsError","previousMotherLode","Shutdown","Startup","clear","cacheSize","SetCacheSize","cacheCleanup","autoPurgePolicy","SetAutoPurgePolicy","SetSource","SetPaths","SetPathResolver","SetMainThreadLoader","SetWorkerLoader","useWorkerLoading","UseWorkerLoading","assertPositiveInteger","SetConcurrency","assertNonNegativeNumber","assertNonNegativeInteger","Boolean","SetUrgentResourceLoads","entry","normalizeRegistrationEntries","RegisterFormat","Format","format","defaults","RegisterResourceType","requirement","payload","key","Constructor","Resource","resourceType","ext","loader","entries","RegisterObjectLoader","SetPath","prefix","urlBase","normalizePathPrefix","normalizeUrlBase","set","HasPath","has","GetPath","get","resolver","undefined","BuildUrl","path","normalized","normalizeResourcePath","normalizeResolvedUrl","prefixIndex","indexOf","normalizePath","slice","error","Error","code","assertResourceLoader","wasSelected","SetFallback","resolved","isResourceLoader","Reset","IsWorkerLoading","GetPendingWorkers","GetPendingCount","AddToQueue","queue","callback","context","flags","task","QueueTask","promise","catch","EmitEvent","id","CancelFromQueue","reason","GetWorkQueue","Cancel","GetNextIdForQueue","GetNextId","PumpMainThreadQueue","urgent","result","Pump","maxItems","maxTime","now","queued","active","processed","PumpBackgroundQueue","PauseQueue","Pause","ResumeQueue","name","normalizeName","Resume","GetPendingLoads","GetPendingPrepares","GetQueueStats","GetStats","loads","prepares","IsUrgentResourceLoads","IsLoading","Update","loaded","background","prepared","prepare","cacheOptions","cache","cacheResult","TrimCache","trimmed","evicted","purgeOptions","purge","purgeResult","PumpAutoPurge","purged","payloadsReleased","Tick","Wait","pump","yield","snapshot","Set","values","size","fence","Promise","allSettled","yieldQueue","defaultQueueYield","settled","then","race","resolve","metadata","Add","IsPaused","normalizeRequirement","alias","aliases","aliasKey","normalizeResourceExtension","inputTypes","length","descriptor","snapshotFormatDefaults","inputType","candidates","next","filter","candidate","push","GetFormats","GetFormatDescriptors","map","ResolveFormat","ResolveFormatDescriptor","GetResource","variant","GetResourceVariant","getResourceExtension","emit","objectLoader","GetObjectLoader","createObjectLoaderOutputMissingError","descriptors","filterFormatDescriptors","createFormatOutputMissingError","cacheKey","getMotherLodeKey","existing","Lookup","reload","KeepAlive","InvalidateReadCache","ResolveResourceConstructor","resource","CreateResource","expectedOwnership","generation","loaderOptions","getResourceLoaderOptions","reloadCandidate","owner","expected","SetObjectLoader","reloadOptions","loadOptions","mergeResourceLoaderOptions","insertion","Insert","replace","canonical","displaced","GetObject","operationOptions","GetObjectRequest","ownership","HasPayload","KeepPayloadAlive","getPublishedResourceObject","QueueResourceObject","operation","delete","LoadObject","FetchObject","ReloadObject","FetchResource","readinessOptions","Ready","ReloadResource","#GetReloadCandidateObject","reject","reloadCandidateUnavailableError","#RunReloadCandidate","committed","releaseLock","noop","finishOperation","read","MarkRequested","bytes","MarkLoading","object","ReplaceExpected","commitGuard","staleReloadCandidateError","finalizeError","combined","AggregateError","#FinalizeCommittedReload","errors","#CreateReloadCandidateFailure","cause","SetError","#CleanupReloadCandidate","DestroyAdapterResources","destroy","ReleasePayload","SetLifecycleController","Fetch","LoadResourceObject","load","finally","QueueReadResource","PrepareResourceObject","PrepareResourceObjectQueued","#PrepareResourceObject","ReadResourceObjectPayload","#PrepareResourceObjectQueued","formatOptions","createFormatReadOptions","runInWorker","CanReadFormat","readTask","kind","stage","publishTask","published","#ResolveResourceObjectRead","explicitLoader","GetExt","#ReadResolvedResourceObjectPayload","createPrepareContext","ReadFormatOnce","PublishResourceObject","#PublishResourceObject","#PublishResourceObjectValue","CjsResource","SetPayload","IsPrepared","MarkPrepared","Prefetch","all","resolveFormatDescriptorCandidates","ReadFormat","normalizedPath","Delete","Entries","startsWith","DeleteAllVariants","PurgeInactive","policy","normalizeAutoPurgePolicy","GetAutoPurgePolicy","IsAutoPurgeEnabled","normalizeAutoPurgePumpOptions","time","intervalMilliseconds","maxIdleMilliseconds","payloadMaxIdleMilliseconds","destroyAdapters","releasePayload","cleanup","Clear","hasRevision","hasOwn","revisionKey","normalizeSourceRevision","sourceRevision","queuedSource","Read","ReadResource","#BeginReadOperation","inherited","resMan","normalizeCachePolicy","cacheSource","cacheFormat","sourcePath","sourceRequiresUrl","#QueueReadResource","cachePolicy","operations","getOwnerOperations","getReadOperationKey","bypassExisting","retain","sourceRecord","record","#ReadResource","queuedRecord","resourcePath","#RetainSourceResult","#InvalidateReadCache","removeOperationRecords","sourceCount","disallowedAlias","Initialize","reloadCandidateAliasError","requested","emitted","trim","normalizeResourceVariant","#TrackQueueTask","#BeginResourceOperation","resolveDone","done","finished","Math","max","#GetResourceOwnership","phase","#RequireResourceOwnership","resourceNotOwnedError","#IsResourceOwnershipCurrent","IsPurged","#AssertResourceOwnership","staleResourceOperationError","#AssertOptionalResourceOwnership","#IsReloadCandidateCurrent","#AssertReloadCandidate","#InvalidateResourceOwnership","add","#InvalidateMotherLodeOwnership","#AcquireResourcePurgeLock","Lock","Unlock","released","#ReloadPurgedResource","current","request","#BindResourceLifecycle","SetReloadHook","isCurrent","keepAlive","keepPayloadAlive","lock","unlock","#BindMotherLodeResources","getFormatOperationKey","cacheableOptions","descriptorOperations","getFormatDescriptorOperations","seen","snapshotFormatDefaultValue","type","includes","ArrayBuffer","isView","prior","index","prototype","getPrototypeOf","getOwnPropertySymbols","create","getOwnPropertyNames","getOwnPropertyDescriptor","enumerable","Number","isFinite","is","ledger","material","mediaType","classes","every","isCanonicalFormatCacheValue","serializeFormatCacheValue","join","JSON","stringify","isNaN","String","getLocalValueIdentity","identity","Uint8Array","buffer","byteOffset","byteLength","keys","sort","removed","getResourceRequestOptions","effectiveSource","base","overrides","pinsOutput","some","findDeclaredOutput","getFormatOutputs","mediaTypes","outputTypes","debugOutputTypes","outputs","output","supported","isSupported","report","call","toLowerCase","GetPayload","isInteger","allowed","unsupported","defaultAutoPurgeNow","activeOperations","getResourceDiagnosticPath","requiresUrl","property","hasOwnProperty","test","url","endsWith","Date","setTimeout","keyed"],"mappings":";;;;;;;;;AAoBA;AACA,MAAMA,aAAa,GAAG,IAAIC,OAAO,EAAE;;AAEnC;AACA,MAAMC,4BAA4B,GAAGC,MAAM,CAACC,MAAM,CAAC,CACjD,SAAS,EACT,aAAa,EACb,SAAS,EACT,MAAM,EACN,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,CAChB,CAAC;;AAEF;AACA,MAAMC,2BAA2B,GAAGF,MAAM,CAACC,MAAM,CAAC,CAChD,SAAS,EACT,MAAM,EACN,aAAa,EACb,SAAS,CACV,CAAC;;AAEF;AACA,MAAME,+BAA+B,GAAGH,MAAM,CAACC,MAAM,CAAC,CACpD,QAAQ,EACR,gBAAgB,EAChB,KAAK,CACN,CAAC;;AAEF;AACA,MAAMG,sBAAsB,GAAG,IAAIN,OAAO,EAAE;AAC5C,IAAIO,sBAAsB,GAAG,CAAC;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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