Repository: vercel/next.js
Pull request: Turbopack server HMR: inline source maps for `eval`ed modules

Previously, we lost stack frame information when server hmr code was applied through `eval`. 

This adds and calls \`maybeInlineSourcemap()\` to the Turbopack Node.js HMR runtime that appends \`//# sourceURL\` and \`//# sourceMappingURL\` (base64-encoded) to each `eval`ed module entry. 
    
Test Plan: CI for #90389

Changed files:
filename: test/development/app-dir/server-hmr/app/sourcemaps/page.tsx
patch: @@ -0,0 +1,5 @@
+// hmr-trigger: 0
+
+export default function Page() {
+  throw new Error('hmr-sourcemap-test-error')
+}

filename: test/development/app-dir/server-hmr/server-hmr.test.ts
patch: @@ -127,4 +127,31 @@ describe('server-hmr', () => {
       }
     )
   })
+
+  describe('source maps', () => {
+    itTurbopackDev(
+      "stack frames from eval'd HMR modules point to original source locations",
+      async () => {
+        await next.fetch('/sourcemaps').catch(() => {})
+
+        await next.patchFile('app/sourcemaps/page.tsx', (content) =>
+          content.replace('hmr-trigger: 0', 'hmr-trigger: 1')
+        )
+
+        const outputLengthBeforeFetch = next.cliOutput.length
+        await next.fetch('/sourcemaps').catch(() => {})
+
+        await retry(async () => {
+          expect(next.cliOutput.slice(outputLengthBeforeFetch)).toContain(
+            'hmr-sourcemap-test-error'
+          )
+        })
+
+        const outputAfterHmr = next.cliOutput.slice(outputLengthBeforeFetch)
+
+        // Without proper sourcemaps, the stack frame doesn't include the accurate file number
+        expect(outputAfterHmr).toMatch(/page\.tsx:4:9/)
+      }
+    )
+  })
 })

filename: turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/dev/hmr-client.ts
patch: @@ -13,6 +13,25 @@ type NodeJsHmrPayload = {
   instruction: EcmascriptMergedUpdate
 }
 
+/**
+ * Appends the module code with //# sourceURL and //# sourceMappingURL so
+ * that Node.js can resolve stack frames from `eval`ed server HMR modules back to
+ * their original source files. Mirrors the browser's _eval in dev-backend-dom.ts.
+ */
+function inlineSourcemaps(entry: EcmascriptModuleEntry): string {
+  const [chunkPath, moduleId] = entry.url.split('?', 2)
+  const absolutePath = path.resolve(RUNTIME_ROOT, chunkPath)
+  const fileHref = url.pathToFileURL(absolutePath).href
+  const sourceURL = moduleId ? `${fileHref}?${moduleId}` : fileHref
+  let code = entry.code + '\n\n//# sourceURL=' + sourceURL
+  if (entry.map) {
+    code +=
+      '\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,' +
+      Buffer.from(entry.map).toString('base64')
+  }
+  return code
+}
+
 let serverHmrUpdateHandler: ((msg: NodeJsHmrPayload) => void) | null = null
 
 function initializeServerHmr(
@@ -75,10 +94,9 @@ function handleNodejsUpdate(
   try {
     const { entries = {}, chunks = {} } = instruction
 
-    // Node.js eval function (no source maps)
     const evalModuleEntry = (entry: EcmascriptModuleEntry) => {
       // eslint-disable-next-line no-eval
-      return (0, eval)(entry.code)
+      return (0, eval)(entry.map ? inlineSourcemaps(entry) : entry.code)
     }
 
     const { added, modified } = computeChangedModules(

filename: turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js
patch: @@ -1466,7 +1466,22 @@ module.exports = (sourcePath)=>({
     });
 /// <reference path="../../shared/runtime/dev-protocol.d.ts" />
 /// <reference path="../../shared/runtime/hmr-runtime.ts" />
-/* eslint-disable @typescript-eslint/no-unused-vars */ let serverHmrUpdateHandler = null;
+/* eslint-disable @typescript-eslint/no-unused-vars */ /**
+ * Appends the module code with //# sourceURL and //# sourceMappingURL so
+ * that Node.js can resolve stack frames from `eval`ed server HMR modules back to
+ * their original source files. Mirrors the browser's _eval in dev-backend-dom.ts.
+ */ function inlineSourcemaps(entry) {
+    const [chunkPath, moduleId] = entry.url.split('?', 2);
+    const absolutePath = path.resolve(RUNTIME_ROOT, chunkPath);
+    const fileHref = url.pathToFileURL(absolutePath).href;
+    const sourceURL = moduleId ? `${fileHref}?${moduleId}` : fileHref;
+    let code = entry.code + '\n\n//# sourceURL=' + sourceURL;
+    if (entry.map) {
+        code += '\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,' + Buffer.from(entry.map).toString('base64');
+    }
+    return code;
+}
+let serverHmrUpdateHandler = null;
 function initializeServerHmr(moduleFactories, devModuleCache) {
     if (serverHmrUpdateHandler != null) {
         throw new Error('[Server HMR] Server HMR client is already initialized');
@@ -1508,10 +1523,9 @@ function initializeServerHmr(moduleFactories, devModuleCache) {
     }
     try {
         const { entries = {}, chunks = {} } = instruction;
-        // Node.js eval function (no source maps)
         const evalModuleEntry = (entry)=>{
             // eslint-disable-next-line no-eval
-            return (0, eval)(entry.code);
+            return (0, eval)(entry.map ? inlineSourcemaps(entry) : entry.code);
         };
         const { added, modified } = computeChangedModules(entries, chunks, undefined // no chunkModulesMap for Node.js
         );

filename: turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/node/output/[turbopack]_runtime.js.map
patch: @@ -9,6 +9,6 @@
     {"offset": {"line": 663, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime/runtime-base.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// <reference path=\"../../shared/runtime/runtime-utils.ts\" />\n/// <reference path=\"../../shared-node/base-externals-utils.ts\" />\n/// <reference path=\"../../shared-node/node-externals-utils.ts\" />\n/// <reference path=\"../../shared-node/node-wasm-utils.ts\" />\n/// <reference path=\"./nodejs-globals.d.ts\" />\n\n/**\n * Base Node.js runtime shared between production and development.\n * Contains chunk loading, module caching, and other non-HMR functionality.\n */\n\nprocess.env.TURBOPACK = '1'\n\nconst url = require('url') as typeof import('url')\n\nconst moduleFactories: ModuleFactories = new Map()\nconst moduleCache: ModuleCache<Module> = Object.create(null)\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction resolvePathFromModule(\n  this: TurbopackBaseContext<Module>,\n  moduleId: string\n): string {\n  const exported = this.r(moduleId)\n  const exportedPath = exported?.default ?? exported\n  if (typeof exportedPath !== 'string') {\n    return exported as any\n  }\n\n  const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length)\n  const resolved = path.resolve(RUNTIME_ROOT, strippedAssetPrefix)\n\n  return url.pathToFileURL(resolved).href\n}\n\n/**\n * Exports a URL value. No suffix is added in Node.js runtime.\n */\nfunction exportUrl(\n  this: TurbopackBaseContext<Module>,\n  urlValue: string,\n  id: ModuleId | undefined\n) {\n  exportValue.call(this, urlValue, id)\n}\n\nfunction loadRuntimeChunk(sourcePath: ChunkPath, chunkData: ChunkData): void {\n  if (typeof chunkData === 'string') {\n    loadRuntimeChunkPath(sourcePath, chunkData)\n  } else {\n    loadRuntimeChunkPath(sourcePath, chunkData.path)\n  }\n}\n\nconst loadedChunks = new Set<ChunkPath>()\nconst unsupportedLoadChunk = Promise.resolve(undefined)\nconst loadedChunk: Promise<void> = Promise.resolve(undefined)\nconst chunkCache = new Map<ChunkPath, Promise<void>>()\n\nfunction clearChunkCache() {\n  chunkCache.clear()\n  loadedChunks.clear()\n}\n\nfunction loadRuntimeChunkPath(\n  sourcePath: ChunkPath,\n  chunkPath: ChunkPath\n): void {\n  if (!isJs(chunkPath)) {\n    // We only support loading JS chunks in Node.js.\n    // This branch can be hit when trying to load a CSS chunk.\n    return\n  }\n\n  if (loadedChunks.has(chunkPath)) {\n    return\n  }\n\n  try {\n    const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n    const chunkModules: CompressedModuleFactories = require(resolved)\n    installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n    loadedChunks.add(chunkPath)\n  } catch (cause) {\n    let errorMessage = `Failed to load chunk ${chunkPath}`\n\n    if (sourcePath) {\n      errorMessage += ` from runtime for chunk ${sourcePath}`\n    }\n\n    const error = new Error(errorMessage, { cause })\n    error.name = 'ChunkLoadError'\n    throw error\n  }\n}\n\nfunction loadChunkAsync<TModule extends Module>(\n  this: TurbopackBaseContext<TModule>,\n  chunkData: ChunkData\n): Promise<void> {\n  const chunkPath = typeof chunkData === 'string' ? chunkData : chunkData.path\n  if (!isJs(chunkPath)) {\n    // We only support loading JS chunks in Node.js.\n    // This branch can be hit when trying to load a CSS chunk.\n    return unsupportedLoadChunk\n  }\n\n  let entry = chunkCache.get(chunkPath)\n  if (entry === undefined) {\n    try {\n      // resolve to an absolute path to simplify `require` handling\n      const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n      // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io\n      // However this is incompatible with hot reloading (since `import` doesn't use the require cache)\n      const chunkModules: CompressedModuleFactories = require(resolved)\n      installCompressedModuleFactories(chunkModules, 0, moduleFactories)\n      entry = loadedChunk\n    } catch (cause) {\n      const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`\n      const error = new Error(errorMessage, { cause })\n      error.name = 'ChunkLoadError'\n\n      // Cache the failure promise, future requests will also get this same rejection\n      entry = Promise.reject(error)\n    }\n    chunkCache.set(chunkPath, entry)\n  }\n  // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.\n  return entry\n}\ncontextPrototype.l = loadChunkAsync\n\nfunction loadChunkAsyncByUrl<TModule extends Module>(\n  this: TurbopackBaseContext<TModule>,\n  chunkUrl: string\n) {\n  const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath\n  return loadChunkAsync.call(this, path)\n}\ncontextPrototype.L = loadChunkAsyncByUrl\n\nfunction loadWebAssembly(\n  chunkPath: ChunkPath,\n  _edgeModule: () => WebAssembly.Module,\n  imports: WebAssembly.Imports\n) {\n  const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n  return instantiateWebAssemblyFromPath(resolved, imports)\n}\ncontextPrototype.w = loadWebAssembly\n\nfunction loadWebAssemblyModule(\n  chunkPath: ChunkPath,\n  _edgeModule: () => WebAssembly.Module\n) {\n  const resolved = path.resolve(RUNTIME_ROOT, chunkPath)\n\n  return compileWebAssemblyFromPath(resolved)\n}\ncontextPrototype.u = loadWebAssemblyModule\n\n/**\n * Creates a Node.js worker thread by instantiating the given WorkerConstructor\n * with the appropriate path and options, including forwarded globals.\n *\n * @param WorkerConstructor The Worker constructor from worker_threads\n * @param workerPath Path to the worker entry chunk\n * @param workerOptions options to pass to the Worker constructor (optional)\n */\nfunction createWorker(\n  WorkerConstructor: { new (path: string, options?: object): unknown },\n  workerPath: string,\n  workerOptions?: { workerData?: unknown; [key: string]: unknown }\n): unknown {\n  // Build the forwarded globals object\n  const forwardedGlobals: Record<string, unknown> = {}\n  for (const name of WORKER_FORWARDED_GLOBALS) {\n    forwardedGlobals[name] = (globalThis as Record<string, unknown>)[name]\n  }\n\n  // Merge workerData with forwarded globals\n  const existingWorkerData = workerOptions?.workerData || {}\n  const options = {\n    ...workerOptions,\n    workerData: {\n      ...(typeof existingWorkerData === 'object' ? existingWorkerData : {}),\n      __turbopack_globals__: forwardedGlobals,\n    },\n  }\n\n  return new WorkerConstructor(workerPath, options)\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":["process","env","TURBOPACK","url","require","moduleFactories","Map","moduleCache","Object","create","resolvePathFromModule","moduleId","exported","r","exportedPath","default","strippedAssetPrefix","slice","ASSET_PREFIX","length","resolved","path","resolve","RUNTIME_ROOT","pathToFileURL","href","exportUrl","urlValue","id","exportValue","call","loadRuntimeChunk","sourcePath","chunkData","loadRuntimeChunkPath","loadedChunks","Set","unsupportedLoadChunk","Promise","undefined","loadedChunk","chunkCache","clearChunkCache","clear","chunkPath","isJs","has","chunkModules","installCompressedModuleFactories","add","cause","errorMessage","error","Error","name","loadChunkAsync","entry","get","m","reject","set","contextPrototype","l","loadChunkAsyncByUrl","chunkUrl","path1","fileURLToPath","URL","L","loadWebAssembly","_edgeModule","imports","instantiateWebAssemblyFromPath","w","loadWebAssemblyModule","compileWebAssemblyFromPath","u","createWorker","WorkerConstructor","workerPath","workerOptions","forwardedGlobals","WORKER_FORWARDED_GLOBALS","globalThis","existingWorkerData","workerData","options","__turb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B;IAEhB,MAAMC,QAAO9D,IAAI+D,aAAa,CAAC,IAAIC,IAAIH,UAAUzC;IACjD,OAAOgC,eAAezB,IAAI,CAAC,IAAI,EAAEmC;AACnC;AACAJ,iBAAiBO,CAAC,GAAGL;AAErB,SAASM,gBACPzB,SAAoB,EACpB0B,WAAqC,EACrCC,OAA4B;IAE5B,MAAMnD,WAAWC,KAAKC,OAAO,CAACC,cAAcqB;IAE5C,OAAO4B,+BAA+BpD,UAAUmD;AAClD;AACAV,iBAAiBY,CAAC,GAAGJ;AAErB,SAASK,sBACP9B,SAAoB,EACpB0B,WAAqC;IAErC,MAAMlD,WAAWC,KAAKC,OAAO,CAACC,cAAcqB;IAE5C,OAAO+B,2BAA2BvD;AACpC;AACAyC,iBAAiBe,CAAC,GAAGF;AAErB;;;;;;;CAOC,GACD,SAASG,aACPC,iBAAoE,EACpEC,UAAkB,EAClBC,aAAgE;IAEhE,qCAAqC;IACrC,MAAMC,mBAA4C,CAAC;IACnD,KAAK,MAAM3B,QAAQ4B,yBAA0B;QAC3CD,gBAAgB,CAAC3B,KAAK,GAAG,AAAC6B,UAAsC,CAAC7B,KAAK;IACxE;IAEA,0CAA0C;IAC1C,MAAM8B,qBAAqBJ,eAAeK,cAAc,CAAC;IACzD,MAAMC,UAAU;QACd,GAAGN,aAAa;QAChBK,YAAY;YACV,GAAI,OAAOD,uBAAuB,WAAWA,qBAAqB,CAAC,CAAC;YACpEG,uBAAuBN;QACzB;IACF;IAEA,OAAO,IAAIH,kBAAkBC,YAAYO;AAC3C;AAEA,MAAME,aAAa;AACnB;;CAEC,GACD,SAAS3C,KAAK4C,cAAoC;IAChD,OAAOD,WAAWE,IAAI,CAACD;AACzB","ignoreList":[0]}},
     {"offset": {"line": 810, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime/hmr-runtime.ts"],"sourcesContent":["/// <reference path=\"./runtime-utils.ts\" />\n/// <reference path=\"./runtime-types.d.ts\" />\n/// <reference path=\"./dev-extensions.ts\" />\n/// <reference path=\"./dev-protocol.d.ts\" />\n\ntype HotModuleFactoryFunction = ModuleFactoryFunction<\n  HotModule,\n  TurbopackBaseContext<HotModule>\n>\n\n/**\n * Shared HMR (Hot Module Replacement) implementation.\n *\n * This file contains the complete HMR implementation that's shared between\n * browser and Node.js runtimes. It manages module hot state, dependency\n * tracking, the module.hot API, and the full HMR update flow.\n */\n\n/**\n * The development module cache shared across the runtime.\n * Browser runtime declares this directly.\n * Node.js runtime assigns globalThis.__turbopack_module_cache__ to this.\n */\nlet devModuleCache: Record<ModuleId, any>\n\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nlet runtimeModules: Set<ModuleId>\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map<ModuleId, HotData> = new Map()\n\n/**\n * Maps module instances to their hot module state.\n * Uses WeakMap so it works with both HotModule and ModuleWithDirection.\n */\nconst moduleHotState: WeakMap<any, HotState> = new WeakMap()\n\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set<ModuleId> = new Set()\n\nclass UpdateApplyError extends Error {\n  name = 'UpdateApplyError'\n\n  dependencyChain: ModuleId[]\n\n  constructor(message: string, dependencyChain: ModuleId[]) {\n    super(message)\n    this.dependencyChain = dependencyChain\n  }\n}\n\ntype ModuleEffect =\n  | {\n      type: 'unaccepted'\n      dependencyChain: ModuleId[]\n    }\n  | {\n      type: 'self-declined'\n      dependencyChain: ModuleId[]\n      moduleId: ModuleId\n    }\n  | {\n      type: 'accepted'\n      moduleId: ModuleId\n      outdatedModules: Set<ModuleId>\n    }\n\n/**\n * Records parent-child relationship when a module imports another.\n * Should be called during module instantiation.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction trackModuleImport(\n  parentModule: ModuleWithDirection,\n  childModuleId: ModuleId,\n  childModule: ModuleWithDirection | undefined\n): void {\n  // Record that parent imports child\n  if (parentModule.children.indexOf(childModuleId) === -1) {\n    parentModule.children.push(childModuleId)\n  }\n\n  // Record that child is imported by parent\n  if (childModule && childModule.parents.indexOf(parentModule.id) === -1) {\n    childModule.parents.push(parentModule.id)\n  }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n  return `Dependency chain: ${dependencyChain.join(' -> ')}`\n}\n\n/**\n * Walks the dependency tree to find all modules affected by a change.\n * Returns information about whether the update can be accepted and which\n * modules need to be invalidated.\n *\n * @param moduleId - The module that changed\n * @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept().\n *                           This is used for server-side HMR where pages auto-accept at the top level.\n */\nfunction getAffectedModuleEffects(\n  moduleId: ModuleId,\n  autoAcceptRootModules: boolean\n): ModuleEffect {\n  const outdatedModules: Set<ModuleId> = new Set()\n\n  type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] }\n\n  const queue: QueueItem[] = [\n    {\n      moduleId,\n      dependencyChain: [],\n    },\n  ]\n\n  let nextItem\n  while ((nextItem = queue.shift())) {\n    const { moduleId, dependencyChain } = nextItem\n\n    if (moduleId != null) {\n      if (outdatedModules.has(moduleId)) {\n        // Avoid infinite loops caused by cycles between modules in the dependency chain.\n        continue\n      }\n\n      outdatedModules.add(moduleId)\n    }\n\n    // We've arrived at the runtime of the chunk, which means that nothing\n    // else above can accept this update.\n    if (moduleId === undefined) {\n      if (autoAcceptRootModules) {\n        return {\n          type: 'accepted',\n          moduleId,\n          outdatedModules,\n        }\n      }\n      return {\n        type: 'unaccepted',\n        dependencyChain,\n      }\n    }\n\n    const module = devModuleCache[moduleId]\n    const hotState = moduleHotState.get(module)!\n\n    if (\n      // The module is not in the cache. Since this is a \"modified\" update,\n      // it means that the module was never instantiated before.\n      !module || // The module accepted itself without invalidating globalThis.\n      // TODO is that right?\n      (hotState.selfAccepted && !hotState.selfInvalidated)\n    ) {\n      continue\n    }\n\n    if (hotState.selfDeclined) {\n      return {\n        type: 'self-declined',\n        dependencyChain,\n        moduleId,\n      }\n    }\n\n    if (runtimeModules.has(moduleId)) {\n      if (autoAcceptRootModules) {\n        continue\n      }\n      queue.push({\n        moduleId: undefined,\n        dependencyChain: [...dependencyChain, moduleId],\n      })\n      continue\n    }\n\n    for (const parentId of module.parents) {\n      const parent = devModuleCache[parentId]\n\n      if (!parent) {\n        // TODO(alexkirsz) Is this even possible?\n        continue\n      }\n\n      // TODO(alexkirsz) Dependencies: check accepted and declined\n      // dependencies here.\n\n      queue.push({\n        moduleId: parentId,\n        dependencyChain: [...dependencyChain, moduleId],\n      })\n    }\n\n    // If no parents and we're at a root module, auto-accept if configured\n    if (module.parents.length === 0 && autoAcceptRootModules) {\n      continue\n    }\n  }\n\n  return {\n    type: 'accepted',\n    moduleId,\n    outdatedModules,\n  }\n}\n\n/**\n * Computes all modules that need to be invalidated based on which modules changed.\n *\n * @param invalidated - The modules that have been invalidated\n * @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept()\n */\nfunction computedInvalidatedModules(\n  invalidated: Iterable<ModuleId>,\n  autoAcceptRootModules: boolean\n): Set<ModuleId> {\n  const outdatedModules = new Set<ModuleId>()\n\n  for (const moduleId of invalidated) {\n    const effect = getAffectedModuleEffects(moduleId, autoAcceptRootModules)\n\n    switch (effect.type) {\n      case 'unaccepted':\n        throw new UpdateApplyError(\n          `cannot apply update: unaccepted module. ${formatDependencyChain(\n            effect.dependencyChain\n          )}.`,\n          effect.dependencyChain\n        )\n      case 'self-declined':\n        throw new UpdateApplyError(\n          `cannot apply update: self-declined module. ${formatDependencyChain(\n            effect.dependencyChain\n          )}.`,\n          effect.dependencyChain\n        )\n      case 'accepted':\n        for (const outdatedModuleId of effect.outdatedModules) {\n          outdatedModules.add(outdatedModuleId)\n        }\n        break\n      // TODO(alexkirsz) Dependencies: handle dependencies effects.\n      default:\n        invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`)\n    }\n  }\n\n  return outdatedModules\n}\n\n/**\n * Creates the module.hot API object and its internal state.\n * This provides the HMR API that user code calls (module.hot.accept(), etc.)\n */\n\nfunction createModuleHot(\n  moduleId: ModuleId,\n  hotData: HotData\n): { hot: Hot; hotState: HotState } {\n  const hotState: HotState = {\n    selfAccepted: false,\n    selfDeclined: false,\n    selfInvalidated: false,\n    disposeHandlers: [],\n  }\n\n  const hot: Hot = {\n    // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n    // decide whether to warn whenever an HMR-disposed module required other\n    // modules. We might want to remove it.\n    active: true,\n\n    data: hotData ?? {},\n\n    // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n    accept: (\n      modules?: string | string[] | AcceptErrorHandler,\n      _callback?: AcceptCallback,\n      _errorHandler?: AcceptErrorHandler\n    ) => {\n      if (modules === undefined) {\n        hotState.selfAccepted = true\n      } else if (typeof modules === 'function') {\n        hotState.selfAccepted = modules\n      } else {\n        throw new Error('unsupported `accept` signature')\n      }\n    },\n\n    decline: (dep) => {\n      if (dep === undefined) {\n        hotState.selfDeclined = true\n      } else {\n        throw new Error('unsupported `decline` signature')\n      }\n    },\n\n    dispose: (callback) => {\n      hotState.disposeHandlers.push(callback)\n    },\n\n    addDisposeHandler: (callback) => {\n      hotState.disposeHandlers.push(callback)\n    },\n\n    removeDisposeHandler: (callback) => {\n      const idx = hotState.disposeHandlers.indexOf(callback)\n      if (idx >= 0) {\n        hotState.disposeHandlers.splice(idx, 1)\n      }\n    },\n\n    invalidate: () => {\n      hotState.selfInvalidated = true\n      queuedInvalidatedModules.add(moduleId)\n    },\n\n    // NOTE(alexkirsz) This is part of the management API, which we don't\n    // implement, but the Next.js React Refresh runtime uses this to decide\n    // whether to schedule an update.\n    status: () => 'idle',\n\n    // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n    addStatusHandler: (_handler) => {},\n    removeStatusHandler: (_handler) => {},\n\n    // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n    // want the webpack code paths to ever update (the turbopack paths handle\n    // this already).\n    check: () => Promise.resolve(null),\n  }\n\n  return { hot, hotState }\n}\n\n/**\n * Processes queued invalidated modules and adds them to the outdated modules set.\n * Modules that call module.hot.invalidate() are queued and processed here.\n *\n * @param outdatedModules - The current set of outdated modules\n * @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept()\n */\nfunction applyInvalidatedModules(\n  outdatedModules: Set<ModuleId>,\n  autoAcceptRootModules: boolean\n): Set<ModuleId> {\n  if (queuedInvalidatedModules.size > 0) {\n    computedInvalidatedModules(\n      queuedInvalidatedModules,\n      autoAcceptRootModules\n    ).forEach((moduleId) => {\n      outdatedModules.add(moduleId)\n    })\n\n    queuedInvalidatedModules.clear()\n  }\n\n  return outdatedModules\n}\n\n/**\n * Computes which outdated modules have self-accepted and can be hot reloaded.\n */\n\nfunction computeOutdatedSelfAcceptedModules(\n  outdatedModules: Iterable<ModuleId>\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n  const outdatedSelfAcceptedModules: {\n    moduleId: ModuleId\n    errorHandler: true | Function\n  }[] = []\n  for (const moduleId of outdatedModules) {\n    const module = devModuleCache[moduleId]\n    const hotState = moduleHotState.get(module)\n    if (module && hotState?.selfAccepted && !hotState.selfInvalidated) {\n      outdatedSelfAcceptedModules.push({\n        moduleId,\n        errorHandler: hotState.selfAccepted,\n      })\n    }\n  }\n  return outdatedSelfAcceptedModules\n}\n\n/**\n * Disposes of an instance of a module.\n * Runs hot.dispose handlers and manages persistent hot data.\n *\n * NOTE: mode = \"replace\" will not remove modules from devModuleCache.\n * This must be done in a separate step afterwards.\n */\nfunction disposeModule(moduleId: ModuleId, mode: 'clear' | 'replace') {\n  const module = devModuleCache[moduleId]\n  if (!module) {\n    return\n  }\n\n  const hotState = moduleHotState.get(module)\n  if (!hotState) {\n    return\n  }\n\n  const data: HotData = {}\n\n  // Run the `hot.dispose` handler, if any, passing in the persistent\n  // `hot.data` object.\n  for (const disposeHandler of hotState.disposeHandlers) {\n    disposeHandler(data)\n  }\n\n  // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n  // module is still importing other modules.\n  if (module.hot) {\n    module.hot.active = false\n  }\n\n  moduleHotState.delete(module)\n\n  // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n  // Remove the disposed module from its children's parent list.\n  // It will be added back once the module re-instantiates and imports its\n  // children again.\n  for (const childId of module.children) {\n    const child = devModuleCache[childId]\n    if (!child) {\n      continue\n    }\n\n    const idx = child.parents.indexOf(module.id)\n    if (idx >= 0) {\n      child.parents.splice(idx, 1)\n    }\n  }\n\n  switch (mode) {\n    case 'clear':\n      delete devModuleCache[module.id]\n      moduleHotData.delete(module.id)\n      break\n    case 'replace':\n      moduleHotData.set(module.id, data)\n      break\n    default:\n      invariant(mode, (mode) => `invalid mode: ${mode}`)\n  }\n}\n\n/**\n * Dispose phase: runs dispose handlers and cleans up outdated/disposed modules.\n * Returns the parent modules of outdated modules for use in the apply phase.\n */\n\nfunction disposePhase(\n  outdatedModules: Iterable<ModuleId>,\n  disposedModules: Iterable<ModuleId>\n): { outdatedModuleParents: Map<ModuleId, Array<ModuleId>> } {\n  for (const moduleId of outdatedModules) {\n    disposeModule(moduleId, 'replace')\n  }\n\n  for (const moduleId of disposedModules) {\n    disposeModule(moduleId, 'clear')\n  }\n\n  // Removing modules from the module cache is a separate step.\n  // We also want to keep track of previous parents of the outdated modules.\n  const outdatedModuleParents = new Map<ModuleId, Array<ModuleId>>()\n  for (const moduleId of outdatedModules) {\n    const oldModule = devModuleCache[moduleId]\n    outdatedModuleParents.set(moduleId, oldModule?.parents)\n    delete devModuleCache[moduleId]\n  }\n\n  // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n  // children.\n\n  return { outdatedModuleParents }\n}\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/**\n * Shared module instantiation logic.\n * This handles the full module instantiation flow for both browser and Node.js.\n * Only React Refresh hooks differ between platforms (passed as callback).\n */\nfunction instantiateModuleShared(\n  moduleId: ModuleId,\n  sourceType: SourceType,\n  sourceData: SourceData,\n  moduleFactories: ModuleFactories,\n  devModuleCache: ModuleCache<HotModule>,\n  runtimeModules: Set<ModuleId>,\n  createModuleObjectFn: (id: ModuleId) => HotModule,\n  createContextFn: (module: HotModule, exports: Exports, refresh?: any) => any,\n  runModuleExecutionHooksFn: (\n    module: HotModule,\n    exec: (refresh: any) => void\n  ) => void\n): HotModule {\n  // 1. Factory validation (same in both browser and Node.js)\n  const id = moduleId as string\n  const moduleFactory = moduleFactories.get(id)\n  if (typeof moduleFactory !== 'function') {\n    throw new Error(\n      factoryNotAvailableMessage(moduleId, sourceType, sourceData) +\n        `\\nThis is often caused by a stale browser cache, misconfigured Cache-Control headers, or a service worker serving outdated responses.` +\n        `\\nTo fix this, make sure your Cache-Control headers allow revalidation of chunks and review your service worker configuration. ` +\n        `As an immediate workaround, try hard-reloading the page, clearing the browser cache, or unregistering any service workers.`\n    )\n  }\n\n  // 2. Hot API setup (same in both - works for browser, included for Node.js)\n  const hotData = moduleHotData.get(id)!\n  const { hot, hotState } = createModuleHot(id, hotData)\n\n  // 3. Parent assignment logic (same in both)\n  let parents: ModuleId[]\n  switch (sourceType) {\n    case SourceType.Runtime:\n      runtimeModules.add(id)\n      parents = []\n      break\n    case SourceType.Parent:\n      parents = [sourceData as ModuleId]\n      break\n    case SourceType.Update:\n      parents = (sourceData as ModuleId[]) || []\n      break\n    default:\n      throw new Error(`Unknown source type: ${sourceType}`)\n  }\n\n  // 4. Module creation (platform creates base module object)\n  const module = createModuleObjectFn(id)\n  const exports = module.exports\n  module.parents = parents\n  module.children = []\n  module.hot = hot\n\n  devModuleCache[id] = module\n  moduleHotState.set(module, hotState)\n\n  // 5. Module execution (React Refresh hooks are platform-specific)\n  try {\n    runModuleExecutionHooksFn(module, (refresh) => {\n      const context = createContextFn(module, exports, refresh)\n      moduleFactory.call(exports, context, module, exports)\n    })\n  } catch (error) {\n    module.error = error as any\n    throw error\n  }\n\n  // 6. ESM interop (same in both)\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/**\n * Analyzes update entries and chunks to determine which modules were added, modified, or deleted.\n * This is pure logic that doesn't depend on the runtime environment.\n */\nfunction computeChangedModules(\n  entries: Record<ModuleId, EcmascriptModuleEntry>,\n  updates: Record<ChunkPath, EcmascriptMergedChunkUpdate>,\n  chunkModulesMap?: Map<ChunkPath, Set<ModuleId>>\n): {\n  added: Map<ModuleId, EcmascriptModuleEntry | undefined>\n  modified: Map<ModuleId, EcmascriptModuleEntry>\n  deleted: Set<ModuleId>\n  chunksAdded: Map<ChunkPath, Set<ModuleId>>\n  chunksDeleted: Map<ChunkPath, Set<ModuleId>>\n} {\n  const chunksAdded = new Map()\n  const chunksDeleted = new Map()\n  const added: Map<ModuleId, EcmascriptModuleEntry> = new Map()\n  const modified = new Map()\n  const deleted: Set<ModuleId> = new Set()\n\n  for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates) as Array<\n    [ChunkPath, EcmascriptMergedChunkUpdate]\n  >) {\n    switch (mergedChunkUpdate.type) {\n      case 'added': {\n        const updateAdded = new Set(mergedChunkUpdate.modules)\n        for (const moduleId of updateAdded) {\n          added.set(moduleId, entries[moduleId])\n        }\n        chunksAdded.set(chunkPath, updateAdded)\n        break\n      }\n      case 'deleted': {\n        const updateDeleted = chunkModulesMap\n          ? new Set(chunkModulesMap.get(chunkPath))\n          : new Set<ModuleId>()\n        for (const moduleId of updateDeleted) {\n          deleted.add(moduleId)\n        }\n        chunksDeleted.set(chunkPath, updateDeleted)\n        break\n      }\n      case 'partial': {\n        const updateAdded = new Set(mergedChunkUpdate.added)\n        const updateDeleted = new Set(mergedChunkUpdate.deleted)\n        for (const moduleId of updateAdded) {\n          added.set(moduleId, entries[moduleId])\n        }\n        for (const moduleId of updateDeleted) {\n          deleted.add(moduleId)\n        }\n        chunksAdded.set(chunkPath, updateAdded)\n        chunksDeleted.set(chunkPath, updateDeleted)\n        break\n      }\n      default:\n        throw new Error('Unknown merged chunk update type')\n    }\n  }\n\n  // If a module was added from one chunk and deleted from another in the same update,\n  // consider it to be modified, as it means the module was moved from one chunk to another\n  // AND has new code in a single update.\n  for (const moduleId of added.keys()) {\n    if (deleted.has(moduleId)) {\n      added.delete(moduleId)\n      deleted.delete(moduleId)\n    }\n  }\n\n  for (const [moduleId, entry] of Object.entries(entries)) {\n    // Modules that haven't been added to any chunk but have new code are considered\n    // to be modified.\n    // This needs to be under the previous loop, as we need it to get rid of modules\n    // that were added and deleted in the same update.\n    if (!added.has(moduleId)) {\n      modified.set(moduleId, entry)\n    }\n  }\n\n  return { added, deleted, modified, chunksAdded, chunksDeleted }\n}\n\n/**\n * Compiles new module code and walks the dependency tree to find all outdated modules.\n * Uses the evalModuleEntry function to compile code (platform-specific).\n *\n * @param added - Map of added modules\n * @param modified - Map of modified modules\n * @param evalModuleEntry - Function to compile module code\n * @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept()\n */\nfunction computeOutdatedModules(\n  added: Map<ModuleId, EcmascriptModuleEntry | undefined>,\n  modified: Map<ModuleId, EcmascriptModuleEntry>,\n  evalModuleEntry: (entry: EcmascriptModuleEntry) => HotModuleFactoryFunction,\n  autoAcceptRootModules: boolean\n): {\n  outdatedModules: Set<ModuleId>\n  newModuleFactories: Map<ModuleId, HotModuleFactoryFunction>\n} {\n  const newModuleFactories = new Map<ModuleId, HotModuleFactoryFunction>()\n\n  // Compile added modules\n  for (const [moduleId, entry] of added) {\n    if (entry != null) {\n      newModuleFactories.set(moduleId, evalModuleEntry(entry))\n    }\n  }\n\n  // Walk dependency tree to find all modules affected by modifications\n  const outdatedModules = computedInvalidatedModules(\n    modified.keys(),\n    autoAcceptRootModules\n  )\n\n  // Compile modified modules\n  for (const [moduleId, entry] of modified) {\n    newModuleFactories.set(moduleId, evalModuleEntry(entry))\n  }\n\n  return { outdatedModules, newModuleFactories }\n}\n\n/**\n * Updates module factories and re-instantiates self-accepted modules.\n * Uses the instantiateModule function (platform-specific via callback).\n */\nfunction applyPhase(\n  outdatedSelfAcceptedModules: {\n    moduleId: ModuleId\n    errorHandler: true | Function\n  }[],\n  newModuleFactories: Map<ModuleId, HotModuleFactoryFunction>,\n  outdatedModuleParents: Map<ModuleId, Array<ModuleId>>,\n  moduleFactories: ModuleFactories,\n  devModuleCache: ModuleCache<HotModule>,\n  instantiateModuleFn: (\n    moduleId: ModuleId,\n    sourceType: SourceType,\n    sourceData: SourceData\n  ) => HotModule,\n  applyModuleFactoryNameFn: (factory: HotModuleFactoryFunction) => void,\n  reportError: (err: any) => void\n) {\n  // Update module factories\n  for (const [moduleId, factory] of newModuleFactories.entries()) {\n    applyModuleFactoryNameFn(factory)\n    moduleFactories.set(moduleId, factory)\n  }\n\n  // TODO(alexkirsz) Run new runtime entries here.\n\n  // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n  // Re-instantiate all outdated self-accepted modules\n  for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n    try {\n      instantiateModuleFn(\n        moduleId,\n        SourceType.Update,\n        outdatedModuleParents.get(moduleId)\n      )\n    } catch (err) {\n      if (typeof errorHandler === 'function') {\n        try {\n          errorHandler(err, { moduleId, module: devModuleCache[moduleId] })\n        } catch (err2) {\n          reportError(err2)\n          reportError(err)\n        }\n      } else {\n        reportError(err)\n      }\n    }\n  }\n}\n\n/**\n * Internal implementation that orchestrates the full HMR update flow:\n * invalidation, disposal, and application of new modules.\n *\n * @param autoAcceptRootModules - If true, root modules auto-accept updates without explicit module.hot.accept()\n */\nfunction applyInternal(\n  outdatedModules: Set<ModuleId>,\n  disposedModules: Iterable<ModuleId>,\n  newModuleFactories: Map<ModuleId, HotModuleFactoryFunction>,\n  moduleFactories: ModuleFactories,\n  devModuleCache: ModuleCache<HotModule>,\n  instantiateModuleFn: (\n    moduleId: ModuleId,\n    sourceType: SourceType,\n    sourceData: SourceData\n  ) => HotModule,\n  applyModuleFactoryNameFn: (factory: HotModuleFactoryFunction) => void,\n  autoAcceptRootModules: boolean\n) {\n  outdatedModules = applyInvalidatedModules(\n    outdatedModules,\n    autoAcceptRootModules\n  )\n\n  // Find self-accepted modules to re-instantiate\n  const outdatedSelfAcceptedModules =\n    computeOutdatedSelfAcceptedModules(outdatedModules)\n\n  // Run dispose handlers, save hot.data, clear caches\n  const { outdatedModuleParents } = disposePhase(\n    outdatedModules,\n    disposedModules\n  )\n\n  let error: any\n\n  function reportError(err: any) {\n    if (!error) error = err // Keep first error\n  }\n\n  applyPhase(\n    outdatedSelfAcceptedModules,\n    newModuleFactories,\n    outdatedModuleParents,\n    moduleFactories,\n    devModuleCache,\n    instantiateModuleFn,\n    applyModuleFactoryNameFn,\n    reportError\n  )\n\n  if (error) {\n    throw error\n  }\n\n  // Recursively apply any queued invalidations from new module execution\n  if (queuedInvalidatedModules.size > 0) {\n    applyInternal(\n      new Set(),\n      [],\n      new Map(),\n      moduleFactories,\n      devModuleCache,\n      instantiateModuleFn,\n      applyModuleFactoryNameFn,\n      autoAcceptRootModules\n    )\n  }\n}\n\n/**\n * Main entry point for applying an ECMAScript merged update.\n * This is called by both browser and Node.js runtimes with platform-specific callbacks.\n *\n * @param options.autoAcceptRootModules - If true, root modules auto-accept updates without explicit\n *                                   module.hot.accept(). Used for server-side HMR where pages\n *                                   auto-accept at the top level.\n */\nfunction applyEcmascriptMergedUpdateShared(options: {\n  added: Map<ModuleId, EcmascriptModuleEntry | undefined>\n  modified: Map<ModuleId, EcmascriptModuleEntry>\n  disposedModules: Iterable<ModuleId>\n  evalModuleEntry: (entry: EcmascriptModuleEntry) => HotModuleFactoryFunction\n  instantiateModule: (\n    moduleId: ModuleId,\n    sourceType: SourceType,\n    sourceData: SourceData\n  ) => HotModule\n  applyModuleFactoryName: (factory: HotModuleFactoryFunction) => void\n  moduleFactories: ModuleFactories\n  devModuleCache: ModuleCache<HotModule>\n  autoAcceptRootModules: boolean\n}) {\n  const {\n    added,\n    modified,\n    disposedModules,\n    evalModuleEntry,\n    instantiateModule,\n    applyModuleFactoryName,\n    moduleFactories,\n    devModuleCache,\n    autoAcceptRootModules,\n  } = options\n\n  const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n    added,\n    modified,\n    evalModuleEntry,\n    autoAcceptRootModules\n  )\n\n  applyInternal(\n    outdatedModules,\n    disposedModules,\n    newModuleFactories,\n    moduleFactories,\n    devModuleCache,\n    instantiateModule,\n    applyModuleFactoryName,\n    autoAcceptRootModules\n  )\n}\n"],"names":["devModuleCache","runtimeModules","moduleHotData","Map","moduleHotState","WeakMap","queuedInvalidatedModules","Set","UpdateApplyError","Error","name","dependencyChain","message","trackModuleImport","parentModule","childModuleId","childModule","children","indexOf","push","parents","id","formatDependencyChain","join","getAffectedModuleEffects","moduleId","autoAcceptRootModules","outdatedModules","queue","nextItem","shift","has","add","undefined","type","module","hotState","get","selfAccepted","selfInvalidated","selfDeclined","parentId","parent","length","computedInvalidatedModules","invalidated","effect","outdatedModuleId","invariant","createModuleHot","hotData","disposeHandlers","hot","active","data","accept","modules","_callback","_errorHandler","decline","dep","dispose","callback","addDisposeHandler","removeDisposeHandler","idx","splice","invalidate","status","addStatusHandler","_handler","removeStatusHandler","check","Promise","resolve","applyInvalidatedModules","size","forEach","clear","computeOutdatedSelfAcceptedModules","outdatedSelfAcceptedModules","errorHandler","disposeModule","mode","disposeHandler","delete","childId","child","set","disposePhase","disposedModules","outdatedModuleParents","oldModule","instantiateModuleShared","sourceType","sourceData","moduleFactories","createModuleObjectFn","createContextFn","runModuleExecutionHooksFn","moduleFactory","factoryNotAvailableMessage","SourceType","Runtime","Parent","Update","exports","refresh","context","call","error","namespaceObject","interopEsm","computeChangedModules","entries","updates","chunkModulesMap","chunksAdded","chunksDeleted","added","modified","deleted","chunkPath","mergedChunkUpdate","Object","updateAdded","updateDeleted","keys","entry","computeOutdatedModules","evalModuleEntry","newModuleFactories","applyPhase","instantiateModuleFn","applyModuleFactoryNameFn","reportError","factory","err","err2","applyInternal","applyEcmascriptMergedUpdateShared","options","instantiate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BC,kBAAkBgD,wBAChBhD,iBACAD;IAGF,+CAA+C;IAC/C,MAAMsD,8BACJD,mCAAmCpD;IAErC,oDAAoD;IACpD,MAAM,EAAEgE,qBAAqB,EAAE,GAAGF,aAChC9D,iBACA+D;IAGF,IAAIoB;IAEJ,SAASyB,YAAYE,GAAQ;QAC3B,IAAI,CAAC3B,OAAOA,QAAQ2B,KAAI,mBAAmB;IAC7C;IAEAL,WACEpD,6BACAmD,oBACAxC,uBACAK,iBACAhG,gBACAqI,qBACAC,0BACAC;IAGF,IAAIzB,OAAO;QACT,MAAMA;IACR;IAEA,uEAAuE;IACvE,IAAIxG,yBAAyBsE,IAAI,GAAG,GAAG;QACrC+D,cACE,IAAIpI,OACJ,EAAE,EACF,IAAIJ,OACJ6F,iBACAhG,gBACAqI,qBACAC,0BACA5G;IAEJ;AACF;AAEA;;;;;;;CAOC,GACD,SAASkH,kCAAkCC,OAc1C;IACC,MAAM,EACJtB,KAAK,EACLC,QAAQ,EACR9B,eAAe,EACfwC,eAAe,EACfY,iBAAiB,EACjBC,sBAAsB,EACtB/C,eAAe,EACfhG,cAAc,EACd0B,qBAAqB,EACtB,GAAGmH;IAEJ,MAAM,EAAElH,eAAe,EAAEwG,kBAAkB,EAAE,GAAGF,uBAC9CV,OACAC,UACAU,iBACAxG;IAGFiH,cACEhH,iBACA+D,iBACAyC,oBACAnC,iBACAhG,gBACA8I,mBACAC,wBACArH;AAEJ","ignoreList":[0]}},
     {"offset": {"line": 1382, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime/dev-base.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// <reference path=\"./runtime-base.ts\" />\n/// <reference path=\"../../shared/runtime/dev-extensions.ts\" />\n/// <reference path=\"../../shared/runtime/hmr-runtime.ts\" />\n\n/**\n * Development Node.js runtime.\n * Uses HotModule and shared HMR logic for hot module replacement support.\n */\n\n// Cast the module cache to HotModule for development mode\n// (hmr-runtime.ts declares devModuleCache as `let` variable expecting assignment)\n// This is safe because HotModule extends Module\ndevModuleCache = moduleCache as ModuleCache<HotModule>\n\n// this is read in runtime-utils.ts so it creates a module with direction for hmr\ncreateModuleWithDirectionFlag = true\n\nif (!globalThis.__turbopack_runtime_modules__) {\n  globalThis.__turbopack_runtime_modules__ = new Set()\n}\nruntimeModules = globalThis.__turbopack_runtime_modules__\n\ninterface TurbopackNodeDevBuildContext extends TurbopackBaseContext<HotModule> {\n  R: ResolvePathFromModule\n  x: ExternalRequire\n  y: ExternalImport\n  C: typeof clearChunkCache\n}\n\nconst nodeDevContextPrototype =\n  Context.prototype as TurbopackNodeDevBuildContext\n\nnodeDevContextPrototype.q = exportUrl\nnodeDevContextPrototype.M = moduleFactories\nnodeDevContextPrototype.c = devModuleCache\nnodeDevContextPrototype.R = resolvePathFromModule\nnodeDevContextPrototype.b = createWorker\nnodeDevContextPrototype.C = clearChunkCache\n\n/**\n * Instantiates a module in development mode using shared HMR logic.\n */\nfunction instantiateModule(\n  id: ModuleId,\n  sourceType: SourceType,\n  sourceData: SourceData\n): HotModule {\n  // Node.js: creates base module object (hot API added by shared code)\n  const createModuleObjectFn = (moduleId: ModuleId) => {\n    return createModuleWithDirection(moduleId) as HotModule\n  }\n\n  // Node.js: creates Context (no refresh parameter)\n  const createContext = (\n    module: HotModule,\n    exports: Exports,\n    _refresh?: any\n  ) => {\n    return new (Context as any as ContextConstructor<HotModule>)(\n      module,\n      exports\n    )\n  }\n\n  // Node.js: no hooks wrapper, just execute directly\n  const runWithHooks = (module: HotModule, exec: (refresh: any) => void) => {\n    exec(undefined) // no refresh context\n  }\n\n  // Use shared instantiation logic (includes hot API setup)\n  const newModule = instantiateModuleShared(\n    id,\n    sourceType,\n    sourceData,\n    moduleFactories,\n    devModuleCache,\n    runtimeModules,\n    createModuleObjectFn,\n    createContext,\n    runWithHooks\n  )\n\n  // Node.js-specific: mark module as loaded\n  ;(newModule as any).loaded = true\n\n  return newModule\n}\n\n/**\n * Instantiates a runtime module in development mode.\n */\nfunction instantiateRuntimeModule(\n  chunkPath: ChunkPath,\n  moduleId: ModuleId\n): HotModule {\n  return instantiateModule(moduleId, SourceType.Runtime, chunkPath)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n  chunkPath: ChunkPath,\n  moduleId: ModuleId\n): HotModule {\n  const module = devModuleCache[moduleId]\n\n  if (module) {\n    if (module.error) {\n      throw module.error\n    }\n    return module\n  }\n\n  return instantiateRuntimeModule(chunkPath, moduleId)\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n * Also tracks parent-child relationships for HMR dependency tracking.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n  id: ModuleId,\n  sourceModule: HotModule\n): HotModule {\n  // Track parent-child relationship\n  trackModuleImport(sourceModule, id, devModuleCache[id])\n\n  const module = devModuleCache[id]\n\n  if (module) {\n    if (module.error) {\n      throw module.error\n    }\n\n    return module\n  }\n\n  const newModule = instantiateModule(id, SourceType.Parent, sourceModule.id)\n\n  // Track again after instantiation to ensure the relationship is recorded\n  trackModuleImport(sourceModule, id, newModule)\n\n  return newModule\n}\n\nmodule.exports = (sourcePath: ChunkPath) => ({\n  m: (id: ModuleId) => getOrInstantiateRuntimeModule(sourcePath, id),\n  c: (chunkData: ChunkData) => loadRuntimeChunk(sourcePath, chunkData),\n})\n"],"names":["devModuleCache","moduleCache","createModuleWithDirectionFlag","globalThis","__turbopack_runtime_modules__","Set","runtimeModules","nodeDevContextPrototype","Context","prototype","q","exportUrl","M","moduleFactories","c","R","resolvePathFromModule","b","createWorker","C","clearChunkCache","instantiateModule","id","sourceType","sourceData","createModuleObjectFn","moduleId","createModuleWithDirection","createContext","module1","exports","_refresh","runWithHooks","exec","undefined","newModule","instantiateModuleShared","loaded","instantiateRuntimeModule","chunkPath","SourceType","Runtime","getOrInstantiateRuntimeModule","error","getOrInstantiateModuleFromParent","sourceModule","trackModuleImport","Parent","module","sourcePath","m","chunkData","loadRuntimeChunk"],"mappings":"AAAA,oDAAoD,GAEpD,0CAA0C;AAC1C,+DAA+D;AAC/D,4DAA4D;AAE5D;;;CAGC,GAED,0DAA0D;AAC1D,kFAAkF;AAClF,gDAAgD;AAChDA,iBAAiBC;AAEjB,iFAAiF;AACjFC,gCAAgC;AAEhC,IAAI,CAACC,WAAWC,6BAA6B,EAAE;IAC7CD,WAAWC,6BAA6B,GAAG,IAAIC;AACjD;AACAC,iBAAiBH,WAAWC,6BAA6B;AASzD,MAAMG,0BACJC,QAAQC,SAAS;AAEnBF,wBAAwBG,CAAC,GAAGC;AAC5BJ,wBAAwBK,CAAC,GAAGC;AAC5BN,wBAAwBO,CAAC,GAAGd;AAC5BO,wBAAwBQ,CAAC,GAAGC;AAC5BT,wBAAwBU,CAAC,GAAGC;AAC5BX,wBAAwBY,CAAC,GAAGC;AAE5B;;CAEC,GACD,SAASC,kBACPC,EAAY,EACZC,UAAsB,EACtBC,UAAsB;IAEtB,qEAAqE;IACrE,MAAMC,uBAAuB,CAACC;QAC5B,OAAOC,0BAA0BD;IACnC;IAEA,kDAAkD;IAClD,MAAME,gBAAgB,CACpBC,SACAC,SACAC;QAEA,OAAO,IAAKvB,QACVqB,SACAC;IAEJ;IAEA,mDAAmD;IACnD,MAAME,eAAe,CAACH,SAAmBI;QACvCA,KAAKC,YAAW,qBAAqB;IACvC;IAEA,0DAA0D;IAC1D,MAAMC,YAAYC,wBAChBd,IACAC,YACAC,YACAX,iBACAb,gBACAM,gBACAmB,sBACAG,eACAI;IAIAG,UAAkBE,MAAM,GAAG;IAE7B,OAAOF;AACT;AAEA;;CAEC,GACD,SAASG,yBACPC,SAAoB,EACpBb,QAAkB;IAElB,OAAOL,kBAAkBK,UAAUc,WAAWC,OAAO,EAAEF;AACzD;AAEA;;CAEC,GACD,oFAAoF;AACpF,SAASG,8BACPH,SAAoB,EACpBb,QAAkB;IAElB,MAAMG,UAAS7B,cAAc,CAAC0B,SAAS;IAEvC,IAAIG,SAAQ;QACV,IAAIA,QAAOc,KAAK,EAAE;YAChB,MAAMd,QAAOc,KAAK;QACpB;QACA,OAAOd;IACT;IAEA,OAAOS,yBAAyBC,WAAWb;AAC7C;AAEA;;;CAGC,GACD,aAAa;AACb,SAASkB,iCACPtB,EAAY,EACZuB,YAAuB;IAEvB,kCAAkC;IAClCC,kBAAkBD,cAAcvB,IAAItB,cAAc,CAACsB,GAAG;IAEtD,MAAMO,UAAS7B,cAAc,CAACsB,GAAG;IAEjC,IAAIO,SAAQ;QACV,IAAIA,QAAOc,KAAK,EAAE;YAChB,MAAMd,QAAOc,KAAK;QACpB;QAEA,OAAOd;IACT;IAEA,MAAMM,YAAYd,kBAAkBC,IAAIkB,WAAWO,MAAM,EAAEF,aAAavB,EAAE;IAE1E,yEAAyE;IACzEwB,kBAAkBD,cAAcvB,IAAIa;IAEpC,OAAOA;AACT;AAEAa,OAAOlB,OAAO,GAAG,CAACmB,aAA0B,CAAC;QAC3CC,GAAG,CAAC5B,KAAiBoB,8BAA8BO,YAAY3B;QAC/DR,GAAG,CAACqC,YAAyBC,iBAAiBH,YAAYE;IAC5D,CAAC","ignoreList":[0]}},
-    {"offset": {"line": 1466, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/dev/hmr-client.ts"],"sourcesContent":["/// <reference path=\"../../shared/runtime/dev-protocol.d.ts\" />\n/// <reference path=\"../../shared/runtime/hmr-runtime.ts\" />\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\ntype NodeJsHmrPayload = {\n  resource: {\n    path: string\n    headers?: Record<string, string>\n  }\n  issues: Issue[]\n  type: 'partial'\n  instruction: EcmascriptMergedUpdate\n}\n\nlet serverHmrUpdateHandler: ((msg: NodeJsHmrPayload) => void) | null = null\n\nfunction initializeServerHmr(\n  moduleFactories: ModuleFactories,\n  devModuleCache: ModuleCache<HotModule>\n): void {\n  if (serverHmrUpdateHandler != null) {\n    throw new Error('[Server HMR] Server HMR client is already initialized')\n  }\n\n  // Register the update handler for the server runtime\n  serverHmrUpdateHandler = (msg: NodeJsHmrPayload) => {\n    handleNodejsUpdate(msg, moduleFactories, devModuleCache)\n  }\n}\n\n/**\n * Emits an HMR message to the registered update handler.\n * Node uses a simpler listener pattern than the browser's websocket connection.\n *\n * Note: This is only called via __turbopack_server_hmr_apply__ which ensures\n * the handler is initialized first via ensureHmrClientInitialized().\n */\nfunction emitMessage(msg: { type: string; data: any }): boolean {\n  if (serverHmrUpdateHandler == null) {\n    console.warn(\n      '[Server HMR] No update handler registered to receive message:',\n      msg\n    )\n    return false\n  }\n\n  try {\n    serverHmrUpdateHandler(msg.data)\n    return true\n  } catch (err) {\n    console.error('[Server HMR] Listener error:', err)\n    return false\n  }\n}\n\n/**\n * Handles server message updates and applies them to the Node.js runtime.\n * Uses shared HMR update logic from hmr-runtime.ts.\n */\nfunction handleNodejsUpdate(\n  msg: NodeJsHmrPayload,\n  moduleFactories: ModuleFactories,\n  devModuleCache: ModuleCache<HotModule>\n): void {\n  if (msg.type !== 'partial') {\n    return\n  }\n\n  const instruction = msg.instruction\n  if (instruction.type !== 'EcmascriptMergedUpdate') {\n    return\n  }\n\n  try {\n    const { entries = {}, chunks = {} } = instruction\n\n    // Node.js eval function (no source maps)\n    const evalModuleEntry = (entry: EcmascriptModuleEntry) => {\n      // eslint-disable-next-line no-eval\n      return (0, eval)(entry.code)\n    }\n\n    const { added, modified } = computeChangedModules(\n      entries,\n      chunks,\n      undefined // no chunkModulesMap for Node.js\n    )\n\n    // Use shared HMR update implementation\n    applyEcmascriptMergedUpdateShared({\n      added,\n      modified,\n      disposedModules: [], // no disposedModules for Node.js (no chunk management)\n      evalModuleEntry,\n      instantiateModule,\n      applyModuleFactoryName: () => {}, // Node doesn't use this\n      moduleFactories,\n      devModuleCache,\n      autoAcceptRootModules: true,\n    })\n  } catch (e) {\n    console.error('[Server HMR] Update failed, full reload needed:', e)\n    throw e\n  }\n}\n"],"names":["serverHmrUpdateHandler","initializeServerHmr","moduleFactories","devModuleCache","Error","msg","handleNodejsUpdate","emitMessage","console","warn","data","err","error","type","instruction","entries","chunks","evalModuleEntry","entry","eval","code","added","modified","computeChangedModules","undefined","applyEcmascriptMergedUpdateShared","disposedModules","instantiateModule","applyModuleFactoryName","autoAcceptRootModules","e"],"mappings":"AAAA,+DAA+D;AAC/D,4DAA4D;AAE5D,oDAAoD,GAYpD,IAAIA,yBAAmE;AAEvE,SAASC,oBACPC,eAAgC,EAChCC,cAAsC;IAEtC,IAAIH,0BAA0B,MAAM;QAClC,MAAM,IAAII,MAAM;IAClB;IAEA,qDAAqD;IACrDJ,yBAAyB,CAACK;QACxBC,mBAAmBD,KAAKH,iBAAiBC;IAC3C;AACF;AAEA;;;;;;CAMC,GACD,SAASI,YAAYF,GAAgC;IACnD,IAAIL,0BAA0B,MAAM;QAClCQ,QAAQC,IAAI,CACV,iEACAJ;QAEF,OAAO;IACT;IAEA,IAAI;QACFL,uBAAuBK,IAAIK,IAAI;QAC/B,OAAO;IACT,EAAE,OAAOC,KAAK;QACZH,QAAQI,KAAK,CAAC,gCAAgCD;QAC9C,OAAO;IACT;AACF;AAEA;;;CAGC,GACD,SAASL,mBACPD,GAAqB,EACrBH,eAAgC,EAChCC,cAAsC;IAEtC,IAAIE,IAAIQ,IAAI,KAAK,WAAW;QAC1B;IACF;IAEA,MAAMC,cAAcT,IAAIS,WAAW;IACnC,IAAIA,YAAYD,IAAI,KAAK,0BAA0B;QACjD;IACF;IAEA,IAAI;QACF,MAAM,EAAEE,UAAU,CAAC,CAAC,EAAEC,SAAS,CAAC,CAAC,EAAE,GAAGF;QAEtC,yCAAyC;QACzC,MAAMG,kBAAkB,CAACC;YACvB,mCAAmC;YACnC,OAAO,CAAC,GAAGC,IAAI,EAAED,MAAME,IAAI;QAC7B;QAEA,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,sBAC1BR,SACAC,QACAQ,UAAU,iCAAiC;;QAG7C,uCAAuC;QACvCC,kCAAkC;YAChCJ;YACAC;YACAI,iBAAiB,EAAE;YACnBT;YACAU;YACAC,wBAAwB,KAAO;YAC/B1B;YACAC;YACA0B,uBAAuB;QACzB;IACF,EAAE,OAAOC,GAAG;QACVtB,QAAQI,KAAK,CAAC,mDAAmDkB;QACjE,MAAMA;IACR;AACF","ignoreList":[0]}},
-    {"offset": {"line": 1534, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/dev/dev-nodejs.ts"],"sourcesContent":["/// <reference path=\"../../shared/runtime/dev-protocol.d.ts\" />\n/// <reference path=\"./hmr-client.ts\" />\n\n/**\n * Note: hmr-runtime.ts is embedded before this file, so its functions\n * (initializeServerHmr, emitMessage) are available in the same scope.\n */\n\n// Initialize server HMR client (connects to shared HMR infrastructure)\nlet hmrClientInitialized = false\nfunction ensureHmrClientInitialized() {\n  if (hmrClientInitialized) return\n  hmrClientInitialized = true\n\n  // initializeServerHmr is from hmr-client.ts (embedded before this file)\n  // moduleFactories is from dev-runtime.ts\n  // devModuleCache is the HotModule-typed cache from dev-runtime.ts\n  initializeServerHmr(moduleFactories, devModuleCache)\n}\n\nfunction __turbopack_server_hmr_apply__(update: NodeJsHmrPayload): boolean {\n  try {\n    ensureHmrClientInitialized()\n\n    // emitMessage returns false if any listener failed to apply the update\n    return emitMessage({\n      type: 'turbopack-message',\n      data: update,\n    })\n  } catch (err) {\n    console.error('[Server HMR] Failed to apply update:', err)\n    return false\n  }\n}\n\nglobalThis.__turbopack_server_hmr_apply__ = __turbopack_server_hmr_apply__\n"],"names":["hmrClientInitialized","ensureHmrClientInitialized","initializeServerHmr","moduleFactories","devModuleCache","__turbopack_server_hmr_apply__","update","emitMessage","type","data","err","console","error","globalThis"],"mappings":"AAAA,+DAA+D;AAC/D,wCAAwC;AAExC;;;CAGC,GAED,uEAAuE;AACvE,IAAIA,uBAAuB;AAC3B,SAASC;IACP,IAAID,sBAAsB;IAC1BA,uBAAuB;IAEvB,wEAAwE;IACxE,yCAAyC;IACzC,kEAAkE;IAClEE,oBAAoBC,iBAAiBC;AACvC;AAEA,SAASC,+BAA+BC,MAAwB;IAC9D,IAAI;QACFL;QAEA,uEAAuE;QACvE,OAAOM,YAAY;YACjBC,MAAM;YACNC,MAAMH;QACR;IACF,EAAE,OAAOI,KAAK;QACZC,QAAQC,KAAK,CAAC,wCAAwCF;QACtD,OAAO;IACT;AACF;AAEAG,WAAWR,8BAA8B,GAAGA","ignoreList":[0]}}]
+    {"offset": {"line": 1466, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/dev/hmr-client.ts"],"sourcesContent":["/// <reference path=\"../../shared/runtime/dev-protocol.d.ts\" />\n/// <reference path=\"../../shared/runtime/hmr-runtime.ts\" />\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\ntype NodeJsHmrPayload = {\n  resource: {\n    path: string\n    headers?: Record<string, string>\n  }\n  issues: Issue[]\n  type: 'partial'\n  instruction: EcmascriptMergedUpdate\n}\n\n/**\n * Appends the module code with //# sourceURL and //# sourceMappingURL so\n * that Node.js can resolve stack frames from `eval`ed server HMR modules back to\n * their original source files. Mirrors the browser's _eval in dev-backend-dom.ts.\n */\nfunction inlineSourcemaps(entry: EcmascriptModuleEntry): string {\n  const [chunkPath, moduleId] = entry.url.split('?', 2)\n  const absolutePath = path.resolve(RUNTIME_ROOT, chunkPath)\n  const fileHref = url.pathToFileURL(absolutePath).href\n  const sourceURL = moduleId ? `${fileHref}?${moduleId}` : fileHref\n  let code = entry.code + '\\n\\n//# sourceURL=' + sourceURL\n  if (entry.map) {\n    code +=\n      '\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,' +\n      Buffer.from(entry.map).toString('base64')\n  }\n  return code\n}\n\nlet serverHmrUpdateHandler: ((msg: NodeJsHmrPayload) => void) | null = null\n\nfunction initializeServerHmr(\n  moduleFactories: ModuleFactories,\n  devModuleCache: ModuleCache<HotModule>\n): void {\n  if (serverHmrUpdateHandler != null) {\n    throw new Error('[Server HMR] Server HMR client is already initialized')\n  }\n\n  // Register the update handler for the server runtime\n  serverHmrUpdateHandler = (msg: NodeJsHmrPayload) => {\n    handleNodejsUpdate(msg, moduleFactories, devModuleCache)\n  }\n}\n\n/**\n * Emits an HMR message to the registered update handler.\n * Node uses a simpler listener pattern than the browser's websocket connection.\n *\n * Note: This is only called via __turbopack_server_hmr_apply__ which ensures\n * the handler is initialized first via ensureHmrClientInitialized().\n */\nfunction emitMessage(msg: { type: string; data: any }): boolean {\n  if (serverHmrUpdateHandler == null) {\n    console.warn(\n      '[Server HMR] No update handler registered to receive message:',\n      msg\n    )\n    return false\n  }\n\n  try {\n    serverHmrUpdateHandler(msg.data)\n    return true\n  } catch (err) {\n    console.error('[Server HMR] Listener error:', err)\n    return false\n  }\n}\n\n/**\n * Handles server message updates and applies them to the Node.js runtime.\n * Uses shared HMR update logic from hmr-runtime.ts.\n */\nfunction handleNodejsUpdate(\n  msg: NodeJsHmrPayload,\n  moduleFactories: ModuleFactories,\n  devModuleCache: ModuleCache<HotModule>\n): void {\n  if (msg.type !== 'partial') {\n    return\n  }\n\n  const instruction = msg.instruction\n  if (instruction.type !== 'EcmascriptMergedUpdate') {\n    return\n  }\n\n  try {\n    const { entries = {}, chunks = {} } = instruction\n\n    const evalModuleEntry = (entry: EcmascriptModuleEntry) => {\n      // eslint-disable-next-line no-eval\n      return (0, eval)(entry.map ? inlineSourcemaps(entry) : entry.code)\n    }\n\n    const { added, modified } = computeChangedModules(\n      entries,\n      chunks,\n      undefined // no chunkModulesMap for Node.js\n    )\n\n    // Use shared HMR update implementation\n    applyEcmascriptMergedUpdateShared({\n      added,\n      modified,\n      disposedModules: [], // no disposedModules for Node.js (no chunk management)\n      evalModuleEntry,\n      instantiateModule,\n      applyModuleFactoryName: () => {}, // Node doesn't use this\n      moduleFactories,\n      devModuleCache,\n      autoAcceptRootModules: true,\n    })\n  } catch (e) {\n    console.error('[Server HMR] Update failed, full reload needed:', e)\n    throw e\n  }\n}\n"],"names":["inlineSourcemaps","entry","chunkPath","moduleId","url","split","absolutePath","path","resolve","RUNTIME_ROOT","fileHref","pathToFileURL","href","sourceURL","code","map","Buffer","from","toString","serverHmrUpdateHandler","initializeServerHmr","moduleFactories","devModuleCache","Error","msg","handleNodejsUpdate","emitMessage","console","warn","data","err","error","type","instruction","entries","chunks","evalModuleEntry","eval","added","modified","computeChangedModules","undefined","applyEcmascriptMergedUpdateShared","disposedModules","instantiateModule","applyModuleFactoryName","autoAcceptRootModules","e"],"mappings":"AAAA,+DAA+D;AAC/D,4DAA4D;AAE5D,oDAAoD,GAYpD;;;;CAIC,GACD,SAASA,iBAAiBC,KAA4B;IACpD,MAAM,CAACC,WAAWC,SAAS,GAAGF,MAAMG,GAAG,CAACC,KAAK,CAAC,KAAK;IACnD,MAAMC,eAAeC,KAAKC,OAAO,CAACC,cAAcP;IAChD,MAAMQ,WAAWN,IAAIO,aAAa,CAACL,cAAcM,IAAI;IACrD,MAAMC,YAAYV,WAAW,GAAGO,SAAS,CAAC,EAAEP,UAAU,GAAGO;IACzD,IAAII,OAAOb,MAAMa,IAAI,GAAG,uBAAuBD;IAC/C,IAAIZ,MAAMc,GAAG,EAAE;QACbD,QACE,uEACAE,OAAOC,IAAI,CAAChB,MAAMc,GAAG,EAAEG,QAAQ,CAAC;IACpC;IACA,OAAOJ;AACT;AAEA,IAAIK,yBAAmE;AAEvE,SAASC,oBACPC,eAAgC,EAChCC,cAAsC;IAEtC,IAAIH,0BAA0B,MAAM;QAClC,MAAM,IAAII,MAAM;IAClB;IAEA,qDAAqD;IACrDJ,yBAAyB,CAACK;QACxBC,mBAAmBD,KAAKH,iBAAiBC;IAC3C;AACF;AAEA;;;;;;CAMC,GACD,SAASI,YAAYF,GAAgC;IACnD,IAAIL,0BAA0B,MAAM;QAClCQ,QAAQC,IAAI,CACV,iEACAJ;QAEF,OAAO;IACT;IAEA,IAAI;QACFL,uBAAuBK,IAAIK,IAAI;QAC/B,OAAO;IACT,EAAE,OAAOC,KAAK;QACZH,QAAQI,KAAK,CAAC,gCAAgCD;QAC9C,OAAO;IACT;AACF;AAEA;;;CAGC,GACD,SAASL,mBACPD,GAAqB,EACrBH,eAAgC,EAChCC,cAAsC;IAEtC,IAAIE,IAAIQ,IAAI,KAAK,WAAW;QAC1B;IACF;IAEA,MAAMC,cAAcT,IAAIS,WAAW;IACnC,IAAIA,YAAYD,IAAI,KAAK,0BAA0B;QACjD;IACF;IAEA,IAAI;QACF,MAAM,EAAEE,UAAU,CAAC,CAAC,EAAEC,SAAS,CAAC,CAAC,EAAE,GAAGF;QAEtC,MAAMG,kBAAkB,CAACnC;YACvB,mCAAmC;YACnC,OAAO,CAAC,GAAGoC,IAAI,EAAEpC,MAAMc,GAAG,GAAGf,iBAAiBC,SAASA,MAAMa,IAAI;QACnE;QAEA,MAAM,EAAEwB,KAAK,EAAEC,QAAQ,EAAE,GAAGC,sBAC1BN,SACAC,QACAM,UAAU,iCAAiC;;QAG7C,uCAAuC;QACvCC,kCAAkC;YAChCJ;YACAC;YACAI,iBAAiB,EAAE;YACnBP;YACAQ;YACAC,wBAAwB,KAAO;YAC/BxB;YACAC;YACAwB,uBAAuB;QACzB;IACF,EAAE,OAAOC,GAAG;QACVpB,QAAQI,KAAK,CAAC,mDAAmDgB;QACjE,MAAMA;IACR;AACF","ignoreList":[0]}},
+    {"offset": {"line": 1548, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/dev/dev-nodejs.ts"],"sourcesContent":["/// <reference path=\"../../shared/runtime/dev-protocol.d.ts\" />\n/// <reference path=\"./hmr-client.ts\" />\n\n/**\n * Note: hmr-runtime.ts is embedded before this file, so its functions\n * (initializeServerHmr, emitMessage) are available in the same scope.\n */\n\n// Initialize server HMR client (connects to shared HMR infrastructure)\nlet hmrClientInitialized = false\nfunction ensureHmrClientInitialized() {\n  if (hmrClientInitialized) return\n  hmrClientInitialized = true\n\n  // initializeServerHmr is from hmr-client.ts (embedded before this file)\n  // moduleFactories is from dev-runtime.ts\n  // devModuleCache is the HotModule-typed cache from dev-runtime.ts\n  initializeServerHmr(moduleFactories, devModuleCache)\n}\n\nfunction __turbopack_server_hmr_apply__(update: NodeJsHmrPayload): boolean {\n  try {\n    ensureHmrClientInitialized()\n\n    // emitMessage returns false if any listener failed to apply the update\n    return emitMessage({\n      type: 'turbopack-message',\n      data: update,\n    })\n  } catch (err) {\n    console.error('[Server HMR] Failed to apply update:', err)\n    return false\n  }\n}\n\nglobalThis.__turbopack_server_hmr_apply__ = __turbopack_server_hmr_apply__\n"],"names":["hmrClientInitialized","ensureHmrClientInitialized","initializeServerHmr","moduleFactories","devModuleCache","__turbopack_server_hmr_apply__","update","emitMessage","type","data","err","console","error","globalThis"],"mappings":"AAAA,+DAA+D;AAC/D,wCAAwC;AAExC;;;CAGC,GAED,uEAAuE;AACvE,IAAIA,uBAAuB;AAC3B,SAASC;IACP,IAAID,sBAAsB;IAC1BA,uBAAuB;IAEvB,wEAAwE;IACxE,yCAAyC;IACzC,kEAAkE;IAClEE,oBAAoBC,iBAAiBC;AACvC;AAEA,SAASC,+BAA+BC,MAAwB;IAC9D,IAAI;QACFL;QAEA,uEAAuE;QACvE,OAAOM,YAAY;YACjBC,MAAM;YACNC,MAAMH;QACR;IACF,EAAE,OAAOI,KAAK;QACZC,QAAQC,KAAK,CAAC,wCAAwCF;QACtD,OAAO;IACT;AACF;AAEAG,WAAWR,8BAA8B,GAAGA","ignoreList":[0]}}]
 }
\ No newline at end of file