{"version":3,"sources":["../../../../src/server/app-render/create-component-tree.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport type {\n  CacheNodeSeedData,\n  LoadingModuleData,\n} from '../../shared/lib/app-router-types'\nimport type { PreloadCallbacks } from './types'\nimport {\n  isClientReference,\n  isUseCacheFunction,\n} from '../../lib/client-and-server-references'\nimport { getLayoutOrPageModule } from '../lib/app-dir-module'\nimport type { LoaderTree } from '../lib/app-dir-module'\nimport { interopDefault } from './interop-default'\nimport { parseLoaderTree } from '../../shared/lib/router/utils/parse-loader-tree'\nimport type { AppRenderContext, GetDynamicParamFromSegment } from './app-render'\nimport { createComponentStylesAndScripts } from './create-component-styles-and-scripts'\nimport { getLayerAssets } from './get-layer-assets'\nimport { hasLoadingComponentInTree } from './has-loading-component-in-tree'\nimport { validateRevalidate } from '../lib/patch-fetch'\nimport { PARALLEL_ROUTE_DEFAULT_PATH } from '../../client/components/builtin/default'\nimport { getTracer } from '../lib/trace/tracer'\nimport { NextNodeServerSpan } from '../lib/trace/constants'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport type { Params } from '../request/params'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport {\n  createVaryParamsAccumulator,\n  emptyVaryParamsAccumulator,\n  getVaryParamsThenable,\n  type VaryParamsAccumulator,\n} from './vary-params'\nimport type {\n  UseCacheLayoutProps,\n  UseCachePageProps,\n} from '../use-cache/use-cache-wrapper'\nimport { DEFAULT_SEGMENT_KEY } from '../../shared/lib/segment'\nimport {\n  BOUNDARY_PREFIX,\n  BOUNDARY_SUFFIX,\n  BUILTIN_PREFIX,\n  getConventionPathByType,\n  isNextjsBuiltinFilePath,\n} from './segment-explorer-path'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\nimport { RenderStage, type StagedRenderingController } from './staged-rendering'\n\ntype HTTPAccessErrorStatusCode = 404 | 403 | 401\n\nexport type PrerenderHTTPErrorState = {\n  boundaryTree: LoaderTree\n  triggeredStatus: HTTPAccessErrorStatusCode\n}\n\n/**\n * Use the provided loader tree to create the React Component tree.\n */\n// TODO convert these arguments to non-object form. the entrypoint doesn't need most of them\nexport function createComponentTree(props: {\n  loaderTree: LoaderTree\n  parentParams: Params\n  parentOptionalCatchAllParamName: string | null\n  parentRuntimePrefetchable: false\n  rootLayoutIncluded: boolean\n  injectedCSS: Set<string>\n  injectedJS: Set<string>\n  injectedFontPreloadTags: Set<string>\n  ctx: AppRenderContext\n  missingSlots?: Set<string>\n  preloadCallbacks: PreloadCallbacks\n  authInterrupts: boolean\n  MetadataOutlet: ComponentType\n  prerenderHTTPError?: PrerenderHTTPErrorState\n}): Promise<CacheNodeSeedData> {\n  return getTracer().trace(\n    NextNodeServerSpan.createComponentTree,\n    {\n      spanName: 'build component tree',\n    },\n    () => createComponentTreeInternal(props, true)\n  )\n}\n\nfunction errorMissingDefaultExport(\n  pagePath: string,\n  convention: string\n): never {\n  const normalizedPagePath = pagePath === '/' ? '' : pagePath\n  throw new Error(\n    `The default export is not a React Component in \"${normalizedPagePath}/${convention}\"`\n  )\n}\n\nconst cacheNodeKey = 'c'\n\nasync function createComponentTreeInternal(\n  {\n    loaderTree: tree,\n    parentParams,\n    parentOptionalCatchAllParamName,\n    parentRuntimePrefetchable,\n    rootLayoutIncluded,\n    injectedCSS,\n    injectedJS,\n    injectedFontPreloadTags,\n    ctx,\n    missingSlots,\n    preloadCallbacks,\n    authInterrupts,\n    MetadataOutlet,\n    prerenderHTTPError,\n  }: {\n    loaderTree: LoaderTree\n    parentParams: Params\n    parentOptionalCatchAllParamName: string | null\n    parentRuntimePrefetchable: boolean\n    rootLayoutIncluded: boolean\n    injectedCSS: Set<string>\n    injectedJS: Set<string>\n    injectedFontPreloadTags: Set<string>\n    ctx: AppRenderContext\n    missingSlots?: Set<string>\n    preloadCallbacks: PreloadCallbacks\n    authInterrupts: boolean\n    MetadataOutlet: ComponentType | null\n    prerenderHTTPError?: PrerenderHTTPErrorState\n  },\n  isRoot: boolean\n): Promise<CacheNodeSeedData> {\n  const {\n    renderOpts: { nextConfigOutput, experimental, cacheComponents },\n    workStore,\n    componentMod: {\n      createElement,\n      Fragment,\n      SegmentViewNode,\n      HTTPAccessFallbackBoundary,\n      LayoutRouter,\n      RenderFromTemplateContext,\n      ClientPageRoot,\n      ClientSegmentRoot,\n      createServerSearchParamsForServerPage,\n      createPrerenderSearchParamsForClientPage,\n      createServerParamsForServerSegment,\n      createPrerenderParamsForClientSegment,\n      serverHooks: { DynamicServerError },\n      Postpone,\n    },\n    pagePath,\n    getDynamicParamFromSegment,\n    isPrefetch,\n    query,\n  } = ctx\n\n  const { page, conventionPath, segment, modules, parallelRoutes } =\n    parseLoaderTree(tree)\n\n  const {\n    layout,\n    template,\n    error,\n    loading,\n    'not-found': notFound,\n    forbidden,\n    unauthorized,\n  } = modules\n\n  const injectedCSSWithCurrentLayout = new Set(injectedCSS)\n  const injectedJSWithCurrentLayout = new Set(injectedJS)\n  const injectedFontPreloadTagsWithCurrentLayout = new Set(\n    injectedFontPreloadTags\n  )\n\n  const layerAssets = getLayerAssets({\n    preloadCallbacks,\n    ctx,\n    layoutOrPagePath: conventionPath,\n    injectedCSS: injectedCSSWithCurrentLayout,\n    injectedJS: injectedJSWithCurrentLayout,\n    injectedFontPreloadTags: injectedFontPreloadTagsWithCurrentLayout,\n  })\n\n  const [Template, templateStyles, templateScripts] = template\n    ? await createComponentStylesAndScripts({\n        ctx,\n        filePath: template[1],\n        getComponent: template[0],\n        injectedCSS: injectedCSSWithCurrentLayout,\n        injectedJS: injectedJSWithCurrentLayout,\n      })\n    : [Fragment]\n\n  const [ErrorComponent, errorStyles, errorScripts] = error\n    ? await createComponentStylesAndScripts({\n        ctx,\n        filePath: error[1],\n        getComponent: error[0],\n        injectedCSS: injectedCSSWithCurrentLayout,\n        injectedJS: injectedJSWithCurrentLayout,\n      })\n    : []\n\n  const [Loading, loadingStyles, loadingScripts] = loading\n    ? await createComponentStylesAndScripts({\n        ctx,\n        filePath: loading[1],\n        getComponent: loading[0],\n        injectedCSS: injectedCSSWithCurrentLayout,\n        injectedJS: injectedJSWithCurrentLayout,\n      })\n    : []\n\n  const isLayout = typeof layout !== 'undefined'\n  const isPage = typeof page !== 'undefined'\n  const { mod: layoutOrPageMod, modType } = await getTracer().trace(\n    NextNodeServerSpan.getLayoutOrPageModule,\n    {\n      hideSpan: !(isLayout || isPage),\n      spanName: 'resolve segment modules',\n      attributes: {\n        'next.segment': segment,\n      },\n    },\n    () => getLayoutOrPageModule(tree)\n  )\n\n  /**\n   * Checks if the current segment is a root layout.\n   */\n  const rootLayoutAtThisLevel = isLayout && !rootLayoutIncluded\n  /**\n   * Checks if the current segment or any level above it has a root layout.\n   */\n  const rootLayoutIncludedAtThisLevelOrAbove =\n    rootLayoutIncluded || rootLayoutAtThisLevel\n\n  const [NotFound, notFoundStyles] = notFound\n    ? await createComponentStylesAndScripts({\n        ctx,\n        filePath: notFound[1],\n        getComponent: notFound[0],\n        injectedCSS: injectedCSSWithCurrentLayout,\n        injectedJS: injectedJSWithCurrentLayout,\n      })\n    : []\n\n  const instantConfig = layoutOrPageMod\n    ? (layoutOrPageMod as AppSegmentConfig).unstable_instant\n    : undefined\n  const hasRuntimePrefetch =\n    instantConfig && typeof instantConfig === 'object'\n      ? instantConfig.prefetch === 'runtime'\n      : false\n  const isRuntimePrefetchable = hasRuntimePrefetch || parentRuntimePrefetchable\n\n  const [Forbidden, forbiddenStyles] =\n    authInterrupts && forbidden\n      ? await createComponentStylesAndScripts({\n          ctx,\n          filePath: forbidden[1],\n          getComponent: forbidden[0],\n          injectedCSS: injectedCSSWithCurrentLayout,\n          injectedJS: injectedJSWithCurrentLayout,\n        })\n      : []\n\n  const [Unauthorized, unauthorizedStyles] =\n    authInterrupts && unauthorized\n      ? await createComponentStylesAndScripts({\n          ctx,\n          filePath: unauthorized[1],\n          getComponent: unauthorized[0],\n          injectedCSS: injectedCSSWithCurrentLayout,\n          injectedJS: injectedJSWithCurrentLayout,\n        })\n      : []\n\n  let dynamic = layoutOrPageMod?.dynamic\n\n  if (nextConfigOutput === 'export') {\n    if (!dynamic || dynamic === 'auto') {\n      dynamic = 'error'\n    } else if (dynamic === 'force-dynamic') {\n      // force-dynamic is always incompatible with 'export'. We must interrupt the build\n      throw new StaticGenBailoutError(\n        `Page with \\`dynamic = \"force-dynamic\"\\` couldn't be exported. \\`output: \"export\"\\` requires all pages be renderable statically because there is no runtime server to dynamically render routes in this output format. Learn more: https://nextjs.org/docs/app/building-your-application/deploying/static-exports`\n      )\n    }\n  }\n\n  if (typeof dynamic === 'string') {\n    // the nested most config wins so we only force-static\n    // if it's configured above any parent that configured\n    // otherwise\n    if (dynamic === 'error') {\n      workStore.dynamicShouldError = true\n    } else if (dynamic === 'force-dynamic') {\n      workStore.forceDynamic = true\n\n      // TODO: (PPR) remove this bailout once PPR is the default\n      if (workStore.isStaticGeneration && !experimental.isRoutePPREnabled) {\n        // If the postpone API isn't available, we can't postpone the render and\n        // therefore we can't use the dynamic API.\n        const err = new DynamicServerError(\n          `Page with \\`dynamic = \"force-dynamic\"\\` won't be rendered statically.`\n        )\n        workStore.dynamicUsageDescription = err.message\n        workStore.dynamicUsageStack = err.stack\n        throw err\n      }\n    } else {\n      workStore.dynamicShouldError = false\n      workStore.forceStatic = dynamic === 'force-static'\n    }\n  }\n\n  if (typeof layoutOrPageMod?.fetchCache === 'string') {\n    workStore.fetchCache = layoutOrPageMod?.fetchCache\n  }\n\n  if (typeof layoutOrPageMod?.revalidate !== 'undefined') {\n    validateRevalidate(layoutOrPageMod?.revalidate, workStore.route)\n  }\n\n  if (typeof layoutOrPageMod?.revalidate === 'number') {\n    const defaultRevalidate = layoutOrPageMod.revalidate as number\n\n    const workUnitStore = workUnitAsyncStorage.getStore()\n\n    if (workUnitStore) {\n      switch (workUnitStore.type) {\n        case 'prerender':\n        case 'prerender-runtime':\n        case 'prerender-legacy':\n        case 'prerender-ppr':\n          if (workUnitStore.revalidate > defaultRevalidate) {\n            workUnitStore.revalidate = defaultRevalidate\n          }\n          break\n        case 'request':\n          // A request store doesn't have a revalidate property.\n          break\n        // createComponentTree is not called for these stores:\n        case 'cache':\n        case 'private-cache':\n        case 'prerender-client':\n        case 'validation-client':\n        case 'unstable-cache':\n        case 'generate-static-params':\n          break\n        default:\n          workUnitStore satisfies never\n      }\n    }\n\n    if (\n      !workStore.forceStatic &&\n      workStore.isStaticGeneration &&\n      defaultRevalidate === 0 &&\n      // If the postpone API isn't available, we can't postpone the render and\n      // therefore we can't use the dynamic API.\n      !experimental.isRoutePPREnabled\n    ) {\n      const dynamicUsageDescription = `revalidate: 0 configured ${segment}`\n      workStore.dynamicUsageDescription = dynamicUsageDescription\n\n      throw new DynamicServerError(dynamicUsageDescription)\n    }\n  }\n\n  // Read unstable_dynamicStaleTime from page modules (not layouts) and track it on\n  // the store's stale field. This affects the segment cache stale time via\n  // the StaleTimeIterable.\n  if (\n    isPage &&\n    typeof layoutOrPageMod?.unstable_dynamicStaleTime === 'number'\n  ) {\n    const pageStaleTime = layoutOrPageMod.unstable_dynamicStaleTime\n    const workUnitStore = workUnitAsyncStorage.getStore()\n\n    if (workUnitStore) {\n      switch (workUnitStore.type) {\n        case 'prerender':\n        case 'prerender-runtime':\n        case 'prerender-legacy':\n        case 'prerender-ppr':\n          if (workUnitStore.stale > pageStaleTime) {\n            workUnitStore.stale = pageStaleTime\n          }\n          break\n        case 'request':\n          if (\n            workUnitStore.stale === undefined ||\n            workUnitStore.stale > pageStaleTime\n          ) {\n            workUnitStore.stale = pageStaleTime\n          }\n          break\n        // createComponentTree is not called for these stores:\n        case 'cache':\n        case 'private-cache':\n        case 'prerender-client':\n        case 'validation-client':\n        case 'unstable-cache':\n        case 'generate-static-params':\n          break\n        default:\n          workUnitStore satisfies never\n      }\n    }\n  }\n\n  const isStaticGeneration = workStore.isStaticGeneration\n\n  // Assume the segment we're rendering contains only partial data if PPR is\n  // enabled and this is a statically generated response. This is used by the\n  // client Segment Cache after a prefetch to determine if it can skip the\n  // second request to fill in the dynamic data.\n  //\n  // It's OK for this to be `true` when the data is actually fully static, but\n  // it's not OK for this to be `false` when the data possibly contains holes.\n  // Although the value here is overly pessimistic, for prefetches, it will be\n  // replaced by a more specific value when the data is later processed into\n  // per-segment responses (see collect-segment-data.tsx)\n  //\n  // For dynamic requests, this must always be `false` because dynamic responses\n  // are never partial.\n  const isPossiblyPartialResponse =\n    isStaticGeneration && experimental.isRoutePPREnabled === true\n\n  const LayoutOrPage: ComponentType<any> | undefined = layoutOrPageMod\n    ? interopDefault(layoutOrPageMod)\n    : undefined\n\n  /**\n   * The React Component to render.\n   */\n  let MaybeComponent = LayoutOrPage\n\n  if (process.env.NODE_ENV === 'development' || isStaticGeneration) {\n    const { isValidElementType } =\n      require('next/dist/compiled/react-is') as typeof import('next/dist/compiled/react-is')\n    if (\n      typeof MaybeComponent !== 'undefined' &&\n      !isValidElementType(MaybeComponent)\n    ) {\n      errorMissingDefaultExport(pagePath, modType ?? 'page')\n    }\n\n    if (\n      typeof ErrorComponent !== 'undefined' &&\n      !isValidElementType(ErrorComponent)\n    ) {\n      errorMissingDefaultExport(pagePath, 'error')\n    }\n\n    if (typeof Loading !== 'undefined' && !isValidElementType(Loading)) {\n      errorMissingDefaultExport(pagePath, 'loading')\n    }\n\n    if (typeof NotFound !== 'undefined' && !isValidElementType(NotFound)) {\n      errorMissingDefaultExport(pagePath, 'not-found')\n    }\n\n    if (typeof Forbidden !== 'undefined' && !isValidElementType(Forbidden)) {\n      errorMissingDefaultExport(pagePath, 'forbidden')\n    }\n\n    if (\n      typeof Unauthorized !== 'undefined' &&\n      !isValidElementType(Unauthorized)\n    ) {\n      errorMissingDefaultExport(pagePath, 'unauthorized')\n    }\n  }\n\n  // Handle dynamic segment params.\n  const segmentParam = getDynamicParamFromSegment(tree)\n\n  // Create object holding the parent params and current params\n  let currentParams: Params = parentParams\n  if (segmentParam && segmentParam.value !== null) {\n    currentParams = {\n      ...parentParams,\n      [segmentParam.param]: segmentParam.value,\n    }\n  }\n\n  // Track optional catch-all params with no value (e.g., [[...slug]] at /).\n  // These params won't exist as properties on the params object, so vary\n  // params tracking needs to use a Proxy to detect access. We propagate this\n  // through the tree so that child segments (like __PAGE__) also know about\n  // the missing param. In practice, this only gets passed down one level —\n  // from the optional catch-all layout segment to the page segment — so it's\n  // always very close to the leaf of the tree.\n  const optionalCatchAllParamName: string | null =\n    segmentParam?.type === 'oc' && segmentParam.value === null\n      ? segmentParam.param\n      : parentOptionalCatchAllParamName\n\n  // Resolve the segment param\n  const isSegmentViewEnabled = !!process.env.__NEXT_DEV_SERVER\n  const dir =\n    (process.env.NEXT_RUNTIME === 'edge'\n      ? process.env.__NEXT_EDGE_PROJECT_DIR\n      : ctx.renderOpts.dir) || ''\n\n  const [notFoundElement, notFoundFilePath] =\n    await createBoundaryConventionElement({\n      ctx,\n      conventionName: 'not-found',\n      Component: NotFound,\n      styles: notFoundStyles,\n      tree,\n    })\n\n  const [forbiddenElement] = await createBoundaryConventionElement({\n    ctx,\n    conventionName: 'forbidden',\n    Component: Forbidden,\n    styles: forbiddenStyles,\n    tree,\n  })\n\n  const [unauthorizedElement] = await createBoundaryConventionElement({\n    ctx,\n    conventionName: 'unauthorized',\n    Component: Unauthorized,\n    styles: unauthorizedStyles,\n    tree,\n  })\n\n  // TODO: Combine this `map` traversal with the loop below that turns the array\n  // into an object.\n  const parallelRouteMap = await Promise.all(\n    Object.keys(parallelRoutes).map(\n      async (\n        parallelRouteKey\n      ): Promise<[string, React.ReactNode, CacheNodeSeedData | null]> => {\n        const isChildrenRouteKey = parallelRouteKey === 'children'\n        const parallelRoute = parallelRoutes[parallelRouteKey]\n\n        const notFoundComponent = isChildrenRouteKey\n          ? notFoundElement\n          : undefined\n\n        const forbiddenComponent = isChildrenRouteKey\n          ? forbiddenElement\n          : undefined\n\n        const unauthorizedComponent = isChildrenRouteKey\n          ? unauthorizedElement\n          : undefined\n\n        // if we're prefetching and that there's a Loading component, we bail out\n        // otherwise we keep rendering for the prefetch.\n        // We also want to bail out if there's no Loading component in the tree.\n        let childCacheNodeSeedData: CacheNodeSeedData | null = null\n\n        if (\n          // Before PPR, the way instant navigations work in Next.js is we\n          // prefetch everything up to the first route segment that defines a\n          // loading.tsx boundary. (We do the same if there's no loading\n          // boundary in the entire tree, because we don't want to prefetch too\n          // much) The rest of the tree is deferred until the actual navigation.\n          // It does not take into account whether the data is dynamic — even if\n          // the tree is completely static, it will still defer everything\n          // inside the loading boundary.\n          //\n          // This behavior predates PPR and is only relevant if the\n          // PPR flag is not enabled.\n          isPrefetch &&\n          (Loading || !hasLoadingComponentInTree(parallelRoute)) &&\n          // The approach with PPR is different — loading.tsx behaves like a\n          // regular Suspense boundary and has no special behavior.\n          //\n          // With PPR, we prefetch as deeply as possible, and only defer when\n          // dynamic data is accessed. If so, we only defer the nearest parent\n          // Suspense boundary of the dynamic data access, regardless of whether\n          // the boundary is defined by loading.tsx or a normal <Suspense>\n          // component in userspace.\n          //\n          // NOTE: In practice this usually means we'll end up prefetching more\n          // than we were before PPR, which may or may not be considered a\n          // performance regression by some apps. The plan is to address this\n          // before General Availability of PPR by introducing granular\n          // per-segment fetching, so we can reuse as much of the tree as\n          // possible during both prefetches and dynamic navigations. But during\n          // the beta period, we should be clear about this trade off in our\n          // communications.\n          !experimental.isRoutePPREnabled\n        ) {\n          // Don't prefetch this child. This will trigger a lazy fetch by the\n          // client router.\n        } else {\n          // Create the child component\n\n          if (process.env.NODE_ENV === 'development' && missingSlots) {\n            // When we detect the default fallback (which triggers a 404), we collect the missing slots\n            // to provide more helpful debug information during development mode.\n            const parsedTree = parseLoaderTree(parallelRoute)\n            if (\n              parsedTree.conventionPath?.endsWith(PARALLEL_ROUTE_DEFAULT_PATH)\n            ) {\n              missingSlots.add(parallelRouteKey)\n            }\n          }\n\n          // The outer prerender catch already found the deepest segment whose\n          // HTTP fallback should replace the throwing page. When we reach that\n          // segment's `children` slot, render the fallback directly instead of\n          // descending back into the subtree that threw during deserialization.\n\n          // Like the other segment-level boundary props below, HTTP access\n          // fallbacks are attached to the default `children` slot, not to named\n          // parallel routes.\n          const shouldRenderPrerenderHTTPFallback =\n            prerenderHTTPError?.boundaryTree === tree && isChildrenRouteKey\n\n          if (shouldRenderPrerenderHTTPFallback) {\n            let fallbackElement: React.ReactNode | undefined\n            switch (prerenderHTTPError.triggeredStatus) {\n              case 404:\n                fallbackElement = notFoundElement\n                break\n              case 403:\n                fallbackElement = forbiddenElement\n                break\n              case 401:\n                fallbackElement = unauthorizedElement\n                break\n              default:\n                break\n            }\n\n            if (fallbackElement) {\n              childCacheNodeSeedData = createSeedData(\n                ctx,\n                fallbackElement,\n                {},\n                null,\n                isPossiblyPartialResponse,\n                false,\n                emptyVaryParamsAccumulator\n              )\n            }\n          }\n\n          if (childCacheNodeSeedData === null) {\n            const seedData = await createComponentTreeInternal(\n              {\n                loaderTree: parallelRoute,\n                parentParams: currentParams,\n                parentOptionalCatchAllParamName: optionalCatchAllParamName,\n                parentRuntimePrefetchable: isRuntimePrefetchable,\n                rootLayoutIncluded: rootLayoutIncludedAtThisLevelOrAbove,\n                injectedCSS: injectedCSSWithCurrentLayout,\n                injectedJS: injectedJSWithCurrentLayout,\n                injectedFontPreloadTags:\n                  injectedFontPreloadTagsWithCurrentLayout,\n                ctx,\n                missingSlots,\n                preloadCallbacks,\n                authInterrupts,\n                // `StreamingMetadataOutlet` is used to conditionally throw. In the case of parallel routes we will have more than one page\n                // but we only want to throw on the first one.\n                MetadataOutlet: isChildrenRouteKey ? MetadataOutlet : null,\n                prerenderHTTPError,\n              },\n              false\n            )\n\n            childCacheNodeSeedData = seedData\n          }\n        }\n\n        const templateNode = createElement(\n          Template,\n          null,\n          createElement(RenderFromTemplateContext, null)\n        )\n\n        const templateFilePath = getConventionPathByType(tree, dir, 'template')\n        const errorFilePath = getConventionPathByType(tree, dir, 'error')\n        const loadingFilePath = getConventionPathByType(tree, dir, 'loading')\n        const globalErrorFilePath = isRoot\n          ? getConventionPathByType(tree, dir, 'global-error')\n          : undefined\n\n        const wrappedErrorStyles =\n          isSegmentViewEnabled && errorFilePath\n            ? createElement(\n                SegmentViewNode,\n                {\n                  type: 'error',\n                  pagePath: errorFilePath,\n                },\n                errorStyles\n              )\n            : errorStyles\n\n        // Add a suffix to avoid conflict with the segment view node representing rendered file.\n        // existence: not-found.tsx@boundary\n        // rendered: not-found.tsx\n        const fileNameSuffix = BOUNDARY_SUFFIX\n        const segmentViewBoundaries = isSegmentViewEnabled\n          ? createElement(\n              Fragment,\n              null,\n              notFoundFilePath &&\n                createElement(SegmentViewNode, {\n                  type: `${BOUNDARY_PREFIX}not-found`,\n                  pagePath: notFoundFilePath + fileNameSuffix,\n                }),\n              loadingFilePath &&\n                createElement(SegmentViewNode, {\n                  type: `${BOUNDARY_PREFIX}loading`,\n                  pagePath: loadingFilePath + fileNameSuffix,\n                }),\n              errorFilePath &&\n                createElement(SegmentViewNode, {\n                  type: `${BOUNDARY_PREFIX}error`,\n                  pagePath: errorFilePath + fileNameSuffix,\n                }),\n              globalErrorFilePath &&\n                createElement(SegmentViewNode, {\n                  type: `${BOUNDARY_PREFIX}global-error`,\n                  pagePath: isNextjsBuiltinFilePath(globalErrorFilePath)\n                    ? `${BUILTIN_PREFIX}global-error.js${fileNameSuffix}`\n                    : globalErrorFilePath,\n                })\n            )\n          : null\n\n        return [\n          parallelRouteKey,\n          createElement(LayoutRouter, {\n            parallelRouterKey: parallelRouteKey,\n            error: ErrorComponent,\n            errorStyles: wrappedErrorStyles,\n            errorScripts: errorScripts,\n            template:\n              isSegmentViewEnabled && templateFilePath\n                ? createElement(\n                    SegmentViewNode,\n                    {\n                      type: 'template',\n                      pagePath: templateFilePath,\n                    },\n                    templateNode\n                  )\n                : templateNode,\n            templateStyles: templateStyles,\n            templateScripts: templateScripts,\n            notFound: notFoundComponent,\n            forbidden: forbiddenComponent,\n            unauthorized: unauthorizedComponent,\n            ...(isSegmentViewEnabled && {\n              segmentViewBoundaries,\n            }),\n          }),\n          childCacheNodeSeedData,\n        ]\n      }\n    )\n  )\n\n  // Convert the parallel route map into an object after all promises have been resolved.\n  let parallelRouteProps: { [key: string]: React.ReactNode } = {}\n  let parallelRouteCacheNodeSeedData: {\n    [key: string]: CacheNodeSeedData | null\n  } = {}\n  for (const parallelRoute of parallelRouteMap) {\n    const [parallelRouteKey, parallelRouteProp, flightData] = parallelRoute\n    parallelRouteProps[parallelRouteKey] = parallelRouteProp\n    parallelRouteCacheNodeSeedData[parallelRouteKey] = flightData\n  }\n\n  let loadingElement = Loading\n    ? createElement(Loading, {\n        key: 'l',\n      })\n    : null\n  const loadingFilePath = getConventionPathByType(tree, dir, 'loading')\n  if (isSegmentViewEnabled && loadingElement) {\n    if (loadingFilePath) {\n      loadingElement = createElement(\n        SegmentViewNode,\n        {\n          key: cacheNodeKey + '-loading',\n          type: 'loading',\n          pagePath: loadingFilePath,\n        },\n        loadingElement\n      )\n    }\n  }\n\n  const loadingData: LoadingModuleData = loadingElement\n    ? [loadingElement, loadingStyles, loadingScripts]\n    : null\n\n  // When the segment does not have a layout or page we still have to add the layout router to ensure the path holds the loading component\n  if (!MaybeComponent) {\n    return createSeedData(\n      ctx,\n      createElement(\n        Fragment,\n        {\n          key: cacheNodeKey,\n        },\n        layerAssets,\n        parallelRouteProps.children\n      ),\n      parallelRouteCacheNodeSeedData,\n      loadingData,\n      isPossiblyPartialResponse,\n      isRuntimePrefetchable,\n\n      // No user-provided component, so no params will be accessed. Use the\n      // pre-resolved empty tracker.\n      emptyVaryParamsAccumulator\n    )\n  }\n\n  const Component = MaybeComponent\n  // If force-dynamic is used and the current render supports postponing, we\n  // replace it with a node that will postpone the render. This ensures that the\n  // postpone is invoked during the react render phase and not during the next\n  // render phase.\n  // @TODO this does not actually do what it seems like it would or should do. The idea is that\n  // if we are rendering in a force-dynamic mode and we can postpone we should only make the segments\n  // that ask for force-dynamic to be dynamic, allowing other segments to still prerender. However\n  // because this comes after the children traversal and the static generation store is mutated every segment\n  // along the parent path of a force-dynamic segment will hit this condition effectively making the entire\n  // render force-dynamic. We should refactor this function so that we can correctly track which segments\n  // need to be dynamic\n  if (\n    workStore.isStaticGeneration &&\n    workStore.forceDynamic &&\n    experimental.isRoutePPREnabled\n  ) {\n    return createSeedData(\n      ctx,\n      createElement(\n        Fragment,\n        {\n          key: cacheNodeKey,\n        },\n        createElement(Postpone, {\n          reason: 'dynamic = \"force-dynamic\" was used',\n          route: workStore.route,\n        }),\n        layerAssets\n      ),\n      parallelRouteCacheNodeSeedData,\n      loadingData,\n      true,\n      isRuntimePrefetchable,\n\n      // force-dynamic postpones without rendering the component, so no params\n      // are accessed. The vary params are empty.\n      emptyVaryParamsAccumulator\n    )\n  }\n\n  const isClientComponent = isClientReference(layoutOrPageMod)\n\n  const varyParamsAccumulator =\n    isClientComponent && cacheComponents\n      ? // Client components with Cache Components enabled don't receive params\n        // from the server, so they have an empty vary params set.\n        emptyVaryParamsAccumulator\n      : createVaryParamsAccumulator()\n\n  if (\n    process.env.NODE_ENV === 'development' &&\n    'params' in parallelRouteProps\n  ) {\n    // @TODO consider making this an error and running the check in build as well\n    console.error(\n      `\"params\" is a reserved prop in Layouts and Pages and cannot be used as the name of a parallel route in ${segment}`\n    )\n  }\n\n  if (isPage) {\n    const PageComponent = Component\n\n    // Assign searchParams to props if this is a page\n    let pageElement: React.ReactNode\n    if (isClientComponent) {\n      if (cacheComponents) {\n        // Params are omitted when Cache Components is enabled\n        pageElement = createElement(ClientPageRoot, {\n          Component: PageComponent,\n          serverProvidedParams: null,\n        })\n      } else if (isStaticGeneration) {\n        const promiseOfParams =\n          createPrerenderParamsForClientSegment(currentParams)\n        const promiseOfSearchParams = createPrerenderSearchParamsForClientPage()\n        pageElement = createElement(ClientPageRoot, {\n          Component: PageComponent,\n          serverProvidedParams: {\n            searchParams: query,\n            params: currentParams,\n            promises: [promiseOfSearchParams, promiseOfParams],\n          },\n        })\n      } else {\n        pageElement = createElement(ClientPageRoot, {\n          Component: PageComponent,\n          serverProvidedParams: {\n            searchParams: query,\n            params: currentParams,\n            promises: null,\n          },\n        })\n      }\n    } else {\n      // If we are passing params to a server component Page we need to track\n      // their usage in case the current render mode tracks dynamic API usage.\n      const params = createServerParamsForServerSegment(\n        currentParams,\n        optionalCatchAllParamName,\n        varyParamsAccumulator,\n        isRuntimePrefetchable\n      )\n\n      // If we are passing searchParams to a server component Page we need to\n      // track their usage in case the current render mode tracks dynamic API\n      // usage.\n      let searchParams = createServerSearchParamsForServerPage(\n        query,\n        varyParamsAccumulator,\n        isRuntimePrefetchable\n      )\n\n      if (isUseCacheFunction(PageComponent)) {\n        const UseCachePageComponent: ComponentType<UseCachePageProps> =\n          PageComponent\n\n        pageElement = createElement(UseCachePageComponent, {\n          params: params,\n          searchParams: searchParams,\n          $$isPage: true,\n        })\n      } else {\n        pageElement = createElement(PageComponent, {\n          params: params,\n          searchParams: searchParams,\n        })\n      }\n    }\n\n    const isDefaultSegment = segment === DEFAULT_SEGMENT_KEY\n    const pageFilePath =\n      getConventionPathByType(tree, dir, 'page') ??\n      getConventionPathByType(tree, dir, 'defaultPage')\n    const segmentType = isDefaultSegment ? 'default' : 'page'\n    const wrappedPageElement =\n      isSegmentViewEnabled && pageFilePath\n        ? createElement(\n            SegmentViewNode,\n            {\n              key: cacheNodeKey + '-' + segmentType,\n              type: segmentType,\n              pagePath: pageFilePath,\n            },\n            pageElement\n          )\n        : pageElement\n\n    return createSeedData(\n      ctx,\n      createElement(\n        Fragment,\n        {\n          key: cacheNodeKey,\n        },\n        wrappedPageElement,\n        layerAssets,\n        MetadataOutlet ? createElement(MetadataOutlet, null) : null\n      ),\n      parallelRouteCacheNodeSeedData,\n      loadingData,\n      isPossiblyPartialResponse,\n      isRuntimePrefetchable,\n\n      varyParamsAccumulator\n    )\n  } else {\n    const SegmentComponent = Component\n    const isRootLayoutWithChildrenSlotAndAtLeastOneMoreSlot =\n      rootLayoutAtThisLevel &&\n      'children' in parallelRoutes &&\n      Object.keys(parallelRoutes).length > 1\n\n    let segmentNode: React.ReactNode\n\n    if (isClientComponent) {\n      let clientSegment: React.ReactNode\n      if (cacheComponents) {\n        // Params are omitted when Cache Components is enabled\n        clientSegment = createElement(ClientSegmentRoot, {\n          Component: SegmentComponent,\n          slots: parallelRouteProps,\n          serverProvidedParams: null,\n        })\n      } else if (isStaticGeneration) {\n        const promiseOfParams =\n          createPrerenderParamsForClientSegment(currentParams)\n\n        clientSegment = createElement(ClientSegmentRoot, {\n          Component: SegmentComponent,\n          slots: parallelRouteProps,\n          serverProvidedParams: {\n            params: currentParams,\n            promises: [promiseOfParams],\n          },\n        })\n      } else {\n        clientSegment = createElement(ClientSegmentRoot, {\n          Component: SegmentComponent,\n          slots: parallelRouteProps,\n          serverProvidedParams: {\n            params: currentParams,\n            promises: null,\n          },\n        })\n      }\n\n      if (isRootLayoutWithChildrenSlotAndAtLeastOneMoreSlot) {\n        let notfoundClientSegment: React.ReactNode\n        let forbiddenClientSegment: React.ReactNode\n        let unauthorizedClientSegment: React.ReactNode\n        // TODO-APP: This is a hack to support unmatched parallel routes, which will throw `notFound()`.\n        // This ensures that a `HTTPAccessFallbackBoundary` is available for when that happens,\n        // but it's not ideal, as it needlessly invokes the `NotFound` component and renders the `RootLayout` twice.\n        // We should instead look into handling the fallback behavior differently in development mode so that it doesn't\n        // rely on the `NotFound` behavior.\n        notfoundClientSegment = createErrorBoundaryClientSegmentRoot({\n          ctx,\n          ErrorBoundaryComponent: NotFound,\n          errorElement: notFoundElement,\n          ClientSegmentRoot,\n          layerAssets,\n          SegmentComponent,\n          currentParams,\n        })\n        forbiddenClientSegment = createErrorBoundaryClientSegmentRoot({\n          ctx,\n          ErrorBoundaryComponent: Forbidden,\n          errorElement: forbiddenElement,\n          ClientSegmentRoot,\n          layerAssets,\n          SegmentComponent,\n          currentParams,\n        })\n        unauthorizedClientSegment = createErrorBoundaryClientSegmentRoot({\n          ctx,\n          ErrorBoundaryComponent: Unauthorized,\n          errorElement: unauthorizedElement,\n          ClientSegmentRoot,\n          layerAssets,\n          SegmentComponent,\n          currentParams,\n        })\n        if (\n          notfoundClientSegment ||\n          forbiddenClientSegment ||\n          unauthorizedClientSegment\n        ) {\n          segmentNode = createElement(\n            HTTPAccessFallbackBoundary,\n            {\n              key: cacheNodeKey,\n              notFound: notfoundClientSegment,\n              forbidden: forbiddenClientSegment,\n              unauthorized: unauthorizedClientSegment,\n            },\n            layerAssets,\n            clientSegment\n          )\n        } else {\n          segmentNode = createElement(\n            Fragment,\n            {\n              key: cacheNodeKey,\n            },\n            layerAssets,\n            clientSegment\n          )\n        }\n      } else {\n        segmentNode = createElement(\n          Fragment,\n          {\n            key: cacheNodeKey,\n          },\n          layerAssets,\n          clientSegment\n        )\n      }\n    } else {\n      const params = createServerParamsForServerSegment(\n        currentParams,\n        optionalCatchAllParamName,\n        varyParamsAccumulator,\n        isRuntimePrefetchable\n      )\n\n      let serverSegment: React.ReactNode\n\n      if (isUseCacheFunction(SegmentComponent)) {\n        const UseCacheLayoutComponent: ComponentType<UseCacheLayoutProps> =\n          SegmentComponent\n\n        serverSegment = createElement(\n          UseCacheLayoutComponent,\n          {\n            ...parallelRouteProps,\n            params: params,\n            $$isLayout: true,\n          },\n          // Force static children here so that they're validated.\n          // See https://github.com/facebook/react/pull/34846\n          parallelRouteProps.children\n        )\n      } else {\n        serverSegment = createElement(\n          SegmentComponent,\n          {\n            ...parallelRouteProps,\n            params: params,\n          },\n          // Force static children here so that they're validated.\n          // See https://github.com/facebook/react/pull/34846\n          parallelRouteProps.children\n        )\n      }\n\n      if (isRootLayoutWithChildrenSlotAndAtLeastOneMoreSlot) {\n        // TODO-APP: This is a hack to support unmatched parallel routes, which will throw `notFound()`.\n        // This ensures that a `HTTPAccessFallbackBoundary` is available for when that happens,\n        // but it's not ideal, as it needlessly invokes the `NotFound` component and renders the `RootLayout` twice.\n        // We should instead look into handling the fallback behavior differently in development mode so that it doesn't\n        // rely on the `NotFound` behavior.\n        segmentNode = createElement(\n          HTTPAccessFallbackBoundary,\n          {\n            key: cacheNodeKey,\n            notFound: notFoundElement\n              ? createElement(\n                  Fragment,\n                  null,\n                  layerAssets,\n                  createElement(\n                    SegmentComponent,\n                    {\n                      params: params,\n                    },\n                    notFoundStyles,\n                    notFoundElement\n                  )\n                )\n              : undefined,\n          },\n          layerAssets,\n          serverSegment\n        )\n      } else {\n        segmentNode = createElement(\n          Fragment,\n          {\n            key: cacheNodeKey,\n          },\n          layerAssets,\n          serverSegment\n        )\n      }\n    }\n\n    const layoutFilePath = getConventionPathByType(tree, dir, 'layout')\n    const wrappedSegmentNode =\n      isSegmentViewEnabled && layoutFilePath\n        ? createElement(\n            SegmentViewNode,\n            {\n              key: 'layout',\n              type: 'layout',\n              pagePath: layoutFilePath,\n            },\n            segmentNode\n          )\n        : segmentNode\n\n    // For layouts we just render the component\n    return createSeedData(\n      ctx,\n      wrappedSegmentNode,\n      parallelRouteCacheNodeSeedData,\n      loadingData,\n      isPossiblyPartialResponse,\n      isRuntimePrefetchable,\n\n      varyParamsAccumulator\n    )\n  }\n}\n\nfunction createErrorBoundaryClientSegmentRoot({\n  ctx,\n  ErrorBoundaryComponent,\n  errorElement,\n  ClientSegmentRoot,\n  layerAssets,\n  SegmentComponent,\n  currentParams,\n}: {\n  ctx: AppRenderContext\n  ErrorBoundaryComponent: ComponentType<any> | undefined\n  errorElement: React.ReactNode\n  ClientSegmentRoot: ComponentType<any>\n  layerAssets: React.ReactNode\n  SegmentComponent: ComponentType<any>\n  currentParams: Params\n}) {\n  const {\n    componentMod: { createElement, Fragment },\n  } = ctx\n  if (ErrorBoundaryComponent) {\n    const notFoundParallelRouteProps = {\n      children: errorElement,\n    }\n    return createElement(\n      Fragment,\n      null,\n      layerAssets,\n      createElement(ClientSegmentRoot, {\n        Component: SegmentComponent,\n        slots: notFoundParallelRouteProps,\n        params: currentParams,\n      })\n    )\n  }\n  return null\n}\n\nexport function getRootParams(\n  loaderTree: LoaderTree,\n  getDynamicParamFromSegment: GetDynamicParamFromSegment\n): Params {\n  return getRootParamsImpl({}, loaderTree, getDynamicParamFromSegment)\n}\n\nfunction getRootParamsImpl(\n  parentParams: Params,\n  loaderTree: LoaderTree,\n  getDynamicParamFromSegment: GetDynamicParamFromSegment\n): Params {\n  const {\n    modules: { layout },\n    parallelRoutes,\n  } = parseLoaderTree(loaderTree)\n\n  const segmentParam = getDynamicParamFromSegment(loaderTree)\n\n  let currentParams: Params = parentParams\n  if (segmentParam && segmentParam.value !== null) {\n    currentParams = {\n      ...parentParams,\n      [segmentParam.param]: segmentParam.value,\n    }\n  }\n\n  const isRootLayout = typeof layout !== 'undefined'\n\n  if (isRootLayout) {\n    return currentParams\n  } else if (!parallelRoutes.children) {\n    // This should really be an error but there are bugs in Turbopack that cause\n    // the _not-found LoaderTree to not have any layouts. For rootParams sake\n    // this is somewhat irrelevant when you are not customizing the 404 page.\n    // If you are customizing 404\n    // TODO update rootParams to make all params optional if `/app/not-found.tsx` is defined\n    return currentParams\n  } else {\n    return getRootParamsImpl(\n      currentParams,\n      // We stop looking for root params as soon as we hit the first layout\n      // and it is not possible to use parallel route children above the root layout\n      // so every parallelRoutes object that this function can visit will necessarily\n      // have a single `children` prop and no others.\n      parallelRoutes.children,\n      getDynamicParamFromSegment\n    )\n  }\n}\n\nasync function createBoundaryConventionElement({\n  ctx,\n  conventionName,\n  Component,\n  styles,\n  tree,\n}: {\n  ctx: AppRenderContext\n  conventionName:\n    | 'not-found'\n    | 'error'\n    | 'loading'\n    | 'forbidden'\n    | 'unauthorized'\n  Component: ComponentType<any> | undefined\n  styles: React.ReactNode | undefined\n  tree: LoaderTree\n}) {\n  const {\n    componentMod: { createElement, Fragment },\n  } = ctx\n  const isSegmentViewEnabled = !!process.env.__NEXT_DEV_SERVER\n  const dir =\n    (process.env.NEXT_RUNTIME === 'edge'\n      ? process.env.__NEXT_EDGE_PROJECT_DIR\n      : ctx.renderOpts.dir) || ''\n  const { SegmentViewNode } = ctx.componentMod\n  const element = Component\n    ? createElement(Fragment, null, createElement(Component, null), styles)\n    : undefined\n\n  const pagePath = getConventionPathByType(tree, dir, conventionName)\n\n  const wrappedElement =\n    isSegmentViewEnabled && element\n      ? createElement(\n          SegmentViewNode,\n          {\n            key: cacheNodeKey + '-' + conventionName,\n            type: conventionName,\n            // TODO: Discovered when moving to `createElement`.\n            // `SegmentViewNode` doesn't support undefined `pagePath`\n            pagePath: pagePath!,\n          },\n          element\n        )\n      : element\n\n  return [wrappedElement, pagePath] as const\n}\n\nfunction createSeedData(\n  ctx: AppRenderContext,\n  rsc: React.ReactNode,\n  parallelRoutes: Record<string, CacheNodeSeedData | null>,\n  loading: LoadingModuleData | null,\n  isPossiblyPartialResponse: boolean,\n  isRuntimePrefetchable: boolean,\n  varyParamsAccumulator: VaryParamsAccumulator | null\n): CacheNodeSeedData {\n  const createElement = ctx.componentMod.createElement\n\n  // When this segment is NOT runtime-prefetchable, delay it until the Static\n  // stage by wrapping the node in a promise. This allows runtime-prefetchable\n  // segments (the lower tree) to render first during EarlyStatic, so their\n  // runtime data resolves in EarlyRuntime where sync IO can be checked.\n  // React will suspend on the thenable and resume when the stage advances.\n  if (!isRuntimePrefetchable) {\n    const workUnitStore = workUnitAsyncStorage.getStore()\n    if (workUnitStore) {\n      let stagedRendering: StagedRenderingController | null | undefined\n      switch (workUnitStore.type) {\n        case 'request':\n        case 'prerender-runtime':\n          stagedRendering = workUnitStore.stagedRendering\n          if (stagedRendering) {\n            const deferredRsc = rsc\n            rsc = stagedRendering\n              .waitForStage(RenderStage.Static)\n              .then(() => deferredRsc)\n          }\n          break\n        case 'prerender':\n        case 'prerender-client':\n        case 'validation-client':\n        case 'prerender-ppr':\n        case 'prerender-legacy':\n        case 'cache':\n        case 'private-cache':\n        case 'unstable-cache':\n        case 'generate-static-params':\n          break\n        default:\n          workUnitStore satisfies never\n      }\n    }\n  }\n\n  if (loading !== null) {\n    // If a loading.tsx boundary is present, wrap the component data in an\n    // additional context provider to pass the loading data to the next\n    // set of children.\n    // NOTE: The reason this is a separate wrapper from LayoutRouter is because\n    // not all segments render a LayoutRouter component, e.g. the root segment.\n    const LoadingBoundaryProvider = ctx.componentMod.LoadingBoundaryProvider\n    rsc = createElement(LoadingBoundaryProvider, {\n      loading: loading,\n      children: rsc,\n    })\n  }\n  return [\n    rsc,\n    parallelRoutes,\n    null,\n    isPossiblyPartialResponse,\n    varyParamsAccumulator ? getVaryParamsThenable(varyParamsAccumulator) : null,\n  ]\n}\n"],"names":["isClientReference","isUseCacheFunction","getLayoutOrPageModule","interopDefault","parseLoaderTree","createComponentStylesAndScripts","getLayerAssets","hasLoadingComponentInTree","validateRevalidate","PARALLEL_ROUTE_DEFAULT_PATH","getTracer","NextNodeServerSpan","StaticGenBailoutError","workUnitAsyncStorage","createVaryParamsAccumulator","emptyVaryParamsAccumulator","getVaryParamsThenable","DEFAULT_SEGMENT_KEY","BOUNDARY_PREFIX","BOUNDARY_SUFFIX","BUILTIN_PREFIX","getConventionPathByType","isNextjsBuiltinFilePath","RenderStage","createComponentTree","props","trace","spanName","createComponentTreeInternal","errorMissingDefaultExport","pagePath","convention","normalizedPagePath","Error","cacheNodeKey","loaderTree","tree","parentParams","parentOptionalCatchAllParamName","parentRuntimePrefetchable","rootLayoutIncluded","injectedCSS","injectedJS","injectedFontPreloadTags","ctx","missingSlots","preloadCallbacks","authInterrupts","MetadataOutlet","prerenderHTTPError","isRoot","renderOpts","nextConfigOutput","experimental","cacheComponents","workStore","componentMod","createElement","Fragment","SegmentViewNode","HTTPAccessFallbackBoundary","LayoutRouter","RenderFromTemplateContext","ClientPageRoot","ClientSegmentRoot","createServerSearchParamsForServerPage","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createPrerenderParamsForClientSegment","serverHooks","DynamicServerError","Postpone","getDynamicParamFromSegment","isPrefetch","query","page","conventionPath","segment","modules","parallelRoutes","layout","template","error","loading","notFound","forbidden","unauthorized","injectedCSSWithCurrentLayout","Set","injectedJSWithCurrentLayout","injectedFontPreloadTagsWithCurrentLayout","layerAssets","layoutOrPagePath","Template","templateStyles","templateScripts","filePath","getComponent","ErrorComponent","errorStyles","errorScripts","Loading","loadingStyles","loadingScripts","isLayout","isPage","mod","layoutOrPageMod","modType","hideSpan","attributes","rootLayoutAtThisLevel","rootLayoutIncludedAtThisLevelOrAbove","NotFound","notFoundStyles","instantConfig","unstable_instant","undefined","hasRuntimePrefetch","prefetch","isRuntimePrefetchable","Forbidden","forbiddenStyles","Unauthorized","unauthorizedStyles","dynamic","dynamicShouldError","forceDynamic","isStaticGeneration","isRoutePPREnabled","err","dynamicUsageDescription","message","dynamicUsageStack","stack","forceStatic","fetchCache","revalidate","route","defaultRevalidate","workUnitStore","getStore","type","unstable_dynamicStaleTime","pageStaleTime","stale","isPossiblyPartialResponse","LayoutOrPage","MaybeComponent","process","env","NODE_ENV","isValidElementType","require","segmentParam","currentParams","value","param","optionalCatchAllParamName","isSegmentViewEnabled","__NEXT_DEV_SERVER","dir","NEXT_RUNTIME","__NEXT_EDGE_PROJECT_DIR","notFoundElement","notFoundFilePath","createBoundaryConventionElement","conventionName","Component","styles","forbiddenElement","unauthorizedElement","parallelRouteMap","Promise","all","Object","keys","map","parallelRouteKey","isChildrenRouteKey","parallelRoute","notFoundComponent","forbiddenComponent","unauthorizedComponent","childCacheNodeSeedData","parsedTree","endsWith","add","shouldRenderPrerenderHTTPFallback","boundaryTree","fallbackElement","triggeredStatus","createSeedData","seedData","templateNode","templateFilePath","errorFilePath","loadingFilePath","globalErrorFilePath","wrappedErrorStyles","fileNameSuffix","segmentViewBoundaries","parallelRouterKey","parallelRouteProps","parallelRouteCacheNodeSeedData","parallelRouteProp","flightData","loadingElement","key","loadingData","children","reason","isClientComponent","varyParamsAccumulator","console","PageComponent","pageElement","serverProvidedParams","promiseOfParams","promiseOfSearchParams","searchParams","params","promises","UseCachePageComponent","$$isPage","isDefaultSegment","pageFilePath","segmentType","wrappedPageElement","SegmentComponent","isRootLayoutWithChildrenSlotAndAtLeastOneMoreSlot","length","segmentNode","clientSegment","slots","notfoundClientSegment","forbiddenClientSegment","unauthorizedClientSegment","createErrorBoundaryClientSegmentRoot","ErrorBoundaryComponent","errorElement","serverSegment","UseCacheLayoutComponent","$$isLayout","layoutFilePath","wrappedSegmentNode","notFoundParallelRouteProps","getRootParams","getRootParamsImpl","isRootLayout","element","wrappedElement","rsc","stagedRendering","deferredRsc","waitForStage","Static","then","LoadingBoundaryProvider"],"mappings":"AAMA,SACEA,iBAAiB,EACjBC,kBAAkB,QACb,yCAAwC;AAC/C,SAASC,qBAAqB,QAAQ,wBAAuB;AAE7D,SAASC,cAAc,QAAQ,oBAAmB;AAClD,SAASC,eAAe,QAAQ,kDAAiD;AAEjF,SAASC,+BAA+B,QAAQ,wCAAuC;AACvF,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,yBAAyB,QAAQ,kCAAiC;AAC3E,SAASC,kBAAkB,QAAQ,qBAAoB;AACvD,SAASC,2BAA2B,QAAQ,0CAAyC;AACrF,SAASC,SAAS,QAAQ,sBAAqB;AAC/C,SAASC,kBAAkB,QAAQ,yBAAwB;AAC3D,SAASC,qBAAqB,QAAQ,oDAAmD;AAEzF,SAASC,oBAAoB,QAAQ,qCAAoC;AACzE,SACEC,2BAA2B,EAC3BC,0BAA0B,EAC1BC,qBAAqB,QAEhB,gBAAe;AAKtB,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SACEC,eAAe,EACfC,eAAe,EACfC,cAAc,EACdC,uBAAuB,EACvBC,uBAAuB,QAClB,0BAAyB;AAEhC,SAASC,WAAW,QAAwC,qBAAoB;AAShF;;CAEC,GACD,4FAA4F;AAC5F,OAAO,SAASC,oBAAoBC,KAenC;IACC,OAAOf,YAAYgB,KAAK,CACtBf,mBAAmBa,mBAAmB,EACtC;QACEG,UAAU;IACZ,GACA,IAAMC,4BAA4BH,OAAO;AAE7C;AAEA,SAASI,0BACPC,QAAgB,EAChBC,UAAkB;IAElB,MAAMC,qBAAqBF,aAAa,MAAM,KAAKA;IACnD,MAAM,qBAEL,CAFK,IAAIG,MACR,CAAC,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