next 14.2.21 → 14.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +1 -1
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/type-check.js +5 -4
  5. package/dist/build/type-check.js.map +1 -1
  6. package/dist/build/utils.js +6 -3
  7. package/dist/build/utils.js.map +1 -1
  8. package/dist/build/webpack-config.js +2 -2
  9. package/dist/client/app-bootstrap.js +1 -1
  10. package/dist/client/index.js +1 -1
  11. package/dist/compiled/next-server/server.runtime.prod.js +1 -1
  12. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  13. package/dist/esm/build/index.js +1 -1
  14. package/dist/esm/build/swc/index.js +1 -1
  15. package/dist/esm/build/type-check.js +5 -4
  16. package/dist/esm/build/type-check.js.map +1 -1
  17. package/dist/esm/build/utils.js +6 -3
  18. package/dist/esm/build/utils.js.map +1 -1
  19. package/dist/esm/build/webpack-config.js +2 -2
  20. package/dist/esm/client/app-bootstrap.js +1 -1
  21. package/dist/esm/client/index.js +1 -1
  22. package/dist/esm/export/worker.js +2 -1
  23. package/dist/esm/export/worker.js.map +1 -1
  24. package/dist/esm/lib/verifyAndLint.js +12 -7
  25. package/dist/esm/lib/verifyAndLint.js.map +1 -1
  26. package/dist/esm/lib/worker.js +4 -0
  27. package/dist/esm/lib/worker.js.map +1 -1
  28. package/dist/esm/server/config.js +1 -1
  29. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  30. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  31. package/dist/esm/server/dev/static-paths-worker.js +2 -1
  32. package/dist/esm/server/dev/static-paths-worker.js.map +1 -1
  33. package/dist/esm/server/lib/app-info-log.js +1 -1
  34. package/dist/esm/server/lib/start-server.js +1 -1
  35. package/dist/esm/server/load-components.js +12 -7
  36. package/dist/esm/server/load-components.js.map +1 -1
  37. package/dist/esm/server/next-server.js +11 -5
  38. package/dist/esm/server/next-server.js.map +1 -1
  39. package/dist/export/worker.js +2 -1
  40. package/dist/export/worker.js.map +1 -1
  41. package/dist/lib/verifyAndLint.js +12 -7
  42. package/dist/lib/verifyAndLint.js.map +1 -1
  43. package/dist/lib/worker.js +4 -0
  44. package/dist/lib/worker.js.map +1 -1
  45. package/dist/server/config.js +1 -1
  46. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  47. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  48. package/dist/server/dev/static-paths-worker.js +2 -1
  49. package/dist/server/dev/static-paths-worker.js.map +1 -1
  50. package/dist/server/lib/app-info-log.js +1 -1
  51. package/dist/server/lib/start-server.js +1 -1
  52. package/dist/server/load-components.d.ts +2 -1
  53. package/dist/server/load-components.js +12 -7
  54. package/dist/server/load-components.js.map +1 -1
  55. package/dist/server/next-server.d.ts +1 -0
  56. package/dist/server/next-server.js +11 -5
  57. package/dist/server/next-server.js.map +1 -1
  58. package/dist/telemetry/anonymous-meta.js +1 -1
  59. package/dist/telemetry/events/session-stopped.js +2 -2
  60. package/dist/telemetry/events/version.js +2 -2
  61. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"server.runtime.prod.js","mappings":"mDAAA,CAAC,KAAK,IAAIA,EAAE,CAAC,IAAIA,IAAI,YAAitBA,CAAAA,EAAEC,OAAO,CAACC,CAAC,CAAhR,SAAgBF,CAAC,EAAE,IAAMG,EAAEH,EAAEI,gBAAgB,CAAC,CAAC,EAAEC,QAAQC,GAAG,CAAC,IAAI,IAAMC,KAAKP,EAAEQ,MAAM,CAAC,CAAC,IAAMC,EAAEC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACV,EAAEI,GAAGJ,CAAC,CAACI,EAAE,CAACP,EAAEQ,MAAM,CAACD,EAAE,CAACP,EAAEQ,MAAM,CAACD,EAAE,CAA3LP,CAAlU,SAASc,EAAad,CAAC,CAACG,CAAC,CAACI,CAAC,EAAE,IAAME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ACPA,CAAAA,EAAIA,EAAE8Q,IAAI,CAACuK,EAAI,EAEnBA,CAAI,CAAC/iB,EAAI,CAAG0H,CAChB,CAEJ,GAsBmCkmB,EAAUg9B,GAC7BA,EAAWh9B,CACf,CACJ,EAIAo9B,kBACI,IAAM1mC,EAAQsmC,GAAYh9B,EACpBq9B,EAAK,IAAI,GAAAC,WAAW,CACpBC,EAAK,IAAI,GAAAD,WAAW,CAU1B,OATA5mC,EAAM+J,EAAE,CAAC,OAAQ,IACb48B,EAAGpoD,IAAI,CAACukB,GACR+jC,EAAGtoD,IAAI,CAACukB,EACZ,GACA9C,EAAM+J,EAAE,CAAC,MAAO,KACZ48B,EAAGpoD,IAAI,CAAC,MACRsoD,EAAGtoD,IAAI,CAAC,KACZ,GACA+nD,EAAWO,EACJF,CACX,CACJ,CACJ,EJogCiEr4C,EAAIqD,IAAI,EAErE,CACA,MAAMovC,gBAAgB/1C,CAAM,CAAE,CAEtB,MAAM,MAAU,sGAuFxB,CACA,IAAIotC,eAAgB,CAChB,GAAI,IAAI,CAAC0O,cAAc,CACnB,OAAO,IAAI,CAACA,cAAc,CAE9B,IAAM1O,EAAgB,KAAA/9C,IAAA,EAAK,IAAI,CAAC64B,OAAO,CAAE5Z,GAEzC,OADA,IAAI,CAACwtC,cAAc,CAAG1O,EACfA,CACX,CACA,MAAM/H,2BAA2BiT,CAAI,CAAE,CAGnC,OAAO,IACX,CACJ,C","sources":["webpack://next/../next-env/dist/index.js","webpack://next/./dist/compiled/@edge-runtime/cookies/index.js","webpack://next/./dist/compiled/cookie/index.js","webpack://next/./dist/compiled/fresh/index.js","webpack://next/./dist/compiled/lru-cache/index.js","webpack://next/./dist/compiled/path-to-regexp/index.js","webpack://next/./dist/esm/lib/constants.js","webpack://next/./dist/esm/server/api-utils/index.js","webpack://next/./dist/esm/server/api-utils/node/try-get-preview-data.js","webpack://next/./dist/esm/server/crypto-utils.js","webpack://next/./dist/esm/shared/lib/error-source.js","webpack://next/./dist/esm/server/lib/server-ipc/utils.js","webpack://next/./dist/esm/server/lib/server-ipc/invoke-request.js","webpack://next/./dist/esm/server/lib/server-ipc/request-utils.js","webpack://next/./dist/esm/server/lib/trace/constants.js","webpack://next/./dist/esm/server/node-environment.js","webpack://next/./dist/esm/server/node-polyfill-crypto.js","webpack://next/./dist/esm/server/web/spec-extension/adapters/reflect.js","webpack://next/./dist/esm/server/web/spec-extension/adapters/headers.js","webpack://next/./dist/esm/server/ sync","webpack://next/./dist/esm/shared/lib/isomorphic/path.js","webpack://next/./dist/esm/shared/lib/modern-browserslist-target.js","webpack://next/./dist/esm/shared/lib/utils.js","webpack://next/external commonjs \"next/dist/server/lib/trace/tracer\"","webpack://next/external commonjs2 \"next/dist/compiled/jsonwebtoken\"","webpack://next/external commonjs2 \"next/dist/compiled/node-html-parser\"","webpack://next/external commonjs2 \"next/dist/compiled/ws\"","webpack://next/external commonjs2 \"next/dist/server/web/sandbox\"","webpack://next/external node-commonjs \"async_hooks\"","webpack://next/external node-commonjs \"crypto\"","webpack://next/external node-commonjs \"fs\"","webpack://next/external node-commonjs \"module\"","webpack://next/external node-commonjs \"node:crypto\"","webpack://next/external node-commonjs \"os\"","webpack://next/external node-commonjs \"path\"","webpack://next/webpack/bootstrap","webpack://next/webpack/runtime/compat get default export","webpack://next/webpack/runtime/define property getters","webpack://next/webpack/runtime/hasOwnProperty shorthand","webpack://next/webpack/runtime/make namespace object","webpack://next/./dist/esm/server/lib/incremental-cache/fetch-cache.js","webpack://next/./dist/esm/server/lib/incremental-cache/file-system-cache.js","webpack://next/./dist/esm/client/components/redirect-status-code.js","webpack://next/./dist/esm/lib/picocolors.js","webpack://next/./dist/esm/lib/page-types.js","webpack://next/./dist/esm/server/future/route-kind.js","webpack://next/./dist/esm/server/require-hook.js","webpack://next/./dist/esm/shared/lib/router/utils/route-matcher.js","webpack://next/./dist/esm/server/request-meta.js","webpack://next/./dist/esm/shared/lib/constants.js","webpack://next/./dist/esm/lib/find-pages-dir.js","webpack://next/./dist/esm/server/api-utils/get-cookie-parser.js","webpack://next/./dist/esm/server/base-http/index.js","webpack://next/./dist/esm/server/base-http/node.js","webpack://next/./dist/esm/server/lib/etag.js","webpack://next/./dist/esm/server/lib/revalidate.js","webpack://next/./dist/esm/client/components/app-router-headers.js","webpack://next/./dist/esm/server/send-payload.js","webpack://next/./dist/esm/shared/lib/router/utils/querystring.js","webpack://next/./dist/esm/shared/lib/router/utils/parse-url.js","webpack://next/./dist/esm/shared/lib/router/utils/parse-relative-url.js","webpack://next/./dist/esm/build/output/log.js","webpack://next/external node-commonjs \"url\"","webpack://next/./dist/esm/server/lib/is-ipv6.js","webpack://next/./dist/esm/shared/lib/page-path/ensure-leading-slash.js","webpack://next/./dist/esm/shared/lib/router/utils/app-paths.js","webpack://next/./dist/esm/shared/lib/segment.js","webpack://next/./dist/esm/server/future/helpers/interception-routes.js","webpack://next/./dist/esm/shared/lib/router/utils/is-dynamic.js","webpack://next/external commonjs \"next/dist/shared/lib/runtime-config.external.js\"","webpack://next/./dist/esm/shared/lib/router/utils/is-bot.js","webpack://next/./dist/esm/server/stream-utils/node-web-streams-helper.js","webpack://next/./dist/esm/server/stream-utils/encodedTags.js","webpack://next/./dist/esm/server/web/utils.js","webpack://next/./dist/esm/shared/lib/router/utils/remove-trailing-slash.js","webpack://next/./dist/esm/shared/lib/router/utils/parse-path.js","webpack://next/./dist/esm/shared/lib/router/utils/add-path-prefix.js","webpack://next/./dist/esm/shared/lib/router/utils/add-path-suffix.js","webpack://next/./dist/esm/shared/lib/router/utils/path-has-prefix.js","webpack://next/./dist/esm/shared/lib/get-hostname.js","webpack://next/./dist/esm/shared/lib/i18n/normalize-locale-path.js","webpack://next/./dist/esm/shared/lib/router/utils/remove-path-prefix.js","webpack://next/./dist/esm/shared/lib/router/utils/get-next-pathname-info.js","webpack://next/./dist/esm/server/web/next-url.js","webpack://next/./dist/esm/shared/lib/i18n/detect-domain-locale.js","webpack://next/./dist/esm/shared/lib/router/utils/format-next-pathname-info.js","webpack://next/./dist/esm/shared/lib/router/utils/add-locale.js","webpack://next/./dist/esm/server/web/error.js","webpack://next/./dist/esm/server/web/spec-extension/request.js","webpack://next/./dist/esm/server/web/spec-extension/adapters/next-request.js","webpack://next/./dist/esm/lib/detached-promise.js","webpack://next/./dist/esm/server/client-component-renderer-logger.js","webpack://next/./dist/esm/server/pipe-readable.js","webpack://next/./dist/esm/server/render-result.js","webpack://next/./dist/esm/shared/lib/page-path/denormalize-page-path.js","webpack://next/./dist/esm/shared/lib/page-path/normalize-path-sep.js","webpack://next/./dist/esm/shared/lib/router/utils/path-match.js","webpack://next/./dist/esm/shared/lib/escape-regexp.js","webpack://next/./dist/esm/shared/lib/router/utils/route-regex.js","webpack://next/./dist/esm/shared/lib/router/utils/prepare-destination.js","webpack://next/./dist/esm/lib/is-error.js","webpack://next/./dist/esm/shared/lib/is-plain-object.js","webpack://next/./dist/esm/server/future/normalizers/locale-route-normalizer.js","webpack://next/./dist/esm/shared/lib/router/utils/sorted-routes.js","webpack://next/./dist/esm/server/future/route-matchers/route-matcher.js","webpack://next/./dist/esm/server/future/route-matchers/locale-route-matcher.js","webpack://next/./dist/esm/server/future/route-matcher-managers/default-route-matcher-manager.js","webpack://next/./dist/esm/server/future/normalizers/normalizers.js","webpack://next/./dist/esm/server/future/normalizers/prefixing-normalizer.js","webpack://next/./dist/esm/shared/lib/page-path/normalize-page-path.js","webpack://next/./dist/esm/server/future/normalizers/built/app/app-bundle-path-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/app/app-filename-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/wrap-normalizer-fn.js","webpack://next/./dist/esm/server/future/normalizers/underscore-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/app/app-pathname-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/app/index.js","webpack://next/./dist/esm/server/future/route-matchers/app-page-route-matcher.js","webpack://next/./dist/esm/server/future/route-matcher-providers/helpers/cached-route-matcher-provider.js","webpack://next/./dist/esm/server/future/route-matcher-providers/manifest-route-matcher-provider.js","webpack://next/./dist/esm/server/future/route-matcher-providers/app-page-route-matcher-provider.js","webpack://next/./dist/esm/lib/is-app-page-route.js","webpack://next/./dist/esm/server/future/route-matchers/app-route-route-matcher.js","webpack://next/./dist/esm/server/future/route-matcher-providers/app-route-route-matcher-provider.js","webpack://next/./dist/esm/lib/is-app-route-route.js","webpack://next/./dist/esm/lib/is-api-route.js","webpack://next/./dist/esm/server/future/route-matchers/pages-api-route-matcher.js","webpack://next/./dist/esm/server/future/normalizers/built/pages/pages-bundle-path-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/pages/pages-filename-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/pages/index.js","webpack://next/./dist/esm/server/future/route-matcher-providers/pages-api-route-matcher-provider.js","webpack://next/./dist/esm/server/future/route-matchers/pages-route-matcher.js","webpack://next/./dist/esm/server/future/route-matcher-providers/pages-route-matcher-provider.js","webpack://next/./dist/esm/server/future/route-matcher-providers/helpers/manifest-loaders/server-manifest-loader.js","webpack://next/./dist/esm/server/future/helpers/i18n-provider.js","webpack://next/./dist/esm/server/send-response.js","webpack://next/external commonjs \"next/dist/client/components/static-generation-async-storage.external.js\"","webpack://next/./dist/esm/server/web/spec-extension/adapters/request-cookies.js","webpack://next/./dist/esm/server/lib/match-next-data-pathname.js","webpack://next/./dist/esm/server/future/normalizers/request/suffix.js","webpack://next/./dist/esm/server/future/normalizers/request/rsc.js","webpack://next/./dist/esm/server/future/normalizers/request/prefix.js","webpack://next/./dist/esm/server/future/normalizers/request/postponed.js","webpack://next/./dist/esm/server/future/normalizers/request/action.js","webpack://next/./dist/esm/server/app-render/strip-flight-headers.js","webpack://next/./dist/esm/server/future/normalizers/request/prefetch-rsc.js","webpack://next/./dist/esm/server/future/normalizers/request/next-data.js","webpack://next/./dist/esm/server/lib/to-route.js","webpack://next/./dist/esm/server/base-server.js","webpack://next/./dist/esm/shared/lib/router/utils/get-route-from-asset-path.js","webpack://next/./dist/esm/server/lib/format-hostname.js","webpack://next/./dist/esm/server/server-utils.js","webpack://next/./dist/esm/server/utils.js","webpack://next/./dist/esm/lib/is-edge-runtime.js","webpack://next/./dist/esm/server/lib/server-action-request-meta.js","webpack://next/./dist/esm/shared/lib/router/utils/escape-path-delimiters.js","webpack://next/./dist/esm/server/future/route-modules/checks.js","webpack://next/./dist/esm/server/future/route-modules/helpers/response-handlers.js","webpack://next/./dist/esm/lib/redirect-status.js","webpack://next/external node-commonjs \"vm\"","webpack://next/./dist/esm/shared/lib/deep-freeze.js","webpack://next/./dist/esm/server/load-manifest.js","webpack://next/./dist/esm/server/require.js","webpack://next/./dist/esm/lib/interop-default.js","webpack://next/./dist/esm/lib/wait.js","webpack://next/./dist/esm/server/app-render/encryption-utils.js","webpack://next/./dist/esm/server/load-components.js","webpack://next/./dist/esm/server/app-render/action-utils.js","webpack://next/external node-commonjs \"stream\"","webpack://next/./dist/esm/lib/batcher.js","webpack://next/./dist/esm/lib/scheduler.js","webpack://next/./dist/esm/server/response-cache/utils.js","webpack://next/./dist/esm/server/response-cache/index.js","webpack://next/./dist/esm/server/lib/incremental-cache/shared-revalidate-timings.js","webpack://next/./dist/esm/server/lib/incremental-cache/index.js","webpack://next/external node-commonjs \"http\"","webpack://next/external node-commonjs \"https\"","webpack://next/./dist/esm/server/lib/node-fs-methods.js","webpack://next/./dist/esm/server/lib/mock-request.js","webpack://next/./dist/esm/server/future/helpers/module-loader/node-module-loader.js","webpack://next/./dist/esm/server/future/helpers/module-loader/route-module-loader.js","webpack://next/./dist/esm/lib/format-dynamic-import-path.js","webpack://next/./dist/esm/lib/generate-interception-routes-rewrites.js","webpack://next/./dist/esm/server/next-server.js","webpack://next/./dist/esm/server/future/route-matches/pages-api-route-match.js","webpack://next/./dist/esm/server/setup-http-agent-env.js","webpack://next/./dist/esm/shared/lib/router/utils/middleware-route-matcher.js","webpack://next/./dist/esm/server/body-streams.js"],"sourcesContent":["(()=>{var e={383:e=>{\"use strict\";function _searchLast(e,t){const n=Array.from(e.matchAll(t));return n.length>0?n.slice(-1)[0].index:-1}function _interpolate(e,t,n){const r=_searchLast(e,/(?!(?<=\\\\))\\$/g);if(r===-1)return e;const o=e.slice(r);const s=/((?!(?<=\\\\))\\${?([\\w]+)(?::-([^}\\\\]*))?}?)/;const i=o.match(s);if(i!=null){const[,r,o,s]=i;return _interpolate(e.replace(r,t[o]||s||n.parsed[o]||\"\"),t,n)}return e}function _resolveEscapeSequences(e){return e.replace(/\\\\\\$/g,\"$\")}function expand(e){const t=e.ignoreProcessEnv?{}:process.env;for(const n in e.parsed){const r=Object.prototype.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=_resolveEscapeSequences(_interpolate(r,t,e))}for(const n in e.parsed){t[n]=e.parsed[n]}return e}e.exports.j=expand},234:(e,t,n)=>{const r=n(147);const o=n(17);const s=n(37);const i=n(113);const c=n(803);const a=c.version;const l=/(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/gm;function parse(e){const t={};let n=e.toString();n=n.replace(/\\r\\n?/gm,\"\\n\");let r;while((r=l.exec(n))!=null){const e=r[1];let n=r[2]||\"\";n=n.trim();const o=n[0];n=n.replace(/^(['\"`])([\\s\\S]*)\\1$/gm,\"$2\");if(o==='\"'){n=n.replace(/\\\\n/g,\"\\n\");n=n.replace(/\\\\r/g,\"\\r\")}t[e]=n}return t}function _parseVault(e){const t=_vaultPath(e);const n=p.configDotenv({path:t});if(!n.parsed){throw new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`)}const r=_dotenvKey(e).split(\",\");const o=r.length;let s;for(let e=0;e<o;e++){try{const t=r[e].trim();const o=_instructions(n,t);s=p.decrypt(o.ciphertext,o.key);break}catch(t){if(e+1>=o){throw t}}}return p.parse(s)}function _log(e){console.log(`[dotenv@${a}][INFO] ${e}`)}function _warn(e){console.log(`[dotenv@${a}][WARN] ${e}`)}function _debug(e){console.log(`[dotenv@${a}][DEBUG] ${e}`)}function _dotenvKey(e){if(e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0){return e.DOTENV_KEY}if(process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0){return process.env.DOTENV_KEY}return\"\"}function _instructions(e,t){let n;try{n=new URL(t)}catch(e){if(e.code===\"ERR_INVALID_URL\"){throw new Error(\"INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development\")}throw e}const r=n.password;if(!r){throw new Error(\"INVALID_DOTENV_KEY: Missing key part\")}const o=n.searchParams.get(\"environment\");if(!o){throw new Error(\"INVALID_DOTENV_KEY: Missing environment part\")}const s=`DOTENV_VAULT_${o.toUpperCase()}`;const i=e.parsed[s];if(!i){throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`)}return{ciphertext:i,key:r}}function _vaultPath(e){let t=o.resolve(process.cwd(),\".env\");if(e&&e.path&&e.path.length>0){t=e.path}return t.endsWith(\".vault\")?t:`${t}.vault`}function _resolveHome(e){return e[0]===\"~\"?o.join(s.homedir(),e.slice(1)):e}function _configVault(e){_log(\"Loading env from encrypted .env.vault\");const t=p._parseVault(e);let n=process.env;if(e&&e.processEnv!=null){n=e.processEnv}p.populate(n,t,e);return{parsed:t}}function configDotenv(e){let t=o.resolve(process.cwd(),\".env\");let n=\"utf8\";const s=Boolean(e&&e.debug);if(e){if(e.path!=null){t=_resolveHome(e.path)}if(e.encoding!=null){n=e.encoding}}try{const o=p.parse(r.readFileSync(t,{encoding:n}));let s=process.env;if(e&&e.processEnv!=null){s=e.processEnv}p.populate(s,o,e);return{parsed:o}}catch(e){if(s){_debug(`Failed to load ${t} ${e.message}`)}return{error:e}}}function config(e){const t=_vaultPath(e);if(_dotenvKey(e).length===0){return p.configDotenv(e)}if(!r.existsSync(t)){_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`);return p.configDotenv(e)}return p._configVault(e)}function decrypt(e,t){const n=Buffer.from(t.slice(-64),\"hex\");let r=Buffer.from(e,\"base64\");const o=r.slice(0,12);const s=r.slice(-16);r=r.slice(12,-16);try{const e=i.createDecipheriv(\"aes-256-gcm\",n,o);e.setAuthTag(s);return`${e.update(r)}${e.final()}`}catch(e){const t=e instanceof RangeError;const n=e.message===\"Invalid key length\";const r=e.message===\"Unsupported state or unable to authenticate data\";if(t||n){const e=\"INVALID_DOTENV_KEY: It must be 64 characters long (or more)\";throw new Error(e)}else if(r){const e=\"DECRYPTION_FAILED: Please check your DOTENV_KEY\";throw new Error(e)}else{console.error(\"Error: \",e.code);console.error(\"Error: \",e.message);throw e}}}function populate(e,t,n={}){const r=Boolean(n&&n.debug);const o=Boolean(n&&n.override);if(typeof t!==\"object\"){throw new Error(\"OBJECT_REQUIRED: Please check the processEnv argument being passed to populate\")}for(const n of Object.keys(t)){if(Object.prototype.hasOwnProperty.call(e,n)){if(o===true){e[n]=t[n]}if(r){if(o===true){_debug(`\"${n}\" is already defined and WAS overwritten`)}else{_debug(`\"${n}\" is already defined and was NOT overwritten`)}}}else{e[n]=t[n]}}}const p={configDotenv:configDotenv,_configVault:_configVault,_parseVault:_parseVault,config:config,decrypt:decrypt,parse:parse,populate:populate};e.exports.configDotenv=p.configDotenv;e.exports._configVault=p._configVault;e.exports._parseVault=p._parseVault;e.exports.config=p.config;e.exports.decrypt=p.decrypt;e.exports.parse=p.parse;e.exports.populate=p.populate;e.exports=p},113:e=>{\"use strict\";e.exports=require(\"crypto\")},147:e=>{\"use strict\";e.exports=require(\"fs\")},37:e=>{\"use strict\";e.exports=require(\"os\")},17:e=>{\"use strict\";e.exports=require(\"path\")},803:e=>{\"use strict\";e.exports=JSON.parse('{\"name\":\"dotenv\",\"version\":\"16.3.1\",\"description\":\"Loads environment variables from .env file\",\"main\":\"lib/main.js\",\"types\":\"lib/main.d.ts\",\"exports\":{\".\":{\"types\":\"./lib/main.d.ts\",\"require\":\"./lib/main.js\",\"default\":\"./lib/main.js\"},\"./config\":\"./config.js\",\"./config.js\":\"./config.js\",\"./lib/env-options\":\"./lib/env-options.js\",\"./lib/env-options.js\":\"./lib/env-options.js\",\"./lib/cli-options\":\"./lib/cli-options.js\",\"./lib/cli-options.js\":\"./lib/cli-options.js\",\"./package.json\":\"./package.json\"},\"scripts\":{\"dts-check\":\"tsc --project tests/types/tsconfig.json\",\"lint\":\"standard\",\"lint-readme\":\"standard-markdown\",\"pretest\":\"npm run lint && npm run dts-check\",\"test\":\"tap tests/*.js --100 -Rspec\",\"prerelease\":\"npm test\",\"release\":\"standard-version\"},\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/motdotla/dotenv.git\"},\"funding\":\"https://github.com/motdotla/dotenv?sponsor=1\",\"keywords\":[\"dotenv\",\"env\",\".env\",\"environment\",\"variables\",\"config\",\"settings\"],\"readmeFilename\":\"README.md\",\"license\":\"BSD-2-Clause\",\"devDependencies\":{\"@definitelytyped/dtslint\":\"^0.0.133\",\"@types/node\":\"^18.11.3\",\"decache\":\"^4.6.1\",\"sinon\":\"^14.0.1\",\"standard\":\"^17.0.0\",\"standard-markdown\":\"^7.1.0\",\"standard-version\":\"^9.5.0\",\"tap\":\"^16.3.0\",\"tar\":\"^6.1.11\",\"typescript\":\"^4.8.4\"},\"engines\":{\"node\":\">=12\"},\"browser\":{\"fs\":false}}')}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var o=t[n]={exports:{}};var s=true;try{e[n](o,o.exports,__nccwpck_require__);s=false}finally{if(s)delete t[n]}return o.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e[\"default\"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var n in t){if(__nccwpck_require__.o(t,n)&&!__nccwpck_require__.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:t[n]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(e,\"__esModule\",{value:true})}})();if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var n={};(()=>{\"use strict\";__nccwpck_require__.r(n);__nccwpck_require__.d(n,{initialEnv:()=>a,updateInitialEnv:()=>updateInitialEnv,processEnv:()=>processEnv,resetEnv:()=>resetEnv,loadEnvConfig:()=>loadEnvConfig});var e=__nccwpck_require__(147);var t=__nccwpck_require__.n(e);var r=__nccwpck_require__(17);var o=__nccwpck_require__.n(r);var s=__nccwpck_require__(234);var i=__nccwpck_require__.n(s);var c=__nccwpck_require__(383);let a=undefined;let l=undefined;let p=[];let u=[];function updateInitialEnv(e){Object.assign(a||{},e)}function replaceProcessEnv(e){Object.keys(process.env).forEach((t=>{if(!t.startsWith(\"__NEXT_PRIVATE\")){if(e[t]===undefined||e[t]===\"\"){delete process.env[t]}}}));Object.entries(e).forEach((([e,t])=>{process.env[e]=t}))}function processEnv(e,t,n=console,o=false,i){var l;if(!a){a=Object.assign({},process.env)}if(!o&&(process.env.__NEXT_PROCESSED_ENV||e.length===0)){return process.env}process.env.__NEXT_PROCESSED_ENV=\"true\";const p=Object.assign({},a);const _={};for(const o of e){try{let e={};e.parsed=s.parse(o.contents);e=(0,c.j)(e);if(e.parsed&&!u.some((e=>e.contents===o.contents&&e.path===o.path))){i===null||i===void 0?void 0:i(o.path)}for(const t of Object.keys(e.parsed||{})){if(typeof _[t]===\"undefined\"&&typeof p[t]===\"undefined\"){_[t]=(l=e.parsed)===null||l===void 0?void 0:l[t]}}}catch(e){n.error(`Failed to load env from ${r.join(t||\"\",o.path)}`,e)}}return Object.assign(process.env,_)}function resetEnv(){if(a){replaceProcessEnv(a)}}function loadEnvConfig(t,n,o=console,s=false,i){if(!a){a=Object.assign({},process.env)}if(l&&!s){return{combinedEnv:l,loadedEnvFiles:p}}replaceProcessEnv(a);u=p;p=[];const c=process.env.NODE_ENV===\"test\";const _=c?\"test\":n?\"development\":\"production\";const d=[`.env.${_}.local`,_!==\"test\"&&`.env.local`,`.env.${_}`,\".env\"].filter(Boolean);for(const n of d){const s=r.join(t,n);try{const t=e.statSync(s);if(!t.isFile()){continue}const r=e.readFileSync(s,\"utf8\");p.push({path:n,contents:r})}catch(e){if(e.code!==\"ENOENT\"){o.error(`Failed to load env from ${n}`,e)}}}l=processEnv(p,t,o,s,i);return{combinedEnv:l,loadedEnvFiles:p}}})();module.exports=n})();","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n RequestCookies: () => RequestCookies,\n ResponseCookies: () => ResponseCookies,\n parseCookie: () => parseCookie,\n parseSetCookie: () => parseSetCookie,\n stringifyCookie: () => stringifyCookie\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/serialize.ts\nfunction stringifyCookie(c) {\n var _a;\n const attrs = [\n \"path\" in c && c.path && `Path=${c.path}`,\n \"expires\" in c && (c.expires || c.expires === 0) && `Expires=${(typeof c.expires === \"number\" ? new Date(c.expires) : c.expires).toUTCString()}`,\n \"maxAge\" in c && typeof c.maxAge === \"number\" && `Max-Age=${c.maxAge}`,\n \"domain\" in c && c.domain && `Domain=${c.domain}`,\n \"secure\" in c && c.secure && \"Secure\",\n \"httpOnly\" in c && c.httpOnly && \"HttpOnly\",\n \"sameSite\" in c && c.sameSite && `SameSite=${c.sameSite}`,\n \"partitioned\" in c && c.partitioned && \"Partitioned\",\n \"priority\" in c && c.priority && `Priority=${c.priority}`\n ].filter(Boolean);\n const stringified = `${c.name}=${encodeURIComponent((_a = c.value) != null ? _a : \"\")}`;\n return attrs.length === 0 ? stringified : `${stringified}; ${attrs.join(\"; \")}`;\n}\nfunction parseCookie(cookie) {\n const map = /* @__PURE__ */ new Map();\n for (const pair of cookie.split(/; */)) {\n if (!pair)\n continue;\n const splitAt = pair.indexOf(\"=\");\n if (splitAt === -1) {\n map.set(pair, \"true\");\n continue;\n }\n const [key, value] = [pair.slice(0, splitAt), pair.slice(splitAt + 1)];\n try {\n map.set(key, decodeURIComponent(value != null ? value : \"true\"));\n } catch {\n }\n }\n return map;\n}\nfunction parseSetCookie(setCookie) {\n if (!setCookie) {\n return void 0;\n }\n const [[name, value], ...attributes] = parseCookie(setCookie);\n const {\n domain,\n expires,\n httponly,\n maxage,\n path,\n samesite,\n secure,\n partitioned,\n priority\n } = Object.fromEntries(\n attributes.map(([key, value2]) => [key.toLowerCase(), value2])\n );\n const cookie = {\n name,\n value: decodeURIComponent(value),\n domain,\n ...expires && { expires: new Date(expires) },\n ...httponly && { httpOnly: true },\n ...typeof maxage === \"string\" && { maxAge: Number(maxage) },\n path,\n ...samesite && { sameSite: parseSameSite(samesite) },\n ...secure && { secure: true },\n ...priority && { priority: parsePriority(priority) },\n ...partitioned && { partitioned: true }\n };\n return compact(cookie);\n}\nfunction compact(t) {\n const newT = {};\n for (const key in t) {\n if (t[key]) {\n newT[key] = t[key];\n }\n }\n return newT;\n}\nvar SAME_SITE = [\"strict\", \"lax\", \"none\"];\nfunction parseSameSite(string) {\n string = string.toLowerCase();\n return SAME_SITE.includes(string) ? string : void 0;\n}\nvar PRIORITY = [\"low\", \"medium\", \"high\"];\nfunction parsePriority(string) {\n string = string.toLowerCase();\n return PRIORITY.includes(string) ? string : void 0;\n}\nfunction splitCookiesString(cookiesString) {\n if (!cookiesString)\n return [];\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n function skipWhitespace() {\n while (pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))) {\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n while (pos < cookiesString.length) {\n start = pos;\n cookiesSeparatorFound = false;\n while (skipWhitespace()) {\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n lastComma = pos;\n pos += 1;\n skipWhitespace();\n nextStart = pos;\n while (pos < cookiesString.length && notSpecialChar()) {\n pos += 1;\n }\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n cookiesSeparatorFound = true;\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n return cookiesStrings;\n}\n\n// src/request-cookies.ts\nvar RequestCookies = class {\n constructor(requestHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n this._headers = requestHeaders;\n const header = requestHeaders.get(\"cookie\");\n if (header) {\n const parsed = parseCookie(header);\n for (const [name, value] of parsed) {\n this._parsed.set(name, { name, value });\n }\n }\n }\n [Symbol.iterator]() {\n return this._parsed[Symbol.iterator]();\n }\n /**\n * The amount of cookies received from the client\n */\n get size() {\n return this._parsed.size;\n }\n get(...args) {\n const name = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(name);\n }\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed);\n if (!args.length) {\n return all.map(([_, value]) => value);\n }\n const name = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter(([n]) => n === name).map(([_, value]) => value);\n }\n has(name) {\n return this._parsed.has(name);\n }\n set(...args) {\n const [name, value] = args.length === 1 ? [args[0].name, args[0].value] : args;\n const map = this._parsed;\n map.set(name, { name, value });\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value2]) => stringifyCookie(value2)).join(\"; \")\n );\n return this;\n }\n /**\n * Delete the cookies matching the passed name or names in the request.\n */\n delete(names) {\n const map = this._parsed;\n const result = !Array.isArray(names) ? map.delete(names) : names.map((name) => map.delete(name));\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value]) => stringifyCookie(value)).join(\"; \")\n );\n return result;\n }\n /**\n * Delete all the cookies in the cookies in the request.\n */\n clear() {\n this.delete(Array.from(this._parsed.keys()));\n return this;\n }\n /**\n * Format the cookies in the request as a string for logging\n */\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map((v) => `${v.name}=${encodeURIComponent(v.value)}`).join(\"; \");\n }\n};\n\n// src/response-cookies.ts\nvar ResponseCookies = class {\n constructor(responseHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n var _a, _b, _c;\n this._headers = responseHeaders;\n const setCookie = (_c = (_b = (_a = responseHeaders.getSetCookie) == null ? void 0 : _a.call(responseHeaders)) != null ? _b : responseHeaders.get(\"set-cookie\")) != null ? _c : [];\n const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie);\n for (const cookieString of cookieStrings) {\n const parsed = parseSetCookie(cookieString);\n if (parsed)\n this._parsed.set(parsed.name, parsed);\n }\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.\n */\n get(...args) {\n const key = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(key);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.\n */\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed.values());\n if (!args.length) {\n return all;\n }\n const key = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter((c) => c.name === key);\n }\n has(name) {\n return this._parsed.has(name);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.\n */\n set(...args) {\n const [name, value, cookie] = args.length === 1 ? [args[0].name, args[0].value, args[0]] : args;\n const map = this._parsed;\n map.set(name, normalizeCookie({ name, value, ...cookie }));\n replace(map, this._headers);\n return this;\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.\n */\n delete(...args) {\n const [name, path, domain] = typeof args[0] === \"string\" ? [args[0]] : [args[0].name, args[0].path, args[0].domain];\n return this.set({ name, path, domain, value: \"\", expires: /* @__PURE__ */ new Date(0) });\n }\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map(stringifyCookie).join(\"; \");\n }\n};\nfunction replace(bag, headers) {\n headers.delete(\"set-cookie\");\n for (const [, value] of bag) {\n const serialized = stringifyCookie(value);\n headers.append(\"set-cookie\", serialized);\n }\n}\nfunction normalizeCookie(cookie = { name: \"\", value: \"\" }) {\n if (typeof cookie.expires === \"number\") {\n cookie.expires = new Date(cookie.expires);\n }\n if (cookie.maxAge) {\n cookie.expires = new Date(Date.now() + cookie.maxAge * 1e3);\n }\n if (cookie.path === null || cookie.path === void 0) {\n cookie.path = \"/\";\n }\n return cookie;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n RequestCookies,\n ResponseCookies,\n parseCookie,\n parseSetCookie,\n stringifyCookie\n});\n","(()=>{\"use strict\";if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var e={};(()=>{var r=e;\n/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */r.parse=parse;r.serialize=serialize;var i=decodeURIComponent;var t=encodeURIComponent;var a=/; */;var n=/^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;function parse(e,r){if(typeof e!==\"string\"){throw new TypeError(\"argument str must be a string\")}var t={};var n=r||{};var o=e.split(a);var s=n.decode||i;for(var p=0;p<o.length;p++){var f=o[p];var u=f.indexOf(\"=\");if(u<0){continue}var v=f.substr(0,u).trim();var c=f.substr(++u,f.length).trim();if('\"'==c[0]){c=c.slice(1,-1)}if(undefined==t[v]){t[v]=tryDecode(c,s)}}return t}function serialize(e,r,i){var a=i||{};var o=a.encode||t;if(typeof o!==\"function\"){throw new TypeError(\"option encode is invalid\")}if(!n.test(e)){throw new TypeError(\"argument name is invalid\")}var s=o(r);if(s&&!n.test(s)){throw new TypeError(\"argument val is invalid\")}var p=e+\"=\"+s;if(null!=a.maxAge){var f=a.maxAge-0;if(isNaN(f)||!isFinite(f)){throw new TypeError(\"option maxAge is invalid\")}p+=\"; Max-Age=\"+Math.floor(f)}if(a.domain){if(!n.test(a.domain)){throw new TypeError(\"option domain is invalid\")}p+=\"; Domain=\"+a.domain}if(a.path){if(!n.test(a.path)){throw new TypeError(\"option path is invalid\")}p+=\"; Path=\"+a.path}if(a.expires){if(typeof a.expires.toUTCString!==\"function\"){throw new TypeError(\"option expires is invalid\")}p+=\"; Expires=\"+a.expires.toUTCString()}if(a.httpOnly){p+=\"; HttpOnly\"}if(a.secure){p+=\"; Secure\"}if(a.sameSite){var u=typeof a.sameSite===\"string\"?a.sameSite.toLowerCase():a.sameSite;switch(u){case true:p+=\"; SameSite=Strict\";break;case\"lax\":p+=\"; SameSite=Lax\";break;case\"strict\":p+=\"; SameSite=Strict\";break;case\"none\":p+=\"; SameSite=None\";break;default:throw new TypeError(\"option sameSite is invalid\")}}return p}function tryDecode(e,r){try{return r(e)}catch(r){return e}}})();module.exports=e})();","(()=>{\"use strict\";var e={695:e=>{\n/*!\n * fresh\n * Copyright(c) 2012 TJ Holowaychuk\n * Copyright(c) 2016-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\nvar r=/(?:^|,)\\s*?no-cache\\s*?(?:,|$)/;e.exports=fresh;function fresh(e,a){var t=e[\"if-modified-since\"];var s=e[\"if-none-match\"];if(!t&&!s){return false}var i=e[\"cache-control\"];if(i&&r.test(i)){return false}if(s&&s!==\"*\"){var f=a[\"etag\"];if(!f){return false}var n=true;var u=parseTokenList(s);for(var _=0;_<u.length;_++){var o=u[_];if(o===f||o===\"W/\"+f||\"W/\"+o===f){n=false;break}}if(n){return false}}if(t){var p=a[\"last-modified\"];var v=!p||!(parseHttpDate(p)<=parseHttpDate(t));if(v){return false}}return true}function parseHttpDate(e){var r=e&&Date.parse(e);return typeof r===\"number\"?r:NaN}function parseTokenList(e){var r=0;var a=[];var t=0;for(var s=0,i=e.length;s<i;s++){switch(e.charCodeAt(s)){case 32:if(t===r){t=r=s+1}break;case 44:a.push(e.substring(t,r));t=r=s+1;break;default:r=s+1;break}}a.push(e.substring(t,r));return a}}};var r={};function __nccwpck_require__(a){var t=r[a];if(t!==undefined){return t.exports}var s=r[a]={exports:{}};var i=true;try{e[a](s,s.exports,__nccwpck_require__);i=false}finally{if(i)delete r[a]}return s.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var a=__nccwpck_require__(695);module.exports=a})();","(()=>{\"use strict\";var t={806:(t,e,i)=>{const s=i(190);const n=Symbol(\"max\");const l=Symbol(\"length\");const r=Symbol(\"lengthCalculator\");const h=Symbol(\"allowStale\");const a=Symbol(\"maxAge\");const o=Symbol(\"dispose\");const u=Symbol(\"noDisposeOnSet\");const f=Symbol(\"lruList\");const p=Symbol(\"cache\");const v=Symbol(\"updateAgeOnGet\");const naiveLength=()=>1;class LRUCache{constructor(t){if(typeof t===\"number\")t={max:t};if(!t)t={};if(t.max&&(typeof t.max!==\"number\"||t.max<0))throw new TypeError(\"max must be a non-negative number\");const e=this[n]=t.max||Infinity;const i=t.length||naiveLength;this[r]=typeof i!==\"function\"?naiveLength:i;this[h]=t.stale||false;if(t.maxAge&&typeof t.maxAge!==\"number\")throw new TypeError(\"maxAge must be a number\");this[a]=t.maxAge||0;this[o]=t.dispose;this[u]=t.noDisposeOnSet||false;this[v]=t.updateAgeOnGet||false;this.reset()}set max(t){if(typeof t!==\"number\"||t<0)throw new TypeError(\"max must be a non-negative number\");this[n]=t||Infinity;trim(this)}get max(){return this[n]}set allowStale(t){this[h]=!!t}get allowStale(){return this[h]}set maxAge(t){if(typeof t!==\"number\")throw new TypeError(\"maxAge must be a non-negative number\");this[a]=t;trim(this)}get maxAge(){return this[a]}set lengthCalculator(t){if(typeof t!==\"function\")t=naiveLength;if(t!==this[r]){this[r]=t;this[l]=0;this[f].forEach((t=>{t.length=this[r](t.value,t.key);this[l]+=t.length}))}trim(this)}get lengthCalculator(){return this[r]}get length(){return this[l]}get itemCount(){return this[f].length}rforEach(t,e){e=e||this;for(let i=this[f].tail;i!==null;){const s=i.prev;forEachStep(this,t,i,e);i=s}}forEach(t,e){e=e||this;for(let i=this[f].head;i!==null;){const s=i.next;forEachStep(this,t,i,e);i=s}}keys(){return this[f].toArray().map((t=>t.key))}values(){return this[f].toArray().map((t=>t.value))}reset(){if(this[o]&&this[f]&&this[f].length){this[f].forEach((t=>this[o](t.key,t.value)))}this[p]=new Map;this[f]=new s;this[l]=0}dump(){return this[f].map((t=>isStale(this,t)?false:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[f]}set(t,e,i){i=i||this[a];if(i&&typeof i!==\"number\")throw new TypeError(\"maxAge must be a number\");const s=i?Date.now():0;const h=this[r](e,t);if(this[p].has(t)){if(h>this[n]){del(this,this[p].get(t));return false}const r=this[p].get(t);const a=r.value;if(this[o]){if(!this[u])this[o](t,a.value)}a.now=s;a.maxAge=i;a.value=e;this[l]+=h-a.length;a.length=h;this.get(t);trim(this);return true}const v=new Entry(t,e,h,s,i);if(v.length>this[n]){if(this[o])this[o](t,e);return false}this[l]+=v.length;this[f].unshift(v);this[p].set(t,this[f].head);trim(this);return true}has(t){if(!this[p].has(t))return false;const e=this[p].get(t).value;return!isStale(this,e)}get(t){return get(this,t,true)}peek(t){return get(this,t,false)}pop(){const t=this[f].tail;if(!t)return null;del(this,t);return t.value}del(t){del(this,this[p].get(t))}load(t){this.reset();const e=Date.now();for(let i=t.length-1;i>=0;i--){const s=t[i];const n=s.e||0;if(n===0)this.set(s.k,s.v);else{const t=n-e;if(t>0){this.set(s.k,s.v,t)}}}}prune(){this[p].forEach(((t,e)=>get(this,e,false)))}}const get=(t,e,i)=>{const s=t[p].get(e);if(s){const e=s.value;if(isStale(t,e)){del(t,s);if(!t[h])return undefined}else{if(i){if(t[v])s.value.now=Date.now();t[f].unshiftNode(s)}}return e.value}};const isStale=(t,e)=>{if(!e||!e.maxAge&&!t[a])return false;const i=Date.now()-e.now;return e.maxAge?i>e.maxAge:t[a]&&i>t[a]};const trim=t=>{if(t[l]>t[n]){for(let e=t[f].tail;t[l]>t[n]&&e!==null;){const i=e.prev;del(t,e);e=i}}};const del=(t,e)=>{if(e){const i=e.value;if(t[o])t[o](i.key,i.value);t[l]-=i.length;t[p].delete(i.key);t[f].removeNode(e)}};class Entry{constructor(t,e,i,s,n){this.key=t;this.value=e;this.length=i;this.now=s;this.maxAge=n||0}}const forEachStep=(t,e,i,s)=>{let n=i.value;if(isStale(t,n)){del(t,i);if(!t[h])n=undefined}if(n)e.call(s,n.value,n.key,t)};t.exports=LRUCache},76:t=>{t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next){yield t.value}}}},190:(t,e,i)=>{t.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(t){var e=this;if(!(e instanceof Yallist)){e=new Yallist}e.tail=null;e.head=null;e.length=0;if(t&&typeof t.forEach===\"function\"){t.forEach((function(t){e.push(t)}))}else if(arguments.length>0){for(var i=0,s=arguments.length;i<s;i++){e.push(arguments[i])}}return e}Yallist.prototype.removeNode=function(t){if(t.list!==this){throw new Error(\"removing node which does not belong to this list\")}var e=t.next;var i=t.prev;if(e){e.prev=i}if(i){i.next=e}if(t===this.head){this.head=e}if(t===this.tail){this.tail=i}t.list.length--;t.next=null;t.prev=null;t.list=null;return e};Yallist.prototype.unshiftNode=function(t){if(t===this.head){return}if(t.list){t.list.removeNode(t)}var e=this.head;t.list=this;t.next=e;if(e){e.prev=t}this.head=t;if(!this.tail){this.tail=t}this.length++};Yallist.prototype.pushNode=function(t){if(t===this.tail){return}if(t.list){t.list.removeNode(t)}var e=this.tail;t.list=this;t.prev=e;if(e){e.next=t}this.tail=t;if(!this.head){this.head=t}this.length++};Yallist.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++){push(this,arguments[t])}return this.length};Yallist.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++){unshift(this,arguments[t])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var t=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return t};Yallist.prototype.shift=function(){if(!this.head){return undefined}var t=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return t};Yallist.prototype.forEach=function(t,e){e=e||this;for(var i=this.head,s=0;i!==null;s++){t.call(e,i.value,s,this);i=i.next}};Yallist.prototype.forEachReverse=function(t,e){e=e||this;for(var i=this.tail,s=this.length-1;i!==null;s--){t.call(e,i.value,s,this);i=i.prev}};Yallist.prototype.get=function(t){for(var e=0,i=this.head;i!==null&&e<t;e++){i=i.next}if(e===t&&i!==null){return i.value}};Yallist.prototype.getReverse=function(t){for(var e=0,i=this.tail;i!==null&&e<t;e++){i=i.prev}if(e===t&&i!==null){return i.value}};Yallist.prototype.map=function(t,e){e=e||this;var i=new Yallist;for(var s=this.head;s!==null;){i.push(t.call(e,s.value,this));s=s.next}return i};Yallist.prototype.mapReverse=function(t,e){e=e||this;var i=new Yallist;for(var s=this.tail;s!==null;){i.push(t.call(e,s.value,this));s=s.prev}return i};Yallist.prototype.reduce=function(t,e){var i;var s=this.head;if(arguments.length>1){i=e}else if(this.head){s=this.head.next;i=this.head.value}else{throw new TypeError(\"Reduce of empty list with no initial value\")}for(var n=0;s!==null;n++){i=t(i,s.value,n);s=s.next}return i};Yallist.prototype.reduceReverse=function(t,e){var i;var s=this.tail;if(arguments.length>1){i=e}else if(this.tail){s=this.tail.prev;i=this.tail.value}else{throw new TypeError(\"Reduce of empty list with no initial value\")}for(var n=this.length-1;s!==null;n--){i=t(i,s.value,n);s=s.prev}return i};Yallist.prototype.toArray=function(){var t=new Array(this.length);for(var e=0,i=this.head;i!==null;e++){t[e]=i.value;i=i.next}return t};Yallist.prototype.toArrayReverse=function(){var t=new Array(this.length);for(var e=0,i=this.tail;i!==null;e++){t[e]=i.value;i=i.prev}return t};Yallist.prototype.slice=function(t,e){e=e||this.length;if(e<0){e+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(e<t||e<0){return i}if(t<0){t=0}if(e>this.length){e=this.length}for(var s=0,n=this.head;n!==null&&s<t;s++){n=n.next}for(;n!==null&&s<e;s++,n=n.next){i.push(n.value)}return i};Yallist.prototype.sliceReverse=function(t,e){e=e||this.length;if(e<0){e+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(e<t||e<0){return i}if(t<0){t=0}if(e>this.length){e=this.length}for(var s=this.length,n=this.tail;n!==null&&s>e;s--){n=n.prev}for(;n!==null&&s>t;s--,n=n.prev){i.push(n.value)}return i};Yallist.prototype.splice=function(t,e){if(t>this.length){t=this.length-1}if(t<0){t=this.length+t}for(var i=0,s=this.head;s!==null&&i<t;i++){s=s.next}var n=[];for(var i=0;s&&i<e;i++){n.push(s.value);s=this.removeNode(s)}if(s===null){s=this.tail}if(s!==this.head&&s!==this.tail){s=s.prev}for(var i=2;i<arguments.length;i++){s=insert(this,s,arguments[i])}return n};Yallist.prototype.reverse=function(){var t=this.head;var e=this.tail;for(var i=t;i!==null;i=i.prev){var s=i.prev;i.prev=i.next;i.next=s}this.head=e;this.tail=t;return this};function insert(t,e,i){var s=e===t.head?new Node(i,null,e,t):new Node(i,e,e.next,t);if(s.next===null){t.tail=s}if(s.prev===null){t.head=s}t.length++;return s}function push(t,e){t.tail=new Node(e,t.tail,null,t);if(!t.head){t.head=t.tail}t.length++}function unshift(t,e){t.head=new Node(e,null,t.head,t);if(!t.tail){t.tail=t.head}t.length++}function Node(t,e,i,s){if(!(this instanceof Node)){return new Node(t,e,i,s)}this.list=s;this.value=t;if(e){e.next=this;this.prev=e}else{this.prev=null}if(i){i.prev=this;this.next=i}else{this.next=null}}try{i(76)(Yallist)}catch(t){}}};var e={};function __nccwpck_require__(i){var s=e[i];if(s!==undefined){return s.exports}var n=e[i]={exports:{}};var l=true;try{t[i](n,n.exports,__nccwpck_require__);l=false}finally{if(l)delete e[i]}return n.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var i=__nccwpck_require__(806);module.exports=i})();","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Tokenize input string.\n */\nfunction lexer(str) {\n var tokens = [];\n var i = 0;\n while (i < str.length) {\n var char = str[i];\n if (char === \"*\" || char === \"+\" || char === \"?\") {\n tokens.push({ type: \"MODIFIER\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"\\\\\") {\n tokens.push({ type: \"ESCAPED_CHAR\", index: i++, value: str[i++] });\n continue;\n }\n if (char === \"{\") {\n tokens.push({ type: \"OPEN\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"}\") {\n tokens.push({ type: \"CLOSE\", index: i, value: str[i++] });\n continue;\n }\n if (char === \":\") {\n var name = \"\";\n var j = i + 1;\n while (j < str.length) {\n var code = str.charCodeAt(j);\n if (\n // `0-9`\n (code >= 48 && code <= 57) ||\n // `A-Z`\n (code >= 65 && code <= 90) ||\n // `a-z`\n (code >= 97 && code <= 122) ||\n // `_`\n code === 95) {\n name += str[j++];\n continue;\n }\n break;\n }\n if (!name)\n throw new TypeError(\"Missing parameter name at \" + i);\n tokens.push({ type: \"NAME\", index: i, value: name });\n i = j;\n continue;\n }\n if (char === \"(\") {\n var count = 1;\n var pattern = \"\";\n var j = i + 1;\n if (str[j] === \"?\") {\n throw new TypeError(\"Pattern cannot start with \\\"?\\\" at \" + j);\n }\n while (j < str.length) {\n if (str[j] === \"\\\\\") {\n pattern += str[j++] + str[j++];\n continue;\n }\n if (str[j] === \")\") {\n count--;\n if (count === 0) {\n j++;\n break;\n }\n }\n else if (str[j] === \"(\") {\n count++;\n if (str[j + 1] !== \"?\") {\n throw new TypeError(\"Capturing groups are not allowed at \" + j);\n }\n }\n pattern += str[j++];\n }\n if (count)\n throw new TypeError(\"Unbalanced pattern at \" + i);\n if (!pattern)\n throw new TypeError(\"Missing pattern at \" + i);\n tokens.push({ type: \"PATTERN\", index: i, value: pattern });\n i = j;\n continue;\n }\n tokens.push({ type: \"CHAR\", index: i, value: str[i++] });\n }\n tokens.push({ type: \"END\", index: i, value: \"\" });\n return tokens;\n}\n/**\n * Parse a string for the raw tokens.\n */\nfunction parse(str, options) {\n if (options === void 0) { options = {}; }\n var tokens = lexer(str);\n var _a = options.prefixes, prefixes = _a === void 0 ? \"./\" : _a;\n var defaultPattern = \"[^\" + escapeString(options.delimiter || \"/#?\") + \"]+?\";\n var result = [];\n var key = 0;\n var i = 0;\n var path = \"\";\n var tryConsume = function (type) {\n if (i < tokens.length && tokens[i].type === type)\n return tokens[i++].value;\n };\n var mustConsume = function (type) {\n var value = tryConsume(type);\n if (value !== undefined)\n return value;\n var _a = tokens[i], nextType = _a.type, index = _a.index;\n throw new TypeError(\"Unexpected \" + nextType + \" at \" + index + \", expected \" + type);\n };\n var consumeText = function () {\n var result = \"\";\n var value;\n // tslint:disable-next-line\n while ((value = tryConsume(\"CHAR\") || tryConsume(\"ESCAPED_CHAR\"))) {\n result += value;\n }\n return result;\n };\n while (i < tokens.length) {\n var char = tryConsume(\"CHAR\");\n var name = tryConsume(\"NAME\");\n var pattern = tryConsume(\"PATTERN\");\n if (name || pattern) {\n var prefix = char || \"\";\n if (prefixes.indexOf(prefix) === -1) {\n path += prefix;\n prefix = \"\";\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n result.push({\n name: name || key++,\n prefix: prefix,\n suffix: \"\",\n pattern: pattern || defaultPattern,\n modifier: tryConsume(\"MODIFIER\") || \"\"\n });\n continue;\n }\n var value = char || tryConsume(\"ESCAPED_CHAR\");\n if (value) {\n path += value;\n continue;\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n var open = tryConsume(\"OPEN\");\n if (open) {\n var prefix = consumeText();\n var name_1 = tryConsume(\"NAME\") || \"\";\n var pattern_1 = tryConsume(\"PATTERN\") || \"\";\n var suffix = consumeText();\n mustConsume(\"CLOSE\");\n result.push({\n name: name_1 || (pattern_1 ? key++ : \"\"),\n pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1,\n prefix: prefix,\n suffix: suffix,\n modifier: tryConsume(\"MODIFIER\") || \"\"\n });\n continue;\n }\n mustConsume(\"END\");\n }\n return result;\n}\nexports.parse = parse;\n/**\n * Compile a string to a template function for the path.\n */\nfunction compile(str, options) {\n return tokensToFunction(parse(str, options), options);\n}\nexports.compile = compile;\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction(tokens, options) {\n if (options === void 0) { options = {}; }\n var reFlags = flags(options);\n var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;\n // Compile all the tokens into regexps.\n var matches = tokens.map(function (token) {\n if (typeof token === \"object\") {\n return new RegExp(\"^(?:\" + token.pattern + \")$\", reFlags);\n }\n });\n return function (data) {\n var path = \"\";\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n var value = data ? data[token.name] : undefined;\n var optional = token.modifier === \"?\" || token.modifier === \"*\";\n var repeat = token.modifier === \"*\" || token.modifier === \"+\";\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to not repeat, but got an array\");\n }\n if (value.length === 0) {\n if (optional)\n continue;\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to not be empty\");\n }\n for (var j = 0; j < value.length; j++) {\n var segment = encode(value[j], token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected all \\\"\" + token.name + \"\\\" to match \\\"\" + token.pattern + \"\\\", but got \\\"\" + segment + \"\\\"\");\n }\n path += token.prefix + segment + token.suffix;\n }\n continue;\n }\n if (typeof value === \"string\" || typeof value === \"number\") {\n var segment = encode(String(value), token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to match \\\"\" + token.pattern + \"\\\", but got \\\"\" + segment + \"\\\"\");\n }\n path += token.prefix + segment + token.suffix;\n continue;\n }\n if (optional)\n continue;\n var typeOfMessage = repeat ? \"an array\" : \"a string\";\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to be \" + typeOfMessage);\n }\n return path;\n };\n}\nexports.tokensToFunction = tokensToFunction;\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nfunction match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}\nexports.match = match;\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nfunction regexpToFunction(re, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a;\n return function (pathname) {\n var m = re.exec(pathname);\n if (!m)\n return false;\n var path = m[0], index = m.index;\n var params = Object.create(null);\n var _loop_1 = function (i) {\n // tslint:disable-next-line\n if (m[i] === undefined)\n return \"continue\";\n var key = keys[i - 1];\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) {\n return decode(value, key);\n });\n }\n else {\n params[key.name] = decode(m[i], key);\n }\n };\n for (var i = 1; i < m.length; i++) {\n _loop_1(i);\n }\n return { path: path, index: index, params: params };\n };\n}\nexports.regexpToFunction = regexpToFunction;\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path, keys) {\n if (!keys)\n return path;\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n });\n }\n }\n return path;\n}\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(paths, keys, options) {\n var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; });\n return new RegExp(\"(?:\" + parts.join(\"|\") + \")\", flags(options));\n}\n/**\n * Create a path regexp from string input.\n */\nfunction stringToRegexp(path, keys, options) {\n return tokensToRegexp(parse(path, options), keys, options);\n}\n/**\n * Expose a function for taking tokens and returning a RegExp.\n */\nfunction tokensToRegexp(tokens, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d;\n var endsWith = \"[\" + escapeString(options.endsWith || \"\") + \"]|$\";\n var delimiter = \"[\" + escapeString(options.delimiter || \"/#?\") + \"]\";\n var route = start ? \"^\" : \"\";\n // Iterate over the tokens and create our regexp string.\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n if (typeof token === \"string\") {\n route += escapeString(encode(token));\n }\n else {\n var prefix = escapeString(encode(token.prefix));\n var suffix = escapeString(encode(token.suffix));\n if (token.pattern) {\n if (keys)\n keys.push(token);\n if (prefix || suffix) {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n var mod = token.modifier === \"*\" ? \"?\" : \"\";\n route += \"(?:\" + prefix + \"((?:\" + token.pattern + \")(?:\" + suffix + prefix + \"(?:\" + token.pattern + \"))*)\" + suffix + \")\" + mod;\n }\n else {\n route += \"(?:\" + prefix + \"(\" + token.pattern + \")\" + suffix + \")\" + token.modifier;\n }\n }\n else {\n route += \"(\" + token.pattern + \")\" + token.modifier;\n }\n }\n else {\n route += \"(?:\" + prefix + suffix + \")\" + token.modifier;\n }\n }\n }\n if (end) {\n if (!strict)\n route += delimiter + \"?\";\n route += !options.endsWith ? \"$\" : \"(?=\" + endsWith + \")\";\n }\n else {\n var endToken = tokens[tokens.length - 1];\n var isEndDelimited = typeof endToken === \"string\"\n ? delimiter.indexOf(endToken[endToken.length - 1]) > -1\n : // tslint:disable-next-line\n endToken === undefined;\n if (!strict) {\n route += \"(?:\" + delimiter + \"(?=\" + endsWith + \"))?\";\n }\n if (!isEndDelimited) {\n route += \"(?=\" + delimiter + \"|\" + endsWith + \")\";\n }\n }\n return new RegExp(route, flags(options));\n}\nexports.tokensToRegexp = tokensToRegexp;\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n */\nfunction pathToRegexp(path, keys, options) {\n if (path instanceof RegExp)\n return regexpToRegexp(path, keys);\n if (Array.isArray(path))\n return arrayToRegexp(path, keys, options);\n return stringToRegexp(path, keys, options);\n}\nexports.pathToRegexp = pathToRegexp;\n//# sourceMappingURL=index.js.map","export const NEXT_QUERY_PARAM_PREFIX = \"nxtP\";\nexport const PRERENDER_REVALIDATE_HEADER = \"x-prerender-revalidate\";\nexport const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = \"x-prerender-revalidate-if-generated\";\nexport const RSC_PREFETCH_SUFFIX = \".prefetch.rsc\";\nexport const RSC_SUFFIX = \".rsc\";\nexport const ACTION_SUFFIX = \".action\";\nexport const NEXT_DATA_SUFFIX = \".json\";\nexport const NEXT_META_SUFFIX = \".meta\";\nexport const NEXT_BODY_SUFFIX = \".body\";\nexport const NEXT_CACHE_TAGS_HEADER = \"x-next-cache-tags\";\nexport const NEXT_CACHE_SOFT_TAGS_HEADER = \"x-next-cache-soft-tags\";\nexport const NEXT_CACHE_REVALIDATED_TAGS_HEADER = \"x-next-revalidated-tags\";\nexport const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = \"x-next-revalidate-tag-token\";\n// if these change make sure we update the related\n// documentation as well\nexport const NEXT_CACHE_TAG_MAX_ITEMS = 128;\nexport const NEXT_CACHE_TAG_MAX_LENGTH = 256;\nexport const NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;\nexport const NEXT_CACHE_IMPLICIT_TAG_ID = \"_N_T_\";\n// in seconds\nexport const CACHE_ONE_YEAR = 31536000;\n// Patterns to detect middleware files\nexport const MIDDLEWARE_FILENAME = \"middleware\";\nexport const MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;\n// Pattern to detect instrumentation hooks file\nexport const INSTRUMENTATION_HOOK_FILENAME = \"instrumentation\";\n// Because on Windows absolute paths in the generated code can break because of numbers, eg 1 in the path,\n// we have to use a private alias\nexport const PAGES_DIR_ALIAS = \"private-next-pages\";\nexport const DOT_NEXT_ALIAS = \"private-dot-next\";\nexport const ROOT_DIR_ALIAS = \"private-next-root-dir\";\nexport const APP_DIR_ALIAS = \"private-next-app-dir\";\nexport const RSC_MOD_REF_PROXY_ALIAS = \"private-next-rsc-mod-ref-proxy\";\nexport const RSC_ACTION_VALIDATE_ALIAS = \"private-next-rsc-action-validate\";\nexport const RSC_ACTION_PROXY_ALIAS = \"private-next-rsc-server-reference\";\nexport const RSC_ACTION_ENCRYPTION_ALIAS = \"private-next-rsc-action-encryption\";\nexport const RSC_ACTION_CLIENT_WRAPPER_ALIAS = \"private-next-rsc-action-client-wrapper\";\nexport const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;\nexport const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;\nexport const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;\nexport const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;\nexport const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;\nexport const SERVER_PROPS_EXPORT_ERROR = `pages with \\`getServerSideProps\\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;\nexport const GSP_NO_RETURNED_VALUE = \"Your `getStaticProps` function did not return an object. Did you forget to add a `return`?\";\nexport const GSSP_NO_RETURNED_VALUE = \"Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?\";\nexport const UNSTABLE_REVALIDATE_RENAME_ERROR = \"The `unstable_revalidate` property is available for general use.\\n\" + \"Please use `revalidate` instead.\";\nexport const GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;\nexport const NON_STANDARD_NODE_ENV = `You are using a non-standard \"NODE_ENV\" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;\nexport const SSG_FALLBACK_EXPORT_ERROR = `Pages with \\`fallback\\` enabled in \\`getStaticPaths\\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;\nexport const ESLINT_DEFAULT_DIRS = [\n \"app\",\n \"pages\",\n \"components\",\n \"lib\",\n \"src\"\n];\nexport const SERVER_RUNTIME = {\n edge: \"edge\",\n experimentalEdge: \"experimental-edge\",\n nodejs: \"nodejs\"\n};\n/**\n * The names of the webpack layers. These layers are the primitives for the\n * webpack chunks.\n */ const WEBPACK_LAYERS_NAMES = {\n /**\n * The layer for the shared code between the client and server bundles.\n */ shared: \"shared\",\n /**\n * React Server Components layer (rsc).\n */ reactServerComponents: \"rsc\",\n /**\n * Server Side Rendering layer for app (ssr).\n */ serverSideRendering: \"ssr\",\n /**\n * The browser client bundle layer for actions.\n */ actionBrowser: \"action-browser\",\n /**\n * The layer for the API routes.\n */ api: \"api\",\n /**\n * The layer for the middleware code.\n */ middleware: \"middleware\",\n /**\n * The layer for the instrumentation hooks.\n */ instrument: \"instrument\",\n /**\n * The layer for assets on the edge.\n */ edgeAsset: \"edge-asset\",\n /**\n * The browser client bundle layer for App directory.\n */ appPagesBrowser: \"app-pages-browser\",\n /**\n * The server bundle layer for metadata routes.\n */ appMetadataRoute: \"app-metadata-route\",\n /**\n * The layer for the server bundle for App Route handlers.\n */ appRouteHandler: \"app-route-handler\"\n};\nconst WEBPACK_LAYERS = {\n ...WEBPACK_LAYERS_NAMES,\n GROUP: {\n serverOnly: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.appMetadataRoute,\n WEBPACK_LAYERS_NAMES.appRouteHandler,\n WEBPACK_LAYERS_NAMES.instrument\n ],\n clientOnly: [\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser\n ],\n nonClientServerTarget: [\n // middleware and pages api\n WEBPACK_LAYERS_NAMES.middleware,\n WEBPACK_LAYERS_NAMES.api\n ],\n app: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.appMetadataRoute,\n WEBPACK_LAYERS_NAMES.appRouteHandler,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.shared,\n WEBPACK_LAYERS_NAMES.instrument\n ]\n }\n};\nconst WEBPACK_RESOURCE_QUERIES = {\n edgeSSREntry: \"__next_edge_ssr_entry__\",\n metadata: \"__next_metadata__\",\n metadataRoute: \"__next_metadata_route__\",\n metadataImageMeta: \"__next_metadata_image_meta__\"\n};\nexport { WEBPACK_LAYERS, WEBPACK_RESOURCE_QUERIES };\n\n//# sourceMappingURL=constants.js.map","import { HeadersAdapter } from \"../web/spec-extension/adapters/headers\";\nimport { PRERENDER_REVALIDATE_HEADER, PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER } from \"../../lib/constants\";\nimport { getTracer } from \"../lib/trace/tracer\";\nimport { NodeSpan } from \"../lib/trace/constants\";\nexport function wrapApiHandler(page, handler) {\n return (...args)=>{\n var _getTracer_getRootSpanAttributes;\n (_getTracer_getRootSpanAttributes = getTracer().getRootSpanAttributes()) == null ? void 0 : _getTracer_getRootSpanAttributes.set(\"next.route\", page);\n // Call API route method\n return getTracer().trace(NodeSpan.runHandler, {\n spanName: `executing api route (pages) ${page}`\n }, ()=>handler(...args));\n };\n}\n/**\n *\n * @param res response object\n * @param statusCode `HTTP` status code of response\n */ export function sendStatusCode(res, statusCode) {\n res.statusCode = statusCode;\n return res;\n}\n/**\n *\n * @param res response object\n * @param [statusOrUrl] `HTTP` status code of redirect\n * @param url URL of redirect\n */ export function redirect(res, statusOrUrl, url) {\n if (typeof statusOrUrl === \"string\") {\n url = statusOrUrl;\n statusOrUrl = 307;\n }\n if (typeof statusOrUrl !== \"number\" || typeof url !== \"string\") {\n throw new Error(`Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination').`);\n }\n res.writeHead(statusOrUrl, {\n Location: url\n });\n res.write(url);\n res.end();\n return res;\n}\nexport function checkIsOnDemandRevalidate(req, previewProps) {\n const headers = HeadersAdapter.from(req.headers);\n const previewModeId = headers.get(PRERENDER_REVALIDATE_HEADER);\n const isOnDemandRevalidate = previewModeId === previewProps.previewModeId;\n const revalidateOnlyGenerated = headers.has(PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER);\n return {\n isOnDemandRevalidate,\n revalidateOnlyGenerated\n };\n}\nexport const COOKIE_NAME_PRERENDER_BYPASS = `__prerender_bypass`;\nexport const COOKIE_NAME_PRERENDER_DATA = `__next_preview_data`;\nexport const RESPONSE_LIMIT_DEFAULT = 4 * 1024 * 1024;\nexport const SYMBOL_PREVIEW_DATA = Symbol(COOKIE_NAME_PRERENDER_DATA);\nexport const SYMBOL_CLEARED_COOKIES = Symbol(COOKIE_NAME_PRERENDER_BYPASS);\nexport function clearPreviewData(res, options = {}) {\n if (SYMBOL_CLEARED_COOKIES in res) {\n return res;\n }\n const { serialize } = require(\"next/dist/compiled/cookie\");\n const previous = res.getHeader(\"Set-Cookie\");\n res.setHeader(`Set-Cookie`, [\n ...typeof previous === \"string\" ? [\n previous\n ] : Array.isArray(previous) ? previous : [],\n serialize(COOKIE_NAME_PRERENDER_BYPASS, \"\", {\n // To delete a cookie, set `expires` to a date in the past:\n // https://tools.ietf.org/html/rfc6265#section-4.1.1\n // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.\n expires: new Date(0),\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== \"development\" ? \"none\" : \"lax\",\n secure: process.env.NODE_ENV !== \"development\",\n path: \"/\",\n ...options.path !== undefined ? {\n path: options.path\n } : undefined\n }),\n serialize(COOKIE_NAME_PRERENDER_DATA, \"\", {\n // To delete a cookie, set `expires` to a date in the past:\n // https://tools.ietf.org/html/rfc6265#section-4.1.1\n // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.\n expires: new Date(0),\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== \"development\" ? \"none\" : \"lax\",\n secure: process.env.NODE_ENV !== \"development\",\n path: \"/\",\n ...options.path !== undefined ? {\n path: options.path\n } : undefined\n })\n ]);\n Object.defineProperty(res, SYMBOL_CLEARED_COOKIES, {\n value: true,\n enumerable: false\n });\n return res;\n}\n/**\n * Custom error class\n */ export class ApiError extends Error {\n constructor(statusCode, message){\n super(message);\n this.statusCode = statusCode;\n }\n}\n/**\n * Sends error in `response`\n * @param res response object\n * @param statusCode of response\n * @param message of response\n */ export function sendError(res, statusCode, message) {\n res.statusCode = statusCode;\n res.statusMessage = message;\n res.end(message);\n}\n/**\n * Execute getter function only if its needed\n * @param LazyProps `req` and `params` for lazyProp\n * @param prop name of property\n * @param getter function to get data\n */ export function setLazyProp({ req }, prop, getter) {\n const opts = {\n configurable: true,\n enumerable: true\n };\n const optsReset = {\n ...opts,\n writable: true\n };\n Object.defineProperty(req, prop, {\n ...opts,\n get: ()=>{\n const value = getter();\n // we set the property on the object to avoid recalculating it\n Object.defineProperty(req, prop, {\n ...optsReset,\n value\n });\n return value;\n },\n set: (value)=>{\n Object.defineProperty(req, prop, {\n ...optsReset,\n value\n });\n }\n });\n}\n\n//# sourceMappingURL=index.js.map","import { checkIsOnDemandRevalidate } from \"../.\";\nimport { clearPreviewData, COOKIE_NAME_PRERENDER_BYPASS, COOKIE_NAME_PRERENDER_DATA, SYMBOL_PREVIEW_DATA } from \"../index\";\nimport { RequestCookies } from \"../../web/spec-extension/cookies\";\nimport { HeadersAdapter } from \"../../web/spec-extension/adapters/headers\";\nexport function tryGetPreviewData(req, res, options, multiZoneDraftMode) {\n var _cookies_get, _cookies_get1;\n // if an On-Demand revalidation is being done preview mode\n // is disabled\n if (options && checkIsOnDemandRevalidate(req, options).isOnDemandRevalidate) {\n return false;\n }\n // Read cached preview data if present\n // TODO: use request metadata instead of a symbol\n if (SYMBOL_PREVIEW_DATA in req) {\n return req[SYMBOL_PREVIEW_DATA];\n }\n const headers = HeadersAdapter.from(req.headers);\n const cookies = new RequestCookies(headers);\n const previewModeId = (_cookies_get = cookies.get(COOKIE_NAME_PRERENDER_BYPASS)) == null ? void 0 : _cookies_get.value;\n const tokenPreviewData = (_cookies_get1 = cookies.get(COOKIE_NAME_PRERENDER_DATA)) == null ? void 0 : _cookies_get1.value;\n // Case: preview mode cookie set but data cookie is not set\n if (previewModeId && !tokenPreviewData && previewModeId === options.previewModeId) {\n // This is \"Draft Mode\" which doesn't use\n // previewData, so we return an empty object\n // for backwards compat with \"Preview Mode\".\n const data = {};\n Object.defineProperty(req, SYMBOL_PREVIEW_DATA, {\n value: data,\n enumerable: false\n });\n return data;\n }\n // Case: neither cookie is set.\n if (!previewModeId && !tokenPreviewData) {\n return false;\n }\n // Case: one cookie is set, but not the other.\n if (!previewModeId || !tokenPreviewData) {\n if (!multiZoneDraftMode) {\n clearPreviewData(res);\n }\n return false;\n }\n // Case: preview session is for an old build.\n if (previewModeId !== options.previewModeId) {\n if (!multiZoneDraftMode) {\n clearPreviewData(res);\n }\n return false;\n }\n let encryptedPreviewData;\n try {\n const jsonwebtoken = require(\"next/dist/compiled/jsonwebtoken\");\n encryptedPreviewData = jsonwebtoken.verify(tokenPreviewData, options.previewModeSigningKey);\n } catch {\n // TODO: warn\n clearPreviewData(res);\n return false;\n }\n const { decryptWithSecret } = require(\"../../crypto-utils\");\n const decryptedPreviewData = decryptWithSecret(Buffer.from(options.previewModeEncryptionKey), encryptedPreviewData.data);\n try {\n // TODO: strict runtime type checking\n const data = JSON.parse(decryptedPreviewData);\n // Cache lookup\n Object.defineProperty(req, SYMBOL_PREVIEW_DATA, {\n value: data,\n enumerable: false\n });\n return data;\n } catch {\n return false;\n }\n}\n\n//# sourceMappingURL=try-get-preview-data.js.map","import crypto from \"crypto\";\n// Background:\n// https://security.stackexchange.com/questions/184305/why-would-i-ever-use-aes-256-cbc-if-aes-256-gcm-is-more-secure\nconst CIPHER_ALGORITHM = `aes-256-gcm`, CIPHER_KEY_LENGTH = 32, CIPHER_IV_LENGTH = 16, CIPHER_TAG_LENGTH = 16, CIPHER_SALT_LENGTH = 64;\nconst PBKDF2_ITERATIONS = 100000 // https://support.1password.com/pbkdf2/\n;\nexport function encryptWithSecret(secret, data) {\n const iv = crypto.randomBytes(CIPHER_IV_LENGTH);\n const salt = crypto.randomBytes(CIPHER_SALT_LENGTH);\n // https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest\n const key = crypto.pbkdf2Sync(secret, salt, PBKDF2_ITERATIONS, CIPHER_KEY_LENGTH, `sha512`);\n const cipher = crypto.createCipheriv(CIPHER_ALGORITHM, key, iv);\n const encrypted = Buffer.concat([\n cipher.update(data, `utf8`),\n cipher.final()\n ]);\n // https://nodejs.org/api/crypto.html#crypto_cipher_getauthtag\n const tag = cipher.getAuthTag();\n return Buffer.concat([\n // Data as required by:\n // Salt for Key: https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest\n // IV: https://nodejs.org/api/crypto.html#crypto_class_decipher\n // Tag: https://nodejs.org/api/crypto.html#crypto_decipher_setauthtag_buffer\n salt,\n iv,\n tag,\n encrypted\n ]).toString(`hex`);\n}\nexport function decryptWithSecret(secret, encryptedData) {\n const buffer = Buffer.from(encryptedData, `hex`);\n const salt = buffer.slice(0, CIPHER_SALT_LENGTH);\n const iv = buffer.slice(CIPHER_SALT_LENGTH, CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH);\n const tag = buffer.slice(CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH, CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH + CIPHER_TAG_LENGTH);\n const encrypted = buffer.slice(CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH + CIPHER_TAG_LENGTH);\n // https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest\n const key = crypto.pbkdf2Sync(secret, salt, PBKDF2_ITERATIONS, CIPHER_KEY_LENGTH, `sha512`);\n const decipher = crypto.createDecipheriv(CIPHER_ALGORITHM, key, iv);\n decipher.setAuthTag(tag);\n return decipher.update(encrypted) + decipher.final(`utf8`);\n}\n\n//# sourceMappingURL=crypto-utils.js.map","const symbolError = Symbol.for(\"NextjsError\");\nexport function getErrorSource(error) {\n return error[symbolError] || null;\n}\nexport function decorateServerError(error, type) {\n Object.defineProperty(error, symbolError, {\n writable: false,\n enumerable: false,\n configurable: false,\n value: type\n });\n}\n\n//# sourceMappingURL=error-source.js.map","export const ipcForbiddenHeaders = [\n \"accept-encoding\",\n \"keepalive\",\n \"keep-alive\",\n \"content-encoding\",\n \"transfer-encoding\",\n // https://github.com/nodejs/undici/issues/1470\n \"connection\",\n // marked as unsupported by undici: https://github.com/nodejs/undici/blob/c83b084879fa0bb8e0469d31ec61428ac68160d5/lib/core/request.js#L354\n \"expect\"\n];\nexport const actionsForbiddenHeaders = [\n ...ipcForbiddenHeaders,\n \"content-length\",\n \"set-cookie\"\n];\nexport const filterReqHeaders = (headers, forbiddenHeaders)=>{\n // Some browsers are not matching spec and sending Content-Length: 0. This causes issues in undici\n // https://github.com/nodejs/undici/issues/2046\n if (headers[\"content-length\"] && headers[\"content-length\"] === \"0\") {\n delete headers[\"content-length\"];\n }\n for (const [key, value] of Object.entries(headers)){\n if (forbiddenHeaders.includes(key) || !(Array.isArray(value) || typeof value === \"string\")) {\n delete headers[key];\n }\n }\n return headers;\n};\n\n//# sourceMappingURL=utils.js.map","import { filterReqHeaders, ipcForbiddenHeaders } from \"./utils\";\nexport const invokeRequest = async (targetUrl, requestInit, readableBody)=>{\n const invokeHeaders = filterReqHeaders({\n \"cache-control\": \"\",\n ...requestInit.headers\n }, ipcForbiddenHeaders);\n return await fetch(targetUrl, {\n headers: invokeHeaders,\n method: requestInit.method,\n redirect: \"manual\",\n signal: requestInit.signal,\n ...requestInit.method !== \"GET\" && requestInit.method !== \"HEAD\" && readableBody ? {\n body: readableBody,\n duplex: \"half\"\n } : {},\n next: {\n // @ts-ignore\n internal: true\n }\n });\n};\n\n//# sourceMappingURL=invoke-request.js.map","import { decorateServerError } from \"../../../shared/lib/error-source\";\nimport { PageNotFoundError } from \"../../../shared/lib/utils\";\nimport { invokeRequest } from \"./invoke-request\";\nexport const deserializeErr = (serializedErr)=>{\n if (!serializedErr || typeof serializedErr !== \"object\" || !serializedErr.stack) {\n return serializedErr;\n }\n let ErrorType = Error;\n if (serializedErr.name === \"PageNotFoundError\") {\n ErrorType = PageNotFoundError;\n }\n const err = new ErrorType(serializedErr.message);\n err.stack = serializedErr.stack;\n err.name = serializedErr.name;\n err.digest = serializedErr.digest;\n if (process.env.NODE_ENV === \"development\" && process.env.NEXT_RUNTIME !== \"edge\") {\n decorateServerError(err, serializedErr.source || \"server\");\n }\n return err;\n};\nexport async function invokeIpcMethod({ fetchHostname = \"localhost\", method, args, ipcPort, ipcKey }) {\n if (ipcPort) {\n const res = await invokeRequest(`http://${fetchHostname}:${ipcPort}?key=${ipcKey}&method=${method}&args=${encodeURIComponent(JSON.stringify(args))}`, {\n method: \"GET\",\n headers: {}\n });\n const body = await res.text();\n if (body.startsWith(\"{\") && body.endsWith(\"}\")) {\n const parsedBody = JSON.parse(body);\n if (parsedBody && typeof parsedBody === \"object\" && \"err\" in parsedBody && \"stack\" in parsedBody.err) {\n throw deserializeErr(parsedBody.err);\n }\n return parsedBody;\n }\n }\n}\n\n//# sourceMappingURL=request-utils.js.map","/**\n * Contains predefined constants for the trace span name in next/server.\n *\n * Currently, next/server/tracer is internal implementation only for tracking\n * next.js's implementation only with known span names defined here.\n **/ // eslint typescript has a bug with TS enums\n/* eslint-disable no-shadow */ var BaseServerSpan;\n(function(BaseServerSpan) {\n BaseServerSpan[\"handleRequest\"] = \"BaseServer.handleRequest\";\n BaseServerSpan[\"run\"] = \"BaseServer.run\";\n BaseServerSpan[\"pipe\"] = \"BaseServer.pipe\";\n BaseServerSpan[\"getStaticHTML\"] = \"BaseServer.getStaticHTML\";\n BaseServerSpan[\"render\"] = \"BaseServer.render\";\n BaseServerSpan[\"renderToResponseWithComponents\"] = \"BaseServer.renderToResponseWithComponents\";\n BaseServerSpan[\"renderToResponse\"] = \"BaseServer.renderToResponse\";\n BaseServerSpan[\"renderToHTML\"] = \"BaseServer.renderToHTML\";\n BaseServerSpan[\"renderError\"] = \"BaseServer.renderError\";\n BaseServerSpan[\"renderErrorToResponse\"] = \"BaseServer.renderErrorToResponse\";\n BaseServerSpan[\"renderErrorToHTML\"] = \"BaseServer.renderErrorToHTML\";\n BaseServerSpan[\"render404\"] = \"BaseServer.render404\";\n})(BaseServerSpan || (BaseServerSpan = {}));\nvar LoadComponentsSpan;\n(function(LoadComponentsSpan) {\n LoadComponentsSpan[\"loadDefaultErrorComponents\"] = \"LoadComponents.loadDefaultErrorComponents\";\n LoadComponentsSpan[\"loadComponents\"] = \"LoadComponents.loadComponents\";\n})(LoadComponentsSpan || (LoadComponentsSpan = {}));\nvar NextServerSpan;\n(function(NextServerSpan) {\n NextServerSpan[\"getRequestHandler\"] = \"NextServer.getRequestHandler\";\n NextServerSpan[\"getServer\"] = \"NextServer.getServer\";\n NextServerSpan[\"getServerRequestHandler\"] = \"NextServer.getServerRequestHandler\";\n NextServerSpan[\"createServer\"] = \"createServer.createServer\";\n})(NextServerSpan || (NextServerSpan = {}));\nvar NextNodeServerSpan;\n(function(NextNodeServerSpan) {\n NextNodeServerSpan[\"compression\"] = \"NextNodeServer.compression\";\n NextNodeServerSpan[\"getBuildId\"] = \"NextNodeServer.getBuildId\";\n NextNodeServerSpan[\"createComponentTree\"] = \"NextNodeServer.createComponentTree\";\n NextNodeServerSpan[\"clientComponentLoading\"] = \"NextNodeServer.clientComponentLoading\";\n NextNodeServerSpan[\"getLayoutOrPageModule\"] = \"NextNodeServer.getLayoutOrPageModule\";\n NextNodeServerSpan[\"generateStaticRoutes\"] = \"NextNodeServer.generateStaticRoutes\";\n NextNodeServerSpan[\"generateFsStaticRoutes\"] = \"NextNodeServer.generateFsStaticRoutes\";\n NextNodeServerSpan[\"generatePublicRoutes\"] = \"NextNodeServer.generatePublicRoutes\";\n NextNodeServerSpan[\"generateImageRoutes\"] = \"NextNodeServer.generateImageRoutes.route\";\n NextNodeServerSpan[\"sendRenderResult\"] = \"NextNodeServer.sendRenderResult\";\n NextNodeServerSpan[\"proxyRequest\"] = \"NextNodeServer.proxyRequest\";\n NextNodeServerSpan[\"runApi\"] = \"NextNodeServer.runApi\";\n NextNodeServerSpan[\"render\"] = \"NextNodeServer.render\";\n NextNodeServerSpan[\"renderHTML\"] = \"NextNodeServer.renderHTML\";\n NextNodeServerSpan[\"imageOptimizer\"] = \"NextNodeServer.imageOptimizer\";\n NextNodeServerSpan[\"getPagePath\"] = \"NextNodeServer.getPagePath\";\n NextNodeServerSpan[\"getRoutesManifest\"] = \"NextNodeServer.getRoutesManifest\";\n NextNodeServerSpan[\"findPageComponents\"] = \"NextNodeServer.findPageComponents\";\n NextNodeServerSpan[\"getFontManifest\"] = \"NextNodeServer.getFontManifest\";\n NextNodeServerSpan[\"getServerComponentManifest\"] = \"NextNodeServer.getServerComponentManifest\";\n NextNodeServerSpan[\"getRequestHandler\"] = \"NextNodeServer.getRequestHandler\";\n NextNodeServerSpan[\"renderToHTML\"] = \"NextNodeServer.renderToHTML\";\n NextNodeServerSpan[\"renderError\"] = \"NextNodeServer.renderError\";\n NextNodeServerSpan[\"renderErrorToHTML\"] = \"NextNodeServer.renderErrorToHTML\";\n NextNodeServerSpan[\"render404\"] = \"NextNodeServer.render404\";\n NextNodeServerSpan[\"startResponse\"] = \"NextNodeServer.startResponse\";\n // nested inner span, does not require parent scope name\n NextNodeServerSpan[\"route\"] = \"route\";\n NextNodeServerSpan[\"onProxyReq\"] = \"onProxyReq\";\n NextNodeServerSpan[\"apiResolver\"] = \"apiResolver\";\n NextNodeServerSpan[\"internalFetch\"] = \"internalFetch\";\n})(NextNodeServerSpan || (NextNodeServerSpan = {}));\nvar StartServerSpan;\n(function(StartServerSpan) {\n StartServerSpan[\"startServer\"] = \"startServer.startServer\";\n})(StartServerSpan || (StartServerSpan = {}));\nvar RenderSpan;\n(function(RenderSpan) {\n RenderSpan[\"getServerSideProps\"] = \"Render.getServerSideProps\";\n RenderSpan[\"getStaticProps\"] = \"Render.getStaticProps\";\n RenderSpan[\"renderToString\"] = \"Render.renderToString\";\n RenderSpan[\"renderDocument\"] = \"Render.renderDocument\";\n RenderSpan[\"createBodyResult\"] = \"Render.createBodyResult\";\n})(RenderSpan || (RenderSpan = {}));\nvar AppRenderSpan;\n(function(AppRenderSpan) {\n AppRenderSpan[\"renderToString\"] = \"AppRender.renderToString\";\n AppRenderSpan[\"renderToReadableStream\"] = \"AppRender.renderToReadableStream\";\n AppRenderSpan[\"getBodyResult\"] = \"AppRender.getBodyResult\";\n AppRenderSpan[\"fetch\"] = \"AppRender.fetch\";\n})(AppRenderSpan || (AppRenderSpan = {}));\nvar RouterSpan;\n(function(RouterSpan) {\n RouterSpan[\"executeRoute\"] = \"Router.executeRoute\";\n})(RouterSpan || (RouterSpan = {}));\nvar NodeSpan;\n(function(NodeSpan) {\n NodeSpan[\"runHandler\"] = \"Node.runHandler\";\n})(NodeSpan || (NodeSpan = {}));\nvar AppRouteRouteHandlersSpan;\n(function(AppRouteRouteHandlersSpan) {\n AppRouteRouteHandlersSpan[\"runHandler\"] = \"AppRouteRouteHandlers.runHandler\";\n})(AppRouteRouteHandlersSpan || (AppRouteRouteHandlersSpan = {}));\nvar ResolveMetadataSpan;\n(function(ResolveMetadataSpan) {\n ResolveMetadataSpan[\"generateMetadata\"] = \"ResolveMetadata.generateMetadata\";\n ResolveMetadataSpan[\"generateViewport\"] = \"ResolveMetadata.generateViewport\";\n})(ResolveMetadataSpan || (ResolveMetadataSpan = {}));\nvar MiddlewareSpan;\n(function(MiddlewareSpan) {\n MiddlewareSpan[\"execute\"] = \"Middleware.execute\";\n})(MiddlewareSpan || (MiddlewareSpan = {}));\n// This list is used to filter out spans that are not relevant to the user\nexport const NextVanillaSpanAllowlist = [\n \"Middleware.execute\",\n \"BaseServer.handleRequest\",\n \"Render.getServerSideProps\",\n \"Render.getStaticProps\",\n \"AppRender.fetch\",\n \"AppRender.getBodyResult\",\n \"Render.renderDocument\",\n \"Node.runHandler\",\n \"AppRouteRouteHandlers.runHandler\",\n \"ResolveMetadata.generateMetadata\",\n \"ResolveMetadata.generateViewport\",\n \"NextNodeServer.createComponentTree\",\n \"NextNodeServer.findPageComponents\",\n \"NextNodeServer.getLayoutOrPageModule\",\n \"NextNodeServer.startResponse\",\n \"NextNodeServer.clientComponentLoading\"\n];\n// These Spans are allowed to be always logged\n// when the otel log prefix env is set\nexport const LogSpanAllowList = [\n \"NextNodeServer.findPageComponents\",\n \"NextNodeServer.createComponentTree\",\n \"NextNodeServer.clientComponentLoading\"\n];\nexport { BaseServerSpan, LoadComponentsSpan, NextServerSpan, NextNodeServerSpan, StartServerSpan, RenderSpan, RouterSpan, AppRenderSpan, NodeSpan, AppRouteRouteHandlersSpan, ResolveMetadataSpan, MiddlewareSpan, };\n\n//# sourceMappingURL=constants.js.map","// This file should be imported before any others. It sets up the environment\n// for later imports to work properly.\n// expose AsyncLocalStorage on global for react usage if it isn't already provided by the environment\nif (typeof globalThis.AsyncLocalStorage !== \"function\") {\n const { AsyncLocalStorage } = require(\"async_hooks\");\n globalThis.AsyncLocalStorage = AsyncLocalStorage;\n}\nif (typeof globalThis.WebSocket !== \"function\") {\n Object.defineProperty(globalThis, \"WebSocket\", {\n get () {\n return require(\"next/dist/compiled/ws\").WebSocket;\n }\n });\n}\n\n//# sourceMappingURL=node-environment.js.map","// Polyfill crypto() in the Node.js environment\nif (!global.crypto) {\n let webcrypto;\n Object.defineProperty(global, \"crypto\", {\n enumerable: false,\n configurable: true,\n get () {\n if (!webcrypto) {\n webcrypto = require(\"node:crypto\").webcrypto;\n }\n return webcrypto;\n },\n set (value) {\n webcrypto = value;\n }\n });\n}\n\n//# sourceMappingURL=node-polyfill-crypto.js.map","export class ReflectAdapter {\n static get(target, prop, receiver) {\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === \"function\") {\n return value.bind(target);\n }\n return value;\n }\n static set(target, prop, value, receiver) {\n return Reflect.set(target, prop, value, receiver);\n }\n static has(target, prop) {\n return Reflect.has(target, prop);\n }\n static deleteProperty(target, prop) {\n return Reflect.deleteProperty(target, prop);\n }\n}\n\n//# sourceMappingURL=reflect.js.map","import { ReflectAdapter } from \"./reflect\";\n/**\n * @internal\n */ export class ReadonlyHeadersError extends Error {\n constructor(){\n super(\"Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers\");\n }\n static callable() {\n throw new ReadonlyHeadersError();\n }\n}\nexport class HeadersAdapter extends Headers {\n constructor(headers){\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super();\n this.headers = new Proxy(headers, {\n get (target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === \"symbol\") {\n return ReflectAdapter.get(target, prop, receiver);\n }\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, return undefined.\n if (typeof original === \"undefined\") return;\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === \"symbol\") {\n return ReflectAdapter.set(target, prop, value, receiver);\n }\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver);\n },\n has (target, prop) {\n if (typeof prop === \"symbol\") return ReflectAdapter.has(target, prop);\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, return false.\n if (typeof original === \"undefined\") return false;\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original);\n },\n deleteProperty (target, prop) {\n if (typeof prop === \"symbol\") return ReflectAdapter.deleteProperty(target, prop);\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, return true.\n if (typeof original === \"undefined\") return true;\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original);\n }\n });\n }\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n */ static seal(headers) {\n return new Proxy(headers, {\n get (target, prop, receiver) {\n switch(prop){\n case \"append\":\n case \"delete\":\n case \"set\":\n return ReadonlyHeadersError.callable;\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n }\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */ merge(value) {\n if (Array.isArray(value)) return value.join(\", \");\n return value;\n }\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */ static from(headers) {\n if (headers instanceof Headers) return headers;\n return new HeadersAdapter(headers);\n }\n append(name, value) {\n const existing = this.headers[name];\n if (typeof existing === \"string\") {\n this.headers[name] = [\n existing,\n value\n ];\n } else if (Array.isArray(existing)) {\n existing.push(value);\n } else {\n this.headers[name] = value;\n }\n }\n delete(name) {\n delete this.headers[name];\n }\n get(name) {\n const value = this.headers[name];\n if (typeof value !== \"undefined\") return this.merge(value);\n return null;\n }\n has(name) {\n return typeof this.headers[name] !== \"undefined\";\n }\n set(name, value) {\n this.headers[name] = value;\n }\n forEach(callbackfn, thisArg) {\n for (const [name, value] of this.entries()){\n callbackfn.call(thisArg, value, name, this);\n }\n }\n *entries() {\n for (const key of Object.keys(this.headers)){\n const name = key.toLowerCase();\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name);\n yield [\n name,\n value\n ];\n }\n }\n *keys() {\n for (const key of Object.keys(this.headers)){\n const name = key.toLowerCase();\n yield name;\n }\n }\n *values() {\n for (const key of Object.keys(this.headers)){\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key);\n yield value;\n }\n }\n [Symbol.iterator]() {\n return this.entries();\n }\n}\n\n//# sourceMappingURL=headers.js.map","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = () => ([]);\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = \"./dist/esm/server sync recursive\";\nmodule.exports = webpackEmptyContext;","/**\n * This module is for next.js server internal usage of path module.\n * It will use native path module for nodejs runtime.\n * It will use path-browserify polyfill for edge runtime.\n */ let path;\nif (process.env.NEXT_RUNTIME === \"edge\") {\n path = require(\"next/dist/compiled/path-browserify\");\n} else {\n path = require(\"path\");\n}\nmodule.exports = path;\n\n//# sourceMappingURL=path.js.map","// Note: This file is JS because it's used by the taskfile-swc.js file, which is JS.\n// Keep file changes in sync with the corresponding `.d.ts` files.\n/**\n * These are the browser versions that support all of the following:\n * static import: https://caniuse.com/es6-module\n * dynamic import: https://caniuse.com/es6-module-dynamic-import\n * import.meta: https://caniuse.com/mdn-javascript_operators_import_meta\n */ const MODERN_BROWSERSLIST_TARGET = [\n \"chrome 64\",\n \"edge 79\",\n \"firefox 67\",\n \"opera 51\",\n \"safari 12\"\n];\nmodule.exports = MODERN_BROWSERSLIST_TARGET;\n\n//# sourceMappingURL=modern-browserslist-target.js.map","/**\n * Web vitals provided to _app.reportWebVitals by Core Web Vitals plugin developed by Google Chrome team.\n * https://nextjs.org/blog/next-9-4#integrated-web-vitals-reporting\n */ export const WEB_VITALS = [\n \"CLS\",\n \"FCP\",\n \"FID\",\n \"INP\",\n \"LCP\",\n \"TTFB\"\n];\n/**\n * Utils\n */ export function execOnce(fn) {\n let used = false;\n let result;\n return function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n if (!used) {\n used = true;\n result = fn(...args);\n }\n return result;\n };\n}\n// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1\n// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\nconst ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\\d+\\-.]*?:/;\nexport const isAbsoluteUrl = (url)=>ABSOLUTE_URL_REGEX.test(url);\nexport function getLocationOrigin() {\n const { protocol, hostname, port } = window.location;\n return protocol + \"//\" + hostname + (port ? \":\" + port : \"\");\n}\nexport function getURL() {\n const { href } = window.location;\n const origin = getLocationOrigin();\n return href.substring(origin.length);\n}\nexport function getDisplayName(Component) {\n return typeof Component === \"string\" ? Component : Component.displayName || Component.name || \"Unknown\";\n}\nexport function isResSent(res) {\n return res.finished || res.headersSent;\n}\nexport function normalizeRepeatedSlashes(url) {\n const urlParts = url.split(\"?\");\n const urlNoQuery = urlParts[0];\n return urlNoQuery// first we replace any non-encoded backslashes with forward\n // then normalize repeated forward slashes\n .replace(/\\\\/g, \"/\").replace(/\\/\\/+/g, \"/\") + (urlParts[1] ? \"?\" + urlParts.slice(1).join(\"?\") : \"\");\n}\nexport async function loadGetInitialProps(App, ctx) {\n if (process.env.NODE_ENV !== \"production\") {\n var _App_prototype;\n if ((_App_prototype = App.prototype) == null ? void 0 : _App_prototype.getInitialProps) {\n const message = '\"' + getDisplayName(App) + '.getInitialProps()\" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';\n throw new Error(message);\n }\n }\n // when called from _app `ctx` is nested in `ctx`\n const res = ctx.res || ctx.ctx && ctx.ctx.res;\n if (!App.getInitialProps) {\n if (ctx.ctx && ctx.Component) {\n // @ts-ignore pageProps default\n return {\n pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx)\n };\n }\n return {};\n }\n const props = await App.getInitialProps(ctx);\n if (res && isResSent(res)) {\n return props;\n }\n if (!props) {\n const message = '\"' + getDisplayName(App) + '.getInitialProps()\" should resolve to an object. But found \"' + props + '\" instead.';\n throw new Error(message);\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (Object.keys(props).length === 0 && !ctx.ctx) {\n console.warn(\"\" + getDisplayName(App) + \" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps\");\n }\n }\n return props;\n}\nexport const SP = typeof performance !== \"undefined\";\nexport const ST = SP && [\n \"mark\",\n \"measure\",\n \"getEntriesByName\"\n].every((method)=>typeof performance[method] === \"function\");\nexport class DecodeError extends Error {\n}\nexport class NormalizeError extends Error {\n}\nexport class PageNotFoundError extends Error {\n constructor(page){\n super();\n this.code = \"ENOENT\";\n this.name = \"PageNotFoundError\";\n this.message = \"Cannot find module for page: \" + page;\n }\n}\nexport class MissingStaticPage extends Error {\n constructor(page, message){\n super();\n this.message = \"Failed to load static file for page: \" + page + \" \" + message;\n }\n}\nexport class MiddlewareNotFoundError extends Error {\n constructor(){\n super();\n this.code = \"ENOENT\";\n this.message = \"Cannot find the middleware module\";\n }\n}\nexport function stringifyError(error) {\n return JSON.stringify({\n message: error.message,\n stack: error.stack\n });\n}\n\n//# sourceMappingURL=utils.js.map","module.exports = require(\"next/dist/server/lib/trace/tracer\");","module.exports = require(\"next/dist/compiled/jsonwebtoken\");","module.exports = require(\"next/dist/compiled/node-html-parser\");","module.exports = require(\"next/dist/compiled/ws\");","module.exports = require(\"next/dist/server/web/sandbox\");","module.exports = require(\"async_hooks\");","module.exports = require(\"crypto\");","module.exports = require(\"fs\");","module.exports = require(\"module\");","module.exports = require(\"node:crypto\");","module.exports = require(\"os\");","module.exports = require(\"path\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import LRUCache from \"next/dist/compiled/lru-cache\";\nimport { CACHE_ONE_YEAR, NEXT_CACHE_SOFT_TAGS_HEADER } from \"../../../lib/constants\";\nlet rateLimitedUntil = 0;\nlet memoryCache;\nconst CACHE_TAGS_HEADER = \"x-vercel-cache-tags\";\nconst CACHE_HEADERS_HEADER = \"x-vercel-sc-headers\";\nconst CACHE_STATE_HEADER = \"x-vercel-cache-state\";\nconst CACHE_REVALIDATE_HEADER = \"x-vercel-revalidate\";\nconst CACHE_FETCH_URL_HEADER = \"x-vercel-cache-item-name\";\nconst CACHE_CONTROL_VALUE_HEADER = \"x-vercel-cache-control\";\nconst DEBUG = Boolean(process.env.NEXT_PRIVATE_DEBUG_CACHE);\nasync function fetchRetryWithTimeout(url, init, retryIndex = 0) {\n const controller = new AbortController();\n const timeout = setTimeout(()=>{\n controller.abort();\n }, 500);\n return fetch(url, {\n ...init || {},\n signal: controller.signal\n }).catch((err)=>{\n if (retryIndex === 3) {\n throw err;\n } else {\n if (DEBUG) {\n console.log(`Fetch failed for ${url} retry ${retryIndex}`);\n }\n return fetchRetryWithTimeout(url, init, retryIndex + 1);\n }\n }).finally(()=>{\n clearTimeout(timeout);\n });\n}\nexport default class FetchCache {\n hasMatchingTags(arr1, arr2) {\n if (arr1.length !== arr2.length) return false;\n const set1 = new Set(arr1);\n const set2 = new Set(arr2);\n if (set1.size !== set2.size) return false;\n for (let tag of set1){\n if (!set2.has(tag)) return false;\n }\n return true;\n }\n static isAvailable(ctx) {\n return !!(ctx._requestHeaders[\"x-vercel-sc-host\"] || process.env.SUSPENSE_CACHE_URL);\n }\n constructor(ctx){\n this.headers = {};\n this.headers[\"Content-Type\"] = \"application/json\";\n if (CACHE_HEADERS_HEADER in ctx._requestHeaders) {\n const newHeaders = JSON.parse(ctx._requestHeaders[CACHE_HEADERS_HEADER]);\n for(const k in newHeaders){\n this.headers[k] = newHeaders[k];\n }\n delete ctx._requestHeaders[CACHE_HEADERS_HEADER];\n }\n const scHost = ctx._requestHeaders[\"x-vercel-sc-host\"] || process.env.SUSPENSE_CACHE_URL;\n const scBasePath = ctx._requestHeaders[\"x-vercel-sc-basepath\"] || process.env.SUSPENSE_CACHE_BASEPATH;\n if (process.env.SUSPENSE_CACHE_AUTH_TOKEN) {\n this.headers[\"Authorization\"] = `Bearer ${process.env.SUSPENSE_CACHE_AUTH_TOKEN}`;\n }\n if (scHost) {\n const scProto = process.env.SUSPENSE_CACHE_PROTO || \"https\";\n this.cacheEndpoint = `${scProto}://${scHost}${scBasePath || \"\"}`;\n if (DEBUG) {\n console.log(\"using cache endpoint\", this.cacheEndpoint);\n }\n } else if (DEBUG) {\n console.log(\"no cache endpoint available\");\n }\n if (ctx.maxMemoryCacheSize) {\n if (!memoryCache) {\n if (DEBUG) {\n console.log(\"using memory store for fetch cache\");\n }\n memoryCache = new LRUCache({\n max: ctx.maxMemoryCacheSize,\n length ({ value }) {\n var _JSON_stringify;\n if (!value) {\n return 25;\n } else if (value.kind === \"REDIRECT\") {\n return JSON.stringify(value.props).length;\n } else if (value.kind === \"IMAGE\") {\n throw new Error(\"invariant image should not be incremental-cache\");\n } else if (value.kind === \"FETCH\") {\n return JSON.stringify(value.data || \"\").length;\n } else if (value.kind === \"ROUTE\") {\n return value.body.length;\n }\n // rough estimate of size of cache value\n return value.html.length + (((_JSON_stringify = JSON.stringify(value.kind === \"PAGE\" && value.pageData)) == null ? void 0 : _JSON_stringify.length) || 0);\n }\n });\n }\n } else {\n if (DEBUG) {\n console.log(\"not using memory store for fetch cache\");\n }\n }\n }\n resetRequestCache() {\n memoryCache == null ? void 0 : memoryCache.reset();\n }\n async revalidateTag(...args) {\n let [tags] = args;\n tags = typeof tags === \"string\" ? [\n tags\n ] : tags;\n if (DEBUG) {\n console.log(\"revalidateTag\", tags);\n }\n if (!tags.length) return;\n if (Date.now() < rateLimitedUntil) {\n if (DEBUG) {\n console.log(\"rate limited \", rateLimitedUntil);\n }\n return;\n }\n for(let i = 0; i < Math.ceil(tags.length / 64); i++){\n const currentTags = tags.slice(i * 64, i * 64 + 64);\n try {\n const res = await fetchRetryWithTimeout(`${this.cacheEndpoint}/v1/suspense-cache/revalidate?tags=${currentTags.map((tag)=>encodeURIComponent(tag)).join(\",\")}`, {\n method: \"POST\",\n headers: this.headers,\n // @ts-expect-error not on public type\n next: {\n internal: true\n }\n });\n if (res.status === 429) {\n const retryAfter = res.headers.get(\"retry-after\") || \"60000\";\n rateLimitedUntil = Date.now() + parseInt(retryAfter);\n }\n if (!res.ok) {\n throw new Error(`Request failed with status ${res.status}.`);\n }\n } catch (err) {\n console.warn(`Failed to revalidate tag`, currentTags, err);\n }\n }\n }\n async get(...args) {\n var _data_value;\n const [key, ctx = {}] = args;\n const { tags, softTags, kindHint, fetchIdx, fetchUrl } = ctx;\n if (kindHint !== \"fetch\") {\n return null;\n }\n if (Date.now() < rateLimitedUntil) {\n if (DEBUG) {\n console.log(\"rate limited\");\n }\n return null;\n }\n // memory cache is cleared at the end of each request\n // so that revalidate events are pulled from upstream\n // on successive requests\n let data = memoryCache == null ? void 0 : memoryCache.get(key);\n const hasFetchKindAndMatchingTags = (data == null ? void 0 : (_data_value = data.value) == null ? void 0 : _data_value.kind) === \"FETCH\" && this.hasMatchingTags(tags ?? [], data.value.tags ?? []);\n // Get data from fetch cache. Also check if new tags have been\n // specified with the same cache key (fetch URL)\n if (this.cacheEndpoint && (!data || !hasFetchKindAndMatchingTags)) {\n try {\n const start = Date.now();\n const fetchParams = {\n internal: true,\n fetchType: \"cache-get\",\n fetchUrl: fetchUrl,\n fetchIdx\n };\n const res = await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${key}`, {\n method: \"GET\",\n headers: {\n ...this.headers,\n [CACHE_FETCH_URL_HEADER]: fetchUrl,\n [CACHE_TAGS_HEADER]: (tags == null ? void 0 : tags.join(\",\")) || \"\",\n [NEXT_CACHE_SOFT_TAGS_HEADER]: (softTags == null ? void 0 : softTags.join(\",\")) || \"\"\n },\n next: fetchParams\n });\n if (res.status === 429) {\n const retryAfter = res.headers.get(\"retry-after\") || \"60000\";\n rateLimitedUntil = Date.now() + parseInt(retryAfter);\n }\n if (res.status === 404) {\n if (DEBUG) {\n console.log(`no fetch cache entry for ${key}, duration: ${Date.now() - start}ms`);\n }\n return null;\n }\n if (!res.ok) {\n console.error(await res.text());\n throw new Error(`invalid response from cache ${res.status}`);\n }\n const cached = await res.json();\n if (!cached || cached.kind !== \"FETCH\") {\n DEBUG && console.log({\n cached\n });\n throw new Error(\"invalid cache value\");\n }\n // if new tags were specified, merge those tags to the existing tags\n if (cached.kind === \"FETCH\") {\n cached.tags ??= [];\n for (const tag of tags ?? []){\n if (!cached.tags.includes(tag)) {\n cached.tags.push(tag);\n }\n }\n }\n const cacheState = res.headers.get(CACHE_STATE_HEADER);\n const age = res.headers.get(\"age\");\n data = {\n value: cached,\n // if it's already stale set it to a time in the past\n // if not derive last modified from age\n lastModified: cacheState !== \"fresh\" ? Date.now() - CACHE_ONE_YEAR : Date.now() - parseInt(age || \"0\", 10) * 1000\n };\n if (DEBUG) {\n console.log(`got fetch cache entry for ${key}, duration: ${Date.now() - start}ms, size: ${Object.keys(cached).length}, cache-state: ${cacheState} tags: ${tags == null ? void 0 : tags.join(\",\")} softTags: ${softTags == null ? void 0 : softTags.join(\",\")}`);\n }\n if (data) {\n memoryCache == null ? void 0 : memoryCache.set(key, data);\n }\n } catch (err) {\n // unable to get data from fetch-cache\n if (DEBUG) {\n console.error(`Failed to get from fetch-cache`, err);\n }\n }\n }\n return data || null;\n }\n async set(...args) {\n const [key, data, ctx] = args;\n const { fetchCache, fetchIdx, fetchUrl, tags } = ctx;\n if (!fetchCache) return;\n if (Date.now() < rateLimitedUntil) {\n if (DEBUG) {\n console.log(\"rate limited\");\n }\n return;\n }\n memoryCache == null ? void 0 : memoryCache.set(key, {\n value: data,\n lastModified: Date.now()\n });\n if (this.cacheEndpoint) {\n try {\n const start = Date.now();\n if (data !== null && \"revalidate\" in data) {\n this.headers[CACHE_REVALIDATE_HEADER] = data.revalidate.toString();\n }\n if (!this.headers[CACHE_REVALIDATE_HEADER] && data !== null && \"data\" in data) {\n this.headers[CACHE_CONTROL_VALUE_HEADER] = data.data.headers[\"cache-control\"];\n }\n const body = JSON.stringify({\n ...data,\n // we send the tags in the header instead\n // of in the body here\n tags: undefined\n });\n if (DEBUG) {\n console.log(\"set cache\", key);\n }\n const fetchParams = {\n internal: true,\n fetchType: \"cache-set\",\n fetchUrl,\n fetchIdx\n };\n const res = await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${key}`, {\n method: \"POST\",\n headers: {\n ...this.headers,\n [CACHE_FETCH_URL_HEADER]: fetchUrl || \"\",\n [CACHE_TAGS_HEADER]: (tags == null ? void 0 : tags.join(\",\")) || \"\"\n },\n body: body,\n next: fetchParams\n });\n if (res.status === 429) {\n const retryAfter = res.headers.get(\"retry-after\") || \"60000\";\n rateLimitedUntil = Date.now() + parseInt(retryAfter);\n }\n if (!res.ok) {\n DEBUG && console.log(await res.text());\n throw new Error(`invalid response ${res.status}`);\n }\n if (DEBUG) {\n console.log(`successfully set to fetch-cache for ${key}, duration: ${Date.now() - start}ms, size: ${body.length}`);\n }\n } catch (err) {\n // unable to set to fetch-cache\n if (DEBUG) {\n console.error(`Failed to update fetch cache`, err);\n }\n }\n }\n return;\n }\n}\n\n//# sourceMappingURL=fetch-cache.js.map","import LRUCache from \"next/dist/compiled/lru-cache\";\nimport path from \"../../../shared/lib/isomorphic/path\";\nimport { NEXT_CACHE_TAGS_HEADER, NEXT_DATA_SUFFIX, NEXT_META_SUFFIX, RSC_PREFETCH_SUFFIX, RSC_SUFFIX } from \"../../../lib/constants\";\nlet memoryCache;\nlet tagsManifest;\nexport default class FileSystemCache {\n constructor(ctx){\n this.fs = ctx.fs;\n this.flushToDisk = ctx.flushToDisk;\n this.serverDistDir = ctx.serverDistDir;\n this.appDir = !!ctx._appDir;\n this.pagesDir = !!ctx._pagesDir;\n this.revalidatedTags = ctx.revalidatedTags;\n this.experimental = ctx.experimental;\n this.debug = !!process.env.NEXT_PRIVATE_DEBUG_CACHE;\n if (ctx.maxMemoryCacheSize && !memoryCache) {\n if (this.debug) {\n console.log(\"using memory store for fetch cache\");\n }\n memoryCache = new LRUCache({\n max: ctx.maxMemoryCacheSize,\n length ({ value }) {\n var _JSON_stringify;\n if (!value) {\n return 25;\n } else if (value.kind === \"REDIRECT\") {\n return JSON.stringify(value.props).length;\n } else if (value.kind === \"IMAGE\") {\n throw new Error(\"invariant image should not be incremental-cache\");\n } else if (value.kind === \"FETCH\") {\n return JSON.stringify(value.data || \"\").length;\n } else if (value.kind === \"ROUTE\") {\n return value.body.length;\n }\n // rough estimate of size of cache value\n return value.html.length + (((_JSON_stringify = JSON.stringify(value.pageData)) == null ? void 0 : _JSON_stringify.length) || 0);\n }\n });\n } else if (this.debug) {\n console.log(\"not using memory store for fetch cache\");\n }\n if (this.serverDistDir && this.fs) {\n this.tagsManifestPath = path.join(this.serverDistDir, \"..\", \"cache\", \"fetch-cache\", \"tags-manifest.json\");\n this.loadTagsManifest();\n }\n }\n resetRequestCache() {}\n loadTagsManifest() {\n if (!this.tagsManifestPath || !this.fs || tagsManifest) return;\n try {\n tagsManifest = JSON.parse(this.fs.readFileSync(this.tagsManifestPath, \"utf8\"));\n } catch (err) {\n tagsManifest = {\n version: 1,\n items: {}\n };\n }\n if (this.debug) console.log(\"loadTagsManifest\", tagsManifest);\n }\n async revalidateTag(...args) {\n let [tags] = args;\n tags = typeof tags === \"string\" ? [\n tags\n ] : tags;\n if (this.debug) {\n console.log(\"revalidateTag\", tags);\n }\n if (tags.length === 0) {\n return;\n }\n // we need to ensure the tagsManifest is refreshed\n // since separate workers can be updating it at the same\n // time and we can't flush out of sync data\n await this.loadTagsManifest();\n if (!tagsManifest || !this.tagsManifestPath) {\n return;\n }\n for (const tag of tags){\n const data = tagsManifest.items[tag] || {};\n data.revalidatedAt = Date.now();\n tagsManifest.items[tag] = data;\n }\n try {\n await this.fs.mkdir(path.dirname(this.tagsManifestPath));\n await this.fs.writeFile(this.tagsManifestPath, JSON.stringify(tagsManifest || {}));\n if (this.debug) {\n console.log(\"Updated tags manifest\", tagsManifest);\n }\n } catch (err) {\n console.warn(\"Failed to update tags manifest.\", err);\n }\n }\n async get(...args) {\n var _data_value, _data_value1;\n const [key, ctx = {}] = args;\n const { tags, softTags, kindHint } = ctx;\n let data = memoryCache == null ? void 0 : memoryCache.get(key);\n if (this.debug) {\n console.log(\"get\", key, tags, kindHint, !!data);\n }\n // let's check the disk for seed data\n if (!data && process.env.NEXT_RUNTIME !== \"edge\") {\n try {\n const filePath = this.getFilePath(`${key}.body`, \"app\");\n const fileData = await this.fs.readFile(filePath);\n const { mtime } = await this.fs.stat(filePath);\n const meta = JSON.parse(await this.fs.readFile(filePath.replace(/\\.body$/, NEXT_META_SUFFIX), \"utf8\"));\n const cacheEntry = {\n lastModified: mtime.getTime(),\n value: {\n kind: \"ROUTE\",\n body: fileData,\n headers: meta.headers,\n status: meta.status\n }\n };\n return cacheEntry;\n } catch (_) {\n // no .meta data for the related key\n }\n try {\n // Determine the file kind if we didn't know it already.\n let kind = kindHint;\n if (!kind) {\n kind = this.detectFileKind(`${key}.html`);\n }\n const isAppPath = kind === \"app\";\n const filePath = this.getFilePath(kind === \"fetch\" ? key : `${key}.html`, kind);\n const fileData = await this.fs.readFile(filePath, \"utf8\");\n const { mtime } = await this.fs.stat(filePath);\n if (kind === \"fetch\" && this.flushToDisk) {\n var _data_value2;\n const lastModified = mtime.getTime();\n const parsedData = JSON.parse(fileData);\n data = {\n lastModified,\n value: parsedData\n };\n if (((_data_value2 = data.value) == null ? void 0 : _data_value2.kind) === \"FETCH\") {\n var _data_value3;\n const storedTags = (_data_value3 = data.value) == null ? void 0 : _data_value3.tags;\n // update stored tags if a new one is being added\n // TODO: remove this when we can send the tags\n // via header on GET same as SET\n if (!(tags == null ? void 0 : tags.every((tag)=>storedTags == null ? void 0 : storedTags.includes(tag)))) {\n if (this.debug) {\n console.log(\"tags vs storedTags mismatch\", tags, storedTags);\n }\n await this.set(key, data.value, {\n tags\n });\n }\n }\n } else {\n const pageData = isAppPath ? await this.fs.readFile(this.getFilePath(`${key}${this.experimental.ppr ? RSC_PREFETCH_SUFFIX : RSC_SUFFIX}`, \"app\"), \"utf8\") : JSON.parse(await this.fs.readFile(this.getFilePath(`${key}${NEXT_DATA_SUFFIX}`, \"pages\"), \"utf8\"));\n let meta;\n if (isAppPath) {\n try {\n meta = JSON.parse(await this.fs.readFile(filePath.replace(/\\.html$/, NEXT_META_SUFFIX), \"utf8\"));\n } catch {}\n }\n data = {\n lastModified: mtime.getTime(),\n value: {\n kind: \"PAGE\",\n html: fileData,\n pageData,\n postponed: meta == null ? void 0 : meta.postponed,\n headers: meta == null ? void 0 : meta.headers,\n status: meta == null ? void 0 : meta.status\n }\n };\n }\n if (data) {\n memoryCache == null ? void 0 : memoryCache.set(key, data);\n }\n } catch (_) {\n // unable to get data from disk\n }\n }\n if ((data == null ? void 0 : (_data_value = data.value) == null ? void 0 : _data_value.kind) === \"PAGE\") {\n var _data_value_headers;\n let cacheTags;\n const tagsHeader = (_data_value_headers = data.value.headers) == null ? void 0 : _data_value_headers[NEXT_CACHE_TAGS_HEADER];\n if (typeof tagsHeader === \"string\") {\n cacheTags = tagsHeader.split(\",\");\n }\n if (cacheTags == null ? void 0 : cacheTags.length) {\n this.loadTagsManifest();\n const isStale = cacheTags.some((tag)=>{\n var _tagsManifest_items_tag;\n return (tagsManifest == null ? void 0 : (_tagsManifest_items_tag = tagsManifest.items[tag]) == null ? void 0 : _tagsManifest_items_tag.revalidatedAt) && (tagsManifest == null ? void 0 : tagsManifest.items[tag].revalidatedAt) >= ((data == null ? void 0 : data.lastModified) || Date.now());\n });\n // we trigger a blocking validation if an ISR page\n // had a tag revalidated, if we want to be a background\n // revalidation instead we return data.lastModified = -1\n if (isStale) {\n data = undefined;\n }\n }\n }\n if (data && (data == null ? void 0 : (_data_value1 = data.value) == null ? void 0 : _data_value1.kind) === \"FETCH\") {\n this.loadTagsManifest();\n const combinedTags = [\n ...tags || [],\n ...softTags || []\n ];\n const wasRevalidated = combinedTags.some((tag)=>{\n var _tagsManifest_items_tag;\n if (this.revalidatedTags.includes(tag)) {\n return true;\n }\n return (tagsManifest == null ? void 0 : (_tagsManifest_items_tag = tagsManifest.items[tag]) == null ? void 0 : _tagsManifest_items_tag.revalidatedAt) && (tagsManifest == null ? void 0 : tagsManifest.items[tag].revalidatedAt) >= ((data == null ? void 0 : data.lastModified) || Date.now());\n });\n // When revalidate tag is called we don't return\n // stale data so it's updated right away\n if (wasRevalidated) {\n data = undefined;\n }\n }\n return data ?? null;\n }\n async set(...args) {\n const [key, data, ctx] = args;\n memoryCache == null ? void 0 : memoryCache.set(key, {\n value: data,\n lastModified: Date.now()\n });\n if (this.debug) {\n console.log(\"set\", key);\n }\n if (!this.flushToDisk) return;\n if ((data == null ? void 0 : data.kind) === \"ROUTE\") {\n const filePath = this.getFilePath(`${key}.body`, \"app\");\n await this.fs.mkdir(path.dirname(filePath));\n await this.fs.writeFile(filePath, data.body);\n const meta = {\n headers: data.headers,\n status: data.status,\n postponed: undefined\n };\n await this.fs.writeFile(filePath.replace(/\\.body$/, NEXT_META_SUFFIX), JSON.stringify(meta, null, 2));\n return;\n }\n if ((data == null ? void 0 : data.kind) === \"PAGE\") {\n const isAppPath = typeof data.pageData === \"string\";\n const htmlPath = this.getFilePath(`${key}.html`, isAppPath ? \"app\" : \"pages\");\n await this.fs.mkdir(path.dirname(htmlPath));\n await this.fs.writeFile(htmlPath, data.html);\n await this.fs.writeFile(this.getFilePath(`${key}${isAppPath ? this.experimental.ppr ? RSC_PREFETCH_SUFFIX : RSC_SUFFIX : NEXT_DATA_SUFFIX}`, isAppPath ? \"app\" : \"pages\"), isAppPath ? data.pageData : JSON.stringify(data.pageData));\n if (data.headers || data.status) {\n const meta = {\n headers: data.headers,\n status: data.status,\n postponed: data.postponed\n };\n await this.fs.writeFile(htmlPath.replace(/\\.html$/, NEXT_META_SUFFIX), JSON.stringify(meta));\n }\n } else if ((data == null ? void 0 : data.kind) === \"FETCH\") {\n const filePath = this.getFilePath(key, \"fetch\");\n await this.fs.mkdir(path.dirname(filePath));\n await this.fs.writeFile(filePath, JSON.stringify({\n ...data,\n tags: ctx.tags\n }));\n }\n }\n detectFileKind(pathname) {\n if (!this.appDir && !this.pagesDir) {\n throw new Error(\"Invariant: Can't determine file path kind, no page directory enabled\");\n }\n // If app directory isn't enabled, then assume it's pages and avoid the fs\n // hit.\n if (!this.appDir && this.pagesDir) {\n return \"pages\";\n } else if (this.appDir && !this.pagesDir) {\n return \"app\";\n }\n // If both are enabled, we need to test each in order, starting with\n // `pages`.\n let filePath = this.getFilePath(pathname, \"pages\");\n if (this.fs.existsSync(filePath)) {\n return \"pages\";\n }\n filePath = this.getFilePath(pathname, \"app\");\n if (this.fs.existsSync(filePath)) {\n return \"app\";\n }\n throw new Error(`Invariant: Unable to determine file path kind for ${pathname}`);\n }\n getFilePath(pathname, kind) {\n switch(kind){\n case \"fetch\":\n // we store in .next/cache/fetch-cache so it can be persisted\n // across deploys\n return path.join(this.serverDistDir, \"..\", \"cache\", \"fetch-cache\", pathname);\n case \"pages\":\n return path.join(this.serverDistDir, \"pages\", pathname);\n case \"app\":\n return path.join(this.serverDistDir, \"app\", pathname);\n default:\n throw new Error(\"Invariant: Can't determine file path kind\");\n }\n }\n}\n\n//# sourceMappingURL=file-system-cache.js.map","export var RedirectStatusCode;\n(function(RedirectStatusCode) {\n RedirectStatusCode[RedirectStatusCode[\"SeeOther\"] = 303] = \"SeeOther\";\n RedirectStatusCode[RedirectStatusCode[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n RedirectStatusCode[RedirectStatusCode[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n})(RedirectStatusCode || (RedirectStatusCode = {}));\n\n//# sourceMappingURL=redirect-status-code.js.map","// ISC License\n// Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n//\n// https://github.com/alexeyraspopov/picocolors/blob/b6261487e7b81aaab2440e397a356732cad9e342/picocolors.js#L1\nvar _globalThis;\nconst { env, stdout } = ((_globalThis = globalThis) == null ? void 0 : _globalThis.process) ?? {};\nconst enabled = env && !env.NO_COLOR && (env.FORCE_COLOR || (stdout == null ? void 0 : stdout.isTTY) && !env.CI && env.TERM !== \"dumb\");\nconst replaceClose = (str, close, replace, index)=>{\n const start = str.substring(0, index) + replace;\n const end = str.substring(index + close.length);\n const nextIndex = end.indexOf(close);\n return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\nconst formatter = (open, close, replace = open)=>{\n if (!enabled) return String;\n return (input)=>{\n const string = \"\" + input;\n const index = string.indexOf(close, open.length);\n return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;\n };\n};\nexport const reset = enabled ? (s)=>`\\x1b[0m${s}\\x1b[0m` : String;\nexport const bold = formatter(\"\\x1b[1m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[1m\");\nexport const dim = formatter(\"\\x1b[2m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[2m\");\nexport const italic = formatter(\"\\x1b[3m\", \"\\x1b[23m\");\nexport const underline = formatter(\"\\x1b[4m\", \"\\x1b[24m\");\nexport const inverse = formatter(\"\\x1b[7m\", \"\\x1b[27m\");\nexport const hidden = formatter(\"\\x1b[8m\", \"\\x1b[28m\");\nexport const strikethrough = formatter(\"\\x1b[9m\", \"\\x1b[29m\");\nexport const black = formatter(\"\\x1b[30m\", \"\\x1b[39m\");\nexport const red = formatter(\"\\x1b[31m\", \"\\x1b[39m\");\nexport const green = formatter(\"\\x1b[32m\", \"\\x1b[39m\");\nexport const yellow = formatter(\"\\x1b[33m\", \"\\x1b[39m\");\nexport const blue = formatter(\"\\x1b[34m\", \"\\x1b[39m\");\nexport const magenta = formatter(\"\\x1b[35m\", \"\\x1b[39m\");\nexport const purple = formatter(\"\\x1b[38;2;173;127;168m\", \"\\x1b[39m\");\nexport const cyan = formatter(\"\\x1b[36m\", \"\\x1b[39m\");\nexport const white = formatter(\"\\x1b[37m\", \"\\x1b[39m\");\nexport const gray = formatter(\"\\x1b[90m\", \"\\x1b[39m\");\nexport const bgBlack = formatter(\"\\x1b[40m\", \"\\x1b[49m\");\nexport const bgRed = formatter(\"\\x1b[41m\", \"\\x1b[49m\");\nexport const bgGreen = formatter(\"\\x1b[42m\", \"\\x1b[49m\");\nexport const bgYellow = formatter(\"\\x1b[43m\", \"\\x1b[49m\");\nexport const bgBlue = formatter(\"\\x1b[44m\", \"\\x1b[49m\");\nexport const bgMagenta = formatter(\"\\x1b[45m\", \"\\x1b[49m\");\nexport const bgCyan = formatter(\"\\x1b[46m\", \"\\x1b[49m\");\nexport const bgWhite = formatter(\"\\x1b[47m\", \"\\x1b[49m\");\n\n//# sourceMappingURL=picocolors.js.map","export var PAGE_TYPES;\n(function(PAGE_TYPES) {\n PAGE_TYPES[\"PAGES\"] = \"pages\";\n PAGE_TYPES[\"ROOT\"] = \"root\";\n PAGE_TYPES[\"APP\"] = \"app\";\n})(PAGE_TYPES || (PAGE_TYPES = {}));\n\n//# sourceMappingURL=page-types.js.map","export var RouteKind;\n(function(RouteKind) {\n /**\n * `PAGES` represents all the React pages that are under `pages/`.\n */ RouteKind[\"PAGES\"] = \"PAGES\";\n /**\n * `PAGES_API` represents all the API routes under `pages/api/`.\n */ RouteKind[\"PAGES_API\"] = \"PAGES_API\";\n /**\n * `APP_PAGE` represents all the React pages that are under `app/` with the\n * filename of `page.{j,t}s{,x}`.\n */ RouteKind[\"APP_PAGE\"] = \"APP_PAGE\";\n /**\n * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the\n * filename of `route.{j,t}s{,x}`.\n */ RouteKind[\"APP_ROUTE\"] = \"APP_ROUTE\";\n})(RouteKind || (RouteKind = {}));\n\n//# sourceMappingURL=route-kind.js.map","// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n// This module will only be loaded once per process.\nconst path = require(\"path\");\nconst mod = require(\"module\");\nconst originalRequire = mod.prototype.require;\nconst resolveFilename = mod._resolveFilename;\nlet resolve = process.env.NEXT_MINIMAL ? __non_webpack_require__.resolve : require.resolve;\nexport const hookPropertyMap = new Map();\nexport const defaultOverrides = {\n \"styled-jsx\": path.dirname(resolve(\"styled-jsx/package.json\")),\n \"styled-jsx/style\": resolve(\"styled-jsx/style\"),\n \"styled-jsx/style.js\": resolve(\"styled-jsx/style\")\n};\nconst toResolveMap = (map)=>Object.entries(map).map(([key, value])=>[\n key,\n resolve(value)\n ]);\nexport function addHookAliases(aliases = []) {\n for (const [key, value] of aliases){\n hookPropertyMap.set(key, value);\n }\n}\naddHookAliases(toResolveMap(defaultOverrides));\nmod._resolveFilename = (function(originalResolveFilename, requestMap, request, parent, isMain, options) {\n const hookResolved = requestMap.get(request);\n if (hookResolved) request = hookResolved;\n return originalResolveFilename.call(mod, request, parent, isMain, options);\n// We use `bind` here to avoid referencing outside variables to create potential memory leaks.\n}).bind(null, resolveFilename, hookPropertyMap);\n// This is a hack to make sure that if a user requires a Next.js module that wasn't bundled\n// that needs to point to the rendering runtime version, it will point to the correct one.\n// This can happen on `pages` when a user requires a dependency that uses next/image for example.\nmod.prototype.require = function(request) {\n if (request.endsWith(\".shared-runtime\")) {\n return originalRequire.call(this, `next/dist/server/future/route-modules/pages/vendored/contexts/${path.basename(request, \".shared-runtime\")}`);\n }\n return originalRequire.call(this, request);\n};\n\n//# sourceMappingURL=require-hook.js.map","import { DecodeError } from \"../../utils\";\nexport function getRouteMatcher(param) {\n let { re, groups } = param;\n return (pathname)=>{\n const routeMatch = re.exec(pathname);\n if (!routeMatch) {\n return false;\n }\n const decode = (param)=>{\n try {\n return decodeURIComponent(param);\n } catch (_) {\n throw new DecodeError(\"failed to decode param\");\n }\n };\n const params = {};\n Object.keys(groups).forEach((slugName)=>{\n const g = groups[slugName];\n const m = routeMatch[g.pos];\n if (m !== undefined) {\n params[slugName] = ~m.indexOf(\"/\") ? m.split(\"/\").map((entry)=>decode(entry)) : g.repeat ? [\n decode(m)\n ] : decode(m);\n }\n });\n return params;\n };\n}\n\n//# sourceMappingURL=route-matcher.js.map","/* eslint-disable no-redeclare */ // FIXME: (wyattjoh) this is a temporary solution to allow us to pass data between bundled modules\nexport const NEXT_REQUEST_META = Symbol.for(\"NextInternalRequestMeta\");\nexport function getRequestMeta(req, key) {\n const meta = req[NEXT_REQUEST_META] || {};\n return typeof key === \"string\" ? meta[key] : meta;\n}\n/**\n * Sets the request metadata.\n *\n * @param req the request to set the metadata on\n * @param meta the metadata to set\n * @returns the mutated request metadata\n */ export function setRequestMeta(req, meta) {\n req[NEXT_REQUEST_META] = meta;\n return meta;\n}\n/**\n * Adds a value to the request metadata.\n *\n * @param request the request to mutate\n * @param key the key to set\n * @param value the value to set\n * @returns the mutated request metadata\n */ export function addRequestMeta(request, key, value) {\n const meta = getRequestMeta(request);\n meta[key] = value;\n return setRequestMeta(request, meta);\n}\n/**\n * Removes a key from the request metadata.\n *\n * @param request the request to mutate\n * @param key the key to remove\n * @returns the mutated request metadata\n */ export function removeRequestMeta(request, key) {\n const meta = getRequestMeta(request);\n delete meta[key];\n return setRequestMeta(request, meta);\n}\nexport function getNextInternalQuery(query) {\n const keysToInclude = [\n \"__nextDefaultLocale\",\n \"__nextFallback\",\n \"__nextLocale\",\n \"__nextSsgPath\",\n \"_nextBubbleNoFallback\",\n \"__nextDataReq\",\n \"__nextInferredLocaleFromDefault\"\n ];\n const nextInternalQuery = {};\n for (const key of keysToInclude){\n if (key in query) {\n // @ts-ignore this can't be typed correctly\n nextInternalQuery[key] = query[key];\n }\n }\n return nextInternalQuery;\n}\n\n//# sourceMappingURL=request-meta.js.map","import MODERN_BROWSERSLIST_TARGET from \"./modern-browserslist-target\";\nexport { MODERN_BROWSERSLIST_TARGET };\nexport const COMPILER_NAMES = {\n client: \"client\",\n server: \"server\",\n edgeServer: \"edge-server\"\n};\nexport const COMPILER_INDEXES = {\n [COMPILER_NAMES.client]: 0,\n [COMPILER_NAMES.server]: 1,\n [COMPILER_NAMES.edgeServer]: 2\n};\nexport const UNDERSCORE_NOT_FOUND_ROUTE = \"/_not-found\";\nexport const UNDERSCORE_NOT_FOUND_ROUTE_ENTRY = \"\" + UNDERSCORE_NOT_FOUND_ROUTE + \"/page\";\nexport const PHASE_EXPORT = \"phase-export\";\nexport const PHASE_PRODUCTION_BUILD = \"phase-production-build\";\nexport const PHASE_PRODUCTION_SERVER = \"phase-production-server\";\nexport const PHASE_DEVELOPMENT_SERVER = \"phase-development-server\";\nexport const PHASE_TEST = \"phase-test\";\nexport const PHASE_INFO = \"phase-info\";\nexport const PAGES_MANIFEST = \"pages-manifest.json\";\nexport const APP_PATHS_MANIFEST = \"app-paths-manifest.json\";\nexport const APP_PATH_ROUTES_MANIFEST = \"app-path-routes-manifest.json\";\nexport const BUILD_MANIFEST = \"build-manifest.json\";\nexport const APP_BUILD_MANIFEST = \"app-build-manifest.json\";\nexport const FUNCTIONS_CONFIG_MANIFEST = \"functions-config-manifest.json\";\nexport const SUBRESOURCE_INTEGRITY_MANIFEST = \"subresource-integrity-manifest\";\nexport const NEXT_FONT_MANIFEST = \"next-font-manifest\";\nexport const EXPORT_MARKER = \"export-marker.json\";\nexport const EXPORT_DETAIL = \"export-detail.json\";\nexport const PRERENDER_MANIFEST = \"prerender-manifest.json\";\nexport const ROUTES_MANIFEST = \"routes-manifest.json\";\nexport const IMAGES_MANIFEST = \"images-manifest.json\";\nexport const SERVER_FILES_MANIFEST = \"required-server-files.json\";\nexport const DEV_CLIENT_PAGES_MANIFEST = \"_devPagesManifest.json\";\nexport const MIDDLEWARE_MANIFEST = \"middleware-manifest.json\";\nexport const DEV_MIDDLEWARE_MANIFEST = \"_devMiddlewareManifest.json\";\nexport const REACT_LOADABLE_MANIFEST = \"react-loadable-manifest.json\";\nexport const AUTOMATIC_FONT_OPTIMIZATION_MANIFEST = \"font-manifest.json\";\nexport const SERVER_DIRECTORY = \"server\";\nexport const CONFIG_FILES = [\n \"next.config.js\",\n \"next.config.mjs\"\n];\nexport const BUILD_ID_FILE = \"BUILD_ID\";\nexport const BLOCKED_PAGES = [\n \"/_document\",\n \"/_app\",\n \"/_error\"\n];\nexport const CLIENT_PUBLIC_FILES_PATH = \"public\";\nexport const CLIENT_STATIC_FILES_PATH = \"static\";\nexport const STRING_LITERAL_DROP_BUNDLE = \"__NEXT_DROP_CLIENT_FILE__\";\nexport const NEXT_BUILTIN_DOCUMENT = \"__NEXT_BUILTIN_DOCUMENT__\";\nexport const BARREL_OPTIMIZATION_PREFIX = \"__barrel_optimize__\";\n// server/[entry]/page_client-reference-manifest.js\nexport const CLIENT_REFERENCE_MANIFEST = \"client-reference-manifest\";\n// server/server-reference-manifest\nexport const SERVER_REFERENCE_MANIFEST = \"server-reference-manifest\";\n// server/middleware-build-manifest.js\nexport const MIDDLEWARE_BUILD_MANIFEST = \"middleware-build-manifest\";\n// server/middleware-react-loadable-manifest.js\nexport const MIDDLEWARE_REACT_LOADABLE_MANIFEST = \"middleware-react-loadable-manifest\";\n// server/interception-route-rewrite-manifest.js\nexport const INTERCEPTION_ROUTE_REWRITE_MANIFEST = \"interception-route-rewrite-manifest\";\n// static/runtime/main.js\nexport const CLIENT_STATIC_FILES_RUNTIME_MAIN = \"main\";\nexport const CLIENT_STATIC_FILES_RUNTIME_MAIN_APP = \"\" + CLIENT_STATIC_FILES_RUNTIME_MAIN + \"-app\";\n// next internal client components chunk for layouts\nexport const APP_CLIENT_INTERNALS = \"app-pages-internals\";\n// static/runtime/react-refresh.js\nexport const CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH = \"react-refresh\";\n// static/runtime/amp.js\nexport const CLIENT_STATIC_FILES_RUNTIME_AMP = \"amp\";\n// static/runtime/webpack.js\nexport const CLIENT_STATIC_FILES_RUNTIME_WEBPACK = \"webpack\";\n// static/runtime/polyfills.js\nexport const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS = \"polyfills\";\nexport const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL = Symbol(CLIENT_STATIC_FILES_RUNTIME_POLYFILLS);\nexport const DEFAULT_RUNTIME_WEBPACK = \"webpack-runtime\";\nexport const EDGE_RUNTIME_WEBPACK = \"edge-runtime-webpack\";\nexport const STATIC_PROPS_ID = \"__N_SSG\";\nexport const SERVER_PROPS_ID = \"__N_SSP\";\nexport const GOOGLE_FONT_PROVIDER = \"https://fonts.googleapis.com/\";\nexport const OPTIMIZED_FONT_PROVIDERS = [\n {\n url: GOOGLE_FONT_PROVIDER,\n preconnect: \"https://fonts.gstatic.com\"\n },\n {\n url: \"https://use.typekit.net\",\n preconnect: \"https://use.typekit.net\"\n }\n];\nexport const DEFAULT_SERIF_FONT = {\n name: \"Times New Roman\",\n xAvgCharWidth: 821,\n azAvgWidth: 854.3953488372093,\n unitsPerEm: 2048\n};\nexport const DEFAULT_SANS_SERIF_FONT = {\n name: \"Arial\",\n xAvgCharWidth: 904,\n azAvgWidth: 934.5116279069767,\n unitsPerEm: 2048\n};\nexport const STATIC_STATUS_PAGES = [\n \"/500\"\n];\nexport const TRACE_OUTPUT_VERSION = 1;\n// in `MB`\nexport const TURBO_TRACE_DEFAULT_MEMORY_LIMIT = 6000;\nexport const RSC_MODULE_TYPES = {\n client: \"client\",\n server: \"server\"\n};\n// comparing\n// https://nextjs.org/docs/api-reference/edge-runtime\n// with\n// https://nodejs.org/docs/latest/api/globals.html\nexport const EDGE_UNSUPPORTED_NODE_APIS = [\n \"clearImmediate\",\n \"setImmediate\",\n \"BroadcastChannel\",\n \"ByteLengthQueuingStrategy\",\n \"CompressionStream\",\n \"CountQueuingStrategy\",\n \"DecompressionStream\",\n \"DomException\",\n \"MessageChannel\",\n \"MessageEvent\",\n \"MessagePort\",\n \"ReadableByteStreamController\",\n \"ReadableStreamBYOBRequest\",\n \"ReadableStreamDefaultController\",\n \"TransformStreamDefaultController\",\n \"WritableStreamDefaultController\"\n];\nexport const SYSTEM_ENTRYPOINTS = new Set([\n CLIENT_STATIC_FILES_RUNTIME_MAIN,\n CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,\n CLIENT_STATIC_FILES_RUNTIME_AMP,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP\n]);\n\n//# sourceMappingURL=constants.js.map","import fs from \"fs\";\nimport path from \"path\";\nexport function findDir(dir, name) {\n // prioritize ./${name} over ./src/${name}\n let curDir = path.join(dir, name);\n if (fs.existsSync(curDir)) return curDir;\n curDir = path.join(dir, \"src\", name);\n if (fs.existsSync(curDir)) return curDir;\n return null;\n}\nexport function findPagesDir(dir) {\n const pagesDir = findDir(dir, \"pages\") || undefined;\n const appDir = findDir(dir, \"app\") || undefined;\n if (appDir == null && pagesDir == null) {\n throw new Error(\"> Couldn't find any `pages` or `app` directory. Please create one under the project root\");\n }\n return {\n pagesDir,\n appDir\n };\n}\n\n//# sourceMappingURL=find-pages-dir.js.map","/**\n * Parse cookies from the `headers` of request\n * @param req request object\n */ export function getCookieParser(headers) {\n return function parseCookie() {\n const { cookie } = headers;\n if (!cookie) {\n return {};\n }\n const { parse: parseCookieFn } = require(\"next/dist/compiled/cookie\");\n return parseCookieFn(Array.isArray(cookie) ? cookie.join(\"; \") : cookie);\n };\n}\n\n//# sourceMappingURL=get-cookie-parser.js.map","import { RedirectStatusCode } from \"../../client/components/redirect-status-code\";\nimport { getCookieParser } from \"../api-utils/get-cookie-parser\";\nexport class BaseNextRequest {\n constructor(method, url, body){\n this.method = method;\n this.url = url;\n this.body = body;\n }\n // Utils implemented using the abstract methods above\n get cookies() {\n if (this._cookies) return this._cookies;\n return this._cookies = getCookieParser(this.headers)();\n }\n}\nexport class BaseNextResponse {\n constructor(destination){\n this.destination = destination;\n }\n // Utils implemented using the abstract methods above\n redirect(destination, statusCode) {\n this.setHeader(\"Location\", destination);\n this.statusCode = statusCode;\n // Since IE11 doesn't support the 308 header add backwards\n // compatibility using refresh header\n if (statusCode === RedirectStatusCode.PermanentRedirect) {\n this.setHeader(\"Refresh\", `0;url=${destination}`);\n }\n return this;\n }\n}\n\n//# sourceMappingURL=index.js.map","import { SYMBOL_CLEARED_COOKIES } from \"../api-utils\";\nimport { NEXT_REQUEST_META } from \"../request-meta\";\nimport { BaseNextRequest, BaseNextResponse } from \"./index\";\nlet _NEXT_REQUEST_META = NEXT_REQUEST_META;\nexport class NodeNextRequest extends BaseNextRequest {\n get originalRequest() {\n // Need to mimic these changes to the original req object for places where we use it:\n // render.tsx, api/ssg requests\n this._req[NEXT_REQUEST_META] = this[NEXT_REQUEST_META];\n this._req.url = this.url;\n this._req.cookies = this.cookies;\n return this._req;\n }\n set originalRequest(value) {\n this._req = value;\n }\n constructor(_req){\n var _this__req;\n super(_req.method.toUpperCase(), _req.url, _req);\n this._req = _req;\n this.headers = this._req.headers;\n this.fetchMetrics = (_this__req = this._req) == null ? void 0 : _this__req.fetchMetrics;\n this[_NEXT_REQUEST_META] = this._req[NEXT_REQUEST_META] || {};\n }\n}\nexport class NodeNextResponse extends BaseNextResponse {\n get originalResponse() {\n if (SYMBOL_CLEARED_COOKIES in this) {\n this._res[SYMBOL_CLEARED_COOKIES] = this[SYMBOL_CLEARED_COOKIES];\n }\n return this._res;\n }\n constructor(_res){\n super(_res);\n this._res = _res;\n this.textBody = undefined;\n }\n get sent() {\n return this._res.finished || this._res.headersSent;\n }\n get statusCode() {\n return this._res.statusCode;\n }\n set statusCode(value) {\n this._res.statusCode = value;\n }\n get statusMessage() {\n return this._res.statusMessage;\n }\n set statusMessage(value) {\n this._res.statusMessage = value;\n }\n setHeader(name, value) {\n this._res.setHeader(name, value);\n return this;\n }\n removeHeader(name) {\n this._res.removeHeader(name);\n return this;\n }\n getHeaderValues(name) {\n const values = this._res.getHeader(name);\n if (values === undefined) return undefined;\n return (Array.isArray(values) ? values : [\n values\n ]).map((value)=>value.toString());\n }\n hasHeader(name) {\n return this._res.hasHeader(name);\n }\n getHeader(name) {\n const values = this.getHeaderValues(name);\n return Array.isArray(values) ? values.join(\",\") : undefined;\n }\n getHeaders() {\n return this._res.getHeaders();\n }\n appendHeader(name, value) {\n const currentValues = this.getHeaderValues(name) ?? [];\n if (!currentValues.includes(value)) {\n this._res.setHeader(name, [\n ...currentValues,\n value\n ]);\n }\n return this;\n }\n body(value) {\n this.textBody = value;\n return this;\n }\n send() {\n this._res.end(this.textBody);\n }\n}\n\n//# sourceMappingURL=node.js.map","/**\n * FNV-1a Hash implementation\n * @author Travis Webb (tjwebb) <me@traviswebb.com>\n *\n * Ported from https://github.com/tjwebb/fnv-plus/blob/master/index.js\n *\n * Simplified, optimized and add modified for 52 bit, which provides a larger hash space\n * and still making use of Javascript's 53-bit integer space.\n */ export const fnv1a52 = (str)=>{\n const len = str.length;\n let i = 0, t0 = 0, v0 = 0x2325, t1 = 0, v1 = 0x8422, t2 = 0, v2 = 0x9ce4, t3 = 0, v3 = 0xcbf2;\n while(i < len){\n v0 ^= str.charCodeAt(i++);\n t0 = v0 * 435;\n t1 = v1 * 435;\n t2 = v2 * 435;\n t3 = v3 * 435;\n t2 += v0 << 8;\n t3 += v1 << 8;\n t1 += t0 >>> 16;\n v0 = t0 & 65535;\n t2 += t1 >>> 16;\n v1 = t1 & 65535;\n v3 = t3 + (t2 >>> 16) & 65535;\n v2 = t2 & 65535;\n }\n return (v3 & 15) * 281474976710656 + v2 * 4294967296 + v1 * 65536 + (v0 ^ v3 >> 4);\n};\nexport const generateETag = (payload, weak = false)=>{\n const prefix = weak ? 'W/\"' : '\"';\n return prefix + fnv1a52(payload).toString(36) + payload.length.toString(36) + '\"';\n};\n\n//# sourceMappingURL=etag.js.map","import { CACHE_ONE_YEAR } from \"../../lib/constants\";\nexport function formatRevalidate({ revalidate, swrDelta }) {\n const swrHeader = swrDelta ? `stale-while-revalidate=${swrDelta}` : \"stale-while-revalidate\";\n if (revalidate === 0) {\n return \"private, no-cache, no-store, max-age=0, must-revalidate\";\n } else if (typeof revalidate === \"number\") {\n return `s-maxage=${revalidate}, ${swrHeader}`;\n }\n return `s-maxage=${CACHE_ONE_YEAR}, ${swrHeader}`;\n}\n\n//# sourceMappingURL=revalidate.js.map","export const RSC_HEADER = \"RSC\";\nexport const ACTION = \"Next-Action\";\nexport const NEXT_ROUTER_STATE_TREE = \"Next-Router-State-Tree\";\nexport const NEXT_ROUTER_PREFETCH_HEADER = \"Next-Router-Prefetch\";\nexport const NEXT_URL = \"Next-Url\";\nexport const RSC_CONTENT_TYPE_HEADER = \"text/x-component\";\nexport const FLIGHT_PARAMETERS = [\n [\n RSC_HEADER\n ],\n [\n NEXT_ROUTER_STATE_TREE\n ],\n [\n NEXT_ROUTER_PREFETCH_HEADER\n ]\n];\nexport const NEXT_RSC_UNION_QUERY = \"_rsc\";\nexport const NEXT_DID_POSTPONE_HEADER = \"x-nextjs-postponed\";\n\n//# sourceMappingURL=app-router-headers.js.map","import { isResSent } from \"../shared/lib/utils\";\nimport { generateETag } from \"./lib/etag\";\nimport fresh from \"next/dist/compiled/fresh\";\nimport { formatRevalidate } from \"./lib/revalidate\";\nimport { RSC_CONTENT_TYPE_HEADER } from \"../client/components/app-router-headers\";\nexport function sendEtagResponse(req, res, etag) {\n if (etag) {\n /**\n * The server generating a 304 response MUST generate any of the\n * following header fields that would have been sent in a 200 (OK)\n * response to the same request: Cache-Control, Content-Location, Date,\n * ETag, Expires, and Vary. https://tools.ietf.org/html/rfc7232#section-4.1\n */ res.setHeader(\"ETag\", etag);\n }\n if (fresh(req.headers, {\n etag\n })) {\n res.statusCode = 304;\n res.end();\n return true;\n }\n return false;\n}\nexport async function sendRenderResult({ req, res, result, type, generateEtags, poweredByHeader, revalidate, swrDelta }) {\n if (isResSent(res)) {\n return;\n }\n if (poweredByHeader && type === \"html\") {\n res.setHeader(\"X-Powered-By\", \"Next.js\");\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (typeof revalidate !== \"undefined\" && !res.getHeader(\"Cache-Control\")) {\n res.setHeader(\"Cache-Control\", formatRevalidate({\n revalidate,\n swrDelta\n }));\n }\n const payload = result.isDynamic ? null : result.toUnchunkedString();\n if (payload !== null) {\n let etagPayload = payload;\n if (type === \"rsc\") {\n // ensure etag generation is deterministic as\n // ordering can differ even if underlying content\n // does not differ\n etagPayload = payload.split(\"\\n\").sort().join(\"\\n\");\n } else if (type === \"html\" && payload.includes(\"__next_f\")) {\n const { parse } = require(\"next/dist/compiled/node-html-parser\");\n try {\n var _root_querySelector;\n // Parse the HTML\n let root = parse(payload);\n // Get script tags in the body element\n let scriptTags = (_root_querySelector = root.querySelector(\"body\")) == null ? void 0 : _root_querySelector.querySelectorAll(\"script\").filter((node)=>{\n var _node_innerHTML;\n return !node.hasAttribute(\"src\") && ((_node_innerHTML = node.innerHTML) == null ? void 0 : _node_innerHTML.includes(\"__next_f\"));\n });\n // Sort the script tags by their inner text\n scriptTags == null ? void 0 : scriptTags.sort((a, b)=>a.innerHTML.localeCompare(b.innerHTML));\n // Remove the original script tags\n scriptTags == null ? void 0 : scriptTags.forEach((script)=>script.remove());\n // Append the sorted script tags to the body\n scriptTags == null ? void 0 : scriptTags.forEach((script)=>{\n var _root_querySelector;\n return (_root_querySelector = root.querySelector(\"body\")) == null ? void 0 : _root_querySelector.appendChild(script);\n });\n // Stringify back to HTML\n etagPayload = root.toString();\n } catch (err) {\n console.error(`Error parsing HTML payload`, err);\n }\n }\n const etag = generateEtags ? generateETag(etagPayload) : undefined;\n if (sendEtagResponse(req, res, etag)) {\n return;\n }\n }\n if (!res.getHeader(\"Content-Type\")) {\n res.setHeader(\"Content-Type\", result.contentType ? result.contentType : type === \"rsc\" ? RSC_CONTENT_TYPE_HEADER : type === \"json\" ? \"application/json\" : \"text/html; charset=utf-8\");\n }\n if (payload) {\n res.setHeader(\"Content-Length\", Buffer.byteLength(payload));\n }\n if (req.method === \"HEAD\") {\n res.end(null);\n return;\n }\n if (payload !== null) {\n res.end(payload);\n return;\n }\n // Pipe the render result to the response after we get a writer for it.\n await result.pipeToNodeResponse(res);\n}\n\n//# sourceMappingURL=send-payload.js.map","export function searchParamsToUrlQuery(searchParams) {\n const query = {};\n searchParams.forEach((value, key)=>{\n if (typeof query[key] === \"undefined\") {\n query[key] = value;\n } else if (Array.isArray(query[key])) {\n query[key].push(value);\n } else {\n query[key] = [\n query[key],\n value\n ];\n }\n });\n return query;\n}\nfunction stringifyUrlQueryParam(param) {\n if (typeof param === \"string\" || typeof param === \"number\" && !isNaN(param) || typeof param === \"boolean\") {\n return String(param);\n } else {\n return \"\";\n }\n}\nexport function urlQueryToSearchParams(urlQuery) {\n const result = new URLSearchParams();\n Object.entries(urlQuery).forEach((param)=>{\n let [key, value] = param;\n if (Array.isArray(value)) {\n value.forEach((item)=>result.append(key, stringifyUrlQueryParam(item)));\n } else {\n result.set(key, stringifyUrlQueryParam(value));\n }\n });\n return result;\n}\nexport function assign(target) {\n for(var _len = arguments.length, searchParamsList = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){\n searchParamsList[_key - 1] = arguments[_key];\n }\n searchParamsList.forEach((searchParams)=>{\n Array.from(searchParams.keys()).forEach((key)=>target.delete(key));\n searchParams.forEach((value, key)=>target.append(key, value));\n });\n return target;\n}\n\n//# sourceMappingURL=querystring.js.map","import { searchParamsToUrlQuery } from \"./querystring\";\nimport { parseRelativeUrl } from \"./parse-relative-url\";\nexport function parseUrl(url) {\n if (url.startsWith(\"/\")) {\n return parseRelativeUrl(url);\n }\n const parsedURL = new URL(url);\n return {\n hash: parsedURL.hash,\n hostname: parsedURL.hostname,\n href: parsedURL.href,\n pathname: parsedURL.pathname,\n port: parsedURL.port,\n protocol: parsedURL.protocol,\n query: searchParamsToUrlQuery(parsedURL.searchParams),\n search: parsedURL.search\n };\n}\n\n//# sourceMappingURL=parse-url.js.map","import { getLocationOrigin } from \"../../utils\";\nimport { searchParamsToUrlQuery } from \"./querystring\";\n/**\n * Parses path-relative urls (e.g. `/hello/world?foo=bar`). If url isn't path-relative\n * (e.g. `./hello`) then at least base must be.\n * Absolute urls are rejected with one exception, in the browser, absolute urls that are on\n * the current origin will be parsed as relative\n */ export function parseRelativeUrl(url, base) {\n const globalBase = new URL(typeof window === \"undefined\" ? \"http://n\" : getLocationOrigin());\n const resolvedBase = base ? new URL(base, globalBase) : url.startsWith(\".\") ? new URL(typeof window === \"undefined\" ? \"http://n\" : window.location.href) : globalBase;\n const { pathname, searchParams, search, hash, href, origin } = new URL(url, resolvedBase);\n if (origin !== globalBase.origin) {\n throw new Error(\"invariant: invalid relative URL, router received \" + url);\n }\n return {\n pathname,\n query: searchParamsToUrlQuery(searchParams),\n search,\n hash,\n href: href.slice(globalBase.origin.length)\n };\n}\n\n//# sourceMappingURL=parse-relative-url.js.map","import { bold, green, magenta, red, yellow, white } from \"../../lib/picocolors\";\nexport const prefixes = {\n wait: white(bold(\"○\")),\n error: red(bold(\"⨯\")),\n warn: yellow(bold(\"⚠\")),\n ready: \"▲\",\n info: white(bold(\" \")),\n event: green(bold(\"✓\")),\n trace: magenta(bold(\"\\xbb\"))\n};\nconst LOGGING_METHOD = {\n log: \"log\",\n warn: \"warn\",\n error: \"error\"\n};\nfunction prefixedLog(prefixType, ...message) {\n if ((message[0] === \"\" || message[0] === undefined) && message.length === 1) {\n message.shift();\n }\n const consoleMethod = prefixType in LOGGING_METHOD ? LOGGING_METHOD[prefixType] : \"log\";\n const prefix = prefixes[prefixType];\n // If there's no message, don't print the prefix but a new line\n if (message.length === 0) {\n console[consoleMethod](\"\");\n } else {\n console[consoleMethod](\" \" + prefix, ...message);\n }\n}\nexport function bootstrap(...message) {\n console.log(\" \", ...message);\n}\nexport function wait(...message) {\n prefixedLog(\"wait\", ...message);\n}\nexport function error(...message) {\n prefixedLog(\"error\", ...message);\n}\nexport function warn(...message) {\n prefixedLog(\"warn\", ...message);\n}\nexport function ready(...message) {\n prefixedLog(\"ready\", ...message);\n}\nexport function info(...message) {\n prefixedLog(\"info\", ...message);\n}\nexport function event(...message) {\n prefixedLog(\"event\", ...message);\n}\nexport function trace(...message) {\n prefixedLog(\"trace\", ...message);\n}\nconst warnOnceMessages = new Set();\nexport function warnOnce(...message) {\n if (!warnOnceMessages.has(message[0])) {\n warnOnceMessages.add(message.join(\" \"));\n warn(...message);\n }\n}\n\n//# sourceMappingURL=log.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"url\");","// Regex from `node/lib/internal/net.js`: https://github.com/nodejs/node/blob/9fc57006c27564ed7f75eee090eca86786508f51/lib/internal/net.js#L19-L29\n// License included below:\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nconst v4Seg = \"(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\";\nconst v4Str = `(${v4Seg}[.]){3}${v4Seg}`;\nconst v6Seg = \"(?:[0-9a-fA-F]{1,4})\";\nconst IPv6Reg = new RegExp(\"^(\" + `(?:${v6Seg}:){7}(?:${v6Seg}|:)|` + `(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` + `(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|` + `(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|` + `(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|` + `(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` + `(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` + `(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` + \")(%[0-9a-zA-Z-.:]{1,})?$\");\nexport function isIPv6(s) {\n return IPv6Reg.test(s);\n}\n\n//# sourceMappingURL=is-ipv6.js.map","/**\n * For a given page path, this function ensures that there is a leading slash.\n * If there is not a leading slash, one is added, otherwise it is noop.\n */ export function ensureLeadingSlash(path) {\n return path.startsWith(\"/\") ? path : \"/\" + path;\n}\n\n//# sourceMappingURL=ensure-leading-slash.js.map","import { ensureLeadingSlash } from \"../../page-path/ensure-leading-slash\";\nimport { isGroupSegment } from \"../../segment\";\n/**\n * Normalizes an app route so it represents the actual request path. Essentially\n * performing the following transformations:\n *\n * - `/(dashboard)/user/[id]/page` to `/user/[id]`\n * - `/(dashboard)/account/page` to `/account`\n * - `/user/[id]/page` to `/user/[id]`\n * - `/account/page` to `/account`\n * - `/page` to `/`\n * - `/(dashboard)/user/[id]/route` to `/user/[id]`\n * - `/(dashboard)/account/route` to `/account`\n * - `/user/[id]/route` to `/user/[id]`\n * - `/account/route` to `/account`\n * - `/route` to `/`\n * - `/` to `/`\n *\n * @param route the app route to normalize\n * @returns the normalized pathname\n */ export function normalizeAppPath(route) {\n return ensureLeadingSlash(route.split(\"/\").reduce((pathname, segment, index, segments)=>{\n // Empty segments are ignored.\n if (!segment) {\n return pathname;\n }\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname;\n }\n // Parallel segments are ignored.\n if (segment[0] === \"@\") {\n return pathname;\n }\n // The last segment (if it's a leaf) should be ignored.\n if ((segment === \"page\" || segment === \"route\") && index === segments.length - 1) {\n return pathname;\n }\n return pathname + \"/\" + segment;\n }, \"\"));\n}\n/**\n * Strips the `.rsc` extension if it's in the pathname.\n * Since this function is used on full urls it checks `?` for searchParams handling.\n */ export function normalizeRscURL(url) {\n return url.replace(/\\.rsc($|\\?)/, // $1 ensures `?` is preserved\n \"$1\");\n}\n\n//# sourceMappingURL=app-paths.js.map","export function isGroupSegment(segment) {\n // Use array[0] for performant purpose\n return segment[0] === \"(\" && segment.endsWith(\")\");\n}\nexport const PAGE_SEGMENT_KEY = \"__PAGE__\";\nexport const DEFAULT_SEGMENT_KEY = \"__DEFAULT__\";\n\n//# sourceMappingURL=segment.js.map","import { normalizeAppPath } from \"../../../shared/lib/router/utils/app-paths\";\n// order matters here, the first match will be used\nexport const INTERCEPTION_ROUTE_MARKERS = [\n \"(..)(..)\",\n \"(.)\",\n \"(..)\",\n \"(...)\"\n];\nexport function isInterceptionRouteAppPath(path) {\n // TODO-APP: add more serious validation\n return path.split(\"/\").find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;\n}\nexport function extractInterceptionRouteInformation(path) {\n let interceptingRoute, marker, interceptedRoute;\n for (const segment of path.split(\"/\")){\n marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));\n if (marker) {\n [interceptingRoute, interceptedRoute] = path.split(marker, 2);\n break;\n }\n }\n if (!interceptingRoute || !marker || !interceptedRoute) {\n throw new Error(`Invalid interception route: ${path}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);\n }\n interceptingRoute = normalizeAppPath(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed\n ;\n switch(marker){\n case \"(.)\":\n // (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route\n if (interceptingRoute === \"/\") {\n interceptedRoute = `/${interceptedRoute}`;\n } else {\n interceptedRoute = interceptingRoute + \"/\" + interceptedRoute;\n }\n break;\n case \"(..)\":\n // (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route\n if (interceptingRoute === \"/\") {\n throw new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`);\n }\n interceptedRoute = interceptingRoute.split(\"/\").slice(0, -1).concat(interceptedRoute).join(\"/\");\n break;\n case \"(...)\":\n // (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route\n interceptedRoute = \"/\" + interceptedRoute;\n break;\n case \"(..)(..)\":\n // (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route\n const splitInterceptingRoute = interceptingRoute.split(\"/\");\n if (splitInterceptingRoute.length <= 2) {\n throw new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`);\n }\n interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join(\"/\");\n break;\n default:\n throw new Error(\"Invariant: unexpected marker\");\n }\n return {\n interceptingRoute,\n interceptedRoute\n };\n}\n\n//# sourceMappingURL=interception-routes.js.map","import { extractInterceptionRouteInformation, isInterceptionRouteAppPath } from \"../../../../server/future/helpers/interception-routes\";\n// Identify /[param]/ in route string\nconst TEST_ROUTE = /\\/\\[[^/]+?\\](?=\\/|$)/;\nexport function isDynamicRoute(route) {\n if (isInterceptionRouteAppPath(route)) {\n route = extractInterceptionRouteInformation(route).interceptedRoute;\n }\n return TEST_ROUTE.test(route);\n}\n\n//# sourceMappingURL=is-dynamic.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/dist/shared/lib/runtime-config.external.js\");","export function isBot(userAgent) {\n return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(userAgent);\n}\n\n//# sourceMappingURL=is-bot.js.map","import { getTracer } from \"../lib/trace/tracer\";\nimport { AppRenderSpan } from \"../lib/trace/constants\";\nimport { DetachedPromise } from \"../../lib/detached-promise\";\nimport { scheduleImmediate, atLeastOneTask } from \"../../lib/scheduler\";\nimport { ENCODED_TAGS } from \"./encodedTags\";\nimport { indexOfUint8Array, isEquivalentUint8Arrays, removeFromUint8Array } from \"./uint8array-helpers\";\nfunction voidCatch() {\n// this catcher is designed to be used with pipeTo where we expect the underlying\n// pipe implementation to forward errors but we don't want the pipeTo promise to reject\n// and be unhandled\n}\n// We can share the same encoder instance everywhere\n// Notably we cannot do the same for TextDecoder because it is stateful\n// when handling streaming data\nconst encoder = new TextEncoder();\nexport function chainStreams(...streams) {\n // We could encode this invariant in the arguments but current uses of this function pass\n // use spread so it would be missed by\n if (streams.length === 0) {\n throw new Error(\"Invariant: chainStreams requires at least one stream\");\n }\n // If we only have 1 stream we fast path it by returning just this stream\n if (streams.length === 1) {\n return streams[0];\n }\n const { readable, writable } = new TransformStream();\n // We always initiate pipeTo immediately. We know we have at least 2 streams\n // so we need to avoid closing the writable when this one finishes.\n let promise = streams[0].pipeTo(writable, {\n preventClose: true\n });\n let i = 1;\n for(; i < streams.length - 1; i++){\n const nextStream = streams[i];\n promise = promise.then(()=>nextStream.pipeTo(writable, {\n preventClose: true\n }));\n }\n // We can omit the length check because we halted before the last stream and there\n // is at least two streams so the lastStream here will always be defined\n const lastStream = streams[i];\n promise = promise.then(()=>lastStream.pipeTo(writable));\n // Catch any errors from the streams and ignore them, they will be handled\n // by whatever is consuming the readable stream.\n promise.catch(voidCatch);\n return readable;\n}\nexport function streamFromString(str) {\n return new ReadableStream({\n start (controller) {\n controller.enqueue(encoder.encode(str));\n controller.close();\n }\n });\n}\nexport async function streamToString(stream) {\n const decoder = new TextDecoder(\"utf-8\", {\n fatal: true\n });\n let string = \"\";\n // @ts-expect-error TypeScript gets this wrong (https://nodejs.org/api/webstreams.html#async-iteration)\n for await (const chunk of stream){\n string += decoder.decode(chunk, {\n stream: true\n });\n }\n string += decoder.decode();\n return string;\n}\nexport function createBufferedTransformStream() {\n let bufferedChunks = [];\n let bufferByteLength = 0;\n let pending;\n const flush = (controller)=>{\n // If we already have a pending flush, then return early.\n if (pending) return;\n const detached = new DetachedPromise();\n pending = detached;\n scheduleImmediate(()=>{\n try {\n const chunk = new Uint8Array(bufferByteLength);\n let copiedBytes = 0;\n for(let i = 0; i < bufferedChunks.length; i++){\n const bufferedChunk = bufferedChunks[i];\n chunk.set(bufferedChunk, copiedBytes);\n copiedBytes += bufferedChunk.byteLength;\n }\n // We just wrote all the buffered chunks so we need to reset the bufferedChunks array\n // and our bufferByteLength to prepare for the next round of buffered chunks\n bufferedChunks.length = 0;\n bufferByteLength = 0;\n controller.enqueue(chunk);\n } catch {\n // If an error occurs while enqueuing it can't be due to this\n // transformers fault. It's likely due to the controller being\n // errored due to the stream being cancelled.\n } finally{\n pending = undefined;\n detached.resolve();\n }\n });\n };\n return new TransformStream({\n transform (chunk, controller) {\n // Combine the previous buffer with the new chunk.\n bufferedChunks.push(chunk);\n bufferByteLength += chunk.byteLength;\n // Flush the buffer to the controller.\n flush(controller);\n },\n flush () {\n if (!pending) return;\n return pending.promise;\n }\n });\n}\nfunction createInsertedHTMLStream(getServerInsertedHTML) {\n return new TransformStream({\n transform: async (chunk, controller)=>{\n const html = await getServerInsertedHTML();\n if (html) {\n controller.enqueue(encoder.encode(html));\n }\n controller.enqueue(chunk);\n }\n });\n}\nexport function renderToInitialFizzStream({ ReactDOMServer, element, streamOptions }) {\n return getTracer().trace(AppRenderSpan.renderToReadableStream, async ()=>ReactDOMServer.renderToReadableStream(element, streamOptions));\n}\nfunction createHeadInsertionTransformStream(insert) {\n let inserted = false;\n let freezing = false;\n // We need to track if this transform saw any bytes because if it didn't\n // we won't want to insert any server HTML at all\n let hasBytes = false;\n return new TransformStream({\n async transform (chunk, controller) {\n hasBytes = true;\n // While react is flushing chunks, we don't apply insertions\n if (freezing) {\n controller.enqueue(chunk);\n return;\n }\n const insertion = await insert();\n if (inserted) {\n if (insertion) {\n const encodedInsertion = encoder.encode(insertion);\n controller.enqueue(encodedInsertion);\n }\n controller.enqueue(chunk);\n freezing = true;\n } else {\n // TODO (@Ethan-Arrowood): Replace the generic `indexOfUint8Array` method with something finely tuned for the subset of things actually being checked for.\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD);\n if (index !== -1) {\n if (insertion) {\n const encodedInsertion = encoder.encode(insertion);\n const insertedHeadContent = new Uint8Array(chunk.length + encodedInsertion.length);\n insertedHeadContent.set(chunk.slice(0, index));\n insertedHeadContent.set(encodedInsertion, index);\n insertedHeadContent.set(chunk.slice(index), index + encodedInsertion.length);\n controller.enqueue(insertedHeadContent);\n } else {\n controller.enqueue(chunk);\n }\n freezing = true;\n inserted = true;\n }\n }\n if (!inserted) {\n controller.enqueue(chunk);\n } else {\n scheduleImmediate(()=>{\n freezing = false;\n });\n }\n },\n async flush (controller) {\n // Check before closing if there's anything remaining to insert.\n if (hasBytes) {\n const insertion = await insert();\n if (insertion) {\n controller.enqueue(encoder.encode(insertion));\n }\n }\n }\n });\n}\n// Suffix after main body content - scripts before </body>,\n// but wait for the major chunks to be enqueued.\nfunction createDeferredSuffixStream(suffix) {\n let flushed = false;\n let pending;\n const flush = (controller)=>{\n const detached = new DetachedPromise();\n pending = detached;\n scheduleImmediate(()=>{\n try {\n controller.enqueue(encoder.encode(suffix));\n } catch {\n // If an error occurs while enqueuing it can't be due to this\n // transformers fault. It's likely due to the controller being\n // errored due to the stream being cancelled.\n } finally{\n pending = undefined;\n detached.resolve();\n }\n });\n };\n return new TransformStream({\n transform (chunk, controller) {\n controller.enqueue(chunk);\n // If we've already flushed, we're done.\n if (flushed) return;\n // Schedule the flush to happen.\n flushed = true;\n flush(controller);\n },\n flush (controller) {\n if (pending) return pending.promise;\n if (flushed) return;\n // Flush now.\n controller.enqueue(encoder.encode(suffix));\n }\n });\n}\n// Merge two streams into one. Ensure the final transform stream is closed\n// when both are finished.\nfunction createMergedTransformStream(stream) {\n let pull = null;\n let donePulling = false;\n async function startPulling(controller) {\n if (pull) {\n return;\n }\n const reader = stream.getReader();\n // NOTE: streaming flush\n // We are buffering here for the inlined data stream because the\n // \"shell\" stream might be chunkenized again by the underlying stream\n // implementation, e.g. with a specific high-water mark. To ensure it's\n // the safe timing to pipe the data stream, this extra tick is\n // necessary.\n // We don't start reading until we've left the current Task to ensure\n // that it's inserted after flushing the shell. Note that this implementation\n // might get stale if impl details of Fizz change in the future.\n await atLeastOneTask();\n try {\n while(true){\n const { done, value } = await reader.read();\n if (done) {\n donePulling = true;\n return;\n }\n controller.enqueue(value);\n }\n } catch (err) {\n controller.error(err);\n }\n }\n return new TransformStream({\n transform (chunk, controller) {\n controller.enqueue(chunk);\n // Start the streaming if it hasn't already been started yet.\n if (!pull) {\n pull = startPulling(controller);\n }\n },\n flush (controller) {\n if (donePulling) {\n return;\n }\n return pull || startPulling(controller);\n }\n });\n}\n/**\n * This transform stream moves the suffix to the end of the stream, so results\n * like `</body></html><script>...</script>` will be transformed to\n * `<script>...</script></body></html>`.\n */ function createMoveSuffixStream(suffix) {\n let foundSuffix = false;\n const encodedSuffix = encoder.encode(suffix);\n return new TransformStream({\n transform (chunk, controller) {\n if (foundSuffix) {\n return controller.enqueue(chunk);\n }\n const index = indexOfUint8Array(chunk, encodedSuffix);\n if (index > -1) {\n foundSuffix = true;\n // If the whole chunk is the suffix, then don't write anything, it will\n // be written in the flush.\n if (chunk.length === suffix.length) {\n return;\n }\n // Write out the part before the suffix.\n const before = chunk.slice(0, index);\n controller.enqueue(before);\n // In the case where the suffix is in the middle of the chunk, we need\n // to split the chunk into two parts.\n if (chunk.length > suffix.length + index) {\n // Write out the part after the suffix.\n const after = chunk.slice(index + suffix.length);\n controller.enqueue(after);\n }\n } else {\n controller.enqueue(chunk);\n }\n },\n flush (controller) {\n // Even if we didn't find the suffix, the HTML is not valid if we don't\n // add it, so insert it at the end.\n controller.enqueue(encodedSuffix);\n }\n });\n}\nfunction createStripDocumentClosingTagsTransform() {\n return new TransformStream({\n transform (chunk, controller) {\n // We rely on the assumption that chunks will never break across a code unit.\n // This is reasonable because we currently concat all of React's output from a single\n // flush into one chunk before streaming it forward which means the chunk will represent\n // a single coherent utf-8 string. This is not safe to use if we change our streaming to no\n // longer do this large buffered chunk\n if (isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML) || isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.BODY) || isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.HTML)) {\n // the entire chunk is the closing tags; return without enqueueing anything.\n return;\n }\n // We assume these tags will go at together at the end of the document and that\n // they won't appear anywhere else in the document. This is not really a safe assumption\n // but until we revamp our streaming infra this is a performant way to string the tags\n chunk = removeFromUint8Array(chunk, ENCODED_TAGS.CLOSED.BODY);\n chunk = removeFromUint8Array(chunk, ENCODED_TAGS.CLOSED.HTML);\n controller.enqueue(chunk);\n }\n });\n}\n/*\n * Checks if the root layout is missing the html or body tags\n * and if so, it will inject a script tag to throw an error in the browser, showing the user\n * the error message in the error overlay.\n */ export function createRootLayoutValidatorStream() {\n let foundHtml = false;\n let foundBody = false;\n return new TransformStream({\n async transform (chunk, controller) {\n // Peek into the streamed chunk to see if the tags are present.\n if (!foundHtml && indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML) > -1) {\n foundHtml = true;\n }\n if (!foundBody && indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.BODY) > -1) {\n foundBody = true;\n }\n controller.enqueue(chunk);\n },\n flush (controller) {\n const missingTags = [];\n if (!foundHtml) missingTags.push(\"html\");\n if (!foundBody) missingTags.push(\"body\");\n if (!missingTags.length) return;\n controller.enqueue(encoder.encode(`<script>self.__next_root_layout_missing_tags=${JSON.stringify(missingTags)}</script>`));\n }\n });\n}\nfunction chainTransformers(readable, transformers) {\n let stream = readable;\n for (const transformer of transformers){\n if (!transformer) continue;\n stream = stream.pipeThrough(transformer);\n }\n return stream;\n}\nexport async function continueFizzStream(renderStream, { suffix, inlinedDataStream, isStaticGeneration, getServerInsertedHTML, serverInsertedHTMLToHead, validateRootLayout }) {\n const closeTag = \"</body></html>\";\n // Suffix itself might contain close tags at the end, so we need to split it.\n const suffixUnclosed = suffix ? suffix.split(closeTag, 1)[0] : null;\n // If we're generating static HTML and there's an `allReady` promise on the\n // stream, we need to wait for it to resolve before continuing.\n if (isStaticGeneration && \"allReady\" in renderStream) {\n await renderStream.allReady;\n }\n return chainTransformers(renderStream, [\n // Buffer everything to avoid flushing too frequently\n createBufferedTransformStream(),\n // Insert generated tags to head\n getServerInsertedHTML && !serverInsertedHTMLToHead ? createInsertedHTMLStream(getServerInsertedHTML) : null,\n // Insert suffix content\n suffixUnclosed != null && suffixUnclosed.length > 0 ? createDeferredSuffixStream(suffixUnclosed) : null,\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n inlinedDataStream ? createMergedTransformStream(inlinedDataStream) : null,\n // Validate the root layout for missing html or body tags\n validateRootLayout ? createRootLayoutValidatorStream() : null,\n // Close tags should always be deferred to the end\n createMoveSuffixStream(closeTag),\n // Special head insertions\n // TODO-APP: Insert server side html to end of head in app layout rendering, to avoid\n // hydration errors. Remove this once it's ready to be handled by react itself.\n getServerInsertedHTML && serverInsertedHTMLToHead ? createHeadInsertionTransformStream(getServerInsertedHTML) : null\n ]);\n}\nexport async function continueDynamicPrerender(prerenderStream, { getServerInsertedHTML }) {\n return prerenderStream// Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream()).pipeThrough(createStripDocumentClosingTagsTransform())// Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML));\n}\nexport async function continueStaticPrerender(prerenderStream, { inlinedDataStream, getServerInsertedHTML }) {\n const closeTag = \"</body></html>\";\n return prerenderStream// Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream())// Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML))// Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n .pipeThrough(createMergedTransformStream(inlinedDataStream))// Close tags should always be deferred to the end\n .pipeThrough(createMoveSuffixStream(closeTag));\n}\nexport async function continueDynamicHTMLResume(renderStream, { inlinedDataStream, getServerInsertedHTML }) {\n const closeTag = \"</body></html>\";\n return renderStream// Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream())// Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML))// Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n .pipeThrough(createMergedTransformStream(inlinedDataStream))// Close tags should always be deferred to the end\n .pipeThrough(createMoveSuffixStream(closeTag));\n}\nexport async function continueDynamicDataResume(renderStream, { inlinedDataStream }) {\n const closeTag = \"</body></html>\";\n return renderStream// Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n .pipeThrough(createMergedTransformStream(inlinedDataStream))// Close tags should always be deferred to the end\n .pipeThrough(createMoveSuffixStream(closeTag));\n}\n\n//# sourceMappingURL=node-web-streams-helper.js.map","export const ENCODED_TAGS = {\n // opening tags do not have the closing `>` since they can contain other attributes such as `<body className=''>`\n OPENING: {\n // <html\n HTML: new Uint8Array([\n 60,\n 104,\n 116,\n 109,\n 108\n ]),\n // <body\n BODY: new Uint8Array([\n 60,\n 98,\n 111,\n 100,\n 121\n ])\n },\n CLOSED: {\n // </head>\n HEAD: new Uint8Array([\n 60,\n 47,\n 104,\n 101,\n 97,\n 100,\n 62\n ]),\n // </body>\n BODY: new Uint8Array([\n 60,\n 47,\n 98,\n 111,\n 100,\n 121,\n 62\n ]),\n // </html>\n HTML: new Uint8Array([\n 60,\n 47,\n 104,\n 116,\n 109,\n 108,\n 62\n ]),\n // </body></html>\n BODY_AND_HTML: new Uint8Array([\n 60,\n 47,\n 98,\n 111,\n 100,\n 121,\n 62,\n 60,\n 47,\n 104,\n 116,\n 109,\n 108,\n 62\n ])\n }\n};\n\n//# sourceMappingURL=encodedTags.js.map","/**\n * Converts a Node.js IncomingHttpHeaders object to a Headers object. Any\n * headers with multiple values will be joined with a comma and space. Any\n * headers that have an undefined value will be ignored and others will be\n * coerced to strings.\n *\n * @param nodeHeaders the headers object to convert\n * @returns the converted headers object\n */ export function fromNodeOutgoingHttpHeaders(nodeHeaders) {\n const headers = new Headers();\n for (let [key, value] of Object.entries(nodeHeaders)){\n const values = Array.isArray(value) ? value : [\n value\n ];\n for (let v of values){\n if (typeof v === \"undefined\") continue;\n if (typeof v === \"number\") {\n v = v.toString();\n }\n headers.append(key, v);\n }\n }\n return headers;\n}\n/*\n Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas\n that are within a single set-cookie field-value, such as in the Expires portion.\n This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2\n Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128\n React Native's fetch does this for *every* header, including set-cookie.\n \n Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25\n Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation\n*/ export function splitCookiesString(cookiesString) {\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n function skipWhitespace() {\n while(pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))){\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n while(pos < cookiesString.length){\n start = pos;\n cookiesSeparatorFound = false;\n while(skipWhitespace()){\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n // ',' is a cookie separator if we have later first '=', not ';' or ','\n lastComma = pos;\n pos += 1;\n skipWhitespace();\n nextStart = pos;\n while(pos < cookiesString.length && notSpecialChar()){\n pos += 1;\n }\n // currently special character\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n // we found cookies separator\n cookiesSeparatorFound = true;\n // pos is inside the next cookie, so back up and return it.\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n // in param ',' or param separator ';',\n // we continue from that comma\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n return cookiesStrings;\n}\n/**\n * Converts a Headers object to a Node.js OutgoingHttpHeaders object. This is\n * required to support the set-cookie header, which may have multiple values.\n *\n * @param headers the headers object to convert\n * @returns the converted headers object\n */ export function toNodeOutgoingHttpHeaders(headers) {\n const nodeHeaders = {};\n const cookies = [];\n if (headers) {\n for (const [key, value] of headers.entries()){\n if (key.toLowerCase() === \"set-cookie\") {\n // We may have gotten a comma joined string of cookies, or multiple\n // set-cookie headers. We need to merge them into one header array\n // to represent all the cookies.\n cookies.push(...splitCookiesString(value));\n nodeHeaders[key] = cookies.length === 1 ? cookies[0] : cookies;\n } else {\n nodeHeaders[key] = value;\n }\n }\n }\n return nodeHeaders;\n}\n/**\n * Validate the correctness of a user-provided URL.\n */ export function validateURL(url) {\n try {\n return String(new URL(String(url)));\n } catch (error) {\n throw new Error(`URL is malformed \"${String(url)}\". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {\n cause: error\n });\n }\n}\n\n//# sourceMappingURL=utils.js.map","/**\n * Removes the trailing slash for a given route or page path. Preserves the\n * root page. Examples:\n * - `/foo/bar/` -> `/foo/bar`\n * - `/foo/bar` -> `/foo/bar`\n * - `/` -> `/`\n */ export function removeTrailingSlash(route) {\n return route.replace(/\\/$/, \"\") || \"/\";\n}\n\n//# sourceMappingURL=remove-trailing-slash.js.map","/**\n * Given a path this function will find the pathname, query and hash and return\n * them. This is useful to parse full paths on the client side.\n * @param path A path to parse e.g. /foo/bar?id=1#hash\n */ export function parsePath(path) {\n const hashIndex = path.indexOf(\"#\");\n const queryIndex = path.indexOf(\"?\");\n const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);\n if (hasQuery || hashIndex > -1) {\n return {\n pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),\n query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined) : \"\",\n hash: hashIndex > -1 ? path.slice(hashIndex) : \"\"\n };\n }\n return {\n pathname: path,\n query: \"\",\n hash: \"\"\n };\n}\n\n//# sourceMappingURL=parse-path.js.map","import { parsePath } from \"./parse-path\";\n/**\n * Adds the provided prefix to the given path. It first ensures that the path\n * is indeed starting with a slash.\n */ export function addPathPrefix(path, prefix) {\n if (!path.startsWith(\"/\") || !prefix) {\n return path;\n }\n const { pathname, query, hash } = parsePath(path);\n return \"\" + prefix + pathname + query + hash;\n}\n\n//# sourceMappingURL=add-path-prefix.js.map","import { parsePath } from \"./parse-path\";\n/**\n * Similarly to `addPathPrefix`, this function adds a suffix at the end on the\n * provided path. It also works only for paths ensuring the argument starts\n * with a slash.\n */ export function addPathSuffix(path, suffix) {\n if (!path.startsWith(\"/\") || !suffix) {\n return path;\n }\n const { pathname, query, hash } = parsePath(path);\n return \"\" + pathname + suffix + query + hash;\n}\n\n//# sourceMappingURL=add-path-suffix.js.map","import { parsePath } from \"./parse-path\";\n/**\n * Checks if a given path starts with a given prefix. It ensures it matches\n * exactly without containing extra chars. e.g. prefix /docs should replace\n * for /docs, /docs/, /docs/a but not /docsss\n * @param path The path to check.\n * @param prefix The prefix to check against.\n */ export function pathHasPrefix(path, prefix) {\n if (typeof path !== \"string\") {\n return false;\n }\n const { pathname } = parsePath(path);\n return pathname === prefix || pathname.startsWith(prefix + \"/\");\n}\n\n//# sourceMappingURL=path-has-prefix.js.map","/**\n * Takes an object with a hostname property (like a parsed URL) and some\n * headers that may contain Host and returns the preferred hostname.\n * @param parsed An object containing a hostname property.\n * @param headers A dictionary with headers containing a `host`.\n */ export function getHostname(parsed, headers) {\n // Get the hostname from the headers if it exists, otherwise use the parsed\n // hostname.\n let hostname;\n if ((headers == null ? void 0 : headers.host) && !Array.isArray(headers.host)) {\n hostname = headers.host.toString().split(\":\", 1)[0];\n } else if (parsed.hostname) {\n hostname = parsed.hostname;\n } else return;\n return hostname.toLowerCase();\n}\n\n//# sourceMappingURL=get-hostname.js.map","/**\n * For a pathname that may include a locale from a list of locales, it\n * removes the locale from the pathname returning it alongside with the\n * detected locale.\n *\n * @param pathname A pathname that may include a locale.\n * @param locales A list of locales.\n * @returns The detected locale and pathname without locale\n */ export function normalizeLocalePath(pathname, locales) {\n let detectedLocale;\n // first item will be empty string from splitting at first char\n const pathnameParts = pathname.split(\"/\");\n (locales || []).some((locale)=>{\n if (pathnameParts[1] && pathnameParts[1].toLowerCase() === locale.toLowerCase()) {\n detectedLocale = locale;\n pathnameParts.splice(1, 1);\n pathname = pathnameParts.join(\"/\") || \"/\";\n return true;\n }\n return false;\n });\n return {\n pathname,\n detectedLocale\n };\n}\n\n//# sourceMappingURL=normalize-locale-path.js.map","import { pathHasPrefix } from \"./path-has-prefix\";\n/**\n * Given a path and a prefix it will remove the prefix when it exists in the\n * given path. It ensures it matches exactly without containing extra chars\n * and if the prefix is not there it will be noop.\n *\n * @param path The path to remove the prefix from.\n * @param prefix The prefix to be removed.\n */ export function removePathPrefix(path, prefix) {\n // If the path doesn't start with the prefix we can return it as is. This\n // protects us from situations where the prefix is a substring of the path\n // prefix such as:\n //\n // For prefix: /blog\n //\n // /blog -> true\n // /blog/ -> true\n // /blog/1 -> true\n // /blogging -> false\n // /blogging/ -> false\n // /blogging/1 -> false\n if (!pathHasPrefix(path, prefix)) {\n return path;\n }\n // Remove the prefix from the path via slicing.\n const withoutPrefix = path.slice(prefix.length);\n // If the path without the prefix starts with a `/` we can return it as is.\n if (withoutPrefix.startsWith(\"/\")) {\n return withoutPrefix;\n }\n // If the path without the prefix doesn't start with a `/` we need to add it\n // back to the path to make sure it's a valid path.\n return \"/\" + withoutPrefix;\n}\n\n//# sourceMappingURL=remove-path-prefix.js.map","import { normalizeLocalePath } from \"../../i18n/normalize-locale-path\";\nimport { removePathPrefix } from \"./remove-path-prefix\";\nimport { pathHasPrefix } from \"./path-has-prefix\";\nexport function getNextPathnameInfo(pathname, options) {\n var _options_nextConfig;\n const { basePath, i18n, trailingSlash } = (_options_nextConfig = options.nextConfig) != null ? _options_nextConfig : {};\n const info = {\n pathname,\n trailingSlash: pathname !== \"/\" ? pathname.endsWith(\"/\") : trailingSlash\n };\n if (basePath && pathHasPrefix(info.pathname, basePath)) {\n info.pathname = removePathPrefix(info.pathname, basePath);\n info.basePath = basePath;\n }\n let pathnameNoDataPrefix = info.pathname;\n if (info.pathname.startsWith(\"/_next/data/\") && info.pathname.endsWith(\".json\")) {\n const paths = info.pathname.replace(/^\\/_next\\/data\\//, \"\").replace(/\\.json$/, \"\").split(\"/\");\n const buildId = paths[0];\n info.buildId = buildId;\n pathnameNoDataPrefix = paths[1] !== \"index\" ? \"/\" + paths.slice(1).join(\"/\") : \"/\";\n // update pathname with normalized if enabled although\n // we use normalized to populate locale info still\n if (options.parseData === true) {\n info.pathname = pathnameNoDataPrefix;\n }\n }\n // If provided, use the locale route normalizer to detect the locale instead\n // of the function below.\n if (i18n) {\n let result = options.i18nProvider ? options.i18nProvider.analyze(info.pathname) : normalizeLocalePath(info.pathname, i18n.locales);\n info.locale = result.detectedLocale;\n var _result_pathname;\n info.pathname = (_result_pathname = result.pathname) != null ? _result_pathname : info.pathname;\n if (!result.detectedLocale && info.buildId) {\n result = options.i18nProvider ? options.i18nProvider.analyze(pathnameNoDataPrefix) : normalizeLocalePath(pathnameNoDataPrefix, i18n.locales);\n if (result.detectedLocale) {\n info.locale = result.detectedLocale;\n }\n }\n }\n return info;\n}\n\n//# sourceMappingURL=get-next-pathname-info.js.map","import { detectDomainLocale } from \"../../shared/lib/i18n/detect-domain-locale\";\nimport { formatNextPathnameInfo } from \"../../shared/lib/router/utils/format-next-pathname-info\";\nimport { getHostname } from \"../../shared/lib/get-hostname\";\nimport { getNextPathnameInfo } from \"../../shared/lib/router/utils/get-next-pathname-info\";\nconst REGEX_LOCALHOST_HOSTNAME = /(?!^https?:\\/\\/)(127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\\[::1\\]|localhost)/;\nfunction parseURL(url, base) {\n return new URL(String(url).replace(REGEX_LOCALHOST_HOSTNAME, \"localhost\"), base && String(base).replace(REGEX_LOCALHOST_HOSTNAME, \"localhost\"));\n}\nconst Internal = Symbol(\"NextURLInternal\");\nexport class NextURL {\n constructor(input, baseOrOpts, opts){\n let base;\n let options;\n if (typeof baseOrOpts === \"object\" && \"pathname\" in baseOrOpts || typeof baseOrOpts === \"string\") {\n base = baseOrOpts;\n options = opts || {};\n } else {\n options = opts || baseOrOpts || {};\n }\n this[Internal] = {\n url: parseURL(input, base ?? options.base),\n options: options,\n basePath: \"\"\n };\n this.analyze();\n }\n analyze() {\n var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig, _this_Internal_domainLocale, _this_Internal_options_nextConfig_i18n1, _this_Internal_options_nextConfig1;\n const info = getNextPathnameInfo(this[Internal].url.pathname, {\n nextConfig: this[Internal].options.nextConfig,\n parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,\n i18nProvider: this[Internal].options.i18nProvider\n });\n const hostname = getHostname(this[Internal].url, this[Internal].options.headers);\n this[Internal].domainLocale = this[Internal].options.i18nProvider ? this[Internal].options.i18nProvider.detectDomainLocale(hostname) : detectDomainLocale((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.domains, hostname);\n const defaultLocale = ((_this_Internal_domainLocale = this[Internal].domainLocale) == null ? void 0 : _this_Internal_domainLocale.defaultLocale) || ((_this_Internal_options_nextConfig1 = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n1 = _this_Internal_options_nextConfig1.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n1.defaultLocale);\n this[Internal].url.pathname = info.pathname;\n this[Internal].defaultLocale = defaultLocale;\n this[Internal].basePath = info.basePath ?? \"\";\n this[Internal].buildId = info.buildId;\n this[Internal].locale = info.locale ?? defaultLocale;\n this[Internal].trailingSlash = info.trailingSlash;\n }\n formatPathname() {\n return formatNextPathnameInfo({\n basePath: this[Internal].basePath,\n buildId: this[Internal].buildId,\n defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : undefined,\n locale: this[Internal].locale,\n pathname: this[Internal].url.pathname,\n trailingSlash: this[Internal].trailingSlash\n });\n }\n formatSearch() {\n return this[Internal].url.search;\n }\n get buildId() {\n return this[Internal].buildId;\n }\n set buildId(buildId) {\n this[Internal].buildId = buildId;\n }\n get locale() {\n return this[Internal].locale ?? \"\";\n }\n set locale(locale) {\n var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig;\n if (!this[Internal].locale || !((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.locales.includes(locale))) {\n throw new TypeError(`The NextURL configuration includes no locale \"${locale}\"`);\n }\n this[Internal].locale = locale;\n }\n get defaultLocale() {\n return this[Internal].defaultLocale;\n }\n get domainLocale() {\n return this[Internal].domainLocale;\n }\n get searchParams() {\n return this[Internal].url.searchParams;\n }\n get host() {\n return this[Internal].url.host;\n }\n set host(value) {\n this[Internal].url.host = value;\n }\n get hostname() {\n return this[Internal].url.hostname;\n }\n set hostname(value) {\n this[Internal].url.hostname = value;\n }\n get port() {\n return this[Internal].url.port;\n }\n set port(value) {\n this[Internal].url.port = value;\n }\n get protocol() {\n return this[Internal].url.protocol;\n }\n set protocol(value) {\n this[Internal].url.protocol = value;\n }\n get href() {\n const pathname = this.formatPathname();\n const search = this.formatSearch();\n return `${this.protocol}//${this.host}${pathname}${search}${this.hash}`;\n }\n set href(url) {\n this[Internal].url = parseURL(url);\n this.analyze();\n }\n get origin() {\n return this[Internal].url.origin;\n }\n get pathname() {\n return this[Internal].url.pathname;\n }\n set pathname(value) {\n this[Internal].url.pathname = value;\n }\n get hash() {\n return this[Internal].url.hash;\n }\n set hash(value) {\n this[Internal].url.hash = value;\n }\n get search() {\n return this[Internal].url.search;\n }\n set search(value) {\n this[Internal].url.search = value;\n }\n get password() {\n return this[Internal].url.password;\n }\n set password(value) {\n this[Internal].url.password = value;\n }\n get username() {\n return this[Internal].url.username;\n }\n set username(value) {\n this[Internal].url.username = value;\n }\n get basePath() {\n return this[Internal].basePath;\n }\n set basePath(value) {\n this[Internal].basePath = value.startsWith(\"/\") ? value : `/${value}`;\n }\n toString() {\n return this.href;\n }\n toJSON() {\n return this.href;\n }\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return {\n href: this.href,\n origin: this.origin,\n protocol: this.protocol,\n username: this.username,\n password: this.password,\n host: this.host,\n hostname: this.hostname,\n port: this.port,\n pathname: this.pathname,\n search: this.search,\n searchParams: this.searchParams,\n hash: this.hash\n };\n }\n clone() {\n return new NextURL(String(this), this[Internal].options);\n }\n}\n\n//# sourceMappingURL=next-url.js.map","export function detectDomainLocale(domainItems, hostname, detectedLocale) {\n if (!domainItems) return;\n if (detectedLocale) {\n detectedLocale = detectedLocale.toLowerCase();\n }\n for (const item of domainItems){\n var _item_domain, _item_locales;\n // remove port if present\n const domainHostname = (_item_domain = item.domain) == null ? void 0 : _item_domain.split(\":\", 1)[0].toLowerCase();\n if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((_item_locales = item.locales) == null ? void 0 : _item_locales.some((locale)=>locale.toLowerCase() === detectedLocale))) {\n return item;\n }\n }\n}\n\n//# sourceMappingURL=detect-domain-locale.js.map","import { removeTrailingSlash } from \"./remove-trailing-slash\";\nimport { addPathPrefix } from \"./add-path-prefix\";\nimport { addPathSuffix } from \"./add-path-suffix\";\nimport { addLocale } from \"./add-locale\";\nexport function formatNextPathnameInfo(info) {\n let pathname = addLocale(info.pathname, info.locale, info.buildId ? undefined : info.defaultLocale, info.ignorePrefix);\n if (info.buildId || !info.trailingSlash) {\n pathname = removeTrailingSlash(pathname);\n }\n if (info.buildId) {\n pathname = addPathSuffix(addPathPrefix(pathname, \"/_next/data/\" + info.buildId), info.pathname === \"/\" ? \"index.json\" : \".json\");\n }\n pathname = addPathPrefix(pathname, info.basePath);\n return !info.buildId && info.trailingSlash ? !pathname.endsWith(\"/\") ? addPathSuffix(pathname, \"/\") : pathname : removeTrailingSlash(pathname);\n}\n\n//# sourceMappingURL=format-next-pathname-info.js.map","import { addPathPrefix } from \"./add-path-prefix\";\nimport { pathHasPrefix } from \"./path-has-prefix\";\n/**\n * For a given path and a locale, if the locale is given, it will prefix the\n * locale. The path shouldn't be an API path. If a default locale is given the\n * prefix will be omitted if the locale is already the default locale.\n */ export function addLocale(path, locale, defaultLocale, ignorePrefix) {\n // If no locale was given or the locale is the default locale, we don't need\n // to prefix the path.\n if (!locale || locale === defaultLocale) return path;\n const lower = path.toLowerCase();\n // If the path is an API path or the path already has the locale prefix, we\n // don't need to prefix the path.\n if (!ignorePrefix) {\n if (pathHasPrefix(lower, \"/api\")) return path;\n if (pathHasPrefix(lower, \"/\" + locale.toLowerCase())) return path;\n }\n // Add the locale prefix to the path.\n return addPathPrefix(path, \"/\" + locale);\n}\n\n//# sourceMappingURL=add-locale.js.map","export class PageSignatureError extends Error {\n constructor({ page }){\n super(`The middleware \"${page}\" accepts an async API directly with the form:\n \n export function middleware(request, event) {\n return NextResponse.redirect('/new-location')\n }\n \n Read more: https://nextjs.org/docs/messages/middleware-new-signature\n `);\n }\n}\nexport class RemovedPageError extends Error {\n constructor(){\n super(`The request.page has been deprecated in favour of \\`URLPattern\\`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n `);\n }\n}\nexport class RemovedUAError extends Error {\n constructor(){\n super(`The request.ua has been removed in favour of \\`userAgent\\` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n `);\n }\n}\n\n//# sourceMappingURL=error.js.map","import { NextURL } from \"../next-url\";\nimport { toNodeOutgoingHttpHeaders, validateURL } from \"../utils\";\nimport { RemovedUAError, RemovedPageError } from \"../error\";\nimport { RequestCookies } from \"./cookies\";\nexport const INTERNALS = Symbol(\"internal request\");\n/**\n * This class extends the [Web `Request` API](https://developer.mozilla.org/docs/Web/API/Request) with additional convenience methods.\n *\n * Read more: [Next.js Docs: `NextRequest`](https://nextjs.org/docs/app/api-reference/functions/next-request)\n */ export class NextRequest extends Request {\n constructor(input, init = {}){\n const url = typeof input !== \"string\" && \"url\" in input ? input.url : String(input);\n validateURL(url);\n if (input instanceof Request) super(input, init);\n else super(url, init);\n const nextUrl = new NextURL(url, {\n headers: toNodeOutgoingHttpHeaders(this.headers),\n nextConfig: init.nextConfig\n });\n this[INTERNALS] = {\n cookies: new RequestCookies(this.headers),\n geo: init.geo || {},\n ip: init.ip,\n nextUrl,\n url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? url : nextUrl.toString()\n };\n }\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return {\n cookies: this.cookies,\n geo: this.geo,\n ip: this.ip,\n nextUrl: this.nextUrl,\n url: this.url,\n // rest of props come from Request\n bodyUsed: this.bodyUsed,\n cache: this.cache,\n credentials: this.credentials,\n destination: this.destination,\n headers: Object.fromEntries(this.headers),\n integrity: this.integrity,\n keepalive: this.keepalive,\n method: this.method,\n mode: this.mode,\n redirect: this.redirect,\n referrer: this.referrer,\n referrerPolicy: this.referrerPolicy,\n signal: this.signal\n };\n }\n get cookies() {\n return this[INTERNALS].cookies;\n }\n get geo() {\n return this[INTERNALS].geo;\n }\n get ip() {\n return this[INTERNALS].ip;\n }\n get nextUrl() {\n return this[INTERNALS].nextUrl;\n }\n /**\n * @deprecated\n * `page` has been deprecated in favour of `URLPattern`.\n * Read more: https://nextjs.org/docs/messages/middleware-request-page\n */ get page() {\n throw new RemovedPageError();\n }\n /**\n * @deprecated\n * `ua` has been removed in favour of \\`userAgent\\` function.\n * Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n */ get ua() {\n throw new RemovedUAError();\n }\n get url() {\n return this[INTERNALS].url;\n }\n}\n\n//# sourceMappingURL=request.js.map","import { getRequestMeta } from \"../../../request-meta\";\nimport { fromNodeOutgoingHttpHeaders } from \"../../utils\";\nimport { NextRequest } from \"../request\";\nexport const ResponseAbortedName = \"ResponseAborted\";\nexport class ResponseAborted extends Error {\n constructor(...args){\n super(...args);\n this.name = ResponseAbortedName;\n }\n}\n/**\n * Creates an AbortController tied to the closing of a ServerResponse (or other\n * appropriate Writable).\n *\n * If the `close` event is fired before the `finish` event, then we'll send the\n * `abort` signal.\n */ export function createAbortController(response) {\n const controller = new AbortController();\n // If `finish` fires first, then `res.end()` has been called and the close is\n // just us finishing the stream on our side. If `close` fires first, then we\n // know the client disconnected before we finished.\n response.once(\"close\", ()=>{\n if (response.writableFinished) return;\n controller.abort(new ResponseAborted());\n });\n return controller;\n}\n/**\n * Creates an AbortSignal tied to the closing of a ServerResponse (or other\n * appropriate Writable).\n *\n * This cannot be done with the request (IncomingMessage or Readable) because\n * the `abort` event will not fire if to data has been fully read (because that\n * will \"close\" the readable stream and nothing fires after that).\n */ export function signalFromNodeResponse(response) {\n const { errored, destroyed } = response;\n if (errored || destroyed) {\n return AbortSignal.abort(errored ?? new ResponseAborted());\n }\n const { signal } = createAbortController(response);\n return signal;\n}\nexport class NextRequestAdapter {\n static fromBaseNextRequest(request, signal) {\n // TODO: look at refining this check\n if (\"request\" in request && request.request) {\n return NextRequestAdapter.fromWebNextRequest(request);\n }\n return NextRequestAdapter.fromNodeNextRequest(request, signal);\n }\n static fromNodeNextRequest(request, signal) {\n // HEAD and GET requests can not have a body.\n let body = null;\n if (request.method !== \"GET\" && request.method !== \"HEAD\" && request.body) {\n // @ts-expect-error - this is handled by undici, when streams/web land use it instead\n body = request.body;\n }\n let url;\n if (request.url.startsWith(\"http\")) {\n url = new URL(request.url);\n } else {\n // Grab the full URL from the request metadata.\n const base = getRequestMeta(request, \"initURL\");\n if (!base || !base.startsWith(\"http\")) {\n // Because the URL construction relies on the fact that the URL provided\n // is absolute, we need to provide a base URL. We can't use the request\n // URL because it's relative, so we use a dummy URL instead.\n url = new URL(request.url, \"http://n\");\n } else {\n url = new URL(request.url, base);\n }\n }\n return new NextRequest(url, {\n method: request.method,\n headers: fromNodeOutgoingHttpHeaders(request.headers),\n // @ts-expect-error - see https://github.com/whatwg/fetch/pull/1457\n duplex: \"half\",\n signal,\n // geo\n // ip\n // nextConfig\n // body can not be passed if request was aborted\n // or we get a Request body was disturbed error\n ...signal.aborted ? {} : {\n body\n }\n });\n }\n static fromWebNextRequest(request) {\n // HEAD and GET requests can not have a body.\n let body = null;\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n body = request.body;\n }\n return new NextRequest(request.url, {\n method: request.method,\n headers: fromNodeOutgoingHttpHeaders(request.headers),\n // @ts-expect-error - see https://github.com/whatwg/fetch/pull/1457\n duplex: \"half\",\n signal: request.request.signal,\n // geo\n // ip\n // nextConfig\n // body can not be passed if request was aborted\n // or we get a Request body was disturbed error\n ...request.request.signal.aborted ? {} : {\n body\n }\n });\n }\n}\n\n//# sourceMappingURL=next-request.js.map","/**\n * A `Promise.withResolvers` implementation that exposes the `resolve` and\n * `reject` functions on a `Promise`.\n *\n * @see https://tc39.es/proposal-promise-with-resolvers/\n */ export class DetachedPromise {\n constructor(){\n let resolve;\n let reject;\n // Create the promise and assign the resolvers to the object.\n this.promise = new Promise((res, rej)=>{\n resolve = res;\n reject = rej;\n });\n // We know that resolvers is defined because the Promise constructor runs\n // synchronously.\n this.resolve = resolve;\n this.reject = reject;\n }\n}\n\n//# sourceMappingURL=detached-promise.js.map","// Combined load times for loading client components\nlet clientComponentLoadStart = 0;\nlet clientComponentLoadTimes = 0;\nlet clientComponentLoadCount = 0;\nexport function wrapClientComponentLoader(ComponentMod) {\n if (!(\"performance\" in globalThis)) {\n return ComponentMod.__next_app__;\n }\n return {\n require: (...args)=>{\n if (clientComponentLoadStart === 0) {\n clientComponentLoadStart = performance.now();\n }\n const startTime = performance.now();\n try {\n clientComponentLoadCount += 1;\n return ComponentMod.__next_app__.require(...args);\n } finally{\n clientComponentLoadTimes += performance.now() - startTime;\n }\n },\n loadChunk: (...args)=>{\n const startTime = performance.now();\n try {\n clientComponentLoadCount += 1;\n return ComponentMod.__next_app__.loadChunk(...args);\n } finally{\n clientComponentLoadTimes += performance.now() - startTime;\n }\n }\n };\n}\nexport function getClientComponentLoaderMetrics(options = {}) {\n const metrics = clientComponentLoadStart === 0 ? undefined : {\n clientComponentLoadStart,\n clientComponentLoadTimes,\n clientComponentLoadCount\n };\n if (options.reset) {\n clientComponentLoadStart = 0;\n clientComponentLoadTimes = 0;\n clientComponentLoadCount = 0;\n }\n return metrics;\n}\n\n//# sourceMappingURL=client-component-renderer-logger.js.map","import { ResponseAbortedName, createAbortController } from \"./web/spec-extension/adapters/next-request\";\nimport { DetachedPromise } from \"../lib/detached-promise\";\nimport { getTracer } from \"./lib/trace/tracer\";\nimport { NextNodeServerSpan } from \"./lib/trace/constants\";\nimport { getClientComponentLoaderMetrics } from \"./client-component-renderer-logger\";\nexport function isAbortError(e) {\n return (e == null ? void 0 : e.name) === \"AbortError\" || (e == null ? void 0 : e.name) === ResponseAbortedName;\n}\nfunction createWriterFromResponse(res, waitUntilForEnd) {\n let started = false;\n // Create a promise that will resolve once the response has drained. See\n // https://nodejs.org/api/stream.html#stream_event_drain\n let drained = new DetachedPromise();\n function onDrain() {\n drained.resolve();\n }\n res.on(\"drain\", onDrain);\n // If the finish event fires, it means we shouldn't block and wait for the\n // drain event.\n res.once(\"close\", ()=>{\n res.off(\"drain\", onDrain);\n drained.resolve();\n });\n // Create a promise that will resolve once the response has finished. See\n // https://nodejs.org/api/http.html#event-finish_1\n const finished = new DetachedPromise();\n res.once(\"finish\", ()=>{\n finished.resolve();\n });\n // Create a writable stream that will write to the response.\n return new WritableStream({\n write: async (chunk)=>{\n // You'd think we'd want to use `start` instead of placing this in `write`\n // but this ensures that we don't actually flush the headers until we've\n // started writing chunks.\n if (!started) {\n started = true;\n if (\"performance\" in globalThis && process.env.NEXT_OTEL_PERFORMANCE_PREFIX) {\n const metrics = getClientComponentLoaderMetrics();\n if (metrics) {\n performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`, {\n start: metrics.clientComponentLoadStart,\n end: metrics.clientComponentLoadStart + metrics.clientComponentLoadTimes\n });\n }\n }\n res.flushHeaders();\n getTracer().trace(NextNodeServerSpan.startResponse, {\n spanName: \"start response\"\n }, ()=>undefined);\n }\n try {\n const ok = res.write(chunk);\n // Added by the `compression` middleware, this is a function that will\n // flush the partially-compressed response to the client.\n if (\"flush\" in res && typeof res.flush === \"function\") {\n res.flush();\n }\n // If the write returns false, it means there's some backpressure, so\n // wait until it's streamed before continuing.\n if (!ok) {\n await drained.promise;\n // Reset the drained promise so that we can wait for the next drain event.\n drained = new DetachedPromise();\n }\n } catch (err) {\n res.end();\n throw new Error(\"failed to write chunk to response\", {\n cause: err\n });\n }\n },\n abort: (err)=>{\n if (res.writableFinished) return;\n res.destroy(err);\n },\n close: async ()=>{\n // if a waitUntil promise was passed, wait for it to resolve before\n // ending the response.\n if (waitUntilForEnd) {\n await waitUntilForEnd;\n }\n if (res.writableFinished) return;\n res.end();\n return finished.promise;\n }\n });\n}\nexport async function pipeToNodeResponse(readable, res, waitUntilForEnd) {\n try {\n // If the response has already errored, then just return now.\n const { errored, destroyed } = res;\n if (errored || destroyed) return;\n // Create a new AbortController so that we can abort the readable if the\n // client disconnects.\n const controller = createAbortController(res);\n const writer = createWriterFromResponse(res, waitUntilForEnd);\n await readable.pipeTo(writer, {\n signal: controller.signal\n });\n } catch (err) {\n // If this isn't related to an abort error, re-throw it.\n if (isAbortError(err)) return;\n throw new Error(\"failed to pipe response\", {\n cause: err\n });\n }\n}\n\n//# sourceMappingURL=pipe-readable.js.map","import { chainStreams, streamFromString, streamToString } from \"./stream-utils/node-web-streams-helper\";\nimport { isAbortError, pipeToNodeResponse } from \"./pipe-readable\";\nexport default class RenderResult {\n /**\n * Creates a new RenderResult instance from a static response.\n *\n * @param value the static response value\n * @returns a new RenderResult instance\n */ static fromStatic(value) {\n return new RenderResult(value, {\n metadata: {}\n });\n }\n constructor(response, { contentType, waitUntil, metadata }){\n this.response = response;\n this.contentType = contentType;\n this.metadata = metadata;\n this.waitUntil = waitUntil;\n }\n assignMetadata(metadata) {\n Object.assign(this.metadata, metadata);\n }\n /**\n * Returns true if the response is null. It can be null if the response was\n * not found or was already sent.\n */ get isNull() {\n return this.response === null;\n }\n /**\n * Returns false if the response is a string. It can be a string if the page\n * was prerendered. If it's not, then it was generated dynamically.\n */ get isDynamic() {\n return typeof this.response !== \"string\";\n }\n toUnchunkedString(stream = false) {\n if (this.response === null) {\n throw new Error(\"Invariant: null responses cannot be unchunked\");\n }\n if (typeof this.response !== \"string\") {\n if (!stream) {\n throw new Error(\"Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js\");\n }\n return streamToString(this.readable);\n }\n return this.response;\n }\n /**\n * Returns the response if it is a stream, or throws an error if it is a\n * string.\n */ get readable() {\n if (this.response === null) {\n throw new Error(\"Invariant: null responses cannot be streamed\");\n }\n if (typeof this.response === \"string\") {\n throw new Error(\"Invariant: static responses cannot be streamed\");\n }\n // If the response is an array of streams, then chain them together.\n if (Array.isArray(this.response)) {\n return chainStreams(...this.response);\n }\n return this.response;\n }\n /**\n * Chains a new stream to the response. This will convert the response to an\n * array of streams if it is not already one and will add the new stream to\n * the end. When this response is piped, all of the streams will be piped\n * one after the other.\n *\n * @param readable The new stream to chain\n */ chain(readable) {\n if (this.response === null) {\n throw new Error(\"Invariant: response is null. This is a bug in Next.js\");\n }\n // If the response is not an array of streams already, make it one.\n let responses;\n if (typeof this.response === \"string\") {\n responses = [\n streamFromString(this.response)\n ];\n } else if (Array.isArray(this.response)) {\n responses = this.response;\n } else {\n responses = [\n this.response\n ];\n }\n // Add the new stream to the array.\n responses.push(readable);\n // Update the response.\n this.response = responses;\n }\n /**\n * Pipes the response to a writable stream. This will close/cancel the\n * writable stream if an error is encountered. If this doesn't throw, then\n * the writable stream will be closed or aborted.\n *\n * @param writable Writable stream to pipe the response to\n */ async pipeTo(writable) {\n try {\n await this.readable.pipeTo(writable, {\n // We want to close the writable stream ourselves so that we can wait\n // for the waitUntil promise to resolve before closing it. If an error\n // is encountered, we'll abort the writable stream if we swallowed the\n // error.\n preventClose: true\n });\n // If there is a waitUntil promise, wait for it to resolve before\n // closing the writable stream.\n if (this.waitUntil) await this.waitUntil;\n // Close the writable stream.\n await writable.close();\n } catch (err) {\n // If this is an abort error, we should abort the writable stream (as we\n // took ownership of it when we started piping). We don't need to re-throw\n // because we handled the error.\n if (isAbortError(err)) {\n // Abort the writable stream if an error is encountered.\n await writable.abort(err);\n return;\n }\n // We're not aborting the writer here as when this method throws it's not\n // clear as to how so the caller should assume it's their responsibility\n // to clean up the writer.\n throw err;\n }\n }\n /**\n * Pipes the response to a node response. This will close/cancel the node\n * response if an error is encountered.\n *\n * @param res\n */ async pipeToNodeResponse(res) {\n await pipeToNodeResponse(this.readable, res, this.waitUntil);\n }\n}\n\n//# sourceMappingURL=render-result.js.map","import { isDynamicRoute } from \"../router/utils\";\nimport { normalizePathSep } from \"./normalize-path-sep\";\n/**\n * Performs the opposite transformation of `normalizePagePath`. Note that\n * this function is not idempotent either in cases where there are multiple\n * leading `/index` for the page. Examples:\n * - `/index` -> `/`\n * - `/index/foo` -> `/foo`\n * - `/index/index` -> `/index`\n */ export function denormalizePagePath(page) {\n let _page = normalizePathSep(page);\n return _page.startsWith(\"/index/\") && !isDynamicRoute(_page) ? _page.slice(6) : _page !== \"/index\" ? _page : \"/\";\n}\n\n//# sourceMappingURL=denormalize-page-path.js.map","/**\n * For a given page path, this function ensures that there is no backslash\n * escaping slashes in the path. Example:\n * - `foo\\/bar\\/baz` -> `foo/bar/baz`\n */ export function normalizePathSep(path) {\n return path.replace(/\\\\/g, \"/\");\n}\n\n//# sourceMappingURL=normalize-path-sep.js.map","import { pathToRegexp } from \"next/dist/compiled/path-to-regexp\";\nimport { regexpToFunction } from \"next/dist/compiled/path-to-regexp\";\n/**\n * Generates a path matcher function for a given path and options based on\n * path-to-regexp. By default the match will be case insensitive, non strict\n * and delimited by `/`.\n */ export function getPathMatch(path, options) {\n const keys = [];\n const regexp = pathToRegexp(path, keys, {\n delimiter: \"/\",\n sensitive: typeof (options == null ? void 0 : options.sensitive) === \"boolean\" ? options.sensitive : false,\n strict: options == null ? void 0 : options.strict\n });\n const matcher = regexpToFunction((options == null ? void 0 : options.regexModifier) ? new RegExp(options.regexModifier(regexp.source), regexp.flags) : regexp, keys);\n /**\n * A matcher function that will check if a given pathname matches the path\n * given in the builder function. When the path does not match it will return\n * `false` but if it does it will return an object with the matched params\n * merged with the params provided in the second argument.\n */ return (pathname, params)=>{\n // If no pathname is provided it's not a match.\n if (typeof pathname !== \"string\") return false;\n const match = matcher(pathname);\n // If the path did not match `false` will be returned.\n if (!match) return false;\n /**\n * If unnamed params are not allowed they must be removed from\n * the matched parameters. path-to-regexp uses \"string\" for named and\n * \"number\" for unnamed parameters.\n */ if (options == null ? void 0 : options.removeUnnamedParams) {\n for (const key of keys){\n if (typeof key.name === \"number\") {\n delete match.params[key.name];\n }\n }\n }\n return {\n ...params,\n ...match.params\n };\n };\n}\n\n//# sourceMappingURL=path-match.js.map","// regexp is based on https://github.com/sindresorhus/escape-string-regexp\nconst reHasRegExp = /[|\\\\{}()[\\]^$+*?.-]/;\nconst reReplaceRegExp = /[|\\\\{}()[\\]^$+*?.-]/g;\nexport function escapeStringRegexp(str) {\n // see also: https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/escapeRegExp.js#L23\n if (reHasRegExp.test(str)) {\n return str.replace(reReplaceRegExp, \"\\\\$&\");\n }\n return str;\n}\n\n//# sourceMappingURL=escape-regexp.js.map","import { INTERCEPTION_ROUTE_MARKERS } from \"../../../../server/future/helpers/interception-routes\";\nimport { escapeStringRegexp } from \"../../escape-regexp\";\nimport { removeTrailingSlash } from \"./remove-trailing-slash\";\nconst NEXT_QUERY_PARAM_PREFIX = \"nxtP\";\nconst NEXT_INTERCEPTION_MARKER_PREFIX = \"nxtI\";\n/**\n * Parses a given parameter from a route to a data structure that can be used\n * to generate the parametrized route. Examples:\n * - `[...slug]` -> `{ key: 'slug', repeat: true, optional: true }`\n * - `...slug` -> `{ key: 'slug', repeat: true, optional: false }`\n * - `[foo]` -> `{ key: 'foo', repeat: false, optional: true }`\n * - `bar` -> `{ key: 'bar', repeat: false, optional: false }`\n */ export function parseParameter(param) {\n const optional = param.startsWith(\"[\") && param.endsWith(\"]\");\n if (optional) {\n param = param.slice(1, -1);\n }\n const repeat = param.startsWith(\"...\");\n if (repeat) {\n param = param.slice(3);\n }\n return {\n key: param,\n repeat,\n optional\n };\n}\nfunction getParametrizedRoute(route) {\n const segments = removeTrailingSlash(route).slice(1).split(\"/\");\n const groups = {};\n let groupIndex = 1;\n return {\n parameterizedRoute: segments.map((segment)=>{\n const markerMatch = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));\n const paramMatches = segment.match(/\\[((?:\\[.*\\])|.+)\\]/) // Check for parameters\n ;\n if (markerMatch && paramMatches) {\n const { key, optional, repeat } = parseParameter(paramMatches[1]);\n groups[key] = {\n pos: groupIndex++,\n repeat,\n optional\n };\n return \"/\" + escapeStringRegexp(markerMatch) + \"([^/]+?)\";\n } else if (paramMatches) {\n const { key, repeat, optional } = parseParameter(paramMatches[1]);\n groups[key] = {\n pos: groupIndex++,\n repeat,\n optional\n };\n return repeat ? optional ? \"(?:/(.+?))?\" : \"/(.+?)\" : \"/([^/]+?)\";\n } else {\n return \"/\" + escapeStringRegexp(segment);\n }\n }).join(\"\"),\n groups\n };\n}\n/**\n * From a normalized route this function generates a regular expression and\n * a corresponding groups object intended to be used to store matching groups\n * from the regular expression.\n */ export function getRouteRegex(normalizedRoute) {\n const { parameterizedRoute, groups } = getParametrizedRoute(normalizedRoute);\n return {\n re: new RegExp(\"^\" + parameterizedRoute + \"(?:/)?$\"),\n groups: groups\n };\n}\n/**\n * Builds a function to generate a minimal routeKey using only a-z and minimal\n * number of characters.\n */ function buildGetSafeRouteKey() {\n let i = 0;\n return ()=>{\n let routeKey = \"\";\n let j = ++i;\n while(j > 0){\n routeKey += String.fromCharCode(97 + (j - 1) % 26);\n j = Math.floor((j - 1) / 26);\n }\n return routeKey;\n };\n}\nfunction getSafeKeyFromSegment(param) {\n let { interceptionMarker, getSafeRouteKey, segment, routeKeys, keyPrefix } = param;\n const { key, optional, repeat } = parseParameter(segment);\n // replace any non-word characters since they can break\n // the named regex\n let cleanedKey = key.replace(/\\W/g, \"\");\n if (keyPrefix) {\n cleanedKey = \"\" + keyPrefix + cleanedKey;\n }\n let invalidKey = false;\n // check if the key is still invalid and fallback to using a known\n // safe key\n if (cleanedKey.length === 0 || cleanedKey.length > 30) {\n invalidKey = true;\n }\n if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {\n invalidKey = true;\n }\n if (invalidKey) {\n cleanedKey = getSafeRouteKey();\n }\n if (keyPrefix) {\n routeKeys[cleanedKey] = \"\" + keyPrefix + key;\n } else {\n routeKeys[cleanedKey] = key;\n }\n // if the segment has an interception marker, make sure that's part of the regex pattern\n // this is to ensure that the route with the interception marker doesn't incorrectly match\n // the non-intercepted route (ie /app/(.)[username] should not match /app/[username])\n const interceptionPrefix = interceptionMarker ? escapeStringRegexp(interceptionMarker) : \"\";\n return repeat ? optional ? \"(?:/\" + interceptionPrefix + \"(?<\" + cleanedKey + \">.+?))?\" : \"/\" + interceptionPrefix + \"(?<\" + cleanedKey + \">.+?)\" : \"/\" + interceptionPrefix + \"(?<\" + cleanedKey + \">[^/]+?)\";\n}\nfunction getNamedParametrizedRoute(route, prefixRouteKeys) {\n const segments = removeTrailingSlash(route).slice(1).split(\"/\");\n const getSafeRouteKey = buildGetSafeRouteKey();\n const routeKeys = {};\n return {\n namedParameterizedRoute: segments.map((segment)=>{\n const hasInterceptionMarker = INTERCEPTION_ROUTE_MARKERS.some((m)=>segment.startsWith(m));\n const paramMatches = segment.match(/\\[((?:\\[.*\\])|.+)\\]/) // Check for parameters\n ;\n if (hasInterceptionMarker && paramMatches) {\n const [usedMarker] = segment.split(paramMatches[0]);\n return getSafeKeyFromSegment({\n getSafeRouteKey,\n interceptionMarker: usedMarker,\n segment: paramMatches[1],\n routeKeys,\n keyPrefix: prefixRouteKeys ? NEXT_INTERCEPTION_MARKER_PREFIX : undefined\n });\n } else if (paramMatches) {\n return getSafeKeyFromSegment({\n getSafeRouteKey,\n segment: paramMatches[1],\n routeKeys,\n keyPrefix: prefixRouteKeys ? NEXT_QUERY_PARAM_PREFIX : undefined\n });\n } else {\n return \"/\" + escapeStringRegexp(segment);\n }\n }).join(\"\"),\n routeKeys\n };\n}\n/**\n * This function extends `getRouteRegex` generating also a named regexp where\n * each group is named along with a routeKeys object that indexes the assigned\n * named group with its corresponding key. When the routeKeys need to be\n * prefixed to uniquely identify internally the \"prefixRouteKey\" arg should\n * be \"true\" currently this is only the case when creating the routes-manifest\n * during the build\n */ export function getNamedRouteRegex(normalizedRoute, prefixRouteKey) {\n const result = getNamedParametrizedRoute(normalizedRoute, prefixRouteKey);\n return {\n ...getRouteRegex(normalizedRoute),\n namedRegex: \"^\" + result.namedParameterizedRoute + \"(?:/)?$\",\n routeKeys: result.routeKeys\n };\n}\n/**\n * Generates a named regexp.\n * This is intended to be using for build time only.\n */ export function getNamedMiddlewareRegex(normalizedRoute, options) {\n const { parameterizedRoute } = getParametrizedRoute(normalizedRoute);\n const { catchAll = true } = options;\n if (parameterizedRoute === \"/\") {\n let catchAllRegex = catchAll ? \".*\" : \"\";\n return {\n namedRegex: \"^/\" + catchAllRegex + \"$\"\n };\n }\n const { namedParameterizedRoute } = getNamedParametrizedRoute(normalizedRoute, false);\n let catchAllGroupedRegex = catchAll ? \"(?:(/.*)?)\" : \"\";\n return {\n namedRegex: \"^\" + namedParameterizedRoute + catchAllGroupedRegex + \"$\"\n };\n}\n\n//# sourceMappingURL=route-regex.js.map","import { compile, pathToRegexp } from \"next/dist/compiled/path-to-regexp\";\nimport { escapeStringRegexp } from \"../../escape-regexp\";\nimport { parseUrl } from \"./parse-url\";\nimport { INTERCEPTION_ROUTE_MARKERS, isInterceptionRouteAppPath } from \"../../../../server/future/helpers/interception-routes\";\nimport { NEXT_RSC_UNION_QUERY } from \"../../../../client/components/app-router-headers\";\nimport { getCookieParser } from \"../../../../server/api-utils/get-cookie-parser\";\n/**\n * Ensure only a-zA-Z are used for param names for proper interpolating\n * with path-to-regexp\n */ function getSafeParamName(paramName) {\n let newParamName = \"\";\n for(let i = 0; i < paramName.length; i++){\n const charCode = paramName.charCodeAt(i);\n if (charCode > 64 && charCode < 91 || // A-Z\n charCode > 96 && charCode < 123 // a-z\n ) {\n newParamName += paramName[i];\n }\n }\n return newParamName;\n}\nfunction escapeSegment(str, segmentName) {\n return str.replace(new RegExp(\":\" + escapeStringRegexp(segmentName), \"g\"), \"__ESC_COLON_\" + segmentName);\n}\nfunction unescapeSegments(str) {\n return str.replace(/__ESC_COLON_/gi, \":\");\n}\nexport function matchHas(req, query, has, missing) {\n if (has === void 0) has = [];\n if (missing === void 0) missing = [];\n const params = {};\n const hasMatch = (hasItem)=>{\n let value;\n let key = hasItem.key;\n switch(hasItem.type){\n case \"header\":\n {\n key = key.toLowerCase();\n value = req.headers[key];\n break;\n }\n case \"cookie\":\n {\n if (\"cookies\" in req) {\n value = req.cookies[hasItem.key];\n } else {\n const cookies = getCookieParser(req.headers)();\n value = cookies[hasItem.key];\n }\n break;\n }\n case \"query\":\n {\n value = query[key];\n break;\n }\n case \"host\":\n {\n const { host } = (req == null ? void 0 : req.headers) || {};\n // remove port from host if present\n const hostname = host == null ? void 0 : host.split(\":\", 1)[0].toLowerCase();\n value = hostname;\n break;\n }\n default:\n {\n break;\n }\n }\n if (!hasItem.value && value) {\n params[getSafeParamName(key)] = value;\n return true;\n } else if (value) {\n const matcher = new RegExp(\"^\" + hasItem.value + \"$\");\n const matches = Array.isArray(value) ? value.slice(-1)[0].match(matcher) : value.match(matcher);\n if (matches) {\n if (Array.isArray(matches)) {\n if (matches.groups) {\n Object.keys(matches.groups).forEach((groupKey)=>{\n params[groupKey] = matches.groups[groupKey];\n });\n } else if (hasItem.type === \"host\" && matches[0]) {\n params.host = matches[0];\n }\n }\n return true;\n }\n }\n return false;\n };\n const allMatch = has.every((item)=>hasMatch(item)) && !missing.some((item)=>hasMatch(item));\n if (allMatch) {\n return params;\n }\n return false;\n}\nexport function compileNonPath(value, params) {\n if (!value.includes(\":\")) {\n return value;\n }\n for (const key of Object.keys(params)){\n if (value.includes(\":\" + key)) {\n value = value.replace(new RegExp(\":\" + key + \"\\\\*\", \"g\"), \":\" + key + \"--ESCAPED_PARAM_ASTERISKS\").replace(new RegExp(\":\" + key + \"\\\\?\", \"g\"), \":\" + key + \"--ESCAPED_PARAM_QUESTION\").replace(new RegExp(\":\" + key + \"\\\\+\", \"g\"), \":\" + key + \"--ESCAPED_PARAM_PLUS\").replace(new RegExp(\":\" + key + \"(?!\\\\w)\", \"g\"), \"--ESCAPED_PARAM_COLON\" + key);\n }\n }\n value = value.replace(/(:|\\*|\\?|\\+|\\(|\\)|\\{|\\})/g, \"\\\\$1\").replace(/--ESCAPED_PARAM_PLUS/g, \"+\").replace(/--ESCAPED_PARAM_COLON/g, \":\").replace(/--ESCAPED_PARAM_QUESTION/g, \"?\").replace(/--ESCAPED_PARAM_ASTERISKS/g, \"*\");\n // the value needs to start with a forward-slash to be compiled\n // correctly\n return compile(\"/\" + value, {\n validate: false\n })(params).slice(1);\n}\nexport function prepareDestination(args) {\n const query = Object.assign({}, args.query);\n delete query.__nextLocale;\n delete query.__nextDefaultLocale;\n delete query.__nextDataReq;\n delete query.__nextInferredLocaleFromDefault;\n delete query[NEXT_RSC_UNION_QUERY];\n let escapedDestination = args.destination;\n for (const param of Object.keys({\n ...args.params,\n ...query\n })){\n escapedDestination = escapeSegment(escapedDestination, param);\n }\n const parsedDestination = parseUrl(escapedDestination);\n const destQuery = parsedDestination.query;\n const destPath = unescapeSegments(\"\" + parsedDestination.pathname + (parsedDestination.hash || \"\"));\n const destHostname = unescapeSegments(parsedDestination.hostname || \"\");\n const destPathParamKeys = [];\n const destHostnameParamKeys = [];\n pathToRegexp(destPath, destPathParamKeys);\n pathToRegexp(destHostname, destHostnameParamKeys);\n const destParams = [];\n destPathParamKeys.forEach((key)=>destParams.push(key.name));\n destHostnameParamKeys.forEach((key)=>destParams.push(key.name));\n const destPathCompiler = compile(destPath, // we don't validate while compiling the destination since we should\n // have already validated before we got to this point and validating\n // breaks compiling destinations with named pattern params from the source\n // e.g. /something:hello(.*) -> /another/:hello is broken with validation\n // since compile validation is meant for reversing and not for inserting\n // params from a separate path-regex into another\n {\n validate: false\n });\n const destHostnameCompiler = compile(destHostname, {\n validate: false\n });\n // update any params in query values\n for (const [key, strOrArray] of Object.entries(destQuery)){\n // the value needs to start with a forward-slash to be compiled\n // correctly\n if (Array.isArray(strOrArray)) {\n destQuery[key] = strOrArray.map((value)=>compileNonPath(unescapeSegments(value), args.params));\n } else if (typeof strOrArray === \"string\") {\n destQuery[key] = compileNonPath(unescapeSegments(strOrArray), args.params);\n }\n }\n // add path params to query if it's not a redirect and not\n // already defined in destination query or path\n let paramKeys = Object.keys(args.params).filter((name)=>name !== \"nextInternalLocale\");\n if (args.appendParamsToQuery && !paramKeys.some((key)=>destParams.includes(key))) {\n for (const key of paramKeys){\n if (!(key in destQuery)) {\n destQuery[key] = args.params[key];\n }\n }\n }\n let newUrl;\n // The compiler also that the interception route marker is an unnamed param, hence '0',\n // so we need to add it to the params object.\n if (isInterceptionRouteAppPath(destPath)) {\n for (const segment of destPath.split(\"/\")){\n const marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));\n if (marker) {\n args.params[\"0\"] = marker;\n break;\n }\n }\n }\n try {\n newUrl = destPathCompiler(args.params);\n const [pathname, hash] = newUrl.split(\"#\", 2);\n parsedDestination.hostname = destHostnameCompiler(args.params);\n parsedDestination.pathname = pathname;\n parsedDestination.hash = \"\" + (hash ? \"#\" : \"\") + (hash || \"\");\n delete parsedDestination.search;\n } catch (err) {\n if (err.message.match(/Expected .*? to not repeat, but got an array/)) {\n throw new Error(\"To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match\");\n }\n throw err;\n }\n // Query merge order lowest priority to highest\n // 1. initial URL query values\n // 2. path segment values\n // 3. destination specified query values\n parsedDestination.query = {\n ...query,\n ...parsedDestination.query\n };\n return {\n newUrl,\n destQuery,\n parsedDestination\n };\n}\n\n//# sourceMappingURL=prepare-destination.js.map","import { isPlainObject } from \"../shared/lib/is-plain-object\";\nexport default function isError(err) {\n return typeof err === \"object\" && err !== null && \"name\" in err && \"message\" in err;\n}\nexport function getProperError(err) {\n if (isError(err)) {\n return err;\n }\n if (process.env.NODE_ENV === \"development\") {\n // provide better error for case where `throw undefined`\n // is called in development\n if (typeof err === \"undefined\") {\n return new Error(\"An undefined error was thrown, \" + \"see here for more info: https://nextjs.org/docs/messages/threw-undefined\");\n }\n if (err === null) {\n return new Error(\"A null error was thrown, \" + \"see here for more info: https://nextjs.org/docs/messages/threw-undefined\");\n }\n }\n return new Error(isPlainObject(err) ? JSON.stringify(err) : err + \"\");\n}\n\n//# sourceMappingURL=is-error.js.map","export function getObjectClassLabel(value) {\n return Object.prototype.toString.call(value);\n}\nexport function isPlainObject(value) {\n if (getObjectClassLabel(value) !== \"[object Object]\") {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n /**\n * this used to be previously:\n *\n * `return prototype === null || prototype === Object.prototype`\n *\n * but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.\n *\n * It was changed to the current implementation since it's resilient to serialization.\n */ return prototype === null || prototype.hasOwnProperty(\"isPrototypeOf\");\n}\n\n//# sourceMappingURL=is-plain-object.js.map","/**\n * Normalizes the pathname by removing the locale prefix if any.\n */ export class LocaleRouteNormalizer {\n constructor(provider){\n this.provider = provider;\n }\n /**\n * Normalizes the pathname by removing the locale prefix if any.\n *\n * @param pathname The pathname to normalize.\n * @returns The pathname without the locale prefix (if any).\n */ normalize(pathname) {\n const match = this.provider.analyze(pathname);\n return match.pathname;\n }\n}\n\n//# sourceMappingURL=locale-route-normalizer.js.map","class UrlNode {\n insert(urlPath) {\n this._insert(urlPath.split(\"/\").filter(Boolean), [], false);\n }\n smoosh() {\n return this._smoosh();\n }\n _smoosh(prefix) {\n if (prefix === void 0) prefix = \"/\";\n const childrenPaths = [\n ...this.children.keys()\n ].sort();\n if (this.slugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf(\"[]\"), 1);\n }\n if (this.restSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf(\"[...]\"), 1);\n }\n if (this.optionalRestSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf(\"[[...]]\"), 1);\n }\n const routes = childrenPaths.map((c)=>this.children.get(c)._smoosh(\"\" + prefix + c + \"/\")).reduce((prev, curr)=>[\n ...prev,\n ...curr\n ], []);\n if (this.slugName !== null) {\n routes.push(...this.children.get(\"[]\")._smoosh(prefix + \"[\" + this.slugName + \"]/\"));\n }\n if (!this.placeholder) {\n const r = prefix === \"/\" ? \"/\" : prefix.slice(0, -1);\n if (this.optionalRestSlugName != null) {\n throw new Error('You cannot define a route with the same specificity as a optional catch-all route (\"' + r + '\" and \"' + r + \"[[...\" + this.optionalRestSlugName + ']]\").');\n }\n routes.unshift(r);\n }\n if (this.restSlugName !== null) {\n routes.push(...this.children.get(\"[...]\")._smoosh(prefix + \"[...\" + this.restSlugName + \"]/\"));\n }\n if (this.optionalRestSlugName !== null) {\n routes.push(...this.children.get(\"[[...]]\")._smoosh(prefix + \"[[...\" + this.optionalRestSlugName + \"]]/\"));\n }\n return routes;\n }\n _insert(urlPaths, slugNames, isCatchAll) {\n if (urlPaths.length === 0) {\n this.placeholder = false;\n return;\n }\n if (isCatchAll) {\n throw new Error(\"Catch-all must be the last part of the URL.\");\n }\n // The next segment in the urlPaths list\n let nextSegment = urlPaths[0];\n // Check if the segment matches `[something]`\n if (nextSegment.startsWith(\"[\") && nextSegment.endsWith(\"]\")) {\n // Strip `[` and `]`, leaving only `something`\n let segmentName = nextSegment.slice(1, -1);\n let isOptional = false;\n if (segmentName.startsWith(\"[\") && segmentName.endsWith(\"]\")) {\n // Strip optional `[` and `]`, leaving only `something`\n segmentName = segmentName.slice(1, -1);\n isOptional = true;\n }\n if (segmentName.startsWith(\"...\")) {\n // Strip `...`, leaving only `something`\n segmentName = segmentName.substring(3);\n isCatchAll = true;\n }\n if (segmentName.startsWith(\"[\") || segmentName.endsWith(\"]\")) {\n throw new Error(\"Segment names may not start or end with extra brackets ('\" + segmentName + \"').\");\n }\n if (segmentName.startsWith(\".\")) {\n throw new Error(\"Segment names may not start with erroneous periods ('\" + segmentName + \"').\");\n }\n function handleSlug(previousSlug, nextSlug) {\n if (previousSlug !== null) {\n // If the specific segment already has a slug but the slug is not `something`\n // This prevents collisions like:\n // pages/[post]/index.js\n // pages/[id]/index.js\n // Because currently multiple dynamic params on the same segment level are not supported\n if (previousSlug !== nextSlug) {\n // TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.\n throw new Error(\"You cannot use different slug names for the same dynamic path ('\" + previousSlug + \"' !== '\" + nextSlug + \"').\");\n }\n }\n slugNames.forEach((slug)=>{\n if (slug === nextSlug) {\n throw new Error('You cannot have the same slug name \"' + nextSlug + '\" repeat within a single dynamic path');\n }\n if (slug.replace(/\\W/g, \"\") === nextSegment.replace(/\\W/g, \"\")) {\n throw new Error('You cannot have the slug names \"' + slug + '\" and \"' + nextSlug + '\" differ only by non-word symbols within a single dynamic path');\n }\n });\n slugNames.push(nextSlug);\n }\n if (isCatchAll) {\n if (isOptional) {\n if (this.restSlugName != null) {\n throw new Error('You cannot use both an required and optional catch-all route at the same level (\"[...' + this.restSlugName + ']\" and \"' + urlPaths[0] + '\" ).');\n }\n handleSlug(this.optionalRestSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.optionalRestSlugName = segmentName;\n // nextSegment is overwritten to [[...]] so that it can later be sorted specifically\n nextSegment = \"[[...]]\";\n } else {\n if (this.optionalRestSlugName != null) {\n throw new Error('You cannot use both an optional and required catch-all route at the same level (\"[[...' + this.optionalRestSlugName + ']]\" and \"' + urlPaths[0] + '\").');\n }\n handleSlug(this.restSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.restSlugName = segmentName;\n // nextSegment is overwritten to [...] so that it can later be sorted specifically\n nextSegment = \"[...]\";\n }\n } else {\n if (isOptional) {\n throw new Error('Optional route parameters are not yet supported (\"' + urlPaths[0] + '\").');\n }\n handleSlug(this.slugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.slugName = segmentName;\n // nextSegment is overwritten to [] so that it can later be sorted specifically\n nextSegment = \"[]\";\n }\n }\n // If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode\n if (!this.children.has(nextSegment)) {\n this.children.set(nextSegment, new UrlNode());\n }\n this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);\n }\n constructor(){\n this.placeholder = true;\n this.children = new Map();\n this.slugName = null;\n this.restSlugName = null;\n this.optionalRestSlugName = null;\n }\n}\nexport function getSortedRoutes(normalizedPages) {\n // First the UrlNode is created, and every UrlNode can have only 1 dynamic segment\n // Eg you can't have pages/[post]/abc.js and pages/[hello]/something-else.js\n // Only 1 dynamic segment per nesting level\n // So in the case that is test/integration/dynamic-routing it'll be this:\n // pages/[post]/comments.js\n // pages/blog/[post]/comment/[id].js\n // Both are fine because `pages/[post]` and `pages/blog` are on the same level\n // So in this case `UrlNode` created here has `this.slugName === 'post'`\n // And since your PR passed through `slugName` as an array basically it'd including it in too many possibilities\n // Instead what has to be passed through is the upwards path's dynamic names\n const root = new UrlNode();\n // Here the `root` gets injected multiple paths, and insert will break them up into sublevels\n normalizedPages.forEach((pagePath)=>root.insert(pagePath));\n // Smoosh will then sort those sublevels up to the point where you get the correct route definition priority\n return root.smoosh();\n}\n\n//# sourceMappingURL=sorted-routes.js.map","import { isDynamicRoute } from \"../../../shared/lib/router/utils\";\nimport { getRouteMatcher } from \"../../../shared/lib/router/utils/route-matcher\";\nimport { getRouteRegex } from \"../../../shared/lib/router/utils/route-regex\";\nexport class RouteMatcher {\n constructor(definition){\n this.definition = definition;\n if (isDynamicRoute(definition.pathname)) {\n this.dynamic = getRouteMatcher(getRouteRegex(definition.pathname));\n }\n }\n /**\n * Identity returns the identity part of the matcher. This is used to compare\n * a unique matcher to another. This is also used when sorting dynamic routes,\n * so it must contain the pathname part.\n */ get identity() {\n return this.definition.pathname;\n }\n get isDynamic() {\n return this.dynamic !== undefined;\n }\n match(pathname) {\n const result = this.test(pathname);\n if (!result) return null;\n return {\n definition: this.definition,\n params: result.params\n };\n }\n test(pathname) {\n if (this.dynamic) {\n const params = this.dynamic(pathname);\n if (!params) return null;\n return {\n params\n };\n }\n if (pathname === this.definition.pathname) {\n return {};\n }\n return null;\n }\n}\n\n//# sourceMappingURL=route-matcher.js.map","import { RouteMatcher } from \"./route-matcher\";\nexport class LocaleRouteMatcher extends RouteMatcher {\n /**\n * Identity returns the identity part of the matcher. This is used to compare\n * a unique matcher to another. This is also used when sorting dynamic routes,\n * so it must contain the pathname part as well.\n */ get identity() {\n var _this_definition_i18n;\n return `${this.definition.pathname}?__nextLocale=${(_this_definition_i18n = this.definition.i18n) == null ? void 0 : _this_definition_i18n.locale}`;\n }\n /**\n * Match will attempt to match the given pathname against this route while\n * also taking into account the locale information.\n *\n * @param pathname The pathname to match against.\n * @param options The options to use when matching.\n * @returns The match result, or `null` if there was no match.\n */ match(pathname, options) {\n var // If the options have a detected locale, then use that, otherwise use\n // the route's locale.\n _options_i18n, _this_definition_i18n;\n // This is like the parent `match` method but instead this injects the\n // additional `options` into the\n const result = this.test(pathname, options);\n if (!result) return null;\n return {\n definition: this.definition,\n params: result.params,\n detectedLocale: (options == null ? void 0 : (_options_i18n = options.i18n) == null ? void 0 : _options_i18n.detectedLocale) ?? ((_this_definition_i18n = this.definition.i18n) == null ? void 0 : _this_definition_i18n.locale)\n };\n }\n /**\n * Test will attempt to match the given pathname against this route while\n * also taking into account the locale information.\n *\n * @param pathname The pathname to match against.\n * @param options The options to use when matching.\n * @returns The match result, or `null` if there was no match.\n */ test(pathname, options) {\n // If this route has locale information and we have detected a locale, then\n // we need to compare the detected locale to the route's locale.\n if (this.definition.i18n && (options == null ? void 0 : options.i18n)) {\n // If we have detected a locale and it does not match this route's locale,\n // then this isn't a match!\n if (this.definition.i18n.locale && options.i18n.detectedLocale && this.definition.i18n.locale !== options.i18n.detectedLocale) {\n return null;\n }\n // Perform regular matching against the locale stripped pathname now, the\n // locale information matches!\n return super.test(options.i18n.pathname);\n }\n // If we don't have locale information, then we can just perform regular\n // matching.\n return super.test(pathname);\n }\n}\n\n//# sourceMappingURL=locale-route-matcher.js.map","import { isDynamicRoute } from \"../../../shared/lib/router/utils\";\nimport { getSortedRoutes } from \"../../../shared/lib/router/utils\";\nimport { LocaleRouteMatcher } from \"../route-matchers/locale-route-matcher\";\nimport { ensureLeadingSlash } from \"../../../shared/lib/page-path/ensure-leading-slash\";\nimport { DetachedPromise } from \"../../../lib/detached-promise\";\nexport class DefaultRouteMatcherManager {\n /**\n * When this value changes, it indicates that a change has been introduced\n * that requires recompilation.\n */ get compilationID() {\n return this.providers.length;\n }\n async waitTillReady() {\n if (this.waitTillReadyPromise) {\n await this.waitTillReadyPromise;\n delete this.waitTillReadyPromise;\n }\n }\n async reload() {\n const { promise, resolve, reject } = new DetachedPromise();\n this.waitTillReadyPromise = promise;\n // Grab the compilation ID for this run, we'll verify it at the end to\n // ensure that if any routes were added before reloading is finished that\n // we error out.\n const compilationID = this.compilationID;\n try {\n // Collect all the matchers from each provider.\n const matchers = [];\n // Get all the providers matchers.\n const providersMatchers = await Promise.all(this.providers.map((provider)=>provider.matchers()));\n // Use this to detect duplicate pathnames.\n const all = new Map();\n const duplicates = {};\n for (const providerMatchers of providersMatchers){\n for (const matcher of providerMatchers){\n // Reset duplicated matches when reloading from pages conflicting state.\n if (matcher.duplicated) delete matcher.duplicated;\n // Test to see if the matcher being added is a duplicate.\n const duplicate = all.get(matcher.definition.pathname);\n if (duplicate) {\n // This looks a little weird, but essentially if the pathname\n // already exists in the duplicates map, then we got that array\n // reference. Otherwise, we create a new array with the original\n // duplicate first. Then we push the new matcher into the duplicate\n // array, and reset it to the duplicates object (which may be a\n // no-op if the pathname already existed in the duplicates object).\n // Then we set the array of duplicates on both the original\n // duplicate object and the new one, so we can keep them in sync.\n // If a new duplicate is found, and it matches an existing pathname,\n // the retrieval of the `other` will actually return the array\n // reference used by all other duplicates. This is why ReadonlyArray\n // is so important! Array's are always references!\n const others = duplicates[matcher.definition.pathname] ?? [\n duplicate\n ];\n others.push(matcher);\n duplicates[matcher.definition.pathname] = others;\n // Add duplicated details to each route.\n duplicate.duplicated = others;\n matcher.duplicated = others;\n // TODO: see if we should error for duplicates in production?\n }\n matchers.push(matcher);\n // Add the matcher's pathname to the set.\n all.set(matcher.definition.pathname, matcher);\n }\n }\n // Update the duplicate matchers. This is used in the development manager\n // to warn about duplicates.\n this.matchers.duplicates = duplicates;\n // If the cache is the same as what we just parsed, we can exit now. We\n // can tell by using the `===` which compares object identity, which for\n // the manifest matchers, will return the same matcher each time.\n if (this.previousMatchers.length === matchers.length && this.previousMatchers.every((cachedMatcher, index)=>cachedMatcher === matchers[index])) {\n return;\n }\n this.previousMatchers = matchers;\n // For matchers that are for static routes, filter them now.\n this.matchers.static = matchers.filter((matcher)=>!matcher.isDynamic);\n // For matchers that are for dynamic routes, filter them and sort them now.\n const dynamic = matchers.filter((matcher)=>matcher.isDynamic);\n // As `getSortedRoutes` only takes an array of strings, we need to create\n // a map of the pathnames (used for sorting) and the matchers. When we\n // have locales, there may be multiple matches for the same pathname. To\n // handle this, we keep a map of all the indexes (in `reference`) and\n // merge them in later.\n const reference = new Map();\n const pathnames = new Array();\n for(let index = 0; index < dynamic.length; index++){\n // Grab the pathname from the definition.\n const pathname = dynamic[index].definition.pathname;\n // Grab the index in the dynamic array, push it into the reference.\n const indexes = reference.get(pathname) ?? [];\n indexes.push(index);\n // If this is the first one set it. If it isn't, we don't need to\n // because pushing above on the array will mutate the array already\n // stored there because array's are always a reference!\n if (indexes.length === 1) reference.set(pathname, indexes);\n else continue;\n pathnames.push(pathname);\n }\n // Sort the array of pathnames.\n const sorted = getSortedRoutes(pathnames);\n // For each of the sorted pathnames, iterate over them, grabbing the list\n // of indexes and merging them back into the new `sortedDynamicMatchers`\n // array. The order of the same matching pathname doesn't matter because\n // they will have other matching characteristics (like the locale) that\n // is considered.\n const sortedDynamicMatchers = [];\n for (const pathname of sorted){\n const indexes = reference.get(pathname);\n if (!Array.isArray(indexes)) {\n throw new Error(\"Invariant: expected to find identity in indexes map\");\n }\n const dynamicMatches = indexes.map((index)=>dynamic[index]);\n sortedDynamicMatchers.push(...dynamicMatches);\n }\n this.matchers.dynamic = sortedDynamicMatchers;\n // This means that there was a new matcher pushed while we were waiting\n if (this.compilationID !== compilationID) {\n throw new Error(\"Invariant: expected compilation to finish before new matchers were added, possible missing await\");\n }\n } catch (err) {\n reject(err);\n } finally{\n // The compilation ID matched, so mark the complication as finished.\n this.lastCompilationID = compilationID;\n resolve();\n }\n }\n push(provider) {\n this.providers.push(provider);\n }\n async test(pathname, options) {\n // See if there's a match for the pathname...\n const match = await this.match(pathname, options);\n // This default implementation only needs to check to see if there _was_ a\n // match. The development matcher actually changes it's behavior by not\n // recompiling the routes.\n return match !== null;\n }\n async match(pathname, options) {\n // \"Iterate\" over the match options. Once we found a single match, exit with\n // it, otherwise return null below. If no match is found, the inner block\n // won't be called.\n for await (const match of this.matchAll(pathname, options)){\n return match;\n }\n return null;\n }\n /**\n * This is a point for other managers to override to inject other checking\n * behavior like duplicate route checking on a per-request basis.\n *\n * @param pathname the pathname to validate against\n * @param matcher the matcher to validate/test with\n * @returns the match if found\n */ validate(pathname, matcher, options) {\n var _options_i18n;\n if (matcher instanceof LocaleRouteMatcher) {\n return matcher.match(pathname, options);\n }\n // If the locale was inferred from the default locale, then it will have\n // already added a locale to the pathname. We need to remove it before\n // matching because this matcher is not locale aware.\n if ((_options_i18n = options.i18n) == null ? void 0 : _options_i18n.inferredFromDefault) {\n return matcher.match(options.i18n.pathname);\n }\n return matcher.match(pathname);\n }\n async *matchAll(pathname, options) {\n // Guard against the matcher manager from being run before it needs to be\n // recompiled. This was preferred to re-running the compilation here because\n // it should be re-ran only when it changes. If a match is attempted before\n // this is done, it indicates that there is a case where a provider is added\n // before it was recompiled (an error). We also don't want to affect request\n // times.\n if (this.lastCompilationID !== this.compilationID) {\n throw new Error(\"Invariant: expected routes to have been loaded before match\");\n }\n // Ensure that path matching is done with a leading slash.\n pathname = ensureLeadingSlash(pathname);\n // If this pathname doesn't look like a dynamic route, and this pathname is\n // listed in the normalized list of routes, then return it. This ensures\n // that when a route like `/user/[id]` is encountered, it doesn't just match\n // with the list of normalized routes.\n if (!isDynamicRoute(pathname)) {\n for (const matcher of this.matchers.static){\n const match = this.validate(pathname, matcher, options);\n if (!match) continue;\n yield match;\n }\n }\n // If we should skip handling dynamic routes, exit now.\n if (options == null ? void 0 : options.skipDynamic) return null;\n // Loop over the dynamic matchers, yielding each match.\n for (const matcher of this.matchers.dynamic){\n const match = this.validate(pathname, matcher, options);\n if (!match) continue;\n yield match;\n }\n // We tried direct matching against the pathname and against all the dynamic\n // paths, so there was no match.\n return null;\n }\n constructor(){\n this.providers = [];\n this.matchers = {\n static: [],\n dynamic: [],\n duplicates: {}\n };\n this.lastCompilationID = this.compilationID;\n this.previousMatchers = [];\n }\n}\n\n//# sourceMappingURL=default-route-matcher-manager.js.map","/**\n * Normalizers combines many normalizers into a single normalizer interface that\n * will normalize the inputted pathname with each normalizer in order.\n */ export class Normalizers {\n constructor(normalizers = []){\n this.normalizers = normalizers;\n }\n push(normalizer) {\n this.normalizers.push(normalizer);\n }\n normalize(pathname) {\n return this.normalizers.reduce((normalized, normalizer)=>normalizer.normalize(normalized), pathname);\n }\n}\n\n//# sourceMappingURL=normalizers.js.map","import path from \"../../../shared/lib/isomorphic/path\";\nexport class PrefixingNormalizer {\n constructor(...prefixes){\n this.prefix = path.posix.join(...prefixes);\n }\n normalize(pathname) {\n return path.posix.join(this.prefix, pathname);\n }\n}\n\n//# sourceMappingURL=prefixing-normalizer.js.map","import { ensureLeadingSlash } from \"./ensure-leading-slash\";\nimport { isDynamicRoute } from \"../router/utils\";\nimport { NormalizeError } from \"../utils\";\n/**\n * Takes a page and transforms it into its file counterpart ensuring that the\n * output is normalized. Note this function is not idempotent because a page\n * `/index` can be referencing `/index/index.js` and `/index/index` could be\n * referencing `/index/index/index.js`. Examples:\n * - `/` -> `/index`\n * - `/index/foo` -> `/index/index/foo`\n * - `/index` -> `/index/index`\n */ export function normalizePagePath(page) {\n const normalized = /^\\/index(\\/|$)/.test(page) && !isDynamicRoute(page) ? \"/index\" + page : page === \"/\" ? \"/index\" : ensureLeadingSlash(page);\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n const { posix } = require(\"path\");\n const resolvedPage = posix.normalize(normalized);\n if (resolvedPage !== normalized) {\n throw new NormalizeError(\"Requested and resolved page mismatch: \" + normalized + \" \" + resolvedPage);\n }\n }\n return normalized;\n}\n\n//# sourceMappingURL=normalize-page-path.js.map","import { Normalizers } from \"../../normalizers\";\nimport { PrefixingNormalizer } from \"../../prefixing-normalizer\";\nimport { normalizePagePath } from \"../../../../../shared/lib/page-path/normalize-page-path\";\nexport class AppBundlePathNormalizer extends PrefixingNormalizer {\n constructor(){\n super(\"app\");\n }\n normalize(page) {\n return super.normalize(normalizePagePath(page));\n }\n}\nexport class DevAppBundlePathNormalizer extends Normalizers {\n constructor(pageNormalizer){\n super([\n // This should normalize the filename to a page.\n pageNormalizer,\n // Normalize the app page to a pathname.\n new AppBundlePathNormalizer()\n ]);\n }\n normalize(filename) {\n return super.normalize(filename);\n }\n}\n\n//# sourceMappingURL=app-bundle-path-normalizer.js.map","import { SERVER_DIRECTORY } from \"../../../../../shared/lib/constants\";\nimport { PrefixingNormalizer } from \"../../prefixing-normalizer\";\nexport class AppFilenameNormalizer extends PrefixingNormalizer {\n constructor(distDir){\n super(distDir, SERVER_DIRECTORY);\n }\n normalize(manifestFilename) {\n return super.normalize(manifestFilename);\n }\n}\n\n//# sourceMappingURL=app-filename-normalizer.js.map","export function wrapNormalizerFn(fn) {\n return {\n normalize: fn\n };\n}\n\n//# sourceMappingURL=wrap-normalizer-fn.js.map","/**\n * UnderscoreNormalizer replaces all instances of %5F with _.\n */ export class UnderscoreNormalizer {\n normalize(pathname) {\n return pathname.replace(/%5F/g, \"_\");\n }\n}\n\n//# sourceMappingURL=underscore-normalizer.js.map","import { normalizeAppPath } from \"../../../../../shared/lib/router/utils/app-paths\";\nimport { Normalizers } from \"../../normalizers\";\nimport { wrapNormalizerFn } from \"../../wrap-normalizer-fn\";\nimport { UnderscoreNormalizer } from \"../../underscore-normalizer\";\nexport class AppPathnameNormalizer extends Normalizers {\n constructor(){\n super([\n // The pathname to match should have the trailing `/page` and other route\n // group information stripped from it.\n wrapNormalizerFn(normalizeAppPath),\n // The page should have the `%5F` characters replaced with `_` characters.\n new UnderscoreNormalizer()\n ]);\n }\n normalize(page) {\n return super.normalize(page);\n }\n}\nexport class DevAppPathnameNormalizer extends Normalizers {\n constructor(pageNormalizer){\n super([\n // This should normalize the filename to a page.\n pageNormalizer,\n // Normalize the app page to a pathname.\n new AppPathnameNormalizer()\n ]);\n }\n normalize(filename) {\n return super.normalize(filename);\n }\n}\n\n//# sourceMappingURL=app-pathname-normalizer.js.map","import { AppBundlePathNormalizer, DevAppBundlePathNormalizer } from \"./app-bundle-path-normalizer\";\nimport { AppFilenameNormalizer } from \"./app-filename-normalizer\";\nimport { DevAppPageNormalizer } from \"./app-page-normalizer\";\nimport { AppPathnameNormalizer, DevAppPathnameNormalizer } from \"./app-pathname-normalizer\";\nexport class AppNormalizers {\n constructor(distDir){\n this.filename = new AppFilenameNormalizer(distDir);\n this.pathname = new AppPathnameNormalizer();\n this.bundlePath = new AppBundlePathNormalizer();\n }\n}\nexport class DevAppNormalizers {\n constructor(appDir, extensions){\n this.page = new DevAppPageNormalizer(appDir, extensions);\n this.pathname = new DevAppPathnameNormalizer(this.page);\n this.bundlePath = new DevAppBundlePathNormalizer(this.page);\n }\n}\n\n//# sourceMappingURL=index.js.map","import { RouteMatcher } from \"./route-matcher\";\nexport class AppPageRouteMatcher extends RouteMatcher {\n get identity() {\n return `${this.definition.pathname}?__nextPage=${this.definition.page}`;\n }\n}\n\n//# sourceMappingURL=app-page-route-matcher.js.map","/**\n * This will memoize the matchers if the loaded data is comparable.\n */ export class CachedRouteMatcherProvider {\n constructor(loader){\n this.loader = loader;\n this.cached = [];\n }\n async matchers() {\n const data = await this.loader.load();\n if (!data) return [];\n // Return the cached matchers if the data has not changed.\n if (this.data && this.loader.compare(this.data, data)) return this.cached;\n this.data = data;\n // Transform the manifest into matchers.\n const matchers = await this.transform(data);\n // Cache the matchers.\n this.cached = matchers;\n return matchers;\n }\n}\n\n//# sourceMappingURL=cached-route-matcher-provider.js.map","import { CachedRouteMatcherProvider } from \"./helpers/cached-route-matcher-provider\";\nexport class ManifestRouteMatcherProvider extends CachedRouteMatcherProvider {\n constructor(manifestName, manifestLoader){\n super({\n load: async ()=>manifestLoader.load(manifestName),\n compare: (left, right)=>left === right\n });\n }\n}\n\n//# sourceMappingURL=manifest-route-matcher-provider.js.map","import { isAppPageRoute } from \"../../../lib/is-app-page-route\";\nimport { APP_PATHS_MANIFEST } from \"../../../shared/lib/constants\";\nimport { AppNormalizers } from \"../normalizers/built/app\";\nimport { RouteKind } from \"../route-kind\";\nimport { AppPageRouteMatcher } from \"../route-matchers/app-page-route-matcher\";\nimport { ManifestRouteMatcherProvider } from \"./manifest-route-matcher-provider\";\nexport class AppPageRouteMatcherProvider extends ManifestRouteMatcherProvider {\n constructor(distDir, manifestLoader){\n super(APP_PATHS_MANIFEST, manifestLoader);\n this.normalizers = new AppNormalizers(distDir);\n }\n async transform(manifest) {\n // This matcher only matches app pages.\n const pages = Object.keys(manifest).filter((page)=>isAppPageRoute(page));\n // Collect all the app paths for each page. This could include any parallel\n // routes.\n const allAppPaths = {};\n for (const page of pages){\n const pathname = this.normalizers.pathname.normalize(page);\n if (pathname in allAppPaths) allAppPaths[pathname].push(page);\n else allAppPaths[pathname] = [\n page\n ];\n }\n // Format the routes.\n const matchers = [];\n for (const [pathname, appPaths] of Object.entries(allAppPaths)){\n // TODO-APP: (wyattjoh) this is a hack right now, should be more deterministic\n const page = appPaths[0];\n const filename = this.normalizers.filename.normalize(manifest[page]);\n const bundlePath = this.normalizers.bundlePath.normalize(page);\n matchers.push(new AppPageRouteMatcher({\n kind: RouteKind.APP_PAGE,\n pathname,\n page,\n bundlePath,\n filename,\n appPaths\n }));\n }\n return matchers;\n }\n}\n\n//# sourceMappingURL=app-page-route-matcher-provider.js.map","export function isAppPageRoute(route) {\n return route.endsWith(\"/page\");\n}\n\n//# sourceMappingURL=is-app-page-route.js.map","import { RouteMatcher } from \"./route-matcher\";\nexport class AppRouteRouteMatcher extends RouteMatcher {\n}\n\n//# sourceMappingURL=app-route-route-matcher.js.map","import { isAppRouteRoute } from \"../../../lib/is-app-route-route\";\nimport { APP_PATHS_MANIFEST } from \"../../../shared/lib/constants\";\nimport { RouteKind } from \"../route-kind\";\nimport { AppRouteRouteMatcher } from \"../route-matchers/app-route-route-matcher\";\nimport { ManifestRouteMatcherProvider } from \"./manifest-route-matcher-provider\";\nimport { AppNormalizers } from \"../normalizers/built/app\";\nexport class AppRouteRouteMatcherProvider extends ManifestRouteMatcherProvider {\n constructor(distDir, manifestLoader){\n super(APP_PATHS_MANIFEST, manifestLoader);\n this.normalizers = new AppNormalizers(distDir);\n }\n async transform(manifest) {\n // This matcher only matches app routes.\n const pages = Object.keys(manifest).filter((page)=>isAppRouteRoute(page));\n // Format the routes.\n const matchers = [];\n for (const page of pages){\n const filename = this.normalizers.filename.normalize(manifest[page]);\n const pathname = this.normalizers.pathname.normalize(page);\n const bundlePath = this.normalizers.bundlePath.normalize(page);\n matchers.push(new AppRouteRouteMatcher({\n kind: RouteKind.APP_ROUTE,\n pathname,\n page,\n bundlePath,\n filename\n }));\n }\n return matchers;\n }\n}\n\n//# sourceMappingURL=app-route-route-matcher-provider.js.map","export function isAppRouteRoute(route) {\n return route.endsWith(\"/route\");\n}\n\n//# sourceMappingURL=is-app-route-route.js.map","export function isAPIRoute(value) {\n return value === \"/api\" || Boolean(value == null ? void 0 : value.startsWith(\"/api/\"));\n}\n\n//# sourceMappingURL=is-api-route.js.map","import { LocaleRouteMatcher } from \"./locale-route-matcher\";\nimport { RouteMatcher } from \"./route-matcher\";\nexport class PagesAPIRouteMatcher extends RouteMatcher {\n}\nexport class PagesAPILocaleRouteMatcher extends LocaleRouteMatcher {\n}\n\n//# sourceMappingURL=pages-api-route-matcher.js.map","import { normalizePagePath } from \"../../../../../shared/lib/page-path/normalize-page-path\";\nimport { Normalizers } from \"../../normalizers\";\nimport { PrefixingNormalizer } from \"../../prefixing-normalizer\";\nimport { wrapNormalizerFn } from \"../../wrap-normalizer-fn\";\nexport class PagesBundlePathNormalizer extends Normalizers {\n constructor(){\n super([\n // The bundle path should have the trailing `/index` stripped from\n // it.\n wrapNormalizerFn(normalizePagePath),\n // The page should prefixed with `pages/`.\n new PrefixingNormalizer(\"pages\")\n ]);\n }\n normalize(page) {\n return super.normalize(page);\n }\n}\nexport class DevPagesBundlePathNormalizer extends Normalizers {\n constructor(pagesNormalizer){\n super([\n // This should normalize the filename to a page.\n pagesNormalizer,\n // Normalize the app page to a pathname.\n new PagesBundlePathNormalizer()\n ]);\n }\n normalize(filename) {\n return super.normalize(filename);\n }\n}\n\n//# sourceMappingURL=pages-bundle-path-normalizer.js.map","import { SERVER_DIRECTORY } from \"../../../../../shared/lib/constants\";\nimport { PrefixingNormalizer } from \"../../prefixing-normalizer\";\nexport class PagesFilenameNormalizer extends PrefixingNormalizer {\n constructor(distDir){\n super(distDir, SERVER_DIRECTORY);\n }\n normalize(manifestFilename) {\n return super.normalize(manifestFilename);\n }\n}\n\n//# sourceMappingURL=pages-filename-normalizer.js.map","import { DevPagesBundlePathNormalizer, PagesBundlePathNormalizer } from \"./pages-bundle-path-normalizer\";\nimport { PagesFilenameNormalizer } from \"./pages-filename-normalizer\";\nimport { DevPagesPageNormalizer } from \"./pages-page-normalizer\";\nimport { DevPagesPathnameNormalizer } from \"./pages-pathname-normalizer\";\nexport class PagesNormalizers {\n constructor(distDir){\n this.filename = new PagesFilenameNormalizer(distDir);\n this.bundlePath = new PagesBundlePathNormalizer();\n // You'd think that we'd require a `pathname` normalizer here, but for\n // `/pages` we have to handle i18n routes, which means that we need to\n // analyze the page path to determine the locale prefix and it's locale.\n }\n}\nexport class DevPagesNormalizers {\n constructor(pagesDir, extensions){\n this.page = new DevPagesPageNormalizer(pagesDir, extensions);\n this.pathname = new DevPagesPathnameNormalizer(pagesDir, extensions);\n this.bundlePath = new DevPagesBundlePathNormalizer(this.page);\n }\n}\n\n//# sourceMappingURL=index.js.map","import { isAPIRoute } from \"../../../lib/is-api-route\";\nimport { PAGES_MANIFEST } from \"../../../shared/lib/constants\";\nimport { RouteKind } from \"../route-kind\";\nimport { PagesAPILocaleRouteMatcher, PagesAPIRouteMatcher } from \"../route-matchers/pages-api-route-matcher\";\nimport { ManifestRouteMatcherProvider } from \"./manifest-route-matcher-provider\";\nimport { PagesNormalizers } from \"../normalizers/built/pages\";\nexport class PagesAPIRouteMatcherProvider extends ManifestRouteMatcherProvider {\n constructor(distDir, manifestLoader, i18nProvider){\n super(PAGES_MANIFEST, manifestLoader);\n this.i18nProvider = i18nProvider;\n this.normalizers = new PagesNormalizers(distDir);\n }\n async transform(manifest) {\n // This matcher is only for Pages API routes.\n const pathnames = Object.keys(manifest).filter((pathname)=>isAPIRoute(pathname));\n const matchers = [];\n for (const page of pathnames){\n if (this.i18nProvider) {\n // Match the locale on the page name, or default to the default locale.\n const { detectedLocale, pathname } = this.i18nProvider.analyze(page);\n matchers.push(new PagesAPILocaleRouteMatcher({\n kind: RouteKind.PAGES_API,\n pathname,\n page,\n bundlePath: this.normalizers.bundlePath.normalize(page),\n filename: this.normalizers.filename.normalize(manifest[page]),\n i18n: {\n locale: detectedLocale\n }\n }));\n } else {\n matchers.push(new PagesAPIRouteMatcher({\n kind: RouteKind.PAGES_API,\n // In `pages/`, the page is the same as the pathname.\n pathname: page,\n page,\n bundlePath: this.normalizers.bundlePath.normalize(page),\n filename: this.normalizers.filename.normalize(manifest[page])\n }));\n }\n }\n return matchers;\n }\n}\n\n//# sourceMappingURL=pages-api-route-matcher-provider.js.map","import { LocaleRouteMatcher } from \"./locale-route-matcher\";\nimport { RouteMatcher } from \"./route-matcher\";\nexport class PagesRouteMatcher extends RouteMatcher {\n}\nexport class PagesLocaleRouteMatcher extends LocaleRouteMatcher {\n}\n\n//# sourceMappingURL=pages-route-matcher.js.map","import { isAPIRoute } from \"../../../lib/is-api-route\";\nimport { BLOCKED_PAGES, PAGES_MANIFEST } from \"../../../shared/lib/constants\";\nimport { RouteKind } from \"../route-kind\";\nimport { PagesLocaleRouteMatcher, PagesRouteMatcher } from \"../route-matchers/pages-route-matcher\";\nimport { ManifestRouteMatcherProvider } from \"./manifest-route-matcher-provider\";\nimport { PagesNormalizers } from \"../normalizers/built/pages\";\nexport class PagesRouteMatcherProvider extends ManifestRouteMatcherProvider {\n constructor(distDir, manifestLoader, i18nProvider){\n super(PAGES_MANIFEST, manifestLoader);\n this.i18nProvider = i18nProvider;\n this.normalizers = new PagesNormalizers(distDir);\n }\n async transform(manifest) {\n // This matcher is only for Pages routes, not Pages API routes which are\n // included in this manifest.\n const pathnames = Object.keys(manifest).filter((pathname)=>!isAPIRoute(pathname))// Remove any blocked pages (page that can't be routed to, like error or\n // internal pages).\n .filter((pathname)=>{\n var _this_i18nProvider;\n const normalized = ((_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.analyze(pathname).pathname) ?? pathname;\n // Skip any blocked pages.\n if (BLOCKED_PAGES.includes(normalized)) return false;\n return true;\n });\n const matchers = [];\n for (const page of pathnames){\n if (this.i18nProvider) {\n // Match the locale on the page name, or default to the default locale.\n const { detectedLocale, pathname } = this.i18nProvider.analyze(page);\n matchers.push(new PagesLocaleRouteMatcher({\n kind: RouteKind.PAGES,\n pathname,\n page,\n bundlePath: this.normalizers.bundlePath.normalize(page),\n filename: this.normalizers.filename.normalize(manifest[page]),\n i18n: {\n locale: detectedLocale\n }\n }));\n } else {\n matchers.push(new PagesRouteMatcher({\n kind: RouteKind.PAGES,\n // In `pages/`, the page is the same as the pathname.\n pathname: page,\n page,\n bundlePath: this.normalizers.bundlePath.normalize(page),\n filename: this.normalizers.filename.normalize(manifest[page])\n }));\n }\n }\n return matchers;\n }\n}\n\n//# sourceMappingURL=pages-route-matcher-provider.js.map","export class ServerManifestLoader {\n constructor(getter){\n this.getter = getter;\n }\n load(name) {\n return this.getter(name);\n }\n}\n\n//# sourceMappingURL=server-manifest-loader.js.map","/**\n * The I18NProvider is used to match locale aware routes, detect the locale from\n * the pathname and hostname and normalize the pathname by removing the locale\n * prefix.\n */ export class I18NProvider {\n constructor(config){\n var _config_domains;\n this.config = config;\n if (!config.locales.length) {\n throw new Error(\"Invariant: No locales provided\");\n }\n this.lowerCaseLocales = config.locales.map((locale)=>locale.toLowerCase());\n this.lowerCaseDomains = (_config_domains = config.domains) == null ? void 0 : _config_domains.map((domainLocale)=>{\n var _domainLocale_locales;\n const domain = domainLocale.domain.toLowerCase();\n return {\n defaultLocale: domainLocale.defaultLocale.toLowerCase(),\n hostname: domain.split(\":\", 1)[0],\n domain,\n locales: (_domainLocale_locales = domainLocale.locales) == null ? void 0 : _domainLocale_locales.map((locale)=>locale.toLowerCase()),\n http: domainLocale.http\n };\n });\n }\n /**\n * Detects the domain locale from the hostname and the detected locale if\n * provided.\n *\n * @param hostname The hostname to detect the domain locale from, this must be lowercased.\n * @param detectedLocale The detected locale to use if the hostname does not match.\n * @returns The domain locale if found, `undefined` otherwise.\n */ detectDomainLocale(hostname, detectedLocale) {\n if (!hostname || !this.lowerCaseDomains || !this.config.domains) return;\n if (detectedLocale) detectedLocale = detectedLocale.toLowerCase();\n for(let i = 0; i < this.lowerCaseDomains.length; i++){\n var // Configuration validation ensures that the locale is not repeated in\n // other domains locales.\n _domainLocale_locales;\n const domainLocale = this.lowerCaseDomains[i];\n if (// We assume that the hostname is already lowercased.\n domainLocale.hostname === hostname || ((_domainLocale_locales = domainLocale.locales) == null ? void 0 : _domainLocale_locales.some((locale)=>locale === detectedLocale))) {\n return this.config.domains[i];\n }\n }\n return;\n }\n /**\n * Pulls the pre-computed locale and inference results from the query\n * object.\n *\n * @param pathname the pathname that could contain a locale prefix\n * @param query the query object\n * @returns the locale analysis result\n */ fromQuery(pathname, query) {\n const detectedLocale = query.__nextLocale;\n // If a locale was detected on the query, analyze the pathname to ensure\n // that the locale matches.\n if (detectedLocale) {\n const analysis = this.analyze(pathname);\n // If the analysis contained a locale we should validate it against the\n // query and strip it from the pathname.\n if (analysis.detectedLocale) {\n if (analysis.detectedLocale !== detectedLocale) {\n throw new Error(`Invariant: The detected locale does not match the locale in the query. Expected to find '${detectedLocale}' in '${pathname}' but found '${analysis.detectedLocale}'}`);\n }\n pathname = analysis.pathname;\n }\n }\n return {\n pathname,\n detectedLocale,\n inferredFromDefault: query.__nextInferredLocaleFromDefault === \"1\"\n };\n }\n /**\n * Validates that the locale is valid.\n *\n * @param locale The locale to validate.\n * @returns `true` if the locale is valid, `false` otherwise.\n */ validate(locale) {\n return this.lowerCaseLocales.includes(locale.toLowerCase());\n }\n /**\n * Validates that the locales in the query object are valid.\n *\n * @param query The query object to validate.\n * @returns `true` if the locale is valid, `false` otherwise.\n */ validateQuery(query) {\n if (query.__nextLocale && !this.validate(query.__nextLocale)) {\n return false;\n }\n if (query.__nextDefaultLocale && !this.validate(query.__nextDefaultLocale)) {\n return false;\n }\n return true;\n }\n /**\n * Analyzes the pathname for a locale and returns the pathname without it.\n *\n * @param pathname The pathname that could contain a locale prefix.\n * @param options The options to use when matching the locale.\n * @returns The matched locale and the pathname without the locale prefix\n * (if any).\n */ analyze(pathname, options = {}) {\n let detectedLocale = options.defaultLocale;\n // By default, we assume that the default locale was inferred if there was\n // no detected locale.\n let inferredFromDefault = typeof detectedLocale === \"string\";\n // The first segment will be empty, because it has a leading `/`. If\n // there is no further segment, there is no locale (or it's the default).\n const segments = pathname.split(\"/\", 2);\n if (!segments[1]) return {\n detectedLocale,\n pathname,\n inferredFromDefault\n };\n // The second segment will contain the locale part if any.\n const segment = segments[1].toLowerCase();\n // See if the segment matches one of the locales. If it doesn't, there is\n // no locale (or it's the default).\n const index = this.lowerCaseLocales.indexOf(segment);\n if (index < 0) return {\n detectedLocale,\n pathname,\n inferredFromDefault\n };\n // Return the case-sensitive locale.\n detectedLocale = this.config.locales[index];\n inferredFromDefault = false;\n // Remove the `/${locale}` part of the pathname.\n pathname = pathname.slice(detectedLocale.length + 1) || \"/\";\n return {\n detectedLocale,\n pathname,\n inferredFromDefault\n };\n }\n}\n\n//# sourceMappingURL=i18n-provider.js.map","import { pipeToNodeResponse } from \"./pipe-readable\";\nimport { splitCookiesString } from \"./web/utils\";\n/**\n * Sends the response on the underlying next response object.\n *\n * @param req the underlying request object\n * @param res the underlying response object\n * @param response the response to send\n */ export async function sendResponse(req, res, response, waitUntil) {\n // Don't use in edge runtime\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n var // Copy over the response headers.\n _response_headers;\n // Copy over the response status.\n res.statusCode = response.status;\n res.statusMessage = response.statusText;\n (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{\n // The append handling is special cased for `set-cookie`.\n if (name.toLowerCase() === \"set-cookie\") {\n // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici\n for (const cookie of splitCookiesString(value)){\n res.appendHeader(name, cookie);\n }\n } else {\n res.appendHeader(name, value);\n }\n });\n /**\n * The response can't be directly piped to the underlying response. The\n * following is duplicated from the edge runtime handler.\n *\n * See packages/next/server/next-server.ts\n */ const originalResponse = res.originalResponse;\n // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD\n if (response.body && req.method !== \"HEAD\") {\n await pipeToNodeResponse(response.body, originalResponse, waitUntil);\n } else {\n originalResponse.end();\n }\n }\n}\n\n//# sourceMappingURL=send-response.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/dist/client/components/static-generation-async-storage.external.js\");","import { ResponseCookies } from \"../cookies\";\nimport { ReflectAdapter } from \"./reflect\";\nimport { staticGenerationAsyncStorage } from \"../../../../client/components/static-generation-async-storage.external\";\n/**\n * @internal\n */ export class ReadonlyRequestCookiesError extends Error {\n constructor(){\n super(\"Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options\");\n }\n static callable() {\n throw new ReadonlyRequestCookiesError();\n }\n}\nexport class RequestCookiesAdapter {\n static seal(cookies) {\n return new Proxy(cookies, {\n get (target, prop, receiver) {\n switch(prop){\n case \"clear\":\n case \"delete\":\n case \"set\":\n return ReadonlyRequestCookiesError.callable;\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n }\n}\nconst SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for(\"next.mutated.cookies\");\nexport function getModifiedCookieValues(cookies) {\n const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES];\n if (!modified || !Array.isArray(modified) || modified.length === 0) {\n return [];\n }\n return modified;\n}\nexport function appendMutableCookies(headers, mutableCookies) {\n const modifiedCookieValues = getModifiedCookieValues(mutableCookies);\n if (modifiedCookieValues.length === 0) {\n return false;\n }\n // Return a new response that extends the response with\n // the modified cookies as fallbacks. `res` cookies\n // will still take precedence.\n const resCookies = new ResponseCookies(headers);\n const returnedCookies = resCookies.getAll();\n // Set the modified cookies as fallbacks.\n for (const cookie of modifiedCookieValues){\n resCookies.set(cookie);\n }\n // Set the original cookies as the final values.\n for (const cookie of returnedCookies){\n resCookies.set(cookie);\n }\n return true;\n}\nexport class MutableRequestCookiesAdapter {\n static wrap(cookies, onUpdateCookies) {\n const responseCookies = new ResponseCookies(new Headers());\n for (const cookie of cookies.getAll()){\n responseCookies.set(cookie);\n }\n let modifiedValues = [];\n const modifiedCookies = new Set();\n const updateResponseCookies = ()=>{\n // TODO-APP: change method of getting staticGenerationAsyncStore\n const staticGenerationAsyncStore = staticGenerationAsyncStorage.getStore();\n if (staticGenerationAsyncStore) {\n staticGenerationAsyncStore.pathWasRevalidated = true;\n }\n const allCookies = responseCookies.getAll();\n modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name));\n if (onUpdateCookies) {\n const serializedCookies = [];\n for (const cookie of modifiedValues){\n const tempCookies = new ResponseCookies(new Headers());\n tempCookies.set(cookie);\n serializedCookies.push(tempCookies.toString());\n }\n onUpdateCookies(serializedCookies);\n }\n };\n return new Proxy(responseCookies, {\n get (target, prop, receiver) {\n switch(prop){\n // A special symbol to get the modified cookie values\n case SYMBOL_MODIFY_COOKIE_VALUES:\n return modifiedValues;\n // TODO: Throw error if trying to set a cookie after the response\n // headers have been set.\n case \"delete\":\n return function(...args) {\n modifiedCookies.add(typeof args[0] === \"string\" ? args[0] : args[0].name);\n try {\n target.delete(...args);\n } finally{\n updateResponseCookies();\n }\n };\n case \"set\":\n return function(...args) {\n modifiedCookies.add(typeof args[0] === \"string\" ? args[0] : args[0].name);\n try {\n return target.set(...args);\n } finally{\n updateResponseCookies();\n }\n };\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n }\n}\n\n//# sourceMappingURL=request-cookies.js.map","import { getPathMatch } from \"../../shared/lib/router/utils/path-match\";\nconst matcher = getPathMatch(\"/_next/data/:path*\");\nexport function matchNextDataPathname(pathname) {\n if (typeof pathname !== \"string\") return false;\n return matcher(pathname);\n}\n\n//# sourceMappingURL=match-next-data-pathname.js.map","export class SuffixPathnameNormalizer {\n constructor(suffix){\n this.suffix = suffix;\n }\n match(pathname) {\n // If the pathname doesn't end in the suffix, we don't match.\n if (!pathname.endsWith(this.suffix)) return false;\n return true;\n }\n normalize(pathname, matched) {\n // If we're not matched and we don't match, we don't need to normalize.\n if (!matched && !this.match(pathname)) return pathname;\n return pathname.substring(0, pathname.length - this.suffix.length);\n }\n}\n\n//# sourceMappingURL=suffix.js.map","import { RSC_SUFFIX } from \"../../../../lib/constants\";\nimport { SuffixPathnameNormalizer } from \"./suffix\";\nexport class RSCPathnameNormalizer extends SuffixPathnameNormalizer {\n constructor(){\n super(RSC_SUFFIX);\n }\n}\n\n//# sourceMappingURL=rsc.js.map","export class PrefixPathnameNormalizer {\n constructor(prefix){\n this.prefix = prefix;\n if (prefix.endsWith(\"/\")) {\n throw new Error(`PrefixPathnameNormalizer: prefix \"${prefix}\" should not end with a slash`);\n }\n }\n match(pathname) {\n // If the pathname doesn't start with the prefix, we don't match.\n if (pathname !== this.prefix && !pathname.startsWith(this.prefix + \"/\")) {\n return false;\n }\n return true;\n }\n normalize(pathname, matched) {\n // If we're not matched and we don't match, we don't need to normalize.\n if (!matched && !this.match(pathname)) return pathname;\n if (pathname.length === this.prefix.length) {\n return \"/\";\n }\n return pathname.substring(this.prefix.length);\n }\n}\n\n//# sourceMappingURL=prefix.js.map","import { denormalizePagePath } from \"../../../../shared/lib/page-path/denormalize-page-path\";\nimport { PrefixPathnameNormalizer } from \"./prefix\";\nconst prefix = \"/_next/postponed/resume\";\nexport class PostponedPathnameNormalizer extends PrefixPathnameNormalizer {\n constructor(){\n super(prefix);\n }\n normalize(pathname, matched) {\n // If we're not matched and we don't match, we don't need to normalize.\n if (!matched && !this.match(pathname)) return pathname;\n // Remove the prefix.\n pathname = super.normalize(pathname, true);\n return denormalizePagePath(pathname);\n }\n}\n\n//# sourceMappingURL=postponed.js.map","import { ACTION_SUFFIX } from \"../../../../lib/constants\";\nimport { SuffixPathnameNormalizer } from \"./suffix\";\nexport class ActionPathnameNormalizer extends SuffixPathnameNormalizer {\n constructor(){\n super(ACTION_SUFFIX);\n }\n}\n\n//# sourceMappingURL=action.js.map","import { FLIGHT_PARAMETERS } from \"../../client/components/app-router-headers\";\n/**\n * Removes the flight headers from the request.\n *\n * @param req the request to strip the headers from\n */ export function stripFlightHeaders(headers) {\n for (const [header] of FLIGHT_PARAMETERS){\n delete headers[header.toLowerCase()];\n }\n}\n\n//# sourceMappingURL=strip-flight-headers.js.map","import { RSC_PREFETCH_SUFFIX } from \"../../../../lib/constants\";\nimport { SuffixPathnameNormalizer } from \"./suffix\";\nexport class PrefetchRSCPathnameNormalizer extends SuffixPathnameNormalizer {\n constructor(){\n super(RSC_PREFETCH_SUFFIX);\n }\n}\n\n//# sourceMappingURL=prefetch-rsc.js.map","import { denormalizePagePath } from \"../../../../shared/lib/page-path/denormalize-page-path\";\nimport { PrefixPathnameNormalizer } from \"./prefix\";\nimport { SuffixPathnameNormalizer } from \"./suffix\";\nexport class NextDataPathnameNormalizer {\n constructor(buildID){\n this.suffix = new SuffixPathnameNormalizer(\".json\");\n if (!buildID) {\n throw new Error(\"Invariant: buildID is required\");\n }\n this.prefix = new PrefixPathnameNormalizer(`/_next/data/${buildID}`);\n }\n match(pathname) {\n return this.prefix.match(pathname) && this.suffix.match(pathname);\n }\n normalize(pathname, matched) {\n // If we're not matched and we don't match, we don't need to normalize.\n if (!matched && !this.match(pathname)) return pathname;\n pathname = this.prefix.normalize(pathname, true);\n pathname = this.suffix.normalize(pathname, true);\n return denormalizePagePath(pathname);\n }\n}\n\n//# sourceMappingURL=next-data.js.map","/**\n * This transforms a URL pathname into a route. It removes any trailing slashes\n * and the `/index` suffix.\n *\n * @param {string} pathname - The URL path that needs to be optimized.\n * @returns {string} - The route\n *\n * @example\n * // returns '/example'\n * toRoute('/example/index/');\n *\n * @example\n * // returns '/example'\n * toRoute('/example/');\n *\n * @example\n * // returns '/'\n * toRoute('/index/');\n *\n * @example\n * // returns '/'\n * toRoute('/');\n */ export function toRoute(pathname) {\n return pathname.replace(/(?:\\/index)?\\/?$/, \"\") || \"/\";\n}\n\n//# sourceMappingURL=to-route.js.map","import { NormalizeError, DecodeError, normalizeRepeatedSlashes, MissingStaticPage } from \"../shared/lib/utils\";\nimport { format as formatUrl, parse as parseUrl } from \"url\";\nimport { formatHostname } from \"./lib/format-hostname\";\nimport { getRedirectStatus } from \"../lib/redirect-status\";\nimport { isEdgeRuntime } from \"../lib/is-edge-runtime\";\nimport { APP_PATHS_MANIFEST, NEXT_BUILTIN_DOCUMENT, PAGES_MANIFEST, STATIC_STATUS_PAGES, UNDERSCORE_NOT_FOUND_ROUTE, UNDERSCORE_NOT_FOUND_ROUTE_ENTRY } from \"../shared/lib/constants\";\nimport { isDynamicRoute } from \"../shared/lib/router/utils\";\nimport { checkIsOnDemandRevalidate } from \"./api-utils\";\nimport { setConfig } from \"../shared/lib/runtime-config.external\";\nimport { formatRevalidate } from \"./lib/revalidate\";\nimport { execOnce } from \"../shared/lib/utils\";\nimport { isBlockedPage } from \"./utils\";\nimport { isBot } from \"../shared/lib/router/utils/is-bot\";\nimport RenderResult from \"./render-result\";\nimport { removeTrailingSlash } from \"../shared/lib/router/utils/remove-trailing-slash\";\nimport { denormalizePagePath } from \"../shared/lib/page-path/denormalize-page-path\";\nimport * as Log from \"../build/output/log\";\nimport escapePathDelimiters from \"../shared/lib/router/utils/escape-path-delimiters\";\nimport { getUtils } from \"./server-utils\";\nimport isError, { getProperError } from \"../lib/is-error\";\nimport { addRequestMeta, getRequestMeta, removeRequestMeta, setRequestMeta } from \"./request-meta\";\nimport { removePathPrefix } from \"../shared/lib/router/utils/remove-path-prefix\";\nimport { normalizeAppPath } from \"../shared/lib/router/utils/app-paths\";\nimport { getHostname } from \"../shared/lib/get-hostname\";\nimport { parseUrl as parseUrlUtil } from \"../shared/lib/router/utils/parse-url\";\nimport { getNextPathnameInfo } from \"../shared/lib/router/utils/get-next-pathname-info\";\nimport { RSC_HEADER, NEXT_RSC_UNION_QUERY, NEXT_ROUTER_PREFETCH_HEADER, NEXT_DID_POSTPONE_HEADER, NEXT_URL, NEXT_ROUTER_STATE_TREE } from \"../client/components/app-router-headers\";\nimport { LocaleRouteNormalizer } from \"./future/normalizers/locale-route-normalizer\";\nimport { DefaultRouteMatcherManager } from \"./future/route-matcher-managers/default-route-matcher-manager\";\nimport { AppPageRouteMatcherProvider } from \"./future/route-matcher-providers/app-page-route-matcher-provider\";\nimport { AppRouteRouteMatcherProvider } from \"./future/route-matcher-providers/app-route-route-matcher-provider\";\nimport { PagesAPIRouteMatcherProvider } from \"./future/route-matcher-providers/pages-api-route-matcher-provider\";\nimport { PagesRouteMatcherProvider } from \"./future/route-matcher-providers/pages-route-matcher-provider\";\nimport { ServerManifestLoader } from \"./future/route-matcher-providers/helpers/manifest-loaders/server-manifest-loader\";\nimport { getTracer, SpanKind } from \"./lib/trace/tracer\";\nimport { BaseServerSpan } from \"./lib/trace/constants\";\nimport { I18NProvider } from \"./future/helpers/i18n-provider\";\nimport { sendResponse } from \"./send-response\";\nimport { handleInternalServerErrorResponse } from \"./future/route-modules/helpers/response-handlers\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"./web/utils\";\nimport { CACHE_ONE_YEAR, NEXT_CACHE_TAGS_HEADER, NEXT_QUERY_PARAM_PREFIX } from \"../lib/constants\";\nimport { normalizeLocalePath } from \"../shared/lib/i18n/normalize-locale-path\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"./web/spec-extension/adapters/next-request\";\nimport { matchNextDataPathname } from \"./lib/match-next-data-pathname\";\nimport getRouteFromAssetPath from \"../shared/lib/router/utils/get-route-from-asset-path\";\nimport { RSCPathnameNormalizer } from \"./future/normalizers/request/rsc\";\nimport { PostponedPathnameNormalizer } from \"./future/normalizers/request/postponed\";\nimport { ActionPathnameNormalizer } from \"./future/normalizers/request/action\";\nimport { stripFlightHeaders } from \"./app-render/strip-flight-headers\";\nimport { isAppPageRouteModule, isAppRouteRouteModule, isPagesRouteModule } from \"./future/route-modules/checks\";\nimport { PrefetchRSCPathnameNormalizer } from \"./future/normalizers/request/prefetch-rsc\";\nimport { NextDataPathnameNormalizer } from \"./future/normalizers/request/next-data\";\nimport { getIsServerAction } from \"./lib/server-action-request-meta\";\nimport { isInterceptionRouteAppPath } from \"./future/helpers/interception-routes\";\nimport { toRoute } from \"./lib/to-route\";\nexport class NoFallbackError extends Error {\n}\n// Internal wrapper around build errors at development\n// time, to prevent us from propagating or logging them\nexport class WrappedBuildError extends Error {\n constructor(innerError){\n super();\n this.innerError = innerError;\n }\n}\nexport default class Server {\n constructor(options){\n var _this_nextConfig_i18n, _this_nextConfig_experimental_amp, _this_nextConfig_i18n1;\n this.handleRSCRequest = (req, _res, parsedUrl)=>{\n var _this_normalizers_prefetchRSC, _this_normalizers_rsc;\n if (!parsedUrl.pathname) return false;\n if ((_this_normalizers_prefetchRSC = this.normalizers.prefetchRSC) == null ? void 0 : _this_normalizers_prefetchRSC.match(parsedUrl.pathname)) {\n parsedUrl.pathname = this.normalizers.prefetchRSC.normalize(parsedUrl.pathname, true);\n // Mark the request as a router prefetch request.\n req.headers[RSC_HEADER.toLowerCase()] = \"1\";\n req.headers[NEXT_ROUTER_PREFETCH_HEADER.toLowerCase()] = \"1\";\n addRequestMeta(req, \"isRSCRequest\", true);\n addRequestMeta(req, \"isPrefetchRSCRequest\", true);\n } else if ((_this_normalizers_rsc = this.normalizers.rsc) == null ? void 0 : _this_normalizers_rsc.match(parsedUrl.pathname)) {\n parsedUrl.pathname = this.normalizers.rsc.normalize(parsedUrl.pathname, true);\n // Mark the request as a RSC request.\n req.headers[RSC_HEADER.toLowerCase()] = \"1\";\n addRequestMeta(req, \"isRSCRequest\", true);\n } else if (req.headers[\"x-now-route-matches\"]) {\n // If we didn't match, return with the flight headers stripped. If in\n // minimal mode we didn't match based on the path, this can't be a RSC\n // request. This is because Vercel only sends this header during\n // revalidation requests and we want the cache to instead depend on the\n // request path for flight information.\n stripFlightHeaders(req.headers);\n return false;\n } else {\n // Otherwise just return without doing anything.\n return false;\n }\n if (req.url) {\n const parsed = parseUrl(req.url);\n parsed.pathname = parsedUrl.pathname;\n req.url = formatUrl(parsed);\n }\n return false;\n };\n this.handleNextDataRequest = async (req, res, parsedUrl)=>{\n const middleware = this.getMiddleware();\n const params = matchNextDataPathname(parsedUrl.pathname);\n // ignore for non-next data URLs\n if (!params || !params.path) {\n return false;\n }\n if (params.path[0] !== this.buildId) {\n // Ignore if its a middleware request when we aren't on edge.\n if (process.env.NEXT_RUNTIME !== \"edge\" && getRequestMeta(req, \"middlewareInvoke\")) {\n return false;\n }\n // Make sure to 404 if the buildId isn't correct\n await this.render404(req, res, parsedUrl);\n return true;\n }\n // remove buildId from URL\n params.path.shift();\n const lastParam = params.path[params.path.length - 1];\n // show 404 if it doesn't end with .json\n if (typeof lastParam !== \"string\" || !lastParam.endsWith(\".json\")) {\n await this.render404(req, res, parsedUrl);\n return true;\n }\n // re-create page's pathname\n let pathname = `/${params.path.join(\"/\")}`;\n pathname = getRouteFromAssetPath(pathname, \".json\");\n // ensure trailing slash is normalized per config\n if (middleware) {\n if (this.nextConfig.trailingSlash && !pathname.endsWith(\"/\")) {\n pathname += \"/\";\n }\n if (!this.nextConfig.trailingSlash && pathname.length > 1 && pathname.endsWith(\"/\")) {\n pathname = pathname.substring(0, pathname.length - 1);\n }\n }\n if (this.i18nProvider) {\n var _req_headers_host;\n // Remove the port from the hostname if present.\n const hostname = req == null ? void 0 : (_req_headers_host = req.headers.host) == null ? void 0 : _req_headers_host.split(\":\", 1)[0].toLowerCase();\n const domainLocale = this.i18nProvider.detectDomainLocale(hostname);\n const defaultLocale = (domainLocale == null ? void 0 : domainLocale.defaultLocale) ?? this.i18nProvider.config.defaultLocale;\n const localePathResult = this.i18nProvider.analyze(pathname);\n // If the locale is detected from the path, we need to remove it\n // from the pathname.\n if (localePathResult.detectedLocale) {\n pathname = localePathResult.pathname;\n }\n // Update the query with the detected locale and default locale.\n parsedUrl.query.__nextLocale = localePathResult.detectedLocale;\n parsedUrl.query.__nextDefaultLocale = defaultLocale;\n // If the locale is not detected from the path, we need to mark that\n // it was not inferred from default.\n if (!localePathResult.detectedLocale) {\n delete parsedUrl.query.__nextInferredLocaleFromDefault;\n }\n // If no locale was detected and we don't have middleware, we need\n // to render a 404 page.\n if (!localePathResult.detectedLocale && !middleware) {\n parsedUrl.query.__nextLocale = defaultLocale;\n await this.render404(req, res, parsedUrl);\n return true;\n }\n }\n parsedUrl.pathname = pathname;\n parsedUrl.query.__nextDataReq = \"1\";\n return false;\n };\n this.handleNextImageRequest = ()=>false;\n this.handleCatchallRenderRequest = ()=>false;\n this.handleCatchallMiddlewareRequest = ()=>false;\n /**\n * Normalizes a pathname without attaching any metadata from any matched\n * normalizer.\n *\n * @param pathname the pathname to normalize\n * @returns the normalized pathname\n */ this.normalize = (pathname)=>{\n const normalizers = [];\n if (this.normalizers.data) {\n normalizers.push(this.normalizers.data);\n }\n if (this.normalizers.postponed) {\n normalizers.push(this.normalizers.postponed);\n }\n // We have to put the prefetch normalizer before the RSC normalizer\n // because the RSC normalizer will match the prefetch RSC routes too.\n if (this.normalizers.prefetchRSC) {\n normalizers.push(this.normalizers.prefetchRSC);\n }\n if (this.normalizers.rsc) {\n normalizers.push(this.normalizers.rsc);\n }\n if (this.normalizers.action) {\n normalizers.push(this.normalizers.action);\n }\n for (const normalizer of normalizers){\n if (!normalizer.match(pathname)) continue;\n return normalizer.normalize(pathname, true);\n }\n return pathname;\n };\n this.normalizeAndAttachMetadata = async (req, res, url)=>{\n let finished = await this.handleNextImageRequest(req, res, url);\n if (finished) return true;\n if (this.enabledDirectories.pages) {\n finished = await this.handleNextDataRequest(req, res, url);\n if (finished) return true;\n }\n return false;\n };\n this.prepared = false;\n this.preparedPromise = null;\n this.customErrorNo404Warn = execOnce(()=>{\n Log.warn(`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.\\nSee here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`);\n });\n const { dir = \".\", quiet = false, conf, dev = false, minimalMode = false, customServer = true, hostname, port, experimentalTestProxy } = options;\n this.experimentalTestProxy = experimentalTestProxy;\n this.serverOptions = options;\n this.dir = process.env.NEXT_RUNTIME === \"edge\" ? dir : require(\"path\").resolve(dir);\n this.quiet = quiet;\n this.loadEnvConfig({\n dev\n });\n // TODO: should conf be normalized to prevent missing\n // values from causing issues as this can be user provided\n this.nextConfig = conf;\n this.hostname = hostname;\n if (this.hostname) {\n // we format the hostname so that it can be fetched\n this.fetchHostname = formatHostname(this.hostname);\n }\n this.port = port;\n this.distDir = process.env.NEXT_RUNTIME === \"edge\" ? this.nextConfig.distDir : require(\"path\").join(this.dir, this.nextConfig.distDir);\n this.publicDir = this.getPublicDir();\n this.hasStaticDir = !minimalMode && this.getHasStaticDir();\n this.i18nProvider = ((_this_nextConfig_i18n = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n.locales) ? new I18NProvider(this.nextConfig.i18n) : undefined;\n // Configure the locale normalizer, it's used for routes inside `pages/`.\n this.localeNormalizer = this.i18nProvider ? new LocaleRouteNormalizer(this.i18nProvider) : undefined;\n // Only serverRuntimeConfig needs the default\n // publicRuntimeConfig gets it's default in client/index.js\n const { serverRuntimeConfig = {}, publicRuntimeConfig, assetPrefix, generateEtags } = this.nextConfig;\n this.buildId = this.getBuildId();\n // this is a hack to avoid Webpack knowing this is equal to this.minimalMode\n // because we replace this.minimalMode to true in production bundles.\n const minimalModeKey = \"minimalMode\";\n this[minimalModeKey] = minimalMode || !!process.env.NEXT_PRIVATE_MINIMAL_MODE;\n this.enabledDirectories = this.getEnabledDirectories(dev);\n this.normalizers = {\n // We should normalize the pathname from the RSC prefix only in minimal\n // mode as otherwise that route is not exposed external to the server as\n // we instead only rely on the headers.\n postponed: this.enabledDirectories.app && this.nextConfig.experimental.ppr && this.minimalMode ? new PostponedPathnameNormalizer() : undefined,\n rsc: this.enabledDirectories.app && this.minimalMode ? new RSCPathnameNormalizer() : undefined,\n prefetchRSC: this.enabledDirectories.app && this.nextConfig.experimental.ppr && this.minimalMode ? new PrefetchRSCPathnameNormalizer() : undefined,\n data: this.enabledDirectories.pages ? new NextDataPathnameNormalizer(this.buildId) : undefined,\n action: this.enabledDirectories.app && this.minimalMode ? new ActionPathnameNormalizer() : undefined\n };\n this.nextFontManifest = this.getNextFontManifest();\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n process.env.NEXT_DEPLOYMENT_ID = this.nextConfig.deploymentId || \"\";\n }\n this.renderOpts = {\n supportsDynamicResponse: true,\n trailingSlash: this.nextConfig.trailingSlash,\n deploymentId: this.nextConfig.deploymentId,\n strictNextHead: !!this.nextConfig.experimental.strictNextHead,\n poweredByHeader: this.nextConfig.poweredByHeader,\n canonicalBase: this.nextConfig.amp.canonicalBase || \"\",\n buildId: this.buildId,\n generateEtags,\n previewProps: this.getPrerenderManifest().preview,\n customServer: customServer === true ? true : undefined,\n ampOptimizerConfig: (_this_nextConfig_experimental_amp = this.nextConfig.experimental.amp) == null ? void 0 : _this_nextConfig_experimental_amp.optimizer,\n basePath: this.nextConfig.basePath,\n images: this.nextConfig.images,\n optimizeFonts: this.nextConfig.optimizeFonts,\n fontManifest: this.nextConfig.optimizeFonts && !dev ? this.getFontManifest() : undefined,\n optimizeCss: this.nextConfig.experimental.optimizeCss,\n nextConfigOutput: this.nextConfig.output,\n nextScriptWorkers: this.nextConfig.experimental.nextScriptWorkers,\n disableOptimizedLoading: this.nextConfig.experimental.disableOptimizedLoading,\n domainLocales: (_this_nextConfig_i18n1 = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n1.domains,\n distDir: this.distDir,\n serverComponents: this.enabledDirectories.app,\n enableTainting: this.nextConfig.experimental.taint,\n crossOrigin: this.nextConfig.crossOrigin ? this.nextConfig.crossOrigin : undefined,\n largePageDataBytes: this.nextConfig.experimental.largePageDataBytes,\n // Only the `publicRuntimeConfig` key is exposed to the client side\n // It'll be rendered as part of __NEXT_DATA__ on the client side\n runtimeConfig: Object.keys(publicRuntimeConfig).length > 0 ? publicRuntimeConfig : undefined,\n // @ts-expect-error internal field not publicly exposed\n isExperimentalCompile: this.nextConfig.experimental.isExperimentalCompile,\n experimental: {\n ppr: this.enabledDirectories.app && this.nextConfig.experimental.ppr === true,\n missingSuspenseWithCSRBailout: this.nextConfig.experimental.missingSuspenseWithCSRBailout === true,\n swrDelta: this.nextConfig.experimental.swrDelta\n }\n };\n // Initialize next/config with the environment configuration\n setConfig({\n serverRuntimeConfig,\n publicRuntimeConfig\n });\n this.pagesManifest = this.getPagesManifest();\n this.appPathsManifest = this.getAppPathsManifest();\n this.appPathRoutes = this.getAppPathRoutes();\n this.interceptionRoutePatterns = this.getinterceptionRoutePatterns();\n // Configure the routes.\n this.matchers = this.getRouteMatchers();\n // Start route compilation. We don't wait for the routes to finish loading\n // because we use the `waitTillReady` promise below in `handleRequest` to\n // wait. Also we can't `await` in the constructor.\n void this.matchers.reload();\n this.setAssetPrefix(assetPrefix);\n this.responseCache = this.getResponseCache({\n dev\n });\n }\n reloadMatchers() {\n return this.matchers.reload();\n }\n getRouteMatchers() {\n // Create a new manifest loader that get's the manifests from the server.\n const manifestLoader = new ServerManifestLoader((name)=>{\n switch(name){\n case PAGES_MANIFEST:\n return this.getPagesManifest() ?? null;\n case APP_PATHS_MANIFEST:\n return this.getAppPathsManifest() ?? null;\n default:\n return null;\n }\n });\n // Configure the matchers and handlers.\n const matchers = new DefaultRouteMatcherManager();\n // Match pages under `pages/`.\n matchers.push(new PagesRouteMatcherProvider(this.distDir, manifestLoader, this.i18nProvider));\n // Match api routes under `pages/api/`.\n matchers.push(new PagesAPIRouteMatcherProvider(this.distDir, manifestLoader, this.i18nProvider));\n // If the app directory is enabled, then add the app matchers and handlers.\n if (this.enabledDirectories.app) {\n // Match app pages under `app/`.\n matchers.push(new AppPageRouteMatcherProvider(this.distDir, manifestLoader));\n matchers.push(new AppRouteRouteMatcherProvider(this.distDir, manifestLoader));\n }\n return matchers;\n }\n logError(err) {\n if (this.quiet) return;\n Log.error(err);\n }\n async handleRequest(req, res, parsedUrl) {\n await this.prepare();\n const method = req.method.toUpperCase();\n const rsc = isRSCRequestCheck(req) ? \"RSC \" : \"\";\n const tracer = getTracer();\n return tracer.withPropagatedContext(req.headers, ()=>{\n return tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${rsc}${method} ${req.url}`,\n kind: SpanKind.SERVER,\n attributes: {\n \"http.method\": method,\n \"http.target\": req.url,\n \"next.rsc\": Boolean(rsc)\n }\n }, async (span)=>this.handleRequestImpl(req, res, parsedUrl).finally(()=>{\n if (!span) return;\n span.setAttributes({\n \"http.status_code\": res.statusCode\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) return;\n if (rootSpanAttributes.get(\"next.span_type\") !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get(\"next.span_type\")}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get(\"next.route\");\n if (route) {\n const newName = `${rsc}${method} ${route}`;\n span.setAttributes({\n \"next.route\": route,\n \"http.route\": route,\n \"next.span_name\": newName\n });\n span.updateName(newName);\n }\n }));\n });\n }\n async handleRequestImpl(req, res, parsedUrl) {\n try {\n var _originalRequest_socket, _originalRequest_socket1, _this_i18nProvider, _this_i18nProvider1, _this_nextConfig_i18n;\n // Wait for the matchers to be ready.\n await this.matchers.waitTillReady();\n // ensure cookies set in middleware are merged and\n // not overridden by API routes/getServerSideProps\n const _res = res.originalResponse || res;\n const origSetHeader = _res.setHeader.bind(_res);\n _res.setHeader = (name, val)=>{\n // When renders /_error after page is failed,\n // it could attempt to set headers after headers\n if (_res.headersSent) {\n return;\n }\n if (name.toLowerCase() === \"set-cookie\") {\n const middlewareValue = getRequestMeta(req, \"middlewareCookie\");\n if (!middlewareValue || !Array.isArray(val) || !val.every((item, idx)=>item === middlewareValue[idx])) {\n val = [\n // TODO: (wyattjoh) find out why this is called multiple times resulting in duplicate cookies being added\n ...new Set([\n ...middlewareValue || [],\n ...typeof val === \"string\" ? [\n val\n ] : Array.isArray(val) ? val : []\n ])\n ];\n }\n }\n return origSetHeader(name, val);\n };\n const urlParts = (req.url || \"\").split(\"?\", 1);\n const urlNoQuery = urlParts[0];\n // this normalizes repeated slashes in the path e.g. hello//world ->\n // hello/world or backslashes to forward slashes, this does not\n // handle trailing slash as that is handled the same as a next.config.js\n // redirect\n if (urlNoQuery == null ? void 0 : urlNoQuery.match(/(\\\\|\\/\\/)/)) {\n const cleanUrl = normalizeRepeatedSlashes(req.url);\n res.redirect(cleanUrl, 308).body(cleanUrl).send();\n return;\n }\n // Parse url if parsedUrl not provided\n if (!parsedUrl || typeof parsedUrl !== \"object\") {\n if (!req.url) {\n throw new Error(\"Invariant: url can not be undefined\");\n }\n parsedUrl = parseUrl(req.url, true);\n }\n if (!parsedUrl.pathname) {\n throw new Error(\"Invariant: pathname can't be empty\");\n }\n // Parse the querystring ourselves if the user doesn't handle querystring parsing\n if (typeof parsedUrl.query === \"string\") {\n parsedUrl.query = Object.fromEntries(new URLSearchParams(parsedUrl.query));\n }\n const { originalRequest } = req;\n const xForwardedProto = originalRequest == null ? void 0 : originalRequest.headers[\"x-forwarded-proto\"];\n const isHttps = xForwardedProto ? xForwardedProto === \"https\" : !!(originalRequest == null ? void 0 : (_originalRequest_socket = originalRequest.socket) == null ? void 0 : _originalRequest_socket.encrypted);\n req.headers[\"x-forwarded-host\"] ??= req.headers[\"host\"] ?? this.hostname;\n req.headers[\"x-forwarded-port\"] ??= this.port ? this.port.toString() : isHttps ? \"443\" : \"80\";\n req.headers[\"x-forwarded-proto\"] ??= isHttps ? \"https\" : \"http\";\n req.headers[\"x-forwarded-for\"] ??= (_originalRequest_socket1 = originalRequest.socket) == null ? void 0 : _originalRequest_socket1.remoteAddress;\n // Validate that if i18n isn't configured or the passed parameters are not\n // valid it should be removed from the query.\n if (!((_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.validateQuery(parsedUrl.query))) {\n delete parsedUrl.query.__nextLocale;\n delete parsedUrl.query.__nextDefaultLocale;\n delete parsedUrl.query.__nextInferredLocaleFromDefault;\n }\n // This should be done before any normalization of the pathname happens as\n // it captures the initial URL.\n this.attachRequestMeta(req, parsedUrl);\n let finished = false;\n if (this.minimalMode && this.enabledDirectories.app) {\n finished = await this.handleRSCRequest(req, res, parsedUrl);\n if (finished) return;\n }\n const domainLocale = (_this_i18nProvider1 = this.i18nProvider) == null ? void 0 : _this_i18nProvider1.detectDomainLocale(getHostname(parsedUrl, req.headers));\n const defaultLocale = (domainLocale == null ? void 0 : domainLocale.defaultLocale) || ((_this_nextConfig_i18n = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n.defaultLocale);\n parsedUrl.query.__nextDefaultLocale = defaultLocale;\n const url = parseUrlUtil(req.url.replace(/^\\/+/, \"/\"));\n const pathnameInfo = getNextPathnameInfo(url.pathname, {\n nextConfig: this.nextConfig,\n i18nProvider: this.i18nProvider\n });\n url.pathname = pathnameInfo.pathname;\n if (pathnameInfo.basePath) {\n req.url = removePathPrefix(req.url, this.nextConfig.basePath);\n }\n const useMatchedPathHeader = this.minimalMode && typeof req.headers[\"x-matched-path\"] === \"string\";\n // TODO: merge handling with invokePath\n if (useMatchedPathHeader) {\n try {\n var _this_normalizers_data, _this_normalizers_postponed, _this_i18nProvider2, _this_getRoutesManifest;\n if (this.enabledDirectories.app) {\n // ensure /index path is normalized for prerender\n // in minimal mode\n if (req.url.match(/^\\/index($|\\?)/)) {\n req.url = req.url.replace(/^\\/index/, \"/\");\n }\n parsedUrl.pathname = parsedUrl.pathname === \"/index\" ? \"/\" : parsedUrl.pathname;\n }\n // x-matched-path is the source of truth, it tells what page\n // should be rendered because we don't process rewrites in minimalMode\n let { pathname: matchedPath } = new URL(req.headers[\"x-matched-path\"], \"http://localhost\");\n let { pathname: urlPathname } = new URL(req.url, \"http://localhost\");\n // For ISR the URL is normalized to the prerenderPath so if\n // it's a data request the URL path will be the data URL,\n // basePath is already stripped by this point\n if ((_this_normalizers_data = this.normalizers.data) == null ? void 0 : _this_normalizers_data.match(urlPathname)) {\n parsedUrl.query.__nextDataReq = \"1\";\n } else if (((_this_normalizers_postponed = this.normalizers.postponed) == null ? void 0 : _this_normalizers_postponed.match(matchedPath)) && req.method === \"POST\") {\n // Decode the postponed state from the request body, it will come as\n // an array of buffers, so collect them and then concat them to form\n // the string.\n const body = [];\n for await (const chunk of req.body){\n body.push(chunk);\n }\n const postponed = Buffer.concat(body).toString(\"utf8\");\n addRequestMeta(req, \"postponed\", postponed);\n // If the request does not have the `x-now-route-matches` header,\n // it means that the request has it's exact path specified in the\n // `x-matched-path` header. In this case, we should update the\n // pathname to the matched path.\n if (!req.headers[\"x-now-route-matches\"]) {\n urlPathname = this.normalizers.postponed.normalize(matchedPath, true);\n }\n }\n matchedPath = this.normalize(matchedPath);\n const normalizedUrlPath = this.stripNextDataPath(urlPathname);\n // Perform locale detection and normalization.\n const localeAnalysisResult = (_this_i18nProvider2 = this.i18nProvider) == null ? void 0 : _this_i18nProvider2.analyze(matchedPath, {\n defaultLocale\n });\n // The locale result will be defined even if the locale was not\n // detected for the request because it will be inferred from the\n // default locale.\n if (localeAnalysisResult) {\n parsedUrl.query.__nextLocale = localeAnalysisResult.detectedLocale;\n // If the detected locale was inferred from the default locale, we\n // need to modify the metadata on the request to indicate that.\n if (localeAnalysisResult.inferredFromDefault) {\n parsedUrl.query.__nextInferredLocaleFromDefault = \"1\";\n } else {\n delete parsedUrl.query.__nextInferredLocaleFromDefault;\n }\n }\n // TODO: check if this is needed any more?\n matchedPath = denormalizePagePath(matchedPath);\n let srcPathname = matchedPath;\n let pageIsDynamic = isDynamicRoute(srcPathname);\n if (!pageIsDynamic) {\n const match = await this.matchers.match(srcPathname, {\n i18n: localeAnalysisResult\n });\n // Update the source pathname to the matched page's pathname.\n if (match) {\n srcPathname = match.definition.pathname;\n // The page is dynamic if the params are defined.\n pageIsDynamic = typeof match.params !== \"undefined\";\n }\n }\n // The rest of this function can't handle i18n properly, so ensure we\n // restore the pathname with the locale information stripped from it\n // now that we're done matching if we're using i18n.\n if (localeAnalysisResult) {\n matchedPath = localeAnalysisResult.pathname;\n }\n const utils = getUtils({\n pageIsDynamic,\n page: srcPathname,\n i18n: this.nextConfig.i18n,\n basePath: this.nextConfig.basePath,\n rewrites: ((_this_getRoutesManifest = this.getRoutesManifest()) == null ? void 0 : _this_getRoutesManifest.rewrites) || {\n beforeFiles: [],\n afterFiles: [],\n fallback: []\n },\n caseSensitive: !!this.nextConfig.experimental.caseSensitiveRoutes\n });\n // Ensure parsedUrl.pathname includes locale before processing\n // rewrites or they won't match correctly.\n if (defaultLocale && !pathnameInfo.locale) {\n parsedUrl.pathname = `/${defaultLocale}${parsedUrl.pathname}`;\n }\n const pathnameBeforeRewrite = parsedUrl.pathname;\n const rewriteParams = utils.handleRewrites(req, parsedUrl);\n const rewriteParamKeys = Object.keys(rewriteParams);\n const didRewrite = pathnameBeforeRewrite !== parsedUrl.pathname;\n if (didRewrite && parsedUrl.pathname) {\n addRequestMeta(req, \"rewroteURL\", parsedUrl.pathname);\n }\n const routeParamKeys = new Set();\n for (const key of Object.keys(parsedUrl.query)){\n const value = parsedUrl.query[key];\n if (key !== NEXT_QUERY_PARAM_PREFIX && key.startsWith(NEXT_QUERY_PARAM_PREFIX)) {\n const normalizedKey = key.substring(NEXT_QUERY_PARAM_PREFIX.length);\n parsedUrl.query[normalizedKey] = value;\n routeParamKeys.add(normalizedKey);\n delete parsedUrl.query[key];\n }\n }\n // interpolate dynamic params and normalize URL if needed\n if (pageIsDynamic) {\n let params = {};\n let paramsResult = utils.normalizeDynamicRouteParams(parsedUrl.query);\n // for prerendered ISR paths we attempt parsing the route\n // params from the URL directly as route-matches may not\n // contain the correct values due to the filesystem path\n // matching before the dynamic route has been matched\n if (!paramsResult.hasValidParams && pageIsDynamic && !isDynamicRoute(normalizedUrlPath)) {\n let matcherParams = utils.dynamicRouteMatcher == null ? void 0 : utils.dynamicRouteMatcher.call(utils, normalizedUrlPath);\n if (matcherParams) {\n utils.normalizeDynamicRouteParams(matcherParams);\n Object.assign(paramsResult.params, matcherParams);\n paramsResult.hasValidParams = true;\n }\n }\n if (paramsResult.hasValidParams) {\n params = paramsResult.params;\n }\n if (req.headers[\"x-now-route-matches\"] && isDynamicRoute(matchedPath) && !paramsResult.hasValidParams) {\n const opts = {};\n const routeParams = utils.getParamsFromRouteMatches(req, opts, parsedUrl.query.__nextLocale || \"\");\n // If this returns a locale, it means that the locale was detected\n // from the pathname.\n if (opts.locale) {\n parsedUrl.query.__nextLocale = opts.locale;\n // As the locale was parsed from the pathname, we should mark\n // that the locale was not inferred as the default.\n delete parsedUrl.query.__nextInferredLocaleFromDefault;\n }\n paramsResult = utils.normalizeDynamicRouteParams(routeParams, true);\n if (paramsResult.hasValidParams) {\n params = paramsResult.params;\n }\n }\n // handle the actual dynamic route name being requested\n if (pageIsDynamic && utils.defaultRouteMatches && normalizedUrlPath === srcPathname && !paramsResult.hasValidParams && !utils.normalizeDynamicRouteParams({\n ...params\n }, true).hasValidParams) {\n params = utils.defaultRouteMatches;\n }\n if (params) {\n matchedPath = utils.interpolateDynamicPath(srcPathname, params);\n req.url = utils.interpolateDynamicPath(req.url, params);\n }\n }\n if (pageIsDynamic || didRewrite) {\n var _utils_defaultRouteRegex;\n utils.normalizeVercelUrl(req, true, [\n ...rewriteParamKeys,\n ...Object.keys(((_utils_defaultRouteRegex = utils.defaultRouteRegex) == null ? void 0 : _utils_defaultRouteRegex.groups) || {})\n ]);\n }\n for (const key of routeParamKeys){\n delete parsedUrl.query[key];\n }\n parsedUrl.pathname = matchedPath;\n url.pathname = parsedUrl.pathname;\n finished = await this.normalizeAndAttachMetadata(req, res, parsedUrl);\n if (finished) return;\n } catch (err) {\n if (err instanceof DecodeError || err instanceof NormalizeError) {\n res.statusCode = 400;\n return this.renderError(null, req, res, \"/_error\", {});\n }\n throw err;\n }\n }\n addRequestMeta(req, \"isLocaleDomain\", Boolean(domainLocale));\n if (pathnameInfo.locale) {\n req.url = formatUrl(url);\n addRequestMeta(req, \"didStripLocale\", true);\n }\n // If we aren't in minimal mode or there is no locale in the query\n // string, add the locale to the query string.\n if (!this.minimalMode || !parsedUrl.query.__nextLocale) {\n // If the locale is in the pathname, add it to the query string.\n if (pathnameInfo.locale) {\n parsedUrl.query.__nextLocale = pathnameInfo.locale;\n } else if (defaultLocale) {\n parsedUrl.query.__nextLocale = defaultLocale;\n parsedUrl.query.__nextInferredLocaleFromDefault = \"1\";\n }\n }\n // set incremental cache to request meta so it can\n // be passed down for edge functions and the fetch disk\n // cache can be leveraged locally\n if (!this.serverOptions.webServerConfig && !getRequestMeta(req, \"incrementalCache\")) {\n let protocol = \"https:\";\n try {\n const parsedFullUrl = new URL(getRequestMeta(req, \"initURL\") || \"/\", \"http://n\");\n protocol = parsedFullUrl.protocol;\n } catch {}\n const incrementalCache = await this.getIncrementalCache({\n requestHeaders: Object.assign({}, req.headers),\n requestProtocol: protocol.substring(0, protocol.length - 1)\n });\n incrementalCache.resetRequestCache();\n addRequestMeta(req, \"incrementalCache\", incrementalCache);\n globalThis.__incrementalCache = incrementalCache;\n }\n // when invokePath is specified we can short short circuit resolving\n // we only honor this header if we are inside of a render worker to\n // prevent external users coercing the routing path\n const invokePath = getRequestMeta(req, \"invokePath\");\n const useInvokePath = !useMatchedPathHeader && process.env.NEXT_RUNTIME !== \"edge\" && invokePath;\n if (useInvokePath) {\n var _this_nextConfig_i18n1;\n const invokeStatus = getRequestMeta(req, \"invokeStatus\");\n if (invokeStatus) {\n const invokeQuery = getRequestMeta(req, \"invokeQuery\");\n if (invokeQuery) {\n Object.assign(parsedUrl.query, invokeQuery);\n }\n res.statusCode = invokeStatus;\n let err = getRequestMeta(req, \"invokeError\") || null;\n return this.renderError(err, req, res, \"/_error\", parsedUrl.query);\n }\n const parsedMatchedPath = new URL(invokePath || \"/\", \"http://n\");\n const invokePathnameInfo = getNextPathnameInfo(parsedMatchedPath.pathname, {\n nextConfig: this.nextConfig,\n parseData: false\n });\n if (invokePathnameInfo.locale) {\n parsedUrl.query.__nextLocale = invokePathnameInfo.locale;\n }\n if (parsedUrl.pathname !== parsedMatchedPath.pathname) {\n parsedUrl.pathname = parsedMatchedPath.pathname;\n addRequestMeta(req, \"rewroteURL\", invokePathnameInfo.pathname);\n }\n const normalizeResult = normalizeLocalePath(removePathPrefix(parsedUrl.pathname, this.nextConfig.basePath || \"\"), ((_this_nextConfig_i18n1 = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n1.locales) || []);\n if (normalizeResult.detectedLocale) {\n parsedUrl.query.__nextLocale = normalizeResult.detectedLocale;\n }\n parsedUrl.pathname = normalizeResult.pathname;\n for (const key of Object.keys(parsedUrl.query)){\n if (!key.startsWith(\"__next\") && !key.startsWith(\"_next\")) {\n delete parsedUrl.query[key];\n }\n }\n const invokeQuery = getRequestMeta(req, \"invokeQuery\");\n if (invokeQuery) {\n Object.assign(parsedUrl.query, invokeQuery);\n }\n finished = await this.normalizeAndAttachMetadata(req, res, parsedUrl);\n if (finished) return;\n await this.handleCatchallRenderRequest(req, res, parsedUrl);\n return;\n }\n if (process.env.NEXT_RUNTIME !== \"edge\" && getRequestMeta(req, \"middlewareInvoke\")) {\n finished = await this.normalizeAndAttachMetadata(req, res, parsedUrl);\n if (finished) return;\n finished = await this.handleCatchallMiddlewareRequest(req, res, parsedUrl);\n if (finished) return;\n const err = new Error();\n err.result = {\n response: new Response(null, {\n headers: {\n \"x-middleware-next\": \"1\"\n }\n })\n };\n err.bubble = true;\n throw err;\n }\n // This wasn't a request via the matched path or the invoke path, so\n // prepare for a legacy run by removing the base path.\n // ensure we strip the basePath when not using an invoke header\n if (!useMatchedPathHeader && pathnameInfo.basePath) {\n parsedUrl.pathname = removePathPrefix(parsedUrl.pathname, pathnameInfo.basePath);\n }\n res.statusCode = 200;\n return await this.run(req, res, parsedUrl);\n } catch (err) {\n if (err instanceof NoFallbackError) {\n throw err;\n }\n if (err && typeof err === \"object\" && err.code === \"ERR_INVALID_URL\" || err instanceof DecodeError || err instanceof NormalizeError) {\n res.statusCode = 400;\n return this.renderError(null, req, res, \"/_error\", {});\n }\n if (this.minimalMode || this.renderOpts.dev || err.bubble) {\n throw err;\n }\n this.logError(getProperError(err));\n res.statusCode = 500;\n res.body(\"Internal Server Error\").send();\n }\n }\n /**\n * @internal - this method is internal to Next.js and should not be used directly by end-users\n */ getRequestHandlerWithMetadata(meta) {\n const handler = this.getRequestHandler();\n return (req, res, parsedUrl)=>{\n setRequestMeta(req, meta);\n return handler(req, res, parsedUrl);\n };\n }\n getRequestHandler() {\n return this.handleRequest.bind(this);\n }\n setAssetPrefix(prefix) {\n this.renderOpts.assetPrefix = prefix ? prefix.replace(/\\/$/, \"\") : \"\";\n }\n /**\n * Runs async initialization of server.\n * It is idempotent, won't fire underlying initialization more than once.\n */ async prepare() {\n if (this.prepared) return;\n if (this.preparedPromise === null) {\n this.preparedPromise = this.prepareImpl().then(()=>{\n this.prepared = true;\n this.preparedPromise = null;\n });\n }\n return this.preparedPromise;\n }\n async prepareImpl() {}\n // Backwards compatibility\n async close() {}\n getAppPathRoutes() {\n const appPathRoutes = {};\n Object.keys(this.appPathsManifest || {}).forEach((entry)=>{\n const normalizedPath = normalizeAppPath(entry);\n if (!appPathRoutes[normalizedPath]) {\n appPathRoutes[normalizedPath] = [];\n }\n appPathRoutes[normalizedPath].push(entry);\n });\n return appPathRoutes;\n }\n async run(req, res, parsedUrl) {\n return getTracer().trace(BaseServerSpan.run, async ()=>this.runImpl(req, res, parsedUrl));\n }\n async runImpl(req, res, parsedUrl) {\n await this.handleCatchallRenderRequest(req, res, parsedUrl);\n }\n async pipe(fn, partialContext) {\n return getTracer().trace(BaseServerSpan.pipe, async ()=>this.pipeImpl(fn, partialContext));\n }\n async pipeImpl(fn, partialContext) {\n const isBotRequest = isBot(partialContext.req.headers[\"user-agent\"] || \"\");\n const ctx = {\n ...partialContext,\n renderOpts: {\n ...this.renderOpts,\n supportsDynamicResponse: !isBotRequest,\n isBot: !!isBotRequest\n }\n };\n const payload = await fn(ctx);\n if (payload === null) {\n return;\n }\n const { req, res } = ctx;\n const originalStatus = res.statusCode;\n const { body, type } = payload;\n let { revalidate } = payload;\n if (!res.sent) {\n const { generateEtags, poweredByHeader, dev } = this.renderOpts;\n // In dev, we should not cache pages for any reason.\n if (dev) {\n res.setHeader(\"Cache-Control\", \"no-store, must-revalidate\");\n revalidate = undefined;\n }\n await this.sendRenderResult(req, res, {\n result: body,\n type,\n generateEtags,\n poweredByHeader,\n revalidate,\n swrDelta: this.nextConfig.experimental.swrDelta\n });\n res.statusCode = originalStatus;\n }\n }\n async getStaticHTML(fn, partialContext) {\n const ctx = {\n ...partialContext,\n renderOpts: {\n ...this.renderOpts,\n supportsDynamicResponse: false\n }\n };\n const payload = await fn(ctx);\n if (payload === null) {\n return null;\n }\n return payload.body.toUnchunkedString();\n }\n async render(req, res, pathname, query = {}, parsedUrl, internalRender = false) {\n return getTracer().trace(BaseServerSpan.render, async ()=>this.renderImpl(req, res, pathname, query, parsedUrl, internalRender));\n }\n async renderImpl(req, res, pathname, query = {}, parsedUrl, internalRender = false) {\n var _req_url;\n if (!pathname.startsWith(\"/\")) {\n console.warn(`Cannot render page with path \"${pathname}\", did you mean \"/${pathname}\"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`);\n }\n if (this.renderOpts.customServer && pathname === \"/index\" && !await this.hasPage(\"/index\")) {\n // maintain backwards compatibility for custom server\n // (see custom-server integration tests)\n pathname = \"/\";\n }\n // we allow custom servers to call render for all URLs\n // so check if we need to serve a static _next file or not.\n // we don't modify the URL for _next/data request but still\n // call render so we special case this to prevent an infinite loop\n if (!internalRender && !this.minimalMode && !query.__nextDataReq && (((_req_url = req.url) == null ? void 0 : _req_url.match(/^\\/_next\\//)) || this.hasStaticDir && req.url.match(/^\\/static\\//))) {\n return this.handleRequest(req, res, parsedUrl);\n }\n if (isBlockedPage(pathname)) {\n return this.render404(req, res, parsedUrl);\n }\n return this.pipe((ctx)=>this.renderToResponse(ctx), {\n req,\n res,\n pathname,\n query\n });\n }\n async getStaticPaths({ pathname }) {\n var _this_getPrerenderManifest_dynamicRoutes_pathname;\n // Read whether or not fallback should exist from the manifest.\n const fallbackField = (_this_getPrerenderManifest_dynamicRoutes_pathname = this.getPrerenderManifest().dynamicRoutes[pathname]) == null ? void 0 : _this_getPrerenderManifest_dynamicRoutes_pathname.fallback;\n return {\n // `staticPaths` is intentionally set to `undefined` as it should've\n // been caught when checking disk data.\n staticPaths: undefined,\n fallbackMode: typeof fallbackField === \"string\" ? \"static\" : fallbackField === null ? \"blocking\" : fallbackField\n };\n }\n async renderToResponseWithComponents(requestContext, findComponentsResult) {\n return getTracer().trace(BaseServerSpan.renderToResponseWithComponents, async ()=>this.renderToResponseWithComponentsImpl(requestContext, findComponentsResult));\n }\n pathCouldBeIntercepted(resolvedPathname) {\n return isInterceptionRouteAppPath(resolvedPathname) || this.interceptionRoutePatterns.some((regexp)=>{\n return regexp.test(resolvedPathname);\n });\n }\n setVaryHeader(req, res, isAppPath, resolvedPathname) {\n const baseVaryHeader = `${RSC_HEADER}, ${NEXT_ROUTER_STATE_TREE}, ${NEXT_ROUTER_PREFETCH_HEADER}`;\n const isRSCRequest = isRSCRequestCheck(req);\n let addedNextUrlToVary = false;\n if (isAppPath && this.pathCouldBeIntercepted(resolvedPathname)) {\n // Interception route responses can vary based on the `Next-URL` header.\n // We use the Vary header to signal this behavior to the client to properly cache the response.\n res.setHeader(\"vary\", `${baseVaryHeader}, ${NEXT_URL}`);\n addedNextUrlToVary = true;\n } else if (isAppPath || isRSCRequest) {\n // We don't need to include `Next-URL` in the Vary header for non-interception routes since it won't affect the response.\n // We also set this header for pages to avoid caching issues when navigating between pages and app.\n res.setHeader(\"vary\", baseVaryHeader);\n }\n if (!addedNextUrlToVary) {\n // Remove `Next-URL` from the request headers we determined it wasn't necessary to include in the Vary header.\n // This is to avoid any dependency on the `Next-URL` header being present when preparing the response.\n delete req.headers[NEXT_URL];\n }\n }\n async renderToResponseWithComponentsImpl({ req, res, pathname, renderOpts: opts }, { components, query }) {\n var _components_Component, _this_nextConfig_i18n, _this_nextConfig_i18n1, _cacheEntry_value;\n if (pathname === UNDERSCORE_NOT_FOUND_ROUTE) {\n pathname = \"/404\";\n }\n const isErrorPathname = pathname === \"/_error\";\n const is404Page = pathname === \"/404\" || isErrorPathname && res.statusCode === 404;\n const is500Page = pathname === \"/500\" || isErrorPathname && res.statusCode === 500;\n const isAppPath = components.isAppPath === true;\n const hasServerProps = !!components.getServerSideProps;\n let hasStaticPaths = !!components.getStaticPaths;\n const isServerAction = getIsServerAction(req);\n const hasGetInitialProps = !!((_components_Component = components.Component) == null ? void 0 : _components_Component.getInitialProps);\n let isSSG = !!components.getStaticProps;\n // Compute the iSSG cache key. We use the rewroteUrl since\n // pages with fallback: false are allowed to be rewritten to\n // and we need to look up the path by the rewritten path\n let urlPathname = parseUrl(req.url || \"\").pathname || \"/\";\n let resolvedUrlPathname = getRequestMeta(req, \"rewroteURL\") || urlPathname;\n this.setVaryHeader(req, res, isAppPath, resolvedUrlPathname);\n let staticPaths;\n let fallbackMode;\n let hasFallback = false;\n const isDynamic = isDynamicRoute(components.page);\n const prerenderManifest = this.getPrerenderManifest();\n if (isAppPath && isDynamic) {\n const pathsResult = await this.getStaticPaths({\n pathname,\n page: components.page,\n isAppPath,\n requestHeaders: req.headers\n });\n staticPaths = pathsResult.staticPaths;\n fallbackMode = pathsResult.fallbackMode;\n hasFallback = typeof fallbackMode !== \"undefined\";\n if (this.nextConfig.output === \"export\") {\n const page = components.page;\n if (fallbackMode !== \"static\") {\n throw new Error(`Page \"${page}\" is missing exported function \"generateStaticParams()\", which is required with \"output: export\" config.`);\n }\n const resolvedWithoutSlash = removeTrailingSlash(resolvedUrlPathname);\n if (!(staticPaths == null ? void 0 : staticPaths.includes(resolvedWithoutSlash))) {\n throw new Error(`Page \"${page}\" is missing param \"${resolvedWithoutSlash}\" in \"generateStaticParams()\", which is required with \"output: export\" config.`);\n }\n }\n if (hasFallback) {\n hasStaticPaths = true;\n }\n }\n if (hasFallback || (staticPaths == null ? void 0 : staticPaths.includes(resolvedUrlPathname)) || // this signals revalidation in deploy environments\n // TODO: make this more generic\n req.headers[\"x-now-route-matches\"]) {\n isSSG = true;\n } else if (!this.renderOpts.dev) {\n isSSG ||= !!prerenderManifest.routes[toRoute(pathname)];\n }\n // Toggle whether or not this is a Data request\n const isNextDataRequest = !!(query.__nextDataReq || req.headers[\"x-nextjs-data\"] && this.serverOptions.webServerConfig) && (isSSG || hasServerProps);\n /**\n * If true, this indicates that the request being made is for an app\n * prefetch request.\n */ const isPrefetchRSCRequest = (req.headers[NEXT_ROUTER_PREFETCH_HEADER.toLowerCase()] === \"1\" || getRequestMeta(req, \"isPrefetchRSCRequest\")) ?? false;\n // when we are handling a middleware prefetch and it doesn't\n // resolve to a static data route we bail early to avoid\n // unexpected SSR invocations\n if (!isSSG && req.headers[\"x-middleware-prefetch\"] && !(is404Page || pathname === \"/_error\")) {\n res.setHeader(\"x-matched-path\", pathname);\n res.setHeader(\"x-middleware-skip\", \"1\");\n res.setHeader(\"cache-control\", \"private, no-cache, no-store, max-age=0, must-revalidate\");\n res.body(\"{}\").send();\n return null;\n }\n delete query.__nextDataReq;\n // normalize req.url for SSG paths as it is not exposed\n // to getStaticProps and the asPath should not expose /_next/data\n if (isSSG && this.minimalMode && req.headers[\"x-matched-path\"] && req.url.startsWith(\"/_next/data\")) {\n req.url = this.stripNextDataPath(req.url);\n }\n if (!!req.headers[\"x-nextjs-data\"] && (!res.statusCode || res.statusCode === 200)) {\n res.setHeader(\"x-nextjs-matched-path\", `${query.__nextLocale ? `/${query.__nextLocale}` : \"\"}${pathname}`);\n }\n // Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later\n const isRSCRequest = isRSCRequestCheck(req);\n // If we're in minimal mode, then try to get the postponed information from\n // the request metadata. If available, use it for resuming the postponed\n // render.\n const minimalPostponed = getRequestMeta(req, \"postponed\");\n // If PPR is enabled, and this is a RSC request (but not a prefetch), then\n // we can use this fact to only generate the flight data for the request\n // because we can't cache the HTML (as it's also dynamic).\n const isDynamicRSCRequest = opts.experimental.ppr && isRSCRequest && !isPrefetchRSCRequest;\n // we need to ensure the status code if /404 is visited directly\n if (is404Page && !isNextDataRequest && !isRSCRequest) {\n res.statusCode = 404;\n }\n // ensure correct status is set when visiting a status page\n // directly e.g. /500\n if (STATIC_STATUS_PAGES.includes(pathname)) {\n res.statusCode = parseInt(pathname.slice(1), 10);\n }\n if (// Server actions can use non-GET/HEAD methods.\n !isServerAction && // Resume can use non-GET/HEAD methods.\n !minimalPostponed && !is404Page && !is500Page && pathname !== \"/_error\" && req.method !== \"HEAD\" && req.method !== \"GET\" && (typeof components.Component === \"string\" || isSSG)) {\n res.statusCode = 405;\n res.setHeader(\"Allow\", [\n \"GET\",\n \"HEAD\"\n ]);\n await this.renderError(null, req, res, pathname);\n return null;\n }\n // handle static page\n if (typeof components.Component === \"string\") {\n return {\n type: \"html\",\n // TODO: Static pages should be serialized as RenderResult\n body: RenderResult.fromStatic(components.Component)\n };\n }\n if (!query.amp) {\n delete query.amp;\n }\n if (opts.supportsDynamicResponse === true) {\n var _components_Document;\n const isBotRequest = isBot(req.headers[\"user-agent\"] || \"\");\n const isSupportedDocument = typeof ((_components_Document = components.Document) == null ? void 0 : _components_Document.getInitialProps) !== \"function\" || // The built-in `Document` component also supports dynamic HTML for concurrent mode.\n NEXT_BUILTIN_DOCUMENT in components.Document;\n // Disable dynamic HTML in cases that we know it won't be generated,\n // so that we can continue generating a cache key when possible.\n // TODO-APP: should the first render for a dynamic app path\n // be static so we can collect revalidate and populate the\n // cache if there are no dynamic data requirements\n opts.supportsDynamicResponse = !isSSG && !isBotRequest && !query.amp && isSupportedDocument;\n opts.isBot = isBotRequest;\n }\n // In development, we always want to generate dynamic HTML.\n if (!isNextDataRequest && isAppPath && opts.dev) {\n opts.supportsDynamicResponse = true;\n }\n const defaultLocale = isSSG ? (_this_nextConfig_i18n = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n.defaultLocale : query.__nextDefaultLocale;\n const locale = query.__nextLocale;\n const locales = (_this_nextConfig_i18n1 = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n1.locales;\n let previewData;\n let isPreviewMode = false;\n if (hasServerProps || isSSG || isAppPath) {\n // For the edge runtime, we don't support preview mode in SSG.\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n const { tryGetPreviewData } = require(\"./api-utils/node/try-get-preview-data\");\n previewData = tryGetPreviewData(req, res, this.renderOpts.previewProps, !!this.nextConfig.experimental.multiZoneDraftMode);\n isPreviewMode = previewData !== false;\n }\n }\n // If this is a request for an app path that should be statically generated\n // and we aren't in the edge runtime, strip the flight headers so it will\n // generate the static response.\n if (isAppPath && !opts.dev && !isPreviewMode && isSSG && isRSCRequest && !isDynamicRSCRequest && (!isEdgeRuntime(opts.runtime) || this.serverOptions.webServerConfig)) {\n stripFlightHeaders(req.headers);\n }\n let isOnDemandRevalidate = false;\n let revalidateOnlyGenerated = false;\n if (isSSG) {\n ({ isOnDemandRevalidate, revalidateOnlyGenerated } = checkIsOnDemandRevalidate(req, this.renderOpts.previewProps));\n }\n if (isSSG && this.minimalMode && req.headers[\"x-matched-path\"]) {\n // the url value is already correct when the matched-path header is set\n resolvedUrlPathname = urlPathname;\n }\n urlPathname = removeTrailingSlash(urlPathname);\n resolvedUrlPathname = removeTrailingSlash(resolvedUrlPathname);\n if (this.localeNormalizer) {\n resolvedUrlPathname = this.localeNormalizer.normalize(resolvedUrlPathname);\n }\n const handleRedirect = (pageData)=>{\n const redirect = {\n destination: pageData.pageProps.__N_REDIRECT,\n statusCode: pageData.pageProps.__N_REDIRECT_STATUS,\n basePath: pageData.pageProps.__N_REDIRECT_BASE_PATH\n };\n const statusCode = getRedirectStatus(redirect);\n const { basePath } = this.nextConfig;\n if (basePath && redirect.basePath !== false && redirect.destination.startsWith(\"/\")) {\n redirect.destination = `${basePath}${redirect.destination}`;\n }\n if (redirect.destination.startsWith(\"/\")) {\n redirect.destination = normalizeRepeatedSlashes(redirect.destination);\n }\n res.redirect(redirect.destination, statusCode).body(redirect.destination).send();\n };\n // remove /_next/data prefix from urlPathname so it matches\n // for direct page visit and /_next/data visit\n if (isNextDataRequest) {\n resolvedUrlPathname = this.stripNextDataPath(resolvedUrlPathname);\n urlPathname = this.stripNextDataPath(urlPathname);\n }\n let ssgCacheKey = null;\n if (!isPreviewMode && isSSG && !opts.supportsDynamicResponse && !isServerAction && !minimalPostponed && !isDynamicRSCRequest) {\n ssgCacheKey = `${locale ? `/${locale}` : \"\"}${(pathname === \"/\" || resolvedUrlPathname === \"/\") && locale ? \"\" : resolvedUrlPathname}${query.amp ? \".amp\" : \"\"}`;\n }\n if ((is404Page || is500Page) && isSSG) {\n ssgCacheKey = `${locale ? `/${locale}` : \"\"}${pathname}${query.amp ? \".amp\" : \"\"}`;\n }\n if (ssgCacheKey) {\n // we only encode path delimiters for path segments from\n // getStaticPaths so we need to attempt decoding the URL\n // to match against and only escape the path delimiters\n // this allows non-ascii values to be handled e.g. Japanese characters\n // TODO: investigate adding this handling for non-SSG pages so\n // non-ascii names work there also\n ssgCacheKey = ssgCacheKey.split(\"/\").map((seg)=>{\n try {\n seg = escapePathDelimiters(decodeURIComponent(seg), true);\n } catch (_) {\n // An improperly encoded URL was provided\n throw new DecodeError(\"failed to decode param\");\n }\n return seg;\n }).join(\"/\");\n // ensure /index and / is normalized to one key\n ssgCacheKey = ssgCacheKey === \"/index\" && pathname === \"/\" ? \"/\" : ssgCacheKey;\n }\n let protocol = \"https:\";\n try {\n const parsedFullUrl = new URL(getRequestMeta(req, \"initURL\") || \"/\", \"http://n\");\n protocol = parsedFullUrl.protocol;\n } catch {}\n // use existing incrementalCache instance if available\n const incrementalCache = globalThis.__incrementalCache || await this.getIncrementalCache({\n requestHeaders: Object.assign({}, req.headers),\n requestProtocol: protocol.substring(0, protocol.length - 1)\n });\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n const { routeModule } = components;\n // allow debugging the skeleton in dev with PPR\n // instead of continuing to resume stream right away\n const isDebugPPRSkeleton = Boolean(this.nextConfig.experimental.ppr && (this.renderOpts.dev || this.experimentalTestProxy) && query.__nextppronly);\n const doRender = async ({ postponed })=>{\n // In development, we always want to generate dynamic HTML.\n let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's\n // a data request, in which case we only produce static HTML.\n !isNextDataRequest && opts.dev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isSSG && !hasStaticPaths || // If this request has provided postponed data, it supports dynamic\n // HTML.\n typeof postponed === \"string\" || // If this is a dynamic RSC request, then this render supports dynamic\n // HTML (it's dynamic).\n isDynamicRSCRequest;\n const origQuery = parseUrl(req.url || \"\", true).query;\n // clear any dynamic route params so they aren't in\n // the resolvedUrl\n if (opts.params) {\n Object.keys(opts.params).forEach((key)=>{\n delete origQuery[key];\n });\n }\n const hadTrailingSlash = urlPathname !== \"/\" && this.nextConfig.trailingSlash;\n const resolvedUrl = formatUrl({\n pathname: `${resolvedUrlPathname}${hadTrailingSlash ? \"/\" : \"\"}`,\n // make sure to only add query values from original URL\n query: origQuery\n });\n const renderOpts = {\n ...components,\n ...opts,\n ...isAppPath ? {\n incrementalCache,\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n isRevalidate: isSSG && !postponed && !isDynamicRSCRequest,\n originalPathname: components.ComponentMod.originalPathname,\n serverActions: this.nextConfig.experimental.serverActions\n } : {},\n isNextDataRequest,\n resolvedUrl,\n locale,\n locales,\n defaultLocale,\n multiZoneDraftMode: this.nextConfig.experimental.multiZoneDraftMode,\n // For getServerSideProps and getInitialProps we need to ensure we use the original URL\n // and not the resolved URL to prevent a hydration mismatch on\n // asPath\n resolvedAsPath: hasServerProps || hasGetInitialProps ? formatUrl({\n // we use the original URL pathname less the _next/data prefix if\n // present\n pathname: `${urlPathname}${hadTrailingSlash ? \"/\" : \"\"}`,\n query: origQuery\n }) : resolvedUrl,\n supportsDynamicResponse,\n isOnDemandRevalidate,\n isDraftMode: isPreviewMode,\n isServerAction,\n postponed\n };\n if (isDebugPPRSkeleton) {\n supportsDynamicResponse = false;\n renderOpts.nextExport = true;\n renderOpts.supportsDynamicResponse = false;\n renderOpts.isStaticGeneration = true;\n renderOpts.isRevalidate = true;\n renderOpts.isDebugPPRSkeleton = true;\n }\n // Legacy render methods will return a render result that needs to be\n // served by the server.\n let result;\n if (routeModule) {\n if (isAppRouteRouteModule(routeModule)) {\n const context = {\n params: opts.params,\n prerenderManifest,\n renderOpts: {\n // App Route's cannot postpone, so don't enable it.\n experimental: {\n ppr: false\n },\n originalPathname: components.ComponentMod.originalPathname,\n supportsDynamicResponse,\n incrementalCache,\n isRevalidate: isSSG\n }\n };\n try {\n const request = NextRequestAdapter.fromBaseNextRequest(req, signalFromNodeResponse(res.originalResponse));\n const response = await routeModule.handle(request, context);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n const cacheTags = context.renderOpts.fetchTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isSSG && process.env.NEXT_RUNTIME !== \"edge\") {\n var _context_renderOpts_store;\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers[\"content-type\"] && blob.type) {\n headers[\"content-type\"] = blob.type;\n }\n const revalidate = ((_context_renderOpts_store = context.renderOpts.store) == null ? void 0 : _context_renderOpts_store.revalidate) ?? false;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: \"ROUTE\",\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n revalidate\n };\n return cacheEntry;\n }\n // Send the response now that we have copied it into the cache.\n await sendResponse(req, res, response, context.renderOpts.waitUntil);\n return null;\n } catch (err) {\n // If this is during static generation, throw the error again.\n if (isSSG) throw err;\n Log.error(err);\n // Otherwise, send a 500 response.\n await sendResponse(req, res, handleInternalServerErrorResponse());\n return null;\n }\n } else if (isPagesRouteModule(routeModule)) {\n // Due to the way we pass data by mutating `renderOpts`, we can't extend\n // the object here but only updating its `clientReferenceManifest` and\n // `nextFontManifest` properties.\n // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952\n renderOpts.nextFontManifest = this.nextFontManifest;\n renderOpts.clientReferenceManifest = components.clientReferenceManifest;\n // Call the built-in render method on the module.\n result = await routeModule.render(req.originalRequest ?? req, res.originalResponse ?? res, {\n page: pathname,\n params: opts.params,\n query,\n renderOpts\n });\n } else if (isAppPageRouteModule(routeModule)) {\n const module = components.routeModule;\n // Due to the way we pass data by mutating `renderOpts`, we can't extend the\n // object here but only updating its `nextFontManifest` field.\n // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952\n renderOpts.nextFontManifest = this.nextFontManifest;\n // Call the built-in render method on the module.\n result = await module.render(req.originalRequest ?? req, res.originalResponse ?? res, {\n page: is404Page ? \"/404\" : pathname,\n params: opts.params,\n query,\n renderOpts\n });\n } else {\n throw new Error(\"Invariant: Unknown route module type\");\n }\n } else {\n // If we didn't match a page, we should fallback to using the legacy\n // render method.\n result = await this.renderHTML(req, res, pathname, query, renderOpts);\n }\n const { metadata } = result;\n const { headers = {}, // Add any fetch tags that were on the page to the response headers.\n fetchTags: cacheTags } = metadata;\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n req.fetchMetrics = metadata.fetchMetrics;\n // we don't throw static to dynamic errors in dev as isSSG\n // is a best guess in dev since we don't have the prerender pass\n // to know whether the path is actually static or not\n if (isAppPath && isSSG && metadata.revalidate === 0 && !this.renderOpts.dev && !renderOpts.experimental.ppr) {\n const staticBailoutInfo = metadata.staticBailoutInfo;\n const err = new Error(`Page changed from static to dynamic at runtime ${urlPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`);\n if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) {\n const stack = staticBailoutInfo.stack;\n err.stack = err.message + stack.substring(stack.indexOf(\"\\n\"));\n }\n throw err;\n }\n // Based on the metadata, we can determine what kind of cache result we\n // should return.\n // Handle `isNotFound`.\n if (\"isNotFound\" in metadata && metadata.isNotFound) {\n return {\n value: null,\n revalidate: metadata.revalidate\n };\n }\n // Handle `isRedirect`.\n if (metadata.isRedirect) {\n return {\n value: {\n kind: \"REDIRECT\",\n props: metadata.pageData ?? metadata.flightData\n },\n revalidate: metadata.revalidate\n };\n }\n // Handle `isNull`.\n if (result.isNull) {\n return null;\n }\n // We now have a valid HTML result that we can return to the user.\n return {\n value: {\n kind: \"PAGE\",\n html: result,\n pageData: metadata.pageData ?? metadata.flightData,\n postponed: metadata.postponed,\n headers,\n status: isAppPath ? res.statusCode : undefined\n },\n revalidate: metadata.revalidate\n };\n };\n const cacheEntry = await this.responseCache.get(ssgCacheKey, async (hasResolved, previousCacheEntry, isRevalidating)=>{\n const isProduction = !this.renderOpts.dev;\n const didRespond = hasResolved || res.sent;\n if (!staticPaths) {\n ({ staticPaths, fallbackMode } = hasStaticPaths ? await this.getStaticPaths({\n pathname,\n requestHeaders: req.headers,\n isAppPath,\n page: components.page\n }) : {\n staticPaths: undefined,\n fallbackMode: false\n });\n }\n if (fallbackMode === \"static\" && isBot(req.headers[\"user-agent\"] || \"\")) {\n fallbackMode = \"blocking\";\n }\n // skip on-demand revalidate if cache is not present and\n // revalidate-if-generated is set\n if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !this.minimalMode) {\n await this.render404(req, res);\n return null;\n }\n if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) {\n isOnDemandRevalidate = true;\n }\n // only allow on-demand revalidate for fallback: true/blocking\n // or for prerendered fallback: false paths\n if (isOnDemandRevalidate && (fallbackMode !== false || previousCacheEntry)) {\n fallbackMode = \"blocking\";\n }\n // We use `ssgCacheKey` here as it is normalized to match the encoding\n // from getStaticPaths along with including the locale.\n //\n // We use the `resolvedUrlPathname` for the development case when this\n // is an app path since it doesn't include locale information.\n let staticPathKey = ssgCacheKey ?? (opts.dev && isAppPath ? resolvedUrlPathname : null);\n if (staticPathKey && query.amp) {\n staticPathKey = staticPathKey.replace(/\\.amp$/, \"\");\n }\n const isPageIncludedInStaticPaths = staticPathKey && (staticPaths == null ? void 0 : staticPaths.includes(staticPathKey));\n if (this.nextConfig.experimental.isExperimentalCompile) {\n fallbackMode = \"blocking\";\n }\n // When we did not respond from cache, we need to choose to block on\n // rendering or return a skeleton.\n //\n // - Data requests always block.\n // - Blocking mode fallback always blocks.\n // - Preview mode toggles all pages to be resolved in a blocking manner.\n // - Non-dynamic pages should block (though this is an impossible\n // case in production).\n // - Dynamic pages should return their skeleton if not defined in\n // getStaticPaths, then finish the data request on the client-side.\n //\n if (process.env.NEXT_RUNTIME !== \"edge\" && !this.minimalMode && fallbackMode !== \"blocking\" && staticPathKey && !didRespond && !isPreviewMode && isDynamic && (isProduction || !staticPaths || !isPageIncludedInStaticPaths)) {\n if (// In development, fall through to render to handle missing\n // getStaticPaths.\n (isProduction || staticPaths && (staticPaths == null ? void 0 : staticPaths.length) > 0) && // When fallback isn't present, abort this render so we 404\n fallbackMode !== \"static\") {\n throw new NoFallbackError();\n }\n if (!isNextDataRequest) {\n // Production already emitted the fallback as static HTML.\n if (isProduction) {\n const html = await this.getFallback(locale ? `/${locale}${pathname}` : pathname);\n return {\n value: {\n kind: \"PAGE\",\n html: RenderResult.fromStatic(html),\n postponed: undefined,\n status: undefined,\n headers: undefined,\n pageData: {}\n }\n };\n } else {\n query.__nextFallback = \"true\";\n // We pass `undefined` as there cannot be a postponed state in\n // development.\n const result = await doRender({\n postponed: undefined\n });\n if (!result) {\n return null;\n }\n // Prevent caching this result\n delete result.revalidate;\n return result;\n }\n }\n }\n const result = await doRender({\n // Only requests that aren't revalidating can be resumed. If we have the\n // minimal postponed data, then we should resume the render with it.\n postponed: !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined\n });\n if (!result) {\n return null;\n }\n return {\n ...result,\n revalidate: result.revalidate\n };\n }, {\n routeKind: routeModule == null ? void 0 : routeModule.definition.kind,\n incrementalCache,\n isOnDemandRevalidate,\n isPrefetch: req.headers.purpose === \"prefetch\"\n });\n if (isPreviewMode) {\n res.setHeader(\"Cache-Control\", \"private, no-cache, no-store, max-age=0, must-revalidate\");\n }\n if (!cacheEntry) {\n if (ssgCacheKey && !(isOnDemandRevalidate && revalidateOnlyGenerated)) {\n // A cache entry might not be generated if a response is written\n // in `getInitialProps` or `getServerSideProps`, but those shouldn't\n // have a cache key. If we do have a cache key but we don't end up\n // with a cache entry, then either Next.js or the application has a\n // bug that needs fixing.\n throw new Error(\"invariant: cache entry required but not generated\");\n }\n return null;\n }\n const didPostpone = ((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) === \"PAGE\" && !!cacheEntry.value.postponed;\n if (isSSG && !this.minimalMode && // We don't want to send a cache header for requests that contain dynamic\n // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC\n // request, then we should set the cache header.\n !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) {\n // set x-nextjs-cache header to match the header\n // we set for the image-optimizer\n res.setHeader(\"x-nextjs-cache\", isOnDemandRevalidate ? \"REVALIDATED\" : cacheEntry.isMiss ? \"MISS\" : cacheEntry.isStale ? \"STALE\" : \"HIT\");\n }\n const { value: cachedData } = cacheEntry;\n // If the cache value is an image, we should error early.\n if ((cachedData == null ? void 0 : cachedData.kind) === \"IMAGE\") {\n throw new Error(\"invariant SSG should not return an image cache value\");\n }\n // Coerce the revalidate parameter from the render.\n let revalidate;\n // If this is a resume request in minimal mode it is streamed with dynamic\n // content and should not be cached.\n if (minimalPostponed) {\n revalidate = 0;\n } else if (this.minimalMode && isRSCRequest && !isPrefetchRSCRequest && opts.experimental.ppr) {\n revalidate = 0;\n } else if (!this.renderOpts.dev || hasServerProps && !isNextDataRequest) {\n // If this is a preview mode request, we shouldn't cache it. We also don't\n // cache 404 pages.\n if (isPreviewMode || is404Page && !isNextDataRequest) {\n revalidate = 0;\n } else if (!isSSG) {\n if (!res.getHeader(\"Cache-Control\")) {\n revalidate = 0;\n }\n } else if (is404Page) {\n const notFoundRevalidate = getRequestMeta(req, \"notFoundRevalidate\");\n revalidate = typeof notFoundRevalidate === \"undefined\" ? 0 : notFoundRevalidate;\n } else if (is500Page) {\n revalidate = 0;\n } else if (typeof cacheEntry.revalidate === \"number\") {\n if (cacheEntry.revalidate < 1) {\n throw new Error(`Invariant: invalid Cache-Control duration provided: ${cacheEntry.revalidate} < 1`);\n }\n revalidate = cacheEntry.revalidate;\n } else if (cacheEntry.revalidate === false) {\n revalidate = CACHE_ONE_YEAR;\n }\n }\n cacheEntry.revalidate = revalidate;\n // If there's a callback for `onCacheEntry`, call it with the cache entry\n // and the revalidate options.\n const onCacheEntry = getRequestMeta(req, \"onCacheEntry\");\n if (onCacheEntry) {\n const finished = await onCacheEntry(cacheEntry, {\n url: getRequestMeta(req, \"initURL\")\n });\n if (finished) {\n // TODO: maybe we have to end the request?\n return null;\n }\n }\n if (!cachedData) {\n // add revalidate metadata before rendering 404 page\n // so that we can use this as source of truth for the\n // cache-control header instead of what the 404 page returns\n // for the revalidate value\n addRequestMeta(req, \"notFoundRevalidate\", cacheEntry.revalidate);\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.revalidate && !res.getHeader(\"Cache-Control\")) {\n res.setHeader(\"Cache-Control\", formatRevalidate({\n revalidate: cacheEntry.revalidate,\n swrDelta: this.nextConfig.experimental.swrDelta\n }));\n }\n if (isNextDataRequest) {\n res.statusCode = 404;\n res.body('{\"notFound\":true}').send();\n return null;\n }\n if (this.renderOpts.dev) {\n query.__nextNotFoundSrcPage = pathname;\n }\n await this.render404(req, res, {\n pathname,\n query\n }, false);\n return null;\n } else if (cachedData.kind === \"REDIRECT\") {\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.revalidate && !res.getHeader(\"Cache-Control\")) {\n res.setHeader(\"Cache-Control\", formatRevalidate({\n revalidate: cacheEntry.revalidate,\n swrDelta: this.nextConfig.experimental.swrDelta\n }));\n }\n if (isNextDataRequest) {\n return {\n type: \"json\",\n body: RenderResult.fromStatic(// @TODO: Handle flight data.\n JSON.stringify(cachedData.props)),\n revalidate: cacheEntry.revalidate\n };\n } else {\n await handleRedirect(cachedData.props);\n return null;\n }\n } else if (cachedData.kind === \"ROUTE\") {\n const headers = {\n ...cachedData.headers\n };\n if (!(this.minimalMode && isSSG)) {\n delete headers[NEXT_CACHE_TAGS_HEADER];\n }\n await sendResponse(req, res, new Response(cachedData.body, {\n headers: fromNodeOutgoingHttpHeaders(headers),\n status: cachedData.status || 200\n }));\n return null;\n } else if (isAppPath) {\n var _cachedData_headers;\n // If the request has a postponed state and it's a resume request we\n // should error.\n if (cachedData.postponed && minimalPostponed) {\n throw new Error(\"Invariant: postponed state should not be present on a resume request\");\n }\n if (cachedData.headers) {\n const headers = {\n ...cachedData.headers\n };\n if (!this.minimalMode || !isSSG) {\n delete headers[NEXT_CACHE_TAGS_HEADER];\n }\n for (let [key, value] of Object.entries(headers)){\n if (typeof value === \"undefined\") continue;\n if (Array.isArray(value)) {\n for (const v of value){\n res.appendHeader(key, v);\n }\n } else if (typeof value === \"number\") {\n value = value.toString();\n res.appendHeader(key, value);\n } else {\n res.appendHeader(key, value);\n }\n }\n }\n if (this.minimalMode && isSSG && ((_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER])) {\n res.setHeader(NEXT_CACHE_TAGS_HEADER, cachedData.headers[NEXT_CACHE_TAGS_HEADER]);\n }\n // If the request is a data request, then we shouldn't set the status code\n // from the response because it should always be 200. This should be gated\n // behind the experimental PPR flag.\n if (cachedData.status && (!isRSCRequest || !opts.experimental.ppr)) {\n res.statusCode = cachedData.status;\n }\n // Mark that the request did postpone if this is a data request.\n if (cachedData.postponed && isRSCRequest) {\n res.setHeader(NEXT_DID_POSTPONE_HEADER, \"1\");\n }\n // we don't go through this block when preview mode is true\n // as preview mode is a dynamic request (bypasses cache) and doesn't\n // generate both HTML and payloads in the same request so continue to just\n // return the generated payload\n if (isRSCRequest && !isPreviewMode) {\n // If this is a dynamic RSC request, then stream the response.\n if (typeof cachedData.pageData !== \"string\") {\n if (cachedData.postponed) {\n throw new Error(\"Invariant: Expected postponed to be undefined\");\n }\n return {\n type: \"rsc\",\n body: cachedData.html,\n // Dynamic RSC responses cannot be cached, even if they're\n // configured with `force-static` because we have no way of\n // distinguishing between `force-static` and pages that have no\n // postponed state.\n // TODO: distinguish `force-static` from pages with no postponed state (static)\n revalidate: isDynamicRSCRequest ? 0 : cacheEntry.revalidate\n };\n }\n // As this isn't a prefetch request, we should serve the static flight\n // data.\n return {\n type: \"rsc\",\n body: RenderResult.fromStatic(cachedData.pageData),\n revalidate: cacheEntry.revalidate\n };\n }\n // This is a request for HTML data.\n let body = cachedData.html;\n // If there's no postponed state, we should just serve the HTML. This\n // should also be the case for a resume request because it's completed\n // as a server render (rather than a static render).\n if (!cachedData.postponed || this.minimalMode) {\n return {\n type: \"html\",\n body,\n revalidate: cacheEntry.revalidate\n };\n }\n // If we're debugging the skeleton, we should just serve the HTML without\n // resuming the render. The returned HTML will be the static shell.\n if (isDebugPPRSkeleton) {\n return {\n type: \"html\",\n body,\n revalidate: 0\n };\n }\n // This request has postponed, so let's create a new transformer that the\n // dynamic data can pipe to that will attach the dynamic data to the end\n // of the response.\n const transformer = new TransformStream();\n body.chain(transformer.readable);\n // Perform the render again, but this time, provide the postponed state.\n // We don't await because we want the result to start streaming now, and\n // we've already chained the transformer's readable to the render result.\n doRender({\n postponed: cachedData.postponed\n }).then(async (result)=>{\n var _result_value;\n if (!result) {\n throw new Error(\"Invariant: expected a result to be returned\");\n }\n if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== \"PAGE\") {\n var _result_value1;\n throw new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`);\n }\n // Pipe the resume result to the transformer.\n await result.value.html.pipeTo(transformer.writable);\n }).catch((err)=>{\n // An error occurred during piping or preparing the render, abort\n // the transformers writer so we can terminate the stream.\n transformer.writable.abort(err).catch((e)=>{\n console.error(\"couldn't abort transformer\", e);\n });\n });\n return {\n type: \"html\",\n body,\n // We don't want to cache the response if it has postponed data because\n // the response being sent to the client it's dynamic parts are streamed\n // to the client on the same request.\n revalidate: 0\n };\n } else if (isNextDataRequest) {\n return {\n type: \"json\",\n body: RenderResult.fromStatic(JSON.stringify(cachedData.pageData)),\n revalidate: cacheEntry.revalidate\n };\n } else {\n return {\n type: \"html\",\n body: cachedData.html,\n revalidate: cacheEntry.revalidate\n };\n }\n }\n stripNextDataPath(path, stripLocale = true) {\n if (path.includes(this.buildId)) {\n const splitPath = path.substring(path.indexOf(this.buildId) + this.buildId.length);\n path = denormalizePagePath(splitPath.replace(/\\.json$/, \"\"));\n }\n if (this.localeNormalizer && stripLocale) {\n return this.localeNormalizer.normalize(path);\n }\n return path;\n }\n // map the route to the actual bundle name\n getOriginalAppPaths(route) {\n if (this.enabledDirectories.app) {\n var _this_appPathRoutes;\n const originalAppPath = (_this_appPathRoutes = this.appPathRoutes) == null ? void 0 : _this_appPathRoutes[route];\n if (!originalAppPath) {\n return null;\n }\n return originalAppPath;\n }\n return null;\n }\n async renderPageComponent(ctx, bubbleNoFallback) {\n var _this_nextConfig_experimental_sri;\n const { query, pathname } = ctx;\n const appPaths = this.getOriginalAppPaths(pathname);\n const isAppPath = Array.isArray(appPaths);\n let page = pathname;\n if (isAppPath) {\n // the last item in the array is the root page, if there are parallel routes\n page = appPaths[appPaths.length - 1];\n }\n const result = await this.findPageComponents({\n page,\n query,\n params: ctx.renderOpts.params || {},\n isAppPath,\n sriEnabled: !!((_this_nextConfig_experimental_sri = this.nextConfig.experimental.sri) == null ? void 0 : _this_nextConfig_experimental_sri.algorithm),\n appPaths,\n // Ensuring for loading page component routes is done via the matcher.\n shouldEnsure: false\n });\n if (result) {\n var _getTracer_getRootSpanAttributes;\n (_getTracer_getRootSpanAttributes = getTracer().getRootSpanAttributes()) == null ? void 0 : _getTracer_getRootSpanAttributes.set(\"next.route\", pathname);\n try {\n return await this.renderToResponseWithComponents(ctx, result);\n } catch (err) {\n const isNoFallbackError = err instanceof NoFallbackError;\n if (!isNoFallbackError || isNoFallbackError && bubbleNoFallback) {\n throw err;\n }\n }\n }\n return false;\n }\n async renderToResponse(ctx) {\n return getTracer().trace(BaseServerSpan.renderToResponse, {\n spanName: `rendering page`,\n attributes: {\n \"next.route\": ctx.pathname\n }\n }, async ()=>{\n return this.renderToResponseImpl(ctx);\n });\n }\n async renderToResponseImpl(ctx) {\n var _this_i18nProvider;\n const { res, query, pathname } = ctx;\n let page = pathname;\n const bubbleNoFallback = !!query._nextBubbleNoFallback;\n delete query[NEXT_RSC_UNION_QUERY];\n delete query._nextBubbleNoFallback;\n const options = {\n i18n: (_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.fromQuery(pathname, query)\n };\n try {\n for await (const match of this.matchers.matchAll(pathname, options)){\n // when a specific invoke-output is meant to be matched\n // ensure a prior dynamic route/page doesn't take priority\n const invokeOutput = getRequestMeta(ctx.req, \"invokeOutput\");\n if (!this.minimalMode && typeof invokeOutput === \"string\" && isDynamicRoute(invokeOutput || \"\") && invokeOutput !== match.definition.pathname) {\n continue;\n }\n const result = await this.renderPageComponent({\n ...ctx,\n pathname: match.definition.pathname,\n renderOpts: {\n ...ctx.renderOpts,\n params: match.params\n }\n }, bubbleNoFallback);\n if (result !== false) return result;\n }\n // currently edge functions aren't receiving the x-matched-path\n // header so we need to fallback to matching the current page\n // when we weren't able to match via dynamic route to handle\n // the rewrite case\n // @ts-expect-error extended in child class web-server\n if (this.serverOptions.webServerConfig) {\n // @ts-expect-error extended in child class web-server\n ctx.pathname = this.serverOptions.webServerConfig.page;\n const result = await this.renderPageComponent(ctx, bubbleNoFallback);\n if (result !== false) return result;\n }\n } catch (error) {\n const err = getProperError(error);\n if (error instanceof MissingStaticPage) {\n console.error(\"Invariant: failed to load static page\", JSON.stringify({\n page,\n url: ctx.req.url,\n matchedPath: ctx.req.headers[\"x-matched-path\"],\n initUrl: getRequestMeta(ctx.req, \"initURL\"),\n didRewrite: !!getRequestMeta(ctx.req, \"rewroteURL\"),\n rewroteUrl: getRequestMeta(ctx.req, \"rewroteURL\")\n }, null, 2));\n throw err;\n }\n if (err instanceof NoFallbackError && bubbleNoFallback) {\n throw err;\n }\n if (err instanceof DecodeError || err instanceof NormalizeError) {\n res.statusCode = 400;\n return await this.renderErrorToResponse(ctx, err);\n }\n res.statusCode = 500;\n // if pages/500 is present we still need to trigger\n // /_error `getInitialProps` to allow reporting error\n if (await this.hasPage(\"/500\")) {\n ctx.query.__nextCustomErrorRender = \"1\";\n await this.renderErrorToResponse(ctx, err);\n delete ctx.query.__nextCustomErrorRender;\n }\n const isWrappedError = err instanceof WrappedBuildError;\n if (!isWrappedError) {\n if (this.minimalMode && process.env.NEXT_RUNTIME !== \"edge\" || this.renderOpts.dev) {\n if (isError(err)) err.page = page;\n throw err;\n }\n this.logError(getProperError(err));\n }\n const response = await this.renderErrorToResponse(ctx, isWrappedError ? err.innerError : err);\n return response;\n }\n if (this.getMiddleware() && !!ctx.req.headers[\"x-nextjs-data\"] && (!res.statusCode || res.statusCode === 200 || res.statusCode === 404)) {\n res.setHeader(\"x-nextjs-matched-path\", `${query.__nextLocale ? `/${query.__nextLocale}` : \"\"}${pathname}`);\n res.statusCode = 200;\n res.setHeader(\"content-type\", \"application/json\");\n res.body(\"{}\");\n res.send();\n return null;\n }\n res.statusCode = 404;\n return this.renderErrorToResponse(ctx, null);\n }\n async renderToHTML(req, res, pathname, query = {}) {\n return getTracer().trace(BaseServerSpan.renderToHTML, async ()=>{\n return this.renderToHTMLImpl(req, res, pathname, query);\n });\n }\n async renderToHTMLImpl(req, res, pathname, query = {}) {\n return this.getStaticHTML((ctx)=>this.renderToResponse(ctx), {\n req,\n res,\n pathname,\n query\n });\n }\n async renderError(err, req, res, pathname, query = {}, setHeaders = true) {\n return getTracer().trace(BaseServerSpan.renderError, async ()=>{\n return this.renderErrorImpl(err, req, res, pathname, query, setHeaders);\n });\n }\n async renderErrorImpl(err, req, res, pathname, query = {}, setHeaders = true) {\n if (setHeaders) {\n res.setHeader(\"Cache-Control\", \"private, no-cache, no-store, max-age=0, must-revalidate\");\n }\n return this.pipe(async (ctx)=>{\n const response = await this.renderErrorToResponse(ctx, err);\n if (this.minimalMode && res.statusCode === 500) {\n throw err;\n }\n return response;\n }, {\n req,\n res,\n pathname,\n query\n });\n }\n async renderErrorToResponse(ctx, err) {\n return getTracer().trace(BaseServerSpan.renderErrorToResponse, async ()=>{\n return this.renderErrorToResponseImpl(ctx, err);\n });\n }\n async renderErrorToResponseImpl(ctx, err) {\n // Short-circuit favicon.ico in development to avoid compiling 404 page when the app has no favicon.ico.\n // Since favicon.ico is automatically requested by the browser.\n if (this.renderOpts.dev && ctx.pathname === \"/favicon.ico\") {\n return {\n type: \"html\",\n body: RenderResult.fromStatic(\"\")\n };\n }\n const { res, query } = ctx;\n try {\n let result = null;\n const is404 = res.statusCode === 404;\n let using404Page = false;\n if (is404) {\n if (this.enabledDirectories.app) {\n // Use the not-found entry in app directory\n result = await this.findPageComponents({\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n query,\n params: {},\n isAppPath: true,\n shouldEnsure: true,\n url: ctx.req.url\n });\n using404Page = result !== null;\n }\n if (!result && await this.hasPage(\"/404\")) {\n result = await this.findPageComponents({\n page: \"/404\",\n query,\n params: {},\n isAppPath: false,\n // Ensuring can't be done here because you never \"match\" a 404 route.\n shouldEnsure: true,\n url: ctx.req.url\n });\n using404Page = result !== null;\n }\n }\n let statusPage = `/${res.statusCode}`;\n if (!ctx.query.__nextCustomErrorRender && !result && STATIC_STATUS_PAGES.includes(statusPage)) {\n // skip ensuring /500 in dev mode as it isn't used and the\n // dev overlay is used instead\n if (statusPage !== \"/500\" || !this.renderOpts.dev) {\n result = await this.findPageComponents({\n page: statusPage,\n query,\n params: {},\n isAppPath: false,\n // Ensuring can't be done here because you never \"match\" a 500\n // route.\n shouldEnsure: true,\n url: ctx.req.url\n });\n }\n }\n if (!result) {\n result = await this.findPageComponents({\n page: \"/_error\",\n query,\n params: {},\n isAppPath: false,\n // Ensuring can't be done here because you never \"match\" an error\n // route.\n shouldEnsure: true,\n url: ctx.req.url\n });\n statusPage = \"/_error\";\n }\n if (process.env.NODE_ENV !== \"production\" && !using404Page && await this.hasPage(\"/_error\") && !await this.hasPage(\"/404\")) {\n this.customErrorNo404Warn();\n }\n if (!result) {\n // this can occur when a project directory has been moved/deleted\n // which is handled in the parent process in development\n if (this.renderOpts.dev) {\n return {\n type: \"html\",\n // wait for dev-server to restart before refreshing\n body: RenderResult.fromStatic(`\n <pre>missing required error components, refreshing...</pre>\n <script>\n async function check() {\n const res = await fetch(location.href).catch(() => ({}))\n\n if (res.status === 200) {\n location.reload()\n } else {\n setTimeout(check, 1000)\n }\n }\n check()\n </script>`)\n };\n }\n throw new WrappedBuildError(new Error(\"missing required error components\"));\n }\n // If the page has a route module, use it for the new match. If it doesn't\n // have a route module, remove the match.\n if (result.components.routeModule) {\n addRequestMeta(ctx.req, \"match\", {\n definition: result.components.routeModule.definition,\n params: undefined\n });\n } else {\n removeRequestMeta(ctx.req, \"match\");\n }\n try {\n return await this.renderToResponseWithComponents({\n ...ctx,\n pathname: statusPage,\n renderOpts: {\n ...ctx.renderOpts,\n err\n }\n }, result);\n } catch (maybeFallbackError) {\n if (maybeFallbackError instanceof NoFallbackError) {\n throw new Error(\"invariant: failed to render error page\");\n }\n throw maybeFallbackError;\n }\n } catch (error) {\n const renderToHtmlError = getProperError(error);\n const isWrappedError = renderToHtmlError instanceof WrappedBuildError;\n if (!isWrappedError) {\n this.logError(renderToHtmlError);\n }\n res.statusCode = 500;\n const fallbackComponents = await this.getFallbackErrorComponents(ctx.req.url);\n if (fallbackComponents) {\n // There was an error, so use it's definition from the route module\n // to add the match to the request.\n addRequestMeta(ctx.req, \"match\", {\n definition: fallbackComponents.routeModule.definition,\n params: undefined\n });\n return this.renderToResponseWithComponents({\n ...ctx,\n pathname: \"/_error\",\n renderOpts: {\n ...ctx.renderOpts,\n // We render `renderToHtmlError` here because `err` is\n // already captured in the stacktrace.\n err: isWrappedError ? renderToHtmlError.innerError : renderToHtmlError\n }\n }, {\n query,\n components: fallbackComponents\n });\n }\n return {\n type: \"html\",\n body: RenderResult.fromStatic(\"Internal Server Error\")\n };\n }\n }\n async renderErrorToHTML(err, req, res, pathname, query = {}) {\n return this.getStaticHTML((ctx)=>this.renderErrorToResponse(ctx, err), {\n req,\n res,\n pathname,\n query\n });\n }\n async render404(req, res, parsedUrl, setHeaders = true) {\n const { pathname, query } = parsedUrl ? parsedUrl : parseUrl(req.url, true);\n if (this.nextConfig.i18n) {\n query.__nextLocale ||= this.nextConfig.i18n.defaultLocale;\n query.__nextDefaultLocale ||= this.nextConfig.i18n.defaultLocale;\n }\n res.statusCode = 404;\n return this.renderError(null, req, res, pathname, query, setHeaders);\n }\n}\nexport function isRSCRequestCheck(req) {\n return req.headers[RSC_HEADER.toLowerCase()] === \"1\" || Boolean(getRequestMeta(req, \"isRSCRequest\"));\n}\n\n//# sourceMappingURL=base-server.js.map","// Translate a pages asset path (relative from a common prefix) back into its logical route\nimport { isDynamicRoute } from \"./is-dynamic\";\n// \"asset path\" being its javascript file, data file, prerendered html,...\nexport default function getRouteFromAssetPath(assetPath, ext) {\n if (ext === void 0) ext = \"\";\n assetPath = assetPath.replace(/\\\\/g, \"/\");\n assetPath = ext && assetPath.endsWith(ext) ? assetPath.slice(0, -ext.length) : assetPath;\n if (assetPath.startsWith(\"/index/\") && !isDynamicRoute(assetPath)) {\n assetPath = assetPath.slice(6);\n } else if (assetPath === \"/index\") {\n assetPath = \"/\";\n }\n return assetPath;\n}\n\n//# sourceMappingURL=get-route-from-asset-path.js.map","import { isIPv6 } from \"./is-ipv6\";\n/**\n * Formats a hostname so that it is a valid host that can be fetched by wrapping\n * IPv6 hosts with brackets.\n * @param hostname\n * @returns\n */ export function formatHostname(hostname) {\n return isIPv6(hostname) ? `[${hostname}]` : hostname;\n}\n\n//# sourceMappingURL=format-hostname.js.map","import { format as formatUrl, parse as parseUrl } from \"url\";\nimport { normalizeLocalePath } from \"../shared/lib/i18n/normalize-locale-path\";\nimport { getPathMatch } from \"../shared/lib/router/utils/path-match\";\nimport { getNamedRouteRegex } from \"../shared/lib/router/utils/route-regex\";\nimport { getRouteMatcher } from \"../shared/lib/router/utils/route-matcher\";\nimport { matchHas, prepareDestination } from \"../shared/lib/router/utils/prepare-destination\";\nimport { removeTrailingSlash } from \"../shared/lib/router/utils/remove-trailing-slash\";\nimport { normalizeRscURL } from \"../shared/lib/router/utils/app-paths\";\nimport { NEXT_QUERY_PARAM_PREFIX } from \"../lib/constants\";\nexport function normalizeVercelUrl(req, trustQuery, paramKeys, pageIsDynamic, defaultRouteRegex) {\n // make sure to normalize req.url on Vercel to strip dynamic params\n // from the query which are added during routing\n if (pageIsDynamic && trustQuery && defaultRouteRegex) {\n const _parsedUrl = parseUrl(req.url, true);\n delete _parsedUrl.search;\n for (const key of Object.keys(_parsedUrl.query)){\n if (key !== NEXT_QUERY_PARAM_PREFIX && key.startsWith(NEXT_QUERY_PARAM_PREFIX) || (paramKeys || Object.keys(defaultRouteRegex.groups)).includes(key)) {\n delete _parsedUrl.query[key];\n }\n }\n req.url = formatUrl(_parsedUrl);\n }\n}\nexport function interpolateDynamicPath(pathname, params, defaultRouteRegex) {\n if (!defaultRouteRegex) return pathname;\n for (const param of Object.keys(defaultRouteRegex.groups)){\n const { optional, repeat } = defaultRouteRegex.groups[param];\n let builtParam = `[${repeat ? \"...\" : \"\"}${param}]`;\n if (optional) {\n builtParam = `[${builtParam}]`;\n }\n const paramIdx = pathname.indexOf(builtParam);\n if (paramIdx > -1) {\n let paramValue;\n const value = params[param];\n if (Array.isArray(value)) {\n paramValue = value.map((v)=>v && encodeURIComponent(v)).join(\"/\");\n } else if (value) {\n paramValue = encodeURIComponent(value);\n } else {\n paramValue = \"\";\n }\n pathname = pathname.slice(0, paramIdx) + paramValue + pathname.slice(paramIdx + builtParam.length);\n }\n }\n return pathname;\n}\nexport function normalizeDynamicRouteParams(params, ignoreOptional, defaultRouteRegex, defaultRouteMatches) {\n let hasValidParams = true;\n if (!defaultRouteRegex) return {\n params,\n hasValidParams: false\n };\n params = Object.keys(defaultRouteRegex.groups).reduce((prev, key)=>{\n let value = params[key];\n if (typeof value === \"string\") {\n value = normalizeRscURL(value);\n }\n if (Array.isArray(value)) {\n value = value.map((val)=>{\n if (typeof val === \"string\") {\n val = normalizeRscURL(val);\n }\n return val;\n });\n }\n // if the value matches the default value we can't rely\n // on the parsed params, this is used to signal if we need\n // to parse x-now-route-matches or not\n const defaultValue = defaultRouteMatches[key];\n const isOptional = defaultRouteRegex.groups[key].optional;\n const isDefaultValue = Array.isArray(defaultValue) ? defaultValue.some((defaultVal)=>{\n return Array.isArray(value) ? value.some((val)=>val.includes(defaultVal)) : value == null ? void 0 : value.includes(defaultVal);\n }) : value == null ? void 0 : value.includes(defaultValue);\n if (isDefaultValue || typeof value === \"undefined\" && !(isOptional && ignoreOptional)) {\n hasValidParams = false;\n }\n // non-provided optional values should be undefined so normalize\n // them to undefined\n if (isOptional && (!value || Array.isArray(value) && value.length === 1 && // fallback optional catch-all SSG pages have\n // [[...paramName]] for the root path on Vercel\n (value[0] === \"index\" || value[0] === `[[...${key}]]`))) {\n value = undefined;\n delete params[key];\n }\n // query values from the proxy aren't already split into arrays\n // so make sure to normalize catch-all values\n if (value && typeof value === \"string\" && defaultRouteRegex.groups[key].repeat) {\n value = value.split(\"/\");\n }\n if (value) {\n prev[key] = value;\n }\n return prev;\n }, {});\n return {\n params,\n hasValidParams\n };\n}\nexport function getUtils({ page, i18n, basePath, rewrites, pageIsDynamic, trailingSlash, caseSensitive }) {\n let defaultRouteRegex;\n let dynamicRouteMatcher;\n let defaultRouteMatches;\n if (pageIsDynamic) {\n defaultRouteRegex = getNamedRouteRegex(page, false);\n dynamicRouteMatcher = getRouteMatcher(defaultRouteRegex);\n defaultRouteMatches = dynamicRouteMatcher(page);\n }\n function handleRewrites(req, parsedUrl) {\n const rewriteParams = {};\n let fsPathname = parsedUrl.pathname;\n const matchesPage = ()=>{\n const fsPathnameNoSlash = removeTrailingSlash(fsPathname || \"\");\n return fsPathnameNoSlash === removeTrailingSlash(page) || (dynamicRouteMatcher == null ? void 0 : dynamicRouteMatcher(fsPathnameNoSlash));\n };\n const checkRewrite = (rewrite)=>{\n const matcher = getPathMatch(rewrite.source + (trailingSlash ? \"(/)?\" : \"\"), {\n removeUnnamedParams: true,\n strict: true,\n sensitive: !!caseSensitive\n });\n let params = matcher(parsedUrl.pathname);\n if ((rewrite.has || rewrite.missing) && params) {\n const hasParams = matchHas(req, parsedUrl.query, rewrite.has, rewrite.missing);\n if (hasParams) {\n Object.assign(params, hasParams);\n } else {\n params = false;\n }\n }\n if (params) {\n const { parsedDestination, destQuery } = prepareDestination({\n appendParamsToQuery: true,\n destination: rewrite.destination,\n params: params,\n query: parsedUrl.query\n });\n // if the rewrite destination is external break rewrite chain\n if (parsedDestination.protocol) {\n return true;\n }\n Object.assign(rewriteParams, destQuery, params);\n Object.assign(parsedUrl.query, parsedDestination.query);\n delete parsedDestination.query;\n Object.assign(parsedUrl, parsedDestination);\n fsPathname = parsedUrl.pathname;\n if (basePath) {\n fsPathname = fsPathname.replace(new RegExp(`^${basePath}`), \"\") || \"/\";\n }\n if (i18n) {\n const destLocalePathResult = normalizeLocalePath(fsPathname, i18n.locales);\n fsPathname = destLocalePathResult.pathname;\n parsedUrl.query.nextInternalLocale = destLocalePathResult.detectedLocale || params.nextInternalLocale;\n }\n if (fsPathname === page) {\n return true;\n }\n if (pageIsDynamic && dynamicRouteMatcher) {\n const dynamicParams = dynamicRouteMatcher(fsPathname);\n if (dynamicParams) {\n parsedUrl.query = {\n ...parsedUrl.query,\n ...dynamicParams\n };\n return true;\n }\n }\n }\n return false;\n };\n for (const rewrite of rewrites.beforeFiles || []){\n checkRewrite(rewrite);\n }\n if (fsPathname !== page) {\n let finished = false;\n for (const rewrite of rewrites.afterFiles || []){\n finished = checkRewrite(rewrite);\n if (finished) break;\n }\n if (!finished && !matchesPage()) {\n for (const rewrite of rewrites.fallback || []){\n finished = checkRewrite(rewrite);\n if (finished) break;\n }\n }\n }\n return rewriteParams;\n }\n function getParamsFromRouteMatches(req, renderOpts, detectedLocale) {\n return getRouteMatcher(function() {\n const { groups, routeKeys } = defaultRouteRegex;\n return {\n re: {\n // Simulate a RegExp match from the \\`req.url\\` input\n exec: (str)=>{\n const obj = Object.fromEntries(new URLSearchParams(str));\n const matchesHasLocale = i18n && detectedLocale && obj[\"1\"] === detectedLocale;\n for (const key of Object.keys(obj)){\n const value = obj[key];\n if (key !== NEXT_QUERY_PARAM_PREFIX && key.startsWith(NEXT_QUERY_PARAM_PREFIX)) {\n const normalizedKey = key.substring(NEXT_QUERY_PARAM_PREFIX.length);\n obj[normalizedKey] = value;\n delete obj[key];\n }\n }\n // favor named matches if available\n const routeKeyNames = Object.keys(routeKeys || {});\n const filterLocaleItem = (val)=>{\n if (i18n) {\n // locale items can be included in route-matches\n // for fallback SSG pages so ensure they are\n // filtered\n const isCatchAll = Array.isArray(val);\n const _val = isCatchAll ? val[0] : val;\n if (typeof _val === \"string\" && i18n.locales.some((item)=>{\n if (item.toLowerCase() === _val.toLowerCase()) {\n detectedLocale = item;\n renderOpts.locale = detectedLocale;\n return true;\n }\n return false;\n })) {\n // remove the locale item from the match\n if (isCatchAll) {\n val.splice(0, 1);\n }\n // the value is only a locale item and\n // shouldn't be added\n return isCatchAll ? val.length === 0 : true;\n }\n }\n return false;\n };\n if (routeKeyNames.every((name)=>obj[name])) {\n return routeKeyNames.reduce((prev, keyName)=>{\n const paramName = routeKeys == null ? void 0 : routeKeys[keyName];\n if (paramName && !filterLocaleItem(obj[keyName])) {\n prev[groups[paramName].pos] = obj[keyName];\n }\n return prev;\n }, {});\n }\n return Object.keys(obj).reduce((prev, key)=>{\n if (!filterLocaleItem(obj[key])) {\n let normalizedKey = key;\n if (matchesHasLocale) {\n normalizedKey = parseInt(key, 10) - 1 + \"\";\n }\n return Object.assign(prev, {\n [normalizedKey]: obj[key]\n });\n }\n return prev;\n }, {});\n }\n },\n groups\n };\n }())(req.headers[\"x-now-route-matches\"]);\n }\n return {\n handleRewrites,\n defaultRouteRegex,\n dynamicRouteMatcher,\n defaultRouteMatches,\n getParamsFromRouteMatches,\n normalizeDynamicRouteParams: (params, ignoreOptional)=>normalizeDynamicRouteParams(params, ignoreOptional, defaultRouteRegex, defaultRouteMatches),\n normalizeVercelUrl: (req, trustQuery, paramKeys)=>normalizeVercelUrl(req, trustQuery, paramKeys, pageIsDynamic, defaultRouteRegex),\n interpolateDynamicPath: (pathname, params)=>interpolateDynamicPath(pathname, params, defaultRouteRegex)\n };\n}\n\n//# sourceMappingURL=server-utils.js.map","import { BLOCKED_PAGES } from \"../shared/lib/constants\";\nexport function isBlockedPage(page) {\n return BLOCKED_PAGES.includes(page);\n}\nexport function cleanAmpPath(pathname) {\n if (pathname.match(/\\?amp=(y|yes|true|1)/)) {\n pathname = pathname.replace(/\\?amp=(y|yes|true|1)&?/, \"?\");\n }\n if (pathname.match(/&amp=(y|yes|true|1)/)) {\n pathname = pathname.replace(/&amp=(y|yes|true|1)/, \"\");\n }\n pathname = pathname.replace(/\\?$/, \"\");\n return pathname;\n}\nexport function debounce(fn, ms, maxWait = Infinity) {\n let timeoutId;\n // The time the debouncing function was first called during this debounce queue.\n let startTime = 0;\n // The time the debouncing function was last called.\n let lastCall = 0;\n // The arguments and this context of the last call to the debouncing function.\n let args, context;\n // A helper used to that either invokes the debounced function, or\n // reschedules the timer if a more recent call was made.\n function run() {\n const now = Date.now();\n const diff = lastCall + ms - now;\n // If the diff is non-positive, then we've waited at least `ms`\n // milliseconds since the last call. Or if we've waited for longer than the\n // max wait time, we must call the debounced function.\n if (diff <= 0 || startTime + maxWait >= now) {\n // It's important to clear the timeout id before invoking the debounced\n // function, in case the function calls the debouncing function again.\n timeoutId = undefined;\n fn.apply(context, args);\n } else {\n // Else, a new call was made after the original timer was scheduled. We\n // didn't clear the timeout (doing so is very slow), so now we need to\n // reschedule the timer for the time difference.\n timeoutId = setTimeout(run, diff);\n }\n }\n return function(...passedArgs) {\n // The arguments and this context of the most recent call are saved so the\n // debounced function can be invoked with them later.\n args = passedArgs;\n context = this;\n // Instead of constantly clearing and scheduling a timer, we record the\n // time of the last call. If a second call comes in before the timer fires,\n // then we'll reschedule in the run function. Doing this is considerably\n // faster.\n lastCall = Date.now();\n // Only schedule a new timer if we're not currently waiting.\n if (timeoutId === undefined) {\n startTime = lastCall;\n timeoutId = setTimeout(run, ms);\n }\n };\n}\n\n//# sourceMappingURL=utils.js.map","import { SERVER_RUNTIME } from \"./constants\";\nexport function isEdgeRuntime(value) {\n return value === SERVER_RUNTIME.experimentalEdge || value === SERVER_RUNTIME.edge;\n}\n\n//# sourceMappingURL=is-edge-runtime.js.map","import { ACTION } from \"../../client/components/app-router-headers\";\nexport function getServerActionRequestMetadata(req) {\n let actionId;\n let contentType;\n if (req.headers instanceof Headers) {\n actionId = req.headers.get(ACTION.toLowerCase()) ?? null;\n contentType = req.headers.get(\"content-type\");\n } else {\n actionId = req.headers[ACTION.toLowerCase()] ?? null;\n contentType = req.headers[\"content-type\"] ?? null;\n }\n const isURLEncodedAction = Boolean(req.method === \"POST\" && contentType === \"application/x-www-form-urlencoded\");\n const isMultipartAction = Boolean(req.method === \"POST\" && (contentType == null ? void 0 : contentType.startsWith(\"multipart/form-data\")));\n const isFetchAction = Boolean(actionId !== undefined && typeof actionId === \"string\" && req.method === \"POST\");\n const isServerAction = Boolean(isFetchAction || isURLEncodedAction || isMultipartAction);\n return {\n actionId,\n isURLEncodedAction,\n isMultipartAction,\n isFetchAction,\n isServerAction\n };\n}\nexport function getIsServerAction(req) {\n return getServerActionRequestMetadata(req).isServerAction;\n}\n\n//# sourceMappingURL=server-action-request-meta.js.map","// escape delimiters used by path-to-regexp\nexport default function escapePathDelimiters(segment, escapeEncoded) {\n return segment.replace(new RegExp(\"([/#?]\" + (escapeEncoded ? \"|%(2f|23|3f)\" : \"\") + \")\", \"gi\"), (char)=>encodeURIComponent(char));\n}\n\n//# sourceMappingURL=escape-path-delimiters.js.map","import { RouteKind } from \"../route-kind\";\nexport function isAppRouteRouteModule(routeModule) {\n return routeModule.definition.kind === RouteKind.APP_ROUTE;\n}\nexport function isAppPageRouteModule(routeModule) {\n return routeModule.definition.kind === RouteKind.APP_PAGE;\n}\nexport function isPagesRouteModule(routeModule) {\n return routeModule.definition.kind === RouteKind.PAGES;\n}\nexport function isPagesAPIRouteModule(routeModule) {\n return routeModule.definition.kind === RouteKind.PAGES_API;\n}\n\n//# sourceMappingURL=checks.js.map","import { appendMutableCookies } from \"../../../web/spec-extension/adapters/request-cookies\";\nexport function handleRedirectResponse(url, mutableCookies, status) {\n const headers = new Headers({\n location: url\n });\n appendMutableCookies(headers, mutableCookies);\n return new Response(null, {\n status,\n headers\n });\n}\nexport function handleBadRequestResponse() {\n return new Response(null, {\n status: 400\n });\n}\nexport function handleNotFoundResponse() {\n return new Response(null, {\n status: 404\n });\n}\nexport function handleMethodNotAllowedResponse() {\n return new Response(null, {\n status: 405\n });\n}\nexport function handleInternalServerErrorResponse() {\n return new Response(null, {\n status: 500\n });\n}\n\n//# sourceMappingURL=response-handlers.js.map","import { RedirectStatusCode } from \"../client/components/redirect-status-code\";\nexport const allowedStatusCodes = new Set([\n 301,\n 302,\n 303,\n 307,\n 308\n]);\nexport function getRedirectStatus(route) {\n return route.statusCode || (route.permanent ? RedirectStatusCode.PermanentRedirect : RedirectStatusCode.TemporaryRedirect);\n}\n// for redirects we restrict matching /_next and for all routes\n// we add an optional trailing slash at the end for easier\n// configuring between trailingSlash: true/false\nexport function modifyRouteRegex(regex, restrictedPaths) {\n if (restrictedPaths) {\n regex = regex.replace(/\\^/, `^(?!${restrictedPaths.map((path)=>path.replace(/\\//g, \"\\\\/\")).join(\"|\")})`);\n }\n regex = regex.replace(/\\$$/, \"(?:\\\\/)?$\");\n return regex;\n}\n\n//# sourceMappingURL=redirect-status.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"vm\");","/**\n * Recursively freezes an object and all of its properties. This prevents the\n * object from being modified at runtime. When the JS runtime is running in\n * strict mode, any attempts to modify a frozen object will throw an error.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n * @param obj The object to freeze.\n */ export function deepFreeze(obj) {\n // If the object is already frozen, there's no need to freeze it again.\n if (Object.isFrozen(obj)) return obj;\n // An array is an object, but we also want to freeze each element in the array\n // as well.\n if (Array.isArray(obj)) {\n for (const item of obj){\n if (!item || typeof item !== \"object\") continue;\n deepFreeze(item);\n }\n return Object.freeze(obj);\n }\n for (const value of Object.values(obj)){\n if (!value || typeof value !== \"object\") continue;\n deepFreeze(value);\n }\n return Object.freeze(obj);\n}\n\n//# sourceMappingURL=deep-freeze.js.map","import { readFileSync } from \"fs\";\nimport { runInNewContext } from \"vm\";\nimport { deepFreeze } from \"../shared/lib/deep-freeze\";\nconst sharedCache = new Map();\nexport function loadManifest(path, shouldCache = true, cache = sharedCache) {\n const cached = shouldCache && cache.get(path);\n if (cached) {\n return cached;\n }\n let manifest = JSON.parse(readFileSync(path, \"utf8\"));\n // Freeze the manifest so it cannot be modified if we're caching it.\n if (shouldCache) {\n manifest = deepFreeze(manifest);\n }\n if (shouldCache) {\n cache.set(path, manifest);\n }\n return manifest;\n}\nexport function evalManifest(path, shouldCache = true, cache = sharedCache) {\n const cached = shouldCache && cache.get(path);\n if (cached) {\n return cached;\n }\n const content = readFileSync(path, \"utf8\");\n if (content.length === 0) {\n throw new Error(\"Manifest file is empty\");\n }\n let contextObject = {};\n runInNewContext(content, contextObject);\n // Freeze the context object so it cannot be modified if we're caching it.\n if (shouldCache) {\n contextObject = deepFreeze(contextObject);\n }\n if (shouldCache) {\n cache.set(path, contextObject);\n }\n return contextObject;\n}\nexport function clearManifestCache(path, cache = sharedCache) {\n return cache.delete(path);\n}\n\n//# sourceMappingURL=load-manifest.js.map","import path from \"path\";\nimport { AUTOMATIC_FONT_OPTIMIZATION_MANIFEST, PAGES_MANIFEST, SERVER_DIRECTORY, APP_PATHS_MANIFEST } from \"../shared/lib/constants\";\nimport { normalizeLocalePath } from \"../shared/lib/i18n/normalize-locale-path\";\nimport { normalizePagePath } from \"../shared/lib/page-path/normalize-page-path\";\nimport { denormalizePagePath } from \"../shared/lib/page-path/denormalize-page-path\";\nimport { PageNotFoundError, MissingStaticPage } from \"../shared/lib/utils\";\nimport LRUCache from \"next/dist/compiled/lru-cache\";\nimport { loadManifest } from \"./load-manifest\";\nimport { promises } from \"fs\";\nconst isDev = process.env.NODE_ENV === \"development\";\nconst pagePathCache = !isDev ? new LRUCache({\n max: 1000\n}) : null;\nexport function getMaybePagePath(page, distDir, locales, isAppPath) {\n const cacheKey = `${page}:${distDir}:${locales}:${isAppPath}`;\n let pagePath = pagePathCache == null ? void 0 : pagePathCache.get(cacheKey);\n // If we have a cached path, we can return it directly.\n if (pagePath) return pagePath;\n const serverBuildPath = path.join(distDir, SERVER_DIRECTORY);\n let appPathsManifest;\n if (isAppPath) {\n appPathsManifest = loadManifest(path.join(serverBuildPath, APP_PATHS_MANIFEST), !isDev);\n }\n const pagesManifest = loadManifest(path.join(serverBuildPath, PAGES_MANIFEST), !isDev);\n try {\n page = denormalizePagePath(normalizePagePath(page));\n } catch (err) {\n console.error(err);\n throw new PageNotFoundError(page);\n }\n const checkManifest = (manifest)=>{\n let curPath = manifest[page];\n if (!manifest[curPath] && locales) {\n const manifestNoLocales = {};\n for (const key of Object.keys(manifest)){\n manifestNoLocales[normalizeLocalePath(key, locales).pathname] = pagesManifest[key];\n }\n curPath = manifestNoLocales[page];\n }\n return curPath;\n };\n if (appPathsManifest) {\n pagePath = checkManifest(appPathsManifest);\n }\n if (!pagePath) {\n pagePath = checkManifest(pagesManifest);\n }\n if (!pagePath) {\n pagePathCache == null ? void 0 : pagePathCache.set(cacheKey, null);\n return null;\n }\n pagePath = path.join(serverBuildPath, pagePath);\n pagePathCache == null ? void 0 : pagePathCache.set(cacheKey, pagePath);\n return pagePath;\n}\nexport function getPagePath(page, distDir, locales, isAppPath) {\n const pagePath = getMaybePagePath(page, distDir, locales, isAppPath);\n if (!pagePath) {\n throw new PageNotFoundError(page);\n }\n return pagePath;\n}\nexport function requirePage(page, distDir, isAppPath) {\n const pagePath = getPagePath(page, distDir, undefined, isAppPath);\n if (pagePath.endsWith(\".html\")) {\n return promises.readFile(pagePath, \"utf8\").catch((err)=>{\n throw new MissingStaticPage(page, err.message);\n });\n }\n // since require is synchronous we can set the specific runtime\n // we are requiring for the require-hook and then clear after\n try {\n process.env.__NEXT_PRIVATE_RUNTIME_TYPE = isAppPath ? \"app\" : \"pages\";\n const mod = process.env.NEXT_MINIMAL ? __non_webpack_require__(pagePath) : require(pagePath);\n return mod;\n } finally{\n process.env.__NEXT_PRIVATE_RUNTIME_TYPE = \"\";\n }\n}\nexport function requireFontManifest(distDir) {\n const serverBuildPath = path.join(distDir, SERVER_DIRECTORY);\n const fontManifest = loadManifest(path.join(serverBuildPath, AUTOMATIC_FONT_OPTIMIZATION_MANIFEST));\n return fontManifest;\n}\n\n//# sourceMappingURL=require.js.map","export function interopDefault(mod) {\n return mod.default || mod;\n}\n\n//# sourceMappingURL=interop-default.js.map","/**\n * Wait for a given number of milliseconds and then resolve.\n *\n * @param ms the number of milliseconds to wait\n */ export async function wait(ms) {\n return new Promise((resolve)=>setTimeout(resolve, ms));\n}\n\n//# sourceMappingURL=wait.js.map","// Keep the key in memory as it should never change during the lifetime of the server in\n// both development and production.\nlet __next_encryption_key_generation_promise = null;\nlet __next_loaded_action_key;\nlet __next_internal_development_raw_action_key;\nexport function arrayBufferToString(buffer) {\n const bytes = new Uint8Array(buffer);\n const len = bytes.byteLength;\n // @anonrig: V8 has a limit of 65535 arguments in a function.\n // For len < 65535, this is faster.\n // https://github.com/vercel/next.js/pull/56377#pullrequestreview-1656181623\n if (len < 65535) {\n return String.fromCharCode.apply(null, bytes);\n }\n let binary = \"\";\n for(let i = 0; i < len; i++){\n binary += String.fromCharCode(bytes[i]);\n }\n return binary;\n}\nexport function stringToUint8Array(binary) {\n const len = binary.length;\n const arr = new Uint8Array(len);\n for(let i = 0; i < len; i++){\n arr[i] = binary.charCodeAt(i);\n }\n return arr;\n}\nexport function encrypt(key, iv, data) {\n return crypto.subtle.encrypt({\n name: \"AES-GCM\",\n iv\n }, key, data);\n}\nexport function decrypt(key, iv, data) {\n return crypto.subtle.decrypt({\n name: \"AES-GCM\",\n iv\n }, key, data);\n}\nexport async function generateEncryptionKeyBase64(dev) {\n // For development, we just keep one key in memory for all actions.\n // This makes things faster.\n if (dev) {\n if (typeof __next_internal_development_raw_action_key !== \"undefined\") {\n return __next_internal_development_raw_action_key;\n }\n }\n // This avoids it being generated multiple times in parallel.\n if (!__next_encryption_key_generation_promise) {\n __next_encryption_key_generation_promise = new Promise(async (resolve, reject)=>{\n try {\n const key = await crypto.subtle.generateKey({\n name: \"AES-GCM\",\n length: 256\n }, true, [\n \"encrypt\",\n \"decrypt\"\n ]);\n const exported = await crypto.subtle.exportKey(\"raw\", key);\n const b64 = btoa(arrayBufferToString(exported));\n resolve([\n key,\n b64\n ]);\n } catch (error) {\n reject(error);\n }\n });\n }\n const [key, b64] = await __next_encryption_key_generation_promise;\n __next_loaded_action_key = key;\n if (dev) {\n __next_internal_development_raw_action_key = b64;\n }\n return b64;\n}\n// This is a global singleton that is used to encode/decode the action bound args from\n// the closure. This can't be using a AsyncLocalStorage as it might happen on the module\n// level. Since the client reference manifest won't be mutated, let's use a global singleton\n// to keep it.\nconst SERVER_ACTION_MANIFESTS_SINGLETON = Symbol.for(\"next.server.action-manifests\");\nexport function setReferenceManifestsSingleton({ clientReferenceManifest, serverActionsManifest, serverModuleMap }) {\n // @ts-ignore\n globalThis[SERVER_ACTION_MANIFESTS_SINGLETON] = {\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap\n };\n}\nexport function getServerModuleMap() {\n const serverActionsManifestSingleton = globalThis[SERVER_ACTION_MANIFESTS_SINGLETON];\n if (!serverActionsManifestSingleton) {\n throw new Error(\"Missing manifest for Server Actions. This is a bug in Next.js\");\n }\n return serverActionsManifestSingleton.serverModuleMap;\n}\nexport function getClientReferenceManifestSingleton() {\n const serverActionsManifestSingleton = globalThis[SERVER_ACTION_MANIFESTS_SINGLETON];\n if (!serverActionsManifestSingleton) {\n throw new Error(\"Missing manifest for Server Actions. This is a bug in Next.js\");\n }\n return serverActionsManifestSingleton.clientReferenceManifest;\n}\nexport async function getActionEncryptionKey() {\n if (__next_loaded_action_key) {\n return __next_loaded_action_key;\n }\n const serverActionsManifestSingleton = globalThis[SERVER_ACTION_MANIFESTS_SINGLETON];\n if (!serverActionsManifestSingleton) {\n throw new Error(\"Missing manifest for Server Actions. This is a bug in Next.js\");\n }\n const rawKey = process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY || serverActionsManifestSingleton.serverActionsManifest.encryptionKey;\n if (rawKey === undefined) {\n throw new Error(\"Missing encryption key for Server Actions\");\n }\n __next_loaded_action_key = await crypto.subtle.importKey(\"raw\", stringToUint8Array(atob(rawKey)), \"AES-GCM\", true, [\n \"encrypt\",\n \"decrypt\"\n ]);\n return __next_loaded_action_key;\n}\n\n//# sourceMappingURL=encryption-utils.js.map","import { BUILD_MANIFEST, REACT_LOADABLE_MANIFEST, CLIENT_REFERENCE_MANIFEST, SERVER_REFERENCE_MANIFEST, UNDERSCORE_NOT_FOUND_ROUTE } from \"../shared/lib/constants\";\nimport { join } from \"path\";\nimport { requirePage } from \"./require\";\nimport { interopDefault } from \"../lib/interop-default\";\nimport { getTracer } from \"./lib/trace/tracer\";\nimport { LoadComponentsSpan } from \"./lib/trace/constants\";\nimport { evalManifest, loadManifest } from \"./load-manifest\";\nimport { wait } from \"../lib/wait\";\nimport { setReferenceManifestsSingleton } from \"./app-render/encryption-utils\";\nimport { createServerModuleMap } from \"./app-render/action-utils\";\n/**\n * Load manifest file with retries, defaults to 3 attempts.\n */ export async function loadManifestWithRetries(manifestPath, attempts = 3) {\n while(true){\n try {\n return loadManifest(manifestPath);\n } catch (err) {\n attempts--;\n if (attempts <= 0) throw err;\n await wait(100);\n }\n }\n}\n/**\n * Load manifest file with retries, defaults to 3 attempts.\n */ export async function evalManifestWithRetries(manifestPath, attempts = 3) {\n while(true){\n try {\n return evalManifest(manifestPath);\n } catch (err) {\n attempts--;\n if (attempts <= 0) throw err;\n await wait(100);\n }\n }\n}\nasync function loadClientReferenceManifest(manifestPath, entryName) {\n try {\n const context = await evalManifestWithRetries(manifestPath);\n return context.__RSC_MANIFEST[entryName];\n } catch (err) {\n return undefined;\n }\n}\nasync function loadComponentsImpl({ distDir, page, isAppPath }) {\n let DocumentMod = {};\n let AppMod = {};\n if (!isAppPath) {\n [DocumentMod, AppMod] = await Promise.all([\n Promise.resolve().then(()=>requirePage(\"/_document\", distDir, false)),\n Promise.resolve().then(()=>requirePage(\"/_app\", distDir, false))\n ]);\n }\n // Make sure to avoid loading the manifest for Route Handlers\n const hasClientManifest = isAppPath && (page.endsWith(\"/page\") || page === UNDERSCORE_NOT_FOUND_ROUTE);\n // Load the manifest files first\n const [buildManifest, reactLoadableManifest, clientReferenceManifest, serverActionsManifest] = await Promise.all([\n loadManifestWithRetries(join(distDir, BUILD_MANIFEST)),\n loadManifestWithRetries(join(distDir, REACT_LOADABLE_MANIFEST)),\n hasClientManifest ? loadClientReferenceManifest(join(distDir, \"server\", \"app\", page.replace(/%5F/g, \"_\") + \"_\" + CLIENT_REFERENCE_MANIFEST + \".js\"), page.replace(/%5F/g, \"_\")) : undefined,\n isAppPath ? loadManifestWithRetries(join(distDir, \"server\", SERVER_REFERENCE_MANIFEST + \".json\")).catch(()=>null) : null\n ]);\n // Before requring the actual page module, we have to set the reference manifests\n // to our global store so Server Action's encryption util can access to them\n // at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setReferenceManifestsSingleton({\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest,\n pageName: page\n })\n });\n }\n const ComponentMod = await Promise.resolve().then(()=>requirePage(page, distDir, isAppPath));\n const Component = interopDefault(ComponentMod);\n const Document = interopDefault(DocumentMod);\n const App = interopDefault(AppMod);\n const { getServerSideProps, getStaticProps, getStaticPaths, routeModule } = ComponentMod;\n return {\n App,\n Document,\n Component,\n buildManifest,\n reactLoadableManifest,\n pageConfig: ComponentMod.config || {},\n ComponentMod,\n getServerSideProps,\n getStaticProps,\n getStaticPaths,\n clientReferenceManifest,\n serverActionsManifest,\n isAppPath,\n page,\n routeModule\n };\n}\nexport const loadComponents = getTracer().wrap(LoadComponentsSpan.loadComponents, loadComponentsImpl);\n\n//# sourceMappingURL=load-components.js.map","import { normalizeAppPath } from \"../../shared/lib/router/utils/app-paths\";\nimport { pathHasPrefix } from \"../../shared/lib/router/utils/path-has-prefix\";\nimport { removePathPrefix } from \"../../shared/lib/router/utils/remove-path-prefix\";\n// This function creates a Flight-acceptable server module map proxy from our\n// Server Reference Manifest similar to our client module map.\n// This is because our manifest contains a lot of internal Next.js data that\n// are relevant to the runtime, workers, etc. that React doesn't need to know.\nexport function createServerModuleMap({ serverActionsManifest, pageName }) {\n return new Proxy({}, {\n get: (_, id)=>{\n return {\n id: serverActionsManifest[process.env.NEXT_RUNTIME === \"edge\" ? \"edge\" : \"node\"][id].workers[normalizeWorkerPageName(pageName)],\n name: id,\n chunks: []\n };\n }\n });\n}\n/**\n * Checks if the requested action has a worker for the current page.\n * If not, it returns the first worker that has a handler for the action.\n */ export function selectWorkerForForwarding(actionId, pageName, serverActionsManifest) {\n var _serverActionsManifest__actionId;\n const workers = (_serverActionsManifest__actionId = serverActionsManifest[process.env.NEXT_RUNTIME === \"edge\" ? \"edge\" : \"node\"][actionId]) == null ? void 0 : _serverActionsManifest__actionId.workers;\n const workerName = normalizeWorkerPageName(pageName);\n // no workers, nothing to forward to\n if (!workers) return;\n // if there is a worker for this page, no need to forward it.\n if (workers[workerName]) {\n return;\n }\n // otherwise, grab the first worker that has a handler for this action id\n return denormalizeWorkerPageName(Object.keys(workers)[0]);\n}\n/**\n * The flight entry loader keys actions by bundlePath.\n * bundlePath corresponds with the relative path (including 'app') to the page entrypoint.\n */ function normalizeWorkerPageName(pageName) {\n if (pathHasPrefix(pageName, \"app\")) {\n return pageName;\n }\n return \"app\" + pageName;\n}\n/**\n * Converts a bundlePath (relative path to the entrypoint) to a routable page name\n */ function denormalizeWorkerPageName(bundlePath) {\n return normalizeAppPath(removePathPrefix(bundlePath, \"app\"));\n}\n\n//# sourceMappingURL=action-utils.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"stream\");","import { DetachedPromise } from \"./detached-promise\";\n/**\n * A wrapper for a function that will only allow one call to the function to\n * execute at a time.\n */ export class Batcher {\n constructor(cacheKeyFn, /**\n * A function that will be called to schedule the wrapped function to be\n * executed. This defaults to a function that will execute the function\n * immediately.\n */ schedulerFn = (fn)=>fn()){\n this.cacheKeyFn = cacheKeyFn;\n this.schedulerFn = schedulerFn;\n this.pending = new Map();\n }\n static create(options) {\n return new Batcher(options == null ? void 0 : options.cacheKeyFn, options == null ? void 0 : options.schedulerFn);\n }\n /**\n * Wraps a function in a promise that will be resolved or rejected only once\n * for a given key. This will allow multiple calls to the function to be\n * made, but only one will be executed at a time. The result of the first\n * call will be returned to all callers.\n *\n * @param key the key to use for the cache\n * @param fn the function to wrap\n * @returns a promise that resolves to the result of the function\n */ async batch(key, fn) {\n const cacheKey = this.cacheKeyFn ? await this.cacheKeyFn(key) : key;\n if (cacheKey === null) {\n return fn(cacheKey, Promise.resolve);\n }\n const pending = this.pending.get(cacheKey);\n if (pending) return pending;\n const { promise, resolve, reject } = new DetachedPromise();\n this.pending.set(cacheKey, promise);\n this.schedulerFn(async ()=>{\n try {\n const result = await fn(cacheKey, resolve);\n // Resolving a promise multiple times is a no-op, so we can safely\n // resolve all pending promises with the same result.\n resolve(result);\n } catch (err) {\n reject(err);\n } finally{\n this.pending.delete(cacheKey);\n }\n });\n return promise;\n }\n}\n\n//# sourceMappingURL=batcher.js.map","/**\n * Schedules a function to be called on the next tick after the other promises\n * have been resolved.\n *\n * @param cb the function to schedule\n */ export const scheduleOnNextTick = (cb)=>{\n // We use Promise.resolve().then() here so that the operation is scheduled at\n // the end of the promise job queue, we then add it to the next process tick\n // to ensure it's evaluated afterwards.\n //\n // This was inspired by the implementation of the DataLoader interface: https://github.com/graphql/dataloader/blob/d336bd15282664e0be4b4a657cb796f09bafbc6b/src/index.js#L213-L255\n //\n Promise.resolve().then(()=>{\n process.nextTick(cb);\n });\n};\n/**\n * Schedules a function to be called using `setImmediate` or `setTimeout` if\n * `setImmediate` is not available (like in the Edge runtime).\n *\n * @param cb the function to schedule\n */ export const scheduleImmediate = (cb)=>{\n if (process.env.NEXT_RUNTIME === \"edge\") {\n setTimeout(cb, 0);\n } else {\n setImmediate(cb);\n }\n};\n/**\n * returns a promise than resolves in a future task. There is no guarantee that the task it resolves in\n * will be the next task but if you await it you can at least be sure that the current task is over and\n * most usefully that the entire microtask queue of the current task has been emptied.\n */ export function atLeastOneTask() {\n return new Promise((resolve)=>scheduleImmediate(resolve));\n}\n\n//# sourceMappingURL=scheduler.js.map","import RenderResult from \"../render-result\";\nexport async function fromResponseCacheEntry(cacheEntry) {\n var _cacheEntry_value;\n return {\n ...cacheEntry,\n value: ((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) === \"PAGE\" ? {\n kind: \"PAGE\",\n html: await cacheEntry.value.html.toUnchunkedString(true),\n postponed: cacheEntry.value.postponed,\n pageData: cacheEntry.value.pageData,\n headers: cacheEntry.value.headers,\n status: cacheEntry.value.status\n } : cacheEntry.value\n };\n}\nexport async function toResponseCacheEntry(response) {\n var _response_value, _response_value1;\n if (!response) return null;\n if (((_response_value = response.value) == null ? void 0 : _response_value.kind) === \"FETCH\") {\n throw new Error(\"Invariant: unexpected cachedResponse of kind fetch in response cache\");\n }\n return {\n isMiss: response.isMiss,\n isStale: response.isStale,\n revalidate: response.revalidate,\n value: ((_response_value1 = response.value) == null ? void 0 : _response_value1.kind) === \"PAGE\" ? {\n kind: \"PAGE\",\n html: RenderResult.fromStatic(response.value.html),\n pageData: response.value.pageData,\n postponed: response.value.postponed,\n headers: response.value.headers,\n status: response.value.status\n } : response.value\n };\n}\n\n//# sourceMappingURL=utils.js.map","import { RouteKind } from \"../future/route-kind\";\nimport { Batcher } from \"../../lib/batcher\";\nimport { scheduleOnNextTick } from \"../../lib/scheduler\";\nimport { fromResponseCacheEntry, toResponseCacheEntry } from \"./utils\";\nexport * from \"./types\";\nexport default class ResponseCache {\n constructor(minimalMode){\n this.batcher = Batcher.create({\n // Ensure on-demand revalidate doesn't block normal requests, it should be\n // safe to run an on-demand revalidate for the same key as a normal request.\n cacheKeyFn: ({ key, isOnDemandRevalidate })=>`${key}-${isOnDemandRevalidate ? \"1\" : \"0\"}`,\n // We wait to do any async work until after we've added our promise to\n // `pendingResponses` to ensure that any any other calls will reuse the\n // same promise until we've fully finished our work.\n schedulerFn: scheduleOnNextTick\n });\n // this is a hack to avoid Webpack knowing this is equal to this.minimalMode\n // because we replace this.minimalMode to true in production bundles.\n const minimalModeKey = \"minimalMode\";\n this[minimalModeKey] = minimalMode;\n }\n async get(key, responseGenerator, context) {\n // If there is no key for the cache, we can't possibly look this up in the\n // cache so just return the result of the response generator.\n if (!key) return responseGenerator(false, null);\n const { incrementalCache, isOnDemandRevalidate = false } = context;\n const response = await this.batcher.batch({\n key,\n isOnDemandRevalidate\n }, async (cacheKey, resolve)=>{\n var _this_previousCacheItem;\n // We keep the previous cache entry around to leverage when the\n // incremental cache is disabled in minimal mode.\n if (this.minimalMode && ((_this_previousCacheItem = this.previousCacheItem) == null ? void 0 : _this_previousCacheItem.key) === cacheKey && this.previousCacheItem.expiresAt > Date.now()) {\n return this.previousCacheItem.entry;\n }\n // Coerce the kindHint into a given kind for the incremental cache.\n let kindHint;\n if (context.routeKind === RouteKind.APP_PAGE || context.routeKind === RouteKind.APP_ROUTE) {\n kindHint = \"app\";\n } else if (context.routeKind === RouteKind.PAGES) {\n kindHint = \"pages\";\n }\n let resolved = false;\n let cachedResponse = null;\n try {\n cachedResponse = !this.minimalMode ? await incrementalCache.get(key, {\n kindHint\n }) : null;\n if (cachedResponse && !isOnDemandRevalidate) {\n var _cachedResponse_value;\n if (((_cachedResponse_value = cachedResponse.value) == null ? void 0 : _cachedResponse_value.kind) === \"FETCH\") {\n throw new Error(`invariant: unexpected cachedResponse of kind fetch in response cache`);\n }\n resolve({\n ...cachedResponse,\n revalidate: cachedResponse.curRevalidate\n });\n resolved = true;\n if (!cachedResponse.isStale || context.isPrefetch) {\n // The cached value is still valid, so we don't need\n // to update it yet.\n return null;\n }\n }\n const cacheEntry = await responseGenerator(resolved, cachedResponse, true);\n // If the cache entry couldn't be generated, we don't want to cache\n // the result.\n if (!cacheEntry) {\n // Unset the previous cache item if it was set.\n if (this.minimalMode) this.previousCacheItem = undefined;\n return null;\n }\n const resolveValue = await fromResponseCacheEntry({\n ...cacheEntry,\n isMiss: !cachedResponse\n });\n if (!resolveValue) {\n // Unset the previous cache item if it was set.\n if (this.minimalMode) this.previousCacheItem = undefined;\n return null;\n }\n // For on-demand revalidate wait to resolve until cache is set.\n // Otherwise resolve now.\n if (!isOnDemandRevalidate && !resolved) {\n resolve(resolveValue);\n resolved = true;\n }\n if (typeof resolveValue.revalidate !== \"undefined\") {\n if (this.minimalMode) {\n this.previousCacheItem = {\n key: cacheKey,\n entry: resolveValue,\n expiresAt: Date.now() + 1000\n };\n } else {\n await incrementalCache.set(key, resolveValue.value, {\n revalidate: resolveValue.revalidate\n });\n }\n }\n return resolveValue;\n } catch (err) {\n // When a getStaticProps path is erroring we automatically re-set the\n // existing cache under a new expiration to prevent non-stop retrying.\n if (cachedResponse) {\n await incrementalCache.set(key, cachedResponse.value, {\n revalidate: Math.min(Math.max(cachedResponse.revalidate || 3, 3), 30)\n });\n }\n // While revalidating in the background we can't reject as we already\n // resolved the cache entry so log the error here.\n if (resolved) {\n console.error(err);\n return null;\n }\n // We haven't resolved yet, so let's throw to indicate an error.\n throw err;\n }\n });\n return toResponseCacheEntry(response);\n }\n}\n\n//# sourceMappingURL=index.js.map","/**\n * A shared cache of revalidate timings for routes. This cache is used so we\n * don't have to modify the prerender manifest when we want to update the\n * revalidate timings for a route.\n */ export class SharedRevalidateTimings {\n static #_ = /**\n * The in-memory cache of revalidate timings for routes. This cache is\n * populated when the cache is updated with new timings.\n */ this.timings = new Map();\n constructor(/**\n * The prerender manifest that contains the initial revalidate timings for\n * routes.\n */ prerenderManifest){\n this.prerenderManifest = prerenderManifest;\n }\n /**\n * Try to get the revalidate timings for a route. This will first try to get\n * the timings from the in-memory cache. If the timings are not present in the\n * in-memory cache, then the timings will be sourced from the prerender\n * manifest.\n *\n * @param route the route to get the revalidate timings for\n * @returns the revalidate timings for the route, or undefined if the timings\n * are not present in the in-memory cache or the prerender manifest\n */ get(route) {\n var _this_prerenderManifest_routes_route;\n // This is a copy on write cache that is updated when the cache is updated.\n // If the cache is never written to, then the timings will be sourced from\n // the prerender manifest.\n let revalidate = SharedRevalidateTimings.timings.get(route);\n if (typeof revalidate !== \"undefined\") return revalidate;\n revalidate = (_this_prerenderManifest_routes_route = this.prerenderManifest.routes[route]) == null ? void 0 : _this_prerenderManifest_routes_route.initialRevalidateSeconds;\n if (typeof revalidate !== \"undefined\") return revalidate;\n return undefined;\n }\n /**\n * Set the revalidate timings for a route.\n *\n * @param route the route to set the revalidate timings for\n * @param revalidate the revalidate timings for the route\n */ set(route, revalidate) {\n SharedRevalidateTimings.timings.set(route, revalidate);\n }\n /**\n * Clear the in-memory cache of revalidate timings for routes.\n */ clear() {\n SharedRevalidateTimings.timings.clear();\n }\n}\n\n//# sourceMappingURL=shared-revalidate-timings.js.map","import FetchCache from \"./fetch-cache\";\nimport FileSystemCache from \"./file-system-cache\";\nimport { normalizePagePath } from \"../../../shared/lib/page-path/normalize-page-path\";\nimport { CACHE_ONE_YEAR, NEXT_CACHE_REVALIDATED_TAGS_HEADER, NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER, PRERENDER_REVALIDATE_HEADER } from \"../../../lib/constants\";\nimport { toRoute } from \"../to-route\";\nimport { SharedRevalidateTimings } from \"./shared-revalidate-timings\";\nexport class CacheHandler {\n // eslint-disable-next-line\n constructor(_ctx){}\n async get(..._args) {\n return {};\n }\n async set(..._args) {}\n async revalidateTag(..._args) {}\n resetRequestCache() {}\n}\nexport class IncrementalCache {\n constructor({ fs, dev, appDir, pagesDir, flushToDisk, fetchCache, minimalMode, serverDistDir, requestHeaders, requestProtocol, maxMemoryCacheSize, getPrerenderManifest, fetchCacheKeyPrefix, CurCacheHandler, allowedRevalidateHeaderKeys, experimental }){\n var _this_prerenderManifest_preview, _this_prerenderManifest, _this_prerenderManifest_preview1, _this_prerenderManifest1;\n this.locks = new Map();\n this.unlocks = new Map();\n const debug = !!process.env.NEXT_PRIVATE_DEBUG_CACHE;\n this.hasCustomCacheHandler = Boolean(CurCacheHandler);\n if (!CurCacheHandler) {\n if (fs && serverDistDir) {\n if (debug) {\n console.log(\"using filesystem cache handler\");\n }\n CurCacheHandler = FileSystemCache;\n }\n if (FetchCache.isAvailable({\n _requestHeaders: requestHeaders\n }) && minimalMode && fetchCache) {\n if (debug) {\n console.log(\"using fetch cache handler\");\n }\n CurCacheHandler = FetchCache;\n }\n } else if (debug) {\n console.log(\"using custom cache handler\", CurCacheHandler.name);\n }\n if (process.env.__NEXT_TEST_MAX_ISR_CACHE) {\n // Allow cache size to be overridden for testing purposes\n maxMemoryCacheSize = parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE, 10);\n }\n this.dev = dev;\n this.disableForTestmode = process.env.NEXT_PRIVATE_TEST_PROXY === \"true\";\n // this is a hack to avoid Webpack knowing this is equal to this.minimalMode\n // because we replace this.minimalMode to true in production bundles.\n const minimalModeKey = \"minimalMode\";\n this[minimalModeKey] = minimalMode;\n this.requestHeaders = requestHeaders;\n this.requestProtocol = requestProtocol;\n this.allowedRevalidateHeaderKeys = allowedRevalidateHeaderKeys;\n this.prerenderManifest = getPrerenderManifest();\n this.revalidateTimings = new SharedRevalidateTimings(this.prerenderManifest);\n this.fetchCacheKeyPrefix = fetchCacheKeyPrefix;\n let revalidatedTags = [];\n if (requestHeaders[PRERENDER_REVALIDATE_HEADER] === ((_this_prerenderManifest = this.prerenderManifest) == null ? void 0 : (_this_prerenderManifest_preview = _this_prerenderManifest.preview) == null ? void 0 : _this_prerenderManifest_preview.previewModeId)) {\n this.isOnDemandRevalidate = true;\n }\n if (minimalMode && typeof requestHeaders[NEXT_CACHE_REVALIDATED_TAGS_HEADER] === \"string\" && requestHeaders[NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER] === ((_this_prerenderManifest1 = this.prerenderManifest) == null ? void 0 : (_this_prerenderManifest_preview1 = _this_prerenderManifest1.preview) == null ? void 0 : _this_prerenderManifest_preview1.previewModeId)) {\n revalidatedTags = requestHeaders[NEXT_CACHE_REVALIDATED_TAGS_HEADER].split(\",\");\n }\n if (CurCacheHandler) {\n this.cacheHandler = new CurCacheHandler({\n dev,\n fs,\n flushToDisk,\n serverDistDir,\n revalidatedTags,\n maxMemoryCacheSize,\n _pagesDir: !!pagesDir,\n _appDir: !!appDir,\n _requestHeaders: requestHeaders,\n fetchCacheKeyPrefix,\n experimental\n });\n }\n }\n calculateRevalidate(pathname, fromTime, dev) {\n // in development we don't have a prerender-manifest\n // and default to always revalidating to allow easier debugging\n if (dev) return new Date().getTime() - 1000;\n // if an entry isn't present in routes we fallback to a default\n // of revalidating after 1 second.\n const initialRevalidateSeconds = this.revalidateTimings.get(toRoute(pathname)) ?? 1;\n const revalidateAfter = typeof initialRevalidateSeconds === \"number\" ? initialRevalidateSeconds * 1000 + fromTime : initialRevalidateSeconds;\n return revalidateAfter;\n }\n _getPathname(pathname, fetchCache) {\n return fetchCache ? pathname : normalizePagePath(pathname);\n }\n resetRequestCache() {\n var _this_cacheHandler_resetRequestCache, _this_cacheHandler;\n (_this_cacheHandler = this.cacheHandler) == null ? void 0 : (_this_cacheHandler_resetRequestCache = _this_cacheHandler.resetRequestCache) == null ? void 0 : _this_cacheHandler_resetRequestCache.call(_this_cacheHandler);\n }\n async unlock(cacheKey) {\n const unlock = this.unlocks.get(cacheKey);\n if (unlock) {\n unlock();\n this.locks.delete(cacheKey);\n this.unlocks.delete(cacheKey);\n }\n }\n async lock(cacheKey) {\n if (process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT && process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY && process.env.NEXT_RUNTIME !== \"edge\") {\n const invokeIpcMethod = require(\"../server-ipc/request-utils\").invokeIpcMethod;\n await invokeIpcMethod({\n method: \"lock\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n cacheKey\n ]\n });\n return async ()=>{\n await invokeIpcMethod({\n method: \"unlock\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n cacheKey\n ]\n });\n };\n }\n let unlockNext = ()=>Promise.resolve();\n const existingLock = this.locks.get(cacheKey);\n if (existingLock) {\n await existingLock;\n } else {\n const newLock = new Promise((resolve)=>{\n unlockNext = async ()=>{\n resolve();\n };\n });\n this.locks.set(cacheKey, newLock);\n this.unlocks.set(cacheKey, unlockNext);\n }\n return unlockNext;\n }\n async revalidateTag(tags) {\n var _this_cacheHandler_revalidateTag, _this_cacheHandler;\n if (process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT && process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY && process.env.NEXT_RUNTIME !== \"edge\") {\n const invokeIpcMethod = require(\"../server-ipc/request-utils\").invokeIpcMethod;\n return invokeIpcMethod({\n method: \"revalidateTag\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n ...arguments\n ]\n });\n }\n return (_this_cacheHandler = this.cacheHandler) == null ? void 0 : (_this_cacheHandler_revalidateTag = _this_cacheHandler.revalidateTag) == null ? void 0 : _this_cacheHandler_revalidateTag.call(_this_cacheHandler, tags);\n }\n // x-ref: https://github.com/facebook/react/blob/2655c9354d8e1c54ba888444220f63e836925caa/packages/react/src/ReactFetch.js#L23\n async fetchCacheKey(url, init = {}) {\n // this should be bumped anytime a fix is made to cache entries\n // that should bust the cache\n const MAIN_KEY_PREFIX = \"v3\";\n const bodyChunks = [];\n const encoder = new TextEncoder();\n const decoder = new TextDecoder();\n if (init.body) {\n // handle ReadableStream body\n if (typeof init.body.getReader === \"function\") {\n const readableBody = init.body;\n const chunks = [];\n try {\n await readableBody.pipeTo(new WritableStream({\n write (chunk) {\n if (typeof chunk === \"string\") {\n chunks.push(encoder.encode(chunk));\n bodyChunks.push(chunk);\n } else {\n chunks.push(chunk);\n bodyChunks.push(decoder.decode(chunk, {\n stream: true\n }));\n }\n }\n }));\n // Flush the decoder.\n bodyChunks.push(decoder.decode());\n // Create a new buffer with all the chunks.\n const length = chunks.reduce((total, arr)=>total + arr.length, 0);\n const arrayBuffer = new Uint8Array(length);\n // Push each of the chunks into the new array buffer.\n let offset = 0;\n for (const chunk of chunks){\n arrayBuffer.set(chunk, offset);\n offset += chunk.length;\n }\n init._ogBody = arrayBuffer;\n } catch (err) {\n console.error(\"Problem reading body\", err);\n }\n } else if (typeof init.body.keys === \"function\") {\n const formData = init.body;\n init._ogBody = init.body;\n for (const key of new Set([\n ...formData.keys()\n ])){\n const values = formData.getAll(key);\n bodyChunks.push(`${key}=${(await Promise.all(values.map(async (val)=>{\n if (typeof val === \"string\") {\n return val;\n } else {\n return await val.text();\n }\n }))).join(\",\")}`);\n }\n // handle blob body\n } else if (typeof init.body.arrayBuffer === \"function\") {\n const blob = init.body;\n const arrayBuffer = await blob.arrayBuffer();\n bodyChunks.push(await blob.text());\n init._ogBody = new Blob([\n arrayBuffer\n ], {\n type: blob.type\n });\n } else if (typeof init.body === \"string\") {\n bodyChunks.push(init.body);\n init._ogBody = init.body;\n }\n }\n const headers = typeof (init.headers || {}).keys === \"function\" ? Object.fromEntries(init.headers) : Object.assign({}, init.headers);\n if (\"traceparent\" in headers) delete headers[\"traceparent\"];\n const cacheString = JSON.stringify([\n MAIN_KEY_PREFIX,\n this.fetchCacheKeyPrefix || \"\",\n url,\n init.method,\n headers,\n init.mode,\n init.redirect,\n init.credentials,\n init.referrer,\n init.referrerPolicy,\n init.integrity,\n init.cache,\n bodyChunks\n ]);\n if (process.env.NEXT_RUNTIME === \"edge\") {\n function bufferToHex(buffer) {\n return Array.prototype.map.call(new Uint8Array(buffer), (b)=>b.toString(16).padStart(2, \"0\")).join(\"\");\n }\n const buffer = encoder.encode(cacheString);\n return bufferToHex(await crypto.subtle.digest(\"SHA-256\", buffer));\n } else {\n const crypto1 = require(\"crypto\");\n return crypto1.createHash(\"sha256\").update(cacheString).digest(\"hex\");\n }\n }\n // get data from cache if available\n async get(cacheKey, ctx = {}) {\n var _this_cacheHandler, _cacheData_value;\n if (process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT && process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY && process.env.NEXT_RUNTIME !== \"edge\") {\n const invokeIpcMethod = require(\"../server-ipc/request-utils\").invokeIpcMethod;\n return invokeIpcMethod({\n method: \"get\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n ...arguments\n ]\n });\n }\n // we don't leverage the prerender cache in dev mode\n // so that getStaticProps is always called for easier debugging\n if (this.disableForTestmode || this.dev && (ctx.kindHint !== \"fetch\" || this.requestHeaders[\"cache-control\"] === \"no-cache\")) {\n return null;\n }\n cacheKey = this._getPathname(cacheKey, ctx.kindHint === \"fetch\");\n let entry = null;\n let revalidate = ctx.revalidate;\n const cacheData = await ((_this_cacheHandler = this.cacheHandler) == null ? void 0 : _this_cacheHandler.get(cacheKey, ctx));\n if ((cacheData == null ? void 0 : (_cacheData_value = cacheData.value) == null ? void 0 : _cacheData_value.kind) === \"FETCH\") {\n const combinedTags = [\n ...ctx.tags || [],\n ...ctx.softTags || []\n ];\n // if a tag was revalidated we don't return stale data\n if (combinedTags.some((tag)=>{\n var _this_revalidatedTags;\n return (_this_revalidatedTags = this.revalidatedTags) == null ? void 0 : _this_revalidatedTags.includes(tag);\n })) {\n return null;\n }\n revalidate = revalidate || cacheData.value.revalidate;\n const age = (Date.now() - (cacheData.lastModified || 0)) / 1000;\n const isStale = age > revalidate;\n const data = cacheData.value.data;\n return {\n isStale: isStale,\n value: {\n kind: \"FETCH\",\n data,\n revalidate: revalidate\n },\n revalidateAfter: Date.now() + revalidate * 1000\n };\n }\n const curRevalidate = this.revalidateTimings.get(toRoute(cacheKey));\n let isStale;\n let revalidateAfter;\n if ((cacheData == null ? void 0 : cacheData.lastModified) === -1) {\n isStale = -1;\n revalidateAfter = -1 * CACHE_ONE_YEAR;\n } else {\n revalidateAfter = this.calculateRevalidate(cacheKey, (cacheData == null ? void 0 : cacheData.lastModified) || Date.now(), this.dev && ctx.kindHint !== \"fetch\");\n isStale = revalidateAfter !== false && revalidateAfter < Date.now() ? true : undefined;\n }\n if (cacheData) {\n entry = {\n isStale,\n curRevalidate,\n revalidateAfter,\n value: cacheData.value\n };\n }\n if (!cacheData && this.prerenderManifest.notFoundRoutes.includes(cacheKey)) {\n // for the first hit after starting the server the cache\n // may not have a way to save notFound: true so if\n // the prerender-manifest marks this as notFound then we\n // return that entry and trigger a cache set to give it a\n // chance to update in-memory entries\n entry = {\n isStale,\n value: null,\n curRevalidate,\n revalidateAfter\n };\n this.set(cacheKey, entry.value, ctx);\n }\n return entry;\n }\n // populate the incremental cache with new data\n async set(pathname, data, ctx) {\n if (process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT && process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY && process.env.NEXT_RUNTIME !== \"edge\") {\n const invokeIpcMethod = require(\"../server-ipc/request-utils\").invokeIpcMethod;\n return invokeIpcMethod({\n method: \"set\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n ...arguments\n ]\n });\n }\n if (this.disableForTestmode || this.dev && !ctx.fetchCache) return;\n // FetchCache has upper limit of 2MB per-entry currently\n const itemSize = JSON.stringify(data).length;\n if (ctx.fetchCache && // we don't show this error/warning when a custom cache handler is being used\n // as it might not have this limit\n !this.hasCustomCacheHandler && itemSize > 2 * 1024 * 1024) {\n if (this.dev) {\n throw new Error(`Failed to set Next.js data cache, items over 2MB can not be cached (${itemSize} bytes)`);\n }\n return;\n }\n pathname = this._getPathname(pathname, ctx.fetchCache);\n try {\n var _this_cacheHandler;\n // Set the value for the revalidate seconds so if it changes we can\n // update the cache with the new value.\n if (typeof ctx.revalidate !== \"undefined\" && !ctx.fetchCache) {\n this.revalidateTimings.set(pathname, ctx.revalidate);\n }\n await ((_this_cacheHandler = this.cacheHandler) == null ? void 0 : _this_cacheHandler.set(pathname, data, ctx));\n } catch (error) {\n console.warn(\"Failed to update prerender cache for\", pathname, error);\n }\n }\n}\n\n//# sourceMappingURL=index.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"http\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"https\");","import fs from \"fs\";\nexport const nodeFs = {\n existsSync: fs.existsSync,\n readFile: fs.promises.readFile,\n readFileSync: fs.readFileSync,\n writeFile: (f, d)=>fs.promises.writeFile(f, d),\n mkdir: (dir)=>fs.promises.mkdir(dir, {\n recursive: true\n }),\n stat: (f)=>fs.promises.stat(f)\n};\n\n//# sourceMappingURL=node-fs-methods.js.map","import Stream from \"stream\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"../web/utils\";\nexport class MockedRequest extends Stream.Readable {\n constructor({ url, headers, method, socket = null, readable }){\n super();\n // This is hardcoded for now, but can be updated to be configurable if needed.\n this.httpVersion = \"1.0\";\n this.httpVersionMajor = 1;\n this.httpVersionMinor = 0;\n // If we don't actually have a socket, we'll just use a mock one that\n // always returns false for the `encrypted` property and undefined for the\n // `remoteAddress` property.\n this.socket = new Proxy({}, {\n get: (_target, prop)=>{\n if (prop !== \"encrypted\" && prop !== \"remoteAddress\") {\n throw new Error(\"Method not implemented\");\n }\n if (prop === \"remoteAddress\") return undefined;\n // For this mock request, always ensure we just respond with the encrypted\n // set to false to ensure there's no odd leakages.\n return false;\n }\n });\n this.url = url;\n this.headers = headers;\n this.method = method;\n if (readable) {\n this.bodyReadable = readable;\n this.bodyReadable.on(\"end\", ()=>this.emit(\"end\"));\n this.bodyReadable.on(\"close\", ()=>this.emit(\"close\"));\n }\n if (socket) {\n this.socket = socket;\n }\n }\n get headersDistinct() {\n const headers = {};\n for (const [key, value] of Object.entries(this.headers)){\n if (!value) continue;\n headers[key] = Array.isArray(value) ? value : [\n value\n ];\n }\n return headers;\n }\n _read(size) {\n if (this.bodyReadable) {\n return this.bodyReadable._read(size);\n } else {\n this.emit(\"end\");\n this.emit(\"close\");\n }\n }\n /**\n * The `connection` property is just an alias for the `socket` property.\n *\n * @deprecated — since v13.0.0 - Use socket instead.\n */ get connection() {\n return this.socket;\n }\n // The following methods are not implemented as they are not used in the\n // Next.js codebase.\n get aborted() {\n throw new Error(\"Method not implemented\");\n }\n get complete() {\n throw new Error(\"Method not implemented\");\n }\n get trailers() {\n throw new Error(\"Method not implemented\");\n }\n get trailersDistinct() {\n throw new Error(\"Method not implemented\");\n }\n get rawTrailers() {\n throw new Error(\"Method not implemented\");\n }\n get rawHeaders() {\n throw new Error(\"Method not implemented.\");\n }\n setTimeout() {\n throw new Error(\"Method not implemented.\");\n }\n}\nexport class MockedResponse extends Stream.Writable {\n constructor(res = {}){\n super();\n this.statusMessage = \"\";\n this.finished = false;\n this.headersSent = false;\n /**\n * A list of buffers that have been written to the response.\n *\n * @internal - used internally by Next.js\n */ this.buffers = [];\n this.statusCode = res.statusCode ?? 200;\n this.socket = res.socket ?? null;\n this.headers = res.headers ? fromNodeOutgoingHttpHeaders(res.headers) : new Headers();\n this.headPromise = new Promise((resolve)=>{\n this.headPromiseResolve = resolve;\n });\n // Attach listeners for the `finish`, `end`, and `error` events to the\n // `MockedResponse` instance.\n this.hasStreamed = new Promise((resolve, reject)=>{\n this.on(\"finish\", ()=>resolve(true));\n this.on(\"end\", ()=>resolve(true));\n this.on(\"error\", (err)=>reject(err));\n }).then((val)=>{\n this.headPromiseResolve == null ? void 0 : this.headPromiseResolve.call(this);\n return val;\n });\n if (res.resWriter) {\n this.resWriter = res.resWriter;\n }\n }\n appendHeader(name, value) {\n const values = Array.isArray(value) ? value : [\n value\n ];\n for (const v of values){\n this.headers.append(name, v);\n }\n return this;\n }\n /**\n * Returns true if the response has been sent, false otherwise.\n *\n * @internal - used internally by Next.js\n */ get isSent() {\n return this.finished || this.headersSent;\n }\n /**\n * The `connection` property is just an alias for the `socket` property.\n *\n * @deprecated — since v13.0.0 - Use socket instead.\n */ get connection() {\n return this.socket;\n }\n write(chunk) {\n if (this.resWriter) {\n return this.resWriter(chunk);\n }\n this.buffers.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));\n return true;\n }\n end() {\n this.finished = true;\n return super.end(...arguments);\n }\n /**\n * This method is a no-op because the `MockedResponse` instance is not\n * actually connected to a socket. This method is not specified on the\n * interface type for `ServerResponse` but is called by Node.js.\n *\n * @see https://github.com/nodejs/node/pull/7949\n */ _implicitHeader() {}\n _write(chunk, _encoding, callback) {\n this.write(chunk);\n // According to Node.js documentation, the callback MUST be invoked to\n // signal that the write completed successfully. If this callback is not\n // invoked, the 'finish' event will not be emitted.\n //\n // https://nodejs.org/docs/latest-v16.x/api/stream.html#writable_writechunk-encoding-callback\n callback();\n }\n writeHead(statusCode, statusMessage, headers) {\n if (!headers && typeof statusMessage !== \"string\") {\n headers = statusMessage;\n } else if (typeof statusMessage === \"string\" && statusMessage.length > 0) {\n this.statusMessage = statusMessage;\n }\n if (headers) {\n // When headers have been set with response.setHeader(), they will be\n // merged with any headers passed to response.writeHead(), with the\n // headers passed to response.writeHead() given precedence.\n //\n // https://nodejs.org/api/http.html#responsewriteheadstatuscode-statusmessage-headers\n //\n // For this reason, we need to only call `set` to ensure that this will\n // overwrite any existing headers.\n if (Array.isArray(headers)) {\n // headers may be an Array where the keys and values are in the same list.\n // It is not a list of tuples. So, the even-numbered offsets are key\n // values, and the odd-numbered offsets are the associated values. The\n // array is in the same format as request.rawHeaders.\n for(let i = 0; i < headers.length; i += 2){\n // The header key is always a string according to the spec.\n this.setHeader(headers[i], headers[i + 1]);\n }\n } else {\n for (const [key, value] of Object.entries(headers)){\n // Skip undefined values\n if (typeof value === \"undefined\") continue;\n this.setHeader(key, value);\n }\n }\n }\n this.statusCode = statusCode;\n this.headersSent = true;\n this.headPromiseResolve == null ? void 0 : this.headPromiseResolve.call(this);\n return this;\n }\n hasHeader(name) {\n return this.headers.has(name);\n }\n getHeader(name) {\n return this.headers.get(name) ?? undefined;\n }\n getHeaders() {\n return toNodeOutgoingHttpHeaders(this.headers);\n }\n getHeaderNames() {\n return Array.from(this.headers.keys());\n }\n setHeader(name, value) {\n if (Array.isArray(value)) {\n // Because `set` here should override any existing values, we need to\n // delete the existing values before setting the new ones via `append`.\n this.headers.delete(name);\n for (const v of value){\n this.headers.append(name, v);\n }\n } else if (typeof value === \"number\") {\n this.headers.set(name, value.toString());\n } else {\n this.headers.set(name, value);\n }\n return this;\n }\n removeHeader(name) {\n this.headers.delete(name);\n }\n flushHeaders() {\n // This is a no-op because we don't actually have a socket to flush the\n // headers to.\n }\n // The following methods are not implemented as they are not used in the\n // Next.js codebase.\n get strictContentLength() {\n throw new Error(\"Method not implemented.\");\n }\n writeEarlyHints() {\n throw new Error(\"Method not implemented.\");\n }\n get req() {\n throw new Error(\"Method not implemented.\");\n }\n assignSocket() {\n throw new Error(\"Method not implemented.\");\n }\n detachSocket() {\n throw new Error(\"Method not implemented.\");\n }\n writeContinue() {\n throw new Error(\"Method not implemented.\");\n }\n writeProcessing() {\n throw new Error(\"Method not implemented.\");\n }\n get upgrading() {\n throw new Error(\"Method not implemented.\");\n }\n get chunkedEncoding() {\n throw new Error(\"Method not implemented.\");\n }\n get shouldKeepAlive() {\n throw new Error(\"Method not implemented.\");\n }\n get useChunkedEncodingByDefault() {\n throw new Error(\"Method not implemented.\");\n }\n get sendDate() {\n throw new Error(\"Method not implemented.\");\n }\n setTimeout() {\n throw new Error(\"Method not implemented.\");\n }\n addTrailers() {\n throw new Error(\"Method not implemented.\");\n }\n}\nexport function createRequestResponseMocks({ url, headers = {}, method = \"GET\", bodyReadable, resWriter, socket = null }) {\n return {\n req: new MockedRequest({\n url,\n headers,\n method,\n socket,\n readable: bodyReadable\n }),\n res: new MockedResponse({\n socket,\n resWriter\n })\n };\n}\n\n//# sourceMappingURL=mock-request.js.map","/**\n * Loads a module using `await require(id)`.\n */ export class NodeModuleLoader {\n async load(id) {\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n // Need to `await` to cover the case that route is marked ESM modules by ESM escalation.\n return await (process.env.NEXT_MINIMAL ? __non_webpack_require__(id) : require(id));\n }\n throw new Error(\"NodeModuleLoader is not supported in edge runtime.\");\n }\n}\n\n//# sourceMappingURL=node-module-loader.js.map","import { NodeModuleLoader } from \"./node-module-loader\";\nexport class RouteModuleLoader {\n static async load(id, loader = new NodeModuleLoader()) {\n const module = await loader.load(id);\n if (\"routeModule\" in module) {\n return module.routeModule;\n }\n throw new Error(`Module \"${id}\" does not export a routeModule.`);\n }\n}\n\n//# sourceMappingURL=route-module-loader.js.map","import path from \"path\";\nimport { pathToFileURL } from \"url\";\n/**\n * The path for a dynamic route must be URLs with a valid scheme.\n *\n * When an absolute Windows path is passed to it, it interprets the beginning of the path as a protocol (`C:`).\n * Therefore, it is important to always construct a complete path.\n * @param dir File directory\n * @param filePath Absolute or relative path\n */ export const formatDynamicImportPath = (dir, filePath)=>{\n const absoluteFilePath = path.isAbsolute(filePath) ? filePath : path.join(dir, filePath);\n const formattedFilePath = pathToFileURL(absoluteFilePath).toString();\n return formattedFilePath;\n};\n\n//# sourceMappingURL=format-dynamic-import-path.js.map","import { pathToRegexp } from \"next/dist/compiled/path-to-regexp\";\nimport { NEXT_URL } from \"../client/components/app-router-headers\";\nimport { INTERCEPTION_ROUTE_MARKERS, extractInterceptionRouteInformation, isInterceptionRouteAppPath } from \"../server/future/helpers/interception-routes\";\n// a function that converts normalised paths (e.g. /foo/[bar]/[baz]) to the format expected by pathToRegexp (e.g. /foo/:bar/:baz)\nfunction toPathToRegexpPath(path) {\n return path.replace(/\\[\\[?([^\\]]+)\\]\\]?/g, (_, capture)=>{\n // handle catch-all segments (e.g. /foo/bar/[...baz] or /foo/bar/[[...baz]])\n if (capture.startsWith(\"...\")) {\n return `:${capture.slice(3)}*`;\n }\n return \":\" + capture;\n });\n}\n// for interception routes we don't have access to the dynamic segments from the\n// referrer route so we mark them as noop for the app renderer so that it\n// can retrieve them from the router state later on. This also allows us to\n// compile the route properly with path-to-regexp, otherwise it will throw\nfunction voidParamsBeforeInterceptionMarker(path) {\n let newPath = [];\n let foundInterceptionMarker = false;\n for (const segment of path.split(\"/\")){\n if (INTERCEPTION_ROUTE_MARKERS.find((marker)=>segment.startsWith(marker))) {\n foundInterceptionMarker = true;\n }\n if (segment.startsWith(\":\") && !foundInterceptionMarker) {\n newPath.push(\"__NEXT_EMPTY_PARAM__\");\n } else {\n newPath.push(segment);\n }\n }\n return newPath.join(\"/\");\n}\nexport function generateInterceptionRoutesRewrites(appPaths, basePath = \"\") {\n const rewrites = [];\n for (const appPath of appPaths){\n if (isInterceptionRouteAppPath(appPath)) {\n const { interceptingRoute, interceptedRoute } = extractInterceptionRouteInformation(appPath);\n const normalizedInterceptingRoute = `${interceptingRoute !== \"/\" ? toPathToRegexpPath(interceptingRoute) : \"\"}/(.*)?`;\n const normalizedInterceptedRoute = toPathToRegexpPath(interceptedRoute);\n const normalizedAppPath = voidParamsBeforeInterceptionMarker(toPathToRegexpPath(appPath));\n // pathToRegexp returns a regex that matches the path, but we need to\n // convert it to a string that can be used in a header value\n // to the format that Next/the proxy expects\n let interceptingRouteRegex = pathToRegexp(normalizedInterceptingRoute).toString().slice(2, -3);\n rewrites.push({\n source: `${basePath}${normalizedInterceptedRoute}`,\n destination: `${basePath}${normalizedAppPath}`,\n has: [\n {\n type: \"header\",\n key: NEXT_URL,\n value: interceptingRouteRegex\n }\n ]\n });\n }\n }\n return rewrites;\n}\nexport function isInterceptionRouteRewrite(route) {\n var _route_has_, _route_has;\n // When we generate interception rewrites in the above implementation, we always do so with only a single `has` condition.\n return ((_route_has = route.has) == null ? void 0 : (_route_has_ = _route_has[0]) == null ? void 0 : _route_has_.key) === NEXT_URL;\n}\n\n//# sourceMappingURL=generate-interception-routes-rewrites.js.map","import \"./node-environment\";\nimport \"./require-hook\";\nimport \"./node-polyfill-crypto\";\nimport { DecodeError, PageNotFoundError, MiddlewareNotFoundError } from \"../shared/lib/utils\";\nimport fs from \"fs\";\nimport { join, resolve } from \"path\";\nimport { getRouteMatcher } from \"../shared/lib/router/utils/route-matcher\";\nimport { addRequestMeta, getRequestMeta } from \"./request-meta\";\nimport { PAGES_MANIFEST, BUILD_ID_FILE, MIDDLEWARE_MANIFEST, PRERENDER_MANIFEST, ROUTES_MANIFEST, CLIENT_PUBLIC_FILES_PATH, APP_PATHS_MANIFEST, SERVER_DIRECTORY, NEXT_FONT_MANIFEST, PHASE_PRODUCTION_BUILD, UNDERSCORE_NOT_FOUND_ROUTE_ENTRY } from \"../shared/lib/constants\";\nimport { findDir } from \"../lib/find-pages-dir\";\nimport { NodeNextRequest, NodeNextResponse } from \"./base-http/node\";\nimport { sendRenderResult } from \"./send-payload\";\nimport { parseUrl } from \"../shared/lib/router/utils/parse-url\";\nimport * as Log from \"../build/output/log\";\nimport BaseServer, { NoFallbackError, isRSCRequestCheck } from \"./base-server\";\nimport { getMaybePagePath, getPagePath, requireFontManifest } from \"./require\";\nimport { denormalizePagePath } from \"../shared/lib/page-path/denormalize-page-path\";\nimport { normalizePagePath } from \"../shared/lib/page-path/normalize-page-path\";\nimport { loadComponents } from \"./load-components\";\nimport isError, { getProperError } from \"../lib/is-error\";\nimport { splitCookiesString, toNodeOutgoingHttpHeaders } from \"./web/utils\";\nimport { getMiddlewareRouteMatcher } from \"../shared/lib/router/utils/middleware-route-matcher\";\nimport { loadEnvConfig } from \"@next/env\";\nimport { urlQueryToSearchParams } from \"../shared/lib/router/utils/querystring\";\nimport { removeTrailingSlash } from \"../shared/lib/router/utils/remove-trailing-slash\";\nimport { getNextPathnameInfo } from \"../shared/lib/router/utils/get-next-pathname-info\";\nimport { getCloneableBody } from \"./body-streams\";\nimport { checkIsOnDemandRevalidate } from \"./api-utils\";\nimport ResponseCache from \"./response-cache\";\nimport { IncrementalCache } from \"./lib/incremental-cache\";\nimport { normalizeAppPath } from \"../shared/lib/router/utils/app-paths\";\nimport { setHttpClientAndAgentOptions } from \"./setup-http-agent-env\";\nimport { isPagesAPIRouteMatch } from \"./future/route-matches/pages-api-route-match\";\nimport { INSTRUMENTATION_HOOK_FILENAME, RSC_PREFETCH_SUFFIX } from \"../lib/constants\";\nimport { getTracer } from \"./lib/trace/tracer\";\nimport { NextNodeServerSpan } from \"./lib/trace/constants\";\nimport { nodeFs } from \"./lib/node-fs-methods\";\nimport { getRouteRegex } from \"../shared/lib/router/utils/route-regex\";\nimport { pipeToNodeResponse } from \"./pipe-readable\";\nimport { createRequestResponseMocks } from \"./lib/mock-request\";\nimport { NEXT_RSC_UNION_QUERY } from \"../client/components/app-router-headers\";\nimport { signalFromNodeResponse } from \"./web/spec-extension/adapters/next-request\";\nimport { RouteModuleLoader } from \"./future/helpers/module-loader/route-module-loader\";\nimport { loadManifest } from \"./load-manifest\";\nimport { lazyRenderAppPage } from \"./future/route-modules/app-page/module.render\";\nimport { lazyRenderPagesPage } from \"./future/route-modules/pages/module.render\";\nimport { interopDefault } from \"../lib/interop-default\";\nimport { formatDynamicImportPath } from \"../lib/format-dynamic-import-path\";\nimport { isInterceptionRouteRewrite } from \"../lib/generate-interception-routes-rewrites\";\nexport * from \"./base-server\";\n// For module that can be both CJS or ESM\nconst dynamicImportEsmDefault = process.env.NEXT_MINIMAL ? (id)=>import(/* webpackIgnore: true */ id).then((mod)=>mod.default || mod) : (id)=>import(id).then((mod)=>mod.default || mod);\n// For module that will be compiled to CJS, e.g. instrument\nconst dynamicRequire = process.env.NEXT_MINIMAL ? __non_webpack_require__ : require;\nfunction writeStdoutLine(text) {\n process.stdout.write(\" \" + text + \"\\n\");\n}\nfunction formatRequestUrl(url, maxLength) {\n return maxLength !== undefined && url.length > maxLength ? url.substring(0, maxLength) + \"..\" : url;\n}\nconst MiddlewareMatcherCache = new WeakMap();\nfunction getMiddlewareMatcher(info) {\n const stored = MiddlewareMatcherCache.get(info);\n if (stored) {\n return stored;\n }\n if (!Array.isArray(info.matchers)) {\n throw new Error(`Invariant: invalid matchers for middleware ${JSON.stringify(info)}`);\n }\n const matcher = getMiddlewareRouteMatcher(info.matchers);\n MiddlewareMatcherCache.set(info, matcher);\n return matcher;\n}\nexport default class NextNodeServer extends BaseServer {\n constructor(options){\n // Initialize super class\n super(options);\n this.handleNextImageRequest = async (req, res, parsedUrl)=>{\n if (!parsedUrl.pathname || !parsedUrl.pathname.startsWith(\"/_next/image\")) {\n return false;\n }\n if (this.minimalMode || this.nextConfig.output === \"export\" || process.env.NEXT_MINIMAL) {\n res.statusCode = 400;\n res.body(\"Bad Request\").send();\n return true;\n // the `else` branch is needed for tree-shaking\n } else {\n const { ImageOptimizerCache } = require(\"./image-optimizer\");\n const imageOptimizerCache = new ImageOptimizerCache({\n distDir: this.distDir,\n nextConfig: this.nextConfig\n });\n const { getHash, sendResponse, ImageError } = require(\"./image-optimizer\");\n if (!this.imageResponseCache) {\n throw new Error(\"invariant image optimizer cache was not initialized\");\n }\n const imagesConfig = this.nextConfig.images;\n if (imagesConfig.loader !== \"default\" || imagesConfig.unoptimized) {\n await this.render404(req, res);\n return true;\n }\n const paramsResult = ImageOptimizerCache.validateParams(req.originalRequest, parsedUrl.query, this.nextConfig, !!this.renderOpts.dev);\n if (\"errorMessage\" in paramsResult) {\n res.statusCode = 400;\n res.body(paramsResult.errorMessage).send();\n return true;\n }\n const cacheKey = ImageOptimizerCache.getCacheKey(paramsResult);\n try {\n var _cacheEntry_value;\n const { getExtension } = require(\"./serve-static\");\n const cacheEntry = await this.imageResponseCache.get(cacheKey, async ()=>{\n const { buffer, contentType, maxAge } = await this.imageOptimizer(req, res, paramsResult);\n const etag = getHash([\n buffer\n ]);\n return {\n value: {\n kind: \"IMAGE\",\n buffer,\n etag,\n extension: getExtension(contentType)\n },\n revalidate: maxAge\n };\n }, {\n incrementalCache: imageOptimizerCache\n });\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== \"IMAGE\") {\n throw new Error(\"invariant did not get entry from image response cache\");\n }\n sendResponse(req.originalRequest, res.originalResponse, paramsResult.href, cacheEntry.value.extension, cacheEntry.value.buffer, paramsResult.isStatic, cacheEntry.isMiss ? \"MISS\" : cacheEntry.isStale ? \"STALE\" : \"HIT\", imagesConfig, cacheEntry.revalidate || 0, Boolean(this.renderOpts.dev));\n return true;\n } catch (err) {\n if (err instanceof ImageError) {\n res.statusCode = err.statusCode;\n res.body(err.message).send();\n return true;\n }\n throw err;\n }\n }\n };\n this.handleCatchallRenderRequest = async (req, res, parsedUrl)=>{\n let { pathname, query } = parsedUrl;\n if (!pathname) {\n throw new Error(\"Invariant: pathname is undefined\");\n }\n // This is a catch-all route, there should be no fallbacks so mark it as\n // such.\n query._nextBubbleNoFallback = \"1\";\n try {\n var _this_i18nProvider;\n // next.js core assumes page path without trailing slash\n pathname = removeTrailingSlash(pathname);\n const options = {\n i18n: (_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.fromQuery(pathname, query)\n };\n const match = await this.matchers.match(pathname, options);\n // If we don't have a match, try to render it anyways.\n if (!match) {\n await this.render(req, res, pathname, query, parsedUrl, true);\n return true;\n }\n // Add the match to the request so we don't have to re-run the matcher\n // for the same request.\n addRequestMeta(req, \"match\", match);\n // TODO-APP: move this to a route handler\n const edgeFunctionsPages = this.getEdgeFunctionsPages();\n for (const edgeFunctionsPage of edgeFunctionsPages){\n // If the page doesn't match the edge function page, skip it.\n if (edgeFunctionsPage !== match.definition.page) continue;\n if (this.nextConfig.output === \"export\") {\n await this.render404(req, res, parsedUrl);\n return true;\n }\n delete query._nextBubbleNoFallback;\n delete query[NEXT_RSC_UNION_QUERY];\n const handled = await this.runEdgeFunction({\n req,\n res,\n query,\n params: match.params,\n page: match.definition.page,\n match,\n appPaths: null\n });\n // If we handled the request, we can return early.\n if (handled) return true;\n }\n // If the route was detected as being a Pages API route, then handle\n // it.\n // TODO: move this behavior into a route handler.\n if (isPagesAPIRouteMatch(match)) {\n if (this.nextConfig.output === \"export\") {\n await this.render404(req, res, parsedUrl);\n return true;\n }\n delete query._nextBubbleNoFallback;\n const handled = await this.handleApiRequest(req, res, query, match);\n if (handled) return true;\n }\n await this.render(req, res, pathname, query, parsedUrl, true);\n return true;\n } catch (err) {\n if (err instanceof NoFallbackError) {\n throw err;\n }\n try {\n if (this.renderOpts.dev) {\n const { formatServerError } = require(\"../lib/format-server-error\");\n formatServerError(err);\n await this.logErrorWithOriginalStack(err);\n } else {\n this.logError(err);\n }\n res.statusCode = 500;\n await this.renderError(err, req, res, pathname, query);\n return true;\n } catch {}\n throw err;\n }\n };\n this.handleCatchallMiddlewareRequest = async (req, res, parsed)=>{\n const isMiddlewareInvoke = getRequestMeta(req, \"middlewareInvoke\");\n if (!isMiddlewareInvoke) {\n return false;\n }\n const handleFinished = ()=>{\n addRequestMeta(req, \"middlewareInvoke\", true);\n res.body(\"\").send();\n return true;\n };\n const middleware = this.getMiddleware();\n if (!middleware) {\n return handleFinished();\n }\n const initUrl = getRequestMeta(req, \"initURL\");\n const parsedUrl = parseUrl(initUrl);\n const pathnameInfo = getNextPathnameInfo(parsedUrl.pathname, {\n nextConfig: this.nextConfig,\n i18nProvider: this.i18nProvider\n });\n parsedUrl.pathname = pathnameInfo.pathname;\n const normalizedPathname = removeTrailingSlash(parsed.pathname || \"\");\n if (!middleware.match(normalizedPathname, req, parsedUrl.query)) {\n return handleFinished();\n }\n let result;\n let bubblingResult = false;\n try {\n await this.ensureMiddleware(req.url);\n result = await this.runMiddleware({\n request: req,\n response: res,\n parsedUrl: parsedUrl,\n parsed: parsed\n });\n if (\"response\" in result) {\n if (isMiddlewareInvoke) {\n bubblingResult = true;\n const err = new Error();\n err.result = result;\n err.bubble = true;\n throw err;\n }\n for (const [key, value] of Object.entries(toNodeOutgoingHttpHeaders(result.response.headers))){\n if (key !== \"content-encoding\" && value !== undefined) {\n res.setHeader(key, value);\n }\n }\n res.statusCode = result.response.status;\n const { originalResponse } = res;\n if (result.response.body) {\n await pipeToNodeResponse(result.response.body, originalResponse);\n } else {\n originalResponse.end();\n }\n return true;\n }\n } catch (err) {\n if (bubblingResult) {\n throw err;\n }\n if (isError(err) && err.code === \"ENOENT\") {\n await this.render404(req, res, parsed);\n return true;\n }\n if (err instanceof DecodeError) {\n res.statusCode = 400;\n await this.renderError(err, req, res, parsed.pathname || \"\");\n return true;\n }\n const error = getProperError(err);\n console.error(error);\n res.statusCode = 500;\n await this.renderError(error, req, res, parsed.pathname || \"\");\n return true;\n }\n return result.finished;\n };\n /**\n * This sets environment variable to be used at the time of SSR by head.tsx.\n * Using this from process.env allows targeting SSR by calling\n * `process.env.__NEXT_OPTIMIZE_CSS`.\n */ if (this.renderOpts.optimizeFonts) {\n process.env.__NEXT_OPTIMIZE_FONTS = JSON.stringify(this.renderOpts.optimizeFonts);\n }\n if (this.renderOpts.optimizeCss) {\n process.env.__NEXT_OPTIMIZE_CSS = JSON.stringify(true);\n }\n if (this.renderOpts.nextScriptWorkers) {\n process.env.__NEXT_SCRIPT_WORKERS = JSON.stringify(true);\n }\n process.env.NEXT_DEPLOYMENT_ID = this.nextConfig.deploymentId || \"\";\n if (!this.minimalMode) {\n this.imageResponseCache = new ResponseCache(this.minimalMode);\n }\n const { appDocumentPreloading } = this.nextConfig.experimental;\n const isDefaultEnabled = typeof appDocumentPreloading === \"undefined\";\n if (!options.dev && (appDocumentPreloading === true || !(this.minimalMode && isDefaultEnabled))) {\n // pre-warm _document and _app as these will be\n // needed for most requests\n loadComponents({\n distDir: this.distDir,\n page: \"/_document\",\n isAppPath: false\n }).catch(()=>{});\n loadComponents({\n distDir: this.distDir,\n page: \"/_app\",\n isAppPath: false\n }).catch(()=>{});\n }\n if (!options.dev && this.nextConfig.experimental.preloadEntriesOnStart) {\n this.unstable_preloadEntries();\n }\n if (!options.dev) {\n const { dynamicRoutes = [] } = this.getRoutesManifest() ?? {};\n this.dynamicRoutes = dynamicRoutes.map((r)=>{\n // TODO: can we just re-use the regex from the manifest?\n const regex = getRouteRegex(r.page);\n const match = getRouteMatcher(regex);\n return {\n match,\n page: r.page,\n re: regex.re\n };\n });\n }\n // ensure options are set when loadConfig isn't called\n setHttpClientAndAgentOptions(this.nextConfig);\n // Intercept fetch and other testmode apis.\n if (this.serverOptions.experimentalTestProxy) {\n process.env.NEXT_PRIVATE_TEST_PROXY = \"true\";\n const { interceptTestApis } = require(\"next/dist/experimental/testmode/server\");\n interceptTestApis();\n }\n this.middlewareManifestPath = join(this.serverDistDir, MIDDLEWARE_MANIFEST);\n // This is just optimization to fire prepare as soon as possible. It will be\n // properly awaited later. We add the catch here to ensure that it does not\n // cause a unhandled promise rejection. The promise rejection will be\n // handled later on via the `await` when the request handler is called.\n if (!options.dev) {\n this.prepare().catch((err)=>{\n console.error(\"Failed to prepare server\", err);\n });\n }\n }\n async unstable_preloadEntries() {\n const appPathsManifest = this.getAppPathsManifest();\n const pagesManifest = this.getPagesManifest();\n for (const page of Object.keys(pagesManifest || {})){\n await loadComponents({\n distDir: this.distDir,\n page,\n isAppPath: false\n }).catch(()=>{});\n }\n for (const page of Object.keys(appPathsManifest || {})){\n await loadComponents({\n distDir: this.distDir,\n page,\n isAppPath: true\n }).then(async ({ ComponentMod })=>{\n const webpackRequire = ComponentMod.__next_app__.require;\n if (webpackRequire == null ? void 0 : webpackRequire.m) {\n for (const id of Object.keys(webpackRequire.m)){\n await webpackRequire(id);\n }\n }\n }).catch(()=>{});\n }\n }\n async handleUpgrade() {\n // The web server does not support web sockets, it's only used for HMR in\n // development.\n }\n async prepareImpl() {\n await super.prepareImpl();\n if (!this.serverOptions.dev && this.nextConfig.experimental.instrumentationHook) {\n try {\n const instrumentationHook = await dynamicRequire(resolve(this.serverOptions.dir || \".\", this.serverOptions.conf.distDir, \"server\", INSTRUMENTATION_HOOK_FILENAME));\n await (instrumentationHook.register == null ? void 0 : instrumentationHook.register.call(instrumentationHook));\n } catch (err) {\n if (err.code !== \"MODULE_NOT_FOUND\") {\n err.message = `An error occurred while loading instrumentation hook: ${err.message}`;\n throw err;\n }\n }\n }\n }\n loadEnvConfig({ dev, forceReload, silent }) {\n loadEnvConfig(this.dir, dev, silent ? {\n info: ()=>{},\n error: ()=>{}\n } : Log, forceReload);\n }\n async getIncrementalCache({ requestHeaders, requestProtocol }) {\n const dev = !!this.renderOpts.dev;\n let CacheHandler;\n const { cacheHandler } = this.nextConfig;\n if (cacheHandler) {\n CacheHandler = interopDefault(await dynamicImportEsmDefault(formatDynamicImportPath(this.distDir, cacheHandler)));\n }\n // incremental-cache is request specific\n // although can have shared caches in module scope\n // per-cache handler\n return new IncrementalCache({\n fs: this.getCacheFilesystem(),\n dev,\n requestHeaders,\n requestProtocol,\n pagesDir: this.enabledDirectories.pages,\n appDir: this.enabledDirectories.app,\n allowedRevalidateHeaderKeys: this.nextConfig.experimental.allowedRevalidateHeaderKeys,\n minimalMode: this.minimalMode,\n serverDistDir: this.serverDistDir,\n fetchCache: true,\n fetchCacheKeyPrefix: this.nextConfig.experimental.fetchCacheKeyPrefix,\n maxMemoryCacheSize: this.nextConfig.cacheMaxMemorySize,\n flushToDisk: !this.minimalMode && this.nextConfig.experimental.isrFlushToDisk,\n getPrerenderManifest: ()=>this.getPrerenderManifest(),\n CurCacheHandler: CacheHandler,\n experimental: this.renderOpts.experimental\n });\n }\n getResponseCache() {\n return new ResponseCache(this.minimalMode);\n }\n getPublicDir() {\n return join(this.dir, CLIENT_PUBLIC_FILES_PATH);\n }\n getHasStaticDir() {\n return fs.existsSync(join(this.dir, \"static\"));\n }\n getPagesManifest() {\n return loadManifest(join(this.serverDistDir, PAGES_MANIFEST));\n }\n getAppPathsManifest() {\n if (!this.enabledDirectories.app) return undefined;\n return loadManifest(join(this.serverDistDir, APP_PATHS_MANIFEST));\n }\n getinterceptionRoutePatterns() {\n if (!this.enabledDirectories.app) return [];\n const routesManifest = this.getRoutesManifest();\n return (routesManifest == null ? void 0 : routesManifest.rewrites.beforeFiles.filter(isInterceptionRouteRewrite).map((rewrite)=>new RegExp(rewrite.regex))) ?? [];\n }\n async hasPage(pathname) {\n var _this_nextConfig_i18n;\n return !!getMaybePagePath(pathname, this.distDir, (_this_nextConfig_i18n = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n.locales, this.enabledDirectories.app);\n }\n getBuildId() {\n const buildIdFile = join(this.distDir, BUILD_ID_FILE);\n try {\n return fs.readFileSync(buildIdFile, \"utf8\").trim();\n } catch (err) {\n if (err.code === \"ENOENT\") {\n throw new Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`);\n }\n throw err;\n }\n }\n getEnabledDirectories(dev) {\n const dir = dev ? this.dir : this.serverDistDir;\n return {\n app: findDir(dir, \"app\") ? true : false,\n pages: findDir(dir, \"pages\") ? true : false\n };\n }\n sendRenderResult(req, res, options) {\n return sendRenderResult({\n req: req.originalRequest,\n res: res.originalResponse,\n result: options.result,\n type: options.type,\n generateEtags: options.generateEtags,\n poweredByHeader: options.poweredByHeader,\n revalidate: options.revalidate,\n swrDelta: options.swrDelta\n });\n }\n async runApi(req, res, query, match) {\n const edgeFunctionsPages = this.getEdgeFunctionsPages();\n for (const edgeFunctionsPage of edgeFunctionsPages){\n if (edgeFunctionsPage === match.definition.pathname) {\n const handledAsEdgeFunction = await this.runEdgeFunction({\n req,\n res,\n query,\n params: match.params,\n page: match.definition.pathname,\n appPaths: null\n });\n if (handledAsEdgeFunction) {\n return true;\n }\n }\n }\n // The module supports minimal mode, load the minimal module.\n const module = await RouteModuleLoader.load(match.definition.filename);\n query = {\n ...query,\n ...match.params\n };\n delete query.__nextLocale;\n delete query.__nextDefaultLocale;\n delete query.__nextInferredLocaleFromDefault;\n await module.render(req.originalRequest, res.originalResponse, {\n previewProps: this.renderOpts.previewProps,\n revalidate: this.revalidate.bind(this),\n trustHostHeader: this.nextConfig.experimental.trustHostHeader,\n allowedRevalidateHeaderKeys: this.nextConfig.experimental.allowedRevalidateHeaderKeys,\n hostname: this.fetchHostname,\n minimalMode: this.minimalMode,\n dev: this.renderOpts.dev === true,\n query,\n params: match.params,\n page: match.definition.pathname,\n multiZoneDraftMode: this.nextConfig.experimental.multiZoneDraftMode\n });\n return true;\n }\n async renderHTML(req, res, pathname, query, renderOpts) {\n return getTracer().trace(NextNodeServerSpan.renderHTML, async ()=>this.renderHTMLImpl(req, res, pathname, query, renderOpts));\n }\n async renderHTMLImpl(req, res, pathname, query, renderOpts) {\n if (process.env.NEXT_MINIMAL) {\n throw new Error(\"Invariant: renderHTML should not be called in minimal mode\");\n // the `else` branch is needed for tree-shaking\n } else {\n // Due to the way we pass data by mutating `renderOpts`, we can't extend the\n // object here but only updating its `nextFontManifest` field.\n // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952\n renderOpts.nextFontManifest = this.nextFontManifest;\n if (this.enabledDirectories.app && renderOpts.isAppPath) {\n return lazyRenderAppPage(req.originalRequest, res.originalResponse, pathname, query, renderOpts);\n }\n // TODO: re-enable this once we've refactored to use implicit matches\n // throw new Error('Invariant: render should have used routeModule')\n return lazyRenderPagesPage(req.originalRequest, res.originalResponse, pathname, query, renderOpts);\n }\n }\n async imageOptimizer(req, res, paramsResult) {\n if (process.env.NEXT_MINIMAL) {\n throw new Error(\"invariant: imageOptimizer should not be called in minimal mode\");\n } else {\n const { imageOptimizer, fetchExternalImage, fetchInternalImage } = require(\"./image-optimizer\");\n const handleInternalReq = async (newReq, newRes)=>{\n if (newReq.url === req.url) {\n throw new Error(`Invariant attempted to optimize _next/image itself`);\n }\n if (!this.routerServerHandler) {\n throw new Error(`Invariant missing routerServerHandler`);\n }\n await this.routerServerHandler(newReq, newRes);\n return;\n };\n const { isAbsolute, href } = paramsResult;\n const imageUpstream = isAbsolute ? await fetchExternalImage(href) : await fetchInternalImage(href, req.originalRequest, res.originalResponse, handleInternalReq);\n return imageOptimizer(imageUpstream, paramsResult, this.nextConfig, this.renderOpts.dev);\n }\n }\n getPagePath(pathname, locales) {\n return getPagePath(pathname, this.distDir, locales, this.enabledDirectories.app);\n }\n async renderPageComponent(ctx, bubbleNoFallback) {\n const edgeFunctionsPages = this.getEdgeFunctionsPages() || [];\n if (edgeFunctionsPages.length) {\n const appPaths = this.getOriginalAppPaths(ctx.pathname);\n const isAppPath = Array.isArray(appPaths);\n let page = ctx.pathname;\n if (isAppPath) {\n // When it's an array, we need to pass all parallel routes to the loader.\n page = appPaths[0];\n }\n for (const edgeFunctionsPage of edgeFunctionsPages){\n if (edgeFunctionsPage === page) {\n await this.runEdgeFunction({\n req: ctx.req,\n res: ctx.res,\n query: ctx.query,\n params: ctx.renderOpts.params,\n page,\n appPaths\n });\n return null;\n }\n }\n }\n return super.renderPageComponent(ctx, bubbleNoFallback);\n }\n async findPageComponents({ page, query, params, isAppPath, url }) {\n return getTracer().trace(NextNodeServerSpan.findPageComponents, {\n spanName: \"resolve page components\",\n attributes: {\n \"next.route\": isAppPath ? normalizeAppPath(page) : page\n }\n }, ()=>this.findPageComponentsImpl({\n page,\n query,\n params,\n isAppPath,\n url\n }));\n }\n async findPageComponentsImpl({ page, query, params, isAppPath, url: _url }) {\n const pagePaths = [\n page\n ];\n if (query.amp) {\n // try serving a static AMP version first\n pagePaths.unshift((isAppPath ? normalizeAppPath(page) : normalizePagePath(page)) + \".amp\");\n }\n if (query.__nextLocale) {\n pagePaths.unshift(...pagePaths.map((path)=>`/${query.__nextLocale}${path === \"/\" ? \"\" : path}`));\n }\n for (const pagePath of pagePaths){\n try {\n const components = await loadComponents({\n distDir: this.distDir,\n page: pagePath,\n isAppPath\n });\n if (query.__nextLocale && typeof components.Component === \"string\" && !pagePath.startsWith(`/${query.__nextLocale}`)) {\n continue;\n }\n return {\n components,\n query: {\n ...!this.renderOpts.isExperimentalCompile && components.getStaticProps ? {\n amp: query.amp,\n __nextDataReq: query.__nextDataReq,\n __nextLocale: query.__nextLocale,\n __nextDefaultLocale: query.__nextDefaultLocale\n } : query,\n // For appDir params is excluded.\n ...(isAppPath ? {} : params) || {}\n }\n };\n } catch (err) {\n // we should only not throw if we failed to find the page\n // in the pages-manifest\n if (!(err instanceof PageNotFoundError)) {\n throw err;\n }\n }\n }\n return null;\n }\n getFontManifest() {\n return requireFontManifest(this.distDir);\n }\n getNextFontManifest() {\n return loadManifest(join(this.distDir, \"server\", NEXT_FONT_MANIFEST + \".json\"));\n }\n getFallback(page) {\n page = normalizePagePath(page);\n const cacheFs = this.getCacheFilesystem();\n return cacheFs.readFile(join(this.serverDistDir, \"pages\", `${page}.html`), \"utf8\");\n }\n // Used in development only, overloaded in next-dev-server\n async logErrorWithOriginalStack(_err, _type) {\n throw new Error(\"Invariant: logErrorWithOriginalStack can only be called on the development server\");\n }\n // Used in development only, overloaded in next-dev-server\n async ensurePage(_opts) {\n throw new Error(\"Invariant: ensurePage can only be called on the development server\");\n }\n /**\n * Resolves `API` request, in development builds on demand\n * @param req http request\n * @param res http response\n * @param pathname path of request\n */ async handleApiRequest(req, res, query, match) {\n return this.runApi(req, res, query, match);\n }\n getPrefetchRsc(pathname) {\n return this.getCacheFilesystem().readFile(join(this.serverDistDir, \"app\", `${pathname}${RSC_PREFETCH_SUFFIX}`), \"utf8\");\n }\n getCacheFilesystem() {\n return nodeFs;\n }\n normalizeReq(req) {\n return !(req instanceof NodeNextRequest) ? new NodeNextRequest(req) : req;\n }\n normalizeRes(res) {\n return !(res instanceof NodeNextResponse) ? new NodeNextResponse(res) : res;\n }\n getRequestHandler() {\n const handler = this.makeRequestHandler();\n if (this.serverOptions.experimentalTestProxy) {\n const { wrapRequestHandlerNode } = require(\"next/dist/experimental/testmode/server\");\n return wrapRequestHandlerNode(handler);\n }\n return handler;\n }\n makeRequestHandler() {\n // This is just optimization to fire prepare as soon as possible. It will be\n // properly awaited later. We add the catch here to ensure that it does not\n // cause a unhandled promise rejection. The promise rejection wil be\n // handled later on via the `await` when the request handler is called.\n this.prepare().catch((err)=>{\n console.error(\"Failed to prepare server\", err);\n });\n const handler = super.getRequestHandler();\n return (req, res, parsedUrl)=>{\n var _this_nextConfig_logging;\n const normalizedReq = this.normalizeReq(req);\n const normalizedRes = this.normalizeRes(res);\n const loggingFetchesConfig = (_this_nextConfig_logging = this.nextConfig.logging) == null ? void 0 : _this_nextConfig_logging.fetches;\n const enabledVerboseLogging = !!loggingFetchesConfig;\n const shouldTruncateUrl = !(loggingFetchesConfig == null ? void 0 : loggingFetchesConfig.fullUrl);\n if (this.renderOpts.dev) {\n const { blue, green, yellow, red, gray, white } = require(\"../lib/picocolors\");\n const _res = res;\n const origRes = \"originalResponse\" in _res ? _res.originalResponse : _res;\n const reqStart = Date.now();\n const isMiddlewareRequest = getRequestMeta(req, \"middlewareInvoke\");\n const reqCallback = ()=>{\n // we don't log for non-route requests\n const routeMatch = getRequestMeta(req).match;\n const isRSC = isRSCRequestCheck(req);\n if (!routeMatch || isRSC || isMiddlewareRequest) return;\n const reqEnd = Date.now();\n const fetchMetrics = normalizedReq.fetchMetrics || [];\n const reqDuration = reqEnd - reqStart;\n const statusColor = (status)=>{\n if (!status || status < 200) return white;\n else if (status < 300) return green;\n else if (status < 400) return blue;\n else if (status < 500) return yellow;\n return red;\n };\n const color = statusColor(res.statusCode);\n const method = req.method || \"GET\";\n writeStdoutLine(`${method} ${req.url ?? \"\"} ${color((res.statusCode ?? 200).toString())} in ${reqDuration}ms`);\n if (fetchMetrics.length && enabledVerboseLogging) {\n const calcNestedLevel = (prevMetrics, start)=>{\n let nestedLevel = 0;\n for(let i = 0; i < prevMetrics.length; i++){\n const metric = prevMetrics[i];\n const prevMetric = prevMetrics[i - 1];\n if (metric.end <= start && !(prevMetric && prevMetric.start < metric.end)) {\n nestedLevel += 1;\n }\n }\n return nestedLevel === 0 ? \" \" : \" │ \".repeat(nestedLevel);\n };\n for(let i = 0; i < fetchMetrics.length; i++){\n const metric = fetchMetrics[i];\n let { cacheStatus, cacheReason } = metric;\n let cacheReasonStr = \"\";\n let cacheColor;\n const duration = metric.end - metric.start;\n if (cacheStatus === \"hit\") {\n cacheColor = green;\n } else {\n cacheColor = yellow;\n const status = cacheStatus === \"skip\" ? \"skipped\" : \"missed\";\n cacheReasonStr = gray(`Cache ${status} reason: (${white(cacheReason)})`);\n }\n let url = metric.url;\n if (url.length > 48) {\n const parsed = new URL(url);\n const truncatedHost = formatRequestUrl(parsed.host, shouldTruncateUrl ? 16 : undefined);\n const truncatedPath = formatRequestUrl(parsed.pathname, shouldTruncateUrl ? 24 : undefined);\n const truncatedSearch = formatRequestUrl(parsed.search, shouldTruncateUrl ? 16 : undefined);\n url = parsed.protocol + \"//\" + truncatedHost + truncatedPath + truncatedSearch;\n }\n const status = cacheColor(`(cache ${cacheStatus})`);\n const newLineLeadingChar = \"│\";\n const nestedIndent = calcNestedLevel(fetchMetrics.slice(0, i + 1), metric.start);\n writeStdoutLine(`${newLineLeadingChar}${nestedIndent}${white(metric.method)} ${white(url)} ${metric.status} in ${duration}ms ${status}`);\n if (cacheReasonStr) {\n const nextNestedIndent = calcNestedLevel(fetchMetrics.slice(0, i + 1), metric.start);\n writeStdoutLine(`${newLineLeadingChar}${nextNestedIndent}${newLineLeadingChar} ${cacheReasonStr}`);\n }\n }\n }\n delete normalizedReq.fetchMetrics;\n origRes.off(\"close\", reqCallback);\n };\n origRes.on(\"close\", reqCallback);\n }\n return handler(normalizedReq, normalizedRes, parsedUrl);\n };\n }\n async revalidate({ urlPath, revalidateHeaders, opts }) {\n const mocked = createRequestResponseMocks({\n url: urlPath,\n headers: revalidateHeaders\n });\n const handler = this.getRequestHandler();\n await handler(new NodeNextRequest(mocked.req), new NodeNextResponse(mocked.res));\n await mocked.res.hasStreamed;\n if (mocked.res.getHeader(\"x-nextjs-cache\") !== \"REVALIDATED\" && !(mocked.res.statusCode === 404 && opts.unstable_onlyGenerated)) {\n throw new Error(`Invalid response ${mocked.res.statusCode}`);\n }\n }\n async render(req, res, pathname, query, parsedUrl, internal = false) {\n return super.render(this.normalizeReq(req), this.normalizeRes(res), pathname, query, parsedUrl, internal);\n }\n async renderToHTML(req, res, pathname, query) {\n return super.renderToHTML(this.normalizeReq(req), this.normalizeRes(res), pathname, query);\n }\n async renderErrorToResponseImpl(ctx, err) {\n const { req, res, query } = ctx;\n const is404 = res.statusCode === 404;\n if (is404 && this.enabledDirectories.app) {\n if (this.renderOpts.dev) {\n await this.ensurePage({\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n clientOnly: false,\n url: req.url\n }).catch(()=>{});\n }\n if (this.getEdgeFunctionsPages().includes(UNDERSCORE_NOT_FOUND_ROUTE_ENTRY)) {\n await this.runEdgeFunction({\n req: req,\n res: res,\n query: query || {},\n params: {},\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n appPaths: null\n });\n return null;\n }\n }\n return super.renderErrorToResponseImpl(ctx, err);\n }\n async renderError(err, req, res, pathname, query, setHeaders) {\n return super.renderError(err, this.normalizeReq(req), this.normalizeRes(res), pathname, query, setHeaders);\n }\n async renderErrorToHTML(err, req, res, pathname, query) {\n return super.renderErrorToHTML(err, this.normalizeReq(req), this.normalizeRes(res), pathname, query);\n }\n async render404(req, res, parsedUrl, setHeaders) {\n return super.render404(this.normalizeReq(req), this.normalizeRes(res), parsedUrl, setHeaders);\n }\n getMiddlewareManifest() {\n if (this.minimalMode) return null;\n const manifest = require(this.middlewareManifestPath);\n return manifest;\n }\n /** Returns the middleware routing item if there is one. */ getMiddleware() {\n var _manifest_middleware;\n const manifest = this.getMiddlewareManifest();\n const middleware = manifest == null ? void 0 : (_manifest_middleware = manifest.middleware) == null ? void 0 : _manifest_middleware[\"/\"];\n if (!middleware) {\n return;\n }\n return {\n match: getMiddlewareMatcher(middleware),\n page: \"/\"\n };\n }\n getEdgeFunctionsPages() {\n const manifest = this.getMiddlewareManifest();\n if (!manifest) {\n return [];\n }\n return Object.keys(manifest.functions);\n }\n /**\n * Get information for the edge function located in the provided page\n * folder. If the edge function info can't be found it will throw\n * an error.\n */ getEdgeFunctionInfo(params) {\n const manifest = this.getMiddlewareManifest();\n if (!manifest) {\n return null;\n }\n let foundPage;\n try {\n foundPage = denormalizePagePath(normalizePagePath(params.page));\n } catch (err) {\n return null;\n }\n let pageInfo = params.middleware ? manifest.middleware[foundPage] : manifest.functions[foundPage];\n if (!pageInfo) {\n if (!params.middleware) {\n throw new PageNotFoundError(foundPage);\n }\n return null;\n }\n return {\n name: pageInfo.name,\n paths: pageInfo.files.map((file)=>join(this.distDir, file)),\n wasm: (pageInfo.wasm ?? []).map((binding)=>({\n ...binding,\n filePath: join(this.distDir, binding.filePath)\n })),\n assets: pageInfo.assets && pageInfo.assets.map((binding)=>{\n return {\n ...binding,\n filePath: join(this.distDir, binding.filePath)\n };\n }),\n env: pageInfo.env\n };\n }\n /**\n * Checks if a middleware exists. This method is useful for the development\n * server where we need to check the filesystem. Here we just check the\n * middleware manifest.\n */ async hasMiddleware(pathname) {\n const info = this.getEdgeFunctionInfo({\n page: pathname,\n middleware: true\n });\n return Boolean(info && info.paths.length > 0);\n }\n /**\n * A placeholder for a function to be defined in the development server.\n * It will make sure that the root middleware or an edge function has been compiled\n * so that we can run it.\n */ async ensureMiddleware(_url) {}\n async ensureEdgeFunction(_params) {}\n /**\n * This method gets all middleware matchers and execute them when the request\n * matches. It will make sure that each middleware exists and is compiled and\n * ready to be invoked. The development server will decorate it to add warns\n * and errors with rich traces.\n */ async runMiddleware(params) {\n if (process.env.NEXT_MINIMAL) {\n throw new Error(\"invariant: runMiddleware should not be called in minimal mode\");\n }\n // Middleware is skipped for on-demand revalidate requests\n if (checkIsOnDemandRevalidate(params.request, this.renderOpts.previewProps).isOnDemandRevalidate) {\n return {\n response: new Response(null, {\n headers: {\n \"x-middleware-next\": \"1\"\n }\n })\n };\n }\n let url;\n if (this.nextConfig.skipMiddlewareUrlNormalize) {\n url = getRequestMeta(params.request, \"initURL\");\n } else {\n // For middleware to \"fetch\" we must always provide an absolute URL\n const query = urlQueryToSearchParams(params.parsed.query).toString();\n const locale = params.parsed.query.__nextLocale;\n url = `${getRequestMeta(params.request, \"initProtocol\")}://${this.fetchHostname || \"localhost\"}:${this.port}${locale ? `/${locale}` : \"\"}${params.parsed.pathname}${query ? `?${query}` : \"\"}`;\n }\n if (!url.startsWith(\"http\")) {\n throw new Error(\"To use middleware you must provide a `hostname` and `port` to the Next.js Server\");\n }\n const page = {};\n const middleware = this.getMiddleware();\n if (!middleware) {\n return {\n finished: false\n };\n }\n if (!await this.hasMiddleware(middleware.page)) {\n return {\n finished: false\n };\n }\n await this.ensureMiddleware(params.request.url);\n const middlewareInfo = this.getEdgeFunctionInfo({\n page: middleware.page,\n middleware: true\n });\n if (!middlewareInfo) {\n throw new MiddlewareNotFoundError();\n }\n const method = (params.request.method || \"GET\").toUpperCase();\n const { run } = require(\"./web/sandbox\");\n const result = await run({\n distDir: this.distDir,\n name: middlewareInfo.name,\n paths: middlewareInfo.paths,\n edgeFunctionEntry: middlewareInfo,\n request: {\n headers: params.request.headers,\n method,\n nextConfig: {\n basePath: this.nextConfig.basePath,\n i18n: this.nextConfig.i18n,\n trailingSlash: this.nextConfig.trailingSlash\n },\n url: url,\n page,\n body: getRequestMeta(params.request, \"clonableBody\"),\n signal: signalFromNodeResponse(params.response.originalResponse)\n },\n useCache: true,\n onWarning: params.onWarning\n });\n if (!this.renderOpts.dev) {\n result.waitUntil.catch((error)=>{\n console.error(`Uncaught: middleware waitUntil errored`, error);\n });\n }\n if (!result) {\n this.render404(params.request, params.response, params.parsed);\n return {\n finished: true\n };\n }\n // Split compound (comma-separated) set-cookie headers\n if (result.response.headers.has(\"set-cookie\")) {\n const cookies = result.response.headers.getSetCookie().flatMap((maybeCompoundCookie)=>splitCookiesString(maybeCompoundCookie));\n // Clear existing header(s)\n result.response.headers.delete(\"set-cookie\");\n // Append each cookie individually.\n for (const cookie of cookies){\n result.response.headers.append(\"set-cookie\", cookie);\n }\n // Add cookies to request meta.\n addRequestMeta(params.request, \"middlewareCookie\", cookies);\n }\n return result;\n }\n getPrerenderManifest() {\n var _this_renderOpts, _this_serverOptions;\n if (this._cachedPreviewManifest) {\n return this._cachedPreviewManifest;\n }\n if (((_this_renderOpts = this.renderOpts) == null ? void 0 : _this_renderOpts.dev) || ((_this_serverOptions = this.serverOptions) == null ? void 0 : _this_serverOptions.dev) || process.env.NODE_ENV === \"development\" || process.env.NEXT_PHASE === PHASE_PRODUCTION_BUILD) {\n this._cachedPreviewManifest = {\n version: 4,\n routes: {},\n dynamicRoutes: {},\n notFoundRoutes: [],\n preview: {\n previewModeId: require(\"crypto\").randomBytes(16).toString(\"hex\"),\n previewModeSigningKey: require(\"crypto\").randomBytes(32).toString(\"hex\"),\n previewModeEncryptionKey: require(\"crypto\").randomBytes(32).toString(\"hex\")\n }\n };\n return this._cachedPreviewManifest;\n }\n this._cachedPreviewManifest = loadManifest(join(this.distDir, PRERENDER_MANIFEST));\n return this._cachedPreviewManifest;\n }\n getRoutesManifest() {\n return getTracer().trace(NextNodeServerSpan.getRoutesManifest, ()=>{\n const manifest = loadManifest(join(this.distDir, ROUTES_MANIFEST));\n let rewrites = manifest.rewrites ?? {\n beforeFiles: [],\n afterFiles: [],\n fallback: []\n };\n if (Array.isArray(rewrites)) {\n rewrites = {\n beforeFiles: [],\n afterFiles: rewrites,\n fallback: []\n };\n }\n return {\n ...manifest,\n rewrites\n };\n });\n }\n attachRequestMeta(req, parsedUrl, isUpgradeReq) {\n var _req_headers_xforwardedproto;\n // Injected in base-server.ts\n const protocol = ((_req_headers_xforwardedproto = req.headers[\"x-forwarded-proto\"]) == null ? void 0 : _req_headers_xforwardedproto.includes(\"https\")) ? \"https\" : \"http\";\n // When there are hostname and port we build an absolute URL\n const initUrl = this.fetchHostname && this.port ? `${protocol}://${this.fetchHostname}:${this.port}${req.url}` : this.nextConfig.experimental.trustHostHeader ? `https://${req.headers.host || \"localhost\"}${req.url}` : req.url;\n addRequestMeta(req, \"initURL\", initUrl);\n addRequestMeta(req, \"initQuery\", {\n ...parsedUrl.query\n });\n addRequestMeta(req, \"initProtocol\", protocol);\n if (!isUpgradeReq) {\n addRequestMeta(req, \"clonableBody\", getCloneableBody(req.body));\n }\n }\n async runEdgeFunction(params) {\n if (process.env.NEXT_MINIMAL) {\n throw new Error(\"Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.\");\n }\n let edgeInfo;\n const { query, page, match } = params;\n if (!match) await this.ensureEdgeFunction({\n page,\n appPaths: params.appPaths,\n url: params.req.url\n });\n edgeInfo = this.getEdgeFunctionInfo({\n page,\n middleware: false\n });\n if (!edgeInfo) {\n return null;\n }\n // For edge to \"fetch\" we must always provide an absolute URL\n const isNextDataRequest = !!query.__nextDataReq;\n const initialUrl = new URL(getRequestMeta(params.req, \"initURL\") || \"/\", \"http://n\");\n const queryString = urlQueryToSearchParams({\n ...Object.fromEntries(initialUrl.searchParams),\n ...query,\n ...params.params\n }).toString();\n if (isNextDataRequest) {\n params.req.headers[\"x-nextjs-data\"] = \"1\";\n }\n initialUrl.search = queryString;\n const url = initialUrl.toString();\n if (!url.startsWith(\"http\")) {\n throw new Error(\"To use middleware you must provide a `hostname` and `port` to the Next.js Server\");\n }\n const { run } = require(\"./web/sandbox\");\n const result = await run({\n distDir: this.distDir,\n name: edgeInfo.name,\n paths: edgeInfo.paths,\n edgeFunctionEntry: edgeInfo,\n request: {\n headers: params.req.headers,\n method: params.req.method,\n nextConfig: {\n basePath: this.nextConfig.basePath,\n i18n: this.nextConfig.i18n,\n trailingSlash: this.nextConfig.trailingSlash\n },\n url,\n page: {\n name: params.page,\n ...params.params && {\n params: params.params\n }\n },\n body: getRequestMeta(params.req, \"clonableBody\"),\n signal: signalFromNodeResponse(params.res.originalResponse)\n },\n useCache: true,\n onError: params.onError,\n onWarning: params.onWarning,\n incrementalCache: globalThis.__incrementalCache || getRequestMeta(params.req, \"incrementalCache\")\n });\n if (result.fetchMetrics) {\n params.req.fetchMetrics = result.fetchMetrics;\n }\n if (!params.res.statusCode || params.res.statusCode < 400) {\n params.res.statusCode = result.response.status;\n params.res.statusMessage = result.response.statusText;\n }\n // TODO: (wyattjoh) investigate improving this\n result.response.headers.forEach((value, key)=>{\n // The append handling is special cased for `set-cookie`.\n if (key.toLowerCase() === \"set-cookie\") {\n // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici\n for (const cookie of splitCookiesString(value)){\n params.res.appendHeader(key, cookie);\n }\n } else {\n params.res.appendHeader(key, value);\n }\n });\n const nodeResStream = params.res.originalResponse;\n if (result.response.body) {\n await pipeToNodeResponse(result.response.body, nodeResStream);\n } else {\n nodeResStream.end();\n }\n return result;\n }\n get serverDistDir() {\n if (this._serverDistDir) {\n return this._serverDistDir;\n }\n const serverDistDir = join(this.distDir, SERVER_DIRECTORY);\n this._serverDistDir = serverDistDir;\n return serverDistDir;\n }\n async getFallbackErrorComponents(_url) {\n // Not implemented for production use cases, this is implemented on the\n // development server.\n return null;\n }\n}\n\n//# sourceMappingURL=next-server.js.map","import { RouteKind } from \"../route-kind\";\n/**\n * Checks if the given match is a Pages API route match.\n * @param match the match to check\n * @returns true if the match is a Pages API route match, false otherwise\n */ export function isPagesAPIRouteMatch(match) {\n return match.definition.kind === RouteKind.PAGES_API;\n}\n\n//# sourceMappingURL=pages-api-route-match.js.map","import { Agent as HttpAgent } from \"http\";\nimport { Agent as HttpsAgent } from \"https\";\nexport function setHttpClientAndAgentOptions(config) {\n if (globalThis.__NEXT_HTTP_AGENT) {\n // We only need to assign once because we want\n // to reuse the same agent for all requests.\n return;\n }\n if (!config) {\n throw new Error(\"Expected config.httpAgentOptions to be an object\");\n }\n globalThis.__NEXT_HTTP_AGENT_OPTIONS = config.httpAgentOptions;\n globalThis.__NEXT_HTTP_AGENT = new HttpAgent(config.httpAgentOptions);\n globalThis.__NEXT_HTTPS_AGENT = new HttpsAgent(config.httpAgentOptions);\n}\n\n//# sourceMappingURL=setup-http-agent-env.js.map","import { matchHas } from \"./prepare-destination\";\nexport function getMiddlewareRouteMatcher(matchers) {\n return (pathname, req, query)=>{\n for (const matcher of matchers){\n const routeMatch = new RegExp(matcher.regexp).exec(pathname);\n if (!routeMatch) {\n continue;\n }\n if (matcher.has || matcher.missing) {\n const hasParams = matchHas(req, query, matcher.has, matcher.missing);\n if (!hasParams) {\n continue;\n }\n }\n return true;\n }\n return false;\n };\n}\n\n//# sourceMappingURL=middleware-route-matcher.js.map","import { PassThrough } from \"stream\";\nexport function requestToBodyStream(context, KUint8Array, stream) {\n return new context.ReadableStream({\n start: async (controller)=>{\n for await (const chunk of stream){\n controller.enqueue(new KUint8Array(chunk));\n }\n controller.close();\n }\n });\n}\nfunction replaceRequestBody(base, stream) {\n for(const key in stream){\n let v = stream[key];\n if (typeof v === \"function\") {\n v = v.bind(base);\n }\n base[key] = v;\n }\n return base;\n}\nexport function getCloneableBody(readable) {\n let buffered = null;\n const endPromise = new Promise((resolve, reject)=>{\n readable.on(\"end\", resolve);\n readable.on(\"error\", reject);\n }).catch((error)=>{\n return {\n error\n };\n });\n return {\n /**\n * Replaces the original request body if necessary.\n * This is done because once we read the body from the original request,\n * we can't read it again.\n */ async finalize () {\n if (buffered) {\n const res = await endPromise;\n if (res && typeof res === \"object\" && res.error) {\n throw res.error;\n }\n replaceRequestBody(readable, buffered);\n buffered = readable;\n }\n },\n /**\n * Clones the body stream\n * to pass into a middleware\n */ cloneBodyStream () {\n const input = buffered ?? readable;\n const p1 = new PassThrough();\n const p2 = new PassThrough();\n input.on(\"data\", (chunk)=>{\n p1.push(chunk);\n p2.push(chunk);\n });\n input.on(\"end\", ()=>{\n p1.push(null);\n p2.push(null);\n });\n buffered = p2;\n return p1;\n }\n };\n}\n\n//# sourceMappingURL=body-streams.js.map"],"names":["e","exports","j","t","ignoreProcessEnv","process","env","n","parsed","r","Object","prototype","hasOwnProperty","call","_interpolate","_searchLast","Array","from","matchAll","length","slice","index","i","o","match","s","replace","a","c","version","l","_debug","console","log","_dotenvKey","DOTENV_KEY","_vaultPath","resolve","cwd","path","endsWith","p","configDotenv","Boolean","debug","join","homedir","encoding","parse","readFileSync","processEnv","populate","message","error","_configVault","_parseVault","split","trim","_instructions","URL","code","password","searchParams","get","toUpperCase","ciphertext","key","decrypt","config","existsSync","Buffer","createDecipheriv","setAuthTag","update","final","RangeError","toString","exec","override","keys","JSON","__nccwpck_require__","undefined","__esModule","d","defineProperty","enumerable","Symbol","toStringTag","value","ab","__dirname","initialEnv","updateInitialEnv","resetEnv","loadEnvConfig","u","assign","replaceProcessEnv","forEach","startsWith","entries","__NEXT_PROCESSED_ENV","_","contents","some","combinedEnv","loadedEnvFiles","filter","statSync","isFile","push","module","__defProp","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","src_exports","stringifyCookie","_a","attrs","expires","Date","toUTCString","maxAge","domain","secure","httpOnly","sameSite","partitioned","priority","stringified","name","encodeURIComponent","parseCookie","cookie","map","Map","pair","splitAt","indexOf","set","decodeURIComponent","parseSetCookie","setCookie","string","attributes","httponly","maxage","samesite","fromEntries","value2","toLowerCase","compact","newT","Number","SAME_SITE","includes","PRIORITY","__export","target","all","RequestCookies","ResponseCookies","__copyProps","to","except","desc","constructor","requestHeaders","_parsed","_headers","header","iterator","size","args","getAll","has","delete","names","result","isArray","clear","for","stringify","values","v","responseHeaders","_b","_c","getSetCookie","cookieString","splitCookiesString","cookiesString","start","ch","lastComma","nextStart","cookiesSeparatorFound","cookiesStrings","pos","skipWhitespace","test","charAt","substring","normalizeCookie","now","bag","headers","serialized","append","decode","f","substr","tryDecode","serialize","encode","isNaN","isFinite","Math","floor","parseHttpDate","NaN","parseTokenList","charCodeAt","h","naiveLength","isStale","del","unshiftNode","tail","prev","removeNode","Entry","forEachStep","max","Infinity","stale","dispose","noDisposeOnSet","updateAgeOnGet","reset","allowStale","lengthCalculator","itemCount","rforEach","head","next","toArray","dump","k","dumpLru","unshift","peek","pop","load","prune","Yallist","arguments","Node","list","create","pushNode","shift","forEachReverse","getReverse","mapReverse","reduce","reduceReverse","toArrayReverse","sliceReverse","splice","insert","reverse","str","options","tokens","lexer","char","type","count","pattern","prefixes","defaultPattern","escapeString","delimiter","tryConsume","mustConsume","consumeText","prefix","suffix","modifier","name_1","pattern_1","flags","sensitive","reFlags","validate","matches","x","token","data","optional","repeat","segment","String","typeOfMessage","re","pathname","m","params","_loop_1","pathToRegexp","RegExp","regexpToRegexp","groups","source","parts","tokensToRegexp","strict","end","_d","route","_i","tokens_1","mod","endToken","isEndDelimited","NEXT_QUERY_PARAM_PREFIX","PRERENDER_REVALIDATE_HEADER","PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER","RSC_PREFETCH_SUFFIX","RSC_SUFFIX","ACTION_SUFFIX","NEXT_DATA_SUFFIX","NEXT_META_SUFFIX","NEXT_CACHE_TAGS_HEADER","NEXT_CACHE_SOFT_TAGS_HEADER","NEXT_CACHE_REVALIDATED_TAGS_HEADER","NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER","CACHE_ONE_YEAR","INSTRUMENTATION_HOOK_FILENAME","SERVER_RUNTIME","edge","experimentalEdge","nodejs","WEBPACK_LAYERS_NAMES","shared","reactServerComponents","serverSideRendering","actionBrowser","api","middleware","instrument","edgeAsset","appPagesBrowser","appMetadataRoute","appRouteHandler","GROUP","serverOnly","clientOnly","nonClientServerTarget","app","checkIsOnDemandRevalidate","req","previewProps","isOnDemandRevalidate","previewModeId","revalidateOnlyGenerated","COOKIE_NAME_PRERENDER_BYPASS","COOKIE_NAME_PRERENDER_DATA","SYMBOL_PREVIEW_DATA","SYMBOL_CLEARED_COOKIES","clearPreviewData","res","previous","getHeader","setHeader","tryGetPreviewData","multiZoneDraftMode","_cookies_get","_cookies_get1","encryptedPreviewData","cookies","tokenPreviewData","jsonwebtoken","verify","previewModeSigningKey","decryptWithSecret","decryptedPreviewData","previewModeEncryptionKey","CIPHER_ALGORITHM","encryptWithSecret","secret","iv","salt","cipher","encrypted","concat","tag","getAuthTag","encryptedData","buffer","CIPHER_SALT_LENGTH","decipher","ipcForbiddenHeaders","filterReqHeaders","forbiddenHeaders","invokeRequest","targetUrl","requestInit","readableBody","invokeHeaders","fetch","method","redirect","signal","body","duplex","internal","deserializeErr","serializedErr","stack","ErrorType","Error","err","digest","invokeIpcMethod","fetchHostname","ipcPort","ipcKey","text","parsedBody","BaseServerSpan","LoadComponentsSpan","NextServerSpan","NextNodeServerSpan","StartServerSpan","RenderSpan","AppRenderSpan","RouterSpan","NodeSpan","AppRouteRouteHandlersSpan","ResolveMetadataSpan","MiddlewareSpan","globalThis","AsyncLocalStorage","WebSocket","global","crypto","webcrypto","configurable","ReflectAdapter","prop","receiver","Reflect","bind","deleteProperty","ReadonlyHeadersError","callable","HeadersAdapter","Headers","Proxy","lowercased","original","find","seal","merge","existing","callbackfn","thisArg","webpackEmptyContext","id","execOnce","fn","used","_len","_key","isResSent","finished","headersSent","normalizeRepeatedSlashes","url","urlParts","urlNoQuery","SP","performance","every","DecodeError","NormalizeError","PageNotFoundError","page","MissingStaticPage","MiddlewareNotFoundError","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","definition","obj","memoryCache","tagsManifest","RedirectStatusCode","_globalThis","PAGE_TYPES","originalRequire","resolveFilename","_resolveFilename","hookPropertyMap","addHookAliases","aliases","dirname","originalResolveFilename","requestMap","request","parent","isMain","hookResolved","basename","getRouteMatcher","param","routeMatch","g","slugName","entry","NEXT_REQUEST_META","getRequestMeta","meta","addRequestMeta","COMPILER_NAMES","client","server","edgeServer","UNDERSCORE_NOT_FOUND_ROUTE","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","PAGES_MANIFEST","APP_PATHS_MANIFEST","SERVER_DIRECTORY","BLOCKED_PAGES","STATIC_STATUS_PAGES","findDir","dir","curDir","getCookieParser","parseCookieFn","BaseNextRequest","_cookies","BaseNextResponse","destination","statusCode","PermanentRedirect","NodeNextRequest","originalRequest","_req","_this__req","fetchMetrics","NodeNextResponse","originalResponse","_res","textBody","sent","statusMessage","removeHeader","getHeaderValues","hasHeader","getHeaders","appendHeader","currentValues","send","fnv1a52","len","t0","v0","t1","v1","t2","v2","t3","v3","generateETag","payload","weak","formatRevalidate","revalidate","swrDelta","swrHeader","ACTION","NEXT_ROUTER_STATE_TREE","NEXT_ROUTER_PREFETCH_HEADER","FLIGHT_PARAMETERS","NEXT_RSC_UNION_QUERY","sendRenderResult","generateEtags","poweredByHeader","isDynamic","toUnchunkedString","_root_querySelector","etagPayload","sort","root","scriptTags","querySelector","querySelectorAll","_node_innerHTML","node","hasAttribute","innerHTML","b","localeCompare","script","remove","appendChild","etag","contentType","byteLength","pipeToNodeResponse","searchParamsToUrlQuery","query","parseUrl","parseRelativeUrl","base","globalBase","resolvedBase","search","hash","href","origin","parsedURL","hostname","port","protocol","stdout","enabled","NO_COLOR","FORCE_COLOR","isTTY","CI","TERM","replaceClose","close","nextIndex","formatter","open","input","bold","red","green","yellow","magenta","white","wait","warn","ready","info","event","trace","LOGGING_METHOD","prefixedLog","prefixType","consoleMethod","bootstrap","warnOnceMessages","Set","warnOnce","add","v4Seg","v4Str","v6Seg","IPv6Reg","ensureLeadingSlash","segments","normalizeRscURL","TEST_ROUTE","isDynamicRoute","interceptingRoute","marker","interceptedRoute","splitInterceptingRoute","isBot","userAgent","voidCatch","Uint8Array","encoder","TextEncoder","streamToString","stream","decoder","TextDecoder","fatal","chunk","fromNodeOutgoingHttpHeaders","nodeHeaders","toNodeOutgoingHttpHeaders","removeTrailingSlash","parsePath","hashIndex","queryIndex","hasQuery","addPathPrefix","addPathSuffix","pathHasPrefix","getHostname","host","normalizeLocalePath","locales","detectedLocale","pathnameParts","locale","withoutPrefix","getNextPathnameInfo","_options_nextConfig","_result_pathname","basePath","i18n","trailingSlash","nextConfig","pathnameNoDataPrefix","paths","buildId","parseData","i18nProvider","analyze","REGEX_LOCALHOST_HOSTNAME","parseURL","Internal","NextURL","baseOrOpts","opts","_this_Internal_options_nextConfig_i18n","_this_Internal_options_nextConfig","_this_Internal_domainLocale","_this_Internal_options_nextConfig_i18n1","_this_Internal_options_nextConfig1","__NEXT_NO_MIDDLEWARE_URL_NORMALIZE","domainLocale","detectDomainLocale","domainItems","item","_item_domain","_item_locales","defaultLocale","domains","formatPathname","addLocale","ignorePrefix","lower","forceLocale","formatSearch","username","toJSON","clone","RemovedPageError","RemovedUAError","INTERNALS","NextRequest","Request","init","validateURL","cause","nextUrl","geo","ip","bodyUsed","cache","credentials","integrity","keepalive","mode","referrer","referrerPolicy","ua","ResponseAbortedName","ResponseAborted","createAbortController","response","controller","AbortController","once","writableFinished","abort","NextRequestAdapter","fromBaseNextRequest","fromWebNextRequest","fromNodeNextRequest","aborted","reject","promise","Promise","rej","clientComponentLoadStart","clientComponentLoadTimes","clientComponentLoadCount","isAbortError","readable","waitUntilForEnd","errored","destroyed","writer","createWriterFromResponse","started","drained","onDrain","on","off","WritableStream","write","NEXT_OTEL_PERFORMANCE_PREFIX","metrics","getClientComponentLoaderMetrics","measure","flushHeaders","getTracer","startResponse","spanName","ok","flush","destroy","pipeTo","RenderResult","fromStatic","metadata","waitUntil","assignMetadata","isNull","chainStreams","streams","writable","TransformStream","preventClose","nextStream","then","lastStream","catch","chain","responses","ReadableStream","enqueue","denormalizePagePath","_page","getPathMatch","regexp","matcher","regexModifier","removeUnnamedParams","reHasRegExp","reReplaceRegExp","escapeStringRegexp","parseParameter","getRouteRegex","normalizedRoute","parameterizedRoute","getParametrizedRoute","groupIndex","markerMatch","paramMatches","getSafeKeyFromSegment","interceptionMarker","getSafeRouteKey","routeKeys","keyPrefix","cleanedKey","invalidKey","parseInt","interceptionPrefix","unescapeSegments","matchHas","missing","hasMatch","hasItem","getSafeParamName","paramName","newParamName","charCode","groupKey","compileNonPath","isError","getProperError","isPlainObject","getObjectClassLabel","getPrototypeOf","LocaleRouteNormalizer","provider","normalize","UrlNode","urlPath","_insert","smoosh","_smoosh","childrenPaths","children","restSlugName","optionalRestSlugName","routes","curr","placeholder","urlPaths","slugNames","isCatchAll","nextSegment","segmentName","isOptional","handleSlug","previousSlug","nextSlug","slug","RouteMatcher","dynamic","identity","LocaleRouteMatcher","_this_definition_i18n","_options_i18n","DefaultRouteMatcherManager","compilationID","providers","waitTillReady","waitTillReadyPromise","reload","matchers","providersMatchers","duplicates","providerMatchers","duplicated","duplicate","others","previousMatchers","cachedMatcher","static","reference","pathnames","indexes","sorted","getSortedRoutes","normalizedPages","pagePath","sortedDynamicMatchers","dynamicMatches","lastCompilationID","inferredFromDefault","skipDynamic","Normalizers","normalizers","normalizer","normalized","PrefixingNormalizer","normalizePagePath","posix","resolvedPage","AppBundlePathNormalizer","AppFilenameNormalizer","distDir","manifestFilename","wrapNormalizerFn","UnderscoreNormalizer","AppPathnameNormalizer","AppNormalizers","filename","bundlePath","RouteKind","AppPageRouteMatcher","CachedRouteMatcherProvider","loader","cached","compare","transform","ManifestRouteMatcherProvider","manifestName","manifestLoader","left","right","AppPageRouteMatcherProvider","manifest","pages","allAppPaths","appPaths","kind","APP_PAGE","AppRouteRouteMatcher","AppRouteRouteMatcherProvider","APP_ROUTE","isAPIRoute","PagesAPIRouteMatcher","PagesAPILocaleRouteMatcher","PagesBundlePathNormalizer","PagesFilenameNormalizer","PagesNormalizers","PagesAPIRouteMatcherProvider","PAGES_API","PagesRouteMatcher","PagesLocaleRouteMatcher","PagesRouteMatcherProvider","_this_i18nProvider","PAGES","ServerManifestLoader","I18NProvider","_config_domains","lowerCaseLocales","lowerCaseDomains","_domainLocale_locales","http","fromQuery","__nextLocale","analysis","__nextInferredLocaleFromDefault","validateQuery","__nextDefaultLocale","sendResponse","_response_headers","status","statusText","SuffixPathnameNormalizer","matched","RSCPathnameNormalizer","PrefixPathnameNormalizer","PostponedPathnameNormalizer","ActionPathnameNormalizer","stripFlightHeaders","PrefetchRSCPathnameNormalizer","NextDataPathnameNormalizer","buildID","toRoute","NoFallbackError","WrappedBuildError","innerError","Server","_this_nextConfig_i18n","_this_nextConfig_experimental_amp","_this_nextConfig_i18n1","handleRSCRequest","parsedUrl","_this_normalizers_prefetchRSC","_this_normalizers_rsc","prefetchRSC","RSC_HEADER","rsc","format","handleNextDataRequest","getMiddleware","matchNextDataPathname","render404","lastParam","getRouteFromAssetPath","assetPath","ext","_req_headers_host","localePathResult","__nextDataReq","handleNextImageRequest","handleCatchallRenderRequest","handleCatchallMiddlewareRequest","postponed","action","normalizeAndAttachMetadata","enabledDirectories","prepared","preparedPromise","customErrorNo404Warn","quiet","conf","dev","minimalMode","customServer","experimentalTestProxy","serverOptions","formatHostname","isIPv6","publicDir","getPublicDir","hasStaticDir","getHasStaticDir","localeNormalizer","serverRuntimeConfig","publicRuntimeConfig","assetPrefix","getBuildId","NEXT_PRIVATE_MINIMAL_MODE","getEnabledDirectories","experimental","ppr","nextFontManifest","getNextFontManifest","NEXT_DEPLOYMENT_ID","deploymentId","renderOpts","supportsDynamicResponse","strictNextHead","canonicalBase","amp","getPrerenderManifest","preview","ampOptimizerConfig","optimizer","images","optimizeFonts","fontManifest","getFontManifest","optimizeCss","nextConfigOutput","output","nextScriptWorkers","disableOptimizedLoading","domainLocales","serverComponents","enableTainting","taint","crossOrigin","largePageDataBytes","runtimeConfig","isExperimentalCompile","missingSuspenseWithCSRBailout","setConfig","pagesManifest","getPagesManifest","appPathsManifest","getAppPathsManifest","appPathRoutes","getAppPathRoutes","interceptionRoutePatterns","getinterceptionRoutePatterns","getRouteMatchers","setAssetPrefix","responseCache","getResponseCache","reloadMatchers","logError","handleRequest","prepare","isRSCRequestCheck","tracer","withPropagatedContext","SpanKind","SERVER","span","handleRequestImpl","finally","setAttributes","rootSpanAttributes","getRootSpanAttributes","newName","updateName","_originalRequest_socket","_originalRequest_socket1","_this_i18nProvider1","_this_normalizers_data","_this_normalizers_postponed","_this_i18nProvider2","_this_getRoutesManifest","_utils_defaultRouteRegex","origSetHeader","val","middlewareValue","idx","cleanUrl","URLSearchParams","xForwardedProto","isHttps","socket","remoteAddress","attachRequestMeta","pathnameInfo","useMatchedPathHeader","matchedPath","urlPathname","normalizedUrlPath","stripNextDataPath","localeAnalysisResult","srcPathname","pageIsDynamic","utils","getUtils","rewrites","caseSensitive","defaultRouteRegex","dynamicRouteMatcher","defaultRouteMatches","prefixRouteKey","getNamedParametrizedRoute","prefixRouteKeys","routeKey","fromCharCode","namedParameterizedRoute","hasInterceptionMarker","usedMarker","namedRegex","handleRewrites","rewriteParams","fsPathname","checkRewrite","rewrite","hasParams","parsedDestination","destQuery","prepareDestination","newUrl","escapedDestination","destPath","destHostname","destPathParamKeys","destHostnameParamKeys","destParams","destPathCompiler","destHostnameCompiler","strOrArray","paramKeys","appendParamsToQuery","destLocalePathResult","nextInternalLocale","dynamicParams","beforeFiles","afterFiles","matchesPage","fsPathnameNoSlash","fallback","getParamsFromRouteMatches","matchesHasLocale","routeKeyNames","filterLocaleItem","_val","keyName","normalizedKey","normalizeDynamicRouteParams","ignoreOptional","hasValidParams","defaultValue","isDefaultValue","defaultVal","normalizeVercelUrl","trustQuery","_parsedUrl","interpolateDynamicPath","builtParam","paramIdx","paramValue","getRoutesManifest","caseSensitiveRoutes","pathnameBeforeRewrite","rewriteParamKeys","didRewrite","routeParamKeys","paramsResult","matcherParams","routeParams","renderError","webServerConfig","parsedFullUrl","incrementalCache","getIncrementalCache","requestProtocol","resetRequestCache","__incrementalCache","invokePath","invokeStatus","invokeQuery","parsedMatchedPath","invokePathnameInfo","normalizeResult","Response","bubble","run","getRequestHandlerWithMetadata","handler","getRequestHandler","prepareImpl","normalizedPath","runImpl","pipe","partialContext","pipeImpl","isBotRequest","ctx","originalStatus","getStaticHTML","render","internalRender","renderImpl","hasPage","renderToResponse","getStaticPaths","_this_getPrerenderManifest_dynamicRoutes_pathname","fallbackField","dynamicRoutes","staticPaths","fallbackMode","renderToResponseWithComponents","requestContext","findComponentsResult","renderToResponseWithComponentsImpl","pathCouldBeIntercepted","resolvedPathname","setVaryHeader","isAppPath","baseVaryHeader","isRSCRequest","addedNextUrlToVary","components","_components_Component","_cacheEntry_value","_components_Document","_cachedData_headers","isErrorPathname","is404Page","is500Page","hasServerProps","getServerSideProps","hasStaticPaths","isServerAction","getServerActionRequestMetadata","actionId","isURLEncodedAction","isMultipartAction","isFetchAction","hasGetInitialProps","Component","getInitialProps","isSSG","getStaticProps","resolvedUrlPathname","hasFallback","prerenderManifest","pathsResult","resolvedWithoutSlash","isNextDataRequest","isPrefetchRSCRequest","minimalPostponed","isDynamicRSCRequest","isSupportedDocument","Document","NEXT_BUILTIN_DOCUMENT","isPreviewMode","previewData","runtime","ssgCacheKey","seg","routeModule","isDebugPPRSkeleton","__nextppronly","doRender","origQuery","hadTrailingSlash","resolvedUrl","isRevalidate","originalPathname","ComponentMod","serverActions","resolvedAsPath","isDraftMode","nextExport","isStaticGeneration","context","signalFromNodeResponse","AbortSignal","handle","cacheTags","fetchTags","_context_renderOpts_store","blob","store","arrayBuffer","clientReferenceManifest","renderHTML","staticBailoutInfo","description","isNotFound","isRedirect","props","pageData","flightData","html","cacheEntry","hasResolved","previousCacheEntry","isRevalidating","staticPathKey","routeKind","isPrefetch","purpose","cachedData","notFoundRevalidate","onCacheEntry","handleRedirect","pageProps","__N_REDIRECT","__N_REDIRECT_STATUS","__N_REDIRECT_BASE_PATH","permanent","TemporaryRedirect","stripLocale","splitPath","getOriginalAppPaths","_this_appPathRoutes","renderPageComponent","bubbleNoFallback","_this_nextConfig_experimental_sri","_getTracer_getRootSpanAttributes","findPageComponents","sriEnabled","sri","algorithm","shouldEnsure","isNoFallbackError","renderToResponseImpl","_nextBubbleNoFallback","initUrl","rewroteUrl","renderErrorToResponse","__nextCustomErrorRender","isWrappedError","renderToHTML","renderToHTMLImpl","setHeaders","renderErrorImpl","renderErrorToResponseImpl","statusPage","removeRequestMeta","maybeFallbackError","renderToHtmlError","fallbackComponents","getFallbackErrorComponents","renderErrorToHTML","deepFreeze","isFrozen","freeze","sharedCache","loadManifest","shouldCache","pagePathCache","getMaybePagePath","cacheKey","serverBuildPath","checkManifest","curPath","manifestNoLocales","getPagePath","requirePage","promises","readFile","__NEXT_PRIVATE_RUNTIME_TYPE","interopDefault","default","ms","setTimeout","SERVER_ACTION_MANIFESTS_SINGLETON","loadManifestWithRetries","manifestPath","attempts","evalManifestWithRetries","evalManifest","content","contextObject","runInNewContext","loadClientReferenceManifest","entryName","__RSC_MANIFEST","loadComponentsImpl","DocumentMod","AppMod","hasClientManifest","buildManifest","reactLoadableManifest","serverActionsManifest","SERVER_REFERENCE_MANIFEST","setReferenceManifestsSingleton","serverModuleMap","createServerModuleMap","pageName","workers","chunks","App","pageConfig","loadComponents","wrap","Batcher","cacheKeyFn","schedulerFn","pending","batch","scheduleOnNextTick","nextTick","cb","fromResponseCacheEntry","toResponseCacheEntry","_response_value","_response_value1","isMiss","ResponseCache","batcher","responseGenerator","_this_previousCacheItem","previousCacheItem","expiresAt","resolved","cachedResponse","resolveValue","min","rateLimitedUntil","CACHE_TAGS_HEADER","CACHE_HEADERS_HEADER","CACHE_REVALIDATE_HEADER","CACHE_FETCH_URL_HEADER","DEBUG","NEXT_PRIVATE_DEBUG_CACHE","fetchRetryWithTimeout","retryIndex","timeout","clearTimeout","FetchCache","hasMatchingTags","arr1","arr2","set1","set2","isAvailable","_requestHeaders","SUSPENSE_CACHE_URL","newHeaders","scHost","scBasePath","SUSPENSE_CACHE_BASEPATH","SUSPENSE_CACHE_AUTH_TOKEN","scProto","SUSPENSE_CACHE_PROTO","cacheEndpoint","maxMemoryCacheSize","_JSON_stringify","revalidateTag","tags","ceil","currentTags","retryAfter","_data_value","softTags","kindHint","fetchIdx","fetchUrl","hasFetchKindAndMatchingTags","fetchType","json","cacheState","age","lastModified","fetchCache","FileSystemCache","fs","flushToDisk","serverDistDir","appDir","_appDir","pagesDir","_pagesDir","revalidatedTags","tagsManifestPath","loadTagsManifest","items","revalidatedAt","mkdir","writeFile","_data_value1","_data_value2","_data_value3","_data_value_headers","filePath","getFilePath","fileData","mtime","stat","getTime","detectFileKind","parsedData","storedTags","tagsHeader","_tagsManifest_items_tag","combinedTags","htmlPath","SharedRevalidateTimings","timings","_this_prerenderManifest_routes_route","initialRevalidateSeconds","IncrementalCache","fetchCacheKeyPrefix","CurCacheHandler","allowedRevalidateHeaderKeys","_this_prerenderManifest_preview","_this_prerenderManifest","_this_prerenderManifest_preview1","_this_prerenderManifest1","locks","unlocks","hasCustomCacheHandler","__NEXT_TEST_MAX_ISR_CACHE","disableForTestmode","NEXT_PRIVATE_TEST_PROXY","revalidateTimings","cacheHandler","calculateRevalidate","fromTime","_getPathname","_this_cacheHandler_resetRequestCache","_this_cacheHandler","unlock","lock","__NEXT_INCREMENTAL_CACHE_IPC_PORT","__NEXT_INCREMENTAL_CACHE_IPC_KEY","unlockNext","existingLock","newLock","_this_cacheHandler_revalidateTag","fetchCacheKey","bodyChunks","getReader","total","arr","offset","_ogBody","formData","Blob","cacheString","crypto1","createHash","_cacheData_value","revalidateAfter","cacheData","_this_revalidatedTags","curRevalidate","notFoundRoutes","itemSize","nodeFs","recursive","MockedRequest","httpVersion","httpVersionMajor","httpVersionMinor","_target","bodyReadable","emit","headersDistinct","_read","connection","complete","trailers","trailersDistinct","rawTrailers","rawHeaders","MockedResponse","buffers","headPromise","headPromiseResolve","hasStreamed","resWriter","isSent","isBuffer","_implicitHeader","_write","_encoding","callback","writeHead","getHeaderNames","strictContentLength","writeEarlyHints","assignSocket","detachSocket","writeContinue","writeProcessing","upgrading","chunkedEncoding","shouldKeepAlive","useChunkedEncodingByDefault","sendDate","addTrailers","NodeModuleLoader","RouteModuleLoader","formatDynamicImportPath","absoluteFilePath","pathToFileURL","isInterceptionRouteRewrite","_route_has_","_route_has","dynamicImportEsmDefault","dynamicRequire","MiddlewareMatcherCache","WeakMap","NextNodeServer","edgeFunctionsPage","getEdgeFunctionsPages","runEdgeFunction","handleApiRequest","isMiddlewareInvoke","handleFinished","normalizedPathname","bubblingResult","ensureMiddleware","runMiddleware","__NEXT_OPTIMIZE_FONTS","__NEXT_OPTIMIZE_CSS","__NEXT_SCRIPT_WORKERS","appDocumentPreloading","preloadEntriesOnStart","unstable_preloadEntries","regex","setHttpClientAndAgentOptions","__NEXT_HTTP_AGENT","__NEXT_HTTP_AGENT_OPTIONS","httpAgentOptions","__NEXT_HTTPS_AGENT","middlewareManifestPath","webpackRequire","__next_app__","handleUpgrade","instrumentationHook","register","forceReload","silent","CacheHandler","getCacheFilesystem","cacheMaxMemorySize","routesManifest","buildIdFile","runApi","trustHostHeader","renderHTMLImpl","imageOptimizer","edgeFunctionsPages","findPageComponentsImpl","_url","pagePaths","requireFontManifest","NEXT_FONT_MANIFEST","getFallback","cacheFs","logErrorWithOriginalStack","_err","_type","ensurePage","_opts","getPrefetchRsc","normalizeReq","normalizeRes","makeRequestHandler","_this_nextConfig_logging","normalizedReq","normalizedRes","loggingFetchesConfig","logging","fetches","fullUrl","revalidateHeaders","mocked","createRequestResponseMocks","unstable_onlyGenerated","getMiddlewareManifest","_manifest_middleware","getMiddlewareMatcher","stored","functions","getEdgeFunctionInfo","foundPage","pageInfo","files","file","wasm","binding","assets","hasMiddleware","ensureEdgeFunction","_params","_this_serverOptions","_cachedPreviewManifest","NEXT_PHASE","isUpgradeReq","_req_headers_xforwardedproto","getCloneableBody","buffered","endPromise","finalize","replaceRequestBody","cloneBodyStream","p1","PassThrough","p2","_serverDistDir"],"sourceRoot":""}
1
+ {"version":3,"file":"server.runtime.prod.js","mappings":"mDAAA,CAAC,KAAK,IAAIA,EAAE,CAAC,IAAIA,IAAI,YAAitBA,CAAAA,EAAEC,OAAO,CAACC,CAAC,CAAhR,SAAgBF,CAAC,EAAE,IAAMG,EAAEH,EAAEI,gBAAgB,CAAC,CAAC,EAAEC,QAAQC,GAAG,CAAC,IAAI,IAAMC,KAAKP,EAAEQ,MAAM,CAAC,CAAC,IAAMC,EAAEC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACV,EAAEI,GAAGJ,CAAC,CAACI,EAAE,CAACP,EAAEQ,MAAM,CAACD,EAAE,CAACP,EAAEQ,MAAM,CAACD,EAAE,CAA3LP,CAAlU,SAASc,EAAad,CAAC,CAACG,CAAC,CAACI,CAAC,EAAE,IAAME,EAAEM,SAAtHf,CAAC,CAACG,CAAC,EAAE,IAAMI,EAAES,MAAMC,IAAI,CAACjB,EAAEkB,QAAQ,CAACf,IAAI,OAAOI,EAAEY,MAAM,CAAC,EAAEZ,EAAEa,KAAK,CAAC,GAAG,CAAC,EAAE,CAACC,KAAK,CAAC,EAAE,EAAkDrB,EAAE,kBAAkB,GAAGS,KAAAA,EAAO,OAAOT,EAAE,IAA8EsB,EAAEC,EAAtEH,KAAK,CAACX,GAAkEe,KAAK,CAA5D,8CAAgE,GAAGF,MAAAA,EAAQ,CAAC,GAAK,EAAEb,EAAEc,EAAEE,EAAE,CAACH,EAAE,OAAOR,EAAad,EAAE0B,OAAO,CAACjB,EAAEN,CAAC,CAACoB,EAAE,EAAEE,GAAGlB,EAAEC,MAAM,CAACe,EAAE,EAAE,IAAIpB,EAAEI,EAAE,CAAC,OAAOP,CAAC,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+J,EAAE,CAAC,OAAQ,IACb88B,EAAGtoD,IAAI,CAACukB,GACRikC,EAAGxoD,IAAI,CAACukB,EACZ,GACA9C,EAAM+J,EAAE,CAAC,MAAO,KACZ88B,EAAGtoD,IAAI,CAAC,MACRwoD,EAAGxoD,IAAI,CAAC,KACZ,GACAioD,EAAWO,EACJF,CACX,CACJ,CACJ,EJ0gCiEv4C,EAAIqD,IAAI,EAErE,CACA,MAAMsvC,gBAAgBj2C,CAAM,CAAE,CAEtB,MAAM,MAAU,sGAuFxB,CACA,IAAIstC,eAAgB,CAChB,GAAI,IAAI,CAAC0O,cAAc,CACnB,OAAO,IAAI,CAACA,cAAc,CAE9B,IAAM1O,EAAgB,KAAAj+C,IAAA,EAAK,IAAI,CAAC64B,OAAO,CAAE5Z,GAEzC,OADA,IAAI,CAAC0tC,cAAc,CAAG1O,EACfA,CACX,CACA,MAAMjI,2BAA2BmT,CAAI,CAAE,CAGnC,OAAO,IACX,CACJ,C","sources":["webpack://next/../next-env/dist/index.js","webpack://next/./dist/compiled/@edge-runtime/cookies/index.js","webpack://next/./dist/compiled/cookie/index.js","webpack://next/./dist/compiled/fresh/index.js","webpack://next/./dist/compiled/lru-cache/index.js","webpack://next/./dist/compiled/path-to-regexp/index.js","webpack://next/./dist/esm/lib/constants.js","webpack://next/./dist/esm/server/api-utils/index.js","webpack://next/./dist/esm/server/api-utils/node/try-get-preview-data.js","webpack://next/./dist/esm/server/crypto-utils.js","webpack://next/./dist/esm/shared/lib/error-source.js","webpack://next/./dist/esm/server/lib/server-ipc/utils.js","webpack://next/./dist/esm/server/lib/server-ipc/invoke-request.js","webpack://next/./dist/esm/server/lib/server-ipc/request-utils.js","webpack://next/./dist/esm/server/lib/trace/constants.js","webpack://next/./dist/esm/server/node-environment.js","webpack://next/./dist/esm/server/node-polyfill-crypto.js","webpack://next/./dist/esm/server/web/spec-extension/adapters/reflect.js","webpack://next/./dist/esm/server/web/spec-extension/adapters/headers.js","webpack://next/./dist/esm/server/ sync","webpack://next/./dist/esm/shared/lib/isomorphic/path.js","webpack://next/./dist/esm/shared/lib/modern-browserslist-target.js","webpack://next/./dist/esm/shared/lib/utils.js","webpack://next/external commonjs \"next/dist/server/lib/trace/tracer\"","webpack://next/external commonjs2 \"next/dist/compiled/jsonwebtoken\"","webpack://next/external commonjs2 \"next/dist/compiled/node-html-parser\"","webpack://next/external commonjs2 \"next/dist/compiled/ws\"","webpack://next/external commonjs2 \"next/dist/server/web/sandbox\"","webpack://next/external node-commonjs \"async_hooks\"","webpack://next/external node-commonjs \"crypto\"","webpack://next/external node-commonjs \"fs\"","webpack://next/external node-commonjs \"module\"","webpack://next/external node-commonjs \"node:crypto\"","webpack://next/external node-commonjs \"os\"","webpack://next/external node-commonjs \"path\"","webpack://next/webpack/bootstrap","webpack://next/webpack/runtime/compat get default export","webpack://next/webpack/runtime/define property getters","webpack://next/webpack/runtime/hasOwnProperty shorthand","webpack://next/webpack/runtime/make namespace object","webpack://next/./dist/esm/server/lib/incremental-cache/fetch-cache.js","webpack://next/./dist/esm/server/lib/incremental-cache/file-system-cache.js","webpack://next/./dist/esm/client/components/redirect-status-code.js","webpack://next/./dist/esm/lib/picocolors.js","webpack://next/./dist/esm/lib/page-types.js","webpack://next/./dist/esm/server/future/route-kind.js","webpack://next/./dist/esm/server/require-hook.js","webpack://next/./dist/esm/shared/lib/router/utils/route-matcher.js","webpack://next/./dist/esm/server/request-meta.js","webpack://next/./dist/esm/shared/lib/constants.js","webpack://next/./dist/esm/lib/find-pages-dir.js","webpack://next/./dist/esm/server/api-utils/get-cookie-parser.js","webpack://next/./dist/esm/server/base-http/index.js","webpack://next/./dist/esm/server/base-http/node.js","webpack://next/./dist/esm/server/lib/etag.js","webpack://next/./dist/esm/server/lib/revalidate.js","webpack://next/./dist/esm/client/components/app-router-headers.js","webpack://next/./dist/esm/server/send-payload.js","webpack://next/./dist/esm/shared/lib/router/utils/querystring.js","webpack://next/./dist/esm/shared/lib/router/utils/parse-url.js","webpack://next/./dist/esm/shared/lib/router/utils/parse-relative-url.js","webpack://next/./dist/esm/build/output/log.js","webpack://next/external node-commonjs \"url\"","webpack://next/./dist/esm/server/lib/is-ipv6.js","webpack://next/./dist/esm/shared/lib/page-path/ensure-leading-slash.js","webpack://next/./dist/esm/shared/lib/router/utils/app-paths.js","webpack://next/./dist/esm/shared/lib/segment.js","webpack://next/./dist/esm/server/future/helpers/interception-routes.js","webpack://next/./dist/esm/shared/lib/router/utils/is-dynamic.js","webpack://next/external commonjs \"next/dist/shared/lib/runtime-config.external.js\"","webpack://next/./dist/esm/shared/lib/router/utils/is-bot.js","webpack://next/./dist/esm/server/stream-utils/node-web-streams-helper.js","webpack://next/./dist/esm/server/stream-utils/encodedTags.js","webpack://next/./dist/esm/server/web/utils.js","webpack://next/./dist/esm/shared/lib/router/utils/remove-trailing-slash.js","webpack://next/./dist/esm/shared/lib/router/utils/parse-path.js","webpack://next/./dist/esm/shared/lib/router/utils/add-path-prefix.js","webpack://next/./dist/esm/shared/lib/router/utils/add-path-suffix.js","webpack://next/./dist/esm/shared/lib/router/utils/path-has-prefix.js","webpack://next/./dist/esm/shared/lib/get-hostname.js","webpack://next/./dist/esm/shared/lib/i18n/normalize-locale-path.js","webpack://next/./dist/esm/shared/lib/router/utils/remove-path-prefix.js","webpack://next/./dist/esm/shared/lib/router/utils/get-next-pathname-info.js","webpack://next/./dist/esm/server/web/next-url.js","webpack://next/./dist/esm/shared/lib/i18n/detect-domain-locale.js","webpack://next/./dist/esm/shared/lib/router/utils/format-next-pathname-info.js","webpack://next/./dist/esm/shared/lib/router/utils/add-locale.js","webpack://next/./dist/esm/server/web/error.js","webpack://next/./dist/esm/server/web/spec-extension/request.js","webpack://next/./dist/esm/server/web/spec-extension/adapters/next-request.js","webpack://next/./dist/esm/lib/detached-promise.js","webpack://next/./dist/esm/server/client-component-renderer-logger.js","webpack://next/./dist/esm/server/pipe-readable.js","webpack://next/./dist/esm/server/render-result.js","webpack://next/./dist/esm/shared/lib/page-path/denormalize-page-path.js","webpack://next/./dist/esm/shared/lib/page-path/normalize-path-sep.js","webpack://next/./dist/esm/shared/lib/router/utils/path-match.js","webpack://next/./dist/esm/shared/lib/escape-regexp.js","webpack://next/./dist/esm/shared/lib/router/utils/route-regex.js","webpack://next/./dist/esm/shared/lib/router/utils/prepare-destination.js","webpack://next/./dist/esm/lib/is-error.js","webpack://next/./dist/esm/shared/lib/is-plain-object.js","webpack://next/./dist/esm/server/future/normalizers/locale-route-normalizer.js","webpack://next/./dist/esm/shared/lib/router/utils/sorted-routes.js","webpack://next/./dist/esm/server/future/route-matchers/route-matcher.js","webpack://next/./dist/esm/server/future/route-matchers/locale-route-matcher.js","webpack://next/./dist/esm/server/future/route-matcher-managers/default-route-matcher-manager.js","webpack://next/./dist/esm/server/future/normalizers/normalizers.js","webpack://next/./dist/esm/server/future/normalizers/prefixing-normalizer.js","webpack://next/./dist/esm/shared/lib/page-path/normalize-page-path.js","webpack://next/./dist/esm/server/future/normalizers/built/app/app-bundle-path-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/app/app-filename-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/wrap-normalizer-fn.js","webpack://next/./dist/esm/server/future/normalizers/underscore-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/app/app-pathname-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/app/index.js","webpack://next/./dist/esm/server/future/route-matchers/app-page-route-matcher.js","webpack://next/./dist/esm/server/future/route-matcher-providers/helpers/cached-route-matcher-provider.js","webpack://next/./dist/esm/server/future/route-matcher-providers/manifest-route-matcher-provider.js","webpack://next/./dist/esm/server/future/route-matcher-providers/app-page-route-matcher-provider.js","webpack://next/./dist/esm/lib/is-app-page-route.js","webpack://next/./dist/esm/server/future/route-matchers/app-route-route-matcher.js","webpack://next/./dist/esm/server/future/route-matcher-providers/app-route-route-matcher-provider.js","webpack://next/./dist/esm/lib/is-app-route-route.js","webpack://next/./dist/esm/lib/is-api-route.js","webpack://next/./dist/esm/server/future/route-matchers/pages-api-route-matcher.js","webpack://next/./dist/esm/server/future/normalizers/built/pages/pages-bundle-path-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/pages/pages-filename-normalizer.js","webpack://next/./dist/esm/server/future/normalizers/built/pages/index.js","webpack://next/./dist/esm/server/future/route-matcher-providers/pages-api-route-matcher-provider.js","webpack://next/./dist/esm/server/future/route-matchers/pages-route-matcher.js","webpack://next/./dist/esm/server/future/route-matcher-providers/pages-route-matcher-provider.js","webpack://next/./dist/esm/server/future/route-matcher-providers/helpers/manifest-loaders/server-manifest-loader.js","webpack://next/./dist/esm/server/future/helpers/i18n-provider.js","webpack://next/./dist/esm/server/send-response.js","webpack://next/external commonjs \"next/dist/client/components/static-generation-async-storage.external.js\"","webpack://next/./dist/esm/server/web/spec-extension/adapters/request-cookies.js","webpack://next/./dist/esm/server/lib/match-next-data-pathname.js","webpack://next/./dist/esm/server/future/normalizers/request/suffix.js","webpack://next/./dist/esm/server/future/normalizers/request/rsc.js","webpack://next/./dist/esm/server/future/normalizers/request/prefix.js","webpack://next/./dist/esm/server/future/normalizers/request/postponed.js","webpack://next/./dist/esm/server/future/normalizers/request/action.js","webpack://next/./dist/esm/server/app-render/strip-flight-headers.js","webpack://next/./dist/esm/server/future/normalizers/request/prefetch-rsc.js","webpack://next/./dist/esm/server/future/normalizers/request/next-data.js","webpack://next/./dist/esm/server/lib/to-route.js","webpack://next/./dist/esm/server/base-server.js","webpack://next/./dist/esm/shared/lib/router/utils/get-route-from-asset-path.js","webpack://next/./dist/esm/server/lib/format-hostname.js","webpack://next/./dist/esm/server/server-utils.js","webpack://next/./dist/esm/server/utils.js","webpack://next/./dist/esm/lib/is-edge-runtime.js","webpack://next/./dist/esm/server/lib/server-action-request-meta.js","webpack://next/./dist/esm/shared/lib/router/utils/escape-path-delimiters.js","webpack://next/./dist/esm/server/future/route-modules/checks.js","webpack://next/./dist/esm/server/future/route-modules/helpers/response-handlers.js","webpack://next/./dist/esm/lib/redirect-status.js","webpack://next/external node-commonjs \"vm\"","webpack://next/./dist/esm/shared/lib/deep-freeze.js","webpack://next/./dist/esm/server/load-manifest.js","webpack://next/./dist/esm/server/require.js","webpack://next/./dist/esm/lib/interop-default.js","webpack://next/./dist/esm/lib/wait.js","webpack://next/./dist/esm/server/app-render/encryption-utils.js","webpack://next/./dist/esm/server/load-components.js","webpack://next/./dist/esm/server/app-render/action-utils.js","webpack://next/external node-commonjs \"stream\"","webpack://next/./dist/esm/lib/batcher.js","webpack://next/./dist/esm/lib/scheduler.js","webpack://next/./dist/esm/server/response-cache/utils.js","webpack://next/./dist/esm/server/response-cache/index.js","webpack://next/./dist/esm/server/lib/incremental-cache/shared-revalidate-timings.js","webpack://next/./dist/esm/server/lib/incremental-cache/index.js","webpack://next/external node-commonjs \"http\"","webpack://next/external node-commonjs \"https\"","webpack://next/./dist/esm/server/lib/node-fs-methods.js","webpack://next/./dist/esm/server/lib/mock-request.js","webpack://next/./dist/esm/server/future/helpers/module-loader/node-module-loader.js","webpack://next/./dist/esm/server/future/helpers/module-loader/route-module-loader.js","webpack://next/./dist/esm/lib/format-dynamic-import-path.js","webpack://next/./dist/esm/lib/generate-interception-routes-rewrites.js","webpack://next/./dist/esm/server/next-server.js","webpack://next/./dist/esm/server/future/route-matches/pages-api-route-match.js","webpack://next/./dist/esm/server/setup-http-agent-env.js","webpack://next/./dist/esm/shared/lib/router/utils/middleware-route-matcher.js","webpack://next/./dist/esm/server/body-streams.js"],"sourcesContent":["(()=>{var e={383:e=>{\"use strict\";function _searchLast(e,t){const n=Array.from(e.matchAll(t));return n.length>0?n.slice(-1)[0].index:-1}function _interpolate(e,t,n){const r=_searchLast(e,/(?!(?<=\\\\))\\$/g);if(r===-1)return e;const o=e.slice(r);const s=/((?!(?<=\\\\))\\${?([\\w]+)(?::-([^}\\\\]*))?}?)/;const i=o.match(s);if(i!=null){const[,r,o,s]=i;return _interpolate(e.replace(r,t[o]||s||n.parsed[o]||\"\"),t,n)}return e}function _resolveEscapeSequences(e){return e.replace(/\\\\\\$/g,\"$\")}function expand(e){const t=e.ignoreProcessEnv?{}:process.env;for(const n in e.parsed){const r=Object.prototype.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=_resolveEscapeSequences(_interpolate(r,t,e))}for(const n in e.parsed){t[n]=e.parsed[n]}return e}e.exports.j=expand},234:(e,t,n)=>{const r=n(147);const o=n(17);const s=n(37);const i=n(113);const c=n(803);const a=c.version;const l=/(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/gm;function parse(e){const t={};let n=e.toString();n=n.replace(/\\r\\n?/gm,\"\\n\");let r;while((r=l.exec(n))!=null){const e=r[1];let n=r[2]||\"\";n=n.trim();const o=n[0];n=n.replace(/^(['\"`])([\\s\\S]*)\\1$/gm,\"$2\");if(o==='\"'){n=n.replace(/\\\\n/g,\"\\n\");n=n.replace(/\\\\r/g,\"\\r\")}t[e]=n}return t}function _parseVault(e){const t=_vaultPath(e);const n=p.configDotenv({path:t});if(!n.parsed){throw new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`)}const r=_dotenvKey(e).split(\",\");const o=r.length;let s;for(let e=0;e<o;e++){try{const t=r[e].trim();const o=_instructions(n,t);s=p.decrypt(o.ciphertext,o.key);break}catch(t){if(e+1>=o){throw t}}}return p.parse(s)}function _log(e){console.log(`[dotenv@${a}][INFO] ${e}`)}function _warn(e){console.log(`[dotenv@${a}][WARN] ${e}`)}function _debug(e){console.log(`[dotenv@${a}][DEBUG] ${e}`)}function _dotenvKey(e){if(e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0){return e.DOTENV_KEY}if(process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0){return process.env.DOTENV_KEY}return\"\"}function _instructions(e,t){let n;try{n=new URL(t)}catch(e){if(e.code===\"ERR_INVALID_URL\"){throw new Error(\"INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development\")}throw e}const r=n.password;if(!r){throw new Error(\"INVALID_DOTENV_KEY: Missing key part\")}const o=n.searchParams.get(\"environment\");if(!o){throw new Error(\"INVALID_DOTENV_KEY: Missing environment part\")}const s=`DOTENV_VAULT_${o.toUpperCase()}`;const i=e.parsed[s];if(!i){throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`)}return{ciphertext:i,key:r}}function _vaultPath(e){let t=o.resolve(process.cwd(),\".env\");if(e&&e.path&&e.path.length>0){t=e.path}return t.endsWith(\".vault\")?t:`${t}.vault`}function _resolveHome(e){return e[0]===\"~\"?o.join(s.homedir(),e.slice(1)):e}function _configVault(e){_log(\"Loading env from encrypted .env.vault\");const t=p._parseVault(e);let n=process.env;if(e&&e.processEnv!=null){n=e.processEnv}p.populate(n,t,e);return{parsed:t}}function configDotenv(e){let t=o.resolve(process.cwd(),\".env\");let n=\"utf8\";const s=Boolean(e&&e.debug);if(e){if(e.path!=null){t=_resolveHome(e.path)}if(e.encoding!=null){n=e.encoding}}try{const o=p.parse(r.readFileSync(t,{encoding:n}));let s=process.env;if(e&&e.processEnv!=null){s=e.processEnv}p.populate(s,o,e);return{parsed:o}}catch(e){if(s){_debug(`Failed to load ${t} ${e.message}`)}return{error:e}}}function config(e){const t=_vaultPath(e);if(_dotenvKey(e).length===0){return p.configDotenv(e)}if(!r.existsSync(t)){_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`);return p.configDotenv(e)}return p._configVault(e)}function decrypt(e,t){const n=Buffer.from(t.slice(-64),\"hex\");let r=Buffer.from(e,\"base64\");const o=r.slice(0,12);const s=r.slice(-16);r=r.slice(12,-16);try{const e=i.createDecipheriv(\"aes-256-gcm\",n,o);e.setAuthTag(s);return`${e.update(r)}${e.final()}`}catch(e){const t=e instanceof RangeError;const n=e.message===\"Invalid key length\";const r=e.message===\"Unsupported state or unable to authenticate data\";if(t||n){const e=\"INVALID_DOTENV_KEY: It must be 64 characters long (or more)\";throw new Error(e)}else if(r){const e=\"DECRYPTION_FAILED: Please check your DOTENV_KEY\";throw new Error(e)}else{console.error(\"Error: \",e.code);console.error(\"Error: \",e.message);throw e}}}function populate(e,t,n={}){const r=Boolean(n&&n.debug);const o=Boolean(n&&n.override);if(typeof t!==\"object\"){throw new Error(\"OBJECT_REQUIRED: Please check the processEnv argument being passed to populate\")}for(const n of Object.keys(t)){if(Object.prototype.hasOwnProperty.call(e,n)){if(o===true){e[n]=t[n]}if(r){if(o===true){_debug(`\"${n}\" is already defined and WAS overwritten`)}else{_debug(`\"${n}\" is already defined and was NOT overwritten`)}}}else{e[n]=t[n]}}}const p={configDotenv:configDotenv,_configVault:_configVault,_parseVault:_parseVault,config:config,decrypt:decrypt,parse:parse,populate:populate};e.exports.configDotenv=p.configDotenv;e.exports._configVault=p._configVault;e.exports._parseVault=p._parseVault;e.exports.config=p.config;e.exports.decrypt=p.decrypt;e.exports.parse=p.parse;e.exports.populate=p.populate;e.exports=p},113:e=>{\"use strict\";e.exports=require(\"crypto\")},147:e=>{\"use strict\";e.exports=require(\"fs\")},37:e=>{\"use strict\";e.exports=require(\"os\")},17:e=>{\"use strict\";e.exports=require(\"path\")},803:e=>{\"use strict\";e.exports=JSON.parse('{\"name\":\"dotenv\",\"version\":\"16.3.1\",\"description\":\"Loads environment variables from .env file\",\"main\":\"lib/main.js\",\"types\":\"lib/main.d.ts\",\"exports\":{\".\":{\"types\":\"./lib/main.d.ts\",\"require\":\"./lib/main.js\",\"default\":\"./lib/main.js\"},\"./config\":\"./config.js\",\"./config.js\":\"./config.js\",\"./lib/env-options\":\"./lib/env-options.js\",\"./lib/env-options.js\":\"./lib/env-options.js\",\"./lib/cli-options\":\"./lib/cli-options.js\",\"./lib/cli-options.js\":\"./lib/cli-options.js\",\"./package.json\":\"./package.json\"},\"scripts\":{\"dts-check\":\"tsc --project tests/types/tsconfig.json\",\"lint\":\"standard\",\"lint-readme\":\"standard-markdown\",\"pretest\":\"npm run lint && npm run dts-check\",\"test\":\"tap tests/*.js --100 -Rspec\",\"prerelease\":\"npm test\",\"release\":\"standard-version\"},\"repository\":{\"type\":\"git\",\"url\":\"git://github.com/motdotla/dotenv.git\"},\"funding\":\"https://github.com/motdotla/dotenv?sponsor=1\",\"keywords\":[\"dotenv\",\"env\",\".env\",\"environment\",\"variables\",\"config\",\"settings\"],\"readmeFilename\":\"README.md\",\"license\":\"BSD-2-Clause\",\"devDependencies\":{\"@definitelytyped/dtslint\":\"^0.0.133\",\"@types/node\":\"^18.11.3\",\"decache\":\"^4.6.1\",\"sinon\":\"^14.0.1\",\"standard\":\"^17.0.0\",\"standard-markdown\":\"^7.1.0\",\"standard-version\":\"^9.5.0\",\"tap\":\"^16.3.0\",\"tar\":\"^6.1.11\",\"typescript\":\"^4.8.4\"},\"engines\":{\"node\":\">=12\"},\"browser\":{\"fs\":false}}')}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var o=t[n]={exports:{}};var s=true;try{e[n](o,o.exports,__nccwpck_require__);s=false}finally{if(s)delete t[n]}return o.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e[\"default\"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var n in t){if(__nccwpck_require__.o(t,n)&&!__nccwpck_require__.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:t[n]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!==\"undefined\"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"})}Object.defineProperty(e,\"__esModule\",{value:true})}})();if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var n={};(()=>{\"use strict\";__nccwpck_require__.r(n);__nccwpck_require__.d(n,{initialEnv:()=>a,updateInitialEnv:()=>updateInitialEnv,processEnv:()=>processEnv,resetEnv:()=>resetEnv,loadEnvConfig:()=>loadEnvConfig});var e=__nccwpck_require__(147);var t=__nccwpck_require__.n(e);var r=__nccwpck_require__(17);var o=__nccwpck_require__.n(r);var s=__nccwpck_require__(234);var i=__nccwpck_require__.n(s);var c=__nccwpck_require__(383);let a=undefined;let l=undefined;let p=[];let u=[];function updateInitialEnv(e){Object.assign(a||{},e)}function replaceProcessEnv(e){Object.keys(process.env).forEach((t=>{if(!t.startsWith(\"__NEXT_PRIVATE\")){if(e[t]===undefined||e[t]===\"\"){delete process.env[t]}}}));Object.entries(e).forEach((([e,t])=>{process.env[e]=t}))}function processEnv(e,t,n=console,o=false,i){var l;if(!a){a=Object.assign({},process.env)}if(!o&&(process.env.__NEXT_PROCESSED_ENV||e.length===0)){return process.env}process.env.__NEXT_PROCESSED_ENV=\"true\";const p=Object.assign({},a);const _={};for(const o of e){try{let e={};e.parsed=s.parse(o.contents);e=(0,c.j)(e);if(e.parsed&&!u.some((e=>e.contents===o.contents&&e.path===o.path))){i===null||i===void 0?void 0:i(o.path)}for(const t of Object.keys(e.parsed||{})){if(typeof _[t]===\"undefined\"&&typeof p[t]===\"undefined\"){_[t]=(l=e.parsed)===null||l===void 0?void 0:l[t]}}}catch(e){n.error(`Failed to load env from ${r.join(t||\"\",o.path)}`,e)}}return Object.assign(process.env,_)}function resetEnv(){if(a){replaceProcessEnv(a)}}function loadEnvConfig(t,n,o=console,s=false,i){if(!a){a=Object.assign({},process.env)}if(l&&!s){return{combinedEnv:l,loadedEnvFiles:p}}replaceProcessEnv(a);u=p;p=[];const c=process.env.NODE_ENV===\"test\";const _=c?\"test\":n?\"development\":\"production\";const d=[`.env.${_}.local`,_!==\"test\"&&`.env.local`,`.env.${_}`,\".env\"].filter(Boolean);for(const n of d){const s=r.join(t,n);try{const t=e.statSync(s);if(!t.isFile()){continue}const r=e.readFileSync(s,\"utf8\");p.push({path:n,contents:r})}catch(e){if(e.code!==\"ENOENT\"){o.error(`Failed to load env from ${n}`,e)}}}l=processEnv(p,t,o,s,i);return{combinedEnv:l,loadedEnvFiles:p}}})();module.exports=n})();","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n RequestCookies: () => RequestCookies,\n ResponseCookies: () => ResponseCookies,\n parseCookie: () => parseCookie,\n parseSetCookie: () => parseSetCookie,\n stringifyCookie: () => stringifyCookie\n});\nmodule.exports = __toCommonJS(src_exports);\n\n// src/serialize.ts\nfunction stringifyCookie(c) {\n var _a;\n const attrs = [\n \"path\" in c && c.path && `Path=${c.path}`,\n \"expires\" in c && (c.expires || c.expires === 0) && `Expires=${(typeof c.expires === \"number\" ? new Date(c.expires) : c.expires).toUTCString()}`,\n \"maxAge\" in c && typeof c.maxAge === \"number\" && `Max-Age=${c.maxAge}`,\n \"domain\" in c && c.domain && `Domain=${c.domain}`,\n \"secure\" in c && c.secure && \"Secure\",\n \"httpOnly\" in c && c.httpOnly && \"HttpOnly\",\n \"sameSite\" in c && c.sameSite && `SameSite=${c.sameSite}`,\n \"partitioned\" in c && c.partitioned && \"Partitioned\",\n \"priority\" in c && c.priority && `Priority=${c.priority}`\n ].filter(Boolean);\n const stringified = `${c.name}=${encodeURIComponent((_a = c.value) != null ? _a : \"\")}`;\n return attrs.length === 0 ? stringified : `${stringified}; ${attrs.join(\"; \")}`;\n}\nfunction parseCookie(cookie) {\n const map = /* @__PURE__ */ new Map();\n for (const pair of cookie.split(/; */)) {\n if (!pair)\n continue;\n const splitAt = pair.indexOf(\"=\");\n if (splitAt === -1) {\n map.set(pair, \"true\");\n continue;\n }\n const [key, value] = [pair.slice(0, splitAt), pair.slice(splitAt + 1)];\n try {\n map.set(key, decodeURIComponent(value != null ? value : \"true\"));\n } catch {\n }\n }\n return map;\n}\nfunction parseSetCookie(setCookie) {\n if (!setCookie) {\n return void 0;\n }\n const [[name, value], ...attributes] = parseCookie(setCookie);\n const {\n domain,\n expires,\n httponly,\n maxage,\n path,\n samesite,\n secure,\n partitioned,\n priority\n } = Object.fromEntries(\n attributes.map(([key, value2]) => [key.toLowerCase(), value2])\n );\n const cookie = {\n name,\n value: decodeURIComponent(value),\n domain,\n ...expires && { expires: new Date(expires) },\n ...httponly && { httpOnly: true },\n ...typeof maxage === \"string\" && { maxAge: Number(maxage) },\n path,\n ...samesite && { sameSite: parseSameSite(samesite) },\n ...secure && { secure: true },\n ...priority && { priority: parsePriority(priority) },\n ...partitioned && { partitioned: true }\n };\n return compact(cookie);\n}\nfunction compact(t) {\n const newT = {};\n for (const key in t) {\n if (t[key]) {\n newT[key] = t[key];\n }\n }\n return newT;\n}\nvar SAME_SITE = [\"strict\", \"lax\", \"none\"];\nfunction parseSameSite(string) {\n string = string.toLowerCase();\n return SAME_SITE.includes(string) ? string : void 0;\n}\nvar PRIORITY = [\"low\", \"medium\", \"high\"];\nfunction parsePriority(string) {\n string = string.toLowerCase();\n return PRIORITY.includes(string) ? string : void 0;\n}\nfunction splitCookiesString(cookiesString) {\n if (!cookiesString)\n return [];\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n function skipWhitespace() {\n while (pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))) {\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n while (pos < cookiesString.length) {\n start = pos;\n cookiesSeparatorFound = false;\n while (skipWhitespace()) {\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n lastComma = pos;\n pos += 1;\n skipWhitespace();\n nextStart = pos;\n while (pos < cookiesString.length && notSpecialChar()) {\n pos += 1;\n }\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n cookiesSeparatorFound = true;\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n return cookiesStrings;\n}\n\n// src/request-cookies.ts\nvar RequestCookies = class {\n constructor(requestHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n this._headers = requestHeaders;\n const header = requestHeaders.get(\"cookie\");\n if (header) {\n const parsed = parseCookie(header);\n for (const [name, value] of parsed) {\n this._parsed.set(name, { name, value });\n }\n }\n }\n [Symbol.iterator]() {\n return this._parsed[Symbol.iterator]();\n }\n /**\n * The amount of cookies received from the client\n */\n get size() {\n return this._parsed.size;\n }\n get(...args) {\n const name = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(name);\n }\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed);\n if (!args.length) {\n return all.map(([_, value]) => value);\n }\n const name = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter(([n]) => n === name).map(([_, value]) => value);\n }\n has(name) {\n return this._parsed.has(name);\n }\n set(...args) {\n const [name, value] = args.length === 1 ? [args[0].name, args[0].value] : args;\n const map = this._parsed;\n map.set(name, { name, value });\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value2]) => stringifyCookie(value2)).join(\"; \")\n );\n return this;\n }\n /**\n * Delete the cookies matching the passed name or names in the request.\n */\n delete(names) {\n const map = this._parsed;\n const result = !Array.isArray(names) ? map.delete(names) : names.map((name) => map.delete(name));\n this._headers.set(\n \"cookie\",\n Array.from(map).map(([_, value]) => stringifyCookie(value)).join(\"; \")\n );\n return result;\n }\n /**\n * Delete all the cookies in the cookies in the request.\n */\n clear() {\n this.delete(Array.from(this._parsed.keys()));\n return this;\n }\n /**\n * Format the cookies in the request as a string for logging\n */\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map((v) => `${v.name}=${encodeURIComponent(v.value)}`).join(\"; \");\n }\n};\n\n// src/response-cookies.ts\nvar ResponseCookies = class {\n constructor(responseHeaders) {\n /** @internal */\n this._parsed = /* @__PURE__ */ new Map();\n var _a, _b, _c;\n this._headers = responseHeaders;\n const setCookie = (_c = (_b = (_a = responseHeaders.getSetCookie) == null ? void 0 : _a.call(responseHeaders)) != null ? _b : responseHeaders.get(\"set-cookie\")) != null ? _c : [];\n const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie);\n for (const cookieString of cookieStrings) {\n const parsed = parseSetCookie(cookieString);\n if (parsed)\n this._parsed.set(parsed.name, parsed);\n }\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.\n */\n get(...args) {\n const key = typeof args[0] === \"string\" ? args[0] : args[0].name;\n return this._parsed.get(key);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.\n */\n getAll(...args) {\n var _a;\n const all = Array.from(this._parsed.values());\n if (!args.length) {\n return all;\n }\n const key = typeof args[0] === \"string\" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;\n return all.filter((c) => c.name === key);\n }\n has(name) {\n return this._parsed.has(name);\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.\n */\n set(...args) {\n const [name, value, cookie] = args.length === 1 ? [args[0].name, args[0].value, args[0]] : args;\n const map = this._parsed;\n map.set(name, normalizeCookie({ name, value, ...cookie }));\n replace(map, this._headers);\n return this;\n }\n /**\n * {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.\n */\n delete(...args) {\n const [name, path, domain] = typeof args[0] === \"string\" ? [args[0]] : [args[0].name, args[0].path, args[0].domain];\n return this.set({ name, path, domain, value: \"\", expires: /* @__PURE__ */ new Date(0) });\n }\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;\n }\n toString() {\n return [...this._parsed.values()].map(stringifyCookie).join(\"; \");\n }\n};\nfunction replace(bag, headers) {\n headers.delete(\"set-cookie\");\n for (const [, value] of bag) {\n const serialized = stringifyCookie(value);\n headers.append(\"set-cookie\", serialized);\n }\n}\nfunction normalizeCookie(cookie = { name: \"\", value: \"\" }) {\n if (typeof cookie.expires === \"number\") {\n cookie.expires = new Date(cookie.expires);\n }\n if (cookie.maxAge) {\n cookie.expires = new Date(Date.now() + cookie.maxAge * 1e3);\n }\n if (cookie.path === null || cookie.path === void 0) {\n cookie.path = \"/\";\n }\n return cookie;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n RequestCookies,\n ResponseCookies,\n parseCookie,\n parseSetCookie,\n stringifyCookie\n});\n","(()=>{\"use strict\";if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var e={};(()=>{var r=e;\n/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */r.parse=parse;r.serialize=serialize;var i=decodeURIComponent;var t=encodeURIComponent;var a=/; */;var n=/^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;function parse(e,r){if(typeof e!==\"string\"){throw new TypeError(\"argument str must be a string\")}var t={};var n=r||{};var o=e.split(a);var s=n.decode||i;for(var p=0;p<o.length;p++){var f=o[p];var u=f.indexOf(\"=\");if(u<0){continue}var v=f.substr(0,u).trim();var c=f.substr(++u,f.length).trim();if('\"'==c[0]){c=c.slice(1,-1)}if(undefined==t[v]){t[v]=tryDecode(c,s)}}return t}function serialize(e,r,i){var a=i||{};var o=a.encode||t;if(typeof o!==\"function\"){throw new TypeError(\"option encode is invalid\")}if(!n.test(e)){throw new TypeError(\"argument name is invalid\")}var s=o(r);if(s&&!n.test(s)){throw new TypeError(\"argument val is invalid\")}var p=e+\"=\"+s;if(null!=a.maxAge){var f=a.maxAge-0;if(isNaN(f)||!isFinite(f)){throw new TypeError(\"option maxAge is invalid\")}p+=\"; Max-Age=\"+Math.floor(f)}if(a.domain){if(!n.test(a.domain)){throw new TypeError(\"option domain is invalid\")}p+=\"; Domain=\"+a.domain}if(a.path){if(!n.test(a.path)){throw new TypeError(\"option path is invalid\")}p+=\"; Path=\"+a.path}if(a.expires){if(typeof a.expires.toUTCString!==\"function\"){throw new TypeError(\"option expires is invalid\")}p+=\"; Expires=\"+a.expires.toUTCString()}if(a.httpOnly){p+=\"; HttpOnly\"}if(a.secure){p+=\"; Secure\"}if(a.sameSite){var u=typeof a.sameSite===\"string\"?a.sameSite.toLowerCase():a.sameSite;switch(u){case true:p+=\"; SameSite=Strict\";break;case\"lax\":p+=\"; SameSite=Lax\";break;case\"strict\":p+=\"; SameSite=Strict\";break;case\"none\":p+=\"; SameSite=None\";break;default:throw new TypeError(\"option sameSite is invalid\")}}return p}function tryDecode(e,r){try{return r(e)}catch(r){return e}}})();module.exports=e})();","(()=>{\"use strict\";var e={695:e=>{\n/*!\n * fresh\n * Copyright(c) 2012 TJ Holowaychuk\n * Copyright(c) 2016-2017 Douglas Christopher Wilson\n * MIT Licensed\n */\nvar r=/(?:^|,)\\s*?no-cache\\s*?(?:,|$)/;e.exports=fresh;function fresh(e,a){var t=e[\"if-modified-since\"];var s=e[\"if-none-match\"];if(!t&&!s){return false}var i=e[\"cache-control\"];if(i&&r.test(i)){return false}if(s&&s!==\"*\"){var f=a[\"etag\"];if(!f){return false}var n=true;var u=parseTokenList(s);for(var _=0;_<u.length;_++){var o=u[_];if(o===f||o===\"W/\"+f||\"W/\"+o===f){n=false;break}}if(n){return false}}if(t){var p=a[\"last-modified\"];var v=!p||!(parseHttpDate(p)<=parseHttpDate(t));if(v){return false}}return true}function parseHttpDate(e){var r=e&&Date.parse(e);return typeof r===\"number\"?r:NaN}function parseTokenList(e){var r=0;var a=[];var t=0;for(var s=0,i=e.length;s<i;s++){switch(e.charCodeAt(s)){case 32:if(t===r){t=r=s+1}break;case 44:a.push(e.substring(t,r));t=r=s+1;break;default:r=s+1;break}}a.push(e.substring(t,r));return a}}};var r={};function __nccwpck_require__(a){var t=r[a];if(t!==undefined){return t.exports}var s=r[a]={exports:{}};var i=true;try{e[a](s,s.exports,__nccwpck_require__);i=false}finally{if(i)delete r[a]}return s.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var a=__nccwpck_require__(695);module.exports=a})();","(()=>{\"use strict\";var t={806:(t,e,i)=>{const s=i(190);const n=Symbol(\"max\");const l=Symbol(\"length\");const r=Symbol(\"lengthCalculator\");const h=Symbol(\"allowStale\");const a=Symbol(\"maxAge\");const o=Symbol(\"dispose\");const u=Symbol(\"noDisposeOnSet\");const f=Symbol(\"lruList\");const p=Symbol(\"cache\");const v=Symbol(\"updateAgeOnGet\");const naiveLength=()=>1;class LRUCache{constructor(t){if(typeof t===\"number\")t={max:t};if(!t)t={};if(t.max&&(typeof t.max!==\"number\"||t.max<0))throw new TypeError(\"max must be a non-negative number\");const e=this[n]=t.max||Infinity;const i=t.length||naiveLength;this[r]=typeof i!==\"function\"?naiveLength:i;this[h]=t.stale||false;if(t.maxAge&&typeof t.maxAge!==\"number\")throw new TypeError(\"maxAge must be a number\");this[a]=t.maxAge||0;this[o]=t.dispose;this[u]=t.noDisposeOnSet||false;this[v]=t.updateAgeOnGet||false;this.reset()}set max(t){if(typeof t!==\"number\"||t<0)throw new TypeError(\"max must be a non-negative number\");this[n]=t||Infinity;trim(this)}get max(){return this[n]}set allowStale(t){this[h]=!!t}get allowStale(){return this[h]}set maxAge(t){if(typeof t!==\"number\")throw new TypeError(\"maxAge must be a non-negative number\");this[a]=t;trim(this)}get maxAge(){return this[a]}set lengthCalculator(t){if(typeof t!==\"function\")t=naiveLength;if(t!==this[r]){this[r]=t;this[l]=0;this[f].forEach((t=>{t.length=this[r](t.value,t.key);this[l]+=t.length}))}trim(this)}get lengthCalculator(){return this[r]}get length(){return this[l]}get itemCount(){return this[f].length}rforEach(t,e){e=e||this;for(let i=this[f].tail;i!==null;){const s=i.prev;forEachStep(this,t,i,e);i=s}}forEach(t,e){e=e||this;for(let i=this[f].head;i!==null;){const s=i.next;forEachStep(this,t,i,e);i=s}}keys(){return this[f].toArray().map((t=>t.key))}values(){return this[f].toArray().map((t=>t.value))}reset(){if(this[o]&&this[f]&&this[f].length){this[f].forEach((t=>this[o](t.key,t.value)))}this[p]=new Map;this[f]=new s;this[l]=0}dump(){return this[f].map((t=>isStale(this,t)?false:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[f]}set(t,e,i){i=i||this[a];if(i&&typeof i!==\"number\")throw new TypeError(\"maxAge must be a number\");const s=i?Date.now():0;const h=this[r](e,t);if(this[p].has(t)){if(h>this[n]){del(this,this[p].get(t));return false}const r=this[p].get(t);const a=r.value;if(this[o]){if(!this[u])this[o](t,a.value)}a.now=s;a.maxAge=i;a.value=e;this[l]+=h-a.length;a.length=h;this.get(t);trim(this);return true}const v=new Entry(t,e,h,s,i);if(v.length>this[n]){if(this[o])this[o](t,e);return false}this[l]+=v.length;this[f].unshift(v);this[p].set(t,this[f].head);trim(this);return true}has(t){if(!this[p].has(t))return false;const e=this[p].get(t).value;return!isStale(this,e)}get(t){return get(this,t,true)}peek(t){return get(this,t,false)}pop(){const t=this[f].tail;if(!t)return null;del(this,t);return t.value}del(t){del(this,this[p].get(t))}load(t){this.reset();const e=Date.now();for(let i=t.length-1;i>=0;i--){const s=t[i];const n=s.e||0;if(n===0)this.set(s.k,s.v);else{const t=n-e;if(t>0){this.set(s.k,s.v,t)}}}}prune(){this[p].forEach(((t,e)=>get(this,e,false)))}}const get=(t,e,i)=>{const s=t[p].get(e);if(s){const e=s.value;if(isStale(t,e)){del(t,s);if(!t[h])return undefined}else{if(i){if(t[v])s.value.now=Date.now();t[f].unshiftNode(s)}}return e.value}};const isStale=(t,e)=>{if(!e||!e.maxAge&&!t[a])return false;const i=Date.now()-e.now;return e.maxAge?i>e.maxAge:t[a]&&i>t[a]};const trim=t=>{if(t[l]>t[n]){for(let e=t[f].tail;t[l]>t[n]&&e!==null;){const i=e.prev;del(t,e);e=i}}};const del=(t,e)=>{if(e){const i=e.value;if(t[o])t[o](i.key,i.value);t[l]-=i.length;t[p].delete(i.key);t[f].removeNode(e)}};class Entry{constructor(t,e,i,s,n){this.key=t;this.value=e;this.length=i;this.now=s;this.maxAge=n||0}}const forEachStep=(t,e,i,s)=>{let n=i.value;if(isStale(t,n)){del(t,i);if(!t[h])n=undefined}if(n)e.call(s,n.value,n.key,t)};t.exports=LRUCache},76:t=>{t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next){yield t.value}}}},190:(t,e,i)=>{t.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(t){var e=this;if(!(e instanceof Yallist)){e=new Yallist}e.tail=null;e.head=null;e.length=0;if(t&&typeof t.forEach===\"function\"){t.forEach((function(t){e.push(t)}))}else if(arguments.length>0){for(var i=0,s=arguments.length;i<s;i++){e.push(arguments[i])}}return e}Yallist.prototype.removeNode=function(t){if(t.list!==this){throw new Error(\"removing node which does not belong to this list\")}var e=t.next;var i=t.prev;if(e){e.prev=i}if(i){i.next=e}if(t===this.head){this.head=e}if(t===this.tail){this.tail=i}t.list.length--;t.next=null;t.prev=null;t.list=null;return e};Yallist.prototype.unshiftNode=function(t){if(t===this.head){return}if(t.list){t.list.removeNode(t)}var e=this.head;t.list=this;t.next=e;if(e){e.prev=t}this.head=t;if(!this.tail){this.tail=t}this.length++};Yallist.prototype.pushNode=function(t){if(t===this.tail){return}if(t.list){t.list.removeNode(t)}var e=this.tail;t.list=this;t.prev=e;if(e){e.next=t}this.tail=t;if(!this.head){this.head=t}this.length++};Yallist.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++){push(this,arguments[t])}return this.length};Yallist.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++){unshift(this,arguments[t])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var t=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return t};Yallist.prototype.shift=function(){if(!this.head){return undefined}var t=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return t};Yallist.prototype.forEach=function(t,e){e=e||this;for(var i=this.head,s=0;i!==null;s++){t.call(e,i.value,s,this);i=i.next}};Yallist.prototype.forEachReverse=function(t,e){e=e||this;for(var i=this.tail,s=this.length-1;i!==null;s--){t.call(e,i.value,s,this);i=i.prev}};Yallist.prototype.get=function(t){for(var e=0,i=this.head;i!==null&&e<t;e++){i=i.next}if(e===t&&i!==null){return i.value}};Yallist.prototype.getReverse=function(t){for(var e=0,i=this.tail;i!==null&&e<t;e++){i=i.prev}if(e===t&&i!==null){return i.value}};Yallist.prototype.map=function(t,e){e=e||this;var i=new Yallist;for(var s=this.head;s!==null;){i.push(t.call(e,s.value,this));s=s.next}return i};Yallist.prototype.mapReverse=function(t,e){e=e||this;var i=new Yallist;for(var s=this.tail;s!==null;){i.push(t.call(e,s.value,this));s=s.prev}return i};Yallist.prototype.reduce=function(t,e){var i;var s=this.head;if(arguments.length>1){i=e}else if(this.head){s=this.head.next;i=this.head.value}else{throw new TypeError(\"Reduce of empty list with no initial value\")}for(var n=0;s!==null;n++){i=t(i,s.value,n);s=s.next}return i};Yallist.prototype.reduceReverse=function(t,e){var i;var s=this.tail;if(arguments.length>1){i=e}else if(this.tail){s=this.tail.prev;i=this.tail.value}else{throw new TypeError(\"Reduce of empty list with no initial value\")}for(var n=this.length-1;s!==null;n--){i=t(i,s.value,n);s=s.prev}return i};Yallist.prototype.toArray=function(){var t=new Array(this.length);for(var e=0,i=this.head;i!==null;e++){t[e]=i.value;i=i.next}return t};Yallist.prototype.toArrayReverse=function(){var t=new Array(this.length);for(var e=0,i=this.tail;i!==null;e++){t[e]=i.value;i=i.prev}return t};Yallist.prototype.slice=function(t,e){e=e||this.length;if(e<0){e+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(e<t||e<0){return i}if(t<0){t=0}if(e>this.length){e=this.length}for(var s=0,n=this.head;n!==null&&s<t;s++){n=n.next}for(;n!==null&&s<e;s++,n=n.next){i.push(n.value)}return i};Yallist.prototype.sliceReverse=function(t,e){e=e||this.length;if(e<0){e+=this.length}t=t||0;if(t<0){t+=this.length}var i=new Yallist;if(e<t||e<0){return i}if(t<0){t=0}if(e>this.length){e=this.length}for(var s=this.length,n=this.tail;n!==null&&s>e;s--){n=n.prev}for(;n!==null&&s>t;s--,n=n.prev){i.push(n.value)}return i};Yallist.prototype.splice=function(t,e){if(t>this.length){t=this.length-1}if(t<0){t=this.length+t}for(var i=0,s=this.head;s!==null&&i<t;i++){s=s.next}var n=[];for(var i=0;s&&i<e;i++){n.push(s.value);s=this.removeNode(s)}if(s===null){s=this.tail}if(s!==this.head&&s!==this.tail){s=s.prev}for(var i=2;i<arguments.length;i++){s=insert(this,s,arguments[i])}return n};Yallist.prototype.reverse=function(){var t=this.head;var e=this.tail;for(var i=t;i!==null;i=i.prev){var s=i.prev;i.prev=i.next;i.next=s}this.head=e;this.tail=t;return this};function insert(t,e,i){var s=e===t.head?new Node(i,null,e,t):new Node(i,e,e.next,t);if(s.next===null){t.tail=s}if(s.prev===null){t.head=s}t.length++;return s}function push(t,e){t.tail=new Node(e,t.tail,null,t);if(!t.head){t.head=t.tail}t.length++}function unshift(t,e){t.head=new Node(e,null,t.head,t);if(!t.tail){t.tail=t.head}t.length++}function Node(t,e,i,s){if(!(this instanceof Node)){return new Node(t,e,i,s)}this.list=s;this.value=t;if(e){e.next=this;this.prev=e}else{this.prev=null}if(i){i.prev=this;this.next=i}else{this.next=null}}try{i(76)(Yallist)}catch(t){}}};var e={};function __nccwpck_require__(i){var s=e[i];if(s!==undefined){return s.exports}var n=e[i]={exports:{}};var l=true;try{t[i](n,n.exports,__nccwpck_require__);l=false}finally{if(l)delete e[i]}return n.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var i=__nccwpck_require__(806);module.exports=i})();","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Tokenize input string.\n */\nfunction lexer(str) {\n var tokens = [];\n var i = 0;\n while (i < str.length) {\n var char = str[i];\n if (char === \"*\" || char === \"+\" || char === \"?\") {\n tokens.push({ type: \"MODIFIER\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"\\\\\") {\n tokens.push({ type: \"ESCAPED_CHAR\", index: i++, value: str[i++] });\n continue;\n }\n if (char === \"{\") {\n tokens.push({ type: \"OPEN\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"}\") {\n tokens.push({ type: \"CLOSE\", index: i, value: str[i++] });\n continue;\n }\n if (char === \":\") {\n var name = \"\";\n var j = i + 1;\n while (j < str.length) {\n var code = str.charCodeAt(j);\n if (\n // `0-9`\n (code >= 48 && code <= 57) ||\n // `A-Z`\n (code >= 65 && code <= 90) ||\n // `a-z`\n (code >= 97 && code <= 122) ||\n // `_`\n code === 95) {\n name += str[j++];\n continue;\n }\n break;\n }\n if (!name)\n throw new TypeError(\"Missing parameter name at \" + i);\n tokens.push({ type: \"NAME\", index: i, value: name });\n i = j;\n continue;\n }\n if (char === \"(\") {\n var count = 1;\n var pattern = \"\";\n var j = i + 1;\n if (str[j] === \"?\") {\n throw new TypeError(\"Pattern cannot start with \\\"?\\\" at \" + j);\n }\n while (j < str.length) {\n if (str[j] === \"\\\\\") {\n pattern += str[j++] + str[j++];\n continue;\n }\n if (str[j] === \")\") {\n count--;\n if (count === 0) {\n j++;\n break;\n }\n }\n else if (str[j] === \"(\") {\n count++;\n if (str[j + 1] !== \"?\") {\n throw new TypeError(\"Capturing groups are not allowed at \" + j);\n }\n }\n pattern += str[j++];\n }\n if (count)\n throw new TypeError(\"Unbalanced pattern at \" + i);\n if (!pattern)\n throw new TypeError(\"Missing pattern at \" + i);\n tokens.push({ type: \"PATTERN\", index: i, value: pattern });\n i = j;\n continue;\n }\n tokens.push({ type: \"CHAR\", index: i, value: str[i++] });\n }\n tokens.push({ type: \"END\", index: i, value: \"\" });\n return tokens;\n}\n/**\n * Parse a string for the raw tokens.\n */\nfunction parse(str, options) {\n if (options === void 0) { options = {}; }\n var tokens = lexer(str);\n var _a = options.prefixes, prefixes = _a === void 0 ? \"./\" : _a;\n var defaultPattern = \"[^\" + escapeString(options.delimiter || \"/#?\") + \"]+?\";\n var result = [];\n var key = 0;\n var i = 0;\n var path = \"\";\n var tryConsume = function (type) {\n if (i < tokens.length && tokens[i].type === type)\n return tokens[i++].value;\n };\n var mustConsume = function (type) {\n var value = tryConsume(type);\n if (value !== undefined)\n return value;\n var _a = tokens[i], nextType = _a.type, index = _a.index;\n throw new TypeError(\"Unexpected \" + nextType + \" at \" + index + \", expected \" + type);\n };\n var consumeText = function () {\n var result = \"\";\n var value;\n // tslint:disable-next-line\n while ((value = tryConsume(\"CHAR\") || tryConsume(\"ESCAPED_CHAR\"))) {\n result += value;\n }\n return result;\n };\n while (i < tokens.length) {\n var char = tryConsume(\"CHAR\");\n var name = tryConsume(\"NAME\");\n var pattern = tryConsume(\"PATTERN\");\n if (name || pattern) {\n var prefix = char || \"\";\n if (prefixes.indexOf(prefix) === -1) {\n path += prefix;\n prefix = \"\";\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n result.push({\n name: name || key++,\n prefix: prefix,\n suffix: \"\",\n pattern: pattern || defaultPattern,\n modifier: tryConsume(\"MODIFIER\") || \"\"\n });\n continue;\n }\n var value = char || tryConsume(\"ESCAPED_CHAR\");\n if (value) {\n path += value;\n continue;\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n var open = tryConsume(\"OPEN\");\n if (open) {\n var prefix = consumeText();\n var name_1 = tryConsume(\"NAME\") || \"\";\n var pattern_1 = tryConsume(\"PATTERN\") || \"\";\n var suffix = consumeText();\n mustConsume(\"CLOSE\");\n result.push({\n name: name_1 || (pattern_1 ? key++ : \"\"),\n pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1,\n prefix: prefix,\n suffix: suffix,\n modifier: tryConsume(\"MODIFIER\") || \"\"\n });\n continue;\n }\n mustConsume(\"END\");\n }\n return result;\n}\nexports.parse = parse;\n/**\n * Compile a string to a template function for the path.\n */\nfunction compile(str, options) {\n return tokensToFunction(parse(str, options), options);\n}\nexports.compile = compile;\n/**\n * Expose a method for transforming tokens into the path function.\n */\nfunction tokensToFunction(tokens, options) {\n if (options === void 0) { options = {}; }\n var reFlags = flags(options);\n var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;\n // Compile all the tokens into regexps.\n var matches = tokens.map(function (token) {\n if (typeof token === \"object\") {\n return new RegExp(\"^(?:\" + token.pattern + \")$\", reFlags);\n }\n });\n return function (data) {\n var path = \"\";\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n var value = data ? data[token.name] : undefined;\n var optional = token.modifier === \"?\" || token.modifier === \"*\";\n var repeat = token.modifier === \"*\" || token.modifier === \"+\";\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to not repeat, but got an array\");\n }\n if (value.length === 0) {\n if (optional)\n continue;\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to not be empty\");\n }\n for (var j = 0; j < value.length; j++) {\n var segment = encode(value[j], token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected all \\\"\" + token.name + \"\\\" to match \\\"\" + token.pattern + \"\\\", but got \\\"\" + segment + \"\\\"\");\n }\n path += token.prefix + segment + token.suffix;\n }\n continue;\n }\n if (typeof value === \"string\" || typeof value === \"number\") {\n var segment = encode(String(value), token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to match \\\"\" + token.pattern + \"\\\", but got \\\"\" + segment + \"\\\"\");\n }\n path += token.prefix + segment + token.suffix;\n continue;\n }\n if (optional)\n continue;\n var typeOfMessage = repeat ? \"an array\" : \"a string\";\n throw new TypeError(\"Expected \\\"\" + token.name + \"\\\" to be \" + typeOfMessage);\n }\n return path;\n };\n}\nexports.tokensToFunction = tokensToFunction;\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nfunction match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}\nexports.match = match;\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nfunction regexpToFunction(re, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a;\n return function (pathname) {\n var m = re.exec(pathname);\n if (!m)\n return false;\n var path = m[0], index = m.index;\n var params = Object.create(null);\n var _loop_1 = function (i) {\n // tslint:disable-next-line\n if (m[i] === undefined)\n return \"continue\";\n var key = keys[i - 1];\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) {\n return decode(value, key);\n });\n }\n else {\n params[key.name] = decode(m[i], key);\n }\n };\n for (var i = 1; i < m.length; i++) {\n _loop_1(i);\n }\n return { path: path, index: index, params: params };\n };\n}\nexports.regexpToFunction = regexpToFunction;\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path, keys) {\n if (!keys)\n return path;\n // Use a negative lookahead to match only capturing groups.\n var groups = path.source.match(/\\((?!\\?)/g);\n if (groups) {\n for (var i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n });\n }\n }\n return path;\n}\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(paths, keys, options) {\n var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; });\n return new RegExp(\"(?:\" + parts.join(\"|\") + \")\", flags(options));\n}\n/**\n * Create a path regexp from string input.\n */\nfunction stringToRegexp(path, keys, options) {\n return tokensToRegexp(parse(path, options), keys, options);\n}\n/**\n * Expose a function for taking tokens and returning a RegExp.\n */\nfunction tokensToRegexp(tokens, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d;\n var endsWith = \"[\" + escapeString(options.endsWith || \"\") + \"]|$\";\n var delimiter = \"[\" + escapeString(options.delimiter || \"/#?\") + \"]\";\n var route = start ? \"^\" : \"\";\n // Iterate over the tokens and create our regexp string.\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n if (typeof token === \"string\") {\n route += escapeString(encode(token));\n }\n else {\n var prefix = escapeString(encode(token.prefix));\n var suffix = escapeString(encode(token.suffix));\n if (token.pattern) {\n if (keys)\n keys.push(token);\n if (prefix || suffix) {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n var mod = token.modifier === \"*\" ? \"?\" : \"\";\n route += \"(?:\" + prefix + \"((?:\" + token.pattern + \")(?:\" + suffix + prefix + \"(?:\" + token.pattern + \"))*)\" + suffix + \")\" + mod;\n }\n else {\n route += \"(?:\" + prefix + \"(\" + token.pattern + \")\" + suffix + \")\" + token.modifier;\n }\n }\n else {\n route += \"(\" + token.pattern + \")\" + token.modifier;\n }\n }\n else {\n route += \"(?:\" + prefix + suffix + \")\" + token.modifier;\n }\n }\n }\n if (end) {\n if (!strict)\n route += delimiter + \"?\";\n route += !options.endsWith ? \"$\" : \"(?=\" + endsWith + \")\";\n }\n else {\n var endToken = tokens[tokens.length - 1];\n var isEndDelimited = typeof endToken === \"string\"\n ? delimiter.indexOf(endToken[endToken.length - 1]) > -1\n : // tslint:disable-next-line\n endToken === undefined;\n if (!strict) {\n route += \"(?:\" + delimiter + \"(?=\" + endsWith + \"))?\";\n }\n if (!isEndDelimited) {\n route += \"(?=\" + delimiter + \"|\" + endsWith + \")\";\n }\n }\n return new RegExp(route, flags(options));\n}\nexports.tokensToRegexp = tokensToRegexp;\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n */\nfunction pathToRegexp(path, keys, options) {\n if (path instanceof RegExp)\n return regexpToRegexp(path, keys);\n if (Array.isArray(path))\n return arrayToRegexp(path, keys, options);\n return stringToRegexp(path, keys, options);\n}\nexports.pathToRegexp = pathToRegexp;\n//# sourceMappingURL=index.js.map","export const NEXT_QUERY_PARAM_PREFIX = \"nxtP\";\nexport const PRERENDER_REVALIDATE_HEADER = \"x-prerender-revalidate\";\nexport const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = \"x-prerender-revalidate-if-generated\";\nexport const RSC_PREFETCH_SUFFIX = \".prefetch.rsc\";\nexport const RSC_SUFFIX = \".rsc\";\nexport const ACTION_SUFFIX = \".action\";\nexport const NEXT_DATA_SUFFIX = \".json\";\nexport const NEXT_META_SUFFIX = \".meta\";\nexport const NEXT_BODY_SUFFIX = \".body\";\nexport const NEXT_CACHE_TAGS_HEADER = \"x-next-cache-tags\";\nexport const NEXT_CACHE_SOFT_TAGS_HEADER = \"x-next-cache-soft-tags\";\nexport const NEXT_CACHE_REVALIDATED_TAGS_HEADER = \"x-next-revalidated-tags\";\nexport const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = \"x-next-revalidate-tag-token\";\n// if these change make sure we update the related\n// documentation as well\nexport const NEXT_CACHE_TAG_MAX_ITEMS = 128;\nexport const NEXT_CACHE_TAG_MAX_LENGTH = 256;\nexport const NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;\nexport const NEXT_CACHE_IMPLICIT_TAG_ID = \"_N_T_\";\n// in seconds\nexport const CACHE_ONE_YEAR = 31536000;\n// Patterns to detect middleware files\nexport const MIDDLEWARE_FILENAME = \"middleware\";\nexport const MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;\n// Pattern to detect instrumentation hooks file\nexport const INSTRUMENTATION_HOOK_FILENAME = \"instrumentation\";\n// Because on Windows absolute paths in the generated code can break because of numbers, eg 1 in the path,\n// we have to use a private alias\nexport const PAGES_DIR_ALIAS = \"private-next-pages\";\nexport const DOT_NEXT_ALIAS = \"private-dot-next\";\nexport const ROOT_DIR_ALIAS = \"private-next-root-dir\";\nexport const APP_DIR_ALIAS = \"private-next-app-dir\";\nexport const RSC_MOD_REF_PROXY_ALIAS = \"private-next-rsc-mod-ref-proxy\";\nexport const RSC_ACTION_VALIDATE_ALIAS = \"private-next-rsc-action-validate\";\nexport const RSC_ACTION_PROXY_ALIAS = \"private-next-rsc-server-reference\";\nexport const RSC_ACTION_ENCRYPTION_ALIAS = \"private-next-rsc-action-encryption\";\nexport const RSC_ACTION_CLIENT_WRAPPER_ALIAS = \"private-next-rsc-action-client-wrapper\";\nexport const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;\nexport const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;\nexport const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;\nexport const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;\nexport const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;\nexport const SERVER_PROPS_EXPORT_ERROR = `pages with \\`getServerSideProps\\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;\nexport const GSP_NO_RETURNED_VALUE = \"Your `getStaticProps` function did not return an object. Did you forget to add a `return`?\";\nexport const GSSP_NO_RETURNED_VALUE = \"Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?\";\nexport const UNSTABLE_REVALIDATE_RENAME_ERROR = \"The `unstable_revalidate` property is available for general use.\\n\" + \"Please use `revalidate` instead.\";\nexport const GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;\nexport const NON_STANDARD_NODE_ENV = `You are using a non-standard \"NODE_ENV\" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;\nexport const SSG_FALLBACK_EXPORT_ERROR = `Pages with \\`fallback\\` enabled in \\`getStaticPaths\\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;\nexport const ESLINT_DEFAULT_DIRS = [\n \"app\",\n \"pages\",\n \"components\",\n \"lib\",\n \"src\"\n];\nexport const SERVER_RUNTIME = {\n edge: \"edge\",\n experimentalEdge: \"experimental-edge\",\n nodejs: \"nodejs\"\n};\n/**\n * The names of the webpack layers. These layers are the primitives for the\n * webpack chunks.\n */ const WEBPACK_LAYERS_NAMES = {\n /**\n * The layer for the shared code between the client and server bundles.\n */ shared: \"shared\",\n /**\n * React Server Components layer (rsc).\n */ reactServerComponents: \"rsc\",\n /**\n * Server Side Rendering layer for app (ssr).\n */ serverSideRendering: \"ssr\",\n /**\n * The browser client bundle layer for actions.\n */ actionBrowser: \"action-browser\",\n /**\n * The layer for the API routes.\n */ api: \"api\",\n /**\n * The layer for the middleware code.\n */ middleware: \"middleware\",\n /**\n * The layer for the instrumentation hooks.\n */ instrument: \"instrument\",\n /**\n * The layer for assets on the edge.\n */ edgeAsset: \"edge-asset\",\n /**\n * The browser client bundle layer for App directory.\n */ appPagesBrowser: \"app-pages-browser\",\n /**\n * The server bundle layer for metadata routes.\n */ appMetadataRoute: \"app-metadata-route\",\n /**\n * The layer for the server bundle for App Route handlers.\n */ appRouteHandler: \"app-route-handler\"\n};\nconst WEBPACK_LAYERS = {\n ...WEBPACK_LAYERS_NAMES,\n GROUP: {\n serverOnly: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.appMetadataRoute,\n WEBPACK_LAYERS_NAMES.appRouteHandler,\n WEBPACK_LAYERS_NAMES.instrument\n ],\n clientOnly: [\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser\n ],\n nonClientServerTarget: [\n // middleware and pages api\n WEBPACK_LAYERS_NAMES.middleware,\n WEBPACK_LAYERS_NAMES.api\n ],\n app: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.appMetadataRoute,\n WEBPACK_LAYERS_NAMES.appRouteHandler,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.shared,\n WEBPACK_LAYERS_NAMES.instrument\n ]\n }\n};\nconst WEBPACK_RESOURCE_QUERIES = {\n edgeSSREntry: \"__next_edge_ssr_entry__\",\n metadata: \"__next_metadata__\",\n metadataRoute: \"__next_metadata_route__\",\n metadataImageMeta: \"__next_metadata_image_meta__\"\n};\nexport { WEBPACK_LAYERS, WEBPACK_RESOURCE_QUERIES };\n\n//# sourceMappingURL=constants.js.map","import { HeadersAdapter } from \"../web/spec-extension/adapters/headers\";\nimport { PRERENDER_REVALIDATE_HEADER, PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER } from \"../../lib/constants\";\nimport { getTracer } from \"../lib/trace/tracer\";\nimport { NodeSpan } from \"../lib/trace/constants\";\nexport function wrapApiHandler(page, handler) {\n return (...args)=>{\n var _getTracer_getRootSpanAttributes;\n (_getTracer_getRootSpanAttributes = getTracer().getRootSpanAttributes()) == null ? void 0 : _getTracer_getRootSpanAttributes.set(\"next.route\", page);\n // Call API route method\n return getTracer().trace(NodeSpan.runHandler, {\n spanName: `executing api route (pages) ${page}`\n }, ()=>handler(...args));\n };\n}\n/**\n *\n * @param res response object\n * @param statusCode `HTTP` status code of response\n */ export function sendStatusCode(res, statusCode) {\n res.statusCode = statusCode;\n return res;\n}\n/**\n *\n * @param res response object\n * @param [statusOrUrl] `HTTP` status code of redirect\n * @param url URL of redirect\n */ export function redirect(res, statusOrUrl, url) {\n if (typeof statusOrUrl === \"string\") {\n url = statusOrUrl;\n statusOrUrl = 307;\n }\n if (typeof statusOrUrl !== \"number\" || typeof url !== \"string\") {\n throw new Error(`Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination').`);\n }\n res.writeHead(statusOrUrl, {\n Location: url\n });\n res.write(url);\n res.end();\n return res;\n}\nexport function checkIsOnDemandRevalidate(req, previewProps) {\n const headers = HeadersAdapter.from(req.headers);\n const previewModeId = headers.get(PRERENDER_REVALIDATE_HEADER);\n const isOnDemandRevalidate = previewModeId === previewProps.previewModeId;\n const revalidateOnlyGenerated = headers.has(PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER);\n return {\n isOnDemandRevalidate,\n revalidateOnlyGenerated\n };\n}\nexport const COOKIE_NAME_PRERENDER_BYPASS = `__prerender_bypass`;\nexport const COOKIE_NAME_PRERENDER_DATA = `__next_preview_data`;\nexport const RESPONSE_LIMIT_DEFAULT = 4 * 1024 * 1024;\nexport const SYMBOL_PREVIEW_DATA = Symbol(COOKIE_NAME_PRERENDER_DATA);\nexport const SYMBOL_CLEARED_COOKIES = Symbol(COOKIE_NAME_PRERENDER_BYPASS);\nexport function clearPreviewData(res, options = {}) {\n if (SYMBOL_CLEARED_COOKIES in res) {\n return res;\n }\n const { serialize } = require(\"next/dist/compiled/cookie\");\n const previous = res.getHeader(\"Set-Cookie\");\n res.setHeader(`Set-Cookie`, [\n ...typeof previous === \"string\" ? [\n previous\n ] : Array.isArray(previous) ? previous : [],\n serialize(COOKIE_NAME_PRERENDER_BYPASS, \"\", {\n // To delete a cookie, set `expires` to a date in the past:\n // https://tools.ietf.org/html/rfc6265#section-4.1.1\n // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.\n expires: new Date(0),\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== \"development\" ? \"none\" : \"lax\",\n secure: process.env.NODE_ENV !== \"development\",\n path: \"/\",\n ...options.path !== undefined ? {\n path: options.path\n } : undefined\n }),\n serialize(COOKIE_NAME_PRERENDER_DATA, \"\", {\n // To delete a cookie, set `expires` to a date in the past:\n // https://tools.ietf.org/html/rfc6265#section-4.1.1\n // `Max-Age: 0` is not valid, thus ignored, and the cookie is persisted.\n expires: new Date(0),\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== \"development\" ? \"none\" : \"lax\",\n secure: process.env.NODE_ENV !== \"development\",\n path: \"/\",\n ...options.path !== undefined ? {\n path: options.path\n } : undefined\n })\n ]);\n Object.defineProperty(res, SYMBOL_CLEARED_COOKIES, {\n value: true,\n enumerable: false\n });\n return res;\n}\n/**\n * Custom error class\n */ export class ApiError extends Error {\n constructor(statusCode, message){\n super(message);\n this.statusCode = statusCode;\n }\n}\n/**\n * Sends error in `response`\n * @param res response object\n * @param statusCode of response\n * @param message of response\n */ export function sendError(res, statusCode, message) {\n res.statusCode = statusCode;\n res.statusMessage = message;\n res.end(message);\n}\n/**\n * Execute getter function only if its needed\n * @param LazyProps `req` and `params` for lazyProp\n * @param prop name of property\n * @param getter function to get data\n */ export function setLazyProp({ req }, prop, getter) {\n const opts = {\n configurable: true,\n enumerable: true\n };\n const optsReset = {\n ...opts,\n writable: true\n };\n Object.defineProperty(req, prop, {\n ...opts,\n get: ()=>{\n const value = getter();\n // we set the property on the object to avoid recalculating it\n Object.defineProperty(req, prop, {\n ...optsReset,\n value\n });\n return value;\n },\n set: (value)=>{\n Object.defineProperty(req, prop, {\n ...optsReset,\n value\n });\n }\n });\n}\n\n//# sourceMappingURL=index.js.map","import { checkIsOnDemandRevalidate } from \"../.\";\nimport { clearPreviewData, COOKIE_NAME_PRERENDER_BYPASS, COOKIE_NAME_PRERENDER_DATA, SYMBOL_PREVIEW_DATA } from \"../index\";\nimport { RequestCookies } from \"../../web/spec-extension/cookies\";\nimport { HeadersAdapter } from \"../../web/spec-extension/adapters/headers\";\nexport function tryGetPreviewData(req, res, options, multiZoneDraftMode) {\n var _cookies_get, _cookies_get1;\n // if an On-Demand revalidation is being done preview mode\n // is disabled\n if (options && checkIsOnDemandRevalidate(req, options).isOnDemandRevalidate) {\n return false;\n }\n // Read cached preview data if present\n // TODO: use request metadata instead of a symbol\n if (SYMBOL_PREVIEW_DATA in req) {\n return req[SYMBOL_PREVIEW_DATA];\n }\n const headers = HeadersAdapter.from(req.headers);\n const cookies = new RequestCookies(headers);\n const previewModeId = (_cookies_get = cookies.get(COOKIE_NAME_PRERENDER_BYPASS)) == null ? void 0 : _cookies_get.value;\n const tokenPreviewData = (_cookies_get1 = cookies.get(COOKIE_NAME_PRERENDER_DATA)) == null ? void 0 : _cookies_get1.value;\n // Case: preview mode cookie set but data cookie is not set\n if (previewModeId && !tokenPreviewData && previewModeId === options.previewModeId) {\n // This is \"Draft Mode\" which doesn't use\n // previewData, so we return an empty object\n // for backwards compat with \"Preview Mode\".\n const data = {};\n Object.defineProperty(req, SYMBOL_PREVIEW_DATA, {\n value: data,\n enumerable: false\n });\n return data;\n }\n // Case: neither cookie is set.\n if (!previewModeId && !tokenPreviewData) {\n return false;\n }\n // Case: one cookie is set, but not the other.\n if (!previewModeId || !tokenPreviewData) {\n if (!multiZoneDraftMode) {\n clearPreviewData(res);\n }\n return false;\n }\n // Case: preview session is for an old build.\n if (previewModeId !== options.previewModeId) {\n if (!multiZoneDraftMode) {\n clearPreviewData(res);\n }\n return false;\n }\n let encryptedPreviewData;\n try {\n const jsonwebtoken = require(\"next/dist/compiled/jsonwebtoken\");\n encryptedPreviewData = jsonwebtoken.verify(tokenPreviewData, options.previewModeSigningKey);\n } catch {\n // TODO: warn\n clearPreviewData(res);\n return false;\n }\n const { decryptWithSecret } = require(\"../../crypto-utils\");\n const decryptedPreviewData = decryptWithSecret(Buffer.from(options.previewModeEncryptionKey), encryptedPreviewData.data);\n try {\n // TODO: strict runtime type checking\n const data = JSON.parse(decryptedPreviewData);\n // Cache lookup\n Object.defineProperty(req, SYMBOL_PREVIEW_DATA, {\n value: data,\n enumerable: false\n });\n return data;\n } catch {\n return false;\n }\n}\n\n//# sourceMappingURL=try-get-preview-data.js.map","import crypto from \"crypto\";\n// Background:\n// https://security.stackexchange.com/questions/184305/why-would-i-ever-use-aes-256-cbc-if-aes-256-gcm-is-more-secure\nconst CIPHER_ALGORITHM = `aes-256-gcm`, CIPHER_KEY_LENGTH = 32, CIPHER_IV_LENGTH = 16, CIPHER_TAG_LENGTH = 16, CIPHER_SALT_LENGTH = 64;\nconst PBKDF2_ITERATIONS = 100000 // https://support.1password.com/pbkdf2/\n;\nexport function encryptWithSecret(secret, data) {\n const iv = crypto.randomBytes(CIPHER_IV_LENGTH);\n const salt = crypto.randomBytes(CIPHER_SALT_LENGTH);\n // https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest\n const key = crypto.pbkdf2Sync(secret, salt, PBKDF2_ITERATIONS, CIPHER_KEY_LENGTH, `sha512`);\n const cipher = crypto.createCipheriv(CIPHER_ALGORITHM, key, iv);\n const encrypted = Buffer.concat([\n cipher.update(data, `utf8`),\n cipher.final()\n ]);\n // https://nodejs.org/api/crypto.html#crypto_cipher_getauthtag\n const tag = cipher.getAuthTag();\n return Buffer.concat([\n // Data as required by:\n // Salt for Key: https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest\n // IV: https://nodejs.org/api/crypto.html#crypto_class_decipher\n // Tag: https://nodejs.org/api/crypto.html#crypto_decipher_setauthtag_buffer\n salt,\n iv,\n tag,\n encrypted\n ]).toString(`hex`);\n}\nexport function decryptWithSecret(secret, encryptedData) {\n const buffer = Buffer.from(encryptedData, `hex`);\n const salt = buffer.slice(0, CIPHER_SALT_LENGTH);\n const iv = buffer.slice(CIPHER_SALT_LENGTH, CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH);\n const tag = buffer.slice(CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH, CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH + CIPHER_TAG_LENGTH);\n const encrypted = buffer.slice(CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH + CIPHER_TAG_LENGTH);\n // https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest\n const key = crypto.pbkdf2Sync(secret, salt, PBKDF2_ITERATIONS, CIPHER_KEY_LENGTH, `sha512`);\n const decipher = crypto.createDecipheriv(CIPHER_ALGORITHM, key, iv);\n decipher.setAuthTag(tag);\n return decipher.update(encrypted) + decipher.final(`utf8`);\n}\n\n//# sourceMappingURL=crypto-utils.js.map","const symbolError = Symbol.for(\"NextjsError\");\nexport function getErrorSource(error) {\n return error[symbolError] || null;\n}\nexport function decorateServerError(error, type) {\n Object.defineProperty(error, symbolError, {\n writable: false,\n enumerable: false,\n configurable: false,\n value: type\n });\n}\n\n//# sourceMappingURL=error-source.js.map","export const ipcForbiddenHeaders = [\n \"accept-encoding\",\n \"keepalive\",\n \"keep-alive\",\n \"content-encoding\",\n \"transfer-encoding\",\n // https://github.com/nodejs/undici/issues/1470\n \"connection\",\n // marked as unsupported by undici: https://github.com/nodejs/undici/blob/c83b084879fa0bb8e0469d31ec61428ac68160d5/lib/core/request.js#L354\n \"expect\"\n];\nexport const actionsForbiddenHeaders = [\n ...ipcForbiddenHeaders,\n \"content-length\",\n \"set-cookie\"\n];\nexport const filterReqHeaders = (headers, forbiddenHeaders)=>{\n // Some browsers are not matching spec and sending Content-Length: 0. This causes issues in undici\n // https://github.com/nodejs/undici/issues/2046\n if (headers[\"content-length\"] && headers[\"content-length\"] === \"0\") {\n delete headers[\"content-length\"];\n }\n for (const [key, value] of Object.entries(headers)){\n if (forbiddenHeaders.includes(key) || !(Array.isArray(value) || typeof value === \"string\")) {\n delete headers[key];\n }\n }\n return headers;\n};\n\n//# sourceMappingURL=utils.js.map","import { filterReqHeaders, ipcForbiddenHeaders } from \"./utils\";\nexport const invokeRequest = async (targetUrl, requestInit, readableBody)=>{\n const invokeHeaders = filterReqHeaders({\n \"cache-control\": \"\",\n ...requestInit.headers\n }, ipcForbiddenHeaders);\n return await fetch(targetUrl, {\n headers: invokeHeaders,\n method: requestInit.method,\n redirect: \"manual\",\n signal: requestInit.signal,\n ...requestInit.method !== \"GET\" && requestInit.method !== \"HEAD\" && readableBody ? {\n body: readableBody,\n duplex: \"half\"\n } : {},\n next: {\n // @ts-ignore\n internal: true\n }\n });\n};\n\n//# sourceMappingURL=invoke-request.js.map","import { decorateServerError } from \"../../../shared/lib/error-source\";\nimport { PageNotFoundError } from \"../../../shared/lib/utils\";\nimport { invokeRequest } from \"./invoke-request\";\nexport const deserializeErr = (serializedErr)=>{\n if (!serializedErr || typeof serializedErr !== \"object\" || !serializedErr.stack) {\n return serializedErr;\n }\n let ErrorType = Error;\n if (serializedErr.name === \"PageNotFoundError\") {\n ErrorType = PageNotFoundError;\n }\n const err = new ErrorType(serializedErr.message);\n err.stack = serializedErr.stack;\n err.name = serializedErr.name;\n err.digest = serializedErr.digest;\n if (process.env.NODE_ENV === \"development\" && process.env.NEXT_RUNTIME !== \"edge\") {\n decorateServerError(err, serializedErr.source || \"server\");\n }\n return err;\n};\nexport async function invokeIpcMethod({ fetchHostname = \"localhost\", method, args, ipcPort, ipcKey }) {\n if (ipcPort) {\n const res = await invokeRequest(`http://${fetchHostname}:${ipcPort}?key=${ipcKey}&method=${method}&args=${encodeURIComponent(JSON.stringify(args))}`, {\n method: \"GET\",\n headers: {}\n });\n const body = await res.text();\n if (body.startsWith(\"{\") && body.endsWith(\"}\")) {\n const parsedBody = JSON.parse(body);\n if (parsedBody && typeof parsedBody === \"object\" && \"err\" in parsedBody && \"stack\" in parsedBody.err) {\n throw deserializeErr(parsedBody.err);\n }\n return parsedBody;\n }\n }\n}\n\n//# sourceMappingURL=request-utils.js.map","/**\n * Contains predefined constants for the trace span name in next/server.\n *\n * Currently, next/server/tracer is internal implementation only for tracking\n * next.js's implementation only with known span names defined here.\n **/ // eslint typescript has a bug with TS enums\n/* eslint-disable no-shadow */ var BaseServerSpan;\n(function(BaseServerSpan) {\n BaseServerSpan[\"handleRequest\"] = \"BaseServer.handleRequest\";\n BaseServerSpan[\"run\"] = \"BaseServer.run\";\n BaseServerSpan[\"pipe\"] = \"BaseServer.pipe\";\n BaseServerSpan[\"getStaticHTML\"] = \"BaseServer.getStaticHTML\";\n BaseServerSpan[\"render\"] = \"BaseServer.render\";\n BaseServerSpan[\"renderToResponseWithComponents\"] = \"BaseServer.renderToResponseWithComponents\";\n BaseServerSpan[\"renderToResponse\"] = \"BaseServer.renderToResponse\";\n BaseServerSpan[\"renderToHTML\"] = \"BaseServer.renderToHTML\";\n BaseServerSpan[\"renderError\"] = \"BaseServer.renderError\";\n BaseServerSpan[\"renderErrorToResponse\"] = \"BaseServer.renderErrorToResponse\";\n BaseServerSpan[\"renderErrorToHTML\"] = \"BaseServer.renderErrorToHTML\";\n BaseServerSpan[\"render404\"] = \"BaseServer.render404\";\n})(BaseServerSpan || (BaseServerSpan = {}));\nvar LoadComponentsSpan;\n(function(LoadComponentsSpan) {\n LoadComponentsSpan[\"loadDefaultErrorComponents\"] = \"LoadComponents.loadDefaultErrorComponents\";\n LoadComponentsSpan[\"loadComponents\"] = \"LoadComponents.loadComponents\";\n})(LoadComponentsSpan || (LoadComponentsSpan = {}));\nvar NextServerSpan;\n(function(NextServerSpan) {\n NextServerSpan[\"getRequestHandler\"] = \"NextServer.getRequestHandler\";\n NextServerSpan[\"getServer\"] = \"NextServer.getServer\";\n NextServerSpan[\"getServerRequestHandler\"] = \"NextServer.getServerRequestHandler\";\n NextServerSpan[\"createServer\"] = \"createServer.createServer\";\n})(NextServerSpan || (NextServerSpan = {}));\nvar NextNodeServerSpan;\n(function(NextNodeServerSpan) {\n NextNodeServerSpan[\"compression\"] = \"NextNodeServer.compression\";\n NextNodeServerSpan[\"getBuildId\"] = \"NextNodeServer.getBuildId\";\n NextNodeServerSpan[\"createComponentTree\"] = \"NextNodeServer.createComponentTree\";\n NextNodeServerSpan[\"clientComponentLoading\"] = \"NextNodeServer.clientComponentLoading\";\n NextNodeServerSpan[\"getLayoutOrPageModule\"] = \"NextNodeServer.getLayoutOrPageModule\";\n NextNodeServerSpan[\"generateStaticRoutes\"] = \"NextNodeServer.generateStaticRoutes\";\n NextNodeServerSpan[\"generateFsStaticRoutes\"] = \"NextNodeServer.generateFsStaticRoutes\";\n NextNodeServerSpan[\"generatePublicRoutes\"] = \"NextNodeServer.generatePublicRoutes\";\n NextNodeServerSpan[\"generateImageRoutes\"] = \"NextNodeServer.generateImageRoutes.route\";\n NextNodeServerSpan[\"sendRenderResult\"] = \"NextNodeServer.sendRenderResult\";\n NextNodeServerSpan[\"proxyRequest\"] = \"NextNodeServer.proxyRequest\";\n NextNodeServerSpan[\"runApi\"] = \"NextNodeServer.runApi\";\n NextNodeServerSpan[\"render\"] = \"NextNodeServer.render\";\n NextNodeServerSpan[\"renderHTML\"] = \"NextNodeServer.renderHTML\";\n NextNodeServerSpan[\"imageOptimizer\"] = \"NextNodeServer.imageOptimizer\";\n NextNodeServerSpan[\"getPagePath\"] = \"NextNodeServer.getPagePath\";\n NextNodeServerSpan[\"getRoutesManifest\"] = \"NextNodeServer.getRoutesManifest\";\n NextNodeServerSpan[\"findPageComponents\"] = \"NextNodeServer.findPageComponents\";\n NextNodeServerSpan[\"getFontManifest\"] = \"NextNodeServer.getFontManifest\";\n NextNodeServerSpan[\"getServerComponentManifest\"] = \"NextNodeServer.getServerComponentManifest\";\n NextNodeServerSpan[\"getRequestHandler\"] = \"NextNodeServer.getRequestHandler\";\n NextNodeServerSpan[\"renderToHTML\"] = \"NextNodeServer.renderToHTML\";\n NextNodeServerSpan[\"renderError\"] = \"NextNodeServer.renderError\";\n NextNodeServerSpan[\"renderErrorToHTML\"] = \"NextNodeServer.renderErrorToHTML\";\n NextNodeServerSpan[\"render404\"] = \"NextNodeServer.render404\";\n NextNodeServerSpan[\"startResponse\"] = \"NextNodeServer.startResponse\";\n // nested inner span, does not require parent scope name\n NextNodeServerSpan[\"route\"] = \"route\";\n NextNodeServerSpan[\"onProxyReq\"] = \"onProxyReq\";\n NextNodeServerSpan[\"apiResolver\"] = \"apiResolver\";\n NextNodeServerSpan[\"internalFetch\"] = \"internalFetch\";\n})(NextNodeServerSpan || (NextNodeServerSpan = {}));\nvar StartServerSpan;\n(function(StartServerSpan) {\n StartServerSpan[\"startServer\"] = \"startServer.startServer\";\n})(StartServerSpan || (StartServerSpan = {}));\nvar RenderSpan;\n(function(RenderSpan) {\n RenderSpan[\"getServerSideProps\"] = \"Render.getServerSideProps\";\n RenderSpan[\"getStaticProps\"] = \"Render.getStaticProps\";\n RenderSpan[\"renderToString\"] = \"Render.renderToString\";\n RenderSpan[\"renderDocument\"] = \"Render.renderDocument\";\n RenderSpan[\"createBodyResult\"] = \"Render.createBodyResult\";\n})(RenderSpan || (RenderSpan = {}));\nvar AppRenderSpan;\n(function(AppRenderSpan) {\n AppRenderSpan[\"renderToString\"] = \"AppRender.renderToString\";\n AppRenderSpan[\"renderToReadableStream\"] = \"AppRender.renderToReadableStream\";\n AppRenderSpan[\"getBodyResult\"] = \"AppRender.getBodyResult\";\n AppRenderSpan[\"fetch\"] = \"AppRender.fetch\";\n})(AppRenderSpan || (AppRenderSpan = {}));\nvar RouterSpan;\n(function(RouterSpan) {\n RouterSpan[\"executeRoute\"] = \"Router.executeRoute\";\n})(RouterSpan || (RouterSpan = {}));\nvar NodeSpan;\n(function(NodeSpan) {\n NodeSpan[\"runHandler\"] = \"Node.runHandler\";\n})(NodeSpan || (NodeSpan = {}));\nvar AppRouteRouteHandlersSpan;\n(function(AppRouteRouteHandlersSpan) {\n AppRouteRouteHandlersSpan[\"runHandler\"] = \"AppRouteRouteHandlers.runHandler\";\n})(AppRouteRouteHandlersSpan || (AppRouteRouteHandlersSpan = {}));\nvar ResolveMetadataSpan;\n(function(ResolveMetadataSpan) {\n ResolveMetadataSpan[\"generateMetadata\"] = \"ResolveMetadata.generateMetadata\";\n ResolveMetadataSpan[\"generateViewport\"] = \"ResolveMetadata.generateViewport\";\n})(ResolveMetadataSpan || (ResolveMetadataSpan = {}));\nvar MiddlewareSpan;\n(function(MiddlewareSpan) {\n MiddlewareSpan[\"execute\"] = \"Middleware.execute\";\n})(MiddlewareSpan || (MiddlewareSpan = {}));\n// This list is used to filter out spans that are not relevant to the user\nexport const NextVanillaSpanAllowlist = [\n \"Middleware.execute\",\n \"BaseServer.handleRequest\",\n \"Render.getServerSideProps\",\n \"Render.getStaticProps\",\n \"AppRender.fetch\",\n \"AppRender.getBodyResult\",\n \"Render.renderDocument\",\n \"Node.runHandler\",\n \"AppRouteRouteHandlers.runHandler\",\n \"ResolveMetadata.generateMetadata\",\n \"ResolveMetadata.generateViewport\",\n \"NextNodeServer.createComponentTree\",\n \"NextNodeServer.findPageComponents\",\n \"NextNodeServer.getLayoutOrPageModule\",\n \"NextNodeServer.startResponse\",\n \"NextNodeServer.clientComponentLoading\"\n];\n// These Spans are allowed to be always logged\n// when the otel log prefix env is set\nexport const LogSpanAllowList = [\n \"NextNodeServer.findPageComponents\",\n \"NextNodeServer.createComponentTree\",\n \"NextNodeServer.clientComponentLoading\"\n];\nexport { BaseServerSpan, LoadComponentsSpan, NextServerSpan, NextNodeServerSpan, StartServerSpan, RenderSpan, RouterSpan, AppRenderSpan, NodeSpan, AppRouteRouteHandlersSpan, ResolveMetadataSpan, MiddlewareSpan, };\n\n//# sourceMappingURL=constants.js.map","// This file should be imported before any others. It sets up the environment\n// for later imports to work properly.\n// expose AsyncLocalStorage on global for react usage if it isn't already provided by the environment\nif (typeof globalThis.AsyncLocalStorage !== \"function\") {\n const { AsyncLocalStorage } = require(\"async_hooks\");\n globalThis.AsyncLocalStorage = AsyncLocalStorage;\n}\nif (typeof globalThis.WebSocket !== \"function\") {\n Object.defineProperty(globalThis, \"WebSocket\", {\n get () {\n return require(\"next/dist/compiled/ws\").WebSocket;\n }\n });\n}\n\n//# sourceMappingURL=node-environment.js.map","// Polyfill crypto() in the Node.js environment\nif (!global.crypto) {\n let webcrypto;\n Object.defineProperty(global, \"crypto\", {\n enumerable: false,\n configurable: true,\n get () {\n if (!webcrypto) {\n webcrypto = require(\"node:crypto\").webcrypto;\n }\n return webcrypto;\n },\n set (value) {\n webcrypto = value;\n }\n });\n}\n\n//# sourceMappingURL=node-polyfill-crypto.js.map","export class ReflectAdapter {\n static get(target, prop, receiver) {\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === \"function\") {\n return value.bind(target);\n }\n return value;\n }\n static set(target, prop, value, receiver) {\n return Reflect.set(target, prop, value, receiver);\n }\n static has(target, prop) {\n return Reflect.has(target, prop);\n }\n static deleteProperty(target, prop) {\n return Reflect.deleteProperty(target, prop);\n }\n}\n\n//# sourceMappingURL=reflect.js.map","import { ReflectAdapter } from \"./reflect\";\n/**\n * @internal\n */ export class ReadonlyHeadersError extends Error {\n constructor(){\n super(\"Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers\");\n }\n static callable() {\n throw new ReadonlyHeadersError();\n }\n}\nexport class HeadersAdapter extends Headers {\n constructor(headers){\n // We've already overridden the methods that would be called, so we're just\n // calling the super constructor to ensure that the instanceof check works.\n super();\n this.headers = new Proxy(headers, {\n get (target, prop, receiver) {\n // Because this is just an object, we expect that all \"get\" operations\n // are for properties. If it's a \"get\" for a symbol, we'll just return\n // the symbol.\n if (typeof prop === \"symbol\") {\n return ReflectAdapter.get(target, prop, receiver);\n }\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, return undefined.\n if (typeof original === \"undefined\") return;\n // If the original casing exists, return the value.\n return ReflectAdapter.get(target, original, receiver);\n },\n set (target, prop, value, receiver) {\n if (typeof prop === \"symbol\") {\n return ReflectAdapter.set(target, prop, value, receiver);\n }\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, use the prop as the key.\n return ReflectAdapter.set(target, original ?? prop, value, receiver);\n },\n has (target, prop) {\n if (typeof prop === \"symbol\") return ReflectAdapter.has(target, prop);\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, return false.\n if (typeof original === \"undefined\") return false;\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original);\n },\n deleteProperty (target, prop) {\n if (typeof prop === \"symbol\") return ReflectAdapter.deleteProperty(target, prop);\n const lowercased = prop.toLowerCase();\n // Let's find the original casing of the key. This assumes that there is\n // no mixed case keys (e.g. \"Content-Type\" and \"content-type\") in the\n // headers object.\n const original = Object.keys(headers).find((o)=>o.toLowerCase() === lowercased);\n // If the original casing doesn't exist, return true.\n if (typeof original === \"undefined\") return true;\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original);\n }\n });\n }\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n */ static seal(headers) {\n return new Proxy(headers, {\n get (target, prop, receiver) {\n switch(prop){\n case \"append\":\n case \"delete\":\n case \"set\":\n return ReadonlyHeadersError.callable;\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n }\n /**\n * Merges a header value into a string. This stores multiple values as an\n * array, so we need to merge them into a string.\n *\n * @param value a header value\n * @returns a merged header value (a string)\n */ merge(value) {\n if (Array.isArray(value)) return value.join(\", \");\n return value;\n }\n /**\n * Creates a Headers instance from a plain object or a Headers instance.\n *\n * @param headers a plain object or a Headers instance\n * @returns a headers instance\n */ static from(headers) {\n if (headers instanceof Headers) return headers;\n return new HeadersAdapter(headers);\n }\n append(name, value) {\n const existing = this.headers[name];\n if (typeof existing === \"string\") {\n this.headers[name] = [\n existing,\n value\n ];\n } else if (Array.isArray(existing)) {\n existing.push(value);\n } else {\n this.headers[name] = value;\n }\n }\n delete(name) {\n delete this.headers[name];\n }\n get(name) {\n const value = this.headers[name];\n if (typeof value !== \"undefined\") return this.merge(value);\n return null;\n }\n has(name) {\n return typeof this.headers[name] !== \"undefined\";\n }\n set(name, value) {\n this.headers[name] = value;\n }\n forEach(callbackfn, thisArg) {\n for (const [name, value] of this.entries()){\n callbackfn.call(thisArg, value, name, this);\n }\n }\n *entries() {\n for (const key of Object.keys(this.headers)){\n const name = key.toLowerCase();\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(name);\n yield [\n name,\n value\n ];\n }\n }\n *keys() {\n for (const key of Object.keys(this.headers)){\n const name = key.toLowerCase();\n yield name;\n }\n }\n *values() {\n for (const key of Object.keys(this.headers)){\n // We assert here that this is a string because we got it from the\n // Object.keys() call above.\n const value = this.get(key);\n yield value;\n }\n }\n [Symbol.iterator]() {\n return this.entries();\n }\n}\n\n//# sourceMappingURL=headers.js.map","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = () => ([]);\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = \"./dist/esm/server sync recursive\";\nmodule.exports = webpackEmptyContext;","/**\n * This module is for next.js server internal usage of path module.\n * It will use native path module for nodejs runtime.\n * It will use path-browserify polyfill for edge runtime.\n */ let path;\nif (process.env.NEXT_RUNTIME === \"edge\") {\n path = require(\"next/dist/compiled/path-browserify\");\n} else {\n path = require(\"path\");\n}\nmodule.exports = path;\n\n//# sourceMappingURL=path.js.map","// Note: This file is JS because it's used by the taskfile-swc.js file, which is JS.\n// Keep file changes in sync with the corresponding `.d.ts` files.\n/**\n * These are the browser versions that support all of the following:\n * static import: https://caniuse.com/es6-module\n * dynamic import: https://caniuse.com/es6-module-dynamic-import\n * import.meta: https://caniuse.com/mdn-javascript_operators_import_meta\n */ const MODERN_BROWSERSLIST_TARGET = [\n \"chrome 64\",\n \"edge 79\",\n \"firefox 67\",\n \"opera 51\",\n \"safari 12\"\n];\nmodule.exports = MODERN_BROWSERSLIST_TARGET;\n\n//# sourceMappingURL=modern-browserslist-target.js.map","/**\n * Web vitals provided to _app.reportWebVitals by Core Web Vitals plugin developed by Google Chrome team.\n * https://nextjs.org/blog/next-9-4#integrated-web-vitals-reporting\n */ export const WEB_VITALS = [\n \"CLS\",\n \"FCP\",\n \"FID\",\n \"INP\",\n \"LCP\",\n \"TTFB\"\n];\n/**\n * Utils\n */ export function execOnce(fn) {\n let used = false;\n let result;\n return function() {\n for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){\n args[_key] = arguments[_key];\n }\n if (!used) {\n used = true;\n result = fn(...args);\n }\n return result;\n };\n}\n// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1\n// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\nconst ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\\d+\\-.]*?:/;\nexport const isAbsoluteUrl = (url)=>ABSOLUTE_URL_REGEX.test(url);\nexport function getLocationOrigin() {\n const { protocol, hostname, port } = window.location;\n return protocol + \"//\" + hostname + (port ? \":\" + port : \"\");\n}\nexport function getURL() {\n const { href } = window.location;\n const origin = getLocationOrigin();\n return href.substring(origin.length);\n}\nexport function getDisplayName(Component) {\n return typeof Component === \"string\" ? Component : Component.displayName || Component.name || \"Unknown\";\n}\nexport function isResSent(res) {\n return res.finished || res.headersSent;\n}\nexport function normalizeRepeatedSlashes(url) {\n const urlParts = url.split(\"?\");\n const urlNoQuery = urlParts[0];\n return urlNoQuery// first we replace any non-encoded backslashes with forward\n // then normalize repeated forward slashes\n .replace(/\\\\/g, \"/\").replace(/\\/\\/+/g, \"/\") + (urlParts[1] ? \"?\" + urlParts.slice(1).join(\"?\") : \"\");\n}\nexport async function loadGetInitialProps(App, ctx) {\n if (process.env.NODE_ENV !== \"production\") {\n var _App_prototype;\n if ((_App_prototype = App.prototype) == null ? void 0 : _App_prototype.getInitialProps) {\n const message = '\"' + getDisplayName(App) + '.getInitialProps()\" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';\n throw new Error(message);\n }\n }\n // when called from _app `ctx` is nested in `ctx`\n const res = ctx.res || ctx.ctx && ctx.ctx.res;\n if (!App.getInitialProps) {\n if (ctx.ctx && ctx.Component) {\n // @ts-ignore pageProps default\n return {\n pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx)\n };\n }\n return {};\n }\n const props = await App.getInitialProps(ctx);\n if (res && isResSent(res)) {\n return props;\n }\n if (!props) {\n const message = '\"' + getDisplayName(App) + '.getInitialProps()\" should resolve to an object. But found \"' + props + '\" instead.';\n throw new Error(message);\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (Object.keys(props).length === 0 && !ctx.ctx) {\n console.warn(\"\" + getDisplayName(App) + \" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps\");\n }\n }\n return props;\n}\nexport const SP = typeof performance !== \"undefined\";\nexport const ST = SP && [\n \"mark\",\n \"measure\",\n \"getEntriesByName\"\n].every((method)=>typeof performance[method] === \"function\");\nexport class DecodeError extends Error {\n}\nexport class NormalizeError extends Error {\n}\nexport class PageNotFoundError extends Error {\n constructor(page){\n super();\n this.code = \"ENOENT\";\n this.name = \"PageNotFoundError\";\n this.message = \"Cannot find module for page: \" + page;\n }\n}\nexport class MissingStaticPage extends Error {\n constructor(page, message){\n super();\n this.message = \"Failed to load static file for page: \" + page + \" \" + message;\n }\n}\nexport class MiddlewareNotFoundError extends Error {\n constructor(){\n super();\n this.code = \"ENOENT\";\n this.message = \"Cannot find the middleware module\";\n }\n}\nexport function stringifyError(error) {\n return JSON.stringify({\n message: error.message,\n stack: error.stack\n });\n}\n\n//# sourceMappingURL=utils.js.map","module.exports = require(\"next/dist/server/lib/trace/tracer\");","module.exports = require(\"next/dist/compiled/jsonwebtoken\");","module.exports = require(\"next/dist/compiled/node-html-parser\");","module.exports = require(\"next/dist/compiled/ws\");","module.exports = require(\"next/dist/server/web/sandbox\");","module.exports = require(\"async_hooks\");","module.exports = require(\"crypto\");","module.exports = require(\"fs\");","module.exports = require(\"module\");","module.exports = require(\"node:crypto\");","module.exports = require(\"os\");","module.exports = require(\"path\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import LRUCache from \"next/dist/compiled/lru-cache\";\nimport { CACHE_ONE_YEAR, NEXT_CACHE_SOFT_TAGS_HEADER } from \"../../../lib/constants\";\nlet rateLimitedUntil = 0;\nlet memoryCache;\nconst CACHE_TAGS_HEADER = \"x-vercel-cache-tags\";\nconst CACHE_HEADERS_HEADER = \"x-vercel-sc-headers\";\nconst CACHE_STATE_HEADER = \"x-vercel-cache-state\";\nconst CACHE_REVALIDATE_HEADER = \"x-vercel-revalidate\";\nconst CACHE_FETCH_URL_HEADER = \"x-vercel-cache-item-name\";\nconst CACHE_CONTROL_VALUE_HEADER = \"x-vercel-cache-control\";\nconst DEBUG = Boolean(process.env.NEXT_PRIVATE_DEBUG_CACHE);\nasync function fetchRetryWithTimeout(url, init, retryIndex = 0) {\n const controller = new AbortController();\n const timeout = setTimeout(()=>{\n controller.abort();\n }, 500);\n return fetch(url, {\n ...init || {},\n signal: controller.signal\n }).catch((err)=>{\n if (retryIndex === 3) {\n throw err;\n } else {\n if (DEBUG) {\n console.log(`Fetch failed for ${url} retry ${retryIndex}`);\n }\n return fetchRetryWithTimeout(url, init, retryIndex + 1);\n }\n }).finally(()=>{\n clearTimeout(timeout);\n });\n}\nexport default class FetchCache {\n hasMatchingTags(arr1, arr2) {\n if (arr1.length !== arr2.length) return false;\n const set1 = new Set(arr1);\n const set2 = new Set(arr2);\n if (set1.size !== set2.size) return false;\n for (let tag of set1){\n if (!set2.has(tag)) return false;\n }\n return true;\n }\n static isAvailable(ctx) {\n return !!(ctx._requestHeaders[\"x-vercel-sc-host\"] || process.env.SUSPENSE_CACHE_URL);\n }\n constructor(ctx){\n this.headers = {};\n this.headers[\"Content-Type\"] = \"application/json\";\n if (CACHE_HEADERS_HEADER in ctx._requestHeaders) {\n const newHeaders = JSON.parse(ctx._requestHeaders[CACHE_HEADERS_HEADER]);\n for(const k in newHeaders){\n this.headers[k] = newHeaders[k];\n }\n delete ctx._requestHeaders[CACHE_HEADERS_HEADER];\n }\n const scHost = ctx._requestHeaders[\"x-vercel-sc-host\"] || process.env.SUSPENSE_CACHE_URL;\n const scBasePath = ctx._requestHeaders[\"x-vercel-sc-basepath\"] || process.env.SUSPENSE_CACHE_BASEPATH;\n if (process.env.SUSPENSE_CACHE_AUTH_TOKEN) {\n this.headers[\"Authorization\"] = `Bearer ${process.env.SUSPENSE_CACHE_AUTH_TOKEN}`;\n }\n if (scHost) {\n const scProto = process.env.SUSPENSE_CACHE_PROTO || \"https\";\n this.cacheEndpoint = `${scProto}://${scHost}${scBasePath || \"\"}`;\n if (DEBUG) {\n console.log(\"using cache endpoint\", this.cacheEndpoint);\n }\n } else if (DEBUG) {\n console.log(\"no cache endpoint available\");\n }\n if (ctx.maxMemoryCacheSize) {\n if (!memoryCache) {\n if (DEBUG) {\n console.log(\"using memory store for fetch cache\");\n }\n memoryCache = new LRUCache({\n max: ctx.maxMemoryCacheSize,\n length ({ value }) {\n var _JSON_stringify;\n if (!value) {\n return 25;\n } else if (value.kind === \"REDIRECT\") {\n return JSON.stringify(value.props).length;\n } else if (value.kind === \"IMAGE\") {\n throw new Error(\"invariant image should not be incremental-cache\");\n } else if (value.kind === \"FETCH\") {\n return JSON.stringify(value.data || \"\").length;\n } else if (value.kind === \"ROUTE\") {\n return value.body.length;\n }\n // rough estimate of size of cache value\n return value.html.length + (((_JSON_stringify = JSON.stringify(value.kind === \"PAGE\" && value.pageData)) == null ? void 0 : _JSON_stringify.length) || 0);\n }\n });\n }\n } else {\n if (DEBUG) {\n console.log(\"not using memory store for fetch cache\");\n }\n }\n }\n resetRequestCache() {\n memoryCache == null ? void 0 : memoryCache.reset();\n }\n async revalidateTag(...args) {\n let [tags] = args;\n tags = typeof tags === \"string\" ? [\n tags\n ] : tags;\n if (DEBUG) {\n console.log(\"revalidateTag\", tags);\n }\n if (!tags.length) return;\n if (Date.now() < rateLimitedUntil) {\n if (DEBUG) {\n console.log(\"rate limited \", rateLimitedUntil);\n }\n return;\n }\n for(let i = 0; i < Math.ceil(tags.length / 64); i++){\n const currentTags = tags.slice(i * 64, i * 64 + 64);\n try {\n const res = await fetchRetryWithTimeout(`${this.cacheEndpoint}/v1/suspense-cache/revalidate?tags=${currentTags.map((tag)=>encodeURIComponent(tag)).join(\",\")}`, {\n method: \"POST\",\n headers: this.headers,\n // @ts-expect-error not on public type\n next: {\n internal: true\n }\n });\n if (res.status === 429) {\n const retryAfter = res.headers.get(\"retry-after\") || \"60000\";\n rateLimitedUntil = Date.now() + parseInt(retryAfter);\n }\n if (!res.ok) {\n throw new Error(`Request failed with status ${res.status}.`);\n }\n } catch (err) {\n console.warn(`Failed to revalidate tag`, currentTags, err);\n }\n }\n }\n async get(...args) {\n var _data_value;\n const [key, ctx = {}] = args;\n const { tags, softTags, kindHint, fetchIdx, fetchUrl } = ctx;\n if (kindHint !== \"fetch\") {\n return null;\n }\n if (Date.now() < rateLimitedUntil) {\n if (DEBUG) {\n console.log(\"rate limited\");\n }\n return null;\n }\n // memory cache is cleared at the end of each request\n // so that revalidate events are pulled from upstream\n // on successive requests\n let data = memoryCache == null ? void 0 : memoryCache.get(key);\n const hasFetchKindAndMatchingTags = (data == null ? void 0 : (_data_value = data.value) == null ? void 0 : _data_value.kind) === \"FETCH\" && this.hasMatchingTags(tags ?? [], data.value.tags ?? []);\n // Get data from fetch cache. Also check if new tags have been\n // specified with the same cache key (fetch URL)\n if (this.cacheEndpoint && (!data || !hasFetchKindAndMatchingTags)) {\n try {\n const start = Date.now();\n const fetchParams = {\n internal: true,\n fetchType: \"cache-get\",\n fetchUrl: fetchUrl,\n fetchIdx\n };\n const res = await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${key}`, {\n method: \"GET\",\n headers: {\n ...this.headers,\n [CACHE_FETCH_URL_HEADER]: fetchUrl,\n [CACHE_TAGS_HEADER]: (tags == null ? void 0 : tags.join(\",\")) || \"\",\n [NEXT_CACHE_SOFT_TAGS_HEADER]: (softTags == null ? void 0 : softTags.join(\",\")) || \"\"\n },\n next: fetchParams\n });\n if (res.status === 429) {\n const retryAfter = res.headers.get(\"retry-after\") || \"60000\";\n rateLimitedUntil = Date.now() + parseInt(retryAfter);\n }\n if (res.status === 404) {\n if (DEBUG) {\n console.log(`no fetch cache entry for ${key}, duration: ${Date.now() - start}ms`);\n }\n return null;\n }\n if (!res.ok) {\n console.error(await res.text());\n throw new Error(`invalid response from cache ${res.status}`);\n }\n const cached = await res.json();\n if (!cached || cached.kind !== \"FETCH\") {\n DEBUG && console.log({\n cached\n });\n throw new Error(\"invalid cache value\");\n }\n // if new tags were specified, merge those tags to the existing tags\n if (cached.kind === \"FETCH\") {\n cached.tags ??= [];\n for (const tag of tags ?? []){\n if (!cached.tags.includes(tag)) {\n cached.tags.push(tag);\n }\n }\n }\n const cacheState = res.headers.get(CACHE_STATE_HEADER);\n const age = res.headers.get(\"age\");\n data = {\n value: cached,\n // if it's already stale set it to a time in the past\n // if not derive last modified from age\n lastModified: cacheState !== \"fresh\" ? Date.now() - CACHE_ONE_YEAR : Date.now() - parseInt(age || \"0\", 10) * 1000\n };\n if (DEBUG) {\n console.log(`got fetch cache entry for ${key}, duration: ${Date.now() - start}ms, size: ${Object.keys(cached).length}, cache-state: ${cacheState} tags: ${tags == null ? void 0 : tags.join(\",\")} softTags: ${softTags == null ? void 0 : softTags.join(\",\")}`);\n }\n if (data) {\n memoryCache == null ? void 0 : memoryCache.set(key, data);\n }\n } catch (err) {\n // unable to get data from fetch-cache\n if (DEBUG) {\n console.error(`Failed to get from fetch-cache`, err);\n }\n }\n }\n return data || null;\n }\n async set(...args) {\n const [key, data, ctx] = args;\n const { fetchCache, fetchIdx, fetchUrl, tags } = ctx;\n if (!fetchCache) return;\n if (Date.now() < rateLimitedUntil) {\n if (DEBUG) {\n console.log(\"rate limited\");\n }\n return;\n }\n memoryCache == null ? void 0 : memoryCache.set(key, {\n value: data,\n lastModified: Date.now()\n });\n if (this.cacheEndpoint) {\n try {\n const start = Date.now();\n if (data !== null && \"revalidate\" in data) {\n this.headers[CACHE_REVALIDATE_HEADER] = data.revalidate.toString();\n }\n if (!this.headers[CACHE_REVALIDATE_HEADER] && data !== null && \"data\" in data) {\n this.headers[CACHE_CONTROL_VALUE_HEADER] = data.data.headers[\"cache-control\"];\n }\n const body = JSON.stringify({\n ...data,\n // we send the tags in the header instead\n // of in the body here\n tags: undefined\n });\n if (DEBUG) {\n console.log(\"set cache\", key);\n }\n const fetchParams = {\n internal: true,\n fetchType: \"cache-set\",\n fetchUrl,\n fetchIdx\n };\n const res = await fetch(`${this.cacheEndpoint}/v1/suspense-cache/${key}`, {\n method: \"POST\",\n headers: {\n ...this.headers,\n [CACHE_FETCH_URL_HEADER]: fetchUrl || \"\",\n [CACHE_TAGS_HEADER]: (tags == null ? void 0 : tags.join(\",\")) || \"\"\n },\n body: body,\n next: fetchParams\n });\n if (res.status === 429) {\n const retryAfter = res.headers.get(\"retry-after\") || \"60000\";\n rateLimitedUntil = Date.now() + parseInt(retryAfter);\n }\n if (!res.ok) {\n DEBUG && console.log(await res.text());\n throw new Error(`invalid response ${res.status}`);\n }\n if (DEBUG) {\n console.log(`successfully set to fetch-cache for ${key}, duration: ${Date.now() - start}ms, size: ${body.length}`);\n }\n } catch (err) {\n // unable to set to fetch-cache\n if (DEBUG) {\n console.error(`Failed to update fetch cache`, err);\n }\n }\n }\n return;\n }\n}\n\n//# sourceMappingURL=fetch-cache.js.map","import LRUCache from \"next/dist/compiled/lru-cache\";\nimport path from \"../../../shared/lib/isomorphic/path\";\nimport { NEXT_CACHE_TAGS_HEADER, NEXT_DATA_SUFFIX, NEXT_META_SUFFIX, RSC_PREFETCH_SUFFIX, RSC_SUFFIX } from \"../../../lib/constants\";\nlet memoryCache;\nlet tagsManifest;\nexport default class FileSystemCache {\n constructor(ctx){\n this.fs = ctx.fs;\n this.flushToDisk = ctx.flushToDisk;\n this.serverDistDir = ctx.serverDistDir;\n this.appDir = !!ctx._appDir;\n this.pagesDir = !!ctx._pagesDir;\n this.revalidatedTags = ctx.revalidatedTags;\n this.experimental = ctx.experimental;\n this.debug = !!process.env.NEXT_PRIVATE_DEBUG_CACHE;\n if (ctx.maxMemoryCacheSize && !memoryCache) {\n if (this.debug) {\n console.log(\"using memory store for fetch cache\");\n }\n memoryCache = new LRUCache({\n max: ctx.maxMemoryCacheSize,\n length ({ value }) {\n var _JSON_stringify;\n if (!value) {\n return 25;\n } else if (value.kind === \"REDIRECT\") {\n return JSON.stringify(value.props).length;\n } else if (value.kind === \"IMAGE\") {\n throw new Error(\"invariant image should not be incremental-cache\");\n } else if (value.kind === \"FETCH\") {\n return JSON.stringify(value.data || \"\").length;\n } else if (value.kind === \"ROUTE\") {\n return value.body.length;\n }\n // rough estimate of size of cache value\n return value.html.length + (((_JSON_stringify = JSON.stringify(value.pageData)) == null ? void 0 : _JSON_stringify.length) || 0);\n }\n });\n } else if (this.debug) {\n console.log(\"not using memory store for fetch cache\");\n }\n if (this.serverDistDir && this.fs) {\n this.tagsManifestPath = path.join(this.serverDistDir, \"..\", \"cache\", \"fetch-cache\", \"tags-manifest.json\");\n this.loadTagsManifest();\n }\n }\n resetRequestCache() {}\n loadTagsManifest() {\n if (!this.tagsManifestPath || !this.fs || tagsManifest) return;\n try {\n tagsManifest = JSON.parse(this.fs.readFileSync(this.tagsManifestPath, \"utf8\"));\n } catch (err) {\n tagsManifest = {\n version: 1,\n items: {}\n };\n }\n if (this.debug) console.log(\"loadTagsManifest\", tagsManifest);\n }\n async revalidateTag(...args) {\n let [tags] = args;\n tags = typeof tags === \"string\" ? [\n tags\n ] : tags;\n if (this.debug) {\n console.log(\"revalidateTag\", tags);\n }\n if (tags.length === 0) {\n return;\n }\n // we need to ensure the tagsManifest is refreshed\n // since separate workers can be updating it at the same\n // time and we can't flush out of sync data\n await this.loadTagsManifest();\n if (!tagsManifest || !this.tagsManifestPath) {\n return;\n }\n for (const tag of tags){\n const data = tagsManifest.items[tag] || {};\n data.revalidatedAt = Date.now();\n tagsManifest.items[tag] = data;\n }\n try {\n await this.fs.mkdir(path.dirname(this.tagsManifestPath));\n await this.fs.writeFile(this.tagsManifestPath, JSON.stringify(tagsManifest || {}));\n if (this.debug) {\n console.log(\"Updated tags manifest\", tagsManifest);\n }\n } catch (err) {\n console.warn(\"Failed to update tags manifest.\", err);\n }\n }\n async get(...args) {\n var _data_value, _data_value1;\n const [key, ctx = {}] = args;\n const { tags, softTags, kindHint } = ctx;\n let data = memoryCache == null ? void 0 : memoryCache.get(key);\n if (this.debug) {\n console.log(\"get\", key, tags, kindHint, !!data);\n }\n // let's check the disk for seed data\n if (!data && process.env.NEXT_RUNTIME !== \"edge\") {\n try {\n const filePath = this.getFilePath(`${key}.body`, \"app\");\n const fileData = await this.fs.readFile(filePath);\n const { mtime } = await this.fs.stat(filePath);\n const meta = JSON.parse(await this.fs.readFile(filePath.replace(/\\.body$/, NEXT_META_SUFFIX), \"utf8\"));\n const cacheEntry = {\n lastModified: mtime.getTime(),\n value: {\n kind: \"ROUTE\",\n body: fileData,\n headers: meta.headers,\n status: meta.status\n }\n };\n return cacheEntry;\n } catch (_) {\n // no .meta data for the related key\n }\n try {\n // Determine the file kind if we didn't know it already.\n let kind = kindHint;\n if (!kind) {\n kind = this.detectFileKind(`${key}.html`);\n }\n const isAppPath = kind === \"app\";\n const filePath = this.getFilePath(kind === \"fetch\" ? key : `${key}.html`, kind);\n const fileData = await this.fs.readFile(filePath, \"utf8\");\n const { mtime } = await this.fs.stat(filePath);\n if (kind === \"fetch\" && this.flushToDisk) {\n var _data_value2;\n const lastModified = mtime.getTime();\n const parsedData = JSON.parse(fileData);\n data = {\n lastModified,\n value: parsedData\n };\n if (((_data_value2 = data.value) == null ? void 0 : _data_value2.kind) === \"FETCH\") {\n var _data_value3;\n const storedTags = (_data_value3 = data.value) == null ? void 0 : _data_value3.tags;\n // update stored tags if a new one is being added\n // TODO: remove this when we can send the tags\n // via header on GET same as SET\n if (!(tags == null ? void 0 : tags.every((tag)=>storedTags == null ? void 0 : storedTags.includes(tag)))) {\n if (this.debug) {\n console.log(\"tags vs storedTags mismatch\", tags, storedTags);\n }\n await this.set(key, data.value, {\n tags\n });\n }\n }\n } else {\n const pageData = isAppPath ? await this.fs.readFile(this.getFilePath(`${key}${this.experimental.ppr ? RSC_PREFETCH_SUFFIX : RSC_SUFFIX}`, \"app\"), \"utf8\") : JSON.parse(await this.fs.readFile(this.getFilePath(`${key}${NEXT_DATA_SUFFIX}`, \"pages\"), \"utf8\"));\n let meta;\n if (isAppPath) {\n try {\n meta = JSON.parse(await this.fs.readFile(filePath.replace(/\\.html$/, NEXT_META_SUFFIX), \"utf8\"));\n } catch {}\n }\n data = {\n lastModified: mtime.getTime(),\n value: {\n kind: \"PAGE\",\n html: fileData,\n pageData,\n postponed: meta == null ? void 0 : meta.postponed,\n headers: meta == null ? void 0 : meta.headers,\n status: meta == null ? void 0 : meta.status\n }\n };\n }\n if (data) {\n memoryCache == null ? void 0 : memoryCache.set(key, data);\n }\n } catch (_) {\n // unable to get data from disk\n }\n }\n if ((data == null ? void 0 : (_data_value = data.value) == null ? void 0 : _data_value.kind) === \"PAGE\") {\n var _data_value_headers;\n let cacheTags;\n const tagsHeader = (_data_value_headers = data.value.headers) == null ? void 0 : _data_value_headers[NEXT_CACHE_TAGS_HEADER];\n if (typeof tagsHeader === \"string\") {\n cacheTags = tagsHeader.split(\",\");\n }\n if (cacheTags == null ? void 0 : cacheTags.length) {\n this.loadTagsManifest();\n const isStale = cacheTags.some((tag)=>{\n var _tagsManifest_items_tag;\n return (tagsManifest == null ? void 0 : (_tagsManifest_items_tag = tagsManifest.items[tag]) == null ? void 0 : _tagsManifest_items_tag.revalidatedAt) && (tagsManifest == null ? void 0 : tagsManifest.items[tag].revalidatedAt) >= ((data == null ? void 0 : data.lastModified) || Date.now());\n });\n // we trigger a blocking validation if an ISR page\n // had a tag revalidated, if we want to be a background\n // revalidation instead we return data.lastModified = -1\n if (isStale) {\n data = undefined;\n }\n }\n }\n if (data && (data == null ? void 0 : (_data_value1 = data.value) == null ? void 0 : _data_value1.kind) === \"FETCH\") {\n this.loadTagsManifest();\n const combinedTags = [\n ...tags || [],\n ...softTags || []\n ];\n const wasRevalidated = combinedTags.some((tag)=>{\n var _tagsManifest_items_tag;\n if (this.revalidatedTags.includes(tag)) {\n return true;\n }\n return (tagsManifest == null ? void 0 : (_tagsManifest_items_tag = tagsManifest.items[tag]) == null ? void 0 : _tagsManifest_items_tag.revalidatedAt) && (tagsManifest == null ? void 0 : tagsManifest.items[tag].revalidatedAt) >= ((data == null ? void 0 : data.lastModified) || Date.now());\n });\n // When revalidate tag is called we don't return\n // stale data so it's updated right away\n if (wasRevalidated) {\n data = undefined;\n }\n }\n return data ?? null;\n }\n async set(...args) {\n const [key, data, ctx] = args;\n memoryCache == null ? void 0 : memoryCache.set(key, {\n value: data,\n lastModified: Date.now()\n });\n if (this.debug) {\n console.log(\"set\", key);\n }\n if (!this.flushToDisk) return;\n if ((data == null ? void 0 : data.kind) === \"ROUTE\") {\n const filePath = this.getFilePath(`${key}.body`, \"app\");\n await this.fs.mkdir(path.dirname(filePath));\n await this.fs.writeFile(filePath, data.body);\n const meta = {\n headers: data.headers,\n status: data.status,\n postponed: undefined\n };\n await this.fs.writeFile(filePath.replace(/\\.body$/, NEXT_META_SUFFIX), JSON.stringify(meta, null, 2));\n return;\n }\n if ((data == null ? void 0 : data.kind) === \"PAGE\") {\n const isAppPath = typeof data.pageData === \"string\";\n const htmlPath = this.getFilePath(`${key}.html`, isAppPath ? \"app\" : \"pages\");\n await this.fs.mkdir(path.dirname(htmlPath));\n await this.fs.writeFile(htmlPath, data.html);\n await this.fs.writeFile(this.getFilePath(`${key}${isAppPath ? this.experimental.ppr ? RSC_PREFETCH_SUFFIX : RSC_SUFFIX : NEXT_DATA_SUFFIX}`, isAppPath ? \"app\" : \"pages\"), isAppPath ? data.pageData : JSON.stringify(data.pageData));\n if (data.headers || data.status) {\n const meta = {\n headers: data.headers,\n status: data.status,\n postponed: data.postponed\n };\n await this.fs.writeFile(htmlPath.replace(/\\.html$/, NEXT_META_SUFFIX), JSON.stringify(meta));\n }\n } else if ((data == null ? void 0 : data.kind) === \"FETCH\") {\n const filePath = this.getFilePath(key, \"fetch\");\n await this.fs.mkdir(path.dirname(filePath));\n await this.fs.writeFile(filePath, JSON.stringify({\n ...data,\n tags: ctx.tags\n }));\n }\n }\n detectFileKind(pathname) {\n if (!this.appDir && !this.pagesDir) {\n throw new Error(\"Invariant: Can't determine file path kind, no page directory enabled\");\n }\n // If app directory isn't enabled, then assume it's pages and avoid the fs\n // hit.\n if (!this.appDir && this.pagesDir) {\n return \"pages\";\n } else if (this.appDir && !this.pagesDir) {\n return \"app\";\n }\n // If both are enabled, we need to test each in order, starting with\n // `pages`.\n let filePath = this.getFilePath(pathname, \"pages\");\n if (this.fs.existsSync(filePath)) {\n return \"pages\";\n }\n filePath = this.getFilePath(pathname, \"app\");\n if (this.fs.existsSync(filePath)) {\n return \"app\";\n }\n throw new Error(`Invariant: Unable to determine file path kind for ${pathname}`);\n }\n getFilePath(pathname, kind) {\n switch(kind){\n case \"fetch\":\n // we store in .next/cache/fetch-cache so it can be persisted\n // across deploys\n return path.join(this.serverDistDir, \"..\", \"cache\", \"fetch-cache\", pathname);\n case \"pages\":\n return path.join(this.serverDistDir, \"pages\", pathname);\n case \"app\":\n return path.join(this.serverDistDir, \"app\", pathname);\n default:\n throw new Error(\"Invariant: Can't determine file path kind\");\n }\n }\n}\n\n//# sourceMappingURL=file-system-cache.js.map","export var RedirectStatusCode;\n(function(RedirectStatusCode) {\n RedirectStatusCode[RedirectStatusCode[\"SeeOther\"] = 303] = \"SeeOther\";\n RedirectStatusCode[RedirectStatusCode[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n RedirectStatusCode[RedirectStatusCode[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n})(RedirectStatusCode || (RedirectStatusCode = {}));\n\n//# sourceMappingURL=redirect-status-code.js.map","// ISC License\n// Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n//\n// https://github.com/alexeyraspopov/picocolors/blob/b6261487e7b81aaab2440e397a356732cad9e342/picocolors.js#L1\nvar _globalThis;\nconst { env, stdout } = ((_globalThis = globalThis) == null ? void 0 : _globalThis.process) ?? {};\nconst enabled = env && !env.NO_COLOR && (env.FORCE_COLOR || (stdout == null ? void 0 : stdout.isTTY) && !env.CI && env.TERM !== \"dumb\");\nconst replaceClose = (str, close, replace, index)=>{\n const start = str.substring(0, index) + replace;\n const end = str.substring(index + close.length);\n const nextIndex = end.indexOf(close);\n return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;\n};\nconst formatter = (open, close, replace = open)=>{\n if (!enabled) return String;\n return (input)=>{\n const string = \"\" + input;\n const index = string.indexOf(close, open.length);\n return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;\n };\n};\nexport const reset = enabled ? (s)=>`\\x1b[0m${s}\\x1b[0m` : String;\nexport const bold = formatter(\"\\x1b[1m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[1m\");\nexport const dim = formatter(\"\\x1b[2m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[2m\");\nexport const italic = formatter(\"\\x1b[3m\", \"\\x1b[23m\");\nexport const underline = formatter(\"\\x1b[4m\", \"\\x1b[24m\");\nexport const inverse = formatter(\"\\x1b[7m\", \"\\x1b[27m\");\nexport const hidden = formatter(\"\\x1b[8m\", \"\\x1b[28m\");\nexport const strikethrough = formatter(\"\\x1b[9m\", \"\\x1b[29m\");\nexport const black = formatter(\"\\x1b[30m\", \"\\x1b[39m\");\nexport const red = formatter(\"\\x1b[31m\", \"\\x1b[39m\");\nexport const green = formatter(\"\\x1b[32m\", \"\\x1b[39m\");\nexport const yellow = formatter(\"\\x1b[33m\", \"\\x1b[39m\");\nexport const blue = formatter(\"\\x1b[34m\", \"\\x1b[39m\");\nexport const magenta = formatter(\"\\x1b[35m\", \"\\x1b[39m\");\nexport const purple = formatter(\"\\x1b[38;2;173;127;168m\", \"\\x1b[39m\");\nexport const cyan = formatter(\"\\x1b[36m\", \"\\x1b[39m\");\nexport const white = formatter(\"\\x1b[37m\", \"\\x1b[39m\");\nexport const gray = formatter(\"\\x1b[90m\", \"\\x1b[39m\");\nexport const bgBlack = formatter(\"\\x1b[40m\", \"\\x1b[49m\");\nexport const bgRed = formatter(\"\\x1b[41m\", \"\\x1b[49m\");\nexport const bgGreen = formatter(\"\\x1b[42m\", \"\\x1b[49m\");\nexport const bgYellow = formatter(\"\\x1b[43m\", \"\\x1b[49m\");\nexport const bgBlue = formatter(\"\\x1b[44m\", \"\\x1b[49m\");\nexport const bgMagenta = formatter(\"\\x1b[45m\", \"\\x1b[49m\");\nexport const bgCyan = formatter(\"\\x1b[46m\", \"\\x1b[49m\");\nexport const bgWhite = formatter(\"\\x1b[47m\", \"\\x1b[49m\");\n\n//# sourceMappingURL=picocolors.js.map","export var PAGE_TYPES;\n(function(PAGE_TYPES) {\n PAGE_TYPES[\"PAGES\"] = \"pages\";\n PAGE_TYPES[\"ROOT\"] = \"root\";\n PAGE_TYPES[\"APP\"] = \"app\";\n})(PAGE_TYPES || (PAGE_TYPES = {}));\n\n//# sourceMappingURL=page-types.js.map","export var RouteKind;\n(function(RouteKind) {\n /**\n * `PAGES` represents all the React pages that are under `pages/`.\n */ RouteKind[\"PAGES\"] = \"PAGES\";\n /**\n * `PAGES_API` represents all the API routes under `pages/api/`.\n */ RouteKind[\"PAGES_API\"] = \"PAGES_API\";\n /**\n * `APP_PAGE` represents all the React pages that are under `app/` with the\n * filename of `page.{j,t}s{,x}`.\n */ RouteKind[\"APP_PAGE\"] = \"APP_PAGE\";\n /**\n * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the\n * filename of `route.{j,t}s{,x}`.\n */ RouteKind[\"APP_ROUTE\"] = \"APP_ROUTE\";\n})(RouteKind || (RouteKind = {}));\n\n//# sourceMappingURL=route-kind.js.map","// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n// This module will only be loaded once per process.\nconst path = require(\"path\");\nconst mod = require(\"module\");\nconst originalRequire = mod.prototype.require;\nconst resolveFilename = mod._resolveFilename;\nlet resolve = process.env.NEXT_MINIMAL ? __non_webpack_require__.resolve : require.resolve;\nexport const hookPropertyMap = new Map();\nexport const defaultOverrides = {\n \"styled-jsx\": path.dirname(resolve(\"styled-jsx/package.json\")),\n \"styled-jsx/style\": resolve(\"styled-jsx/style\"),\n \"styled-jsx/style.js\": resolve(\"styled-jsx/style\")\n};\nconst toResolveMap = (map)=>Object.entries(map).map(([key, value])=>[\n key,\n resolve(value)\n ]);\nexport function addHookAliases(aliases = []) {\n for (const [key, value] of aliases){\n hookPropertyMap.set(key, value);\n }\n}\naddHookAliases(toResolveMap(defaultOverrides));\nmod._resolveFilename = (function(originalResolveFilename, requestMap, request, parent, isMain, options) {\n const hookResolved = requestMap.get(request);\n if (hookResolved) request = hookResolved;\n return originalResolveFilename.call(mod, request, parent, isMain, options);\n// We use `bind` here to avoid referencing outside variables to create potential memory leaks.\n}).bind(null, resolveFilename, hookPropertyMap);\n// This is a hack to make sure that if a user requires a Next.js module that wasn't bundled\n// that needs to point to the rendering runtime version, it will point to the correct one.\n// This can happen on `pages` when a user requires a dependency that uses next/image for example.\nmod.prototype.require = function(request) {\n if (request.endsWith(\".shared-runtime\")) {\n return originalRequire.call(this, `next/dist/server/future/route-modules/pages/vendored/contexts/${path.basename(request, \".shared-runtime\")}`);\n }\n return originalRequire.call(this, request);\n};\n\n//# sourceMappingURL=require-hook.js.map","import { DecodeError } from \"../../utils\";\nexport function getRouteMatcher(param) {\n let { re, groups } = param;\n return (pathname)=>{\n const routeMatch = re.exec(pathname);\n if (!routeMatch) {\n return false;\n }\n const decode = (param)=>{\n try {\n return decodeURIComponent(param);\n } catch (_) {\n throw new DecodeError(\"failed to decode param\");\n }\n };\n const params = {};\n Object.keys(groups).forEach((slugName)=>{\n const g = groups[slugName];\n const m = routeMatch[g.pos];\n if (m !== undefined) {\n params[slugName] = ~m.indexOf(\"/\") ? m.split(\"/\").map((entry)=>decode(entry)) : g.repeat ? [\n decode(m)\n ] : decode(m);\n }\n });\n return params;\n };\n}\n\n//# sourceMappingURL=route-matcher.js.map","/* eslint-disable no-redeclare */ // FIXME: (wyattjoh) this is a temporary solution to allow us to pass data between bundled modules\nexport const NEXT_REQUEST_META = Symbol.for(\"NextInternalRequestMeta\");\nexport function getRequestMeta(req, key) {\n const meta = req[NEXT_REQUEST_META] || {};\n return typeof key === \"string\" ? meta[key] : meta;\n}\n/**\n * Sets the request metadata.\n *\n * @param req the request to set the metadata on\n * @param meta the metadata to set\n * @returns the mutated request metadata\n */ export function setRequestMeta(req, meta) {\n req[NEXT_REQUEST_META] = meta;\n return meta;\n}\n/**\n * Adds a value to the request metadata.\n *\n * @param request the request to mutate\n * @param key the key to set\n * @param value the value to set\n * @returns the mutated request metadata\n */ export function addRequestMeta(request, key, value) {\n const meta = getRequestMeta(request);\n meta[key] = value;\n return setRequestMeta(request, meta);\n}\n/**\n * Removes a key from the request metadata.\n *\n * @param request the request to mutate\n * @param key the key to remove\n * @returns the mutated request metadata\n */ export function removeRequestMeta(request, key) {\n const meta = getRequestMeta(request);\n delete meta[key];\n return setRequestMeta(request, meta);\n}\nexport function getNextInternalQuery(query) {\n const keysToInclude = [\n \"__nextDefaultLocale\",\n \"__nextFallback\",\n \"__nextLocale\",\n \"__nextSsgPath\",\n \"_nextBubbleNoFallback\",\n \"__nextDataReq\",\n \"__nextInferredLocaleFromDefault\"\n ];\n const nextInternalQuery = {};\n for (const key of keysToInclude){\n if (key in query) {\n // @ts-ignore this can't be typed correctly\n nextInternalQuery[key] = query[key];\n }\n }\n return nextInternalQuery;\n}\n\n//# sourceMappingURL=request-meta.js.map","import MODERN_BROWSERSLIST_TARGET from \"./modern-browserslist-target\";\nexport { MODERN_BROWSERSLIST_TARGET };\nexport const COMPILER_NAMES = {\n client: \"client\",\n server: \"server\",\n edgeServer: \"edge-server\"\n};\nexport const COMPILER_INDEXES = {\n [COMPILER_NAMES.client]: 0,\n [COMPILER_NAMES.server]: 1,\n [COMPILER_NAMES.edgeServer]: 2\n};\nexport const UNDERSCORE_NOT_FOUND_ROUTE = \"/_not-found\";\nexport const UNDERSCORE_NOT_FOUND_ROUTE_ENTRY = \"\" + UNDERSCORE_NOT_FOUND_ROUTE + \"/page\";\nexport const PHASE_EXPORT = \"phase-export\";\nexport const PHASE_PRODUCTION_BUILD = \"phase-production-build\";\nexport const PHASE_PRODUCTION_SERVER = \"phase-production-server\";\nexport const PHASE_DEVELOPMENT_SERVER = \"phase-development-server\";\nexport const PHASE_TEST = \"phase-test\";\nexport const PHASE_INFO = \"phase-info\";\nexport const PAGES_MANIFEST = \"pages-manifest.json\";\nexport const APP_PATHS_MANIFEST = \"app-paths-manifest.json\";\nexport const APP_PATH_ROUTES_MANIFEST = \"app-path-routes-manifest.json\";\nexport const BUILD_MANIFEST = \"build-manifest.json\";\nexport const APP_BUILD_MANIFEST = \"app-build-manifest.json\";\nexport const FUNCTIONS_CONFIG_MANIFEST = \"functions-config-manifest.json\";\nexport const SUBRESOURCE_INTEGRITY_MANIFEST = \"subresource-integrity-manifest\";\nexport const NEXT_FONT_MANIFEST = \"next-font-manifest\";\nexport const EXPORT_MARKER = \"export-marker.json\";\nexport const EXPORT_DETAIL = \"export-detail.json\";\nexport const PRERENDER_MANIFEST = \"prerender-manifest.json\";\nexport const ROUTES_MANIFEST = \"routes-manifest.json\";\nexport const IMAGES_MANIFEST = \"images-manifest.json\";\nexport const SERVER_FILES_MANIFEST = \"required-server-files.json\";\nexport const DEV_CLIENT_PAGES_MANIFEST = \"_devPagesManifest.json\";\nexport const MIDDLEWARE_MANIFEST = \"middleware-manifest.json\";\nexport const DEV_MIDDLEWARE_MANIFEST = \"_devMiddlewareManifest.json\";\nexport const REACT_LOADABLE_MANIFEST = \"react-loadable-manifest.json\";\nexport const AUTOMATIC_FONT_OPTIMIZATION_MANIFEST = \"font-manifest.json\";\nexport const SERVER_DIRECTORY = \"server\";\nexport const CONFIG_FILES = [\n \"next.config.js\",\n \"next.config.mjs\"\n];\nexport const BUILD_ID_FILE = \"BUILD_ID\";\nexport const BLOCKED_PAGES = [\n \"/_document\",\n \"/_app\",\n \"/_error\"\n];\nexport const CLIENT_PUBLIC_FILES_PATH = \"public\";\nexport const CLIENT_STATIC_FILES_PATH = \"static\";\nexport const STRING_LITERAL_DROP_BUNDLE = \"__NEXT_DROP_CLIENT_FILE__\";\nexport const NEXT_BUILTIN_DOCUMENT = \"__NEXT_BUILTIN_DOCUMENT__\";\nexport const BARREL_OPTIMIZATION_PREFIX = \"__barrel_optimize__\";\n// server/[entry]/page_client-reference-manifest.js\nexport const CLIENT_REFERENCE_MANIFEST = \"client-reference-manifest\";\n// server/server-reference-manifest\nexport const SERVER_REFERENCE_MANIFEST = \"server-reference-manifest\";\n// server/middleware-build-manifest.js\nexport const MIDDLEWARE_BUILD_MANIFEST = \"middleware-build-manifest\";\n// server/middleware-react-loadable-manifest.js\nexport const MIDDLEWARE_REACT_LOADABLE_MANIFEST = \"middleware-react-loadable-manifest\";\n// server/interception-route-rewrite-manifest.js\nexport const INTERCEPTION_ROUTE_REWRITE_MANIFEST = \"interception-route-rewrite-manifest\";\n// static/runtime/main.js\nexport const CLIENT_STATIC_FILES_RUNTIME_MAIN = \"main\";\nexport const CLIENT_STATIC_FILES_RUNTIME_MAIN_APP = \"\" + CLIENT_STATIC_FILES_RUNTIME_MAIN + \"-app\";\n// next internal client components chunk for layouts\nexport const APP_CLIENT_INTERNALS = \"app-pages-internals\";\n// static/runtime/react-refresh.js\nexport const CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH = \"react-refresh\";\n// static/runtime/amp.js\nexport const CLIENT_STATIC_FILES_RUNTIME_AMP = \"amp\";\n// static/runtime/webpack.js\nexport const CLIENT_STATIC_FILES_RUNTIME_WEBPACK = \"webpack\";\n// static/runtime/polyfills.js\nexport const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS = \"polyfills\";\nexport const CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL = Symbol(CLIENT_STATIC_FILES_RUNTIME_POLYFILLS);\nexport const DEFAULT_RUNTIME_WEBPACK = \"webpack-runtime\";\nexport const EDGE_RUNTIME_WEBPACK = \"edge-runtime-webpack\";\nexport const STATIC_PROPS_ID = \"__N_SSG\";\nexport const SERVER_PROPS_ID = \"__N_SSP\";\nexport const GOOGLE_FONT_PROVIDER = \"https://fonts.googleapis.com/\";\nexport const OPTIMIZED_FONT_PROVIDERS = [\n {\n url: GOOGLE_FONT_PROVIDER,\n preconnect: \"https://fonts.gstatic.com\"\n },\n {\n url: \"https://use.typekit.net\",\n preconnect: \"https://use.typekit.net\"\n }\n];\nexport const DEFAULT_SERIF_FONT = {\n name: \"Times New Roman\",\n xAvgCharWidth: 821,\n azAvgWidth: 854.3953488372093,\n unitsPerEm: 2048\n};\nexport const DEFAULT_SANS_SERIF_FONT = {\n name: \"Arial\",\n xAvgCharWidth: 904,\n azAvgWidth: 934.5116279069767,\n unitsPerEm: 2048\n};\nexport const STATIC_STATUS_PAGES = [\n \"/500\"\n];\nexport const TRACE_OUTPUT_VERSION = 1;\n// in `MB`\nexport const TURBO_TRACE_DEFAULT_MEMORY_LIMIT = 6000;\nexport const RSC_MODULE_TYPES = {\n client: \"client\",\n server: \"server\"\n};\n// comparing\n// https://nextjs.org/docs/api-reference/edge-runtime\n// with\n// https://nodejs.org/docs/latest/api/globals.html\nexport const EDGE_UNSUPPORTED_NODE_APIS = [\n \"clearImmediate\",\n \"setImmediate\",\n \"BroadcastChannel\",\n \"ByteLengthQueuingStrategy\",\n \"CompressionStream\",\n \"CountQueuingStrategy\",\n \"DecompressionStream\",\n \"DomException\",\n \"MessageChannel\",\n \"MessageEvent\",\n \"MessagePort\",\n \"ReadableByteStreamController\",\n \"ReadableStreamBYOBRequest\",\n \"ReadableStreamDefaultController\",\n \"TransformStreamDefaultController\",\n \"WritableStreamDefaultController\"\n];\nexport const SYSTEM_ENTRYPOINTS = new Set([\n CLIENT_STATIC_FILES_RUNTIME_MAIN,\n CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,\n CLIENT_STATIC_FILES_RUNTIME_AMP,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP\n]);\n\n//# sourceMappingURL=constants.js.map","import fs from \"fs\";\nimport path from \"path\";\nexport function findDir(dir, name) {\n // prioritize ./${name} over ./src/${name}\n let curDir = path.join(dir, name);\n if (fs.existsSync(curDir)) return curDir;\n curDir = path.join(dir, \"src\", name);\n if (fs.existsSync(curDir)) return curDir;\n return null;\n}\nexport function findPagesDir(dir) {\n const pagesDir = findDir(dir, \"pages\") || undefined;\n const appDir = findDir(dir, \"app\") || undefined;\n if (appDir == null && pagesDir == null) {\n throw new Error(\"> Couldn't find any `pages` or `app` directory. Please create one under the project root\");\n }\n return {\n pagesDir,\n appDir\n };\n}\n\n//# sourceMappingURL=find-pages-dir.js.map","/**\n * Parse cookies from the `headers` of request\n * @param req request object\n */ export function getCookieParser(headers) {\n return function parseCookie() {\n const { cookie } = headers;\n if (!cookie) {\n return {};\n }\n const { parse: parseCookieFn } = require(\"next/dist/compiled/cookie\");\n return parseCookieFn(Array.isArray(cookie) ? cookie.join(\"; \") : cookie);\n };\n}\n\n//# sourceMappingURL=get-cookie-parser.js.map","import { RedirectStatusCode } from \"../../client/components/redirect-status-code\";\nimport { getCookieParser } from \"../api-utils/get-cookie-parser\";\nexport class BaseNextRequest {\n constructor(method, url, body){\n this.method = method;\n this.url = url;\n this.body = body;\n }\n // Utils implemented using the abstract methods above\n get cookies() {\n if (this._cookies) return this._cookies;\n return this._cookies = getCookieParser(this.headers)();\n }\n}\nexport class BaseNextResponse {\n constructor(destination){\n this.destination = destination;\n }\n // Utils implemented using the abstract methods above\n redirect(destination, statusCode) {\n this.setHeader(\"Location\", destination);\n this.statusCode = statusCode;\n // Since IE11 doesn't support the 308 header add backwards\n // compatibility using refresh header\n if (statusCode === RedirectStatusCode.PermanentRedirect) {\n this.setHeader(\"Refresh\", `0;url=${destination}`);\n }\n return this;\n }\n}\n\n//# sourceMappingURL=index.js.map","import { SYMBOL_CLEARED_COOKIES } from \"../api-utils\";\nimport { NEXT_REQUEST_META } from \"../request-meta\";\nimport { BaseNextRequest, BaseNextResponse } from \"./index\";\nlet _NEXT_REQUEST_META = NEXT_REQUEST_META;\nexport class NodeNextRequest extends BaseNextRequest {\n get originalRequest() {\n // Need to mimic these changes to the original req object for places where we use it:\n // render.tsx, api/ssg requests\n this._req[NEXT_REQUEST_META] = this[NEXT_REQUEST_META];\n this._req.url = this.url;\n this._req.cookies = this.cookies;\n return this._req;\n }\n set originalRequest(value) {\n this._req = value;\n }\n constructor(_req){\n var _this__req;\n super(_req.method.toUpperCase(), _req.url, _req);\n this._req = _req;\n this.headers = this._req.headers;\n this.fetchMetrics = (_this__req = this._req) == null ? void 0 : _this__req.fetchMetrics;\n this[_NEXT_REQUEST_META] = this._req[NEXT_REQUEST_META] || {};\n }\n}\nexport class NodeNextResponse extends BaseNextResponse {\n get originalResponse() {\n if (SYMBOL_CLEARED_COOKIES in this) {\n this._res[SYMBOL_CLEARED_COOKIES] = this[SYMBOL_CLEARED_COOKIES];\n }\n return this._res;\n }\n constructor(_res){\n super(_res);\n this._res = _res;\n this.textBody = undefined;\n }\n get sent() {\n return this._res.finished || this._res.headersSent;\n }\n get statusCode() {\n return this._res.statusCode;\n }\n set statusCode(value) {\n this._res.statusCode = value;\n }\n get statusMessage() {\n return this._res.statusMessage;\n }\n set statusMessage(value) {\n this._res.statusMessage = value;\n }\n setHeader(name, value) {\n this._res.setHeader(name, value);\n return this;\n }\n removeHeader(name) {\n this._res.removeHeader(name);\n return this;\n }\n getHeaderValues(name) {\n const values = this._res.getHeader(name);\n if (values === undefined) return undefined;\n return (Array.isArray(values) ? values : [\n values\n ]).map((value)=>value.toString());\n }\n hasHeader(name) {\n return this._res.hasHeader(name);\n }\n getHeader(name) {\n const values = this.getHeaderValues(name);\n return Array.isArray(values) ? values.join(\",\") : undefined;\n }\n getHeaders() {\n return this._res.getHeaders();\n }\n appendHeader(name, value) {\n const currentValues = this.getHeaderValues(name) ?? [];\n if (!currentValues.includes(value)) {\n this._res.setHeader(name, [\n ...currentValues,\n value\n ]);\n }\n return this;\n }\n body(value) {\n this.textBody = value;\n return this;\n }\n send() {\n this._res.end(this.textBody);\n }\n}\n\n//# sourceMappingURL=node.js.map","/**\n * FNV-1a Hash implementation\n * @author Travis Webb (tjwebb) <me@traviswebb.com>\n *\n * Ported from https://github.com/tjwebb/fnv-plus/blob/master/index.js\n *\n * Simplified, optimized and add modified for 52 bit, which provides a larger hash space\n * and still making use of Javascript's 53-bit integer space.\n */ export const fnv1a52 = (str)=>{\n const len = str.length;\n let i = 0, t0 = 0, v0 = 0x2325, t1 = 0, v1 = 0x8422, t2 = 0, v2 = 0x9ce4, t3 = 0, v3 = 0xcbf2;\n while(i < len){\n v0 ^= str.charCodeAt(i++);\n t0 = v0 * 435;\n t1 = v1 * 435;\n t2 = v2 * 435;\n t3 = v3 * 435;\n t2 += v0 << 8;\n t3 += v1 << 8;\n t1 += t0 >>> 16;\n v0 = t0 & 65535;\n t2 += t1 >>> 16;\n v1 = t1 & 65535;\n v3 = t3 + (t2 >>> 16) & 65535;\n v2 = t2 & 65535;\n }\n return (v3 & 15) * 281474976710656 + v2 * 4294967296 + v1 * 65536 + (v0 ^ v3 >> 4);\n};\nexport const generateETag = (payload, weak = false)=>{\n const prefix = weak ? 'W/\"' : '\"';\n return prefix + fnv1a52(payload).toString(36) + payload.length.toString(36) + '\"';\n};\n\n//# sourceMappingURL=etag.js.map","import { CACHE_ONE_YEAR } from \"../../lib/constants\";\nexport function formatRevalidate({ revalidate, swrDelta }) {\n const swrHeader = swrDelta ? `stale-while-revalidate=${swrDelta}` : \"stale-while-revalidate\";\n if (revalidate === 0) {\n return \"private, no-cache, no-store, max-age=0, must-revalidate\";\n } else if (typeof revalidate === \"number\") {\n return `s-maxage=${revalidate}, ${swrHeader}`;\n }\n return `s-maxage=${CACHE_ONE_YEAR}, ${swrHeader}`;\n}\n\n//# sourceMappingURL=revalidate.js.map","export const RSC_HEADER = \"RSC\";\nexport const ACTION = \"Next-Action\";\nexport const NEXT_ROUTER_STATE_TREE = \"Next-Router-State-Tree\";\nexport const NEXT_ROUTER_PREFETCH_HEADER = \"Next-Router-Prefetch\";\nexport const NEXT_URL = \"Next-Url\";\nexport const RSC_CONTENT_TYPE_HEADER = \"text/x-component\";\nexport const FLIGHT_PARAMETERS = [\n [\n RSC_HEADER\n ],\n [\n NEXT_ROUTER_STATE_TREE\n ],\n [\n NEXT_ROUTER_PREFETCH_HEADER\n ]\n];\nexport const NEXT_RSC_UNION_QUERY = \"_rsc\";\nexport const NEXT_DID_POSTPONE_HEADER = \"x-nextjs-postponed\";\n\n//# sourceMappingURL=app-router-headers.js.map","import { isResSent } from \"../shared/lib/utils\";\nimport { generateETag } from \"./lib/etag\";\nimport fresh from \"next/dist/compiled/fresh\";\nimport { formatRevalidate } from \"./lib/revalidate\";\nimport { RSC_CONTENT_TYPE_HEADER } from \"../client/components/app-router-headers\";\nexport function sendEtagResponse(req, res, etag) {\n if (etag) {\n /**\n * The server generating a 304 response MUST generate any of the\n * following header fields that would have been sent in a 200 (OK)\n * response to the same request: Cache-Control, Content-Location, Date,\n * ETag, Expires, and Vary. https://tools.ietf.org/html/rfc7232#section-4.1\n */ res.setHeader(\"ETag\", etag);\n }\n if (fresh(req.headers, {\n etag\n })) {\n res.statusCode = 304;\n res.end();\n return true;\n }\n return false;\n}\nexport async function sendRenderResult({ req, res, result, type, generateEtags, poweredByHeader, revalidate, swrDelta }) {\n if (isResSent(res)) {\n return;\n }\n if (poweredByHeader && type === \"html\") {\n res.setHeader(\"X-Powered-By\", \"Next.js\");\n }\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (typeof revalidate !== \"undefined\" && !res.getHeader(\"Cache-Control\")) {\n res.setHeader(\"Cache-Control\", formatRevalidate({\n revalidate,\n swrDelta\n }));\n }\n const payload = result.isDynamic ? null : result.toUnchunkedString();\n if (payload !== null) {\n let etagPayload = payload;\n if (type === \"rsc\") {\n // ensure etag generation is deterministic as\n // ordering can differ even if underlying content\n // does not differ\n etagPayload = payload.split(\"\\n\").sort().join(\"\\n\");\n } else if (type === \"html\" && payload.includes(\"__next_f\")) {\n const { parse } = require(\"next/dist/compiled/node-html-parser\");\n try {\n var _root_querySelector;\n // Parse the HTML\n let root = parse(payload);\n // Get script tags in the body element\n let scriptTags = (_root_querySelector = root.querySelector(\"body\")) == null ? void 0 : _root_querySelector.querySelectorAll(\"script\").filter((node)=>{\n var _node_innerHTML;\n return !node.hasAttribute(\"src\") && ((_node_innerHTML = node.innerHTML) == null ? void 0 : _node_innerHTML.includes(\"__next_f\"));\n });\n // Sort the script tags by their inner text\n scriptTags == null ? void 0 : scriptTags.sort((a, b)=>a.innerHTML.localeCompare(b.innerHTML));\n // Remove the original script tags\n scriptTags == null ? void 0 : scriptTags.forEach((script)=>script.remove());\n // Append the sorted script tags to the body\n scriptTags == null ? void 0 : scriptTags.forEach((script)=>{\n var _root_querySelector;\n return (_root_querySelector = root.querySelector(\"body\")) == null ? void 0 : _root_querySelector.appendChild(script);\n });\n // Stringify back to HTML\n etagPayload = root.toString();\n } catch (err) {\n console.error(`Error parsing HTML payload`, err);\n }\n }\n const etag = generateEtags ? generateETag(etagPayload) : undefined;\n if (sendEtagResponse(req, res, etag)) {\n return;\n }\n }\n if (!res.getHeader(\"Content-Type\")) {\n res.setHeader(\"Content-Type\", result.contentType ? result.contentType : type === \"rsc\" ? RSC_CONTENT_TYPE_HEADER : type === \"json\" ? \"application/json\" : \"text/html; charset=utf-8\");\n }\n if (payload) {\n res.setHeader(\"Content-Length\", Buffer.byteLength(payload));\n }\n if (req.method === \"HEAD\") {\n res.end(null);\n return;\n }\n if (payload !== null) {\n res.end(payload);\n return;\n }\n // Pipe the render result to the response after we get a writer for it.\n await result.pipeToNodeResponse(res);\n}\n\n//# sourceMappingURL=send-payload.js.map","export function searchParamsToUrlQuery(searchParams) {\n const query = {};\n searchParams.forEach((value, key)=>{\n if (typeof query[key] === \"undefined\") {\n query[key] = value;\n } else if (Array.isArray(query[key])) {\n query[key].push(value);\n } else {\n query[key] = [\n query[key],\n value\n ];\n }\n });\n return query;\n}\nfunction stringifyUrlQueryParam(param) {\n if (typeof param === \"string\" || typeof param === \"number\" && !isNaN(param) || typeof param === \"boolean\") {\n return String(param);\n } else {\n return \"\";\n }\n}\nexport function urlQueryToSearchParams(urlQuery) {\n const result = new URLSearchParams();\n Object.entries(urlQuery).forEach((param)=>{\n let [key, value] = param;\n if (Array.isArray(value)) {\n value.forEach((item)=>result.append(key, stringifyUrlQueryParam(item)));\n } else {\n result.set(key, stringifyUrlQueryParam(value));\n }\n });\n return result;\n}\nexport function assign(target) {\n for(var _len = arguments.length, searchParamsList = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){\n searchParamsList[_key - 1] = arguments[_key];\n }\n searchParamsList.forEach((searchParams)=>{\n Array.from(searchParams.keys()).forEach((key)=>target.delete(key));\n searchParams.forEach((value, key)=>target.append(key, value));\n });\n return target;\n}\n\n//# sourceMappingURL=querystring.js.map","import { searchParamsToUrlQuery } from \"./querystring\";\nimport { parseRelativeUrl } from \"./parse-relative-url\";\nexport function parseUrl(url) {\n if (url.startsWith(\"/\")) {\n return parseRelativeUrl(url);\n }\n const parsedURL = new URL(url);\n return {\n hash: parsedURL.hash,\n hostname: parsedURL.hostname,\n href: parsedURL.href,\n pathname: parsedURL.pathname,\n port: parsedURL.port,\n protocol: parsedURL.protocol,\n query: searchParamsToUrlQuery(parsedURL.searchParams),\n search: parsedURL.search\n };\n}\n\n//# sourceMappingURL=parse-url.js.map","import { getLocationOrigin } from \"../../utils\";\nimport { searchParamsToUrlQuery } from \"./querystring\";\n/**\n * Parses path-relative urls (e.g. `/hello/world?foo=bar`). If url isn't path-relative\n * (e.g. `./hello`) then at least base must be.\n * Absolute urls are rejected with one exception, in the browser, absolute urls that are on\n * the current origin will be parsed as relative\n */ export function parseRelativeUrl(url, base) {\n const globalBase = new URL(typeof window === \"undefined\" ? \"http://n\" : getLocationOrigin());\n const resolvedBase = base ? new URL(base, globalBase) : url.startsWith(\".\") ? new URL(typeof window === \"undefined\" ? \"http://n\" : window.location.href) : globalBase;\n const { pathname, searchParams, search, hash, href, origin } = new URL(url, resolvedBase);\n if (origin !== globalBase.origin) {\n throw new Error(\"invariant: invalid relative URL, router received \" + url);\n }\n return {\n pathname,\n query: searchParamsToUrlQuery(searchParams),\n search,\n hash,\n href: href.slice(globalBase.origin.length)\n };\n}\n\n//# sourceMappingURL=parse-relative-url.js.map","import { bold, green, magenta, red, yellow, white } from \"../../lib/picocolors\";\nexport const prefixes = {\n wait: white(bold(\"○\")),\n error: red(bold(\"⨯\")),\n warn: yellow(bold(\"⚠\")),\n ready: \"▲\",\n info: white(bold(\" \")),\n event: green(bold(\"✓\")),\n trace: magenta(bold(\"\\xbb\"))\n};\nconst LOGGING_METHOD = {\n log: \"log\",\n warn: \"warn\",\n error: \"error\"\n};\nfunction prefixedLog(prefixType, ...message) {\n if ((message[0] === \"\" || message[0] === undefined) && message.length === 1) {\n message.shift();\n }\n const consoleMethod = prefixType in LOGGING_METHOD ? LOGGING_METHOD[prefixType] : \"log\";\n const prefix = prefixes[prefixType];\n // If there's no message, don't print the prefix but a new line\n if (message.length === 0) {\n console[consoleMethod](\"\");\n } else {\n console[consoleMethod](\" \" + prefix, ...message);\n }\n}\nexport function bootstrap(...message) {\n console.log(\" \", ...message);\n}\nexport function wait(...message) {\n prefixedLog(\"wait\", ...message);\n}\nexport function error(...message) {\n prefixedLog(\"error\", ...message);\n}\nexport function warn(...message) {\n prefixedLog(\"warn\", ...message);\n}\nexport function ready(...message) {\n prefixedLog(\"ready\", ...message);\n}\nexport function info(...message) {\n prefixedLog(\"info\", ...message);\n}\nexport function event(...message) {\n prefixedLog(\"event\", ...message);\n}\nexport function trace(...message) {\n prefixedLog(\"trace\", ...message);\n}\nconst warnOnceMessages = new Set();\nexport function warnOnce(...message) {\n if (!warnOnceMessages.has(message[0])) {\n warnOnceMessages.add(message.join(\" \"));\n warn(...message);\n }\n}\n\n//# sourceMappingURL=log.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"url\");","// Regex from `node/lib/internal/net.js`: https://github.com/nodejs/node/blob/9fc57006c27564ed7f75eee090eca86786508f51/lib/internal/net.js#L19-L29\n// License included below:\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nconst v4Seg = \"(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\";\nconst v4Str = `(${v4Seg}[.]){3}${v4Seg}`;\nconst v6Seg = \"(?:[0-9a-fA-F]{1,4})\";\nconst IPv6Reg = new RegExp(\"^(\" + `(?:${v6Seg}:){7}(?:${v6Seg}|:)|` + `(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` + `(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|` + `(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|` + `(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|` + `(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` + `(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` + `(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` + \")(%[0-9a-zA-Z-.:]{1,})?$\");\nexport function isIPv6(s) {\n return IPv6Reg.test(s);\n}\n\n//# sourceMappingURL=is-ipv6.js.map","/**\n * For a given page path, this function ensures that there is a leading slash.\n * If there is not a leading slash, one is added, otherwise it is noop.\n */ export function ensureLeadingSlash(path) {\n return path.startsWith(\"/\") ? path : \"/\" + path;\n}\n\n//# sourceMappingURL=ensure-leading-slash.js.map","import { ensureLeadingSlash } from \"../../page-path/ensure-leading-slash\";\nimport { isGroupSegment } from \"../../segment\";\n/**\n * Normalizes an app route so it represents the actual request path. Essentially\n * performing the following transformations:\n *\n * - `/(dashboard)/user/[id]/page` to `/user/[id]`\n * - `/(dashboard)/account/page` to `/account`\n * - `/user/[id]/page` to `/user/[id]`\n * - `/account/page` to `/account`\n * - `/page` to `/`\n * - `/(dashboard)/user/[id]/route` to `/user/[id]`\n * - `/(dashboard)/account/route` to `/account`\n * - `/user/[id]/route` to `/user/[id]`\n * - `/account/route` to `/account`\n * - `/route` to `/`\n * - `/` to `/`\n *\n * @param route the app route to normalize\n * @returns the normalized pathname\n */ export function normalizeAppPath(route) {\n return ensureLeadingSlash(route.split(\"/\").reduce((pathname, segment, index, segments)=>{\n // Empty segments are ignored.\n if (!segment) {\n return pathname;\n }\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname;\n }\n // Parallel segments are ignored.\n if (segment[0] === \"@\") {\n return pathname;\n }\n // The last segment (if it's a leaf) should be ignored.\n if ((segment === \"page\" || segment === \"route\") && index === segments.length - 1) {\n return pathname;\n }\n return pathname + \"/\" + segment;\n }, \"\"));\n}\n/**\n * Strips the `.rsc` extension if it's in the pathname.\n * Since this function is used on full urls it checks `?` for searchParams handling.\n */ export function normalizeRscURL(url) {\n return url.replace(/\\.rsc($|\\?)/, // $1 ensures `?` is preserved\n \"$1\");\n}\n\n//# sourceMappingURL=app-paths.js.map","export function isGroupSegment(segment) {\n // Use array[0] for performant purpose\n return segment[0] === \"(\" && segment.endsWith(\")\");\n}\nexport const PAGE_SEGMENT_KEY = \"__PAGE__\";\nexport const DEFAULT_SEGMENT_KEY = \"__DEFAULT__\";\n\n//# sourceMappingURL=segment.js.map","import { normalizeAppPath } from \"../../../shared/lib/router/utils/app-paths\";\n// order matters here, the first match will be used\nexport const INTERCEPTION_ROUTE_MARKERS = [\n \"(..)(..)\",\n \"(.)\",\n \"(..)\",\n \"(...)\"\n];\nexport function isInterceptionRouteAppPath(path) {\n // TODO-APP: add more serious validation\n return path.split(\"/\").find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;\n}\nexport function extractInterceptionRouteInformation(path) {\n let interceptingRoute, marker, interceptedRoute;\n for (const segment of path.split(\"/\")){\n marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));\n if (marker) {\n [interceptingRoute, interceptedRoute] = path.split(marker, 2);\n break;\n }\n }\n if (!interceptingRoute || !marker || !interceptedRoute) {\n throw new Error(`Invalid interception route: ${path}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);\n }\n interceptingRoute = normalizeAppPath(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed\n ;\n switch(marker){\n case \"(.)\":\n // (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route\n if (interceptingRoute === \"/\") {\n interceptedRoute = `/${interceptedRoute}`;\n } else {\n interceptedRoute = interceptingRoute + \"/\" + interceptedRoute;\n }\n break;\n case \"(..)\":\n // (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route\n if (interceptingRoute === \"/\") {\n throw new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`);\n }\n interceptedRoute = interceptingRoute.split(\"/\").slice(0, -1).concat(interceptedRoute).join(\"/\");\n break;\n case \"(...)\":\n // (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route\n interceptedRoute = \"/\" + interceptedRoute;\n break;\n case \"(..)(..)\":\n // (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route\n const splitInterceptingRoute = interceptingRoute.split(\"/\");\n if (splitInterceptingRoute.length <= 2) {\n throw new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`);\n }\n interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join(\"/\");\n break;\n default:\n throw new Error(\"Invariant: unexpected marker\");\n }\n return {\n interceptingRoute,\n interceptedRoute\n };\n}\n\n//# sourceMappingURL=interception-routes.js.map","import { extractInterceptionRouteInformation, isInterceptionRouteAppPath } from \"../../../../server/future/helpers/interception-routes\";\n// Identify /[param]/ in route string\nconst TEST_ROUTE = /\\/\\[[^/]+?\\](?=\\/|$)/;\nexport function isDynamicRoute(route) {\n if (isInterceptionRouteAppPath(route)) {\n route = extractInterceptionRouteInformation(route).interceptedRoute;\n }\n return TEST_ROUTE.test(route);\n}\n\n//# sourceMappingURL=is-dynamic.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/dist/shared/lib/runtime-config.external.js\");","export function isBot(userAgent) {\n return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(userAgent);\n}\n\n//# sourceMappingURL=is-bot.js.map","import { getTracer } from \"../lib/trace/tracer\";\nimport { AppRenderSpan } from \"../lib/trace/constants\";\nimport { DetachedPromise } from \"../../lib/detached-promise\";\nimport { scheduleImmediate, atLeastOneTask } from \"../../lib/scheduler\";\nimport { ENCODED_TAGS } from \"./encodedTags\";\nimport { indexOfUint8Array, isEquivalentUint8Arrays, removeFromUint8Array } from \"./uint8array-helpers\";\nfunction voidCatch() {\n// this catcher is designed to be used with pipeTo where we expect the underlying\n// pipe implementation to forward errors but we don't want the pipeTo promise to reject\n// and be unhandled\n}\n// We can share the same encoder instance everywhere\n// Notably we cannot do the same for TextDecoder because it is stateful\n// when handling streaming data\nconst encoder = new TextEncoder();\nexport function chainStreams(...streams) {\n // We could encode this invariant in the arguments but current uses of this function pass\n // use spread so it would be missed by\n if (streams.length === 0) {\n throw new Error(\"Invariant: chainStreams requires at least one stream\");\n }\n // If we only have 1 stream we fast path it by returning just this stream\n if (streams.length === 1) {\n return streams[0];\n }\n const { readable, writable } = new TransformStream();\n // We always initiate pipeTo immediately. We know we have at least 2 streams\n // so we need to avoid closing the writable when this one finishes.\n let promise = streams[0].pipeTo(writable, {\n preventClose: true\n });\n let i = 1;\n for(; i < streams.length - 1; i++){\n const nextStream = streams[i];\n promise = promise.then(()=>nextStream.pipeTo(writable, {\n preventClose: true\n }));\n }\n // We can omit the length check because we halted before the last stream and there\n // is at least two streams so the lastStream here will always be defined\n const lastStream = streams[i];\n promise = promise.then(()=>lastStream.pipeTo(writable));\n // Catch any errors from the streams and ignore them, they will be handled\n // by whatever is consuming the readable stream.\n promise.catch(voidCatch);\n return readable;\n}\nexport function streamFromString(str) {\n return new ReadableStream({\n start (controller) {\n controller.enqueue(encoder.encode(str));\n controller.close();\n }\n });\n}\nexport async function streamToString(stream) {\n const decoder = new TextDecoder(\"utf-8\", {\n fatal: true\n });\n let string = \"\";\n // @ts-expect-error TypeScript gets this wrong (https://nodejs.org/api/webstreams.html#async-iteration)\n for await (const chunk of stream){\n string += decoder.decode(chunk, {\n stream: true\n });\n }\n string += decoder.decode();\n return string;\n}\nexport function createBufferedTransformStream() {\n let bufferedChunks = [];\n let bufferByteLength = 0;\n let pending;\n const flush = (controller)=>{\n // If we already have a pending flush, then return early.\n if (pending) return;\n const detached = new DetachedPromise();\n pending = detached;\n scheduleImmediate(()=>{\n try {\n const chunk = new Uint8Array(bufferByteLength);\n let copiedBytes = 0;\n for(let i = 0; i < bufferedChunks.length; i++){\n const bufferedChunk = bufferedChunks[i];\n chunk.set(bufferedChunk, copiedBytes);\n copiedBytes += bufferedChunk.byteLength;\n }\n // We just wrote all the buffered chunks so we need to reset the bufferedChunks array\n // and our bufferByteLength to prepare for the next round of buffered chunks\n bufferedChunks.length = 0;\n bufferByteLength = 0;\n controller.enqueue(chunk);\n } catch {\n // If an error occurs while enqueuing it can't be due to this\n // transformers fault. It's likely due to the controller being\n // errored due to the stream being cancelled.\n } finally{\n pending = undefined;\n detached.resolve();\n }\n });\n };\n return new TransformStream({\n transform (chunk, controller) {\n // Combine the previous buffer with the new chunk.\n bufferedChunks.push(chunk);\n bufferByteLength += chunk.byteLength;\n // Flush the buffer to the controller.\n flush(controller);\n },\n flush () {\n if (!pending) return;\n return pending.promise;\n }\n });\n}\nfunction createInsertedHTMLStream(getServerInsertedHTML) {\n return new TransformStream({\n transform: async (chunk, controller)=>{\n const html = await getServerInsertedHTML();\n if (html) {\n controller.enqueue(encoder.encode(html));\n }\n controller.enqueue(chunk);\n }\n });\n}\nexport function renderToInitialFizzStream({ ReactDOMServer, element, streamOptions }) {\n return getTracer().trace(AppRenderSpan.renderToReadableStream, async ()=>ReactDOMServer.renderToReadableStream(element, streamOptions));\n}\nfunction createHeadInsertionTransformStream(insert) {\n let inserted = false;\n let freezing = false;\n // We need to track if this transform saw any bytes because if it didn't\n // we won't want to insert any server HTML at all\n let hasBytes = false;\n return new TransformStream({\n async transform (chunk, controller) {\n hasBytes = true;\n // While react is flushing chunks, we don't apply insertions\n if (freezing) {\n controller.enqueue(chunk);\n return;\n }\n const insertion = await insert();\n if (inserted) {\n if (insertion) {\n const encodedInsertion = encoder.encode(insertion);\n controller.enqueue(encodedInsertion);\n }\n controller.enqueue(chunk);\n freezing = true;\n } else {\n // TODO (@Ethan-Arrowood): Replace the generic `indexOfUint8Array` method with something finely tuned for the subset of things actually being checked for.\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD);\n if (index !== -1) {\n if (insertion) {\n const encodedInsertion = encoder.encode(insertion);\n const insertedHeadContent = new Uint8Array(chunk.length + encodedInsertion.length);\n insertedHeadContent.set(chunk.slice(0, index));\n insertedHeadContent.set(encodedInsertion, index);\n insertedHeadContent.set(chunk.slice(index), index + encodedInsertion.length);\n controller.enqueue(insertedHeadContent);\n } else {\n controller.enqueue(chunk);\n }\n freezing = true;\n inserted = true;\n }\n }\n if (!inserted) {\n controller.enqueue(chunk);\n } else {\n scheduleImmediate(()=>{\n freezing = false;\n });\n }\n },\n async flush (controller) {\n // Check before closing if there's anything remaining to insert.\n if (hasBytes) {\n const insertion = await insert();\n if (insertion) {\n controller.enqueue(encoder.encode(insertion));\n }\n }\n }\n });\n}\n// Suffix after main body content - scripts before </body>,\n// but wait for the major chunks to be enqueued.\nfunction createDeferredSuffixStream(suffix) {\n let flushed = false;\n let pending;\n const flush = (controller)=>{\n const detached = new DetachedPromise();\n pending = detached;\n scheduleImmediate(()=>{\n try {\n controller.enqueue(encoder.encode(suffix));\n } catch {\n // If an error occurs while enqueuing it can't be due to this\n // transformers fault. It's likely due to the controller being\n // errored due to the stream being cancelled.\n } finally{\n pending = undefined;\n detached.resolve();\n }\n });\n };\n return new TransformStream({\n transform (chunk, controller) {\n controller.enqueue(chunk);\n // If we've already flushed, we're done.\n if (flushed) return;\n // Schedule the flush to happen.\n flushed = true;\n flush(controller);\n },\n flush (controller) {\n if (pending) return pending.promise;\n if (flushed) return;\n // Flush now.\n controller.enqueue(encoder.encode(suffix));\n }\n });\n}\n// Merge two streams into one. Ensure the final transform stream is closed\n// when both are finished.\nfunction createMergedTransformStream(stream) {\n let pull = null;\n let donePulling = false;\n async function startPulling(controller) {\n if (pull) {\n return;\n }\n const reader = stream.getReader();\n // NOTE: streaming flush\n // We are buffering here for the inlined data stream because the\n // \"shell\" stream might be chunkenized again by the underlying stream\n // implementation, e.g. with a specific high-water mark. To ensure it's\n // the safe timing to pipe the data stream, this extra tick is\n // necessary.\n // We don't start reading until we've left the current Task to ensure\n // that it's inserted after flushing the shell. Note that this implementation\n // might get stale if impl details of Fizz change in the future.\n await atLeastOneTask();\n try {\n while(true){\n const { done, value } = await reader.read();\n if (done) {\n donePulling = true;\n return;\n }\n controller.enqueue(value);\n }\n } catch (err) {\n controller.error(err);\n }\n }\n return new TransformStream({\n transform (chunk, controller) {\n controller.enqueue(chunk);\n // Start the streaming if it hasn't already been started yet.\n if (!pull) {\n pull = startPulling(controller);\n }\n },\n flush (controller) {\n if (donePulling) {\n return;\n }\n return pull || startPulling(controller);\n }\n });\n}\n/**\n * This transform stream moves the suffix to the end of the stream, so results\n * like `</body></html><script>...</script>` will be transformed to\n * `<script>...</script></body></html>`.\n */ function createMoveSuffixStream(suffix) {\n let foundSuffix = false;\n const encodedSuffix = encoder.encode(suffix);\n return new TransformStream({\n transform (chunk, controller) {\n if (foundSuffix) {\n return controller.enqueue(chunk);\n }\n const index = indexOfUint8Array(chunk, encodedSuffix);\n if (index > -1) {\n foundSuffix = true;\n // If the whole chunk is the suffix, then don't write anything, it will\n // be written in the flush.\n if (chunk.length === suffix.length) {\n return;\n }\n // Write out the part before the suffix.\n const before = chunk.slice(0, index);\n controller.enqueue(before);\n // In the case where the suffix is in the middle of the chunk, we need\n // to split the chunk into two parts.\n if (chunk.length > suffix.length + index) {\n // Write out the part after the suffix.\n const after = chunk.slice(index + suffix.length);\n controller.enqueue(after);\n }\n } else {\n controller.enqueue(chunk);\n }\n },\n flush (controller) {\n // Even if we didn't find the suffix, the HTML is not valid if we don't\n // add it, so insert it at the end.\n controller.enqueue(encodedSuffix);\n }\n });\n}\nfunction createStripDocumentClosingTagsTransform() {\n return new TransformStream({\n transform (chunk, controller) {\n // We rely on the assumption that chunks will never break across a code unit.\n // This is reasonable because we currently concat all of React's output from a single\n // flush into one chunk before streaming it forward which means the chunk will represent\n // a single coherent utf-8 string. This is not safe to use if we change our streaming to no\n // longer do this large buffered chunk\n if (isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML) || isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.BODY) || isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.HTML)) {\n // the entire chunk is the closing tags; return without enqueueing anything.\n return;\n }\n // We assume these tags will go at together at the end of the document and that\n // they won't appear anywhere else in the document. This is not really a safe assumption\n // but until we revamp our streaming infra this is a performant way to string the tags\n chunk = removeFromUint8Array(chunk, ENCODED_TAGS.CLOSED.BODY);\n chunk = removeFromUint8Array(chunk, ENCODED_TAGS.CLOSED.HTML);\n controller.enqueue(chunk);\n }\n });\n}\n/*\n * Checks if the root layout is missing the html or body tags\n * and if so, it will inject a script tag to throw an error in the browser, showing the user\n * the error message in the error overlay.\n */ export function createRootLayoutValidatorStream() {\n let foundHtml = false;\n let foundBody = false;\n return new TransformStream({\n async transform (chunk, controller) {\n // Peek into the streamed chunk to see if the tags are present.\n if (!foundHtml && indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML) > -1) {\n foundHtml = true;\n }\n if (!foundBody && indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.BODY) > -1) {\n foundBody = true;\n }\n controller.enqueue(chunk);\n },\n flush (controller) {\n const missingTags = [];\n if (!foundHtml) missingTags.push(\"html\");\n if (!foundBody) missingTags.push(\"body\");\n if (!missingTags.length) return;\n controller.enqueue(encoder.encode(`<script>self.__next_root_layout_missing_tags=${JSON.stringify(missingTags)}</script>`));\n }\n });\n}\nfunction chainTransformers(readable, transformers) {\n let stream = readable;\n for (const transformer of transformers){\n if (!transformer) continue;\n stream = stream.pipeThrough(transformer);\n }\n return stream;\n}\nexport async function continueFizzStream(renderStream, { suffix, inlinedDataStream, isStaticGeneration, getServerInsertedHTML, serverInsertedHTMLToHead, validateRootLayout }) {\n const closeTag = \"</body></html>\";\n // Suffix itself might contain close tags at the end, so we need to split it.\n const suffixUnclosed = suffix ? suffix.split(closeTag, 1)[0] : null;\n // If we're generating static HTML and there's an `allReady` promise on the\n // stream, we need to wait for it to resolve before continuing.\n if (isStaticGeneration && \"allReady\" in renderStream) {\n await renderStream.allReady;\n }\n return chainTransformers(renderStream, [\n // Buffer everything to avoid flushing too frequently\n createBufferedTransformStream(),\n // Insert generated tags to head\n getServerInsertedHTML && !serverInsertedHTMLToHead ? createInsertedHTMLStream(getServerInsertedHTML) : null,\n // Insert suffix content\n suffixUnclosed != null && suffixUnclosed.length > 0 ? createDeferredSuffixStream(suffixUnclosed) : null,\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n inlinedDataStream ? createMergedTransformStream(inlinedDataStream) : null,\n // Validate the root layout for missing html or body tags\n validateRootLayout ? createRootLayoutValidatorStream() : null,\n // Close tags should always be deferred to the end\n createMoveSuffixStream(closeTag),\n // Special head insertions\n // TODO-APP: Insert server side html to end of head in app layout rendering, to avoid\n // hydration errors. Remove this once it's ready to be handled by react itself.\n getServerInsertedHTML && serverInsertedHTMLToHead ? createHeadInsertionTransformStream(getServerInsertedHTML) : null\n ]);\n}\nexport async function continueDynamicPrerender(prerenderStream, { getServerInsertedHTML }) {\n return prerenderStream// Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream()).pipeThrough(createStripDocumentClosingTagsTransform())// Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML));\n}\nexport async function continueStaticPrerender(prerenderStream, { inlinedDataStream, getServerInsertedHTML }) {\n const closeTag = \"</body></html>\";\n return prerenderStream// Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream())// Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML))// Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n .pipeThrough(createMergedTransformStream(inlinedDataStream))// Close tags should always be deferred to the end\n .pipeThrough(createMoveSuffixStream(closeTag));\n}\nexport async function continueDynamicHTMLResume(renderStream, { inlinedDataStream, getServerInsertedHTML }) {\n const closeTag = \"</body></html>\";\n return renderStream// Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream())// Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML))// Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n .pipeThrough(createMergedTransformStream(inlinedDataStream))// Close tags should always be deferred to the end\n .pipeThrough(createMoveSuffixStream(closeTag));\n}\nexport async function continueDynamicDataResume(renderStream, { inlinedDataStream }) {\n const closeTag = \"</body></html>\";\n return renderStream// Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n .pipeThrough(createMergedTransformStream(inlinedDataStream))// Close tags should always be deferred to the end\n .pipeThrough(createMoveSuffixStream(closeTag));\n}\n\n//# sourceMappingURL=node-web-streams-helper.js.map","export const ENCODED_TAGS = {\n // opening tags do not have the closing `>` since they can contain other attributes such as `<body className=''>`\n OPENING: {\n // <html\n HTML: new Uint8Array([\n 60,\n 104,\n 116,\n 109,\n 108\n ]),\n // <body\n BODY: new Uint8Array([\n 60,\n 98,\n 111,\n 100,\n 121\n ])\n },\n CLOSED: {\n // </head>\n HEAD: new Uint8Array([\n 60,\n 47,\n 104,\n 101,\n 97,\n 100,\n 62\n ]),\n // </body>\n BODY: new Uint8Array([\n 60,\n 47,\n 98,\n 111,\n 100,\n 121,\n 62\n ]),\n // </html>\n HTML: new Uint8Array([\n 60,\n 47,\n 104,\n 116,\n 109,\n 108,\n 62\n ]),\n // </body></html>\n BODY_AND_HTML: new Uint8Array([\n 60,\n 47,\n 98,\n 111,\n 100,\n 121,\n 62,\n 60,\n 47,\n 104,\n 116,\n 109,\n 108,\n 62\n ])\n }\n};\n\n//# sourceMappingURL=encodedTags.js.map","/**\n * Converts a Node.js IncomingHttpHeaders object to a Headers object. Any\n * headers with multiple values will be joined with a comma and space. Any\n * headers that have an undefined value will be ignored and others will be\n * coerced to strings.\n *\n * @param nodeHeaders the headers object to convert\n * @returns the converted headers object\n */ export function fromNodeOutgoingHttpHeaders(nodeHeaders) {\n const headers = new Headers();\n for (let [key, value] of Object.entries(nodeHeaders)){\n const values = Array.isArray(value) ? value : [\n value\n ];\n for (let v of values){\n if (typeof v === \"undefined\") continue;\n if (typeof v === \"number\") {\n v = v.toString();\n }\n headers.append(key, v);\n }\n }\n return headers;\n}\n/*\n Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas\n that are within a single set-cookie field-value, such as in the Expires portion.\n This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2\n Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128\n React Native's fetch does this for *every* header, including set-cookie.\n \n Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25\n Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation\n*/ export function splitCookiesString(cookiesString) {\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n function skipWhitespace() {\n while(pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))){\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n while(pos < cookiesString.length){\n start = pos;\n cookiesSeparatorFound = false;\n while(skipWhitespace()){\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n // ',' is a cookie separator if we have later first '=', not ';' or ','\n lastComma = pos;\n pos += 1;\n skipWhitespace();\n nextStart = pos;\n while(pos < cookiesString.length && notSpecialChar()){\n pos += 1;\n }\n // currently special character\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n // we found cookies separator\n cookiesSeparatorFound = true;\n // pos is inside the next cookie, so back up and return it.\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n // in param ',' or param separator ';',\n // we continue from that comma\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n return cookiesStrings;\n}\n/**\n * Converts a Headers object to a Node.js OutgoingHttpHeaders object. This is\n * required to support the set-cookie header, which may have multiple values.\n *\n * @param headers the headers object to convert\n * @returns the converted headers object\n */ export function toNodeOutgoingHttpHeaders(headers) {\n const nodeHeaders = {};\n const cookies = [];\n if (headers) {\n for (const [key, value] of headers.entries()){\n if (key.toLowerCase() === \"set-cookie\") {\n // We may have gotten a comma joined string of cookies, or multiple\n // set-cookie headers. We need to merge them into one header array\n // to represent all the cookies.\n cookies.push(...splitCookiesString(value));\n nodeHeaders[key] = cookies.length === 1 ? cookies[0] : cookies;\n } else {\n nodeHeaders[key] = value;\n }\n }\n }\n return nodeHeaders;\n}\n/**\n * Validate the correctness of a user-provided URL.\n */ export function validateURL(url) {\n try {\n return String(new URL(String(url)));\n } catch (error) {\n throw new Error(`URL is malformed \"${String(url)}\". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {\n cause: error\n });\n }\n}\n\n//# sourceMappingURL=utils.js.map","/**\n * Removes the trailing slash for a given route or page path. Preserves the\n * root page. Examples:\n * - `/foo/bar/` -> `/foo/bar`\n * - `/foo/bar` -> `/foo/bar`\n * - `/` -> `/`\n */ export function removeTrailingSlash(route) {\n return route.replace(/\\/$/, \"\") || \"/\";\n}\n\n//# sourceMappingURL=remove-trailing-slash.js.map","/**\n * Given a path this function will find the pathname, query and hash and return\n * them. This is useful to parse full paths on the client side.\n * @param path A path to parse e.g. /foo/bar?id=1#hash\n */ export function parsePath(path) {\n const hashIndex = path.indexOf(\"#\");\n const queryIndex = path.indexOf(\"?\");\n const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);\n if (hasQuery || hashIndex > -1) {\n return {\n pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),\n query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined) : \"\",\n hash: hashIndex > -1 ? path.slice(hashIndex) : \"\"\n };\n }\n return {\n pathname: path,\n query: \"\",\n hash: \"\"\n };\n}\n\n//# sourceMappingURL=parse-path.js.map","import { parsePath } from \"./parse-path\";\n/**\n * Adds the provided prefix to the given path. It first ensures that the path\n * is indeed starting with a slash.\n */ export function addPathPrefix(path, prefix) {\n if (!path.startsWith(\"/\") || !prefix) {\n return path;\n }\n const { pathname, query, hash } = parsePath(path);\n return \"\" + prefix + pathname + query + hash;\n}\n\n//# sourceMappingURL=add-path-prefix.js.map","import { parsePath } from \"./parse-path\";\n/**\n * Similarly to `addPathPrefix`, this function adds a suffix at the end on the\n * provided path. It also works only for paths ensuring the argument starts\n * with a slash.\n */ export function addPathSuffix(path, suffix) {\n if (!path.startsWith(\"/\") || !suffix) {\n return path;\n }\n const { pathname, query, hash } = parsePath(path);\n return \"\" + pathname + suffix + query + hash;\n}\n\n//# sourceMappingURL=add-path-suffix.js.map","import { parsePath } from \"./parse-path\";\n/**\n * Checks if a given path starts with a given prefix. It ensures it matches\n * exactly without containing extra chars. e.g. prefix /docs should replace\n * for /docs, /docs/, /docs/a but not /docsss\n * @param path The path to check.\n * @param prefix The prefix to check against.\n */ export function pathHasPrefix(path, prefix) {\n if (typeof path !== \"string\") {\n return false;\n }\n const { pathname } = parsePath(path);\n return pathname === prefix || pathname.startsWith(prefix + \"/\");\n}\n\n//# sourceMappingURL=path-has-prefix.js.map","/**\n * Takes an object with a hostname property (like a parsed URL) and some\n * headers that may contain Host and returns the preferred hostname.\n * @param parsed An object containing a hostname property.\n * @param headers A dictionary with headers containing a `host`.\n */ export function getHostname(parsed, headers) {\n // Get the hostname from the headers if it exists, otherwise use the parsed\n // hostname.\n let hostname;\n if ((headers == null ? void 0 : headers.host) && !Array.isArray(headers.host)) {\n hostname = headers.host.toString().split(\":\", 1)[0];\n } else if (parsed.hostname) {\n hostname = parsed.hostname;\n } else return;\n return hostname.toLowerCase();\n}\n\n//# sourceMappingURL=get-hostname.js.map","/**\n * For a pathname that may include a locale from a list of locales, it\n * removes the locale from the pathname returning it alongside with the\n * detected locale.\n *\n * @param pathname A pathname that may include a locale.\n * @param locales A list of locales.\n * @returns The detected locale and pathname without locale\n */ export function normalizeLocalePath(pathname, locales) {\n let detectedLocale;\n // first item will be empty string from splitting at first char\n const pathnameParts = pathname.split(\"/\");\n (locales || []).some((locale)=>{\n if (pathnameParts[1] && pathnameParts[1].toLowerCase() === locale.toLowerCase()) {\n detectedLocale = locale;\n pathnameParts.splice(1, 1);\n pathname = pathnameParts.join(\"/\") || \"/\";\n return true;\n }\n return false;\n });\n return {\n pathname,\n detectedLocale\n };\n}\n\n//# sourceMappingURL=normalize-locale-path.js.map","import { pathHasPrefix } from \"./path-has-prefix\";\n/**\n * Given a path and a prefix it will remove the prefix when it exists in the\n * given path. It ensures it matches exactly without containing extra chars\n * and if the prefix is not there it will be noop.\n *\n * @param path The path to remove the prefix from.\n * @param prefix The prefix to be removed.\n */ export function removePathPrefix(path, prefix) {\n // If the path doesn't start with the prefix we can return it as is. This\n // protects us from situations where the prefix is a substring of the path\n // prefix such as:\n //\n // For prefix: /blog\n //\n // /blog -> true\n // /blog/ -> true\n // /blog/1 -> true\n // /blogging -> false\n // /blogging/ -> false\n // /blogging/1 -> false\n if (!pathHasPrefix(path, prefix)) {\n return path;\n }\n // Remove the prefix from the path via slicing.\n const withoutPrefix = path.slice(prefix.length);\n // If the path without the prefix starts with a `/` we can return it as is.\n if (withoutPrefix.startsWith(\"/\")) {\n return withoutPrefix;\n }\n // If the path without the prefix doesn't start with a `/` we need to add it\n // back to the path to make sure it's a valid path.\n return \"/\" + withoutPrefix;\n}\n\n//# sourceMappingURL=remove-path-prefix.js.map","import { normalizeLocalePath } from \"../../i18n/normalize-locale-path\";\nimport { removePathPrefix } from \"./remove-path-prefix\";\nimport { pathHasPrefix } from \"./path-has-prefix\";\nexport function getNextPathnameInfo(pathname, options) {\n var _options_nextConfig;\n const { basePath, i18n, trailingSlash } = (_options_nextConfig = options.nextConfig) != null ? _options_nextConfig : {};\n const info = {\n pathname,\n trailingSlash: pathname !== \"/\" ? pathname.endsWith(\"/\") : trailingSlash\n };\n if (basePath && pathHasPrefix(info.pathname, basePath)) {\n info.pathname = removePathPrefix(info.pathname, basePath);\n info.basePath = basePath;\n }\n let pathnameNoDataPrefix = info.pathname;\n if (info.pathname.startsWith(\"/_next/data/\") && info.pathname.endsWith(\".json\")) {\n const paths = info.pathname.replace(/^\\/_next\\/data\\//, \"\").replace(/\\.json$/, \"\").split(\"/\");\n const buildId = paths[0];\n info.buildId = buildId;\n pathnameNoDataPrefix = paths[1] !== \"index\" ? \"/\" + paths.slice(1).join(\"/\") : \"/\";\n // update pathname with normalized if enabled although\n // we use normalized to populate locale info still\n if (options.parseData === true) {\n info.pathname = pathnameNoDataPrefix;\n }\n }\n // If provided, use the locale route normalizer to detect the locale instead\n // of the function below.\n if (i18n) {\n let result = options.i18nProvider ? options.i18nProvider.analyze(info.pathname) : normalizeLocalePath(info.pathname, i18n.locales);\n info.locale = result.detectedLocale;\n var _result_pathname;\n info.pathname = (_result_pathname = result.pathname) != null ? _result_pathname : info.pathname;\n if (!result.detectedLocale && info.buildId) {\n result = options.i18nProvider ? options.i18nProvider.analyze(pathnameNoDataPrefix) : normalizeLocalePath(pathnameNoDataPrefix, i18n.locales);\n if (result.detectedLocale) {\n info.locale = result.detectedLocale;\n }\n }\n }\n return info;\n}\n\n//# sourceMappingURL=get-next-pathname-info.js.map","import { detectDomainLocale } from \"../../shared/lib/i18n/detect-domain-locale\";\nimport { formatNextPathnameInfo } from \"../../shared/lib/router/utils/format-next-pathname-info\";\nimport { getHostname } from \"../../shared/lib/get-hostname\";\nimport { getNextPathnameInfo } from \"../../shared/lib/router/utils/get-next-pathname-info\";\nconst REGEX_LOCALHOST_HOSTNAME = /(?!^https?:\\/\\/)(127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\\[::1\\]|localhost)/;\nfunction parseURL(url, base) {\n return new URL(String(url).replace(REGEX_LOCALHOST_HOSTNAME, \"localhost\"), base && String(base).replace(REGEX_LOCALHOST_HOSTNAME, \"localhost\"));\n}\nconst Internal = Symbol(\"NextURLInternal\");\nexport class NextURL {\n constructor(input, baseOrOpts, opts){\n let base;\n let options;\n if (typeof baseOrOpts === \"object\" && \"pathname\" in baseOrOpts || typeof baseOrOpts === \"string\") {\n base = baseOrOpts;\n options = opts || {};\n } else {\n options = opts || baseOrOpts || {};\n }\n this[Internal] = {\n url: parseURL(input, base ?? options.base),\n options: options,\n basePath: \"\"\n };\n this.analyze();\n }\n analyze() {\n var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig, _this_Internal_domainLocale, _this_Internal_options_nextConfig_i18n1, _this_Internal_options_nextConfig1;\n const info = getNextPathnameInfo(this[Internal].url.pathname, {\n nextConfig: this[Internal].options.nextConfig,\n parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,\n i18nProvider: this[Internal].options.i18nProvider\n });\n const hostname = getHostname(this[Internal].url, this[Internal].options.headers);\n this[Internal].domainLocale = this[Internal].options.i18nProvider ? this[Internal].options.i18nProvider.detectDomainLocale(hostname) : detectDomainLocale((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.domains, hostname);\n const defaultLocale = ((_this_Internal_domainLocale = this[Internal].domainLocale) == null ? void 0 : _this_Internal_domainLocale.defaultLocale) || ((_this_Internal_options_nextConfig1 = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n1 = _this_Internal_options_nextConfig1.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n1.defaultLocale);\n this[Internal].url.pathname = info.pathname;\n this[Internal].defaultLocale = defaultLocale;\n this[Internal].basePath = info.basePath ?? \"\";\n this[Internal].buildId = info.buildId;\n this[Internal].locale = info.locale ?? defaultLocale;\n this[Internal].trailingSlash = info.trailingSlash;\n }\n formatPathname() {\n return formatNextPathnameInfo({\n basePath: this[Internal].basePath,\n buildId: this[Internal].buildId,\n defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : undefined,\n locale: this[Internal].locale,\n pathname: this[Internal].url.pathname,\n trailingSlash: this[Internal].trailingSlash\n });\n }\n formatSearch() {\n return this[Internal].url.search;\n }\n get buildId() {\n return this[Internal].buildId;\n }\n set buildId(buildId) {\n this[Internal].buildId = buildId;\n }\n get locale() {\n return this[Internal].locale ?? \"\";\n }\n set locale(locale) {\n var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig;\n if (!this[Internal].locale || !((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.locales.includes(locale))) {\n throw new TypeError(`The NextURL configuration includes no locale \"${locale}\"`);\n }\n this[Internal].locale = locale;\n }\n get defaultLocale() {\n return this[Internal].defaultLocale;\n }\n get domainLocale() {\n return this[Internal].domainLocale;\n }\n get searchParams() {\n return this[Internal].url.searchParams;\n }\n get host() {\n return this[Internal].url.host;\n }\n set host(value) {\n this[Internal].url.host = value;\n }\n get hostname() {\n return this[Internal].url.hostname;\n }\n set hostname(value) {\n this[Internal].url.hostname = value;\n }\n get port() {\n return this[Internal].url.port;\n }\n set port(value) {\n this[Internal].url.port = value;\n }\n get protocol() {\n return this[Internal].url.protocol;\n }\n set protocol(value) {\n this[Internal].url.protocol = value;\n }\n get href() {\n const pathname = this.formatPathname();\n const search = this.formatSearch();\n return `${this.protocol}//${this.host}${pathname}${search}${this.hash}`;\n }\n set href(url) {\n this[Internal].url = parseURL(url);\n this.analyze();\n }\n get origin() {\n return this[Internal].url.origin;\n }\n get pathname() {\n return this[Internal].url.pathname;\n }\n set pathname(value) {\n this[Internal].url.pathname = value;\n }\n get hash() {\n return this[Internal].url.hash;\n }\n set hash(value) {\n this[Internal].url.hash = value;\n }\n get search() {\n return this[Internal].url.search;\n }\n set search(value) {\n this[Internal].url.search = value;\n }\n get password() {\n return this[Internal].url.password;\n }\n set password(value) {\n this[Internal].url.password = value;\n }\n get username() {\n return this[Internal].url.username;\n }\n set username(value) {\n this[Internal].url.username = value;\n }\n get basePath() {\n return this[Internal].basePath;\n }\n set basePath(value) {\n this[Internal].basePath = value.startsWith(\"/\") ? value : `/${value}`;\n }\n toString() {\n return this.href;\n }\n toJSON() {\n return this.href;\n }\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return {\n href: this.href,\n origin: this.origin,\n protocol: this.protocol,\n username: this.username,\n password: this.password,\n host: this.host,\n hostname: this.hostname,\n port: this.port,\n pathname: this.pathname,\n search: this.search,\n searchParams: this.searchParams,\n hash: this.hash\n };\n }\n clone() {\n return new NextURL(String(this), this[Internal].options);\n }\n}\n\n//# sourceMappingURL=next-url.js.map","export function detectDomainLocale(domainItems, hostname, detectedLocale) {\n if (!domainItems) return;\n if (detectedLocale) {\n detectedLocale = detectedLocale.toLowerCase();\n }\n for (const item of domainItems){\n var _item_domain, _item_locales;\n // remove port if present\n const domainHostname = (_item_domain = item.domain) == null ? void 0 : _item_domain.split(\":\", 1)[0].toLowerCase();\n if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((_item_locales = item.locales) == null ? void 0 : _item_locales.some((locale)=>locale.toLowerCase() === detectedLocale))) {\n return item;\n }\n }\n}\n\n//# sourceMappingURL=detect-domain-locale.js.map","import { removeTrailingSlash } from \"./remove-trailing-slash\";\nimport { addPathPrefix } from \"./add-path-prefix\";\nimport { addPathSuffix } from \"./add-path-suffix\";\nimport { addLocale } from \"./add-locale\";\nexport function formatNextPathnameInfo(info) {\n let pathname = addLocale(info.pathname, info.locale, info.buildId ? undefined : info.defaultLocale, info.ignorePrefix);\n if (info.buildId || !info.trailingSlash) {\n pathname = removeTrailingSlash(pathname);\n }\n if (info.buildId) {\n pathname = addPathSuffix(addPathPrefix(pathname, \"/_next/data/\" + info.buildId), info.pathname === \"/\" ? \"index.json\" : \".json\");\n }\n pathname = addPathPrefix(pathname, info.basePath);\n return !info.buildId && info.trailingSlash ? !pathname.endsWith(\"/\") ? addPathSuffix(pathname, \"/\") : pathname : removeTrailingSlash(pathname);\n}\n\n//# sourceMappingURL=format-next-pathname-info.js.map","import { addPathPrefix } from \"./add-path-prefix\";\nimport { pathHasPrefix } from \"./path-has-prefix\";\n/**\n * For a given path and a locale, if the locale is given, it will prefix the\n * locale. The path shouldn't be an API path. If a default locale is given the\n * prefix will be omitted if the locale is already the default locale.\n */ export function addLocale(path, locale, defaultLocale, ignorePrefix) {\n // If no locale was given or the locale is the default locale, we don't need\n // to prefix the path.\n if (!locale || locale === defaultLocale) return path;\n const lower = path.toLowerCase();\n // If the path is an API path or the path already has the locale prefix, we\n // don't need to prefix the path.\n if (!ignorePrefix) {\n if (pathHasPrefix(lower, \"/api\")) return path;\n if (pathHasPrefix(lower, \"/\" + locale.toLowerCase())) return path;\n }\n // Add the locale prefix to the path.\n return addPathPrefix(path, \"/\" + locale);\n}\n\n//# sourceMappingURL=add-locale.js.map","export class PageSignatureError extends Error {\n constructor({ page }){\n super(`The middleware \"${page}\" accepts an async API directly with the form:\n \n export function middleware(request, event) {\n return NextResponse.redirect('/new-location')\n }\n \n Read more: https://nextjs.org/docs/messages/middleware-new-signature\n `);\n }\n}\nexport class RemovedPageError extends Error {\n constructor(){\n super(`The request.page has been deprecated in favour of \\`URLPattern\\`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n `);\n }\n}\nexport class RemovedUAError extends Error {\n constructor(){\n super(`The request.ua has been removed in favour of \\`userAgent\\` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n `);\n }\n}\n\n//# sourceMappingURL=error.js.map","import { NextURL } from \"../next-url\";\nimport { toNodeOutgoingHttpHeaders, validateURL } from \"../utils\";\nimport { RemovedUAError, RemovedPageError } from \"../error\";\nimport { RequestCookies } from \"./cookies\";\nexport const INTERNALS = Symbol(\"internal request\");\n/**\n * This class extends the [Web `Request` API](https://developer.mozilla.org/docs/Web/API/Request) with additional convenience methods.\n *\n * Read more: [Next.js Docs: `NextRequest`](https://nextjs.org/docs/app/api-reference/functions/next-request)\n */ export class NextRequest extends Request {\n constructor(input, init = {}){\n const url = typeof input !== \"string\" && \"url\" in input ? input.url : String(input);\n validateURL(url);\n if (input instanceof Request) super(input, init);\n else super(url, init);\n const nextUrl = new NextURL(url, {\n headers: toNodeOutgoingHttpHeaders(this.headers),\n nextConfig: init.nextConfig\n });\n this[INTERNALS] = {\n cookies: new RequestCookies(this.headers),\n geo: init.geo || {},\n ip: init.ip,\n nextUrl,\n url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? url : nextUrl.toString()\n };\n }\n [Symbol.for(\"edge-runtime.inspect.custom\")]() {\n return {\n cookies: this.cookies,\n geo: this.geo,\n ip: this.ip,\n nextUrl: this.nextUrl,\n url: this.url,\n // rest of props come from Request\n bodyUsed: this.bodyUsed,\n cache: this.cache,\n credentials: this.credentials,\n destination: this.destination,\n headers: Object.fromEntries(this.headers),\n integrity: this.integrity,\n keepalive: this.keepalive,\n method: this.method,\n mode: this.mode,\n redirect: this.redirect,\n referrer: this.referrer,\n referrerPolicy: this.referrerPolicy,\n signal: this.signal\n };\n }\n get cookies() {\n return this[INTERNALS].cookies;\n }\n get geo() {\n return this[INTERNALS].geo;\n }\n get ip() {\n return this[INTERNALS].ip;\n }\n get nextUrl() {\n return this[INTERNALS].nextUrl;\n }\n /**\n * @deprecated\n * `page` has been deprecated in favour of `URLPattern`.\n * Read more: https://nextjs.org/docs/messages/middleware-request-page\n */ get page() {\n throw new RemovedPageError();\n }\n /**\n * @deprecated\n * `ua` has been removed in favour of \\`userAgent\\` function.\n * Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n */ get ua() {\n throw new RemovedUAError();\n }\n get url() {\n return this[INTERNALS].url;\n }\n}\n\n//# sourceMappingURL=request.js.map","import { getRequestMeta } from \"../../../request-meta\";\nimport { fromNodeOutgoingHttpHeaders } from \"../../utils\";\nimport { NextRequest } from \"../request\";\nexport const ResponseAbortedName = \"ResponseAborted\";\nexport class ResponseAborted extends Error {\n constructor(...args){\n super(...args);\n this.name = ResponseAbortedName;\n }\n}\n/**\n * Creates an AbortController tied to the closing of a ServerResponse (or other\n * appropriate Writable).\n *\n * If the `close` event is fired before the `finish` event, then we'll send the\n * `abort` signal.\n */ export function createAbortController(response) {\n const controller = new AbortController();\n // If `finish` fires first, then `res.end()` has been called and the close is\n // just us finishing the stream on our side. If `close` fires first, then we\n // know the client disconnected before we finished.\n response.once(\"close\", ()=>{\n if (response.writableFinished) return;\n controller.abort(new ResponseAborted());\n });\n return controller;\n}\n/**\n * Creates an AbortSignal tied to the closing of a ServerResponse (or other\n * appropriate Writable).\n *\n * This cannot be done with the request (IncomingMessage or Readable) because\n * the `abort` event will not fire if to data has been fully read (because that\n * will \"close\" the readable stream and nothing fires after that).\n */ export function signalFromNodeResponse(response) {\n const { errored, destroyed } = response;\n if (errored || destroyed) {\n return AbortSignal.abort(errored ?? new ResponseAborted());\n }\n const { signal } = createAbortController(response);\n return signal;\n}\nexport class NextRequestAdapter {\n static fromBaseNextRequest(request, signal) {\n // TODO: look at refining this check\n if (\"request\" in request && request.request) {\n return NextRequestAdapter.fromWebNextRequest(request);\n }\n return NextRequestAdapter.fromNodeNextRequest(request, signal);\n }\n static fromNodeNextRequest(request, signal) {\n // HEAD and GET requests can not have a body.\n let body = null;\n if (request.method !== \"GET\" && request.method !== \"HEAD\" && request.body) {\n // @ts-expect-error - this is handled by undici, when streams/web land use it instead\n body = request.body;\n }\n let url;\n if (request.url.startsWith(\"http\")) {\n url = new URL(request.url);\n } else {\n // Grab the full URL from the request metadata.\n const base = getRequestMeta(request, \"initURL\");\n if (!base || !base.startsWith(\"http\")) {\n // Because the URL construction relies on the fact that the URL provided\n // is absolute, we need to provide a base URL. We can't use the request\n // URL because it's relative, so we use a dummy URL instead.\n url = new URL(request.url, \"http://n\");\n } else {\n url = new URL(request.url, base);\n }\n }\n return new NextRequest(url, {\n method: request.method,\n headers: fromNodeOutgoingHttpHeaders(request.headers),\n // @ts-expect-error - see https://github.com/whatwg/fetch/pull/1457\n duplex: \"half\",\n signal,\n // geo\n // ip\n // nextConfig\n // body can not be passed if request was aborted\n // or we get a Request body was disturbed error\n ...signal.aborted ? {} : {\n body\n }\n });\n }\n static fromWebNextRequest(request) {\n // HEAD and GET requests can not have a body.\n let body = null;\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n body = request.body;\n }\n return new NextRequest(request.url, {\n method: request.method,\n headers: fromNodeOutgoingHttpHeaders(request.headers),\n // @ts-expect-error - see https://github.com/whatwg/fetch/pull/1457\n duplex: \"half\",\n signal: request.request.signal,\n // geo\n // ip\n // nextConfig\n // body can not be passed if request was aborted\n // or we get a Request body was disturbed error\n ...request.request.signal.aborted ? {} : {\n body\n }\n });\n }\n}\n\n//# sourceMappingURL=next-request.js.map","/**\n * A `Promise.withResolvers` implementation that exposes the `resolve` and\n * `reject` functions on a `Promise`.\n *\n * @see https://tc39.es/proposal-promise-with-resolvers/\n */ export class DetachedPromise {\n constructor(){\n let resolve;\n let reject;\n // Create the promise and assign the resolvers to the object.\n this.promise = new Promise((res, rej)=>{\n resolve = res;\n reject = rej;\n });\n // We know that resolvers is defined because the Promise constructor runs\n // synchronously.\n this.resolve = resolve;\n this.reject = reject;\n }\n}\n\n//# sourceMappingURL=detached-promise.js.map","// Combined load times for loading client components\nlet clientComponentLoadStart = 0;\nlet clientComponentLoadTimes = 0;\nlet clientComponentLoadCount = 0;\nexport function wrapClientComponentLoader(ComponentMod) {\n if (!(\"performance\" in globalThis)) {\n return ComponentMod.__next_app__;\n }\n return {\n require: (...args)=>{\n if (clientComponentLoadStart === 0) {\n clientComponentLoadStart = performance.now();\n }\n const startTime = performance.now();\n try {\n clientComponentLoadCount += 1;\n return ComponentMod.__next_app__.require(...args);\n } finally{\n clientComponentLoadTimes += performance.now() - startTime;\n }\n },\n loadChunk: (...args)=>{\n const startTime = performance.now();\n try {\n clientComponentLoadCount += 1;\n return ComponentMod.__next_app__.loadChunk(...args);\n } finally{\n clientComponentLoadTimes += performance.now() - startTime;\n }\n }\n };\n}\nexport function getClientComponentLoaderMetrics(options = {}) {\n const metrics = clientComponentLoadStart === 0 ? undefined : {\n clientComponentLoadStart,\n clientComponentLoadTimes,\n clientComponentLoadCount\n };\n if (options.reset) {\n clientComponentLoadStart = 0;\n clientComponentLoadTimes = 0;\n clientComponentLoadCount = 0;\n }\n return metrics;\n}\n\n//# sourceMappingURL=client-component-renderer-logger.js.map","import { ResponseAbortedName, createAbortController } from \"./web/spec-extension/adapters/next-request\";\nimport { DetachedPromise } from \"../lib/detached-promise\";\nimport { getTracer } from \"./lib/trace/tracer\";\nimport { NextNodeServerSpan } from \"./lib/trace/constants\";\nimport { getClientComponentLoaderMetrics } from \"./client-component-renderer-logger\";\nexport function isAbortError(e) {\n return (e == null ? void 0 : e.name) === \"AbortError\" || (e == null ? void 0 : e.name) === ResponseAbortedName;\n}\nfunction createWriterFromResponse(res, waitUntilForEnd) {\n let started = false;\n // Create a promise that will resolve once the response has drained. See\n // https://nodejs.org/api/stream.html#stream_event_drain\n let drained = new DetachedPromise();\n function onDrain() {\n drained.resolve();\n }\n res.on(\"drain\", onDrain);\n // If the finish event fires, it means we shouldn't block and wait for the\n // drain event.\n res.once(\"close\", ()=>{\n res.off(\"drain\", onDrain);\n drained.resolve();\n });\n // Create a promise that will resolve once the response has finished. See\n // https://nodejs.org/api/http.html#event-finish_1\n const finished = new DetachedPromise();\n res.once(\"finish\", ()=>{\n finished.resolve();\n });\n // Create a writable stream that will write to the response.\n return new WritableStream({\n write: async (chunk)=>{\n // You'd think we'd want to use `start` instead of placing this in `write`\n // but this ensures that we don't actually flush the headers until we've\n // started writing chunks.\n if (!started) {\n started = true;\n if (\"performance\" in globalThis && process.env.NEXT_OTEL_PERFORMANCE_PREFIX) {\n const metrics = getClientComponentLoaderMetrics();\n if (metrics) {\n performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`, {\n start: metrics.clientComponentLoadStart,\n end: metrics.clientComponentLoadStart + metrics.clientComponentLoadTimes\n });\n }\n }\n res.flushHeaders();\n getTracer().trace(NextNodeServerSpan.startResponse, {\n spanName: \"start response\"\n }, ()=>undefined);\n }\n try {\n const ok = res.write(chunk);\n // Added by the `compression` middleware, this is a function that will\n // flush the partially-compressed response to the client.\n if (\"flush\" in res && typeof res.flush === \"function\") {\n res.flush();\n }\n // If the write returns false, it means there's some backpressure, so\n // wait until it's streamed before continuing.\n if (!ok) {\n await drained.promise;\n // Reset the drained promise so that we can wait for the next drain event.\n drained = new DetachedPromise();\n }\n } catch (err) {\n res.end();\n throw new Error(\"failed to write chunk to response\", {\n cause: err\n });\n }\n },\n abort: (err)=>{\n if (res.writableFinished) return;\n res.destroy(err);\n },\n close: async ()=>{\n // if a waitUntil promise was passed, wait for it to resolve before\n // ending the response.\n if (waitUntilForEnd) {\n await waitUntilForEnd;\n }\n if (res.writableFinished) return;\n res.end();\n return finished.promise;\n }\n });\n}\nexport async function pipeToNodeResponse(readable, res, waitUntilForEnd) {\n try {\n // If the response has already errored, then just return now.\n const { errored, destroyed } = res;\n if (errored || destroyed) return;\n // Create a new AbortController so that we can abort the readable if the\n // client disconnects.\n const controller = createAbortController(res);\n const writer = createWriterFromResponse(res, waitUntilForEnd);\n await readable.pipeTo(writer, {\n signal: controller.signal\n });\n } catch (err) {\n // If this isn't related to an abort error, re-throw it.\n if (isAbortError(err)) return;\n throw new Error(\"failed to pipe response\", {\n cause: err\n });\n }\n}\n\n//# sourceMappingURL=pipe-readable.js.map","import { chainStreams, streamFromString, streamToString } from \"./stream-utils/node-web-streams-helper\";\nimport { isAbortError, pipeToNodeResponse } from \"./pipe-readable\";\nexport default class RenderResult {\n /**\n * Creates a new RenderResult instance from a static response.\n *\n * @param value the static response value\n * @returns a new RenderResult instance\n */ static fromStatic(value) {\n return new RenderResult(value, {\n metadata: {}\n });\n }\n constructor(response, { contentType, waitUntil, metadata }){\n this.response = response;\n this.contentType = contentType;\n this.metadata = metadata;\n this.waitUntil = waitUntil;\n }\n assignMetadata(metadata) {\n Object.assign(this.metadata, metadata);\n }\n /**\n * Returns true if the response is null. It can be null if the response was\n * not found or was already sent.\n */ get isNull() {\n return this.response === null;\n }\n /**\n * Returns false if the response is a string. It can be a string if the page\n * was prerendered. If it's not, then it was generated dynamically.\n */ get isDynamic() {\n return typeof this.response !== \"string\";\n }\n toUnchunkedString(stream = false) {\n if (this.response === null) {\n throw new Error(\"Invariant: null responses cannot be unchunked\");\n }\n if (typeof this.response !== \"string\") {\n if (!stream) {\n throw new Error(\"Invariant: dynamic responses cannot be unchunked. This is a bug in Next.js\");\n }\n return streamToString(this.readable);\n }\n return this.response;\n }\n /**\n * Returns the response if it is a stream, or throws an error if it is a\n * string.\n */ get readable() {\n if (this.response === null) {\n throw new Error(\"Invariant: null responses cannot be streamed\");\n }\n if (typeof this.response === \"string\") {\n throw new Error(\"Invariant: static responses cannot be streamed\");\n }\n // If the response is an array of streams, then chain them together.\n if (Array.isArray(this.response)) {\n return chainStreams(...this.response);\n }\n return this.response;\n }\n /**\n * Chains a new stream to the response. This will convert the response to an\n * array of streams if it is not already one and will add the new stream to\n * the end. When this response is piped, all of the streams will be piped\n * one after the other.\n *\n * @param readable The new stream to chain\n */ chain(readable) {\n if (this.response === null) {\n throw new Error(\"Invariant: response is null. This is a bug in Next.js\");\n }\n // If the response is not an array of streams already, make it one.\n let responses;\n if (typeof this.response === \"string\") {\n responses = [\n streamFromString(this.response)\n ];\n } else if (Array.isArray(this.response)) {\n responses = this.response;\n } else {\n responses = [\n this.response\n ];\n }\n // Add the new stream to the array.\n responses.push(readable);\n // Update the response.\n this.response = responses;\n }\n /**\n * Pipes the response to a writable stream. This will close/cancel the\n * writable stream if an error is encountered. If this doesn't throw, then\n * the writable stream will be closed or aborted.\n *\n * @param writable Writable stream to pipe the response to\n */ async pipeTo(writable) {\n try {\n await this.readable.pipeTo(writable, {\n // We want to close the writable stream ourselves so that we can wait\n // for the waitUntil promise to resolve before closing it. If an error\n // is encountered, we'll abort the writable stream if we swallowed the\n // error.\n preventClose: true\n });\n // If there is a waitUntil promise, wait for it to resolve before\n // closing the writable stream.\n if (this.waitUntil) await this.waitUntil;\n // Close the writable stream.\n await writable.close();\n } catch (err) {\n // If this is an abort error, we should abort the writable stream (as we\n // took ownership of it when we started piping). We don't need to re-throw\n // because we handled the error.\n if (isAbortError(err)) {\n // Abort the writable stream if an error is encountered.\n await writable.abort(err);\n return;\n }\n // We're not aborting the writer here as when this method throws it's not\n // clear as to how so the caller should assume it's their responsibility\n // to clean up the writer.\n throw err;\n }\n }\n /**\n * Pipes the response to a node response. This will close/cancel the node\n * response if an error is encountered.\n *\n * @param res\n */ async pipeToNodeResponse(res) {\n await pipeToNodeResponse(this.readable, res, this.waitUntil);\n }\n}\n\n//# sourceMappingURL=render-result.js.map","import { isDynamicRoute } from \"../router/utils\";\nimport { normalizePathSep } from \"./normalize-path-sep\";\n/**\n * Performs the opposite transformation of `normalizePagePath`. Note that\n * this function is not idempotent either in cases where there are multiple\n * leading `/index` for the page. Examples:\n * - `/index` -> `/`\n * - `/index/foo` -> `/foo`\n * - `/index/index` -> `/index`\n */ export function denormalizePagePath(page) {\n let _page = normalizePathSep(page);\n return _page.startsWith(\"/index/\") && !isDynamicRoute(_page) ? _page.slice(6) : _page !== \"/index\" ? _page : \"/\";\n}\n\n//# sourceMappingURL=denormalize-page-path.js.map","/**\n * For a given page path, this function ensures that there is no backslash\n * escaping slashes in the path. Example:\n * - `foo\\/bar\\/baz` -> `foo/bar/baz`\n */ export function normalizePathSep(path) {\n return path.replace(/\\\\/g, \"/\");\n}\n\n//# sourceMappingURL=normalize-path-sep.js.map","import { pathToRegexp } from \"next/dist/compiled/path-to-regexp\";\nimport { regexpToFunction } from \"next/dist/compiled/path-to-regexp\";\n/**\n * Generates a path matcher function for a given path and options based on\n * path-to-regexp. By default the match will be case insensitive, non strict\n * and delimited by `/`.\n */ export function getPathMatch(path, options) {\n const keys = [];\n const regexp = pathToRegexp(path, keys, {\n delimiter: \"/\",\n sensitive: typeof (options == null ? void 0 : options.sensitive) === \"boolean\" ? options.sensitive : false,\n strict: options == null ? void 0 : options.strict\n });\n const matcher = regexpToFunction((options == null ? void 0 : options.regexModifier) ? new RegExp(options.regexModifier(regexp.source), regexp.flags) : regexp, keys);\n /**\n * A matcher function that will check if a given pathname matches the path\n * given in the builder function. When the path does not match it will return\n * `false` but if it does it will return an object with the matched params\n * merged with the params provided in the second argument.\n */ return (pathname, params)=>{\n // If no pathname is provided it's not a match.\n if (typeof pathname !== \"string\") return false;\n const match = matcher(pathname);\n // If the path did not match `false` will be returned.\n if (!match) return false;\n /**\n * If unnamed params are not allowed they must be removed from\n * the matched parameters. path-to-regexp uses \"string\" for named and\n * \"number\" for unnamed parameters.\n */ if (options == null ? void 0 : options.removeUnnamedParams) {\n for (const key of keys){\n if (typeof key.name === \"number\") {\n delete match.params[key.name];\n }\n }\n }\n return {\n ...params,\n ...match.params\n };\n };\n}\n\n//# sourceMappingURL=path-match.js.map","// regexp is based on https://github.com/sindresorhus/escape-string-regexp\nconst reHasRegExp = /[|\\\\{}()[\\]^$+*?.-]/;\nconst reReplaceRegExp = /[|\\\\{}()[\\]^$+*?.-]/g;\nexport function escapeStringRegexp(str) {\n // see also: https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/escapeRegExp.js#L23\n if (reHasRegExp.test(str)) {\n return str.replace(reReplaceRegExp, \"\\\\$&\");\n }\n return str;\n}\n\n//# sourceMappingURL=escape-regexp.js.map","import { INTERCEPTION_ROUTE_MARKERS } from \"../../../../server/future/helpers/interception-routes\";\nimport { escapeStringRegexp } from \"../../escape-regexp\";\nimport { removeTrailingSlash } from \"./remove-trailing-slash\";\nconst NEXT_QUERY_PARAM_PREFIX = \"nxtP\";\nconst NEXT_INTERCEPTION_MARKER_PREFIX = \"nxtI\";\n/**\n * Parses a given parameter from a route to a data structure that can be used\n * to generate the parametrized route. Examples:\n * - `[...slug]` -> `{ key: 'slug', repeat: true, optional: true }`\n * - `...slug` -> `{ key: 'slug', repeat: true, optional: false }`\n * - `[foo]` -> `{ key: 'foo', repeat: false, optional: true }`\n * - `bar` -> `{ key: 'bar', repeat: false, optional: false }`\n */ export function parseParameter(param) {\n const optional = param.startsWith(\"[\") && param.endsWith(\"]\");\n if (optional) {\n param = param.slice(1, -1);\n }\n const repeat = param.startsWith(\"...\");\n if (repeat) {\n param = param.slice(3);\n }\n return {\n key: param,\n repeat,\n optional\n };\n}\nfunction getParametrizedRoute(route) {\n const segments = removeTrailingSlash(route).slice(1).split(\"/\");\n const groups = {};\n let groupIndex = 1;\n return {\n parameterizedRoute: segments.map((segment)=>{\n const markerMatch = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));\n const paramMatches = segment.match(/\\[((?:\\[.*\\])|.+)\\]/) // Check for parameters\n ;\n if (markerMatch && paramMatches) {\n const { key, optional, repeat } = parseParameter(paramMatches[1]);\n groups[key] = {\n pos: groupIndex++,\n repeat,\n optional\n };\n return \"/\" + escapeStringRegexp(markerMatch) + \"([^/]+?)\";\n } else if (paramMatches) {\n const { key, repeat, optional } = parseParameter(paramMatches[1]);\n groups[key] = {\n pos: groupIndex++,\n repeat,\n optional\n };\n return repeat ? optional ? \"(?:/(.+?))?\" : \"/(.+?)\" : \"/([^/]+?)\";\n } else {\n return \"/\" + escapeStringRegexp(segment);\n }\n }).join(\"\"),\n groups\n };\n}\n/**\n * From a normalized route this function generates a regular expression and\n * a corresponding groups object intended to be used to store matching groups\n * from the regular expression.\n */ export function getRouteRegex(normalizedRoute) {\n const { parameterizedRoute, groups } = getParametrizedRoute(normalizedRoute);\n return {\n re: new RegExp(\"^\" + parameterizedRoute + \"(?:/)?$\"),\n groups: groups\n };\n}\n/**\n * Builds a function to generate a minimal routeKey using only a-z and minimal\n * number of characters.\n */ function buildGetSafeRouteKey() {\n let i = 0;\n return ()=>{\n let routeKey = \"\";\n let j = ++i;\n while(j > 0){\n routeKey += String.fromCharCode(97 + (j - 1) % 26);\n j = Math.floor((j - 1) / 26);\n }\n return routeKey;\n };\n}\nfunction getSafeKeyFromSegment(param) {\n let { interceptionMarker, getSafeRouteKey, segment, routeKeys, keyPrefix } = param;\n const { key, optional, repeat } = parseParameter(segment);\n // replace any non-word characters since they can break\n // the named regex\n let cleanedKey = key.replace(/\\W/g, \"\");\n if (keyPrefix) {\n cleanedKey = \"\" + keyPrefix + cleanedKey;\n }\n let invalidKey = false;\n // check if the key is still invalid and fallback to using a known\n // safe key\n if (cleanedKey.length === 0 || cleanedKey.length > 30) {\n invalidKey = true;\n }\n if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {\n invalidKey = true;\n }\n if (invalidKey) {\n cleanedKey = getSafeRouteKey();\n }\n if (keyPrefix) {\n routeKeys[cleanedKey] = \"\" + keyPrefix + key;\n } else {\n routeKeys[cleanedKey] = key;\n }\n // if the segment has an interception marker, make sure that's part of the regex pattern\n // this is to ensure that the route with the interception marker doesn't incorrectly match\n // the non-intercepted route (ie /app/(.)[username] should not match /app/[username])\n const interceptionPrefix = interceptionMarker ? escapeStringRegexp(interceptionMarker) : \"\";\n return repeat ? optional ? \"(?:/\" + interceptionPrefix + \"(?<\" + cleanedKey + \">.+?))?\" : \"/\" + interceptionPrefix + \"(?<\" + cleanedKey + \">.+?)\" : \"/\" + interceptionPrefix + \"(?<\" + cleanedKey + \">[^/]+?)\";\n}\nfunction getNamedParametrizedRoute(route, prefixRouteKeys) {\n const segments = removeTrailingSlash(route).slice(1).split(\"/\");\n const getSafeRouteKey = buildGetSafeRouteKey();\n const routeKeys = {};\n return {\n namedParameterizedRoute: segments.map((segment)=>{\n const hasInterceptionMarker = INTERCEPTION_ROUTE_MARKERS.some((m)=>segment.startsWith(m));\n const paramMatches = segment.match(/\\[((?:\\[.*\\])|.+)\\]/) // Check for parameters\n ;\n if (hasInterceptionMarker && paramMatches) {\n const [usedMarker] = segment.split(paramMatches[0]);\n return getSafeKeyFromSegment({\n getSafeRouteKey,\n interceptionMarker: usedMarker,\n segment: paramMatches[1],\n routeKeys,\n keyPrefix: prefixRouteKeys ? NEXT_INTERCEPTION_MARKER_PREFIX : undefined\n });\n } else if (paramMatches) {\n return getSafeKeyFromSegment({\n getSafeRouteKey,\n segment: paramMatches[1],\n routeKeys,\n keyPrefix: prefixRouteKeys ? NEXT_QUERY_PARAM_PREFIX : undefined\n });\n } else {\n return \"/\" + escapeStringRegexp(segment);\n }\n }).join(\"\"),\n routeKeys\n };\n}\n/**\n * This function extends `getRouteRegex` generating also a named regexp where\n * each group is named along with a routeKeys object that indexes the assigned\n * named group with its corresponding key. When the routeKeys need to be\n * prefixed to uniquely identify internally the \"prefixRouteKey\" arg should\n * be \"true\" currently this is only the case when creating the routes-manifest\n * during the build\n */ export function getNamedRouteRegex(normalizedRoute, prefixRouteKey) {\n const result = getNamedParametrizedRoute(normalizedRoute, prefixRouteKey);\n return {\n ...getRouteRegex(normalizedRoute),\n namedRegex: \"^\" + result.namedParameterizedRoute + \"(?:/)?$\",\n routeKeys: result.routeKeys\n };\n}\n/**\n * Generates a named regexp.\n * This is intended to be using for build time only.\n */ export function getNamedMiddlewareRegex(normalizedRoute, options) {\n const { parameterizedRoute } = getParametrizedRoute(normalizedRoute);\n const { catchAll = true } = options;\n if (parameterizedRoute === \"/\") {\n let catchAllRegex = catchAll ? \".*\" : \"\";\n return {\n namedRegex: \"^/\" + catchAllRegex + \"$\"\n };\n }\n const { namedParameterizedRoute } = getNamedParametrizedRoute(normalizedRoute, false);\n let catchAllGroupedRegex = catchAll ? \"(?:(/.*)?)\" : \"\";\n return {\n namedRegex: \"^\" + namedParameterizedRoute + catchAllGroupedRegex + \"$\"\n };\n}\n\n//# sourceMappingURL=route-regex.js.map","import { compile, pathToRegexp } from \"next/dist/compiled/path-to-regexp\";\nimport { escapeStringRegexp } from \"../../escape-regexp\";\nimport { parseUrl } from \"./parse-url\";\nimport { INTERCEPTION_ROUTE_MARKERS, isInterceptionRouteAppPath } from \"../../../../server/future/helpers/interception-routes\";\nimport { NEXT_RSC_UNION_QUERY } from \"../../../../client/components/app-router-headers\";\nimport { getCookieParser } from \"../../../../server/api-utils/get-cookie-parser\";\n/**\n * Ensure only a-zA-Z are used for param names for proper interpolating\n * with path-to-regexp\n */ function getSafeParamName(paramName) {\n let newParamName = \"\";\n for(let i = 0; i < paramName.length; i++){\n const charCode = paramName.charCodeAt(i);\n if (charCode > 64 && charCode < 91 || // A-Z\n charCode > 96 && charCode < 123 // a-z\n ) {\n newParamName += paramName[i];\n }\n }\n return newParamName;\n}\nfunction escapeSegment(str, segmentName) {\n return str.replace(new RegExp(\":\" + escapeStringRegexp(segmentName), \"g\"), \"__ESC_COLON_\" + segmentName);\n}\nfunction unescapeSegments(str) {\n return str.replace(/__ESC_COLON_/gi, \":\");\n}\nexport function matchHas(req, query, has, missing) {\n if (has === void 0) has = [];\n if (missing === void 0) missing = [];\n const params = {};\n const hasMatch = (hasItem)=>{\n let value;\n let key = hasItem.key;\n switch(hasItem.type){\n case \"header\":\n {\n key = key.toLowerCase();\n value = req.headers[key];\n break;\n }\n case \"cookie\":\n {\n if (\"cookies\" in req) {\n value = req.cookies[hasItem.key];\n } else {\n const cookies = getCookieParser(req.headers)();\n value = cookies[hasItem.key];\n }\n break;\n }\n case \"query\":\n {\n value = query[key];\n break;\n }\n case \"host\":\n {\n const { host } = (req == null ? void 0 : req.headers) || {};\n // remove port from host if present\n const hostname = host == null ? void 0 : host.split(\":\", 1)[0].toLowerCase();\n value = hostname;\n break;\n }\n default:\n {\n break;\n }\n }\n if (!hasItem.value && value) {\n params[getSafeParamName(key)] = value;\n return true;\n } else if (value) {\n const matcher = new RegExp(\"^\" + hasItem.value + \"$\");\n const matches = Array.isArray(value) ? value.slice(-1)[0].match(matcher) : value.match(matcher);\n if (matches) {\n if (Array.isArray(matches)) {\n if (matches.groups) {\n Object.keys(matches.groups).forEach((groupKey)=>{\n params[groupKey] = matches.groups[groupKey];\n });\n } else if (hasItem.type === \"host\" && matches[0]) {\n params.host = matches[0];\n }\n }\n return true;\n }\n }\n return false;\n };\n const allMatch = has.every((item)=>hasMatch(item)) && !missing.some((item)=>hasMatch(item));\n if (allMatch) {\n return params;\n }\n return false;\n}\nexport function compileNonPath(value, params) {\n if (!value.includes(\":\")) {\n return value;\n }\n for (const key of Object.keys(params)){\n if (value.includes(\":\" + key)) {\n value = value.replace(new RegExp(\":\" + key + \"\\\\*\", \"g\"), \":\" + key + \"--ESCAPED_PARAM_ASTERISKS\").replace(new RegExp(\":\" + key + \"\\\\?\", \"g\"), \":\" + key + \"--ESCAPED_PARAM_QUESTION\").replace(new RegExp(\":\" + key + \"\\\\+\", \"g\"), \":\" + key + \"--ESCAPED_PARAM_PLUS\").replace(new RegExp(\":\" + key + \"(?!\\\\w)\", \"g\"), \"--ESCAPED_PARAM_COLON\" + key);\n }\n }\n value = value.replace(/(:|\\*|\\?|\\+|\\(|\\)|\\{|\\})/g, \"\\\\$1\").replace(/--ESCAPED_PARAM_PLUS/g, \"+\").replace(/--ESCAPED_PARAM_COLON/g, \":\").replace(/--ESCAPED_PARAM_QUESTION/g, \"?\").replace(/--ESCAPED_PARAM_ASTERISKS/g, \"*\");\n // the value needs to start with a forward-slash to be compiled\n // correctly\n return compile(\"/\" + value, {\n validate: false\n })(params).slice(1);\n}\nexport function prepareDestination(args) {\n const query = Object.assign({}, args.query);\n delete query.__nextLocale;\n delete query.__nextDefaultLocale;\n delete query.__nextDataReq;\n delete query.__nextInferredLocaleFromDefault;\n delete query[NEXT_RSC_UNION_QUERY];\n let escapedDestination = args.destination;\n for (const param of Object.keys({\n ...args.params,\n ...query\n })){\n escapedDestination = escapeSegment(escapedDestination, param);\n }\n const parsedDestination = parseUrl(escapedDestination);\n const destQuery = parsedDestination.query;\n const destPath = unescapeSegments(\"\" + parsedDestination.pathname + (parsedDestination.hash || \"\"));\n const destHostname = unescapeSegments(parsedDestination.hostname || \"\");\n const destPathParamKeys = [];\n const destHostnameParamKeys = [];\n pathToRegexp(destPath, destPathParamKeys);\n pathToRegexp(destHostname, destHostnameParamKeys);\n const destParams = [];\n destPathParamKeys.forEach((key)=>destParams.push(key.name));\n destHostnameParamKeys.forEach((key)=>destParams.push(key.name));\n const destPathCompiler = compile(destPath, // we don't validate while compiling the destination since we should\n // have already validated before we got to this point and validating\n // breaks compiling destinations with named pattern params from the source\n // e.g. /something:hello(.*) -> /another/:hello is broken with validation\n // since compile validation is meant for reversing and not for inserting\n // params from a separate path-regex into another\n {\n validate: false\n });\n const destHostnameCompiler = compile(destHostname, {\n validate: false\n });\n // update any params in query values\n for (const [key, strOrArray] of Object.entries(destQuery)){\n // the value needs to start with a forward-slash to be compiled\n // correctly\n if (Array.isArray(strOrArray)) {\n destQuery[key] = strOrArray.map((value)=>compileNonPath(unescapeSegments(value), args.params));\n } else if (typeof strOrArray === \"string\") {\n destQuery[key] = compileNonPath(unescapeSegments(strOrArray), args.params);\n }\n }\n // add path params to query if it's not a redirect and not\n // already defined in destination query or path\n let paramKeys = Object.keys(args.params).filter((name)=>name !== \"nextInternalLocale\");\n if (args.appendParamsToQuery && !paramKeys.some((key)=>destParams.includes(key))) {\n for (const key of paramKeys){\n if (!(key in destQuery)) {\n destQuery[key] = args.params[key];\n }\n }\n }\n let newUrl;\n // The compiler also that the interception route marker is an unnamed param, hence '0',\n // so we need to add it to the params object.\n if (isInterceptionRouteAppPath(destPath)) {\n for (const segment of destPath.split(\"/\")){\n const marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));\n if (marker) {\n args.params[\"0\"] = marker;\n break;\n }\n }\n }\n try {\n newUrl = destPathCompiler(args.params);\n const [pathname, hash] = newUrl.split(\"#\", 2);\n parsedDestination.hostname = destHostnameCompiler(args.params);\n parsedDestination.pathname = pathname;\n parsedDestination.hash = \"\" + (hash ? \"#\" : \"\") + (hash || \"\");\n delete parsedDestination.search;\n } catch (err) {\n if (err.message.match(/Expected .*? to not repeat, but got an array/)) {\n throw new Error(\"To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match\");\n }\n throw err;\n }\n // Query merge order lowest priority to highest\n // 1. initial URL query values\n // 2. path segment values\n // 3. destination specified query values\n parsedDestination.query = {\n ...query,\n ...parsedDestination.query\n };\n return {\n newUrl,\n destQuery,\n parsedDestination\n };\n}\n\n//# sourceMappingURL=prepare-destination.js.map","import { isPlainObject } from \"../shared/lib/is-plain-object\";\nexport default function isError(err) {\n return typeof err === \"object\" && err !== null && \"name\" in err && \"message\" in err;\n}\nexport function getProperError(err) {\n if (isError(err)) {\n return err;\n }\n if (process.env.NODE_ENV === \"development\") {\n // provide better error for case where `throw undefined`\n // is called in development\n if (typeof err === \"undefined\") {\n return new Error(\"An undefined error was thrown, \" + \"see here for more info: https://nextjs.org/docs/messages/threw-undefined\");\n }\n if (err === null) {\n return new Error(\"A null error was thrown, \" + \"see here for more info: https://nextjs.org/docs/messages/threw-undefined\");\n }\n }\n return new Error(isPlainObject(err) ? JSON.stringify(err) : err + \"\");\n}\n\n//# sourceMappingURL=is-error.js.map","export function getObjectClassLabel(value) {\n return Object.prototype.toString.call(value);\n}\nexport function isPlainObject(value) {\n if (getObjectClassLabel(value) !== \"[object Object]\") {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n /**\n * this used to be previously:\n *\n * `return prototype === null || prototype === Object.prototype`\n *\n * but Edge Runtime expose Object from vm, being that kind of type-checking wrongly fail.\n *\n * It was changed to the current implementation since it's resilient to serialization.\n */ return prototype === null || prototype.hasOwnProperty(\"isPrototypeOf\");\n}\n\n//# sourceMappingURL=is-plain-object.js.map","/**\n * Normalizes the pathname by removing the locale prefix if any.\n */ export class LocaleRouteNormalizer {\n constructor(provider){\n this.provider = provider;\n }\n /**\n * Normalizes the pathname by removing the locale prefix if any.\n *\n * @param pathname The pathname to normalize.\n * @returns The pathname without the locale prefix (if any).\n */ normalize(pathname) {\n const match = this.provider.analyze(pathname);\n return match.pathname;\n }\n}\n\n//# sourceMappingURL=locale-route-normalizer.js.map","class UrlNode {\n insert(urlPath) {\n this._insert(urlPath.split(\"/\").filter(Boolean), [], false);\n }\n smoosh() {\n return this._smoosh();\n }\n _smoosh(prefix) {\n if (prefix === void 0) prefix = \"/\";\n const childrenPaths = [\n ...this.children.keys()\n ].sort();\n if (this.slugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf(\"[]\"), 1);\n }\n if (this.restSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf(\"[...]\"), 1);\n }\n if (this.optionalRestSlugName !== null) {\n childrenPaths.splice(childrenPaths.indexOf(\"[[...]]\"), 1);\n }\n const routes = childrenPaths.map((c)=>this.children.get(c)._smoosh(\"\" + prefix + c + \"/\")).reduce((prev, curr)=>[\n ...prev,\n ...curr\n ], []);\n if (this.slugName !== null) {\n routes.push(...this.children.get(\"[]\")._smoosh(prefix + \"[\" + this.slugName + \"]/\"));\n }\n if (!this.placeholder) {\n const r = prefix === \"/\" ? \"/\" : prefix.slice(0, -1);\n if (this.optionalRestSlugName != null) {\n throw new Error('You cannot define a route with the same specificity as a optional catch-all route (\"' + r + '\" and \"' + r + \"[[...\" + this.optionalRestSlugName + ']]\").');\n }\n routes.unshift(r);\n }\n if (this.restSlugName !== null) {\n routes.push(...this.children.get(\"[...]\")._smoosh(prefix + \"[...\" + this.restSlugName + \"]/\"));\n }\n if (this.optionalRestSlugName !== null) {\n routes.push(...this.children.get(\"[[...]]\")._smoosh(prefix + \"[[...\" + this.optionalRestSlugName + \"]]/\"));\n }\n return routes;\n }\n _insert(urlPaths, slugNames, isCatchAll) {\n if (urlPaths.length === 0) {\n this.placeholder = false;\n return;\n }\n if (isCatchAll) {\n throw new Error(\"Catch-all must be the last part of the URL.\");\n }\n // The next segment in the urlPaths list\n let nextSegment = urlPaths[0];\n // Check if the segment matches `[something]`\n if (nextSegment.startsWith(\"[\") && nextSegment.endsWith(\"]\")) {\n // Strip `[` and `]`, leaving only `something`\n let segmentName = nextSegment.slice(1, -1);\n let isOptional = false;\n if (segmentName.startsWith(\"[\") && segmentName.endsWith(\"]\")) {\n // Strip optional `[` and `]`, leaving only `something`\n segmentName = segmentName.slice(1, -1);\n isOptional = true;\n }\n if (segmentName.startsWith(\"...\")) {\n // Strip `...`, leaving only `something`\n segmentName = segmentName.substring(3);\n isCatchAll = true;\n }\n if (segmentName.startsWith(\"[\") || segmentName.endsWith(\"]\")) {\n throw new Error(\"Segment names may not start or end with extra brackets ('\" + segmentName + \"').\");\n }\n if (segmentName.startsWith(\".\")) {\n throw new Error(\"Segment names may not start with erroneous periods ('\" + segmentName + \"').\");\n }\n function handleSlug(previousSlug, nextSlug) {\n if (previousSlug !== null) {\n // If the specific segment already has a slug but the slug is not `something`\n // This prevents collisions like:\n // pages/[post]/index.js\n // pages/[id]/index.js\n // Because currently multiple dynamic params on the same segment level are not supported\n if (previousSlug !== nextSlug) {\n // TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.\n throw new Error(\"You cannot use different slug names for the same dynamic path ('\" + previousSlug + \"' !== '\" + nextSlug + \"').\");\n }\n }\n slugNames.forEach((slug)=>{\n if (slug === nextSlug) {\n throw new Error('You cannot have the same slug name \"' + nextSlug + '\" repeat within a single dynamic path');\n }\n if (slug.replace(/\\W/g, \"\") === nextSegment.replace(/\\W/g, \"\")) {\n throw new Error('You cannot have the slug names \"' + slug + '\" and \"' + nextSlug + '\" differ only by non-word symbols within a single dynamic path');\n }\n });\n slugNames.push(nextSlug);\n }\n if (isCatchAll) {\n if (isOptional) {\n if (this.restSlugName != null) {\n throw new Error('You cannot use both an required and optional catch-all route at the same level (\"[...' + this.restSlugName + ']\" and \"' + urlPaths[0] + '\" ).');\n }\n handleSlug(this.optionalRestSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.optionalRestSlugName = segmentName;\n // nextSegment is overwritten to [[...]] so that it can later be sorted specifically\n nextSegment = \"[[...]]\";\n } else {\n if (this.optionalRestSlugName != null) {\n throw new Error('You cannot use both an optional and required catch-all route at the same level (\"[[...' + this.optionalRestSlugName + ']]\" and \"' + urlPaths[0] + '\").');\n }\n handleSlug(this.restSlugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.restSlugName = segmentName;\n // nextSegment is overwritten to [...] so that it can later be sorted specifically\n nextSegment = \"[...]\";\n }\n } else {\n if (isOptional) {\n throw new Error('Optional route parameters are not yet supported (\"' + urlPaths[0] + '\").');\n }\n handleSlug(this.slugName, segmentName);\n // slugName is kept as it can only be one particular slugName\n this.slugName = segmentName;\n // nextSegment is overwritten to [] so that it can later be sorted specifically\n nextSegment = \"[]\";\n }\n }\n // If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode\n if (!this.children.has(nextSegment)) {\n this.children.set(nextSegment, new UrlNode());\n }\n this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);\n }\n constructor(){\n this.placeholder = true;\n this.children = new Map();\n this.slugName = null;\n this.restSlugName = null;\n this.optionalRestSlugName = null;\n }\n}\nexport function getSortedRoutes(normalizedPages) {\n // First the UrlNode is created, and every UrlNode can have only 1 dynamic segment\n // Eg you can't have pages/[post]/abc.js and pages/[hello]/something-else.js\n // Only 1 dynamic segment per nesting level\n // So in the case that is test/integration/dynamic-routing it'll be this:\n // pages/[post]/comments.js\n // pages/blog/[post]/comment/[id].js\n // Both are fine because `pages/[post]` and `pages/blog` are on the same level\n // So in this case `UrlNode` created here has `this.slugName === 'post'`\n // And since your PR passed through `slugName` as an array basically it'd including it in too many possibilities\n // Instead what has to be passed through is the upwards path's dynamic names\n const root = new UrlNode();\n // Here the `root` gets injected multiple paths, and insert will break them up into sublevels\n normalizedPages.forEach((pagePath)=>root.insert(pagePath));\n // Smoosh will then sort those sublevels up to the point where you get the correct route definition priority\n return root.smoosh();\n}\n\n//# sourceMappingURL=sorted-routes.js.map","import { isDynamicRoute } from \"../../../shared/lib/router/utils\";\nimport { getRouteMatcher } from \"../../../shared/lib/router/utils/route-matcher\";\nimport { getRouteRegex } from \"../../../shared/lib/router/utils/route-regex\";\nexport class RouteMatcher {\n constructor(definition){\n this.definition = definition;\n if (isDynamicRoute(definition.pathname)) {\n this.dynamic = getRouteMatcher(getRouteRegex(definition.pathname));\n }\n }\n /**\n * Identity returns the identity part of the matcher. This is used to compare\n * a unique matcher to another. This is also used when sorting dynamic routes,\n * so it must contain the pathname part.\n */ get identity() {\n return this.definition.pathname;\n }\n get isDynamic() {\n return this.dynamic !== undefined;\n }\n match(pathname) {\n const result = this.test(pathname);\n if (!result) return null;\n return {\n definition: this.definition,\n params: result.params\n };\n }\n test(pathname) {\n if (this.dynamic) {\n const params = this.dynamic(pathname);\n if (!params) return null;\n return {\n params\n };\n }\n if (pathname === this.definition.pathname) {\n return {};\n }\n return null;\n }\n}\n\n//# sourceMappingURL=route-matcher.js.map","import { RouteMatcher } from \"./route-matcher\";\nexport class LocaleRouteMatcher extends RouteMatcher {\n /**\n * Identity returns the identity part of the matcher. This is used to compare\n * a unique matcher to another. This is also used when sorting dynamic routes,\n * so it must contain the pathname part as well.\n */ get identity() {\n var _this_definition_i18n;\n return `${this.definition.pathname}?__nextLocale=${(_this_definition_i18n = this.definition.i18n) == null ? void 0 : _this_definition_i18n.locale}`;\n }\n /**\n * Match will attempt to match the given pathname against this route while\n * also taking into account the locale information.\n *\n * @param pathname The pathname to match against.\n * @param options The options to use when matching.\n * @returns The match result, or `null` if there was no match.\n */ match(pathname, options) {\n var // If the options have a detected locale, then use that, otherwise use\n // the route's locale.\n _options_i18n, _this_definition_i18n;\n // This is like the parent `match` method but instead this injects the\n // additional `options` into the\n const result = this.test(pathname, options);\n if (!result) return null;\n return {\n definition: this.definition,\n params: result.params,\n detectedLocale: (options == null ? void 0 : (_options_i18n = options.i18n) == null ? void 0 : _options_i18n.detectedLocale) ?? ((_this_definition_i18n = this.definition.i18n) == null ? void 0 : _this_definition_i18n.locale)\n };\n }\n /**\n * Test will attempt to match the given pathname against this route while\n * also taking into account the locale information.\n *\n * @param pathname The pathname to match against.\n * @param options The options to use when matching.\n * @returns The match result, or `null` if there was no match.\n */ test(pathname, options) {\n // If this route has locale information and we have detected a locale, then\n // we need to compare the detected locale to the route's locale.\n if (this.definition.i18n && (options == null ? void 0 : options.i18n)) {\n // If we have detected a locale and it does not match this route's locale,\n // then this isn't a match!\n if (this.definition.i18n.locale && options.i18n.detectedLocale && this.definition.i18n.locale !== options.i18n.detectedLocale) {\n return null;\n }\n // Perform regular matching against the locale stripped pathname now, the\n // locale information matches!\n return super.test(options.i18n.pathname);\n }\n // If we don't have locale information, then we can just perform regular\n // matching.\n return super.test(pathname);\n }\n}\n\n//# sourceMappingURL=locale-route-matcher.js.map","import { isDynamicRoute } from \"../../../shared/lib/router/utils\";\nimport { getSortedRoutes } from \"../../../shared/lib/router/utils\";\nimport { LocaleRouteMatcher } from \"../route-matchers/locale-route-matcher\";\nimport { ensureLeadingSlash } from \"../../../shared/lib/page-path/ensure-leading-slash\";\nimport { DetachedPromise } from \"../../../lib/detached-promise\";\nexport class DefaultRouteMatcherManager {\n /**\n * When this value changes, it indicates that a change has been introduced\n * that requires recompilation.\n */ get compilationID() {\n return this.providers.length;\n }\n async waitTillReady() {\n if (this.waitTillReadyPromise) {\n await this.waitTillReadyPromise;\n delete this.waitTillReadyPromise;\n }\n }\n async reload() {\n const { promise, resolve, reject } = new DetachedPromise();\n this.waitTillReadyPromise = promise;\n // Grab the compilation ID for this run, we'll verify it at the end to\n // ensure that if any routes were added before reloading is finished that\n // we error out.\n const compilationID = this.compilationID;\n try {\n // Collect all the matchers from each provider.\n const matchers = [];\n // Get all the providers matchers.\n const providersMatchers = await Promise.all(this.providers.map((provider)=>provider.matchers()));\n // Use this to detect duplicate pathnames.\n const all = new Map();\n const duplicates = {};\n for (const providerMatchers of providersMatchers){\n for (const matcher of providerMatchers){\n // Reset duplicated matches when reloading from pages conflicting state.\n if (matcher.duplicated) delete matcher.duplicated;\n // Test to see if the matcher being added is a duplicate.\n const duplicate = all.get(matcher.definition.pathname);\n if (duplicate) {\n // This looks a little weird, but essentially if the pathname\n // already exists in the duplicates map, then we got that array\n // reference. Otherwise, we create a new array with the original\n // duplicate first. Then we push the new matcher into the duplicate\n // array, and reset it to the duplicates object (which may be a\n // no-op if the pathname already existed in the duplicates object).\n // Then we set the array of duplicates on both the original\n // duplicate object and the new one, so we can keep them in sync.\n // If a new duplicate is found, and it matches an existing pathname,\n // the retrieval of the `other` will actually return the array\n // reference used by all other duplicates. This is why ReadonlyArray\n // is so important! Array's are always references!\n const others = duplicates[matcher.definition.pathname] ?? [\n duplicate\n ];\n others.push(matcher);\n duplicates[matcher.definition.pathname] = others;\n // Add duplicated details to each route.\n duplicate.duplicated = others;\n matcher.duplicated = others;\n // TODO: see if we should error for duplicates in production?\n }\n matchers.push(matcher);\n // Add the matcher's pathname to the set.\n all.set(matcher.definition.pathname, matcher);\n }\n }\n // Update the duplicate matchers. This is used in the development manager\n // to warn about duplicates.\n this.matchers.duplicates = duplicates;\n // If the cache is the same as what we just parsed, we can exit now. We\n // can tell by using the `===` which compares object identity, which for\n // the manifest matchers, will return the same matcher each time.\n if (this.previousMatchers.length === matchers.length && this.previousMatchers.every((cachedMatcher, index)=>cachedMatcher === matchers[index])) {\n return;\n }\n this.previousMatchers = matchers;\n // For matchers that are for static routes, filter them now.\n this.matchers.static = matchers.filter((matcher)=>!matcher.isDynamic);\n // For matchers that are for dynamic routes, filter them and sort them now.\n const dynamic = matchers.filter((matcher)=>matcher.isDynamic);\n // As `getSortedRoutes` only takes an array of strings, we need to create\n // a map of the pathnames (used for sorting) and the matchers. When we\n // have locales, there may be multiple matches for the same pathname. To\n // handle this, we keep a map of all the indexes (in `reference`) and\n // merge them in later.\n const reference = new Map();\n const pathnames = new Array();\n for(let index = 0; index < dynamic.length; index++){\n // Grab the pathname from the definition.\n const pathname = dynamic[index].definition.pathname;\n // Grab the index in the dynamic array, push it into the reference.\n const indexes = reference.get(pathname) ?? [];\n indexes.push(index);\n // If this is the first one set it. If it isn't, we don't need to\n // because pushing above on the array will mutate the array already\n // stored there because array's are always a reference!\n if (indexes.length === 1) reference.set(pathname, indexes);\n else continue;\n pathnames.push(pathname);\n }\n // Sort the array of pathnames.\n const sorted = getSortedRoutes(pathnames);\n // For each of the sorted pathnames, iterate over them, grabbing the list\n // of indexes and merging them back into the new `sortedDynamicMatchers`\n // array. The order of the same matching pathname doesn't matter because\n // they will have other matching characteristics (like the locale) that\n // is considered.\n const sortedDynamicMatchers = [];\n for (const pathname of sorted){\n const indexes = reference.get(pathname);\n if (!Array.isArray(indexes)) {\n throw new Error(\"Invariant: expected to find identity in indexes map\");\n }\n const dynamicMatches = indexes.map((index)=>dynamic[index]);\n sortedDynamicMatchers.push(...dynamicMatches);\n }\n this.matchers.dynamic = sortedDynamicMatchers;\n // This means that there was a new matcher pushed while we were waiting\n if (this.compilationID !== compilationID) {\n throw new Error(\"Invariant: expected compilation to finish before new matchers were added, possible missing await\");\n }\n } catch (err) {\n reject(err);\n } finally{\n // The compilation ID matched, so mark the complication as finished.\n this.lastCompilationID = compilationID;\n resolve();\n }\n }\n push(provider) {\n this.providers.push(provider);\n }\n async test(pathname, options) {\n // See if there's a match for the pathname...\n const match = await this.match(pathname, options);\n // This default implementation only needs to check to see if there _was_ a\n // match. The development matcher actually changes it's behavior by not\n // recompiling the routes.\n return match !== null;\n }\n async match(pathname, options) {\n // \"Iterate\" over the match options. Once we found a single match, exit with\n // it, otherwise return null below. If no match is found, the inner block\n // won't be called.\n for await (const match of this.matchAll(pathname, options)){\n return match;\n }\n return null;\n }\n /**\n * This is a point for other managers to override to inject other checking\n * behavior like duplicate route checking on a per-request basis.\n *\n * @param pathname the pathname to validate against\n * @param matcher the matcher to validate/test with\n * @returns the match if found\n */ validate(pathname, matcher, options) {\n var _options_i18n;\n if (matcher instanceof LocaleRouteMatcher) {\n return matcher.match(pathname, options);\n }\n // If the locale was inferred from the default locale, then it will have\n // already added a locale to the pathname. We need to remove it before\n // matching because this matcher is not locale aware.\n if ((_options_i18n = options.i18n) == null ? void 0 : _options_i18n.inferredFromDefault) {\n return matcher.match(options.i18n.pathname);\n }\n return matcher.match(pathname);\n }\n async *matchAll(pathname, options) {\n // Guard against the matcher manager from being run before it needs to be\n // recompiled. This was preferred to re-running the compilation here because\n // it should be re-ran only when it changes. If a match is attempted before\n // this is done, it indicates that there is a case where a provider is added\n // before it was recompiled (an error). We also don't want to affect request\n // times.\n if (this.lastCompilationID !== this.compilationID) {\n throw new Error(\"Invariant: expected routes to have been loaded before match\");\n }\n // Ensure that path matching is done with a leading slash.\n pathname = ensureLeadingSlash(pathname);\n // If this pathname doesn't look like a dynamic route, and this pathname is\n // listed in the normalized list of routes, then return it. This ensures\n // that when a route like `/user/[id]` is encountered, it doesn't just match\n // with the list of normalized routes.\n if (!isDynamicRoute(pathname)) {\n for (const matcher of this.matchers.static){\n const match = this.validate(pathname, matcher, options);\n if (!match) continue;\n yield match;\n }\n }\n // If we should skip handling dynamic routes, exit now.\n if (options == null ? void 0 : options.skipDynamic) return null;\n // Loop over the dynamic matchers, yielding each match.\n for (const matcher of this.matchers.dynamic){\n const match = this.validate(pathname, matcher, options);\n if (!match) continue;\n yield match;\n }\n // We tried direct matching against the pathname and against all the dynamic\n // paths, so there was no match.\n return null;\n }\n constructor(){\n this.providers = [];\n this.matchers = {\n static: [],\n dynamic: [],\n duplicates: {}\n };\n this.lastCompilationID = this.compilationID;\n this.previousMatchers = [];\n }\n}\n\n//# sourceMappingURL=default-route-matcher-manager.js.map","/**\n * Normalizers combines many normalizers into a single normalizer interface that\n * will normalize the inputted pathname with each normalizer in order.\n */ export class Normalizers {\n constructor(normalizers = []){\n this.normalizers = normalizers;\n }\n push(normalizer) {\n this.normalizers.push(normalizer);\n }\n normalize(pathname) {\n return this.normalizers.reduce((normalized, normalizer)=>normalizer.normalize(normalized), pathname);\n }\n}\n\n//# sourceMappingURL=normalizers.js.map","import path from \"../../../shared/lib/isomorphic/path\";\nexport class PrefixingNormalizer {\n constructor(...prefixes){\n this.prefix = path.posix.join(...prefixes);\n }\n normalize(pathname) {\n return path.posix.join(this.prefix, pathname);\n }\n}\n\n//# sourceMappingURL=prefixing-normalizer.js.map","import { ensureLeadingSlash } from \"./ensure-leading-slash\";\nimport { isDynamicRoute } from \"../router/utils\";\nimport { NormalizeError } from \"../utils\";\n/**\n * Takes a page and transforms it into its file counterpart ensuring that the\n * output is normalized. Note this function is not idempotent because a page\n * `/index` can be referencing `/index/index.js` and `/index/index` could be\n * referencing `/index/index/index.js`. Examples:\n * - `/` -> `/index`\n * - `/index/foo` -> `/index/index/foo`\n * - `/index` -> `/index/index`\n */ export function normalizePagePath(page) {\n const normalized = /^\\/index(\\/|$)/.test(page) && !isDynamicRoute(page) ? \"/index\" + page : page === \"/\" ? \"/index\" : ensureLeadingSlash(page);\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n const { posix } = require(\"path\");\n const resolvedPage = posix.normalize(normalized);\n if (resolvedPage !== normalized) {\n throw new NormalizeError(\"Requested and resolved page mismatch: \" + normalized + \" \" + resolvedPage);\n }\n }\n return normalized;\n}\n\n//# sourceMappingURL=normalize-page-path.js.map","import { Normalizers } from \"../../normalizers\";\nimport { PrefixingNormalizer } from \"../../prefixing-normalizer\";\nimport { normalizePagePath } from \"../../../../../shared/lib/page-path/normalize-page-path\";\nexport class AppBundlePathNormalizer extends PrefixingNormalizer {\n constructor(){\n super(\"app\");\n }\n normalize(page) {\n return super.normalize(normalizePagePath(page));\n }\n}\nexport class DevAppBundlePathNormalizer extends Normalizers {\n constructor(pageNormalizer){\n super([\n // This should normalize the filename to a page.\n pageNormalizer,\n // Normalize the app page to a pathname.\n new AppBundlePathNormalizer()\n ]);\n }\n normalize(filename) {\n return super.normalize(filename);\n }\n}\n\n//# sourceMappingURL=app-bundle-path-normalizer.js.map","import { SERVER_DIRECTORY } from \"../../../../../shared/lib/constants\";\nimport { PrefixingNormalizer } from \"../../prefixing-normalizer\";\nexport class AppFilenameNormalizer extends PrefixingNormalizer {\n constructor(distDir){\n super(distDir, SERVER_DIRECTORY);\n }\n normalize(manifestFilename) {\n return super.normalize(manifestFilename);\n }\n}\n\n//# sourceMappingURL=app-filename-normalizer.js.map","export function wrapNormalizerFn(fn) {\n return {\n normalize: fn\n };\n}\n\n//# sourceMappingURL=wrap-normalizer-fn.js.map","/**\n * UnderscoreNormalizer replaces all instances of %5F with _.\n */ export class UnderscoreNormalizer {\n normalize(pathname) {\n return pathname.replace(/%5F/g, \"_\");\n }\n}\n\n//# sourceMappingURL=underscore-normalizer.js.map","import { normalizeAppPath } from \"../../../../../shared/lib/router/utils/app-paths\";\nimport { Normalizers } from \"../../normalizers\";\nimport { wrapNormalizerFn } from \"../../wrap-normalizer-fn\";\nimport { UnderscoreNormalizer } from \"../../underscore-normalizer\";\nexport class AppPathnameNormalizer extends Normalizers {\n constructor(){\n super([\n // The pathname to match should have the trailing `/page` and other route\n // group information stripped from it.\n wrapNormalizerFn(normalizeAppPath),\n // The page should have the `%5F` characters replaced with `_` characters.\n new UnderscoreNormalizer()\n ]);\n }\n normalize(page) {\n return super.normalize(page);\n }\n}\nexport class DevAppPathnameNormalizer extends Normalizers {\n constructor(pageNormalizer){\n super([\n // This should normalize the filename to a page.\n pageNormalizer,\n // Normalize the app page to a pathname.\n new AppPathnameNormalizer()\n ]);\n }\n normalize(filename) {\n return super.normalize(filename);\n }\n}\n\n//# sourceMappingURL=app-pathname-normalizer.js.map","import { AppBundlePathNormalizer, DevAppBundlePathNormalizer } from \"./app-bundle-path-normalizer\";\nimport { AppFilenameNormalizer } from \"./app-filename-normalizer\";\nimport { DevAppPageNormalizer } from \"./app-page-normalizer\";\nimport { AppPathnameNormalizer, DevAppPathnameNormalizer } from \"./app-pathname-normalizer\";\nexport class AppNormalizers {\n constructor(distDir){\n this.filename = new AppFilenameNormalizer(distDir);\n this.pathname = new AppPathnameNormalizer();\n this.bundlePath = new AppBundlePathNormalizer();\n }\n}\nexport class DevAppNormalizers {\n constructor(appDir, extensions){\n this.page = new DevAppPageNormalizer(appDir, extensions);\n this.pathname = new DevAppPathnameNormalizer(this.page);\n this.bundlePath = new DevAppBundlePathNormalizer(this.page);\n }\n}\n\n//# sourceMappingURL=index.js.map","import { RouteMatcher } from \"./route-matcher\";\nexport class AppPageRouteMatcher extends RouteMatcher {\n get identity() {\n return `${this.definition.pathname}?__nextPage=${this.definition.page}`;\n }\n}\n\n//# sourceMappingURL=app-page-route-matcher.js.map","/**\n * This will memoize the matchers if the loaded data is comparable.\n */ export class CachedRouteMatcherProvider {\n constructor(loader){\n this.loader = loader;\n this.cached = [];\n }\n async matchers() {\n const data = await this.loader.load();\n if (!data) return [];\n // Return the cached matchers if the data has not changed.\n if (this.data && this.loader.compare(this.data, data)) return this.cached;\n this.data = data;\n // Transform the manifest into matchers.\n const matchers = await this.transform(data);\n // Cache the matchers.\n this.cached = matchers;\n return matchers;\n }\n}\n\n//# sourceMappingURL=cached-route-matcher-provider.js.map","import { CachedRouteMatcherProvider } from \"./helpers/cached-route-matcher-provider\";\nexport class ManifestRouteMatcherProvider extends CachedRouteMatcherProvider {\n constructor(manifestName, manifestLoader){\n super({\n load: async ()=>manifestLoader.load(manifestName),\n compare: (left, right)=>left === right\n });\n }\n}\n\n//# sourceMappingURL=manifest-route-matcher-provider.js.map","import { isAppPageRoute } from \"../../../lib/is-app-page-route\";\nimport { APP_PATHS_MANIFEST } from \"../../../shared/lib/constants\";\nimport { AppNormalizers } from \"../normalizers/built/app\";\nimport { RouteKind } from \"../route-kind\";\nimport { AppPageRouteMatcher } from \"../route-matchers/app-page-route-matcher\";\nimport { ManifestRouteMatcherProvider } from \"./manifest-route-matcher-provider\";\nexport class AppPageRouteMatcherProvider extends ManifestRouteMatcherProvider {\n constructor(distDir, manifestLoader){\n super(APP_PATHS_MANIFEST, manifestLoader);\n this.normalizers = new AppNormalizers(distDir);\n }\n async transform(manifest) {\n // This matcher only matches app pages.\n const pages = Object.keys(manifest).filter((page)=>isAppPageRoute(page));\n // Collect all the app paths for each page. This could include any parallel\n // routes.\n const allAppPaths = {};\n for (const page of pages){\n const pathname = this.normalizers.pathname.normalize(page);\n if (pathname in allAppPaths) allAppPaths[pathname].push(page);\n else allAppPaths[pathname] = [\n page\n ];\n }\n // Format the routes.\n const matchers = [];\n for (const [pathname, appPaths] of Object.entries(allAppPaths)){\n // TODO-APP: (wyattjoh) this is a hack right now, should be more deterministic\n const page = appPaths[0];\n const filename = this.normalizers.filename.normalize(manifest[page]);\n const bundlePath = this.normalizers.bundlePath.normalize(page);\n matchers.push(new AppPageRouteMatcher({\n kind: RouteKind.APP_PAGE,\n pathname,\n page,\n bundlePath,\n filename,\n appPaths\n }));\n }\n return matchers;\n }\n}\n\n//# sourceMappingURL=app-page-route-matcher-provider.js.map","export function isAppPageRoute(route) {\n return route.endsWith(\"/page\");\n}\n\n//# sourceMappingURL=is-app-page-route.js.map","import { RouteMatcher } from \"./route-matcher\";\nexport class AppRouteRouteMatcher extends RouteMatcher {\n}\n\n//# sourceMappingURL=app-route-route-matcher.js.map","import { isAppRouteRoute } from \"../../../lib/is-app-route-route\";\nimport { APP_PATHS_MANIFEST } from \"../../../shared/lib/constants\";\nimport { RouteKind } from \"../route-kind\";\nimport { AppRouteRouteMatcher } from \"../route-matchers/app-route-route-matcher\";\nimport { ManifestRouteMatcherProvider } from \"./manifest-route-matcher-provider\";\nimport { AppNormalizers } from \"../normalizers/built/app\";\nexport class AppRouteRouteMatcherProvider extends ManifestRouteMatcherProvider {\n constructor(distDir, manifestLoader){\n super(APP_PATHS_MANIFEST, manifestLoader);\n this.normalizers = new AppNormalizers(distDir);\n }\n async transform(manifest) {\n // This matcher only matches app routes.\n const pages = Object.keys(manifest).filter((page)=>isAppRouteRoute(page));\n // Format the routes.\n const matchers = [];\n for (const page of pages){\n const filename = this.normalizers.filename.normalize(manifest[page]);\n const pathname = this.normalizers.pathname.normalize(page);\n const bundlePath = this.normalizers.bundlePath.normalize(page);\n matchers.push(new AppRouteRouteMatcher({\n kind: RouteKind.APP_ROUTE,\n pathname,\n page,\n bundlePath,\n filename\n }));\n }\n return matchers;\n }\n}\n\n//# sourceMappingURL=app-route-route-matcher-provider.js.map","export function isAppRouteRoute(route) {\n return route.endsWith(\"/route\");\n}\n\n//# sourceMappingURL=is-app-route-route.js.map","export function isAPIRoute(value) {\n return value === \"/api\" || Boolean(value == null ? void 0 : value.startsWith(\"/api/\"));\n}\n\n//# sourceMappingURL=is-api-route.js.map","import { LocaleRouteMatcher } from \"./locale-route-matcher\";\nimport { RouteMatcher } from \"./route-matcher\";\nexport class PagesAPIRouteMatcher extends RouteMatcher {\n}\nexport class PagesAPILocaleRouteMatcher extends LocaleRouteMatcher {\n}\n\n//# sourceMappingURL=pages-api-route-matcher.js.map","import { normalizePagePath } from \"../../../../../shared/lib/page-path/normalize-page-path\";\nimport { Normalizers } from \"../../normalizers\";\nimport { PrefixingNormalizer } from \"../../prefixing-normalizer\";\nimport { wrapNormalizerFn } from \"../../wrap-normalizer-fn\";\nexport class PagesBundlePathNormalizer extends Normalizers {\n constructor(){\n super([\n // The bundle path should have the trailing `/index` stripped from\n // it.\n wrapNormalizerFn(normalizePagePath),\n // The page should prefixed with `pages/`.\n new PrefixingNormalizer(\"pages\")\n ]);\n }\n normalize(page) {\n return super.normalize(page);\n }\n}\nexport class DevPagesBundlePathNormalizer extends Normalizers {\n constructor(pagesNormalizer){\n super([\n // This should normalize the filename to a page.\n pagesNormalizer,\n // Normalize the app page to a pathname.\n new PagesBundlePathNormalizer()\n ]);\n }\n normalize(filename) {\n return super.normalize(filename);\n }\n}\n\n//# sourceMappingURL=pages-bundle-path-normalizer.js.map","import { SERVER_DIRECTORY } from \"../../../../../shared/lib/constants\";\nimport { PrefixingNormalizer } from \"../../prefixing-normalizer\";\nexport class PagesFilenameNormalizer extends PrefixingNormalizer {\n constructor(distDir){\n super(distDir, SERVER_DIRECTORY);\n }\n normalize(manifestFilename) {\n return super.normalize(manifestFilename);\n }\n}\n\n//# sourceMappingURL=pages-filename-normalizer.js.map","import { DevPagesBundlePathNormalizer, PagesBundlePathNormalizer } from \"./pages-bundle-path-normalizer\";\nimport { PagesFilenameNormalizer } from \"./pages-filename-normalizer\";\nimport { DevPagesPageNormalizer } from \"./pages-page-normalizer\";\nimport { DevPagesPathnameNormalizer } from \"./pages-pathname-normalizer\";\nexport class PagesNormalizers {\n constructor(distDir){\n this.filename = new PagesFilenameNormalizer(distDir);\n this.bundlePath = new PagesBundlePathNormalizer();\n // You'd think that we'd require a `pathname` normalizer here, but for\n // `/pages` we have to handle i18n routes, which means that we need to\n // analyze the page path to determine the locale prefix and it's locale.\n }\n}\nexport class DevPagesNormalizers {\n constructor(pagesDir, extensions){\n this.page = new DevPagesPageNormalizer(pagesDir, extensions);\n this.pathname = new DevPagesPathnameNormalizer(pagesDir, extensions);\n this.bundlePath = new DevPagesBundlePathNormalizer(this.page);\n }\n}\n\n//# sourceMappingURL=index.js.map","import { isAPIRoute } from \"../../../lib/is-api-route\";\nimport { PAGES_MANIFEST } from \"../../../shared/lib/constants\";\nimport { RouteKind } from \"../route-kind\";\nimport { PagesAPILocaleRouteMatcher, PagesAPIRouteMatcher } from \"../route-matchers/pages-api-route-matcher\";\nimport { ManifestRouteMatcherProvider } from \"./manifest-route-matcher-provider\";\nimport { PagesNormalizers } from \"../normalizers/built/pages\";\nexport class PagesAPIRouteMatcherProvider extends ManifestRouteMatcherProvider {\n constructor(distDir, manifestLoader, i18nProvider){\n super(PAGES_MANIFEST, manifestLoader);\n this.i18nProvider = i18nProvider;\n this.normalizers = new PagesNormalizers(distDir);\n }\n async transform(manifest) {\n // This matcher is only for Pages API routes.\n const pathnames = Object.keys(manifest).filter((pathname)=>isAPIRoute(pathname));\n const matchers = [];\n for (const page of pathnames){\n if (this.i18nProvider) {\n // Match the locale on the page name, or default to the default locale.\n const { detectedLocale, pathname } = this.i18nProvider.analyze(page);\n matchers.push(new PagesAPILocaleRouteMatcher({\n kind: RouteKind.PAGES_API,\n pathname,\n page,\n bundlePath: this.normalizers.bundlePath.normalize(page),\n filename: this.normalizers.filename.normalize(manifest[page]),\n i18n: {\n locale: detectedLocale\n }\n }));\n } else {\n matchers.push(new PagesAPIRouteMatcher({\n kind: RouteKind.PAGES_API,\n // In `pages/`, the page is the same as the pathname.\n pathname: page,\n page,\n bundlePath: this.normalizers.bundlePath.normalize(page),\n filename: this.normalizers.filename.normalize(manifest[page])\n }));\n }\n }\n return matchers;\n }\n}\n\n//# sourceMappingURL=pages-api-route-matcher-provider.js.map","import { LocaleRouteMatcher } from \"./locale-route-matcher\";\nimport { RouteMatcher } from \"./route-matcher\";\nexport class PagesRouteMatcher extends RouteMatcher {\n}\nexport class PagesLocaleRouteMatcher extends LocaleRouteMatcher {\n}\n\n//# sourceMappingURL=pages-route-matcher.js.map","import { isAPIRoute } from \"../../../lib/is-api-route\";\nimport { BLOCKED_PAGES, PAGES_MANIFEST } from \"../../../shared/lib/constants\";\nimport { RouteKind } from \"../route-kind\";\nimport { PagesLocaleRouteMatcher, PagesRouteMatcher } from \"../route-matchers/pages-route-matcher\";\nimport { ManifestRouteMatcherProvider } from \"./manifest-route-matcher-provider\";\nimport { PagesNormalizers } from \"../normalizers/built/pages\";\nexport class PagesRouteMatcherProvider extends ManifestRouteMatcherProvider {\n constructor(distDir, manifestLoader, i18nProvider){\n super(PAGES_MANIFEST, manifestLoader);\n this.i18nProvider = i18nProvider;\n this.normalizers = new PagesNormalizers(distDir);\n }\n async transform(manifest) {\n // This matcher is only for Pages routes, not Pages API routes which are\n // included in this manifest.\n const pathnames = Object.keys(manifest).filter((pathname)=>!isAPIRoute(pathname))// Remove any blocked pages (page that can't be routed to, like error or\n // internal pages).\n .filter((pathname)=>{\n var _this_i18nProvider;\n const normalized = ((_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.analyze(pathname).pathname) ?? pathname;\n // Skip any blocked pages.\n if (BLOCKED_PAGES.includes(normalized)) return false;\n return true;\n });\n const matchers = [];\n for (const page of pathnames){\n if (this.i18nProvider) {\n // Match the locale on the page name, or default to the default locale.\n const { detectedLocale, pathname } = this.i18nProvider.analyze(page);\n matchers.push(new PagesLocaleRouteMatcher({\n kind: RouteKind.PAGES,\n pathname,\n page,\n bundlePath: this.normalizers.bundlePath.normalize(page),\n filename: this.normalizers.filename.normalize(manifest[page]),\n i18n: {\n locale: detectedLocale\n }\n }));\n } else {\n matchers.push(new PagesRouteMatcher({\n kind: RouteKind.PAGES,\n // In `pages/`, the page is the same as the pathname.\n pathname: page,\n page,\n bundlePath: this.normalizers.bundlePath.normalize(page),\n filename: this.normalizers.filename.normalize(manifest[page])\n }));\n }\n }\n return matchers;\n }\n}\n\n//# sourceMappingURL=pages-route-matcher-provider.js.map","export class ServerManifestLoader {\n constructor(getter){\n this.getter = getter;\n }\n load(name) {\n return this.getter(name);\n }\n}\n\n//# sourceMappingURL=server-manifest-loader.js.map","/**\n * The I18NProvider is used to match locale aware routes, detect the locale from\n * the pathname and hostname and normalize the pathname by removing the locale\n * prefix.\n */ export class I18NProvider {\n constructor(config){\n var _config_domains;\n this.config = config;\n if (!config.locales.length) {\n throw new Error(\"Invariant: No locales provided\");\n }\n this.lowerCaseLocales = config.locales.map((locale)=>locale.toLowerCase());\n this.lowerCaseDomains = (_config_domains = config.domains) == null ? void 0 : _config_domains.map((domainLocale)=>{\n var _domainLocale_locales;\n const domain = domainLocale.domain.toLowerCase();\n return {\n defaultLocale: domainLocale.defaultLocale.toLowerCase(),\n hostname: domain.split(\":\", 1)[0],\n domain,\n locales: (_domainLocale_locales = domainLocale.locales) == null ? void 0 : _domainLocale_locales.map((locale)=>locale.toLowerCase()),\n http: domainLocale.http\n };\n });\n }\n /**\n * Detects the domain locale from the hostname and the detected locale if\n * provided.\n *\n * @param hostname The hostname to detect the domain locale from, this must be lowercased.\n * @param detectedLocale The detected locale to use if the hostname does not match.\n * @returns The domain locale if found, `undefined` otherwise.\n */ detectDomainLocale(hostname, detectedLocale) {\n if (!hostname || !this.lowerCaseDomains || !this.config.domains) return;\n if (detectedLocale) detectedLocale = detectedLocale.toLowerCase();\n for(let i = 0; i < this.lowerCaseDomains.length; i++){\n var // Configuration validation ensures that the locale is not repeated in\n // other domains locales.\n _domainLocale_locales;\n const domainLocale = this.lowerCaseDomains[i];\n if (// We assume that the hostname is already lowercased.\n domainLocale.hostname === hostname || ((_domainLocale_locales = domainLocale.locales) == null ? void 0 : _domainLocale_locales.some((locale)=>locale === detectedLocale))) {\n return this.config.domains[i];\n }\n }\n return;\n }\n /**\n * Pulls the pre-computed locale and inference results from the query\n * object.\n *\n * @param pathname the pathname that could contain a locale prefix\n * @param query the query object\n * @returns the locale analysis result\n */ fromQuery(pathname, query) {\n const detectedLocale = query.__nextLocale;\n // If a locale was detected on the query, analyze the pathname to ensure\n // that the locale matches.\n if (detectedLocale) {\n const analysis = this.analyze(pathname);\n // If the analysis contained a locale we should validate it against the\n // query and strip it from the pathname.\n if (analysis.detectedLocale) {\n if (analysis.detectedLocale !== detectedLocale) {\n throw new Error(`Invariant: The detected locale does not match the locale in the query. Expected to find '${detectedLocale}' in '${pathname}' but found '${analysis.detectedLocale}'}`);\n }\n pathname = analysis.pathname;\n }\n }\n return {\n pathname,\n detectedLocale,\n inferredFromDefault: query.__nextInferredLocaleFromDefault === \"1\"\n };\n }\n /**\n * Validates that the locale is valid.\n *\n * @param locale The locale to validate.\n * @returns `true` if the locale is valid, `false` otherwise.\n */ validate(locale) {\n return this.lowerCaseLocales.includes(locale.toLowerCase());\n }\n /**\n * Validates that the locales in the query object are valid.\n *\n * @param query The query object to validate.\n * @returns `true` if the locale is valid, `false` otherwise.\n */ validateQuery(query) {\n if (query.__nextLocale && !this.validate(query.__nextLocale)) {\n return false;\n }\n if (query.__nextDefaultLocale && !this.validate(query.__nextDefaultLocale)) {\n return false;\n }\n return true;\n }\n /**\n * Analyzes the pathname for a locale and returns the pathname without it.\n *\n * @param pathname The pathname that could contain a locale prefix.\n * @param options The options to use when matching the locale.\n * @returns The matched locale and the pathname without the locale prefix\n * (if any).\n */ analyze(pathname, options = {}) {\n let detectedLocale = options.defaultLocale;\n // By default, we assume that the default locale was inferred if there was\n // no detected locale.\n let inferredFromDefault = typeof detectedLocale === \"string\";\n // The first segment will be empty, because it has a leading `/`. If\n // there is no further segment, there is no locale (or it's the default).\n const segments = pathname.split(\"/\", 2);\n if (!segments[1]) return {\n detectedLocale,\n pathname,\n inferredFromDefault\n };\n // The second segment will contain the locale part if any.\n const segment = segments[1].toLowerCase();\n // See if the segment matches one of the locales. If it doesn't, there is\n // no locale (or it's the default).\n const index = this.lowerCaseLocales.indexOf(segment);\n if (index < 0) return {\n detectedLocale,\n pathname,\n inferredFromDefault\n };\n // Return the case-sensitive locale.\n detectedLocale = this.config.locales[index];\n inferredFromDefault = false;\n // Remove the `/${locale}` part of the pathname.\n pathname = pathname.slice(detectedLocale.length + 1) || \"/\";\n return {\n detectedLocale,\n pathname,\n inferredFromDefault\n };\n }\n}\n\n//# sourceMappingURL=i18n-provider.js.map","import { pipeToNodeResponse } from \"./pipe-readable\";\nimport { splitCookiesString } from \"./web/utils\";\n/**\n * Sends the response on the underlying next response object.\n *\n * @param req the underlying request object\n * @param res the underlying response object\n * @param response the response to send\n */ export async function sendResponse(req, res, response, waitUntil) {\n // Don't use in edge runtime\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n var // Copy over the response headers.\n _response_headers;\n // Copy over the response status.\n res.statusCode = response.status;\n res.statusMessage = response.statusText;\n (_response_headers = response.headers) == null ? void 0 : _response_headers.forEach((value, name)=>{\n // The append handling is special cased for `set-cookie`.\n if (name.toLowerCase() === \"set-cookie\") {\n // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici\n for (const cookie of splitCookiesString(value)){\n res.appendHeader(name, cookie);\n }\n } else {\n res.appendHeader(name, value);\n }\n });\n /**\n * The response can't be directly piped to the underlying response. The\n * following is duplicated from the edge runtime handler.\n *\n * See packages/next/server/next-server.ts\n */ const originalResponse = res.originalResponse;\n // A response body must not be sent for HEAD requests. See https://httpwg.org/specs/rfc9110.html#HEAD\n if (response.body && req.method !== \"HEAD\") {\n await pipeToNodeResponse(response.body, originalResponse, waitUntil);\n } else {\n originalResponse.end();\n }\n }\n}\n\n//# sourceMappingURL=send-response.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/dist/client/components/static-generation-async-storage.external.js\");","import { ResponseCookies } from \"../cookies\";\nimport { ReflectAdapter } from \"./reflect\";\nimport { staticGenerationAsyncStorage } from \"../../../../client/components/static-generation-async-storage.external\";\n/**\n * @internal\n */ export class ReadonlyRequestCookiesError extends Error {\n constructor(){\n super(\"Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options\");\n }\n static callable() {\n throw new ReadonlyRequestCookiesError();\n }\n}\nexport class RequestCookiesAdapter {\n static seal(cookies) {\n return new Proxy(cookies, {\n get (target, prop, receiver) {\n switch(prop){\n case \"clear\":\n case \"delete\":\n case \"set\":\n return ReadonlyRequestCookiesError.callable;\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n }\n}\nconst SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for(\"next.mutated.cookies\");\nexport function getModifiedCookieValues(cookies) {\n const modified = cookies[SYMBOL_MODIFY_COOKIE_VALUES];\n if (!modified || !Array.isArray(modified) || modified.length === 0) {\n return [];\n }\n return modified;\n}\nexport function appendMutableCookies(headers, mutableCookies) {\n const modifiedCookieValues = getModifiedCookieValues(mutableCookies);\n if (modifiedCookieValues.length === 0) {\n return false;\n }\n // Return a new response that extends the response with\n // the modified cookies as fallbacks. `res` cookies\n // will still take precedence.\n const resCookies = new ResponseCookies(headers);\n const returnedCookies = resCookies.getAll();\n // Set the modified cookies as fallbacks.\n for (const cookie of modifiedCookieValues){\n resCookies.set(cookie);\n }\n // Set the original cookies as the final values.\n for (const cookie of returnedCookies){\n resCookies.set(cookie);\n }\n return true;\n}\nexport class MutableRequestCookiesAdapter {\n static wrap(cookies, onUpdateCookies) {\n const responseCookies = new ResponseCookies(new Headers());\n for (const cookie of cookies.getAll()){\n responseCookies.set(cookie);\n }\n let modifiedValues = [];\n const modifiedCookies = new Set();\n const updateResponseCookies = ()=>{\n // TODO-APP: change method of getting staticGenerationAsyncStore\n const staticGenerationAsyncStore = staticGenerationAsyncStorage.getStore();\n if (staticGenerationAsyncStore) {\n staticGenerationAsyncStore.pathWasRevalidated = true;\n }\n const allCookies = responseCookies.getAll();\n modifiedValues = allCookies.filter((c)=>modifiedCookies.has(c.name));\n if (onUpdateCookies) {\n const serializedCookies = [];\n for (const cookie of modifiedValues){\n const tempCookies = new ResponseCookies(new Headers());\n tempCookies.set(cookie);\n serializedCookies.push(tempCookies.toString());\n }\n onUpdateCookies(serializedCookies);\n }\n };\n return new Proxy(responseCookies, {\n get (target, prop, receiver) {\n switch(prop){\n // A special symbol to get the modified cookie values\n case SYMBOL_MODIFY_COOKIE_VALUES:\n return modifiedValues;\n // TODO: Throw error if trying to set a cookie after the response\n // headers have been set.\n case \"delete\":\n return function(...args) {\n modifiedCookies.add(typeof args[0] === \"string\" ? args[0] : args[0].name);\n try {\n target.delete(...args);\n } finally{\n updateResponseCookies();\n }\n };\n case \"set\":\n return function(...args) {\n modifiedCookies.add(typeof args[0] === \"string\" ? args[0] : args[0].name);\n try {\n return target.set(...args);\n } finally{\n updateResponseCookies();\n }\n };\n default:\n return ReflectAdapter.get(target, prop, receiver);\n }\n }\n });\n }\n}\n\n//# sourceMappingURL=request-cookies.js.map","import { getPathMatch } from \"../../shared/lib/router/utils/path-match\";\nconst matcher = getPathMatch(\"/_next/data/:path*\");\nexport function matchNextDataPathname(pathname) {\n if (typeof pathname !== \"string\") return false;\n return matcher(pathname);\n}\n\n//# sourceMappingURL=match-next-data-pathname.js.map","export class SuffixPathnameNormalizer {\n constructor(suffix){\n this.suffix = suffix;\n }\n match(pathname) {\n // If the pathname doesn't end in the suffix, we don't match.\n if (!pathname.endsWith(this.suffix)) return false;\n return true;\n }\n normalize(pathname, matched) {\n // If we're not matched and we don't match, we don't need to normalize.\n if (!matched && !this.match(pathname)) return pathname;\n return pathname.substring(0, pathname.length - this.suffix.length);\n }\n}\n\n//# sourceMappingURL=suffix.js.map","import { RSC_SUFFIX } from \"../../../../lib/constants\";\nimport { SuffixPathnameNormalizer } from \"./suffix\";\nexport class RSCPathnameNormalizer extends SuffixPathnameNormalizer {\n constructor(){\n super(RSC_SUFFIX);\n }\n}\n\n//# sourceMappingURL=rsc.js.map","export class PrefixPathnameNormalizer {\n constructor(prefix){\n this.prefix = prefix;\n if (prefix.endsWith(\"/\")) {\n throw new Error(`PrefixPathnameNormalizer: prefix \"${prefix}\" should not end with a slash`);\n }\n }\n match(pathname) {\n // If the pathname doesn't start with the prefix, we don't match.\n if (pathname !== this.prefix && !pathname.startsWith(this.prefix + \"/\")) {\n return false;\n }\n return true;\n }\n normalize(pathname, matched) {\n // If we're not matched and we don't match, we don't need to normalize.\n if (!matched && !this.match(pathname)) return pathname;\n if (pathname.length === this.prefix.length) {\n return \"/\";\n }\n return pathname.substring(this.prefix.length);\n }\n}\n\n//# sourceMappingURL=prefix.js.map","import { denormalizePagePath } from \"../../../../shared/lib/page-path/denormalize-page-path\";\nimport { PrefixPathnameNormalizer } from \"./prefix\";\nconst prefix = \"/_next/postponed/resume\";\nexport class PostponedPathnameNormalizer extends PrefixPathnameNormalizer {\n constructor(){\n super(prefix);\n }\n normalize(pathname, matched) {\n // If we're not matched and we don't match, we don't need to normalize.\n if (!matched && !this.match(pathname)) return pathname;\n // Remove the prefix.\n pathname = super.normalize(pathname, true);\n return denormalizePagePath(pathname);\n }\n}\n\n//# sourceMappingURL=postponed.js.map","import { ACTION_SUFFIX } from \"../../../../lib/constants\";\nimport { SuffixPathnameNormalizer } from \"./suffix\";\nexport class ActionPathnameNormalizer extends SuffixPathnameNormalizer {\n constructor(){\n super(ACTION_SUFFIX);\n }\n}\n\n//# sourceMappingURL=action.js.map","import { FLIGHT_PARAMETERS } from \"../../client/components/app-router-headers\";\n/**\n * Removes the flight headers from the request.\n *\n * @param req the request to strip the headers from\n */ export function stripFlightHeaders(headers) {\n for (const [header] of FLIGHT_PARAMETERS){\n delete headers[header.toLowerCase()];\n }\n}\n\n//# sourceMappingURL=strip-flight-headers.js.map","import { RSC_PREFETCH_SUFFIX } from \"../../../../lib/constants\";\nimport { SuffixPathnameNormalizer } from \"./suffix\";\nexport class PrefetchRSCPathnameNormalizer extends SuffixPathnameNormalizer {\n constructor(){\n super(RSC_PREFETCH_SUFFIX);\n }\n}\n\n//# sourceMappingURL=prefetch-rsc.js.map","import { denormalizePagePath } from \"../../../../shared/lib/page-path/denormalize-page-path\";\nimport { PrefixPathnameNormalizer } from \"./prefix\";\nimport { SuffixPathnameNormalizer } from \"./suffix\";\nexport class NextDataPathnameNormalizer {\n constructor(buildID){\n this.suffix = new SuffixPathnameNormalizer(\".json\");\n if (!buildID) {\n throw new Error(\"Invariant: buildID is required\");\n }\n this.prefix = new PrefixPathnameNormalizer(`/_next/data/${buildID}`);\n }\n match(pathname) {\n return this.prefix.match(pathname) && this.suffix.match(pathname);\n }\n normalize(pathname, matched) {\n // If we're not matched and we don't match, we don't need to normalize.\n if (!matched && !this.match(pathname)) return pathname;\n pathname = this.prefix.normalize(pathname, true);\n pathname = this.suffix.normalize(pathname, true);\n return denormalizePagePath(pathname);\n }\n}\n\n//# sourceMappingURL=next-data.js.map","/**\n * This transforms a URL pathname into a route. It removes any trailing slashes\n * and the `/index` suffix.\n *\n * @param {string} pathname - The URL path that needs to be optimized.\n * @returns {string} - The route\n *\n * @example\n * // returns '/example'\n * toRoute('/example/index/');\n *\n * @example\n * // returns '/example'\n * toRoute('/example/');\n *\n * @example\n * // returns '/'\n * toRoute('/index/');\n *\n * @example\n * // returns '/'\n * toRoute('/');\n */ export function toRoute(pathname) {\n return pathname.replace(/(?:\\/index)?\\/?$/, \"\") || \"/\";\n}\n\n//# sourceMappingURL=to-route.js.map","import { NormalizeError, DecodeError, normalizeRepeatedSlashes, MissingStaticPage } from \"../shared/lib/utils\";\nimport { format as formatUrl, parse as parseUrl } from \"url\";\nimport { formatHostname } from \"./lib/format-hostname\";\nimport { getRedirectStatus } from \"../lib/redirect-status\";\nimport { isEdgeRuntime } from \"../lib/is-edge-runtime\";\nimport { APP_PATHS_MANIFEST, NEXT_BUILTIN_DOCUMENT, PAGES_MANIFEST, STATIC_STATUS_PAGES, UNDERSCORE_NOT_FOUND_ROUTE, UNDERSCORE_NOT_FOUND_ROUTE_ENTRY } from \"../shared/lib/constants\";\nimport { isDynamicRoute } from \"../shared/lib/router/utils\";\nimport { checkIsOnDemandRevalidate } from \"./api-utils\";\nimport { setConfig } from \"../shared/lib/runtime-config.external\";\nimport { formatRevalidate } from \"./lib/revalidate\";\nimport { execOnce } from \"../shared/lib/utils\";\nimport { isBlockedPage } from \"./utils\";\nimport { isBot } from \"../shared/lib/router/utils/is-bot\";\nimport RenderResult from \"./render-result\";\nimport { removeTrailingSlash } from \"../shared/lib/router/utils/remove-trailing-slash\";\nimport { denormalizePagePath } from \"../shared/lib/page-path/denormalize-page-path\";\nimport * as Log from \"../build/output/log\";\nimport escapePathDelimiters from \"../shared/lib/router/utils/escape-path-delimiters\";\nimport { getUtils } from \"./server-utils\";\nimport isError, { getProperError } from \"../lib/is-error\";\nimport { addRequestMeta, getRequestMeta, removeRequestMeta, setRequestMeta } from \"./request-meta\";\nimport { removePathPrefix } from \"../shared/lib/router/utils/remove-path-prefix\";\nimport { normalizeAppPath } from \"../shared/lib/router/utils/app-paths\";\nimport { getHostname } from \"../shared/lib/get-hostname\";\nimport { parseUrl as parseUrlUtil } from \"../shared/lib/router/utils/parse-url\";\nimport { getNextPathnameInfo } from \"../shared/lib/router/utils/get-next-pathname-info\";\nimport { RSC_HEADER, NEXT_RSC_UNION_QUERY, NEXT_ROUTER_PREFETCH_HEADER, NEXT_DID_POSTPONE_HEADER, NEXT_URL, NEXT_ROUTER_STATE_TREE } from \"../client/components/app-router-headers\";\nimport { LocaleRouteNormalizer } from \"./future/normalizers/locale-route-normalizer\";\nimport { DefaultRouteMatcherManager } from \"./future/route-matcher-managers/default-route-matcher-manager\";\nimport { AppPageRouteMatcherProvider } from \"./future/route-matcher-providers/app-page-route-matcher-provider\";\nimport { AppRouteRouteMatcherProvider } from \"./future/route-matcher-providers/app-route-route-matcher-provider\";\nimport { PagesAPIRouteMatcherProvider } from \"./future/route-matcher-providers/pages-api-route-matcher-provider\";\nimport { PagesRouteMatcherProvider } from \"./future/route-matcher-providers/pages-route-matcher-provider\";\nimport { ServerManifestLoader } from \"./future/route-matcher-providers/helpers/manifest-loaders/server-manifest-loader\";\nimport { getTracer, SpanKind } from \"./lib/trace/tracer\";\nimport { BaseServerSpan } from \"./lib/trace/constants\";\nimport { I18NProvider } from \"./future/helpers/i18n-provider\";\nimport { sendResponse } from \"./send-response\";\nimport { handleInternalServerErrorResponse } from \"./future/route-modules/helpers/response-handlers\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"./web/utils\";\nimport { CACHE_ONE_YEAR, NEXT_CACHE_TAGS_HEADER, NEXT_QUERY_PARAM_PREFIX } from \"../lib/constants\";\nimport { normalizeLocalePath } from \"../shared/lib/i18n/normalize-locale-path\";\nimport { NextRequestAdapter, signalFromNodeResponse } from \"./web/spec-extension/adapters/next-request\";\nimport { matchNextDataPathname } from \"./lib/match-next-data-pathname\";\nimport getRouteFromAssetPath from \"../shared/lib/router/utils/get-route-from-asset-path\";\nimport { RSCPathnameNormalizer } from \"./future/normalizers/request/rsc\";\nimport { PostponedPathnameNormalizer } from \"./future/normalizers/request/postponed\";\nimport { ActionPathnameNormalizer } from \"./future/normalizers/request/action\";\nimport { stripFlightHeaders } from \"./app-render/strip-flight-headers\";\nimport { isAppPageRouteModule, isAppRouteRouteModule, isPagesRouteModule } from \"./future/route-modules/checks\";\nimport { PrefetchRSCPathnameNormalizer } from \"./future/normalizers/request/prefetch-rsc\";\nimport { NextDataPathnameNormalizer } from \"./future/normalizers/request/next-data\";\nimport { getIsServerAction } from \"./lib/server-action-request-meta\";\nimport { isInterceptionRouteAppPath } from \"./future/helpers/interception-routes\";\nimport { toRoute } from \"./lib/to-route\";\nexport class NoFallbackError extends Error {\n}\n// Internal wrapper around build errors at development\n// time, to prevent us from propagating or logging them\nexport class WrappedBuildError extends Error {\n constructor(innerError){\n super();\n this.innerError = innerError;\n }\n}\nexport default class Server {\n constructor(options){\n var _this_nextConfig_i18n, _this_nextConfig_experimental_amp, _this_nextConfig_i18n1;\n this.handleRSCRequest = (req, _res, parsedUrl)=>{\n var _this_normalizers_prefetchRSC, _this_normalizers_rsc;\n if (!parsedUrl.pathname) return false;\n if ((_this_normalizers_prefetchRSC = this.normalizers.prefetchRSC) == null ? void 0 : _this_normalizers_prefetchRSC.match(parsedUrl.pathname)) {\n parsedUrl.pathname = this.normalizers.prefetchRSC.normalize(parsedUrl.pathname, true);\n // Mark the request as a router prefetch request.\n req.headers[RSC_HEADER.toLowerCase()] = \"1\";\n req.headers[NEXT_ROUTER_PREFETCH_HEADER.toLowerCase()] = \"1\";\n addRequestMeta(req, \"isRSCRequest\", true);\n addRequestMeta(req, \"isPrefetchRSCRequest\", true);\n } else if ((_this_normalizers_rsc = this.normalizers.rsc) == null ? void 0 : _this_normalizers_rsc.match(parsedUrl.pathname)) {\n parsedUrl.pathname = this.normalizers.rsc.normalize(parsedUrl.pathname, true);\n // Mark the request as a RSC request.\n req.headers[RSC_HEADER.toLowerCase()] = \"1\";\n addRequestMeta(req, \"isRSCRequest\", true);\n } else if (req.headers[\"x-now-route-matches\"]) {\n // If we didn't match, return with the flight headers stripped. If in\n // minimal mode we didn't match based on the path, this can't be a RSC\n // request. This is because Vercel only sends this header during\n // revalidation requests and we want the cache to instead depend on the\n // request path for flight information.\n stripFlightHeaders(req.headers);\n return false;\n } else {\n // Otherwise just return without doing anything.\n return false;\n }\n if (req.url) {\n const parsed = parseUrl(req.url);\n parsed.pathname = parsedUrl.pathname;\n req.url = formatUrl(parsed);\n }\n return false;\n };\n this.handleNextDataRequest = async (req, res, parsedUrl)=>{\n const middleware = this.getMiddleware();\n const params = matchNextDataPathname(parsedUrl.pathname);\n // ignore for non-next data URLs\n if (!params || !params.path) {\n return false;\n }\n if (params.path[0] !== this.buildId) {\n // Ignore if its a middleware request when we aren't on edge.\n if (process.env.NEXT_RUNTIME !== \"edge\" && getRequestMeta(req, \"middlewareInvoke\")) {\n return false;\n }\n // Make sure to 404 if the buildId isn't correct\n await this.render404(req, res, parsedUrl);\n return true;\n }\n // remove buildId from URL\n params.path.shift();\n const lastParam = params.path[params.path.length - 1];\n // show 404 if it doesn't end with .json\n if (typeof lastParam !== \"string\" || !lastParam.endsWith(\".json\")) {\n await this.render404(req, res, parsedUrl);\n return true;\n }\n // re-create page's pathname\n let pathname = `/${params.path.join(\"/\")}`;\n pathname = getRouteFromAssetPath(pathname, \".json\");\n // ensure trailing slash is normalized per config\n if (middleware) {\n if (this.nextConfig.trailingSlash && !pathname.endsWith(\"/\")) {\n pathname += \"/\";\n }\n if (!this.nextConfig.trailingSlash && pathname.length > 1 && pathname.endsWith(\"/\")) {\n pathname = pathname.substring(0, pathname.length - 1);\n }\n }\n if (this.i18nProvider) {\n var _req_headers_host;\n // Remove the port from the hostname if present.\n const hostname = req == null ? void 0 : (_req_headers_host = req.headers.host) == null ? void 0 : _req_headers_host.split(\":\", 1)[0].toLowerCase();\n const domainLocale = this.i18nProvider.detectDomainLocale(hostname);\n const defaultLocale = (domainLocale == null ? void 0 : domainLocale.defaultLocale) ?? this.i18nProvider.config.defaultLocale;\n const localePathResult = this.i18nProvider.analyze(pathname);\n // If the locale is detected from the path, we need to remove it\n // from the pathname.\n if (localePathResult.detectedLocale) {\n pathname = localePathResult.pathname;\n }\n // Update the query with the detected locale and default locale.\n parsedUrl.query.__nextLocale = localePathResult.detectedLocale;\n parsedUrl.query.__nextDefaultLocale = defaultLocale;\n // If the locale is not detected from the path, we need to mark that\n // it was not inferred from default.\n if (!localePathResult.detectedLocale) {\n delete parsedUrl.query.__nextInferredLocaleFromDefault;\n }\n // If no locale was detected and we don't have middleware, we need\n // to render a 404 page.\n if (!localePathResult.detectedLocale && !middleware) {\n parsedUrl.query.__nextLocale = defaultLocale;\n await this.render404(req, res, parsedUrl);\n return true;\n }\n }\n parsedUrl.pathname = pathname;\n parsedUrl.query.__nextDataReq = \"1\";\n return false;\n };\n this.handleNextImageRequest = ()=>false;\n this.handleCatchallRenderRequest = ()=>false;\n this.handleCatchallMiddlewareRequest = ()=>false;\n /**\n * Normalizes a pathname without attaching any metadata from any matched\n * normalizer.\n *\n * @param pathname the pathname to normalize\n * @returns the normalized pathname\n */ this.normalize = (pathname)=>{\n const normalizers = [];\n if (this.normalizers.data) {\n normalizers.push(this.normalizers.data);\n }\n if (this.normalizers.postponed) {\n normalizers.push(this.normalizers.postponed);\n }\n // We have to put the prefetch normalizer before the RSC normalizer\n // because the RSC normalizer will match the prefetch RSC routes too.\n if (this.normalizers.prefetchRSC) {\n normalizers.push(this.normalizers.prefetchRSC);\n }\n if (this.normalizers.rsc) {\n normalizers.push(this.normalizers.rsc);\n }\n if (this.normalizers.action) {\n normalizers.push(this.normalizers.action);\n }\n for (const normalizer of normalizers){\n if (!normalizer.match(pathname)) continue;\n return normalizer.normalize(pathname, true);\n }\n return pathname;\n };\n this.normalizeAndAttachMetadata = async (req, res, url)=>{\n let finished = await this.handleNextImageRequest(req, res, url);\n if (finished) return true;\n if (this.enabledDirectories.pages) {\n finished = await this.handleNextDataRequest(req, res, url);\n if (finished) return true;\n }\n return false;\n };\n this.prepared = false;\n this.preparedPromise = null;\n this.customErrorNo404Warn = execOnce(()=>{\n Log.warn(`You have added a custom /_error page without a custom /404 page. This prevents the 404 page from being auto statically optimized.\\nSee here for info: https://nextjs.org/docs/messages/custom-error-no-custom-404`);\n });\n const { dir = \".\", quiet = false, conf, dev = false, minimalMode = false, customServer = true, hostname, port, experimentalTestProxy } = options;\n this.experimentalTestProxy = experimentalTestProxy;\n this.serverOptions = options;\n this.dir = process.env.NEXT_RUNTIME === \"edge\" ? dir : require(\"path\").resolve(dir);\n this.quiet = quiet;\n this.loadEnvConfig({\n dev\n });\n // TODO: should conf be normalized to prevent missing\n // values from causing issues as this can be user provided\n this.nextConfig = conf;\n this.hostname = hostname;\n if (this.hostname) {\n // we format the hostname so that it can be fetched\n this.fetchHostname = formatHostname(this.hostname);\n }\n this.port = port;\n this.distDir = process.env.NEXT_RUNTIME === \"edge\" ? this.nextConfig.distDir : require(\"path\").join(this.dir, this.nextConfig.distDir);\n this.publicDir = this.getPublicDir();\n this.hasStaticDir = !minimalMode && this.getHasStaticDir();\n this.i18nProvider = ((_this_nextConfig_i18n = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n.locales) ? new I18NProvider(this.nextConfig.i18n) : undefined;\n // Configure the locale normalizer, it's used for routes inside `pages/`.\n this.localeNormalizer = this.i18nProvider ? new LocaleRouteNormalizer(this.i18nProvider) : undefined;\n // Only serverRuntimeConfig needs the default\n // publicRuntimeConfig gets it's default in client/index.js\n const { serverRuntimeConfig = {}, publicRuntimeConfig, assetPrefix, generateEtags } = this.nextConfig;\n this.buildId = this.getBuildId();\n // this is a hack to avoid Webpack knowing this is equal to this.minimalMode\n // because we replace this.minimalMode to true in production bundles.\n const minimalModeKey = \"minimalMode\";\n this[minimalModeKey] = minimalMode || !!process.env.NEXT_PRIVATE_MINIMAL_MODE;\n this.enabledDirectories = this.getEnabledDirectories(dev);\n this.normalizers = {\n // We should normalize the pathname from the RSC prefix only in minimal\n // mode as otherwise that route is not exposed external to the server as\n // we instead only rely on the headers.\n postponed: this.enabledDirectories.app && this.nextConfig.experimental.ppr && this.minimalMode ? new PostponedPathnameNormalizer() : undefined,\n rsc: this.enabledDirectories.app && this.minimalMode ? new RSCPathnameNormalizer() : undefined,\n prefetchRSC: this.enabledDirectories.app && this.nextConfig.experimental.ppr && this.minimalMode ? new PrefetchRSCPathnameNormalizer() : undefined,\n data: this.enabledDirectories.pages ? new NextDataPathnameNormalizer(this.buildId) : undefined,\n action: this.enabledDirectories.app && this.minimalMode ? new ActionPathnameNormalizer() : undefined\n };\n this.nextFontManifest = this.getNextFontManifest();\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n process.env.NEXT_DEPLOYMENT_ID = this.nextConfig.deploymentId || \"\";\n }\n this.renderOpts = {\n supportsDynamicResponse: true,\n trailingSlash: this.nextConfig.trailingSlash,\n deploymentId: this.nextConfig.deploymentId,\n strictNextHead: !!this.nextConfig.experimental.strictNextHead,\n poweredByHeader: this.nextConfig.poweredByHeader,\n canonicalBase: this.nextConfig.amp.canonicalBase || \"\",\n buildId: this.buildId,\n generateEtags,\n previewProps: this.getPrerenderManifest().preview,\n customServer: customServer === true ? true : undefined,\n ampOptimizerConfig: (_this_nextConfig_experimental_amp = this.nextConfig.experimental.amp) == null ? void 0 : _this_nextConfig_experimental_amp.optimizer,\n basePath: this.nextConfig.basePath,\n images: this.nextConfig.images,\n optimizeFonts: this.nextConfig.optimizeFonts,\n fontManifest: this.nextConfig.optimizeFonts && !dev ? this.getFontManifest() : undefined,\n optimizeCss: this.nextConfig.experimental.optimizeCss,\n nextConfigOutput: this.nextConfig.output,\n nextScriptWorkers: this.nextConfig.experimental.nextScriptWorkers,\n disableOptimizedLoading: this.nextConfig.experimental.disableOptimizedLoading,\n domainLocales: (_this_nextConfig_i18n1 = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n1.domains,\n distDir: this.distDir,\n serverComponents: this.enabledDirectories.app,\n enableTainting: this.nextConfig.experimental.taint,\n crossOrigin: this.nextConfig.crossOrigin ? this.nextConfig.crossOrigin : undefined,\n largePageDataBytes: this.nextConfig.experimental.largePageDataBytes,\n // Only the `publicRuntimeConfig` key is exposed to the client side\n // It'll be rendered as part of __NEXT_DATA__ on the client side\n runtimeConfig: Object.keys(publicRuntimeConfig).length > 0 ? publicRuntimeConfig : undefined,\n // @ts-expect-error internal field not publicly exposed\n isExperimentalCompile: this.nextConfig.experimental.isExperimentalCompile,\n experimental: {\n ppr: this.enabledDirectories.app && this.nextConfig.experimental.ppr === true,\n missingSuspenseWithCSRBailout: this.nextConfig.experimental.missingSuspenseWithCSRBailout === true,\n swrDelta: this.nextConfig.experimental.swrDelta\n }\n };\n // Initialize next/config with the environment configuration\n setConfig({\n serverRuntimeConfig,\n publicRuntimeConfig\n });\n this.pagesManifest = this.getPagesManifest();\n this.appPathsManifest = this.getAppPathsManifest();\n this.appPathRoutes = this.getAppPathRoutes();\n this.interceptionRoutePatterns = this.getinterceptionRoutePatterns();\n // Configure the routes.\n this.matchers = this.getRouteMatchers();\n // Start route compilation. We don't wait for the routes to finish loading\n // because we use the `waitTillReady` promise below in `handleRequest` to\n // wait. Also we can't `await` in the constructor.\n void this.matchers.reload();\n this.setAssetPrefix(assetPrefix);\n this.responseCache = this.getResponseCache({\n dev\n });\n }\n reloadMatchers() {\n return this.matchers.reload();\n }\n getRouteMatchers() {\n // Create a new manifest loader that get's the manifests from the server.\n const manifestLoader = new ServerManifestLoader((name)=>{\n switch(name){\n case PAGES_MANIFEST:\n return this.getPagesManifest() ?? null;\n case APP_PATHS_MANIFEST:\n return this.getAppPathsManifest() ?? null;\n default:\n return null;\n }\n });\n // Configure the matchers and handlers.\n const matchers = new DefaultRouteMatcherManager();\n // Match pages under `pages/`.\n matchers.push(new PagesRouteMatcherProvider(this.distDir, manifestLoader, this.i18nProvider));\n // Match api routes under `pages/api/`.\n matchers.push(new PagesAPIRouteMatcherProvider(this.distDir, manifestLoader, this.i18nProvider));\n // If the app directory is enabled, then add the app matchers and handlers.\n if (this.enabledDirectories.app) {\n // Match app pages under `app/`.\n matchers.push(new AppPageRouteMatcherProvider(this.distDir, manifestLoader));\n matchers.push(new AppRouteRouteMatcherProvider(this.distDir, manifestLoader));\n }\n return matchers;\n }\n logError(err) {\n if (this.quiet) return;\n Log.error(err);\n }\n async handleRequest(req, res, parsedUrl) {\n await this.prepare();\n const method = req.method.toUpperCase();\n const rsc = isRSCRequestCheck(req) ? \"RSC \" : \"\";\n const tracer = getTracer();\n return tracer.withPropagatedContext(req.headers, ()=>{\n return tracer.trace(BaseServerSpan.handleRequest, {\n spanName: `${rsc}${method} ${req.url}`,\n kind: SpanKind.SERVER,\n attributes: {\n \"http.method\": method,\n \"http.target\": req.url,\n \"next.rsc\": Boolean(rsc)\n }\n }, async (span)=>this.handleRequestImpl(req, res, parsedUrl).finally(()=>{\n if (!span) return;\n span.setAttributes({\n \"http.status_code\": res.statusCode\n });\n const rootSpanAttributes = tracer.getRootSpanAttributes();\n // We were unable to get attributes, probably OTEL is not enabled\n if (!rootSpanAttributes) return;\n if (rootSpanAttributes.get(\"next.span_type\") !== BaseServerSpan.handleRequest) {\n console.warn(`Unexpected root span type '${rootSpanAttributes.get(\"next.span_type\")}'. Please report this Next.js issue https://github.com/vercel/next.js`);\n return;\n }\n const route = rootSpanAttributes.get(\"next.route\");\n if (route) {\n const newName = `${rsc}${method} ${route}`;\n span.setAttributes({\n \"next.route\": route,\n \"http.route\": route,\n \"next.span_name\": newName\n });\n span.updateName(newName);\n }\n }));\n });\n }\n async handleRequestImpl(req, res, parsedUrl) {\n try {\n var _originalRequest_socket, _originalRequest_socket1, _this_i18nProvider, _this_i18nProvider1, _this_nextConfig_i18n;\n // Wait for the matchers to be ready.\n await this.matchers.waitTillReady();\n // ensure cookies set in middleware are merged and\n // not overridden by API routes/getServerSideProps\n const _res = res.originalResponse || res;\n const origSetHeader = _res.setHeader.bind(_res);\n _res.setHeader = (name, val)=>{\n // When renders /_error after page is failed,\n // it could attempt to set headers after headers\n if (_res.headersSent) {\n return;\n }\n if (name.toLowerCase() === \"set-cookie\") {\n const middlewareValue = getRequestMeta(req, \"middlewareCookie\");\n if (!middlewareValue || !Array.isArray(val) || !val.every((item, idx)=>item === middlewareValue[idx])) {\n val = [\n // TODO: (wyattjoh) find out why this is called multiple times resulting in duplicate cookies being added\n ...new Set([\n ...middlewareValue || [],\n ...typeof val === \"string\" ? [\n val\n ] : Array.isArray(val) ? val : []\n ])\n ];\n }\n }\n return origSetHeader(name, val);\n };\n const urlParts = (req.url || \"\").split(\"?\", 1);\n const urlNoQuery = urlParts[0];\n // this normalizes repeated slashes in the path e.g. hello//world ->\n // hello/world or backslashes to forward slashes, this does not\n // handle trailing slash as that is handled the same as a next.config.js\n // redirect\n if (urlNoQuery == null ? void 0 : urlNoQuery.match(/(\\\\|\\/\\/)/)) {\n const cleanUrl = normalizeRepeatedSlashes(req.url);\n res.redirect(cleanUrl, 308).body(cleanUrl).send();\n return;\n }\n // Parse url if parsedUrl not provided\n if (!parsedUrl || typeof parsedUrl !== \"object\") {\n if (!req.url) {\n throw new Error(\"Invariant: url can not be undefined\");\n }\n parsedUrl = parseUrl(req.url, true);\n }\n if (!parsedUrl.pathname) {\n throw new Error(\"Invariant: pathname can't be empty\");\n }\n // Parse the querystring ourselves if the user doesn't handle querystring parsing\n if (typeof parsedUrl.query === \"string\") {\n parsedUrl.query = Object.fromEntries(new URLSearchParams(parsedUrl.query));\n }\n const { originalRequest } = req;\n const xForwardedProto = originalRequest == null ? void 0 : originalRequest.headers[\"x-forwarded-proto\"];\n const isHttps = xForwardedProto ? xForwardedProto === \"https\" : !!(originalRequest == null ? void 0 : (_originalRequest_socket = originalRequest.socket) == null ? void 0 : _originalRequest_socket.encrypted);\n req.headers[\"x-forwarded-host\"] ??= req.headers[\"host\"] ?? this.hostname;\n req.headers[\"x-forwarded-port\"] ??= this.port ? this.port.toString() : isHttps ? \"443\" : \"80\";\n req.headers[\"x-forwarded-proto\"] ??= isHttps ? \"https\" : \"http\";\n req.headers[\"x-forwarded-for\"] ??= (_originalRequest_socket1 = originalRequest.socket) == null ? void 0 : _originalRequest_socket1.remoteAddress;\n // Validate that if i18n isn't configured or the passed parameters are not\n // valid it should be removed from the query.\n if (!((_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.validateQuery(parsedUrl.query))) {\n delete parsedUrl.query.__nextLocale;\n delete parsedUrl.query.__nextDefaultLocale;\n delete parsedUrl.query.__nextInferredLocaleFromDefault;\n }\n // This should be done before any normalization of the pathname happens as\n // it captures the initial URL.\n this.attachRequestMeta(req, parsedUrl);\n let finished = false;\n if (this.minimalMode && this.enabledDirectories.app) {\n finished = await this.handleRSCRequest(req, res, parsedUrl);\n if (finished) return;\n }\n const domainLocale = (_this_i18nProvider1 = this.i18nProvider) == null ? void 0 : _this_i18nProvider1.detectDomainLocale(getHostname(parsedUrl, req.headers));\n const defaultLocale = (domainLocale == null ? void 0 : domainLocale.defaultLocale) || ((_this_nextConfig_i18n = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n.defaultLocale);\n parsedUrl.query.__nextDefaultLocale = defaultLocale;\n const url = parseUrlUtil(req.url.replace(/^\\/+/, \"/\"));\n const pathnameInfo = getNextPathnameInfo(url.pathname, {\n nextConfig: this.nextConfig,\n i18nProvider: this.i18nProvider\n });\n url.pathname = pathnameInfo.pathname;\n if (pathnameInfo.basePath) {\n req.url = removePathPrefix(req.url, this.nextConfig.basePath);\n }\n const useMatchedPathHeader = this.minimalMode && typeof req.headers[\"x-matched-path\"] === \"string\";\n // TODO: merge handling with invokePath\n if (useMatchedPathHeader) {\n try {\n var _this_normalizers_data, _this_normalizers_postponed, _this_i18nProvider2, _this_getRoutesManifest;\n if (this.enabledDirectories.app) {\n // ensure /index path is normalized for prerender\n // in minimal mode\n if (req.url.match(/^\\/index($|\\?)/)) {\n req.url = req.url.replace(/^\\/index/, \"/\");\n }\n parsedUrl.pathname = parsedUrl.pathname === \"/index\" ? \"/\" : parsedUrl.pathname;\n }\n // x-matched-path is the source of truth, it tells what page\n // should be rendered because we don't process rewrites in minimalMode\n let { pathname: matchedPath } = new URL(req.headers[\"x-matched-path\"], \"http://localhost\");\n let { pathname: urlPathname } = new URL(req.url, \"http://localhost\");\n // For ISR the URL is normalized to the prerenderPath so if\n // it's a data request the URL path will be the data URL,\n // basePath is already stripped by this point\n if ((_this_normalizers_data = this.normalizers.data) == null ? void 0 : _this_normalizers_data.match(urlPathname)) {\n parsedUrl.query.__nextDataReq = \"1\";\n } else if (((_this_normalizers_postponed = this.normalizers.postponed) == null ? void 0 : _this_normalizers_postponed.match(matchedPath)) && req.method === \"POST\") {\n // Decode the postponed state from the request body, it will come as\n // an array of buffers, so collect them and then concat them to form\n // the string.\n const body = [];\n for await (const chunk of req.body){\n body.push(chunk);\n }\n const postponed = Buffer.concat(body).toString(\"utf8\");\n addRequestMeta(req, \"postponed\", postponed);\n // If the request does not have the `x-now-route-matches` header,\n // it means that the request has it's exact path specified in the\n // `x-matched-path` header. In this case, we should update the\n // pathname to the matched path.\n if (!req.headers[\"x-now-route-matches\"]) {\n urlPathname = this.normalizers.postponed.normalize(matchedPath, true);\n }\n }\n matchedPath = this.normalize(matchedPath);\n const normalizedUrlPath = this.stripNextDataPath(urlPathname);\n // Perform locale detection and normalization.\n const localeAnalysisResult = (_this_i18nProvider2 = this.i18nProvider) == null ? void 0 : _this_i18nProvider2.analyze(matchedPath, {\n defaultLocale\n });\n // The locale result will be defined even if the locale was not\n // detected for the request because it will be inferred from the\n // default locale.\n if (localeAnalysisResult) {\n parsedUrl.query.__nextLocale = localeAnalysisResult.detectedLocale;\n // If the detected locale was inferred from the default locale, we\n // need to modify the metadata on the request to indicate that.\n if (localeAnalysisResult.inferredFromDefault) {\n parsedUrl.query.__nextInferredLocaleFromDefault = \"1\";\n } else {\n delete parsedUrl.query.__nextInferredLocaleFromDefault;\n }\n }\n // TODO: check if this is needed any more?\n matchedPath = denormalizePagePath(matchedPath);\n let srcPathname = matchedPath;\n let pageIsDynamic = isDynamicRoute(srcPathname);\n if (!pageIsDynamic) {\n const match = await this.matchers.match(srcPathname, {\n i18n: localeAnalysisResult\n });\n // Update the source pathname to the matched page's pathname.\n if (match) {\n srcPathname = match.definition.pathname;\n // The page is dynamic if the params are defined.\n pageIsDynamic = typeof match.params !== \"undefined\";\n }\n }\n // The rest of this function can't handle i18n properly, so ensure we\n // restore the pathname with the locale information stripped from it\n // now that we're done matching if we're using i18n.\n if (localeAnalysisResult) {\n matchedPath = localeAnalysisResult.pathname;\n }\n const utils = getUtils({\n pageIsDynamic,\n page: srcPathname,\n i18n: this.nextConfig.i18n,\n basePath: this.nextConfig.basePath,\n rewrites: ((_this_getRoutesManifest = this.getRoutesManifest()) == null ? void 0 : _this_getRoutesManifest.rewrites) || {\n beforeFiles: [],\n afterFiles: [],\n fallback: []\n },\n caseSensitive: !!this.nextConfig.experimental.caseSensitiveRoutes\n });\n // Ensure parsedUrl.pathname includes locale before processing\n // rewrites or they won't match correctly.\n if (defaultLocale && !pathnameInfo.locale) {\n parsedUrl.pathname = `/${defaultLocale}${parsedUrl.pathname}`;\n }\n const pathnameBeforeRewrite = parsedUrl.pathname;\n const rewriteParams = utils.handleRewrites(req, parsedUrl);\n const rewriteParamKeys = Object.keys(rewriteParams);\n const didRewrite = pathnameBeforeRewrite !== parsedUrl.pathname;\n if (didRewrite && parsedUrl.pathname) {\n addRequestMeta(req, \"rewroteURL\", parsedUrl.pathname);\n }\n const routeParamKeys = new Set();\n for (const key of Object.keys(parsedUrl.query)){\n const value = parsedUrl.query[key];\n if (key !== NEXT_QUERY_PARAM_PREFIX && key.startsWith(NEXT_QUERY_PARAM_PREFIX)) {\n const normalizedKey = key.substring(NEXT_QUERY_PARAM_PREFIX.length);\n parsedUrl.query[normalizedKey] = value;\n routeParamKeys.add(normalizedKey);\n delete parsedUrl.query[key];\n }\n }\n // interpolate dynamic params and normalize URL if needed\n if (pageIsDynamic) {\n let params = {};\n let paramsResult = utils.normalizeDynamicRouteParams(parsedUrl.query);\n // for prerendered ISR paths we attempt parsing the route\n // params from the URL directly as route-matches may not\n // contain the correct values due to the filesystem path\n // matching before the dynamic route has been matched\n if (!paramsResult.hasValidParams && pageIsDynamic && !isDynamicRoute(normalizedUrlPath)) {\n let matcherParams = utils.dynamicRouteMatcher == null ? void 0 : utils.dynamicRouteMatcher.call(utils, normalizedUrlPath);\n if (matcherParams) {\n utils.normalizeDynamicRouteParams(matcherParams);\n Object.assign(paramsResult.params, matcherParams);\n paramsResult.hasValidParams = true;\n }\n }\n if (paramsResult.hasValidParams) {\n params = paramsResult.params;\n }\n if (req.headers[\"x-now-route-matches\"] && isDynamicRoute(matchedPath) && !paramsResult.hasValidParams) {\n const opts = {};\n const routeParams = utils.getParamsFromRouteMatches(req, opts, parsedUrl.query.__nextLocale || \"\");\n // If this returns a locale, it means that the locale was detected\n // from the pathname.\n if (opts.locale) {\n parsedUrl.query.__nextLocale = opts.locale;\n // As the locale was parsed from the pathname, we should mark\n // that the locale was not inferred as the default.\n delete parsedUrl.query.__nextInferredLocaleFromDefault;\n }\n paramsResult = utils.normalizeDynamicRouteParams(routeParams, true);\n if (paramsResult.hasValidParams) {\n params = paramsResult.params;\n }\n }\n // handle the actual dynamic route name being requested\n if (pageIsDynamic && utils.defaultRouteMatches && normalizedUrlPath === srcPathname && !paramsResult.hasValidParams && !utils.normalizeDynamicRouteParams({\n ...params\n }, true).hasValidParams) {\n params = utils.defaultRouteMatches;\n }\n if (params) {\n matchedPath = utils.interpolateDynamicPath(srcPathname, params);\n req.url = utils.interpolateDynamicPath(req.url, params);\n }\n }\n if (pageIsDynamic || didRewrite) {\n var _utils_defaultRouteRegex;\n utils.normalizeVercelUrl(req, true, [\n ...rewriteParamKeys,\n ...Object.keys(((_utils_defaultRouteRegex = utils.defaultRouteRegex) == null ? void 0 : _utils_defaultRouteRegex.groups) || {})\n ]);\n }\n for (const key of routeParamKeys){\n delete parsedUrl.query[key];\n }\n parsedUrl.pathname = matchedPath;\n url.pathname = parsedUrl.pathname;\n finished = await this.normalizeAndAttachMetadata(req, res, parsedUrl);\n if (finished) return;\n } catch (err) {\n if (err instanceof DecodeError || err instanceof NormalizeError) {\n res.statusCode = 400;\n return this.renderError(null, req, res, \"/_error\", {});\n }\n throw err;\n }\n }\n addRequestMeta(req, \"isLocaleDomain\", Boolean(domainLocale));\n if (pathnameInfo.locale) {\n req.url = formatUrl(url);\n addRequestMeta(req, \"didStripLocale\", true);\n }\n // If we aren't in minimal mode or there is no locale in the query\n // string, add the locale to the query string.\n if (!this.minimalMode || !parsedUrl.query.__nextLocale) {\n // If the locale is in the pathname, add it to the query string.\n if (pathnameInfo.locale) {\n parsedUrl.query.__nextLocale = pathnameInfo.locale;\n } else if (defaultLocale) {\n parsedUrl.query.__nextLocale = defaultLocale;\n parsedUrl.query.__nextInferredLocaleFromDefault = \"1\";\n }\n }\n // set incremental cache to request meta so it can\n // be passed down for edge functions and the fetch disk\n // cache can be leveraged locally\n if (!this.serverOptions.webServerConfig && !getRequestMeta(req, \"incrementalCache\")) {\n let protocol = \"https:\";\n try {\n const parsedFullUrl = new URL(getRequestMeta(req, \"initURL\") || \"/\", \"http://n\");\n protocol = parsedFullUrl.protocol;\n } catch {}\n const incrementalCache = await this.getIncrementalCache({\n requestHeaders: Object.assign({}, req.headers),\n requestProtocol: protocol.substring(0, protocol.length - 1)\n });\n incrementalCache.resetRequestCache();\n addRequestMeta(req, \"incrementalCache\", incrementalCache);\n globalThis.__incrementalCache = incrementalCache;\n }\n // when invokePath is specified we can short short circuit resolving\n // we only honor this header if we are inside of a render worker to\n // prevent external users coercing the routing path\n const invokePath = getRequestMeta(req, \"invokePath\");\n const useInvokePath = !useMatchedPathHeader && process.env.NEXT_RUNTIME !== \"edge\" && invokePath;\n if (useInvokePath) {\n var _this_nextConfig_i18n1;\n const invokeStatus = getRequestMeta(req, \"invokeStatus\");\n if (invokeStatus) {\n const invokeQuery = getRequestMeta(req, \"invokeQuery\");\n if (invokeQuery) {\n Object.assign(parsedUrl.query, invokeQuery);\n }\n res.statusCode = invokeStatus;\n let err = getRequestMeta(req, \"invokeError\") || null;\n return this.renderError(err, req, res, \"/_error\", parsedUrl.query);\n }\n const parsedMatchedPath = new URL(invokePath || \"/\", \"http://n\");\n const invokePathnameInfo = getNextPathnameInfo(parsedMatchedPath.pathname, {\n nextConfig: this.nextConfig,\n parseData: false\n });\n if (invokePathnameInfo.locale) {\n parsedUrl.query.__nextLocale = invokePathnameInfo.locale;\n }\n if (parsedUrl.pathname !== parsedMatchedPath.pathname) {\n parsedUrl.pathname = parsedMatchedPath.pathname;\n addRequestMeta(req, \"rewroteURL\", invokePathnameInfo.pathname);\n }\n const normalizeResult = normalizeLocalePath(removePathPrefix(parsedUrl.pathname, this.nextConfig.basePath || \"\"), ((_this_nextConfig_i18n1 = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n1.locales) || []);\n if (normalizeResult.detectedLocale) {\n parsedUrl.query.__nextLocale = normalizeResult.detectedLocale;\n }\n parsedUrl.pathname = normalizeResult.pathname;\n for (const key of Object.keys(parsedUrl.query)){\n if (!key.startsWith(\"__next\") && !key.startsWith(\"_next\")) {\n delete parsedUrl.query[key];\n }\n }\n const invokeQuery = getRequestMeta(req, \"invokeQuery\");\n if (invokeQuery) {\n Object.assign(parsedUrl.query, invokeQuery);\n }\n finished = await this.normalizeAndAttachMetadata(req, res, parsedUrl);\n if (finished) return;\n await this.handleCatchallRenderRequest(req, res, parsedUrl);\n return;\n }\n if (process.env.NEXT_RUNTIME !== \"edge\" && getRequestMeta(req, \"middlewareInvoke\")) {\n finished = await this.normalizeAndAttachMetadata(req, res, parsedUrl);\n if (finished) return;\n finished = await this.handleCatchallMiddlewareRequest(req, res, parsedUrl);\n if (finished) return;\n const err = new Error();\n err.result = {\n response: new Response(null, {\n headers: {\n \"x-middleware-next\": \"1\"\n }\n })\n };\n err.bubble = true;\n throw err;\n }\n // This wasn't a request via the matched path or the invoke path, so\n // prepare for a legacy run by removing the base path.\n // ensure we strip the basePath when not using an invoke header\n if (!useMatchedPathHeader && pathnameInfo.basePath) {\n parsedUrl.pathname = removePathPrefix(parsedUrl.pathname, pathnameInfo.basePath);\n }\n res.statusCode = 200;\n return await this.run(req, res, parsedUrl);\n } catch (err) {\n if (err instanceof NoFallbackError) {\n throw err;\n }\n if (err && typeof err === \"object\" && err.code === \"ERR_INVALID_URL\" || err instanceof DecodeError || err instanceof NormalizeError) {\n res.statusCode = 400;\n return this.renderError(null, req, res, \"/_error\", {});\n }\n if (this.minimalMode || this.renderOpts.dev || err.bubble) {\n throw err;\n }\n this.logError(getProperError(err));\n res.statusCode = 500;\n res.body(\"Internal Server Error\").send();\n }\n }\n /**\n * @internal - this method is internal to Next.js and should not be used directly by end-users\n */ getRequestHandlerWithMetadata(meta) {\n const handler = this.getRequestHandler();\n return (req, res, parsedUrl)=>{\n setRequestMeta(req, meta);\n return handler(req, res, parsedUrl);\n };\n }\n getRequestHandler() {\n return this.handleRequest.bind(this);\n }\n setAssetPrefix(prefix) {\n this.renderOpts.assetPrefix = prefix ? prefix.replace(/\\/$/, \"\") : \"\";\n }\n /**\n * Runs async initialization of server.\n * It is idempotent, won't fire underlying initialization more than once.\n */ async prepare() {\n if (this.prepared) return;\n if (this.preparedPromise === null) {\n this.preparedPromise = this.prepareImpl().then(()=>{\n this.prepared = true;\n this.preparedPromise = null;\n });\n }\n return this.preparedPromise;\n }\n async prepareImpl() {}\n // Backwards compatibility\n async close() {}\n getAppPathRoutes() {\n const appPathRoutes = {};\n Object.keys(this.appPathsManifest || {}).forEach((entry)=>{\n const normalizedPath = normalizeAppPath(entry);\n if (!appPathRoutes[normalizedPath]) {\n appPathRoutes[normalizedPath] = [];\n }\n appPathRoutes[normalizedPath].push(entry);\n });\n return appPathRoutes;\n }\n async run(req, res, parsedUrl) {\n return getTracer().trace(BaseServerSpan.run, async ()=>this.runImpl(req, res, parsedUrl));\n }\n async runImpl(req, res, parsedUrl) {\n await this.handleCatchallRenderRequest(req, res, parsedUrl);\n }\n async pipe(fn, partialContext) {\n return getTracer().trace(BaseServerSpan.pipe, async ()=>this.pipeImpl(fn, partialContext));\n }\n async pipeImpl(fn, partialContext) {\n const isBotRequest = isBot(partialContext.req.headers[\"user-agent\"] || \"\");\n const ctx = {\n ...partialContext,\n renderOpts: {\n ...this.renderOpts,\n supportsDynamicResponse: !isBotRequest,\n isBot: !!isBotRequest\n }\n };\n const payload = await fn(ctx);\n if (payload === null) {\n return;\n }\n const { req, res } = ctx;\n const originalStatus = res.statusCode;\n const { body, type } = payload;\n let { revalidate } = payload;\n if (!res.sent) {\n const { generateEtags, poweredByHeader, dev } = this.renderOpts;\n // In dev, we should not cache pages for any reason.\n if (dev) {\n res.setHeader(\"Cache-Control\", \"no-store, must-revalidate\");\n revalidate = undefined;\n }\n await this.sendRenderResult(req, res, {\n result: body,\n type,\n generateEtags,\n poweredByHeader,\n revalidate,\n swrDelta: this.nextConfig.experimental.swrDelta\n });\n res.statusCode = originalStatus;\n }\n }\n async getStaticHTML(fn, partialContext) {\n const ctx = {\n ...partialContext,\n renderOpts: {\n ...this.renderOpts,\n supportsDynamicResponse: false\n }\n };\n const payload = await fn(ctx);\n if (payload === null) {\n return null;\n }\n return payload.body.toUnchunkedString();\n }\n async render(req, res, pathname, query = {}, parsedUrl, internalRender = false) {\n return getTracer().trace(BaseServerSpan.render, async ()=>this.renderImpl(req, res, pathname, query, parsedUrl, internalRender));\n }\n async renderImpl(req, res, pathname, query = {}, parsedUrl, internalRender = false) {\n var _req_url;\n if (!pathname.startsWith(\"/\")) {\n console.warn(`Cannot render page with path \"${pathname}\", did you mean \"/${pathname}\"?. See more info here: https://nextjs.org/docs/messages/render-no-starting-slash`);\n }\n if (this.renderOpts.customServer && pathname === \"/index\" && !await this.hasPage(\"/index\")) {\n // maintain backwards compatibility for custom server\n // (see custom-server integration tests)\n pathname = \"/\";\n }\n // we allow custom servers to call render for all URLs\n // so check if we need to serve a static _next file or not.\n // we don't modify the URL for _next/data request but still\n // call render so we special case this to prevent an infinite loop\n if (!internalRender && !this.minimalMode && !query.__nextDataReq && (((_req_url = req.url) == null ? void 0 : _req_url.match(/^\\/_next\\//)) || this.hasStaticDir && req.url.match(/^\\/static\\//))) {\n return this.handleRequest(req, res, parsedUrl);\n }\n if (isBlockedPage(pathname)) {\n return this.render404(req, res, parsedUrl);\n }\n return this.pipe((ctx)=>this.renderToResponse(ctx), {\n req,\n res,\n pathname,\n query\n });\n }\n async getStaticPaths({ pathname }) {\n var _this_getPrerenderManifest_dynamicRoutes_pathname;\n // Read whether or not fallback should exist from the manifest.\n const fallbackField = (_this_getPrerenderManifest_dynamicRoutes_pathname = this.getPrerenderManifest().dynamicRoutes[pathname]) == null ? void 0 : _this_getPrerenderManifest_dynamicRoutes_pathname.fallback;\n return {\n // `staticPaths` is intentionally set to `undefined` as it should've\n // been caught when checking disk data.\n staticPaths: undefined,\n fallbackMode: typeof fallbackField === \"string\" ? \"static\" : fallbackField === null ? \"blocking\" : fallbackField\n };\n }\n async renderToResponseWithComponents(requestContext, findComponentsResult) {\n return getTracer().trace(BaseServerSpan.renderToResponseWithComponents, async ()=>this.renderToResponseWithComponentsImpl(requestContext, findComponentsResult));\n }\n pathCouldBeIntercepted(resolvedPathname) {\n return isInterceptionRouteAppPath(resolvedPathname) || this.interceptionRoutePatterns.some((regexp)=>{\n return regexp.test(resolvedPathname);\n });\n }\n setVaryHeader(req, res, isAppPath, resolvedPathname) {\n const baseVaryHeader = `${RSC_HEADER}, ${NEXT_ROUTER_STATE_TREE}, ${NEXT_ROUTER_PREFETCH_HEADER}`;\n const isRSCRequest = isRSCRequestCheck(req);\n let addedNextUrlToVary = false;\n if (isAppPath && this.pathCouldBeIntercepted(resolvedPathname)) {\n // Interception route responses can vary based on the `Next-URL` header.\n // We use the Vary header to signal this behavior to the client to properly cache the response.\n res.setHeader(\"vary\", `${baseVaryHeader}, ${NEXT_URL}`);\n addedNextUrlToVary = true;\n } else if (isAppPath || isRSCRequest) {\n // We don't need to include `Next-URL` in the Vary header for non-interception routes since it won't affect the response.\n // We also set this header for pages to avoid caching issues when navigating between pages and app.\n res.setHeader(\"vary\", baseVaryHeader);\n }\n if (!addedNextUrlToVary) {\n // Remove `Next-URL` from the request headers we determined it wasn't necessary to include in the Vary header.\n // This is to avoid any dependency on the `Next-URL` header being present when preparing the response.\n delete req.headers[NEXT_URL];\n }\n }\n async renderToResponseWithComponentsImpl({ req, res, pathname, renderOpts: opts }, { components, query }) {\n var _components_Component, _this_nextConfig_i18n, _this_nextConfig_i18n1, _cacheEntry_value;\n if (pathname === UNDERSCORE_NOT_FOUND_ROUTE) {\n pathname = \"/404\";\n }\n const isErrorPathname = pathname === \"/_error\";\n const is404Page = pathname === \"/404\" || isErrorPathname && res.statusCode === 404;\n const is500Page = pathname === \"/500\" || isErrorPathname && res.statusCode === 500;\n const isAppPath = components.isAppPath === true;\n const hasServerProps = !!components.getServerSideProps;\n let hasStaticPaths = !!components.getStaticPaths;\n const isServerAction = getIsServerAction(req);\n const hasGetInitialProps = !!((_components_Component = components.Component) == null ? void 0 : _components_Component.getInitialProps);\n let isSSG = !!components.getStaticProps;\n // Compute the iSSG cache key. We use the rewroteUrl since\n // pages with fallback: false are allowed to be rewritten to\n // and we need to look up the path by the rewritten path\n let urlPathname = parseUrl(req.url || \"\").pathname || \"/\";\n let resolvedUrlPathname = getRequestMeta(req, \"rewroteURL\") || urlPathname;\n this.setVaryHeader(req, res, isAppPath, resolvedUrlPathname);\n let staticPaths;\n let fallbackMode;\n let hasFallback = false;\n const isDynamic = isDynamicRoute(components.page);\n const prerenderManifest = this.getPrerenderManifest();\n if (isAppPath && isDynamic) {\n const pathsResult = await this.getStaticPaths({\n pathname,\n page: components.page,\n isAppPath,\n requestHeaders: req.headers\n });\n staticPaths = pathsResult.staticPaths;\n fallbackMode = pathsResult.fallbackMode;\n hasFallback = typeof fallbackMode !== \"undefined\";\n if (this.nextConfig.output === \"export\") {\n const page = components.page;\n if (fallbackMode !== \"static\") {\n throw new Error(`Page \"${page}\" is missing exported function \"generateStaticParams()\", which is required with \"output: export\" config.`);\n }\n const resolvedWithoutSlash = removeTrailingSlash(resolvedUrlPathname);\n if (!(staticPaths == null ? void 0 : staticPaths.includes(resolvedWithoutSlash))) {\n throw new Error(`Page \"${page}\" is missing param \"${resolvedWithoutSlash}\" in \"generateStaticParams()\", which is required with \"output: export\" config.`);\n }\n }\n if (hasFallback) {\n hasStaticPaths = true;\n }\n }\n if (hasFallback || (staticPaths == null ? void 0 : staticPaths.includes(resolvedUrlPathname)) || // this signals revalidation in deploy environments\n // TODO: make this more generic\n req.headers[\"x-now-route-matches\"]) {\n isSSG = true;\n } else if (!this.renderOpts.dev) {\n isSSG ||= !!prerenderManifest.routes[toRoute(pathname)];\n }\n // Toggle whether or not this is a Data request\n const isNextDataRequest = !!(query.__nextDataReq || req.headers[\"x-nextjs-data\"] && this.serverOptions.webServerConfig) && (isSSG || hasServerProps);\n /**\n * If true, this indicates that the request being made is for an app\n * prefetch request.\n */ const isPrefetchRSCRequest = (req.headers[NEXT_ROUTER_PREFETCH_HEADER.toLowerCase()] === \"1\" || getRequestMeta(req, \"isPrefetchRSCRequest\")) ?? false;\n // when we are handling a middleware prefetch and it doesn't\n // resolve to a static data route we bail early to avoid\n // unexpected SSR invocations\n if (!isSSG && req.headers[\"x-middleware-prefetch\"] && !(is404Page || pathname === \"/_error\")) {\n res.setHeader(\"x-matched-path\", pathname);\n res.setHeader(\"x-middleware-skip\", \"1\");\n res.setHeader(\"cache-control\", \"private, no-cache, no-store, max-age=0, must-revalidate\");\n res.body(\"{}\").send();\n return null;\n }\n delete query.__nextDataReq;\n // normalize req.url for SSG paths as it is not exposed\n // to getStaticProps and the asPath should not expose /_next/data\n if (isSSG && this.minimalMode && req.headers[\"x-matched-path\"] && req.url.startsWith(\"/_next/data\")) {\n req.url = this.stripNextDataPath(req.url);\n }\n if (!!req.headers[\"x-nextjs-data\"] && (!res.statusCode || res.statusCode === 200)) {\n res.setHeader(\"x-nextjs-matched-path\", `${query.__nextLocale ? `/${query.__nextLocale}` : \"\"}${pathname}`);\n }\n // Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later\n const isRSCRequest = isRSCRequestCheck(req);\n // If we're in minimal mode, then try to get the postponed information from\n // the request metadata. If available, use it for resuming the postponed\n // render.\n const minimalPostponed = getRequestMeta(req, \"postponed\");\n // If PPR is enabled, and this is a RSC request (but not a prefetch), then\n // we can use this fact to only generate the flight data for the request\n // because we can't cache the HTML (as it's also dynamic).\n const isDynamicRSCRequest = opts.experimental.ppr && isRSCRequest && !isPrefetchRSCRequest;\n // we need to ensure the status code if /404 is visited directly\n if (is404Page && !isNextDataRequest && !isRSCRequest) {\n res.statusCode = 404;\n }\n // ensure correct status is set when visiting a status page\n // directly e.g. /500\n if (STATIC_STATUS_PAGES.includes(pathname)) {\n res.statusCode = parseInt(pathname.slice(1), 10);\n }\n if (// Server actions can use non-GET/HEAD methods.\n !isServerAction && // Resume can use non-GET/HEAD methods.\n !minimalPostponed && !is404Page && !is500Page && pathname !== \"/_error\" && req.method !== \"HEAD\" && req.method !== \"GET\" && (typeof components.Component === \"string\" || isSSG)) {\n res.statusCode = 405;\n res.setHeader(\"Allow\", [\n \"GET\",\n \"HEAD\"\n ]);\n await this.renderError(null, req, res, pathname);\n return null;\n }\n // handle static page\n if (typeof components.Component === \"string\") {\n return {\n type: \"html\",\n // TODO: Static pages should be serialized as RenderResult\n body: RenderResult.fromStatic(components.Component)\n };\n }\n if (!query.amp) {\n delete query.amp;\n }\n if (opts.supportsDynamicResponse === true) {\n var _components_Document;\n const isBotRequest = isBot(req.headers[\"user-agent\"] || \"\");\n const isSupportedDocument = typeof ((_components_Document = components.Document) == null ? void 0 : _components_Document.getInitialProps) !== \"function\" || // The built-in `Document` component also supports dynamic HTML for concurrent mode.\n NEXT_BUILTIN_DOCUMENT in components.Document;\n // Disable dynamic HTML in cases that we know it won't be generated,\n // so that we can continue generating a cache key when possible.\n // TODO-APP: should the first render for a dynamic app path\n // be static so we can collect revalidate and populate the\n // cache if there are no dynamic data requirements\n opts.supportsDynamicResponse = !isSSG && !isBotRequest && !query.amp && isSupportedDocument;\n opts.isBot = isBotRequest;\n }\n // In development, we always want to generate dynamic HTML.\n if (!isNextDataRequest && isAppPath && opts.dev) {\n opts.supportsDynamicResponse = true;\n }\n const defaultLocale = isSSG ? (_this_nextConfig_i18n = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n.defaultLocale : query.__nextDefaultLocale;\n const locale = query.__nextLocale;\n const locales = (_this_nextConfig_i18n1 = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n1.locales;\n let previewData;\n let isPreviewMode = false;\n if (hasServerProps || isSSG || isAppPath) {\n // For the edge runtime, we don't support preview mode in SSG.\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n const { tryGetPreviewData } = require(\"./api-utils/node/try-get-preview-data\");\n previewData = tryGetPreviewData(req, res, this.renderOpts.previewProps, !!this.nextConfig.experimental.multiZoneDraftMode);\n isPreviewMode = previewData !== false;\n }\n }\n // If this is a request for an app path that should be statically generated\n // and we aren't in the edge runtime, strip the flight headers so it will\n // generate the static response.\n if (isAppPath && !opts.dev && !isPreviewMode && isSSG && isRSCRequest && !isDynamicRSCRequest && (!isEdgeRuntime(opts.runtime) || this.serverOptions.webServerConfig)) {\n stripFlightHeaders(req.headers);\n }\n let isOnDemandRevalidate = false;\n let revalidateOnlyGenerated = false;\n if (isSSG) {\n ({ isOnDemandRevalidate, revalidateOnlyGenerated } = checkIsOnDemandRevalidate(req, this.renderOpts.previewProps));\n }\n if (isSSG && this.minimalMode && req.headers[\"x-matched-path\"]) {\n // the url value is already correct when the matched-path header is set\n resolvedUrlPathname = urlPathname;\n }\n urlPathname = removeTrailingSlash(urlPathname);\n resolvedUrlPathname = removeTrailingSlash(resolvedUrlPathname);\n if (this.localeNormalizer) {\n resolvedUrlPathname = this.localeNormalizer.normalize(resolvedUrlPathname);\n }\n const handleRedirect = (pageData)=>{\n const redirect = {\n destination: pageData.pageProps.__N_REDIRECT,\n statusCode: pageData.pageProps.__N_REDIRECT_STATUS,\n basePath: pageData.pageProps.__N_REDIRECT_BASE_PATH\n };\n const statusCode = getRedirectStatus(redirect);\n const { basePath } = this.nextConfig;\n if (basePath && redirect.basePath !== false && redirect.destination.startsWith(\"/\")) {\n redirect.destination = `${basePath}${redirect.destination}`;\n }\n if (redirect.destination.startsWith(\"/\")) {\n redirect.destination = normalizeRepeatedSlashes(redirect.destination);\n }\n res.redirect(redirect.destination, statusCode).body(redirect.destination).send();\n };\n // remove /_next/data prefix from urlPathname so it matches\n // for direct page visit and /_next/data visit\n if (isNextDataRequest) {\n resolvedUrlPathname = this.stripNextDataPath(resolvedUrlPathname);\n urlPathname = this.stripNextDataPath(urlPathname);\n }\n let ssgCacheKey = null;\n if (!isPreviewMode && isSSG && !opts.supportsDynamicResponse && !isServerAction && !minimalPostponed && !isDynamicRSCRequest) {\n ssgCacheKey = `${locale ? `/${locale}` : \"\"}${(pathname === \"/\" || resolvedUrlPathname === \"/\") && locale ? \"\" : resolvedUrlPathname}${query.amp ? \".amp\" : \"\"}`;\n }\n if ((is404Page || is500Page) && isSSG) {\n ssgCacheKey = `${locale ? `/${locale}` : \"\"}${pathname}${query.amp ? \".amp\" : \"\"}`;\n }\n if (ssgCacheKey) {\n // we only encode path delimiters for path segments from\n // getStaticPaths so we need to attempt decoding the URL\n // to match against and only escape the path delimiters\n // this allows non-ascii values to be handled e.g. Japanese characters\n // TODO: investigate adding this handling for non-SSG pages so\n // non-ascii names work there also\n ssgCacheKey = ssgCacheKey.split(\"/\").map((seg)=>{\n try {\n seg = escapePathDelimiters(decodeURIComponent(seg), true);\n } catch (_) {\n // An improperly encoded URL was provided\n throw new DecodeError(\"failed to decode param\");\n }\n return seg;\n }).join(\"/\");\n // ensure /index and / is normalized to one key\n ssgCacheKey = ssgCacheKey === \"/index\" && pathname === \"/\" ? \"/\" : ssgCacheKey;\n }\n let protocol = \"https:\";\n try {\n const parsedFullUrl = new URL(getRequestMeta(req, \"initURL\") || \"/\", \"http://n\");\n protocol = parsedFullUrl.protocol;\n } catch {}\n // use existing incrementalCache instance if available\n const incrementalCache = globalThis.__incrementalCache || await this.getIncrementalCache({\n requestHeaders: Object.assign({}, req.headers),\n requestProtocol: protocol.substring(0, protocol.length - 1)\n });\n incrementalCache == null ? void 0 : incrementalCache.resetRequestCache();\n const { routeModule } = components;\n // allow debugging the skeleton in dev with PPR\n // instead of continuing to resume stream right away\n const isDebugPPRSkeleton = Boolean(this.nextConfig.experimental.ppr && (this.renderOpts.dev || this.experimentalTestProxy) && query.__nextppronly);\n const doRender = async ({ postponed })=>{\n // In development, we always want to generate dynamic HTML.\n let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's\n // a data request, in which case we only produce static HTML.\n !isNextDataRequest && opts.dev === true || // If this is not SSG or does not have static paths, then it supports\n // dynamic HTML.\n !isSSG && !hasStaticPaths || // If this request has provided postponed data, it supports dynamic\n // HTML.\n typeof postponed === \"string\" || // If this is a dynamic RSC request, then this render supports dynamic\n // HTML (it's dynamic).\n isDynamicRSCRequest;\n const origQuery = parseUrl(req.url || \"\", true).query;\n // clear any dynamic route params so they aren't in\n // the resolvedUrl\n if (opts.params) {\n Object.keys(opts.params).forEach((key)=>{\n delete origQuery[key];\n });\n }\n const hadTrailingSlash = urlPathname !== \"/\" && this.nextConfig.trailingSlash;\n const resolvedUrl = formatUrl({\n pathname: `${resolvedUrlPathname}${hadTrailingSlash ? \"/\" : \"\"}`,\n // make sure to only add query values from original URL\n query: origQuery\n });\n const renderOpts = {\n ...components,\n ...opts,\n ...isAppPath ? {\n incrementalCache,\n // This is a revalidation request if the request is for a static\n // page and it is not being resumed from a postponed render and\n // it is not a dynamic RSC request then it is a revalidation\n // request.\n isRevalidate: isSSG && !postponed && !isDynamicRSCRequest,\n originalPathname: components.ComponentMod.originalPathname,\n serverActions: this.nextConfig.experimental.serverActions\n } : {},\n isNextDataRequest,\n resolvedUrl,\n locale,\n locales,\n defaultLocale,\n multiZoneDraftMode: this.nextConfig.experimental.multiZoneDraftMode,\n // For getServerSideProps and getInitialProps we need to ensure we use the original URL\n // and not the resolved URL to prevent a hydration mismatch on\n // asPath\n resolvedAsPath: hasServerProps || hasGetInitialProps ? formatUrl({\n // we use the original URL pathname less the _next/data prefix if\n // present\n pathname: `${urlPathname}${hadTrailingSlash ? \"/\" : \"\"}`,\n query: origQuery\n }) : resolvedUrl,\n supportsDynamicResponse,\n isOnDemandRevalidate,\n isDraftMode: isPreviewMode,\n isServerAction,\n postponed\n };\n if (isDebugPPRSkeleton) {\n supportsDynamicResponse = false;\n renderOpts.nextExport = true;\n renderOpts.supportsDynamicResponse = false;\n renderOpts.isStaticGeneration = true;\n renderOpts.isRevalidate = true;\n renderOpts.isDebugPPRSkeleton = true;\n }\n // Legacy render methods will return a render result that needs to be\n // served by the server.\n let result;\n if (routeModule) {\n if (isAppRouteRouteModule(routeModule)) {\n const context = {\n params: opts.params,\n prerenderManifest,\n renderOpts: {\n // App Route's cannot postpone, so don't enable it.\n experimental: {\n ppr: false\n },\n originalPathname: components.ComponentMod.originalPathname,\n supportsDynamicResponse,\n incrementalCache,\n isRevalidate: isSSG\n }\n };\n try {\n const request = NextRequestAdapter.fromBaseNextRequest(req, signalFromNodeResponse(res.originalResponse));\n const response = await routeModule.handle(request, context);\n req.fetchMetrics = context.renderOpts.fetchMetrics;\n const cacheTags = context.renderOpts.fetchTags;\n // If the request is for a static response, we can cache it so long\n // as it's not edge.\n if (isSSG && process.env.NEXT_RUNTIME !== \"edge\") {\n var _context_renderOpts_store;\n const blob = await response.blob();\n // Copy the headers from the response.\n const headers = toNodeOutgoingHttpHeaders(response.headers);\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n if (!headers[\"content-type\"] && blob.type) {\n headers[\"content-type\"] = blob.type;\n }\n const revalidate = ((_context_renderOpts_store = context.renderOpts.store) == null ? void 0 : _context_renderOpts_store.revalidate) ?? false;\n // Create the cache entry for the response.\n const cacheEntry = {\n value: {\n kind: \"ROUTE\",\n status: response.status,\n body: Buffer.from(await blob.arrayBuffer()),\n headers\n },\n revalidate\n };\n return cacheEntry;\n }\n // Send the response now that we have copied it into the cache.\n await sendResponse(req, res, response, context.renderOpts.waitUntil);\n return null;\n } catch (err) {\n // If this is during static generation, throw the error again.\n if (isSSG) throw err;\n Log.error(err);\n // Otherwise, send a 500 response.\n await sendResponse(req, res, handleInternalServerErrorResponse());\n return null;\n }\n } else if (isPagesRouteModule(routeModule)) {\n // Due to the way we pass data by mutating `renderOpts`, we can't extend\n // the object here but only updating its `clientReferenceManifest` and\n // `nextFontManifest` properties.\n // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952\n renderOpts.nextFontManifest = this.nextFontManifest;\n renderOpts.clientReferenceManifest = components.clientReferenceManifest;\n // Call the built-in render method on the module.\n result = await routeModule.render(req.originalRequest ?? req, res.originalResponse ?? res, {\n page: pathname,\n params: opts.params,\n query,\n renderOpts\n });\n } else if (isAppPageRouteModule(routeModule)) {\n const module = components.routeModule;\n // Due to the way we pass data by mutating `renderOpts`, we can't extend the\n // object here but only updating its `nextFontManifest` field.\n // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952\n renderOpts.nextFontManifest = this.nextFontManifest;\n // Call the built-in render method on the module.\n result = await module.render(req.originalRequest ?? req, res.originalResponse ?? res, {\n page: is404Page ? \"/404\" : pathname,\n params: opts.params,\n query,\n renderOpts\n });\n } else {\n throw new Error(\"Invariant: Unknown route module type\");\n }\n } else {\n // If we didn't match a page, we should fallback to using the legacy\n // render method.\n result = await this.renderHTML(req, res, pathname, query, renderOpts);\n }\n const { metadata } = result;\n const { headers = {}, // Add any fetch tags that were on the page to the response headers.\n fetchTags: cacheTags } = metadata;\n if (cacheTags) {\n headers[NEXT_CACHE_TAGS_HEADER] = cacheTags;\n }\n req.fetchMetrics = metadata.fetchMetrics;\n // we don't throw static to dynamic errors in dev as isSSG\n // is a best guess in dev since we don't have the prerender pass\n // to know whether the path is actually static or not\n if (isAppPath && isSSG && metadata.revalidate === 0 && !this.renderOpts.dev && !renderOpts.experimental.ppr) {\n const staticBailoutInfo = metadata.staticBailoutInfo;\n const err = new Error(`Page changed from static to dynamic at runtime ${urlPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`);\n if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) {\n const stack = staticBailoutInfo.stack;\n err.stack = err.message + stack.substring(stack.indexOf(\"\\n\"));\n }\n throw err;\n }\n // Based on the metadata, we can determine what kind of cache result we\n // should return.\n // Handle `isNotFound`.\n if (\"isNotFound\" in metadata && metadata.isNotFound) {\n return {\n value: null,\n revalidate: metadata.revalidate\n };\n }\n // Handle `isRedirect`.\n if (metadata.isRedirect) {\n return {\n value: {\n kind: \"REDIRECT\",\n props: metadata.pageData ?? metadata.flightData\n },\n revalidate: metadata.revalidate\n };\n }\n // Handle `isNull`.\n if (result.isNull) {\n return null;\n }\n // We now have a valid HTML result that we can return to the user.\n return {\n value: {\n kind: \"PAGE\",\n html: result,\n pageData: metadata.pageData ?? metadata.flightData,\n postponed: metadata.postponed,\n headers,\n status: isAppPath ? res.statusCode : undefined\n },\n revalidate: metadata.revalidate\n };\n };\n const cacheEntry = await this.responseCache.get(ssgCacheKey, async (hasResolved, previousCacheEntry, isRevalidating)=>{\n const isProduction = !this.renderOpts.dev;\n const didRespond = hasResolved || res.sent;\n if (!staticPaths) {\n ({ staticPaths, fallbackMode } = hasStaticPaths ? await this.getStaticPaths({\n pathname,\n requestHeaders: req.headers,\n isAppPath,\n page: components.page\n }) : {\n staticPaths: undefined,\n fallbackMode: false\n });\n }\n if (fallbackMode === \"static\" && isBot(req.headers[\"user-agent\"] || \"\")) {\n fallbackMode = \"blocking\";\n }\n // skip on-demand revalidate if cache is not present and\n // revalidate-if-generated is set\n if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !this.minimalMode) {\n await this.render404(req, res);\n return null;\n }\n if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) {\n isOnDemandRevalidate = true;\n }\n // only allow on-demand revalidate for fallback: true/blocking\n // or for prerendered fallback: false paths\n if (isOnDemandRevalidate && (fallbackMode !== false || previousCacheEntry)) {\n fallbackMode = \"blocking\";\n }\n // We use `ssgCacheKey` here as it is normalized to match the encoding\n // from getStaticPaths along with including the locale.\n //\n // We use the `resolvedUrlPathname` for the development case when this\n // is an app path since it doesn't include locale information.\n let staticPathKey = ssgCacheKey ?? (opts.dev && isAppPath ? resolvedUrlPathname : null);\n if (staticPathKey && query.amp) {\n staticPathKey = staticPathKey.replace(/\\.amp$/, \"\");\n }\n const isPageIncludedInStaticPaths = staticPathKey && (staticPaths == null ? void 0 : staticPaths.includes(staticPathKey));\n if (this.nextConfig.experimental.isExperimentalCompile) {\n fallbackMode = \"blocking\";\n }\n // When we did not respond from cache, we need to choose to block on\n // rendering or return a skeleton.\n //\n // - Data requests always block.\n // - Blocking mode fallback always blocks.\n // - Preview mode toggles all pages to be resolved in a blocking manner.\n // - Non-dynamic pages should block (though this is an impossible\n // case in production).\n // - Dynamic pages should return their skeleton if not defined in\n // getStaticPaths, then finish the data request on the client-side.\n //\n if (process.env.NEXT_RUNTIME !== \"edge\" && !this.minimalMode && fallbackMode !== \"blocking\" && staticPathKey && !didRespond && !isPreviewMode && isDynamic && (isProduction || !staticPaths || !isPageIncludedInStaticPaths)) {\n if (// In development, fall through to render to handle missing\n // getStaticPaths.\n (isProduction || staticPaths && (staticPaths == null ? void 0 : staticPaths.length) > 0) && // When fallback isn't present, abort this render so we 404\n fallbackMode !== \"static\") {\n throw new NoFallbackError();\n }\n if (!isNextDataRequest) {\n // Production already emitted the fallback as static HTML.\n if (isProduction) {\n const html = await this.getFallback(locale ? `/${locale}${pathname}` : pathname);\n return {\n value: {\n kind: \"PAGE\",\n html: RenderResult.fromStatic(html),\n postponed: undefined,\n status: undefined,\n headers: undefined,\n pageData: {}\n }\n };\n } else {\n query.__nextFallback = \"true\";\n // We pass `undefined` as there cannot be a postponed state in\n // development.\n const result = await doRender({\n postponed: undefined\n });\n if (!result) {\n return null;\n }\n // Prevent caching this result\n delete result.revalidate;\n return result;\n }\n }\n }\n const result = await doRender({\n // Only requests that aren't revalidating can be resumed. If we have the\n // minimal postponed data, then we should resume the render with it.\n postponed: !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined\n });\n if (!result) {\n return null;\n }\n return {\n ...result,\n revalidate: result.revalidate\n };\n }, {\n routeKind: routeModule == null ? void 0 : routeModule.definition.kind,\n incrementalCache,\n isOnDemandRevalidate,\n isPrefetch: req.headers.purpose === \"prefetch\"\n });\n if (isPreviewMode) {\n res.setHeader(\"Cache-Control\", \"private, no-cache, no-store, max-age=0, must-revalidate\");\n }\n if (!cacheEntry) {\n if (ssgCacheKey && !(isOnDemandRevalidate && revalidateOnlyGenerated)) {\n // A cache entry might not be generated if a response is written\n // in `getInitialProps` or `getServerSideProps`, but those shouldn't\n // have a cache key. If we do have a cache key but we don't end up\n // with a cache entry, then either Next.js or the application has a\n // bug that needs fixing.\n throw new Error(\"invariant: cache entry required but not generated\");\n }\n return null;\n }\n const didPostpone = ((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) === \"PAGE\" && !!cacheEntry.value.postponed;\n if (isSSG && !this.minimalMode && // We don't want to send a cache header for requests that contain dynamic\n // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC\n // request, then we should set the cache header.\n !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) {\n // set x-nextjs-cache header to match the header\n // we set for the image-optimizer\n res.setHeader(\"x-nextjs-cache\", isOnDemandRevalidate ? \"REVALIDATED\" : cacheEntry.isMiss ? \"MISS\" : cacheEntry.isStale ? \"STALE\" : \"HIT\");\n }\n const { value: cachedData } = cacheEntry;\n // If the cache value is an image, we should error early.\n if ((cachedData == null ? void 0 : cachedData.kind) === \"IMAGE\") {\n throw new Error(\"invariant SSG should not return an image cache value\");\n }\n // Coerce the revalidate parameter from the render.\n let revalidate;\n // If this is a resume request in minimal mode it is streamed with dynamic\n // content and should not be cached.\n if (minimalPostponed) {\n revalidate = 0;\n } else if (this.minimalMode && isRSCRequest && !isPrefetchRSCRequest && opts.experimental.ppr) {\n revalidate = 0;\n } else if (!this.renderOpts.dev || hasServerProps && !isNextDataRequest) {\n // If this is a preview mode request, we shouldn't cache it. We also don't\n // cache 404 pages.\n if (isPreviewMode || is404Page && !isNextDataRequest) {\n revalidate = 0;\n } else if (!isSSG) {\n if (!res.getHeader(\"Cache-Control\")) {\n revalidate = 0;\n }\n } else if (is404Page) {\n const notFoundRevalidate = getRequestMeta(req, \"notFoundRevalidate\");\n revalidate = typeof notFoundRevalidate === \"undefined\" ? 0 : notFoundRevalidate;\n } else if (is500Page) {\n revalidate = 0;\n } else if (typeof cacheEntry.revalidate === \"number\") {\n if (cacheEntry.revalidate < 1) {\n throw new Error(`Invariant: invalid Cache-Control duration provided: ${cacheEntry.revalidate} < 1`);\n }\n revalidate = cacheEntry.revalidate;\n } else if (cacheEntry.revalidate === false) {\n revalidate = CACHE_ONE_YEAR;\n }\n }\n cacheEntry.revalidate = revalidate;\n // If there's a callback for `onCacheEntry`, call it with the cache entry\n // and the revalidate options.\n const onCacheEntry = getRequestMeta(req, \"onCacheEntry\");\n if (onCacheEntry) {\n const finished = await onCacheEntry(cacheEntry, {\n url: getRequestMeta(req, \"initURL\")\n });\n if (finished) {\n // TODO: maybe we have to end the request?\n return null;\n }\n }\n if (!cachedData) {\n // add revalidate metadata before rendering 404 page\n // so that we can use this as source of truth for the\n // cache-control header instead of what the 404 page returns\n // for the revalidate value\n addRequestMeta(req, \"notFoundRevalidate\", cacheEntry.revalidate);\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.revalidate && !res.getHeader(\"Cache-Control\")) {\n res.setHeader(\"Cache-Control\", formatRevalidate({\n revalidate: cacheEntry.revalidate,\n swrDelta: this.nextConfig.experimental.swrDelta\n }));\n }\n if (isNextDataRequest) {\n res.statusCode = 404;\n res.body('{\"notFound\":true}').send();\n return null;\n }\n if (this.renderOpts.dev) {\n query.__nextNotFoundSrcPage = pathname;\n }\n await this.render404(req, res, {\n pathname,\n query\n }, false);\n return null;\n } else if (cachedData.kind === \"REDIRECT\") {\n // If cache control is already set on the response we don't\n // override it to allow users to customize it via next.config\n if (cacheEntry.revalidate && !res.getHeader(\"Cache-Control\")) {\n res.setHeader(\"Cache-Control\", formatRevalidate({\n revalidate: cacheEntry.revalidate,\n swrDelta: this.nextConfig.experimental.swrDelta\n }));\n }\n if (isNextDataRequest) {\n return {\n type: \"json\",\n body: RenderResult.fromStatic(// @TODO: Handle flight data.\n JSON.stringify(cachedData.props)),\n revalidate: cacheEntry.revalidate\n };\n } else {\n await handleRedirect(cachedData.props);\n return null;\n }\n } else if (cachedData.kind === \"ROUTE\") {\n const headers = {\n ...cachedData.headers\n };\n if (!(this.minimalMode && isSSG)) {\n delete headers[NEXT_CACHE_TAGS_HEADER];\n }\n await sendResponse(req, res, new Response(cachedData.body, {\n headers: fromNodeOutgoingHttpHeaders(headers),\n status: cachedData.status || 200\n }));\n return null;\n } else if (isAppPath) {\n var _cachedData_headers;\n // If the request has a postponed state and it's a resume request we\n // should error.\n if (cachedData.postponed && minimalPostponed) {\n throw new Error(\"Invariant: postponed state should not be present on a resume request\");\n }\n if (cachedData.headers) {\n const headers = {\n ...cachedData.headers\n };\n if (!this.minimalMode || !isSSG) {\n delete headers[NEXT_CACHE_TAGS_HEADER];\n }\n for (let [key, value] of Object.entries(headers)){\n if (typeof value === \"undefined\") continue;\n if (Array.isArray(value)) {\n for (const v of value){\n res.appendHeader(key, v);\n }\n } else if (typeof value === \"number\") {\n value = value.toString();\n res.appendHeader(key, value);\n } else {\n res.appendHeader(key, value);\n }\n }\n }\n if (this.minimalMode && isSSG && ((_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[NEXT_CACHE_TAGS_HEADER])) {\n res.setHeader(NEXT_CACHE_TAGS_HEADER, cachedData.headers[NEXT_CACHE_TAGS_HEADER]);\n }\n // If the request is a data request, then we shouldn't set the status code\n // from the response because it should always be 200. This should be gated\n // behind the experimental PPR flag.\n if (cachedData.status && (!isRSCRequest || !opts.experimental.ppr)) {\n res.statusCode = cachedData.status;\n }\n // Mark that the request did postpone if this is a data request.\n if (cachedData.postponed && isRSCRequest) {\n res.setHeader(NEXT_DID_POSTPONE_HEADER, \"1\");\n }\n // we don't go through this block when preview mode is true\n // as preview mode is a dynamic request (bypasses cache) and doesn't\n // generate both HTML and payloads in the same request so continue to just\n // return the generated payload\n if (isRSCRequest && !isPreviewMode) {\n // If this is a dynamic RSC request, then stream the response.\n if (typeof cachedData.pageData !== \"string\") {\n if (cachedData.postponed) {\n throw new Error(\"Invariant: Expected postponed to be undefined\");\n }\n return {\n type: \"rsc\",\n body: cachedData.html,\n // Dynamic RSC responses cannot be cached, even if they're\n // configured with `force-static` because we have no way of\n // distinguishing between `force-static` and pages that have no\n // postponed state.\n // TODO: distinguish `force-static` from pages with no postponed state (static)\n revalidate: isDynamicRSCRequest ? 0 : cacheEntry.revalidate\n };\n }\n // As this isn't a prefetch request, we should serve the static flight\n // data.\n return {\n type: \"rsc\",\n body: RenderResult.fromStatic(cachedData.pageData),\n revalidate: cacheEntry.revalidate\n };\n }\n // This is a request for HTML data.\n let body = cachedData.html;\n // If there's no postponed state, we should just serve the HTML. This\n // should also be the case for a resume request because it's completed\n // as a server render (rather than a static render).\n if (!cachedData.postponed || this.minimalMode) {\n return {\n type: \"html\",\n body,\n revalidate: cacheEntry.revalidate\n };\n }\n // If we're debugging the skeleton, we should just serve the HTML without\n // resuming the render. The returned HTML will be the static shell.\n if (isDebugPPRSkeleton) {\n return {\n type: \"html\",\n body,\n revalidate: 0\n };\n }\n // This request has postponed, so let's create a new transformer that the\n // dynamic data can pipe to that will attach the dynamic data to the end\n // of the response.\n const transformer = new TransformStream();\n body.chain(transformer.readable);\n // Perform the render again, but this time, provide the postponed state.\n // We don't await because we want the result to start streaming now, and\n // we've already chained the transformer's readable to the render result.\n doRender({\n postponed: cachedData.postponed\n }).then(async (result)=>{\n var _result_value;\n if (!result) {\n throw new Error(\"Invariant: expected a result to be returned\");\n }\n if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== \"PAGE\") {\n var _result_value1;\n throw new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`);\n }\n // Pipe the resume result to the transformer.\n await result.value.html.pipeTo(transformer.writable);\n }).catch((err)=>{\n // An error occurred during piping or preparing the render, abort\n // the transformers writer so we can terminate the stream.\n transformer.writable.abort(err).catch((e)=>{\n console.error(\"couldn't abort transformer\", e);\n });\n });\n return {\n type: \"html\",\n body,\n // We don't want to cache the response if it has postponed data because\n // the response being sent to the client it's dynamic parts are streamed\n // to the client on the same request.\n revalidate: 0\n };\n } else if (isNextDataRequest) {\n return {\n type: \"json\",\n body: RenderResult.fromStatic(JSON.stringify(cachedData.pageData)),\n revalidate: cacheEntry.revalidate\n };\n } else {\n return {\n type: \"html\",\n body: cachedData.html,\n revalidate: cacheEntry.revalidate\n };\n }\n }\n stripNextDataPath(path, stripLocale = true) {\n if (path.includes(this.buildId)) {\n const splitPath = path.substring(path.indexOf(this.buildId) + this.buildId.length);\n path = denormalizePagePath(splitPath.replace(/\\.json$/, \"\"));\n }\n if (this.localeNormalizer && stripLocale) {\n return this.localeNormalizer.normalize(path);\n }\n return path;\n }\n // map the route to the actual bundle name\n getOriginalAppPaths(route) {\n if (this.enabledDirectories.app) {\n var _this_appPathRoutes;\n const originalAppPath = (_this_appPathRoutes = this.appPathRoutes) == null ? void 0 : _this_appPathRoutes[route];\n if (!originalAppPath) {\n return null;\n }\n return originalAppPath;\n }\n return null;\n }\n async renderPageComponent(ctx, bubbleNoFallback) {\n var _this_nextConfig_experimental_sri;\n const { query, pathname } = ctx;\n const appPaths = this.getOriginalAppPaths(pathname);\n const isAppPath = Array.isArray(appPaths);\n let page = pathname;\n if (isAppPath) {\n // the last item in the array is the root page, if there are parallel routes\n page = appPaths[appPaths.length - 1];\n }\n const result = await this.findPageComponents({\n page,\n query,\n params: ctx.renderOpts.params || {},\n isAppPath,\n sriEnabled: !!((_this_nextConfig_experimental_sri = this.nextConfig.experimental.sri) == null ? void 0 : _this_nextConfig_experimental_sri.algorithm),\n appPaths,\n // Ensuring for loading page component routes is done via the matcher.\n shouldEnsure: false\n });\n if (result) {\n var _getTracer_getRootSpanAttributes;\n (_getTracer_getRootSpanAttributes = getTracer().getRootSpanAttributes()) == null ? void 0 : _getTracer_getRootSpanAttributes.set(\"next.route\", pathname);\n try {\n return await this.renderToResponseWithComponents(ctx, result);\n } catch (err) {\n const isNoFallbackError = err instanceof NoFallbackError;\n if (!isNoFallbackError || isNoFallbackError && bubbleNoFallback) {\n throw err;\n }\n }\n }\n return false;\n }\n async renderToResponse(ctx) {\n return getTracer().trace(BaseServerSpan.renderToResponse, {\n spanName: `rendering page`,\n attributes: {\n \"next.route\": ctx.pathname\n }\n }, async ()=>{\n return this.renderToResponseImpl(ctx);\n });\n }\n async renderToResponseImpl(ctx) {\n var _this_i18nProvider;\n const { res, query, pathname } = ctx;\n let page = pathname;\n const bubbleNoFallback = !!query._nextBubbleNoFallback;\n delete query[NEXT_RSC_UNION_QUERY];\n delete query._nextBubbleNoFallback;\n const options = {\n i18n: (_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.fromQuery(pathname, query)\n };\n try {\n for await (const match of this.matchers.matchAll(pathname, options)){\n // when a specific invoke-output is meant to be matched\n // ensure a prior dynamic route/page doesn't take priority\n const invokeOutput = getRequestMeta(ctx.req, \"invokeOutput\");\n if (!this.minimalMode && typeof invokeOutput === \"string\" && isDynamicRoute(invokeOutput || \"\") && invokeOutput !== match.definition.pathname) {\n continue;\n }\n const result = await this.renderPageComponent({\n ...ctx,\n pathname: match.definition.pathname,\n renderOpts: {\n ...ctx.renderOpts,\n params: match.params\n }\n }, bubbleNoFallback);\n if (result !== false) return result;\n }\n // currently edge functions aren't receiving the x-matched-path\n // header so we need to fallback to matching the current page\n // when we weren't able to match via dynamic route to handle\n // the rewrite case\n // @ts-expect-error extended in child class web-server\n if (this.serverOptions.webServerConfig) {\n // @ts-expect-error extended in child class web-server\n ctx.pathname = this.serverOptions.webServerConfig.page;\n const result = await this.renderPageComponent(ctx, bubbleNoFallback);\n if (result !== false) return result;\n }\n } catch (error) {\n const err = getProperError(error);\n if (error instanceof MissingStaticPage) {\n console.error(\"Invariant: failed to load static page\", JSON.stringify({\n page,\n url: ctx.req.url,\n matchedPath: ctx.req.headers[\"x-matched-path\"],\n initUrl: getRequestMeta(ctx.req, \"initURL\"),\n didRewrite: !!getRequestMeta(ctx.req, \"rewroteURL\"),\n rewroteUrl: getRequestMeta(ctx.req, \"rewroteURL\")\n }, null, 2));\n throw err;\n }\n if (err instanceof NoFallbackError && bubbleNoFallback) {\n throw err;\n }\n if (err instanceof DecodeError || err instanceof NormalizeError) {\n res.statusCode = 400;\n return await this.renderErrorToResponse(ctx, err);\n }\n res.statusCode = 500;\n // if pages/500 is present we still need to trigger\n // /_error `getInitialProps` to allow reporting error\n if (await this.hasPage(\"/500\")) {\n ctx.query.__nextCustomErrorRender = \"1\";\n await this.renderErrorToResponse(ctx, err);\n delete ctx.query.__nextCustomErrorRender;\n }\n const isWrappedError = err instanceof WrappedBuildError;\n if (!isWrappedError) {\n if (this.minimalMode && process.env.NEXT_RUNTIME !== \"edge\" || this.renderOpts.dev) {\n if (isError(err)) err.page = page;\n throw err;\n }\n this.logError(getProperError(err));\n }\n const response = await this.renderErrorToResponse(ctx, isWrappedError ? err.innerError : err);\n return response;\n }\n if (this.getMiddleware() && !!ctx.req.headers[\"x-nextjs-data\"] && (!res.statusCode || res.statusCode === 200 || res.statusCode === 404)) {\n res.setHeader(\"x-nextjs-matched-path\", `${query.__nextLocale ? `/${query.__nextLocale}` : \"\"}${pathname}`);\n res.statusCode = 200;\n res.setHeader(\"content-type\", \"application/json\");\n res.body(\"{}\");\n res.send();\n return null;\n }\n res.statusCode = 404;\n return this.renderErrorToResponse(ctx, null);\n }\n async renderToHTML(req, res, pathname, query = {}) {\n return getTracer().trace(BaseServerSpan.renderToHTML, async ()=>{\n return this.renderToHTMLImpl(req, res, pathname, query);\n });\n }\n async renderToHTMLImpl(req, res, pathname, query = {}) {\n return this.getStaticHTML((ctx)=>this.renderToResponse(ctx), {\n req,\n res,\n pathname,\n query\n });\n }\n async renderError(err, req, res, pathname, query = {}, setHeaders = true) {\n return getTracer().trace(BaseServerSpan.renderError, async ()=>{\n return this.renderErrorImpl(err, req, res, pathname, query, setHeaders);\n });\n }\n async renderErrorImpl(err, req, res, pathname, query = {}, setHeaders = true) {\n if (setHeaders) {\n res.setHeader(\"Cache-Control\", \"private, no-cache, no-store, max-age=0, must-revalidate\");\n }\n return this.pipe(async (ctx)=>{\n const response = await this.renderErrorToResponse(ctx, err);\n if (this.minimalMode && res.statusCode === 500) {\n throw err;\n }\n return response;\n }, {\n req,\n res,\n pathname,\n query\n });\n }\n async renderErrorToResponse(ctx, err) {\n return getTracer().trace(BaseServerSpan.renderErrorToResponse, async ()=>{\n return this.renderErrorToResponseImpl(ctx, err);\n });\n }\n async renderErrorToResponseImpl(ctx, err) {\n // Short-circuit favicon.ico in development to avoid compiling 404 page when the app has no favicon.ico.\n // Since favicon.ico is automatically requested by the browser.\n if (this.renderOpts.dev && ctx.pathname === \"/favicon.ico\") {\n return {\n type: \"html\",\n body: RenderResult.fromStatic(\"\")\n };\n }\n const { res, query } = ctx;\n try {\n let result = null;\n const is404 = res.statusCode === 404;\n let using404Page = false;\n if (is404) {\n if (this.enabledDirectories.app) {\n // Use the not-found entry in app directory\n result = await this.findPageComponents({\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n query,\n params: {},\n isAppPath: true,\n shouldEnsure: true,\n url: ctx.req.url\n });\n using404Page = result !== null;\n }\n if (!result && await this.hasPage(\"/404\")) {\n result = await this.findPageComponents({\n page: \"/404\",\n query,\n params: {},\n isAppPath: false,\n // Ensuring can't be done here because you never \"match\" a 404 route.\n shouldEnsure: true,\n url: ctx.req.url\n });\n using404Page = result !== null;\n }\n }\n let statusPage = `/${res.statusCode}`;\n if (!ctx.query.__nextCustomErrorRender && !result && STATIC_STATUS_PAGES.includes(statusPage)) {\n // skip ensuring /500 in dev mode as it isn't used and the\n // dev overlay is used instead\n if (statusPage !== \"/500\" || !this.renderOpts.dev) {\n result = await this.findPageComponents({\n page: statusPage,\n query,\n params: {},\n isAppPath: false,\n // Ensuring can't be done here because you never \"match\" a 500\n // route.\n shouldEnsure: true,\n url: ctx.req.url\n });\n }\n }\n if (!result) {\n result = await this.findPageComponents({\n page: \"/_error\",\n query,\n params: {},\n isAppPath: false,\n // Ensuring can't be done here because you never \"match\" an error\n // route.\n shouldEnsure: true,\n url: ctx.req.url\n });\n statusPage = \"/_error\";\n }\n if (process.env.NODE_ENV !== \"production\" && !using404Page && await this.hasPage(\"/_error\") && !await this.hasPage(\"/404\")) {\n this.customErrorNo404Warn();\n }\n if (!result) {\n // this can occur when a project directory has been moved/deleted\n // which is handled in the parent process in development\n if (this.renderOpts.dev) {\n return {\n type: \"html\",\n // wait for dev-server to restart before refreshing\n body: RenderResult.fromStatic(`\n <pre>missing required error components, refreshing...</pre>\n <script>\n async function check() {\n const res = await fetch(location.href).catch(() => ({}))\n\n if (res.status === 200) {\n location.reload()\n } else {\n setTimeout(check, 1000)\n }\n }\n check()\n </script>`)\n };\n }\n throw new WrappedBuildError(new Error(\"missing required error components\"));\n }\n // If the page has a route module, use it for the new match. If it doesn't\n // have a route module, remove the match.\n if (result.components.routeModule) {\n addRequestMeta(ctx.req, \"match\", {\n definition: result.components.routeModule.definition,\n params: undefined\n });\n } else {\n removeRequestMeta(ctx.req, \"match\");\n }\n try {\n return await this.renderToResponseWithComponents({\n ...ctx,\n pathname: statusPage,\n renderOpts: {\n ...ctx.renderOpts,\n err\n }\n }, result);\n } catch (maybeFallbackError) {\n if (maybeFallbackError instanceof NoFallbackError) {\n throw new Error(\"invariant: failed to render error page\");\n }\n throw maybeFallbackError;\n }\n } catch (error) {\n const renderToHtmlError = getProperError(error);\n const isWrappedError = renderToHtmlError instanceof WrappedBuildError;\n if (!isWrappedError) {\n this.logError(renderToHtmlError);\n }\n res.statusCode = 500;\n const fallbackComponents = await this.getFallbackErrorComponents(ctx.req.url);\n if (fallbackComponents) {\n // There was an error, so use it's definition from the route module\n // to add the match to the request.\n addRequestMeta(ctx.req, \"match\", {\n definition: fallbackComponents.routeModule.definition,\n params: undefined\n });\n return this.renderToResponseWithComponents({\n ...ctx,\n pathname: \"/_error\",\n renderOpts: {\n ...ctx.renderOpts,\n // We render `renderToHtmlError` here because `err` is\n // already captured in the stacktrace.\n err: isWrappedError ? renderToHtmlError.innerError : renderToHtmlError\n }\n }, {\n query,\n components: fallbackComponents\n });\n }\n return {\n type: \"html\",\n body: RenderResult.fromStatic(\"Internal Server Error\")\n };\n }\n }\n async renderErrorToHTML(err, req, res, pathname, query = {}) {\n return this.getStaticHTML((ctx)=>this.renderErrorToResponse(ctx, err), {\n req,\n res,\n pathname,\n query\n });\n }\n async render404(req, res, parsedUrl, setHeaders = true) {\n const { pathname, query } = parsedUrl ? parsedUrl : parseUrl(req.url, true);\n if (this.nextConfig.i18n) {\n query.__nextLocale ||= this.nextConfig.i18n.defaultLocale;\n query.__nextDefaultLocale ||= this.nextConfig.i18n.defaultLocale;\n }\n res.statusCode = 404;\n return this.renderError(null, req, res, pathname, query, setHeaders);\n }\n}\nexport function isRSCRequestCheck(req) {\n return req.headers[RSC_HEADER.toLowerCase()] === \"1\" || Boolean(getRequestMeta(req, \"isRSCRequest\"));\n}\n\n//# sourceMappingURL=base-server.js.map","// Translate a pages asset path (relative from a common prefix) back into its logical route\nimport { isDynamicRoute } from \"./is-dynamic\";\n// \"asset path\" being its javascript file, data file, prerendered html,...\nexport default function getRouteFromAssetPath(assetPath, ext) {\n if (ext === void 0) ext = \"\";\n assetPath = assetPath.replace(/\\\\/g, \"/\");\n assetPath = ext && assetPath.endsWith(ext) ? assetPath.slice(0, -ext.length) : assetPath;\n if (assetPath.startsWith(\"/index/\") && !isDynamicRoute(assetPath)) {\n assetPath = assetPath.slice(6);\n } else if (assetPath === \"/index\") {\n assetPath = \"/\";\n }\n return assetPath;\n}\n\n//# sourceMappingURL=get-route-from-asset-path.js.map","import { isIPv6 } from \"./is-ipv6\";\n/**\n * Formats a hostname so that it is a valid host that can be fetched by wrapping\n * IPv6 hosts with brackets.\n * @param hostname\n * @returns\n */ export function formatHostname(hostname) {\n return isIPv6(hostname) ? `[${hostname}]` : hostname;\n}\n\n//# sourceMappingURL=format-hostname.js.map","import { format as formatUrl, parse as parseUrl } from \"url\";\nimport { normalizeLocalePath } from \"../shared/lib/i18n/normalize-locale-path\";\nimport { getPathMatch } from \"../shared/lib/router/utils/path-match\";\nimport { getNamedRouteRegex } from \"../shared/lib/router/utils/route-regex\";\nimport { getRouteMatcher } from \"../shared/lib/router/utils/route-matcher\";\nimport { matchHas, prepareDestination } from \"../shared/lib/router/utils/prepare-destination\";\nimport { removeTrailingSlash } from \"../shared/lib/router/utils/remove-trailing-slash\";\nimport { normalizeRscURL } from \"../shared/lib/router/utils/app-paths\";\nimport { NEXT_QUERY_PARAM_PREFIX } from \"../lib/constants\";\nexport function normalizeVercelUrl(req, trustQuery, paramKeys, pageIsDynamic, defaultRouteRegex) {\n // make sure to normalize req.url on Vercel to strip dynamic params\n // from the query which are added during routing\n if (pageIsDynamic && trustQuery && defaultRouteRegex) {\n const _parsedUrl = parseUrl(req.url, true);\n delete _parsedUrl.search;\n for (const key of Object.keys(_parsedUrl.query)){\n if (key !== NEXT_QUERY_PARAM_PREFIX && key.startsWith(NEXT_QUERY_PARAM_PREFIX) || (paramKeys || Object.keys(defaultRouteRegex.groups)).includes(key)) {\n delete _parsedUrl.query[key];\n }\n }\n req.url = formatUrl(_parsedUrl);\n }\n}\nexport function interpolateDynamicPath(pathname, params, defaultRouteRegex) {\n if (!defaultRouteRegex) return pathname;\n for (const param of Object.keys(defaultRouteRegex.groups)){\n const { optional, repeat } = defaultRouteRegex.groups[param];\n let builtParam = `[${repeat ? \"...\" : \"\"}${param}]`;\n if (optional) {\n builtParam = `[${builtParam}]`;\n }\n const paramIdx = pathname.indexOf(builtParam);\n if (paramIdx > -1) {\n let paramValue;\n const value = params[param];\n if (Array.isArray(value)) {\n paramValue = value.map((v)=>v && encodeURIComponent(v)).join(\"/\");\n } else if (value) {\n paramValue = encodeURIComponent(value);\n } else {\n paramValue = \"\";\n }\n pathname = pathname.slice(0, paramIdx) + paramValue + pathname.slice(paramIdx + builtParam.length);\n }\n }\n return pathname;\n}\nexport function normalizeDynamicRouteParams(params, ignoreOptional, defaultRouteRegex, defaultRouteMatches) {\n let hasValidParams = true;\n if (!defaultRouteRegex) return {\n params,\n hasValidParams: false\n };\n params = Object.keys(defaultRouteRegex.groups).reduce((prev, key)=>{\n let value = params[key];\n if (typeof value === \"string\") {\n value = normalizeRscURL(value);\n }\n if (Array.isArray(value)) {\n value = value.map((val)=>{\n if (typeof val === \"string\") {\n val = normalizeRscURL(val);\n }\n return val;\n });\n }\n // if the value matches the default value we can't rely\n // on the parsed params, this is used to signal if we need\n // to parse x-now-route-matches or not\n const defaultValue = defaultRouteMatches[key];\n const isOptional = defaultRouteRegex.groups[key].optional;\n const isDefaultValue = Array.isArray(defaultValue) ? defaultValue.some((defaultVal)=>{\n return Array.isArray(value) ? value.some((val)=>val.includes(defaultVal)) : value == null ? void 0 : value.includes(defaultVal);\n }) : value == null ? void 0 : value.includes(defaultValue);\n if (isDefaultValue || typeof value === \"undefined\" && !(isOptional && ignoreOptional)) {\n hasValidParams = false;\n }\n // non-provided optional values should be undefined so normalize\n // them to undefined\n if (isOptional && (!value || Array.isArray(value) && value.length === 1 && // fallback optional catch-all SSG pages have\n // [[...paramName]] for the root path on Vercel\n (value[0] === \"index\" || value[0] === `[[...${key}]]`))) {\n value = undefined;\n delete params[key];\n }\n // query values from the proxy aren't already split into arrays\n // so make sure to normalize catch-all values\n if (value && typeof value === \"string\" && defaultRouteRegex.groups[key].repeat) {\n value = value.split(\"/\");\n }\n if (value) {\n prev[key] = value;\n }\n return prev;\n }, {});\n return {\n params,\n hasValidParams\n };\n}\nexport function getUtils({ page, i18n, basePath, rewrites, pageIsDynamic, trailingSlash, caseSensitive }) {\n let defaultRouteRegex;\n let dynamicRouteMatcher;\n let defaultRouteMatches;\n if (pageIsDynamic) {\n defaultRouteRegex = getNamedRouteRegex(page, false);\n dynamicRouteMatcher = getRouteMatcher(defaultRouteRegex);\n defaultRouteMatches = dynamicRouteMatcher(page);\n }\n function handleRewrites(req, parsedUrl) {\n const rewriteParams = {};\n let fsPathname = parsedUrl.pathname;\n const matchesPage = ()=>{\n const fsPathnameNoSlash = removeTrailingSlash(fsPathname || \"\");\n return fsPathnameNoSlash === removeTrailingSlash(page) || (dynamicRouteMatcher == null ? void 0 : dynamicRouteMatcher(fsPathnameNoSlash));\n };\n const checkRewrite = (rewrite)=>{\n const matcher = getPathMatch(rewrite.source + (trailingSlash ? \"(/)?\" : \"\"), {\n removeUnnamedParams: true,\n strict: true,\n sensitive: !!caseSensitive\n });\n let params = matcher(parsedUrl.pathname);\n if ((rewrite.has || rewrite.missing) && params) {\n const hasParams = matchHas(req, parsedUrl.query, rewrite.has, rewrite.missing);\n if (hasParams) {\n Object.assign(params, hasParams);\n } else {\n params = false;\n }\n }\n if (params) {\n const { parsedDestination, destQuery } = prepareDestination({\n appendParamsToQuery: true,\n destination: rewrite.destination,\n params: params,\n query: parsedUrl.query\n });\n // if the rewrite destination is external break rewrite chain\n if (parsedDestination.protocol) {\n return true;\n }\n Object.assign(rewriteParams, destQuery, params);\n Object.assign(parsedUrl.query, parsedDestination.query);\n delete parsedDestination.query;\n Object.assign(parsedUrl, parsedDestination);\n fsPathname = parsedUrl.pathname;\n if (basePath) {\n fsPathname = fsPathname.replace(new RegExp(`^${basePath}`), \"\") || \"/\";\n }\n if (i18n) {\n const destLocalePathResult = normalizeLocalePath(fsPathname, i18n.locales);\n fsPathname = destLocalePathResult.pathname;\n parsedUrl.query.nextInternalLocale = destLocalePathResult.detectedLocale || params.nextInternalLocale;\n }\n if (fsPathname === page) {\n return true;\n }\n if (pageIsDynamic && dynamicRouteMatcher) {\n const dynamicParams = dynamicRouteMatcher(fsPathname);\n if (dynamicParams) {\n parsedUrl.query = {\n ...parsedUrl.query,\n ...dynamicParams\n };\n return true;\n }\n }\n }\n return false;\n };\n for (const rewrite of rewrites.beforeFiles || []){\n checkRewrite(rewrite);\n }\n if (fsPathname !== page) {\n let finished = false;\n for (const rewrite of rewrites.afterFiles || []){\n finished = checkRewrite(rewrite);\n if (finished) break;\n }\n if (!finished && !matchesPage()) {\n for (const rewrite of rewrites.fallback || []){\n finished = checkRewrite(rewrite);\n if (finished) break;\n }\n }\n }\n return rewriteParams;\n }\n function getParamsFromRouteMatches(req, renderOpts, detectedLocale) {\n return getRouteMatcher(function() {\n const { groups, routeKeys } = defaultRouteRegex;\n return {\n re: {\n // Simulate a RegExp match from the \\`req.url\\` input\n exec: (str)=>{\n const obj = Object.fromEntries(new URLSearchParams(str));\n const matchesHasLocale = i18n && detectedLocale && obj[\"1\"] === detectedLocale;\n for (const key of Object.keys(obj)){\n const value = obj[key];\n if (key !== NEXT_QUERY_PARAM_PREFIX && key.startsWith(NEXT_QUERY_PARAM_PREFIX)) {\n const normalizedKey = key.substring(NEXT_QUERY_PARAM_PREFIX.length);\n obj[normalizedKey] = value;\n delete obj[key];\n }\n }\n // favor named matches if available\n const routeKeyNames = Object.keys(routeKeys || {});\n const filterLocaleItem = (val)=>{\n if (i18n) {\n // locale items can be included in route-matches\n // for fallback SSG pages so ensure they are\n // filtered\n const isCatchAll = Array.isArray(val);\n const _val = isCatchAll ? val[0] : val;\n if (typeof _val === \"string\" && i18n.locales.some((item)=>{\n if (item.toLowerCase() === _val.toLowerCase()) {\n detectedLocale = item;\n renderOpts.locale = detectedLocale;\n return true;\n }\n return false;\n })) {\n // remove the locale item from the match\n if (isCatchAll) {\n val.splice(0, 1);\n }\n // the value is only a locale item and\n // shouldn't be added\n return isCatchAll ? val.length === 0 : true;\n }\n }\n return false;\n };\n if (routeKeyNames.every((name)=>obj[name])) {\n return routeKeyNames.reduce((prev, keyName)=>{\n const paramName = routeKeys == null ? void 0 : routeKeys[keyName];\n if (paramName && !filterLocaleItem(obj[keyName])) {\n prev[groups[paramName].pos] = obj[keyName];\n }\n return prev;\n }, {});\n }\n return Object.keys(obj).reduce((prev, key)=>{\n if (!filterLocaleItem(obj[key])) {\n let normalizedKey = key;\n if (matchesHasLocale) {\n normalizedKey = parseInt(key, 10) - 1 + \"\";\n }\n return Object.assign(prev, {\n [normalizedKey]: obj[key]\n });\n }\n return prev;\n }, {});\n }\n },\n groups\n };\n }())(req.headers[\"x-now-route-matches\"]);\n }\n return {\n handleRewrites,\n defaultRouteRegex,\n dynamicRouteMatcher,\n defaultRouteMatches,\n getParamsFromRouteMatches,\n normalizeDynamicRouteParams: (params, ignoreOptional)=>normalizeDynamicRouteParams(params, ignoreOptional, defaultRouteRegex, defaultRouteMatches),\n normalizeVercelUrl: (req, trustQuery, paramKeys)=>normalizeVercelUrl(req, trustQuery, paramKeys, pageIsDynamic, defaultRouteRegex),\n interpolateDynamicPath: (pathname, params)=>interpolateDynamicPath(pathname, params, defaultRouteRegex)\n };\n}\n\n//# sourceMappingURL=server-utils.js.map","import { BLOCKED_PAGES } from \"../shared/lib/constants\";\nexport function isBlockedPage(page) {\n return BLOCKED_PAGES.includes(page);\n}\nexport function cleanAmpPath(pathname) {\n if (pathname.match(/\\?amp=(y|yes|true|1)/)) {\n pathname = pathname.replace(/\\?amp=(y|yes|true|1)&?/, \"?\");\n }\n if (pathname.match(/&amp=(y|yes|true|1)/)) {\n pathname = pathname.replace(/&amp=(y|yes|true|1)/, \"\");\n }\n pathname = pathname.replace(/\\?$/, \"\");\n return pathname;\n}\nexport function debounce(fn, ms, maxWait = Infinity) {\n let timeoutId;\n // The time the debouncing function was first called during this debounce queue.\n let startTime = 0;\n // The time the debouncing function was last called.\n let lastCall = 0;\n // The arguments and this context of the last call to the debouncing function.\n let args, context;\n // A helper used to that either invokes the debounced function, or\n // reschedules the timer if a more recent call was made.\n function run() {\n const now = Date.now();\n const diff = lastCall + ms - now;\n // If the diff is non-positive, then we've waited at least `ms`\n // milliseconds since the last call. Or if we've waited for longer than the\n // max wait time, we must call the debounced function.\n if (diff <= 0 || startTime + maxWait >= now) {\n // It's important to clear the timeout id before invoking the debounced\n // function, in case the function calls the debouncing function again.\n timeoutId = undefined;\n fn.apply(context, args);\n } else {\n // Else, a new call was made after the original timer was scheduled. We\n // didn't clear the timeout (doing so is very slow), so now we need to\n // reschedule the timer for the time difference.\n timeoutId = setTimeout(run, diff);\n }\n }\n return function(...passedArgs) {\n // The arguments and this context of the most recent call are saved so the\n // debounced function can be invoked with them later.\n args = passedArgs;\n context = this;\n // Instead of constantly clearing and scheduling a timer, we record the\n // time of the last call. If a second call comes in before the timer fires,\n // then we'll reschedule in the run function. Doing this is considerably\n // faster.\n lastCall = Date.now();\n // Only schedule a new timer if we're not currently waiting.\n if (timeoutId === undefined) {\n startTime = lastCall;\n timeoutId = setTimeout(run, ms);\n }\n };\n}\n\n//# sourceMappingURL=utils.js.map","import { SERVER_RUNTIME } from \"./constants\";\nexport function isEdgeRuntime(value) {\n return value === SERVER_RUNTIME.experimentalEdge || value === SERVER_RUNTIME.edge;\n}\n\n//# sourceMappingURL=is-edge-runtime.js.map","import { ACTION } from \"../../client/components/app-router-headers\";\nexport function getServerActionRequestMetadata(req) {\n let actionId;\n let contentType;\n if (req.headers instanceof Headers) {\n actionId = req.headers.get(ACTION.toLowerCase()) ?? null;\n contentType = req.headers.get(\"content-type\");\n } else {\n actionId = req.headers[ACTION.toLowerCase()] ?? null;\n contentType = req.headers[\"content-type\"] ?? null;\n }\n const isURLEncodedAction = Boolean(req.method === \"POST\" && contentType === \"application/x-www-form-urlencoded\");\n const isMultipartAction = Boolean(req.method === \"POST\" && (contentType == null ? void 0 : contentType.startsWith(\"multipart/form-data\")));\n const isFetchAction = Boolean(actionId !== undefined && typeof actionId === \"string\" && req.method === \"POST\");\n const isServerAction = Boolean(isFetchAction || isURLEncodedAction || isMultipartAction);\n return {\n actionId,\n isURLEncodedAction,\n isMultipartAction,\n isFetchAction,\n isServerAction\n };\n}\nexport function getIsServerAction(req) {\n return getServerActionRequestMetadata(req).isServerAction;\n}\n\n//# sourceMappingURL=server-action-request-meta.js.map","// escape delimiters used by path-to-regexp\nexport default function escapePathDelimiters(segment, escapeEncoded) {\n return segment.replace(new RegExp(\"([/#?]\" + (escapeEncoded ? \"|%(2f|23|3f)\" : \"\") + \")\", \"gi\"), (char)=>encodeURIComponent(char));\n}\n\n//# sourceMappingURL=escape-path-delimiters.js.map","import { RouteKind } from \"../route-kind\";\nexport function isAppRouteRouteModule(routeModule) {\n return routeModule.definition.kind === RouteKind.APP_ROUTE;\n}\nexport function isAppPageRouteModule(routeModule) {\n return routeModule.definition.kind === RouteKind.APP_PAGE;\n}\nexport function isPagesRouteModule(routeModule) {\n return routeModule.definition.kind === RouteKind.PAGES;\n}\nexport function isPagesAPIRouteModule(routeModule) {\n return routeModule.definition.kind === RouteKind.PAGES_API;\n}\n\n//# sourceMappingURL=checks.js.map","import { appendMutableCookies } from \"../../../web/spec-extension/adapters/request-cookies\";\nexport function handleRedirectResponse(url, mutableCookies, status) {\n const headers = new Headers({\n location: url\n });\n appendMutableCookies(headers, mutableCookies);\n return new Response(null, {\n status,\n headers\n });\n}\nexport function handleBadRequestResponse() {\n return new Response(null, {\n status: 400\n });\n}\nexport function handleNotFoundResponse() {\n return new Response(null, {\n status: 404\n });\n}\nexport function handleMethodNotAllowedResponse() {\n return new Response(null, {\n status: 405\n });\n}\nexport function handleInternalServerErrorResponse() {\n return new Response(null, {\n status: 500\n });\n}\n\n//# sourceMappingURL=response-handlers.js.map","import { RedirectStatusCode } from \"../client/components/redirect-status-code\";\nexport const allowedStatusCodes = new Set([\n 301,\n 302,\n 303,\n 307,\n 308\n]);\nexport function getRedirectStatus(route) {\n return route.statusCode || (route.permanent ? RedirectStatusCode.PermanentRedirect : RedirectStatusCode.TemporaryRedirect);\n}\n// for redirects we restrict matching /_next and for all routes\n// we add an optional trailing slash at the end for easier\n// configuring between trailingSlash: true/false\nexport function modifyRouteRegex(regex, restrictedPaths) {\n if (restrictedPaths) {\n regex = regex.replace(/\\^/, `^(?!${restrictedPaths.map((path)=>path.replace(/\\//g, \"\\\\/\")).join(\"|\")})`);\n }\n regex = regex.replace(/\\$$/, \"(?:\\\\/)?$\");\n return regex;\n}\n\n//# sourceMappingURL=redirect-status.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"vm\");","/**\n * Recursively freezes an object and all of its properties. This prevents the\n * object from being modified at runtime. When the JS runtime is running in\n * strict mode, any attempts to modify a frozen object will throw an error.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n * @param obj The object to freeze.\n */ export function deepFreeze(obj) {\n // If the object is already frozen, there's no need to freeze it again.\n if (Object.isFrozen(obj)) return obj;\n // An array is an object, but we also want to freeze each element in the array\n // as well.\n if (Array.isArray(obj)) {\n for (const item of obj){\n if (!item || typeof item !== \"object\") continue;\n deepFreeze(item);\n }\n return Object.freeze(obj);\n }\n for (const value of Object.values(obj)){\n if (!value || typeof value !== \"object\") continue;\n deepFreeze(value);\n }\n return Object.freeze(obj);\n}\n\n//# sourceMappingURL=deep-freeze.js.map","import { readFileSync } from \"fs\";\nimport { runInNewContext } from \"vm\";\nimport { deepFreeze } from \"../shared/lib/deep-freeze\";\nconst sharedCache = new Map();\nexport function loadManifest(path, shouldCache = true, cache = sharedCache) {\n const cached = shouldCache && cache.get(path);\n if (cached) {\n return cached;\n }\n let manifest = JSON.parse(readFileSync(path, \"utf8\"));\n // Freeze the manifest so it cannot be modified if we're caching it.\n if (shouldCache) {\n manifest = deepFreeze(manifest);\n }\n if (shouldCache) {\n cache.set(path, manifest);\n }\n return manifest;\n}\nexport function evalManifest(path, shouldCache = true, cache = sharedCache) {\n const cached = shouldCache && cache.get(path);\n if (cached) {\n return cached;\n }\n const content = readFileSync(path, \"utf8\");\n if (content.length === 0) {\n throw new Error(\"Manifest file is empty\");\n }\n let contextObject = {};\n runInNewContext(content, contextObject);\n // Freeze the context object so it cannot be modified if we're caching it.\n if (shouldCache) {\n contextObject = deepFreeze(contextObject);\n }\n if (shouldCache) {\n cache.set(path, contextObject);\n }\n return contextObject;\n}\nexport function clearManifestCache(path, cache = sharedCache) {\n return cache.delete(path);\n}\n\n//# sourceMappingURL=load-manifest.js.map","import path from \"path\";\nimport { AUTOMATIC_FONT_OPTIMIZATION_MANIFEST, PAGES_MANIFEST, SERVER_DIRECTORY, APP_PATHS_MANIFEST } from \"../shared/lib/constants\";\nimport { normalizeLocalePath } from \"../shared/lib/i18n/normalize-locale-path\";\nimport { normalizePagePath } from \"../shared/lib/page-path/normalize-page-path\";\nimport { denormalizePagePath } from \"../shared/lib/page-path/denormalize-page-path\";\nimport { PageNotFoundError, MissingStaticPage } from \"../shared/lib/utils\";\nimport LRUCache from \"next/dist/compiled/lru-cache\";\nimport { loadManifest } from \"./load-manifest\";\nimport { promises } from \"fs\";\nconst isDev = process.env.NODE_ENV === \"development\";\nconst pagePathCache = !isDev ? new LRUCache({\n max: 1000\n}) : null;\nexport function getMaybePagePath(page, distDir, locales, isAppPath) {\n const cacheKey = `${page}:${distDir}:${locales}:${isAppPath}`;\n let pagePath = pagePathCache == null ? void 0 : pagePathCache.get(cacheKey);\n // If we have a cached path, we can return it directly.\n if (pagePath) return pagePath;\n const serverBuildPath = path.join(distDir, SERVER_DIRECTORY);\n let appPathsManifest;\n if (isAppPath) {\n appPathsManifest = loadManifest(path.join(serverBuildPath, APP_PATHS_MANIFEST), !isDev);\n }\n const pagesManifest = loadManifest(path.join(serverBuildPath, PAGES_MANIFEST), !isDev);\n try {\n page = denormalizePagePath(normalizePagePath(page));\n } catch (err) {\n console.error(err);\n throw new PageNotFoundError(page);\n }\n const checkManifest = (manifest)=>{\n let curPath = manifest[page];\n if (!manifest[curPath] && locales) {\n const manifestNoLocales = {};\n for (const key of Object.keys(manifest)){\n manifestNoLocales[normalizeLocalePath(key, locales).pathname] = pagesManifest[key];\n }\n curPath = manifestNoLocales[page];\n }\n return curPath;\n };\n if (appPathsManifest) {\n pagePath = checkManifest(appPathsManifest);\n }\n if (!pagePath) {\n pagePath = checkManifest(pagesManifest);\n }\n if (!pagePath) {\n pagePathCache == null ? void 0 : pagePathCache.set(cacheKey, null);\n return null;\n }\n pagePath = path.join(serverBuildPath, pagePath);\n pagePathCache == null ? void 0 : pagePathCache.set(cacheKey, pagePath);\n return pagePath;\n}\nexport function getPagePath(page, distDir, locales, isAppPath) {\n const pagePath = getMaybePagePath(page, distDir, locales, isAppPath);\n if (!pagePath) {\n throw new PageNotFoundError(page);\n }\n return pagePath;\n}\nexport function requirePage(page, distDir, isAppPath) {\n const pagePath = getPagePath(page, distDir, undefined, isAppPath);\n if (pagePath.endsWith(\".html\")) {\n return promises.readFile(pagePath, \"utf8\").catch((err)=>{\n throw new MissingStaticPage(page, err.message);\n });\n }\n // since require is synchronous we can set the specific runtime\n // we are requiring for the require-hook and then clear after\n try {\n process.env.__NEXT_PRIVATE_RUNTIME_TYPE = isAppPath ? \"app\" : \"pages\";\n const mod = process.env.NEXT_MINIMAL ? __non_webpack_require__(pagePath) : require(pagePath);\n return mod;\n } finally{\n process.env.__NEXT_PRIVATE_RUNTIME_TYPE = \"\";\n }\n}\nexport function requireFontManifest(distDir) {\n const serverBuildPath = path.join(distDir, SERVER_DIRECTORY);\n const fontManifest = loadManifest(path.join(serverBuildPath, AUTOMATIC_FONT_OPTIMIZATION_MANIFEST));\n return fontManifest;\n}\n\n//# sourceMappingURL=require.js.map","export function interopDefault(mod) {\n return mod.default || mod;\n}\n\n//# sourceMappingURL=interop-default.js.map","/**\n * Wait for a given number of milliseconds and then resolve.\n *\n * @param ms the number of milliseconds to wait\n */ export async function wait(ms) {\n return new Promise((resolve)=>setTimeout(resolve, ms));\n}\n\n//# sourceMappingURL=wait.js.map","// Keep the key in memory as it should never change during the lifetime of the server in\n// both development and production.\nlet __next_encryption_key_generation_promise = null;\nlet __next_loaded_action_key;\nlet __next_internal_development_raw_action_key;\nexport function arrayBufferToString(buffer) {\n const bytes = new Uint8Array(buffer);\n const len = bytes.byteLength;\n // @anonrig: V8 has a limit of 65535 arguments in a function.\n // For len < 65535, this is faster.\n // https://github.com/vercel/next.js/pull/56377#pullrequestreview-1656181623\n if (len < 65535) {\n return String.fromCharCode.apply(null, bytes);\n }\n let binary = \"\";\n for(let i = 0; i < len; i++){\n binary += String.fromCharCode(bytes[i]);\n }\n return binary;\n}\nexport function stringToUint8Array(binary) {\n const len = binary.length;\n const arr = new Uint8Array(len);\n for(let i = 0; i < len; i++){\n arr[i] = binary.charCodeAt(i);\n }\n return arr;\n}\nexport function encrypt(key, iv, data) {\n return crypto.subtle.encrypt({\n name: \"AES-GCM\",\n iv\n }, key, data);\n}\nexport function decrypt(key, iv, data) {\n return crypto.subtle.decrypt({\n name: \"AES-GCM\",\n iv\n }, key, data);\n}\nexport async function generateEncryptionKeyBase64(dev) {\n // For development, we just keep one key in memory for all actions.\n // This makes things faster.\n if (dev) {\n if (typeof __next_internal_development_raw_action_key !== \"undefined\") {\n return __next_internal_development_raw_action_key;\n }\n }\n // This avoids it being generated multiple times in parallel.\n if (!__next_encryption_key_generation_promise) {\n __next_encryption_key_generation_promise = new Promise(async (resolve, reject)=>{\n try {\n const key = await crypto.subtle.generateKey({\n name: \"AES-GCM\",\n length: 256\n }, true, [\n \"encrypt\",\n \"decrypt\"\n ]);\n const exported = await crypto.subtle.exportKey(\"raw\", key);\n const b64 = btoa(arrayBufferToString(exported));\n resolve([\n key,\n b64\n ]);\n } catch (error) {\n reject(error);\n }\n });\n }\n const [key, b64] = await __next_encryption_key_generation_promise;\n __next_loaded_action_key = key;\n if (dev) {\n __next_internal_development_raw_action_key = b64;\n }\n return b64;\n}\n// This is a global singleton that is used to encode/decode the action bound args from\n// the closure. This can't be using a AsyncLocalStorage as it might happen on the module\n// level. Since the client reference manifest won't be mutated, let's use a global singleton\n// to keep it.\nconst SERVER_ACTION_MANIFESTS_SINGLETON = Symbol.for(\"next.server.action-manifests\");\nexport function setReferenceManifestsSingleton({ clientReferenceManifest, serverActionsManifest, serverModuleMap }) {\n // @ts-ignore\n globalThis[SERVER_ACTION_MANIFESTS_SINGLETON] = {\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap\n };\n}\nexport function getServerModuleMap() {\n const serverActionsManifestSingleton = globalThis[SERVER_ACTION_MANIFESTS_SINGLETON];\n if (!serverActionsManifestSingleton) {\n throw new Error(\"Missing manifest for Server Actions. This is a bug in Next.js\");\n }\n return serverActionsManifestSingleton.serverModuleMap;\n}\nexport function getClientReferenceManifestSingleton() {\n const serverActionsManifestSingleton = globalThis[SERVER_ACTION_MANIFESTS_SINGLETON];\n if (!serverActionsManifestSingleton) {\n throw new Error(\"Missing manifest for Server Actions. This is a bug in Next.js\");\n }\n return serverActionsManifestSingleton.clientReferenceManifest;\n}\nexport async function getActionEncryptionKey() {\n if (__next_loaded_action_key) {\n return __next_loaded_action_key;\n }\n const serverActionsManifestSingleton = globalThis[SERVER_ACTION_MANIFESTS_SINGLETON];\n if (!serverActionsManifestSingleton) {\n throw new Error(\"Missing manifest for Server Actions. This is a bug in Next.js\");\n }\n const rawKey = process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY || serverActionsManifestSingleton.serverActionsManifest.encryptionKey;\n if (rawKey === undefined) {\n throw new Error(\"Missing encryption key for Server Actions\");\n }\n __next_loaded_action_key = await crypto.subtle.importKey(\"raw\", stringToUint8Array(atob(rawKey)), \"AES-GCM\", true, [\n \"encrypt\",\n \"decrypt\"\n ]);\n return __next_loaded_action_key;\n}\n\n//# sourceMappingURL=encryption-utils.js.map","import { BUILD_MANIFEST, REACT_LOADABLE_MANIFEST, CLIENT_REFERENCE_MANIFEST, SERVER_REFERENCE_MANIFEST, UNDERSCORE_NOT_FOUND_ROUTE } from \"../shared/lib/constants\";\nimport { join } from \"path\";\nimport { requirePage } from \"./require\";\nimport { interopDefault } from \"../lib/interop-default\";\nimport { getTracer } from \"./lib/trace/tracer\";\nimport { LoadComponentsSpan } from \"./lib/trace/constants\";\nimport { evalManifest, loadManifest } from \"./load-manifest\";\nimport { wait } from \"../lib/wait\";\nimport { setReferenceManifestsSingleton } from \"./app-render/encryption-utils\";\nimport { createServerModuleMap } from \"./app-render/action-utils\";\n/**\n * Load manifest file with retries, defaults to 3 attempts.\n */ export async function loadManifestWithRetries(manifestPath, attempts = 3) {\n while(true){\n try {\n return loadManifest(manifestPath);\n } catch (err) {\n attempts--;\n if (attempts <= 0) throw err;\n await wait(100);\n }\n }\n}\n/**\n * Load manifest file with retries, defaults to 3 attempts.\n */ export async function evalManifestWithRetries(manifestPath, attempts = 3) {\n while(true){\n try {\n return evalManifest(manifestPath);\n } catch (err) {\n attempts--;\n if (attempts <= 0) throw err;\n await wait(100);\n }\n }\n}\nasync function loadClientReferenceManifest(manifestPath, entryName, attempts) {\n try {\n const context = await evalManifestWithRetries(manifestPath, attempts);\n return context.__RSC_MANIFEST[entryName];\n } catch (err) {\n return undefined;\n }\n}\nasync function loadComponentsImpl({ distDir, page, isAppPath, isDev }) {\n let DocumentMod = {};\n let AppMod = {};\n if (!isAppPath) {\n [DocumentMod, AppMod] = await Promise.all([\n Promise.resolve().then(()=>requirePage(\"/_document\", distDir, false)),\n Promise.resolve().then(()=>requirePage(\"/_app\", distDir, false))\n ]);\n }\n // Make sure to avoid loading the manifest for Route Handlers\n const hasClientManifest = isAppPath && (page.endsWith(\"/page\") || page === UNDERSCORE_NOT_FOUND_ROUTE);\n // In dev mode we retry loading a manifest file to handle a race condition\n // that can occur while app and pages are compiling at the same time, and the\n // build-manifest is still being written to disk while an app path is\n // attempting to load.\n const manifestLoadAttempts = isDev ? 3 : 1;\n // Load the manifest files first\n const [buildManifest, reactLoadableManifest, clientReferenceManifest, serverActionsManifest] = await Promise.all([\n loadManifestWithRetries(join(distDir, BUILD_MANIFEST), manifestLoadAttempts),\n loadManifestWithRetries(join(distDir, REACT_LOADABLE_MANIFEST), manifestLoadAttempts),\n hasClientManifest ? loadClientReferenceManifest(join(distDir, \"server\", \"app\", page.replace(/%5F/g, \"_\") + \"_\" + CLIENT_REFERENCE_MANIFEST + \".js\"), page.replace(/%5F/g, \"_\"), manifestLoadAttempts) : undefined,\n isAppPath ? loadManifestWithRetries(join(distDir, \"server\", SERVER_REFERENCE_MANIFEST + \".json\"), manifestLoadAttempts).catch(()=>null) : null\n ]);\n // Before requring the actual page module, we have to set the reference manifests\n // to our global store so Server Action's encryption util can access to them\n // at the top level of the page module.\n if (serverActionsManifest && clientReferenceManifest) {\n setReferenceManifestsSingleton({\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest,\n pageName: page\n })\n });\n }\n const ComponentMod = await Promise.resolve().then(()=>requirePage(page, distDir, isAppPath));\n const Component = interopDefault(ComponentMod);\n const Document = interopDefault(DocumentMod);\n const App = interopDefault(AppMod);\n const { getServerSideProps, getStaticProps, getStaticPaths, routeModule } = ComponentMod;\n return {\n App,\n Document,\n Component,\n buildManifest,\n reactLoadableManifest,\n pageConfig: ComponentMod.config || {},\n ComponentMod,\n getServerSideProps,\n getStaticProps,\n getStaticPaths,\n clientReferenceManifest,\n serverActionsManifest,\n isAppPath,\n page,\n routeModule\n };\n}\nexport const loadComponents = getTracer().wrap(LoadComponentsSpan.loadComponents, loadComponentsImpl);\n\n//# sourceMappingURL=load-components.js.map","import { normalizeAppPath } from \"../../shared/lib/router/utils/app-paths\";\nimport { pathHasPrefix } from \"../../shared/lib/router/utils/path-has-prefix\";\nimport { removePathPrefix } from \"../../shared/lib/router/utils/remove-path-prefix\";\n// This function creates a Flight-acceptable server module map proxy from our\n// Server Reference Manifest similar to our client module map.\n// This is because our manifest contains a lot of internal Next.js data that\n// are relevant to the runtime, workers, etc. that React doesn't need to know.\nexport function createServerModuleMap({ serverActionsManifest, pageName }) {\n return new Proxy({}, {\n get: (_, id)=>{\n return {\n id: serverActionsManifest[process.env.NEXT_RUNTIME === \"edge\" ? \"edge\" : \"node\"][id].workers[normalizeWorkerPageName(pageName)],\n name: id,\n chunks: []\n };\n }\n });\n}\n/**\n * Checks if the requested action has a worker for the current page.\n * If not, it returns the first worker that has a handler for the action.\n */ export function selectWorkerForForwarding(actionId, pageName, serverActionsManifest) {\n var _serverActionsManifest__actionId;\n const workers = (_serverActionsManifest__actionId = serverActionsManifest[process.env.NEXT_RUNTIME === \"edge\" ? \"edge\" : \"node\"][actionId]) == null ? void 0 : _serverActionsManifest__actionId.workers;\n const workerName = normalizeWorkerPageName(pageName);\n // no workers, nothing to forward to\n if (!workers) return;\n // if there is a worker for this page, no need to forward it.\n if (workers[workerName]) {\n return;\n }\n // otherwise, grab the first worker that has a handler for this action id\n return denormalizeWorkerPageName(Object.keys(workers)[0]);\n}\n/**\n * The flight entry loader keys actions by bundlePath.\n * bundlePath corresponds with the relative path (including 'app') to the page entrypoint.\n */ function normalizeWorkerPageName(pageName) {\n if (pathHasPrefix(pageName, \"app\")) {\n return pageName;\n }\n return \"app\" + pageName;\n}\n/**\n * Converts a bundlePath (relative path to the entrypoint) to a routable page name\n */ function denormalizeWorkerPageName(bundlePath) {\n return normalizeAppPath(removePathPrefix(bundlePath, \"app\"));\n}\n\n//# sourceMappingURL=action-utils.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"stream\");","import { DetachedPromise } from \"./detached-promise\";\n/**\n * A wrapper for a function that will only allow one call to the function to\n * execute at a time.\n */ export class Batcher {\n constructor(cacheKeyFn, /**\n * A function that will be called to schedule the wrapped function to be\n * executed. This defaults to a function that will execute the function\n * immediately.\n */ schedulerFn = (fn)=>fn()){\n this.cacheKeyFn = cacheKeyFn;\n this.schedulerFn = schedulerFn;\n this.pending = new Map();\n }\n static create(options) {\n return new Batcher(options == null ? void 0 : options.cacheKeyFn, options == null ? void 0 : options.schedulerFn);\n }\n /**\n * Wraps a function in a promise that will be resolved or rejected only once\n * for a given key. This will allow multiple calls to the function to be\n * made, but only one will be executed at a time. The result of the first\n * call will be returned to all callers.\n *\n * @param key the key to use for the cache\n * @param fn the function to wrap\n * @returns a promise that resolves to the result of the function\n */ async batch(key, fn) {\n const cacheKey = this.cacheKeyFn ? await this.cacheKeyFn(key) : key;\n if (cacheKey === null) {\n return fn(cacheKey, Promise.resolve);\n }\n const pending = this.pending.get(cacheKey);\n if (pending) return pending;\n const { promise, resolve, reject } = new DetachedPromise();\n this.pending.set(cacheKey, promise);\n this.schedulerFn(async ()=>{\n try {\n const result = await fn(cacheKey, resolve);\n // Resolving a promise multiple times is a no-op, so we can safely\n // resolve all pending promises with the same result.\n resolve(result);\n } catch (err) {\n reject(err);\n } finally{\n this.pending.delete(cacheKey);\n }\n });\n return promise;\n }\n}\n\n//# sourceMappingURL=batcher.js.map","/**\n * Schedules a function to be called on the next tick after the other promises\n * have been resolved.\n *\n * @param cb the function to schedule\n */ export const scheduleOnNextTick = (cb)=>{\n // We use Promise.resolve().then() here so that the operation is scheduled at\n // the end of the promise job queue, we then add it to the next process tick\n // to ensure it's evaluated afterwards.\n //\n // This was inspired by the implementation of the DataLoader interface: https://github.com/graphql/dataloader/blob/d336bd15282664e0be4b4a657cb796f09bafbc6b/src/index.js#L213-L255\n //\n Promise.resolve().then(()=>{\n process.nextTick(cb);\n });\n};\n/**\n * Schedules a function to be called using `setImmediate` or `setTimeout` if\n * `setImmediate` is not available (like in the Edge runtime).\n *\n * @param cb the function to schedule\n */ export const scheduleImmediate = (cb)=>{\n if (process.env.NEXT_RUNTIME === \"edge\") {\n setTimeout(cb, 0);\n } else {\n setImmediate(cb);\n }\n};\n/**\n * returns a promise than resolves in a future task. There is no guarantee that the task it resolves in\n * will be the next task but if you await it you can at least be sure that the current task is over and\n * most usefully that the entire microtask queue of the current task has been emptied.\n */ export function atLeastOneTask() {\n return new Promise((resolve)=>scheduleImmediate(resolve));\n}\n\n//# sourceMappingURL=scheduler.js.map","import RenderResult from \"../render-result\";\nexport async function fromResponseCacheEntry(cacheEntry) {\n var _cacheEntry_value;\n return {\n ...cacheEntry,\n value: ((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) === \"PAGE\" ? {\n kind: \"PAGE\",\n html: await cacheEntry.value.html.toUnchunkedString(true),\n postponed: cacheEntry.value.postponed,\n pageData: cacheEntry.value.pageData,\n headers: cacheEntry.value.headers,\n status: cacheEntry.value.status\n } : cacheEntry.value\n };\n}\nexport async function toResponseCacheEntry(response) {\n var _response_value, _response_value1;\n if (!response) return null;\n if (((_response_value = response.value) == null ? void 0 : _response_value.kind) === \"FETCH\") {\n throw new Error(\"Invariant: unexpected cachedResponse of kind fetch in response cache\");\n }\n return {\n isMiss: response.isMiss,\n isStale: response.isStale,\n revalidate: response.revalidate,\n value: ((_response_value1 = response.value) == null ? void 0 : _response_value1.kind) === \"PAGE\" ? {\n kind: \"PAGE\",\n html: RenderResult.fromStatic(response.value.html),\n pageData: response.value.pageData,\n postponed: response.value.postponed,\n headers: response.value.headers,\n status: response.value.status\n } : response.value\n };\n}\n\n//# sourceMappingURL=utils.js.map","import { RouteKind } from \"../future/route-kind\";\nimport { Batcher } from \"../../lib/batcher\";\nimport { scheduleOnNextTick } from \"../../lib/scheduler\";\nimport { fromResponseCacheEntry, toResponseCacheEntry } from \"./utils\";\nexport * from \"./types\";\nexport default class ResponseCache {\n constructor(minimalMode){\n this.batcher = Batcher.create({\n // Ensure on-demand revalidate doesn't block normal requests, it should be\n // safe to run an on-demand revalidate for the same key as a normal request.\n cacheKeyFn: ({ key, isOnDemandRevalidate })=>`${key}-${isOnDemandRevalidate ? \"1\" : \"0\"}`,\n // We wait to do any async work until after we've added our promise to\n // `pendingResponses` to ensure that any any other calls will reuse the\n // same promise until we've fully finished our work.\n schedulerFn: scheduleOnNextTick\n });\n // this is a hack to avoid Webpack knowing this is equal to this.minimalMode\n // because we replace this.minimalMode to true in production bundles.\n const minimalModeKey = \"minimalMode\";\n this[minimalModeKey] = minimalMode;\n }\n async get(key, responseGenerator, context) {\n // If there is no key for the cache, we can't possibly look this up in the\n // cache so just return the result of the response generator.\n if (!key) return responseGenerator(false, null);\n const { incrementalCache, isOnDemandRevalidate = false } = context;\n const response = await this.batcher.batch({\n key,\n isOnDemandRevalidate\n }, async (cacheKey, resolve)=>{\n var _this_previousCacheItem;\n // We keep the previous cache entry around to leverage when the\n // incremental cache is disabled in minimal mode.\n if (this.minimalMode && ((_this_previousCacheItem = this.previousCacheItem) == null ? void 0 : _this_previousCacheItem.key) === cacheKey && this.previousCacheItem.expiresAt > Date.now()) {\n return this.previousCacheItem.entry;\n }\n // Coerce the kindHint into a given kind for the incremental cache.\n let kindHint;\n if (context.routeKind === RouteKind.APP_PAGE || context.routeKind === RouteKind.APP_ROUTE) {\n kindHint = \"app\";\n } else if (context.routeKind === RouteKind.PAGES) {\n kindHint = \"pages\";\n }\n let resolved = false;\n let cachedResponse = null;\n try {\n cachedResponse = !this.minimalMode ? await incrementalCache.get(key, {\n kindHint\n }) : null;\n if (cachedResponse && !isOnDemandRevalidate) {\n var _cachedResponse_value;\n if (((_cachedResponse_value = cachedResponse.value) == null ? void 0 : _cachedResponse_value.kind) === \"FETCH\") {\n throw new Error(`invariant: unexpected cachedResponse of kind fetch in response cache`);\n }\n resolve({\n ...cachedResponse,\n revalidate: cachedResponse.curRevalidate\n });\n resolved = true;\n if (!cachedResponse.isStale || context.isPrefetch) {\n // The cached value is still valid, so we don't need\n // to update it yet.\n return null;\n }\n }\n const cacheEntry = await responseGenerator(resolved, cachedResponse, true);\n // If the cache entry couldn't be generated, we don't want to cache\n // the result.\n if (!cacheEntry) {\n // Unset the previous cache item if it was set.\n if (this.minimalMode) this.previousCacheItem = undefined;\n return null;\n }\n const resolveValue = await fromResponseCacheEntry({\n ...cacheEntry,\n isMiss: !cachedResponse\n });\n if (!resolveValue) {\n // Unset the previous cache item if it was set.\n if (this.minimalMode) this.previousCacheItem = undefined;\n return null;\n }\n // For on-demand revalidate wait to resolve until cache is set.\n // Otherwise resolve now.\n if (!isOnDemandRevalidate && !resolved) {\n resolve(resolveValue);\n resolved = true;\n }\n if (typeof resolveValue.revalidate !== \"undefined\") {\n if (this.minimalMode) {\n this.previousCacheItem = {\n key: cacheKey,\n entry: resolveValue,\n expiresAt: Date.now() + 1000\n };\n } else {\n await incrementalCache.set(key, resolveValue.value, {\n revalidate: resolveValue.revalidate\n });\n }\n }\n return resolveValue;\n } catch (err) {\n // When a getStaticProps path is erroring we automatically re-set the\n // existing cache under a new expiration to prevent non-stop retrying.\n if (cachedResponse) {\n await incrementalCache.set(key, cachedResponse.value, {\n revalidate: Math.min(Math.max(cachedResponse.revalidate || 3, 3), 30)\n });\n }\n // While revalidating in the background we can't reject as we already\n // resolved the cache entry so log the error here.\n if (resolved) {\n console.error(err);\n return null;\n }\n // We haven't resolved yet, so let's throw to indicate an error.\n throw err;\n }\n });\n return toResponseCacheEntry(response);\n }\n}\n\n//# sourceMappingURL=index.js.map","/**\n * A shared cache of revalidate timings for routes. This cache is used so we\n * don't have to modify the prerender manifest when we want to update the\n * revalidate timings for a route.\n */ export class SharedRevalidateTimings {\n static #_ = /**\n * The in-memory cache of revalidate timings for routes. This cache is\n * populated when the cache is updated with new timings.\n */ this.timings = new Map();\n constructor(/**\n * The prerender manifest that contains the initial revalidate timings for\n * routes.\n */ prerenderManifest){\n this.prerenderManifest = prerenderManifest;\n }\n /**\n * Try to get the revalidate timings for a route. This will first try to get\n * the timings from the in-memory cache. If the timings are not present in the\n * in-memory cache, then the timings will be sourced from the prerender\n * manifest.\n *\n * @param route the route to get the revalidate timings for\n * @returns the revalidate timings for the route, or undefined if the timings\n * are not present in the in-memory cache or the prerender manifest\n */ get(route) {\n var _this_prerenderManifest_routes_route;\n // This is a copy on write cache that is updated when the cache is updated.\n // If the cache is never written to, then the timings will be sourced from\n // the prerender manifest.\n let revalidate = SharedRevalidateTimings.timings.get(route);\n if (typeof revalidate !== \"undefined\") return revalidate;\n revalidate = (_this_prerenderManifest_routes_route = this.prerenderManifest.routes[route]) == null ? void 0 : _this_prerenderManifest_routes_route.initialRevalidateSeconds;\n if (typeof revalidate !== \"undefined\") return revalidate;\n return undefined;\n }\n /**\n * Set the revalidate timings for a route.\n *\n * @param route the route to set the revalidate timings for\n * @param revalidate the revalidate timings for the route\n */ set(route, revalidate) {\n SharedRevalidateTimings.timings.set(route, revalidate);\n }\n /**\n * Clear the in-memory cache of revalidate timings for routes.\n */ clear() {\n SharedRevalidateTimings.timings.clear();\n }\n}\n\n//# sourceMappingURL=shared-revalidate-timings.js.map","import FetchCache from \"./fetch-cache\";\nimport FileSystemCache from \"./file-system-cache\";\nimport { normalizePagePath } from \"../../../shared/lib/page-path/normalize-page-path\";\nimport { CACHE_ONE_YEAR, NEXT_CACHE_REVALIDATED_TAGS_HEADER, NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER, PRERENDER_REVALIDATE_HEADER } from \"../../../lib/constants\";\nimport { toRoute } from \"../to-route\";\nimport { SharedRevalidateTimings } from \"./shared-revalidate-timings\";\nexport class CacheHandler {\n // eslint-disable-next-line\n constructor(_ctx){}\n async get(..._args) {\n return {};\n }\n async set(..._args) {}\n async revalidateTag(..._args) {}\n resetRequestCache() {}\n}\nexport class IncrementalCache {\n constructor({ fs, dev, appDir, pagesDir, flushToDisk, fetchCache, minimalMode, serverDistDir, requestHeaders, requestProtocol, maxMemoryCacheSize, getPrerenderManifest, fetchCacheKeyPrefix, CurCacheHandler, allowedRevalidateHeaderKeys, experimental }){\n var _this_prerenderManifest_preview, _this_prerenderManifest, _this_prerenderManifest_preview1, _this_prerenderManifest1;\n this.locks = new Map();\n this.unlocks = new Map();\n const debug = !!process.env.NEXT_PRIVATE_DEBUG_CACHE;\n this.hasCustomCacheHandler = Boolean(CurCacheHandler);\n if (!CurCacheHandler) {\n if (fs && serverDistDir) {\n if (debug) {\n console.log(\"using filesystem cache handler\");\n }\n CurCacheHandler = FileSystemCache;\n }\n if (FetchCache.isAvailable({\n _requestHeaders: requestHeaders\n }) && minimalMode && fetchCache) {\n if (debug) {\n console.log(\"using fetch cache handler\");\n }\n CurCacheHandler = FetchCache;\n }\n } else if (debug) {\n console.log(\"using custom cache handler\", CurCacheHandler.name);\n }\n if (process.env.__NEXT_TEST_MAX_ISR_CACHE) {\n // Allow cache size to be overridden for testing purposes\n maxMemoryCacheSize = parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE, 10);\n }\n this.dev = dev;\n this.disableForTestmode = process.env.NEXT_PRIVATE_TEST_PROXY === \"true\";\n // this is a hack to avoid Webpack knowing this is equal to this.minimalMode\n // because we replace this.minimalMode to true in production bundles.\n const minimalModeKey = \"minimalMode\";\n this[minimalModeKey] = minimalMode;\n this.requestHeaders = requestHeaders;\n this.requestProtocol = requestProtocol;\n this.allowedRevalidateHeaderKeys = allowedRevalidateHeaderKeys;\n this.prerenderManifest = getPrerenderManifest();\n this.revalidateTimings = new SharedRevalidateTimings(this.prerenderManifest);\n this.fetchCacheKeyPrefix = fetchCacheKeyPrefix;\n let revalidatedTags = [];\n if (requestHeaders[PRERENDER_REVALIDATE_HEADER] === ((_this_prerenderManifest = this.prerenderManifest) == null ? void 0 : (_this_prerenderManifest_preview = _this_prerenderManifest.preview) == null ? void 0 : _this_prerenderManifest_preview.previewModeId)) {\n this.isOnDemandRevalidate = true;\n }\n if (minimalMode && typeof requestHeaders[NEXT_CACHE_REVALIDATED_TAGS_HEADER] === \"string\" && requestHeaders[NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER] === ((_this_prerenderManifest1 = this.prerenderManifest) == null ? void 0 : (_this_prerenderManifest_preview1 = _this_prerenderManifest1.preview) == null ? void 0 : _this_prerenderManifest_preview1.previewModeId)) {\n revalidatedTags = requestHeaders[NEXT_CACHE_REVALIDATED_TAGS_HEADER].split(\",\");\n }\n if (CurCacheHandler) {\n this.cacheHandler = new CurCacheHandler({\n dev,\n fs,\n flushToDisk,\n serverDistDir,\n revalidatedTags,\n maxMemoryCacheSize,\n _pagesDir: !!pagesDir,\n _appDir: !!appDir,\n _requestHeaders: requestHeaders,\n fetchCacheKeyPrefix,\n experimental\n });\n }\n }\n calculateRevalidate(pathname, fromTime, dev) {\n // in development we don't have a prerender-manifest\n // and default to always revalidating to allow easier debugging\n if (dev) return new Date().getTime() - 1000;\n // if an entry isn't present in routes we fallback to a default\n // of revalidating after 1 second.\n const initialRevalidateSeconds = this.revalidateTimings.get(toRoute(pathname)) ?? 1;\n const revalidateAfter = typeof initialRevalidateSeconds === \"number\" ? initialRevalidateSeconds * 1000 + fromTime : initialRevalidateSeconds;\n return revalidateAfter;\n }\n _getPathname(pathname, fetchCache) {\n return fetchCache ? pathname : normalizePagePath(pathname);\n }\n resetRequestCache() {\n var _this_cacheHandler_resetRequestCache, _this_cacheHandler;\n (_this_cacheHandler = this.cacheHandler) == null ? void 0 : (_this_cacheHandler_resetRequestCache = _this_cacheHandler.resetRequestCache) == null ? void 0 : _this_cacheHandler_resetRequestCache.call(_this_cacheHandler);\n }\n async unlock(cacheKey) {\n const unlock = this.unlocks.get(cacheKey);\n if (unlock) {\n unlock();\n this.locks.delete(cacheKey);\n this.unlocks.delete(cacheKey);\n }\n }\n async lock(cacheKey) {\n if (process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT && process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY && process.env.NEXT_RUNTIME !== \"edge\") {\n const invokeIpcMethod = require(\"../server-ipc/request-utils\").invokeIpcMethod;\n await invokeIpcMethod({\n method: \"lock\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n cacheKey\n ]\n });\n return async ()=>{\n await invokeIpcMethod({\n method: \"unlock\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n cacheKey\n ]\n });\n };\n }\n let unlockNext = ()=>Promise.resolve();\n const existingLock = this.locks.get(cacheKey);\n if (existingLock) {\n await existingLock;\n } else {\n const newLock = new Promise((resolve)=>{\n unlockNext = async ()=>{\n resolve();\n };\n });\n this.locks.set(cacheKey, newLock);\n this.unlocks.set(cacheKey, unlockNext);\n }\n return unlockNext;\n }\n async revalidateTag(tags) {\n var _this_cacheHandler_revalidateTag, _this_cacheHandler;\n if (process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT && process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY && process.env.NEXT_RUNTIME !== \"edge\") {\n const invokeIpcMethod = require(\"../server-ipc/request-utils\").invokeIpcMethod;\n return invokeIpcMethod({\n method: \"revalidateTag\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n ...arguments\n ]\n });\n }\n return (_this_cacheHandler = this.cacheHandler) == null ? void 0 : (_this_cacheHandler_revalidateTag = _this_cacheHandler.revalidateTag) == null ? void 0 : _this_cacheHandler_revalidateTag.call(_this_cacheHandler, tags);\n }\n // x-ref: https://github.com/facebook/react/blob/2655c9354d8e1c54ba888444220f63e836925caa/packages/react/src/ReactFetch.js#L23\n async fetchCacheKey(url, init = {}) {\n // this should be bumped anytime a fix is made to cache entries\n // that should bust the cache\n const MAIN_KEY_PREFIX = \"v3\";\n const bodyChunks = [];\n const encoder = new TextEncoder();\n const decoder = new TextDecoder();\n if (init.body) {\n // handle ReadableStream body\n if (typeof init.body.getReader === \"function\") {\n const readableBody = init.body;\n const chunks = [];\n try {\n await readableBody.pipeTo(new WritableStream({\n write (chunk) {\n if (typeof chunk === \"string\") {\n chunks.push(encoder.encode(chunk));\n bodyChunks.push(chunk);\n } else {\n chunks.push(chunk);\n bodyChunks.push(decoder.decode(chunk, {\n stream: true\n }));\n }\n }\n }));\n // Flush the decoder.\n bodyChunks.push(decoder.decode());\n // Create a new buffer with all the chunks.\n const length = chunks.reduce((total, arr)=>total + arr.length, 0);\n const arrayBuffer = new Uint8Array(length);\n // Push each of the chunks into the new array buffer.\n let offset = 0;\n for (const chunk of chunks){\n arrayBuffer.set(chunk, offset);\n offset += chunk.length;\n }\n init._ogBody = arrayBuffer;\n } catch (err) {\n console.error(\"Problem reading body\", err);\n }\n } else if (typeof init.body.keys === \"function\") {\n const formData = init.body;\n init._ogBody = init.body;\n for (const key of new Set([\n ...formData.keys()\n ])){\n const values = formData.getAll(key);\n bodyChunks.push(`${key}=${(await Promise.all(values.map(async (val)=>{\n if (typeof val === \"string\") {\n return val;\n } else {\n return await val.text();\n }\n }))).join(\",\")}`);\n }\n // handle blob body\n } else if (typeof init.body.arrayBuffer === \"function\") {\n const blob = init.body;\n const arrayBuffer = await blob.arrayBuffer();\n bodyChunks.push(await blob.text());\n init._ogBody = new Blob([\n arrayBuffer\n ], {\n type: blob.type\n });\n } else if (typeof init.body === \"string\") {\n bodyChunks.push(init.body);\n init._ogBody = init.body;\n }\n }\n const headers = typeof (init.headers || {}).keys === \"function\" ? Object.fromEntries(init.headers) : Object.assign({}, init.headers);\n if (\"traceparent\" in headers) delete headers[\"traceparent\"];\n const cacheString = JSON.stringify([\n MAIN_KEY_PREFIX,\n this.fetchCacheKeyPrefix || \"\",\n url,\n init.method,\n headers,\n init.mode,\n init.redirect,\n init.credentials,\n init.referrer,\n init.referrerPolicy,\n init.integrity,\n init.cache,\n bodyChunks\n ]);\n if (process.env.NEXT_RUNTIME === \"edge\") {\n function bufferToHex(buffer) {\n return Array.prototype.map.call(new Uint8Array(buffer), (b)=>b.toString(16).padStart(2, \"0\")).join(\"\");\n }\n const buffer = encoder.encode(cacheString);\n return bufferToHex(await crypto.subtle.digest(\"SHA-256\", buffer));\n } else {\n const crypto1 = require(\"crypto\");\n return crypto1.createHash(\"sha256\").update(cacheString).digest(\"hex\");\n }\n }\n // get data from cache if available\n async get(cacheKey, ctx = {}) {\n var _this_cacheHandler, _cacheData_value;\n if (process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT && process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY && process.env.NEXT_RUNTIME !== \"edge\") {\n const invokeIpcMethod = require(\"../server-ipc/request-utils\").invokeIpcMethod;\n return invokeIpcMethod({\n method: \"get\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n ...arguments\n ]\n });\n }\n // we don't leverage the prerender cache in dev mode\n // so that getStaticProps is always called for easier debugging\n if (this.disableForTestmode || this.dev && (ctx.kindHint !== \"fetch\" || this.requestHeaders[\"cache-control\"] === \"no-cache\")) {\n return null;\n }\n cacheKey = this._getPathname(cacheKey, ctx.kindHint === \"fetch\");\n let entry = null;\n let revalidate = ctx.revalidate;\n const cacheData = await ((_this_cacheHandler = this.cacheHandler) == null ? void 0 : _this_cacheHandler.get(cacheKey, ctx));\n if ((cacheData == null ? void 0 : (_cacheData_value = cacheData.value) == null ? void 0 : _cacheData_value.kind) === \"FETCH\") {\n const combinedTags = [\n ...ctx.tags || [],\n ...ctx.softTags || []\n ];\n // if a tag was revalidated we don't return stale data\n if (combinedTags.some((tag)=>{\n var _this_revalidatedTags;\n return (_this_revalidatedTags = this.revalidatedTags) == null ? void 0 : _this_revalidatedTags.includes(tag);\n })) {\n return null;\n }\n revalidate = revalidate || cacheData.value.revalidate;\n const age = (Date.now() - (cacheData.lastModified || 0)) / 1000;\n const isStale = age > revalidate;\n const data = cacheData.value.data;\n return {\n isStale: isStale,\n value: {\n kind: \"FETCH\",\n data,\n revalidate: revalidate\n },\n revalidateAfter: Date.now() + revalidate * 1000\n };\n }\n const curRevalidate = this.revalidateTimings.get(toRoute(cacheKey));\n let isStale;\n let revalidateAfter;\n if ((cacheData == null ? void 0 : cacheData.lastModified) === -1) {\n isStale = -1;\n revalidateAfter = -1 * CACHE_ONE_YEAR;\n } else {\n revalidateAfter = this.calculateRevalidate(cacheKey, (cacheData == null ? void 0 : cacheData.lastModified) || Date.now(), this.dev && ctx.kindHint !== \"fetch\");\n isStale = revalidateAfter !== false && revalidateAfter < Date.now() ? true : undefined;\n }\n if (cacheData) {\n entry = {\n isStale,\n curRevalidate,\n revalidateAfter,\n value: cacheData.value\n };\n }\n if (!cacheData && this.prerenderManifest.notFoundRoutes.includes(cacheKey)) {\n // for the first hit after starting the server the cache\n // may not have a way to save notFound: true so if\n // the prerender-manifest marks this as notFound then we\n // return that entry and trigger a cache set to give it a\n // chance to update in-memory entries\n entry = {\n isStale,\n value: null,\n curRevalidate,\n revalidateAfter\n };\n this.set(cacheKey, entry.value, ctx);\n }\n return entry;\n }\n // populate the incremental cache with new data\n async set(pathname, data, ctx) {\n if (process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT && process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY && process.env.NEXT_RUNTIME !== \"edge\") {\n const invokeIpcMethod = require(\"../server-ipc/request-utils\").invokeIpcMethod;\n return invokeIpcMethod({\n method: \"set\",\n ipcPort: process.env.__NEXT_INCREMENTAL_CACHE_IPC_PORT,\n ipcKey: process.env.__NEXT_INCREMENTAL_CACHE_IPC_KEY,\n args: [\n ...arguments\n ]\n });\n }\n if (this.disableForTestmode || this.dev && !ctx.fetchCache) return;\n // FetchCache has upper limit of 2MB per-entry currently\n const itemSize = JSON.stringify(data).length;\n if (ctx.fetchCache && // we don't show this error/warning when a custom cache handler is being used\n // as it might not have this limit\n !this.hasCustomCacheHandler && itemSize > 2 * 1024 * 1024) {\n if (this.dev) {\n throw new Error(`Failed to set Next.js data cache, items over 2MB can not be cached (${itemSize} bytes)`);\n }\n return;\n }\n pathname = this._getPathname(pathname, ctx.fetchCache);\n try {\n var _this_cacheHandler;\n // Set the value for the revalidate seconds so if it changes we can\n // update the cache with the new value.\n if (typeof ctx.revalidate !== \"undefined\" && !ctx.fetchCache) {\n this.revalidateTimings.set(pathname, ctx.revalidate);\n }\n await ((_this_cacheHandler = this.cacheHandler) == null ? void 0 : _this_cacheHandler.set(pathname, data, ctx));\n } catch (error) {\n console.warn(\"Failed to update prerender cache for\", pathname, error);\n }\n }\n}\n\n//# sourceMappingURL=index.js.map","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"http\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"https\");","import fs from \"fs\";\nexport const nodeFs = {\n existsSync: fs.existsSync,\n readFile: fs.promises.readFile,\n readFileSync: fs.readFileSync,\n writeFile: (f, d)=>fs.promises.writeFile(f, d),\n mkdir: (dir)=>fs.promises.mkdir(dir, {\n recursive: true\n }),\n stat: (f)=>fs.promises.stat(f)\n};\n\n//# sourceMappingURL=node-fs-methods.js.map","import Stream from \"stream\";\nimport { fromNodeOutgoingHttpHeaders, toNodeOutgoingHttpHeaders } from \"../web/utils\";\nexport class MockedRequest extends Stream.Readable {\n constructor({ url, headers, method, socket = null, readable }){\n super();\n // This is hardcoded for now, but can be updated to be configurable if needed.\n this.httpVersion = \"1.0\";\n this.httpVersionMajor = 1;\n this.httpVersionMinor = 0;\n // If we don't actually have a socket, we'll just use a mock one that\n // always returns false for the `encrypted` property and undefined for the\n // `remoteAddress` property.\n this.socket = new Proxy({}, {\n get: (_target, prop)=>{\n if (prop !== \"encrypted\" && prop !== \"remoteAddress\") {\n throw new Error(\"Method not implemented\");\n }\n if (prop === \"remoteAddress\") return undefined;\n // For this mock request, always ensure we just respond with the encrypted\n // set to false to ensure there's no odd leakages.\n return false;\n }\n });\n this.url = url;\n this.headers = headers;\n this.method = method;\n if (readable) {\n this.bodyReadable = readable;\n this.bodyReadable.on(\"end\", ()=>this.emit(\"end\"));\n this.bodyReadable.on(\"close\", ()=>this.emit(\"close\"));\n }\n if (socket) {\n this.socket = socket;\n }\n }\n get headersDistinct() {\n const headers = {};\n for (const [key, value] of Object.entries(this.headers)){\n if (!value) continue;\n headers[key] = Array.isArray(value) ? value : [\n value\n ];\n }\n return headers;\n }\n _read(size) {\n if (this.bodyReadable) {\n return this.bodyReadable._read(size);\n } else {\n this.emit(\"end\");\n this.emit(\"close\");\n }\n }\n /**\n * The `connection` property is just an alias for the `socket` property.\n *\n * @deprecated — since v13.0.0 - Use socket instead.\n */ get connection() {\n return this.socket;\n }\n // The following methods are not implemented as they are not used in the\n // Next.js codebase.\n get aborted() {\n throw new Error(\"Method not implemented\");\n }\n get complete() {\n throw new Error(\"Method not implemented\");\n }\n get trailers() {\n throw new Error(\"Method not implemented\");\n }\n get trailersDistinct() {\n throw new Error(\"Method not implemented\");\n }\n get rawTrailers() {\n throw new Error(\"Method not implemented\");\n }\n get rawHeaders() {\n throw new Error(\"Method not implemented.\");\n }\n setTimeout() {\n throw new Error(\"Method not implemented.\");\n }\n}\nexport class MockedResponse extends Stream.Writable {\n constructor(res = {}){\n super();\n this.statusMessage = \"\";\n this.finished = false;\n this.headersSent = false;\n /**\n * A list of buffers that have been written to the response.\n *\n * @internal - used internally by Next.js\n */ this.buffers = [];\n this.statusCode = res.statusCode ?? 200;\n this.socket = res.socket ?? null;\n this.headers = res.headers ? fromNodeOutgoingHttpHeaders(res.headers) : new Headers();\n this.headPromise = new Promise((resolve)=>{\n this.headPromiseResolve = resolve;\n });\n // Attach listeners for the `finish`, `end`, and `error` events to the\n // `MockedResponse` instance.\n this.hasStreamed = new Promise((resolve, reject)=>{\n this.on(\"finish\", ()=>resolve(true));\n this.on(\"end\", ()=>resolve(true));\n this.on(\"error\", (err)=>reject(err));\n }).then((val)=>{\n this.headPromiseResolve == null ? void 0 : this.headPromiseResolve.call(this);\n return val;\n });\n if (res.resWriter) {\n this.resWriter = res.resWriter;\n }\n }\n appendHeader(name, value) {\n const values = Array.isArray(value) ? value : [\n value\n ];\n for (const v of values){\n this.headers.append(name, v);\n }\n return this;\n }\n /**\n * Returns true if the response has been sent, false otherwise.\n *\n * @internal - used internally by Next.js\n */ get isSent() {\n return this.finished || this.headersSent;\n }\n /**\n * The `connection` property is just an alias for the `socket` property.\n *\n * @deprecated — since v13.0.0 - Use socket instead.\n */ get connection() {\n return this.socket;\n }\n write(chunk) {\n if (this.resWriter) {\n return this.resWriter(chunk);\n }\n this.buffers.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));\n return true;\n }\n end() {\n this.finished = true;\n return super.end(...arguments);\n }\n /**\n * This method is a no-op because the `MockedResponse` instance is not\n * actually connected to a socket. This method is not specified on the\n * interface type for `ServerResponse` but is called by Node.js.\n *\n * @see https://github.com/nodejs/node/pull/7949\n */ _implicitHeader() {}\n _write(chunk, _encoding, callback) {\n this.write(chunk);\n // According to Node.js documentation, the callback MUST be invoked to\n // signal that the write completed successfully. If this callback is not\n // invoked, the 'finish' event will not be emitted.\n //\n // https://nodejs.org/docs/latest-v16.x/api/stream.html#writable_writechunk-encoding-callback\n callback();\n }\n writeHead(statusCode, statusMessage, headers) {\n if (!headers && typeof statusMessage !== \"string\") {\n headers = statusMessage;\n } else if (typeof statusMessage === \"string\" && statusMessage.length > 0) {\n this.statusMessage = statusMessage;\n }\n if (headers) {\n // When headers have been set with response.setHeader(), they will be\n // merged with any headers passed to response.writeHead(), with the\n // headers passed to response.writeHead() given precedence.\n //\n // https://nodejs.org/api/http.html#responsewriteheadstatuscode-statusmessage-headers\n //\n // For this reason, we need to only call `set` to ensure that this will\n // overwrite any existing headers.\n if (Array.isArray(headers)) {\n // headers may be an Array where the keys and values are in the same list.\n // It is not a list of tuples. So, the even-numbered offsets are key\n // values, and the odd-numbered offsets are the associated values. The\n // array is in the same format as request.rawHeaders.\n for(let i = 0; i < headers.length; i += 2){\n // The header key is always a string according to the spec.\n this.setHeader(headers[i], headers[i + 1]);\n }\n } else {\n for (const [key, value] of Object.entries(headers)){\n // Skip undefined values\n if (typeof value === \"undefined\") continue;\n this.setHeader(key, value);\n }\n }\n }\n this.statusCode = statusCode;\n this.headersSent = true;\n this.headPromiseResolve == null ? void 0 : this.headPromiseResolve.call(this);\n return this;\n }\n hasHeader(name) {\n return this.headers.has(name);\n }\n getHeader(name) {\n return this.headers.get(name) ?? undefined;\n }\n getHeaders() {\n return toNodeOutgoingHttpHeaders(this.headers);\n }\n getHeaderNames() {\n return Array.from(this.headers.keys());\n }\n setHeader(name, value) {\n if (Array.isArray(value)) {\n // Because `set` here should override any existing values, we need to\n // delete the existing values before setting the new ones via `append`.\n this.headers.delete(name);\n for (const v of value){\n this.headers.append(name, v);\n }\n } else if (typeof value === \"number\") {\n this.headers.set(name, value.toString());\n } else {\n this.headers.set(name, value);\n }\n return this;\n }\n removeHeader(name) {\n this.headers.delete(name);\n }\n flushHeaders() {\n // This is a no-op because we don't actually have a socket to flush the\n // headers to.\n }\n // The following methods are not implemented as they are not used in the\n // Next.js codebase.\n get strictContentLength() {\n throw new Error(\"Method not implemented.\");\n }\n writeEarlyHints() {\n throw new Error(\"Method not implemented.\");\n }\n get req() {\n throw new Error(\"Method not implemented.\");\n }\n assignSocket() {\n throw new Error(\"Method not implemented.\");\n }\n detachSocket() {\n throw new Error(\"Method not implemented.\");\n }\n writeContinue() {\n throw new Error(\"Method not implemented.\");\n }\n writeProcessing() {\n throw new Error(\"Method not implemented.\");\n }\n get upgrading() {\n throw new Error(\"Method not implemented.\");\n }\n get chunkedEncoding() {\n throw new Error(\"Method not implemented.\");\n }\n get shouldKeepAlive() {\n throw new Error(\"Method not implemented.\");\n }\n get useChunkedEncodingByDefault() {\n throw new Error(\"Method not implemented.\");\n }\n get sendDate() {\n throw new Error(\"Method not implemented.\");\n }\n setTimeout() {\n throw new Error(\"Method not implemented.\");\n }\n addTrailers() {\n throw new Error(\"Method not implemented.\");\n }\n}\nexport function createRequestResponseMocks({ url, headers = {}, method = \"GET\", bodyReadable, resWriter, socket = null }) {\n return {\n req: new MockedRequest({\n url,\n headers,\n method,\n socket,\n readable: bodyReadable\n }),\n res: new MockedResponse({\n socket,\n resWriter\n })\n };\n}\n\n//# sourceMappingURL=mock-request.js.map","/**\n * Loads a module using `await require(id)`.\n */ export class NodeModuleLoader {\n async load(id) {\n if (process.env.NEXT_RUNTIME !== \"edge\") {\n // Need to `await` to cover the case that route is marked ESM modules by ESM escalation.\n return await (process.env.NEXT_MINIMAL ? __non_webpack_require__(id) : require(id));\n }\n throw new Error(\"NodeModuleLoader is not supported in edge runtime.\");\n }\n}\n\n//# sourceMappingURL=node-module-loader.js.map","import { NodeModuleLoader } from \"./node-module-loader\";\nexport class RouteModuleLoader {\n static async load(id, loader = new NodeModuleLoader()) {\n const module = await loader.load(id);\n if (\"routeModule\" in module) {\n return module.routeModule;\n }\n throw new Error(`Module \"${id}\" does not export a routeModule.`);\n }\n}\n\n//# sourceMappingURL=route-module-loader.js.map","import path from \"path\";\nimport { pathToFileURL } from \"url\";\n/**\n * The path for a dynamic route must be URLs with a valid scheme.\n *\n * When an absolute Windows path is passed to it, it interprets the beginning of the path as a protocol (`C:`).\n * Therefore, it is important to always construct a complete path.\n * @param dir File directory\n * @param filePath Absolute or relative path\n */ export const formatDynamicImportPath = (dir, filePath)=>{\n const absoluteFilePath = path.isAbsolute(filePath) ? filePath : path.join(dir, filePath);\n const formattedFilePath = pathToFileURL(absoluteFilePath).toString();\n return formattedFilePath;\n};\n\n//# sourceMappingURL=format-dynamic-import-path.js.map","import { pathToRegexp } from \"next/dist/compiled/path-to-regexp\";\nimport { NEXT_URL } from \"../client/components/app-router-headers\";\nimport { INTERCEPTION_ROUTE_MARKERS, extractInterceptionRouteInformation, isInterceptionRouteAppPath } from \"../server/future/helpers/interception-routes\";\n// a function that converts normalised paths (e.g. /foo/[bar]/[baz]) to the format expected by pathToRegexp (e.g. /foo/:bar/:baz)\nfunction toPathToRegexpPath(path) {\n return path.replace(/\\[\\[?([^\\]]+)\\]\\]?/g, (_, capture)=>{\n // handle catch-all segments (e.g. /foo/bar/[...baz] or /foo/bar/[[...baz]])\n if (capture.startsWith(\"...\")) {\n return `:${capture.slice(3)}*`;\n }\n return \":\" + capture;\n });\n}\n// for interception routes we don't have access to the dynamic segments from the\n// referrer route so we mark them as noop for the app renderer so that it\n// can retrieve them from the router state later on. This also allows us to\n// compile the route properly with path-to-regexp, otherwise it will throw\nfunction voidParamsBeforeInterceptionMarker(path) {\n let newPath = [];\n let foundInterceptionMarker = false;\n for (const segment of path.split(\"/\")){\n if (INTERCEPTION_ROUTE_MARKERS.find((marker)=>segment.startsWith(marker))) {\n foundInterceptionMarker = true;\n }\n if (segment.startsWith(\":\") && !foundInterceptionMarker) {\n newPath.push(\"__NEXT_EMPTY_PARAM__\");\n } else {\n newPath.push(segment);\n }\n }\n return newPath.join(\"/\");\n}\nexport function generateInterceptionRoutesRewrites(appPaths, basePath = \"\") {\n const rewrites = [];\n for (const appPath of appPaths){\n if (isInterceptionRouteAppPath(appPath)) {\n const { interceptingRoute, interceptedRoute } = extractInterceptionRouteInformation(appPath);\n const normalizedInterceptingRoute = `${interceptingRoute !== \"/\" ? toPathToRegexpPath(interceptingRoute) : \"\"}/(.*)?`;\n const normalizedInterceptedRoute = toPathToRegexpPath(interceptedRoute);\n const normalizedAppPath = voidParamsBeforeInterceptionMarker(toPathToRegexpPath(appPath));\n // pathToRegexp returns a regex that matches the path, but we need to\n // convert it to a string that can be used in a header value\n // to the format that Next/the proxy expects\n let interceptingRouteRegex = pathToRegexp(normalizedInterceptingRoute).toString().slice(2, -3);\n rewrites.push({\n source: `${basePath}${normalizedInterceptedRoute}`,\n destination: `${basePath}${normalizedAppPath}`,\n has: [\n {\n type: \"header\",\n key: NEXT_URL,\n value: interceptingRouteRegex\n }\n ]\n });\n }\n }\n return rewrites;\n}\nexport function isInterceptionRouteRewrite(route) {\n var _route_has_, _route_has;\n // When we generate interception rewrites in the above implementation, we always do so with only a single `has` condition.\n return ((_route_has = route.has) == null ? void 0 : (_route_has_ = _route_has[0]) == null ? void 0 : _route_has_.key) === NEXT_URL;\n}\n\n//# sourceMappingURL=generate-interception-routes-rewrites.js.map","import \"./node-environment\";\nimport \"./require-hook\";\nimport \"./node-polyfill-crypto\";\nimport { DecodeError, PageNotFoundError, MiddlewareNotFoundError } from \"../shared/lib/utils\";\nimport fs from \"fs\";\nimport { join, resolve } from \"path\";\nimport { getRouteMatcher } from \"../shared/lib/router/utils/route-matcher\";\nimport { addRequestMeta, getRequestMeta } from \"./request-meta\";\nimport { PAGES_MANIFEST, BUILD_ID_FILE, MIDDLEWARE_MANIFEST, PRERENDER_MANIFEST, ROUTES_MANIFEST, CLIENT_PUBLIC_FILES_PATH, APP_PATHS_MANIFEST, SERVER_DIRECTORY, NEXT_FONT_MANIFEST, PHASE_PRODUCTION_BUILD, UNDERSCORE_NOT_FOUND_ROUTE_ENTRY } from \"../shared/lib/constants\";\nimport { findDir } from \"../lib/find-pages-dir\";\nimport { NodeNextRequest, NodeNextResponse } from \"./base-http/node\";\nimport { sendRenderResult } from \"./send-payload\";\nimport { parseUrl } from \"../shared/lib/router/utils/parse-url\";\nimport * as Log from \"../build/output/log\";\nimport BaseServer, { NoFallbackError, isRSCRequestCheck } from \"./base-server\";\nimport { getMaybePagePath, getPagePath, requireFontManifest } from \"./require\";\nimport { denormalizePagePath } from \"../shared/lib/page-path/denormalize-page-path\";\nimport { normalizePagePath } from \"../shared/lib/page-path/normalize-page-path\";\nimport { loadComponents } from \"./load-components\";\nimport isError, { getProperError } from \"../lib/is-error\";\nimport { splitCookiesString, toNodeOutgoingHttpHeaders } from \"./web/utils\";\nimport { getMiddlewareRouteMatcher } from \"../shared/lib/router/utils/middleware-route-matcher\";\nimport { loadEnvConfig } from \"@next/env\";\nimport { urlQueryToSearchParams } from \"../shared/lib/router/utils/querystring\";\nimport { removeTrailingSlash } from \"../shared/lib/router/utils/remove-trailing-slash\";\nimport { getNextPathnameInfo } from \"../shared/lib/router/utils/get-next-pathname-info\";\nimport { getCloneableBody } from \"./body-streams\";\nimport { checkIsOnDemandRevalidate } from \"./api-utils\";\nimport ResponseCache from \"./response-cache\";\nimport { IncrementalCache } from \"./lib/incremental-cache\";\nimport { normalizeAppPath } from \"../shared/lib/router/utils/app-paths\";\nimport { setHttpClientAndAgentOptions } from \"./setup-http-agent-env\";\nimport { isPagesAPIRouteMatch } from \"./future/route-matches/pages-api-route-match\";\nimport { INSTRUMENTATION_HOOK_FILENAME, RSC_PREFETCH_SUFFIX } from \"../lib/constants\";\nimport { getTracer } from \"./lib/trace/tracer\";\nimport { NextNodeServerSpan } from \"./lib/trace/constants\";\nimport { nodeFs } from \"./lib/node-fs-methods\";\nimport { getRouteRegex } from \"../shared/lib/router/utils/route-regex\";\nimport { pipeToNodeResponse } from \"./pipe-readable\";\nimport { createRequestResponseMocks } from \"./lib/mock-request\";\nimport { NEXT_RSC_UNION_QUERY } from \"../client/components/app-router-headers\";\nimport { signalFromNodeResponse } from \"./web/spec-extension/adapters/next-request\";\nimport { RouteModuleLoader } from \"./future/helpers/module-loader/route-module-loader\";\nimport { loadManifest } from \"./load-manifest\";\nimport { lazyRenderAppPage } from \"./future/route-modules/app-page/module.render\";\nimport { lazyRenderPagesPage } from \"./future/route-modules/pages/module.render\";\nimport { interopDefault } from \"../lib/interop-default\";\nimport { formatDynamicImportPath } from \"../lib/format-dynamic-import-path\";\nimport { isInterceptionRouteRewrite } from \"../lib/generate-interception-routes-rewrites\";\nexport * from \"./base-server\";\n// For module that can be both CJS or ESM\nconst dynamicImportEsmDefault = process.env.NEXT_MINIMAL ? (id)=>import(/* webpackIgnore: true */ id).then((mod)=>mod.default || mod) : (id)=>import(id).then((mod)=>mod.default || mod);\n// For module that will be compiled to CJS, e.g. instrument\nconst dynamicRequire = process.env.NEXT_MINIMAL ? __non_webpack_require__ : require;\nfunction writeStdoutLine(text) {\n process.stdout.write(\" \" + text + \"\\n\");\n}\nfunction formatRequestUrl(url, maxLength) {\n return maxLength !== undefined && url.length > maxLength ? url.substring(0, maxLength) + \"..\" : url;\n}\nconst MiddlewareMatcherCache = new WeakMap();\nfunction getMiddlewareMatcher(info) {\n const stored = MiddlewareMatcherCache.get(info);\n if (stored) {\n return stored;\n }\n if (!Array.isArray(info.matchers)) {\n throw new Error(`Invariant: invalid matchers for middleware ${JSON.stringify(info)}`);\n }\n const matcher = getMiddlewareRouteMatcher(info.matchers);\n MiddlewareMatcherCache.set(info, matcher);\n return matcher;\n}\nexport default class NextNodeServer extends BaseServer {\n constructor(options){\n // Initialize super class\n super(options);\n this.handleNextImageRequest = async (req, res, parsedUrl)=>{\n if (!parsedUrl.pathname || !parsedUrl.pathname.startsWith(\"/_next/image\")) {\n return false;\n }\n if (this.minimalMode || this.nextConfig.output === \"export\" || process.env.NEXT_MINIMAL) {\n res.statusCode = 400;\n res.body(\"Bad Request\").send();\n return true;\n // the `else` branch is needed for tree-shaking\n } else {\n const { ImageOptimizerCache } = require(\"./image-optimizer\");\n const imageOptimizerCache = new ImageOptimizerCache({\n distDir: this.distDir,\n nextConfig: this.nextConfig\n });\n const { getHash, sendResponse, ImageError } = require(\"./image-optimizer\");\n if (!this.imageResponseCache) {\n throw new Error(\"invariant image optimizer cache was not initialized\");\n }\n const imagesConfig = this.nextConfig.images;\n if (imagesConfig.loader !== \"default\" || imagesConfig.unoptimized) {\n await this.render404(req, res);\n return true;\n }\n const paramsResult = ImageOptimizerCache.validateParams(req.originalRequest, parsedUrl.query, this.nextConfig, !!this.renderOpts.dev);\n if (\"errorMessage\" in paramsResult) {\n res.statusCode = 400;\n res.body(paramsResult.errorMessage).send();\n return true;\n }\n const cacheKey = ImageOptimizerCache.getCacheKey(paramsResult);\n try {\n var _cacheEntry_value;\n const { getExtension } = require(\"./serve-static\");\n const cacheEntry = await this.imageResponseCache.get(cacheKey, async ()=>{\n const { buffer, contentType, maxAge } = await this.imageOptimizer(req, res, paramsResult);\n const etag = getHash([\n buffer\n ]);\n return {\n value: {\n kind: \"IMAGE\",\n buffer,\n etag,\n extension: getExtension(contentType)\n },\n revalidate: maxAge\n };\n }, {\n incrementalCache: imageOptimizerCache\n });\n if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== \"IMAGE\") {\n throw new Error(\"invariant did not get entry from image response cache\");\n }\n sendResponse(req.originalRequest, res.originalResponse, paramsResult.href, cacheEntry.value.extension, cacheEntry.value.buffer, paramsResult.isStatic, cacheEntry.isMiss ? \"MISS\" : cacheEntry.isStale ? \"STALE\" : \"HIT\", imagesConfig, cacheEntry.revalidate || 0, Boolean(this.renderOpts.dev));\n return true;\n } catch (err) {\n if (err instanceof ImageError) {\n res.statusCode = err.statusCode;\n res.body(err.message).send();\n return true;\n }\n throw err;\n }\n }\n };\n this.handleCatchallRenderRequest = async (req, res, parsedUrl)=>{\n let { pathname, query } = parsedUrl;\n if (!pathname) {\n throw new Error(\"Invariant: pathname is undefined\");\n }\n // This is a catch-all route, there should be no fallbacks so mark it as\n // such.\n query._nextBubbleNoFallback = \"1\";\n try {\n var _this_i18nProvider;\n // next.js core assumes page path without trailing slash\n pathname = removeTrailingSlash(pathname);\n const options = {\n i18n: (_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.fromQuery(pathname, query)\n };\n const match = await this.matchers.match(pathname, options);\n // If we don't have a match, try to render it anyways.\n if (!match) {\n await this.render(req, res, pathname, query, parsedUrl, true);\n return true;\n }\n // Add the match to the request so we don't have to re-run the matcher\n // for the same request.\n addRequestMeta(req, \"match\", match);\n // TODO-APP: move this to a route handler\n const edgeFunctionsPages = this.getEdgeFunctionsPages();\n for (const edgeFunctionsPage of edgeFunctionsPages){\n // If the page doesn't match the edge function page, skip it.\n if (edgeFunctionsPage !== match.definition.page) continue;\n if (this.nextConfig.output === \"export\") {\n await this.render404(req, res, parsedUrl);\n return true;\n }\n delete query._nextBubbleNoFallback;\n delete query[NEXT_RSC_UNION_QUERY];\n const handled = await this.runEdgeFunction({\n req,\n res,\n query,\n params: match.params,\n page: match.definition.page,\n match,\n appPaths: null\n });\n // If we handled the request, we can return early.\n if (handled) return true;\n }\n // If the route was detected as being a Pages API route, then handle\n // it.\n // TODO: move this behavior into a route handler.\n if (isPagesAPIRouteMatch(match)) {\n if (this.nextConfig.output === \"export\") {\n await this.render404(req, res, parsedUrl);\n return true;\n }\n delete query._nextBubbleNoFallback;\n const handled = await this.handleApiRequest(req, res, query, match);\n if (handled) return true;\n }\n await this.render(req, res, pathname, query, parsedUrl, true);\n return true;\n } catch (err) {\n if (err instanceof NoFallbackError) {\n throw err;\n }\n try {\n if (this.renderOpts.dev) {\n const { formatServerError } = require(\"../lib/format-server-error\");\n formatServerError(err);\n await this.logErrorWithOriginalStack(err);\n } else {\n this.logError(err);\n }\n res.statusCode = 500;\n await this.renderError(err, req, res, pathname, query);\n return true;\n } catch {}\n throw err;\n }\n };\n this.handleCatchallMiddlewareRequest = async (req, res, parsed)=>{\n const isMiddlewareInvoke = getRequestMeta(req, \"middlewareInvoke\");\n if (!isMiddlewareInvoke) {\n return false;\n }\n const handleFinished = ()=>{\n addRequestMeta(req, \"middlewareInvoke\", true);\n res.body(\"\").send();\n return true;\n };\n const middleware = this.getMiddleware();\n if (!middleware) {\n return handleFinished();\n }\n const initUrl = getRequestMeta(req, \"initURL\");\n const parsedUrl = parseUrl(initUrl);\n const pathnameInfo = getNextPathnameInfo(parsedUrl.pathname, {\n nextConfig: this.nextConfig,\n i18nProvider: this.i18nProvider\n });\n parsedUrl.pathname = pathnameInfo.pathname;\n const normalizedPathname = removeTrailingSlash(parsed.pathname || \"\");\n if (!middleware.match(normalizedPathname, req, parsedUrl.query)) {\n return handleFinished();\n }\n let result;\n let bubblingResult = false;\n try {\n await this.ensureMiddleware(req.url);\n result = await this.runMiddleware({\n request: req,\n response: res,\n parsedUrl: parsedUrl,\n parsed: parsed\n });\n if (\"response\" in result) {\n if (isMiddlewareInvoke) {\n bubblingResult = true;\n const err = new Error();\n err.result = result;\n err.bubble = true;\n throw err;\n }\n for (const [key, value] of Object.entries(toNodeOutgoingHttpHeaders(result.response.headers))){\n if (key !== \"content-encoding\" && value !== undefined) {\n res.setHeader(key, value);\n }\n }\n res.statusCode = result.response.status;\n const { originalResponse } = res;\n if (result.response.body) {\n await pipeToNodeResponse(result.response.body, originalResponse);\n } else {\n originalResponse.end();\n }\n return true;\n }\n } catch (err) {\n if (bubblingResult) {\n throw err;\n }\n if (isError(err) && err.code === \"ENOENT\") {\n await this.render404(req, res, parsed);\n return true;\n }\n if (err instanceof DecodeError) {\n res.statusCode = 400;\n await this.renderError(err, req, res, parsed.pathname || \"\");\n return true;\n }\n const error = getProperError(err);\n console.error(error);\n res.statusCode = 500;\n await this.renderError(error, req, res, parsed.pathname || \"\");\n return true;\n }\n return result.finished;\n };\n this.isDev = options.dev ?? false;\n /**\n * This sets environment variable to be used at the time of SSR by head.tsx.\n * Using this from process.env allows targeting SSR by calling\n * `process.env.__NEXT_OPTIMIZE_CSS`.\n */ if (this.renderOpts.optimizeFonts) {\n process.env.__NEXT_OPTIMIZE_FONTS = JSON.stringify(this.renderOpts.optimizeFonts);\n }\n if (this.renderOpts.optimizeCss) {\n process.env.__NEXT_OPTIMIZE_CSS = JSON.stringify(true);\n }\n if (this.renderOpts.nextScriptWorkers) {\n process.env.__NEXT_SCRIPT_WORKERS = JSON.stringify(true);\n }\n process.env.NEXT_DEPLOYMENT_ID = this.nextConfig.deploymentId || \"\";\n if (!this.minimalMode) {\n this.imageResponseCache = new ResponseCache(this.minimalMode);\n }\n const { appDocumentPreloading } = this.nextConfig.experimental;\n const isDefaultEnabled = typeof appDocumentPreloading === \"undefined\";\n if (!options.dev && (appDocumentPreloading === true || !(this.minimalMode && isDefaultEnabled))) {\n // pre-warm _document and _app as these will be\n // needed for most requests\n loadComponents({\n distDir: this.distDir,\n page: \"/_document\",\n isAppPath: false,\n isDev: this.isDev\n }).catch(()=>{});\n loadComponents({\n distDir: this.distDir,\n page: \"/_app\",\n isAppPath: false,\n isDev: this.isDev\n }).catch(()=>{});\n }\n if (!options.dev && this.nextConfig.experimental.preloadEntriesOnStart) {\n this.unstable_preloadEntries();\n }\n if (!options.dev) {\n const { dynamicRoutes = [] } = this.getRoutesManifest() ?? {};\n this.dynamicRoutes = dynamicRoutes.map((r)=>{\n // TODO: can we just re-use the regex from the manifest?\n const regex = getRouteRegex(r.page);\n const match = getRouteMatcher(regex);\n return {\n match,\n page: r.page,\n re: regex.re\n };\n });\n }\n // ensure options are set when loadConfig isn't called\n setHttpClientAndAgentOptions(this.nextConfig);\n // Intercept fetch and other testmode apis.\n if (this.serverOptions.experimentalTestProxy) {\n process.env.NEXT_PRIVATE_TEST_PROXY = \"true\";\n const { interceptTestApis } = require(\"next/dist/experimental/testmode/server\");\n interceptTestApis();\n }\n this.middlewareManifestPath = join(this.serverDistDir, MIDDLEWARE_MANIFEST);\n // This is just optimization to fire prepare as soon as possible. It will be\n // properly awaited later. We add the catch here to ensure that it does not\n // cause a unhandled promise rejection. The promise rejection will be\n // handled later on via the `await` when the request handler is called.\n if (!options.dev) {\n this.prepare().catch((err)=>{\n console.error(\"Failed to prepare server\", err);\n });\n }\n }\n async unstable_preloadEntries() {\n const appPathsManifest = this.getAppPathsManifest();\n const pagesManifest = this.getPagesManifest();\n for (const page of Object.keys(pagesManifest || {})){\n await loadComponents({\n distDir: this.distDir,\n page,\n isAppPath: false,\n isDev: this.isDev\n }).catch(()=>{});\n }\n for (const page of Object.keys(appPathsManifest || {})){\n await loadComponents({\n distDir: this.distDir,\n page,\n isAppPath: true,\n isDev: this.isDev\n }).then(async ({ ComponentMod })=>{\n const webpackRequire = ComponentMod.__next_app__.require;\n if (webpackRequire == null ? void 0 : webpackRequire.m) {\n for (const id of Object.keys(webpackRequire.m)){\n await webpackRequire(id);\n }\n }\n }).catch(()=>{});\n }\n }\n async handleUpgrade() {\n // The web server does not support web sockets, it's only used for HMR in\n // development.\n }\n async prepareImpl() {\n await super.prepareImpl();\n if (!this.serverOptions.dev && this.nextConfig.experimental.instrumentationHook) {\n try {\n const instrumentationHook = await dynamicRequire(resolve(this.serverOptions.dir || \".\", this.serverOptions.conf.distDir, \"server\", INSTRUMENTATION_HOOK_FILENAME));\n await (instrumentationHook.register == null ? void 0 : instrumentationHook.register.call(instrumentationHook));\n } catch (err) {\n if (err.code !== \"MODULE_NOT_FOUND\") {\n err.message = `An error occurred while loading instrumentation hook: ${err.message}`;\n throw err;\n }\n }\n }\n }\n loadEnvConfig({ dev, forceReload, silent }) {\n loadEnvConfig(this.dir, dev, silent ? {\n info: ()=>{},\n error: ()=>{}\n } : Log, forceReload);\n }\n async getIncrementalCache({ requestHeaders, requestProtocol }) {\n const dev = !!this.renderOpts.dev;\n let CacheHandler;\n const { cacheHandler } = this.nextConfig;\n if (cacheHandler) {\n CacheHandler = interopDefault(await dynamicImportEsmDefault(formatDynamicImportPath(this.distDir, cacheHandler)));\n }\n // incremental-cache is request specific\n // although can have shared caches in module scope\n // per-cache handler\n return new IncrementalCache({\n fs: this.getCacheFilesystem(),\n dev,\n requestHeaders,\n requestProtocol,\n pagesDir: this.enabledDirectories.pages,\n appDir: this.enabledDirectories.app,\n allowedRevalidateHeaderKeys: this.nextConfig.experimental.allowedRevalidateHeaderKeys,\n minimalMode: this.minimalMode,\n serverDistDir: this.serverDistDir,\n fetchCache: true,\n fetchCacheKeyPrefix: this.nextConfig.experimental.fetchCacheKeyPrefix,\n maxMemoryCacheSize: this.nextConfig.cacheMaxMemorySize,\n flushToDisk: !this.minimalMode && this.nextConfig.experimental.isrFlushToDisk,\n getPrerenderManifest: ()=>this.getPrerenderManifest(),\n CurCacheHandler: CacheHandler,\n experimental: this.renderOpts.experimental\n });\n }\n getResponseCache() {\n return new ResponseCache(this.minimalMode);\n }\n getPublicDir() {\n return join(this.dir, CLIENT_PUBLIC_FILES_PATH);\n }\n getHasStaticDir() {\n return fs.existsSync(join(this.dir, \"static\"));\n }\n getPagesManifest() {\n return loadManifest(join(this.serverDistDir, PAGES_MANIFEST));\n }\n getAppPathsManifest() {\n if (!this.enabledDirectories.app) return undefined;\n return loadManifest(join(this.serverDistDir, APP_PATHS_MANIFEST));\n }\n getinterceptionRoutePatterns() {\n if (!this.enabledDirectories.app) return [];\n const routesManifest = this.getRoutesManifest();\n return (routesManifest == null ? void 0 : routesManifest.rewrites.beforeFiles.filter(isInterceptionRouteRewrite).map((rewrite)=>new RegExp(rewrite.regex))) ?? [];\n }\n async hasPage(pathname) {\n var _this_nextConfig_i18n;\n return !!getMaybePagePath(pathname, this.distDir, (_this_nextConfig_i18n = this.nextConfig.i18n) == null ? void 0 : _this_nextConfig_i18n.locales, this.enabledDirectories.app);\n }\n getBuildId() {\n const buildIdFile = join(this.distDir, BUILD_ID_FILE);\n try {\n return fs.readFileSync(buildIdFile, \"utf8\").trim();\n } catch (err) {\n if (err.code === \"ENOENT\") {\n throw new Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`);\n }\n throw err;\n }\n }\n getEnabledDirectories(dev) {\n const dir = dev ? this.dir : this.serverDistDir;\n return {\n app: findDir(dir, \"app\") ? true : false,\n pages: findDir(dir, \"pages\") ? true : false\n };\n }\n sendRenderResult(req, res, options) {\n return sendRenderResult({\n req: req.originalRequest,\n res: res.originalResponse,\n result: options.result,\n type: options.type,\n generateEtags: options.generateEtags,\n poweredByHeader: options.poweredByHeader,\n revalidate: options.revalidate,\n swrDelta: options.swrDelta\n });\n }\n async runApi(req, res, query, match) {\n const edgeFunctionsPages = this.getEdgeFunctionsPages();\n for (const edgeFunctionsPage of edgeFunctionsPages){\n if (edgeFunctionsPage === match.definition.pathname) {\n const handledAsEdgeFunction = await this.runEdgeFunction({\n req,\n res,\n query,\n params: match.params,\n page: match.definition.pathname,\n appPaths: null\n });\n if (handledAsEdgeFunction) {\n return true;\n }\n }\n }\n // The module supports minimal mode, load the minimal module.\n const module = await RouteModuleLoader.load(match.definition.filename);\n query = {\n ...query,\n ...match.params\n };\n delete query.__nextLocale;\n delete query.__nextDefaultLocale;\n delete query.__nextInferredLocaleFromDefault;\n await module.render(req.originalRequest, res.originalResponse, {\n previewProps: this.renderOpts.previewProps,\n revalidate: this.revalidate.bind(this),\n trustHostHeader: this.nextConfig.experimental.trustHostHeader,\n allowedRevalidateHeaderKeys: this.nextConfig.experimental.allowedRevalidateHeaderKeys,\n hostname: this.fetchHostname,\n minimalMode: this.minimalMode,\n dev: this.renderOpts.dev === true,\n query,\n params: match.params,\n page: match.definition.pathname,\n multiZoneDraftMode: this.nextConfig.experimental.multiZoneDraftMode\n });\n return true;\n }\n async renderHTML(req, res, pathname, query, renderOpts) {\n return getTracer().trace(NextNodeServerSpan.renderHTML, async ()=>this.renderHTMLImpl(req, res, pathname, query, renderOpts));\n }\n async renderHTMLImpl(req, res, pathname, query, renderOpts) {\n if (process.env.NEXT_MINIMAL) {\n throw new Error(\"Invariant: renderHTML should not be called in minimal mode\");\n // the `else` branch is needed for tree-shaking\n } else {\n // Due to the way we pass data by mutating `renderOpts`, we can't extend the\n // object here but only updating its `nextFontManifest` field.\n // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952\n renderOpts.nextFontManifest = this.nextFontManifest;\n if (this.enabledDirectories.app && renderOpts.isAppPath) {\n return lazyRenderAppPage(req.originalRequest, res.originalResponse, pathname, query, renderOpts);\n }\n // TODO: re-enable this once we've refactored to use implicit matches\n // throw new Error('Invariant: render should have used routeModule')\n return lazyRenderPagesPage(req.originalRequest, res.originalResponse, pathname, query, renderOpts);\n }\n }\n async imageOptimizer(req, res, paramsResult) {\n if (process.env.NEXT_MINIMAL) {\n throw new Error(\"invariant: imageOptimizer should not be called in minimal mode\");\n } else {\n const { imageOptimizer, fetchExternalImage, fetchInternalImage } = require(\"./image-optimizer\");\n const handleInternalReq = async (newReq, newRes)=>{\n if (newReq.url === req.url) {\n throw new Error(`Invariant attempted to optimize _next/image itself`);\n }\n if (!this.routerServerHandler) {\n throw new Error(`Invariant missing routerServerHandler`);\n }\n await this.routerServerHandler(newReq, newRes);\n return;\n };\n const { isAbsolute, href } = paramsResult;\n const imageUpstream = isAbsolute ? await fetchExternalImage(href) : await fetchInternalImage(href, req.originalRequest, res.originalResponse, handleInternalReq);\n return imageOptimizer(imageUpstream, paramsResult, this.nextConfig, this.renderOpts.dev);\n }\n }\n getPagePath(pathname, locales) {\n return getPagePath(pathname, this.distDir, locales, this.enabledDirectories.app);\n }\n async renderPageComponent(ctx, bubbleNoFallback) {\n const edgeFunctionsPages = this.getEdgeFunctionsPages() || [];\n if (edgeFunctionsPages.length) {\n const appPaths = this.getOriginalAppPaths(ctx.pathname);\n const isAppPath = Array.isArray(appPaths);\n let page = ctx.pathname;\n if (isAppPath) {\n // When it's an array, we need to pass all parallel routes to the loader.\n page = appPaths[0];\n }\n for (const edgeFunctionsPage of edgeFunctionsPages){\n if (edgeFunctionsPage === page) {\n await this.runEdgeFunction({\n req: ctx.req,\n res: ctx.res,\n query: ctx.query,\n params: ctx.renderOpts.params,\n page,\n appPaths\n });\n return null;\n }\n }\n }\n return super.renderPageComponent(ctx, bubbleNoFallback);\n }\n async findPageComponents({ page, query, params, isAppPath, url }) {\n return getTracer().trace(NextNodeServerSpan.findPageComponents, {\n spanName: \"resolve page components\",\n attributes: {\n \"next.route\": isAppPath ? normalizeAppPath(page) : page\n }\n }, ()=>this.findPageComponentsImpl({\n page,\n query,\n params,\n isAppPath,\n url\n }));\n }\n async findPageComponentsImpl({ page, query, params, isAppPath, url: _url }) {\n const pagePaths = [\n page\n ];\n if (query.amp) {\n // try serving a static AMP version first\n pagePaths.unshift((isAppPath ? normalizeAppPath(page) : normalizePagePath(page)) + \".amp\");\n }\n if (query.__nextLocale) {\n pagePaths.unshift(...pagePaths.map((path)=>`/${query.__nextLocale}${path === \"/\" ? \"\" : path}`));\n }\n for (const pagePath of pagePaths){\n try {\n const components = await loadComponents({\n distDir: this.distDir,\n page: pagePath,\n isAppPath,\n isDev: this.isDev\n });\n if (query.__nextLocale && typeof components.Component === \"string\" && !pagePath.startsWith(`/${query.__nextLocale}`)) {\n continue;\n }\n return {\n components,\n query: {\n ...!this.renderOpts.isExperimentalCompile && components.getStaticProps ? {\n amp: query.amp,\n __nextDataReq: query.__nextDataReq,\n __nextLocale: query.__nextLocale,\n __nextDefaultLocale: query.__nextDefaultLocale\n } : query,\n // For appDir params is excluded.\n ...(isAppPath ? {} : params) || {}\n }\n };\n } catch (err) {\n // we should only not throw if we failed to find the page\n // in the pages-manifest\n if (!(err instanceof PageNotFoundError)) {\n throw err;\n }\n }\n }\n return null;\n }\n getFontManifest() {\n return requireFontManifest(this.distDir);\n }\n getNextFontManifest() {\n return loadManifest(join(this.distDir, \"server\", NEXT_FONT_MANIFEST + \".json\"));\n }\n getFallback(page) {\n page = normalizePagePath(page);\n const cacheFs = this.getCacheFilesystem();\n return cacheFs.readFile(join(this.serverDistDir, \"pages\", `${page}.html`), \"utf8\");\n }\n // Used in development only, overloaded in next-dev-server\n async logErrorWithOriginalStack(_err, _type) {\n throw new Error(\"Invariant: logErrorWithOriginalStack can only be called on the development server\");\n }\n // Used in development only, overloaded in next-dev-server\n async ensurePage(_opts) {\n throw new Error(\"Invariant: ensurePage can only be called on the development server\");\n }\n /**\n * Resolves `API` request, in development builds on demand\n * @param req http request\n * @param res http response\n * @param pathname path of request\n */ async handleApiRequest(req, res, query, match) {\n return this.runApi(req, res, query, match);\n }\n getPrefetchRsc(pathname) {\n return this.getCacheFilesystem().readFile(join(this.serverDistDir, \"app\", `${pathname}${RSC_PREFETCH_SUFFIX}`), \"utf8\");\n }\n getCacheFilesystem() {\n return nodeFs;\n }\n normalizeReq(req) {\n return !(req instanceof NodeNextRequest) ? new NodeNextRequest(req) : req;\n }\n normalizeRes(res) {\n return !(res instanceof NodeNextResponse) ? new NodeNextResponse(res) : res;\n }\n getRequestHandler() {\n const handler = this.makeRequestHandler();\n if (this.serverOptions.experimentalTestProxy) {\n const { wrapRequestHandlerNode } = require(\"next/dist/experimental/testmode/server\");\n return wrapRequestHandlerNode(handler);\n }\n return handler;\n }\n makeRequestHandler() {\n // This is just optimization to fire prepare as soon as possible. It will be\n // properly awaited later. We add the catch here to ensure that it does not\n // cause a unhandled promise rejection. The promise rejection wil be\n // handled later on via the `await` when the request handler is called.\n this.prepare().catch((err)=>{\n console.error(\"Failed to prepare server\", err);\n });\n const handler = super.getRequestHandler();\n return (req, res, parsedUrl)=>{\n var _this_nextConfig_logging;\n const normalizedReq = this.normalizeReq(req);\n const normalizedRes = this.normalizeRes(res);\n const loggingFetchesConfig = (_this_nextConfig_logging = this.nextConfig.logging) == null ? void 0 : _this_nextConfig_logging.fetches;\n const enabledVerboseLogging = !!loggingFetchesConfig;\n const shouldTruncateUrl = !(loggingFetchesConfig == null ? void 0 : loggingFetchesConfig.fullUrl);\n if (this.renderOpts.dev) {\n const { blue, green, yellow, red, gray, white } = require(\"../lib/picocolors\");\n const _res = res;\n const origRes = \"originalResponse\" in _res ? _res.originalResponse : _res;\n const reqStart = Date.now();\n const isMiddlewareRequest = getRequestMeta(req, \"middlewareInvoke\");\n const reqCallback = ()=>{\n // we don't log for non-route requests\n const routeMatch = getRequestMeta(req).match;\n const isRSC = isRSCRequestCheck(req);\n if (!routeMatch || isRSC || isMiddlewareRequest) return;\n const reqEnd = Date.now();\n const fetchMetrics = normalizedReq.fetchMetrics || [];\n const reqDuration = reqEnd - reqStart;\n const statusColor = (status)=>{\n if (!status || status < 200) return white;\n else if (status < 300) return green;\n else if (status < 400) return blue;\n else if (status < 500) return yellow;\n return red;\n };\n const color = statusColor(res.statusCode);\n const method = req.method || \"GET\";\n writeStdoutLine(`${method} ${req.url ?? \"\"} ${color((res.statusCode ?? 200).toString())} in ${reqDuration}ms`);\n if (fetchMetrics.length && enabledVerboseLogging) {\n const calcNestedLevel = (prevMetrics, start)=>{\n let nestedLevel = 0;\n for(let i = 0; i < prevMetrics.length; i++){\n const metric = prevMetrics[i];\n const prevMetric = prevMetrics[i - 1];\n if (metric.end <= start && !(prevMetric && prevMetric.start < metric.end)) {\n nestedLevel += 1;\n }\n }\n return nestedLevel === 0 ? \" \" : \" │ \".repeat(nestedLevel);\n };\n for(let i = 0; i < fetchMetrics.length; i++){\n const metric = fetchMetrics[i];\n let { cacheStatus, cacheReason } = metric;\n let cacheReasonStr = \"\";\n let cacheColor;\n const duration = metric.end - metric.start;\n if (cacheStatus === \"hit\") {\n cacheColor = green;\n } else {\n cacheColor = yellow;\n const status = cacheStatus === \"skip\" ? \"skipped\" : \"missed\";\n cacheReasonStr = gray(`Cache ${status} reason: (${white(cacheReason)})`);\n }\n let url = metric.url;\n if (url.length > 48) {\n const parsed = new URL(url);\n const truncatedHost = formatRequestUrl(parsed.host, shouldTruncateUrl ? 16 : undefined);\n const truncatedPath = formatRequestUrl(parsed.pathname, shouldTruncateUrl ? 24 : undefined);\n const truncatedSearch = formatRequestUrl(parsed.search, shouldTruncateUrl ? 16 : undefined);\n url = parsed.protocol + \"//\" + truncatedHost + truncatedPath + truncatedSearch;\n }\n const status = cacheColor(`(cache ${cacheStatus})`);\n const newLineLeadingChar = \"│\";\n const nestedIndent = calcNestedLevel(fetchMetrics.slice(0, i + 1), metric.start);\n writeStdoutLine(`${newLineLeadingChar}${nestedIndent}${white(metric.method)} ${white(url)} ${metric.status} in ${duration}ms ${status}`);\n if (cacheReasonStr) {\n const nextNestedIndent = calcNestedLevel(fetchMetrics.slice(0, i + 1), metric.start);\n writeStdoutLine(`${newLineLeadingChar}${nextNestedIndent}${newLineLeadingChar} ${cacheReasonStr}`);\n }\n }\n }\n delete normalizedReq.fetchMetrics;\n origRes.off(\"close\", reqCallback);\n };\n origRes.on(\"close\", reqCallback);\n }\n return handler(normalizedReq, normalizedRes, parsedUrl);\n };\n }\n async revalidate({ urlPath, revalidateHeaders, opts }) {\n const mocked = createRequestResponseMocks({\n url: urlPath,\n headers: revalidateHeaders\n });\n const handler = this.getRequestHandler();\n await handler(new NodeNextRequest(mocked.req), new NodeNextResponse(mocked.res));\n await mocked.res.hasStreamed;\n if (mocked.res.getHeader(\"x-nextjs-cache\") !== \"REVALIDATED\" && !(mocked.res.statusCode === 404 && opts.unstable_onlyGenerated)) {\n throw new Error(`Invalid response ${mocked.res.statusCode}`);\n }\n }\n async render(req, res, pathname, query, parsedUrl, internal = false) {\n return super.render(this.normalizeReq(req), this.normalizeRes(res), pathname, query, parsedUrl, internal);\n }\n async renderToHTML(req, res, pathname, query) {\n return super.renderToHTML(this.normalizeReq(req), this.normalizeRes(res), pathname, query);\n }\n async renderErrorToResponseImpl(ctx, err) {\n const { req, res, query } = ctx;\n const is404 = res.statusCode === 404;\n if (is404 && this.enabledDirectories.app) {\n if (this.renderOpts.dev) {\n await this.ensurePage({\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n clientOnly: false,\n url: req.url\n }).catch(()=>{});\n }\n if (this.getEdgeFunctionsPages().includes(UNDERSCORE_NOT_FOUND_ROUTE_ENTRY)) {\n await this.runEdgeFunction({\n req: req,\n res: res,\n query: query || {},\n params: {},\n page: UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n appPaths: null\n });\n return null;\n }\n }\n return super.renderErrorToResponseImpl(ctx, err);\n }\n async renderError(err, req, res, pathname, query, setHeaders) {\n return super.renderError(err, this.normalizeReq(req), this.normalizeRes(res), pathname, query, setHeaders);\n }\n async renderErrorToHTML(err, req, res, pathname, query) {\n return super.renderErrorToHTML(err, this.normalizeReq(req), this.normalizeRes(res), pathname, query);\n }\n async render404(req, res, parsedUrl, setHeaders) {\n return super.render404(this.normalizeReq(req), this.normalizeRes(res), parsedUrl, setHeaders);\n }\n getMiddlewareManifest() {\n if (this.minimalMode) return null;\n const manifest = require(this.middlewareManifestPath);\n return manifest;\n }\n /** Returns the middleware routing item if there is one. */ getMiddleware() {\n var _manifest_middleware;\n const manifest = this.getMiddlewareManifest();\n const middleware = manifest == null ? void 0 : (_manifest_middleware = manifest.middleware) == null ? void 0 : _manifest_middleware[\"/\"];\n if (!middleware) {\n return;\n }\n return {\n match: getMiddlewareMatcher(middleware),\n page: \"/\"\n };\n }\n getEdgeFunctionsPages() {\n const manifest = this.getMiddlewareManifest();\n if (!manifest) {\n return [];\n }\n return Object.keys(manifest.functions);\n }\n /**\n * Get information for the edge function located in the provided page\n * folder. If the edge function info can't be found it will throw\n * an error.\n */ getEdgeFunctionInfo(params) {\n const manifest = this.getMiddlewareManifest();\n if (!manifest) {\n return null;\n }\n let foundPage;\n try {\n foundPage = denormalizePagePath(normalizePagePath(params.page));\n } catch (err) {\n return null;\n }\n let pageInfo = params.middleware ? manifest.middleware[foundPage] : manifest.functions[foundPage];\n if (!pageInfo) {\n if (!params.middleware) {\n throw new PageNotFoundError(foundPage);\n }\n return null;\n }\n return {\n name: pageInfo.name,\n paths: pageInfo.files.map((file)=>join(this.distDir, file)),\n wasm: (pageInfo.wasm ?? []).map((binding)=>({\n ...binding,\n filePath: join(this.distDir, binding.filePath)\n })),\n assets: pageInfo.assets && pageInfo.assets.map((binding)=>{\n return {\n ...binding,\n filePath: join(this.distDir, binding.filePath)\n };\n }),\n env: pageInfo.env\n };\n }\n /**\n * Checks if a middleware exists. This method is useful for the development\n * server where we need to check the filesystem. Here we just check the\n * middleware manifest.\n */ async hasMiddleware(pathname) {\n const info = this.getEdgeFunctionInfo({\n page: pathname,\n middleware: true\n });\n return Boolean(info && info.paths.length > 0);\n }\n /**\n * A placeholder for a function to be defined in the development server.\n * It will make sure that the root middleware or an edge function has been compiled\n * so that we can run it.\n */ async ensureMiddleware(_url) {}\n async ensureEdgeFunction(_params) {}\n /**\n * This method gets all middleware matchers and execute them when the request\n * matches. It will make sure that each middleware exists and is compiled and\n * ready to be invoked. The development server will decorate it to add warns\n * and errors with rich traces.\n */ async runMiddleware(params) {\n if (process.env.NEXT_MINIMAL) {\n throw new Error(\"invariant: runMiddleware should not be called in minimal mode\");\n }\n // Middleware is skipped for on-demand revalidate requests\n if (checkIsOnDemandRevalidate(params.request, this.renderOpts.previewProps).isOnDemandRevalidate) {\n return {\n response: new Response(null, {\n headers: {\n \"x-middleware-next\": \"1\"\n }\n })\n };\n }\n let url;\n if (this.nextConfig.skipMiddlewareUrlNormalize) {\n url = getRequestMeta(params.request, \"initURL\");\n } else {\n // For middleware to \"fetch\" we must always provide an absolute URL\n const query = urlQueryToSearchParams(params.parsed.query).toString();\n const locale = params.parsed.query.__nextLocale;\n url = `${getRequestMeta(params.request, \"initProtocol\")}://${this.fetchHostname || \"localhost\"}:${this.port}${locale ? `/${locale}` : \"\"}${params.parsed.pathname}${query ? `?${query}` : \"\"}`;\n }\n if (!url.startsWith(\"http\")) {\n throw new Error(\"To use middleware you must provide a `hostname` and `port` to the Next.js Server\");\n }\n const page = {};\n const middleware = this.getMiddleware();\n if (!middleware) {\n return {\n finished: false\n };\n }\n if (!await this.hasMiddleware(middleware.page)) {\n return {\n finished: false\n };\n }\n await this.ensureMiddleware(params.request.url);\n const middlewareInfo = this.getEdgeFunctionInfo({\n page: middleware.page,\n middleware: true\n });\n if (!middlewareInfo) {\n throw new MiddlewareNotFoundError();\n }\n const method = (params.request.method || \"GET\").toUpperCase();\n const { run } = require(\"./web/sandbox\");\n const result = await run({\n distDir: this.distDir,\n name: middlewareInfo.name,\n paths: middlewareInfo.paths,\n edgeFunctionEntry: middlewareInfo,\n request: {\n headers: params.request.headers,\n method,\n nextConfig: {\n basePath: this.nextConfig.basePath,\n i18n: this.nextConfig.i18n,\n trailingSlash: this.nextConfig.trailingSlash\n },\n url: url,\n page,\n body: getRequestMeta(params.request, \"clonableBody\"),\n signal: signalFromNodeResponse(params.response.originalResponse)\n },\n useCache: true,\n onWarning: params.onWarning\n });\n if (!this.renderOpts.dev) {\n result.waitUntil.catch((error)=>{\n console.error(`Uncaught: middleware waitUntil errored`, error);\n });\n }\n if (!result) {\n this.render404(params.request, params.response, params.parsed);\n return {\n finished: true\n };\n }\n // Split compound (comma-separated) set-cookie headers\n if (result.response.headers.has(\"set-cookie\")) {\n const cookies = result.response.headers.getSetCookie().flatMap((maybeCompoundCookie)=>splitCookiesString(maybeCompoundCookie));\n // Clear existing header(s)\n result.response.headers.delete(\"set-cookie\");\n // Append each cookie individually.\n for (const cookie of cookies){\n result.response.headers.append(\"set-cookie\", cookie);\n }\n // Add cookies to request meta.\n addRequestMeta(params.request, \"middlewareCookie\", cookies);\n }\n return result;\n }\n getPrerenderManifest() {\n var _this_renderOpts, _this_serverOptions;\n if (this._cachedPreviewManifest) {\n return this._cachedPreviewManifest;\n }\n if (((_this_renderOpts = this.renderOpts) == null ? void 0 : _this_renderOpts.dev) || ((_this_serverOptions = this.serverOptions) == null ? void 0 : _this_serverOptions.dev) || process.env.NODE_ENV === \"development\" || process.env.NEXT_PHASE === PHASE_PRODUCTION_BUILD) {\n this._cachedPreviewManifest = {\n version: 4,\n routes: {},\n dynamicRoutes: {},\n notFoundRoutes: [],\n preview: {\n previewModeId: require(\"crypto\").randomBytes(16).toString(\"hex\"),\n previewModeSigningKey: require(\"crypto\").randomBytes(32).toString(\"hex\"),\n previewModeEncryptionKey: require(\"crypto\").randomBytes(32).toString(\"hex\")\n }\n };\n return this._cachedPreviewManifest;\n }\n this._cachedPreviewManifest = loadManifest(join(this.distDir, PRERENDER_MANIFEST));\n return this._cachedPreviewManifest;\n }\n getRoutesManifest() {\n return getTracer().trace(NextNodeServerSpan.getRoutesManifest, ()=>{\n const manifest = loadManifest(join(this.distDir, ROUTES_MANIFEST));\n let rewrites = manifest.rewrites ?? {\n beforeFiles: [],\n afterFiles: [],\n fallback: []\n };\n if (Array.isArray(rewrites)) {\n rewrites = {\n beforeFiles: [],\n afterFiles: rewrites,\n fallback: []\n };\n }\n return {\n ...manifest,\n rewrites\n };\n });\n }\n attachRequestMeta(req, parsedUrl, isUpgradeReq) {\n var _req_headers_xforwardedproto;\n // Injected in base-server.ts\n const protocol = ((_req_headers_xforwardedproto = req.headers[\"x-forwarded-proto\"]) == null ? void 0 : _req_headers_xforwardedproto.includes(\"https\")) ? \"https\" : \"http\";\n // When there are hostname and port we build an absolute URL\n const initUrl = this.fetchHostname && this.port ? `${protocol}://${this.fetchHostname}:${this.port}${req.url}` : this.nextConfig.experimental.trustHostHeader ? `https://${req.headers.host || \"localhost\"}${req.url}` : req.url;\n addRequestMeta(req, \"initURL\", initUrl);\n addRequestMeta(req, \"initQuery\", {\n ...parsedUrl.query\n });\n addRequestMeta(req, \"initProtocol\", protocol);\n if (!isUpgradeReq) {\n addRequestMeta(req, \"clonableBody\", getCloneableBody(req.body));\n }\n }\n async runEdgeFunction(params) {\n if (process.env.NEXT_MINIMAL) {\n throw new Error(\"Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.\");\n }\n let edgeInfo;\n const { query, page, match } = params;\n if (!match) await this.ensureEdgeFunction({\n page,\n appPaths: params.appPaths,\n url: params.req.url\n });\n edgeInfo = this.getEdgeFunctionInfo({\n page,\n middleware: false\n });\n if (!edgeInfo) {\n return null;\n }\n // For edge to \"fetch\" we must always provide an absolute URL\n const isNextDataRequest = !!query.__nextDataReq;\n const initialUrl = new URL(getRequestMeta(params.req, \"initURL\") || \"/\", \"http://n\");\n const queryString = urlQueryToSearchParams({\n ...Object.fromEntries(initialUrl.searchParams),\n ...query,\n ...params.params\n }).toString();\n if (isNextDataRequest) {\n params.req.headers[\"x-nextjs-data\"] = \"1\";\n }\n initialUrl.search = queryString;\n const url = initialUrl.toString();\n if (!url.startsWith(\"http\")) {\n throw new Error(\"To use middleware you must provide a `hostname` and `port` to the Next.js Server\");\n }\n const { run } = require(\"./web/sandbox\");\n const result = await run({\n distDir: this.distDir,\n name: edgeInfo.name,\n paths: edgeInfo.paths,\n edgeFunctionEntry: edgeInfo,\n request: {\n headers: params.req.headers,\n method: params.req.method,\n nextConfig: {\n basePath: this.nextConfig.basePath,\n i18n: this.nextConfig.i18n,\n trailingSlash: this.nextConfig.trailingSlash\n },\n url,\n page: {\n name: params.page,\n ...params.params && {\n params: params.params\n }\n },\n body: getRequestMeta(params.req, \"clonableBody\"),\n signal: signalFromNodeResponse(params.res.originalResponse)\n },\n useCache: true,\n onError: params.onError,\n onWarning: params.onWarning,\n incrementalCache: globalThis.__incrementalCache || getRequestMeta(params.req, \"incrementalCache\")\n });\n if (result.fetchMetrics) {\n params.req.fetchMetrics = result.fetchMetrics;\n }\n if (!params.res.statusCode || params.res.statusCode < 400) {\n params.res.statusCode = result.response.status;\n params.res.statusMessage = result.response.statusText;\n }\n // TODO: (wyattjoh) investigate improving this\n result.response.headers.forEach((value, key)=>{\n // The append handling is special cased for `set-cookie`.\n if (key.toLowerCase() === \"set-cookie\") {\n // TODO: (wyattjoh) replace with native response iteration when we can upgrade undici\n for (const cookie of splitCookiesString(value)){\n params.res.appendHeader(key, cookie);\n }\n } else {\n params.res.appendHeader(key, value);\n }\n });\n const nodeResStream = params.res.originalResponse;\n if (result.response.body) {\n await pipeToNodeResponse(result.response.body, nodeResStream);\n } else {\n nodeResStream.end();\n }\n return result;\n }\n get serverDistDir() {\n if (this._serverDistDir) {\n return this._serverDistDir;\n }\n const serverDistDir = join(this.distDir, SERVER_DIRECTORY);\n this._serverDistDir = serverDistDir;\n return serverDistDir;\n }\n async getFallbackErrorComponents(_url) {\n // Not implemented for production use cases, this is implemented on the\n // development server.\n return null;\n }\n}\n\n//# sourceMappingURL=next-server.js.map","import { RouteKind } from \"../route-kind\";\n/**\n * Checks if the given match is a Pages API route match.\n * @param match the match to check\n * @returns true if the match is a Pages API route match, false otherwise\n */ export function isPagesAPIRouteMatch(match) {\n return match.definition.kind === RouteKind.PAGES_API;\n}\n\n//# sourceMappingURL=pages-api-route-match.js.map","import { Agent as HttpAgent } from \"http\";\nimport { Agent as HttpsAgent } from \"https\";\nexport function setHttpClientAndAgentOptions(config) {\n if (globalThis.__NEXT_HTTP_AGENT) {\n // We only need to assign once because we want\n // to reuse the same agent for all requests.\n return;\n }\n if (!config) {\n throw new Error(\"Expected config.httpAgentOptions to be an object\");\n }\n globalThis.__NEXT_HTTP_AGENT_OPTIONS = config.httpAgentOptions;\n globalThis.__NEXT_HTTP_AGENT = new HttpAgent(config.httpAgentOptions);\n globalThis.__NEXT_HTTPS_AGENT = new HttpsAgent(config.httpAgentOptions);\n}\n\n//# sourceMappingURL=setup-http-agent-env.js.map","import { matchHas } from \"./prepare-destination\";\nexport function getMiddlewareRouteMatcher(matchers) {\n return (pathname, req, query)=>{\n for (const matcher of matchers){\n const routeMatch = new RegExp(matcher.regexp).exec(pathname);\n if (!routeMatch) {\n continue;\n }\n if (matcher.has || matcher.missing) {\n const hasParams = matchHas(req, query, matcher.has, matcher.missing);\n if (!hasParams) {\n continue;\n }\n }\n return true;\n }\n return false;\n };\n}\n\n//# sourceMappingURL=middleware-route-matcher.js.map","import { PassThrough } from \"stream\";\nexport function requestToBodyStream(context, KUint8Array, stream) {\n return new context.ReadableStream({\n start: async (controller)=>{\n for await (const chunk of stream){\n controller.enqueue(new KUint8Array(chunk));\n }\n controller.close();\n }\n });\n}\nfunction replaceRequestBody(base, stream) {\n for(const key in stream){\n let v = stream[key];\n if (typeof v === \"function\") {\n v = v.bind(base);\n }\n base[key] = v;\n }\n return base;\n}\nexport function getCloneableBody(readable) {\n let buffered = null;\n const endPromise = new Promise((resolve, reject)=>{\n readable.on(\"end\", resolve);\n readable.on(\"error\", reject);\n }).catch((error)=>{\n return {\n error\n };\n });\n return {\n /**\n * Replaces the original request body if necessary.\n * This is done because once we read the body from the original request,\n * we can't read it again.\n */ async finalize () {\n if (buffered) {\n const res = await endPromise;\n if (res && typeof res === \"object\" && res.error) {\n throw res.error;\n }\n replaceRequestBody(readable, buffered);\n buffered = readable;\n }\n },\n /**\n * Clones the body stream\n * to pass into a middleware\n */ cloneBodyStream () {\n const input = buffered ?? readable;\n const p1 = new PassThrough();\n const p2 = new PassThrough();\n input.on(\"data\", (chunk)=>{\n p1.push(chunk);\n p2.push(chunk);\n });\n input.on(\"end\", ()=>{\n p1.push(null);\n p2.push(null);\n });\n buffered = p2;\n return p1;\n }\n };\n}\n\n//# sourceMappingURL=body-streams.js.map"],"names":["e","exports","j","t","ignoreProcessEnv","process","env","n","parsed","r","Object","prototype","hasOwnProperty","call","_interpolate","_searchLast","Array","from","matchAll","length","slice","index","i","o","match","s","replace","a","c","version","l","_debug","console","log","_dotenvKey","DOTENV_KEY","_vaultPath","resolve","cwd","path","endsWith","p","configDotenv","Boolean","debug","join","homedir","encoding","parse","readFileSync","processEnv","populate","message","error","_configVault","_parseVault","split","trim","_instructions","URL","code","password","searchParams","get","toUpperCase","ciphertext","key","decrypt","config","existsSync","Buffer","createDecipheriv","setAuthTag","update","final","RangeError","toString","exec","override","keys","JSON","__nccwpck_require__","undefined","__esModule","d","defineProperty","enumerable","Symbol","toStringTag","value","ab","__dirname","initialEnv","updateInitialEnv","resetEnv","loadEnvConfig","u","assign","replaceProcessEnv","forEach","startsWith","entries","__NEXT_PROCESSED_ENV","_","contents","some","combinedEnv","loadedEnvFiles","filter","statSync","isFile","push","module","__defProp","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","src_exports","stringifyCookie","_a","attrs","expires","Date","toUTCString","maxAge","domain","secure","httpOnly","sameSite","partitioned","priority","stringified","name","encodeURIComponent","parseCookie","cookie","map","Map","pair","splitAt","indexOf","set","decodeURIComponent","parseSetCookie","setCookie","string","attributes","httponly","maxage","samesite","fromEntries","value2","toLowerCase","compact","newT","Number","SAME_SITE","includes","PRIORITY","__export","target","all","RequestCookies","ResponseCookies","__copyProps","to","except","desc","constructor","requestHeaders","_parsed","_headers","header","iterator","size","args","getAll","has","delete","names","result","isArray","clear","for","stringify","values","v","responseHeaders","_b","_c","getSetCookie","cookieString","splitCookiesString","cookiesString","start","ch","lastComma","nextStart","cookiesSeparatorFound","cookiesStrings","pos","skipWhitespace","test","charAt","substring","normalizeCookie","now","bag","headers","serialized","append","decode","f","substr","tryDecode","serialize","encode","isNaN","isFinite","Math","floor","parseHttpDate","NaN","parseTokenList","charCodeAt","h","naiveLength","isStale","del","unshiftNode","tail","prev","removeNode","Entry","forEachStep","max","Infinity","stale","dispose","noDisposeOnSet","updateAgeOnGet","reset","allowStale","lengthCalculator","itemCount","rforEach","head","next","toArray","dump","k","dumpLru","unshift","peek","pop","load","prune","Yallist","arguments","Node","list","create","pushNode","shift","forEachReverse","getReverse","mapReverse","reduce","reduceReverse","toArrayReverse","sliceReverse","splice","insert","reverse","str","options","tokens","lexer","char","type","count","pattern","prefixes","defaultPattern","escapeString","delimiter","tryConsume","mustConsume","consumeText","prefix","suffix","modifier","name_1","pattern_1","flags","sensitive","reFlags","validate","matches","x","token","data","optional","repeat","segment","String","typeOfMessage","re","pathname","m","params","_loop_1","pathToRegexp","RegExp","regexpToRegexp","groups","source","parts","tokensToRegexp","strict","end","_d","route","_i","tokens_1","mod","endToken","isEndDelimited","NEXT_QUERY_PARAM_PREFIX","PRERENDER_REVALIDATE_HEADER","PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER","RSC_PREFETCH_SUFFIX","RSC_SUFFIX","ACTION_SUFFIX","NEXT_DATA_SUFFIX","NEXT_META_SUFFIX","NEXT_CACHE_TAGS_HEADER","NEXT_CACHE_SOFT_TAGS_HEADER","NEXT_CACHE_REVALIDATED_TAGS_HEADER","NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER","CACHE_ONE_YEAR","INSTRUMENTATION_HOOK_FILENAME","SERVER_RUNTIME","edge","experimentalEdge","nodejs","WEBPACK_LAYERS_NAMES","shared","reactServerComponents","serverSideRendering","actionBrowser","api","middleware","instrument","edgeAsset","appPagesBrowser","appMetadataRoute","appRouteHandler","GROUP","serverOnly","clientOnly","nonClientServerTarget","app","checkIsOnDemandRevalidate","req","previewProps","isOnDemandRevalidate","previewModeId","revalidateOnlyGenerated","COOKIE_NAME_PRERENDER_BYPASS","COOKIE_NAME_PRERENDER_DATA","SYMBOL_PREVIEW_DATA","SYMBOL_CLEARED_COOKIES","clearPreviewData","res","previous","getHeader","setHeader","tryGetPreviewData","multiZoneDraftMode","_cookies_get","_cookies_get1","encryptedPreviewData","cookies","tokenPreviewData","jsonwebtoken","verify","previewModeSigningKey","decryptWithSecret","decryptedPreviewData","previewModeEncryptionKey","CIPHER_ALGORITHM","encryptWithSecret","secret","iv","salt","cipher","encrypted","concat","tag","getAuthTag","encryptedData","buffer","CIPHER_SALT_LENGTH","decipher","ipcForbiddenHeaders","filterReqHeaders","forbiddenHeaders","invokeRequest","targetUrl","requestInit","readableBody","invokeHeaders","fetch","method","redirect","signal","body","duplex","internal","deserializeErr","serializedErr","stack","ErrorType","Error","err","digest","invokeIpcMethod","fetchHostname","ipcPort","ipcKey","text","parsedBody","BaseServerSpan","LoadComponentsSpan","NextServerSpan","NextNodeServerSpan","StartServerSpan","RenderSpan","AppRenderSpan","RouterSpan","NodeSpan","AppRouteRouteHandlersSpan","ResolveMetadataSpan","MiddlewareSpan","globalThis","AsyncLocalStorage","WebSocket","global","crypto","webcrypto","configurable","ReflectAdapter","prop","receiver","Reflect","bind","deleteProperty","ReadonlyHeadersError","callable","HeadersAdapter","Headers","Proxy","lowercased","original","find","seal","merge","existing","callbackfn","thisArg","webpackEmptyContext","id","execOnce","fn","used","_len","_key","isResSent","finished","headersSent","normalizeRepeatedSlashes","url","urlParts","urlNoQuery","SP","performance","every","DecodeError","NormalizeError","PageNotFoundError","page","MissingStaticPage","MiddlewareNotFoundError","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","definition","obj","memoryCache","tagsManifest","RedirectStatusCode","_globalThis","PAGE_TYPES","originalRequire","resolveFilename","_resolveFilename","hookPropertyMap","addHookAliases","aliases","dirname","originalResolveFilename","requestMap","request","parent","isMain","hookResolved","basename","getRouteMatcher","param","routeMatch","g","slugName","entry","NEXT_REQUEST_META","getRequestMeta","meta","addRequestMeta","COMPILER_NAMES","client","server","edgeServer","UNDERSCORE_NOT_FOUND_ROUTE","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","PAGES_MANIFEST","APP_PATHS_MANIFEST","SERVER_DIRECTORY","BLOCKED_PAGES","STATIC_STATUS_PAGES","findDir","dir","curDir","getCookieParser","parseCookieFn","BaseNextRequest","_cookies","BaseNextResponse","destination","statusCode","PermanentRedirect","NodeNextRequest","originalRequest","_req","_this__req","fetchMetrics","NodeNextResponse","originalResponse","_res","textBody","sent","statusMessage","removeHeader","getHeaderValues","hasHeader","getHeaders","appendHeader","currentValues","send","fnv1a52","len","t0","v0","t1","v1","t2","v2","t3","v3","generateETag","payload","weak","formatRevalidate","revalidate","swrDelta","swrHeader","ACTION","NEXT_ROUTER_STATE_TREE","NEXT_ROUTER_PREFETCH_HEADER","FLIGHT_PARAMETERS","NEXT_RSC_UNION_QUERY","sendRenderResult","generateEtags","poweredByHeader","isDynamic","toUnchunkedString","_root_querySelector","etagPayload","sort","root","scriptTags","querySelector","querySelectorAll","_node_innerHTML","node","hasAttribute","innerHTML","b","localeCompare","script","remove","appendChild","etag","contentType","byteLength","pipeToNodeResponse","searchParamsToUrlQuery","query","parseUrl","parseRelativeUrl","base","globalBase","resolvedBase","search","hash","href","origin","parsedURL","hostname","port","protocol","stdout","enabled","NO_COLOR","FORCE_COLOR","isTTY","CI","TERM","replaceClose","close","nextIndex","formatter","open","input","bold","red","green","yellow","magenta","white","wait","warn","ready","info","event","trace","LOGGING_METHOD","prefixedLog","prefixType","consoleMethod","bootstrap","warnOnceMessages","Set","warnOnce","add","v4Seg","v4Str","v6Seg","IPv6Reg","ensureLeadingSlash","segments","normalizeRscURL","TEST_ROUTE","isDynamicRoute","interceptingRoute","marker","interceptedRoute","splitInterceptingRoute","isBot","userAgent","voidCatch","Uint8Array","encoder","TextEncoder","streamToString","stream","decoder","TextDecoder","fatal","chunk","fromNodeOutgoingHttpHeaders","nodeHeaders","toNodeOutgoingHttpHeaders","removeTrailingSlash","parsePath","hashIndex","queryIndex","hasQuery","addPathPrefix","addPathSuffix","pathHasPrefix","getHostname","host","normalizeLocalePath","locales","detectedLocale","pathnameParts","locale","withoutPrefix","getNextPathnameInfo","_options_nextConfig","_result_pathname","basePath","i18n","trailingSlash","nextConfig","pathnameNoDataPrefix","paths","buildId","parseData","i18nProvider","analyze","REGEX_LOCALHOST_HOSTNAME","parseURL","Internal","NextURL","baseOrOpts","opts","_this_Internal_options_nextConfig_i18n","_this_Internal_options_nextConfig","_this_Internal_domainLocale","_this_Internal_options_nextConfig_i18n1","_this_Internal_options_nextConfig1","__NEXT_NO_MIDDLEWARE_URL_NORMALIZE","domainLocale","detectDomainLocale","domainItems","item","_item_domain","_item_locales","defaultLocale","domains","formatPathname","addLocale","ignorePrefix","lower","forceLocale","formatSearch","username","toJSON","clone","RemovedPageError","RemovedUAError","INTERNALS","NextRequest","Request","init","validateURL","cause","nextUrl","geo","ip","bodyUsed","cache","credentials","integrity","keepalive","mode","referrer","referrerPolicy","ua","ResponseAbortedName","ResponseAborted","createAbortController","response","controller","AbortController","once","writableFinished","abort","NextRequestAdapter","fromBaseNextRequest","fromWebNextRequest","fromNodeNextRequest","aborted","reject","promise","Promise","rej","clientComponentLoadStart","clientComponentLoadTimes","clientComponentLoadCount","isAbortError","readable","waitUntilForEnd","errored","destroyed","writer","createWriterFromResponse","started","drained","onDrain","on","off","WritableStream","write","NEXT_OTEL_PERFORMANCE_PREFIX","metrics","getClientComponentLoaderMetrics","measure","flushHeaders","getTracer","startResponse","spanName","ok","flush","destroy","pipeTo","RenderResult","fromStatic","metadata","waitUntil","assignMetadata","isNull","chainStreams","streams","writable","TransformStream","preventClose","nextStream","then","lastStream","catch","chain","responses","ReadableStream","enqueue","denormalizePagePath","_page","getPathMatch","regexp","matcher","regexModifier","removeUnnamedParams","reHasRegExp","reReplaceRegExp","escapeStringRegexp","parseParameter","getRouteRegex","normalizedRoute","parameterizedRoute","getParametrizedRoute","groupIndex","markerMatch","paramMatches","getSafeKeyFromSegment","interceptionMarker","getSafeRouteKey","routeKeys","keyPrefix","cleanedKey","invalidKey","parseInt","interceptionPrefix","unescapeSegments","matchHas","missing","hasMatch","hasItem","getSafeParamName","paramName","newParamName","charCode","groupKey","compileNonPath","isError","getProperError","isPlainObject","getObjectClassLabel","getPrototypeOf","LocaleRouteNormalizer","provider","normalize","UrlNode","urlPath","_insert","smoosh","_smoosh","childrenPaths","children","restSlugName","optionalRestSlugName","routes","curr","placeholder","urlPaths","slugNames","isCatchAll","nextSegment","segmentName","isOptional","handleSlug","previousSlug","nextSlug","slug","RouteMatcher","dynamic","identity","LocaleRouteMatcher","_this_definition_i18n","_options_i18n","DefaultRouteMatcherManager","compilationID","providers","waitTillReady","waitTillReadyPromise","reload","matchers","providersMatchers","duplicates","providerMatchers","duplicated","duplicate","others","previousMatchers","cachedMatcher","static","reference","pathnames","indexes","sorted","getSortedRoutes","normalizedPages","pagePath","sortedDynamicMatchers","dynamicMatches","lastCompilationID","inferredFromDefault","skipDynamic","Normalizers","normalizers","normalizer","normalized","PrefixingNormalizer","normalizePagePath","posix","resolvedPage","AppBundlePathNormalizer","AppFilenameNormalizer","distDir","manifestFilename","wrapNormalizerFn","UnderscoreNormalizer","AppPathnameNormalizer","AppNormalizers","filename","bundlePath","RouteKind","AppPageRouteMatcher","CachedRouteMatcherProvider","loader","cached","compare","transform","ManifestRouteMatcherProvider","manifestName","manifestLoader","left","right","AppPageRouteMatcherProvider","manifest","pages","allAppPaths","appPaths","kind","APP_PAGE","AppRouteRouteMatcher","AppRouteRouteMatcherProvider","APP_ROUTE","isAPIRoute","PagesAPIRouteMatcher","PagesAPILocaleRouteMatcher","PagesBundlePathNormalizer","PagesFilenameNormalizer","PagesNormalizers","PagesAPIRouteMatcherProvider","PAGES_API","PagesRouteMatcher","PagesLocaleRouteMatcher","PagesRouteMatcherProvider","_this_i18nProvider","PAGES","ServerManifestLoader","I18NProvider","_config_domains","lowerCaseLocales","lowerCaseDomains","_domainLocale_locales","http","fromQuery","__nextLocale","analysis","__nextInferredLocaleFromDefault","validateQuery","__nextDefaultLocale","sendResponse","_response_headers","status","statusText","SuffixPathnameNormalizer","matched","RSCPathnameNormalizer","PrefixPathnameNormalizer","PostponedPathnameNormalizer","ActionPathnameNormalizer","stripFlightHeaders","PrefetchRSCPathnameNormalizer","NextDataPathnameNormalizer","buildID","toRoute","NoFallbackError","WrappedBuildError","innerError","Server","_this_nextConfig_i18n","_this_nextConfig_experimental_amp","_this_nextConfig_i18n1","handleRSCRequest","parsedUrl","_this_normalizers_prefetchRSC","_this_normalizers_rsc","prefetchRSC","RSC_HEADER","rsc","format","handleNextDataRequest","getMiddleware","matchNextDataPathname","render404","lastParam","getRouteFromAssetPath","assetPath","ext","_req_headers_host","localePathResult","__nextDataReq","handleNextImageRequest","handleCatchallRenderRequest","handleCatchallMiddlewareRequest","postponed","action","normalizeAndAttachMetadata","enabledDirectories","prepared","preparedPromise","customErrorNo404Warn","quiet","conf","dev","minimalMode","customServer","experimentalTestProxy","serverOptions","formatHostname","isIPv6","publicDir","getPublicDir","hasStaticDir","getHasStaticDir","localeNormalizer","serverRuntimeConfig","publicRuntimeConfig","assetPrefix","getBuildId","NEXT_PRIVATE_MINIMAL_MODE","getEnabledDirectories","experimental","ppr","nextFontManifest","getNextFontManifest","NEXT_DEPLOYMENT_ID","deploymentId","renderOpts","supportsDynamicResponse","strictNextHead","canonicalBase","amp","getPrerenderManifest","preview","ampOptimizerConfig","optimizer","images","optimizeFonts","fontManifest","getFontManifest","optimizeCss","nextConfigOutput","output","nextScriptWorkers","disableOptimizedLoading","domainLocales","serverComponents","enableTainting","taint","crossOrigin","largePageDataBytes","runtimeConfig","isExperimentalCompile","missingSuspenseWithCSRBailout","setConfig","pagesManifest","getPagesManifest","appPathsManifest","getAppPathsManifest","appPathRoutes","getAppPathRoutes","interceptionRoutePatterns","getinterceptionRoutePatterns","getRouteMatchers","setAssetPrefix","responseCache","getResponseCache","reloadMatchers","logError","handleRequest","prepare","isRSCRequestCheck","tracer","withPropagatedContext","SpanKind","SERVER","span","handleRequestImpl","finally","setAttributes","rootSpanAttributes","getRootSpanAttributes","newName","updateName","_originalRequest_socket","_originalRequest_socket1","_this_i18nProvider1","_this_normalizers_data","_this_normalizers_postponed","_this_i18nProvider2","_this_getRoutesManifest","_utils_defaultRouteRegex","origSetHeader","val","middlewareValue","idx","cleanUrl","URLSearchParams","xForwardedProto","isHttps","socket","remoteAddress","attachRequestMeta","pathnameInfo","useMatchedPathHeader","matchedPath","urlPathname","normalizedUrlPath","stripNextDataPath","localeAnalysisResult","srcPathname","pageIsDynamic","utils","getUtils","rewrites","caseSensitive","defaultRouteRegex","dynamicRouteMatcher","defaultRouteMatches","prefixRouteKey","getNamedParametrizedRoute","prefixRouteKeys","routeKey","fromCharCode","namedParameterizedRoute","hasInterceptionMarker","usedMarker","namedRegex","handleRewrites","rewriteParams","fsPathname","checkRewrite","rewrite","hasParams","parsedDestination","destQuery","prepareDestination","newUrl","escapedDestination","destPath","destHostname","destPathParamKeys","destHostnameParamKeys","destParams","destPathCompiler","destHostnameCompiler","strOrArray","paramKeys","appendParamsToQuery","destLocalePathResult","nextInternalLocale","dynamicParams","beforeFiles","afterFiles","matchesPage","fsPathnameNoSlash","fallback","getParamsFromRouteMatches","matchesHasLocale","routeKeyNames","filterLocaleItem","_val","keyName","normalizedKey","normalizeDynamicRouteParams","ignoreOptional","hasValidParams","defaultValue","isDefaultValue","defaultVal","normalizeVercelUrl","trustQuery","_parsedUrl","interpolateDynamicPath","builtParam","paramIdx","paramValue","getRoutesManifest","caseSensitiveRoutes","pathnameBeforeRewrite","rewriteParamKeys","didRewrite","routeParamKeys","paramsResult","matcherParams","routeParams","renderError","webServerConfig","parsedFullUrl","incrementalCache","getIncrementalCache","requestProtocol","resetRequestCache","__incrementalCache","invokePath","invokeStatus","invokeQuery","parsedMatchedPath","invokePathnameInfo","normalizeResult","Response","bubble","run","getRequestHandlerWithMetadata","handler","getRequestHandler","prepareImpl","normalizedPath","runImpl","pipe","partialContext","pipeImpl","isBotRequest","ctx","originalStatus","getStaticHTML","render","internalRender","renderImpl","hasPage","renderToResponse","getStaticPaths","_this_getPrerenderManifest_dynamicRoutes_pathname","fallbackField","dynamicRoutes","staticPaths","fallbackMode","renderToResponseWithComponents","requestContext","findComponentsResult","renderToResponseWithComponentsImpl","pathCouldBeIntercepted","resolvedPathname","setVaryHeader","isAppPath","baseVaryHeader","isRSCRequest","addedNextUrlToVary","components","_components_Component","_cacheEntry_value","_components_Document","_cachedData_headers","isErrorPathname","is404Page","is500Page","hasServerProps","getServerSideProps","hasStaticPaths","isServerAction","getServerActionRequestMetadata","actionId","isURLEncodedAction","isMultipartAction","isFetchAction","hasGetInitialProps","Component","getInitialProps","isSSG","getStaticProps","resolvedUrlPathname","hasFallback","prerenderManifest","pathsResult","resolvedWithoutSlash","isNextDataRequest","isPrefetchRSCRequest","minimalPostponed","isDynamicRSCRequest","isSupportedDocument","Document","NEXT_BUILTIN_DOCUMENT","isPreviewMode","previewData","runtime","ssgCacheKey","seg","routeModule","isDebugPPRSkeleton","__nextppronly","doRender","origQuery","hadTrailingSlash","resolvedUrl","isRevalidate","originalPathname","ComponentMod","serverActions","resolvedAsPath","isDraftMode","nextExport","isStaticGeneration","context","signalFromNodeResponse","AbortSignal","handle","cacheTags","fetchTags","_context_renderOpts_store","blob","store","arrayBuffer","clientReferenceManifest","renderHTML","staticBailoutInfo","description","isNotFound","isRedirect","props","pageData","flightData","html","cacheEntry","hasResolved","previousCacheEntry","isRevalidating","staticPathKey","routeKind","isPrefetch","purpose","cachedData","notFoundRevalidate","onCacheEntry","handleRedirect","pageProps","__N_REDIRECT","__N_REDIRECT_STATUS","__N_REDIRECT_BASE_PATH","permanent","TemporaryRedirect","stripLocale","splitPath","getOriginalAppPaths","_this_appPathRoutes","renderPageComponent","bubbleNoFallback","_this_nextConfig_experimental_sri","_getTracer_getRootSpanAttributes","findPageComponents","sriEnabled","sri","algorithm","shouldEnsure","isNoFallbackError","renderToResponseImpl","_nextBubbleNoFallback","initUrl","rewroteUrl","renderErrorToResponse","__nextCustomErrorRender","isWrappedError","renderToHTML","renderToHTMLImpl","setHeaders","renderErrorImpl","renderErrorToResponseImpl","statusPage","removeRequestMeta","maybeFallbackError","renderToHtmlError","fallbackComponents","getFallbackErrorComponents","renderErrorToHTML","deepFreeze","isFrozen","freeze","sharedCache","loadManifest","shouldCache","pagePathCache","getMaybePagePath","cacheKey","serverBuildPath","checkManifest","curPath","manifestNoLocales","getPagePath","requirePage","promises","readFile","__NEXT_PRIVATE_RUNTIME_TYPE","interopDefault","default","ms","setTimeout","SERVER_ACTION_MANIFESTS_SINGLETON","loadManifestWithRetries","manifestPath","attempts","evalManifestWithRetries","evalManifest","content","contextObject","runInNewContext","loadClientReferenceManifest","entryName","__RSC_MANIFEST","loadComponentsImpl","isDev","DocumentMod","AppMod","hasClientManifest","manifestLoadAttempts","buildManifest","reactLoadableManifest","serverActionsManifest","SERVER_REFERENCE_MANIFEST","setReferenceManifestsSingleton","serverModuleMap","createServerModuleMap","pageName","workers","chunks","App","pageConfig","loadComponents","wrap","Batcher","cacheKeyFn","schedulerFn","pending","batch","scheduleOnNextTick","nextTick","cb","fromResponseCacheEntry","toResponseCacheEntry","_response_value","_response_value1","isMiss","ResponseCache","batcher","responseGenerator","_this_previousCacheItem","previousCacheItem","expiresAt","resolved","cachedResponse","resolveValue","min","rateLimitedUntil","CACHE_TAGS_HEADER","CACHE_HEADERS_HEADER","CACHE_REVALIDATE_HEADER","CACHE_FETCH_URL_HEADER","DEBUG","NEXT_PRIVATE_DEBUG_CACHE","fetchRetryWithTimeout","retryIndex","timeout","clearTimeout","FetchCache","hasMatchingTags","arr1","arr2","set1","set2","isAvailable","_requestHeaders","SUSPENSE_CACHE_URL","newHeaders","scHost","scBasePath","SUSPENSE_CACHE_BASEPATH","SUSPENSE_CACHE_AUTH_TOKEN","scProto","SUSPENSE_CACHE_PROTO","cacheEndpoint","maxMemoryCacheSize","_JSON_stringify","revalidateTag","tags","ceil","currentTags","retryAfter","_data_value","softTags","kindHint","fetchIdx","fetchUrl","hasFetchKindAndMatchingTags","fetchType","json","cacheState","age","lastModified","fetchCache","FileSystemCache","fs","flushToDisk","serverDistDir","appDir","_appDir","pagesDir","_pagesDir","revalidatedTags","tagsManifestPath","loadTagsManifest","items","revalidatedAt","mkdir","writeFile","_data_value1","_data_value2","_data_value3","_data_value_headers","filePath","getFilePath","fileData","mtime","stat","getTime","detectFileKind","parsedData","storedTags","tagsHeader","_tagsManifest_items_tag","combinedTags","htmlPath","SharedRevalidateTimings","timings","_this_prerenderManifest_routes_route","initialRevalidateSeconds","IncrementalCache","fetchCacheKeyPrefix","CurCacheHandler","allowedRevalidateHeaderKeys","_this_prerenderManifest_preview","_this_prerenderManifest","_this_prerenderManifest_preview1","_this_prerenderManifest1","locks","unlocks","hasCustomCacheHandler","__NEXT_TEST_MAX_ISR_CACHE","disableForTestmode","NEXT_PRIVATE_TEST_PROXY","revalidateTimings","cacheHandler","calculateRevalidate","fromTime","_getPathname","_this_cacheHandler_resetRequestCache","_this_cacheHandler","unlock","lock","__NEXT_INCREMENTAL_CACHE_IPC_PORT","__NEXT_INCREMENTAL_CACHE_IPC_KEY","unlockNext","existingLock","newLock","_this_cacheHandler_revalidateTag","fetchCacheKey","bodyChunks","getReader","total","arr","offset","_ogBody","formData","Blob","cacheString","crypto1","createHash","_cacheData_value","revalidateAfter","cacheData","_this_revalidatedTags","curRevalidate","notFoundRoutes","itemSize","nodeFs","recursive","MockedRequest","httpVersion","httpVersionMajor","httpVersionMinor","_target","bodyReadable","emit","headersDistinct","_read","connection","complete","trailers","trailersDistinct","rawTrailers","rawHeaders","MockedResponse","buffers","headPromise","headPromiseResolve","hasStreamed","resWriter","isSent","isBuffer","_implicitHeader","_write","_encoding","callback","writeHead","getHeaderNames","strictContentLength","writeEarlyHints","assignSocket","detachSocket","writeContinue","writeProcessing","upgrading","chunkedEncoding","shouldKeepAlive","useChunkedEncodingByDefault","sendDate","addTrailers","NodeModuleLoader","RouteModuleLoader","formatDynamicImportPath","absoluteFilePath","pathToFileURL","isInterceptionRouteRewrite","_route_has_","_route_has","dynamicImportEsmDefault","dynamicRequire","MiddlewareMatcherCache","WeakMap","NextNodeServer","edgeFunctionsPage","getEdgeFunctionsPages","runEdgeFunction","handleApiRequest","isMiddlewareInvoke","handleFinished","normalizedPathname","bubblingResult","ensureMiddleware","runMiddleware","__NEXT_OPTIMIZE_FONTS","__NEXT_OPTIMIZE_CSS","__NEXT_SCRIPT_WORKERS","appDocumentPreloading","preloadEntriesOnStart","unstable_preloadEntries","regex","setHttpClientAndAgentOptions","__NEXT_HTTP_AGENT","__NEXT_HTTP_AGENT_OPTIONS","httpAgentOptions","__NEXT_HTTPS_AGENT","middlewareManifestPath","webpackRequire","__next_app__","handleUpgrade","instrumentationHook","register","forceReload","silent","CacheHandler","getCacheFilesystem","cacheMaxMemorySize","routesManifest","buildIdFile","runApi","trustHostHeader","renderHTMLImpl","imageOptimizer","edgeFunctionsPages","findPageComponentsImpl","_url","pagePaths","requireFontManifest","NEXT_FONT_MANIFEST","getFallback","cacheFs","logErrorWithOriginalStack","_err","_type","ensurePage","_opts","getPrefetchRsc","normalizeReq","normalizeRes","makeRequestHandler","_this_nextConfig_logging","normalizedReq","normalizedRes","loggingFetchesConfig","logging","fetches","fullUrl","revalidateHeaders","mocked","createRequestResponseMocks","unstable_onlyGenerated","getMiddlewareManifest","_manifest_middleware","getMiddlewareMatcher","stored","functions","getEdgeFunctionInfo","foundPage","pageInfo","files","file","wasm","binding","assets","hasMiddleware","ensureEdgeFunction","_params","_this_serverOptions","_cachedPreviewManifest","NEXT_PHASE","isUpgradeReq","_req_headers_xforwardedproto","getCloneableBody","buffered","endPromise","finalize","replaceRequestBody","cloneBodyStream","p1","PassThrough","p2","_serverDistDir"],"sourceRoot":""}