diff --git a/crates/pack-core/js/src/umd/build-base.ts b/crates/pack-core/js/src/umd/build-base.ts index 4b1490da7..f4327e2d0 100644 --- a/crates/pack-core/js/src/umd/build-base.ts +++ b/crates/pack-core/js/src/umd/build-base.ts @@ -47,28 +47,31 @@ function instantiateModule( sourceType: SourceType, sourceData: SourceData, ): Module { - const moduleFactory = moduleFactories[id]; + const moduleFactory = moduleFactories.get(id); if (typeof moduleFactory !== "function") { // This can happen if modules incorrectly handle HMR disposes/updates, // e.g. when they keep a `setTimeout` around which still executes old code // and contains e.g. a `require("something")` call. - factoryNotAvailable(id, sourceType, sourceData); + throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData)); } const module: Module = createModuleObject(id); + const exports = module.exports; moduleCache[id] = module; // NOTE(alexkirsz) This can fail when the module encounters a runtime error. + const context = new (Context as any as ContextConstructor)( + module, + exports, + ); try { - const context = new (Context as any as ContextConstructor)(module); - moduleFactory(context); + moduleFactory(context, module, exports); } catch (error) { module.error = error as any; throw error; } - module.loaded = true; if (module.namespaceObject && module.exports !== module.namespaceObject) { // in case of a circular dependency: cjs1 -> esm2 -> cjs1 interopEsm(module.exports, module.namespaceObject); @@ -78,14 +81,19 @@ function instantiateModule( } // eslint-disable-next-line @typescript-eslint/no-unused-vars -function registerChunk([ - chunkScript, - chunkModules, - runtimeParams, -]: ChunkRegistration) { - const chunkPath = getPathFromScript(chunkScript); - for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) { - registerCompressedModuleFactory(moduleId, moduleFactory); +function registerChunk(registration: ChunkRegistration) { + const chunkPath = getPathFromScript(registration[0]); + let runtimeParams: RuntimeParams | undefined; + // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length + if (registration.length === 3) { + runtimeParams = registration[2] as RuntimeParams; + } else { + runtimeParams = undefined; + installCompressedModuleFactories( + registration as CompressedModuleFactories, + /* offset= */ 1, + moduleFactories, + ); } return BACKEND.registerChunk(chunkPath, runtimeParams); diff --git a/crates/pack-core/js/src/umd/runtime-base.ts b/crates/pack-core/js/src/umd/runtime-base.ts index b72e3435f..e3f46eaba 100644 --- a/crates/pack-core/js/src/umd/runtime-base.ts +++ b/crates/pack-core/js/src/umd/runtime-base.ts @@ -42,8 +42,7 @@ type RuntimeParams = { type ChunkRegistration = [ chunkPath: ChunkScript, - chunkModules: CompressedModuleFactories, - params: RuntimeParams | undefined, + ...(CompressedModuleFactories | [RuntimeParams]), ]; type ChunkList = { @@ -85,18 +84,18 @@ interface RuntimeBackend { ) => Promise; } -const moduleFactories: ModuleFactories = Object.create(null); +const moduleFactories: ModuleFactories = new Map(); contextPrototype.M = moduleFactories; const availableModules: Map | true> = new Map(); const availableModuleChunks: Map | true> = new Map(); -function factoryNotAvailable( +function factoryNotAvailableMessage( moduleId: ModuleId, sourceType: SourceType, sourceData: SourceData, -) { +): string { let instantiationReason; switch (sourceType) { case SourceType.Runtime: @@ -114,9 +113,7 @@ function factoryNotAvailable( (sourceType) => `Unknown source type: ${sourceType}`, ); } - throw new Error( - `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.`, - ); + return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`; } const loadedChunk = Promise.resolve(undefined); @@ -259,23 +256,6 @@ function getPathFromScript( return path as ChunkPath | ChunkListPath; } -function registerCompressedModuleFactory( - moduleId: ModuleId, - moduleFactory: Function | [Function, ModuleId[]], -) { - if (!moduleFactories[moduleId]) { - if (Array.isArray(moduleFactory)) { - let [moduleFactoryFn, otherIds] = moduleFactory; - moduleFactories[moduleId] = moduleFactoryFn; - for (const otherModuleId of otherIds) { - moduleFactories[otherModuleId] = moduleFactoryFn; - } - } else { - moduleFactories[moduleId] = moduleFactory; - } - } -} - const regexJsUrl = /\.js(?:\?[^#]*)?(?:#.*)?$/; /** * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment. diff --git a/crates/pack-core/js/src/umd/runtime-types.d.ts b/crates/pack-core/js/src/umd/runtime-types.d.ts index ed9c688f8..dd0e10361 100644 --- a/crates/pack-core/js/src/umd/runtime-types.d.ts +++ b/crates/pack-core/js/src/umd/runtime-types.d.ts @@ -42,7 +42,9 @@ type EsmImport = ( ) => EsmNamespaceObject | Promise; type InvokeAsyncLoader = (moduleId: ModuleId) => Promise; type EsmExport = ( - exportGetters: Record any>, + bindings: Array< + string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown + >, id: ModuleId | undefined, ) => void; type ExportValue = (value: any, id: ModuleId | undefined) => void; @@ -56,12 +58,11 @@ type LoadChunkByUrl = (chunkUrl: ChunkUrl) => Promise | undefined; type ModuleCache = Record; // TODO properly type values here -type ModuleFactories = Record; -// The value is an array with scope hoisting -type CompressedModuleFactories = Record< - ModuleId, - Function | [Function, ModuleId[]] ->; +type ModuleFactories = Map; +// This is an alternating, non-empty module factory functions and module ids +// [id1, id2..., factory1, id3, factory2, id4, id5, factory3] +// There are multiple ids to support scope hoisting modules +type CompressedModuleFactories = Array; type RelativeURL = (inputUrl: string) => void; type ResolvePathFromModule = (moduleId: string) => string; @@ -91,13 +92,11 @@ type ExternalImport = ( interface Module { exports: Function | Exports | Promise | AsyncModulePromise; error: Error | undefined; - loaded: boolean; id: ModuleId; namespaceObject?: | EsmNamespaceObject | Promise | AsyncModulePromise; - [REEXPORTED_OBJECTS]?: any[]; } interface ModuleWithDirection extends Module { diff --git a/crates/pack-core/js/src/umd/runtime-utils.ts b/crates/pack-core/js/src/umd/runtime-utils.ts index c7a84cba5..0e5aa280a 100644 --- a/crates/pack-core/js/src/umd/runtime-utils.ts +++ b/crates/pack-core/js/src/umd/runtime-utils.ts @@ -17,7 +17,7 @@ declare function getOrInstantiateModuleFromParent( sourceModule: M, ): M; -const REEXPORTED_OBJECTS = Symbol("reexported objects"); +const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. @@ -90,32 +90,57 @@ function createModuleObject(id: ModuleId): Module { return { exports: {}, error: undefined, - loaded: false, id, namespaceObject: undefined, - [REEXPORTED_OBJECTS]: undefined, }; } +type BindingTag = 0; +const BindingTag_Value = 0 as BindingTag; + +// an arbitrary sequence of bindings as +// - a prop name +// - BindingTag_Value, a value to be bound directly, or +// - 1 or 2 functions to bind as getters and sdetters +type EsmBindings = Array< + string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown +>; + /** * Adds the getters to the exports object. */ -function esm( - exports: Exports, - getters: Record any) | [() => any, (v: any) => void]>, -) { +function esm(exports: Exports, bindings: EsmBindings) { defineProp(exports, "__esModule", { value: true }); if (toStringTag) defineProp(exports, toStringTag, { value: "Module" }); - for (const key in getters) { - const item = getters[key]; - if (Array.isArray(item)) { - defineProp(exports, key, { - get: item[0], - set: item[1], - enumerable: true, - }); + let i = 0; + while (i < bindings.length) { + const propName = bindings[i++] as string; + const tagOrFunction = bindings[i++]; + if (typeof tagOrFunction === "number") { + if (tagOrFunction === BindingTag_Value) { + defineProp(exports, propName, { + value: bindings[i++], + enumerable: true, + writable: false, + }); + } else { + throw new Error(`unexpected tag: ${tagOrFunction}`); + } } else { - defineProp(exports, key, { get: item, enumerable: true }); + const getterFn = tagOrFunction as () => unknown; + if (typeof bindings[i] === "function") { + const setterFn = bindings[i++] as (v: unknown) => void; + defineProp(exports, propName, { + get: getterFn, + set: setterFn, + enumerable: true, + }); + } else { + defineProp(exports, propName, { + get: getterFn, + enumerable: true, + }); + } } } Object.seal(exports); @@ -126,25 +151,33 @@ function esm( */ function esmExport( this: TurbopackBaseContext, - getters: Record any>, + bindings: EsmBindings, id: ModuleId | undefined, ) { - let module = this.m; - let exports = this.e; + let module: Module; + let exports: Module["exports"]; if (id != null) { module = getOverwrittenModule(this.c, id); exports = module.exports; + } else { + module = this.m; + exports = this.e; } - module.namespaceObject = module.exports; - esm(exports, getters); + module.namespaceObject = exports; + esm(exports, bindings); } contextPrototype.s = esmExport; -function ensureDynamicExports(module: Module, exports: Exports) { - let reexportedObjects = module[REEXPORTED_OBJECTS]; +type ReexportedObjects = Record[]; +function ensureDynamicExports( + module: Module, + exports: Exports, +): ReexportedObjects { + let reexportedObjects: ReexportedObjects | undefined = + REEXPORTED_OBJECTS.get(module); if (!reexportedObjects) { - reexportedObjects = module[REEXPORTED_OBJECTS] = []; + REEXPORTED_OBJECTS.set(module, (reexportedObjects = [])); module.exports = module.namespaceObject = new Proxy(exports, { get(target, prop) { if ( @@ -171,6 +204,7 @@ function ensureDynamicExports(module: Module, exports: Exports) { }, }); } + return reexportedObjects; } /** @@ -181,16 +215,19 @@ function dynamicExport( object: Record, id: ModuleId | undefined, ) { - let module = this.m; - let exports = this.e; + let module: Module; + let exports: Exports; if (id != null) { module = getOverwrittenModule(this.c, id); exports = module.exports; + } else { + module = this.m; + exports = this.e; } - ensureDynamicExports(module, exports); + const reexportedObjects = ensureDynamicExports(module, exports); if (typeof object === "object" && object !== null) { - module[REEXPORTED_OBJECTS]!.push(object); + reexportedObjects.push(object); } } contextPrototype.j = dynamicExport; @@ -247,7 +284,8 @@ function interopEsm( ns: EsmNamespaceObject, allowExportDefault?: boolean, ) { - const getters: { [s: string]: () => any } = Object.create(null); + const bindings: EsmBindings = []; + let defaultLocation = -1; for ( let current = raw; (typeof current === "object" || typeof current === "function") && @@ -255,17 +293,26 @@ function interopEsm( current = getProto(current) ) { for (const key of Object.getOwnPropertyNames(current)) { - getters[key] = createGetter(raw, key); + bindings.push(key, createGetter(raw, key)); + if (defaultLocation === -1 && key === "default") { + defaultLocation = bindings.length - 1; + } } } // this is not really correct // we should set the `default` getter if the imported module is a `.cjs file` - if (!(allowExportDefault && "default" in getters)) { - getters["default"] = () => raw; + if (!(allowExportDefault && defaultLocation >= 0)) { + // Replace the binding with one for the namespace itself in order to preserve iteration order. + if (defaultLocation >= 0) { + // Replace the getter with the value + bindings.splice(defaultLocation, 1, BindingTag_Value, raw); + } else { + bindings.push("default", BindingTag_Value, raw); + } } - esm(ns, getters); + esm(ns, bindings); return ns; } @@ -284,7 +331,6 @@ function esmImport( id: ModuleId, ): Exclude { const module = getOrInstantiateModuleFromParent(id, this.m); - if (module.error) throw module.error; // any ES module has to have `module.namespaceObject` defined. if (module.namespaceObject) return module.namespaceObject; @@ -306,7 +352,7 @@ function asyncLoader( const loader = this.r(moduleId) as ( importFunction: EsmImport, ) => Promise; - return loader(this.i.bind(this)); + return loader(esmImport.bind(this)); } contextPrototype.A = asyncLoader; @@ -326,9 +372,7 @@ function commonJsRequire( this: TurbopackBaseContext, id: ModuleId, ): Exports { - const module = getOrInstantiateModuleFromParent(id, this.m); - if (module.error) throw module.error; - return module.exports; + return getOrInstantiateModuleFromParent(id, this.m).exports; } contextPrototype.r = commonJsRequire; @@ -404,6 +448,47 @@ function createPromise() { }; } +// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map. +// The CompressedModuleFactories format is +// - 1 or more module ids +// - a module factory function +// So walking this is a little complex but the flat structure is also fast to +// traverse, we can use `typeof` operators to distinguish the two cases. +function installCompressedModuleFactories( + chunkModules: CompressedModuleFactories, + offset: number, + moduleFactories: ModuleFactories, + newModuleId?: (id: ModuleId) => void, +) { + let i = offset; + while (i < chunkModules.length) { + let moduleId = chunkModules[i] as ModuleId; + let end = i + 1; + // Find our factory function + while ( + end < chunkModules.length && + typeof chunkModules[end] !== "function" + ) { + end++; + } + if (end === chunkModules.length) { + throw new Error("malformed chunk format, expected a factory function"); + } + // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already + // present we know all the additional ids are also present, so we don't need to check. + if (!moduleFactories.has(moduleId)) { + const moduleFactoryFn = chunkModules[end] as Function; + applyModuleFactoryName(moduleFactoryFn); + newModuleId?.(moduleId); + for (; i < end; i++) { + moduleId = chunkModules[i] as ModuleId; + moduleFactories.set(moduleId, moduleFactoryFn); + } + } + i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array. + } +} + // everything below is adapted from webpack // https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13 @@ -612,5 +697,12 @@ function requireStub(_moduleId: ModuleId): never { contextPrototype.z = requireStub; type ContextConstructor = { - new (module: Module): TurbopackBaseContext; + new (module: Module, exports: Exports): TurbopackBaseContext; }; + +function applyModuleFactoryName(factory: Function) { + // Give the module factory a nice name to improve stack traces. + Object.defineProperty(factory, "name", { + value: "module evaluation", + }); +} diff --git a/crates/pack-core/src/library/ecmascript/chunk.rs b/crates/pack-core/src/library/ecmascript/chunk.rs index 3c6a7ad91..c0f617c80 100644 --- a/crates/pack-core/src/library/ecmascript/chunk.rs +++ b/crates/pack-core/src/library/ecmascript/chunk.rs @@ -146,7 +146,7 @@ impl EcmascriptLibraryEvaluateChunk { writedoc!( code, r#" - }})([[{chunk_path}, {{ + }})([[{chunk_path}, [ "#, chunk_path = StringifyJs(chunk_public_path) )?; @@ -154,10 +154,39 @@ impl EcmascriptLibraryEvaluateChunk { let content = this.chunk.chunk_content().await?; let chunk_items = content.chunk_item_code_and_ids().await?; for item in chunk_items { - for (id, item_code) in item { - write!(code, "\n{}: ", StringifyJs(&id))?; - code.push_code(item_code); - write!(code, ",")?; + // Group ids by their code (for scope hoisting, multiple ids can share the same code) + // We use the code's source content as the key to group identical codes + let mut ids_by_code: std::collections::HashMap< + String, + Vec<(ReadRef, ReadRef)>, + > = std::collections::HashMap::new(); + for (id, item_code) in item.iter() { + // Use the code's source content as the key + let code_key = item_code + .source_code() + .to_str() + .map_err(|e| anyhow::anyhow!("Failed to convert code to string: {}", e))? + .to_string(); + // Clone the ReadRef values to store in the HashMap + let id_clone = ReadRef::clone(id); + let item_code_clone = ReadRef::clone(item_code); + ids_by_code + .entry(code_key) + .or_insert_with(Vec::new) + .push((id_clone, item_code_clone)); + } + + // Output in CompressedModuleFactories format: [id1, id2, ..., factory, id3, factory2, ...] + for (_, ids_and_codes) in ids_by_code { + // First output all ids that share the same code + for (id, _) in &ids_and_codes { + write!(code, "\n{}, ", StringifyJs(id))?; + } + // Then output the code (factory function) + if let Some((_, item_code)) = ids_and_codes.first() { + code.push_code(item_code); + write!(code, ",")?; + } } } @@ -166,7 +195,7 @@ impl EcmascriptLibraryEvaluateChunk { runtime_module_ids, }; - write!(code, "\n}},")?; + write!(code, "\n],")?; write!(code, "\n{},", StringifyJs(¶ms))?; writeln!(code, "\n]]);")?; diff --git a/crates/pack-tests/tests/snapshot/runtime/library_build_runtime/output/main.js b/crates/pack-tests/tests/snapshot/runtime/library_build_runtime/output/main.js index 0565abd6d..78552231f 100644 --- a/crates/pack-tests/tests/snapshot/runtime/library_build_runtime/output/main.js +++ b/crates/pack-tests/tests/snapshot/runtime/library_build_runtime/output/main.js @@ -14,7 +14,7 @@ const RUNTIME_PUBLIC_PATH = ""; * * It will be prepended to the runtime code of each runtime. */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -const REEXPORTED_OBJECTS = Symbol("reexported objects"); +const REEXPORTED_OBJECTS = new WeakMap(); /** * Constructs the `__turbopack_context__` object for a module. */ function Context(module) { @@ -43,55 +43,73 @@ function getOverwrittenModule(moduleCache, id) { return { exports: {}, error: undefined, - loaded: false, id, - namespaceObject: undefined, - [REEXPORTED_OBJECTS]: undefined + namespaceObject: undefined }; } +const BindingTag_Value = 0; /** * Adds the getters to the exports object. - */ function esm(exports, getters) { + */ function esm(exports, bindings) { defineProp(exports, "__esModule", { value: true }); if (toStringTag) defineProp(exports, toStringTag, { value: "Module" }); - for(const key in getters){ - const item = getters[key]; - if (Array.isArray(item)) { - defineProp(exports, key, { - get: item[0], - set: item[1], - enumerable: true - }); + let i = 0; + while(i < bindings.length){ + const propName = bindings[i++]; + const tagOrFunction = bindings[i++]; + if (typeof tagOrFunction === "number") { + if (tagOrFunction === BindingTag_Value) { + defineProp(exports, propName, { + value: bindings[i++], + enumerable: true, + writable: false + }); + } else { + throw new Error(`unexpected tag: ${tagOrFunction}`); + } } else { - defineProp(exports, key, { - get: item, - enumerable: true - }); + const getterFn = tagOrFunction; + if (typeof bindings[i] === "function") { + const setterFn = bindings[i++]; + defineProp(exports, propName, { + get: getterFn, + set: setterFn, + enumerable: true + }); + } else { + defineProp(exports, propName, { + get: getterFn, + enumerable: true + }); + } } } Object.seal(exports); } /** * Makes the module an ESM with exports - */ function esmExport(getters, id) { - let module = this.m; - let exports = this.e; + */ function esmExport(bindings, id) { + let module; + let exports; if (id != null) { module = getOverwrittenModule(this.c, id); exports = module.exports; + } else { + module = this.m; + exports = this.e; } - module.namespaceObject = module.exports; - esm(exports, getters); + module.namespaceObject = exports; + esm(exports, bindings); } contextPrototype.s = esmExport; function ensureDynamicExports(module, exports) { - let reexportedObjects = module[REEXPORTED_OBJECTS]; + let reexportedObjects = REEXPORTED_OBJECTS.get(module); if (!reexportedObjects) { - reexportedObjects = module[REEXPORTED_OBJECTS] = []; + REEXPORTED_OBJECTS.set(module, reexportedObjects = []); module.exports = module.namespaceObject = new Proxy(exports, { get (target, prop) { if (hasOwnProperty.call(target, prop) || prop === "default" || prop === "__esModule") { @@ -114,19 +132,23 @@ function ensureDynamicExports(module, exports) { } }); } + return reexportedObjects; } /** * Dynamically exports properties from an object */ function dynamicExport(object, id) { - let module = this.m; - let exports = this.e; + let module; + let exports; if (id != null) { module = getOverwrittenModule(this.c, id); exports = module.exports; + } else { + module = this.m; + exports = this.e; } - ensureDynamicExports(module, exports); + const reexportedObjects = ensureDynamicExports(module, exports); if (typeof object === "object" && object !== null) { - module[REEXPORTED_OBJECTS].push(object); + reexportedObjects.push(object); } } contextPrototype.j = dynamicExport; @@ -165,18 +187,28 @@ function createGetter(obj, key) { * * `false`: will have the raw module as default export * * `true`: will have the default property as default export */ function interopEsm(raw, ns, allowExportDefault) { - const getters = Object.create(null); + const bindings = []; + let defaultLocation = -1; for(let current = raw; (typeof current === "object" || typeof current === "function") && !LEAF_PROTOTYPES.includes(current); current = getProto(current)){ for (const key of Object.getOwnPropertyNames(current)){ - getters[key] = createGetter(raw, key); + bindings.push(key, createGetter(raw, key)); + if (defaultLocation === -1 && key === "default") { + defaultLocation = bindings.length - 1; + } } } // this is not really correct // we should set the `default` getter if the imported module is a `.cjs file` - if (!(allowExportDefault && "default" in getters)) { - getters["default"] = ()=>raw; + if (!(allowExportDefault && defaultLocation >= 0)) { + // Replace the binding with one for the namespace itself in order to preserve iteration order. + if (defaultLocation >= 0) { + // Replace the getter with the value + bindings.splice(defaultLocation, 1, BindingTag_Value, raw); + } else { + bindings.push("default", BindingTag_Value, raw); + } } - esm(ns, getters); + esm(ns, bindings); return ns; } function createNS(raw) { @@ -190,7 +222,6 @@ function createNS(raw) { } function esmImport(id) { const module = getOrInstantiateModuleFromParent(id, this.m); - if (module.error) throw module.error; // any ES module has to have `module.namespaceObject` defined. if (module.namespaceObject) return module.namespaceObject; // only ESM can be an async module, so we don't need to worry about exports being a promise here. @@ -200,7 +231,7 @@ function esmImport(id) { contextPrototype.i = esmImport; function asyncLoader(moduleId) { const loader = this.r(moduleId); - return loader(this.i.bind(this)); + return loader(esmImport.bind(this)); } contextPrototype.A = asyncLoader; // Add a simple runtime require so that environments without one can still pass @@ -211,9 +242,7 @@ typeof require === "function" ? require : function require1() { }; contextPrototype.t = runtimeRequire; function commonJsRequire(id) { - const module = getOrInstantiateModuleFromParent(id, this.m); - if (module.error) throw module.error; - return module.exports; + return getOrInstantiateModuleFromParent(id, this.m).exports; } contextPrototype.r = commonJsRequire; /** @@ -268,6 +297,38 @@ function createPromise() { reject: reject }; } +// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map. +// The CompressedModuleFactories format is +// - 1 or more module ids +// - a module factory function +// So walking this is a little complex but the flat structure is also fast to +// traverse, we can use `typeof` operators to distinguish the two cases. +function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) { + let i = offset; + while(i < chunkModules.length){ + let moduleId = chunkModules[i]; + let end = i + 1; + // Find our factory function + while(end < chunkModules.length && typeof chunkModules[end] !== 'function'){ + end++; + } + if (end === chunkModules.length) { + throw new Error('malformed chunk format, expected a factory function'); + } + // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already + // present we know all the additional ids are also present, so we don't need to check. + if (!moduleFactories.has(moduleId)) { + const moduleFactoryFn = chunkModules[end]; + applyModuleFactoryName(moduleFactoryFn); + newModuleId?.(moduleId); + for(; i < end; i++){ + moduleId = chunkModules[i]; + moduleFactories.set(moduleId, moduleFactoryFn); + } + } + i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array. + } +} // everything below is adapted from webpack // https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13 const turbopackQueues = Symbol("turbopack queues"); @@ -408,6 +469,12 @@ contextPrototype.U = relativeURL; throw new Error("dynamic usage of require is not supported"); } contextPrototype.z = requireStub; +function applyModuleFactoryName(factory) { + // Give the module factory a nice name to improve stack traces. + Object.defineProperty(factory, 'name', { + value: 'module evaluation' + }); +} /** * This file contains runtime types and functions that are shared between all * Turbopack *development* ECMAScript runtimes. @@ -435,11 +502,11 @@ var SourceType = /*#__PURE__*/ function(SourceType) { */ SourceType[SourceType["Update"] = 2] = "Update"; return SourceType; }(SourceType || {}); -const moduleFactories = Object.create(null); +const moduleFactories = new Map(); contextPrototype.M = moduleFactories; const availableModules = new Map(); const availableModuleChunks = new Map(); -function factoryNotAvailable(moduleId, sourceType, sourceData) { +function factoryNotAvailableMessage(moduleId, sourceType, sourceData) { let instantiationReason; switch(sourceType){ case 0: @@ -449,12 +516,12 @@ function factoryNotAvailable(moduleId, sourceType, sourceData) { instantiationReason = `because it was required from module ${sourceData}`; break; case 2: - instantiationReason = "because of an HMR update"; + instantiationReason = 'because of an HMR update'; break; default: invariant(sourceType, (sourceType)=>`Unknown source type: ${sourceType}`); } - throw new Error(`Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.`); + return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`; } const loadedChunk = Promise.resolve(undefined); const instrumentedBackendLoadChunks = new WeakMap(); @@ -583,24 +650,24 @@ const getOrInstantiateModuleFromParent = (id, sourceModule)=>{ return instantiateModule(id, SourceType.Parent, sourceModule.id); }; function instantiateModule(id, sourceType, sourceData) { - const moduleFactory = moduleFactories[id]; - if (typeof moduleFactory !== "function") { + const moduleFactory = moduleFactories.get(id); + if (typeof moduleFactory !== 'function') { // This can happen if modules incorrectly handle HMR disposes/updates, // e.g. when they keep a `setTimeout` around which still executes old code // and contains e.g. a `require("something")` call. - factoryNotAvailable(id, sourceType, sourceData); + throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData)); } const module = createModuleObject(id); + const exports = module.exports; moduleCache[id] = module; // NOTE(alexkirsz) This can fail when the module encounters a runtime error. + const context = new Context(module, exports); try { - const context = new Context(module); - moduleFactory(context); + moduleFactory(context, module, exports); } catch (error) { module.error = error; throw error; } - module.loaded = true; if (module.namespaceObject && module.exports !== module.namespaceObject) { // in case of a circular dependency: cjs1 -> esm2 -> cjs1 interopEsm(module.exports, module.namespaceObject); @@ -608,10 +675,15 @@ function instantiateModule(id, sourceType, sourceData) { return module; } // eslint-disable-next-line @typescript-eslint/no-unused-vars -function registerChunk([chunkScript, chunkModules, runtimeParams]) { - const chunkPath = getPathFromScript(chunkScript); - for (const [moduleId, moduleFactory] of Object.entries(chunkModules)){ - registerCompressedModuleFactory(moduleId, moduleFactory); +function registerChunk(registration) { + const chunkPath = getPathFromScript(registration[0]); + let runtimeParams; + // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length + if (registration.length === 2) { + runtimeParams = registration[1]; + } else { + runtimeParams = undefined; + installCompressedModuleFactories(registration, /* offset= */ 1, moduleFactories); } return BACKEND.registerChunk(chunkPath, runtimeParams); } diff --git a/crates/pack-tests/tests/snapshot/runtime/library_build_runtime/output/main.js.map b/crates/pack-tests/tests/snapshot/runtime/library_build_runtime/output/main.js.map index d37b8174f..add1558b3 100644 --- a/crates/pack-tests/tests/snapshot/runtime/library_build_runtime/output/main.js.map +++ b/crates/pack-tests/tests/snapshot/runtime/library_build_runtime/output/main.js.map @@ -2,10 +2,10 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 10, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record;\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: M[\"id\"],\n sourceModule: M,\n): M;\n\nconst REEXPORTED_OBJECTS = Symbol(\"reexported objects\");\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(this: TurbopackBaseContext, module: Module) {\n this.m = module;\n this.e = module.exports;\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext;\n\ntype ModuleContextMap = Record;\n\ninterface ModuleContextEntry {\n id: () => ModuleId;\n module: () => any;\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject;\n\n // async import call\n import(moduleId: ModuleId): Promise;\n\n keys(): ModuleId[];\n\n resolve(moduleId: ModuleId): ModuleId;\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: ModuleId,\n parentModule: M,\n) => M;\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId,\n): Module;\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst toStringTag = typeof Symbol !== \"undefined\" && Symbol.toStringTag;\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType,\n) {\n if (!hasOwnProperty.call(obj, name))\n Object.defineProperty(obj, name, options);\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId,\n): Module {\n let module = moduleCache[id];\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id);\n moduleCache[id] = module;\n }\n return module;\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n loaded: false,\n id,\n namespaceObject: undefined,\n [REEXPORTED_OBJECTS]: undefined,\n };\n}\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(\n exports: Exports,\n getters: Record any) | [() => any, (v: any) => void]>,\n) {\n defineProp(exports, \"__esModule\", { value: true });\n if (toStringTag) defineProp(exports, toStringTag, { value: \"Module\" });\n for (const key in getters) {\n const item = getters[key];\n if (Array.isArray(item)) {\n defineProp(exports, key, {\n get: item[0],\n set: item[1],\n enumerable: true,\n });\n } else {\n defineProp(exports, key, { get: item, enumerable: true });\n }\n }\n Object.seal(exports);\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n getters: Record any>,\n id: ModuleId | undefined,\n) {\n let module = this.m;\n let exports = this.e;\n if (id != null) {\n module = getOverwrittenModule(this.c, id);\n exports = module.exports;\n }\n module.namespaceObject = module.exports;\n esm(exports, getters);\n}\ncontextPrototype.s = esmExport;\n\nfunction ensureDynamicExports(module: Module, exports: Exports) {\n let reexportedObjects = module[REEXPORTED_OBJECTS];\n\n if (!reexportedObjects) {\n reexportedObjects = module[REEXPORTED_OBJECTS] = [];\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === \"default\" ||\n prop === \"__esModule\"\n ) {\n return Reflect.get(target, prop);\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop);\n if (value !== undefined) return value;\n }\n return undefined;\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target);\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== \"default\" && !keys.includes(key)) keys.push(key);\n }\n }\n return keys;\n },\n });\n }\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined,\n) {\n let module = this.m;\n let exports = this.e;\n if (id != null) {\n module = getOverwrittenModule(this.c, id);\n exports = module.exports;\n }\n ensureDynamicExports(module, exports);\n\n if (typeof object === \"object\" && object !== null) {\n module[REEXPORTED_OBJECTS]!.push(object);\n }\n}\ncontextPrototype.j = dynamicExport;\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined,\n) {\n let module = this.m;\n if (id != null) {\n module = getOverwrittenModule(this.c, id);\n }\n module.exports = value;\n}\ncontextPrototype.v = exportValue;\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined,\n) {\n let module = this.m;\n if (id != null) {\n module = getOverwrittenModule(this.c, id);\n }\n module.exports = module.namespaceObject = namespace;\n}\ncontextPrototype.n = exportNamespace;\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key];\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__;\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)];\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean,\n) {\n const getters: { [s: string]: () => any } = Object.create(null);\n for (\n let current = raw;\n (typeof current === \"object\" || typeof current === \"function\") &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n getters[key] = createGetter(raw, key);\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && \"default\" in getters)) {\n getters[\"default\"] = () => raw;\n }\n\n esm(ns, getters);\n return ns;\n}\n\nfunction createNS(raw: Module[\"exports\"]): EsmNamespaceObject {\n if (typeof raw === \"function\") {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args);\n };\n } else {\n return Object.create(null);\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId,\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m);\n if (module.error) throw module.error;\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject;\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports;\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule,\n ));\n}\ncontextPrototype.i = esmImport;\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId,\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport,\n ) => Promise;\n return loader(this.i.bind(this));\n}\ncontextPrototype.A = asyncLoader;\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === \"function\"\n ? // @ts-ignore\n require\n : function require() {\n throw new Error(\"Unexpected use of runtime require\");\n };\ncontextPrototype.t = runtimeRequire;\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId,\n): Exports {\n const module = getOrInstantiateModuleFromParent(id, this.m);\n if (module.error) throw module.error;\n return module.exports;\n}\ncontextPrototype.r = commonJsRequire;\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module();\n }\n\n const e = new Error(`Cannot find module '${id}'`);\n (e as any).code = \"MODULE_NOT_FOUND\";\n throw e;\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map);\n };\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id();\n }\n\n const e = new Error(`Cannot find module '${id}'`);\n (e as any).code = \"MODULE_NOT_FOUND\";\n throw e;\n };\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise);\n };\n\n return moduleContext;\n}\ncontextPrototype.f = moduleContext;\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === \"string\" ? chunkData : chunkData.path;\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === \"object\" &&\n \"then\" in maybePromise &&\n typeof maybePromise.then === \"function\"\n );\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj;\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void;\n let reject: (reason?: any) => void;\n\n const promise = new Promise((res, rej) => {\n reject = rej;\n resolve = res;\n });\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n };\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol(\"turbopack queues\");\nconst turbopackExports = Symbol(\"turbopack exports\");\nconst turbopackError = Symbol(\"turbopack error\");\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number };\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus;\n};\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved;\n queue.forEach((fn) => fn.queueCount--);\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()));\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise;\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void;\n [turbopackExports]: Exports;\n [turbopackError]?: any;\n};\n\ntype AsyncModulePromise = Promise & AsyncModuleExt;\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === \"object\") {\n if (isAsyncModuleExt(dep)) return dep;\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n });\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n };\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res;\n resolveQueue(queue);\n },\n (err) => {\n obj[turbopackError] = err;\n resolveQueue(queue);\n },\n );\n\n return obj;\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n };\n });\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[],\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void,\n ) => void,\n hasAwait: boolean,\n) {\n const module = this.m;\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined;\n\n const depQueues: Set = new Set();\n\n const { resolve, reject, promise: rawPromise } = createPromise();\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue);\n depQueues.forEach(fn);\n promise[\"catch\"](() => {});\n },\n } satisfies AsyncModuleExt);\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise;\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v;\n }\n },\n };\n\n Object.defineProperty(module, \"exports\", attributes);\n Object.defineProperty(module, \"namespaceObject\", attributes);\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps);\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError];\n return d[turbopackExports];\n });\n\n const { promise, resolve } = createPromise<() => Exports[]>();\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n });\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q);\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++;\n q.push(fn);\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue));\n\n return fn.queueCount ? promise : getResult();\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err));\n } else {\n resolve(promise[turbopackExports]);\n }\n\n resolveQueue(queue);\n }\n\n body(handleAsyncDependencies, asyncResult);\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved;\n }\n}\ncontextPrototype.a = asyncModule;\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, \"x:/\");\n const values: Record = {};\n for (const key in realUrl) values[key] = (realUrl as any)[key];\n values.href = inputUrl;\n values.pathname = inputUrl.replace(/[?#].*/, \"\");\n values.origin = values.protocol = \"\";\n values.toString = values.toJSON = (..._args: Array) => inputUrl;\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n });\n};\n\nrelativeURL.prototype = URL.prototype;\ncontextPrototype.U = relativeURL;\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`);\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error(\"dynamic usage of require is not supported\");\n}\ncontextPrototype.z = requireStub;\n\ntype ContextConstructor = {\n new (module: Module): TurbopackBaseContext;\n};\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,OAAO;AAElC;;CAEC,GACD,SAAS,QAA4C,MAAc;IACjE,IAAI,CAAC,CAAC,GAAG;IACT,IAAI,CAAC,CAAC,GAAG,OAAO,OAAO;AACzB;AACA,MAAM,mBAAmB,QAAQ,SAAS;AA+B1C,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAC5B,OAAO,cAAc,CAAC,KAAK,MAAM;AACrC;AAEA,SAAS,qBACP,WAAgC,EAChC,EAAY;IAEZ,IAAI,SAAS,WAAW,CAAC,GAAG;IAC5B,IAAI,CAAC,QAAQ;QACX,0FAA0F;QAC1F,4DAA4D;QAC5D,SAAS,mBAAmB;QAC5B,WAAW,CAAC,GAAG,GAAG;IACpB;IACA,OAAO;AACT;AAEA;;CAEC,GACD,SAAS,mBAAmB,EAAY;IACtC,OAAO;QACL,SAAS,CAAC;QACV,OAAO;QACP,QAAQ;QACR;QACA,iBAAiB;QACjB,CAAC,mBAAmB,EAAE;IACxB;AACF;AAEA;;CAEC,GACD,SAAS,IACP,OAAgB,EAChB,OAAoE;IAEpE,WAAW,SAAS,cAAc;QAAE,OAAO;IAAK;IAChD,IAAI,aAAa,WAAW,SAAS,aAAa;QAAE,OAAO;IAAS;IACpE,IAAK,MAAM,OAAO,QAAS;QACzB,MAAM,OAAO,OAAO,CAAC,IAAI;QACzB,IAAI,MAAM,OAAO,CAAC,OAAO;YACvB,WAAW,SAAS,KAAK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d;AACF;AACA,iBAAiB,CAAC,GAAG;AAErB;;;;;;;;;CASC,GACD,MAAM,cAAc,SAAS,YAAuB,QAAgB;IAClE,MAAM,UAAU,IAAI,IAAI,UAAU;IAClC,MAAM,SAA8B,CAAC;IACrC,IAAK,MAAM,OAAO,QAAS,MAAM,CAAC,IAAI,GAAG,AAAC,OAAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AAEA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG"}}, - {"offset": {"line": 410, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string;\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined;\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string;\ndeclare var CHUNK_SUFFIX_PATH: string;\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule;\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext;\n\n// Provided by build\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData,\n): Module;\n\ntype RuntimeParams = {\n otherChunks: ChunkData[];\n runtimeModuleIds: ModuleId[];\n};\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n chunkModules: CompressedModuleFactories,\n params: RuntimeParams | undefined,\n];\n\ntype ChunkList = {\n script: ChunkListScript;\n chunks: ChunkData[];\n source: \"entry\" | \"dynamic\";\n};\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined;\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void;\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl,\n ) => Promise;\n}\n\nconst moduleFactories: ModuleFactories = Object.create(null);\ncontextPrototype.M = moduleFactories;\n\nconst availableModules: Map | true> = new Map();\n\nconst availableModuleChunks: Map | true> = new Map();\n\nfunction factoryNotAvailable(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData,\n) {\n let instantiationReason;\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`;\n break;\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`;\n break;\n case SourceType.Update:\n instantiationReason = \"because of an HMR update\";\n break;\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`,\n );\n }\n throw new Error(\n `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.`,\n );\n}\n\nconst loadedChunk = Promise.resolve(undefined);\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>();\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl,\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl);\n}\nbrowserContextPrototype.L = loadChunkByUrl;\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl,\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, sourceData, chunkUrl);\n let entry = instrumentedBackendLoadChunks.get(thenable);\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk,\n );\n entry = thenable.then(resolve).catch((error) => {\n let loadReason;\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`;\n break;\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`;\n break;\n case SourceType.Update:\n loadReason = \"from an HMR update\";\n break;\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`,\n );\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : \"\"\n }`,\n error\n ? {\n cause: error,\n }\n : undefined,\n );\n });\n instrumentedBackendLoadChunks.set(thenable, entry);\n }\n\n return entry;\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath,\n): Promise {\n const url = getChunkRelativeUrl(chunkPath);\n return loadChunkByUrlInternal(sourceType, sourceData, url);\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string,\n): string {\n const exported = this.r(moduleId);\n return exported?.default ?? exported;\n}\nbrowserContextPrototype.R = resolvePathFromModule;\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? \"\"}`;\n}\nbrowserContextPrototype.P = resolveAbsolutePath;\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath,\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath);\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split(\"/\")\n .map((p) => encodeURIComponent(p))\n .join(\"/\")}${CHUNK_SUFFIX_PATH}` as ChunkUrl;\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath;\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript,\n): ChunkListPath;\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript,\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === \"string\") {\n return chunkScript as ChunkPath | ChunkListPath;\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== \"undefined\"\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute(\"src\")!;\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, \"\"));\n let path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src;\n if (path.startsWith(\"/\")) {\n path = path.slice(1);\n }\n return path as ChunkPath | ChunkListPath;\n}\n\nfunction registerCompressedModuleFactory(\n moduleId: ModuleId,\n moduleFactory: Function | [Function, ModuleId[]],\n) {\n if (!moduleFactories[moduleId]) {\n if (Array.isArray(moduleFactory)) {\n let [moduleFactoryFn, otherIds] = moduleFactory;\n moduleFactories[moduleId] = moduleFactoryFn;\n for (const otherModuleId of otherIds) {\n moduleFactories[otherModuleId] = moduleFactoryFn;\n }\n } else {\n moduleFactories[moduleId] = moduleFactory;\n }\n }\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/;\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath);\n}\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,uCAAuC;AACvC,2CAA2C;AAE3C,mEAAmE;AAcnE,MAAM,0BACJ,QAAQ,SAAS;AA0BnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;WAhBE;EAAA;AAiCL,MAAM,kBAAmC,OAAO,MAAM,CAAC;AACvD,iBAAiB,CAAC,GAAG;AAErB,MAAM,mBAAuD,IAAI;AAEjE,MAAM,wBAA6D,IAAI;AAEvE,SAAS,oBACP,QAAkB,EAClB,UAAsB,EACtB,UAAsB;IAEtB,IAAI;IACJ,OAAQ;QACN;YACE,sBAAsB,CAAC,4BAA4B,EAAE,YAAY;YACjE;QACF;YACE,sBAAsB,CAAC,oCAAoC,EAAE,YAAY;YACzE;QACF;YACE,sBAAsB;YACtB;QACF;YACE,UACE,YACA,CAAC,aAAe,CAAC,qBAAqB,EAAE,YAAY;IAE1D;IACA,MAAM,IAAI,MACR,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,oBAAoB,uFAAuF,CAAC;AAEvJ;AAEA,MAAM,cAAc,QAAQ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AAc,IAAI;AACpC;AACA,wBAAwB,CAAC,GAAG;AAE5B;;CAEC,GACD,SAAS,yBACP,QAAkB,EAClB,SAAoB;IAEpB,OAAO,kBAAkB,aAA8B;AACzD;AACA;;CAEC,GACD,SAAS,oBAAoB,SAAoC;IAC/D,OAAO,GAAG,kBAAkB,UACzB,KAAK,CAAC,KACN,GAAG,CAAC,CAAC,IAAM,mBAAmB,IAC9B,IAAI,CAAC,OAAO,mBAAmB;AACpC;AASA,SAAS,kBACP,WAAsE;IAEtE,IAAI,OAAO,gBAAgB,UAAU;QACnC,OAAO;IACT;IACA,MAAM,WACJ,OAAO,8BAA8B,cACjC,0BAA0B,GAAG,KAC7B,YAAY,YAAY,CAAC;IAC/B,MAAM,MAAM,mBAAmB,SAAS,OAAO,CAAC,WAAW;IAC3D,IAAI,OAAO,IAAI,UAAU,CAAC,mBACtB,IAAI,KAAK,CAAC,gBAAgB,MAAM,IAChC;IACJ,IAAI,KAAK,UAAU,CAAC,MAAM;QACxB,OAAO,KAAK,KAAK,CAAC;IACpB;IACA,OAAO;AACT;AAEA,SAAS,gCACP,QAAkB,EAClB,aAAgD;IAEhD,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE;QAC9B,IAAI,MAAM,OAAO,CAAC,gBAAgB;YAChC,IAAI,CAAC,iBAAiB,SAAS,GAAG;YAClC,eAAe,CAAC,SAAS,GAAG;YAC5B,KAAK,MAAM,iBAAiB,SAAU;gBACpC,eAAe,CAAC,cAAc,GAAG;YACnC;QACF,OAAO;YACL,eAAe,CAAC,SAAS,GAAG;QAC9B;IACF;AACF;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB"}}, - {"offset": {"line": 554, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/build-base.ts"],"sourcesContent":["/// \n/// \n\nconst moduleCache: ModuleCache = {};\ncontextPrototype.c = moduleCache;\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId,\n): Module {\n const module = moduleCache[moduleId];\n if (module) {\n if (module.error) {\n throw module.error;\n }\n return module;\n }\n\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath);\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// Used by the backend\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n Module\n> = (id, sourceModule) => {\n const module = moduleCache[id];\n\n if (module) {\n return module;\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id);\n};\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData,\n): Module {\n const moduleFactory = moduleFactories[id];\n if (typeof moduleFactory !== \"function\") {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n factoryNotAvailable(id, sourceType, sourceData);\n }\n\n const module: Module = createModuleObject(id);\n\n moduleCache[id] = module;\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n const context = new (Context as any as ContextConstructor)(module);\n moduleFactory(context);\n } catch (error) {\n module.error = error as any;\n throw error;\n }\n\n module.loaded = true;\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject);\n }\n\n return module;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction registerChunk([\n chunkScript,\n chunkModules,\n runtimeParams,\n]: ChunkRegistration) {\n const chunkPath = getPathFromScript(chunkScript);\n for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n registerCompressedModuleFactory(moduleId, moduleFactory);\n }\n\n return BACKEND.registerChunk(chunk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kB;IACpC,KAAK,MAAM,CAAC,UAAU,cAAc,IAAI,OAAO,OAAO,CAAC,cAAe;QACpE,gCAAgC,UAAU;IAC5C;IAEA,OAAO,QAAQ,aAAa,CAAC,WAAW;AAC1C"}}, - {"offset": {"line": 617, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/base-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw;\n try {\n raw = await import(id);\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`);\n }\n\n if (raw && raw.__esModule && raw.default && \"default\" in raw.default) {\n return interopEsm(raw.default, createNS(raw), true);\n }\n\n return raw;\n}\ncontextPrototype.y = externalImport;\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false,\n): Exports | EsmNamespaceObject {\n let raw;\n try {\n raw = thunk();\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`);\n }\n\n if (!esm || raw.__esModule) {\n return raw;\n }\n\n return interopEsm(raw, createNS(raw), true);\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[];\n },\n) => {\n return require.resolve(id, options);\n};\ncontextPrototype.x = externalRequire;\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,2CAA2C;AAE3C,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG"}}, - {"offset": {"line": 658, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean;\n loadingStarted: boolean;\n resolve: () => void;\n reject: (error?: Error) => void;\n promise: Promise;\n};\n\nlet BACKEND: RuntimeBackend;\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map();\n\n(() => {\n BACKEND = {\n registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath);\n\n const resolver = getOrCreateResolver(chunkUrl);\n resolver.resolve();\n\n if (params == null) {\n return;\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData);\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath);\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl);\n }\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId);\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl,\n ) {\n return doLoadChunk(sourceType, sourceData, chunkUrl);\n },\n };\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl);\n if (!resolver) {\n let resolve: () => void;\n let reject: (error?: Error) => void;\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve;\n reject = innerReject;\n });\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true;\n resolve();\n },\n reject: reject!,\n };\n chunkResolvers.set(chunkUrl, resolver);\n }\n return resolver;\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(\n sourceType: SourceType,\n _sourceData: SourceData,\n chunkUrl: ChunkUrl,\n ) {\n const resolver = getOrCreateResolver(chunkUrl);\n if (resolver.loadingStarted) {\n return resolver.promise;\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true;\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise;\n }\n\n if (typeof importScripts === \"function\") {\n // We're in a web worker\n if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl);\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl);\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`,\n );\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl);\n\n if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`,\n );\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener(\"error\", () => {\n resolver.reject();\n });\n }\n } else {\n const script = document.createElement(\"script\");\n script.src = chunkUrl;\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject();\n };\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script);\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`);\n }\n }\n\n resolver.loadingStarted = true;\n return resolver.promise;\n }\n})();\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,0CAA0C;AAC1C,6CAA6C;AAU7C,IAAI;AAEJ;;CAEC,GACD,MAAM,iBAA+C,IAAI;AAEzD,CAAC;IACC,UAAU;QACR,eAAc,SAAS,EAAE,MAAM;YAC7B,MAAM,WAAW,oBAAoB;YAErC,MAAM,WAAW,oBAAoB;YACrC,SAAS,OAAO;YAEhB,IAAI,UAAU,MAAM;gBAClB;YACF;YAEA,KAAK,MAAM,kBAAkB,OAAO,WAAW,CAAE;gBAC/C,MAAM,iBAAiB,aAAa;gBACpC,MAAM,gBAAgB,oBAAoB;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;gBAClB,MAAM,kBAAkB,SAAS,gBAAgB,CAC/C,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,SAAS,gBAAgB,EAAE,gBAAgB,gBAAgB,EAAE,gBAAgB,GAAG,CAAC;gBAE7H,IAAI,gBAAgB,MAAM,GAAG,GAAG;oBAC9B,qEAAqE;oBACrE,kEAAkE;oBAClE,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,iBAAkB;wBAChD,OAAO,gBAAgB,CAAC,SAAS;4BAC/B,SAAS,MAAM;wBACjB;oBACF;gBACF,OAAO;oBACL,MAAM,SAAS,SAAS,aAAa,CAAC;oBACtC,OAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,OAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;AACF,CAAC"}}, - {"offset": {"line": 805, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/runtime/library_build_runtime/input/index.js"],"sourcesContent":["console.log('Hello, world!')\n"],"names":[],"mappings":"AAAA,QAAQ,GAAG,CAAC"}}] + {"offset": {"line": 10, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\ntype EsmNamespaceObject = Record;\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: M[\"id\"],\n sourceModule: M,\n): M;\n\nconst REEXPORTED_OBJECTS = new WeakMap();\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(this: TurbopackBaseContext, module: Module) {\n this.m = module;\n this.e = module.exports;\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext;\n\ntype ModuleContextMap = Record;\n\ninterface ModuleContextEntry {\n id: () => ModuleId;\n module: () => any;\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject;\n\n // async import call\n import(moduleId: ModuleId): Promise;\n\n keys(): ModuleId[];\n\n resolve(moduleId: ModuleId): ModuleId;\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: ModuleId,\n parentModule: M,\n) => M;\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId,\n): Module;\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst toStringTag = typeof Symbol !== \"undefined\" && Symbol.toStringTag;\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType,\n) {\n if (!hasOwnProperty.call(obj, name))\n Object.defineProperty(obj, name, options);\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId,\n): Module {\n let module = moduleCache[id];\n if (!module) {\n // This is invoked when a module is merged into another module, thus it wasn't invoked via\n // instantiateModule and the cache entry wasn't created yet.\n module = createModuleObject(id);\n moduleCache[id] = module;\n }\n return module;\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n };\n}\n\ntype BindingTag = 0;\nconst BindingTag_Value = 0 as BindingTag;\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>;\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings) {\n defineProp(exports, \"__esModule\", { value: true });\n if (toStringTag) defineProp(exports, toStringTag, { value: \"Module\" });\n let i = 0;\n while (i < bindings.length) {\n const propName = bindings[i++] as string;\n const tagOrFunction = bindings[i++];\n if (typeof tagOrFunction === \"number\") {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n });\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`);\n }\n } else {\n const getterFn = tagOrFunction as () => unknown;\n if (typeof bindings[i] === \"function\") {\n const setterFn = bindings[i++] as (v: unknown) => void;\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n });\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n });\n }\n }\n }\n Object.seal(exports);\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined,\n) {\n let module: Module;\n let exports: Module[\"exports\"];\n if (id != null) {\n module = getOverwrittenModule(this.c, id);\n exports = module.exports;\n } else {\n module = this.m;\n exports = this.e;\n }\n module.namespaceObject = exports;\n esm(exports, bindings);\n}\ncontextPrototype.s = esmExport;\n\ntype ReexportedObjects = Record[];\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports,\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module);\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []));\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === \"default\" ||\n prop === \"__esModule\"\n ) {\n return Reflect.get(target, prop);\n }\n for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop);\n if (value !== undefined) return value;\n }\n return undefined;\n },\n ownKeys(target) {\n const keys = Reflect.ownKeys(target);\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== \"default\" && !keys.includes(key)) keys.push(key);\n }\n }\n return keys;\n },\n });\n }\n return reexportedObjects;\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined,\n) {\n let module: Module;\n let exports: Exports;\n if (id != null) {\n module = getOverwrittenModule(this.c, id);\n exports = module.exports;\n } else {\n module = this.m;\n exports = this.e;\n }\n const reexportedObjects = ensureDynamicExports(module, exports);\n\n if (typeof object === \"object\" && object !== null) {\n reexportedObjects.push(object);\n }\n}\ncontextPrototype.j = dynamicExport;\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined,\n) {\n let module = this.m;\n if (id != null) {\n module = getOverwrittenModule(this.c, id);\n }\n module.exports = value;\n}\ncontextPrototype.v = exportValue;\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined,\n) {\n let module = this.m;\n if (id != null) {\n module = getOverwrittenModule(this.c, id);\n }\n module.exports = module.namespaceObject = namespace;\n}\ncontextPrototype.n = exportNamespace;\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key];\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__;\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)];\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean,\n) {\n const bindings: EsmBindings = [];\n let defaultLocation = -1;\n for (\n let current = raw;\n (typeof current === \"object\" || typeof current === \"function\") &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key));\n if (defaultLocation === -1 && key === \"default\") {\n defaultLocation = bindings.length - 1;\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw);\n } else {\n bindings.push(\"default\", BindingTag_Value, raw);\n }\n }\n\n esm(ns, bindings);\n return ns;\n}\n\nfunction createNS(raw: Module[\"exports\"]): EsmNamespaceObject {\n if (typeof raw === \"function\") {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args);\n };\n } else {\n return Object.create(null);\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId,\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m);\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject;\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports;\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule,\n ));\n}\ncontextPrototype.i = esmImport;\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId,\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport,\n ) => Promise;\n return loader(esmImport.bind(this));\n}\ncontextPrototype.A = asyncLoader;\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === \"function\"\n ? // @ts-ignore\n require\n : function require() {\n throw new Error(\"Unexpected use of runtime require\");\n };\ncontextPrototype.t = runtimeRequire;\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId,\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports;\n}\ncontextPrototype.r = commonJsRequire;\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\n if (hasOwnProperty.call(map, id)) {\n return map[id].module();\n }\n\n const e = new Error(`Cannot find module '${id}'`);\n (e as any).code = \"MODULE_NOT_FOUND\";\n throw e;\n }\n\n moduleContext.keys = (): ModuleId[] => {\n return Object.keys(map);\n };\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\n if (hasOwnProperty.call(map, id)) {\n return map[id].id();\n }\n\n const e = new Error(`Cannot find module '${id}'`);\n (e as any).code = \"MODULE_NOT_FOUND\";\n throw e;\n };\n\n moduleContext.import = async (id: ModuleId) => {\n return await (moduleContext(id) as Promise);\n };\n\n return moduleContext;\n}\ncontextPrototype.f = moduleContext;\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === \"string\" ? chunkData : chunkData.path;\n}\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === \"object\" &&\n \"then\" in maybePromise &&\n typeof maybePromise.then === \"function\"\n );\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj;\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void;\n let reject: (reason?: any) => void;\n\n const promise = new Promise((res, rej) => {\n reject = rej;\n resolve = res;\n });\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n };\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let moduleId = chunkModules[i] as ModuleId\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n // Each chunk item has a 'primary id' and optional additional ids. If the primary id is already\n // present we know all the additional ids are also present, so we don't need to check.\n if (!moduleFactories.has(moduleId)) {\n const moduleFactoryFn = chunkModules[end] as Function\n applyModuleFactoryName(moduleFactoryFn)\n newModuleId?.(moduleId)\n for (; i < end; i++) {\n moduleId = chunkModules[i] as ModuleId\n moduleFactories.set(moduleId, moduleFactoryFn)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n\nconst turbopackQueues = Symbol(\"turbopack queues\");\nconst turbopackExports = Symbol(\"turbopack exports\");\nconst turbopackError = Symbol(\"turbopack error\");\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number };\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus;\n};\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved;\n queue.forEach((fn) => fn.queueCount--);\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()));\n }\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise;\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void;\n [turbopackExports]: Exports;\n [turbopackError]?: any;\n};\n\ntype AsyncModulePromise = Promise & AsyncModuleExt;\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === \"object\") {\n if (isAsyncModuleExt(dep)) return dep;\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n });\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n };\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res;\n resolveQueue(queue);\n },\n (err) => {\n obj[turbopackError] = err;\n resolveQueue(queue);\n },\n );\n\n return obj;\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n };\n });\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[],\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void,\n ) => void,\n hasAwait: boolean,\n) {\n const module = this.m;\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined;\n\n const depQueues: Set = new Set();\n\n const { resolve, reject, promise: rawPromise } = createPromise();\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue);\n depQueues.forEach(fn);\n promise[\"catch\"](() => {});\n },\n } satisfies AsyncModuleExt);\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise;\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v;\n }\n },\n };\n\n Object.defineProperty(module, \"exports\", attributes);\n Object.defineProperty(module, \"namespaceObject\", attributes);\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps);\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError];\n return d[turbopackExports];\n });\n\n const { promise, resolve } = createPromise<() => Exports[]>();\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n });\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q);\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++;\n q.push(fn);\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue));\n\n return fn.queueCount ? promise : getResult();\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err));\n } else {\n resolve(promise[turbopackExports]);\n }\n\n resolveQueue(queue);\n }\n\n body(handleAsyncDependencies, asyncResult);\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved;\n }\n}\ncontextPrototype.a = asyncModule;\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, \"x:/\");\n const values: Record = {};\n for (const key in realUrl) values[key] = (realUrl as any)[key];\n values.href = inputUrl;\n values.pathname = inputUrl.replace(/[?#].*/, \"\");\n values.origin = values.protocol = \"\";\n values.toString = values.toJSON = (..._args: Array) => inputUrl;\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n });\n};\n\nrelativeURL.prototype = URL.prototype;\ncontextPrototype.U = relativeURL;\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`);\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error(\"dynamic usage of require is not supported\");\n}\ncontextPrototype.z = requireStub;\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve st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AAK,MAAM,OAAO,QAAS,MAAM,CAAC,IAAI,GAAG,AAAC,OAAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AAEA,YAAY,SAAS,GAAG,IAAI,SAAS;AACrC,iBAAiB,CAAC,GAAG;AAErB;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,QAAQ;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB;AACA,iBAAiB,CAAC,GAAG;AAMrB,SAAS,uBAAuB,OAAiB;IAC/C,+DAA+D;IAC/D,OAAO,cAAc,CAAC,SAAS,QAAQ;QACrC,OAAO;IACT;AACF"}}, + {"offset": {"line": 477, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk base path\ndeclare var TURBOPACK_WORKER_LOCATION: string;\n// Used in WebWorkers to tell the runtime about the current chunk url since it can't be detected via document.currentScript\n// Note it's stored in reversed order to use push and pop\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined;\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string;\ndeclare var CHUNK_SUFFIX_PATH: string;\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule;\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext;\n\n// Provided by build\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData,\n): Module;\n\ntype RuntimeParams = {\n otherChunks: ChunkData[];\n runtimeModuleIds: ModuleId[];\n};\n\ntype ChunkRegistration = [\n chunkPath: ChunkScript,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkListScript;\n chunks: ChunkData[];\n source: \"entry\" | \"dynamic\";\n};\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined;\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void;\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl,\n ) => Promise;\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map();\n\nconst availableModuleChunks: Map | true> = new Map();\n\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\nconst loadedChunk = Promise.resolve(undefined);\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>();\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkUrl: ChunkUrl,\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkUrl);\n}\nbrowserContextPrototype.L = loadChunkByUrl;\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl,\n): Promise {\n const thenable = BACKEND.loadChunkCached(sourceType, sourceData, chunkUrl);\n let entry = instrumentedBackendLoadChunks.get(thenable);\n if (entry === undefined) {\n const resolve = instrumentedBackendLoadChunks.set.bind(\n instrumentedBackendLoadChunks,\n thenable,\n loadedChunk,\n );\n entry = thenable.then(resolve).catch((error) => {\n let loadReason;\n switch (sourceType) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${sourceData}`;\n break;\n case SourceType.Parent:\n loadReason = `from module ${sourceData}`;\n break;\n case SourceType.Update:\n loadReason = \"from an HMR update\";\n break;\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`,\n );\n }\n throw new Error(\n `Failed to load chunk ${chunkUrl} ${loadReason}${\n error ? `: ${error}` : \"\"\n }`,\n error\n ? {\n cause: error,\n }\n : undefined,\n );\n });\n instrumentedBackendLoadChunks.set(thenable, entry);\n }\n\n return entry;\n}\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkPath(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkPath: ChunkPath,\n): Promise {\n const url = getChunkRelativeUrl(chunkPath);\n return loadChunkByUrlInternal(sourceType, sourceData, url);\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction resolvePathFromModule(\n this: TurbopackBaseContext,\n moduleId: string,\n): string {\n const exported = this.r(moduleId);\n return exported?.default ?? exported;\n}\nbrowserContextPrototype.R = resolvePathFromModule;\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? \"\"}`;\n}\nbrowserContextPrototype.P = resolveAbsolutePath;\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath,\n): Module {\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath);\n}\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath | ChunkListPath): ChunkUrl {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split(\"/\")\n .map((p) => encodeURIComponent(p))\n .join(\"/\")}${CHUNK_SUFFIX_PATH}` as ChunkUrl;\n}\n\n/**\n * Return the ChunkPath from a ChunkScript.\n */\nfunction getPathFromScript(chunkScript: ChunkPath | ChunkScript): ChunkPath;\nfunction getPathFromScript(\n chunkScript: ChunkListPath | ChunkListScript,\n): ChunkListPath;\nfunction getPathFromScript(\n chunkScript: ChunkPath | ChunkListPath | ChunkScript | ChunkListScript,\n): ChunkPath | ChunkListPath {\n if (typeof chunkScript === \"string\") {\n return chunkScript as ChunkPath | ChunkListPath;\n }\n const chunkUrl =\n typeof TURBOPACK_NEXT_CHUNK_URLS !== \"undefined\"\n ? TURBOPACK_NEXT_CHUNK_URLS.pop()!\n : chunkScript.getAttribute(\"src\")!;\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, \"\"));\n let path = src.startsWith(CHUNK_BASE_PATH)\n ? src.slice(CHUNK_BASE_PATH.length)\n : src;\n if (path.startsWith(\"/\")) {\n path = path.slice(1);\n }\n return path as ChunkPath | ChunkListPath;\n}\n\nfunction registerCompressedModuleFactory(\n moduleId: ModuleId,\n moduleFactory: Function | [Function, ModuleId[]],\n) {\n if (!moduleFactories[moduleId]) {\n if (Array.isArray(moduleFactory)) {\n let [moduleFactoryFn, otherIds] = moduleFactory;\n moduleFactories[moduleId] = moduleFactoryFn;\n for (const otherModuleId of otherIds) {\n moduleFactories[otherModuleId] = moduleFactoryFn;\n }\n } else {\n moduleFactories[moduleId] = moduleFactory;\n }\n }\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/;\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n return regexJsUrl.test(chunkUrlOrPath);\n}\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,uCAAuC;AACvC,2CAA2C;AAE3C,mEAAmE;AAcnE,MAAM,0BACJ,QAAQ,SAAS;AAyBnB,IAAA,AAAK,oCAAA;IACH;;;;GAIC;IAED;;;GAGC;IAED;;;;GAIC;WAhBE;EAAA;AAiCL,MAAM,kBAAmC,IAAI;AAC7C,iBAAiB,CAAC,GAAG;AAErB,MAAM,mBAAuD,IAAI;AAEjE,MAAM,wBAA6D,IAAI;AAEvE,SAAS,2BACP,QAAkB,EAClB,UAAsB,EACtB,UAAsB;IAEtB,IAAI;IACJ,OAAQ;QACN;YACE,sBAAsB,CAAC,4BAA4B,EAAE,YAAY;YACjE;QACF;YACE,sBAAsB,CAAC,oCAAoC,EAAE,YAAY;YACzE;QACF;YACE,sBAAsB;YACtB;QACF;YACE,UACE,YACA,CAAC,aAAe,CAAC,qBAAqB,EAAE,YAAY;IAE1D;IACA,OAAO,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,oBAAoB,0CAA0C,CAAC;AAC/G;AAEA,MAAM,cAAc,QAAQ,OAAO,CAAC;AACpC,MAAM,gCAAgC,IAAI;AAI1C,wFAAwF;AACxF,SAAS,eAEP,QAAkB;IAElB,OAAO,0BAA0C,IAAI,CAAC,CAAC,CAAC,EAAE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ACA;;CAEC,GACD,SAAS,oBAAoB,SAAoC;IAC/D,OAAO,GAAG,kBAAkB,UACzB,KAAK,CAAC,KACN,GAAG,CAAC,CAAC,IAAM,mBAAmB,IAC9B,IAAI,CAAC,OAAO,mBAAmB;AACpC;AASA,SAAS,kBACP,WAAsE;IAEtE,IAAI,OAAO,gBAAgB,UAAU;QACnC,OAAO;IACT;IACA,MAAM,WACJ,OAAO,8BAA8B,cACjC,0BAA0B,GAAG,KAC7B,YAAY,YAAY,CAAC;IAC/B,MAAM,MAAM,mBAAmB,SAAS,OAAO,CAAC,WAAW;IAC3D,IAAI,OAAO,IAAI,UAAU,CAAC,mBACtB,IAAI,KAAK,CAAC,gBAAgB,MAAM,IAChC;IACJ,IAAI,KAAK,UAAU,CAAC,MAAM;QACxB,OAAO,KAAK,KAAK,CAAC;IACpB;IACA,OAAO;AACT;AAEA,SAAS,gCACP,QAAkB,EAClB,aAAgD;IAEhD,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE;QAC9B,IAAI,MAAM,OAAO,CAAC,gBAAgB;YAChC,IAAI,CAAC,iBAAiB,SAAS,GAAG;YAClC,eAAe,CAAC,SAAS,GAAG;YAC5B,KAAK,MAAM,iBAAiB,SAAU;gBACpC,eAAe,CAAC,cAAc,GAAG;YACnC;QACF,OAAO;YACL,eAAe,CAAC,SAAS,GAAG;QAC9B;IACF;AACF;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB"}}, + {"offset": {"line": 621, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/build-base.ts"],"sourcesContent":["/// \n/// \n\nconst moduleCache: ModuleCache = {};\ncontextPrototype.c = moduleCache;\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId,\n): Module {\n const module = moduleCache[moduleId];\n if (module) {\n if (module.error) {\n throw module.error;\n }\n return module;\n }\n\n return instantiateModule(moduleId, SourceType.Runtime, chunkPath);\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// Used by the backend\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent<\n Module\n> = (id, sourceModule) => {\n const module = moduleCache[id];\n\n if (module) {\n return module;\n }\n\n return instantiateModule(id, SourceType.Parent, sourceModule.id);\n};\n\nfunction instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module {\n const moduleFactory = moduleFactories.get(id)\n if (typeof moduleFactory !== 'function') {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n throw new Error(factoryNotAvailableMessage(id, sourceType, sourceData))\n }\n\n const module: Module = createModuleObject(id)\n const exports = module.exports\n\n moduleCache[id] = module\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n const context = new (Context as any as ContextConstructor)(\n module,\n exports\n )\n try {\n moduleFactory(context, module, exports)\n } catch (error) {\n module.error = error as any\n throw error\n }\n\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject)\n }\n\n return module\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction registerChunk(registration: ChunkRegistration) {\n const chunkPath = getPathFromScript(registration[0])\n let runtimeParams: RuntimeParams | undefined\n // When bootstrapping we are passed a single runtimeParams object so we can distinguish purely based on length\n if (registration.length === 2) {\n runtimeParams = registration[1] as RuntimeParams\n } else {\n runtimeParams = undefined\n installCompressedModuleFactories(\n registration as CompressedModuleFactories,\n /* offset= */ 1,\n moduleFactories\n )\n }\n\n return BACKEND.registerChunk(chunkPath, runtimeParams)\n}\n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AM,YAAY,kBAAkB,YAAY,CAAC,EAAE;IACnD,IAAI;IACJ,8GAA8G;IAC9G,IAAI,aAAa,MAAM,KAAK,GAAG;QAC7B,gBAAgB,YAAY,CAAC,EAAE;IACjC,OAAO;QACL,gBAAgB;QAChB,iCACE,cACA,WAAW,GAAG,GACd;IAEJ;IAEA,OAAO,QAAQ,aAAa,CAAC,WAAW;AAC1C"}}, + {"offset": {"line": 689, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/base-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: DependencySpecifier) {\n let raw;\n try {\n raw = await import(id);\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`);\n }\n\n if (raw && raw.__esModule && raw.default && \"default\" in raw.default) {\n return interopEsm(raw.default, createNS(raw), true);\n }\n\n return raw;\n}\ncontextPrototype.y = externalImport;\n\nfunction externalRequire(\n id: ModuleId,\n thunk: () => any,\n esm: boolean = false,\n): Exports | EsmNamespaceObject {\n let raw;\n try {\n raw = thunk();\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`);\n }\n\n if (!esm || raw.__esModule) {\n return raw;\n }\n\n return interopEsm(raw, createNS(raw), true);\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[];\n },\n) => {\n return require.resolve(id, options);\n};\ncontextPrototype.x = externalRequire;\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,2CAA2C;AAE3C,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAuB;IACnD,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AACA,iBAAiB,CAAC,GAAG;AAErB,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B;AACA,iBAAiB,CAAC,GAAG"}}, + {"offset": {"line": 730, "column": 0}, "map": {"version":3,"sources":["turbopack:///[@utoo/pack-runtime]/umd/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean;\n loadingStarted: boolean;\n resolve: () => void;\n reject: (error?: Error) => void;\n promise: Promise;\n};\n\nlet BACKEND: RuntimeBackend;\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map();\n\n(() => {\n BACKEND = {\n registerChunk(chunkPath, params) {\n const chunkUrl = getChunkRelativeUrl(chunkPath);\n\n const resolver = getOrCreateResolver(chunkUrl);\n resolver.resolve();\n\n if (params == null) {\n return;\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData);\n const otherChunkUrl = getChunkRelativeUrl(otherChunkPath);\n\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkUrl);\n }\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(chunkPath, moduleId);\n }\n }\n },\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n loadChunkCached(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkUrl: ChunkUrl,\n ) {\n return doLoadChunk(sourceType, sourceData, chunkUrl);\n },\n };\n function getOrCreateResolver(chunkUrl: ChunkUrl): ChunkResolver {\n let resolver = chunkResolvers.get(chunkUrl);\n if (!resolver) {\n let resolve: () => void;\n let reject: (error?: Error) => void;\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve;\n reject = innerReject;\n });\n resolver = {\n resolved: false,\n loadingStarted: false,\n promise,\n resolve: () => {\n resolver!.resolved = true;\n resolve();\n },\n reject: reject!,\n };\n chunkResolvers.set(chunkUrl, resolver);\n }\n return resolver;\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n function doLoadChunk(\n sourceType: SourceType,\n _sourceData: SourceData,\n chunkUrl: ChunkUrl,\n ) {\n const resolver = getOrCreateResolver(chunkUrl);\n if (resolver.loadingStarted) {\n return resolver.promise;\n }\n\n if (sourceType === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n resolver.loadingStarted = true;\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise;\n }\n\n if (typeof importScripts === \"function\") {\n // We're in a web worker\n if (isJs(chunkUrl)) {\n self.TURBOPACK_NEXT_CHUNK_URLS!.push(chunkUrl);\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl);\n } else {\n throw new Error(\n `can't infer type of chunk from URL ${chunkUrl} in worker`,\n );\n }\n } else {\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl);\n\n if (isJs(chunkUrl)) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`,\n );\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener(\"error\", () => {\n resolver.reject();\n });\n }\n } else {\n const script = document.createElement(\"script\");\n script.src = chunkUrl;\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject();\n };\n // Append to the `head` for webpack compatibility.\n document.head.appendChild(script);\n }\n } else {\n throw new Error(`can't infer type of chunk from URL ${chunkUrl}`);\n }\n }\n\n resolver.loadingStarted = true;\n return resolver.promise;\n }\n})();\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,0CAA0C;AAC1C,6CAA6C;AAU7C,IAAI;AAEJ;;CAEC,GACD,MAAM,iBAA+C,IAAI;AAEzD,CAAC;IACC,UAAU;QACR,eAAc,SAAS,EAAE,MAAM;YAC7B,MAAM,WAAW,oBAAoB;YAErC,MAAM,WAAW,oBAAoB;YACrC,SAAS,OAAO;YAEhB,IAAI,UAAU,MAAM;gBAClB;YACF;Y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AE,SAAS,UAAU,CAAC;YAE9D;QACF,OAAO;YACL,gFAAgF;YAChF,MAAM,kBAAkB,UAAU;YAElC,IAAI,KAAK,WAAW;gBAClB,MAAM,kBAAkB,SAAS,gBAAgB,CAC/C,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,SAAS,gBAAgB,EAAE,gBAAgB,gBAAgB,EAAE,gBAAgB,GAAG,CAAC;gBAE7H,IAAI,gBAAgB,MAAM,GAAG,GAAG;oBAC9B,qEAAqE;oBACrE,kEAAkE;oBAClE,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,iBAAkB;wBAChD,OAAO,gBAAgB,CAAC,SAAS;4BAC/B,SAAS,MAAM;wBACjB;oBACF;gBACF,OAAO;oBACL,MAAM,SAAS,SAAS,aAAa,CAAC;oBACtC,OAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,OAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,kDAAkD;oBAClD,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,mCAAmC,EAAE,UAAU;YAClE;QACF;QAEA,SAAS,cAAc,GAAG;QAC1B,OAAO,SAAS,OAAO;IACzB;AACF,CAAC"}}, + {"offset": {"line": 877, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/runtime/library_build_runtime/input/index.js"],"sourcesContent":["console.log('Hello, world!')\n"],"names":[],"mappings":"AAAA,QAAQ,GAAG,CAAC"}}] } \ No newline at end of file