{"version":3,"sources":["../../src/server/config.ts"],"sourcesContent":["import { existsSync } from 'fs'\nimport { basename, extname, join, relative, isAbsolute, resolve } from 'path'\nimport { pathToFileURL } from 'url'\nimport findUp from 'next/dist/compiled/find-up'\nimport * as Log from '../build/output/log'\nimport * as ciEnvironment from '../server/ci-info'\nimport {\n  CONFIG_FILES,\n  PHASE_DEVELOPMENT_SERVER,\n  PHASE_EXPORT,\n  PHASE_PRODUCTION_BUILD,\n  PHASE_PRODUCTION_SERVER,\n} from '../shared/lib/constants'\nimport { defaultConfig, normalizeConfig } from './config-shared'\nimport type {\n  ExperimentalConfig,\n  NextConfigComplete,\n  NextConfig,\n  TurbopackLoaderItem,\n  NextAdapter,\n} from './config-shared'\n\nimport { loadWebpackHook } from './config-utils'\nimport { imageConfigDefault } from '../shared/lib/image-config'\nimport type { ImageConfig } from '../shared/lib/image-config'\nimport { loadEnvConfig, updateInitialEnv } from '@next/env'\nimport { flushAndExit } from '../telemetry/flush-and-exit'\nimport { findRootDir } from '../lib/find-root'\nimport { setHttpClientAndAgentOptions } from './setup-http-agent-env'\nimport { pathHasPrefix } from '../shared/lib/router/utils/path-has-prefix'\nimport { matchRemotePattern } from '../shared/lib/match-remote-pattern'\n\nimport type { ZodError } from 'next/dist/compiled/zod'\nimport { hasNextSupport } from '../server/ci-info'\nimport { transpileConfig } from '../build/next-config-ts/transpile-config'\nimport { dset } from '../shared/lib/dset'\nimport { normalizeZodErrors } from '../shared/lib/zod'\nimport { HTML_LIMITED_BOT_UA_RE_STRING } from '../shared/lib/router/utils/is-bot'\nimport { findDir } from '../lib/find-pages-dir'\nimport { CanaryOnlyError, isStableBuild } from '../shared/lib/canary-only'\nimport { interopDefault } from '../lib/interop-default'\nimport { djb2Hash } from '../shared/lib/hash'\n\nexport { normalizeConfig } from './config-shared'\nexport type { DomainLocale, NextConfig } from './config-shared'\n\nfunction normalizeNextConfigZodErrors(\n  error: ZodError<NextConfig>\n): [errorMessages: string[], shouldExit: boolean] {\n  let shouldExit = false\n  const issues = normalizeZodErrors(error)\n  return [\n    issues.flatMap(({ issue, message }) => {\n      if (issue.path[0] === 'images') {\n        // We exit the build when encountering an error in the images config\n        shouldExit = true\n      }\n\n      return message\n    }),\n    shouldExit,\n  ]\n}\n\nexport function warnOptionHasBeenDeprecated(\n  config: NextConfig,\n  nestedPropertyKey: string,\n  reason: string,\n  silent: boolean\n): boolean {\n  let hasWarned = false\n  if (!silent) {\n    let current = config\n    let found = true\n    const nestedPropertyKeys = nestedPropertyKey.split('.')\n    for (const key of nestedPropertyKeys) {\n      if (current[key] !== undefined) {\n        current = current[key]\n      } else {\n        found = false\n        break\n      }\n    }\n    if (found) {\n      Log.warnOnce(reason)\n      hasWarned = true\n    }\n  }\n  return hasWarned\n}\n\nfunction checkDeprecations(\n  userConfig: NextConfig,\n  configFileName: string,\n  silent: boolean,\n  dir: string\n) {\n  warnOptionHasBeenDeprecated(\n    userConfig,\n    'amp',\n    `Built-in amp support is deprecated and the \\`amp\\` configuration option will be removed in Next.js 16.`,\n    silent\n  )\n\n  warnOptionHasBeenDeprecated(\n    userConfig,\n    'experimental.amp',\n    `Built-in amp support is deprecated and the \\`experimental.amp\\` configuration option will be removed in Next.js 16.`,\n    silent\n  )\n\n  warnOptionHasBeenDeprecated(\n    userConfig,\n    'publicRuntimeConfig',\n    `Runtime config is deprecated and the \\`publicRuntimeConfig\\` configuration option will be removed in Next.js 16.`,\n    silent\n  )\n  warnOptionHasBeenDeprecated(\n    userConfig,\n    'serverRuntimeConfig',\n    `Runtime config is deprecated and the \\`serverRuntimeConfig\\` configuration option will be removed in Next.js 16.`,\n    silent\n  )\n\n  if (userConfig.experimental?.dynamicIO !== undefined) {\n    warnOptionHasBeenDeprecated(\n      userConfig,\n      'experimental.dynamicIO',\n      `\\`experimental.dynamicIO\\` has been renamed to \\`experimental.cacheComponents\\`. Please update your ${configFileName} file accordingly.`,\n      silent\n    )\n  }\n\n  warnOptionHasBeenDeprecated(\n    userConfig,\n    'experimental.instrumentationHook',\n    `\\`experimental.instrumentationHook\\` is no longer needed, because \\`instrumentation.js\\` is available by default. You can remove it from ${configFileName}.`,\n    silent\n  )\n\n  warnOptionHasBeenDeprecated(\n    userConfig,\n    'experimental.after',\n    `\\`experimental.after\\` is no longer needed, because \\`after\\` is available by default. You can remove it from ${configFileName}.`,\n    silent\n  )\n\n  warnOptionHasBeenDeprecated(\n    userConfig,\n    'devIndicators.appIsrStatus',\n    `\\`devIndicators.appIsrStatus\\` is deprecated and no longer configurable. Please remove it from ${configFileName}.`,\n    silent\n  )\n\n  warnOptionHasBeenDeprecated(\n    userConfig,\n    'devIndicators.buildActivity',\n    `\\`devIndicators.buildActivity\\` is deprecated and no longer configurable. Please remove it from ${configFileName}.`,\n    silent\n  )\n\n  warnOptionHasBeenDeprecated(\n    userConfig,\n    'devIndicators.buildActivityPosition',\n    `\\`devIndicators.buildActivityPosition\\` has been renamed to \\`devIndicators.position\\`. Please update your ${configFileName} file accordingly.`,\n    silent\n  )\n\n  // i18n deprecation for App Router\n  if (userConfig.i18n) {\n    const hasAppDir = Boolean(findDir(dir, 'app'))\n    if (hasAppDir) {\n      warnOptionHasBeenDeprecated(\n        userConfig,\n        'i18n',\n        `i18n configuration in ${configFileName} is unsupported in App Router.\\nLearn more about internationalization in App Router: https://nextjs.org/docs/app/building-your-application/routing/internationalization`,\n        silent\n      )\n    }\n  }\n}\n\nexport function warnOptionHasBeenMovedOutOfExperimental(\n  config: NextConfig,\n  oldExperimentalKey: string,\n  newKey: string,\n  configFileName: string,\n  silent: boolean\n) {\n  if (config.experimental && oldExperimentalKey in config.experimental) {\n    if (!silent) {\n      Log.warn(\n        `\\`experimental.${oldExperimentalKey}\\` has been moved to \\`${newKey}\\`. ` +\n          `Please update your ${configFileName} file accordingly.`\n      )\n    }\n\n    let current = config\n    const newKeys = newKey.split('.')\n    while (newKeys.length > 1) {\n      const key = newKeys.shift()!\n      current[key] = current[key] || {}\n      current = current[key]\n    }\n    current[newKeys.shift()!] = (config.experimental as any)[oldExperimentalKey]\n  }\n\n  return config\n}\n\nfunction warnCustomizedOption(\n  config: NextConfig,\n  key: string,\n  defaultValue: any,\n  customMessage: string,\n  configFileName: string,\n  silent: boolean\n) {\n  const segs = key.split('.')\n  let current = config\n\n  while (segs.length >= 1) {\n    const seg = segs.shift()!\n    if (!(seg in current)) {\n      return\n    }\n    current = current[seg]\n  }\n\n  if (!silent && current !== defaultValue) {\n    Log.warn(\n      `The \"${key}\" option has been modified. ${customMessage ? customMessage + '. ' : ''}It should be removed from your ${configFileName}.`\n    )\n  }\n}\n\nfunction assignDefaults(\n  dir: string,\n  userConfig: NextConfig & { configFileName: string },\n  silent: boolean\n): NextConfigComplete {\n  const configFileName = userConfig.configFileName\n  if (typeof userConfig.exportTrailingSlash !== 'undefined') {\n    if (!silent) {\n      Log.warn(\n        `The \"exportTrailingSlash\" option has been renamed to \"trailingSlash\". Please update your ${configFileName}.`\n      )\n    }\n    if (typeof userConfig.trailingSlash === 'undefined') {\n      userConfig.trailingSlash = userConfig.exportTrailingSlash\n    }\n    delete userConfig.exportTrailingSlash\n  }\n\n  // Handle migration of experimental.dynamicIO to experimental.cacheComponents\n  if (userConfig.experimental?.dynamicIO !== undefined) {\n    // If cacheComponents was not explicitly set by the user (i.e., it's still the default value),\n    // use the dynamicIO value. We check against the user config, not the merged result.\n    if (userConfig.experimental?.cacheComponents === undefined) {\n      userConfig.experimental.cacheComponents =\n        userConfig.experimental.dynamicIO\n    }\n\n    // Remove the deprecated property\n    delete userConfig.experimental.dynamicIO\n  }\n\n  const config = Object.keys(userConfig).reduce<{ [key: string]: any }>(\n    (currentConfig, key) => {\n      const value = userConfig[key]\n\n      if (value === undefined || value === null) {\n        return currentConfig\n      }\n\n      if (key === 'distDir') {\n        if (typeof value !== 'string') {\n          throw new Error(\n            `Specified distDir is not a string, found type \"${typeof value}\"`\n          )\n        }\n        const userDistDir = value.trim()\n\n        // don't allow public as the distDir as this is a reserved folder for\n        // public files\n        if (userDistDir === 'public') {\n          throw new Error(\n            `The 'public' directory is reserved in Next.js and can not be set as the 'distDir'. https://nextjs.org/docs/messages/can-not-output-to-public`\n          )\n        }\n        // make sure distDir isn't an empty string as it can result in the provided\n        // directory being deleted in development mode\n        if (userDistDir.length === 0) {\n          throw new Error(\n            `Invalid distDir provided, distDir can not be an empty string. Please remove this config or set it to undefined`\n          )\n        }\n      }\n\n      if (key === 'pageExtensions') {\n        if (!Array.isArray(value)) {\n          throw new Error(\n            `Specified pageExtensions is not an array of strings, found \"${value}\". Please update this config or remove it.`\n          )\n        }\n\n        if (!value.length) {\n          throw new Error(\n            `Specified pageExtensions is an empty array. Please update it with the relevant extensions or remove it.`\n          )\n        }\n\n        value.forEach((ext) => {\n          if (typeof ext !== 'string') {\n            throw new Error(\n              `Specified pageExtensions is not an array of strings, found \"${ext}\" of type \"${typeof ext}\". Please update this config or remove it.`\n            )\n          }\n        })\n      }\n\n      const defaultValue = (defaultConfig as Record<string, unknown>)[key]\n\n      if (\n        !!value &&\n        value.constructor === Object &&\n        typeof defaultValue === 'object'\n      ) {\n        currentConfig[key] = {\n          ...defaultValue,\n          ...Object.keys(value).reduce<any>((c, k) => {\n            const v = value[k]\n            if (v !== undefined && v !== null) {\n              c[k] = v\n            }\n            return c\n          }, {}),\n        }\n      } else {\n        currentConfig[key] = value\n      }\n\n      return currentConfig\n    },\n    {}\n  ) as NextConfig & { configFileName: string }\n\n  const result = {\n    ...defaultConfig,\n    ...config,\n    experimental: {\n      ...defaultConfig.experimental,\n      ...config.experimental,\n    },\n  }\n\n  // ensure correct default is set for api-resolver revalidate handling\n  if (!result.experimental?.trustHostHeader && ciEnvironment.hasNextSupport) {\n    result.experimental.trustHostHeader = true\n  }\n\n  if (\n    result.experimental?.allowDevelopmentBuild &&\n    process.env.NODE_ENV !== 'development'\n  ) {\n    throw new Error(\n      `The experimental.allowDevelopmentBuild option requires NODE_ENV to be explicitly set to 'development'.`\n    )\n  }\n\n  if (isStableBuild()) {\n    // Prevents usage of certain experimental features outside of canary\n    if (result.experimental?.ppr) {\n      throw new CanaryOnlyError({ feature: 'experimental.ppr' })\n    } else if (result.experimental?.cacheComponents) {\n      throw new CanaryOnlyError({ feature: 'experimental.cacheComponents' })\n    } else if (result.experimental?.turbopackPersistentCaching) {\n      throw new CanaryOnlyError({\n        feature: 'experimental.turbopackPersistentCaching',\n      })\n    }\n  }\n\n  if (result.output === 'export') {\n    if (result.i18n) {\n      throw new Error(\n        'Specified \"i18n\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-i18n'\n      )\n    }\n\n    if (!hasNextSupport) {\n      if (result.rewrites) {\n        Log.warn(\n          'Specified \"rewrites\" will not automatically work with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes'\n        )\n      }\n      if (result.redirects) {\n        Log.warn(\n          'Specified \"redirects\" will not automatically work with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes'\n        )\n      }\n      if (result.headers) {\n        Log.warn(\n          'Specified \"headers\" will not automatically work with \"output: export\". See more info here: https://nextjs.org/docs/messages/export-no-custom-routes'\n        )\n      }\n    }\n  }\n\n  if (typeof result.assetPrefix !== 'string') {\n    throw new Error(\n      `Specified assetPrefix is not a string, found type \"${typeof result.assetPrefix}\" https://nextjs.org/docs/messages/invalid-assetprefix`\n    )\n  }\n\n  if (typeof result.basePath !== 'string') {\n    throw new Error(\n      `Specified basePath is not a string, found type \"${typeof result.basePath}\"`\n    )\n  }\n\n  if (result.basePath !== '') {\n    if (result.basePath === '/') {\n      throw new Error(\n        `Specified basePath /. basePath has to be either an empty string or a path prefix\"`\n      )\n    }\n\n    if (!result.basePath.startsWith('/')) {\n      throw new Error(\n        `Specified basePath has to start with a /, found \"${result.basePath}\"`\n      )\n    }\n\n    if (result.basePath !== '/') {\n      if (result.basePath.endsWith('/')) {\n        throw new Error(\n          `Specified basePath should not end with /, found \"${result.basePath}\"`\n        )\n      }\n\n      if (result.assetPrefix === '') {\n        result.assetPrefix = result.basePath\n      }\n\n      if (result.amp?.canonicalBase === '') {\n        result.amp.canonicalBase = result.basePath\n      }\n    }\n  }\n\n  if (result?.images) {\n    const images: ImageConfig = result.images\n\n    if (typeof images !== 'object') {\n      throw new Error(\n        `Specified images should be an object received ${typeof images}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n      )\n    }\n\n    if (images.localPatterns) {\n      if (!Array.isArray(images.localPatterns)) {\n        throw new Error(\n          `Specified images.localPatterns should be an Array received ${typeof images.localPatterns}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n        )\n      }\n      // avoid double-pushing the same pattern if it already exists\n      const hasMatch = images.localPatterns.some(\n        (pattern) =>\n          pattern.pathname === '/_next/static/media/**' && pattern.search === ''\n      )\n      if (!hasMatch) {\n        // static import images are automatically allowed\n        images.localPatterns.push({\n          pathname: '/_next/static/media/**',\n          search: '',\n        })\n      }\n    }\n\n    if (images.remotePatterns) {\n      if (!Array.isArray(images.remotePatterns)) {\n        throw new Error(\n          `Specified images.remotePatterns should be an Array received ${typeof images.remotePatterns}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n        )\n      }\n\n      // We must convert URL to RemotePattern since URL has a colon in the protocol\n      // and also has additional properties we want to filter out. Also, new URL()\n      // accepts any protocol so we need manual validation here.\n      images.remotePatterns = images.remotePatterns.map(\n        ({ protocol, hostname, port, pathname, search }) => {\n          const proto = protocol?.replace(/:$/, '')\n          if (!['http', 'https', undefined].includes(proto)) {\n            throw new Error(\n              `Specified images.remotePatterns must have protocol \"http\" or \"https\" received \"${proto}\".`\n            )\n          }\n          return {\n            protocol: proto as 'http' | 'https' | undefined,\n            hostname,\n            port,\n            pathname,\n            search,\n          }\n        }\n      )\n\n      // static images are automatically prefixed with assetPrefix\n      // so we need to ensure _next/image allows downloading from\n      // this resource\n      if (config.assetPrefix?.startsWith('http')) {\n        try {\n          const url = new URL(config.assetPrefix)\n          const hasMatchForAssetPrefix = images.remotePatterns.some((pattern) =>\n            matchRemotePattern(pattern, url)\n          )\n\n          // avoid double-pushing the same pattern if it already can be matched\n          if (!hasMatchForAssetPrefix) {\n            images.remotePatterns.push({\n              hostname: url.hostname,\n              protocol: url.protocol.replace(/:$/, '') as 'http' | 'https',\n              port: url.port,\n            })\n          }\n        } catch (error) {\n          throw new Error(\n            `Invalid assetPrefix provided. Original error: ${error}`\n          )\n        }\n      }\n    }\n\n    if (images.domains) {\n      if (!Array.isArray(images.domains)) {\n        throw new Error(\n          `Specified images.domains should be an Array received ${typeof images.domains}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-images-config`\n        )\n      }\n    }\n\n    if (!images.loader) {\n      images.loader = 'default'\n    }\n\n    if (\n      images.loader !== 'default' &&\n      images.loader !== 'custom' &&\n      images.path === imageConfigDefault.path\n    ) {\n      throw new Error(\n        `Specified images.loader property (${images.loader}) also requires images.path property to be assigned to a URL prefix.\\nSee more info here: https://nextjs.org/docs/api-reference/next/legacy/image#loader-configuration`\n      )\n    }\n\n    if (\n      images.path === imageConfigDefault.path &&\n      result.basePath &&\n      !pathHasPrefix(images.path, result.basePath)\n    ) {\n      images.path = `${result.basePath}${images.path}`\n    }\n\n    // Append trailing slash for non-default loaders and when trailingSlash is set\n    if (\n      images.path &&\n      !images.path.endsWith('/') &&\n      (images.loader !== 'default' || result.trailingSlash)\n    ) {\n      images.path += '/'\n    }\n\n    if (images.loaderFile) {\n      if (images.loader !== 'default' && images.loader !== 'custom') {\n        throw new Error(\n          `Specified images.loader property (${images.loader}) cannot be used with images.loaderFile property. Please set images.loader to \"custom\".`\n        )\n      }\n      const absolutePath = join(dir, images.loaderFile)\n      if (!existsSync(absolutePath)) {\n        throw new Error(\n          `Specified images.loaderFile does not exist at \"${absolutePath}\".`\n        )\n      }\n      images.loaderFile = absolutePath\n    }\n  }\n\n  warnCustomizedOption(\n    result,\n    'experimental.esmExternals',\n    true,\n    'experimental.esmExternals is not recommended to be modified as it may disrupt module resolution',\n    configFileName,\n    silent\n  )\n\n  // Handle buildActivityPosition migration (needs to be done after merging with defaults)\n  if (\n    result.devIndicators &&\n    typeof result.devIndicators === 'object' &&\n    'buildActivityPosition' in result.devIndicators &&\n    result.devIndicators.buildActivityPosition !== result.devIndicators.position\n  ) {\n    if (!silent) {\n      Log.warnOnce(\n        `The \\`devIndicators\\` option \\`buildActivityPosition\\` (\"${result.devIndicators.buildActivityPosition}\") conflicts with \\`position\\` (\"${result.devIndicators.position}\"). Using \\`buildActivityPosition\\` (\"${result.devIndicators.buildActivityPosition}\") for backward compatibility.`\n      )\n    }\n    result.devIndicators.position = result.devIndicators.buildActivityPosition\n  }\n\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'bundlePagesExternals',\n    'bundlePagesRouterDependencies',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'serverComponentsExternalPackages',\n    'serverExternalPackages',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'relay',\n    'compiler.relay',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'styledComponents',\n    'compiler.styledComponents',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'emotion',\n    'compiler.emotion',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'reactRemoveProperties',\n    'compiler.reactRemoveProperties',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'removeConsole',\n    'compiler.removeConsole',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'swrDelta',\n    'expireTime',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'typedRoutes',\n    'typedRoutes',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'outputFileTracingRoot',\n    'outputFileTracingRoot',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'outputFileTracingIncludes',\n    'outputFileTracingIncludes',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'outputFileTracingExcludes',\n    'outputFileTracingExcludes',\n    configFileName,\n    silent\n  )\n\n  if ((result.experimental as any).outputStandalone) {\n    if (!silent) {\n      Log.warn(\n        `experimental.outputStandalone has been renamed to \"output: 'standalone'\", please move the config.`\n      )\n    }\n    result.output = 'standalone'\n  }\n\n  if (\n    typeof result.experimental?.serverActions?.bodySizeLimit !== 'undefined'\n  ) {\n    const value = parseInt(\n      result.experimental.serverActions?.bodySizeLimit.toString()\n    )\n    if (isNaN(value) || value < 1) {\n      throw new Error(\n        'Server Actions Size Limit must be a valid number or filesize format larger than 1MB: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit'\n      )\n    }\n  }\n\n  // Normalize & validate experimental.middlewareClientMaxBodySize\n  if (typeof result.experimental?.middlewareClientMaxBodySize !== 'undefined') {\n    const middlewareClientMaxBodySize =\n      result.experimental.middlewareClientMaxBodySize\n    let normalizedValue: number\n\n    if (typeof middlewareClientMaxBodySize === 'string') {\n      const bytes =\n        require('next/dist/compiled/bytes') as typeof import('next/dist/compiled/bytes')\n      normalizedValue = bytes.parse(middlewareClientMaxBodySize)\n    } else if (typeof middlewareClientMaxBodySize === 'number') {\n      normalizedValue = middlewareClientMaxBodySize\n    } else {\n      throw new Error(\n        'Client Max Body Size must be a valid number (bytes) or filesize format string (e.g., \"5mb\")'\n      )\n    }\n\n    if (isNaN(normalizedValue) || normalizedValue < 1) {\n      throw new Error('Client Max Body Size must be larger than 0 bytes')\n    }\n\n    // Store the normalized value as a number\n    result.experimental.middlewareClientMaxBodySize = normalizedValue\n  }\n\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'transpilePackages',\n    'transpilePackages',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'skipMiddlewareUrlNormalize',\n    'skipMiddlewareUrlNormalize',\n    configFileName,\n    silent\n  )\n  warnOptionHasBeenMovedOutOfExperimental(\n    result,\n    'skipTrailingSlashRedirect',\n    'skipTrailingSlashRedirect',\n    configFileName,\n    silent\n  )\n\n  if (\n    result?.outputFileTracingRoot &&\n    !isAbsolute(result.outputFileTracingRoot)\n  ) {\n    result.outputFileTracingRoot = resolve(result.outputFileTracingRoot)\n    if (!silent) {\n      Log.warn(\n        `outputFileTracingRoot should be absolute, using: ${result.outputFileTracingRoot}`\n      )\n    }\n  }\n\n  if (result?.turbopack?.root && !isAbsolute(result.turbopack.root)) {\n    result.turbopack.root = resolve(result.turbopack.root)\n    if (!silent) {\n      Log.warn(\n        `turbopack.root should be absolute, using: ${result.turbopack.root}`\n      )\n    }\n  }\n\n  // only leverage deploymentId\n  if (process.env.NEXT_DEPLOYMENT_ID) {\n    result.deploymentId = process.env.NEXT_DEPLOYMENT_ID\n  }\n\n  const tracingRoot = result?.outputFileTracingRoot\n  const turbopackRoot = result?.turbopack?.root\n\n  // If both provided, validate they match. If not, use outputFileTracingRoot.\n  if (tracingRoot && turbopackRoot && tracingRoot !== turbopackRoot) {\n    Log.warn(\n      `Both \\`outputFileTracingRoot\\` and \\`turbopack.root\\` are set, but they must have the same value.\\n` +\n        `Using \\`outputFileTracingRoot\\` value: ${tracingRoot}.`\n    )\n  }\n\n  const rootDir = tracingRoot || turbopackRoot || findRootDir(dir)\n\n  if (!rootDir) {\n    throw new Error(\n      'Failed to find the root directory of the project. This is a bug in Next.js.'\n    )\n  }\n\n  // Ensure both properties are set to the same value\n  result.outputFileTracingRoot = rootDir\n  dset(result, ['turbopack', 'root'], rootDir)\n\n  setHttpClientAndAgentOptions(result || defaultConfig)\n\n  if (result.i18n) {\n    const { i18n } = result\n    const i18nType = typeof i18n\n\n    if (i18nType !== 'object') {\n      throw new Error(\n        `Specified i18n should be an object received ${i18nType}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n      )\n    }\n\n    if (!Array.isArray(i18n.locales)) {\n      throw new Error(\n        `Specified i18n.locales should be an Array received ${typeof i18n.locales}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n      )\n    }\n\n    if (i18n.locales.length > 100 && !silent) {\n      Log.warn(\n        `Received ${i18n.locales.length} i18n.locales items which exceeds the recommended max of 100.\\nSee more info here: https://nextjs.org/docs/advanced-features/i18n-routing#how-does-this-work-with-static-generation`\n      )\n    }\n\n    const defaultLocaleType = typeof i18n.defaultLocale\n\n    if (!i18n.defaultLocale || defaultLocaleType !== 'string') {\n      throw new Error(\n        `Specified i18n.defaultLocale should be a string.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n      )\n    }\n\n    if (typeof i18n.domains !== 'undefined' && !Array.isArray(i18n.domains)) {\n      throw new Error(\n        `Specified i18n.domains must be an array of domain objects e.g. [ { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] } ] received ${typeof i18n.domains}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n      )\n    }\n\n    if (i18n.domains) {\n      const invalidDomainItems = i18n.domains.filter((item) => {\n        if (!item || typeof item !== 'object') return true\n        if (!item.defaultLocale) return true\n        if (!item.domain || typeof item.domain !== 'string') return true\n\n        if (item.domain.includes(':')) {\n          console.warn(\n            `i18n domain: \"${item.domain}\" is invalid it should be a valid domain without protocol (https://) or port (:3000) e.g. example.vercel.sh`\n          )\n          return true\n        }\n\n        const defaultLocaleDuplicate = i18n.domains?.find(\n          (altItem) =>\n            altItem.defaultLocale === item.defaultLocale &&\n            altItem.domain !== item.domain\n        )\n\n        if (!silent && defaultLocaleDuplicate) {\n          console.warn(\n            `Both ${item.domain} and ${defaultLocaleDuplicate.domain} configured the defaultLocale ${item.defaultLocale} but only one can. Change one item's default locale to continue`\n          )\n          return true\n        }\n\n        let hasInvalidLocale = false\n\n        if (Array.isArray(item.locales)) {\n          for (const locale of item.locales) {\n            if (typeof locale !== 'string') hasInvalidLocale = true\n\n            for (const domainItem of i18n.domains || []) {\n              if (domainItem === item) continue\n              if (domainItem.locales && domainItem.locales.includes(locale)) {\n                console.warn(\n                  `Both ${item.domain} and ${domainItem.domain} configured the locale (${locale}) but only one can. Remove it from one i18n.domains config to continue`\n                )\n                hasInvalidLocale = true\n                break\n              }\n            }\n          }\n        }\n\n        return hasInvalidLocale\n      })\n\n      if (invalidDomainItems.length > 0) {\n        throw new Error(\n          `Invalid i18n.domains values:\\n${invalidDomainItems\n            .map((item: any) => JSON.stringify(item))\n            .join(\n              '\\n'\n            )}\\n\\ndomains value must follow format { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] }.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n        )\n      }\n    }\n\n    if (!Array.isArray(i18n.locales)) {\n      throw new Error(\n        `Specified i18n.locales must be an array of locale strings e.g. [\"en-US\", \"nl-NL\"] received ${typeof i18n.locales}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n      )\n    }\n\n    const invalidLocales = i18n.locales.filter(\n      (locale: any) => typeof locale !== 'string'\n    )\n\n    if (invalidLocales.length > 0) {\n      throw new Error(\n        `Specified i18n.locales contains invalid values (${invalidLocales\n          .map(String)\n          .join(\n            ', '\n          )}), locales must be valid locale tags provided as strings e.g. \"en-US\".\\n` +\n          `See here for list of valid language sub-tags: http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry`\n      )\n    }\n\n    if (!i18n.locales.includes(i18n.defaultLocale)) {\n      throw new Error(\n        `Specified i18n.defaultLocale should be included in i18n.locales.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n      )\n    }\n\n    const normalizedLocales = new Set()\n    const duplicateLocales = new Set()\n\n    i18n.locales.forEach((locale) => {\n      const localeLower = locale.toLowerCase()\n      if (normalizedLocales.has(localeLower)) {\n        duplicateLocales.add(locale)\n      }\n      normalizedLocales.add(localeLower)\n    })\n\n    if (duplicateLocales.size > 0) {\n      throw new Error(\n        `Specified i18n.locales contains the following duplicate locales:\\n` +\n          `${[...duplicateLocales].join(', ')}\\n` +\n          `Each locale should be listed only once.\\n` +\n          `See more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n      )\n    }\n\n    // make sure default Locale is at the front\n    i18n.locales = [\n      i18n.defaultLocale,\n      ...i18n.locales.filter((locale) => locale !== i18n.defaultLocale),\n    ]\n\n    const localeDetectionType = typeof i18n.localeDetection\n\n    if (\n      localeDetectionType !== 'boolean' &&\n      localeDetectionType !== 'undefined'\n    ) {\n      throw new Error(\n        `Specified i18n.localeDetection should be undefined or a boolean received ${localeDetectionType}.\\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`\n      )\n    }\n  }\n\n  if (result.devIndicators !== false && result.devIndicators?.position) {\n    const { position } = result.devIndicators\n    const allowedValues = [\n      'top-left',\n      'top-right',\n      'bottom-left',\n      'bottom-right',\n    ]\n\n    if (!allowedValues.includes(position)) {\n      throw new Error(\n        `Invalid \"devIndicator.position\" provided, expected one of ${allowedValues.join(\n          ', '\n        )}, received ${position}`\n      )\n    }\n  }\n\n  if (result.experimental) {\n    result.experimental.cacheLife = {\n      ...defaultConfig.experimental?.cacheLife,\n      ...result.experimental.cacheLife,\n    }\n    const defaultDefault = defaultConfig.experimental?.cacheLife?.['default']\n    if (\n      !defaultDefault ||\n      defaultDefault.revalidate === undefined ||\n      defaultDefault.expire === undefined ||\n      !defaultConfig.experimental?.staleTimes?.static\n    ) {\n      throw new Error('No default cacheLife profile.')\n    }\n    const defaultCacheLifeProfile = result.experimental.cacheLife['default']\n    if (!defaultCacheLifeProfile) {\n      result.experimental.cacheLife['default'] = defaultDefault\n    } else {\n      if (defaultCacheLifeProfile.stale === undefined) {\n        const staticStaleTime = result.experimental.staleTimes?.static\n        defaultCacheLifeProfile.stale =\n          staticStaleTime ?? defaultConfig.experimental?.staleTimes?.static\n      }\n      if (defaultCacheLifeProfile.revalidate === undefined) {\n        defaultCacheLifeProfile.revalidate = defaultDefault.revalidate\n      }\n      if (defaultCacheLifeProfile.expire === undefined) {\n        defaultCacheLifeProfile.expire =\n          result.expireTime ?? defaultDefault.expire\n      }\n    }\n  }\n\n  if (result.experimental?.cacheHandlers) {\n    const allowedHandlerNameRegex = /[a-z-]/\n\n    if (typeof result.experimental.cacheHandlers !== 'object') {\n      throw new Error(\n        `Invalid \"experimental.cacheHandlers\" provided, expected an object e.g. { default: '/my-handler.js' }, received ${JSON.stringify(result.experimental.cacheHandlers)}`\n      )\n    }\n\n    const handlerKeys = Object.keys(result.experimental.cacheHandlers)\n    const invalidHandlerItems: Array<{ key: string; reason: string }> = []\n\n    for (const key of handlerKeys) {\n      if (key === 'private') {\n        invalidHandlerItems.push({\n          key,\n          reason:\n            'The cache handler for \"use cache: private\" cannot be customized.',\n        })\n      } else if (!allowedHandlerNameRegex.test(key)) {\n        invalidHandlerItems.push({\n          key,\n          reason: 'key must only use characters a-z and -',\n        })\n      } else {\n        const handlerPath = (\n          result.experimental.cacheHandlers as {\n            [handlerName: string]: string | undefined\n          }\n        )[key]\n\n        if (handlerPath && !existsSync(handlerPath)) {\n          invalidHandlerItems.push({\n            key,\n            reason: `cache handler path provided does not exist, received ${handlerPath}`,\n          })\n        }\n      }\n      if (invalidHandlerItems.length) {\n        throw new Error(\n          `Invalid handler fields configured for \"experimental.cacheHandler\":\\n${invalidHandlerItems.map((item) => `${key}: ${item.reason}`).join('\\n')}`\n        )\n      }\n    }\n  }\n\n  const userProvidedModularizeImports = result.modularizeImports\n  // Unfortunately these packages end up re-exporting 10600 modules, for example: https://unpkg.com/browse/@mui/icons-material@5.11.16/esm/index.js.\n  // Leveraging modularizeImports tremendously reduces compile times for these.\n  result.modularizeImports = {\n    ...(userProvidedModularizeImports || {}),\n    // This is intentionally added after the user-provided modularizeImports config.\n    '@mui/icons-material': {\n      transform: '@mui/icons-material/{{member}}',\n    },\n    lodash: {\n      transform: 'lodash/{{member}}',\n    },\n  }\n\n  const userProvidedOptimizePackageImports =\n    result.experimental?.optimizePackageImports || []\n\n  result.experimental.optimizePackageImports = [\n    ...new Set([\n      ...userProvidedOptimizePackageImports,\n      'lucide-react',\n      'date-fns',\n      'lodash-es',\n      'ramda',\n      'antd',\n      'react-bootstrap',\n      'ahooks',\n      '@ant-design/icons',\n      '@headlessui/react',\n      '@headlessui-float/react',\n      '@heroicons/react/20/solid',\n      '@heroicons/react/24/solid',\n      '@heroicons/react/24/outline',\n      '@visx/visx',\n      '@tremor/react',\n      'rxjs',\n      '@mui/material',\n      '@mui/icons-material',\n      'recharts',\n      'react-use',\n      'effect',\n      '@effect/schema',\n      '@effect/platform',\n      '@effect/platform-node',\n      '@effect/platform-browser',\n      '@effect/platform-bun',\n      '@effect/sql',\n      '@effect/sql-mssql',\n      '@effect/sql-mysql2',\n      '@effect/sql-pg',\n      '@effect/sql-sqlite-node',\n      '@effect/sql-sqlite-bun',\n      '@effect/sql-sqlite-wasm',\n      '@effect/sql-sqlite-react-native',\n      '@effect/rpc',\n      '@effect/rpc-http',\n      '@effect/typeclass',\n      '@effect/experimental',\n      '@effect/opentelemetry',\n      '@material-ui/core',\n      '@material-ui/icons',\n      '@tabler/icons-react',\n      'mui-core',\n      // We don't support wildcard imports for these configs, e.g. `react-icons/*`\n      // so we need to add them manually.\n      // In the future, we should consider automatically detecting packages that\n      // need to be optimized.\n      'react-icons/ai',\n      'react-icons/bi',\n      'react-icons/bs',\n      'react-icons/cg',\n      'react-icons/ci',\n      'react-icons/di',\n      'react-icons/fa',\n      'react-icons/fa6',\n      'react-icons/fc',\n      'react-icons/fi',\n      'react-icons/gi',\n      'react-icons/go',\n      'react-icons/gr',\n      'react-icons/hi',\n      'react-icons/hi2',\n      'react-icons/im',\n      'react-icons/io',\n      'react-icons/io5',\n      'react-icons/lia',\n      'react-icons/lib',\n      'react-icons/lu',\n      'react-icons/md',\n      'react-icons/pi',\n      'react-icons/ri',\n      'react-icons/rx',\n      'react-icons/si',\n      'react-icons/sl',\n      'react-icons/tb',\n      'react-icons/tfi',\n      'react-icons/ti',\n      'react-icons/vsc',\n      'react-icons/wi',\n    ]),\n  ]\n\n  if (!result.htmlLimitedBots) {\n    // @ts-expect-error: override the htmlLimitedBots with default string, type covert: RegExp -> string\n    result.htmlLimitedBots = HTML_LIMITED_BOT_UA_RE_STRING\n  }\n\n  // \"use cache\" was originally implicitly enabled with the cacheComponents flag, so\n  // we transfer the value for cacheComponents to the explicit useCache flag to ensure\n  // backwards compatibility.\n  if (result.experimental.useCache === undefined) {\n    result.experimental.useCache = result.experimental.cacheComponents\n  }\n\n  // If cacheComponents is enabled, we also enable PPR.\n  if (result.experimental.cacheComponents) {\n    if (\n      userConfig.experimental?.ppr === false ||\n      userConfig.experimental?.ppr === 'incremental'\n    ) {\n      throw new Error(\n        `\\`experimental.ppr\\` can not be \\`${JSON.stringify(userConfig.experimental?.ppr)}\\` when \\`experimental.cacheComponents\\` is \\`true\\`. PPR is implicitly enabled when Cache Components is enabled.`\n      )\n    }\n\n    result.experimental.ppr = true\n  }\n\n  return result as NextConfigComplete\n}\n\nasync function applyModifyConfig(\n  config: NextConfigComplete,\n  phase: string,\n  silent: boolean\n): Promise<NextConfigComplete> {\n  if (\n    // TODO: should this be called for server start as\n    // adapters shouldn't be relying on \"next start\"\n    [PHASE_PRODUCTION_BUILD, PHASE_PRODUCTION_SERVER].includes(phase) &&\n    config.experimental?.adapterPath\n  ) {\n    const adapterMod = interopDefault(\n      await import(\n        pathToFileURL(require.resolve(config.experimental.adapterPath)).href\n      )\n    ) as NextAdapter\n\n    if (typeof adapterMod.modifyConfig === 'function') {\n      if (!silent) {\n        Log.info(`Applying modifyConfig from ${adapterMod.name}`)\n      }\n      config = await adapterMod.modifyConfig(config)\n    }\n  }\n  return config\n}\n\n// Cache config with keys to handle multiple configurations (e.g., multi-zone)\nconst configCache = new Map<\n  string,\n  {\n    rawConfig: any\n    config: NextConfigComplete\n    configuredExperimentalFeatures: ConfiguredExperimentalFeature[]\n  }\n>()\n\n// Generate cache key based on parameters that affect config output\n// We need a unique key for cache because there can be multiple values\nfunction getCacheKey(\n  phase: string,\n  dir: string,\n  customConfig?: object | null,\n  reactProductionProfiling?: boolean,\n  debugPrerender?: boolean\n): string {\n  // The next.config.js is unique per project, so we can use the dir as the major key\n  // to generate the unique config key.\n  const keyData = JSON.stringify({\n    dir,\n    phase,\n    hasCustomConfig: Boolean(customConfig),\n    reactProductionProfiling: Boolean(reactProductionProfiling),\n    debugPrerender: Boolean(debugPrerender),\n  })\n\n  return djb2Hash(keyData).toString(36)\n}\n\nexport default async function loadConfig(\n  phase: string,\n  dir: string,\n  {\n    customConfig,\n    rawConfig,\n    silent = true,\n    reportExperimentalFeatures,\n    reactProductionProfiling,\n    debugPrerender,\n  }: {\n    customConfig?: object | null\n    rawConfig?: boolean\n    silent?: boolean\n    reportExperimentalFeatures?: (\n      configuredExperimentalFeatures: ConfiguredExperimentalFeature[]\n    ) => void\n    reactProductionProfiling?: boolean\n    debugPrerender?: boolean\n  } = {}\n): Promise<NextConfigComplete> {\n  // Generate cache key based on parameters that affect config output\n  const cacheKey = getCacheKey(\n    phase,\n    dir,\n    customConfig,\n    reactProductionProfiling,\n    debugPrerender\n  )\n\n  // Check if we have a cached result\n  const cachedResult = configCache.get(cacheKey)\n  if (cachedResult) {\n    // Call the experimental features callback if provided\n    if (reportExperimentalFeatures) {\n      reportExperimentalFeatures(cachedResult.configuredExperimentalFeatures)\n    }\n\n    // Return raw config if requested and available\n    if (rawConfig && cachedResult.rawConfig) {\n      return cachedResult.rawConfig\n    }\n\n    return cachedResult.config\n  }\n\n  // Original implementation continues below...\n  if (!process.env.__NEXT_PRIVATE_RENDER_WORKER) {\n    try {\n      loadWebpackHook()\n    } catch (err) {\n      // this can fail in standalone mode as the files\n      // aren't traced/included\n      if (!process.env.__NEXT_PRIVATE_STANDALONE_CONFIG) {\n        throw err\n      }\n    }\n  }\n\n  if (process.env.__NEXT_PRIVATE_STANDALONE_CONFIG) {\n    // we don't apply assignDefaults or modifyConfig here as it\n    // has already been applied\n    const standaloneConfig = JSON.parse(\n      process.env.__NEXT_PRIVATE_STANDALONE_CONFIG\n    )\n\n    // Cache the standalone config\n    configCache.set(cacheKey, {\n      config: standaloneConfig,\n      rawConfig: standaloneConfig,\n      configuredExperimentalFeatures: [],\n    })\n\n    return standaloneConfig\n  }\n\n  const curLog = silent\n    ? {\n        warn: () => {},\n        info: () => {},\n        error: () => {},\n      }\n    : Log\n\n  loadEnvConfig(dir, phase === PHASE_DEVELOPMENT_SERVER, curLog)\n\n  let configFileName = 'next.config.js'\n  const configuredExperimentalFeatures: ConfiguredExperimentalFeature[] = []\n\n  if (customConfig) {\n    // Check deprecation warnings on the custom config before merging with defaults\n    checkDeprecations(customConfig as NextConfig, configFileName, silent, dir)\n\n    const config = await applyModifyConfig(\n      assignDefaults(\n        dir,\n        {\n          configOrigin: 'server',\n          configFileName,\n          ...customConfig,\n        },\n        silent\n      ) as NextConfigComplete,\n      phase,\n      silent\n    )\n\n    // Cache the custom config result\n    configCache.set(cacheKey, {\n      config,\n      rawConfig: customConfig,\n      configuredExperimentalFeatures,\n    })\n\n    reportExperimentalFeatures?.(configuredExperimentalFeatures)\n\n    return config\n  }\n\n  const path = await findUp(CONFIG_FILES, { cwd: dir })\n\n  // If config file was found\n  if (path?.length) {\n    configFileName = basename(path)\n\n    let userConfigModule: any\n    try {\n      const envBefore = Object.assign({}, process.env)\n\n      // `import()` expects url-encoded strings, so the path must be properly\n      // escaped and (especially on Windows) absolute paths must pe prefixed\n      // with the `file://` protocol\n      if (process.env.__NEXT_TEST_MODE === 'jest') {\n        // dynamic import does not currently work inside of vm which\n        // jest relies on so we fall back to require for this case\n        // https://github.com/nodejs/node/issues/35889\n        userConfigModule = require(path)\n      } else if (configFileName === 'next.config.ts') {\n        userConfigModule = await transpileConfig({\n          nextConfigPath: path,\n          configFileName,\n          cwd: dir,\n        })\n      } else {\n        userConfigModule = await import(pathToFileURL(path).href)\n      }\n      const newEnv: typeof process.env = {} as any\n\n      for (const key of Object.keys(process.env)) {\n        if (envBefore[key] !== process.env[key]) {\n          newEnv[key] = process.env[key]\n        }\n      }\n      updateInitialEnv(newEnv)\n\n      if (rawConfig) {\n        // Cache the raw config\n        configCache.set(cacheKey, {\n          config: userConfigModule as NextConfigComplete,\n          rawConfig: userConfigModule,\n          configuredExperimentalFeatures,\n        })\n\n        reportExperimentalFeatures?.(configuredExperimentalFeatures)\n\n        return userConfigModule\n      }\n    } catch (err) {\n      // TODO: Modify docs to add cases of failing next.config.ts transformation\n      curLog.error(\n        `Failed to load ${configFileName}, see more info here https://nextjs.org/docs/messages/next-config-error`\n      )\n      throw err\n    }\n\n    const loadedConfig = Object.freeze(\n      (await normalizeConfig(\n        phase,\n        interopDefault(userConfigModule)\n      )) as NextConfig\n    )\n\n    if (loadedConfig.experimental) {\n      for (const name of Object.keys(\n        loadedConfig.experimental\n      ) as (keyof ExperimentalConfig)[]) {\n        const value = loadedConfig.experimental[name]\n\n        if (name === 'turbo' && !process.env.TURBOPACK) {\n          // Ignore any Turbopack config if Turbopack is not enabled\n          continue\n        }\n\n        addConfiguredExperimentalFeature(\n          configuredExperimentalFeatures,\n          name,\n          value\n        )\n      }\n    }\n\n    // Clone a new userConfig each time to avoid mutating the original\n    const userConfig = cloneObject(loadedConfig) as NextConfig\n\n    // Check deprecation warnings on the actual user config before merging with defaults\n    checkDeprecations(userConfig, configFileName, silent, dir)\n\n    // Always validate the config against schema in non minimal mode.\n    // Only validate once in the root Next.js process, not in forked processes.\n    const isRootProcess = typeof process.send !== 'function'\n    if (!process.env.NEXT_MINIMAL && isRootProcess) {\n      // We only validate the config against schema in non minimal mode\n      const { configSchema } =\n        require('./config-schema') as typeof import('./config-schema')\n      const state = configSchema.safeParse(userConfig)\n\n      if (!state.success) {\n        // error message header\n        const messages = [`Invalid ${configFileName} options detected: `]\n\n        const [errorMessages, shouldExit] = normalizeNextConfigZodErrors(\n          state.error\n        )\n        // ident list item\n        for (const error of errorMessages) {\n          messages.push(`    ${error}`)\n        }\n\n        // error message footer\n        messages.push(\n          'See more info here: https://nextjs.org/docs/messages/invalid-next-config'\n        )\n\n        if (shouldExit) {\n          for (const message of messages) {\n            console.error(message)\n          }\n          await flushAndExit(1)\n        } else {\n          for (const message of messages) {\n            curLog.warn(message)\n          }\n        }\n      }\n    }\n\n    if (userConfig.target && userConfig.target !== 'server') {\n      throw new Error(\n        `The \"target\" property is no longer supported in ${configFileName}.\\n` +\n          'See more info here https://nextjs.org/docs/messages/deprecated-target-config'\n      )\n    }\n\n    if (userConfig.amp?.canonicalBase) {\n      const { canonicalBase } = userConfig.amp || ({} as any)\n      userConfig.amp = userConfig.amp || {}\n      userConfig.amp.canonicalBase =\n        (canonicalBase?.endsWith('/')\n          ? canonicalBase.slice(0, -1)\n          : canonicalBase) || ''\n    }\n\n    if (reactProductionProfiling) {\n      userConfig.reactProductionProfiling = reactProductionProfiling\n    }\n\n    if (\n      userConfig.experimental?.turbo?.loaders &&\n      !userConfig.experimental?.turbo?.rules\n    ) {\n      curLog.warn(\n        'experimental.turbo.loaders is now deprecated. Please update next.config.js to use experimental.turbo.rules as soon as possible.\\n' +\n          'The new option is similar, but the key should be a glob instead of an extension.\\n' +\n          'Example: loaders: { \".mdx\": [\"mdx-loader\"] } -> rules: { \"*.mdx\": [\"mdx-loader\"] }\" }\\n' +\n          'See more info here https://nextjs.org/docs/app/api-reference/next-config-js/turbo'\n      )\n\n      const rules: Record<string, TurbopackLoaderItem[]> = {}\n      for (const [ext, loaders] of Object.entries(\n        userConfig.experimental.turbo.loaders\n      )) {\n        rules['*' + ext] = loaders as TurbopackLoaderItem[]\n      }\n\n      userConfig.experimental.turbo.rules = rules\n    }\n\n    if (userConfig.experimental?.turbo) {\n      curLog.warn(\n        'The config property `experimental.turbo` is deprecated. Move this setting to `config.turbopack` or run `npx @next/codemod@latest next-experimental-turbo-to-turbopack .`'\n      )\n\n      // Merge the two configs, preferring values in `config.turbopack`.\n      userConfig.turbopack = {\n        ...userConfig.experimental.turbo,\n        ...userConfig.turbopack,\n      }\n      userConfig.experimental.turbopackMemoryLimit ??=\n        userConfig.experimental.turbo.memoryLimit\n      userConfig.experimental.turbopackMinify ??=\n        userConfig.experimental.turbo.minify\n      userConfig.experimental.turbopackTreeShaking ??=\n        userConfig.experimental.turbo.treeShaking\n      userConfig.experimental.turbopackSourceMaps ??=\n        userConfig.experimental.turbo.sourceMaps\n    }\n\n    if (userConfig.experimental?.useLightningcss) {\n      const { loadBindings } =\n        require('../build/swc') as typeof import('../build/swc')\n      const isLightningSupported = (await loadBindings())?.css?.lightning\n\n      if (!isLightningSupported) {\n        curLog.warn(\n          `experimental.useLightningcss is set, but the setting is disabled because next-swc/wasm does not support it yet.`\n        )\n        userConfig.experimental.useLightningcss = false\n      }\n    }\n\n    // serialize the regex config into string\n    if (userConfig?.htmlLimitedBots instanceof RegExp) {\n      // @ts-expect-error: override the htmlLimitedBots with default string, type covert: RegExp -> string\n      userConfig.htmlLimitedBots = userConfig.htmlLimitedBots.source\n    }\n\n    enforceExperimentalFeatures(userConfig, {\n      isDefaultConfig: false,\n      configuredExperimentalFeatures,\n      debugPrerender,\n      phase,\n    })\n\n    const completeConfig = assignDefaults(\n      dir,\n      {\n        configOrigin: relative(dir, path),\n        configFile: path,\n        configFileName,\n        ...userConfig,\n      },\n      silent\n    ) as NextConfigComplete\n\n    const finalConfig = await applyModifyConfig(completeConfig, phase, silent)\n\n    // Cache the final result\n    configCache.set(cacheKey, {\n      config: finalConfig,\n      rawConfig: userConfigModule, // Store the original user config module\n      configuredExperimentalFeatures,\n    })\n\n    if (reportExperimentalFeatures) {\n      reportExperimentalFeatures(configuredExperimentalFeatures)\n    }\n\n    return finalConfig\n  } else {\n    const configBaseName = basename(CONFIG_FILES[0], extname(CONFIG_FILES[0]))\n    const unsupportedConfig = findUp.sync(\n      [\n        `${configBaseName}.cjs`,\n        `${configBaseName}.cts`,\n        `${configBaseName}.mts`,\n        `${configBaseName}.json`,\n        `${configBaseName}.jsx`,\n        `${configBaseName}.tsx`,\n      ],\n      { cwd: dir }\n    )\n    if (unsupportedConfig?.length) {\n      throw new Error(\n        `Configuring Next.js via '${basename(\n          unsupportedConfig\n        )}' is not supported. Please replace the file with 'next.config.js', 'next.config.mjs', or 'next.config.ts'.`\n      )\n    }\n  }\n\n  const clonedDefaultConfig = cloneObject(defaultConfig) as NextConfig\n\n  enforceExperimentalFeatures(clonedDefaultConfig, {\n    isDefaultConfig: true,\n    configuredExperimentalFeatures,\n    debugPrerender,\n    phase,\n  })\n\n  // always call assignDefaults to ensure settings like\n  // reactRoot can be updated correctly even with no next.config.js\n  const completeConfig = assignDefaults(\n    dir,\n    { ...clonedDefaultConfig, configFileName },\n    silent\n  ) as NextConfigComplete\n\n  setHttpClientAndAgentOptions(completeConfig)\n\n  const finalConfig = await applyModifyConfig(completeConfig, phase, silent)\n\n  // Cache the default config result\n  configCache.set(cacheKey, {\n    config: finalConfig,\n    rawConfig: clonedDefaultConfig,\n    configuredExperimentalFeatures,\n  })\n\n  if (reportExperimentalFeatures) {\n    reportExperimentalFeatures(configuredExperimentalFeatures)\n  }\n\n  return finalConfig\n}\n\nexport type ConfiguredExperimentalFeature = {\n  key: keyof ExperimentalConfig\n  value: ExperimentalConfig[keyof ExperimentalConfig]\n  reason?: string\n}\n\nfunction enforceExperimentalFeatures(\n  config: NextConfig,\n  options: {\n    isDefaultConfig: boolean\n    configuredExperimentalFeatures: ConfiguredExperimentalFeature[] | undefined\n    debugPrerender: boolean | undefined\n    phase: string\n  }\n) {\n  const {\n    configuredExperimentalFeatures,\n    debugPrerender,\n    isDefaultConfig,\n    phase,\n  } = options\n\n  config.experimental ??= {}\n\n  if (\n    debugPrerender &&\n    (phase === PHASE_PRODUCTION_BUILD || phase === PHASE_EXPORT)\n  ) {\n    setExperimentalFeatureForDebugPrerender(\n      config.experimental,\n      'serverSourceMaps',\n      true,\n      configuredExperimentalFeatures\n    )\n\n    setExperimentalFeatureForDebugPrerender(\n      config.experimental,\n      process.env.TURBOPACK ? 'turbopackMinify' : 'serverMinification',\n      false,\n      configuredExperimentalFeatures\n    )\n\n    setExperimentalFeatureForDebugPrerender(\n      config.experimental,\n      'enablePrerenderSourceMaps',\n      true,\n      configuredExperimentalFeatures\n    )\n\n    setExperimentalFeatureForDebugPrerender(\n      config.experimental,\n      'prerenderEarlyExit',\n      false,\n      configuredExperimentalFeatures\n    )\n  }\n\n  // TODO: Remove this once we've made Cache Components the default.\n  if (\n    process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true' &&\n    // We do respect an explicit value in the user config.\n    (config.experimental.ppr === undefined ||\n      (isDefaultConfig && !config.experimental.ppr))\n  ) {\n    config.experimental.ppr = true\n\n    if (configuredExperimentalFeatures) {\n      addConfiguredExperimentalFeature(\n        configuredExperimentalFeatures,\n        'ppr',\n        true,\n        'enabled by `__NEXT_EXPERIMENTAL_CACHE_COMPONENTS`'\n      )\n    }\n  }\n\n  // TODO: Remove this once we've made Cache Components the default.\n  if (\n    process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&\n    // We do respect an explicit value in the user config.\n    (config.experimental.ppr === undefined ||\n      (isDefaultConfig && !config.experimental.ppr))\n  ) {\n    config.experimental.ppr = true\n\n    if (configuredExperimentalFeatures) {\n      addConfiguredExperimentalFeature(\n        configuredExperimentalFeatures,\n        'ppr',\n        true,\n        'enabled by `__NEXT_EXPERIMENTAL_PPR`'\n      )\n    }\n  }\n\n  // TODO: Remove this once we've made Client Segment Cache the default.\n  if (\n    process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&\n    // We do respect an explicit value in the user config.\n    (config.experimental.clientSegmentCache === undefined ||\n      (isDefaultConfig && !config.experimental.clientSegmentCache))\n  ) {\n    config.experimental.clientSegmentCache = true\n\n    if (configuredExperimentalFeatures) {\n      addConfiguredExperimentalFeature(\n        configuredExperimentalFeatures,\n        'clientSegmentCache',\n        true,\n        'enabled by `__NEXT_EXPERIMENTAL_PPR`'\n      )\n    }\n  }\n\n  // TODO: Remove this once we've made Client Param Parsing the default.\n  if (\n    process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&\n    // We do respect an explicit value in the user config.\n    (config.experimental.clientParamParsing === undefined ||\n      (isDefaultConfig && !config.experimental.clientParamParsing))\n  ) {\n    config.experimental.clientParamParsing = true\n\n    if (configuredExperimentalFeatures) {\n      addConfiguredExperimentalFeature(\n        configuredExperimentalFeatures,\n        'clientParamParsing',\n        true,\n        'enabled by `__NEXT_EXPERIMENTAL_PPR`'\n      )\n    }\n  }\n\n  // TODO: Remove this once we've made Cache Components the default.\n  if (\n    process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS === 'true' &&\n    // We do respect an explicit value in the user config.\n    (config.experimental.cacheComponents === undefined ||\n      (isDefaultConfig && !config.experimental.cacheComponents))\n  ) {\n    config.experimental.cacheComponents = true\n\n    if (configuredExperimentalFeatures) {\n      addConfiguredExperimentalFeature(\n        configuredExperimentalFeatures,\n        'cacheComponents',\n        true,\n        'enabled by `__NEXT_EXPERIMENTAL_CACHE_COMPONENTS`'\n      )\n    }\n  }\n\n  if (\n    config.experimental.enablePrerenderSourceMaps === undefined &&\n    config.experimental.cacheComponents === true\n  ) {\n    config.experimental.enablePrerenderSourceMaps = true\n\n    if (configuredExperimentalFeatures) {\n      addConfiguredExperimentalFeature(\n        configuredExperimentalFeatures,\n        'enablePrerenderSourceMaps',\n        true,\n        'enabled by `experimental.cacheComponents`'\n      )\n    }\n  }\n}\n\nfunction addConfiguredExperimentalFeature<\n  KeyType extends keyof ExperimentalConfig,\n>(\n  configuredExperimentalFeatures: ConfiguredExperimentalFeature[],\n  key: KeyType,\n  value: ExperimentalConfig[KeyType],\n  reason?: string\n) {\n  if (value !== (defaultConfig.experimental as Record<string, unknown>)[key]) {\n    configuredExperimentalFeatures.push({ key, value, reason })\n  }\n}\n\nfunction setExperimentalFeatureForDebugPrerender<\n  KeyType extends keyof ExperimentalConfig,\n>(\n  experimentalConfig: ExperimentalConfig,\n  key: KeyType,\n  value: ExperimentalConfig[KeyType],\n  configuredExperimentalFeatures: ConfiguredExperimentalFeature[] | undefined\n) {\n  if (experimentalConfig[key] !== value) {\n    experimentalConfig[key] = value\n\n    if (configuredExperimentalFeatures) {\n      const action =\n        value === true ? 'enabled' : value === false ? 'disabled' : 'set'\n\n      const reason = `${action} by \\`--debug-prerender\\``\n\n      addConfiguredExperimentalFeature(\n        configuredExperimentalFeatures,\n        key,\n        value,\n        reason\n      )\n    }\n  }\n}\n\nfunction cloneObject(obj: any): any {\n  // Primitives & null\n  if (obj === null || typeof obj !== 'object') {\n    return obj\n  }\n\n  // RegExp → clone via constructor\n  if (obj instanceof RegExp) {\n    return new RegExp(obj.source, obj.flags)\n  }\n\n  // Function → just reuse the function reference\n  if (typeof obj === 'function') {\n    return obj\n  }\n\n  // Arrays → map each element\n  if (Array.isArray(obj)) {\n    return obj.map(cloneObject)\n  }\n\n  // Detect non‑plain objects (class instances)\n  const proto = Object.getPrototypeOf(obj)\n  const isPlainObject = proto === Object.prototype || proto === null\n\n  // If it's not a plain object, just return the original\n  if (!isPlainObject) {\n    return obj\n  }\n\n  // Plain object → create a new object with the same prototype\n  // and copy all properties, cloning data properties and keeping\n  // accessor properties (getters/setters) as‑is.\n  const result = Object.create(proto)\n  for (const key of Reflect.ownKeys(obj)) {\n    const descriptor = Object.getOwnPropertyDescriptor(obj, key)\n\n    if (descriptor && (descriptor.get || descriptor.set)) {\n      // Accessor property → copy descriptor as‑is (get/set functions)\n      Object.defineProperty(result, key, descriptor)\n    } else {\n      // Data property → clone the value\n      result[key] = cloneObject(obj[key])\n    }\n  }\n\n  return result\n}\n"],"names":["loadConfig","normalizeConfig","warnOptionHasBeenDeprecated","warnOptionHasBeenMovedOutOfExperimental","normalizeNextConfigZodErrors","error","shouldExit","issues","normalizeZodErrors","flatMap","issue","message","path","config","nestedPropertyKey","reason","silent","hasWarned","current","found","nestedPropertyKeys","split","key","undefined","Log","warnOnce","checkDeprecations","userConfig","configFileName","dir","experimental","dynamicIO","i18n","hasAppDir","Boolean","findDir","oldExperimentalKey","newKey","warn","newKeys","length","shift","warnCustomizedOption","defaultValue","customMessage","segs","seg","assignDefaults","result","exportTrailingSlash","trailingSlash","cacheComponents","Object","keys","reduce","currentConfig","value","Error","userDistDir","trim","Array","isArray","forEach","ext","defaultConfig","constructor","c","k","v","trustHostHeader","ciEnvironment","hasNextSupport","allowDevelopmentBuild","process","env","NODE_ENV","isStableBuild","ppr","CanaryOnlyError","feature","turbopackPersistentCaching","output","rewrites","redirects","headers","assetPrefix","basePath","startsWith","endsWith","amp","canonicalBase","images","localPatterns","hasMatch","some","pattern","pathname","search","push","remotePatterns","map","protocol","hostname","port","proto","replace","includes","url","URL","hasMatchForAssetPrefix","matchRemotePattern","domains","loader","imageConfigDefault","pathHasPrefix","loaderFile","absolutePath","join","existsSync","devIndicators","buildActivityPosition","position","outputStandalone","serverActions","bodySizeLimit","parseInt","toString","isNaN","middlewareClientMaxBodySize","normalizedValue","bytes","require","parse","outputFileTracingRoot","isAbsolute","resolve","turbopack","root","NEXT_DEPLOYMENT_ID","deploymentId","tracingRoot","turbopackRoot","rootDir","findRootDir","dset","setHttpClientAndAgentOptions","i18nType","locales","defaultLocaleType","defaultLocale","invalidDomainItems","filter","item","domain","console","defaultLocaleDuplicate","find","altItem","hasInvalidLocale","locale","domainItem","JSON","stringify","invalidLocales","String","normalizedLocales","Set","duplicateLocales","localeLower","toLowerCase","has","add","size","localeDetectionType","localeDetection","allowedValues","cacheLife","defaultDefault","revalidate","expire","staleTimes","static","defaultCacheLifeProfile","stale","staticStaleTime","expireTime","cacheHandlers","allowedHandlerNameRegex","handlerKeys","invalidHandlerItems","test","handlerPath","userProvidedModularizeImports","modularizeImports","transform","lodash","userProvidedOptimizePackageImports","optimizePackageImports","htmlLimitedBots","HTML_LIMITED_BOT_UA_RE_STRING","useCache","applyModifyConfig","phase","PHASE_PRODUCTION_BUILD","PHASE_PRODUCTION_SERVER","adapterPath","adapterMod","interopDefault","pathToFileURL","href","modifyConfig","info","name","configCache","Map","getCacheKey","customConfig","reactProductionProfiling","debugPrerender","keyData","hasCustomConfig","djb2Hash","rawConfig","reportExperimentalFeatures","cacheKey","cachedResult","get","configuredExperimentalFeatures","__NEXT_PRIVATE_RENDER_WORKER","loadWebpackHook","err","__NEXT_PRIVATE_STANDALONE_CONFIG","standaloneConfig","set","curLog","loadEnvConfig","PHASE_DEVELOPMENT_SERVER","configOrigin","findUp","CONFIG_FILES","cwd","basename","userConfigModule","envBefore","assign","__NEXT_TEST_MODE","transpileConfig","nextConfigPath","newEnv","updateInitialEnv","loadedConfig","freeze","TURBOPACK","addConfiguredExperimentalFeature","cloneObject","isRootProcess","send","NEXT_MINIMAL","configSchema","state","safeParse","success","messages","errorMessages","flushAndExit","target","slice","turbo","loaders","rules","entries","turbopackMemoryLimit","memoryLimit","turbopackMinify","minify","turbopackTreeShaking","treeShaking","turbopackSourceMaps","sourceMaps","useLightningcss","loadBindings","isLightningSupported","css","lightning","RegExp","source","enforceExperimentalFeatures","isDefaultConfig","completeConfig","relative","configFile","finalConfig","configBaseName","extname","unsupportedConfig","sync","clonedDefaultConfig","options","PHASE_EXPORT","setExperimentalFeatureForDebugPrerender","__NEXT_EXPERIMENTAL_CACHE_COMPONENTS","__NEXT_EXPERIMENTAL_PPR","clientSegmentCache","clientParamParsing","enablePrerenderSourceMaps","experimentalConfig","action","obj","flags","getPrototypeOf","isPlainObject","prototype","create","Reflect","ownKeys","descriptor","getOwnPropertyDescriptor","defineProperty"],"mappings":";;;;;;;;;;;;;;;;;IAkvCA,OA6ZC;eA7Z6BA;;IAvsCrBC,eAAe;eAAfA,6BAAe;;IAqBRC,2BAA2B;eAA3BA;;IAsHAC,uCAAuC;eAAvCA;;;oBAtLW;sBAC4C;qBACzC;+DACX;6DACE;gEACU;2BAOxB;8BACwC;6BASf;6BACG;qBAEa;8BACnB;0BACD;mCACiB;+BACf;oCACK;iCAIH;sBACX;qBACc;uBACW;8BACtB;4BACuB;gCAChB;sBACN;;;;;;;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