Rocky_Mountain_Vending/.pnpm-store/v10/files/ac/4a99845aaeb6098ac89073ada2db266557777f2e69882906a4491e600ef439b6f2add7affc944d6aaab151d9f2d0e39634c70b503d78c6e4e29cedbf9c5469
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

1 line
No EOL
2.8 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"app-page-experimental.runtime.prod.js","sources":["webpack://next/./src/build/webpack/alias/react-dom-server-experimental.js","webpack://next/./dist/compiled/@edge-runtime/cookies/index.js","webpack://next/./dist/compiled/busboy/index.js","webpack://next/./dist/compiled/bytes/index.js","webpack://next/./dist/compiled/cookie/index.js","webpack://next/./dist/compiled/p-queue/index.js","webpack://next/./dist/compiled/path-to-regexp/index.js","webpack://next/./dist/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js","webpack://next/./dist/compiled/react-dom-experimental/cjs/react-dom.production.js","webpack://next/./dist/compiled/react-dom-experimental/index.js","webpack://next/./dist/compiled/react-dom-experimental/static.node.js","webpack://next/./dist/compiled/react-experimental/cjs/react-compiler-runtime.production.js","webpack://next/./dist/compiled/react-experimental/cjs/react-jsx-dev-runtime.production.js","webpack://next/./dist/compiled/react-experimental/cjs/react-jsx-runtime.production.js","webpack://next/./dist/compiled/react-experimental/cjs/react.production.js","webpack://next/./dist/compiled/react-experimental/compiler-runtime.js","webpack://next/./dist/compiled/react-experimental/index.js","webpack://next/./dist/compiled/react-experimental/jsx-dev-runtime.js","webpack://next/./dist/compiled/react-experimental/jsx-runtime.js","webpack://next/./dist/compiled/react-is/cjs/react-is.production.js","webpack://next/./dist/compiled/react-is/index.js","webpack://next/./dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.js","webpack://next/./dist/compiled/react-server-dom-webpack-experimental/client.node.js","webpack://next/./dist/compiled/safe-stable-stringify/index.js","webpack://next/./dist/compiled/string-hash/index.js","webpack://next/./dist/src/client/add-base-path.ts","webpack://next/./dist/src/client/normalize-trailing-slash.ts","webpack://next/./dist/src/client/app-build-id.ts","webpack://next/./dist/src/client/app-call-server.ts","webpack://next/./dist/src/client/app-find-source-map-url.ts","webpack://next/./dist/src/client/components/app-router-headers.ts","webpack://next/./dist/src/client/components/app-router-utils.ts","webpack://next/./dist/src/client/components/hooks-server-context.ts","webpack://next/./dist/src/client/components/http-access-fallback/http-access-fallback.ts","webpack://next/./dist/src/client/components/is-next-router-error.ts","webpack://next/./dist/src/client/components/links.ts","webpack://next/./dist/src/client/components/match-segments.ts","webpack://next/./dist/src/client/components/redirect-error.ts","webpack://next/./dist/src/client/components/redirect-status-code.ts","webpack://next/./dist/src/client/components/router-reducer/create-href-from-url.ts","webpack://next/./dist/src/client/components/router-reducer/create-router-cache-key.ts","webpack://next/./dist/src/client/components/router-reducer/fetch-server-response.ts","webpack://next/./dist/src/client/components/router-reducer/ppr-navigations.ts","webpack://next/./dist/src/client/components/router-reducer/is-navigating-to-new-root-layout.ts","webpack://next/./dist/src/client/components/router-reducer/reducers/navigate-reducer.ts","webpack://next/./dist/src/client/components/router-reducer/router-reducer-types.ts","webpack://next/./dist/src/client/components/router-reducer/set-cache-busting-search-param.ts","webpack://next/./dist/src/client/components/segment-cache-impl/cache-key.ts","webpack://next/./dist/src/client/components/segment-cache-impl/cache.ts","webpack://next/./dist/src/client/components/segment-cache-impl/tuple-map.ts","webpack://next/./dist/src/client/components/segment-cache-impl/lru.ts","webpack://next/./dist/src/client/components/segment-cache-impl/navigation.ts","webpack://next/./dist/src/client/components/segment-cache-impl/prefetch.ts","webpack://next/./dist/src/client/components/segment-cache-impl/scheduler.ts","webpack://next/./dist/src/client/components/segment-cache.ts","webpack://next/./dist/src/client/components/static-generation-bailout.ts","webpack://next/./dist/src/client/components/unstable-rethrow.server.ts","webpack://next/./dist/src/server/lib/router-utils/is-postpone.ts","webpack://next/./dist/src/client/components/use-action-queue.ts","webpack://next/./dist/src/client/flight-data-helpers.ts","webpack://next/./dist/src/client/route-params.ts","webpack://next/./dist/src/lib/constants.ts","webpack://next/./dist/src/lib/format-dynamic-import-path.ts","webpack://next/./dist/src/lib/framework/boundary-constants.tsx","webpack://next/./dist/src/server/api-utils/index.ts","webpack://next/./dist/src/server/api-utils/node/try-get-preview-data.ts","webpack://next/./dist/src/server/app-render/dynamic-rendering.ts","webpack://next/./dist/src/server/crypto-utils.ts","webpack://next/./dist/src/server/dynamic-rendering-utils.ts","webpack://next/./dist/src/server/lib/node-fs-methods.ts","webpack://next/./dist/src/server/lib/trace/constants.ts","webpack://next/./dist/src/server/route-modules/app-page/vendored/ssr/entrypoints.ts","webpack://next/./dist/src/server/web/spec-extension/adapters/headers.ts","webpack://next/./dist/src/server/web/spec-extension/adapters/reflect.ts","webpack://next/./dist/src/shared/lib/app-router-types.ts","webpack://next/./dist/src/shared/lib/head-manager-context.shared-runtime.ts","webpack://next/./dist/src/shared/lib/invariant-error.ts","webpack://next/./dist/src/shared/lib/is-thenable.ts","webpack://next/./dist/src/shared/lib/isomorphic/path.js","webpack://next/./dist/src/shared/lib/lazy-dynamic/bailout-to-csr.ts","webpack://next/./dist/src/shared/lib/modern-browserslist-target.js","webpack://next/./dist/src/shared/lib/promise-with-resolvers.ts","webpack://next/./dist/src/shared/lib/router/utils/add-path-prefix.ts","webpack://next/./dist/src/shared/lib/router/utils/cache-busting-search-param.ts","webpack://next/./dist/src/shared/lib/hash.ts","webpack://next/./dist/src/shared/lib/router/utils/html-bots.ts","webpack://next/./dist/src/shared/lib/router/utils/is-bot.ts","webpack://next/./dist/src/shared/lib/router/utils/parse-path.ts","webpack://next/./dist/src/shared/lib/router/utils/remove-trailing-slash.ts","webpack://next/./dist/src/shared/lib/segment-cache/output-export-prefetch-encoding.ts","webpack://next/./dist/src/shared/lib/segment-cache/segment-value-encoding.ts","webpack://next/./dist/src/shared/lib/segment.ts","webpack://next/./dist/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js","webpack://next/./dist/compiled/react-dom-experimental/react-dom.react-server.js","webpack://next/./dist/compiled/react-experimental/cjs/react-jsx-dev-runtime.react-server.production.js","webpack://next/./dist/compiled/react-experimental/cjs/react-jsx-runtime.react-server.production.js","webpack://next/./dist/compiled/react-experimental/cjs/react.react-server.production.js","webpack://next/./dist/compiled/react-experimental/jsx-dev-runtime.react-server.js","webpack://next/./dist/compiled/react-experimental/jsx-runtime.react-server.js","webpack://next/./dist/compiled/react-experimental/react.react-server.js","webpack://next/./dist/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.js","webpack://next/./dist/compiled/react-server-dom-webpack-experimental/server.node.js","webpack://next/./dist/compiled/react-server-dom-webpack-experimental/static.node.js","webpack://next/./dist/src/server/route-modules/app-page/vendored/rsc/entrypoints.ts","webpack://next/./dist/compiled/nanoid/index.cjs","webpack://next/./dist/compiled/superstruct/index.cjs","webpack://next/webpack/runtime/compat_get_default_export","webpack://next/webpack/runtime/create_fake_namespace_object","webpack://next/webpack/runtime/define_property_getters","webpack://next/webpack/runtime/ensure_chunk","webpack://next/webpack/runtime/has_own_property","webpack://next/webpack/runtime/make_namespace_object","webpack://next/./dist/src/server/route-modules/app-page/module.ts","webpack://next/./dist/src/lib/picocolors.ts","webpack://next/./dist/src/lib/detached-promise.ts","webpack://next/./dist/src/lib/scheduler.ts","webpack://next/./dist/src/server/stream-utils/encoded-tags.ts","webpack://next/./dist/src/server/stream-utils/uint8array-helpers.ts","webpack://next/./dist/src/server/stream-utils/node-web-streams-helper.ts","webpack://next/./dist/src/server/request-meta.ts","webpack://next/./dist/src/server/web/utils.ts","webpack://next/./dist/src/shared/lib/i18n/detect-domain-locale.ts","webpack://next/./dist/src/shared/lib/router/utils/add-path-suffix.ts","webpack://next/./dist/src/shared/lib/router/utils/path-has-prefix.ts","webpack://next/./dist/src/shared/lib/get-hostname.ts","webpack://next/./dist/src/shared/lib/i18n/normalize-locale-path.ts","webpack://next/./dist/src/shared/lib/router/utils/remove-path-prefix.ts","webpack://next/./dist/src/server/web/next-url.ts","webpack://next/./dist/src/shared/lib/router/utils/get-next-pathname-info.ts","webpack://next/./dist/src/shared/lib/router/utils/format-next-pathname-info.ts","webpack://next/./dist/src/shared/lib/router/utils/add-locale.ts","webpack://next/./dist/src/server/web/spec-extension/request.ts","webpack://next/./dist/src/server/web/spec-extension/adapters/next-request.ts","webpack://next/./dist/src/server/client-component-renderer-logger.ts","webpack://next/./dist/src/server/pipe-readable.ts","webpack://next/./dist/src/server/render-result.ts","webpack://next/./dist/src/server/internal-utils.ts","webpack://next/./dist/src/lib/metadata/metadata-context.tsx","webpack://next/./dist/src/server/web/spec-extension/adapters/request-cookies.ts","webpack://next/./dist/src/server/async-storage/draft-mode-provider.ts","webpack://next/./dist/src/server/async-storage/request-store.ts","webpack://next/./dist/src/server/lib/lru-cache.ts","webpack://next/./dist/src/server/lib/cache-handlers/default.ts","webpack://next/./dist/src/server/use-cache/handlers.ts","webpack://next/./dist/src/server/revalidation-utils.ts","webpack://next/./dist/src/server/app-render/async-local-storage.ts","webpack://next/./dist/src/server/after/after-context.ts","webpack://next/./dist/src/shared/lib/page-path/ensure-leading-slash.ts","webpack://next/./dist/src/shared/lib/router/utils/app-paths.ts","webpack://next/./dist/src/server/lib/lazy-result.ts","webpack://next/./dist/src/client/components/redirect.ts","webpack://next/./dist/src/server/lib/implicit-tags.ts","webpack://next/./dist/src/server/app-render/flight-render-result.ts","webpack://next/./dist/src/lib/format-server-error.ts","webpack://next/./dist/src/lib/is-error.ts","webpack://next/./dist/src/shared/lib/is-plain-object.ts","webpack://next/./dist/src/lib/error-telemetry-utils.ts","webpack://next/./dist/src/server/app-render/react-large-shell-error.ts","webpack://next/./dist/src/server/app-render/create-error-handler.tsx","webpack://next/./dist/src/server/app-render/get-short-dynamic-param-type.tsx","webpack://next/./dist/src/shared/lib/router/utils/interception-routes.ts","webpack://next/./dist/src/shared/lib/router/utils/get-segment-param.tsx","webpack://next/./dist/src/server/htmlescape.ts","webpack://next/./dist/src/server/app-render/types.ts","webpack://next/./dist/src/server/app-render/create-flight-router-state-from-loader-tree.ts","webpack://next/./dist/src/server/lib/server-ipc/utils.ts","webpack://next/./dist/src/server/lib/server-action-request-meta.ts","webpack://next/./dist/src/build/output/log.ts","webpack://next/./dist/src/server/app-render/action-utils.ts","webpack://next/./dist/src/server/app-render/action-handler.ts","webpack://next/./dist/src/server/app-render/csrf-protection.ts","webpack://next/./dist/src/shared/lib/server-inserted-html.shared-runtime.tsx","webpack://next/./dist/src/server/app-render/server-inserted-html.tsx","webpack://next/./dist/src/shared/lib/encode-uri-path.ts","webpack://next/./dist/src/server/app-render/required-scripts.tsx","webpack://next/./dist/src/server/app-render/make-get-server-inserted-html.tsx","webpack://next/./dist/src/server/app-render/get-css-inlined-link-tags.tsx","webpack://next/./dist/src/server/app-render/get-preloadable-fonts.tsx","webpack://next/./dist/src/server/app-render/has-loading-component-in-tree.tsx","webpack://next/./dist/src/lib/client-and-server-references.ts","webpack://next/./dist/src/shared/lib/server-reference-info.ts","webpack://next/./dist/src/server/lib/app-dir-module.ts","webpack://next/./dist/src/server/app-render/interop-default.ts","webpack://next/./dist/src/shared/lib/router/utils/parse-loader-tree.ts","webpack://next/./dist/src/server/app-render/get-asset-query-string.ts","webpack://next/./dist/src/server/app-render/render-css-resource.tsx","webpack://next/./dist/src/server/app-render/create-component-styles-and-scripts.tsx","webpack://next/./dist/src/server/lib/clone-response.ts","webpack://next/./dist/src/lib/batcher.ts","webpack://next/./dist/src/server/response-cache/types.ts","webpack://next/./dist/src/server/route-kind.ts","webpack://next/./dist/src/server/response-cache/utils.ts","webpack://next/./dist/src/server/response-cache/index.ts","webpack://next/./dist/src/server/lib/patch-fetch.ts","webpack://next/./dist/src/client/components/not-found.ts","webpack://next/./dist/src/server/app-render/segment-explorer-path.ts","webpack://next/./dist/src/server/app-render/create-component-tree.tsx","webpack://next/./dist/src/server/app-render/get-layer-assets.tsx","webpack://next/./dist/src/server/app-render/walk-tree-with-flight-router-state.tsx","webpack://next/./dist/src/server/app-render/encryption-utils.ts","webpack://next/./dist/src/shared/lib/router/utils/get-dynamic-param.ts","webpack://next/./dist/src/server/resume-data-cache/cache-store.ts","webpack://next/./dist/src/server/use-cache/constants.ts","webpack://next/./dist/src/server/resume-data-cache/resume-data-cache.ts","webpack://next/./dist/src/server/app-render/postponed-state.ts","webpack://next/./dist/src/server/app-render/use-flight-response.tsx","webpack://next/./dist/src/shared/lib/utils.ts","webpack://next/./dist/src/shared/lib/router/utils/querystring.ts","webpack://next/./dist/src/shared/lib/router/utils/parse-relative-url.ts","webpack://next/./dist/src/shared/lib/app-router-context.shared-runtime.ts","webpack://next/./dist/src/shared/lib/hooks-client-context.shared-runtime.ts","webpack://next/./dist/src/client/components/app-router-announcer.tsx","webpack://next/./dist/src/client/components/navigation.ts","webpack://next/./dist/src/client/components/redirect-boundary.tsx","webpack://next/./dist/src/client/components/forbidden.ts","webpack://next/./dist/src/client/components/unauthorized.ts","webpack://next/./dist/src/client/components/unstable-rethrow.ts","webpack://next/./dist/src/client/components/unresolved-thenable.ts","webpack://next/./dist/src/client/has-base-path.ts","webpack://next/./dist/src/client/remove-base-path.ts","webpack://next/./dist/src/client/components/app-router-instance.ts","webpack://next/./dist/src/client/components/errors/graceful-degrade-boundary.tsx","webpack://next/./dist/src/client/components/handle-isr-error.tsx","webpack://next/./dist/src/client/components/error-boundary.tsx","webpack://next/./dist/src/client/components/navigation-untracked.ts","webpack://next/./dist/src/client/components/errors/root-error-boundary.tsx","webpack://next/./dist/src/client/components/builtin/global-error.tsx","webpack://next/./dist/src/lib/framework/boundary-components.tsx","webpack://next/./dist/src/client/components/app-router.tsx","webpack://next/./dist/src/client/components/router-reducer/reducers/find-head-in-cache.ts","webpack://next/./dist/src/client/components/router-reducer/compute-changed-path.ts","webpack://next/./dist/src/client/components/nav-failure-handler.ts","webpack://next/./dist/src/client/components/router-reducer/create-initial-router-state.ts","webpack://next/./dist/src/client/components/router-reducer/refetch-inactive-parallel-segments.ts","webpack://next/./dist/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts","webpack://next/./dist/src/server/app-render/app-render-prerender-utils.ts","webpack://next/./dist/src/server/app-render/prospective-render-utils.ts","webpack://next/./dist/src/server/app-render/cache-signal.ts","webpack://next/./dist/src/server/lib/trace/utils.ts","webpack://next/./dist/src/server/app-render/metadata-insertion/create-server-inserted-metadata.tsx","webpack://next/./dist/src/shared/lib/escape-regexp.ts","webpack://next/./dist/src/shared/lib/router/utils/route-regex.ts","webpack://next/./dist/src/lib/route-pattern-normalizer.ts","webpack://next/./dist/src/shared/lib/router/utils/route-match-utils.ts","webpack://next/./dist/src/shared/lib/router/utils/route-matcher.ts","webpack://next/./dist/src/shared/lib/router/utils/prepare-destination.ts","webpack://next/./dist/src/server/lib/decode-query-path-parameter.ts","webpack://next/./dist/src/lib/url.ts","webpack://next/./dist/src/shared/lib/router/utils/format-url.ts","webpack://next/./dist/src/server/server-utils.ts","webpack://next/./dist/src/shared/lib/image-config.ts","webpack://next/./dist/src/shared/lib/image-config-context.shared-runtime.ts","webpack://next/./dist/src/server/app-render/app-render.tsx","webpack://next/./dist/src/server/instrumentation/utils.ts","webpack://next/./dist/src/server/app-render/parse-and-validate-flight-router-state.tsx","webpack://next/./dist/src/server/app-render/get-script-nonce-from-header.tsx","webpack://next/./dist/src/server/async-storage/work-store.ts","webpack://next/./dist/src/shared/lib/constants.ts","webpack://next/./dist/src/shared/lib/router/utils/is-dynamic.ts","webpack://next/./dist/src/shared/lib/page-path/normalize-data-path.ts","webpack://next/./dist/src/shared/lib/page-path/normalize-page-path.ts","webpack://next/./dist/src/lib/metadata/is-metadata-route.ts","webpack://next/./dist/src/lib/multi-file-writer.ts","webpack://next/./dist/src/server/lib/incremental-cache/file-system-cache.ts","webpack://next/./dist/src/server/lib/to-route.ts","webpack://next/./dist/src/server/lib/incremental-cache/index.ts","webpack://next/./dist/src/server/lib/router-utils/router-server-context.ts","webpack://next/./dist/src/lib/generate-interception-routes-rewrites.ts","webpack://next/./dist/src/server/route-modules/route-module.ts","webpack://next/./dist/src/lib/is-app-route-route.ts","webpack://next/./dist/src/shared/lib/page-path/normalize-path-sep.ts","webpack://next/./dist/src/shared/lib/router/utils/path-match.ts","webpack://next/./dist/src/server/api-utils/get-cookie-parser.ts","webpack://next/./dist/src/shared/lib/router/utils/parse-url.ts","webpack://next/./dist/src/server/lib/router-utils/decode-path-params.ts","webpack://next/./dist/src/shared/lib/router/utils/escape-path-delimiters.ts","webpack://next/./dist/src/shared/lib/router-context.shared-runtime.ts","webpack://next/./dist/src/server/route-modules/app-page/helpers/prerender-manifest-matcher.ts"],"sourcesContent":["const ERROR_MESSAGE =\n 'Internal Error: do not use legacy react-dom/server APIs. If you encountered this error, please open an issue on the Next.js repo.'\n\nfunction error() {\n throw new Error(ERROR_MESSAGE)\n}\n\nvar b\nif (process.env.NEXT_RUNTIME === 'nodejs') {\n if (process.env.NODE_ENV === 'production') {\n b = require('next/dist/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js')\n } else {\n b = require('next/dist/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js')\n }\n} else {\n if (process.env.NODE_ENV === 'production') {\n b = require('next/dist/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js')\n } else {\n b = require('next/dist/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js')\n }\n}\n\nexports.version = b.version\nexports.renderToReadableStream = b.renderToReadableStream\nexports.renderToString = error\nexports.renderToStaticMarkup = error\nif (b.resume) {\n exports.resume = b.resume\n}\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]) => [\n key.toLowerCase().replace(/-/g, \"\"),\n value2\n ])\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, options] = typeof args[0] === \"string\" ? [args[0]] : [args[0].name, args[0]];\n return this.set({ ...options, name, 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","(function(){\"use strict\";var e={900:function(e,t,i){const{parseContentType:s}=i(318);function getInstance(e){const t=e.headers;const i=s(t[\"content-type\"]);if(!i)throw new Error(\"Malformed content type\");for(const s of r){const r=s.detect(i);if(!r)continue;const n={limits:e.limits,headers:t,conType:i,highWaterMark:undefined,fileHwm:undefined,defCharset:undefined,defParamCharset:undefined,preservePath:false};if(e.highWaterMark)n.highWaterMark=e.highWaterMark;if(e.fileHwm)n.fileHwm=e.fileHwm;n.defCharset=e.defCharset;n.defParamCharset=e.defParamCharset;n.preservePath=e.preservePath;return new s(n)}throw new Error(`Unsupported content type: ${t[\"content-type\"]}`)}const r=[i(104),i(506)].filter((function(e){return typeof e.detect===\"function\"}));e.exports=e=>{if(typeof e!==\"object\"||e===null)e={};if(typeof e.headers!==\"object\"||e.headers===null||typeof e.headers[\"content-type\"]!==\"string\"){throw new Error(\"Missing Content-Type\")}return getInstance(e)}},104:function(e,t,i){const{Readable:s,Writable:r}=i(781);const n=i(542);const{basename:a,convertToUTF8:o,getDecoder:f,parseContentType:l,parseDisposition:c}=i(318);const h=Buffer.from(\"\\r\\n\");const u=Buffer.from(\"\\r\");const d=Buffer.from(\"-\");function noop(){}const _=2e3;const b=16*1024;const p=0;const y=1;const m=2;class HeaderParser{constructor(e){this.header=Object.create(null);this.pairCount=0;this.byteCount=0;this.state=p;this.name=\"\";this.value=\"\";this.crlf=0;this.cb=e}reset(){this.header=Object.create(null);this.pairCount=0;this.byteCount=0;this.state=p;this.name=\"\";this.value=\"\";this.crlf=0}push(e,t,i){let s=t;while(t<i){switch(this.state){case p:{let r=false;for(;t<i;++t){if(this.byteCount===b)return-1;++this.byteCount;const i=e[t];if(g[i]!==1){if(i!==58)return-1;this.name+=e.latin1Slice(s,t);if(this.name.length===0)return-1;++t;r=true;this.state=y;break}}if(!r){this.name+=e.latin1Slice(s,t);break}}case y:{let r=false;for(;t<i;++t){if(this.byteCount===b)return-1;++this.byteCount;const i=e[t];if(i!==32&&i!==9){s=t;r=true;this.state=m;break}}if(!r)break}case m:switch(this.crlf){case 0:for(;t<i;++t){if(this.byteCount===b)return-1;++this.byteCount;const i=e[t];if(w[i]!==1){if(i!==13)return-1;++this.crlf;break}}this.value+=e.latin1Slice(s,t++);break;case 1:if(this.byteCount===b)return-1;++this.byteCount;if(e[t++]!==10)return-1;++this.crlf;break;case 2:{if(this.byteCount===b)return-1;++this.byteCount;const i=e[t];if(i===32||i===9){s=t;this.crlf=0}else{if(++this.pairCount<_){this.name=this.name.toLowerCase();if(this.header[this.name]===undefined)this.header[this.name]=[this.value];else this.header[this.name].push(this.value)}if(i===13){++this.crlf;++t}else{s=t;this.crlf=0;this.state=p;this.name=\"\";this.value=\"\"}}break}case 3:{if(this.byteCount===b)return-1;++this.byteCount;if(e[t++]!==10)return-1;const i=this.header;this.reset();this.cb(i);return t}}break}}return t}}class FileStream extends s{constructor(e,t){super(e);this.truncated=false;this._readcb=null;this.once(\"end\",(()=>{this._read();if(--t._fileEndsLeft===0&&t._finalcb){const e=t._finalcb;t._finalcb=null;process.nextTick(e)}}))}_read(e){const t=this._readcb;if(t){this._readcb=null;t()}}}const k={push:(e,t)=>{},destroy:()=>{}};function callAndUnsetCb(e,t){const i=e._writecb;e._writecb=null;if(t)e.destroy(t);else if(i)i()}function nullDecoder(e,t){return e}class Multipart extends r{constructor(e){const t={autoDestroy:true,emitClose:true,highWaterMark:typeof e.highWaterMark===\"number\"?e.highWaterMark:undefined};super(t);if(!e.conType.params||typeof e.conType.params.boundary!==\"string\")throw new Error(\"Multipart: Boundary not found\");const i=e.conType.params.boundary;const s=typeof e.defParamCharset===\"string\"&&e.defParamCharset?f(e.defParamCharset):nullDecoder;const r=e.defCharset||\"utf8\";const _=e.preservePath;const b={autoDestroy:true,emitClose:true,highWaterMark:typeof e.fileHwm===\"number\"?e.fileHwm:undefined};const p=e.limits;const y=p&&typeof p.fieldSize===\"number\"?p.fieldSize:1*1024*1024;const m=p&&typeof p.fileSize===\"number\"?p.fileSize:Infinity;const g=p&&typeof p.files===\"number\"?p.files:Infinity;const w=p&&typeof p.fields===\"number\"?p.fields:Infinity;const C=p&&typeof p.parts===\"number\"?p.parts:Infinity;let S=-1;let P=0;let T=0;let v=false;this._fileEndsLeft=0;this._fileStream=undefined;this._complete=false;let x=0;let z;let B=0;let E;let M;let L;let A;let K=false;let D=false;let U=false;this._hparser=null;const V=new HeaderParser((e=>{this._hparser=null;v=false;L=\"text/plain\";E=r;M=\"7bit\";A=undefined;K=false;let t;if(!e[\"content-disposition\"]){v=true;return}const i=c(e[\"content-disposition\"][0],s);if(!i||i.type!==\"form-data\"){v=true;return}if(i.params){if(i.params.name)A=i.params.name;if(i.params[\"filename*\"])t=i.params[\"filename*\"];else if(i.params.filename)t=i.params.filename;if(t!==undefined&&!_)t=a(t)}if(e[\"content-type\"]){const t=l(e[\"content-type\"][0]);if(t){L=`${t.type}/${t.subtype}`;if(t.params&&typeof t.params.charset===\"string\")E=t.params.charset.toLowerCase()}}if(e[\"content-transfer-encoding\"])M=e[\"content-transfer-encoding\"][0].toLowerCase();if(L===\"application/octet-stream\"||t!==undefined){if(T===g){if(!D){D=true;this.emit(\"filesLimit\")}v=true;return}++T;if(this.listenerCount(\"file\")===0){v=true;return}x=0;this._fileStream=new FileStream(b,this);++this._fileEndsLeft;this.emit(\"file\",A,this._fileStream,{filename:t,encoding:M,mimeType:L})}else{if(P===w){if(!U){U=true;this.emit(\"fieldsLimit\")}v=true;return}++P;if(this.listenerCount(\"field\")===0){v=true;return}z=[];B=0}}));let W=0;const ssCb=(e,t,i,s,r)=>{e:while(t){if(this._hparser!==null){const e=this._hparser.push(t,i,s);if(e===-1){this._hparser=null;V.reset();this.emit(\"error\",new Error(\"Malformed part header\"));break}i=e}if(i===s)break;if(W!==0){if(W===1){switch(t[i]){case 45:W=2;++i;break;case 13:W=3;++i;break;default:W=0}if(i===s)return}if(W===2){W=0;if(t[i]===45){this._complete=true;this._bparser=k;return}const e=this._writecb;this._writecb=noop;ssCb(false,d,0,1,false);this._writecb=e}else if(W===3){W=0;if(t[i]===10){++i;if(S>=C)break;this._hparser=V;if(i===s)break;continue e}else{const e=this._writecb;this._writecb=noop;ssCb(false,u,0,1,false);this._writecb=e}}}if(!v){if(this._fileStream){let e;const n=Math.min(s-i,m-x);if(!r){e=Buffer.allocUnsafe(n);t.copy(e,0,i,i+n)}else{e=t.slice(i,i+n)}x+=e.length;if(x===m){if(e.length>0)this._fileStream.push(e);this._fileStream.emit(\"limit\");this._fileStream.truncated=true;v=true}else if(!this._fileStream.push(e)){if(this._writecb)this._fileStream._readcb=this._writecb;this._writecb=null}}else if(z!==undefined){let e;const n=Math.min(s-i,y-B);if(!r){e=Buffer.allocUnsafe(n);t.copy(e,0,i,i+n)}else{e=t.slice(i,i+n)}B+=n;z.push(e);if(B===y){v=true;K=true}}}break}if(e){W=1;if(this._fileStream){this._fileStream.push(null);this._fileStream=null}else if(z!==undefined){let e;switch(z.length){case 0:e=\"\";break;case 1:e=o(z[0],E,0);break;default:e=o(Buffer.concat(z,B),E,0)}z=undefined;B=0;this.emit(\"field\",A,e,{nameTruncated:false,valueTruncated:K,encoding:M,mimeType:L})}if(++S===C)this.emit(\"partsLimit\")}};this._bparser=new n(`\\r\\n--${i}`,ssCb);this._writecb=null;this._finalcb=null;this.write(h)}static detect(e){return e.type===\"multipart\"&&e.subtype===\"form-data\"}_write(e,t,i){this._writecb=i;this._bparser.push(e,0);if(this._writecb)callAndUnsetCb(this)}_destroy(e,t){this._hparser=null;this._bparser=k;if(!e)e=checkEndState(this);const i=this._fileStream;if(i){this._fileStream=null;i.destroy(e)}t(e)}_final(e){this._bparser.destroy();if(!this._complete)return e(new Error(\"Unexpected end of form\"));if(this._fileEndsLeft)this._finalcb=finalcb.bind(null,this,e);else finalcb(this,e)}}function finalcb(e,t,i){if(i)return t(i);i=checkEndState(e);t(i)}function checkEndState(e){if(e._hparser)return new Error(\"Malformed part header\");const t=e._fileStream;if(t){e._fileStream=null;t.destroy(new Error(\"Unexpected end of file\"))}if(!e._complete)return new Error(\"Unexpected end of form\")}const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];const w=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];e.exports=Multipart},506:function(e,t,i){const{Writable:s}=i(781);const{getDecoder:r}=i(318);class URLEncoded extends s{constructor(e){const t={autoDestroy:true,emitClose:true,highWaterMark:typeof e.highWaterMark===\"number\"?e.highWaterMark:undefined};super(t);let i=e.defCharset||\"utf8\";if(e.conType.params&&typeof e.conType.params.charset===\"string\")i=e.conType.params.charset;this.charset=i;const s=e.limits;this.fieldSizeLimit=s&&typeof s.fieldSize===\"number\"?s.fieldSize:1*1024*1024;this.fieldsLimit=s&&typeof s.fields===\"number\"?s.fields:Infinity;this.fieldNameSizeLimit=s&&typeof s.fieldNameSize===\"number\"?s.fieldNameSize:100;this._inKey=true;this._keyTrunc=false;this._valTrunc=false;this._bytesKey=0;this._bytesVal=0;this._fields=0;this._key=\"\";this._val=\"\";this._byte=-2;this._lastPos=0;this._encode=0;this._decoder=r(i)}static detect(e){return e.type===\"application\"&&e.subtype===\"x-www-form-urlencoded\"}_write(e,t,i){if(this._fields>=this.fieldsLimit)return i();let s=0;const r=e.length;this._lastPos=0;if(this._byte!==-2){s=readPctEnc(this,e,s,r);if(s===-1)return i(new Error(\"Malformed urlencoded form\"));if(s>=r)return i();if(this._inKey)++this._bytesKey;else++this._bytesVal}e:while(s<r){if(this._inKey){s=skipKeyBytes(this,e,s,r);while(s<r){switch(e[s]){case 61:if(this._lastPos<s)this._key+=e.latin1Slice(this._lastPos,s);this._lastPos=++s;this._key=this._decoder(this._key,this._encode);this._encode=0;this._inKey=false;continue e;case 38:if(this._lastPos<s)this._key+=e.latin1Slice(this._lastPos,s);this._lastPos=++s;this._key=this._decoder(this._key,this._encode);this._encode=0;if(this._bytesKey>0){this.emit(\"field\",this._key,\"\",{nameTruncated:this._keyTrunc,valueTruncated:false,encoding:this.charset,mimeType:\"text/plain\"})}this._key=\"\";this._val=\"\";this._keyTrunc=false;this._valTrunc=false;this._bytesKey=0;this._bytesVal=0;if(++this._fields>=this.fieldsLimit){this.emit(\"fieldsLimit\");return i()}continue;case 43:if(this._lastPos<s)this._key+=e.latin1Slice(this._lastPos,s);this._key+=\" \";this._lastPos=s+1;break;case 37:if(this._encode===0)this._encode=1;if(this._lastPos<s)this._key+=e.latin1Slice(this._lastPos,s);this._lastPos=s+1;this._byte=-1;s=readPctEnc(this,e,s+1,r);if(s===-1)return i(new Error(\"Malformed urlencoded form\"));if(s>=r)return i();++this._bytesKey;s=skipKeyBytes(this,e,s,r);continue}++s;++this._bytesKey;s=skipKeyBytes(this,e,s,r)}if(this._lastPos<s)this._key+=e.latin1Slice(this._lastPos,s)}else{s=skipValBytes(this,e,s,r);while(s<r){switch(e[s]){case 38:if(this._lastPos<s)this._val+=e.latin1Slice(this._lastPos,s);this._lastPos=++s;this._inKey=true;this._val=this._decoder(this._val,this._encode);this._encode=0;if(this._bytesKey>0||this._bytesVal>0){this.emit(\"field\",this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:\"text/plain\"})}this._key=\"\";this._val=\"\";this._keyTrunc=false;this._valTrunc=false;this._bytesKey=0;this._bytesVal=0;if(++this._fields>=this.fieldsLimit){this.emit(\"fieldsLimit\");return i()}continue e;case 43:if(this._lastPos<s)this._val+=e.latin1Slice(this._lastPos,s);this._val+=\" \";this._lastPos=s+1;break;case 37:if(this._encode===0)this._encode=1;if(this._lastPos<s)this._val+=e.latin1Slice(this._lastPos,s);this._lastPos=s+1;this._byte=-1;s=readPctEnc(this,e,s+1,r);if(s===-1)return i(new Error(\"Malformed urlencoded form\"));if(s>=r)return i();++this._bytesVal;s=skipValBytes(this,e,s,r);continue}++s;++this._bytesVal;s=skipValBytes(this,e,s,r)}if(this._lastPos<s)this._val+=e.latin1Slice(this._lastPos,s)}}i()}_final(e){if(this._byte!==-2)return e(new Error(\"Malformed urlencoded form\"));if(!this._inKey||this._bytesKey>0||this._bytesVal>0){if(this._inKey)this._key=this._decoder(this._key,this._encode);else this._val=this._decoder(this._val,this._encode);this.emit(\"field\",this._key,this._val,{nameTruncated:this._keyTrunc,valueTruncated:this._valTrunc,encoding:this.charset,mimeType:\"text/plain\"})}e()}}function readPctEnc(e,t,i,s){if(i>=s)return s;if(e._byte===-1){const r=n[t[i++]];if(r===-1)return-1;if(r>=8)e._encode=2;if(i<s){const s=n[t[i++]];if(s===-1)return-1;if(e._inKey)e._key+=String.fromCharCode((r<<4)+s);else e._val+=String.fromCharCode((r<<4)+s);e._byte=-2;e._lastPos=i}else{e._byte=r}}else{const s=n[t[i++]];if(s===-1)return-1;if(e._inKey)e._key+=String.fromCharCode((e._byte<<4)+s);else e._val+=String.fromCharCode((e._byte<<4)+s);e._byte=-2;e._lastPos=i}return i}function skipKeyBytes(e,t,i,s){if(e._bytesKey>e.fieldNameSizeLimit){if(!e._keyTrunc){if(e._lastPos<i)e._key+=t.latin1Slice(e._lastPos,i-1)}e._keyTrunc=true;for(;i<s;++i){const s=t[i];if(s===61||s===38)break;++e._bytesKey}e._lastPos=i}return i}function skipValBytes(e,t,i,s){if(e._bytesVal>e.fieldSizeLimit){if(!e._valTrunc){if(e._lastPos<i)e._val+=t.latin1Slice(e._lastPos,i-1)}e._valTrunc=true;for(;i<s;++i){if(t[i]===38)break;++e._bytesVal}e._lastPos=i}return i}const n=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];e.exports=URLEncoded},318:function(e){function parseContentType(e){if(e.length===0)return;const t=Object.create(null);let s=0;for(;s<e.length;++s){const t=e.charCodeAt(s);if(i[t]!==1){if(t!==47||s===0)return;break}}if(s===e.length)return;const r=e.slice(0,s).toLowerCase();const n=++s;for(;s<e.length;++s){const r=e.charCodeAt(s);if(i[r]!==1){if(s===n)return;if(parseContentTypeParams(e,s,t)===undefined)return;break}}if(s===n)return;const a=e.slice(n,s).toLowerCase();return{type:r,subtype:a,params:t}}function parseContentTypeParams(e,t,r){while(t<e.length){for(;t<e.length;++t){const i=e.charCodeAt(t);if(i!==32&&i!==9)break}if(t===e.length)break;if(e.charCodeAt(t++)!==59)return;for(;t<e.length;++t){const i=e.charCodeAt(t);if(i!==32&&i!==9)break}if(t===e.length)return;let n;const a=t;for(;t<e.length;++t){const s=e.charCodeAt(t);if(i[s]!==1){if(s!==61)return;break}}if(t===e.length)return;n=e.slice(a,t);++t;if(t===e.length)return;let o=\"\";let f;if(e.charCodeAt(t)===34){f=++t;let i=false;for(;t<e.length;++t){const r=e.charCodeAt(t);if(r===92){if(i){f=t;i=false}else{o+=e.slice(f,t);i=true}continue}if(r===34){if(i){f=t;i=false;continue}o+=e.slice(f,t);break}if(i){f=t-1;i=false}if(s[r]!==1)return}if(t===e.length)return;++t}else{f=t;for(;t<e.length;++t){const s=e.charCodeAt(t);if(i[s]!==1){if(t===f)return;break}}o=e.slice(f,t)}n=n.toLowerCase();if(r[n]===undefined)r[n]=o}return r}function parseDisposition(e,t){if(e.length===0)return;const s=Object.create(null);let r=0;for(;r<e.length;++r){const n=e.charCodeAt(r);if(i[n]!==1){if(parseDispositionParams(e,r,s,t)===undefined)return;break}}const n=e.slice(0,r).toLowerCase();return{type:n,params:s}}function parseDispositionParams(e,t,o,f){while(t<e.length){for(;t<e.length;++t){const i=e.charCodeAt(t);if(i!==32&&i!==9)break}if(t===e.length)break;if(e.charCodeAt(t++)!==59)return;for(;t<e.length;++t){const i=e.charCodeAt(t);if(i!==32&&i!==9)break}if(t===e.length)return;let l;const c=t;for(;t<e.length;++t){const s=e.charCodeAt(t);if(i[s]!==1){if(s===61)break;return}}if(t===e.length)return;let h=\"\";let u;let d;l=e.slice(c,t);if(l.charCodeAt(l.length-1)===42){const i=++t;for(;t<e.length;++t){const i=e.charCodeAt(t);if(r[i]!==1){if(i!==39)return;break}}if(t===e.length)return;d=e.slice(i,t);++t;for(;t<e.length;++t){const i=e.charCodeAt(t);if(i===39)break}if(t===e.length)return;++t;if(t===e.length)return;u=t;let s=0;for(;t<e.length;++t){const i=e.charCodeAt(t);if(n[i]!==1){if(i===37){let i;let r;if(t+2<e.length&&(i=a[e.charCodeAt(t+1)])!==-1&&(r=a[e.charCodeAt(t+2)])!==-1){const n=(i<<4)+r;h+=e.slice(u,t);h+=String.fromCharCode(n);t+=2;u=t+1;if(n>=128)s=2;else if(s===0)s=1;continue}return}break}}h+=e.slice(u,t);h=convertToUTF8(h,d,s);if(h===undefined)return}else{++t;if(t===e.length)return;if(e.charCodeAt(t)===34){u=++t;let i=false;for(;t<e.length;++t){const r=e.charCodeAt(t);if(r===92){if(i){u=t;i=false}else{h+=e.slice(u,t);i=true}continue}if(r===34){if(i){u=t;i=false;continue}h+=e.slice(u,t);break}if(i){u=t-1;i=false}if(s[r]!==1)return}if(t===e.length)return;++t}else{u=t;for(;t<e.length;++t){const s=e.charCodeAt(t);if(i[s]!==1){if(t===u)return;break}}h=e.slice(u,t)}h=f(h,2);if(h===undefined)return}l=l.toLowerCase();if(o[l]===undefined)o[l]=h}return o}function getDecoder(e){let i;while(true){switch(e){case\"utf-8\":case\"utf8\":return t.utf8;case\"latin1\":case\"ascii\":case\"us-ascii\":case\"iso-8859-1\":case\"iso8859-1\":case\"iso88591\":case\"iso_8859-1\":case\"windows-1252\":case\"iso_8859-1:1987\":case\"cp1252\":case\"x-cp1252\":return t.latin1;case\"utf16le\":case\"utf-16le\":case\"ucs2\":case\"ucs-2\":return t.utf16le;case\"base64\":return t.base64;default:if(i===undefined){i=true;e=e.toLowerCase();continue}return t.other.bind(e)}}}const t={utf8:(e,t)=>{if(e.length===0)return\"\";if(typeof e===\"string\"){if(t<2)return e;e=Buffer.from(e,\"latin1\")}return e.utf8Slice(0,e.length)},latin1:(e,t)=>{if(e.length===0)return\"\";if(typeof e===\"string\")return e;return e.latin1Slice(0,e.length)},utf16le:(e,t)=>{if(e.length===0)return\"\";if(typeof e===\"string\")e=Buffer.from(e,\"latin1\");return e.ucs2Slice(0,e.length)},base64:(e,t)=>{if(e.length===0)return\"\";if(typeof e===\"string\")e=Buffer.from(e,\"latin1\");return e.base64Slice(0,e.length)},other:(e,t)=>{if(e.length===0)return\"\";if(typeof e===\"string\")e=Buffer.from(e,\"latin1\");try{const t=new TextDecoder(this);return t.decode(e)}catch{}}};function convertToUTF8(e,t,i){const s=getDecoder(t);if(s)return s(e,i)}function basename(e){if(typeof e!==\"string\")return\"\";for(let t=e.length-1;t>=0;--t){switch(e.charCodeAt(t)){case 47:case 92:e=e.slice(t+1);return e===\"..\"||e===\".\"?\"\":e}}return e===\"..\"||e===\".\"?\"\":e}const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];e.exports={basename:basename,convertToUTF8:convertToUTF8,getDecoder:getDecoder,parseContentType:parseContentType,parseDisposition:parseDisposition}},542:function(e){function memcmp(e,t,i,s,r){for(let n=0;n<r;++n){if(e[t+n]!==i[s+n])return false}return true}class SBMH{constructor(e,t){if(typeof t!==\"function\")throw new Error(\"Missing match callback\");if(typeof e===\"string\")e=Buffer.from(e);else if(!Buffer.isBuffer(e))throw new Error(`Expected Buffer for needle, got ${typeof e}`);const i=e.length;this.maxMatches=Infinity;this.matches=0;this._cb=t;this._lookbehindSize=0;this._needle=e;this._bufPos=0;this._lookbehind=Buffer.allocUnsafe(i);this._occ=[i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i];if(i>1){for(let t=0;t<i-1;++t)this._occ[e[t]]=i-1-t}}reset(){this.matches=0;this._lookbehindSize=0;this._bufPos=0}push(e,t){let i;if(!Buffer.isBuffer(e))e=Buffer.from(e,\"latin1\");const s=e.length;this._bufPos=t||0;while(i!==s&&this.matches<this.maxMatches)i=feed(this,e);return i}destroy(){const e=this._lookbehindSize;if(e)this._cb(false,this._lookbehind,0,e,false);this.reset()}}function feed(e,t){const i=t.length;const s=e._needle;const r=s.length;let n=-e._lookbehindSize;const a=r-1;const o=s[a];const f=i-r;const l=e._occ;const c=e._lookbehind;if(n<0){while(n<0&&n<=f){const i=n+a;const s=i<0?c[e._lookbehindSize+i]:t[i];if(s===o&&matchNeedle(e,t,n,a)){e._lookbehindSize=0;++e.matches;if(n>-e._lookbehindSize)e._cb(true,c,0,e._lookbehindSize+n,false);else e._cb(true,undefined,0,0,true);return e._bufPos=n+r}n+=l[s]}while(n<0&&!matchNeedle(e,t,n,i-n))++n;if(n<0){const s=e._lookbehindSize+n;if(s>0){e._cb(false,c,0,s,false)}e._lookbehindSize-=s;c.copy(c,0,s,e._lookbehindSize);c.set(t,e._lookbehindSize);e._lookbehindSize+=i;e._bufPos=i;return i}e._cb(false,c,0,e._lookbehindSize,false);e._lookbehindSize=0}n+=e._bufPos;const h=s[0];while(n<=f){const i=t[n+a];if(i===o&&t[n]===h&&memcmp(s,0,t,n,a)){++e.matches;if(n>0)e._cb(true,t,e._bufPos,n,true);else e._cb(true,undefined,0,0,true);return e._bufPos=n+r}n+=l[i]}while(n<i){if(t[n]!==h||!memcmp(t,n,s,0,i-n)){++n;continue}t.copy(c,0,n,i);e._lookbehindSize=i-n;break}if(n>0)e._cb(false,t,e._bufPos,n<i?n:i,true);e._bufPos=i;return i}function matchNeedle(e,t,i,s){const r=e._lookbehind;const n=e._lookbehindSize;const a=e._needle;for(let e=0;e<s;++e,++i){const s=i<0?r[n+i]:t[i];if(s!==a[e])return false}return true}e.exports=SBMH},781:function(e){e.exports=require(\"stream\")}};var t={};function __nccwpck_require__(i){var s=t[i];if(s!==undefined){return s.exports}var r=t[i]={exports:{}};var n=true;try{e[i].call(r.exports,r,r.exports,__nccwpck_require__);n=false}finally{if(n)delete t[i]}return r.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var i=__nccwpck_require__(900);module.exports=i})();","(()=>{\"use strict\";var e={56:e=>{\n/*!\n * bytes\n * Copyright(c) 2012-2014 TJ Holowaychuk\n * Copyright(c) 2015 Jed Watson\n * MIT Licensed\n */\ne.exports=bytes;e.exports.format=format;e.exports.parse=parse;var r=/\\B(?=(\\d{3})+(?!\\d))/g;var a=/(?:\\.0*|(\\.[^0]+)0+)$/;var t={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)};var i=/^((-|\\+)?(\\d+(?:\\.\\d+)?)) *(kb|mb|gb|tb|pb)$/i;function bytes(e,r){if(typeof e===\"string\"){return parse(e)}if(typeof e===\"number\"){return format(e,r)}return null}function format(e,i){if(!Number.isFinite(e)){return null}var n=Math.abs(e);var o=i&&i.thousandsSeparator||\"\";var s=i&&i.unitSeparator||\"\";var f=i&&i.decimalPlaces!==undefined?i.decimalPlaces:2;var u=Boolean(i&&i.fixedDecimals);var p=i&&i.unit||\"\";if(!p||!t[p.toLowerCase()]){if(n>=t.pb){p=\"PB\"}else if(n>=t.tb){p=\"TB\"}else if(n>=t.gb){p=\"GB\"}else if(n>=t.mb){p=\"MB\"}else if(n>=t.kb){p=\"KB\"}else{p=\"B\"}}var b=e/t[p.toLowerCase()];var l=b.toFixed(f);if(!u){l=l.replace(a,\"$1\")}if(o){l=l.split(\".\").map((function(e,a){return a===0?e.replace(r,o):e})).join(\".\")}return l+s+p}function parse(e){if(typeof e===\"number\"&&!isNaN(e)){return e}if(typeof e!==\"string\"){return null}var r=i.exec(e);var a;var n=\"b\";if(!r){a=parseInt(e,10);n=\"b\"}else{a=parseFloat(r[1]);n=r[4].toLowerCase()}return Math.floor(t[n]*a)}}};var r={};function __nccwpck_require__(a){var t=r[a];if(t!==undefined){return t.exports}var i=r[a]={exports:{}};var n=true;try{e[a](i,i.exports,__nccwpck_require__);n=false}finally{if(n)delete r[a]}return i.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var a=__nccwpck_require__(56);module.exports=a})();","(()=>{\"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={993:e=>{var t=Object.prototype.hasOwnProperty,n=\"~\";function Events(){}if(Object.create){Events.prototype=Object.create(null);if(!(new Events).__proto__)n=false}function EE(e,t,n){this.fn=e;this.context=t;this.once=n||false}function addListener(e,t,r,i,s){if(typeof r!==\"function\"){throw new TypeError(\"The listener must be a function\")}var o=new EE(r,i||e,s),u=n?n+t:t;if(!e._events[u])e._events[u]=o,e._eventsCount++;else if(!e._events[u].fn)e._events[u].push(o);else e._events[u]=[e._events[u],o];return e}function clearEvent(e,t){if(--e._eventsCount===0)e._events=new Events;else delete e._events[t]}function EventEmitter(){this._events=new Events;this._eventsCount=0}EventEmitter.prototype.eventNames=function eventNames(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events){if(t.call(r,i))e.push(n?i.slice(1):i)}if(Object.getOwnPropertySymbols){return e.concat(Object.getOwnPropertySymbols(r))}return e};EventEmitter.prototype.listeners=function listeners(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,o=new Array(s);i<s;i++){o[i]=r[i].fn}return o};EventEmitter.prototype.listenerCount=function listenerCount(e){var t=n?n+e:e,r=this._events[t];if(!r)return 0;if(r.fn)return 1;return r.length};EventEmitter.prototype.emit=function emit(e,t,r,i,s,o){var u=n?n+e:e;if(!this._events[u])return false;var a=this._events[u],l=arguments.length,c,h;if(a.fn){if(a.once)this.removeListener(e,a.fn,undefined,true);switch(l){case 1:return a.fn.call(a.context),true;case 2:return a.fn.call(a.context,t),true;case 3:return a.fn.call(a.context,t,r),true;case 4:return a.fn.call(a.context,t,r,i),true;case 5:return a.fn.call(a.context,t,r,i,s),true;case 6:return a.fn.call(a.context,t,r,i,s,o),true}for(h=1,c=new Array(l-1);h<l;h++){c[h-1]=arguments[h]}a.fn.apply(a.context,c)}else{var _=a.length,f;for(h=0;h<_;h++){if(a[h].once)this.removeListener(e,a[h].fn,undefined,true);switch(l){case 1:a[h].fn.call(a[h].context);break;case 2:a[h].fn.call(a[h].context,t);break;case 3:a[h].fn.call(a[h].context,t,r);break;case 4:a[h].fn.call(a[h].context,t,r,i);break;default:if(!c)for(f=1,c=new Array(l-1);f<l;f++){c[f-1]=arguments[f]}a[h].fn.apply(a[h].context,c)}}}return true};EventEmitter.prototype.on=function on(e,t,n){return addListener(this,e,t,n,false)};EventEmitter.prototype.once=function once(e,t,n){return addListener(this,e,t,n,true)};EventEmitter.prototype.removeListener=function removeListener(e,t,r,i){var s=n?n+e:e;if(!this._events[s])return this;if(!t){clearEvent(this,s);return this}var o=this._events[s];if(o.fn){if(o.fn===t&&(!i||o.once)&&(!r||o.context===r)){clearEvent(this,s)}}else{for(var u=0,a=[],l=o.length;u<l;u++){if(o[u].fn!==t||i&&!o[u].once||r&&o[u].context!==r){a.push(o[u])}}if(a.length)this._events[s]=a.length===1?a[0]:a;else clearEvent(this,s)}return this};EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t;if(e){t=n?n+e:e;if(this._events[t])clearEvent(this,t)}else{this._events=new Events;this._eventsCount=0}return this};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.addListener=EventEmitter.prototype.on;EventEmitter.prefixed=n;EventEmitter.EventEmitter=EventEmitter;if(true){e.exports=EventEmitter}},213:e=>{e.exports=(e,t)=>{t=t||(()=>{});return e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e}))))}},574:(e,t)=>{Object.defineProperty(t,\"__esModule\",{value:true});function lowerBound(e,t,n){let r=0;let i=e.length;while(i>0){const s=i/2|0;let o=r+s;if(n(e[o],t)<=0){r=++o;i-=s+1}else{i=s}}return r}t[\"default\"]=lowerBound},821:(e,t,n)=>{Object.defineProperty(t,\"__esModule\",{value:true});const r=n(574);class PriorityQueue{constructor(){this._queue=[]}enqueue(e,t){t=Object.assign({priority:0},t);const n={priority:t.priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority){this._queue.push(n);return}const i=r.default(this._queue,n,((e,t)=>t.priority-e.priority));this._queue.splice(i,0,n)}dequeue(){const e=this._queue.shift();return e===null||e===void 0?void 0:e.run}filter(e){return this._queue.filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return this._queue.length}}t[\"default\"]=PriorityQueue},816:(e,t,n)=>{const r=n(213);class TimeoutError extends Error{constructor(e){super(e);this.name=\"TimeoutError\"}}const pTimeout=(e,t,n)=>new Promise(((i,s)=>{if(typeof t!==\"number\"||t<0){throw new TypeError(\"Expected `milliseconds` to be a positive number\")}if(t===Infinity){i(e);return}const o=setTimeout((()=>{if(typeof n===\"function\"){try{i(n())}catch(e){s(e)}return}const r=typeof n===\"string\"?n:`Promise timed out after ${t} milliseconds`;const o=n instanceof Error?n:new TimeoutError(r);if(typeof e.cancel===\"function\"){e.cancel()}s(o)}),t);r(e.then(i,s),(()=>{clearTimeout(o)}))}));e.exports=pTimeout;e.exports[\"default\"]=pTimeout;e.exports.TimeoutError=TimeoutError}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var i=t[n]={exports:{}};var s=true;try{e[n](i,i.exports,__nccwpck_require__);s=false}finally{if(s)delete t[n]}return i.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var n={};(()=>{var e=n;Object.defineProperty(e,\"__esModule\",{value:true});const t=__nccwpck_require__(993);const r=__nccwpck_require__(816);const i=__nccwpck_require__(821);const empty=()=>{};const s=new r.TimeoutError;class PQueue extends t{constructor(e){var t,n,r,s;super();this._intervalCount=0;this._intervalEnd=0;this._pendingCount=0;this._resolveEmpty=empty;this._resolveIdle=empty;e=Object.assign({carryoverConcurrencyCount:false,intervalCap:Infinity,interval:0,concurrency:Infinity,autoStart:true,queueClass:i.default},e);if(!(typeof e.intervalCap===\"number\"&&e.intervalCap>=1)){throw new TypeError(`Expected \\`intervalCap\\` to be a number from 1 and up, got \\`${(n=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:\"\"}\\` (${typeof e.intervalCap})`)}if(e.interval===undefined||!(Number.isFinite(e.interval)&&e.interval>=0)){throw new TypeError(`Expected \\`interval\\` to be a finite number >= 0, got \\`${(s=(r=e.interval)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:\"\"}\\` (${typeof e.interval})`)}this._carryoverConcurrencyCount=e.carryoverConcurrencyCount;this._isIntervalIgnored=e.intervalCap===Infinity||e.interval===0;this._intervalCap=e.intervalCap;this._interval=e.interval;this._queue=new e.queueClass;this._queueClass=e.queueClass;this.concurrency=e.concurrency;this._timeout=e.timeout;this._throwOnTimeout=e.throwOnTimeout===true;this._isPaused=e.autoStart===false}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--;this._tryToStartAnother();this.emit(\"next\")}_resolvePromises(){this._resolveEmpty();this._resolveEmpty=empty;if(this._pendingCount===0){this._resolveIdle();this._resolveIdle=empty;this.emit(\"idle\")}}_onResumeInterval(){this._onInterval();this._initializeIntervalIfNeeded();this._timeoutId=undefined}_isIntervalPaused(){const e=Date.now();if(this._intervalId===undefined){const t=this._intervalEnd-e;if(t<0){this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}else{if(this._timeoutId===undefined){this._timeoutId=setTimeout((()=>{this._onResumeInterval()}),t)}return true}}return false}_tryToStartAnother(){if(this._queue.size===0){if(this._intervalId){clearInterval(this._intervalId)}this._intervalId=undefined;this._resolvePromises();return false}if(!this._isPaused){const e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();if(!t){return false}this.emit(\"active\");t();if(e){this._initializeIntervalIfNeeded()}return true}}return false}_initializeIntervalIfNeeded(){if(this._isIntervalIgnored||this._intervalId!==undefined){return}this._intervalId=setInterval((()=>{this._onInterval()}),this._interval);this._intervalEnd=Date.now()+this._interval}_onInterval(){if(this._intervalCount===0&&this._pendingCount===0&&this._intervalId){clearInterval(this._intervalId);this._intervalId=undefined}this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;this._processQueue()}_processQueue(){while(this._tryToStartAnother()){}}get concurrency(){return this._concurrency}set concurrency(e){if(!(typeof e===\"number\"&&e>=1)){throw new TypeError(`Expected \\`concurrency\\` to be a number from 1 and up, got \\`${e}\\` (${typeof e})`)}this._concurrency=e;this._processQueue()}async add(e,t={}){return new Promise(((n,i)=>{const run=async()=>{this._pendingCount++;this._intervalCount++;try{const o=this._timeout===undefined&&t.timeout===undefined?e():r.default(Promise.resolve(e()),t.timeout===undefined?this._timeout:t.timeout,(()=>{if(t.throwOnTimeout===undefined?this._throwOnTimeout:t.throwOnTimeout){i(s)}return undefined}));n(await o)}catch(e){i(e)}this._next()};this._queue.enqueue(run,t);this._tryToStartAnother();this.emit(\"add\")}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){if(!this._isPaused){return this}this._isPaused=false;this._processQueue();return this}pause(){this._isPaused=true}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size===0){return}return new Promise((e=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t();e()}}))}async onIdle(){if(this._pendingCount===0&&this._queue.size===0){return}return new Promise((e=>{const t=this._resolveIdle;this._resolveIdle=()=>{t();e()}}))}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}}e[\"default\"]=PQueue})();module.exports=n})();","(()=>{\"use strict\";if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var e={};(()=>{var n=e;Object.defineProperty(n,\"__esModule\",{value:true});n.pathToRegexp=n.tokensToRegexp=n.regexpToFunction=n.match=n.tokensToFunction=n.compile=n.parse=void 0;function lexer(e){var n=[];var r=0;while(r<e.length){var t=e[r];if(t===\"*\"||t===\"+\"||t===\"?\"){n.push({type:\"MODIFIER\",index:r,value:e[r++]});continue}if(t===\"\\\\\"){n.push({type:\"ESCAPED_CHAR\",index:r++,value:e[r++]});continue}if(t===\"{\"){n.push({type:\"OPEN\",index:r,value:e[r++]});continue}if(t===\"}\"){n.push({type:\"CLOSE\",index:r,value:e[r++]});continue}if(t===\":\"){var a=\"\";var i=r+1;while(i<e.length){var o=e.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){a+=e[i++];continue}break}if(!a)throw new TypeError(\"Missing parameter name at \".concat(r));n.push({type:\"NAME\",index:r,value:a});r=i;continue}if(t===\"(\"){var c=1;var f=\"\";var i=r+1;if(e[i]===\"?\"){throw new TypeError('Pattern cannot start with \"?\" at '.concat(i))}while(i<e.length){if(e[i]===\"\\\\\"){f+=e[i++]+e[i++];continue}if(e[i]===\")\"){c--;if(c===0){i++;break}}else if(e[i]===\"(\"){c++;if(e[i+1]!==\"?\"){throw new TypeError(\"Capturing groups are not allowed at \".concat(i))}}f+=e[i++]}if(c)throw new TypeError(\"Unbalanced pattern at \".concat(r));if(!f)throw new TypeError(\"Missing pattern at \".concat(r));n.push({type:\"PATTERN\",index:r,value:f});r=i;continue}n.push({type:\"CHAR\",index:r,value:e[r++]})}n.push({type:\"END\",index:r,value:\"\"});return n}function parse(e,n){if(n===void 0){n={}}var r=lexer(e);var t=n.prefixes,a=t===void 0?\"./\":t,i=n.delimiter,o=i===void 0?\"/#?\":i;var c=[];var f=0;var u=0;var p=\"\";var tryConsume=function(e){if(u<r.length&&r[u].type===e)return r[u++].value};var mustConsume=function(e){var n=tryConsume(e);if(n!==undefined)return n;var t=r[u],a=t.type,i=t.index;throw new TypeError(\"Unexpected \".concat(a,\" at \").concat(i,\", expected \").concat(e))};var consumeText=function(){var e=\"\";var n;while(n=tryConsume(\"CHAR\")||tryConsume(\"ESCAPED_CHAR\")){e+=n}return e};var isSafe=function(e){for(var n=0,r=o;n<r.length;n++){var t=r[n];if(e.indexOf(t)>-1)return true}return false};var safePattern=function(e){var n=c[c.length-1];var r=e||(n&&typeof n===\"string\"?n:\"\");if(n&&!r){throw new TypeError('Must have text between two parameters, missing text after \"'.concat(n.name,'\"'))}if(!r||isSafe(r))return\"[^\".concat(escapeString(o),\"]+?\");return\"(?:(?!\".concat(escapeString(r),\")[^\").concat(escapeString(o),\"])+?\")};while(u<r.length){var v=tryConsume(\"CHAR\");var s=tryConsume(\"NAME\");var d=tryConsume(\"PATTERN\");if(s||d){var g=v||\"\";if(a.indexOf(g)===-1){p+=g;g=\"\"}if(p){c.push(p);p=\"\"}c.push({name:s||f++,prefix:g,suffix:\"\",pattern:d||safePattern(g),modifier:tryConsume(\"MODIFIER\")||\"\"});continue}var x=v||tryConsume(\"ESCAPED_CHAR\");if(x){p+=x;continue}if(p){c.push(p);p=\"\"}var h=tryConsume(\"OPEN\");if(h){var g=consumeText();var l=tryConsume(\"NAME\")||\"\";var m=tryConsume(\"PATTERN\")||\"\";var T=consumeText();mustConsume(\"CLOSE\");c.push({name:l||(m?f++:\"\"),pattern:l&&!m?safePattern(g):m,prefix:g,suffix:T,modifier:tryConsume(\"MODIFIER\")||\"\"});continue}mustConsume(\"END\")}return c}n.parse=parse;function compile(e,n){return tokensToFunction(parse(e,n),n)}n.compile=compile;function tokensToFunction(e,n){if(n===void 0){n={}}var r=flags(n);var t=n.encode,a=t===void 0?function(e){return e}:t,i=n.validate,o=i===void 0?true:i;var c=e.map((function(e){if(typeof e===\"object\"){return new RegExp(\"^(?:\".concat(e.pattern,\")$\"),r)}}));return function(n){var r=\"\";for(var t=0;t<e.length;t++){var i=e[t];if(typeof i===\"string\"){r+=i;continue}var f=n?n[i.name]:undefined;var u=i.modifier===\"?\"||i.modifier===\"*\";var p=i.modifier===\"*\"||i.modifier===\"+\";if(Array.isArray(f)){if(!p){throw new TypeError('Expected \"'.concat(i.name,'\" to not repeat, but got an array'))}if(f.length===0){if(u)continue;throw new TypeError('Expected \"'.concat(i.name,'\" to not be empty'))}for(var v=0;v<f.length;v++){var s=a(f[v],i);if(o&&!c[t].test(s)){throw new TypeError('Expected all \"'.concat(i.name,'\" to match \"').concat(i.pattern,'\", but got \"').concat(s,'\"'))}r+=i.prefix+s+i.suffix}continue}if(typeof f===\"string\"||typeof f===\"number\"){var s=a(String(f),i);if(o&&!c[t].test(s)){throw new TypeError('Expected \"'.concat(i.name,'\" to match \"').concat(i.pattern,'\", but got \"').concat(s,'\"'))}r+=i.prefix+s+i.suffix;continue}if(u)continue;var d=p?\"an array\":\"a string\";throw new TypeError('Expected \"'.concat(i.name,'\" to be ').concat(d))}return r}}n.tokensToFunction=tokensToFunction;function match(e,n){var r=[];var t=pathToRegexp(e,r,n);return regexpToFunction(t,r,n)}n.match=match;function regexpToFunction(e,n,r){if(r===void 0){r={}}var t=r.decode,a=t===void 0?function(e){return e}:t;return function(r){var t=e.exec(r);if(!t)return false;var i=t[0],o=t.index;var c=Object.create(null);var _loop_1=function(e){if(t[e]===undefined)return\"continue\";var r=n[e-1];if(r.modifier===\"*\"||r.modifier===\"+\"){c[r.name]=t[e].split(r.prefix+r.suffix).map((function(e){return a(e,r)}))}else{c[r.name]=a(t[e],r)}};for(var f=1;f<t.length;f++){_loop_1(f)}return{path:i,index:o,params:c}}}n.regexpToFunction=regexpToFunction;function escapeString(e){return e.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g,\"\\\\$1\")}function flags(e){return e&&e.sensitive?\"\":\"i\"}function regexpToRegexp(e,n){if(!n)return e;var r=/\\((?:\\?<(.*?)>)?(?!\\?)/g;var t=0;var a=r.exec(e.source);while(a){n.push({name:a[1]||t++,prefix:\"\",suffix:\"\",modifier:\"\",pattern:\"\"});a=r.exec(e.source)}return e}function arrayToRegexp(e,n,r){var t=e.map((function(e){return pathToRegexp(e,n,r).source}));return new RegExp(\"(?:\".concat(t.join(\"|\"),\")\"),flags(r))}function stringToRegexp(e,n,r){return tokensToRegexp(parse(e,r),n,r)}function tokensToRegexp(e,n,r){if(r===void 0){r={}}var t=r.strict,a=t===void 0?false:t,i=r.start,o=i===void 0?true:i,c=r.end,f=c===void 0?true:c,u=r.encode,p=u===void 0?function(e){return e}:u,v=r.delimiter,s=v===void 0?\"/#?\":v,d=r.endsWith,g=d===void 0?\"\":d;var x=\"[\".concat(escapeString(g),\"]|$\");var h=\"[\".concat(escapeString(s),\"]\");var l=o?\"^\":\"\";for(var m=0,T=e;m<T.length;m++){var E=T[m];if(typeof E===\"string\"){l+=escapeString(p(E))}else{var w=escapeString(p(E.prefix));var y=escapeString(p(E.suffix));if(E.pattern){if(n)n.push(E);if(w||y){if(E.modifier===\"+\"||E.modifier===\"*\"){var R=E.modifier===\"*\"?\"?\":\"\";l+=\"(?:\".concat(w,\"((?:\").concat(E.pattern,\")(?:\").concat(y).concat(w,\"(?:\").concat(E.pattern,\"))*)\").concat(y,\")\").concat(R)}else{l+=\"(?:\".concat(w,\"(\").concat(E.pattern,\")\").concat(y,\")\").concat(E.modifier)}}else{if(E.modifier===\"+\"||E.modifier===\"*\"){throw new TypeError('Can not repeat \"'.concat(E.name,'\" without a prefix and suffix'))}l+=\"(\".concat(E.pattern,\")\").concat(E.modifier)}}else{l+=\"(?:\".concat(w).concat(y,\")\").concat(E.modifier)}}}if(f){if(!a)l+=\"\".concat(h,\"?\");l+=!r.endsWith?\"$\":\"(?=\".concat(x,\")\")}else{var A=e[e.length-1];var _=typeof A===\"string\"?h.indexOf(A[A.length-1])>-1:A===undefined;if(!a){l+=\"(?:\".concat(h,\"(?=\").concat(x,\"))?\")}if(!_){l+=\"(?=\".concat(h,\"|\").concat(x,\")\")}}return new RegExp(l,flags(r))}n.tokensToRegexp=tokensToRegexp;function pathToRegexp(e,n,r){if(e instanceof RegExp)return regexpToRegexp(e,n);if(Array.isArray(e))return arrayToRegexp(e,n,r);return stringToRegexp(e,n,r)}n.pathToRegexp=pathToRegexp})();module.exports=e})();","/**\n * @license React\n * react-dom-server.node.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar util = require(\"util\"),\n crypto = require(\"crypto\"),\n async_hooks = require(\"async_hooks\"),\n React = require(\"next/dist/compiled/react-experimental\"),\n ReactDOM = require(\"next/dist/compiled/react-dom-experimental\"),\n stream = require(\"stream\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_SCOPE_TYPE = Symbol.for(\"react.scope\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_LEGACY_HIDDEN_TYPE = Symbol.for(\"react.legacy_hidden\"),\n REACT_MEMO_CACHE_SENTINEL = Symbol.for(\"react.memo_cache_sentinel\"),\n REACT_POSTPONE_TYPE = Symbol.for(\"react.postpone\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ASYNC_ITERATOR = Symbol.asyncIterator,\n isArrayImpl = Array.isArray,\n scheduleMicrotask = queueMicrotask;\nfunction flushBuffered(destination) {\n \"function\" === typeof destination.flush && destination.flush();\n}\nvar currentView = null,\n writtenBytes = 0,\n destinationHasCapacity$1 = !0;\nfunction writeChunk(destination, chunk) {\n if (\"string\" === typeof chunk) {\n if (0 !== chunk.length)\n if (4096 < 3 * chunk.length)\n 0 < writtenBytes &&\n (writeToDestination(\n destination,\n currentView.subarray(0, writtenBytes)\n ),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0)),\n writeToDestination(destination, chunk);\n else {\n var target = currentView;\n 0 < writtenBytes && (target = currentView.subarray(writtenBytes));\n target = textEncoder.encodeInto(chunk, target);\n var read = target.read;\n writtenBytes += target.written;\n read < chunk.length &&\n (writeToDestination(\n destination,\n currentView.subarray(0, writtenBytes)\n ),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = textEncoder.encodeInto(\n chunk.slice(read),\n currentView\n ).written));\n 4096 === writtenBytes &&\n (writeToDestination(destination, currentView),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0));\n }\n } else\n 0 !== chunk.byteLength &&\n (4096 < chunk.byteLength\n ? (0 < writtenBytes &&\n (writeToDestination(\n destination,\n currentView.subarray(0, writtenBytes)\n ),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0)),\n writeToDestination(destination, chunk))\n : ((target = currentView.length - writtenBytes),\n target < chunk.byteLength &&\n (0 === target\n ? writeToDestination(destination, currentView)\n : (currentView.set(chunk.subarray(0, target), writtenBytes),\n (writtenBytes += target),\n writeToDestination(destination, currentView),\n (chunk = chunk.subarray(target))),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0)),\n currentView.set(chunk, writtenBytes),\n (writtenBytes += chunk.byteLength),\n 4096 === writtenBytes &&\n (writeToDestination(destination, currentView),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0))));\n}\nfunction writeToDestination(destination, view) {\n destination = destination.write(view);\n destinationHasCapacity$1 = destinationHasCapacity$1 && destination;\n}\nfunction writeChunkAndReturn(destination, chunk) {\n writeChunk(destination, chunk);\n return destinationHasCapacity$1;\n}\nfunction completeWriting(destination) {\n currentView &&\n 0 < writtenBytes &&\n destination.write(currentView.subarray(0, writtenBytes));\n currentView = null;\n writtenBytes = 0;\n destinationHasCapacity$1 = !0;\n}\nvar textEncoder = new util.TextEncoder();\nfunction stringToPrecomputedChunk(content) {\n return textEncoder.encode(content);\n}\nfunction byteLengthOfChunk(chunk) {\n return \"string\" === typeof chunk\n ? Buffer.byteLength(chunk, \"utf8\")\n : chunk.byteLength;\n}\nfunction readAsDataURL(blob) {\n return blob.arrayBuffer().then(function (arrayBuffer) {\n arrayBuffer = Buffer.from(arrayBuffer).toString(\"base64\");\n return (\n \"data:\" +\n (blob.type || \"application/octet-stream\") +\n \";base64,\" +\n arrayBuffer\n );\n });\n}\nvar assign = Object.assign,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n VALID_ATTRIBUTE_NAME_REGEX = RegExp(\n \"^[:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD][:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\"\n ),\n illegalAttributeNameCache = {},\n validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))\n return !0;\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return !1;\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))\n return (validatedAttributeNameCache[attributeName] = !0);\n illegalAttributeNameCache[attributeName] = !0;\n return !1;\n}\nvar unitlessNumbers = new Set(\n \"animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp\".split(\n \" \"\n )\n ),\n aliases = new Map([\n [\"acceptCharset\", \"accept-charset\"],\n [\"htmlFor\", \"for\"],\n [\"httpEquiv\", \"http-equiv\"],\n [\"crossOrigin\", \"crossorigin\"],\n [\"accentHeight\", \"accent-height\"],\n [\"alignmentBaseline\", \"alignment-baseline\"],\n [\"arabicForm\", \"arabic-form\"],\n [\"baselineShift\", \"baseline-shift\"],\n [\"capHeight\", \"cap-height\"],\n [\"clipPath\", \"clip-path\"],\n [\"clipRule\", \"clip-rule\"],\n [\"colorInterpolation\", \"color-interpolation\"],\n [\"colorInterpolationFilters\", \"color-interpolation-filters\"],\n [\"colorProfile\", \"color-profile\"],\n [\"colorRendering\", \"color-rendering\"],\n [\"dominantBaseline\", \"dominant-baseline\"],\n [\"enableBackground\", \"enable-background\"],\n [\"fillOpacity\", \"fill-opacity\"],\n [\"fillRule\", \"fill-rule\"],\n [\"floodColor\", \"flood-color\"],\n [\"floodOpacity\", \"flood-opacity\"],\n [\"fontFamily\", \"font-family\"],\n [\"fontSize\", \"font-size\"],\n [\"fontSizeAdjust\", \"font-size-adjust\"],\n [\"fontStretch\", \"font-stretch\"],\n [\"fontStyle\", \"font-style\"],\n [\"fontVariant\", \"font-variant\"],\n [\"fontWeight\", \"font-weight\"],\n [\"glyphName\", \"glyph-name\"],\n [\"glyphOrientationHorizontal\", \"glyph-orientation-horizontal\"],\n [\"glyphOrientationVertical\", \"glyph-orientation-vertical\"],\n [\"horizAdvX\", \"horiz-adv-x\"],\n [\"horizOriginX\", \"horiz-origin-x\"],\n [\"imageRendering\", \"image-rendering\"],\n [\"letterSpacing\", \"letter-spacing\"],\n [\"lightingColor\", \"lighting-color\"],\n [\"markerEnd\", \"marker-end\"],\n [\"markerMid\", \"marker-mid\"],\n [\"markerStart\", \"marker-start\"],\n [\"overlinePosition\", \"overline-position\"],\n [\"overlineThickness\", \"overline-thickness\"],\n [\"paintOrder\", \"paint-order\"],\n [\"panose-1\", \"panose-1\"],\n [\"pointerEvents\", \"pointer-events\"],\n [\"renderingIntent\", \"rendering-intent\"],\n [\"shapeRendering\", \"shape-rendering\"],\n [\"stopColor\", \"stop-color\"],\n [\"stopOpacity\", \"stop-opacity\"],\n [\"strikethroughPosition\", \"strikethrough-position\"],\n [\"strikethroughThickness\", \"strikethrough-thickness\"],\n [\"strokeDasharray\", \"stroke-dasharray\"],\n [\"strokeDashoffset\", \"stroke-dashoffset\"],\n [\"strokeLinecap\", \"stroke-linecap\"],\n [\"strokeLinejoin\", \"stroke-linejoin\"],\n [\"strokeMiterlimit\", \"stroke-miterlimit\"],\n [\"strokeOpacity\", \"stroke-opacity\"],\n [\"strokeWidth\", \"stroke-width\"],\n [\"textAnchor\", \"text-anchor\"],\n [\"textDecoration\", \"text-decoration\"],\n [\"textRendering\", \"text-rendering\"],\n [\"transformOrigin\", \"transform-origin\"],\n [\"underlinePosition\", \"underline-position\"],\n [\"underlineThickness\", \"underline-thickness\"],\n [\"unicodeBidi\", \"unicode-bidi\"],\n [\"unicodeRange\", \"unicode-range\"],\n [\"unitsPerEm\", \"units-per-em\"],\n [\"vAlphabetic\", \"v-alphabetic\"],\n [\"vHanging\", \"v-hanging\"],\n [\"vIdeographic\", \"v-ideographic\"],\n [\"vMathematical\", \"v-mathematical\"],\n [\"vectorEffect\", \"vector-effect\"],\n [\"vertAdvY\", \"vert-adv-y\"],\n [\"vertOriginX\", \"vert-origin-x\"],\n [\"vertOriginY\", \"vert-origin-y\"],\n [\"wordSpacing\", \"word-spacing\"],\n [\"writingMode\", \"writing-mode\"],\n [\"xmlnsXlink\", \"xmlns:xlink\"],\n [\"xHeight\", \"x-height\"]\n ]),\n matchHtmlRegExp = /[\"'&<>]/;\nfunction escapeTextForBrowser(text) {\n if (\n \"boolean\" === typeof text ||\n \"number\" === typeof text ||\n \"bigint\" === typeof text\n )\n return \"\" + text;\n text = \"\" + text;\n var match = matchHtmlRegExp.exec(text);\n if (match) {\n var html = \"\",\n index,\n lastIndex = 0;\n for (index = match.index; index < text.length; index++) {\n switch (text.charCodeAt(index)) {\n case 34:\n match = \"&quot;\";\n break;\n case 38:\n match = \"&amp;\";\n break;\n case 39:\n match = \"&#x27;\";\n break;\n case 60:\n match = \"&lt;\";\n break;\n case 62:\n match = \"&gt;\";\n break;\n default:\n continue;\n }\n lastIndex !== index && (html += text.slice(lastIndex, index));\n lastIndex = index + 1;\n html += match;\n }\n text = lastIndex !== index ? html + text.slice(lastIndex, index) : html;\n }\n return text;\n}\nvar uppercasePattern = /([A-Z])/g,\n msPattern = /^ms-/,\n isJavaScriptProtocol =\n /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*:/i;\nfunction sanitizeURL(url) {\n return isJavaScriptProtocol.test(\"\" + url)\n ? \"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\"\n : url;\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n ReactDOMSharedInternals =\n ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n sharedNotPendingObject = {\n pending: !1,\n data: null,\n method: null,\n action: null\n },\n previousDispatcher = ReactDOMSharedInternals.d;\nReactDOMSharedInternals.d = {\n f: previousDispatcher.f,\n r: previousDispatcher.r,\n D: prefetchDNS,\n C: preconnect,\n L: preload,\n m: preloadModule,\n X: preinitScript,\n S: preinitStyle,\n M: preinitModuleScript\n};\nvar PRELOAD_NO_CREDS = [],\n currentlyFlushingRenderState = null,\n dataElementQuotedEnd = stringToPrecomputedChunk('\"></template>'),\n startInlineScript = stringToPrecomputedChunk(\"<script\"),\n endInlineScript = stringToPrecomputedChunk(\"\\x3c/script>\"),\n startScriptSrc = stringToPrecomputedChunk('<script src=\"'),\n startModuleSrc = stringToPrecomputedChunk('<script type=\"module\" src=\"'),\n scriptNonce = stringToPrecomputedChunk(' nonce=\"'),\n scriptIntegirty = stringToPrecomputedChunk(' integrity=\"'),\n scriptCrossOrigin = stringToPrecomputedChunk(' crossorigin=\"'),\n endAsyncScript = stringToPrecomputedChunk(' async=\"\">\\x3c/script>'),\n startInlineStyle = stringToPrecomputedChunk(\"<style\"),\n scriptRegex = /(<\\/|<)(s)(cript)/gi;\nfunction scriptReplacer(match, prefix, s, suffix) {\n return \"\" + prefix + (\"s\" === s ? \"\\\\u0073\" : \"\\\\u0053\") + suffix;\n}\nvar importMapScriptStart = stringToPrecomputedChunk(\n '<script type=\"importmap\">'\n ),\n importMapScriptEnd = stringToPrecomputedChunk(\"\\x3c/script>\");\nfunction createRenderState(\n resumableState,\n nonce,\n externalRuntimeConfig,\n importMap,\n onHeaders,\n maxHeadersLength\n) {\n var nonceScript = \"string\" === typeof nonce ? nonce : nonce && nonce.script,\n inlineScriptWithNonce =\n void 0 === nonceScript\n ? startInlineScript\n : stringToPrecomputedChunk(\n '<script nonce=\"' + escapeTextForBrowser(nonceScript) + '\"'\n ),\n nonceStyle = \"string\" === typeof nonce ? void 0 : nonce && nonce.style,\n inlineStyleWithNonce =\n void 0 === nonceStyle\n ? startInlineStyle\n : stringToPrecomputedChunk(\n '<style nonce=\"' + escapeTextForBrowser(nonceStyle) + '\"'\n ),\n idPrefix = resumableState.idPrefix,\n bootstrapChunks = [],\n externalRuntimeScript = null,\n bootstrapScriptContent = resumableState.bootstrapScriptContent,\n bootstrapScripts = resumableState.bootstrapScripts,\n bootstrapModules = resumableState.bootstrapModules;\n void 0 !== bootstrapScriptContent &&\n (bootstrapChunks.push(inlineScriptWithNonce),\n pushCompletedShellIdAttribute(bootstrapChunks, resumableState),\n bootstrapChunks.push(\n endOfStartTag,\n (\"\" + bootstrapScriptContent).replace(scriptRegex, scriptReplacer),\n endInlineScript\n ));\n void 0 !== externalRuntimeConfig &&\n (\"string\" === typeof externalRuntimeConfig\n ? ((externalRuntimeScript = { src: externalRuntimeConfig, chunks: [] }),\n pushScriptImpl(externalRuntimeScript.chunks, {\n src: externalRuntimeConfig,\n async: !0,\n integrity: void 0,\n nonce: nonceScript\n }))\n : ((externalRuntimeScript = {\n src: externalRuntimeConfig.src,\n chunks: []\n }),\n pushScriptImpl(externalRuntimeScript.chunks, {\n src: externalRuntimeConfig.src,\n async: !0,\n integrity: externalRuntimeConfig.integrity,\n nonce: nonceScript\n })));\n externalRuntimeConfig = [];\n void 0 !== importMap &&\n (externalRuntimeConfig.push(importMapScriptStart),\n externalRuntimeConfig.push(\n (\"\" + JSON.stringify(importMap)).replace(scriptRegex, scriptReplacer)\n ),\n externalRuntimeConfig.push(importMapScriptEnd));\n importMap = onHeaders\n ? {\n preconnects: \"\",\n fontPreloads: \"\",\n highImagePreloads: \"\",\n remainingCapacity:\n 2 + (\"number\" === typeof maxHeadersLength ? maxHeadersLength : 2e3)\n }\n : null;\n onHeaders = {\n placeholderPrefix: stringToPrecomputedChunk(idPrefix + \"P:\"),\n segmentPrefix: stringToPrecomputedChunk(idPrefix + \"S:\"),\n boundaryPrefix: stringToPrecomputedChunk(idPrefix + \"B:\"),\n startInlineScript: inlineScriptWithNonce,\n startInlineStyle: inlineStyleWithNonce,\n preamble: createPreambleState(),\n externalRuntimeScript: externalRuntimeScript,\n bootstrapChunks: bootstrapChunks,\n importMapChunks: externalRuntimeConfig,\n onHeaders: onHeaders,\n headers: importMap,\n resets: {\n font: {},\n dns: {},\n connect: { default: {}, anonymous: {}, credentials: {} },\n image: {},\n style: {}\n },\n charsetChunks: [],\n viewportChunks: [],\n hoistableChunks: [],\n preconnects: new Set(),\n fontPreloads: new Set(),\n highImagePreloads: new Set(),\n styles: new Map(),\n bootstrapScripts: new Set(),\n scripts: new Set(),\n bulkPreloads: new Set(),\n preloads: {\n images: new Map(),\n stylesheets: new Map(),\n scripts: new Map(),\n moduleScripts: new Map()\n },\n nonce: { script: nonceScript, style: nonceStyle },\n hoistableState: null,\n stylesToHoist: !1\n };\n if (void 0 !== bootstrapScripts)\n for (\n inlineScriptWithNonce = 0;\n inlineScriptWithNonce < bootstrapScripts.length;\n inlineScriptWithNonce++\n )\n (importMap = bootstrapScripts[inlineScriptWithNonce]),\n (idPrefix = inlineStyleWithNonce = void 0),\n (externalRuntimeScript = {\n rel: \"preload\",\n as: \"script\",\n fetchPriority: \"low\",\n nonce: nonce\n }),\n \"string\" === typeof importMap\n ? (externalRuntimeScript.href = nonceStyle = importMap)\n : ((externalRuntimeScript.href = nonceStyle = importMap.src),\n (externalRuntimeScript.integrity = idPrefix =\n \"string\" === typeof importMap.integrity\n ? importMap.integrity\n : void 0),\n (externalRuntimeScript.crossOrigin = inlineStyleWithNonce =\n \"string\" === typeof importMap || null == importMap.crossOrigin\n ? void 0\n : \"use-credentials\" === importMap.crossOrigin\n ? \"use-credentials\"\n : \"\")),\n (importMap = resumableState),\n (maxHeadersLength = nonceStyle),\n (importMap.scriptResources[maxHeadersLength] = null),\n (importMap.moduleScriptResources[maxHeadersLength] = null),\n (importMap = []),\n pushLinkImpl(importMap, externalRuntimeScript),\n onHeaders.bootstrapScripts.add(importMap),\n bootstrapChunks.push(\n startScriptSrc,\n escapeTextForBrowser(nonceStyle),\n attributeEnd\n ),\n nonceScript &&\n bootstrapChunks.push(\n scriptNonce,\n escapeTextForBrowser(nonceScript),\n attributeEnd\n ),\n \"string\" === typeof idPrefix &&\n bootstrapChunks.push(\n scriptIntegirty,\n escapeTextForBrowser(idPrefix),\n attributeEnd\n ),\n \"string\" === typeof inlineStyleWithNonce &&\n bootstrapChunks.push(\n scriptCrossOrigin,\n escapeTextForBrowser(inlineStyleWithNonce),\n attributeEnd\n ),\n pushCompletedShellIdAttribute(bootstrapChunks, resumableState),\n bootstrapChunks.push(endAsyncScript);\n if (void 0 !== bootstrapModules)\n for (nonce = 0; nonce < bootstrapModules.length; nonce++)\n (idPrefix = bootstrapModules[nonce]),\n (nonceStyle = inlineScriptWithNonce = void 0),\n (inlineStyleWithNonce = {\n rel: \"modulepreload\",\n fetchPriority: \"low\",\n nonce: nonceScript\n }),\n \"string\" === typeof idPrefix\n ? (inlineStyleWithNonce.href = bootstrapScripts = idPrefix)\n : ((inlineStyleWithNonce.href = bootstrapScripts = idPrefix.src),\n (inlineStyleWithNonce.integrity = nonceStyle =\n \"string\" === typeof idPrefix.integrity\n ? idPrefix.integrity\n : void 0),\n (inlineStyleWithNonce.crossOrigin = inlineScriptWithNonce =\n \"string\" === typeof idPrefix || null == idPrefix.crossOrigin\n ? void 0\n : \"use-credentials\" === idPrefix.crossOrigin\n ? \"use-credentials\"\n : \"\")),\n (idPrefix = resumableState),\n (externalRuntimeScript = bootstrapScripts),\n (idPrefix.scriptResources[externalRuntimeScript] = null),\n (idPrefix.moduleScriptResources[externalRuntimeScript] = null),\n (idPrefix = []),\n pushLinkImpl(idPrefix, inlineStyleWithNonce),\n onHeaders.bootstrapScripts.add(idPrefix),\n bootstrapChunks.push(\n startModuleSrc,\n escapeTextForBrowser(bootstrapScripts),\n attributeEnd\n ),\n nonceScript &&\n bootstrapChunks.push(\n scriptNonce,\n escapeTextForBrowser(nonceScript),\n attributeEnd\n ),\n \"string\" === typeof nonceStyle &&\n bootstrapChunks.push(\n scriptIntegirty,\n escapeTextForBrowser(nonceStyle),\n attributeEnd\n ),\n \"string\" === typeof inlineScriptWithNonce &&\n bootstrapChunks.push(\n scriptCrossOrigin,\n escapeTextForBrowser(inlineScriptWithNonce),\n attributeEnd\n ),\n pushCompletedShellIdAttribute(bootstrapChunks, resumableState),\n bootstrapChunks.push(endAsyncScript);\n return onHeaders;\n}\nfunction createResumableState(\n identifierPrefix,\n externalRuntimeConfig,\n bootstrapScriptContent,\n bootstrapScripts,\n bootstrapModules\n) {\n var streamingFormat = 0;\n void 0 !== externalRuntimeConfig && (streamingFormat = 1);\n return {\n idPrefix: void 0 === identifierPrefix ? \"\" : identifierPrefix,\n nextFormID: 0,\n streamingFormat: streamingFormat,\n bootstrapScriptContent: bootstrapScriptContent,\n bootstrapScripts: bootstrapScripts,\n bootstrapModules: bootstrapModules,\n instructions: 0,\n hasBody: !1,\n hasHtml: !1,\n unknownResources: {},\n dnsResources: {},\n connectResources: { default: {}, anonymous: {}, credentials: {} },\n imageResources: {},\n styleResources: {},\n scriptResources: {},\n moduleUnknownResources: {},\n moduleScriptResources: {}\n };\n}\nfunction createPreambleState() {\n return { htmlChunks: null, headChunks: null, bodyChunks: null };\n}\nfunction createFormatContext(\n insertionMode,\n selectedValue,\n tagScope,\n viewTransition\n) {\n return {\n insertionMode: insertionMode,\n selectedValue: selectedValue,\n tagScope: tagScope,\n viewTransition: viewTransition\n };\n}\nfunction createRootFormatContext(namespaceURI) {\n return createFormatContext(\n \"http://www.w3.org/2000/svg\" === namespaceURI\n ? 4\n : \"http://www.w3.org/1998/Math/MathML\" === namespaceURI\n ? 5\n : 0,\n null,\n 0,\n null\n );\n}\nfunction getChildFormatContext(parentContext, type, props) {\n var subtreeScope = parentContext.tagScope & -25;\n switch (type) {\n case \"noscript\":\n return createFormatContext(2, null, subtreeScope | 1, null);\n case \"select\":\n return createFormatContext(\n 2,\n null != props.value ? props.value : props.defaultValue,\n subtreeScope,\n null\n );\n case \"svg\":\n return createFormatContext(4, null, subtreeScope, null);\n case \"picture\":\n return createFormatContext(2, null, subtreeScope | 2, null);\n case \"math\":\n return createFormatContext(5, null, subtreeScope, null);\n case \"foreignObject\":\n return createFormatContext(2, null, subtreeScope, null);\n case \"table\":\n return createFormatContext(6, null, subtreeScope, null);\n case \"thead\":\n case \"tbody\":\n case \"tfoot\":\n return createFormatContext(7, null, subtreeScope, null);\n case \"colgroup\":\n return createFormatContext(9, null, subtreeScope, null);\n case \"tr\":\n return createFormatContext(8, null, subtreeScope, null);\n case \"head\":\n if (2 > parentContext.insertionMode)\n return createFormatContext(3, null, subtreeScope, null);\n break;\n case \"html\":\n if (0 === parentContext.insertionMode)\n return createFormatContext(1, null, subtreeScope, null);\n }\n return 6 <= parentContext.insertionMode || 2 > parentContext.insertionMode\n ? createFormatContext(2, null, subtreeScope, null)\n : null !== parentContext.viewTransition ||\n parentContext.tagScope !== subtreeScope\n ? createFormatContext(\n parentContext.insertionMode,\n parentContext.selectedValue,\n subtreeScope,\n null\n )\n : parentContext;\n}\nfunction getSuspenseViewTransition(parentViewTransition) {\n return null === parentViewTransition\n ? null\n : {\n update: parentViewTransition.update,\n enter: \"none\",\n exit: \"none\",\n share: parentViewTransition.update,\n name: parentViewTransition.autoName,\n autoName: parentViewTransition.autoName,\n nameIdx: 0\n };\n}\nfunction getSuspenseFallbackFormatContext(resumableState, parentContext) {\n parentContext.tagScope & 32 && (resumableState.instructions |= 128);\n return createFormatContext(\n parentContext.insertionMode,\n parentContext.selectedValue,\n parentContext.tagScope | 12,\n getSuspenseViewTransition(parentContext.viewTransition)\n );\n}\nfunction getSuspenseContentFormatContext(resumableState, parentContext) {\n resumableState = getSuspenseViewTransition(parentContext.viewTransition);\n var subtreeScope = parentContext.tagScope | 16;\n null !== resumableState &&\n \"none\" !== resumableState.share &&\n (subtreeScope |= 64);\n return createFormatContext(\n parentContext.insertionMode,\n parentContext.selectedValue,\n subtreeScope,\n resumableState\n );\n}\nfunction makeId(resumableState, treeId, localId) {\n resumableState = \"_\" + resumableState.idPrefix + \"R_\" + treeId;\n 0 < localId && (resumableState += \"H\" + localId.toString(32));\n return resumableState + \"_\";\n}\nvar textSeparator = stringToPrecomputedChunk(\"\\x3c!-- --\\x3e\");\nfunction pushTextInstance(target, text, renderState, textEmbedded) {\n if (\"\" === text) return textEmbedded;\n textEmbedded && target.push(textSeparator);\n target.push(escapeTextForBrowser(text));\n return !0;\n}\nfunction pushViewTransitionAttributes(target, formatContext) {\n formatContext = formatContext.viewTransition;\n null !== formatContext &&\n (\"auto\" !== formatContext.name &&\n (pushStringAttribute(\n target,\n \"vt-name\",\n 0 === formatContext.nameIdx\n ? formatContext.name\n : formatContext.name + \"_\" + formatContext.nameIdx\n ),\n formatContext.nameIdx++),\n pushStringAttribute(target, \"vt-update\", formatContext.update),\n \"none\" !== formatContext.enter &&\n pushStringAttribute(target, \"vt-enter\", formatContext.enter),\n \"none\" !== formatContext.exit &&\n pushStringAttribute(target, \"vt-exit\", formatContext.exit),\n \"none\" !== formatContext.share &&\n pushStringAttribute(target, \"vt-share\", formatContext.share));\n}\nvar styleNameCache = new Map(),\n styleAttributeStart = stringToPrecomputedChunk(' style=\"'),\n styleAssign = stringToPrecomputedChunk(\":\"),\n styleSeparator = stringToPrecomputedChunk(\";\");\nfunction pushStyleAttribute(target, style) {\n if (\"object\" !== typeof style)\n throw Error(\n \"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.\"\n );\n var isFirst = !0,\n styleName;\n for (styleName in style)\n if (hasOwnProperty.call(style, styleName)) {\n var styleValue = style[styleName];\n if (\n null != styleValue &&\n \"boolean\" !== typeof styleValue &&\n \"\" !== styleValue\n ) {\n if (0 === styleName.indexOf(\"--\")) {\n var nameChunk = escapeTextForBrowser(styleName);\n styleValue = escapeTextForBrowser((\"\" + styleValue).trim());\n } else\n (nameChunk = styleNameCache.get(styleName)),\n void 0 === nameChunk &&\n ((nameChunk = stringToPrecomputedChunk(\n escapeTextForBrowser(\n styleName\n .replace(uppercasePattern, \"-$1\")\n .toLowerCase()\n .replace(msPattern, \"-ms-\")\n )\n )),\n styleNameCache.set(styleName, nameChunk)),\n (styleValue =\n \"number\" === typeof styleValue\n ? 0 === styleValue || unitlessNumbers.has(styleName)\n ? \"\" + styleValue\n : styleValue + \"px\"\n : escapeTextForBrowser((\"\" + styleValue).trim()));\n isFirst\n ? ((isFirst = !1),\n target.push(\n styleAttributeStart,\n nameChunk,\n styleAssign,\n styleValue\n ))\n : target.push(styleSeparator, nameChunk, styleAssign, styleValue);\n }\n }\n isFirst || target.push(attributeEnd);\n}\nvar attributeSeparator = stringToPrecomputedChunk(\" \"),\n attributeAssign = stringToPrecomputedChunk('=\"'),\n attributeEnd = stringToPrecomputedChunk('\"'),\n attributeEmptyString = stringToPrecomputedChunk('=\"\"');\nfunction pushBooleanAttribute(target, name, value) {\n value &&\n \"function\" !== typeof value &&\n \"symbol\" !== typeof value &&\n target.push(attributeSeparator, name, attributeEmptyString);\n}\nfunction pushStringAttribute(target, name, value) {\n \"function\" !== typeof value &&\n \"symbol\" !== typeof value &&\n \"boolean\" !== typeof value &&\n target.push(\n attributeSeparator,\n name,\n attributeAssign,\n escapeTextForBrowser(value),\n attributeEnd\n );\n}\nvar actionJavaScriptURL = stringToPrecomputedChunk(\n escapeTextForBrowser(\n \"javascript:throw new Error('React form unexpectedly submitted.')\"\n )\n ),\n startHiddenInputChunk = stringToPrecomputedChunk('<input type=\"hidden\"');\nfunction pushAdditionalFormField(value, key) {\n this.push(startHiddenInputChunk);\n validateAdditionalFormField(value);\n pushStringAttribute(this, \"name\", key);\n pushStringAttribute(this, \"value\", value);\n this.push(endOfStartTagSelfClosing);\n}\nfunction validateAdditionalFormField(value) {\n if (\"string\" !== typeof value)\n throw Error(\n \"File/Blob fields are not yet supported in progressive forms. Will fallback to client hydration.\"\n );\n}\nfunction getCustomFormFields(resumableState, formAction) {\n if (\"function\" === typeof formAction.$$FORM_ACTION) {\n var id = resumableState.nextFormID++;\n resumableState = resumableState.idPrefix + id;\n try {\n var customFields = formAction.$$FORM_ACTION(resumableState);\n if (customFields) {\n var formData = customFields.data;\n null != formData && formData.forEach(validateAdditionalFormField);\n }\n return customFields;\n } catch (x) {\n if (\"object\" === typeof x && null !== x && \"function\" === typeof x.then)\n throw x;\n }\n }\n return null;\n}\nfunction pushFormActionAttribute(\n target,\n resumableState,\n renderState,\n formAction,\n formEncType,\n formMethod,\n formTarget,\n name\n) {\n var formData = null;\n if (\"function\" === typeof formAction) {\n var customFields = getCustomFormFields(resumableState, formAction);\n null !== customFields\n ? ((name = customFields.name),\n (formAction = customFields.action || \"\"),\n (formEncType = customFields.encType),\n (formMethod = customFields.method),\n (formTarget = customFields.target),\n (formData = customFields.data))\n : (target.push(\n attributeSeparator,\n \"formAction\",\n attributeAssign,\n actionJavaScriptURL,\n attributeEnd\n ),\n (formTarget = formMethod = formEncType = formAction = name = null),\n injectFormReplayingRuntime(resumableState, renderState));\n }\n null != name && pushAttribute(target, \"name\", name);\n null != formAction && pushAttribute(target, \"formAction\", formAction);\n null != formEncType && pushAttribute(target, \"formEncType\", formEncType);\n null != formMethod && pushAttribute(target, \"formMethod\", formMethod);\n null != formTarget && pushAttribute(target, \"formTarget\", formTarget);\n return formData;\n}\nvar blobCache = null;\nfunction pushSrcObjectAttribute(target, blob) {\n null === blobCache && (blobCache = new WeakMap());\n var suspenseCache = blobCache,\n thenable = suspenseCache.get(blob);\n void 0 === thenable &&\n ((thenable = readAsDataURL(blob)),\n thenable.then(\n function (result) {\n thenable.status = \"fulfilled\";\n thenable.value = result;\n },\n function (error) {\n thenable.status = \"rejected\";\n thenable.reason = error;\n }\n ),\n suspenseCache.set(blob, thenable));\n if (\"rejected\" === thenable.status) throw thenable.reason;\n if (\"fulfilled\" !== thenable.status) throw thenable;\n target.push(\n attributeSeparator,\n \"src\",\n attributeAssign,\n escapeTextForBrowser(thenable.value),\n attributeEnd\n );\n}\nfunction pushAttribute(target, name, value) {\n switch (name) {\n case \"className\":\n pushStringAttribute(target, \"class\", value);\n break;\n case \"tabIndex\":\n pushStringAttribute(target, \"tabindex\", value);\n break;\n case \"dir\":\n case \"role\":\n case \"viewBox\":\n case \"width\":\n case \"height\":\n pushStringAttribute(target, name, value);\n break;\n case \"style\":\n pushStyleAttribute(target, value);\n break;\n case \"src\":\n if (\n \"object\" === typeof value &&\n null !== value &&\n \"function\" === typeof Blob &&\n value instanceof Blob\n ) {\n pushSrcObjectAttribute(target, value);\n break;\n }\n case \"href\":\n if (\"\" === value) break;\n case \"action\":\n case \"formAction\":\n if (\n null == value ||\n \"function\" === typeof value ||\n \"symbol\" === typeof value ||\n \"boolean\" === typeof value\n )\n break;\n value = sanitizeURL(\"\" + value);\n target.push(\n attributeSeparator,\n name,\n attributeAssign,\n escapeTextForBrowser(value),\n attributeEnd\n );\n break;\n case \"defaultValue\":\n case \"defaultChecked\":\n case \"innerHTML\":\n case \"suppressContentEditableWarning\":\n case \"suppressHydrationWarning\":\n case \"ref\":\n break;\n case \"autoFocus\":\n case \"multiple\":\n case \"muted\":\n pushBooleanAttribute(target, name.toLowerCase(), value);\n break;\n case \"xlinkHref\":\n if (\n \"function\" === typeof value ||\n \"symbol\" === typeof value ||\n \"boolean\" === typeof value\n )\n break;\n value = sanitizeURL(\"\" + value);\n target.push(\n attributeSeparator,\n \"xlink:href\",\n attributeAssign,\n escapeTextForBrowser(value),\n attributeEnd\n );\n break;\n case \"contentEditable\":\n case \"spellCheck\":\n case \"draggable\":\n case \"value\":\n case \"autoReverse\":\n case \"externalResourcesRequired\":\n case \"focusable\":\n case \"preserveAlpha\":\n \"function\" !== typeof value &&\n \"symbol\" !== typeof value &&\n target.push(\n attributeSeparator,\n name,\n attributeAssign,\n escapeTextForBrowser(value),\n attributeEnd\n );\n break;\n case \"inert\":\n case \"allowFullScreen\":\n case \"async\":\n case \"autoPlay\":\n case \"controls\":\n case \"default\":\n case \"defer\":\n case \"disabled\":\n case \"disablePictureInPicture\":\n case \"disableRemotePlayback\":\n case \"formNoValidate\":\n case \"hidden\":\n case \"loop\":\n case \"noModule\":\n case \"noValidate\":\n case \"open\":\n case \"playsInline\":\n case \"readOnly\":\n case \"required\":\n case \"reversed\":\n case \"scoped\":\n case \"seamless\":\n case \"itemScope\":\n value &&\n \"function\" !== typeof value &&\n \"symbol\" !== typeof value &&\n target.push(attributeSeparator, name, attributeEmptyString);\n break;\n case \"capture\":\n case \"download\":\n !0 === value\n ? target.push(attributeSeparator, name, attributeEmptyString)\n : !1 !== value &&\n \"function\" !== typeof value &&\n \"symbol\" !== typeof value &&\n target.push(\n attributeSeparator,\n name,\n attributeAssign,\n escapeTextForBrowser(value),\n attributeEnd\n );\n break;\n case \"cols\":\n case \"rows\":\n case \"size\":\n case \"span\":\n \"function\" !== typeof value &&\n \"symbol\" !== typeof value &&\n !isNaN(value) &&\n 1 <= value &&\n target.push(\n attributeSeparator,\n name,\n attributeAssign,\n escapeTextForBrowser(value),\n attributeEnd\n );\n break;\n case \"rowSpan\":\n case \"start\":\n \"function\" === typeof value ||\n \"symbol\" === typeof value ||\n isNaN(value) ||\n target.push(\n attributeSeparator,\n name,\n attributeAssign,\n escapeTextForBrowser(value),\n attributeEnd\n );\n break;\n case \"xlinkActuate\":\n pushStringAttribute(target, \"xlink:actuate\", value);\n break;\n case \"xlinkArcrole\":\n pushStringAttribute(target, \"xlink:arcrole\", value);\n break;\n case \"xlinkRole\":\n pushStringAttribute(target, \"xlink:role\", value);\n break;\n case \"xlinkShow\":\n pushStringAttribute(target, \"xlink:show\", value);\n break;\n case \"xlinkTitle\":\n pushStringAttribute(target, \"xlink:title\", value);\n break;\n case \"xlinkType\":\n pushStringAttribute(target, \"xlink:type\", value);\n break;\n case \"xmlBase\":\n pushStringAttribute(target, \"xml:base\", value);\n break;\n case \"xmlLang\":\n pushStringAttribute(target, \"xml:lang\", value);\n break;\n case \"xmlSpace\":\n pushStringAttribute(target, \"xml:space\", value);\n break;\n default:\n if (\n !(2 < name.length) ||\n (\"o\" !== name[0] && \"O\" !== name[0]) ||\n (\"n\" !== name[1] && \"N\" !== name[1])\n )\n if (((name = aliases.get(name) || name), isAttributeNameSafe(name))) {\n switch (typeof value) {\n case \"function\":\n case \"symbol\":\n return;\n case \"boolean\":\n var prefix$8 = name.toLowerCase().slice(0, 5);\n if (\"data-\" !== prefix$8 && \"aria-\" !== prefix$8) return;\n }\n target.push(\n attributeSeparator,\n name,\n attributeAssign,\n escapeTextForBrowser(value),\n attributeEnd\n );\n }\n }\n}\nvar endOfStartTag = stringToPrecomputedChunk(\">\"),\n endOfStartTagSelfClosing = stringToPrecomputedChunk(\"/>\");\nfunction pushInnerHTML(target, innerHTML, children) {\n if (null != innerHTML) {\n if (null != children)\n throw Error(\n \"Can only set one of `children` or `props.dangerouslySetInnerHTML`.\"\n );\n if (\"object\" !== typeof innerHTML || !(\"__html\" in innerHTML))\n throw Error(\n \"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.\"\n );\n innerHTML = innerHTML.__html;\n null !== innerHTML && void 0 !== innerHTML && target.push(\"\" + innerHTML);\n }\n}\nfunction flattenOptionChildren(children) {\n var content = \"\";\n React.Children.forEach(children, function (child) {\n null != child && (content += child);\n });\n return content;\n}\nvar selectedMarkerAttribute = stringToPrecomputedChunk(' selected=\"\"'),\n formReplayingRuntimeScript = stringToPrecomputedChunk(\n 'addEventListener(\"submit\",function(a){if(!a.defaultPrevented){var c=a.target,d=a.submitter,e=c.action,b=d;if(d){var f=d.getAttribute(\"formAction\");null!=f&&(e=f,b=null)}\"javascript:throw new Error(\\'React form unexpectedly submitted.\\')\"===e&&(a.preventDefault(),b?(a=document.createElement(\"input\"),a.name=b.name,a.value=b.value,b.parentNode.insertBefore(a,b),b=new FormData(c),a.parentNode.removeChild(a)):b=new FormData(c),a=c.ownerDocument||c,(a.$$reactFormReplay=a.$$reactFormReplay||[]).push(c,d,b))}});'\n );\nfunction injectFormReplayingRuntime(resumableState, renderState) {\n if (\n 0 === (resumableState.instructions & 16) &&\n !renderState.externalRuntimeScript\n ) {\n resumableState.instructions |= 16;\n var preamble = renderState.preamble,\n bootstrapChunks = renderState.bootstrapChunks;\n (preamble.htmlChunks || preamble.headChunks) && 0 === bootstrapChunks.length\n ? (bootstrapChunks.push(renderState.startInlineScript),\n pushCompletedShellIdAttribute(bootstrapChunks, resumableState),\n bootstrapChunks.push(\n endOfStartTag,\n formReplayingRuntimeScript,\n endInlineScript\n ))\n : bootstrapChunks.unshift(\n renderState.startInlineScript,\n endOfStartTag,\n formReplayingRuntimeScript,\n endInlineScript\n );\n }\n}\nvar formStateMarkerIsMatching = stringToPrecomputedChunk(\"\\x3c!--F!--\\x3e\"),\n formStateMarkerIsNotMatching = stringToPrecomputedChunk(\"\\x3c!--F--\\x3e\");\nfunction pushLinkImpl(target, props) {\n target.push(startChunkForTag(\"link\"));\n for (var propKey in props)\n if (hasOwnProperty.call(props, propKey)) {\n var propValue = props[propKey];\n if (null != propValue)\n switch (propKey) {\n case \"children\":\n case \"dangerouslySetInnerHTML\":\n throw Error(\n \"link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\"\n );\n default:\n pushAttribute(target, propKey, propValue);\n }\n }\n target.push(endOfStartTagSelfClosing);\n return null;\n}\nvar styleRegex = /(<\\/|<)(s)(tyle)/gi;\nfunction styleReplacer(match, prefix, s, suffix) {\n return \"\" + prefix + (\"s\" === s ? \"\\\\73 \" : \"\\\\53 \") + suffix;\n}\nfunction pushSelfClosing(target, props, tag, formatContext) {\n target.push(startChunkForTag(tag));\n for (var propKey in props)\n if (hasOwnProperty.call(props, propKey)) {\n var propValue = props[propKey];\n if (null != propValue)\n switch (propKey) {\n case \"children\":\n case \"dangerouslySetInnerHTML\":\n throw Error(\n tag +\n \" is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\"\n );\n default:\n pushAttribute(target, propKey, propValue);\n }\n }\n pushViewTransitionAttributes(target, formatContext);\n target.push(endOfStartTagSelfClosing);\n return null;\n}\nfunction pushTitleImpl(target, props) {\n target.push(startChunkForTag(\"title\"));\n var children = null,\n innerHTML = null,\n propKey;\n for (propKey in props)\n if (hasOwnProperty.call(props, propKey)) {\n var propValue = props[propKey];\n if (null != propValue)\n switch (propKey) {\n case \"children\":\n children = propValue;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML = propValue;\n break;\n default:\n pushAttribute(target, propKey, propValue);\n }\n }\n target.push(endOfStartTag);\n props = Array.isArray(children)\n ? 2 > children.length\n ? children[0]\n : null\n : children;\n \"function\" !== typeof props &&\n \"symbol\" !== typeof props &&\n null !== props &&\n void 0 !== props &&\n target.push(escapeTextForBrowser(\"\" + props));\n pushInnerHTML(target, innerHTML, children);\n target.push(endChunkForTag(\"title\"));\n return null;\n}\nvar headPreambleContributionChunk =\n stringToPrecomputedChunk(\"\\x3c!--head--\\x3e\"),\n bodyPreambleContributionChunk = stringToPrecomputedChunk(\"\\x3c!--body--\\x3e\"),\n htmlPreambleContributionChunk = stringToPrecomputedChunk(\"\\x3c!--html--\\x3e\");\nfunction pushScriptImpl(target, props) {\n target.push(startChunkForTag(\"script\"));\n var children = null,\n innerHTML = null,\n propKey;\n for (propKey in props)\n if (hasOwnProperty.call(props, propKey)) {\n var propValue = props[propKey];\n if (null != propValue)\n switch (propKey) {\n case \"children\":\n children = propValue;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML = propValue;\n break;\n default:\n pushAttribute(target, propKey, propValue);\n }\n }\n target.push(endOfStartTag);\n pushInnerHTML(target, innerHTML, children);\n \"string\" === typeof children &&\n target.push((\"\" + children).replace(scriptRegex, scriptReplacer));\n target.push(endChunkForTag(\"script\"));\n return null;\n}\nfunction pushStartSingletonElement(target, props, tag, formatContext) {\n target.push(startChunkForTag(tag));\n var innerHTML = (tag = null),\n propKey;\n for (propKey in props)\n if (hasOwnProperty.call(props, propKey)) {\n var propValue = props[propKey];\n if (null != propValue)\n switch (propKey) {\n case \"children\":\n tag = propValue;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML = propValue;\n break;\n default:\n pushAttribute(target, propKey, propValue);\n }\n }\n pushViewTransitionAttributes(target, formatContext);\n target.push(endOfStartTag);\n pushInnerHTML(target, innerHTML, tag);\n return tag;\n}\nfunction pushStartGenericElement(target, props, tag, formatContext) {\n target.push(startChunkForTag(tag));\n var innerHTML = (tag = null),\n propKey;\n for (propKey in props)\n if (hasOwnProperty.call(props, propKey)) {\n var propValue = props[propKey];\n if (null != propValue)\n switch (propKey) {\n case \"children\":\n tag = propValue;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML = propValue;\n break;\n default:\n pushAttribute(target, propKey, propValue);\n }\n }\n pushViewTransitionAttributes(target, formatContext);\n target.push(endOfStartTag);\n pushInnerHTML(target, innerHTML, tag);\n return \"string\" === typeof tag\n ? (target.push(escapeTextForBrowser(tag)), null)\n : tag;\n}\nvar leadingNewline = stringToPrecomputedChunk(\"\\n\"),\n VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\\.\\-\\d]*$/,\n validatedTagCache = new Map();\nfunction startChunkForTag(tag) {\n var tagStartChunk = validatedTagCache.get(tag);\n if (void 0 === tagStartChunk) {\n if (!VALID_TAG_REGEX.test(tag)) throw Error(\"Invalid tag: \" + tag);\n tagStartChunk = stringToPrecomputedChunk(\"<\" + tag);\n validatedTagCache.set(tag, tagStartChunk);\n }\n return tagStartChunk;\n}\nvar doctypeChunk = stringToPrecomputedChunk(\"<!DOCTYPE html>\");\nfunction pushStartInstance(\n target$jscomp$0,\n type,\n props,\n resumableState,\n renderState,\n preambleState,\n hoistableState,\n formatContext,\n textEmbedded\n) {\n switch (type) {\n case \"div\":\n case \"span\":\n case \"svg\":\n case \"path\":\n break;\n case \"a\":\n target$jscomp$0.push(startChunkForTag(\"a\"));\n var children = null,\n innerHTML = null,\n propKey;\n for (propKey in props)\n if (hasOwnProperty.call(props, propKey)) {\n var propValue = props[propKey];\n if (null != propValue)\n switch (propKey) {\n case \"children\":\n children = propValue;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML = propValue;\n break;\n case \"href\":\n \"\" === propValue\n ? pushStringAttribute(target$jscomp$0, \"href\", \"\")\n : pushAttribute(target$jscomp$0, propKey, propValue);\n break;\n default:\n pushAttribute(target$jscomp$0, propKey, propValue);\n }\n }\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTag);\n pushInnerHTML(target$jscomp$0, innerHTML, children);\n if (\"string\" === typeof children) {\n target$jscomp$0.push(escapeTextForBrowser(children));\n var JSCompiler_inline_result = null;\n } else JSCompiler_inline_result = children;\n return JSCompiler_inline_result;\n case \"g\":\n case \"p\":\n case \"li\":\n break;\n case \"select\":\n target$jscomp$0.push(startChunkForTag(\"select\"));\n var children$jscomp$0 = null,\n innerHTML$jscomp$0 = null,\n propKey$jscomp$0;\n for (propKey$jscomp$0 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$0)) {\n var propValue$jscomp$0 = props[propKey$jscomp$0];\n if (null != propValue$jscomp$0)\n switch (propKey$jscomp$0) {\n case \"children\":\n children$jscomp$0 = propValue$jscomp$0;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML$jscomp$0 = propValue$jscomp$0;\n break;\n case \"defaultValue\":\n case \"value\":\n break;\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$0,\n propValue$jscomp$0\n );\n }\n }\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTag);\n pushInnerHTML(target$jscomp$0, innerHTML$jscomp$0, children$jscomp$0);\n return children$jscomp$0;\n case \"option\":\n var selectedValue = formatContext.selectedValue;\n target$jscomp$0.push(startChunkForTag(\"option\"));\n var children$jscomp$1 = null,\n value = null,\n selected = null,\n innerHTML$jscomp$1 = null,\n propKey$jscomp$1;\n for (propKey$jscomp$1 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$1)) {\n var propValue$jscomp$1 = props[propKey$jscomp$1];\n if (null != propValue$jscomp$1)\n switch (propKey$jscomp$1) {\n case \"children\":\n children$jscomp$1 = propValue$jscomp$1;\n break;\n case \"selected\":\n selected = propValue$jscomp$1;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML$jscomp$1 = propValue$jscomp$1;\n break;\n case \"value\":\n value = propValue$jscomp$1;\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$1,\n propValue$jscomp$1\n );\n }\n }\n if (null != selectedValue) {\n var stringValue =\n null !== value\n ? \"\" + value\n : flattenOptionChildren(children$jscomp$1);\n if (isArrayImpl(selectedValue))\n for (var i = 0; i < selectedValue.length; i++) {\n if (\"\" + selectedValue[i] === stringValue) {\n target$jscomp$0.push(selectedMarkerAttribute);\n break;\n }\n }\n else\n \"\" + selectedValue === stringValue &&\n target$jscomp$0.push(selectedMarkerAttribute);\n } else selected && target$jscomp$0.push(selectedMarkerAttribute);\n target$jscomp$0.push(endOfStartTag);\n pushInnerHTML(target$jscomp$0, innerHTML$jscomp$1, children$jscomp$1);\n return children$jscomp$1;\n case \"textarea\":\n target$jscomp$0.push(startChunkForTag(\"textarea\"));\n var value$jscomp$0 = null,\n defaultValue = null,\n children$jscomp$2 = null,\n propKey$jscomp$2;\n for (propKey$jscomp$2 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$2)) {\n var propValue$jscomp$2 = props[propKey$jscomp$2];\n if (null != propValue$jscomp$2)\n switch (propKey$jscomp$2) {\n case \"children\":\n children$jscomp$2 = propValue$jscomp$2;\n break;\n case \"value\":\n value$jscomp$0 = propValue$jscomp$2;\n break;\n case \"defaultValue\":\n defaultValue = propValue$jscomp$2;\n break;\n case \"dangerouslySetInnerHTML\":\n throw Error(\n \"`dangerouslySetInnerHTML` does not make sense on <textarea>.\"\n );\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$2,\n propValue$jscomp$2\n );\n }\n }\n null === value$jscomp$0 &&\n null !== defaultValue &&\n (value$jscomp$0 = defaultValue);\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTag);\n if (null != children$jscomp$2) {\n if (null != value$jscomp$0)\n throw Error(\n \"If you supply `defaultValue` on a <textarea>, do not pass children.\"\n );\n if (isArrayImpl(children$jscomp$2)) {\n if (1 < children$jscomp$2.length)\n throw Error(\"<textarea> can only have at most one child.\");\n value$jscomp$0 = \"\" + children$jscomp$2[0];\n }\n value$jscomp$0 = \"\" + children$jscomp$2;\n }\n \"string\" === typeof value$jscomp$0 &&\n \"\\n\" === value$jscomp$0[0] &&\n target$jscomp$0.push(leadingNewline);\n null !== value$jscomp$0 &&\n target$jscomp$0.push(escapeTextForBrowser(\"\" + value$jscomp$0));\n return null;\n case \"input\":\n target$jscomp$0.push(startChunkForTag(\"input\"));\n var name = null,\n formAction = null,\n formEncType = null,\n formMethod = null,\n formTarget = null,\n value$jscomp$1 = null,\n defaultValue$jscomp$0 = null,\n checked = null,\n defaultChecked = null,\n propKey$jscomp$3;\n for (propKey$jscomp$3 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$3)) {\n var propValue$jscomp$3 = props[propKey$jscomp$3];\n if (null != propValue$jscomp$3)\n switch (propKey$jscomp$3) {\n case \"children\":\n case \"dangerouslySetInnerHTML\":\n throw Error(\n \"input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\"\n );\n case \"name\":\n name = propValue$jscomp$3;\n break;\n case \"formAction\":\n formAction = propValue$jscomp$3;\n break;\n case \"formEncType\":\n formEncType = propValue$jscomp$3;\n break;\n case \"formMethod\":\n formMethod = propValue$jscomp$3;\n break;\n case \"formTarget\":\n formTarget = propValue$jscomp$3;\n break;\n case \"defaultChecked\":\n defaultChecked = propValue$jscomp$3;\n break;\n case \"defaultValue\":\n defaultValue$jscomp$0 = propValue$jscomp$3;\n break;\n case \"checked\":\n checked = propValue$jscomp$3;\n break;\n case \"value\":\n value$jscomp$1 = propValue$jscomp$3;\n break;\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$3,\n propValue$jscomp$3\n );\n }\n }\n var formData = pushFormActionAttribute(\n target$jscomp$0,\n resumableState,\n renderState,\n formAction,\n formEncType,\n formMethod,\n formTarget,\n name\n );\n null !== checked\n ? pushBooleanAttribute(target$jscomp$0, \"checked\", checked)\n : null !== defaultChecked &&\n pushBooleanAttribute(target$jscomp$0, \"checked\", defaultChecked);\n null !== value$jscomp$1\n ? pushAttribute(target$jscomp$0, \"value\", value$jscomp$1)\n : null !== defaultValue$jscomp$0 &&\n pushAttribute(target$jscomp$0, \"value\", defaultValue$jscomp$0);\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTagSelfClosing);\n null != formData &&\n formData.forEach(pushAdditionalFormField, target$jscomp$0);\n return null;\n case \"button\":\n target$jscomp$0.push(startChunkForTag(\"button\"));\n var children$jscomp$3 = null,\n innerHTML$jscomp$2 = null,\n name$jscomp$0 = null,\n formAction$jscomp$0 = null,\n formEncType$jscomp$0 = null,\n formMethod$jscomp$0 = null,\n formTarget$jscomp$0 = null,\n propKey$jscomp$4;\n for (propKey$jscomp$4 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$4)) {\n var propValue$jscomp$4 = props[propKey$jscomp$4];\n if (null != propValue$jscomp$4)\n switch (propKey$jscomp$4) {\n case \"children\":\n children$jscomp$3 = propValue$jscomp$4;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML$jscomp$2 = propValue$jscomp$4;\n break;\n case \"name\":\n name$jscomp$0 = propValue$jscomp$4;\n break;\n case \"formAction\":\n formAction$jscomp$0 = propValue$jscomp$4;\n break;\n case \"formEncType\":\n formEncType$jscomp$0 = propValue$jscomp$4;\n break;\n case \"formMethod\":\n formMethod$jscomp$0 = propValue$jscomp$4;\n break;\n case \"formTarget\":\n formTarget$jscomp$0 = propValue$jscomp$4;\n break;\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$4,\n propValue$jscomp$4\n );\n }\n }\n var formData$jscomp$0 = pushFormActionAttribute(\n target$jscomp$0,\n resumableState,\n renderState,\n formAction$jscomp$0,\n formEncType$jscomp$0,\n formMethod$jscomp$0,\n formTarget$jscomp$0,\n name$jscomp$0\n );\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTag);\n null != formData$jscomp$0 &&\n formData$jscomp$0.forEach(pushAdditionalFormField, target$jscomp$0);\n pushInnerHTML(target$jscomp$0, innerHTML$jscomp$2, children$jscomp$3);\n if (\"string\" === typeof children$jscomp$3) {\n target$jscomp$0.push(escapeTextForBrowser(children$jscomp$3));\n var JSCompiler_inline_result$jscomp$0 = null;\n } else JSCompiler_inline_result$jscomp$0 = children$jscomp$3;\n return JSCompiler_inline_result$jscomp$0;\n case \"form\":\n target$jscomp$0.push(startChunkForTag(\"form\"));\n var children$jscomp$4 = null,\n innerHTML$jscomp$3 = null,\n formAction$jscomp$1 = null,\n formEncType$jscomp$1 = null,\n formMethod$jscomp$1 = null,\n formTarget$jscomp$1 = null,\n propKey$jscomp$5;\n for (propKey$jscomp$5 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$5)) {\n var propValue$jscomp$5 = props[propKey$jscomp$5];\n if (null != propValue$jscomp$5)\n switch (propKey$jscomp$5) {\n case \"children\":\n children$jscomp$4 = propValue$jscomp$5;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML$jscomp$3 = propValue$jscomp$5;\n break;\n case \"action\":\n formAction$jscomp$1 = propValue$jscomp$5;\n break;\n case \"encType\":\n formEncType$jscomp$1 = propValue$jscomp$5;\n break;\n case \"method\":\n formMethod$jscomp$1 = propValue$jscomp$5;\n break;\n case \"target\":\n formTarget$jscomp$1 = propValue$jscomp$5;\n break;\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$5,\n propValue$jscomp$5\n );\n }\n }\n var formData$jscomp$1 = null,\n formActionName = null;\n if (\"function\" === typeof formAction$jscomp$1) {\n var customFields = getCustomFormFields(\n resumableState,\n formAction$jscomp$1\n );\n null !== customFields\n ? ((formAction$jscomp$1 = customFields.action || \"\"),\n (formEncType$jscomp$1 = customFields.encType),\n (formMethod$jscomp$1 = customFields.method),\n (formTarget$jscomp$1 = customFields.target),\n (formData$jscomp$1 = customFields.data),\n (formActionName = customFields.name))\n : (target$jscomp$0.push(\n attributeSeparator,\n \"action\",\n attributeAssign,\n actionJavaScriptURL,\n attributeEnd\n ),\n (formTarget$jscomp$1 =\n formMethod$jscomp$1 =\n formEncType$jscomp$1 =\n formAction$jscomp$1 =\n null),\n injectFormReplayingRuntime(resumableState, renderState));\n }\n null != formAction$jscomp$1 &&\n pushAttribute(target$jscomp$0, \"action\", formAction$jscomp$1);\n null != formEncType$jscomp$1 &&\n pushAttribute(target$jscomp$0, \"encType\", formEncType$jscomp$1);\n null != formMethod$jscomp$1 &&\n pushAttribute(target$jscomp$0, \"method\", formMethod$jscomp$1);\n null != formTarget$jscomp$1 &&\n pushAttribute(target$jscomp$0, \"target\", formTarget$jscomp$1);\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTag);\n null !== formActionName &&\n (target$jscomp$0.push(startHiddenInputChunk),\n pushStringAttribute(target$jscomp$0, \"name\", formActionName),\n target$jscomp$0.push(endOfStartTagSelfClosing),\n null != formData$jscomp$1 &&\n formData$jscomp$1.forEach(pushAdditionalFormField, target$jscomp$0));\n pushInnerHTML(target$jscomp$0, innerHTML$jscomp$3, children$jscomp$4);\n if (\"string\" === typeof children$jscomp$4) {\n target$jscomp$0.push(escapeTextForBrowser(children$jscomp$4));\n var JSCompiler_inline_result$jscomp$1 = null;\n } else JSCompiler_inline_result$jscomp$1 = children$jscomp$4;\n return JSCompiler_inline_result$jscomp$1;\n case \"menuitem\":\n target$jscomp$0.push(startChunkForTag(\"menuitem\"));\n for (var propKey$jscomp$6 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$6)) {\n var propValue$jscomp$6 = props[propKey$jscomp$6];\n if (null != propValue$jscomp$6)\n switch (propKey$jscomp$6) {\n case \"children\":\n case \"dangerouslySetInnerHTML\":\n throw Error(\n \"menuitems cannot have `children` nor `dangerouslySetInnerHTML`.\"\n );\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$6,\n propValue$jscomp$6\n );\n }\n }\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTag);\n return null;\n case \"object\":\n target$jscomp$0.push(startChunkForTag(\"object\"));\n var children$jscomp$5 = null,\n innerHTML$jscomp$4 = null,\n propKey$jscomp$7;\n for (propKey$jscomp$7 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$7)) {\n var propValue$jscomp$7 = props[propKey$jscomp$7];\n if (null != propValue$jscomp$7)\n switch (propKey$jscomp$7) {\n case \"children\":\n children$jscomp$5 = propValue$jscomp$7;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML$jscomp$4 = propValue$jscomp$7;\n break;\n case \"data\":\n var sanitizedValue = sanitizeURL(\"\" + propValue$jscomp$7);\n if (\"\" === sanitizedValue) break;\n target$jscomp$0.push(\n attributeSeparator,\n \"data\",\n attributeAssign,\n escapeTextForBrowser(sanitizedValue),\n attributeEnd\n );\n break;\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$7,\n propValue$jscomp$7\n );\n }\n }\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTag);\n pushInnerHTML(target$jscomp$0, innerHTML$jscomp$4, children$jscomp$5);\n if (\"string\" === typeof children$jscomp$5) {\n target$jscomp$0.push(escapeTextForBrowser(children$jscomp$5));\n var JSCompiler_inline_result$jscomp$2 = null;\n } else JSCompiler_inline_result$jscomp$2 = children$jscomp$5;\n return JSCompiler_inline_result$jscomp$2;\n case \"title\":\n var noscriptTagInScope = formatContext.tagScope & 1,\n isFallback = formatContext.tagScope & 4;\n if (\n 4 === formatContext.insertionMode ||\n noscriptTagInScope ||\n null != props.itemProp\n )\n var JSCompiler_inline_result$jscomp$3 = pushTitleImpl(\n target$jscomp$0,\n props\n );\n else\n isFallback\n ? (JSCompiler_inline_result$jscomp$3 = null)\n : (pushTitleImpl(renderState.hoistableChunks, props),\n (JSCompiler_inline_result$jscomp$3 = void 0));\n return JSCompiler_inline_result$jscomp$3;\n case \"link\":\n var noscriptTagInScope$jscomp$0 = formatContext.tagScope & 1,\n isFallback$jscomp$0 = formatContext.tagScope & 4,\n rel = props.rel,\n href = props.href,\n precedence = props.precedence;\n if (\n 4 === formatContext.insertionMode ||\n noscriptTagInScope$jscomp$0 ||\n null != props.itemProp ||\n \"string\" !== typeof rel ||\n \"string\" !== typeof href ||\n \"\" === href\n ) {\n pushLinkImpl(target$jscomp$0, props);\n var JSCompiler_inline_result$jscomp$4 = null;\n } else if (\"stylesheet\" === props.rel)\n if (\n \"string\" !== typeof precedence ||\n null != props.disabled ||\n props.onLoad ||\n props.onError\n )\n JSCompiler_inline_result$jscomp$4 = pushLinkImpl(\n target$jscomp$0,\n props\n );\n else {\n var styleQueue = renderState.styles.get(precedence),\n resourceState = resumableState.styleResources.hasOwnProperty(href)\n ? resumableState.styleResources[href]\n : void 0;\n if (null !== resourceState) {\n resumableState.styleResources[href] = null;\n styleQueue ||\n ((styleQueue = {\n precedence: escapeTextForBrowser(precedence),\n rules: [],\n hrefs: [],\n sheets: new Map()\n }),\n renderState.styles.set(precedence, styleQueue));\n var resource = {\n state: 0,\n props: assign({}, props, {\n \"data-precedence\": props.precedence,\n precedence: null\n })\n };\n if (resourceState) {\n 2 === resourceState.length &&\n adoptPreloadCredentials(resource.props, resourceState);\n var preloadResource = renderState.preloads.stylesheets.get(href);\n preloadResource && 0 < preloadResource.length\n ? (preloadResource.length = 0)\n : (resource.state = 1);\n }\n styleQueue.sheets.set(href, resource);\n hoistableState && hoistableState.stylesheets.add(resource);\n } else if (styleQueue) {\n var resource$9 = styleQueue.sheets.get(href);\n resource$9 &&\n hoistableState &&\n hoistableState.stylesheets.add(resource$9);\n }\n textEmbedded && target$jscomp$0.push(textSeparator);\n JSCompiler_inline_result$jscomp$4 = null;\n }\n else\n props.onLoad || props.onError\n ? (JSCompiler_inline_result$jscomp$4 = pushLinkImpl(\n target$jscomp$0,\n props\n ))\n : (textEmbedded && target$jscomp$0.push(textSeparator),\n (JSCompiler_inline_result$jscomp$4 = isFallback$jscomp$0\n ? null\n : pushLinkImpl(renderState.hoistableChunks, props)));\n return JSCompiler_inline_result$jscomp$4;\n case \"script\":\n var noscriptTagInScope$jscomp$1 = formatContext.tagScope & 1,\n asyncProp = props.async;\n if (\n \"string\" !== typeof props.src ||\n !props.src ||\n !asyncProp ||\n \"function\" === typeof asyncProp ||\n \"symbol\" === typeof asyncProp ||\n props.onLoad ||\n props.onError ||\n 4 === formatContext.insertionMode ||\n noscriptTagInScope$jscomp$1 ||\n null != props.itemProp\n )\n var JSCompiler_inline_result$jscomp$5 = pushScriptImpl(\n target$jscomp$0,\n props\n );\n else {\n var key = props.src;\n if (\"module\" === props.type) {\n var resources = resumableState.moduleScriptResources;\n var preloads = renderState.preloads.moduleScripts;\n } else\n (resources = resumableState.scriptResources),\n (preloads = renderState.preloads.scripts);\n var resourceState$jscomp$0 = resources.hasOwnProperty(key)\n ? resources[key]\n : void 0;\n if (null !== resourceState$jscomp$0) {\n resources[key] = null;\n var scriptProps = props;\n if (resourceState$jscomp$0) {\n 2 === resourceState$jscomp$0.length &&\n ((scriptProps = assign({}, props)),\n adoptPreloadCredentials(scriptProps, resourceState$jscomp$0));\n var preloadResource$jscomp$0 = preloads.get(key);\n preloadResource$jscomp$0 && (preloadResource$jscomp$0.length = 0);\n }\n var resource$jscomp$0 = [];\n renderState.scripts.add(resource$jscomp$0);\n pushScriptImpl(resource$jscomp$0, scriptProps);\n }\n textEmbedded && target$jscomp$0.push(textSeparator);\n JSCompiler_inline_result$jscomp$5 = null;\n }\n return JSCompiler_inline_result$jscomp$5;\n case \"style\":\n var noscriptTagInScope$jscomp$2 = formatContext.tagScope & 1,\n precedence$jscomp$0 = props.precedence,\n href$jscomp$0 = props.href,\n nonce = props.nonce;\n if (\n 4 === formatContext.insertionMode ||\n noscriptTagInScope$jscomp$2 ||\n null != props.itemProp ||\n \"string\" !== typeof precedence$jscomp$0 ||\n \"string\" !== typeof href$jscomp$0 ||\n \"\" === href$jscomp$0\n ) {\n target$jscomp$0.push(startChunkForTag(\"style\"));\n var children$jscomp$6 = null,\n innerHTML$jscomp$5 = null,\n propKey$jscomp$8;\n for (propKey$jscomp$8 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$8)) {\n var propValue$jscomp$8 = props[propKey$jscomp$8];\n if (null != propValue$jscomp$8)\n switch (propKey$jscomp$8) {\n case \"children\":\n children$jscomp$6 = propValue$jscomp$8;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML$jscomp$5 = propValue$jscomp$8;\n break;\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$8,\n propValue$jscomp$8\n );\n }\n }\n target$jscomp$0.push(endOfStartTag);\n var child = Array.isArray(children$jscomp$6)\n ? 2 > children$jscomp$6.length\n ? children$jscomp$6[0]\n : null\n : children$jscomp$6;\n \"function\" !== typeof child &&\n \"symbol\" !== typeof child &&\n null !== child &&\n void 0 !== child &&\n target$jscomp$0.push((\"\" + child).replace(styleRegex, styleReplacer));\n pushInnerHTML(target$jscomp$0, innerHTML$jscomp$5, children$jscomp$6);\n target$jscomp$0.push(endChunkForTag(\"style\"));\n var JSCompiler_inline_result$jscomp$6 = null;\n } else {\n var styleQueue$jscomp$0 = renderState.styles.get(precedence$jscomp$0);\n if (\n null !==\n (resumableState.styleResources.hasOwnProperty(href$jscomp$0)\n ? resumableState.styleResources[href$jscomp$0]\n : void 0)\n ) {\n resumableState.styleResources[href$jscomp$0] = null;\n styleQueue$jscomp$0 ||\n ((styleQueue$jscomp$0 = {\n precedence: escapeTextForBrowser(precedence$jscomp$0),\n rules: [],\n hrefs: [],\n sheets: new Map()\n }),\n renderState.styles.set(precedence$jscomp$0, styleQueue$jscomp$0));\n var nonceStyle = renderState.nonce.style;\n if (!nonceStyle || nonceStyle === nonce) {\n styleQueue$jscomp$0.hrefs.push(escapeTextForBrowser(href$jscomp$0));\n var target = styleQueue$jscomp$0.rules,\n children$jscomp$7 = null,\n innerHTML$jscomp$6 = null,\n propKey$jscomp$9;\n for (propKey$jscomp$9 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$9)) {\n var propValue$jscomp$9 = props[propKey$jscomp$9];\n if (null != propValue$jscomp$9)\n switch (propKey$jscomp$9) {\n case \"children\":\n children$jscomp$7 = propValue$jscomp$9;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML$jscomp$6 = propValue$jscomp$9;\n }\n }\n var child$jscomp$0 = Array.isArray(children$jscomp$7)\n ? 2 > children$jscomp$7.length\n ? children$jscomp$7[0]\n : null\n : children$jscomp$7;\n \"function\" !== typeof child$jscomp$0 &&\n \"symbol\" !== typeof child$jscomp$0 &&\n null !== child$jscomp$0 &&\n void 0 !== child$jscomp$0 &&\n target.push(\n (\"\" + child$jscomp$0).replace(styleRegex, styleReplacer)\n );\n pushInnerHTML(target, innerHTML$jscomp$6, children$jscomp$7);\n }\n }\n styleQueue$jscomp$0 &&\n hoistableState &&\n hoistableState.styles.add(styleQueue$jscomp$0);\n textEmbedded && target$jscomp$0.push(textSeparator);\n JSCompiler_inline_result$jscomp$6 = void 0;\n }\n return JSCompiler_inline_result$jscomp$6;\n case \"meta\":\n var noscriptTagInScope$jscomp$3 = formatContext.tagScope & 1,\n isFallback$jscomp$1 = formatContext.tagScope & 4;\n if (\n 4 === formatContext.insertionMode ||\n noscriptTagInScope$jscomp$3 ||\n null != props.itemProp\n )\n var JSCompiler_inline_result$jscomp$7 = pushSelfClosing(\n target$jscomp$0,\n props,\n \"meta\",\n formatContext\n );\n else\n textEmbedded && target$jscomp$0.push(textSeparator),\n (JSCompiler_inline_result$jscomp$7 = isFallback$jscomp$1\n ? null\n : \"string\" === typeof props.charSet\n ? pushSelfClosing(\n renderState.charsetChunks,\n props,\n \"meta\",\n formatContext\n )\n : \"viewport\" === props.name\n ? pushSelfClosing(\n renderState.viewportChunks,\n props,\n \"meta\",\n formatContext\n )\n : pushSelfClosing(\n renderState.hoistableChunks,\n props,\n \"meta\",\n formatContext\n ));\n return JSCompiler_inline_result$jscomp$7;\n case \"listing\":\n case \"pre\":\n target$jscomp$0.push(startChunkForTag(type));\n var children$jscomp$8 = null,\n innerHTML$jscomp$7 = null,\n propKey$jscomp$10;\n for (propKey$jscomp$10 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$10)) {\n var propValue$jscomp$10 = props[propKey$jscomp$10];\n if (null != propValue$jscomp$10)\n switch (propKey$jscomp$10) {\n case \"children\":\n children$jscomp$8 = propValue$jscomp$10;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML$jscomp$7 = propValue$jscomp$10;\n break;\n default:\n pushAttribute(\n target$jscomp$0,\n propKey$jscomp$10,\n propValue$jscomp$10\n );\n }\n }\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTag);\n if (null != innerHTML$jscomp$7) {\n if (null != children$jscomp$8)\n throw Error(\n \"Can only set one of `children` or `props.dangerouslySetInnerHTML`.\"\n );\n if (\n \"object\" !== typeof innerHTML$jscomp$7 ||\n !(\"__html\" in innerHTML$jscomp$7)\n )\n throw Error(\n \"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.\"\n );\n var html = innerHTML$jscomp$7.__html;\n null !== html &&\n void 0 !== html &&\n (\"string\" === typeof html && 0 < html.length && \"\\n\" === html[0]\n ? target$jscomp$0.push(leadingNewline, html)\n : target$jscomp$0.push(\"\" + html));\n }\n \"string\" === typeof children$jscomp$8 &&\n \"\\n\" === children$jscomp$8[0] &&\n target$jscomp$0.push(leadingNewline);\n return children$jscomp$8;\n case \"img\":\n var pictureOrNoScriptTagInScope = formatContext.tagScope & 3,\n src = props.src,\n srcSet = props.srcSet;\n if (\n !(\n \"lazy\" === props.loading ||\n (!src && !srcSet) ||\n (\"string\" !== typeof src && null != src) ||\n (\"string\" !== typeof srcSet && null != srcSet) ||\n \"low\" === props.fetchPriority ||\n pictureOrNoScriptTagInScope\n ) &&\n (\"string\" !== typeof src ||\n \":\" !== src[4] ||\n (\"d\" !== src[0] && \"D\" !== src[0]) ||\n (\"a\" !== src[1] && \"A\" !== src[1]) ||\n (\"t\" !== src[2] && \"T\" !== src[2]) ||\n (\"a\" !== src[3] && \"A\" !== src[3])) &&\n (\"string\" !== typeof srcSet ||\n \":\" !== srcSet[4] ||\n (\"d\" !== srcSet[0] && \"D\" !== srcSet[0]) ||\n (\"a\" !== srcSet[1] && \"A\" !== srcSet[1]) ||\n (\"t\" !== srcSet[2] && \"T\" !== srcSet[2]) ||\n (\"a\" !== srcSet[3] && \"A\" !== srcSet[3]))\n ) {\n null !== hoistableState &&\n formatContext.tagScope & 64 &&\n (hoistableState.suspenseyImages = !0);\n var sizes = \"string\" === typeof props.sizes ? props.sizes : void 0,\n key$jscomp$0 = srcSet ? srcSet + \"\\n\" + (sizes || \"\") : src,\n promotablePreloads = renderState.preloads.images,\n resource$jscomp$1 = promotablePreloads.get(key$jscomp$0);\n if (resource$jscomp$1) {\n if (\n \"high\" === props.fetchPriority ||\n 10 > renderState.highImagePreloads.size\n )\n promotablePreloads.delete(key$jscomp$0),\n renderState.highImagePreloads.add(resource$jscomp$1);\n } else if (\n !resumableState.imageResources.hasOwnProperty(key$jscomp$0)\n ) {\n resumableState.imageResources[key$jscomp$0] = PRELOAD_NO_CREDS;\n var input = props.crossOrigin;\n var JSCompiler_inline_result$jscomp$8 =\n \"string\" === typeof input\n ? \"use-credentials\" === input\n ? input\n : \"\"\n : void 0;\n var headers = renderState.headers,\n header;\n headers &&\n 0 < headers.remainingCapacity &&\n \"string\" !== typeof props.srcSet &&\n (\"high\" === props.fetchPriority ||\n 500 > headers.highImagePreloads.length) &&\n ((header = getPreloadAsHeader(src, \"image\", {\n imageSrcSet: props.srcSet,\n imageSizes: props.sizes,\n crossOrigin: JSCompiler_inline_result$jscomp$8,\n integrity: props.integrity,\n nonce: props.nonce,\n type: props.type,\n fetchPriority: props.fetchPriority,\n referrerPolicy: props.refererPolicy\n })),\n 0 <= (headers.remainingCapacity -= header.length + 2))\n ? ((renderState.resets.image[key$jscomp$0] = PRELOAD_NO_CREDS),\n headers.highImagePreloads && (headers.highImagePreloads += \", \"),\n (headers.highImagePreloads += header))\n : ((resource$jscomp$1 = []),\n pushLinkImpl(resource$jscomp$1, {\n rel: \"preload\",\n as: \"image\",\n href: srcSet ? void 0 : src,\n imageSrcSet: srcSet,\n imageSizes: sizes,\n crossOrigin: JSCompiler_inline_result$jscomp$8,\n integrity: props.integrity,\n type: props.type,\n fetchPriority: props.fetchPriority,\n referrerPolicy: props.referrerPolicy\n }),\n \"high\" === props.fetchPriority ||\n 10 > renderState.highImagePreloads.size\n ? renderState.highImagePreloads.add(resource$jscomp$1)\n : (renderState.bulkPreloads.add(resource$jscomp$1),\n promotablePreloads.set(key$jscomp$0, resource$jscomp$1)));\n }\n }\n return pushSelfClosing(target$jscomp$0, props, \"img\", formatContext);\n case \"base\":\n case \"area\":\n case \"br\":\n case \"col\":\n case \"embed\":\n case \"hr\":\n case \"keygen\":\n case \"param\":\n case \"source\":\n case \"track\":\n case \"wbr\":\n return pushSelfClosing(target$jscomp$0, props, type, formatContext);\n case \"annotation-xml\":\n case \"color-profile\":\n case \"font-face\":\n case \"font-face-src\":\n case \"font-face-uri\":\n case \"font-face-format\":\n case \"font-face-name\":\n case \"missing-glyph\":\n break;\n case \"head\":\n if (2 > formatContext.insertionMode) {\n var preamble = preambleState || renderState.preamble;\n if (preamble.headChunks)\n throw Error(\"The `<head>` tag may only be rendered once.\");\n null !== preambleState &&\n target$jscomp$0.push(headPreambleContributionChunk);\n preamble.headChunks = [];\n var JSCompiler_inline_result$jscomp$9 = pushStartSingletonElement(\n preamble.headChunks,\n props,\n \"head\",\n formatContext\n );\n } else\n JSCompiler_inline_result$jscomp$9 = pushStartGenericElement(\n target$jscomp$0,\n props,\n \"head\",\n formatContext\n );\n return JSCompiler_inline_result$jscomp$9;\n case \"body\":\n if (2 > formatContext.insertionMode) {\n var preamble$jscomp$0 = preambleState || renderState.preamble;\n if (preamble$jscomp$0.bodyChunks)\n throw Error(\"The `<body>` tag may only be rendered once.\");\n null !== preambleState &&\n target$jscomp$0.push(bodyPreambleContributionChunk);\n preamble$jscomp$0.bodyChunks = [];\n var JSCompiler_inline_result$jscomp$10 = pushStartSingletonElement(\n preamble$jscomp$0.bodyChunks,\n props,\n \"body\",\n formatContext\n );\n } else\n JSCompiler_inline_result$jscomp$10 = pushStartGenericElement(\n target$jscomp$0,\n props,\n \"body\",\n formatContext\n );\n return JSCompiler_inline_result$jscomp$10;\n case \"html\":\n if (0 === formatContext.insertionMode) {\n var preamble$jscomp$1 = preambleState || renderState.preamble;\n if (preamble$jscomp$1.htmlChunks)\n throw Error(\"The `<html>` tag may only be rendered once.\");\n null !== preambleState &&\n target$jscomp$0.push(htmlPreambleContributionChunk);\n preamble$jscomp$1.htmlChunks = [doctypeChunk];\n var JSCompiler_inline_result$jscomp$11 = pushStartSingletonElement(\n preamble$jscomp$1.htmlChunks,\n props,\n \"html\",\n formatContext\n );\n } else\n JSCompiler_inline_result$jscomp$11 = pushStartGenericElement(\n target$jscomp$0,\n props,\n \"html\",\n formatContext\n );\n return JSCompiler_inline_result$jscomp$11;\n default:\n if (-1 !== type.indexOf(\"-\")) {\n target$jscomp$0.push(startChunkForTag(type));\n var children$jscomp$9 = null,\n innerHTML$jscomp$8 = null,\n propKey$jscomp$11;\n for (propKey$jscomp$11 in props)\n if (hasOwnProperty.call(props, propKey$jscomp$11)) {\n var propValue$jscomp$11 = props[propKey$jscomp$11];\n if (null != propValue$jscomp$11) {\n var attributeName = propKey$jscomp$11;\n switch (propKey$jscomp$11) {\n case \"children\":\n children$jscomp$9 = propValue$jscomp$11;\n break;\n case \"dangerouslySetInnerHTML\":\n innerHTML$jscomp$8 = propValue$jscomp$11;\n break;\n case \"style\":\n pushStyleAttribute(target$jscomp$0, propValue$jscomp$11);\n break;\n case \"suppressContentEditableWarning\":\n case \"suppressHydrationWarning\":\n case \"ref\":\n break;\n case \"className\":\n attributeName = \"class\";\n default:\n if (\n isAttributeNameSafe(propKey$jscomp$11) &&\n \"function\" !== typeof propValue$jscomp$11 &&\n \"symbol\" !== typeof propValue$jscomp$11 &&\n !1 !== propValue$jscomp$11\n ) {\n if (!0 === propValue$jscomp$11) propValue$jscomp$11 = \"\";\n else if (\"object\" === typeof propValue$jscomp$11) continue;\n target$jscomp$0.push(\n attributeSeparator,\n attributeName,\n attributeAssign,\n escapeTextForBrowser(propValue$jscomp$11),\n attributeEnd\n );\n }\n }\n }\n }\n pushViewTransitionAttributes(target$jscomp$0, formatContext);\n target$jscomp$0.push(endOfStartTag);\n pushInnerHTML(target$jscomp$0, innerHTML$jscomp$8, children$jscomp$9);\n return children$jscomp$9;\n }\n }\n return pushStartGenericElement(target$jscomp$0, props, type, formatContext);\n}\nvar endTagCache = new Map();\nfunction endChunkForTag(tag) {\n var chunk = endTagCache.get(tag);\n void 0 === chunk &&\n ((chunk = stringToPrecomputedChunk(\"</\" + tag + \">\")),\n endTagCache.set(tag, chunk));\n return chunk;\n}\nfunction hoistPreambleState(renderState, preambleState) {\n renderState = renderState.preamble;\n null === renderState.htmlChunks &&\n preambleState.htmlChunks &&\n (renderState.htmlChunks = preambleState.htmlChunks);\n null === renderState.headChunks &&\n preambleState.headChunks &&\n (renderState.headChunks = preambleState.headChunks);\n null === renderState.bodyChunks &&\n preambleState.bodyChunks &&\n (renderState.bodyChunks = preambleState.bodyChunks);\n}\nfunction writeBootstrap(destination, renderState) {\n renderState = renderState.bootstrapChunks;\n for (var i = 0; i < renderState.length - 1; i++)\n writeChunk(destination, renderState[i]);\n return i < renderState.length\n ? ((i = renderState[i]),\n (renderState.length = 0),\n writeChunkAndReturn(destination, i))\n : !0;\n}\nvar shellTimeRuntimeScript = stringToPrecomputedChunk(\n \"requestAnimationFrame(function(){$RT=performance.now()});\"\n ),\n placeholder1 = stringToPrecomputedChunk('<template id=\"'),\n placeholder2 = stringToPrecomputedChunk('\"></template>'),\n startActivityBoundary = stringToPrecomputedChunk(\"\\x3c!--&--\\x3e\"),\n endActivityBoundary = stringToPrecomputedChunk(\"\\x3c!--/&--\\x3e\"),\n startCompletedSuspenseBoundary = stringToPrecomputedChunk(\"\\x3c!--$--\\x3e\"),\n startPendingSuspenseBoundary1 = stringToPrecomputedChunk(\n '\\x3c!--$?--\\x3e<template id=\"'\n ),\n startPendingSuspenseBoundary2 = stringToPrecomputedChunk('\"></template>'),\n startClientRenderedSuspenseBoundary =\n stringToPrecomputedChunk(\"\\x3c!--$!--\\x3e\"),\n endSuspenseBoundary = stringToPrecomputedChunk(\"\\x3c!--/$--\\x3e\"),\n clientRenderedSuspenseBoundaryError1 = stringToPrecomputedChunk(\"<template\"),\n clientRenderedSuspenseBoundaryErrorAttrInterstitial =\n stringToPrecomputedChunk('\"'),\n clientRenderedSuspenseBoundaryError1A =\n stringToPrecomputedChunk(' data-dgst=\"');\nstringToPrecomputedChunk(' data-msg=\"');\nstringToPrecomputedChunk(' data-stck=\"');\nstringToPrecomputedChunk(' data-cstck=\"');\nvar clientRenderedSuspenseBoundaryError2 =\n stringToPrecomputedChunk(\"></template>\");\nfunction writeStartPendingSuspenseBoundary(destination, renderState, id) {\n writeChunk(destination, startPendingSuspenseBoundary1);\n if (null === id)\n throw Error(\n \"An ID must have been assigned before we can complete the boundary.\"\n );\n writeChunk(destination, renderState.boundaryPrefix);\n writeChunk(destination, id.toString(16));\n return writeChunkAndReturn(destination, startPendingSuspenseBoundary2);\n}\nvar startSegmentHTML = stringToPrecomputedChunk('<div hidden id=\"'),\n startSegmentHTML2 = stringToPrecomputedChunk('\">'),\n endSegmentHTML = stringToPrecomputedChunk(\"</div>\"),\n startSegmentSVG = stringToPrecomputedChunk(\n '<svg aria-hidden=\"true\" style=\"display:none\" id=\"'\n ),\n startSegmentSVG2 = stringToPrecomputedChunk('\">'),\n endSegmentSVG = stringToPrecomputedChunk(\"</svg>\"),\n startSegmentMathML = stringToPrecomputedChunk(\n '<math aria-hidden=\"true\" style=\"display:none\" id=\"'\n ),\n startSegmentMathML2 = stringToPrecomputedChunk('\">'),\n endSegmentMathML = stringToPrecomputedChunk(\"</math>\"),\n startSegmentTable = stringToPrecomputedChunk('<table hidden id=\"'),\n startSegmentTable2 = stringToPrecomputedChunk('\">'),\n endSegmentTable = stringToPrecomputedChunk(\"</table>\"),\n startSegmentTableBody = stringToPrecomputedChunk('<table hidden><tbody id=\"'),\n startSegmentTableBody2 = stringToPrecomputedChunk('\">'),\n endSegmentTableBody = stringToPrecomputedChunk(\"</tbody></table>\"),\n startSegmentTableRow = stringToPrecomputedChunk('<table hidden><tr id=\"'),\n startSegmentTableRow2 = stringToPrecomputedChunk('\">'),\n endSegmentTableRow = stringToPrecomputedChunk(\"</tr></table>\"),\n startSegmentColGroup = stringToPrecomputedChunk(\n '<table hidden><colgroup id=\"'\n ),\n startSegmentColGroup2 = stringToPrecomputedChunk('\">'),\n endSegmentColGroup = stringToPrecomputedChunk(\"</colgroup></table>\");\nfunction writeStartSegment(destination, renderState, formatContext, id) {\n switch (formatContext.insertionMode) {\n case 0:\n case 1:\n case 3:\n case 2:\n return (\n writeChunk(destination, startSegmentHTML),\n writeChunk(destination, renderState.segmentPrefix),\n writeChunk(destination, id.toString(16)),\n writeChunkAndReturn(destination, startSegmentHTML2)\n );\n case 4:\n return (\n writeChunk(destination, startSegmentSVG),\n writeChunk(destination, renderState.segmentPrefix),\n writeChunk(destination, id.toString(16)),\n writeChunkAndReturn(destination, startSegmentSVG2)\n );\n case 5:\n return (\n writeChunk(destination, startSegmentMathML),\n writeChunk(destination, renderState.segmentPrefix),\n writeChunk(destination, id.toString(16)),\n writeChunkAndReturn(destination, startSegmentMathML2)\n );\n case 6:\n return (\n writeChunk(destination, startSegmentTable),\n writeChunk(destination, renderState.segmentPrefix),\n writeChunk(destination, id.toString(16)),\n writeChunkAndReturn(destination, startSegmentTable2)\n );\n case 7:\n return (\n writeChunk(destination, startSegmentTableBody),\n writeChunk(destination, renderState.segmentPrefix),\n writeChunk(destination, id.toString(16)),\n writeChunkAndReturn(destination, startSegmentTableBody2)\n );\n case 8:\n return (\n writeChunk(destination, startSegmentTableRow),\n writeChunk(destination, renderState.segmentPrefix),\n writeChunk(destination, id.toString(16)),\n writeChunkAndReturn(destination, startSegmentTableRow2)\n );\n case 9:\n return (\n writeChunk(destination, startSegmentColGroup),\n writeChunk(destination, renderState.segmentPrefix),\n writeChunk(destination, id.toString(16)),\n writeChunkAndReturn(destination, startSegmentColGroup2)\n );\n default:\n throw Error(\"Unknown insertion mode. This is a bug in React.\");\n }\n}\nfunction writeEndSegment(destination, formatContext) {\n switch (formatContext.insertionMode) {\n case 0:\n case 1:\n case 3:\n case 2:\n return writeChunkAndReturn(destination, endSegmentHTML);\n case 4:\n return writeChunkAndReturn(destination, endSegmentSVG);\n case 5:\n return writeChunkAndReturn(destination, endSegmentMathML);\n case 6:\n return writeChunkAndReturn(destination, endSegmentTable);\n case 7:\n return writeChunkAndReturn(destination, endSegmentTableBody);\n case 8:\n return writeChunkAndReturn(destination, endSegmentTableRow);\n case 9:\n return writeChunkAndReturn(destination, endSegmentColGroup);\n default:\n throw Error(\"Unknown insertion mode. This is a bug in React.\");\n }\n}\nvar completeSegmentScript1Full = stringToPrecomputedChunk(\n '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS(\"'\n ),\n completeSegmentScript1Partial = stringToPrecomputedChunk('$RS(\"'),\n completeSegmentScript2 = stringToPrecomputedChunk('\",\"'),\n completeSegmentScriptEnd = stringToPrecomputedChunk('\")\\x3c/script>'),\n completeSegmentData1 = stringToPrecomputedChunk(\n '<template data-rsi=\"\" data-sid=\"'\n ),\n completeSegmentData2 = stringToPrecomputedChunk('\" data-pid=\"'),\n completeBoundaryScriptFunctionOnly = stringToPrecomputedChunk(\n '$RB=[];$RV=function(a){$RT=performance.now();for(var b=0;b<a.length;b+=2){var c=a[b],e=a[b+1];null!==e.parentNode&&e.parentNode.removeChild(e);var f=c.parentNode;if(f){var g=c.previousSibling,h=0;do{if(c&&8===c.nodeType){var d=c.data;if(\"/$\"===d||\"/&\"===d)if(0===h)break;else h--;else\"$\"!==d&&\"$?\"!==d&&\"$~\"!==d&&\"$!\"!==d&&\"&\"!==d||h++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;e.firstChild;)f.insertBefore(e.firstChild,c);g.data=\"$\";g._reactRetry&&requestAnimationFrame(g._reactRetry)}}a.length=0};\\n$RC=function(a,b){if(b=document.getElementById(b))(a=document.getElementById(a))?(a.previousSibling.data=\"$~\",$RB.push(a,b),2===$RB.length&&(\"number\"!==typeof $RT?requestAnimationFrame($RV.bind(null,$RB)):(a=performance.now(),setTimeout($RV.bind(null,$RB),2300>a&&2E3<a?2300-a:$RT+300-a)))):b.parentNode.removeChild(b)};'\n ),\n completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC(\"'),\n completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk(\n '$RM=new Map;$RR=function(n,w,p){function u(q){this._p=null;q()}for(var r=new Map,t=document,h,b,e=t.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),v=[],k=0;b=e[k++];)\"not all\"===b.getAttribute(\"media\")?v.push(b):(\"LINK\"===b.tagName&&$RM.set(b.getAttribute(\"href\"),b),r.set(b.dataset.precedence,h=b));e=0;b=[];var l,a;for(k=!0;;){if(k){var f=p[e++];if(!f){k=!1;e=0;continue}var c=!1,m=0;var d=f[m++];if(a=$RM.get(d)){var g=a._p;c=!0}else{a=t.createElement(\"link\");a.href=d;a.rel=\\n\"stylesheet\";for(a.dataset.precedence=l=f[m++];g=f[m++];)a.setAttribute(g,f[m++]);g=a._p=new Promise(function(q,x){a.onload=u.bind(a,q);a.onerror=u.bind(a,x)});$RM.set(d,a)}d=a.getAttribute(\"media\");!g||d&&!matchMedia(d).matches||b.push(g);if(c)continue}else{a=v[e++];if(!a)break;l=a.getAttribute(\"data-precedence\");a.removeAttribute(\"media\")}c=r.get(l)||h;c===h&&(h=a);r.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=t.head,c.insertBefore(a,c.firstChild))}if(p=document.getElementById(n))p.previousSibling.data=\\n\"$~\";Promise.all(b).then($RC.bind(null,n,w),$RX.bind(null,n,\"CSS failed to load\"))};$RR(\"'\n ),\n completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk('$RR(\"'),\n completeBoundaryScript2 = stringToPrecomputedChunk('\",\"'),\n completeBoundaryScript3a = stringToPrecomputedChunk('\",'),\n completeBoundaryScript3b = stringToPrecomputedChunk('\"'),\n completeBoundaryScriptEnd = stringToPrecomputedChunk(\")\\x3c/script>\"),\n completeBoundaryData1 = stringToPrecomputedChunk(\n '<template data-rci=\"\" data-bid=\"'\n ),\n completeBoundaryWithStylesData1 = stringToPrecomputedChunk(\n '<template data-rri=\"\" data-bid=\"'\n ),\n completeBoundaryData2 = stringToPrecomputedChunk('\" data-sid=\"'),\n completeBoundaryData3a = stringToPrecomputedChunk('\" data-sty=\"'),\n clientRenderScriptFunctionOnly = stringToPrecomputedChunk(\n '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data=\"$!\",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};'\n ),\n clientRenderScript1Full = stringToPrecomputedChunk(\n '$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data=\"$!\",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX(\"'\n ),\n clientRenderScript1Partial = stringToPrecomputedChunk('$RX(\"'),\n clientRenderScript1A = stringToPrecomputedChunk('\"'),\n clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(\",\"),\n clientRenderScriptEnd = stringToPrecomputedChunk(\")\\x3c/script>\"),\n clientRenderData1 = stringToPrecomputedChunk(\n '<template data-rxi=\"\" data-bid=\"'\n ),\n clientRenderData2 = stringToPrecomputedChunk('\" data-dgst=\"');\nstringToPrecomputedChunk('\" data-msg=\"');\nstringToPrecomputedChunk('\" data-stck=\"');\nstringToPrecomputedChunk('\" data-cstck=\"');\nvar regexForJSStringsInInstructionScripts = /[<\\u2028\\u2029]/g;\nfunction escapeJSStringsForInstructionScripts(input) {\n return JSON.stringify(input).replace(\n regexForJSStringsInInstructionScripts,\n function (match) {\n switch (match) {\n case \"<\":\n return \"\\\\u003c\";\n case \"\\u2028\":\n return \"\\\\u2028\";\n case \"\\u2029\":\n return \"\\\\u2029\";\n default:\n throw Error(\n \"escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React\"\n );\n }\n }\n );\n}\nvar regexForJSStringsInScripts = /[&><\\u2028\\u2029]/g;\nfunction escapeJSObjectForInstructionScripts(input) {\n return JSON.stringify(input).replace(\n regexForJSStringsInScripts,\n function (match) {\n switch (match) {\n case \"&\":\n return \"\\\\u0026\";\n case \">\":\n return \"\\\\u003e\";\n case \"<\":\n return \"\\\\u003c\";\n case \"\\u2028\":\n return \"\\\\u2028\";\n case \"\\u2029\":\n return \"\\\\u2029\";\n default:\n throw Error(\n \"escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React\"\n );\n }\n }\n );\n}\nvar lateStyleTagResourceOpen1 = stringToPrecomputedChunk(\n ' media=\"not all\" data-precedence=\"'\n ),\n lateStyleTagResourceOpen2 = stringToPrecomputedChunk('\" data-href=\"'),\n lateStyleTagResourceOpen3 = stringToPrecomputedChunk('\">'),\n lateStyleTagTemplateClose = stringToPrecomputedChunk(\"</style>\"),\n currentlyRenderingBoundaryHasStylesToHoist = !1,\n destinationHasCapacity = !0;\nfunction flushStyleTagsLateForBoundary(styleQueue) {\n var rules = styleQueue.rules,\n hrefs = styleQueue.hrefs,\n i = 0;\n if (hrefs.length) {\n writeChunk(this, currentlyFlushingRenderState.startInlineStyle);\n writeChunk(this, lateStyleTagResourceOpen1);\n writeChunk(this, styleQueue.precedence);\n for (writeChunk(this, lateStyleTagResourceOpen2); i < hrefs.length - 1; i++)\n writeChunk(this, hrefs[i]), writeChunk(this, spaceSeparator);\n writeChunk(this, hrefs[i]);\n writeChunk(this, lateStyleTagResourceOpen3);\n for (i = 0; i < rules.length; i++) writeChunk(this, rules[i]);\n destinationHasCapacity = writeChunkAndReturn(\n this,\n lateStyleTagTemplateClose\n );\n currentlyRenderingBoundaryHasStylesToHoist = !0;\n rules.length = 0;\n hrefs.length = 0;\n }\n}\nfunction hasStylesToHoist(stylesheet) {\n return 2 !== stylesheet.state\n ? (currentlyRenderingBoundaryHasStylesToHoist = !0)\n : !1;\n}\nfunction writeHoistablesForBoundary(destination, hoistableState, renderState) {\n currentlyRenderingBoundaryHasStylesToHoist = !1;\n destinationHasCapacity = !0;\n currentlyFlushingRenderState = renderState;\n hoistableState.styles.forEach(flushStyleTagsLateForBoundary, destination);\n currentlyFlushingRenderState = null;\n hoistableState.stylesheets.forEach(hasStylesToHoist);\n currentlyRenderingBoundaryHasStylesToHoist &&\n (renderState.stylesToHoist = !0);\n return destinationHasCapacity;\n}\nfunction flushResource(resource) {\n for (var i = 0; i < resource.length; i++) writeChunk(this, resource[i]);\n resource.length = 0;\n}\nvar stylesheetFlushingQueue = [];\nfunction flushStyleInPreamble(stylesheet) {\n pushLinkImpl(stylesheetFlushingQueue, stylesheet.props);\n for (var i = 0; i < stylesheetFlushingQueue.length; i++)\n writeChunk(this, stylesheetFlushingQueue[i]);\n stylesheetFlushingQueue.length = 0;\n stylesheet.state = 2;\n}\nvar styleTagResourceOpen1 = stringToPrecomputedChunk(' data-precedence=\"'),\n styleTagResourceOpen2 = stringToPrecomputedChunk('\" data-href=\"'),\n spaceSeparator = stringToPrecomputedChunk(\" \"),\n styleTagResourceOpen3 = stringToPrecomputedChunk('\">'),\n styleTagResourceClose = stringToPrecomputedChunk(\"</style>\");\nfunction flushStylesInPreamble(styleQueue) {\n var hasStylesheets = 0 < styleQueue.sheets.size;\n styleQueue.sheets.forEach(flushStyleInPreamble, this);\n styleQueue.sheets.clear();\n var rules = styleQueue.rules,\n hrefs = styleQueue.hrefs;\n if (!hasStylesheets || hrefs.length) {\n writeChunk(this, currentlyFlushingRenderState.startInlineStyle);\n writeChunk(this, styleTagResourceOpen1);\n writeChunk(this, styleQueue.precedence);\n styleQueue = 0;\n if (hrefs.length) {\n for (\n writeChunk(this, styleTagResourceOpen2);\n styleQueue < hrefs.length - 1;\n styleQueue++\n )\n writeChunk(this, hrefs[styleQueue]), writeChunk(this, spaceSeparator);\n writeChunk(this, hrefs[styleQueue]);\n }\n writeChunk(this, styleTagResourceOpen3);\n for (styleQueue = 0; styleQueue < rules.length; styleQueue++)\n writeChunk(this, rules[styleQueue]);\n writeChunk(this, styleTagResourceClose);\n rules.length = 0;\n hrefs.length = 0;\n }\n}\nfunction preloadLateStyle(stylesheet) {\n if (0 === stylesheet.state) {\n stylesheet.state = 1;\n var props = stylesheet.props;\n pushLinkImpl(stylesheetFlushingQueue, {\n rel: \"preload\",\n as: \"style\",\n href: stylesheet.props.href,\n crossOrigin: props.crossOrigin,\n fetchPriority: props.fetchPriority,\n integrity: props.integrity,\n media: props.media,\n hrefLang: props.hrefLang,\n referrerPolicy: props.referrerPolicy\n });\n for (\n stylesheet = 0;\n stylesheet < stylesheetFlushingQueue.length;\n stylesheet++\n )\n writeChunk(this, stylesheetFlushingQueue[stylesheet]);\n stylesheetFlushingQueue.length = 0;\n }\n}\nfunction preloadLateStyles(styleQueue) {\n styleQueue.sheets.forEach(preloadLateStyle, this);\n styleQueue.sheets.clear();\n}\nvar blockingRenderChunkStart = stringToPrecomputedChunk(\n '<link rel=\"expect\" href=\"#'\n ),\n blockingRenderChunkEnd = stringToPrecomputedChunk('\" blocking=\"render\"/>'),\n completedShellIdAttributeStart = stringToPrecomputedChunk(' id=\"');\nfunction writeCompletedShellIdAttribute(destination, resumableState) {\n 0 === (resumableState.instructions & 32) &&\n ((resumableState.instructions |= 32),\n (resumableState = \"_\" + resumableState.idPrefix + \"R_\"),\n writeChunk(destination, completedShellIdAttributeStart),\n writeChunk(destination, escapeTextForBrowser(resumableState)),\n writeChunk(destination, attributeEnd));\n}\nfunction pushCompletedShellIdAttribute(target, resumableState) {\n 0 === (resumableState.instructions & 32) &&\n ((resumableState.instructions |= 32),\n target.push(\n completedShellIdAttributeStart,\n escapeTextForBrowser(\"_\" + resumableState.idPrefix + \"R_\"),\n attributeEnd\n ));\n}\nvar arrayFirstOpenBracket = stringToPrecomputedChunk(\"[\"),\n arraySubsequentOpenBracket = stringToPrecomputedChunk(\",[\"),\n arrayInterstitial = stringToPrecomputedChunk(\",\"),\n arrayCloseBracket = stringToPrecomputedChunk(\"]\");\nfunction writeStyleResourceDependenciesInJS(destination, hoistableState) {\n writeChunk(destination, arrayFirstOpenBracket);\n var nextArrayOpenBrackChunk = arrayFirstOpenBracket;\n hoistableState.stylesheets.forEach(function (resource) {\n if (2 !== resource.state)\n if (3 === resource.state)\n writeChunk(destination, nextArrayOpenBrackChunk),\n writeChunk(\n destination,\n escapeJSObjectForInstructionScripts(\"\" + resource.props.href)\n ),\n writeChunk(destination, arrayCloseBracket),\n (nextArrayOpenBrackChunk = arraySubsequentOpenBracket);\n else {\n writeChunk(destination, nextArrayOpenBrackChunk);\n var precedence = resource.props[\"data-precedence\"],\n props = resource.props,\n coercedHref = sanitizeURL(\"\" + resource.props.href);\n writeChunk(\n destination,\n escapeJSObjectForInstructionScripts(coercedHref)\n );\n precedence = \"\" + precedence;\n writeChunk(destination, arrayInterstitial);\n writeChunk(\n destination,\n escapeJSObjectForInstructionScripts(precedence)\n );\n for (var propKey in props)\n if (\n hasOwnProperty.call(props, propKey) &&\n ((precedence = props[propKey]), null != precedence)\n )\n switch (propKey) {\n case \"href\":\n case \"rel\":\n case \"precedence\":\n case \"data-precedence\":\n break;\n case \"children\":\n case \"dangerouslySetInnerHTML\":\n throw Error(\n \"link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\"\n );\n default:\n writeStyleResourceAttributeInJS(\n destination,\n propKey,\n precedence\n );\n }\n writeChunk(destination, arrayCloseBracket);\n nextArrayOpenBrackChunk = arraySubsequentOpenBracket;\n resource.state = 3;\n }\n });\n writeChunk(destination, arrayCloseBracket);\n}\nfunction writeStyleResourceAttributeInJS(destination, name, value) {\n var attributeName = name.toLowerCase();\n switch (typeof value) {\n case \"function\":\n case \"symbol\":\n return;\n }\n switch (name) {\n case \"innerHTML\":\n case \"dangerouslySetInnerHTML\":\n case \"suppressContentEditableWarning\":\n case \"suppressHydrationWarning\":\n case \"style\":\n case \"ref\":\n return;\n case \"className\":\n attributeName = \"class\";\n name = \"\" + value;\n break;\n case \"hidden\":\n if (!1 === value) return;\n name = \"\";\n break;\n case \"src\":\n case \"href\":\n value = sanitizeURL(value);\n name = \"\" + value;\n break;\n default:\n if (\n (2 < name.length &&\n (\"o\" === name[0] || \"O\" === name[0]) &&\n (\"n\" === name[1] || \"N\" === name[1])) ||\n !isAttributeNameSafe(name)\n )\n return;\n name = \"\" + value;\n }\n writeChunk(destination, arrayInterstitial);\n writeChunk(destination, escapeJSObjectForInstructionScripts(attributeName));\n writeChunk(destination, arrayInterstitial);\n writeChunk(destination, escapeJSObjectForInstructionScripts(name));\n}\nfunction writeStyleResourceDependenciesInAttr(destination, hoistableState) {\n writeChunk(destination, arrayFirstOpenBracket);\n var nextArrayOpenBrackChunk = arrayFirstOpenBracket;\n hoistableState.stylesheets.forEach(function (resource) {\n if (2 !== resource.state)\n if (3 === resource.state)\n writeChunk(destination, nextArrayOpenBrackChunk),\n writeChunk(\n destination,\n escapeTextForBrowser(JSON.stringify(\"\" + resource.props.href))\n ),\n writeChunk(destination, arrayCloseBracket),\n (nextArrayOpenBrackChunk = arraySubsequentOpenBracket);\n else {\n writeChunk(destination, nextArrayOpenBrackChunk);\n var precedence = resource.props[\"data-precedence\"],\n props = resource.props,\n coercedHref = sanitizeURL(\"\" + resource.props.href);\n writeChunk(\n destination,\n escapeTextForBrowser(JSON.stringify(coercedHref))\n );\n precedence = \"\" + precedence;\n writeChunk(destination, arrayInterstitial);\n writeChunk(\n destination,\n escapeTextForBrowser(JSON.stringify(precedence))\n );\n for (var propKey in props)\n if (\n hasOwnProperty.call(props, propKey) &&\n ((precedence = props[propKey]), null != precedence)\n )\n switch (propKey) {\n case \"href\":\n case \"rel\":\n case \"precedence\":\n case \"data-precedence\":\n break;\n case \"children\":\n case \"dangerouslySetInnerHTML\":\n throw Error(\n \"link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\"\n );\n default:\n writeStyleResourceAttributeInAttr(\n destination,\n propKey,\n precedence\n );\n }\n writeChunk(destination, arrayCloseBracket);\n nextArrayOpenBrackChunk = arraySubsequentOpenBracket;\n resource.state = 3;\n }\n });\n writeChunk(destination, arrayCloseBracket);\n}\nfunction writeStyleResourceAttributeInAttr(destination, name, value) {\n var attributeName = name.toLowerCase();\n switch (typeof value) {\n case \"function\":\n case \"symbol\":\n return;\n }\n switch (name) {\n case \"innerHTML\":\n case \"dangerouslySetInnerHTML\":\n case \"suppressContentEditableWarning\":\n case \"suppressHydrationWarning\":\n case \"style\":\n case \"ref\":\n return;\n case \"className\":\n attributeName = \"class\";\n name = \"\" + value;\n break;\n case \"hidden\":\n if (!1 === value) return;\n name = \"\";\n break;\n case \"src\":\n case \"href\":\n value = sanitizeURL(value);\n name = \"\" + value;\n break;\n default:\n if (\n (2 < name.length &&\n (\"o\" === name[0] || \"O\" === name[0]) &&\n (\"n\" === name[1] || \"N\" === name[1])) ||\n !isAttributeNameSafe(name)\n )\n return;\n name = \"\" + value;\n }\n writeChunk(destination, arrayInterstitial);\n writeChunk(destination, escapeTextForBrowser(JSON.stringify(attributeName)));\n writeChunk(destination, arrayInterstitial);\n writeChunk(destination, escapeTextForBrowser(JSON.stringify(name)));\n}\nfunction createHoistableState() {\n return { styles: new Set(), stylesheets: new Set(), suspenseyImages: !1 };\n}\nfunction prefetchDNS(href) {\n var request = resolveRequest();\n if (request) {\n var resumableState = request.resumableState,\n renderState = request.renderState;\n if (\"string\" === typeof href && href) {\n if (!resumableState.dnsResources.hasOwnProperty(href)) {\n resumableState.dnsResources[href] = null;\n resumableState = renderState.headers;\n var header, JSCompiler_temp;\n if (\n (JSCompiler_temp =\n resumableState && 0 < resumableState.remainingCapacity)\n )\n JSCompiler_temp =\n ((header =\n \"<\" +\n (\"\" + href).replace(\n regexForHrefInLinkHeaderURLContext,\n escapeHrefForLinkHeaderURLContextReplacer\n ) +\n \">; rel=dns-prefetch\"),\n 0 <= (resumableState.remainingCapacity -= header.length + 2));\n JSCompiler_temp\n ? ((renderState.resets.dns[href] = null),\n resumableState.preconnects && (resumableState.preconnects += \", \"),\n (resumableState.preconnects += header))\n : ((header = []),\n pushLinkImpl(header, { href: href, rel: \"dns-prefetch\" }),\n renderState.preconnects.add(header));\n }\n enqueueFlush(request);\n }\n } else previousDispatcher.D(href);\n}\nfunction preconnect(href, crossOrigin) {\n var request = resolveRequest();\n if (request) {\n var resumableState = request.resumableState,\n renderState = request.renderState;\n if (\"string\" === typeof href && href) {\n var bucket =\n \"use-credentials\" === crossOrigin\n ? \"credentials\"\n : \"string\" === typeof crossOrigin\n ? \"anonymous\"\n : \"default\";\n if (!resumableState.connectResources[bucket].hasOwnProperty(href)) {\n resumableState.connectResources[bucket][href] = null;\n resumableState = renderState.headers;\n var header, JSCompiler_temp;\n if (\n (JSCompiler_temp =\n resumableState && 0 < resumableState.remainingCapacity)\n ) {\n JSCompiler_temp =\n \"<\" +\n (\"\" + href).replace(\n regexForHrefInLinkHeaderURLContext,\n escapeHrefForLinkHeaderURLContextReplacer\n ) +\n \">; rel=preconnect\";\n if (\"string\" === typeof crossOrigin) {\n var escapedCrossOrigin = (\"\" + crossOrigin).replace(\n regexForLinkHeaderQuotedParamValueContext,\n escapeStringForLinkHeaderQuotedParamValueContextReplacer\n );\n JSCompiler_temp += '; crossorigin=\"' + escapedCrossOrigin + '\"';\n }\n JSCompiler_temp =\n ((header = JSCompiler_temp),\n 0 <= (resumableState.remainingCapacity -= header.length + 2));\n }\n JSCompiler_temp\n ? ((renderState.resets.connect[bucket][href] = null),\n resumableState.preconnects && (resumableState.preconnects += \", \"),\n (resumableState.preconnects += header))\n : ((bucket = []),\n pushLinkImpl(bucket, {\n rel: \"preconnect\",\n href: href,\n crossOrigin: crossOrigin\n }),\n renderState.preconnects.add(bucket));\n }\n enqueueFlush(request);\n }\n } else previousDispatcher.C(href, crossOrigin);\n}\nfunction preload(href, as, options) {\n var request = resolveRequest();\n if (request) {\n var resumableState = request.resumableState,\n renderState = request.renderState;\n if (as && href) {\n switch (as) {\n case \"image\":\n if (options) {\n var imageSrcSet = options.imageSrcSet;\n var imageSizes = options.imageSizes;\n var fetchPriority = options.fetchPriority;\n }\n var key = imageSrcSet\n ? imageSrcSet + \"\\n\" + (imageSizes || \"\")\n : href;\n if (resumableState.imageResources.hasOwnProperty(key)) return;\n resumableState.imageResources[key] = PRELOAD_NO_CREDS;\n resumableState = renderState.headers;\n var header;\n resumableState &&\n 0 < resumableState.remainingCapacity &&\n \"string\" !== typeof imageSrcSet &&\n \"high\" === fetchPriority &&\n ((header = getPreloadAsHeader(href, as, options)),\n 0 <= (resumableState.remainingCapacity -= header.length + 2))\n ? ((renderState.resets.image[key] = PRELOAD_NO_CREDS),\n resumableState.highImagePreloads &&\n (resumableState.highImagePreloads += \", \"),\n (resumableState.highImagePreloads += header))\n : ((resumableState = []),\n pushLinkImpl(\n resumableState,\n assign(\n { rel: \"preload\", href: imageSrcSet ? void 0 : href, as: as },\n options\n )\n ),\n \"high\" === fetchPriority\n ? renderState.highImagePreloads.add(resumableState)\n : (renderState.bulkPreloads.add(resumableState),\n renderState.preloads.images.set(key, resumableState)));\n break;\n case \"style\":\n if (resumableState.styleResources.hasOwnProperty(href)) return;\n imageSrcSet = [];\n pushLinkImpl(\n imageSrcSet,\n assign({ rel: \"preload\", href: href, as: as }, options)\n );\n resumableState.styleResources[href] =\n !options ||\n (\"string\" !== typeof options.crossOrigin &&\n \"string\" !== typeof options.integrity)\n ? PRELOAD_NO_CREDS\n : [options.crossOrigin, options.integrity];\n renderState.preloads.stylesheets.set(href, imageSrcSet);\n renderState.bulkPreloads.add(imageSrcSet);\n break;\n case \"script\":\n if (resumableState.scriptResources.hasOwnProperty(href)) return;\n imageSrcSet = [];\n renderState.preloads.scripts.set(href, imageSrcSet);\n renderState.bulkPreloads.add(imageSrcSet);\n pushLinkImpl(\n imageSrcSet,\n assign({ rel: \"preload\", href: href, as: as }, options)\n );\n resumableState.scriptResources[href] =\n !options ||\n (\"string\" !== typeof options.crossOrigin &&\n \"string\" !== typeof options.integrity)\n ? PRELOAD_NO_CREDS\n : [options.crossOrigin, options.integrity];\n break;\n default:\n if (resumableState.unknownResources.hasOwnProperty(as)) {\n if (\n ((imageSrcSet = resumableState.unknownResources[as]),\n imageSrcSet.hasOwnProperty(href))\n )\n return;\n } else\n (imageSrcSet = {}),\n (resumableState.unknownResources[as] = imageSrcSet);\n imageSrcSet[href] = PRELOAD_NO_CREDS;\n if (\n (resumableState = renderState.headers) &&\n 0 < resumableState.remainingCapacity &&\n \"font\" === as &&\n ((key = getPreloadAsHeader(href, as, options)),\n 0 <= (resumableState.remainingCapacity -= key.length + 2))\n )\n (renderState.resets.font[href] = PRELOAD_NO_CREDS),\n resumableState.fontPreloads &&\n (resumableState.fontPreloads += \", \"),\n (resumableState.fontPreloads += key);\n else\n switch (\n ((resumableState = []),\n (href = assign({ rel: \"preload\", href: href, as: as }, options)),\n pushLinkImpl(resumableState, href),\n as)\n ) {\n case \"font\":\n renderState.fontPreloads.add(resumableState);\n break;\n default:\n renderState.bulkPreloads.add(resumableState);\n }\n }\n enqueueFlush(request);\n }\n } else previousDispatcher.L(href, as, options);\n}\nfunction preloadModule(href, options) {\n var request = resolveRequest();\n if (request) {\n var resumableState = request.resumableState,\n renderState = request.renderState;\n if (href) {\n var as =\n options && \"string\" === typeof options.as ? options.as : \"script\";\n switch (as) {\n case \"script\":\n if (resumableState.moduleScriptResources.hasOwnProperty(href)) return;\n as = [];\n resumableState.moduleScriptResources[href] =\n !options ||\n (\"string\" !== typeof options.crossOrigin &&\n \"string\" !== typeof options.integrity)\n ? PRELOAD_NO_CREDS\n : [options.crossOrigin, options.integrity];\n renderState.preloads.moduleScripts.set(href, as);\n break;\n default:\n if (resumableState.moduleUnknownResources.hasOwnProperty(as)) {\n var resources = resumableState.unknownResources[as];\n if (resources.hasOwnProperty(href)) return;\n } else\n (resources = {}),\n (resumableState.moduleUnknownResources[as] = resources);\n as = [];\n resources[href] = PRELOAD_NO_CREDS;\n }\n pushLinkImpl(as, assign({ rel: \"modulepreload\", href: href }, options));\n renderState.bulkPreloads.add(as);\n enqueueFlush(request);\n }\n } else previousDispatcher.m(href, options);\n}\nfunction preinitStyle(href, precedence, options) {\n var request = resolveRequest();\n if (request) {\n var resumableState = request.resumableState,\n renderState = request.renderState;\n if (href) {\n precedence = precedence || \"default\";\n var styleQueue = renderState.styles.get(precedence),\n resourceState = resumableState.styleResources.hasOwnProperty(href)\n ? resumableState.styleResources[href]\n : void 0;\n null !== resourceState &&\n ((resumableState.styleResources[href] = null),\n styleQueue ||\n ((styleQueue = {\n precedence: escapeTextForBrowser(precedence),\n rules: [],\n hrefs: [],\n sheets: new Map()\n }),\n renderState.styles.set(precedence, styleQueue)),\n (precedence = {\n state: 0,\n props: assign(\n { rel: \"stylesheet\", href: href, \"data-precedence\": precedence },\n options\n )\n }),\n resourceState &&\n (2 === resourceState.length &&\n adoptPreloadCredentials(precedence.props, resourceState),\n (renderState = renderState.preloads.stylesheets.get(href)) &&\n 0 < renderState.length\n ? (renderState.length = 0)\n : (precedence.state = 1)),\n styleQueue.sheets.set(href, precedence),\n enqueueFlush(request));\n }\n } else previousDispatcher.S(href, precedence, options);\n}\nfunction preinitScript(src, options) {\n var request = resolveRequest();\n if (request) {\n var resumableState = request.resumableState,\n renderState = request.renderState;\n if (src) {\n var resourceState = resumableState.scriptResources.hasOwnProperty(src)\n ? resumableState.scriptResources[src]\n : void 0;\n null !== resourceState &&\n ((resumableState.scriptResources[src] = null),\n (options = assign({ src: src, async: !0 }, options)),\n resourceState &&\n (2 === resourceState.length &&\n adoptPreloadCredentials(options, resourceState),\n (src = renderState.preloads.scripts.get(src))) &&\n (src.length = 0),\n (src = []),\n renderState.scripts.add(src),\n pushScriptImpl(src, options),\n enqueueFlush(request));\n }\n } else previousDispatcher.X(src, options);\n}\nfunction preinitModuleScript(src, options) {\n var request = resolveRequest();\n if (request) {\n var resumableState = request.resumableState,\n renderState = request.renderState;\n if (src) {\n var resourceState = resumableState.moduleScriptResources.hasOwnProperty(\n src\n )\n ? resumableState.moduleScriptResources[src]\n : void 0;\n null !== resourceState &&\n ((resumableState.moduleScriptResources[src] = null),\n (options = assign({ src: src, type: \"module\", async: !0 }, options)),\n resourceState &&\n (2 === resourceState.length &&\n adoptPreloadCredentials(options, resourceState),\n (src = renderState.preloads.moduleScripts.get(src))) &&\n (src.length = 0),\n (src = []),\n renderState.scripts.add(src),\n pushScriptImpl(src, options),\n enqueueFlush(request));\n }\n } else previousDispatcher.M(src, options);\n}\nfunction adoptPreloadCredentials(target, preloadState) {\n null == target.crossOrigin && (target.crossOrigin = preloadState[0]);\n null == target.integrity && (target.integrity = preloadState[1]);\n}\nfunction getPreloadAsHeader(href, as, params) {\n href = (\"\" + href).replace(\n regexForHrefInLinkHeaderURLContext,\n escapeHrefForLinkHeaderURLContextReplacer\n );\n as = (\"\" + as).replace(\n regexForLinkHeaderQuotedParamValueContext,\n escapeStringForLinkHeaderQuotedParamValueContextReplacer\n );\n as = \"<\" + href + '>; rel=preload; as=\"' + as + '\"';\n for (var paramName in params)\n hasOwnProperty.call(params, paramName) &&\n ((href = params[paramName]),\n \"string\" === typeof href &&\n (as +=\n \"; \" +\n paramName.toLowerCase() +\n '=\"' +\n (\"\" + href).replace(\n regexForLinkHeaderQuotedParamValueContext,\n escapeStringForLinkHeaderQuotedParamValueContextReplacer\n ) +\n '\"'));\n return as;\n}\nvar regexForHrefInLinkHeaderURLContext = /[<>\\r\\n]/g;\nfunction escapeHrefForLinkHeaderURLContextReplacer(match) {\n switch (match) {\n case \"<\":\n return \"%3C\";\n case \">\":\n return \"%3E\";\n case \"\\n\":\n return \"%0A\";\n case \"\\r\":\n return \"%0D\";\n default:\n throw Error(\n \"escapeLinkHrefForHeaderContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React\"\n );\n }\n}\nvar regexForLinkHeaderQuotedParamValueContext = /[\"';,\\r\\n]/g;\nfunction escapeStringForLinkHeaderQuotedParamValueContextReplacer(match) {\n switch (match) {\n case '\"':\n return \"%22\";\n case \"'\":\n return \"%27\";\n case \";\":\n return \"%3B\";\n case \",\":\n return \"%2C\";\n case \"\\n\":\n return \"%0A\";\n case \"\\r\":\n return \"%0D\";\n default:\n throw Error(\n \"escapeStringForLinkHeaderQuotedParamValueContextReplacer encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React\"\n );\n }\n}\nfunction hoistStyleQueueDependency(styleQueue) {\n this.styles.add(styleQueue);\n}\nfunction hoistStylesheetDependency(stylesheet) {\n this.stylesheets.add(stylesheet);\n}\nfunction hoistHoistables(parentState, childState) {\n childState.styles.forEach(hoistStyleQueueDependency, parentState);\n childState.stylesheets.forEach(hoistStylesheetDependency, parentState);\n childState.suspenseyImages && (parentState.suspenseyImages = !0);\n}\nfunction hasSuspenseyContent(hoistableState) {\n return 0 < hoistableState.stylesheets.size || hoistableState.suspenseyImages;\n}\nvar bind = Function.prototype.bind,\n requestStorage = new async_hooks.AsyncLocalStorage(),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\");\nfunction getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n case REACT_VIEW_TRANSITION_TYPE:\n return \"ViewTransition\";\n }\n if (\"object\" === typeof type)\n switch (type.$$typeof) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n}\nvar emptyContextObject = {},\n currentActiveSnapshot = null;\nfunction popToNearestCommonAncestor(prev, next) {\n if (prev !== next) {\n prev.context._currentValue = prev.parentValue;\n prev = prev.parent;\n var parentNext = next.parent;\n if (null === prev) {\n if (null !== parentNext)\n throw Error(\n \"The stacks must reach the root at the same time. This is a bug in React.\"\n );\n } else {\n if (null === parentNext)\n throw Error(\n \"The stacks must reach the root at the same time. This is a bug in React.\"\n );\n popToNearestCommonAncestor(prev, parentNext);\n }\n next.context._currentValue = next.value;\n }\n}\nfunction popAllPrevious(prev) {\n prev.context._currentValue = prev.parentValue;\n prev = prev.parent;\n null !== prev && popAllPrevious(prev);\n}\nfunction pushAllNext(next) {\n var parentNext = next.parent;\n null !== parentNext && pushAllNext(parentNext);\n next.context._currentValue = next.value;\n}\nfunction popPreviousToCommonLevel(prev, next) {\n prev.context._currentValue = prev.parentValue;\n prev = prev.parent;\n if (null === prev)\n throw Error(\n \"The depth must equal at least at zero before reaching the root. This is a bug in React.\"\n );\n prev.depth === next.depth\n ? popToNearestCommonAncestor(prev, next)\n : popPreviousToCommonLevel(prev, next);\n}\nfunction popNextToCommonLevel(prev, next) {\n var parentNext = next.parent;\n if (null === parentNext)\n throw Error(\n \"The depth must equal at least at zero before reaching the root. This is a bug in React.\"\n );\n prev.depth === parentNext.depth\n ? popToNearestCommonAncestor(prev, parentNext)\n : popNextToCommonLevel(prev, parentNext);\n next.context._currentValue = next.value;\n}\nfunction switchContext(newSnapshot) {\n var prev = currentActiveSnapshot;\n prev !== newSnapshot &&\n (null === prev\n ? pushAllNext(newSnapshot)\n : null === newSnapshot\n ? popAllPrevious(prev)\n : prev.depth === newSnapshot.depth\n ? popToNearestCommonAncestor(prev, newSnapshot)\n : prev.depth > newSnapshot.depth\n ? popPreviousToCommonLevel(prev, newSnapshot)\n : popNextToCommonLevel(prev, newSnapshot),\n (currentActiveSnapshot = newSnapshot));\n}\nvar classComponentUpdater = {\n enqueueSetState: function (inst, payload) {\n inst = inst._reactInternals;\n null !== inst.queue && inst.queue.push(payload);\n },\n enqueueReplaceState: function (inst, payload) {\n inst = inst._reactInternals;\n inst.replace = !0;\n inst.queue = [payload];\n },\n enqueueForceUpdate: function () {}\n },\n emptyTreeContext = { id: 1, overflow: \"\" };\nfunction getTreeId(context) {\n var overflow = context.overflow;\n context = context.id;\n return (context & ~(1 << (32 - clz32(context) - 1))).toString(32) + overflow;\n}\nfunction pushTreeContext(baseContext, totalChildren, index) {\n var baseIdWithLeadingBit = baseContext.id;\n baseContext = baseContext.overflow;\n var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;\n baseIdWithLeadingBit &= ~(1 << baseLength);\n index += 1;\n var length = 32 - clz32(totalChildren) + baseLength;\n if (30 < length) {\n var numberOfOverflowBits = baseLength - (baseLength % 5);\n length = (\n baseIdWithLeadingBit &\n ((1 << numberOfOverflowBits) - 1)\n ).toString(32);\n baseIdWithLeadingBit >>= numberOfOverflowBits;\n baseLength -= numberOfOverflowBits;\n return {\n id:\n (1 << (32 - clz32(totalChildren) + baseLength)) |\n (index << baseLength) |\n baseIdWithLeadingBit,\n overflow: length + baseContext\n };\n }\n return {\n id: (1 << length) | (index << baseLength) | baseIdWithLeadingBit,\n overflow: baseContext\n };\n}\nvar clz32 = Math.clz32 ? Math.clz32 : clz32Fallback,\n log = Math.log,\n LN2 = Math.LN2;\nfunction clz32Fallback(x) {\n x >>>= 0;\n return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0;\n}\nfunction noop() {}\nvar SuspenseException = Error(\n \"Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\\n\\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`.\"\n);\nfunction trackUsedThenable(thenableState, thenable, index) {\n index = thenableState[index];\n void 0 === index\n ? thenableState.push(thenable)\n : index !== thenable && (thenable.then(noop, noop), (thenable = index));\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n \"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenableState = thenable),\n (thenableState.status = \"pending\"),\n thenableState.then(\n function (fulfilledValue) {\n if (\"pending\" === thenable.status) {\n var fulfilledThenable = thenable;\n fulfilledThenable.status = \"fulfilled\";\n fulfilledThenable.value = fulfilledValue;\n }\n },\n function (error) {\n if (\"pending\" === thenable.status) {\n var rejectedThenable = thenable;\n rejectedThenable.status = \"rejected\";\n rejectedThenable.reason = error;\n }\n }\n ));\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n suspendedThenable = thenable;\n throw SuspenseException;\n }\n}\nvar suspendedThenable = null;\nfunction getSuspendedThenable() {\n if (null === suspendedThenable)\n throw Error(\n \"Expected a suspended thenable. This is a bug in React. Please file an issue.\"\n );\n var thenable = suspendedThenable;\n suspendedThenable = null;\n return thenable;\n}\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n currentlyRenderingComponent = null,\n currentlyRenderingTask = null,\n currentlyRenderingRequest = null,\n currentlyRenderingKeyPath = null,\n firstWorkInProgressHook = null,\n workInProgressHook = null,\n isReRender = !1,\n didScheduleRenderPhaseUpdate = !1,\n localIdCounter = 0,\n actionStateCounter = 0,\n actionStateMatchingIndex = -1,\n thenableIndexCounter = 0,\n thenableState = null,\n renderPhaseUpdates = null,\n numberOfReRenders = 0;\nfunction resolveCurrentlyRenderingComponent() {\n if (null === currentlyRenderingComponent)\n throw Error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return currentlyRenderingComponent;\n}\nfunction createHook() {\n if (0 < numberOfReRenders)\n throw Error(\"Rendered more hooks than during the previous render\");\n return { memoizedState: null, queue: null, next: null };\n}\nfunction createWorkInProgressHook() {\n null === workInProgressHook\n ? null === firstWorkInProgressHook\n ? ((isReRender = !1),\n (firstWorkInProgressHook = workInProgressHook = createHook()))\n : ((isReRender = !0), (workInProgressHook = firstWorkInProgressHook))\n : null === workInProgressHook.next\n ? ((isReRender = !1),\n (workInProgressHook = workInProgressHook.next = createHook()))\n : ((isReRender = !0), (workInProgressHook = workInProgressHook.next));\n return workInProgressHook;\n}\nfunction getThenableStateAfterSuspending() {\n var state = thenableState;\n thenableState = null;\n return state;\n}\nfunction resetHooksState() {\n currentlyRenderingKeyPath =\n currentlyRenderingRequest =\n currentlyRenderingTask =\n currentlyRenderingComponent =\n null;\n didScheduleRenderPhaseUpdate = !1;\n firstWorkInProgressHook = null;\n numberOfReRenders = 0;\n workInProgressHook = renderPhaseUpdates = null;\n}\nfunction basicStateReducer(state, action) {\n return \"function\" === typeof action ? action(state) : action;\n}\nfunction useReducer(reducer, initialArg, init) {\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n if (isReRender) {\n var queue = workInProgressHook.queue;\n initialArg = queue.dispatch;\n if (\n null !== renderPhaseUpdates &&\n ((init = renderPhaseUpdates.get(queue)), void 0 !== init)\n ) {\n renderPhaseUpdates.delete(queue);\n queue = workInProgressHook.memoizedState;\n do (queue = reducer(queue, init.action)), (init = init.next);\n while (null !== init);\n workInProgressHook.memoizedState = queue;\n return [queue, initialArg];\n }\n return [workInProgressHook.memoizedState, initialArg];\n }\n reducer =\n reducer === basicStateReducer\n ? \"function\" === typeof initialArg\n ? initialArg()\n : initialArg\n : void 0 !== init\n ? init(initialArg)\n : initialArg;\n workInProgressHook.memoizedState = reducer;\n reducer = workInProgressHook.queue = { last: null, dispatch: null };\n reducer = reducer.dispatch = dispatchAction.bind(\n null,\n currentlyRenderingComponent,\n reducer\n );\n return [workInProgressHook.memoizedState, reducer];\n}\nfunction useMemo(nextCreate, deps) {\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n deps = void 0 === deps ? null : deps;\n if (null !== workInProgressHook) {\n var prevState = workInProgressHook.memoizedState;\n if (null !== prevState && null !== deps) {\n var prevDeps = prevState[1];\n a: if (null === prevDeps) prevDeps = !1;\n else {\n for (var i = 0; i < prevDeps.length && i < deps.length; i++)\n if (!objectIs(deps[i], prevDeps[i])) {\n prevDeps = !1;\n break a;\n }\n prevDeps = !0;\n }\n if (prevDeps) return prevState[0];\n }\n }\n nextCreate = nextCreate();\n workInProgressHook.memoizedState = [nextCreate, deps];\n return nextCreate;\n}\nfunction dispatchAction(componentIdentity, queue, action) {\n if (25 <= numberOfReRenders)\n throw Error(\n \"Too many re-renders. React limits the number of renders to prevent an infinite loop.\"\n );\n if (componentIdentity === currentlyRenderingComponent)\n if (\n ((didScheduleRenderPhaseUpdate = !0),\n (componentIdentity = { action: action, next: null }),\n null === renderPhaseUpdates && (renderPhaseUpdates = new Map()),\n (action = renderPhaseUpdates.get(queue)),\n void 0 === action)\n )\n renderPhaseUpdates.set(queue, componentIdentity);\n else {\n for (queue = action; null !== queue.next; ) queue = queue.next;\n queue.next = componentIdentity;\n }\n}\nfunction throwOnUseEffectEventCall() {\n throw Error(\n \"A function wrapped in useEffectEvent can't be called during rendering.\"\n );\n}\nfunction unsupportedStartTransition() {\n throw Error(\"startTransition cannot be called during server rendering.\");\n}\nfunction unsupportedSetOptimisticState() {\n throw Error(\"Cannot update optimistic state while rendering.\");\n}\nfunction createPostbackActionStateKey(permalink, componentKeyPath, hookIndex) {\n if (void 0 !== permalink) return \"p\" + permalink;\n permalink = JSON.stringify([componentKeyPath, null, hookIndex]);\n componentKeyPath = crypto.createHash(\"md5\");\n componentKeyPath.update(permalink);\n return \"k\" + componentKeyPath.digest(\"hex\");\n}\nfunction useActionState(action, initialState, permalink) {\n resolveCurrentlyRenderingComponent();\n var actionStateHookIndex = actionStateCounter++,\n request = currentlyRenderingRequest;\n if (\"function\" === typeof action.$$FORM_ACTION) {\n var nextPostbackStateKey = null,\n componentKeyPath = currentlyRenderingKeyPath;\n request = request.formState;\n var isSignatureEqual = action.$$IS_SIGNATURE_EQUAL;\n if (null !== request && \"function\" === typeof isSignatureEqual) {\n var postbackKey = request[1];\n isSignatureEqual.call(action, request[2], request[3]) &&\n ((nextPostbackStateKey = createPostbackActionStateKey(\n permalink,\n componentKeyPath,\n actionStateHookIndex\n )),\n postbackKey === nextPostbackStateKey &&\n ((actionStateMatchingIndex = actionStateHookIndex),\n (initialState = request[0])));\n }\n var boundAction = action.bind(null, initialState);\n action = function (payload) {\n boundAction(payload);\n };\n \"function\" === typeof boundAction.$$FORM_ACTION &&\n (action.$$FORM_ACTION = function (prefix) {\n prefix = boundAction.$$FORM_ACTION(prefix);\n void 0 !== permalink &&\n ((permalink += \"\"), (prefix.action = permalink));\n var formData = prefix.data;\n formData &&\n (null === nextPostbackStateKey &&\n (nextPostbackStateKey = createPostbackActionStateKey(\n permalink,\n componentKeyPath,\n actionStateHookIndex\n )),\n formData.append(\"$ACTION_KEY\", nextPostbackStateKey));\n return prefix;\n });\n return [initialState, action, !1];\n }\n var boundAction$22 = action.bind(null, initialState);\n return [\n initialState,\n function (payload) {\n boundAction$22(payload);\n },\n !1\n ];\n}\nfunction unwrapThenable(thenable) {\n var index = thenableIndexCounter;\n thenableIndexCounter += 1;\n null === thenableState && (thenableState = []);\n return trackUsedThenable(thenableState, thenable, index);\n}\nfunction readPreviousThenableFromState() {\n var index = thenableIndexCounter;\n thenableIndexCounter += 1;\n if (null !== thenableState)\n return (\n (index = thenableState[index]),\n (index = void 0 === index ? void 0 : index.value),\n index\n );\n}\nfunction unsupportedRefresh() {\n throw Error(\"Cache cannot be refreshed during server rendering.\");\n}\nvar HooksDispatcher = {\n readContext: function (context) {\n return context._currentValue;\n },\n use: function (usable) {\n if (null !== usable && \"object\" === typeof usable) {\n if (\"function\" === typeof usable.then) return unwrapThenable(usable);\n if (usable.$$typeof === REACT_CONTEXT_TYPE) return usable._currentValue;\n }\n throw Error(\"An unsupported type was passed to use(): \" + String(usable));\n },\n useContext: function (context) {\n resolveCurrentlyRenderingComponent();\n return context._currentValue;\n },\n useMemo: useMemo,\n useReducer: useReducer,\n useRef: function (initialValue) {\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n var previousRef = workInProgressHook.memoizedState;\n return null === previousRef\n ? ((initialValue = { current: initialValue }),\n (workInProgressHook.memoizedState = initialValue))\n : previousRef;\n },\n useState: function (initialState) {\n return useReducer(basicStateReducer, initialState);\n },\n useInsertionEffect: noop,\n useLayoutEffect: noop,\n useCallback: function (callback, deps) {\n return useMemo(function () {\n return callback;\n }, deps);\n },\n useImperativeHandle: noop,\n useEffect: noop,\n useDebugValue: noop,\n useDeferredValue: function (value, initialValue) {\n resolveCurrentlyRenderingComponent();\n return void 0 !== initialValue ? initialValue : value;\n },\n useTransition: function () {\n resolveCurrentlyRenderingComponent();\n return [!1, unsupportedStartTransition];\n },\n useId: function () {\n var treeId = getTreeId(currentlyRenderingTask.treeContext),\n resumableState = currentResumableState;\n if (null === resumableState)\n throw Error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component.\"\n );\n var localId = localIdCounter++;\n return makeId(resumableState, treeId, localId);\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n if (void 0 === getServerSnapshot)\n throw Error(\n \"Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.\"\n );\n return getServerSnapshot();\n },\n useOptimistic: function (passthrough) {\n resolveCurrentlyRenderingComponent();\n return [passthrough, unsupportedSetOptimisticState];\n },\n useActionState: useActionState,\n useFormState: useActionState,\n useHostTransitionStatus: function () {\n resolveCurrentlyRenderingComponent();\n return sharedNotPendingObject;\n },\n useMemoCache: function (size) {\n for (var data = Array(size), i = 0; i < size; i++)\n data[i] = REACT_MEMO_CACHE_SENTINEL;\n return data;\n },\n useCacheRefresh: function () {\n return unsupportedRefresh;\n },\n useEffectEvent: function () {\n return throwOnUseEffectEventCall;\n }\n },\n currentResumableState = null,\n DefaultAsyncDispatcher = {\n getCacheForType: function () {\n throw Error(\"Not implemented.\");\n },\n cacheSignal: function () {\n throw Error(\"Not implemented.\");\n }\n };\nfunction prepareStackTrace(error, structuredStackTrace) {\n error = (error.name || \"Error\") + \": \" + (error.message || \"\");\n for (var i = 0; i < structuredStackTrace.length; i++)\n error += \"\\n at \" + structuredStackTrace[i].toString();\n return error;\n}\nvar prefix, suffix;\nfunction describeBuiltInComponentFrame(name) {\n if (void 0 === prefix)\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = (match && match[1]) || \"\";\n suffix =\n -1 < x.stack.indexOf(\"\\n at\")\n ? \" (<anonymous>)\"\n : -1 < x.stack.indexOf(\"@\")\n ? \"@unknown:0:0\"\n : \"\";\n }\n return \"\\n\" + prefix + name + suffix;\n}\nvar reentry = !1;\nfunction describeNativeComponentFrame(fn, construct) {\n if (!fn || reentry) return \"\";\n reentry = !0;\n var previousPrepareStackTrace = Error.prepareStackTrace;\n Error.prepareStackTrace = prepareStackTrace;\n try {\n var RunInRootFrame = {\n DetermineComponentFrameRoot: function () {\n try {\n if (construct) {\n var Fake = function () {\n throw Error();\n };\n Object.defineProperty(Fake.prototype, \"props\", {\n set: function () {\n throw Error();\n }\n });\n if (\"object\" === typeof Reflect && Reflect.construct) {\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n var control = x;\n }\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x$24) {\n control = x$24;\n }\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x$25) {\n control = x$25;\n }\n (Fake = fn()) &&\n \"function\" === typeof Fake.catch &&\n Fake.catch(function () {});\n }\n } catch (sample) {\n if (sample && control && \"string\" === typeof sample.stack)\n return [sample.stack, control.stack];\n }\n return [null, null];\n }\n };\n RunInRootFrame.DetermineComponentFrameRoot.displayName =\n \"DetermineComponentFrameRoot\";\n var namePropDescriptor = Object.getOwnPropertyDescriptor(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\"\n );\n namePropDescriptor &&\n namePropDescriptor.configurable &&\n Object.defineProperty(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\",\n { value: \"DetermineComponentFrameRoot\" }\n );\n var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),\n sampleStack = _RunInRootFrame$Deter[0],\n controlStack = _RunInRootFrame$Deter[1];\n if (sampleStack && controlStack) {\n var sampleLines = sampleStack.split(\"\\n\"),\n controlLines = controlStack.split(\"\\n\");\n for (\n namePropDescriptor = RunInRootFrame = 0;\n RunInRootFrame < sampleLines.length &&\n !sampleLines[RunInRootFrame].includes(\"DetermineComponentFrameRoot\");\n\n )\n RunInRootFrame++;\n for (\n ;\n namePropDescriptor < controlLines.length &&\n !controlLines[namePropDescriptor].includes(\n \"DetermineComponentFrameRoot\"\n );\n\n )\n namePropDescriptor++;\n if (\n RunInRootFrame === sampleLines.length ||\n namePropDescriptor === controlLines.length\n )\n for (\n RunInRootFrame = sampleLines.length - 1,\n namePropDescriptor = controlLines.length - 1;\n 1 <= RunInRootFrame &&\n 0 <= namePropDescriptor &&\n sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor];\n\n )\n namePropDescriptor--;\n for (\n ;\n 1 <= RunInRootFrame && 0 <= namePropDescriptor;\n RunInRootFrame--, namePropDescriptor--\n )\n if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {\n if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {\n do\n if (\n (RunInRootFrame--,\n namePropDescriptor--,\n 0 > namePropDescriptor ||\n sampleLines[RunInRootFrame] !==\n controlLines[namePropDescriptor])\n ) {\n var frame =\n \"\\n\" +\n sampleLines[RunInRootFrame].replace(\" at new \", \" at \");\n fn.displayName &&\n frame.includes(\"<anonymous>\") &&\n (frame = frame.replace(\"<anonymous>\", fn.displayName));\n return frame;\n }\n while (1 <= RunInRootFrame && 0 <= namePropDescriptor);\n }\n break;\n }\n }\n } finally {\n (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace);\n }\n return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : \"\")\n ? describeBuiltInComponentFrame(previousPrepareStackTrace)\n : \"\";\n}\nfunction describeComponentStackByType(type) {\n if (\"string\" === typeof type) return describeBuiltInComponentFrame(type);\n if (\"function\" === typeof type)\n return type.prototype && type.prototype.isReactComponent\n ? describeNativeComponentFrame(type, !0)\n : describeNativeComponentFrame(type, !1);\n if (\"object\" === typeof type && null !== type) {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeNativeComponentFrame(type.render, !1);\n case REACT_MEMO_TYPE:\n return describeNativeComponentFrame(type.type, !1);\n case REACT_LAZY_TYPE:\n var lazyComponent = type,\n payload = lazyComponent._payload;\n lazyComponent = lazyComponent._init;\n try {\n type = lazyComponent(payload);\n } catch (x) {\n return describeBuiltInComponentFrame(\"Lazy\");\n }\n return describeComponentStackByType(type);\n }\n if (\"string\" === typeof type.name) {\n a: {\n payload = type.name;\n lazyComponent = type.env;\n var location = type.debugLocation;\n if (\n null != location &&\n ((type = Error.prepareStackTrace),\n (Error.prepareStackTrace = prepareStackTrace),\n (location = location.stack),\n (Error.prepareStackTrace = type),\n location.startsWith(\"Error: react-stack-top-frame\\n\") &&\n (location = location.slice(29)),\n (type = location.indexOf(\"\\n\")),\n -1 !== type && (location = location.slice(type + 1)),\n (type = location.indexOf(\"react_stack_bottom_frame\")),\n -1 !== type && (type = location.lastIndexOf(\"\\n\", type)),\n (type = -1 !== type ? (location = location.slice(0, type)) : \"\"),\n (location = type.lastIndexOf(\"\\n\")),\n (type = -1 === location ? type : type.slice(location + 1)),\n -1 !== type.indexOf(payload))\n ) {\n payload = \"\\n\" + type;\n break a;\n }\n payload = describeBuiltInComponentFrame(\n payload + (lazyComponent ? \" [\" + lazyComponent + \"]\" : \"\")\n );\n }\n return payload;\n }\n }\n switch (type) {\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame(\"SuspenseList\");\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame(\"Suspense\");\n case REACT_VIEW_TRANSITION_TYPE:\n return describeBuiltInComponentFrame(\"ViewTransition\");\n }\n return \"\";\n}\nfunction getViewTransitionClassName(defaultClass, eventClass) {\n defaultClass =\n null == defaultClass || \"string\" === typeof defaultClass\n ? defaultClass\n : defaultClass.default;\n eventClass =\n null == eventClass || \"string\" === typeof eventClass\n ? eventClass\n : eventClass.default;\n return null == eventClass\n ? \"auto\" === defaultClass\n ? null\n : defaultClass\n : \"auto\" === eventClass\n ? null\n : eventClass;\n}\nfunction isEligibleForOutlining(request, boundary) {\n return (\n (500 < boundary.byteSize || hasSuspenseyContent(boundary.contentState)) &&\n null === boundary.contentPreamble\n );\n}\nfunction defaultErrorHandler(error) {\n if (\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.environmentName\n ) {\n var JSCompiler_inline_result = error.environmentName;\n error = [error].slice(0);\n \"string\" === typeof error[0]\n ? error.splice(\n 0,\n 1,\n \"\\u001b[0m\\u001b[7m%c%s\\u001b[0m%c \" + error[0],\n \"background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px\",\n \" \" + JSCompiler_inline_result + \" \",\n \"\"\n )\n : error.splice(\n 0,\n 0,\n \"\\u001b[0m\\u001b[7m%c%s\\u001b[0m%c\",\n \"background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px\",\n \" \" + JSCompiler_inline_result + \" \",\n \"\"\n );\n error.unshift(console);\n JSCompiler_inline_result = bind.apply(console.error, error);\n JSCompiler_inline_result();\n } else console.error(error);\n return null;\n}\nfunction RequestInstance(\n resumableState,\n renderState,\n rootFormatContext,\n progressiveChunkSize,\n onError,\n onAllReady,\n onShellReady,\n onShellError,\n onFatalError,\n onPostpone,\n formState\n) {\n var abortSet = new Set();\n this.destination = null;\n this.flushScheduled = !1;\n this.resumableState = resumableState;\n this.renderState = renderState;\n this.rootFormatContext = rootFormatContext;\n this.progressiveChunkSize =\n void 0 === progressiveChunkSize ? 12800 : progressiveChunkSize;\n this.status = 10;\n this.fatalError = null;\n this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0;\n this.completedPreambleSegments = this.completedRootSegment = null;\n this.byteSize = 0;\n this.abortableTasks = abortSet;\n this.pingedTasks = [];\n this.clientRenderedBoundaries = [];\n this.completedBoundaries = [];\n this.partialBoundaries = [];\n this.trackedPostpones = null;\n this.onError = void 0 === onError ? defaultErrorHandler : onError;\n this.onPostpone = void 0 === onPostpone ? noop : onPostpone;\n this.onAllReady = void 0 === onAllReady ? noop : onAllReady;\n this.onShellReady = void 0 === onShellReady ? noop : onShellReady;\n this.onShellError = void 0 === onShellError ? noop : onShellError;\n this.onFatalError = void 0 === onFatalError ? noop : onFatalError;\n this.formState = void 0 === formState ? null : formState;\n}\nfunction createRequest(\n children,\n resumableState,\n renderState,\n rootFormatContext,\n progressiveChunkSize,\n onError,\n onAllReady,\n onShellReady,\n onShellError,\n onFatalError,\n onPostpone,\n formState\n) {\n resumableState = new RequestInstance(\n resumableState,\n renderState,\n rootFormatContext,\n progressiveChunkSize,\n onError,\n onAllReady,\n onShellReady,\n onShellError,\n onFatalError,\n onPostpone,\n formState\n );\n renderState = createPendingSegment(\n resumableState,\n 0,\n null,\n rootFormatContext,\n !1,\n !1\n );\n renderState.parentFlushed = !0;\n children = createRenderTask(\n resumableState,\n null,\n children,\n -1,\n null,\n renderState,\n null,\n null,\n resumableState.abortableTasks,\n null,\n rootFormatContext,\n null,\n emptyTreeContext,\n null,\n null\n );\n pushComponentStack(children);\n resumableState.pingedTasks.push(children);\n return resumableState;\n}\nfunction createPrerenderRequest(\n children,\n resumableState,\n renderState,\n rootFormatContext,\n progressiveChunkSize,\n onError,\n onAllReady,\n onShellReady,\n onShellError,\n onFatalError,\n onPostpone\n) {\n children = createRequest(\n children,\n resumableState,\n renderState,\n rootFormatContext,\n progressiveChunkSize,\n onError,\n onAllReady,\n onShellReady,\n onShellError,\n onFatalError,\n onPostpone,\n void 0\n );\n children.trackedPostpones = {\n workingMap: new Map(),\n rootNodes: [],\n rootSlots: null\n };\n return children;\n}\nfunction resumeRequest(\n children,\n postponedState,\n renderState,\n onError,\n onAllReady,\n onShellReady,\n onShellError,\n onFatalError,\n onPostpone\n) {\n renderState = new RequestInstance(\n postponedState.resumableState,\n renderState,\n postponedState.rootFormatContext,\n postponedState.progressiveChunkSize,\n onError,\n onAllReady,\n onShellReady,\n onShellError,\n onFatalError,\n onPostpone,\n null\n );\n renderState.nextSegmentId = postponedState.nextSegmentId;\n if (\"number\" === typeof postponedState.replaySlots)\n return (\n (onError = createPendingSegment(\n renderState,\n 0,\n null,\n postponedState.rootFormatContext,\n !1,\n !1\n )),\n (onError.parentFlushed = !0),\n (children = createRenderTask(\n renderState,\n null,\n children,\n -1,\n null,\n onError,\n null,\n null,\n renderState.abortableTasks,\n null,\n postponedState.rootFormatContext,\n null,\n emptyTreeContext,\n null,\n null\n )),\n pushComponentStack(children),\n renderState.pingedTasks.push(children),\n renderState\n );\n children = createReplayTask(\n renderState,\n null,\n {\n nodes: postponedState.replayNodes,\n slots: postponedState.replaySlots,\n pendingTasks: 0\n },\n children,\n -1,\n null,\n null,\n renderState.abortableTasks,\n null,\n postponedState.rootFormatContext,\n null,\n emptyTreeContext,\n null,\n null\n );\n pushComponentStack(children);\n renderState.pingedTasks.push(children);\n return renderState;\n}\nfunction resumeAndPrerenderRequest(\n children,\n postponedState,\n renderState,\n onError,\n onAllReady,\n onShellReady,\n onShellError,\n onFatalError,\n onPostpone\n) {\n children = resumeRequest(\n children,\n postponedState,\n renderState,\n onError,\n onAllReady,\n onShellReady,\n onShellError,\n onFatalError,\n onPostpone\n );\n children.trackedPostpones = {\n workingMap: new Map(),\n rootNodes: [],\n rootSlots: null\n };\n return children;\n}\nvar currentRequest = null;\nfunction resolveRequest() {\n if (currentRequest) return currentRequest;\n var store = requestStorage.getStore();\n return store ? store : null;\n}\nfunction pingTask(request, task) {\n request.pingedTasks.push(task);\n 1 === request.pingedTasks.length &&\n ((request.flushScheduled = null !== request.destination),\n null !== request.trackedPostpones || 10 === request.status\n ? scheduleMicrotask(function () {\n return performWork(request);\n })\n : setImmediate(function () {\n return performWork(request);\n }));\n}\nfunction createSuspenseBoundary(\n request,\n row,\n fallbackAbortableTasks,\n contentPreamble,\n fallbackPreamble\n) {\n fallbackAbortableTasks = {\n status: 0,\n rootSegmentID: -1,\n parentFlushed: !1,\n pendingTasks: 0,\n row: row,\n completedSegments: [],\n byteSize: 0,\n fallbackAbortableTasks: fallbackAbortableTasks,\n errorDigest: null,\n contentState: createHoistableState(),\n fallbackState: createHoistableState(),\n contentPreamble: contentPreamble,\n fallbackPreamble: fallbackPreamble,\n trackedContentKeyPath: null,\n trackedFallbackNode: null\n };\n null !== row &&\n (row.pendingTasks++,\n (contentPreamble = row.boundaries),\n null !== contentPreamble &&\n (request.allPendingTasks++,\n fallbackAbortableTasks.pendingTasks++,\n contentPreamble.push(fallbackAbortableTasks)),\n (request = row.inheritedHoistables),\n null !== request &&\n hoistHoistables(fallbackAbortableTasks.contentState, request));\n return fallbackAbortableTasks;\n}\nfunction createRenderTask(\n request,\n thenableState,\n node,\n childIndex,\n blockedBoundary,\n blockedSegment,\n blockedPreamble,\n hoistableState,\n abortSet,\n keyPath,\n formatContext,\n context,\n treeContext,\n row,\n componentStack\n) {\n request.allPendingTasks++;\n null === blockedBoundary\n ? request.pendingRootTasks++\n : blockedBoundary.pendingTasks++;\n null !== row && row.pendingTasks++;\n var task = {\n replay: null,\n node: node,\n childIndex: childIndex,\n ping: function () {\n return pingTask(request, task);\n },\n blockedBoundary: blockedBoundary,\n blockedSegment: blockedSegment,\n blockedPreamble: blockedPreamble,\n hoistableState: hoistableState,\n abortSet: abortSet,\n keyPath: keyPath,\n formatContext: formatContext,\n context: context,\n treeContext: treeContext,\n row: row,\n componentStack: componentStack,\n thenableState: thenableState\n };\n abortSet.add(task);\n return task;\n}\nfunction createReplayTask(\n request,\n thenableState,\n replay,\n node,\n childIndex,\n blockedBoundary,\n hoistableState,\n abortSet,\n keyPath,\n formatContext,\n context,\n treeContext,\n row,\n componentStack\n) {\n request.allPendingTasks++;\n null === blockedBoundary\n ? request.pendingRootTasks++\n : blockedBoundary.pendingTasks++;\n null !== row && row.pendingTasks++;\n replay.pendingTasks++;\n var task = {\n replay: replay,\n node: node,\n childIndex: childIndex,\n ping: function () {\n return pingTask(request, task);\n },\n blockedBoundary: blockedBoundary,\n blockedSegment: null,\n blockedPreamble: null,\n hoistableState: hoistableState,\n abortSet: abortSet,\n keyPath: keyPath,\n formatContext: formatContext,\n context: context,\n treeContext: treeContext,\n row: row,\n componentStack: componentStack,\n thenableState: thenableState\n };\n abortSet.add(task);\n return task;\n}\nfunction createPendingSegment(\n request,\n index,\n boundary,\n parentFormatContext,\n lastPushedText,\n textEmbedded\n) {\n return {\n status: 0,\n parentFlushed: !1,\n id: -1,\n index: index,\n chunks: [],\n children: [],\n preambleChildren: [],\n parentFormatContext: parentFormatContext,\n boundary: boundary,\n lastPushedText: lastPushedText,\n textEmbedded: textEmbedded\n };\n}\nfunction pushComponentStack(task) {\n var node = task.node;\n if (\"object\" === typeof node && null !== node)\n switch (node.$$typeof) {\n case REACT_ELEMENT_TYPE:\n task.componentStack = { parent: task.componentStack, type: node.type };\n }\n}\nfunction replaceSuspenseComponentStackWithSuspenseFallbackStack(\n componentStack\n) {\n return null === componentStack\n ? null\n : { parent: componentStack.parent, type: \"Suspense Fallback\" };\n}\nfunction getThrownInfo(node$jscomp$0) {\n var errorInfo = {};\n node$jscomp$0 &&\n Object.defineProperty(errorInfo, \"componentStack\", {\n configurable: !0,\n enumerable: !0,\n get: function () {\n try {\n var info = \"\",\n node = node$jscomp$0;\n do\n (info += describeComponentStackByType(node.type)),\n (node = node.parent);\n while (node);\n var JSCompiler_inline_result = info;\n } catch (x) {\n JSCompiler_inline_result =\n \"\\nError generating stack: \" + x.message + \"\\n\" + x.stack;\n }\n Object.defineProperty(errorInfo, \"componentStack\", {\n value: JSCompiler_inline_result\n });\n return JSCompiler_inline_result;\n }\n });\n return errorInfo;\n}\nfunction logPostpone(request, reason, postponeInfo) {\n request = request.onPostpone;\n request(reason, postponeInfo);\n}\nfunction logRecoverableError(request, error, errorInfo) {\n request = request.onError;\n error = request(error, errorInfo);\n if (null == error || \"string\" === typeof error) return error;\n}\nfunction fatalError(request, error) {\n var onShellError = request.onShellError,\n onFatalError = request.onFatalError;\n onShellError(error);\n onFatalError(error);\n null !== request.destination\n ? ((request.status = 14), request.destination.destroy(error))\n : ((request.status = 13), (request.fatalError = error));\n}\nfunction finishSuspenseListRow(request, row) {\n unblockSuspenseListRow(request, row.next, row.hoistables);\n}\nfunction unblockSuspenseListRow(request, unblockedRow, inheritedHoistables) {\n for (; null !== unblockedRow; ) {\n null !== inheritedHoistables &&\n (hoistHoistables(unblockedRow.hoistables, inheritedHoistables),\n (unblockedRow.inheritedHoistables = inheritedHoistables));\n var unblockedBoundaries = unblockedRow.boundaries;\n if (null !== unblockedBoundaries) {\n unblockedRow.boundaries = null;\n for (var i = 0; i < unblockedBoundaries.length; i++) {\n var unblockedBoundary = unblockedBoundaries[i];\n null !== inheritedHoistables &&\n hoistHoistables(unblockedBoundary.contentState, inheritedHoistables);\n finishedTask(request, unblockedBoundary, null, null);\n }\n }\n unblockedRow.pendingTasks--;\n if (0 < unblockedRow.pendingTasks) break;\n inheritedHoistables = unblockedRow.hoistables;\n unblockedRow = unblockedRow.next;\n }\n}\nfunction tryToResolveTogetherRow(request, togetherRow) {\n var boundaries = togetherRow.boundaries;\n if (null !== boundaries && togetherRow.pendingTasks === boundaries.length) {\n for (var allCompleteAndInlinable = !0, i = 0; i < boundaries.length; i++) {\n var rowBoundary = boundaries[i];\n if (\n 1 !== rowBoundary.pendingTasks ||\n rowBoundary.parentFlushed ||\n isEligibleForOutlining(request, rowBoundary)\n ) {\n allCompleteAndInlinable = !1;\n break;\n }\n }\n allCompleteAndInlinable &&\n unblockSuspenseListRow(request, togetherRow, togetherRow.hoistables);\n }\n}\nfunction createSuspenseListRow(previousRow) {\n var newRow = {\n pendingTasks: 1,\n boundaries: null,\n hoistables: createHoistableState(),\n inheritedHoistables: null,\n together: !1,\n next: null\n };\n null !== previousRow &&\n 0 < previousRow.pendingTasks &&\n (newRow.pendingTasks++,\n (newRow.boundaries = []),\n (previousRow.next = newRow));\n return newRow;\n}\nfunction renderSuspenseListRows(request, task, keyPath, rows, revealOrder) {\n var prevKeyPath = task.keyPath,\n prevTreeContext = task.treeContext,\n prevRow = task.row;\n task.keyPath = keyPath;\n keyPath = rows.length;\n var previousSuspenseListRow = null;\n if (null !== task.replay) {\n var resumeSlots = task.replay.slots;\n if (null !== resumeSlots && \"object\" === typeof resumeSlots)\n for (var n = 0; n < keyPath; n++) {\n var i =\n \"backwards\" !== revealOrder &&\n \"unstable_legacy-backwards\" !== revealOrder\n ? n\n : keyPath - 1 - n,\n node = rows[i];\n task.row = previousSuspenseListRow = createSuspenseListRow(\n previousSuspenseListRow\n );\n task.treeContext = pushTreeContext(prevTreeContext, keyPath, i);\n var resumeSegmentID = resumeSlots[i];\n \"number\" === typeof resumeSegmentID\n ? (resumeNode(request, task, resumeSegmentID, node, i),\n delete resumeSlots[i])\n : renderNode(request, task, node, i);\n 0 === --previousSuspenseListRow.pendingTasks &&\n finishSuspenseListRow(request, previousSuspenseListRow);\n }\n else\n for (resumeSlots = 0; resumeSlots < keyPath; resumeSlots++)\n (n =\n \"backwards\" !== revealOrder &&\n \"unstable_legacy-backwards\" !== revealOrder\n ? resumeSlots\n : keyPath - 1 - resumeSlots),\n (i = rows[n]),\n (task.row = previousSuspenseListRow =\n createSuspenseListRow(previousSuspenseListRow)),\n (task.treeContext = pushTreeContext(prevTreeContext, keyPath, n)),\n renderNode(request, task, i, n),\n 0 === --previousSuspenseListRow.pendingTasks &&\n finishSuspenseListRow(request, previousSuspenseListRow);\n } else if (\n \"backwards\" !== revealOrder &&\n \"unstable_legacy-backwards\" !== revealOrder\n )\n for (revealOrder = 0; revealOrder < keyPath; revealOrder++)\n (resumeSlots = rows[revealOrder]),\n (task.row = previousSuspenseListRow =\n createSuspenseListRow(previousSuspenseListRow)),\n (task.treeContext = pushTreeContext(\n prevTreeContext,\n keyPath,\n revealOrder\n )),\n renderNode(request, task, resumeSlots, revealOrder),\n 0 === --previousSuspenseListRow.pendingTasks &&\n finishSuspenseListRow(request, previousSuspenseListRow);\n else {\n revealOrder = task.blockedSegment;\n resumeSlots = revealOrder.children.length;\n n = revealOrder.chunks.length;\n for (i = keyPath - 1; 0 <= i; i--) {\n node = rows[i];\n task.row = previousSuspenseListRow = createSuspenseListRow(\n previousSuspenseListRow\n );\n task.treeContext = pushTreeContext(prevTreeContext, keyPath, i);\n resumeSegmentID = createPendingSegment(\n request,\n n,\n null,\n task.formatContext,\n 0 === i ? revealOrder.lastPushedText : !0,\n !0\n );\n revealOrder.children.splice(resumeSlots, 0, resumeSegmentID);\n task.blockedSegment = resumeSegmentID;\n try {\n renderNode(request, task, node, i),\n resumeSegmentID.lastPushedText &&\n resumeSegmentID.textEmbedded &&\n resumeSegmentID.chunks.push(textSeparator),\n (resumeSegmentID.status = 1),\n finishedSegment(request, task.blockedBoundary, resumeSegmentID),\n 0 === --previousSuspenseListRow.pendingTasks &&\n finishSuspenseListRow(request, previousSuspenseListRow);\n } catch (thrownValue) {\n throw (\n ((resumeSegmentID.status = 12 === request.status ? 3 : 4),\n thrownValue)\n );\n }\n }\n task.blockedSegment = revealOrder;\n revealOrder.lastPushedText = !1;\n }\n null !== prevRow &&\n null !== previousSuspenseListRow &&\n 0 < previousSuspenseListRow.pendingTasks &&\n (prevRow.pendingTasks++, (previousSuspenseListRow.next = prevRow));\n task.treeContext = prevTreeContext;\n task.row = prevRow;\n task.keyPath = prevKeyPath;\n}\nfunction renderWithHooks(request, task, keyPath, Component, props, secondArg) {\n var prevThenableState = task.thenableState;\n task.thenableState = null;\n currentlyRenderingComponent = {};\n currentlyRenderingTask = task;\n currentlyRenderingRequest = request;\n currentlyRenderingKeyPath = keyPath;\n actionStateCounter = localIdCounter = 0;\n actionStateMatchingIndex = -1;\n thenableIndexCounter = 0;\n thenableState = prevThenableState;\n for (request = Component(props, secondArg); didScheduleRenderPhaseUpdate; )\n (didScheduleRenderPhaseUpdate = !1),\n (actionStateCounter = localIdCounter = 0),\n (actionStateMatchingIndex = -1),\n (thenableIndexCounter = 0),\n (numberOfReRenders += 1),\n (workInProgressHook = null),\n (request = Component(props, secondArg));\n resetHooksState();\n return request;\n}\nfunction finishFunctionComponent(\n request,\n task,\n keyPath,\n children,\n hasId,\n actionStateCount,\n actionStateMatchingIndex\n) {\n var didEmitActionStateMarkers = !1;\n if (0 !== actionStateCount && null !== request.formState) {\n var segment = task.blockedSegment;\n if (null !== segment) {\n didEmitActionStateMarkers = !0;\n segment = segment.chunks;\n for (var i = 0; i < actionStateCount; i++)\n i === actionStateMatchingIndex\n ? segment.push(formStateMarkerIsMatching)\n : segment.push(formStateMarkerIsNotMatching);\n }\n }\n actionStateCount = task.keyPath;\n task.keyPath = keyPath;\n hasId\n ? ((keyPath = task.treeContext),\n (task.treeContext = pushTreeContext(keyPath, 1, 0)),\n renderNode(request, task, children, -1),\n (task.treeContext = keyPath))\n : didEmitActionStateMarkers\n ? renderNode(request, task, children, -1)\n : renderNodeDestructive(request, task, children, -1);\n task.keyPath = actionStateCount;\n}\nfunction renderElement(request, task, keyPath, type, props, ref) {\n if (\"function\" === typeof type)\n if (type.prototype && type.prototype.isReactComponent) {\n var newProps = props;\n if (\"ref\" in props) {\n newProps = {};\n for (var propName in props)\n \"ref\" !== propName && (newProps[propName] = props[propName]);\n }\n var defaultProps = type.defaultProps;\n if (defaultProps) {\n newProps === props && (newProps = assign({}, newProps, props));\n for (var propName$47 in defaultProps)\n void 0 === newProps[propName$47] &&\n (newProps[propName$47] = defaultProps[propName$47]);\n }\n var JSCompiler_inline_result = newProps;\n var context = emptyContextObject,\n contextType = type.contextType;\n \"object\" === typeof contextType &&\n null !== contextType &&\n (context = contextType._currentValue);\n var JSCompiler_inline_result$jscomp$0 = new type(\n JSCompiler_inline_result,\n context\n );\n var initialState =\n void 0 !== JSCompiler_inline_result$jscomp$0.state\n ? JSCompiler_inline_result$jscomp$0.state\n : null;\n JSCompiler_inline_result$jscomp$0.updater = classComponentUpdater;\n JSCompiler_inline_result$jscomp$0.props = JSCompiler_inline_result;\n JSCompiler_inline_result$jscomp$0.state = initialState;\n var internalInstance = { queue: [], replace: !1 };\n JSCompiler_inline_result$jscomp$0._reactInternals = internalInstance;\n var contextType$jscomp$0 = type.contextType;\n JSCompiler_inline_result$jscomp$0.context =\n \"object\" === typeof contextType$jscomp$0 &&\n null !== contextType$jscomp$0\n ? contextType$jscomp$0._currentValue\n : emptyContextObject;\n var getDerivedStateFromProps = type.getDerivedStateFromProps;\n if (\"function\" === typeof getDerivedStateFromProps) {\n var partialState = getDerivedStateFromProps(\n JSCompiler_inline_result,\n initialState\n );\n var JSCompiler_inline_result$jscomp$1 =\n null === partialState || void 0 === partialState\n ? initialState\n : assign({}, initialState, partialState);\n JSCompiler_inline_result$jscomp$0.state =\n JSCompiler_inline_result$jscomp$1;\n }\n if (\n \"function\" !== typeof type.getDerivedStateFromProps &&\n \"function\" !==\n typeof JSCompiler_inline_result$jscomp$0.getSnapshotBeforeUpdate &&\n (\"function\" ===\n typeof JSCompiler_inline_result$jscomp$0.UNSAFE_componentWillMount ||\n \"function\" ===\n typeof JSCompiler_inline_result$jscomp$0.componentWillMount)\n ) {\n var oldState = JSCompiler_inline_result$jscomp$0.state;\n \"function\" ===\n typeof JSCompiler_inline_result$jscomp$0.componentWillMount &&\n JSCompiler_inline_result$jscomp$0.componentWillMount();\n \"function\" ===\n typeof JSCompiler_inline_result$jscomp$0.UNSAFE_componentWillMount &&\n JSCompiler_inline_result$jscomp$0.UNSAFE_componentWillMount();\n oldState !== JSCompiler_inline_result$jscomp$0.state &&\n classComponentUpdater.enqueueReplaceState(\n JSCompiler_inline_result$jscomp$0,\n JSCompiler_inline_result$jscomp$0.state,\n null\n );\n if (\n null !== internalInstance.queue &&\n 0 < internalInstance.queue.length\n ) {\n var oldQueue = internalInstance.queue,\n oldReplace = internalInstance.replace;\n internalInstance.queue = null;\n internalInstance.replace = !1;\n if (oldReplace && 1 === oldQueue.length)\n JSCompiler_inline_result$jscomp$0.state = oldQueue[0];\n else {\n for (\n var nextState = oldReplace\n ? oldQueue[0]\n : JSCompiler_inline_result$jscomp$0.state,\n dontMutate = !0,\n i = oldReplace ? 1 : 0;\n i < oldQueue.length;\n i++\n ) {\n var partial = oldQueue[i],\n partialState$jscomp$0 =\n \"function\" === typeof partial\n ? partial.call(\n JSCompiler_inline_result$jscomp$0,\n nextState,\n JSCompiler_inline_result,\n void 0\n )\n : partial;\n null != partialState$jscomp$0 &&\n (dontMutate\n ? ((dontMutate = !1),\n (nextState = assign({}, nextState, partialState$jscomp$0)))\n : assign(nextState, partialState$jscomp$0));\n }\n JSCompiler_inline_result$jscomp$0.state = nextState;\n }\n } else internalInstance.queue = null;\n }\n var nextChildren = JSCompiler_inline_result$jscomp$0.render();\n if (12 === request.status) throw null;\n var prevKeyPath = task.keyPath;\n task.keyPath = keyPath;\n renderNodeDestructive(request, task, nextChildren, -1);\n task.keyPath = prevKeyPath;\n } else {\n var value = renderWithHooks(request, task, keyPath, type, props, void 0);\n if (12 === request.status) throw null;\n finishFunctionComponent(\n request,\n task,\n keyPath,\n value,\n 0 !== localIdCounter,\n actionStateCounter,\n actionStateMatchingIndex\n );\n }\n else if (\"string\" === typeof type) {\n var segment = task.blockedSegment;\n if (null === segment) {\n var children = props.children,\n prevContext = task.formatContext,\n prevKeyPath$jscomp$0 = task.keyPath;\n task.formatContext = getChildFormatContext(prevContext, type, props);\n task.keyPath = keyPath;\n renderNode(request, task, children, -1);\n task.formatContext = prevContext;\n task.keyPath = prevKeyPath$jscomp$0;\n } else {\n var children$44 = pushStartInstance(\n segment.chunks,\n type,\n props,\n request.resumableState,\n request.renderState,\n task.blockedPreamble,\n task.hoistableState,\n task.formatContext,\n segment.lastPushedText\n );\n segment.lastPushedText = !1;\n var prevContext$45 = task.formatContext,\n prevKeyPath$46 = task.keyPath;\n task.keyPath = keyPath;\n if (\n 3 ===\n (task.formatContext = getChildFormatContext(\n prevContext$45,\n type,\n props\n )).insertionMode\n ) {\n var preambleSegment = createPendingSegment(\n request,\n 0,\n null,\n task.formatContext,\n !1,\n !1\n );\n segment.preambleChildren.push(preambleSegment);\n task.blockedSegment = preambleSegment;\n try {\n (preambleSegment.status = 6),\n renderNode(request, task, children$44, -1),\n preambleSegment.lastPushedText &&\n preambleSegment.textEmbedded &&\n preambleSegment.chunks.push(textSeparator),\n (preambleSegment.status = 1),\n finishedSegment(request, task.blockedBoundary, preambleSegment);\n } finally {\n task.blockedSegment = segment;\n }\n } else renderNode(request, task, children$44, -1);\n task.formatContext = prevContext$45;\n task.keyPath = prevKeyPath$46;\n a: {\n var target = segment.chunks,\n resumableState = request.resumableState;\n switch (type) {\n case \"title\":\n case \"style\":\n case \"script\":\n case \"area\":\n case \"base\":\n case \"br\":\n case \"col\":\n case \"embed\":\n case \"hr\":\n case \"img\":\n case \"input\":\n case \"keygen\":\n case \"link\":\n case \"meta\":\n case \"param\":\n case \"source\":\n case \"track\":\n case \"wbr\":\n break a;\n case \"body\":\n if (1 >= prevContext$45.insertionMode) {\n resumableState.hasBody = !0;\n break a;\n }\n break;\n case \"html\":\n if (0 === prevContext$45.insertionMode) {\n resumableState.hasHtml = !0;\n break a;\n }\n break;\n case \"head\":\n if (1 >= prevContext$45.insertionMode) break a;\n }\n target.push(endChunkForTag(type));\n }\n segment.lastPushedText = !1;\n }\n } else {\n switch (type) {\n case REACT_LEGACY_HIDDEN_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_FRAGMENT_TYPE:\n var prevKeyPath$jscomp$1 = task.keyPath;\n task.keyPath = keyPath;\n renderNodeDestructive(request, task, props.children, -1);\n task.keyPath = prevKeyPath$jscomp$1;\n return;\n case REACT_ACTIVITY_TYPE:\n var segment$jscomp$0 = task.blockedSegment;\n if (null === segment$jscomp$0) {\n if (\"hidden\" !== props.mode) {\n var prevKeyPath$jscomp$2 = task.keyPath;\n task.keyPath = keyPath;\n renderNode(request, task, props.children, -1);\n task.keyPath = prevKeyPath$jscomp$2;\n }\n } else if (\"hidden\" !== props.mode) {\n segment$jscomp$0.chunks.push(startActivityBoundary);\n segment$jscomp$0.lastPushedText = !1;\n var prevKeyPath$49 = task.keyPath;\n task.keyPath = keyPath;\n renderNode(request, task, props.children, -1);\n task.keyPath = prevKeyPath$49;\n segment$jscomp$0.chunks.push(endActivityBoundary);\n segment$jscomp$0.lastPushedText = !1;\n }\n return;\n case REACT_SUSPENSE_LIST_TYPE:\n a: {\n var children$jscomp$0 = props.children,\n revealOrder = props.revealOrder;\n if (\n \"forwards\" === revealOrder ||\n \"backwards\" === revealOrder ||\n \"unstable_legacy-backwards\" === revealOrder\n ) {\n if (isArrayImpl(children$jscomp$0)) {\n renderSuspenseListRows(\n request,\n task,\n keyPath,\n children$jscomp$0,\n revealOrder\n );\n break a;\n }\n var iteratorFn = getIteratorFn(children$jscomp$0);\n if (iteratorFn) {\n var iterator = iteratorFn.call(children$jscomp$0);\n if (iterator) {\n var step = iterator.next();\n if (!step.done) {\n do step = iterator.next();\n while (!step.done);\n renderSuspenseListRows(\n request,\n task,\n keyPath,\n children$jscomp$0,\n revealOrder\n );\n }\n break a;\n }\n }\n if (\"function\" === typeof children$jscomp$0[ASYNC_ITERATOR]) {\n var iterator$40 = children$jscomp$0[ASYNC_ITERATOR]();\n if (iterator$40) {\n var prevThenableState = task.thenableState;\n task.thenableState = null;\n thenableIndexCounter = 0;\n thenableState = prevThenableState;\n var rows = [],\n done = !1;\n if (iterator$40 === children$jscomp$0)\n for (\n var step$41 = readPreviousThenableFromState();\n void 0 !== step$41;\n\n ) {\n if (step$41.done) {\n done = !0;\n break;\n }\n rows.push(step$41.value);\n step$41 = readPreviousThenableFromState();\n }\n if (!done)\n for (\n var step$42 = unwrapThenable(iterator$40.next());\n !step$42.done;\n\n )\n rows.push(step$42.value),\n (step$42 = unwrapThenable(iterator$40.next()));\n renderSuspenseListRows(\n request,\n task,\n keyPath,\n rows,\n revealOrder\n );\n break a;\n }\n }\n }\n if (\"together\" === revealOrder) {\n var prevKeyPath$43 = task.keyPath,\n prevRow = task.row,\n newRow = (task.row = createSuspenseListRow(null));\n newRow.boundaries = [];\n newRow.together = !0;\n task.keyPath = keyPath;\n renderNodeDestructive(request, task, children$jscomp$0, -1);\n 0 === --newRow.pendingTasks &&\n finishSuspenseListRow(request, newRow);\n task.keyPath = prevKeyPath$43;\n task.row = prevRow;\n null !== prevRow &&\n 0 < newRow.pendingTasks &&\n (prevRow.pendingTasks++, (newRow.next = prevRow));\n } else {\n var prevKeyPath$jscomp$3 = task.keyPath;\n task.keyPath = keyPath;\n renderNodeDestructive(request, task, children$jscomp$0, -1);\n task.keyPath = prevKeyPath$jscomp$3;\n }\n }\n return;\n case REACT_VIEW_TRANSITION_TYPE:\n var prevContext$jscomp$0 = task.formatContext,\n prevKeyPath$jscomp$4 = task.keyPath;\n var resumableState$jscomp$0 = request.resumableState;\n if (null != props.name && \"auto\" !== props.name)\n var JSCompiler_inline_result$jscomp$2 = props.name;\n else {\n var treeId = getTreeId(task.treeContext);\n JSCompiler_inline_result$jscomp$2 = makeId(\n resumableState$jscomp$0,\n treeId,\n 0\n );\n }\n var autoName = JSCompiler_inline_result$jscomp$2,\n resumableState$jscomp$1 = request.resumableState,\n update = getViewTransitionClassName(props.default, props.update),\n enter = getViewTransitionClassName(props.default, props.enter),\n exit = getViewTransitionClassName(props.default, props.exit),\n share = getViewTransitionClassName(props.default, props.share),\n name = props.name;\n null == update && (update = \"auto\");\n null == enter && (enter = \"auto\");\n null == exit && (exit = \"auto\");\n if (null == name) {\n var parentViewTransition = prevContext$jscomp$0.viewTransition;\n null !== parentViewTransition\n ? ((name = parentViewTransition.name),\n (share = parentViewTransition.share))\n : ((name = \"auto\"), (share = \"none\"));\n } else\n null == share && (share = \"auto\"),\n prevContext$jscomp$0.tagScope & 4 &&\n (resumableState$jscomp$1.instructions |= 128);\n prevContext$jscomp$0.tagScope & 8\n ? (resumableState$jscomp$1.instructions |= 128)\n : (exit = \"none\");\n prevContext$jscomp$0.tagScope & 16\n ? (resumableState$jscomp$1.instructions |= 128)\n : (enter = \"none\");\n var viewTransition = {\n update: update,\n enter: enter,\n exit: exit,\n share: share,\n name: name,\n autoName: autoName,\n nameIdx: 0\n },\n subtreeScope = prevContext$jscomp$0.tagScope & -25;\n subtreeScope =\n \"none\" !== update ? subtreeScope | 32 : subtreeScope & -33;\n \"none\" !== enter && (subtreeScope |= 64);\n var JSCompiler_inline_result$jscomp$3 = createFormatContext(\n prevContext$jscomp$0.insertionMode,\n prevContext$jscomp$0.selectedValue,\n subtreeScope,\n viewTransition\n );\n task.formatContext = JSCompiler_inline_result$jscomp$3;\n task.keyPath = keyPath;\n if (null != props.name && \"auto\" !== props.name)\n renderNodeDestructive(request, task, props.children, -1);\n else {\n var prevTreeContext = task.treeContext;\n task.treeContext = pushTreeContext(prevTreeContext, 1, 0);\n renderNode(request, task, props.children, -1);\n task.treeContext = prevTreeContext;\n }\n task.formatContext = prevContext$jscomp$0;\n task.keyPath = prevKeyPath$jscomp$4;\n return;\n case REACT_SCOPE_TYPE:\n throw Error(\"ReactDOMServer does not yet support scope components.\");\n case REACT_SUSPENSE_TYPE:\n a: if (null !== task.replay) {\n var prevKeyPath$27 = task.keyPath,\n prevContext$28 = task.formatContext,\n prevRow$29 = task.row;\n task.keyPath = keyPath;\n task.formatContext = getSuspenseContentFormatContext(\n request.resumableState,\n prevContext$28\n );\n task.row = null;\n var content$30 = props.children;\n try {\n renderNode(request, task, content$30, -1);\n } finally {\n (task.keyPath = prevKeyPath$27),\n (task.formatContext = prevContext$28),\n (task.row = prevRow$29);\n }\n } else {\n var prevKeyPath$jscomp$5 = task.keyPath,\n prevContext$jscomp$1 = task.formatContext,\n prevRow$jscomp$0 = task.row,\n parentBoundary = task.blockedBoundary,\n parentPreamble = task.blockedPreamble,\n parentHoistableState = task.hoistableState,\n parentSegment = task.blockedSegment,\n fallback = props.fallback,\n content = props.children,\n fallbackAbortSet = new Set();\n var newBoundary =\n 2 > task.formatContext.insertionMode\n ? createSuspenseBoundary(\n request,\n task.row,\n fallbackAbortSet,\n createPreambleState(),\n createPreambleState()\n )\n : createSuspenseBoundary(\n request,\n task.row,\n fallbackAbortSet,\n null,\n null\n );\n null !== request.trackedPostpones &&\n (newBoundary.trackedContentKeyPath = keyPath);\n var boundarySegment = createPendingSegment(\n request,\n parentSegment.chunks.length,\n newBoundary,\n task.formatContext,\n !1,\n !1\n );\n parentSegment.children.push(boundarySegment);\n parentSegment.lastPushedText = !1;\n var contentRootSegment = createPendingSegment(\n request,\n 0,\n null,\n task.formatContext,\n !1,\n !1\n );\n contentRootSegment.parentFlushed = !0;\n if (null !== request.trackedPostpones) {\n var suspenseComponentStack = task.componentStack,\n fallbackKeyPath = [keyPath[0], \"Suspense Fallback\", keyPath[2]],\n fallbackReplayNode = [\n fallbackKeyPath[1],\n fallbackKeyPath[2],\n [],\n null\n ];\n request.trackedPostpones.workingMap.set(\n fallbackKeyPath,\n fallbackReplayNode\n );\n newBoundary.trackedFallbackNode = fallbackReplayNode;\n task.blockedSegment = boundarySegment;\n task.blockedPreamble = newBoundary.fallbackPreamble;\n task.keyPath = fallbackKeyPath;\n task.formatContext = getSuspenseFallbackFormatContext(\n request.resumableState,\n prevContext$jscomp$1\n );\n task.componentStack =\n replaceSuspenseComponentStackWithSuspenseFallbackStack(\n suspenseComponentStack\n );\n boundarySegment.status = 6;\n try {\n renderNode(request, task, fallback, -1),\n boundarySegment.lastPushedText &&\n boundarySegment.textEmbedded &&\n boundarySegment.chunks.push(textSeparator),\n (boundarySegment.status = 1),\n finishedSegment(request, parentBoundary, boundarySegment);\n } catch (thrownValue) {\n throw (\n ((boundarySegment.status = 12 === request.status ? 3 : 4),\n thrownValue)\n );\n } finally {\n (task.blockedSegment = parentSegment),\n (task.blockedPreamble = parentPreamble),\n (task.keyPath = prevKeyPath$jscomp$5),\n (task.formatContext = prevContext$jscomp$1);\n }\n var suspendedPrimaryTask = createRenderTask(\n request,\n null,\n content,\n -1,\n newBoundary,\n contentRootSegment,\n newBoundary.contentPreamble,\n newBoundary.contentState,\n task.abortSet,\n keyPath,\n getSuspenseContentFormatContext(\n request.resumableState,\n task.formatContext\n ),\n task.context,\n task.treeContext,\n null,\n suspenseComponentStack\n );\n pushComponentStack(suspendedPrimaryTask);\n request.pingedTasks.push(suspendedPrimaryTask);\n } else {\n task.blockedBoundary = newBoundary;\n task.blockedPreamble = newBoundary.contentPreamble;\n task.hoistableState = newBoundary.contentState;\n task.blockedSegment = contentRootSegment;\n task.keyPath = keyPath;\n task.formatContext = getSuspenseContentFormatContext(\n request.resumableState,\n prevContext$jscomp$1\n );\n task.row = null;\n contentRootSegment.status = 6;\n try {\n if (\n (renderNode(request, task, content, -1),\n contentRootSegment.lastPushedText &&\n contentRootSegment.textEmbedded &&\n contentRootSegment.chunks.push(textSeparator),\n (contentRootSegment.status = 1),\n finishedSegment(request, newBoundary, contentRootSegment),\n queueCompletedSegment(newBoundary, contentRootSegment),\n 0 === newBoundary.pendingTasks && 0 === newBoundary.status)\n ) {\n if (\n ((newBoundary.status = 1),\n !isEligibleForOutlining(request, newBoundary))\n ) {\n null !== prevRow$jscomp$0 &&\n 0 === --prevRow$jscomp$0.pendingTasks &&\n finishSuspenseListRow(request, prevRow$jscomp$0);\n 0 === request.pendingRootTasks &&\n task.blockedPreamble &&\n preparePreamble(request);\n break a;\n }\n } else\n null !== prevRow$jscomp$0 &&\n prevRow$jscomp$0.together &&\n tryToResolveTogetherRow(request, prevRow$jscomp$0);\n } catch (thrownValue$31) {\n newBoundary.status = 4;\n if (12 === request.status) {\n contentRootSegment.status = 3;\n var error = request.fatalError;\n } else (contentRootSegment.status = 4), (error = thrownValue$31);\n var thrownInfo = getThrownInfo(task.componentStack);\n if (\n \"object\" === typeof error &&\n null !== error &&\n error.$$typeof === REACT_POSTPONE_TYPE\n ) {\n logPostpone(request, error.message, thrownInfo);\n var errorDigest = \"POSTPONE\";\n } else\n errorDigest = logRecoverableError(request, error, thrownInfo);\n newBoundary.errorDigest = errorDigest;\n untrackBoundary(request, newBoundary);\n } finally {\n (task.blockedBoundary = parentBoundary),\n (task.blockedPreamble = parentPreamble),\n (task.hoistableState = parentHoistableState),\n (task.blockedSegment = parentSegment),\n (task.keyPath = prevKeyPath$jscomp$5),\n (task.formatContext = prevContext$jscomp$1),\n (task.row = prevRow$jscomp$0);\n }\n var suspendedFallbackTask = createRenderTask(\n request,\n null,\n fallback,\n -1,\n parentBoundary,\n boundarySegment,\n newBoundary.fallbackPreamble,\n newBoundary.fallbackState,\n fallbackAbortSet,\n [keyPath[0], \"Suspense Fallback\", keyPath[2]],\n getSuspenseFallbackFormatContext(\n request.resumableState,\n task.formatContext\n ),\n task.context,\n task.treeContext,\n task.row,\n replaceSuspenseComponentStackWithSuspenseFallbackStack(\n task.componentStack\n )\n );\n pushComponentStack(suspendedFallbackTask);\n request.pingedTasks.push(suspendedFallbackTask);\n }\n }\n return;\n }\n if (\"object\" === typeof type && null !== type)\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n if (\"ref\" in props) {\n var propsWithoutRef = {};\n for (var key in props)\n \"ref\" !== key && (propsWithoutRef[key] = props[key]);\n } else propsWithoutRef = props;\n var children$jscomp$1 = renderWithHooks(\n request,\n task,\n keyPath,\n type.render,\n propsWithoutRef,\n ref\n );\n finishFunctionComponent(\n request,\n task,\n keyPath,\n children$jscomp$1,\n 0 !== localIdCounter,\n actionStateCounter,\n actionStateMatchingIndex\n );\n return;\n case REACT_MEMO_TYPE:\n renderElement(request, task, keyPath, type.type, props, ref);\n return;\n case REACT_CONTEXT_TYPE:\n var children$jscomp$2 = props.children,\n prevKeyPath$jscomp$6 = task.keyPath,\n nextValue = props.value;\n var prevValue = type._currentValue;\n type._currentValue = nextValue;\n var prevNode = currentActiveSnapshot,\n newNode = {\n parent: prevNode,\n depth: null === prevNode ? 0 : prevNode.depth + 1,\n context: type,\n parentValue: prevValue,\n value: nextValue\n };\n currentActiveSnapshot = newNode;\n task.context = newNode;\n task.keyPath = keyPath;\n renderNodeDestructive(request, task, children$jscomp$2, -1);\n var prevSnapshot = currentActiveSnapshot;\n if (null === prevSnapshot)\n throw Error(\n \"Tried to pop a Context at the root of the app. This is a bug in React.\"\n );\n prevSnapshot.context._currentValue = prevSnapshot.parentValue;\n var JSCompiler_inline_result$jscomp$4 = (currentActiveSnapshot =\n prevSnapshot.parent);\n task.context = JSCompiler_inline_result$jscomp$4;\n task.keyPath = prevKeyPath$jscomp$6;\n return;\n case REACT_CONSUMER_TYPE:\n var render = props.children,\n newChildren = render(type._context._currentValue),\n prevKeyPath$jscomp$7 = task.keyPath;\n task.keyPath = keyPath;\n renderNodeDestructive(request, task, newChildren, -1);\n task.keyPath = prevKeyPath$jscomp$7;\n return;\n case REACT_LAZY_TYPE:\n var init = type._init;\n var Component = init(type._payload);\n if (12 === request.status) throw null;\n renderElement(request, task, keyPath, Component, props, ref);\n return;\n }\n throw Error(\n \"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: \" +\n ((null == type ? type : typeof type) + \".\")\n );\n }\n}\nfunction resumeNode(request, task, segmentId, node, childIndex) {\n var prevReplay = task.replay,\n blockedBoundary = task.blockedBoundary,\n resumedSegment = createPendingSegment(\n request,\n 0,\n null,\n task.formatContext,\n !1,\n !1\n );\n resumedSegment.id = segmentId;\n resumedSegment.parentFlushed = !0;\n try {\n (task.replay = null),\n (task.blockedSegment = resumedSegment),\n renderNode(request, task, node, childIndex),\n (resumedSegment.status = 1),\n finishedSegment(request, blockedBoundary, resumedSegment),\n null === blockedBoundary\n ? (request.completedRootSegment = resumedSegment)\n : (queueCompletedSegment(blockedBoundary, resumedSegment),\n blockedBoundary.parentFlushed &&\n request.partialBoundaries.push(blockedBoundary));\n } finally {\n (task.replay = prevReplay), (task.blockedSegment = null);\n }\n}\nfunction renderNodeDestructive(request, task, node, childIndex) {\n null !== task.replay && \"number\" === typeof task.replay.slots\n ? resumeNode(request, task, task.replay.slots, node, childIndex)\n : ((task.node = node),\n (task.childIndex = childIndex),\n (node = task.componentStack),\n pushComponentStack(task),\n retryNode(request, task),\n (task.componentStack = node));\n}\nfunction retryNode(request, task) {\n var node = task.node,\n childIndex = task.childIndex;\n if (null !== node) {\n if (\"object\" === typeof node) {\n switch (node.$$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = node.type,\n key = node.key,\n props = node.props;\n node = props.ref;\n var ref = void 0 !== node ? node : null,\n name = getComponentNameFromType(type),\n keyOrIndex =\n null == key ? (-1 === childIndex ? 0 : childIndex) : key;\n key = [task.keyPath, name, keyOrIndex];\n if (null !== task.replay)\n a: {\n var replay = task.replay;\n childIndex = replay.nodes;\n for (node = 0; node < childIndex.length; node++) {\n var node$jscomp$0 = childIndex[node];\n if (keyOrIndex === node$jscomp$0[1]) {\n if (4 === node$jscomp$0.length) {\n if (null !== name && name !== node$jscomp$0[0])\n throw Error(\n \"Expected the resume to render <\" +\n node$jscomp$0[0] +\n \"> in this slot but instead it rendered <\" +\n name +\n \">. The tree doesn't match so React will fallback to client rendering.\"\n );\n var childNodes = node$jscomp$0[2];\n name = node$jscomp$0[3];\n keyOrIndex = task.node;\n task.replay = {\n nodes: childNodes,\n slots: name,\n pendingTasks: 1\n };\n try {\n renderElement(request, task, key, type, props, ref);\n if (\n 1 === task.replay.pendingTasks &&\n 0 < task.replay.nodes.length\n )\n throw Error(\n \"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.\"\n );\n task.replay.pendingTasks--;\n } catch (x) {\n if (\n \"object\" === typeof x &&\n null !== x &&\n (x === SuspenseException ||\n \"function\" === typeof x.then)\n )\n throw (\n (task.node === keyOrIndex\n ? (task.replay = replay)\n : childIndex.splice(node, 1),\n x)\n );\n task.replay.pendingTasks--;\n props = getThrownInfo(task.componentStack);\n erroredReplay(\n request,\n task.blockedBoundary,\n x,\n props,\n childNodes,\n name\n );\n }\n task.replay = replay;\n } else {\n if (type !== REACT_SUSPENSE_TYPE)\n throw Error(\n \"Expected the resume to render <Suspense> in this slot but instead it rendered <\" +\n (getComponentNameFromType(type) || \"Unknown\") +\n \">. The tree doesn't match so React will fallback to client rendering.\"\n );\n b: {\n type = void 0;\n ref = node$jscomp$0[5];\n replay = node$jscomp$0[2];\n name = node$jscomp$0[3];\n keyOrIndex =\n null === node$jscomp$0[4] ? [] : node$jscomp$0[4][2];\n node$jscomp$0 =\n null === node$jscomp$0[4] ? null : node$jscomp$0[4][3];\n var prevKeyPath = task.keyPath,\n prevContext = task.formatContext,\n prevRow = task.row,\n previousReplaySet = task.replay,\n parentBoundary = task.blockedBoundary,\n parentHoistableState = task.hoistableState,\n content = props.children,\n fallback = props.fallback,\n fallbackAbortSet = new Set();\n props =\n 2 > task.formatContext.insertionMode\n ? createSuspenseBoundary(\n request,\n task.row,\n fallbackAbortSet,\n createPreambleState(),\n createPreambleState()\n )\n : createSuspenseBoundary(\n request,\n task.row,\n fallbackAbortSet,\n null,\n null\n );\n props.parentFlushed = !0;\n props.rootSegmentID = ref;\n task.blockedBoundary = props;\n task.hoistableState = props.contentState;\n task.keyPath = key;\n task.formatContext = getSuspenseContentFormatContext(\n request.resumableState,\n prevContext\n );\n task.row = null;\n task.replay = {\n nodes: replay,\n slots: name,\n pendingTasks: 1\n };\n try {\n renderNode(request, task, content, -1);\n if (\n 1 === task.replay.pendingTasks &&\n 0 < task.replay.nodes.length\n )\n throw Error(\n \"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.\"\n );\n task.replay.pendingTasks--;\n if (0 === props.pendingTasks && 0 === props.status) {\n props.status = 1;\n request.completedBoundaries.push(props);\n break b;\n }\n } catch (error) {\n (props.status = 4),\n (childNodes = getThrownInfo(task.componentStack)),\n \"object\" === typeof error &&\n null !== error &&\n error.$$typeof === REACT_POSTPONE_TYPE\n ? (logPostpone(request, error.message, childNodes),\n (type = \"POSTPONE\"))\n : (type = logRecoverableError(\n request,\n error,\n childNodes\n )),\n (props.errorDigest = type),\n task.replay.pendingTasks--,\n request.clientRenderedBoundaries.push(props);\n } finally {\n (task.blockedBoundary = parentBoundary),\n (task.hoistableState = parentHoistableState),\n (task.replay = previousReplaySet),\n (task.keyPath = prevKeyPath),\n (task.formatContext = prevContext),\n (task.row = prevRow);\n }\n task = createReplayTask(\n request,\n null,\n {\n nodes: keyOrIndex,\n slots: node$jscomp$0,\n pendingTasks: 0\n },\n fallback,\n -1,\n parentBoundary,\n props.fallbackState,\n fallbackAbortSet,\n [key[0], \"Suspense Fallback\", key[2]],\n getSuspenseFallbackFormatContext(\n request.resumableState,\n task.formatContext\n ),\n task.context,\n task.treeContext,\n task.row,\n replaceSuspenseComponentStackWithSuspenseFallbackStack(\n task.componentStack\n )\n );\n pushComponentStack(task);\n request.pingedTasks.push(task);\n }\n }\n childIndex.splice(node, 1);\n break a;\n }\n }\n }\n else renderElement(request, task, key, type, props, ref);\n return;\n case REACT_PORTAL_TYPE:\n throw Error(\n \"Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.\"\n );\n case REACT_LAZY_TYPE:\n childNodes = node._init;\n node = childNodes(node._payload);\n if (12 === request.status) throw null;\n renderNodeDestructive(request, task, node, childIndex);\n return;\n }\n if (isArrayImpl(node)) {\n renderChildrenArray(request, task, node, childIndex);\n return;\n }\n if ((childNodes = getIteratorFn(node)))\n if ((childNodes = childNodes.call(node))) {\n node = childNodes.next();\n if (!node.done) {\n props = [];\n do props.push(node.value), (node = childNodes.next());\n while (!node.done);\n renderChildrenArray(request, task, props, childIndex);\n }\n return;\n }\n if (\n \"function\" === typeof node[ASYNC_ITERATOR] &&\n (childNodes = node[ASYNC_ITERATOR]())\n ) {\n props = task.thenableState;\n task.thenableState = null;\n thenableIndexCounter = 0;\n thenableState = props;\n props = [];\n key = !1;\n if (childNodes === node)\n for (node = readPreviousThenableFromState(); void 0 !== node; ) {\n if (node.done) {\n key = !0;\n break;\n }\n props.push(node.value);\n node = readPreviousThenableFromState();\n }\n if (!key)\n for (node = unwrapThenable(childNodes.next()); !node.done; )\n props.push(node.value), (node = unwrapThenable(childNodes.next()));\n renderChildrenArray(request, task, props, childIndex);\n return;\n }\n if (\"function\" === typeof node.then)\n return (\n (task.thenableState = null),\n renderNodeDestructive(request, task, unwrapThenable(node), childIndex)\n );\n if (node.$$typeof === REACT_CONTEXT_TYPE)\n return renderNodeDestructive(\n request,\n task,\n node._currentValue,\n childIndex\n );\n request = Object.prototype.toString.call(node);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === request\n ? \"object with keys {\" + Object.keys(node).join(\", \") + \"}\"\n : request) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n if (\"string\" === typeof node)\n (childIndex = task.blockedSegment),\n null !== childIndex &&\n (childIndex.lastPushedText = pushTextInstance(\n childIndex.chunks,\n node,\n request.renderState,\n childIndex.lastPushedText\n ));\n else if (\"number\" === typeof node || \"bigint\" === typeof node)\n (childIndex = task.blockedSegment),\n null !== childIndex &&\n (childIndex.lastPushedText = pushTextInstance(\n childIndex.chunks,\n \"\" + node,\n request.renderState,\n childIndex.lastPushedText\n ));\n }\n}\nfunction renderChildrenArray(request, task, children, childIndex) {\n var prevKeyPath = task.keyPath;\n if (\n -1 !== childIndex &&\n ((task.keyPath = [task.keyPath, \"Fragment\", childIndex]),\n null !== task.replay)\n ) {\n for (\n var replay = task.replay, replayNodes = replay.nodes, j = 0;\n j < replayNodes.length;\n j++\n ) {\n var node = replayNodes[j];\n if (node[1] === childIndex) {\n childIndex = node[2];\n node = node[3];\n task.replay = { nodes: childIndex, slots: node, pendingTasks: 1 };\n try {\n renderChildrenArray(request, task, children, -1);\n if (1 === task.replay.pendingTasks && 0 < task.replay.nodes.length)\n throw Error(\n \"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.\"\n );\n task.replay.pendingTasks--;\n } catch (x) {\n if (\n \"object\" === typeof x &&\n null !== x &&\n (x === SuspenseException || \"function\" === typeof x.then)\n )\n throw x;\n task.replay.pendingTasks--;\n children = getThrownInfo(task.componentStack);\n erroredReplay(\n request,\n task.blockedBoundary,\n x,\n children,\n childIndex,\n node\n );\n }\n task.replay = replay;\n replayNodes.splice(j, 1);\n break;\n }\n }\n task.keyPath = prevKeyPath;\n return;\n }\n replay = task.treeContext;\n replayNodes = children.length;\n if (\n null !== task.replay &&\n ((j = task.replay.slots), null !== j && \"object\" === typeof j)\n ) {\n for (childIndex = 0; childIndex < replayNodes; childIndex++) {\n node = children[childIndex];\n task.treeContext = pushTreeContext(replay, replayNodes, childIndex);\n var resumeSegmentID = j[childIndex];\n \"number\" === typeof resumeSegmentID\n ? (resumeNode(request, task, resumeSegmentID, node, childIndex),\n delete j[childIndex])\n : renderNode(request, task, node, childIndex);\n }\n task.treeContext = replay;\n task.keyPath = prevKeyPath;\n return;\n }\n for (j = 0; j < replayNodes; j++)\n (childIndex = children[j]),\n (task.treeContext = pushTreeContext(replay, replayNodes, j)),\n renderNode(request, task, childIndex, j);\n task.treeContext = replay;\n task.keyPath = prevKeyPath;\n}\nfunction trackPostponedBoundary(request, trackedPostpones, boundary) {\n boundary.status = 5;\n boundary.rootSegmentID = request.nextSegmentId++;\n request = boundary.trackedContentKeyPath;\n if (null === request)\n throw Error(\n \"It should not be possible to postpone at the root. This is a bug in React.\"\n );\n var fallbackReplayNode = boundary.trackedFallbackNode,\n children = [],\n boundaryNode = trackedPostpones.workingMap.get(request);\n if (void 0 === boundaryNode)\n return (\n (boundary = [\n request[1],\n request[2],\n children,\n null,\n fallbackReplayNode,\n boundary.rootSegmentID\n ]),\n trackedPostpones.workingMap.set(request, boundary),\n addToReplayParent(boundary, request[0], trackedPostpones),\n boundary\n );\n boundaryNode[4] = fallbackReplayNode;\n boundaryNode[5] = boundary.rootSegmentID;\n return boundaryNode;\n}\nfunction trackPostpone(request, trackedPostpones, task, segment) {\n segment.status = 5;\n var keyPath = task.keyPath,\n boundary = task.blockedBoundary;\n if (null === boundary)\n (segment.id = request.nextSegmentId++),\n (trackedPostpones.rootSlots = segment.id),\n null !== request.completedRootSegment &&\n (request.completedRootSegment.status = 5);\n else {\n if (null !== boundary && 0 === boundary.status) {\n var boundaryNode = trackPostponedBoundary(\n request,\n trackedPostpones,\n boundary\n );\n if (\n boundary.trackedContentKeyPath === keyPath &&\n -1 === task.childIndex\n ) {\n -1 === segment.id &&\n (segment.id = segment.parentFlushed\n ? boundary.rootSegmentID\n : request.nextSegmentId++);\n boundaryNode[3] = segment.id;\n return;\n }\n }\n -1 === segment.id &&\n (segment.id =\n segment.parentFlushed && null !== boundary\n ? boundary.rootSegmentID\n : request.nextSegmentId++);\n if (-1 === task.childIndex)\n null === keyPath\n ? (trackedPostpones.rootSlots = segment.id)\n : ((task = trackedPostpones.workingMap.get(keyPath)),\n void 0 === task\n ? ((task = [keyPath[1], keyPath[2], [], segment.id]),\n addToReplayParent(task, keyPath[0], trackedPostpones))\n : (task[3] = segment.id));\n else {\n if (null === keyPath)\n if (((request = trackedPostpones.rootSlots), null === request))\n request = trackedPostpones.rootSlots = {};\n else {\n if (\"number\" === typeof request)\n throw Error(\n \"It should not be possible to postpone both at the root of an element as well as a slot below. This is a bug in React.\"\n );\n }\n else if (\n ((boundary = trackedPostpones.workingMap),\n (boundaryNode = boundary.get(keyPath)),\n void 0 === boundaryNode)\n )\n (request = {}),\n (boundaryNode = [keyPath[1], keyPath[2], [], request]),\n boundary.set(keyPath, boundaryNode),\n addToReplayParent(boundaryNode, keyPath[0], trackedPostpones);\n else if (((request = boundaryNode[3]), null === request))\n request = boundaryNode[3] = {};\n else if (\"number\" === typeof request)\n throw Error(\n \"It should not be possible to postpone both at the root of an element as well as a slot below. This is a bug in React.\"\n );\n request[task.childIndex] = segment.id;\n }\n }\n}\nfunction untrackBoundary(request, boundary) {\n request = request.trackedPostpones;\n null !== request &&\n ((boundary = boundary.trackedContentKeyPath),\n null !== boundary &&\n ((boundary = request.workingMap.get(boundary)),\n void 0 !== boundary &&\n ((boundary.length = 4), (boundary[2] = []), (boundary[3] = null))));\n}\nfunction spawnNewSuspendedReplayTask(request, task, thenableState) {\n return createReplayTask(\n request,\n thenableState,\n task.replay,\n task.node,\n task.childIndex,\n task.blockedBoundary,\n task.hoistableState,\n task.abortSet,\n task.keyPath,\n task.formatContext,\n task.context,\n task.treeContext,\n task.row,\n task.componentStack\n );\n}\nfunction spawnNewSuspendedRenderTask(request, task, thenableState) {\n var segment = task.blockedSegment,\n newSegment = createPendingSegment(\n request,\n segment.chunks.length,\n null,\n task.formatContext,\n segment.lastPushedText,\n !0\n );\n segment.children.push(newSegment);\n segment.lastPushedText = !1;\n return createRenderTask(\n request,\n thenableState,\n task.node,\n task.childIndex,\n task.blockedBoundary,\n newSegment,\n task.blockedPreamble,\n task.hoistableState,\n task.abortSet,\n task.keyPath,\n task.formatContext,\n task.context,\n task.treeContext,\n task.row,\n task.componentStack\n );\n}\nfunction renderNode(request, task, node, childIndex) {\n var previousFormatContext = task.formatContext,\n previousContext = task.context,\n previousKeyPath = task.keyPath,\n previousTreeContext = task.treeContext,\n previousComponentStack = task.componentStack,\n segment = task.blockedSegment;\n if (null === segment) {\n segment = task.replay;\n try {\n return renderNodeDestructive(request, task, node, childIndex);\n } catch (thrownValue) {\n if (\n (resetHooksState(),\n (node =\n thrownValue === SuspenseException\n ? getSuspendedThenable()\n : thrownValue),\n 12 !== request.status && \"object\" === typeof node && null !== node)\n ) {\n if (\"function\" === typeof node.then) {\n childIndex =\n thrownValue === SuspenseException\n ? getThenableStateAfterSuspending()\n : null;\n request = spawnNewSuspendedReplayTask(request, task, childIndex).ping;\n node.then(request, request);\n task.formatContext = previousFormatContext;\n task.context = previousContext;\n task.keyPath = previousKeyPath;\n task.treeContext = previousTreeContext;\n task.componentStack = previousComponentStack;\n task.replay = segment;\n switchContext(previousContext);\n return;\n }\n if (\"Maximum call stack size exceeded\" === node.message) {\n node =\n thrownValue === SuspenseException\n ? getThenableStateAfterSuspending()\n : null;\n node = spawnNewSuspendedReplayTask(request, task, node);\n request.pingedTasks.push(node);\n task.formatContext = previousFormatContext;\n task.context = previousContext;\n task.keyPath = previousKeyPath;\n task.treeContext = previousTreeContext;\n task.componentStack = previousComponentStack;\n task.replay = segment;\n switchContext(previousContext);\n return;\n }\n }\n }\n } else {\n var childrenLength = segment.children.length,\n chunkLength = segment.chunks.length;\n try {\n return renderNodeDestructive(request, task, node, childIndex);\n } catch (thrownValue$70) {\n if (\n (resetHooksState(),\n (segment.children.length = childrenLength),\n (segment.chunks.length = chunkLength),\n (node =\n thrownValue$70 === SuspenseException\n ? getSuspendedThenable()\n : thrownValue$70),\n 12 !== request.status && \"object\" === typeof node && null !== node)\n ) {\n if (\"function\" === typeof node.then) {\n segment = node;\n node =\n thrownValue$70 === SuspenseException\n ? getThenableStateAfterSuspending()\n : null;\n request = spawnNewSuspendedRenderTask(request, task, node).ping;\n segment.then(request, request);\n task.formatContext = previousFormatContext;\n task.context = previousContext;\n task.keyPath = previousKeyPath;\n task.treeContext = previousTreeContext;\n task.componentStack = previousComponentStack;\n switchContext(previousContext);\n return;\n }\n if (\n node.$$typeof === REACT_POSTPONE_TYPE &&\n null !== request.trackedPostpones &&\n null !== task.blockedBoundary\n ) {\n segment = request.trackedPostpones;\n childIndex = getThrownInfo(task.componentStack);\n logPostpone(request, node.message, childIndex);\n node = task.blockedSegment;\n childIndex = createPendingSegment(\n request,\n node.chunks.length,\n null,\n task.formatContext,\n node.lastPushedText,\n !0\n );\n node.children.push(childIndex);\n node.lastPushedText = !1;\n trackPostpone(request, segment, task, childIndex);\n task.formatContext = previousFormatContext;\n task.context = previousContext;\n task.keyPath = previousKeyPath;\n task.treeContext = previousTreeContext;\n task.componentStack = previousComponentStack;\n switchContext(previousContext);\n return;\n }\n if (\"Maximum call stack size exceeded\" === node.message) {\n segment =\n thrownValue$70 === SuspenseException\n ? getThenableStateAfterSuspending()\n : null;\n segment = spawnNewSuspendedRenderTask(request, task, segment);\n request.pingedTasks.push(segment);\n task.formatContext = previousFormatContext;\n task.context = previousContext;\n task.keyPath = previousKeyPath;\n task.treeContext = previousTreeContext;\n task.componentStack = previousComponentStack;\n switchContext(previousContext);\n return;\n }\n }\n }\n }\n task.formatContext = previousFormatContext;\n task.context = previousContext;\n task.keyPath = previousKeyPath;\n task.treeContext = previousTreeContext;\n switchContext(previousContext);\n throw node;\n}\nfunction erroredReplay(\n request,\n boundary,\n error,\n errorInfo,\n replayNodes,\n resumeSlots\n) {\n \"object\" === typeof error &&\n null !== error &&\n error.$$typeof === REACT_POSTPONE_TYPE\n ? (logPostpone(request, error.message, errorInfo), (errorInfo = \"POSTPONE\"))\n : (errorInfo = logRecoverableError(request, error, errorInfo));\n abortRemainingReplayNodes(\n request,\n boundary,\n replayNodes,\n resumeSlots,\n error,\n errorInfo\n );\n}\nfunction abortTaskSoft(task) {\n var boundary = task.blockedBoundary,\n segment = task.blockedSegment;\n null !== segment &&\n ((segment.status = 3), finishedTask(this, boundary, task.row, segment));\n}\nfunction abortRemainingReplayNodes(\n request$jscomp$0,\n boundary,\n nodes,\n slots,\n error,\n errorDigest$jscomp$0\n) {\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n if (4 === node.length)\n abortRemainingReplayNodes(\n request$jscomp$0,\n boundary,\n node[2],\n node[3],\n error,\n errorDigest$jscomp$0\n );\n else {\n node = node[5];\n var request = request$jscomp$0,\n errorDigest = errorDigest$jscomp$0,\n resumedBoundary = createSuspenseBoundary(\n request,\n null,\n new Set(),\n null,\n null\n );\n resumedBoundary.parentFlushed = !0;\n resumedBoundary.rootSegmentID = node;\n resumedBoundary.status = 4;\n resumedBoundary.errorDigest = errorDigest;\n resumedBoundary.parentFlushed &&\n request.clientRenderedBoundaries.push(resumedBoundary);\n }\n }\n nodes.length = 0;\n if (null !== slots) {\n if (null === boundary)\n throw Error(\n \"We should not have any resumable nodes in the shell. This is a bug in React.\"\n );\n 4 !== boundary.status &&\n ((boundary.status = 4),\n (boundary.errorDigest = errorDigest$jscomp$0),\n boundary.parentFlushed &&\n request$jscomp$0.clientRenderedBoundaries.push(boundary));\n if (\"object\" === typeof slots) for (var index in slots) delete slots[index];\n }\n}\nfunction abortTask(task, request, error) {\n var boundary = task.blockedBoundary,\n segment = task.blockedSegment;\n if (null !== segment) {\n if (6 === segment.status) return;\n segment.status = 3;\n }\n var errorInfo = getThrownInfo(task.componentStack);\n if (null === boundary) {\n if (13 !== request.status && 14 !== request.status) {\n boundary = task.replay;\n if (null === boundary) {\n \"object\" === typeof error &&\n null !== error &&\n error.$$typeof === REACT_POSTPONE_TYPE\n ? ((boundary = request.trackedPostpones),\n null !== boundary && null !== segment\n ? (logPostpone(request, error.message, errorInfo),\n trackPostpone(request, boundary, task, segment),\n finishedTask(request, null, task.row, segment))\n : ((task = Error(\n \"The render was aborted with postpone when the shell is incomplete. Reason: \" +\n error.message\n )),\n logRecoverableError(request, task, errorInfo),\n fatalError(request, task)))\n : null !== request.trackedPostpones && null !== segment\n ? ((boundary = request.trackedPostpones),\n logRecoverableError(request, error, errorInfo),\n trackPostpone(request, boundary, task, segment),\n finishedTask(request, null, task.row, segment))\n : (logRecoverableError(request, error, errorInfo),\n fatalError(request, error));\n return;\n }\n boundary.pendingTasks--;\n 0 === boundary.pendingTasks &&\n 0 < boundary.nodes.length &&\n (\"object\" === typeof error &&\n null !== error &&\n error.$$typeof === REACT_POSTPONE_TYPE\n ? (logPostpone(request, error.message, errorInfo),\n (errorInfo = \"POSTPONE\"))\n : (errorInfo = logRecoverableError(request, error, errorInfo)),\n abortRemainingReplayNodes(\n request,\n null,\n boundary.nodes,\n boundary.slots,\n error,\n errorInfo\n ));\n request.pendingRootTasks--;\n 0 === request.pendingRootTasks && completeShell(request);\n }\n } else {\n var trackedPostpones$73 = request.trackedPostpones;\n if (4 !== boundary.status) {\n if (null !== trackedPostpones$73 && null !== segment)\n return (\n \"object\" === typeof error &&\n null !== error &&\n error.$$typeof === REACT_POSTPONE_TYPE\n ? logPostpone(request, error.message, errorInfo)\n : logRecoverableError(request, error, errorInfo),\n trackPostpone(request, trackedPostpones$73, task, segment),\n boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {\n return abortTask(fallbackTask, request, error);\n }),\n boundary.fallbackAbortableTasks.clear(),\n finishedTask(request, boundary, task.row, segment)\n );\n boundary.status = 4;\n if (\n \"object\" === typeof error &&\n null !== error &&\n error.$$typeof === REACT_POSTPONE_TYPE\n ) {\n logPostpone(request, error.message, errorInfo);\n if (null !== request.trackedPostpones && null !== segment) {\n trackPostpone(request, request.trackedPostpones, task, segment);\n finishedTask(request, task.blockedBoundary, task.row, segment);\n boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {\n return abortTask(fallbackTask, request, error);\n });\n boundary.fallbackAbortableTasks.clear();\n return;\n }\n errorInfo = \"POSTPONE\";\n } else errorInfo = logRecoverableError(request, error, errorInfo);\n boundary.status = 4;\n boundary.errorDigest = errorInfo;\n untrackBoundary(request, boundary);\n boundary.parentFlushed && request.clientRenderedBoundaries.push(boundary);\n }\n boundary.pendingTasks--;\n errorInfo = boundary.row;\n null !== errorInfo &&\n 0 === --errorInfo.pendingTasks &&\n finishSuspenseListRow(request, errorInfo);\n boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {\n return abortTask(fallbackTask, request, error);\n });\n boundary.fallbackAbortableTasks.clear();\n }\n task = task.row;\n null !== task &&\n 0 === --task.pendingTasks &&\n finishSuspenseListRow(request, task);\n request.allPendingTasks--;\n 0 === request.allPendingTasks && completeAll(request);\n}\nfunction safelyEmitEarlyPreloads(request, shellComplete) {\n try {\n var renderState = request.renderState,\n onHeaders = renderState.onHeaders;\n if (onHeaders) {\n var headers = renderState.headers;\n if (headers) {\n renderState.headers = null;\n var linkHeader = headers.preconnects;\n headers.fontPreloads &&\n (linkHeader && (linkHeader += \", \"),\n (linkHeader += headers.fontPreloads));\n headers.highImagePreloads &&\n (linkHeader && (linkHeader += \", \"),\n (linkHeader += headers.highImagePreloads));\n if (!shellComplete) {\n var queueIter = renderState.styles.values(),\n queueStep = queueIter.next();\n b: for (\n ;\n 0 < headers.remainingCapacity && !queueStep.done;\n queueStep = queueIter.next()\n )\n for (\n var sheetIter = queueStep.value.sheets.values(),\n sheetStep = sheetIter.next();\n 0 < headers.remainingCapacity && !sheetStep.done;\n sheetStep = sheetIter.next()\n ) {\n var sheet = sheetStep.value,\n props = sheet.props,\n key = props.href,\n props$jscomp$0 = sheet.props,\n header = getPreloadAsHeader(props$jscomp$0.href, \"style\", {\n crossOrigin: props$jscomp$0.crossOrigin,\n integrity: props$jscomp$0.integrity,\n nonce: props$jscomp$0.nonce,\n type: props$jscomp$0.type,\n fetchPriority: props$jscomp$0.fetchPriority,\n referrerPolicy: props$jscomp$0.referrerPolicy,\n media: props$jscomp$0.media\n });\n if (0 <= (headers.remainingCapacity -= header.length + 2))\n (renderState.resets.style[key] = PRELOAD_NO_CREDS),\n linkHeader && (linkHeader += \", \"),\n (linkHeader += header),\n (renderState.resets.style[key] =\n \"string\" === typeof props.crossOrigin ||\n \"string\" === typeof props.integrity\n ? [props.crossOrigin, props.integrity]\n : PRELOAD_NO_CREDS);\n else break b;\n }\n }\n linkHeader ? onHeaders({ Link: linkHeader }) : onHeaders({});\n }\n }\n } catch (error) {\n logRecoverableError(request, error, {});\n }\n}\nfunction completeShell(request) {\n null === request.trackedPostpones && safelyEmitEarlyPreloads(request, !0);\n null === request.trackedPostpones && preparePreamble(request);\n request.onShellError = noop;\n request = request.onShellReady;\n request();\n}\nfunction completeAll(request) {\n safelyEmitEarlyPreloads(\n request,\n null === request.trackedPostpones\n ? !0\n : null === request.completedRootSegment ||\n 5 !== request.completedRootSegment.status\n );\n preparePreamble(request);\n request = request.onAllReady;\n request();\n}\nfunction queueCompletedSegment(boundary, segment) {\n if (\n 0 === segment.chunks.length &&\n 1 === segment.children.length &&\n null === segment.children[0].boundary &&\n -1 === segment.children[0].id\n ) {\n var childSegment = segment.children[0];\n childSegment.id = segment.id;\n childSegment.parentFlushed = !0;\n (1 !== childSegment.status &&\n 3 !== childSegment.status &&\n 4 !== childSegment.status) ||\n queueCompletedSegment(boundary, childSegment);\n } else boundary.completedSegments.push(segment);\n}\nfunction finishedSegment(request, boundary, segment) {\n if (null !== byteLengthOfChunk) {\n segment = segment.chunks;\n for (var segmentByteSize = 0, i = 0; i < segment.length; i++)\n segmentByteSize += byteLengthOfChunk(segment[i]);\n null === boundary\n ? (request.byteSize += segmentByteSize)\n : (boundary.byteSize += segmentByteSize);\n }\n}\nfunction finishedTask(request, boundary, row, segment) {\n null !== row &&\n (0 === --row.pendingTasks\n ? finishSuspenseListRow(request, row)\n : row.together && tryToResolveTogetherRow(request, row));\n request.allPendingTasks--;\n if (null === boundary) {\n if (null !== segment && segment.parentFlushed) {\n if (null !== request.completedRootSegment)\n throw Error(\n \"There can only be one root segment. This is a bug in React.\"\n );\n request.completedRootSegment = segment;\n }\n request.pendingRootTasks--;\n 0 === request.pendingRootTasks && completeShell(request);\n } else if ((boundary.pendingTasks--, 4 !== boundary.status))\n if (0 === boundary.pendingTasks)\n if (\n (0 === boundary.status && (boundary.status = 1),\n null !== segment &&\n segment.parentFlushed &&\n (1 === segment.status || 3 === segment.status) &&\n queueCompletedSegment(boundary, segment),\n boundary.parentFlushed && request.completedBoundaries.push(boundary),\n 1 === boundary.status)\n )\n (row = boundary.row),\n null !== row &&\n hoistHoistables(row.hoistables, boundary.contentState),\n isEligibleForOutlining(request, boundary) ||\n (boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request),\n boundary.fallbackAbortableTasks.clear(),\n null !== row &&\n 0 === --row.pendingTasks &&\n finishSuspenseListRow(request, row)),\n 0 === request.pendingRootTasks &&\n null === request.trackedPostpones &&\n null !== boundary.contentPreamble &&\n preparePreamble(request);\n else {\n if (\n 5 === boundary.status &&\n ((boundary = boundary.row), null !== boundary)\n ) {\n if (null !== request.trackedPostpones) {\n row = request.trackedPostpones;\n var postponedRow = boundary.next;\n if (\n null !== postponedRow &&\n ((segment = postponedRow.boundaries), null !== segment)\n )\n for (\n postponedRow.boundaries = null, postponedRow = 0;\n postponedRow < segment.length;\n postponedRow++\n ) {\n var postponedBoundary = segment[postponedRow];\n trackPostponedBoundary(request, row, postponedBoundary);\n finishedTask(request, postponedBoundary, null, null);\n }\n }\n 0 === --boundary.pendingTasks &&\n finishSuspenseListRow(request, boundary);\n }\n }\n else\n null === segment ||\n !segment.parentFlushed ||\n (1 !== segment.status && 3 !== segment.status) ||\n (queueCompletedSegment(boundary, segment),\n 1 === boundary.completedSegments.length &&\n boundary.parentFlushed &&\n request.partialBoundaries.push(boundary)),\n (boundary = boundary.row),\n null !== boundary &&\n boundary.together &&\n tryToResolveTogetherRow(request, boundary);\n 0 === request.allPendingTasks && completeAll(request);\n}\nfunction performWork(request$jscomp$1) {\n if (14 !== request$jscomp$1.status && 13 !== request$jscomp$1.status) {\n var prevContext = currentActiveSnapshot,\n prevDispatcher = ReactSharedInternals.H;\n ReactSharedInternals.H = HooksDispatcher;\n var prevAsyncDispatcher = ReactSharedInternals.A;\n ReactSharedInternals.A = DefaultAsyncDispatcher;\n var prevRequest = currentRequest;\n currentRequest = request$jscomp$1;\n var prevResumableState = currentResumableState;\n currentResumableState = request$jscomp$1.resumableState;\n try {\n var pingedTasks = request$jscomp$1.pingedTasks,\n i;\n for (i = 0; i < pingedTasks.length; i++) {\n var task = pingedTasks[i],\n request = request$jscomp$1,\n segment = task.blockedSegment;\n if (null === segment) {\n var request$jscomp$0 = request;\n if (0 !== task.replay.pendingTasks) {\n switchContext(task.context);\n try {\n \"number\" === typeof task.replay.slots\n ? resumeNode(\n request$jscomp$0,\n task,\n task.replay.slots,\n task.node,\n task.childIndex\n )\n : retryNode(request$jscomp$0, task);\n if (\n 1 === task.replay.pendingTasks &&\n 0 < task.replay.nodes.length\n )\n throw Error(\n \"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.\"\n );\n task.replay.pendingTasks--;\n task.abortSet.delete(task);\n finishedTask(\n request$jscomp$0,\n task.blockedBoundary,\n task.row,\n null\n );\n } catch (thrownValue) {\n resetHooksState();\n var x =\n thrownValue === SuspenseException\n ? getSuspendedThenable()\n : thrownValue;\n if (\n \"object\" === typeof x &&\n null !== x &&\n \"function\" === typeof x.then\n ) {\n var ping = task.ping;\n x.then(ping, ping);\n task.thenableState =\n thrownValue === SuspenseException\n ? getThenableStateAfterSuspending()\n : null;\n } else {\n task.replay.pendingTasks--;\n task.abortSet.delete(task);\n var errorInfo = getThrownInfo(task.componentStack);\n erroredReplay(\n request$jscomp$0,\n task.blockedBoundary,\n 12 === request$jscomp$0.status\n ? request$jscomp$0.fatalError\n : x,\n errorInfo,\n task.replay.nodes,\n task.replay.slots\n );\n request$jscomp$0.pendingRootTasks--;\n 0 === request$jscomp$0.pendingRootTasks &&\n completeShell(request$jscomp$0);\n request$jscomp$0.allPendingTasks--;\n 0 === request$jscomp$0.allPendingTasks &&\n completeAll(request$jscomp$0);\n }\n } finally {\n }\n }\n } else\n a: {\n request$jscomp$0 = void 0;\n var segment$jscomp$0 = segment;\n if (0 === segment$jscomp$0.status) {\n segment$jscomp$0.status = 6;\n switchContext(task.context);\n var childrenLength = segment$jscomp$0.children.length,\n chunkLength = segment$jscomp$0.chunks.length;\n try {\n retryNode(request, task),\n segment$jscomp$0.lastPushedText &&\n segment$jscomp$0.textEmbedded &&\n segment$jscomp$0.chunks.push(textSeparator),\n task.abortSet.delete(task),\n (segment$jscomp$0.status = 1),\n finishedSegment(\n request,\n task.blockedBoundary,\n segment$jscomp$0\n ),\n finishedTask(\n request,\n task.blockedBoundary,\n task.row,\n segment$jscomp$0\n );\n } catch (thrownValue) {\n resetHooksState();\n segment$jscomp$0.children.length = childrenLength;\n segment$jscomp$0.chunks.length = chunkLength;\n var x$jscomp$0 =\n thrownValue === SuspenseException\n ? getSuspendedThenable()\n : 12 === request.status\n ? request.fatalError\n : thrownValue;\n if (\n 12 === request.status &&\n null !== request.trackedPostpones\n ) {\n var trackedPostpones = request.trackedPostpones,\n thrownInfo = getThrownInfo(task.componentStack);\n task.abortSet.delete(task);\n \"object\" === typeof x$jscomp$0 &&\n null !== x$jscomp$0 &&\n x$jscomp$0.$$typeof === REACT_POSTPONE_TYPE\n ? logPostpone(request, x$jscomp$0.message, thrownInfo)\n : logRecoverableError(request, x$jscomp$0, thrownInfo);\n trackPostpone(\n request,\n trackedPostpones,\n task,\n segment$jscomp$0\n );\n finishedTask(\n request,\n task.blockedBoundary,\n task.row,\n segment$jscomp$0\n );\n } else {\n if (\"object\" === typeof x$jscomp$0 && null !== x$jscomp$0) {\n if (\"function\" === typeof x$jscomp$0.then) {\n segment$jscomp$0.status = 0;\n task.thenableState =\n thrownValue === SuspenseException\n ? getThenableStateAfterSuspending()\n : null;\n var ping$jscomp$0 = task.ping;\n x$jscomp$0.then(ping$jscomp$0, ping$jscomp$0);\n break a;\n }\n if (\n null !== request.trackedPostpones &&\n x$jscomp$0.$$typeof === REACT_POSTPONE_TYPE\n ) {\n var trackedPostpones$79 = request.trackedPostpones;\n task.abortSet.delete(task);\n var postponeInfo = getThrownInfo(task.componentStack);\n logPostpone(request, x$jscomp$0.message, postponeInfo);\n trackPostpone(\n request,\n trackedPostpones$79,\n task,\n segment$jscomp$0\n );\n finishedTask(\n request,\n task.blockedBoundary,\n task.row,\n segment$jscomp$0\n );\n break a;\n }\n }\n var errorInfo$jscomp$0 = getThrownInfo(task.componentStack);\n task.abortSet.delete(task);\n segment$jscomp$0.status = 4;\n var boundary = task.blockedBoundary,\n row = task.row;\n null !== row &&\n 0 === --row.pendingTasks &&\n finishSuspenseListRow(request, row);\n request.allPendingTasks--;\n \"object\" === typeof x$jscomp$0 &&\n null !== x$jscomp$0 &&\n x$jscomp$0.$$typeof === REACT_POSTPONE_TYPE\n ? (logPostpone(\n request,\n x$jscomp$0.message,\n errorInfo$jscomp$0\n ),\n (request$jscomp$0 = \"POSTPONE\"))\n : (request$jscomp$0 = logRecoverableError(\n request,\n x$jscomp$0,\n errorInfo$jscomp$0\n ));\n if (null === boundary) fatalError(request, x$jscomp$0);\n else if ((boundary.pendingTasks--, 4 !== boundary.status)) {\n boundary.status = 4;\n boundary.errorDigest = request$jscomp$0;\n untrackBoundary(request, boundary);\n var boundaryRow = boundary.row;\n null !== boundaryRow &&\n 0 === --boundaryRow.pendingTasks &&\n finishSuspenseListRow(request, boundaryRow);\n boundary.parentFlushed &&\n request.clientRenderedBoundaries.push(boundary);\n 0 === request.pendingRootTasks &&\n null === request.trackedPostpones &&\n null !== boundary.contentPreamble &&\n preparePreamble(request);\n }\n 0 === request.allPendingTasks && completeAll(request);\n }\n } finally {\n }\n }\n }\n }\n pingedTasks.splice(0, i);\n null !== request$jscomp$1.destination &&\n flushCompletedQueues(request$jscomp$1, request$jscomp$1.destination);\n } catch (error) {\n logRecoverableError(request$jscomp$1, error, {}),\n fatalError(request$jscomp$1, error);\n } finally {\n (currentResumableState = prevResumableState),\n (ReactSharedInternals.H = prevDispatcher),\n (ReactSharedInternals.A = prevAsyncDispatcher),\n prevDispatcher === HooksDispatcher && switchContext(prevContext),\n (currentRequest = prevRequest);\n }\n }\n}\nfunction preparePreambleFromSubtree(\n request,\n segment,\n collectedPreambleSegments\n) {\n segment.preambleChildren.length &&\n collectedPreambleSegments.push(segment.preambleChildren);\n for (var pendingPreambles = !1, i = 0; i < segment.children.length; i++)\n pendingPreambles =\n preparePreambleFromSegment(\n request,\n segment.children[i],\n collectedPreambleSegments\n ) || pendingPreambles;\n return pendingPreambles;\n}\nfunction preparePreambleFromSegment(\n request,\n segment,\n collectedPreambleSegments\n) {\n var boundary = segment.boundary;\n if (null === boundary)\n return preparePreambleFromSubtree(\n request,\n segment,\n collectedPreambleSegments\n );\n var preamble = boundary.contentPreamble,\n fallbackPreamble = boundary.fallbackPreamble;\n if (null === preamble || null === fallbackPreamble) return !1;\n switch (boundary.status) {\n case 1:\n hoistPreambleState(request.renderState, preamble);\n request.byteSize += boundary.byteSize;\n segment = boundary.completedSegments[0];\n if (!segment)\n throw Error(\n \"A previously unvisited boundary must have exactly one root segment. This is a bug in React.\"\n );\n return preparePreambleFromSubtree(\n request,\n segment,\n collectedPreambleSegments\n );\n case 5:\n if (null !== request.trackedPostpones) return !0;\n case 4:\n if (1 === segment.status)\n return (\n hoistPreambleState(request.renderState, fallbackPreamble),\n preparePreambleFromSubtree(\n request,\n segment,\n collectedPreambleSegments\n )\n );\n default:\n return !0;\n }\n}\nfunction preparePreamble(request) {\n if (\n request.completedRootSegment &&\n null === request.completedPreambleSegments\n ) {\n var collectedPreambleSegments = [],\n originalRequestByteSize = request.byteSize,\n hasPendingPreambles = preparePreambleFromSegment(\n request,\n request.completedRootSegment,\n collectedPreambleSegments\n ),\n preamble = request.renderState.preamble;\n !1 === hasPendingPreambles || (preamble.headChunks && preamble.bodyChunks)\n ? (request.completedPreambleSegments = collectedPreambleSegments)\n : (request.byteSize = originalRequestByteSize);\n }\n}\nfunction flushSubtree(request, destination, segment, hoistableState) {\n segment.parentFlushed = !0;\n switch (segment.status) {\n case 0:\n segment.id = request.nextSegmentId++;\n case 5:\n return (\n (hoistableState = segment.id),\n (segment.lastPushedText = !1),\n (segment.textEmbedded = !1),\n (request = request.renderState),\n writeChunk(destination, placeholder1),\n writeChunk(destination, request.placeholderPrefix),\n (request = hoistableState.toString(16)),\n writeChunk(destination, request),\n writeChunkAndReturn(destination, placeholder2)\n );\n case 1:\n segment.status = 2;\n var r = !0,\n chunks = segment.chunks,\n chunkIdx = 0;\n segment = segment.children;\n for (var childIdx = 0; childIdx < segment.length; childIdx++) {\n for (r = segment[childIdx]; chunkIdx < r.index; chunkIdx++)\n writeChunk(destination, chunks[chunkIdx]);\n r = flushSegment(request, destination, r, hoistableState);\n }\n for (; chunkIdx < chunks.length - 1; chunkIdx++)\n writeChunk(destination, chunks[chunkIdx]);\n chunkIdx < chunks.length &&\n (r = writeChunkAndReturn(destination, chunks[chunkIdx]));\n return r;\n case 3:\n return !0;\n default:\n throw Error(\n \"Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.\"\n );\n }\n}\nvar flushedByteSize = 0;\nfunction flushSegment(request, destination, segment, hoistableState) {\n var boundary = segment.boundary;\n if (null === boundary)\n return flushSubtree(request, destination, segment, hoistableState);\n segment.boundary = null;\n boundary.parentFlushed = !0;\n if (4 === boundary.status) {\n var row = boundary.row;\n null !== row &&\n 0 === --row.pendingTasks &&\n finishSuspenseListRow(request, row);\n boundary = boundary.errorDigest;\n writeChunkAndReturn(destination, startClientRenderedSuspenseBoundary);\n writeChunk(destination, clientRenderedSuspenseBoundaryError1);\n boundary &&\n (writeChunk(destination, clientRenderedSuspenseBoundaryError1A),\n writeChunk(destination, escapeTextForBrowser(boundary)),\n writeChunk(\n destination,\n clientRenderedSuspenseBoundaryErrorAttrInterstitial\n ));\n writeChunkAndReturn(destination, clientRenderedSuspenseBoundaryError2);\n flushSubtree(request, destination, segment, hoistableState);\n } else if (1 !== boundary.status)\n 0 === boundary.status && (boundary.rootSegmentID = request.nextSegmentId++),\n 0 < boundary.completedSegments.length &&\n request.partialBoundaries.push(boundary),\n writeStartPendingSuspenseBoundary(\n destination,\n request.renderState,\n boundary.rootSegmentID\n ),\n hoistableState && hoistHoistables(hoistableState, boundary.fallbackState),\n flushSubtree(request, destination, segment, hoistableState);\n else if (\n !flushingPartialBoundaries &&\n isEligibleForOutlining(request, boundary) &&\n (flushedByteSize + boundary.byteSize > request.progressiveChunkSize ||\n hasSuspenseyContent(boundary.contentState))\n )\n (boundary.rootSegmentID = request.nextSegmentId++),\n request.completedBoundaries.push(boundary),\n writeStartPendingSuspenseBoundary(\n destination,\n request.renderState,\n boundary.rootSegmentID\n ),\n flushSubtree(request, destination, segment, hoistableState);\n else {\n flushedByteSize += boundary.byteSize;\n hoistableState && hoistHoistables(hoistableState, boundary.contentState);\n segment = boundary.row;\n null !== segment &&\n isEligibleForOutlining(request, boundary) &&\n 0 === --segment.pendingTasks &&\n finishSuspenseListRow(request, segment);\n writeChunkAndReturn(destination, startCompletedSuspenseBoundary);\n segment = boundary.completedSegments;\n if (1 !== segment.length)\n throw Error(\n \"A previously unvisited boundary must have exactly one root segment. This is a bug in React.\"\n );\n flushSegment(request, destination, segment[0], hoistableState);\n }\n return writeChunkAndReturn(destination, endSuspenseBoundary);\n}\nfunction flushSegmentContainer(request, destination, segment, hoistableState) {\n writeStartSegment(\n destination,\n request.renderState,\n segment.parentFormatContext,\n segment.id\n );\n flushSegment(request, destination, segment, hoistableState);\n return writeEndSegment(destination, segment.parentFormatContext);\n}\nfunction flushCompletedBoundary(request, destination, boundary) {\n flushedByteSize = boundary.byteSize;\n for (\n var completedSegments = boundary.completedSegments, i = 0;\n i < completedSegments.length;\n i++\n )\n flushPartiallyCompletedSegment(\n request,\n destination,\n boundary,\n completedSegments[i]\n );\n completedSegments.length = 0;\n completedSegments = boundary.row;\n null !== completedSegments &&\n isEligibleForOutlining(request, boundary) &&\n 0 === --completedSegments.pendingTasks &&\n finishSuspenseListRow(request, completedSegments);\n writeHoistablesForBoundary(\n destination,\n boundary.contentState,\n request.renderState\n );\n completedSegments = request.resumableState;\n request = request.renderState;\n i = boundary.rootSegmentID;\n boundary = boundary.contentState;\n var requiresStyleInsertion = request.stylesToHoist,\n requiresViewTransitions = 0 !== (completedSegments.instructions & 128);\n request.stylesToHoist = !1;\n var scriptFormat = 0 === completedSegments.streamingFormat;\n scriptFormat\n ? (writeChunk(destination, request.startInlineScript),\n writeChunk(destination, endOfStartTag),\n requiresStyleInsertion\n ? (0 === (completedSegments.instructions & 4) &&\n ((completedSegments.instructions |= 4),\n writeChunk(destination, clientRenderScriptFunctionOnly)),\n 0 === (completedSegments.instructions & 2) &&\n ((completedSegments.instructions |= 2),\n writeChunk(destination, completeBoundaryScriptFunctionOnly)),\n requiresViewTransitions &&\n 0 === (completedSegments.instructions & 256) &&\n ((completedSegments.instructions |= 256),\n writeChunk(\n destination,\n '$RV=function(A,g){function k(a,b){var e=a.getAttribute(b);e&&(b=a.style,l.push(a,b.viewTransitionName,b.viewTransitionClass),\"auto\"!==e&&(b.viewTransitionClass=e),(a=a.getAttribute(\"vt-name\"))||(a=\"_T_\"+K++ +\"_\"),b.viewTransitionName=a,B=!0)}var B=!1,K=0,l=[];try{var f=document.__reactViewTransition;if(f){f.finished.finally($RV.bind(null,g));return}var m=new Map;for(f=1;f<g.length;f+=2)for(var h=g[f].querySelectorAll(\"[vt-share]\"),d=0;d<h.length;d++){var c=h[d];m.set(c.getAttribute(\"vt-name\"),c)}var u=[];for(h=0;h<g.length;h+=2){var C=g[h],x=C.parentNode;if(x){var v=x.getBoundingClientRect();if(v.left||v.top||v.width||v.height){c=C;for(f=0;c;){if(8===c.nodeType){var r=c.data;if(\"/$\"===r)if(0===f)break;else f--;else\"$\"!==r&&\"$?\"!==r&&\"$~\"!==r&&\"$!\"!==r||f++}else if(1===c.nodeType){d=c;var D=d.getAttribute(\"vt-name\"),y=m.get(D);k(d,y?\"vt-share\":\"vt-exit\");y&&(k(y,\"vt-share\"),m.set(D,null));var E=d.querySelectorAll(\"[vt-share]\");for(d=0;d<E.length;d++){var F=E[d],G=F.getAttribute(\"vt-name\"),\\nH=m.get(G);H&&(k(F,\"vt-share\"),k(H,\"vt-share\"),m.set(G,null))}}c=c.nextSibling}for(var I=g[h+1],t=I.firstElementChild;t;)null!==m.get(t.getAttribute(\"vt-name\"))&&k(t,\"vt-enter\"),t=t.nextElementSibling;c=x;do for(var n=c.firstElementChild;n;){var J=n.getAttribute(\"vt-update\");J&&\"none\"!==J&&!l.includes(n)&&k(n,\"vt-update\");n=n.nextElementSibling}while((c=c.parentNode)&&1===c.nodeType&&\"none\"!==c.getAttribute(\"vt-update\"));u.push.apply(u,I.querySelectorAll(\\'img[src]:not([loading=\"lazy\"])\\'))}}}if(B){var z=\\ndocument.__reactViewTransition=document.startViewTransition({update:function(){A(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],b={},e=0;e<u.length;b={g:b.g},e++)if(b.g=u[e],!b.g.complete){var p=b.g.getBoundingClientRect();0<p.bottom&&0<p.right&&p.top<window.innerHeight&&p.left<window.innerWidth&&(p=new Promise(function(w){return function(q){w.g.addEventListener(\"load\",q);w.g.addEventListener(\"error\",q)}}(b)),a.push(p))}return Promise.race([Promise.all(a),new Promise(function(w){var q=\\nperformance.now();setTimeout(w,2300>q&&2E3<q?2300-q:500)})])},types:[]});z.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var b=l[a],e=b.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];\"\"===b.getAttribute(\"style\")&&b.removeAttribute(\"style\")}});z.finished.finally(function(){document.__reactViewTransition===z&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}A(g)}.bind(null,$RV);'\n )),\n 0 === (completedSegments.instructions & 8)\n ? ((completedSegments.instructions |= 8),\n writeChunk(\n destination,\n completeBoundaryWithStylesScript1FullPartial\n ))\n : writeChunk(destination, completeBoundaryWithStylesScript1Partial))\n : (0 === (completedSegments.instructions & 2) &&\n ((completedSegments.instructions |= 2),\n writeChunk(destination, completeBoundaryScriptFunctionOnly)),\n requiresViewTransitions &&\n 0 === (completedSegments.instructions & 256) &&\n ((completedSegments.instructions |= 256),\n writeChunk(\n destination,\n '$RV=function(A,g){function k(a,b){var e=a.getAttribute(b);e&&(b=a.style,l.push(a,b.viewTransitionName,b.viewTransitionClass),\"auto\"!==e&&(b.viewTransitionClass=e),(a=a.getAttribute(\"vt-name\"))||(a=\"_T_\"+K++ +\"_\"),b.viewTransitionName=a,B=!0)}var B=!1,K=0,l=[];try{var f=document.__reactViewTransition;if(f){f.finished.finally($RV.bind(null,g));return}var m=new Map;for(f=1;f<g.length;f+=2)for(var h=g[f].querySelectorAll(\"[vt-share]\"),d=0;d<h.length;d++){var c=h[d];m.set(c.getAttribute(\"vt-name\"),c)}var u=[];for(h=0;h<g.length;h+=2){var C=g[h],x=C.parentNode;if(x){var v=x.getBoundingClientRect();if(v.left||v.top||v.width||v.height){c=C;for(f=0;c;){if(8===c.nodeType){var r=c.data;if(\"/$\"===r)if(0===f)break;else f--;else\"$\"!==r&&\"$?\"!==r&&\"$~\"!==r&&\"$!\"!==r||f++}else if(1===c.nodeType){d=c;var D=d.getAttribute(\"vt-name\"),y=m.get(D);k(d,y?\"vt-share\":\"vt-exit\");y&&(k(y,\"vt-share\"),m.set(D,null));var E=d.querySelectorAll(\"[vt-share]\");for(d=0;d<E.length;d++){var F=E[d],G=F.getAttribute(\"vt-name\"),\\nH=m.get(G);H&&(k(F,\"vt-share\"),k(H,\"vt-share\"),m.set(G,null))}}c=c.nextSibling}for(var I=g[h+1],t=I.firstElementChild;t;)null!==m.get(t.getAttribute(\"vt-name\"))&&k(t,\"vt-enter\"),t=t.nextElementSibling;c=x;do for(var n=c.firstElementChild;n;){var J=n.getAttribute(\"vt-update\");J&&\"none\"!==J&&!l.includes(n)&&k(n,\"vt-update\");n=n.nextElementSibling}while((c=c.parentNode)&&1===c.nodeType&&\"none\"!==c.getAttribute(\"vt-update\"));u.push.apply(u,I.querySelectorAll(\\'img[src]:not([loading=\"lazy\"])\\'))}}}if(B){var z=\\ndocument.__reactViewTransition=document.startViewTransition({update:function(){A(g);for(var a=[document.documentElement.clientHeight,document.fonts.ready],b={},e=0;e<u.length;b={g:b.g},e++)if(b.g=u[e],!b.g.complete){var p=b.g.getBoundingClientRect();0<p.bottom&&0<p.right&&p.top<window.innerHeight&&p.left<window.innerWidth&&(p=new Promise(function(w){return function(q){w.g.addEventListener(\"load\",q);w.g.addEventListener(\"error\",q)}}(b)),a.push(p))}return Promise.race([Promise.all(a),new Promise(function(w){var q=\\nperformance.now();setTimeout(w,2300>q&&2E3<q?2300-q:500)})])},types:[]});z.ready.finally(function(){for(var a=l.length-3;0<=a;a-=3){var b=l[a],e=b.style;e.viewTransitionName=l[a+1];e.viewTransitionClass=l[a+1];\"\"===b.getAttribute(\"style\")&&b.removeAttribute(\"style\")}});z.finished.finally(function(){document.__reactViewTransition===z&&(document.__reactViewTransition=null)});$RB=[];return}}catch(a){}A(g)}.bind(null,$RV);'\n )),\n writeChunk(destination, completeBoundaryScript1Partial)))\n : requiresStyleInsertion\n ? writeChunk(destination, completeBoundaryWithStylesData1)\n : writeChunk(destination, completeBoundaryData1);\n completedSegments = i.toString(16);\n writeChunk(destination, request.boundaryPrefix);\n writeChunk(destination, completedSegments);\n scriptFormat\n ? writeChunk(destination, completeBoundaryScript2)\n : writeChunk(destination, completeBoundaryData2);\n writeChunk(destination, request.segmentPrefix);\n writeChunk(destination, completedSegments);\n requiresStyleInsertion\n ? scriptFormat\n ? (writeChunk(destination, completeBoundaryScript3a),\n writeStyleResourceDependenciesInJS(destination, boundary))\n : (writeChunk(destination, completeBoundaryData3a),\n writeStyleResourceDependenciesInAttr(destination, boundary))\n : scriptFormat && writeChunk(destination, completeBoundaryScript3b);\n completedSegments = scriptFormat\n ? writeChunkAndReturn(destination, completeBoundaryScriptEnd)\n : writeChunkAndReturn(destination, dataElementQuotedEnd);\n return writeBootstrap(destination, request) && completedSegments;\n}\nfunction flushPartiallyCompletedSegment(\n request,\n destination,\n boundary,\n segment\n) {\n if (2 === segment.status) return !0;\n var hoistableState = boundary.contentState,\n segmentID = segment.id;\n if (-1 === segmentID) {\n if (-1 === (segment.id = boundary.rootSegmentID))\n throw Error(\n \"A root segment ID must have been assigned by now. This is a bug in React.\"\n );\n return flushSegmentContainer(request, destination, segment, hoistableState);\n }\n if (segmentID === boundary.rootSegmentID)\n return flushSegmentContainer(request, destination, segment, hoistableState);\n flushSegmentContainer(request, destination, segment, hoistableState);\n boundary = request.resumableState;\n request = request.renderState;\n (segment = 0 === boundary.streamingFormat)\n ? (writeChunk(destination, request.startInlineScript),\n writeChunk(destination, endOfStartTag),\n 0 === (boundary.instructions & 1)\n ? ((boundary.instructions |= 1),\n writeChunk(destination, completeSegmentScript1Full))\n : writeChunk(destination, completeSegmentScript1Partial))\n : writeChunk(destination, completeSegmentData1);\n writeChunk(destination, request.segmentPrefix);\n segmentID = segmentID.toString(16);\n writeChunk(destination, segmentID);\n segment\n ? writeChunk(destination, completeSegmentScript2)\n : writeChunk(destination, completeSegmentData2);\n writeChunk(destination, request.placeholderPrefix);\n writeChunk(destination, segmentID);\n destination = segment\n ? writeChunkAndReturn(destination, completeSegmentScriptEnd)\n : writeChunkAndReturn(destination, dataElementQuotedEnd);\n return destination;\n}\nvar flushingPartialBoundaries = !1;\nfunction flushCompletedQueues(request, destination) {\n currentView = new Uint8Array(4096);\n writtenBytes = 0;\n destinationHasCapacity$1 = !0;\n try {\n if (!(0 < request.pendingRootTasks)) {\n var i,\n completedRootSegment = request.completedRootSegment;\n if (null !== completedRootSegment) {\n if (5 === completedRootSegment.status) return;\n var completedPreambleSegments = request.completedPreambleSegments;\n if (null === completedPreambleSegments) return;\n flushedByteSize = request.byteSize;\n var skipBlockingShell = !1,\n blockingRenderMaxSize = 40 * request.progressiveChunkSize;\n flushedByteSize > blockingRenderMaxSize &&\n ((skipBlockingShell = !0),\n logRecoverableError(\n request,\n Error(\n \"This rendered a large document (>\" +\n Math.round(blockingRenderMaxSize / 1e3) +\n \" kB) without any Suspense boundaries around most of it. That can delay initial paint longer than necessary. To improve load performance, add a <Suspense> or <SuspenseList> around the content you expect to be below the header or below the fold. In the meantime, the content will deopt to paint arbitrary incomplete pieces of HTML.\"\n ),\n {},\n null\n ));\n var resumableState = request.resumableState,\n renderState = request.renderState;\n if (renderState.externalRuntimeScript) {\n var _renderState$external = renderState.externalRuntimeScript,\n src = _renderState$external.src,\n chunks = _renderState$external.chunks;\n resumableState.scriptResources.hasOwnProperty(src) ||\n ((resumableState.scriptResources[src] = null),\n renderState.scripts.add(chunks));\n }\n var preamble = renderState.preamble,\n htmlChunks = preamble.htmlChunks,\n headChunks = preamble.headChunks,\n i$jscomp$0;\n if (htmlChunks) {\n for (i$jscomp$0 = 0; i$jscomp$0 < htmlChunks.length; i$jscomp$0++)\n writeChunk(destination, htmlChunks[i$jscomp$0]);\n if (headChunks)\n for (i$jscomp$0 = 0; i$jscomp$0 < headChunks.length; i$jscomp$0++)\n writeChunk(destination, headChunks[i$jscomp$0]);\n else\n writeChunk(destination, startChunkForTag(\"head\")),\n writeChunk(destination, endOfStartTag);\n } else if (headChunks)\n for (i$jscomp$0 = 0; i$jscomp$0 < headChunks.length; i$jscomp$0++)\n writeChunk(destination, headChunks[i$jscomp$0]);\n var charsetChunks = renderState.charsetChunks;\n for (i$jscomp$0 = 0; i$jscomp$0 < charsetChunks.length; i$jscomp$0++)\n writeChunk(destination, charsetChunks[i$jscomp$0]);\n charsetChunks.length = 0;\n renderState.preconnects.forEach(flushResource, destination);\n renderState.preconnects.clear();\n var viewportChunks = renderState.viewportChunks;\n for (i$jscomp$0 = 0; i$jscomp$0 < viewportChunks.length; i$jscomp$0++)\n writeChunk(destination, viewportChunks[i$jscomp$0]);\n viewportChunks.length = 0;\n renderState.fontPreloads.forEach(flushResource, destination);\n renderState.fontPreloads.clear();\n renderState.highImagePreloads.forEach(flushResource, destination);\n renderState.highImagePreloads.clear();\n currentlyFlushingRenderState = renderState;\n renderState.styles.forEach(flushStylesInPreamble, destination);\n currentlyFlushingRenderState = null;\n var importMapChunks = renderState.importMapChunks;\n for (i$jscomp$0 = 0; i$jscomp$0 < importMapChunks.length; i$jscomp$0++)\n writeChunk(destination, importMapChunks[i$jscomp$0]);\n importMapChunks.length = 0;\n renderState.bootstrapScripts.forEach(flushResource, destination);\n renderState.scripts.forEach(flushResource, destination);\n renderState.scripts.clear();\n renderState.bulkPreloads.forEach(flushResource, destination);\n renderState.bulkPreloads.clear();\n if ((!htmlChunks && !headChunks) || skipBlockingShell)\n resumableState.instructions |= 32;\n else {\n var shellId = \"_\" + resumableState.idPrefix + \"R_\";\n writeChunk(destination, blockingRenderChunkStart);\n writeChunk(destination, escapeTextForBrowser(shellId));\n writeChunk(destination, blockingRenderChunkEnd);\n }\n var hoistableChunks = renderState.hoistableChunks;\n for (i$jscomp$0 = 0; i$jscomp$0 < hoistableChunks.length; i$jscomp$0++)\n writeChunk(destination, hoistableChunks[i$jscomp$0]);\n for (\n resumableState = hoistableChunks.length = 0;\n resumableState < completedPreambleSegments.length;\n resumableState++\n ) {\n var segments = completedPreambleSegments[resumableState];\n for (renderState = 0; renderState < segments.length; renderState++)\n flushSegment(request, destination, segments[renderState], null);\n }\n var preamble$jscomp$0 = request.renderState.preamble,\n headChunks$jscomp$0 = preamble$jscomp$0.headChunks;\n (preamble$jscomp$0.htmlChunks || headChunks$jscomp$0) &&\n writeChunk(destination, endChunkForTag(\"head\"));\n var bodyChunks = preamble$jscomp$0.bodyChunks;\n if (bodyChunks)\n for (\n completedPreambleSegments = 0;\n completedPreambleSegments < bodyChunks.length;\n completedPreambleSegments++\n )\n writeChunk(destination, bodyChunks[completedPreambleSegments]);\n flushSegment(request, destination, completedRootSegment, null);\n request.completedRootSegment = null;\n var resumableState$jscomp$0 = request.resumableState,\n renderState$jscomp$0 = request.renderState;\n (0 === request.allPendingTasks &&\n 0 === request.clientRenderedBoundaries.length &&\n 0 === request.completedBoundaries.length &&\n (null === request.trackedPostpones ||\n (0 === request.trackedPostpones.rootNodes.length &&\n null === request.trackedPostpones.rootSlots))) ||\n 0 !== resumableState$jscomp$0.streamingFormat ||\n 0 !== (resumableState$jscomp$0.instructions & 64) ||\n ((resumableState$jscomp$0.instructions |= 64),\n writeChunk(destination, renderState$jscomp$0.startInlineScript),\n writeCompletedShellIdAttribute(destination, resumableState$jscomp$0),\n writeChunk(destination, endOfStartTag),\n writeChunk(destination, shellTimeRuntimeScript),\n writeChunkAndReturn(destination, endInlineScript));\n var preamble$jscomp$1 = renderState$jscomp$0.preamble;\n (preamble$jscomp$1.htmlChunks || preamble$jscomp$1.headChunks) &&\n 0 === (resumableState$jscomp$0.instructions & 32) &&\n (writeChunk(destination, startChunkForTag(\"template\")),\n writeCompletedShellIdAttribute(destination, resumableState$jscomp$0),\n writeChunk(destination, endOfStartTag),\n writeChunk(destination, endChunkForTag(\"template\")));\n writeBootstrap(destination, renderState$jscomp$0);\n }\n var renderState$jscomp$1 = request.renderState;\n completedRootSegment = 0;\n var viewportChunks$jscomp$0 = renderState$jscomp$1.viewportChunks;\n for (\n completedRootSegment = 0;\n completedRootSegment < viewportChunks$jscomp$0.length;\n completedRootSegment++\n )\n writeChunk(destination, viewportChunks$jscomp$0[completedRootSegment]);\n viewportChunks$jscomp$0.length = 0;\n renderState$jscomp$1.preconnects.forEach(flushResource, destination);\n renderState$jscomp$1.preconnects.clear();\n renderState$jscomp$1.fontPreloads.forEach(flushResource, destination);\n renderState$jscomp$1.fontPreloads.clear();\n renderState$jscomp$1.highImagePreloads.forEach(\n flushResource,\n destination\n );\n renderState$jscomp$1.highImagePreloads.clear();\n renderState$jscomp$1.styles.forEach(preloadLateStyles, destination);\n renderState$jscomp$1.scripts.forEach(flushResource, destination);\n renderState$jscomp$1.scripts.clear();\n renderState$jscomp$1.bulkPreloads.forEach(flushResource, destination);\n renderState$jscomp$1.bulkPreloads.clear();\n var hoistableChunks$jscomp$0 = renderState$jscomp$1.hoistableChunks;\n for (\n completedRootSegment = 0;\n completedRootSegment < hoistableChunks$jscomp$0.length;\n completedRootSegment++\n )\n writeChunk(destination, hoistableChunks$jscomp$0[completedRootSegment]);\n hoistableChunks$jscomp$0.length = 0;\n var clientRenderedBoundaries = request.clientRenderedBoundaries;\n for (i = 0; i < clientRenderedBoundaries.length; i++) {\n var boundary = clientRenderedBoundaries[i];\n renderState$jscomp$1 = destination;\n var resumableState$jscomp$1 = request.resumableState,\n renderState$jscomp$2 = request.renderState,\n id = boundary.rootSegmentID,\n errorDigest = boundary.errorDigest,\n scriptFormat = 0 === resumableState$jscomp$1.streamingFormat;\n scriptFormat\n ? (writeChunk(\n renderState$jscomp$1,\n renderState$jscomp$2.startInlineScript\n ),\n writeChunk(renderState$jscomp$1, endOfStartTag),\n 0 === (resumableState$jscomp$1.instructions & 4)\n ? ((resumableState$jscomp$1.instructions |= 4),\n writeChunk(renderState$jscomp$1, clientRenderScript1Full))\n : writeChunk(renderState$jscomp$1, clientRenderScript1Partial))\n : writeChunk(renderState$jscomp$1, clientRenderData1);\n writeChunk(renderState$jscomp$1, renderState$jscomp$2.boundaryPrefix);\n writeChunk(renderState$jscomp$1, id.toString(16));\n scriptFormat && writeChunk(renderState$jscomp$1, clientRenderScript1A);\n errorDigest &&\n (scriptFormat\n ? (writeChunk(\n renderState$jscomp$1,\n clientRenderErrorScriptArgInterstitial\n ),\n writeChunk(\n renderState$jscomp$1,\n escapeJSStringsForInstructionScripts(errorDigest || \"\")\n ))\n : (writeChunk(renderState$jscomp$1, clientRenderData2),\n writeChunk(\n renderState$jscomp$1,\n escapeTextForBrowser(errorDigest || \"\")\n )));\n var JSCompiler_inline_result = scriptFormat\n ? writeChunkAndReturn(renderState$jscomp$1, clientRenderScriptEnd)\n : writeChunkAndReturn(renderState$jscomp$1, dataElementQuotedEnd);\n if (!JSCompiler_inline_result) {\n request.destination = null;\n i++;\n clientRenderedBoundaries.splice(0, i);\n return;\n }\n }\n clientRenderedBoundaries.splice(0, i);\n var completedBoundaries = request.completedBoundaries;\n for (i = 0; i < completedBoundaries.length; i++)\n if (\n !flushCompletedBoundary(request, destination, completedBoundaries[i])\n ) {\n request.destination = null;\n i++;\n completedBoundaries.splice(0, i);\n return;\n }\n completedBoundaries.splice(0, i);\n completeWriting(destination);\n currentView = new Uint8Array(4096);\n writtenBytes = 0;\n flushingPartialBoundaries = destinationHasCapacity$1 = !0;\n var partialBoundaries = request.partialBoundaries;\n for (i = 0; i < partialBoundaries.length; i++) {\n var boundary$83 = partialBoundaries[i];\n a: {\n clientRenderedBoundaries = request;\n boundary = destination;\n flushedByteSize = boundary$83.byteSize;\n var completedSegments = boundary$83.completedSegments;\n for (\n JSCompiler_inline_result = 0;\n JSCompiler_inline_result < completedSegments.length;\n JSCompiler_inline_result++\n )\n if (\n !flushPartiallyCompletedSegment(\n clientRenderedBoundaries,\n boundary,\n boundary$83,\n completedSegments[JSCompiler_inline_result]\n )\n ) {\n JSCompiler_inline_result++;\n completedSegments.splice(0, JSCompiler_inline_result);\n var JSCompiler_inline_result$jscomp$0 = !1;\n break a;\n }\n completedSegments.splice(0, JSCompiler_inline_result);\n var row = boundary$83.row;\n null !== row &&\n row.together &&\n 1 === boundary$83.pendingTasks &&\n (1 === row.pendingTasks\n ? unblockSuspenseListRow(\n clientRenderedBoundaries,\n row,\n row.hoistables\n )\n : row.pendingTasks--);\n JSCompiler_inline_result$jscomp$0 = writeHoistablesForBoundary(\n boundary,\n boundary$83.contentState,\n clientRenderedBoundaries.renderState\n );\n }\n if (!JSCompiler_inline_result$jscomp$0) {\n request.destination = null;\n i++;\n partialBoundaries.splice(0, i);\n return;\n }\n }\n partialBoundaries.splice(0, i);\n flushingPartialBoundaries = !1;\n var largeBoundaries = request.completedBoundaries;\n for (i = 0; i < largeBoundaries.length; i++)\n if (!flushCompletedBoundary(request, destination, largeBoundaries[i])) {\n request.destination = null;\n i++;\n largeBoundaries.splice(0, i);\n return;\n }\n largeBoundaries.splice(0, i);\n }\n } finally {\n (flushingPartialBoundaries = !1),\n 0 === request.allPendingTasks &&\n 0 === request.clientRenderedBoundaries.length &&\n 0 === request.completedBoundaries.length\n ? ((request.flushScheduled = !1),\n null === request.trackedPostpones &&\n ((i = request.resumableState),\n i.hasBody && writeChunk(destination, endChunkForTag(\"body\")),\n i.hasHtml && writeChunk(destination, endChunkForTag(\"html\"))),\n completeWriting(destination),\n flushBuffered(destination),\n (request.status = 14),\n destination.end(),\n (request.destination = null))\n : (completeWriting(destination), flushBuffered(destination));\n }\n}\nfunction startWork(request) {\n request.flushScheduled = null !== request.destination;\n scheduleMicrotask(function () {\n return requestStorage.run(request, performWork, request);\n });\n setImmediate(function () {\n 10 === request.status && (request.status = 11);\n null === request.trackedPostpones &&\n requestStorage.run(\n request,\n enqueueEarlyPreloadsAfterInitialWork,\n request\n );\n });\n}\nfunction enqueueEarlyPreloadsAfterInitialWork(request) {\n safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks);\n}\nfunction enqueueFlush(request) {\n !1 === request.flushScheduled &&\n 0 === request.pingedTasks.length &&\n null !== request.destination &&\n ((request.flushScheduled = !0),\n setImmediate(function () {\n var destination = request.destination;\n destination\n ? flushCompletedQueues(request, destination)\n : (request.flushScheduled = !1);\n }));\n}\nfunction startFlowing(request, destination) {\n if (13 === request.status)\n (request.status = 14), destination.destroy(request.fatalError);\n else if (14 !== request.status && null === request.destination) {\n request.destination = destination;\n try {\n flushCompletedQueues(request, destination);\n } catch (error) {\n logRecoverableError(request, error, {}), fatalError(request, error);\n }\n }\n}\nfunction abort(request, reason) {\n if (11 === request.status || 10 === request.status) request.status = 12;\n try {\n var abortableTasks = request.abortableTasks;\n if (0 < abortableTasks.size) {\n var error =\n void 0 === reason\n ? Error(\"The render was aborted by the server without a reason.\")\n : \"object\" === typeof reason &&\n null !== reason &&\n \"function\" === typeof reason.then\n ? Error(\"The render was aborted by the server with a promise.\")\n : reason;\n request.fatalError = error;\n abortableTasks.forEach(function (task) {\n return abortTask(task, request, error);\n });\n abortableTasks.clear();\n }\n null !== request.destination &&\n flushCompletedQueues(request, request.destination);\n } catch (error$85) {\n logRecoverableError(request, error$85, {}), fatalError(request, error$85);\n }\n}\nfunction addToReplayParent(node, parentKeyPath, trackedPostpones) {\n if (null === parentKeyPath) trackedPostpones.rootNodes.push(node);\n else {\n var workingMap = trackedPostpones.workingMap,\n parentNode = workingMap.get(parentKeyPath);\n void 0 === parentNode &&\n ((parentNode = [parentKeyPath[1], parentKeyPath[2], [], null]),\n workingMap.set(parentKeyPath, parentNode),\n addToReplayParent(parentNode, parentKeyPath[0], trackedPostpones));\n parentNode[2].push(node);\n }\n}\nfunction getPostponedState(request) {\n var trackedPostpones = request.trackedPostpones;\n if (\n null === trackedPostpones ||\n (0 === trackedPostpones.rootNodes.length &&\n null === trackedPostpones.rootSlots)\n )\n return (request.trackedPostpones = null);\n if (\n null === request.completedRootSegment ||\n (5 !== request.completedRootSegment.status &&\n null !== request.completedPreambleSegments)\n ) {\n var nextSegmentId = request.nextSegmentId;\n var replaySlots = trackedPostpones.rootSlots;\n var resumableState = request.resumableState;\n resumableState.bootstrapScriptContent = void 0;\n resumableState.bootstrapScripts = void 0;\n resumableState.bootstrapModules = void 0;\n } else {\n nextSegmentId = 0;\n replaySlots = -1;\n resumableState = request.resumableState;\n var renderState = request.renderState;\n resumableState.nextFormID = 0;\n resumableState.hasBody = !1;\n resumableState.hasHtml = !1;\n resumableState.unknownResources = { font: renderState.resets.font };\n resumableState.dnsResources = renderState.resets.dns;\n resumableState.connectResources = renderState.resets.connect;\n resumableState.imageResources = renderState.resets.image;\n resumableState.styleResources = renderState.resets.style;\n resumableState.scriptResources = {};\n resumableState.moduleUnknownResources = {};\n resumableState.moduleScriptResources = {};\n resumableState.instructions = 0;\n }\n return {\n nextSegmentId: nextSegmentId,\n rootFormatContext: request.rootFormatContext,\n progressiveChunkSize: request.progressiveChunkSize,\n resumableState: request.resumableState,\n replayNodes: trackedPostpones.rootNodes,\n replaySlots: replaySlots\n };\n}\nfunction ensureCorrectIsomorphicReactVersion() {\n var isomorphicReactPackageVersion = React.version;\n if (\"19.3.0-experimental-2bcbf254-20251020\" !== isomorphicReactPackageVersion)\n throw Error(\n 'Incompatible React versions: The \"react\" and \"react-dom\" packages must have the exact same version. Instead got:\\n - react: ' +\n (isomorphicReactPackageVersion +\n \"\\n - react-dom: 19.3.0-experimental-2bcbf254-20251020\\nLearn more: https://react.dev/warnings/version-mismatch\")\n );\n}\nensureCorrectIsomorphicReactVersion();\nfunction createDrainHandler(destination, request) {\n return function () {\n return startFlowing(request, destination);\n };\n}\nfunction createCancelHandler(request, reason) {\n return function () {\n request.destination = null;\n abort(request, Error(reason));\n };\n}\nfunction createRequestImpl(children, options) {\n var resumableState = createResumableState(\n options ? options.identifierPrefix : void 0,\n options ? options.unstable_externalRuntimeSrc : void 0,\n options ? options.bootstrapScriptContent : void 0,\n options ? options.bootstrapScripts : void 0,\n options ? options.bootstrapModules : void 0\n );\n return createRequest(\n children,\n resumableState,\n createRenderState(\n resumableState,\n options ? options.nonce : void 0,\n options ? options.unstable_externalRuntimeSrc : void 0,\n options ? options.importMap : void 0,\n options ? options.onHeaders : void 0,\n options ? options.maxHeadersLength : void 0\n ),\n createRootFormatContext(options ? options.namespaceURI : void 0),\n options ? options.progressiveChunkSize : void 0,\n options ? options.onError : void 0,\n options ? options.onAllReady : void 0,\n options ? options.onShellReady : void 0,\n options ? options.onShellError : void 0,\n void 0,\n options ? options.onPostpone : void 0,\n options ? options.formState : void 0\n );\n}\nfunction createFakeWritableFromReadableStreamController$1(controller) {\n return {\n write: function (chunk) {\n \"string\" === typeof chunk && (chunk = textEncoder.encode(chunk));\n controller.enqueue(chunk);\n return !0;\n },\n end: function () {\n controller.close();\n },\n destroy: function (error) {\n \"function\" === typeof controller.error\n ? controller.error(error)\n : controller.close();\n }\n };\n}\nfunction resumeRequestImpl(children, postponedState, options) {\n return resumeRequest(\n children,\n postponedState,\n createRenderState(\n postponedState.resumableState,\n options ? options.nonce : void 0,\n void 0,\n void 0,\n void 0,\n void 0\n ),\n options ? options.onError : void 0,\n options ? options.onAllReady : void 0,\n options ? options.onShellReady : void 0,\n options ? options.onShellError : void 0,\n void 0,\n options ? options.onPostpone : void 0\n );\n}\nensureCorrectIsomorphicReactVersion();\nfunction createFakeWritableFromReadableStreamController(controller) {\n return {\n write: function (chunk) {\n \"string\" === typeof chunk && (chunk = textEncoder.encode(chunk));\n controller.enqueue(chunk);\n return !0;\n },\n end: function () {\n controller.close();\n },\n destroy: function (error) {\n \"function\" === typeof controller.error\n ? controller.error(error)\n : controller.close();\n }\n };\n}\nfunction createFakeWritableFromReadable(readable) {\n return {\n write: function (chunk) {\n return readable.push(chunk);\n },\n end: function () {\n readable.push(null);\n },\n destroy: function (error) {\n readable.destroy(error);\n }\n };\n}\nexports.prerender = function (children, options) {\n return new Promise(function (resolve, reject) {\n var onHeaders = options ? options.onHeaders : void 0,\n onHeadersImpl;\n onHeaders &&\n (onHeadersImpl = function (headersDescriptor) {\n onHeaders(new Headers(headersDescriptor));\n });\n var resources = createResumableState(\n options ? options.identifierPrefix : void 0,\n options ? options.unstable_externalRuntimeSrc : void 0,\n options ? options.bootstrapScriptContent : void 0,\n options ? options.bootstrapScripts : void 0,\n options ? options.bootstrapModules : void 0\n ),\n request = createPrerenderRequest(\n children,\n resources,\n createRenderState(\n resources,\n void 0,\n options ? options.unstable_externalRuntimeSrc : void 0,\n options ? options.importMap : void 0,\n onHeadersImpl,\n options ? options.maxHeadersLength : void 0\n ),\n createRootFormatContext(options ? options.namespaceURI : void 0),\n options ? options.progressiveChunkSize : void 0,\n options ? options.onError : void 0,\n function () {\n var writable,\n stream = new ReadableStream(\n {\n type: \"bytes\",\n start: function (controller) {\n writable =\n createFakeWritableFromReadableStreamController(controller);\n },\n pull: function () {\n startFlowing(request, writable);\n },\n cancel: function (reason) {\n request.destination = null;\n abort(request, reason);\n }\n },\n { highWaterMark: 0 }\n );\n stream = { postponed: getPostponedState(request), prelude: stream };\n resolve(stream);\n },\n void 0,\n void 0,\n reject,\n options ? options.onPostpone : void 0\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(request, signal.reason);\n else {\n var listener = function () {\n abort(request, signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n startWork(request);\n });\n};\nexports.prerenderToNodeStream = function (children, options) {\n return new Promise(function (resolve, reject) {\n var resumableState = createResumableState(\n options ? options.identifierPrefix : void 0,\n options ? options.unstable_externalRuntimeSrc : void 0,\n options ? options.bootstrapScriptContent : void 0,\n options ? options.bootstrapScripts : void 0,\n options ? options.bootstrapModules : void 0\n ),\n request = createPrerenderRequest(\n children,\n resumableState,\n createRenderState(\n resumableState,\n void 0,\n options ? options.unstable_externalRuntimeSrc : void 0,\n options ? options.importMap : void 0,\n options ? options.onHeaders : void 0,\n options ? options.maxHeadersLength : void 0\n ),\n createRootFormatContext(options ? options.namespaceURI : void 0),\n options ? options.progressiveChunkSize : void 0,\n options ? options.onError : void 0,\n function () {\n var readable = new stream.Readable({\n read: function () {\n startFlowing(request, writable);\n }\n }),\n writable = createFakeWritableFromReadable(readable);\n readable = {\n postponed: getPostponedState(request),\n prelude: readable\n };\n resolve(readable);\n },\n void 0,\n void 0,\n reject,\n options ? options.onPostpone : void 0\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(request, signal.reason);\n else {\n var listener = function () {\n abort(request, signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n startWork(request);\n });\n};\nexports.renderToPipeableStream = function (children, options) {\n var request = createRequestImpl(children, options),\n hasStartedFlowing = !1;\n startWork(request);\n return {\n pipe: function (destination) {\n if (hasStartedFlowing)\n throw Error(\n \"React currently only supports piping to one writable stream.\"\n );\n hasStartedFlowing = !0;\n safelyEmitEarlyPreloads(\n request,\n null === request.trackedPostpones\n ? 0 === request.pendingRootTasks\n : null === request.completedRootSegment\n ? 0 === request.pendingRootTasks\n : 5 !== request.completedRootSegment.status\n );\n startFlowing(request, destination);\n destination.on(\"drain\", createDrainHandler(destination, request));\n destination.on(\n \"error\",\n createCancelHandler(\n request,\n \"The destination stream errored while writing data.\"\n )\n );\n destination.on(\n \"close\",\n createCancelHandler(request, \"The destination stream closed early.\")\n );\n return destination;\n },\n abort: function (reason) {\n abort(request, reason);\n }\n };\n};\nexports.renderToReadableStream = function (children, options) {\n return new Promise(function (resolve, reject) {\n var onFatalError,\n onAllReady,\n allReady = new Promise(function (res, rej) {\n onAllReady = res;\n onFatalError = rej;\n }),\n onHeaders = options ? options.onHeaders : void 0,\n onHeadersImpl;\n onHeaders &&\n (onHeadersImpl = function (headersDescriptor) {\n onHeaders(new Headers(headersDescriptor));\n });\n var resumableState = createResumableState(\n options ? options.identifierPrefix : void 0,\n options ? options.unstable_externalRuntimeSrc : void 0,\n options ? options.bootstrapScriptContent : void 0,\n options ? options.bootstrapScripts : void 0,\n options ? options.bootstrapModules : void 0\n ),\n request = createRequest(\n children,\n resumableState,\n createRenderState(\n resumableState,\n options ? options.nonce : void 0,\n options ? options.unstable_externalRuntimeSrc : void 0,\n options ? options.importMap : void 0,\n onHeadersImpl,\n options ? options.maxHeadersLength : void 0\n ),\n createRootFormatContext(options ? options.namespaceURI : void 0),\n options ? options.progressiveChunkSize : void 0,\n options ? options.onError : void 0,\n onAllReady,\n function () {\n var writable,\n stream = new ReadableStream(\n {\n type: \"bytes\",\n start: function (controller) {\n writable =\n createFakeWritableFromReadableStreamController$1(\n controller\n );\n },\n pull: function () {\n startFlowing(request, writable);\n },\n cancel: function (reason) {\n request.destination = null;\n abort(request, reason);\n }\n },\n { highWaterMark: 0 }\n );\n stream.allReady = allReady;\n resolve(stream);\n },\n function (error) {\n allReady.catch(function () {});\n reject(error);\n },\n onFatalError,\n options ? options.onPostpone : void 0,\n options ? options.formState : void 0\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(request, signal.reason);\n else {\n var listener = function () {\n abort(request, signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n startWork(request);\n });\n};\nexports.resume = function (children, postponedState, options) {\n return new Promise(function (resolve, reject) {\n var onFatalError,\n onAllReady,\n allReady = new Promise(function (res, rej) {\n onAllReady = res;\n onFatalError = rej;\n }),\n request = resumeRequest(\n children,\n postponedState,\n createRenderState(\n postponedState.resumableState,\n options ? options.nonce : void 0,\n void 0,\n void 0,\n void 0,\n void 0\n ),\n options ? options.onError : void 0,\n onAllReady,\n function () {\n var writable,\n stream = new ReadableStream(\n {\n type: \"bytes\",\n start: function (controller) {\n writable =\n createFakeWritableFromReadableStreamController$1(\n controller\n );\n },\n pull: function () {\n startFlowing(request, writable);\n },\n cancel: function (reason) {\n request.destination = null;\n abort(request, reason);\n }\n },\n { highWaterMark: 0 }\n );\n stream.allReady = allReady;\n resolve(stream);\n },\n function (error) {\n allReady.catch(function () {});\n reject(error);\n },\n onFatalError,\n options ? options.onPostpone : void 0\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(request, signal.reason);\n else {\n var listener = function () {\n abort(request, signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n startWork(request);\n });\n};\nexports.resumeAndPrerender = function (children, postponedState, options) {\n return new Promise(function (resolve, reject) {\n var request = resumeAndPrerenderRequest(\n children,\n postponedState,\n createRenderState(\n postponedState.resumableState,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0\n ),\n options ? options.onError : void 0,\n function () {\n var writable,\n stream = new ReadableStream(\n {\n type: \"bytes\",\n start: function (controller) {\n writable =\n createFakeWritableFromReadableStreamController(controller);\n },\n pull: function () {\n startFlowing(request, writable);\n },\n cancel: function (reason) {\n request.destination = null;\n abort(request, reason);\n }\n },\n { highWaterMark: 0 }\n );\n stream = { postponed: getPostponedState(request), prelude: stream };\n resolve(stream);\n },\n void 0,\n void 0,\n reject,\n options ? options.onPostpone : void 0\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(request, signal.reason);\n else {\n var listener = function () {\n abort(request, signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n startWork(request);\n });\n};\nexports.resumeAndPrerenderToNodeStream = function (\n children,\n postponedState,\n options\n) {\n return new Promise(function (resolve, reject) {\n var request = resumeAndPrerenderRequest(\n children,\n postponedState,\n createRenderState(\n postponedState.resumableState,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0\n ),\n options ? options.onError : void 0,\n function () {\n var readable = new stream.Readable({\n read: function () {\n startFlowing(request, writable);\n }\n }),\n writable = createFakeWritableFromReadable(readable);\n readable = { postponed: getPostponedState(request), prelude: readable };\n resolve(readable);\n },\n void 0,\n void 0,\n reject,\n options ? options.onPostpone : void 0\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(request, signal.reason);\n else {\n var listener = function () {\n abort(request, signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n startWork(request);\n });\n};\nexports.resumeToPipeableStream = function (children, postponedState, options) {\n var request = resumeRequestImpl(children, postponedState, options),\n hasStartedFlowing = !1;\n startWork(request);\n return {\n pipe: function (destination) {\n if (hasStartedFlowing)\n throw Error(\n \"React currently only supports piping to one writable stream.\"\n );\n hasStartedFlowing = !0;\n startFlowing(request, destination);\n destination.on(\"drain\", createDrainHandler(destination, request));\n destination.on(\n \"error\",\n createCancelHandler(\n request,\n \"The destination stream errored while writing data.\"\n )\n );\n destination.on(\n \"close\",\n createCancelHandler(request, \"The destination stream closed early.\")\n );\n return destination;\n },\n abort: function (reason) {\n abort(request, reason);\n }\n };\n};\nexports.version = \"19.3.0-experimental-2bcbf254-20251020\";\n","/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"next/dist/compiled/react-experimental\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.3.0-experimental-2bcbf254-20251020\";\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","'use strict';\n\nvar s;\nif (process.env.NODE_ENV === 'production') {\n s = require('./cjs/react-dom-server.node.production.js');\n} else {\n s = require('./cjs/react-dom-server.node.development.js');\n}\n\nexports.version = s.version;\nexports.prerenderToNodeStream = s.prerenderToNodeStream;\nexports.prerender = s.prerender;\nexports.resumeAndPrerenderToNodeStream = s.resumeAndPrerenderToNodeStream;\nexports.resumeAndPrerender = s.resumeAndPrerender;\n","/**\n * @license React\n * react-compiler-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar ReactSharedInternals =\n require(\"next/dist/compiled/react-experimental\").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nexports.c = function (size) {\n return ReactSharedInternals.H.useMemoCache(size);\n};\n","/**\n * @license React\n * react-jsx-dev-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsxDEV = void 0;\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_POSTPONE_TYPE = Symbol.for(\"react.postpone\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function () {},\n enqueueReplaceState: function () {},\n enqueueSetState: function () {}\n },\n assign = Object.assign,\n emptyObject = {};\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nComponent.prototype.isReactComponent = {};\nComponent.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n};\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n};\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nvar pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());\npureComponentPrototype.constructor = PureComponent;\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = !0;\nvar isArrayImpl = Array.isArray;\nfunction noop() {}\nvar ReactSharedInternals = { H: null, A: null, T: null, S: null, G: null },\n hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction ReactElement(type, key, props) {\n var refProp = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== refProp ? refProp : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(oldElement.type, newKey, oldElement.props);\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result;\n ctor = ctor();\n ctor.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1), (payload._result = moduleObject);\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2), (payload._result = error);\n }\n );\n -1 === payload._status && ((payload._status = 0), (payload._result = ctor));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nfunction useOptimistic(passthrough, reducer) {\n return ReactSharedInternals.H.useOptimistic(passthrough, reducer);\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n };\nfunction startTransition(scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n currentTransition.types =\n null !== prevTransition ? prevTransition.types : null;\n currentTransition.gesture = null;\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n returnValue.then(noop, reportGlobalError);\n } catch (error) {\n reportGlobalError(error);\n } finally {\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n}\nfunction addTransitionType(type) {\n var transition = ReactSharedInternals.T;\n if (null !== transition) {\n var transitionTypes = transition.types;\n null === transitionTypes\n ? (transition.types = [type])\n : -1 === transitionTypes.indexOf(type) && transitionTypes.push(type);\n } else startTransition(addTransitionType.bind(null, type));\n}\nvar Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n};\nexports.Activity = REACT_ACTIVITY_TYPE;\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.ViewTransition = REACT_VIEW_TRANSITION_TYPE;\nexports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.__COMPILER_RUNTIME = {\n __proto__: null,\n c: function (size) {\n return ReactSharedInternals.H.useMemoCache(size);\n }\n};\nexports.addTransitionType = addTransitionType;\nexports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n};\nexports.cacheSignal = function () {\n return null;\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" + element + \".\"\n );\n var props = assign({}, element.props),\n key = element.key;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, props);\n};\nexports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n return defaultValue;\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.experimental_useOptimistic = function (passthrough, reducer) {\n return useOptimistic(passthrough, reducer);\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.startTransition = startTransition;\nexports.unstable_Activity = REACT_ACTIVITY_TYPE;\nexports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;\nexports.unstable_getCacheForType = function (resourceType) {\n var dispatcher = ReactSharedInternals.A;\n return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();\n};\nexports.unstable_postpone = function (reason) {\n reason = Error(reason);\n reason.$$typeof = REACT_POSTPONE_TYPE;\n throw reason;\n};\nexports.unstable_startGestureTransition = function (provider, scope, options) {\n if (null == provider)\n throw Error(\n \"A Timeline is required as the first argument to startGestureTransition.\"\n );\n var prevTransition = ReactSharedInternals.T,\n currentTransition = { types: null };\n currentTransition.gesture = provider;\n ReactSharedInternals.T = currentTransition;\n try {\n scope();\n var onStartGestureTransitionFinish = ReactSharedInternals.G;\n if (null !== onStartGestureTransitionFinish)\n return onStartGestureTransitionFinish(\n currentTransition,\n provider,\n options\n );\n } catch (error) {\n reportGlobalError(error);\n } finally {\n ReactSharedInternals.T = prevTransition;\n }\n return noop;\n};\nexports.unstable_useCacheRefresh = function () {\n return ReactSharedInternals.H.useCacheRefresh();\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useActionState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useActionState(action, initialState, permalink);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useContext = function (Context) {\n return ReactSharedInternals.H.useContext(Context);\n};\nexports.useDebugValue = function () {};\nexports.useDeferredValue = function (value, initialValue) {\n return ReactSharedInternals.H.useDeferredValue(value, initialValue);\n};\nexports.useEffect = function (create, deps) {\n return ReactSharedInternals.H.useEffect(create, deps);\n};\nexports.useEffectEvent = function (callback) {\n return ReactSharedInternals.H.useEffectEvent(callback);\n};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useImperativeHandle = function (ref, create, deps) {\n return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);\n};\nexports.useInsertionEffect = function (create, deps) {\n return ReactSharedInternals.H.useInsertionEffect(create, deps);\n};\nexports.useLayoutEffect = function (create, deps) {\n return ReactSharedInternals.H.useLayoutEffect(create, deps);\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.useOptimistic = useOptimistic;\nexports.useReducer = function (reducer, initialArg, init) {\n return ReactSharedInternals.H.useReducer(reducer, initialArg, init);\n};\nexports.useRef = function (initialValue) {\n return ReactSharedInternals.H.useRef(initialValue);\n};\nexports.useState = function (initialState) {\n return ReactSharedInternals.H.useState(initialState);\n};\nexports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n) {\n return ReactSharedInternals.H.useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n};\nexports.useTransition = function () {\n return ReactSharedInternals.H.useTransition();\n};\nexports.version = \"19.3.0-experimental-2bcbf254-20251020\";\n","/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-compiler-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-compiler-runtime.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-dev-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-dev-runtime.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/**\n * @license React\n * react-is.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\");\nfunction typeOf(object) {\n if (\"object\" === typeof object && null !== object) {\n var $$typeof = object.$$typeof;\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n switch (((object = object.type), object)) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n case REACT_VIEW_TRANSITION_TYPE:\n return object;\n default:\n switch (((object = object && object.$$typeof), object)) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n return object;\n case REACT_CONSUMER_TYPE:\n return object;\n default:\n return $$typeof;\n }\n }\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n}\nexports.ContextConsumer = REACT_CONSUMER_TYPE;\nexports.ContextProvider = REACT_CONTEXT_TYPE;\nexports.Element = REACT_ELEMENT_TYPE;\nexports.ForwardRef = REACT_FORWARD_REF_TYPE;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Lazy = REACT_LAZY_TYPE;\nexports.Memo = REACT_MEMO_TYPE;\nexports.Portal = REACT_PORTAL_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.SuspenseList = REACT_SUSPENSE_LIST_TYPE;\nexports.isContextConsumer = function (object) {\n return typeOf(object) === REACT_CONSUMER_TYPE;\n};\nexports.isContextProvider = function (object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n};\nexports.isElement = function (object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n};\nexports.isForwardRef = function (object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n};\nexports.isFragment = function (object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n};\nexports.isLazy = function (object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n};\nexports.isMemo = function (object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n};\nexports.isPortal = function (object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n};\nexports.isProfiler = function (object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n};\nexports.isStrictMode = function (object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n};\nexports.isSuspense = function (object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n};\nexports.isSuspenseList = function (object) {\n return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;\n};\nexports.isValidElementType = function (type) {\n return \"string\" === typeof type ||\n \"function\" === typeof type ||\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE ||\n type === REACT_VIEW_TRANSITION_TYPE ||\n (\"object\" === typeof type &&\n null !== type &&\n (type.$$typeof === REACT_LAZY_TYPE ||\n type.$$typeof === REACT_MEMO_TYPE ||\n type.$$typeof === REACT_CONTEXT_TYPE ||\n type.$$typeof === REACT_CONSUMER_TYPE ||\n type.$$typeof === REACT_FORWARD_REF_TYPE ||\n type.$$typeof === REACT_CLIENT_REFERENCE ||\n void 0 !== type.getModuleId))\n ? !0\n : !1;\n};\nexports.typeOf = typeOf;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/**\n * @license React\n * react-server-dom-webpack-client.node.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar util = require(\"util\"),\n ReactDOM = require(\"react-dom\"),\n decoderOptions = { stream: !0 };\nfunction resolveClientReference(bundlerConfig, metadata) {\n if (bundlerConfig) {\n var moduleExports = bundlerConfig[metadata[0]];\n if ((bundlerConfig = moduleExports && moduleExports[metadata[2]]))\n moduleExports = bundlerConfig.name;\n else {\n bundlerConfig = moduleExports && moduleExports[\"*\"];\n if (!bundlerConfig)\n throw Error(\n 'Could not find the module \"' +\n metadata[0] +\n '\" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.'\n );\n moduleExports = metadata[2];\n }\n return 4 === metadata.length\n ? [bundlerConfig.id, bundlerConfig.chunks, moduleExports, 1]\n : [bundlerConfig.id, bundlerConfig.chunks, moduleExports];\n }\n return metadata;\n}\nfunction resolveServerReference(bundlerConfig, id) {\n var name = \"\",\n resolvedModuleData = bundlerConfig[id];\n if (resolvedModuleData) name = resolvedModuleData.name;\n else {\n var idx = id.lastIndexOf(\"#\");\n -1 !== idx &&\n ((name = id.slice(idx + 1)),\n (resolvedModuleData = bundlerConfig[id.slice(0, idx)]));\n if (!resolvedModuleData)\n throw Error(\n 'Could not find the module \"' +\n id +\n '\" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'\n );\n }\n return resolvedModuleData.async\n ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]\n : [resolvedModuleData.id, resolvedModuleData.chunks, name];\n}\nvar chunkCache = new Map();\nfunction requireAsyncModule(id) {\n var promise = globalThis.__next_require__(id);\n if (\"function\" !== typeof promise.then || \"fulfilled\" === promise.status)\n return null;\n promise.then(\n function (value) {\n promise.status = \"fulfilled\";\n promise.value = value;\n },\n function (reason) {\n promise.status = \"rejected\";\n promise.reason = reason;\n }\n );\n return promise;\n}\nfunction ignoreReject() {}\nfunction preloadModule(metadata) {\n for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {\n var chunkId = chunks[i++];\n chunks[i++];\n var entry = chunkCache.get(chunkId);\n if (void 0 === entry) {\n entry = __webpack_chunk_load__(chunkId);\n promises.push(entry);\n var resolve = chunkCache.set.bind(chunkCache, chunkId, null);\n entry.then(resolve, ignoreReject);\n chunkCache.set(chunkId, entry);\n } else null !== entry && promises.push(entry);\n }\n return 4 === metadata.length\n ? 0 === promises.length\n ? requireAsyncModule(metadata[0])\n : Promise.all(promises).then(function () {\n return requireAsyncModule(metadata[0]);\n })\n : 0 < promises.length\n ? Promise.all(promises)\n : null;\n}\nfunction requireModule(metadata) {\n var moduleExports = globalThis.__next_require__(metadata[0]);\n if (4 === metadata.length && \"function\" === typeof moduleExports.then)\n if (\"fulfilled\" === moduleExports.status)\n moduleExports = moduleExports.value;\n else throw moduleExports.reason;\n return \"*\" === metadata[2]\n ? moduleExports\n : \"\" === metadata[2]\n ? moduleExports.__esModule\n ? moduleExports.default\n : moduleExports\n : moduleExports[metadata[2]];\n}\nfunction prepareDestinationWithChunks(moduleLoading, chunks, nonce$jscomp$0) {\n if (null !== moduleLoading)\n for (var i = 1; i < chunks.length; i += 2) {\n var nonce = nonce$jscomp$0,\n JSCompiler_temp_const = ReactDOMSharedInternals.d,\n JSCompiler_temp_const$jscomp$0 = JSCompiler_temp_const.X,\n JSCompiler_temp_const$jscomp$1 = moduleLoading.prefix + chunks[i];\n var JSCompiler_inline_result = moduleLoading.crossOrigin;\n JSCompiler_inline_result =\n \"string\" === typeof JSCompiler_inline_result\n ? \"use-credentials\" === JSCompiler_inline_result\n ? JSCompiler_inline_result\n : \"\"\n : void 0;\n JSCompiler_temp_const$jscomp$0.call(\n JSCompiler_temp_const,\n JSCompiler_temp_const$jscomp$1,\n { crossOrigin: JSCompiler_inline_result, nonce: nonce }\n );\n }\n}\nvar ReactDOMSharedInternals =\n ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_POSTPONE_TYPE = Symbol.for(\"react.postpone\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ASYNC_ITERATOR = Symbol.asyncIterator,\n isArrayImpl = Array.isArray,\n getPrototypeOf = Object.getPrototypeOf,\n ObjectPrototype = Object.prototype,\n knownServerReferences = new WeakMap();\nfunction serializeNumber(number) {\n return Number.isFinite(number)\n ? 0 === number && -Infinity === 1 / number\n ? \"$-0\"\n : number\n : Infinity === number\n ? \"$Infinity\"\n : -Infinity === number\n ? \"$-Infinity\"\n : \"$NaN\";\n}\nfunction processReply(\n root,\n formFieldPrefix,\n temporaryReferences,\n resolve,\n reject\n) {\n function serializeTypedArray(tag, typedArray) {\n typedArray = new Blob([\n new Uint8Array(\n typedArray.buffer,\n typedArray.byteOffset,\n typedArray.byteLength\n )\n ]);\n var blobId = nextPartId++;\n null === formData && (formData = new FormData());\n formData.append(formFieldPrefix + blobId, typedArray);\n return \"$\" + tag + blobId.toString(16);\n }\n function serializeBinaryReader(reader) {\n function progress(entry) {\n entry.done\n ? ((entry = nextPartId++),\n data.append(formFieldPrefix + entry, new Blob(buffer)),\n data.append(\n formFieldPrefix + streamId,\n '\"$o' + entry.toString(16) + '\"'\n ),\n data.append(formFieldPrefix + streamId, \"C\"),\n pendingParts--,\n 0 === pendingParts && resolve(data))\n : (buffer.push(entry.value),\n reader.read(new Uint8Array(1024)).then(progress, reject));\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++,\n buffer = [];\n reader.read(new Uint8Array(1024)).then(progress, reject);\n return \"$r\" + streamId.toString(16);\n }\n function serializeReader(reader) {\n function progress(entry) {\n if (entry.done)\n data.append(formFieldPrefix + streamId, \"C\"),\n pendingParts--,\n 0 === pendingParts && resolve(data);\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON);\n reader.read().then(progress, reject);\n } catch (x) {\n reject(x);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n reader.read().then(progress, reject);\n return \"$R\" + streamId.toString(16);\n }\n function serializeReadableStream(stream) {\n try {\n var binaryReader = stream.getReader({ mode: \"byob\" });\n } catch (x) {\n return serializeReader(stream.getReader());\n }\n return serializeBinaryReader(binaryReader);\n }\n function serializeAsyncIterable(iterable, iterator) {\n function progress(entry) {\n if (entry.done) {\n if (void 0 === entry.value)\n data.append(formFieldPrefix + streamId, \"C\");\n else\n try {\n var partJSON = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, \"C\" + partJSON);\n } catch (x) {\n reject(x);\n return;\n }\n pendingParts--;\n 0 === pendingParts && resolve(data);\n } else\n try {\n var partJSON$21 = JSON.stringify(entry.value, resolveToJSON);\n data.append(formFieldPrefix + streamId, partJSON$21);\n iterator.next().then(progress, reject);\n } catch (x$22) {\n reject(x$22);\n }\n }\n null === formData && (formData = new FormData());\n var data = formData;\n pendingParts++;\n var streamId = nextPartId++;\n iterable = iterable === iterator;\n iterator.next().then(progress, reject);\n return \"$\" + (iterable ? \"x\" : \"X\") + streamId.toString(16);\n }\n function resolveToJSON(key, value) {\n if (null === value) return null;\n if (\"object\" === typeof value) {\n switch (value.$$typeof) {\n case REACT_ELEMENT_TYPE:\n if (void 0 !== temporaryReferences && -1 === key.indexOf(\":\")) {\n var parentReference = writtenObjects.get(this);\n if (void 0 !== parentReference)\n return (\n temporaryReferences.set(parentReference + \":\" + key, value),\n \"$T\"\n );\n }\n throw Error(\n \"React Element cannot be passed to Server Functions from the Client without a temporary reference set. Pass a TemporaryReferenceSet to the options.\"\n );\n case REACT_LAZY_TYPE:\n parentReference = value._payload;\n var init = value._init;\n null === formData && (formData = new FormData());\n pendingParts++;\n try {\n var resolvedModel = init(parentReference),\n lazyId = nextPartId++,\n partJSON = serializeModel(resolvedModel, lazyId);\n formData.append(formFieldPrefix + lazyId, partJSON);\n return \"$\" + lazyId.toString(16);\n } catch (x) {\n if (\n \"object\" === typeof x &&\n null !== x &&\n \"function\" === typeof x.then\n ) {\n pendingParts++;\n var lazyId$23 = nextPartId++;\n parentReference = function () {\n try {\n var partJSON$24 = serializeModel(value, lazyId$23),\n data$25 = formData;\n data$25.append(formFieldPrefix + lazyId$23, partJSON$24);\n pendingParts--;\n 0 === pendingParts && resolve(data$25);\n } catch (reason) {\n reject(reason);\n }\n };\n x.then(parentReference, parentReference);\n return \"$\" + lazyId$23.toString(16);\n }\n reject(x);\n return null;\n } finally {\n pendingParts--;\n }\n }\n if (\"function\" === typeof value.then) {\n null === formData && (formData = new FormData());\n pendingParts++;\n var promiseId = nextPartId++;\n value.then(function (partValue) {\n try {\n var partJSON$27 = serializeModel(partValue, promiseId);\n partValue = formData;\n partValue.append(formFieldPrefix + promiseId, partJSON$27);\n pendingParts--;\n 0 === pendingParts && resolve(partValue);\n } catch (reason) {\n reject(reason);\n }\n }, reject);\n return \"$@\" + promiseId.toString(16);\n }\n parentReference = writtenObjects.get(value);\n if (void 0 !== parentReference)\n if (modelRoot === value) modelRoot = null;\n else return parentReference;\n else\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference &&\n ((key = parentReference + \":\" + key),\n writtenObjects.set(value, key),\n void 0 !== temporaryReferences &&\n temporaryReferences.set(key, value)));\n if (isArrayImpl(value)) return value;\n if (value instanceof FormData) {\n null === formData && (formData = new FormData());\n var data$31 = formData;\n key = nextPartId++;\n var prefix = formFieldPrefix + key + \"_\";\n value.forEach(function (originalValue, originalKey) {\n data$31.append(prefix + originalKey, originalValue);\n });\n return \"$K\" + key.toString(16);\n }\n if (value instanceof Map)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$Q\" + key.toString(16)\n );\n if (value instanceof Set)\n return (\n (key = nextPartId++),\n (parentReference = serializeModel(Array.from(value), key)),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$W\" + key.toString(16)\n );\n if (value instanceof ArrayBuffer)\n return (\n (key = new Blob([value])),\n (parentReference = nextPartId++),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + parentReference, key),\n \"$A\" + parentReference.toString(16)\n );\n if (value instanceof Int8Array) return serializeTypedArray(\"O\", value);\n if (value instanceof Uint8Array) return serializeTypedArray(\"o\", value);\n if (value instanceof Uint8ClampedArray)\n return serializeTypedArray(\"U\", value);\n if (value instanceof Int16Array) return serializeTypedArray(\"S\", value);\n if (value instanceof Uint16Array) return serializeTypedArray(\"s\", value);\n if (value instanceof Int32Array) return serializeTypedArray(\"L\", value);\n if (value instanceof Uint32Array) return serializeTypedArray(\"l\", value);\n if (value instanceof Float32Array) return serializeTypedArray(\"G\", value);\n if (value instanceof Float64Array) return serializeTypedArray(\"g\", value);\n if (value instanceof BigInt64Array)\n return serializeTypedArray(\"M\", value);\n if (value instanceof BigUint64Array)\n return serializeTypedArray(\"m\", value);\n if (value instanceof DataView) return serializeTypedArray(\"V\", value);\n if (\"function\" === typeof Blob && value instanceof Blob)\n return (\n null === formData && (formData = new FormData()),\n (key = nextPartId++),\n formData.append(formFieldPrefix + key, value),\n \"$B\" + key.toString(16)\n );\n if ((key = getIteratorFn(value)))\n return (\n (parentReference = key.call(value)),\n parentReference === value\n ? ((key = nextPartId++),\n (parentReference = serializeModel(\n Array.from(parentReference),\n key\n )),\n null === formData && (formData = new FormData()),\n formData.append(formFieldPrefix + key, parentReference),\n \"$i\" + key.toString(16))\n : Array.from(parentReference)\n );\n if (\n \"function\" === typeof ReadableStream &&\n value instanceof ReadableStream\n )\n return serializeReadableStream(value);\n key = value[ASYNC_ITERATOR];\n if (\"function\" === typeof key)\n return serializeAsyncIterable(value, key.call(value));\n key = getPrototypeOf(value);\n if (\n key !== ObjectPrototype &&\n (null === key || null !== getPrototypeOf(key))\n ) {\n if (void 0 === temporaryReferences)\n throw Error(\n \"Only plain objects, and a few built-ins, can be passed to Server Functions. Classes or null prototypes are not supported.\"\n );\n return \"$T\";\n }\n return value;\n }\n if (\"string\" === typeof value) {\n if (\"Z\" === value[value.length - 1] && this[key] instanceof Date)\n return \"$D\" + value;\n key = \"$\" === value[0] ? \"$\" + value : value;\n return key;\n }\n if (\"boolean\" === typeof value) return value;\n if (\"number\" === typeof value) return serializeNumber(value);\n if (\"undefined\" === typeof value) return \"$undefined\";\n if (\"function\" === typeof value) {\n parentReference = knownServerReferences.get(value);\n if (void 0 !== parentReference)\n return (\n (key = JSON.stringify(\n { id: parentReference.id, bound: parentReference.bound },\n resolveToJSON\n )),\n null === formData && (formData = new FormData()),\n (parentReference = nextPartId++),\n formData.set(formFieldPrefix + parentReference, key),\n \"$F\" + parentReference.toString(16)\n );\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + \":\" + key, value), \"$T\"\n );\n throw Error(\n \"Client Functions cannot be passed directly to Server Functions. Only Functions passed from the Server can be passed back again.\"\n );\n }\n if (\"symbol\" === typeof value) {\n if (\n void 0 !== temporaryReferences &&\n -1 === key.indexOf(\":\") &&\n ((parentReference = writtenObjects.get(this)),\n void 0 !== parentReference)\n )\n return (\n temporaryReferences.set(parentReference + \":\" + key, value), \"$T\"\n );\n throw Error(\n \"Symbols cannot be passed to a Server Function without a temporary reference set. Pass a TemporaryReferenceSet to the options.\"\n );\n }\n if (\"bigint\" === typeof value) return \"$n\" + value.toString(10);\n throw Error(\n \"Type \" +\n typeof value +\n \" is not supported as an argument to a Server Function.\"\n );\n }\n function serializeModel(model, id) {\n \"object\" === typeof model &&\n null !== model &&\n ((id = \"$\" + id.toString(16)),\n writtenObjects.set(model, id),\n void 0 !== temporaryReferences && temporaryReferences.set(id, model));\n modelRoot = model;\n return JSON.stringify(model, resolveToJSON);\n }\n var nextPartId = 1,\n pendingParts = 0,\n formData = null,\n writtenObjects = new WeakMap(),\n modelRoot = root,\n json = serializeModel(root, 0);\n null === formData\n ? resolve(json)\n : (formData.set(formFieldPrefix + \"0\", json),\n 0 === pendingParts && resolve(formData));\n return function () {\n 0 < pendingParts &&\n ((pendingParts = 0),\n null === formData ? resolve(json) : resolve(formData));\n };\n}\nvar boundCache = new WeakMap();\nfunction encodeFormData(reference) {\n var resolve,\n reject,\n thenable = new Promise(function (res, rej) {\n resolve = res;\n reject = rej;\n });\n processReply(\n reference,\n \"\",\n void 0,\n function (body) {\n if (\"string\" === typeof body) {\n var data = new FormData();\n data.append(\"0\", body);\n body = data;\n }\n thenable.status = \"fulfilled\";\n thenable.value = body;\n resolve(body);\n },\n function (e) {\n thenable.status = \"rejected\";\n thenable.reason = e;\n reject(e);\n }\n );\n return thenable;\n}\nfunction defaultEncodeFormAction(identifierPrefix) {\n var referenceClosure = knownServerReferences.get(this);\n if (!referenceClosure)\n throw Error(\n \"Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.\"\n );\n var data = null;\n if (null !== referenceClosure.bound) {\n data = boundCache.get(referenceClosure);\n data ||\n ((data = encodeFormData({\n id: referenceClosure.id,\n bound: referenceClosure.bound\n })),\n boundCache.set(referenceClosure, data));\n if (\"rejected\" === data.status) throw data.reason;\n if (\"fulfilled\" !== data.status) throw data;\n referenceClosure = data.value;\n var prefixedData = new FormData();\n referenceClosure.forEach(function (value, key) {\n prefixedData.append(\"$ACTION_\" + identifierPrefix + \":\" + key, value);\n });\n data = prefixedData;\n referenceClosure = \"$ACTION_REF_\" + identifierPrefix;\n } else referenceClosure = \"$ACTION_ID_\" + referenceClosure.id;\n return {\n name: referenceClosure,\n method: \"POST\",\n encType: \"multipart/form-data\",\n data: data\n };\n}\nfunction isSignatureEqual(referenceId, numberOfBoundArgs) {\n var referenceClosure = knownServerReferences.get(this);\n if (!referenceClosure)\n throw Error(\n \"Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.\"\n );\n if (referenceClosure.id !== referenceId) return !1;\n var boundPromise = referenceClosure.bound;\n if (null === boundPromise) return 0 === numberOfBoundArgs;\n switch (boundPromise.status) {\n case \"fulfilled\":\n return boundPromise.value.length === numberOfBoundArgs;\n case \"pending\":\n throw boundPromise;\n case \"rejected\":\n throw boundPromise.reason;\n default:\n throw (\n (\"string\" !== typeof boundPromise.status &&\n ((boundPromise.status = \"pending\"),\n boundPromise.then(\n function (boundArgs) {\n boundPromise.status = \"fulfilled\";\n boundPromise.value = boundArgs;\n },\n function (error) {\n boundPromise.status = \"rejected\";\n boundPromise.reason = error;\n }\n )),\n boundPromise)\n );\n }\n}\nfunction registerBoundServerReference(reference, id, bound, encodeFormAction) {\n knownServerReferences.has(reference) ||\n (knownServerReferences.set(reference, {\n id: id,\n originalBind: reference.bind,\n bound: bound\n }),\n Object.defineProperties(reference, {\n $$FORM_ACTION: {\n value:\n void 0 === encodeFormAction\n ? defaultEncodeFormAction\n : function () {\n var referenceClosure = knownServerReferences.get(this);\n if (!referenceClosure)\n throw Error(\n \"Tried to encode a Server Action from a different instance than the encoder is from. This is a bug in React.\"\n );\n var boundPromise = referenceClosure.bound;\n null === boundPromise && (boundPromise = Promise.resolve([]));\n return encodeFormAction(referenceClosure.id, boundPromise);\n }\n },\n $$IS_SIGNATURE_EQUAL: { value: isSignatureEqual },\n bind: { value: bind }\n }));\n}\nvar FunctionBind = Function.prototype.bind,\n ArraySlice = Array.prototype.slice;\nfunction bind() {\n var referenceClosure = knownServerReferences.get(this);\n if (!referenceClosure) return FunctionBind.apply(this, arguments);\n var newFn = referenceClosure.originalBind.apply(this, arguments),\n args = ArraySlice.call(arguments, 1),\n boundPromise = null;\n boundPromise =\n null !== referenceClosure.bound\n ? Promise.resolve(referenceClosure.bound).then(function (boundArgs) {\n return boundArgs.concat(args);\n })\n : Promise.resolve(args);\n knownServerReferences.set(newFn, {\n id: referenceClosure.id,\n originalBind: newFn.bind,\n bound: boundPromise\n });\n Object.defineProperties(newFn, {\n $$FORM_ACTION: { value: this.$$FORM_ACTION },\n $$IS_SIGNATURE_EQUAL: { value: isSignatureEqual },\n bind: { value: bind }\n });\n return newFn;\n}\nfunction createBoundServerReference(metaData, callServer, encodeFormAction) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return bound\n ? \"fulfilled\" === bound.status\n ? callServer(id, bound.value.concat(args))\n : Promise.resolve(bound).then(function (boundArgs) {\n return callServer(id, boundArgs.concat(args));\n })\n : callServer(id, args);\n }\n var id = metaData.id,\n bound = metaData.bound;\n registerBoundServerReference(action, id, bound, encodeFormAction);\n return action;\n}\nfunction createServerReference$1(id, callServer, encodeFormAction) {\n function action() {\n var args = Array.prototype.slice.call(arguments);\n return callServer(id, args);\n }\n registerBoundServerReference(action, id, null, encodeFormAction);\n return action;\n}\nfunction ReactPromise(status, value, reason) {\n this.status = status;\n this.value = value;\n this.reason = reason;\n}\nReactPromise.prototype = Object.create(Promise.prototype);\nReactPromise.prototype.then = function (resolve, reject) {\n switch (this.status) {\n case \"resolved_model\":\n initializeModelChunk(this);\n break;\n case \"resolved_module\":\n initializeModuleChunk(this);\n }\n switch (this.status) {\n case \"fulfilled\":\n \"function\" === typeof resolve && resolve(this.value);\n break;\n case \"pending\":\n case \"blocked\":\n \"function\" === typeof resolve &&\n (null === this.value && (this.value = []), this.value.push(resolve));\n \"function\" === typeof reject &&\n (null === this.reason && (this.reason = []), this.reason.push(reject));\n break;\n case \"halted\":\n break;\n default:\n \"function\" === typeof reject && reject(this.reason);\n }\n};\nfunction readChunk(chunk) {\n switch (chunk.status) {\n case \"resolved_model\":\n initializeModelChunk(chunk);\n break;\n case \"resolved_module\":\n initializeModuleChunk(chunk);\n }\n switch (chunk.status) {\n case \"fulfilled\":\n return chunk.value;\n case \"pending\":\n case \"blocked\":\n case \"halted\":\n throw chunk;\n default:\n throw chunk.reason;\n }\n}\nfunction createErrorChunk(response, error) {\n return new ReactPromise(\"rejected\", null, error);\n}\nfunction wakeChunk(listeners, value) {\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n \"function\" === typeof listener\n ? listener(value)\n : fulfillReference(listener, value);\n }\n}\nfunction rejectChunk(listeners, error) {\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n \"function\" === typeof listener\n ? listener(error)\n : rejectReference(listener, error);\n }\n}\nfunction resolveBlockedCycle(resolvedChunk, reference) {\n var referencedChunk = reference.handler.chunk;\n if (null === referencedChunk) return null;\n if (referencedChunk === resolvedChunk) return reference.handler;\n reference = referencedChunk.value;\n if (null !== reference)\n for (\n referencedChunk = 0;\n referencedChunk < reference.length;\n referencedChunk++\n ) {\n var listener = reference[referencedChunk];\n if (\n \"function\" !== typeof listener &&\n ((listener = resolveBlockedCycle(resolvedChunk, listener)),\n null !== listener)\n )\n return listener;\n }\n return null;\n}\nfunction wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners) {\n switch (chunk.status) {\n case \"fulfilled\":\n wakeChunk(resolveListeners, chunk.value);\n break;\n case \"blocked\":\n for (var i = 0; i < resolveListeners.length; i++) {\n var listener = resolveListeners[i];\n if (\"function\" !== typeof listener) {\n var cyclicHandler = resolveBlockedCycle(chunk, listener);\n null !== cyclicHandler &&\n (fulfillReference(listener, cyclicHandler.value),\n resolveListeners.splice(i, 1),\n i--,\n null !== rejectListeners &&\n ((listener = rejectListeners.indexOf(listener)),\n -1 !== listener && rejectListeners.splice(listener, 1)));\n }\n }\n case \"pending\":\n if (chunk.value)\n for (i = 0; i < resolveListeners.length; i++)\n chunk.value.push(resolveListeners[i]);\n else chunk.value = resolveListeners;\n if (chunk.reason) {\n if (rejectListeners)\n for (\n resolveListeners = 0;\n resolveListeners < rejectListeners.length;\n resolveListeners++\n )\n chunk.reason.push(rejectListeners[resolveListeners]);\n } else chunk.reason = rejectListeners;\n break;\n case \"rejected\":\n rejectListeners && rejectChunk(rejectListeners, chunk.reason);\n }\n}\nfunction triggerErrorOnChunk(response, chunk, error) {\n \"pending\" !== chunk.status && \"blocked\" !== chunk.status\n ? chunk.reason.error(error)\n : ((response = chunk.reason),\n (chunk.status = \"rejected\"),\n (chunk.reason = error),\n null !== response && rejectChunk(response, error));\n}\nfunction createResolvedIteratorResultChunk(response, value, done) {\n return new ReactPromise(\n \"resolved_model\",\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\",\n response\n );\n}\nfunction resolveIteratorResultChunk(response, chunk, value, done) {\n resolveModelChunk(\n response,\n chunk,\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\"\n );\n}\nfunction resolveModelChunk(response, chunk, value) {\n if (\"pending\" !== chunk.status) chunk.reason.enqueueModel(value);\n else {\n var resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"resolved_model\";\n chunk.value = value;\n chunk.reason = response;\n null !== resolveListeners &&\n (initializeModelChunk(chunk),\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners));\n }\n}\nfunction resolveModuleChunk(response, chunk, value) {\n if (\"pending\" === chunk.status || \"blocked\" === chunk.status) {\n response = chunk.value;\n var rejectListeners = chunk.reason;\n chunk.status = \"resolved_module\";\n chunk.value = value;\n null !== response &&\n (initializeModuleChunk(chunk),\n wakeChunkIfInitialized(chunk, response, rejectListeners));\n }\n}\nvar initializingHandler = null;\nfunction initializeModelChunk(chunk) {\n var prevHandler = initializingHandler;\n initializingHandler = null;\n var resolvedModel = chunk.value,\n response = chunk.reason;\n chunk.status = \"blocked\";\n chunk.value = null;\n chunk.reason = null;\n try {\n var value = JSON.parse(resolvedModel, response._fromJSON),\n resolveListeners = chunk.value;\n if (null !== resolveListeners)\n for (\n chunk.value = null, chunk.reason = null, resolvedModel = 0;\n resolvedModel < resolveListeners.length;\n resolvedModel++\n ) {\n var listener = resolveListeners[resolvedModel];\n \"function\" === typeof listener\n ? listener(value)\n : fulfillReference(listener, value, chunk);\n }\n if (null !== initializingHandler) {\n if (initializingHandler.errored) throw initializingHandler.reason;\n if (0 < initializingHandler.deps) {\n initializingHandler.value = value;\n initializingHandler.chunk = chunk;\n return;\n }\n }\n chunk.status = \"fulfilled\";\n chunk.value = value;\n } catch (error) {\n (chunk.status = \"rejected\"), (chunk.reason = error);\n } finally {\n initializingHandler = prevHandler;\n }\n}\nfunction initializeModuleChunk(chunk) {\n try {\n var value = requireModule(chunk.value);\n chunk.status = \"fulfilled\";\n chunk.value = value;\n } catch (error) {\n (chunk.status = \"rejected\"), (chunk.reason = error);\n }\n}\nfunction reportGlobalError(weakResponse, error) {\n weakResponse._closed = !0;\n weakResponse._closedReason = error;\n weakResponse._chunks.forEach(function (chunk) {\n \"pending\" === chunk.status &&\n triggerErrorOnChunk(weakResponse, chunk, error);\n });\n}\nfunction createLazyChunkWrapper(chunk) {\n return { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk };\n}\nfunction getChunk(response, id) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk ||\n ((chunk = response._closed\n ? createErrorChunk(response, response._closedReason)\n : new ReactPromise(\"pending\", null, null)),\n chunks.set(id, chunk));\n return chunk;\n}\nfunction fulfillReference(reference, value) {\n for (\n var response = reference.response,\n handler = reference.handler,\n parentObject = reference.parentObject,\n key = reference.key,\n map = reference.map,\n path = reference.path,\n i = 1;\n i < path.length;\n i++\n ) {\n for (\n ;\n \"object\" === typeof value &&\n null !== value &&\n value.$$typeof === REACT_LAZY_TYPE;\n\n )\n if (((value = value._payload), value === handler.chunk))\n value = handler.value;\n else {\n switch (value.status) {\n case \"resolved_model\":\n initializeModelChunk(value);\n break;\n case \"resolved_module\":\n initializeModuleChunk(value);\n }\n switch (value.status) {\n case \"fulfilled\":\n value = value.value;\n continue;\n case \"blocked\":\n var cyclicHandler = resolveBlockedCycle(value, reference);\n if (null !== cyclicHandler) {\n value = cyclicHandler.value;\n continue;\n }\n case \"pending\":\n path.splice(0, i - 1);\n null === value.value\n ? (value.value = [reference])\n : value.value.push(reference);\n null === value.reason\n ? (value.reason = [reference])\n : value.reason.push(reference);\n return;\n case \"halted\":\n return;\n default:\n rejectReference(reference, value.reason);\n return;\n }\n }\n value = value[path[i]];\n }\n for (\n ;\n \"object\" === typeof value &&\n null !== value &&\n value.$$typeof === REACT_LAZY_TYPE;\n\n )\n if (((reference = value._payload), reference === handler.chunk))\n value = handler.value;\n else {\n switch (reference.status) {\n case \"resolved_model\":\n initializeModelChunk(reference);\n break;\n case \"resolved_module\":\n initializeModuleChunk(reference);\n }\n switch (reference.status) {\n case \"fulfilled\":\n value = reference.value;\n continue;\n }\n break;\n }\n response = map(response, value, parentObject, key);\n parentObject[key] = response;\n \"\" === key && null === handler.value && (handler.value = response);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n \"object\" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n )\n switch (((parentObject = handler.value), key)) {\n case \"3\":\n parentObject.props = response;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((key = handler.chunk),\n null !== key &&\n \"blocked\" === key.status &&\n ((parentObject = key.value),\n (key.status = \"fulfilled\"),\n (key.value = handler.value),\n (key.reason = handler.reason),\n null !== parentObject && wakeChunk(parentObject, handler.value)));\n}\nfunction rejectReference(reference, error) {\n var handler = reference.handler;\n reference = reference.response;\n handler.errored ||\n ((handler.errored = !0),\n (handler.value = null),\n (handler.reason = error),\n (handler = handler.chunk),\n null !== handler &&\n \"blocked\" === handler.status &&\n triggerErrorOnChunk(reference, handler, error));\n}\nfunction waitForReference(\n referencedChunk,\n parentObject,\n key,\n response,\n map,\n path\n) {\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: null,\n deps: 1,\n errored: !1\n };\n parentObject = {\n response: response,\n handler: handler,\n parentObject: parentObject,\n key: key,\n map: map,\n path: path\n };\n null === referencedChunk.value\n ? (referencedChunk.value = [parentObject])\n : referencedChunk.value.push(parentObject);\n null === referencedChunk.reason\n ? (referencedChunk.reason = [parentObject])\n : referencedChunk.reason.push(parentObject);\n return null;\n}\nfunction loadServerReference(response, metaData, parentObject, key) {\n if (!response._serverReferenceConfig)\n return createBoundServerReference(\n metaData,\n response._callServer,\n response._encodeFormAction\n );\n var serverReference = resolveServerReference(\n response._serverReferenceConfig,\n metaData.id\n ),\n promise = preloadModule(serverReference);\n if (promise)\n metaData.bound && (promise = Promise.all([promise, metaData.bound]));\n else if (metaData.bound) promise = Promise.resolve(metaData.bound);\n else\n return (\n (promise = requireModule(serverReference)),\n registerBoundServerReference(\n promise,\n metaData.id,\n metaData.bound,\n response._encodeFormAction\n ),\n promise\n );\n if (initializingHandler) {\n var handler = initializingHandler;\n handler.deps++;\n } else\n handler = initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: null,\n deps: 1,\n errored: !1\n };\n promise.then(\n function () {\n var resolvedValue = requireModule(serverReference);\n if (metaData.bound) {\n var boundArgs = metaData.bound.value.slice(0);\n boundArgs.unshift(null);\n resolvedValue = resolvedValue.bind.apply(resolvedValue, boundArgs);\n }\n registerBoundServerReference(\n resolvedValue,\n metaData.id,\n metaData.bound,\n response._encodeFormAction\n );\n parentObject[key] = resolvedValue;\n \"\" === key && null === handler.value && (handler.value = resolvedValue);\n if (\n parentObject[0] === REACT_ELEMENT_TYPE &&\n \"object\" === typeof handler.value &&\n null !== handler.value &&\n handler.value.$$typeof === REACT_ELEMENT_TYPE\n )\n switch (((boundArgs = handler.value), key)) {\n case \"3\":\n boundArgs.props = resolvedValue;\n }\n handler.deps--;\n 0 === handler.deps &&\n ((resolvedValue = handler.chunk),\n null !== resolvedValue &&\n \"blocked\" === resolvedValue.status &&\n ((boundArgs = resolvedValue.value),\n (resolvedValue.status = \"fulfilled\"),\n (resolvedValue.value = handler.value),\n null !== boundArgs && wakeChunk(boundArgs, handler.value)));\n },\n function (error) {\n if (!handler.errored) {\n handler.errored = !0;\n handler.value = null;\n handler.reason = error;\n var chunk = handler.chunk;\n null !== chunk &&\n \"blocked\" === chunk.status &&\n triggerErrorOnChunk(response, chunk, error);\n }\n }\n );\n return null;\n}\nfunction getOutlinedModel(response, reference, parentObject, key, map) {\n reference = reference.split(\":\");\n var id = parseInt(reference[0], 16);\n id = getChunk(response, id);\n switch (id.status) {\n case \"resolved_model\":\n initializeModelChunk(id);\n break;\n case \"resolved_module\":\n initializeModuleChunk(id);\n }\n switch (id.status) {\n case \"fulfilled\":\n id = id.value;\n for (var i = 1; i < reference.length; i++) {\n for (\n ;\n \"object\" === typeof id &&\n null !== id &&\n id.$$typeof === REACT_LAZY_TYPE;\n\n ) {\n id = id._payload;\n switch (id.status) {\n case \"resolved_model\":\n initializeModelChunk(id);\n break;\n case \"resolved_module\":\n initializeModuleChunk(id);\n }\n switch (id.status) {\n case \"fulfilled\":\n id = id.value;\n break;\n case \"blocked\":\n case \"pending\":\n return waitForReference(\n id,\n parentObject,\n key,\n response,\n map,\n reference.slice(i - 1)\n );\n case \"halted\":\n return (\n initializingHandler\n ? ((response = initializingHandler), response.deps++)\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: null,\n deps: 1,\n errored: !1\n }),\n null\n );\n default:\n return (\n initializingHandler\n ? ((initializingHandler.errored = !0),\n (initializingHandler.value = null),\n (initializingHandler.reason = id.reason))\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: id.reason,\n deps: 0,\n errored: !0\n }),\n null\n );\n }\n }\n id = id[reference[i]];\n }\n for (\n ;\n \"object\" === typeof id &&\n null !== id &&\n id.$$typeof === REACT_LAZY_TYPE;\n\n ) {\n reference = id._payload;\n switch (reference.status) {\n case \"resolved_model\":\n initializeModelChunk(reference);\n break;\n case \"resolved_module\":\n initializeModuleChunk(reference);\n }\n switch (reference.status) {\n case \"fulfilled\":\n id = reference.value;\n continue;\n }\n break;\n }\n return map(response, id, parentObject, key);\n case \"pending\":\n case \"blocked\":\n return waitForReference(id, parentObject, key, response, map, reference);\n case \"halted\":\n return (\n initializingHandler\n ? ((response = initializingHandler), response.deps++)\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: null,\n deps: 1,\n errored: !1\n }),\n null\n );\n default:\n return (\n initializingHandler\n ? ((initializingHandler.errored = !0),\n (initializingHandler.value = null),\n (initializingHandler.reason = id.reason))\n : (initializingHandler = {\n parent: null,\n chunk: null,\n value: null,\n reason: id.reason,\n deps: 0,\n errored: !0\n }),\n null\n );\n }\n}\nfunction createMap(response, model) {\n return new Map(model);\n}\nfunction createSet(response, model) {\n return new Set(model);\n}\nfunction createBlob(response, model) {\n return new Blob(model.slice(1), { type: model[0] });\n}\nfunction createFormData(response, model) {\n response = new FormData();\n for (var i = 0; i < model.length; i++)\n response.append(model[i][0], model[i][1]);\n return response;\n}\nfunction extractIterator(response, model) {\n return model[Symbol.iterator]();\n}\nfunction createModel(response, model) {\n return model;\n}\nfunction parseModelString(response, parentObject, key, value) {\n if (\"$\" === value[0]) {\n if (\"$\" === value)\n return (\n null !== initializingHandler &&\n \"0\" === key &&\n (initializingHandler = {\n parent: initializingHandler,\n chunk: null,\n value: null,\n reason: null,\n deps: 0,\n errored: !1\n }),\n REACT_ELEMENT_TYPE\n );\n switch (value[1]) {\n case \"$\":\n return value.slice(1);\n case \"L\":\n return (\n (parentObject = parseInt(value.slice(2), 16)),\n (response = getChunk(response, parentObject)),\n createLazyChunkWrapper(response)\n );\n case \"@\":\n return (\n (parentObject = parseInt(value.slice(2), 16)),\n getChunk(response, parentObject)\n );\n case \"S\":\n return Symbol.for(value.slice(2));\n case \"F\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(\n response,\n value,\n parentObject,\n key,\n loadServerReference\n )\n );\n case \"T\":\n parentObject = \"$\" + value.slice(2);\n response = response._tempRefs;\n if (null == response)\n throw Error(\n \"Missing a temporary reference set but the RSC response returned a temporary reference. Pass a temporaryReference option with the set that was used with the reply.\"\n );\n return response.get(parentObject);\n case \"Q\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createMap)\n );\n case \"W\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createSet)\n );\n case \"B\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createBlob)\n );\n case \"K\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, createFormData)\n );\n case \"Z\":\n return resolveErrorProd();\n case \"i\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, parentObject, key, extractIterator)\n );\n case \"I\":\n return Infinity;\n case \"-\":\n return \"$-0\" === value ? -0 : -Infinity;\n case \"N\":\n return NaN;\n case \"u\":\n return;\n case \"D\":\n return new Date(Date.parse(value.slice(2)));\n case \"n\":\n return BigInt(value.slice(2));\n default:\n return (\n (value = value.slice(1)),\n getOutlinedModel(response, value, parentObject, key, createModel)\n );\n }\n }\n return value;\n}\nfunction missingCall() {\n throw Error(\n 'Trying to call a function from \"use server\" but the callServer option was not implemented in your router runtime.'\n );\n}\nfunction ResponseInstance(\n bundlerConfig,\n serverReferenceConfig,\n moduleLoading,\n callServer,\n encodeFormAction,\n nonce,\n temporaryReferences\n) {\n var chunks = new Map();\n this._bundlerConfig = bundlerConfig;\n this._serverReferenceConfig = serverReferenceConfig;\n this._moduleLoading = moduleLoading;\n this._callServer = void 0 !== callServer ? callServer : missingCall;\n this._encodeFormAction = encodeFormAction;\n this._nonce = nonce;\n this._chunks = chunks;\n this._stringDecoder = new util.TextDecoder();\n this._fromJSON = null;\n this._closed = !1;\n this._closedReason = null;\n this._tempRefs = temporaryReferences;\n this._fromJSON = createFromJSONCallback(this);\n}\nfunction createStreamState() {\n return { _rowState: 0, _rowID: 0, _rowTag: 0, _rowLength: 0, _buffer: [] };\n}\nfunction resolveBuffer(response, id, buffer) {\n response = response._chunks;\n var chunk = response.get(id);\n chunk && \"pending\" !== chunk.status\n ? chunk.reason.enqueueValue(buffer)\n : ((buffer = new ReactPromise(\"fulfilled\", buffer, null)),\n response.set(id, buffer));\n}\nfunction resolveModule(response, id, model) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n model = JSON.parse(model, response._fromJSON);\n var clientReference = resolveClientReference(response._bundlerConfig, model);\n prepareDestinationWithChunks(\n response._moduleLoading,\n model[1],\n response._nonce\n );\n if ((model = preloadModule(clientReference))) {\n if (chunk) {\n var blockedChunk = chunk;\n blockedChunk.status = \"blocked\";\n } else\n (blockedChunk = new ReactPromise(\"blocked\", null, null)),\n chunks.set(id, blockedChunk);\n model.then(\n function () {\n return resolveModuleChunk(response, blockedChunk, clientReference);\n },\n function (error) {\n return triggerErrorOnChunk(response, blockedChunk, error);\n }\n );\n } else\n chunk\n ? resolveModuleChunk(response, chunk, clientReference)\n : ((chunk = new ReactPromise(\"resolved_module\", clientReference, null)),\n chunks.set(id, chunk));\n}\nfunction resolveStream(response, id, stream, controller) {\n response = response._chunks;\n var chunk = response.get(id);\n chunk\n ? \"pending\" === chunk.status &&\n ((id = chunk.value),\n (chunk.status = \"fulfilled\"),\n (chunk.value = stream),\n (chunk.reason = controller),\n null !== id && wakeChunk(id, chunk.value))\n : ((stream = new ReactPromise(\"fulfilled\", stream, controller)),\n response.set(id, stream));\n}\nfunction startReadableStream(response, id, type) {\n var controller = null;\n type = new ReadableStream({\n type: type,\n start: function (c) {\n controller = c;\n }\n });\n var previousBlockedChunk = null;\n resolveStream(response, id, type, {\n enqueueValue: function (value) {\n null === previousBlockedChunk\n ? controller.enqueue(value)\n : previousBlockedChunk.then(function () {\n controller.enqueue(value);\n });\n },\n enqueueModel: function (json) {\n if (null === previousBlockedChunk) {\n var chunk = new ReactPromise(\"resolved_model\", json, response);\n initializeModelChunk(chunk);\n \"fulfilled\" === chunk.status\n ? controller.enqueue(chunk.value)\n : (chunk.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n ),\n (previousBlockedChunk = chunk));\n } else {\n chunk = previousBlockedChunk;\n var chunk$54 = new ReactPromise(\"pending\", null, null);\n chunk$54.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n );\n previousBlockedChunk = chunk$54;\n chunk.then(function () {\n previousBlockedChunk === chunk$54 && (previousBlockedChunk = null);\n resolveModelChunk(response, chunk$54, json);\n });\n }\n },\n close: function () {\n if (null === previousBlockedChunk) controller.close();\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.close();\n });\n }\n },\n error: function (error) {\n if (null === previousBlockedChunk) controller.error(error);\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.error(error);\n });\n }\n }\n });\n}\nfunction asyncIterator() {\n return this;\n}\nfunction createIterator(next) {\n next = { next: next };\n next[ASYNC_ITERATOR] = asyncIterator;\n return next;\n}\nfunction startAsyncIterable(response, id, iterator) {\n var buffer = [],\n closed = !1,\n nextWriteIndex = 0,\n iterable = {};\n iterable[ASYNC_ITERATOR] = function () {\n var nextReadIndex = 0;\n return createIterator(function (arg) {\n if (void 0 !== arg)\n throw Error(\n \"Values cannot be passed to next() of AsyncIterables passed to Client Components.\"\n );\n if (nextReadIndex === buffer.length) {\n if (closed)\n return new ReactPromise(\n \"fulfilled\",\n { done: !0, value: void 0 },\n null\n );\n buffer[nextReadIndex] = new ReactPromise(\"pending\", null, null);\n }\n return buffer[nextReadIndex++];\n });\n };\n resolveStream(\n response,\n id,\n iterator ? iterable[ASYNC_ITERATOR]() : iterable,\n {\n enqueueValue: function (value) {\n if (nextWriteIndex === buffer.length)\n buffer[nextWriteIndex] = new ReactPromise(\n \"fulfilled\",\n { done: !1, value: value },\n null\n );\n else {\n var chunk = buffer[nextWriteIndex],\n resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"fulfilled\";\n chunk.value = { done: !1, value: value };\n null !== resolveListeners &&\n wakeChunkIfInitialized(chunk, resolveListeners, rejectListeners);\n }\n nextWriteIndex++;\n },\n enqueueModel: function (value) {\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !1\n ))\n : resolveIteratorResultChunk(\n response,\n buffer[nextWriteIndex],\n value,\n !1\n );\n nextWriteIndex++;\n },\n close: function (value) {\n closed = !0;\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !0\n ))\n : resolveIteratorResultChunk(\n response,\n buffer[nextWriteIndex],\n value,\n !0\n );\n for (nextWriteIndex++; nextWriteIndex < buffer.length; )\n resolveIteratorResultChunk(\n response,\n buffer[nextWriteIndex++],\n '\"$undefined\"',\n !0\n );\n },\n error: function (error) {\n closed = !0;\n for (\n nextWriteIndex === buffer.length &&\n (buffer[nextWriteIndex] = new ReactPromise(\"pending\", null, null));\n nextWriteIndex < buffer.length;\n\n )\n triggerErrorOnChunk(response, buffer[nextWriteIndex++], error);\n }\n }\n );\n}\nfunction resolveErrorProd() {\n var error = Error(\n \"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.\"\n );\n error.stack = \"Error: \" + error.message;\n return error;\n}\nfunction mergeBuffer(buffer, lastChunk) {\n for (var l = buffer.length, byteLength = lastChunk.length, i = 0; i < l; i++)\n byteLength += buffer[i].byteLength;\n byteLength = new Uint8Array(byteLength);\n for (var i$55 = (i = 0); i$55 < l; i$55++) {\n var chunk = buffer[i$55];\n byteLength.set(chunk, i);\n i += chunk.byteLength;\n }\n byteLength.set(lastChunk, i);\n return byteLength;\n}\nfunction resolveTypedArray(\n response,\n id,\n buffer,\n lastChunk,\n constructor,\n bytesPerElement\n) {\n buffer =\n 0 === buffer.length && 0 === lastChunk.byteOffset % bytesPerElement\n ? lastChunk\n : mergeBuffer(buffer, lastChunk);\n constructor = new constructor(\n buffer.buffer,\n buffer.byteOffset,\n buffer.byteLength / bytesPerElement\n );\n resolveBuffer(response, id, constructor);\n}\nfunction processFullBinaryRow(response, streamState, id, tag, buffer, chunk) {\n switch (tag) {\n case 65:\n resolveBuffer(response, id, mergeBuffer(buffer, chunk).buffer);\n return;\n case 79:\n resolveTypedArray(response, id, buffer, chunk, Int8Array, 1);\n return;\n case 111:\n resolveBuffer(\n response,\n id,\n 0 === buffer.length ? chunk : mergeBuffer(buffer, chunk)\n );\n return;\n case 85:\n resolveTypedArray(response, id, buffer, chunk, Uint8ClampedArray, 1);\n return;\n case 83:\n resolveTypedArray(response, id, buffer, chunk, Int16Array, 2);\n return;\n case 115:\n resolveTypedArray(response, id, buffer, chunk, Uint16Array, 2);\n return;\n case 76:\n resolveTypedArray(response, id, buffer, chunk, Int32Array, 4);\n return;\n case 108:\n resolveTypedArray(response, id, buffer, chunk, Uint32Array, 4);\n return;\n case 71:\n resolveTypedArray(response, id, buffer, chunk, Float32Array, 4);\n return;\n case 103:\n resolveTypedArray(response, id, buffer, chunk, Float64Array, 8);\n return;\n case 77:\n resolveTypedArray(response, id, buffer, chunk, BigInt64Array, 8);\n return;\n case 109:\n resolveTypedArray(response, id, buffer, chunk, BigUint64Array, 8);\n return;\n case 86:\n resolveTypedArray(response, id, buffer, chunk, DataView, 1);\n return;\n }\n for (\n var stringDecoder = response._stringDecoder, row = \"\", i = 0;\n i < buffer.length;\n i++\n )\n row += stringDecoder.decode(buffer[i], decoderOptions);\n row += stringDecoder.decode(chunk);\n processFullStringRow(response, streamState, id, tag, row);\n}\nfunction processFullStringRow(response, streamState, id, tag, row) {\n switch (tag) {\n case 73:\n resolveModule(response, id, row);\n break;\n case 72:\n id = row[0];\n row = row.slice(1);\n response = JSON.parse(row, response._fromJSON);\n row = ReactDOMSharedInternals.d;\n switch (id) {\n case \"D\":\n row.D(response);\n break;\n case \"C\":\n \"string\" === typeof response\n ? row.C(response)\n : row.C(response[0], response[1]);\n break;\n case \"L\":\n id = response[0];\n streamState = response[1];\n 3 === response.length\n ? row.L(id, streamState, response[2])\n : row.L(id, streamState);\n break;\n case \"m\":\n \"string\" === typeof response\n ? row.m(response)\n : row.m(response[0], response[1]);\n break;\n case \"X\":\n \"string\" === typeof response\n ? row.X(response)\n : row.X(response[0], response[1]);\n break;\n case \"S\":\n \"string\" === typeof response\n ? row.S(response)\n : row.S(\n response[0],\n 0 === response[1] ? void 0 : response[1],\n 3 === response.length ? response[2] : void 0\n );\n break;\n case \"M\":\n \"string\" === typeof response\n ? row.M(response)\n : row.M(response[0], response[1]);\n }\n break;\n case 69:\n streamState = response._chunks;\n tag = streamState.get(id);\n row = JSON.parse(row);\n var error = resolveErrorProd();\n error.digest = row.digest;\n tag\n ? triggerErrorOnChunk(response, tag, error)\n : ((response = createErrorChunk(response, error)),\n streamState.set(id, response));\n break;\n case 84:\n response = response._chunks;\n (streamState = response.get(id)) && \"pending\" !== streamState.status\n ? streamState.reason.enqueueValue(row)\n : ((row = new ReactPromise(\"fulfilled\", row, null)),\n response.set(id, row));\n break;\n case 78:\n case 68:\n case 74:\n case 87:\n throw Error(\n \"Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client.\"\n );\n case 82:\n startReadableStream(response, id, void 0);\n break;\n case 114:\n startReadableStream(response, id, \"bytes\");\n break;\n case 88:\n startAsyncIterable(response, id, !1);\n break;\n case 120:\n startAsyncIterable(response, id, !0);\n break;\n case 67:\n (id = response._chunks.get(id)) &&\n \"fulfilled\" === id.status &&\n id.reason.close(\"\" === row ? '\"$undefined\"' : row);\n break;\n case 80:\n streamState = Error(\n \"A Server Component was postponed. The reason is omitted in production builds to avoid leaking sensitive details.\"\n );\n streamState.$$typeof = REACT_POSTPONE_TYPE;\n streamState.stack = \"Error: \" + streamState.message;\n row = response._chunks;\n (tag = row.get(id))\n ? triggerErrorOnChunk(response, tag, streamState)\n : ((response = createErrorChunk(response, streamState)),\n row.set(id, response));\n break;\n default:\n (streamState = response._chunks),\n (tag = streamState.get(id))\n ? resolveModelChunk(response, tag, row)\n : ((response = new ReactPromise(\"resolved_model\", row, response)),\n streamState.set(id, response));\n }\n}\nfunction processBinaryChunk(weakResponse, streamState, chunk) {\n for (\n var i = 0,\n rowState = streamState._rowState,\n rowID = streamState._rowID,\n rowTag = streamState._rowTag,\n rowLength = streamState._rowLength,\n buffer = streamState._buffer,\n chunkLength = chunk.length;\n i < chunkLength;\n\n ) {\n var lastIdx = -1;\n switch (rowState) {\n case 0:\n lastIdx = chunk[i++];\n 58 === lastIdx\n ? (rowState = 1)\n : (rowID =\n (rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 1:\n rowState = chunk[i];\n 84 === rowState ||\n 65 === rowState ||\n 79 === rowState ||\n 111 === rowState ||\n 85 === rowState ||\n 83 === rowState ||\n 115 === rowState ||\n 76 === rowState ||\n 108 === rowState ||\n 71 === rowState ||\n 103 === rowState ||\n 77 === rowState ||\n 109 === rowState ||\n 86 === rowState\n ? ((rowTag = rowState), (rowState = 2), i++)\n : (64 < rowState && 91 > rowState) ||\n 35 === rowState ||\n 114 === rowState ||\n 120 === rowState\n ? ((rowTag = rowState), (rowState = 3), i++)\n : ((rowTag = 0), (rowState = 3));\n continue;\n case 2:\n lastIdx = chunk[i++];\n 44 === lastIdx\n ? (rowState = 4)\n : (rowLength =\n (rowLength << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 3:\n lastIdx = chunk.indexOf(10, i);\n break;\n case 4:\n (lastIdx = i + rowLength), lastIdx > chunk.length && (lastIdx = -1);\n }\n var offset = chunk.byteOffset + i;\n if (-1 < lastIdx)\n (rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i)),\n processFullBinaryRow(\n weakResponse,\n streamState,\n rowID,\n rowTag,\n buffer,\n rowLength\n ),\n (i = lastIdx),\n 3 === rowState && i++,\n (rowLength = rowID = rowTag = rowState = 0),\n (buffer.length = 0);\n else {\n weakResponse = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);\n buffer.push(weakResponse);\n rowLength -= weakResponse.byteLength;\n break;\n }\n }\n streamState._rowState = rowState;\n streamState._rowID = rowID;\n streamState._rowTag = rowTag;\n streamState._rowLength = rowLength;\n}\nfunction createFromJSONCallback(response) {\n return function (key, value) {\n if (\"string\" === typeof value)\n return parseModelString(response, this, key, value);\n if (\"object\" === typeof value && null !== value) {\n if (value[0] === REACT_ELEMENT_TYPE) {\n if (\n ((key = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: value[1],\n key: value[2],\n ref: null,\n props: value[3]\n }),\n null !== initializingHandler)\n )\n if (\n ((value = initializingHandler),\n (initializingHandler = value.parent),\n value.errored)\n )\n (key = createErrorChunk(response, value.reason)),\n (key = createLazyChunkWrapper(key));\n else if (0 < value.deps) {\n var blockedChunk = new ReactPromise(\"blocked\", null, null);\n value.value = key;\n value.chunk = blockedChunk;\n key = createLazyChunkWrapper(blockedChunk);\n }\n } else key = value;\n return key;\n }\n return value;\n };\n}\nfunction close(weakResponse) {\n reportGlobalError(weakResponse, Error(\"Connection closed.\"));\n}\nfunction noServerCall$1() {\n throw Error(\n \"Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead.\"\n );\n}\nfunction createResponseFromOptions(options) {\n return new ResponseInstance(\n options.serverConsumerManifest.moduleMap,\n options.serverConsumerManifest.serverModuleMap,\n options.serverConsumerManifest.moduleLoading,\n noServerCall$1,\n options.encodeFormAction,\n \"string\" === typeof options.nonce ? options.nonce : void 0,\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0\n );\n}\nfunction startReadingFromStream$1(response, stream, onDone) {\n function progress(_ref) {\n var value = _ref.value;\n if (_ref.done) return onDone();\n processBinaryChunk(response, streamState, value);\n return reader.read().then(progress).catch(error);\n }\n function error(e) {\n reportGlobalError(response, e);\n }\n var streamState = createStreamState(),\n reader = stream.getReader();\n reader.read().then(progress).catch(error);\n}\nfunction noServerCall() {\n throw Error(\n \"Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead.\"\n );\n}\nfunction startReadingFromStream(response, stream, onEnd) {\n var streamState = createStreamState();\n stream.on(\"data\", function (chunk) {\n if (\"string\" === typeof chunk) {\n for (\n var i = 0,\n rowState = streamState._rowState,\n rowID = streamState._rowID,\n rowTag = streamState._rowTag,\n rowLength = streamState._rowLength,\n buffer = streamState._buffer,\n chunkLength = chunk.length;\n i < chunkLength;\n\n ) {\n var lastIdx = -1;\n switch (rowState) {\n case 0:\n lastIdx = chunk.charCodeAt(i++);\n 58 === lastIdx\n ? (rowState = 1)\n : (rowID =\n (rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 1:\n rowState = chunk.charCodeAt(i);\n 84 === rowState ||\n 65 === rowState ||\n 79 === rowState ||\n 111 === rowState ||\n 85 === rowState ||\n 83 === rowState ||\n 115 === rowState ||\n 76 === rowState ||\n 108 === rowState ||\n 71 === rowState ||\n 103 === rowState ||\n 77 === rowState ||\n 109 === rowState ||\n 86 === rowState\n ? ((rowTag = rowState), (rowState = 2), i++)\n : (64 < rowState && 91 > rowState) ||\n 114 === rowState ||\n 120 === rowState\n ? ((rowTag = rowState), (rowState = 3), i++)\n : ((rowTag = 0), (rowState = 3));\n continue;\n case 2:\n lastIdx = chunk.charCodeAt(i++);\n 44 === lastIdx\n ? (rowState = 4)\n : (rowLength =\n (rowLength << 4) |\n (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));\n continue;\n case 3:\n lastIdx = chunk.indexOf(\"\\n\", i);\n break;\n case 4:\n if (84 !== rowTag)\n throw Error(\n \"Binary RSC chunks cannot be encoded as strings. This is a bug in the wiring of the React streams.\"\n );\n if (rowLength < chunk.length || chunk.length > 3 * rowLength)\n throw Error(\n \"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams.\"\n );\n lastIdx = chunk.length;\n }\n if (-1 < lastIdx) {\n if (0 < buffer.length)\n throw Error(\n \"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams.\"\n );\n i = chunk.slice(i, lastIdx);\n processFullStringRow(response, streamState, rowID, rowTag, i);\n i = lastIdx;\n 3 === rowState && i++;\n rowLength = rowID = rowTag = rowState = 0;\n buffer.length = 0;\n } else if (chunk.length !== i)\n throw Error(\n \"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams.\"\n );\n }\n streamState._rowState = rowState;\n streamState._rowID = rowID;\n streamState._rowTag = rowTag;\n streamState._rowLength = rowLength;\n } else processBinaryChunk(response, streamState, chunk);\n });\n stream.on(\"error\", function (error) {\n reportGlobalError(response, error);\n });\n stream.on(\"end\", onEnd);\n}\nexports.createFromFetch = function (promiseForResponse, options) {\n var response = createResponseFromOptions(options);\n promiseForResponse.then(\n function (r) {\n startReadingFromStream$1(response, r.body, close.bind(null, response));\n },\n function (e) {\n reportGlobalError(response, e);\n }\n );\n return getChunk(response, 0);\n};\nexports.createFromNodeStream = function (\n stream,\n serverConsumerManifest,\n options\n) {\n serverConsumerManifest = new ResponseInstance(\n serverConsumerManifest.moduleMap,\n serverConsumerManifest.serverModuleMap,\n serverConsumerManifest.moduleLoading,\n noServerCall,\n options ? options.encodeFormAction : void 0,\n options && \"string\" === typeof options.nonce ? options.nonce : void 0,\n void 0\n );\n startReadingFromStream(\n serverConsumerManifest,\n stream,\n close.bind(null, serverConsumerManifest)\n );\n return getChunk(serverConsumerManifest, 0);\n};\nexports.createFromReadableStream = function (stream, options) {\n options = createResponseFromOptions(options);\n startReadingFromStream$1(options, stream, close.bind(null, options));\n return getChunk(options, 0);\n};\nexports.createServerReference = function (id) {\n return createServerReference$1(id, noServerCall$1);\n};\nexports.createTemporaryReferenceSet = function () {\n return new Map();\n};\nexports.encodeReply = function (value, options) {\n return new Promise(function (resolve, reject) {\n var abort = processReply(\n value,\n \"\",\n options && options.temporaryReferences\n ? options.temporaryReferences\n : void 0,\n resolve,\n reject\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(signal.reason);\n else {\n var listener = function () {\n abort(signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n });\n};\nexports.registerServerReference = function (reference, id, encodeFormAction) {\n registerBoundServerReference(reference, id, null, encodeFormAction);\n return reference;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-server-dom-webpack-client.node.production.js');\n} else {\n module.exports = require('./cjs/react-server-dom-webpack-client.node.development.js');\n}\n","(function(){\"use strict\";var e={879:function(e,t){const{hasOwnProperty:n}=Object.prototype;const r=configure();r.configure=configure;r.stringify=r;r.default=r;t.stringify=r;t.configure=configure;e.exports=r;const i=/[\\u0000-\\u001f\\u0022\\u005c\\ud800-\\udfff]/;function strEscape(e){if(e.length<5e3&&!i.test(e)){return`\"${e}\"`}return JSON.stringify(e)}function sort(e,t){if(e.length>200||t){return e.sort(t)}for(let t=1;t<e.length;t++){const n=e[t];let r=t;while(r!==0&&e[r-1]>n){e[r]=e[r-1];r--}e[r]=n}return e}const f=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function isTypedArrayWithEntries(e){return f.call(e)!==undefined&&e.length!==0}function stringifyTypedArray(e,t,n){if(e.length<n){n=e.length}const r=t===\",\"?\"\":\" \";let i=`\"0\":${r}${e[0]}`;for(let f=1;f<n;f++){i+=`${t}\"${f}\":${r}${e[f]}`}return i}function getCircularValueOption(e){if(n.call(e,\"circularValue\")){const t=e.circularValue;if(typeof t===\"string\"){return`\"${t}\"`}if(t==null){return t}if(t===Error||t===TypeError){return{toString(){throw new TypeError(\"Converting circular structure to JSON\")}}}throw new TypeError('The \"circularValue\" argument must be of type string or the value null or undefined')}return'\"[Circular]\"'}function getDeterministicOption(e){let t;if(n.call(e,\"deterministic\")){t=e.deterministic;if(typeof t!==\"boolean\"&&typeof t!==\"function\"){throw new TypeError('The \"deterministic\" argument must be of type boolean or comparator function')}}return t===undefined?true:t}function getBooleanOption(e,t){let r;if(n.call(e,t)){r=e[t];if(typeof r!==\"boolean\"){throw new TypeError(`The \"${t}\" argument must be of type boolean`)}}return r===undefined?true:r}function getPositiveIntegerOption(e,t){let r;if(n.call(e,t)){r=e[t];if(typeof r!==\"number\"){throw new TypeError(`The \"${t}\" argument must be of type number`)}if(!Number.isInteger(r)){throw new TypeError(`The \"${t}\" argument must be an integer`)}if(r<1){throw new RangeError(`The \"${t}\" argument must be >= 1`)}}return r===undefined?Infinity:r}function getItemCount(e){if(e===1){return\"1 item\"}return`${e} items`}function getUniqueReplacerSet(e){const t=new Set;for(const n of e){if(typeof n===\"string\"||typeof n===\"number\"){t.add(String(n))}}return t}function getStrictOption(e){if(n.call(e,\"strict\")){const t=e.strict;if(typeof t!==\"boolean\"){throw new TypeError('The \"strict\" argument must be of type boolean')}if(t){return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;if(typeof e!==\"function\")t+=` (${e.toString()})`;throw new Error(t)}}}}function configure(e){e={...e};const t=getStrictOption(e);if(t){if(e.bigint===undefined){e.bigint=false}if(!(\"circularValue\"in e)){e.circularValue=Error}}const n=getCircularValueOption(e);const r=getBooleanOption(e,\"bigint\");const i=getDeterministicOption(e);const f=typeof i===\"function\"?i:undefined;const u=getPositiveIntegerOption(e,\"maximumDepth\");const o=getPositiveIntegerOption(e,\"maximumBreadth\");function stringifyFnReplacer(e,s,l,c,a,g){let p=s[e];if(typeof p===\"object\"&&p!==null&&typeof p.toJSON===\"function\"){p=p.toJSON(e)}p=c.call(s,e,p);switch(typeof p){case\"string\":return strEscape(p);case\"object\":{if(p===null){return\"null\"}if(l.indexOf(p)!==-1){return n}let e=\"\";let t=\",\";const r=g;if(Array.isArray(p)){if(p.length===0){return\"[]\"}if(u<l.length+1){return'\"[Array]\"'}l.push(p);if(a!==\"\"){g+=a;e+=`\\n${g}`;t=`,\\n${g}`}const n=Math.min(p.length,o);let i=0;for(;i<n-1;i++){const n=stringifyFnReplacer(String(i),p,l,c,a,g);e+=n!==undefined?n:\"null\";e+=t}const f=stringifyFnReplacer(String(i),p,l,c,a,g);e+=f!==undefined?f:\"null\";if(p.length-1>o){const n=p.length-o-1;e+=`${t}\"... ${getItemCount(n)} not stringified\"`}if(a!==\"\"){e+=`\\n${r}`}l.pop();return`[${e}]`}let s=Object.keys(p);const y=s.length;if(y===0){return\"{}\"}if(u<l.length+1){return'\"[Object]\"'}let d=\"\";let h=\"\";if(a!==\"\"){g+=a;t=`,\\n${g}`;d=\" \"}const $=Math.min(y,o);if(i&&!isTypedArrayWithEntries(p)){s=sort(s,f)}l.push(p);for(let n=0;n<$;n++){const r=s[n];const i=stringifyFnReplacer(r,p,l,c,a,g);if(i!==undefined){e+=`${h}${strEscape(r)}:${d}${i}`;h=t}}if(y>o){const n=y-o;e+=`${h}\"...\":${d}\"${getItemCount(n)} not stringified\"`;h=t}if(a!==\"\"&&h.length>1){e=`\\n${g}${e}\\n${r}`}l.pop();return`{${e}}`}case\"number\":return isFinite(p)?String(p):t?t(p):\"null\";case\"boolean\":return p===true?\"true\":\"false\";case\"undefined\":return undefined;case\"bigint\":if(r){return String(p)}default:return t?t(p):undefined}}function stringifyArrayReplacer(e,i,f,s,l,c){if(typeof i===\"object\"&&i!==null&&typeof i.toJSON===\"function\"){i=i.toJSON(e)}switch(typeof i){case\"string\":return strEscape(i);case\"object\":{if(i===null){return\"null\"}if(f.indexOf(i)!==-1){return n}const e=c;let t=\"\";let r=\",\";if(Array.isArray(i)){if(i.length===0){return\"[]\"}if(u<f.length+1){return'\"[Array]\"'}f.push(i);if(l!==\"\"){c+=l;t+=`\\n${c}`;r=`,\\n${c}`}const n=Math.min(i.length,o);let a=0;for(;a<n-1;a++){const e=stringifyArrayReplacer(String(a),i[a],f,s,l,c);t+=e!==undefined?e:\"null\";t+=r}const g=stringifyArrayReplacer(String(a),i[a],f,s,l,c);t+=g!==undefined?g:\"null\";if(i.length-1>o){const e=i.length-o-1;t+=`${r}\"... ${getItemCount(e)} not stringified\"`}if(l!==\"\"){t+=`\\n${e}`}f.pop();return`[${t}]`}f.push(i);let a=\"\";if(l!==\"\"){c+=l;r=`,\\n${c}`;a=\" \"}let g=\"\";for(const e of s){const n=stringifyArrayReplacer(e,i[e],f,s,l,c);if(n!==undefined){t+=`${g}${strEscape(e)}:${a}${n}`;g=r}}if(l!==\"\"&&g.length>1){t=`\\n${c}${t}\\n${e}`}f.pop();return`{${t}}`}case\"number\":return isFinite(i)?String(i):t?t(i):\"null\";case\"boolean\":return i===true?\"true\":\"false\";case\"undefined\":return undefined;case\"bigint\":if(r){return String(i)}default:return t?t(i):undefined}}function stringifyIndent(e,s,l,c,a){switch(typeof s){case\"string\":return strEscape(s);case\"object\":{if(s===null){return\"null\"}if(typeof s.toJSON===\"function\"){s=s.toJSON(e);if(typeof s!==\"object\"){return stringifyIndent(e,s,l,c,a)}if(s===null){return\"null\"}}if(l.indexOf(s)!==-1){return n}const t=a;if(Array.isArray(s)){if(s.length===0){return\"[]\"}if(u<l.length+1){return'\"[Array]\"'}l.push(s);a+=c;let e=`\\n${a}`;const n=`,\\n${a}`;const r=Math.min(s.length,o);let i=0;for(;i<r-1;i++){const t=stringifyIndent(String(i),s[i],l,c,a);e+=t!==undefined?t:\"null\";e+=n}const f=stringifyIndent(String(i),s[i],l,c,a);e+=f!==undefined?f:\"null\";if(s.length-1>o){const t=s.length-o-1;e+=`${n}\"... ${getItemCount(t)} not stringified\"`}e+=`\\n${t}`;l.pop();return`[${e}]`}let r=Object.keys(s);const g=r.length;if(g===0){return\"{}\"}if(u<l.length+1){return'\"[Object]\"'}a+=c;const p=`,\\n${a}`;let y=\"\";let d=\"\";let h=Math.min(g,o);if(isTypedArrayWithEntries(s)){y+=stringifyTypedArray(s,p,o);r=r.slice(s.length);h-=s.length;d=p}if(i){r=sort(r,f)}l.push(s);for(let e=0;e<h;e++){const t=r[e];const n=stringifyIndent(t,s[t],l,c,a);if(n!==undefined){y+=`${d}${strEscape(t)}: ${n}`;d=p}}if(g>o){const e=g-o;y+=`${d}\"...\": \"${getItemCount(e)} not stringified\"`;d=p}if(d!==\"\"){y=`\\n${a}${y}\\n${t}`}l.pop();return`{${y}}`}case\"number\":return isFinite(s)?String(s):t?t(s):\"null\";case\"boolean\":return s===true?\"true\":\"false\";case\"undefined\":return undefined;case\"bigint\":if(r){return String(s)}default:return t?t(s):undefined}}function stringifySimple(e,s,l){switch(typeof s){case\"string\":return strEscape(s);case\"object\":{if(s===null){return\"null\"}if(typeof s.toJSON===\"function\"){s=s.toJSON(e);if(typeof s!==\"object\"){return stringifySimple(e,s,l)}if(s===null){return\"null\"}}if(l.indexOf(s)!==-1){return n}let t=\"\";const r=s.length!==undefined;if(r&&Array.isArray(s)){if(s.length===0){return\"[]\"}if(u<l.length+1){return'\"[Array]\"'}l.push(s);const e=Math.min(s.length,o);let n=0;for(;n<e-1;n++){const e=stringifySimple(String(n),s[n],l);t+=e!==undefined?e:\"null\";t+=\",\"}const r=stringifySimple(String(n),s[n],l);t+=r!==undefined?r:\"null\";if(s.length-1>o){const e=s.length-o-1;t+=`,\"... ${getItemCount(e)} not stringified\"`}l.pop();return`[${t}]`}let c=Object.keys(s);const a=c.length;if(a===0){return\"{}\"}if(u<l.length+1){return'\"[Object]\"'}let g=\"\";let p=Math.min(a,o);if(r&&isTypedArrayWithEntries(s)){t+=stringifyTypedArray(s,\",\",o);c=c.slice(s.length);p-=s.length;g=\",\"}if(i){c=sort(c,f)}l.push(s);for(let e=0;e<p;e++){const n=c[e];const r=stringifySimple(n,s[n],l);if(r!==undefined){t+=`${g}${strEscape(n)}:${r}`;g=\",\"}}if(a>o){const e=a-o;t+=`${g}\"...\":\"${getItemCount(e)} not stringified\"`}l.pop();return`{${t}}`}case\"number\":return isFinite(s)?String(s):t?t(s):\"null\";case\"boolean\":return s===true?\"true\":\"false\";case\"undefined\":return undefined;case\"bigint\":if(r){return String(s)}default:return t?t(s):undefined}}function stringify(e,t,n){if(arguments.length>1){let r=\"\";if(typeof n===\"number\"){r=\" \".repeat(Math.min(n,10))}else if(typeof n===\"string\"){r=n.slice(0,10)}if(t!=null){if(typeof t===\"function\"){return stringifyFnReplacer(\"\",{\"\":e},[],t,r,\"\")}if(Array.isArray(t)){return stringifyArrayReplacer(\"\",e,[],getUniqueReplacerSet(t),r,\"\")}}if(r.length!==0){return stringifyIndent(\"\",e,[],r,\"\")}}return stringifySimple(\"\",e,[])}return stringify}}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var i=t[n]={exports:{}};var f=true;try{e[n](i,i.exports,__nccwpck_require__);f=false}finally{if(f)delete t[n]}return i.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var n=__nccwpck_require__(879);module.exports=n})();","(()=>{\"use strict\";var e={328:e=>{function hash(e){var r=5381,_=e.length;while(_){r=r*33^e.charCodeAt(--_)}return r>>>0}e.exports=hash}};var r={};function __nccwpck_require__(_){var a=r[_];if(a!==undefined){return a.exports}var t=r[_]={exports:{}};var i=true;try{e[_](t,t.exports,__nccwpck_require__);i=false}finally{if(i)delete r[_]}return t.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var _=__nccwpck_require__(328);module.exports=_})();","import { addPathPrefix } from '../shared/lib/router/utils/add-path-prefix'\nimport { normalizePathTrailingSlash } from './normalize-trailing-slash'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function addBasePath(path: string, required?: boolean): string {\n return normalizePathTrailingSlash(\n process.env.__NEXT_MANUAL_CLIENT_BASE_PATH && !required\n ? path\n : addPathPrefix(path, basePath)\n )\n}\n","import { removeTrailingSlash } from '../shared/lib/router/utils/remove-trailing-slash'\nimport { parsePath } from '../shared/lib/router/utils/parse-path'\n\n/**\n * Normalizes the trailing slash of a path according to the `trailingSlash` option\n * in `next.config.js`.\n */\nexport const normalizePathTrailingSlash = (path: string) => {\n if (!path.startsWith('/') || process.env.__NEXT_MANUAL_TRAILING_SLASH) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n if (process.env.__NEXT_TRAILING_SLASH) {\n if (/\\.[^/]+\\/?$/.test(pathname)) {\n return `${removeTrailingSlash(pathname)}${query}${hash}`\n } else if (pathname.endsWith('/')) {\n return `${pathname}${query}${hash}`\n } else {\n return `${pathname}/${query}${hash}`\n }\n }\n\n return `${removeTrailingSlash(pathname)}${query}${hash}`\n}\n","// This gets assigned as a side-effect during app initialization. Because it\n// represents the build used to create the JS bundle, it should never change\n// after being set, so we store it in a global variable.\n//\n// When performing RSC requests, if the incoming data has a different build ID,\n// we perform an MPA navigation/refresh to load the updated build and ensure\n// that the client and server in sync.\n\n// Starts as an empty string. In practice, because setAppBuildId is called\n// during initialization before hydration starts, this will always get\n// reassigned to the actual build ID before it's ever needed by a navigation.\n// If for some reasons it didn't, due to a bug or race condition, then on\n// navigation the build comparision would fail and trigger an MPA navigation.\nlet globalBuildId: string = ''\n\nexport function setAppBuildId(buildId: string) {\n globalBuildId = buildId\n}\n\nexport function getAppBuildId(): string {\n return globalBuildId\n}\n","import { startTransition } from 'react'\nimport { ACTION_SERVER_ACTION } from './components/router-reducer/router-reducer-types'\nimport { dispatchAppRouterAction } from './components/use-action-queue'\n\nexport async function callServer(actionId: string, actionArgs: any[]) {\n return new Promise((resolve, reject) => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_SERVER_ACTION,\n actionId,\n actionArgs,\n resolve,\n reject,\n })\n })\n })\n}\n","const basePath = process.env.__NEXT_ROUTER_BASEPATH || ''\nconst pathname = `${basePath}/__nextjs_source-map`\n\nexport const findSourceMapURL =\n process.env.NODE_ENV === 'development'\n ? function findSourceMapURL(filename: string): string | null {\n if (filename === '') {\n return null\n }\n\n if (\n filename.startsWith(document.location.origin) &&\n filename.includes('/_next/static')\n ) {\n // This is a request for a client chunk. This can only happen when\n // using Turbopack. In this case, since we control how those source\n // maps are generated, we can safely assume that the sourceMappingURL\n // is relative to the filename, with an added `.map` extension. The\n // browser can just request this file, and it gets served through the\n // normal dev server, without the need to route this through\n // the `/__nextjs_source-map` dev middleware.\n return `${filename}.map`\n }\n\n const url = new URL(pathname, document.location.origin)\n url.searchParams.set('filename', filename)\n\n return url.href\n }\n : undefined\n","export const RSC_HEADER = 'rsc' as const\nexport const ACTION_HEADER = 'next-action' as const\n// TODO: Instead of sending the full router state, we only need to send the\n// segment path. Saves bytes. Then we could also use this field for segment\n// prefetches, which also need to specify a particular segment.\nexport const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree' as const\nexport const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch' as const\n// This contains the path to the segment being prefetched.\n// TODO: If we change next-router-state-tree to be a segment path, we can use\n// that instead. Then next-router-prefetch and next-router-segment-prefetch can\n// be merged into a single enum.\nexport const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER =\n 'next-router-segment-prefetch' as const\nexport const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh' as const\nexport const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__' as const\nexport const NEXT_URL = 'next-url' as const\nexport const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const\n\nexport const FLIGHT_HEADERS = [\n RSC_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n] as const\n\nexport const NEXT_RSC_UNION_QUERY = '_rsc' as const\n\nexport const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time' as const\nexport const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed' as const\nexport const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path' as const\nexport const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query' as const\nexport const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender' as const\nexport const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found' as const\nexport const NEXT_REQUEST_ID_HEADER = 'x-nextjs-request-id' as const\nexport const NEXT_HTML_REQUEST_ID_HEADER = 'x-nextjs-html-request-id' as const\n","import { isBot } from '../../shared/lib/router/utils/is-bot'\nimport { addBasePath } from '../add-base-path'\n\nexport function isExternalURL(url: URL) {\n return url.origin !== window.location.origin\n}\n\n/**\n * Given a link href, constructs the URL that should be prefetched. Returns null\n * in cases where prefetching should be disabled, like external URLs, or\n * during development.\n * @param href The href passed to <Link>, router.prefetch(), or similar\n * @returns A URL object to prefetch, or null if prefetching should be disabled\n */\nexport function createPrefetchURL(href: string): URL | null {\n // Don't prefetch for bots as they don't navigate.\n if (isBot(window.navigator.userAgent)) {\n return null\n }\n\n let url: URL\n try {\n url = new URL(addBasePath(href), window.location.href)\n } catch (_) {\n // TODO: Does this need to throw or can we just console.error instead? Does\n // anyone rely on this throwing? (Seems unlikely.)\n throw new Error(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n }\n\n // Don't prefetch during development (improves compilation performance)\n if (process.env.NODE_ENV === 'development') {\n return null\n }\n\n // External urls can't be prefetched in the same way.\n if (isExternalURL(url)) {\n return null\n }\n\n return url\n}\n","const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE'\n\nexport class DynamicServerError extends Error {\n digest: typeof DYNAMIC_ERROR_CODE = DYNAMIC_ERROR_CODE\n\n constructor(public readonly description: string) {\n super(`Dynamic server usage: ${description}`)\n }\n}\n\nexport function isDynamicServerError(err: unknown): err is DynamicServerError {\n if (\n typeof err !== 'object' ||\n err === null ||\n !('digest' in err) ||\n typeof err.digest !== 'string'\n ) {\n return false\n }\n\n return err.digest === DYNAMIC_ERROR_CODE\n}\n","export const HTTPAccessErrorStatus = {\n NOT_FOUND: 404,\n FORBIDDEN: 403,\n UNAUTHORIZED: 401,\n}\n\nconst ALLOWED_CODES = new Set(Object.values(HTTPAccessErrorStatus))\n\nexport const HTTP_ERROR_FALLBACK_ERROR_CODE = 'NEXT_HTTP_ERROR_FALLBACK'\n\nexport type HTTPAccessFallbackError = Error & {\n digest: `${typeof HTTP_ERROR_FALLBACK_ERROR_CODE};${string}`\n}\n\n/**\n * Checks an error to determine if it's an error generated by\n * the HTTP navigation APIs `notFound()`, `forbidden()` or `unauthorized()`.\n *\n * @param error the error that may reference a HTTP access error\n * @returns true if the error is a HTTP access error\n */\nexport function isHTTPAccessFallbackError(\n error: unknown\n): error is HTTPAccessFallbackError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n const [prefix, httpStatus] = error.digest.split(';')\n\n return (\n prefix === HTTP_ERROR_FALLBACK_ERROR_CODE &&\n ALLOWED_CODES.has(Number(httpStatus))\n )\n}\n\nexport function getAccessFallbackHTTPStatus(\n error: HTTPAccessFallbackError\n): number {\n const httpStatus = error.digest.split(';')[1]\n return Number(httpStatus)\n}\n\nexport function getAccessFallbackErrorTypeByStatus(\n status: number\n): 'not-found' | 'forbidden' | 'unauthorized' | undefined {\n switch (status) {\n case 401:\n return 'unauthorized'\n case 403:\n return 'forbidden'\n case 404:\n return 'not-found'\n default:\n return\n }\n}\n","import {\n isHTTPAccessFallbackError,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\nimport { isRedirectError, type RedirectError } from './redirect-error'\n\n/**\n * Returns true if the error is a navigation signal error. These errors are\n * thrown by user code to perform navigation operations and interrupt the React\n * render.\n */\nexport function isNextRouterError(\n error: unknown\n): error is RedirectError | HTTPAccessFallbackError {\n return isRedirectError(error) || isHTTPAccessFallbackError(error)\n}\n","import type { FlightRouterState } from '../../shared/lib/app-router-types'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n FetchStrategy,\n isPrefetchTaskDirty,\n type PrefetchTaskFetchStrategy,\n} from './segment-cache'\nimport { createCacheKey } from './segment-cache'\nimport {\n type PrefetchTask,\n PrefetchPriority,\n schedulePrefetchTask as scheduleSegmentPrefetchTask,\n cancelPrefetchTask,\n reschedulePrefetchTask,\n} from './segment-cache'\nimport { startTransition } from 'react'\nimport { PrefetchKind } from './router-reducer/router-reducer-types'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\ntype LinkElement = HTMLAnchorElement | SVGAElement\n\ntype Element = LinkElement | HTMLFormElement\n\n// Properties that are shared between Link and Form instances. We use the same\n// shape for both to prevent a polymorphic de-opt in the VM.\ntype LinkOrFormInstanceShared = {\n router: AppRouterInstance\n fetchStrategy: PrefetchTaskFetchStrategy\n\n isVisible: boolean\n\n // The most recently initiated prefetch task. It may or may not have\n // already completed. The same prefetch task object can be reused across\n // multiple prefetches of the same link.\n prefetchTask: PrefetchTask | null\n}\n\nexport type FormInstance = LinkOrFormInstanceShared & {\n prefetchHref: string\n setOptimisticLinkStatus: null\n}\n\ntype PrefetchableLinkInstance = LinkOrFormInstanceShared & {\n prefetchHref: string\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype NonPrefetchableLinkInstance = LinkOrFormInstanceShared & {\n prefetchHref: null\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n}\n\ntype PrefetchableInstance = PrefetchableLinkInstance | FormInstance\n\nexport type LinkInstance =\n | PrefetchableLinkInstance\n | NonPrefetchableLinkInstance\n\n// Tracks the most recently navigated link instance. When null, indicates\n// the current navigation was not initiated by a link click.\nlet linkForMostRecentNavigation: LinkInstance | null = null\n\n// Status object indicating link is pending\nexport const PENDING_LINK_STATUS = { pending: true }\n\n// Status object indicating link is idle\nexport const IDLE_LINK_STATUS = { pending: false }\n\n// Updates the loading state when navigating between links\n// - Resets the previous link's loading state\n// - Sets the new link's loading state\n// - Updates tracking of current navigation\nexport function setLinkForCurrentNavigation(link: LinkInstance | null) {\n startTransition(() => {\n linkForMostRecentNavigation?.setOptimisticLinkStatus(IDLE_LINK_STATUS)\n link?.setOptimisticLinkStatus(PENDING_LINK_STATUS)\n linkForMostRecentNavigation = link\n })\n}\n\n// Unmounts the current link instance from navigation tracking\nexport function unmountLinkForCurrentNavigation(link: LinkInstance) {\n if (linkForMostRecentNavigation === link) {\n linkForMostRecentNavigation = null\n }\n}\n\n// Use a WeakMap to associate a Link instance with its DOM element. This is\n// used by the IntersectionObserver to track the link's visibility.\nconst prefetchable:\n | WeakMap<Element, PrefetchableInstance>\n | Map<Element, PrefetchableInstance> =\n typeof WeakMap === 'function' ? new WeakMap() : new Map()\n\n// A Set of the currently visible links. We re-prefetch visible links after a\n// cache invalidation, or when the current URL changes. It's a separate data\n// structure from the WeakMap above because only the visible links need to\n// be enumerated.\nconst prefetchableAndVisible: Set<PrefetchableInstance> = new Set()\n\n// A single IntersectionObserver instance shared by all <Link> components.\nconst observer: IntersectionObserver | null =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(handleIntersect, {\n rootMargin: '200px',\n })\n : null\n\nfunction observeVisibility(element: Element, instance: PrefetchableInstance) {\n const existingInstance = prefetchable.get(element)\n if (existingInstance !== undefined) {\n // This shouldn't happen because each <Link> component should have its own\n // anchor tag instance, but it's defensive coding to avoid a memory leak in\n // case there's a logical error somewhere else.\n unmountPrefetchableInstance(element)\n }\n // Only track prefetchable links that have a valid prefetch URL\n prefetchable.set(element, instance)\n if (observer !== null) {\n observer.observe(element)\n }\n}\n\nfunction coercePrefetchableUrl(href: string): URL | null {\n if (typeof window !== 'undefined') {\n const { createPrefetchURL } =\n require('./app-router-utils') as typeof import('./app-router-utils')\n\n try {\n return createPrefetchURL(href)\n } catch {\n // createPrefetchURL sometimes throws an error if an invalid URL is\n // provided, though I'm not sure if it's actually necessary.\n // TODO: Consider removing the throw from the inner function, or change it\n // to reportError. Or maybe the error isn't even necessary for automatic\n // prefetches, just navigations.\n const reportErrorFn =\n typeof reportError === 'function' ? reportError : console.error\n reportErrorFn(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n return null\n }\n } else {\n return null\n }\n}\n\nexport function mountLinkInstance(\n element: LinkElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy,\n prefetchEnabled: boolean,\n setOptimisticLinkStatus: (status: { pending: boolean }) => void\n): LinkInstance {\n if (prefetchEnabled) {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL !== null) {\n const instance: PrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus,\n }\n // We only observe the link's visibility if it's prefetchable. For\n // example, this excludes links to external URLs.\n observeVisibility(element, instance)\n return instance\n }\n }\n // If the link is not prefetchable, we still create an instance so we can\n // track its optimistic state (i.e. useLinkStatus).\n const instance: NonPrefetchableLinkInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: null,\n setOptimisticLinkStatus,\n }\n return instance\n}\n\nexport function mountFormInstance(\n element: HTMLFormElement,\n href: string,\n router: AppRouterInstance,\n fetchStrategy: PrefetchTaskFetchStrategy\n): void {\n const prefetchURL = coercePrefetchableUrl(href)\n if (prefetchURL === null) {\n // This href is not prefetchable, so we don't track it.\n // TODO: We currently observe/unobserve a form every time its href changes.\n // For Links, this isn't a big deal because the href doesn't usually change,\n // but for forms it's extremely common. We should optimize this.\n return\n }\n const instance: FormInstance = {\n router,\n fetchStrategy,\n isVisible: false,\n prefetchTask: null,\n prefetchHref: prefetchURL.href,\n setOptimisticLinkStatus: null,\n }\n observeVisibility(element, instance)\n}\n\nexport function unmountPrefetchableInstance(element: Element) {\n const instance = prefetchable.get(element)\n if (instance !== undefined) {\n prefetchable.delete(element)\n prefetchableAndVisible.delete(instance)\n const prefetchTask = instance.prefetchTask\n if (prefetchTask !== null) {\n cancelPrefetchTask(prefetchTask)\n }\n }\n if (observer !== null) {\n observer.unobserve(element)\n }\n}\n\nfunction handleIntersect(entries: Array<IntersectionObserverEntry>) {\n for (const entry of entries) {\n // Some extremely old browsers or polyfills don't reliably support\n // isIntersecting so we check intersectionRatio instead. (Do we care? Not\n // really. But whatever this is fine.)\n const isVisible = entry.intersectionRatio > 0\n onLinkVisibilityChanged(entry.target as HTMLAnchorElement, isVisible)\n }\n}\n\nexport function onLinkVisibilityChanged(element: Element, isVisible: boolean) {\n if (process.env.NODE_ENV !== 'production') {\n // Prefetching on viewport is disabled in development for performance\n // reasons, because it requires compiling the target page.\n // TODO: Investigate re-enabling this.\n return\n }\n\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n\n instance.isVisible = isVisible\n if (isVisible) {\n prefetchableAndVisible.add(instance)\n } else {\n prefetchableAndVisible.delete(instance)\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Default)\n}\n\nexport function onNavigationIntent(\n element: HTMLAnchorElement | SVGAElement,\n unstable_upgradeToDynamicPrefetch: boolean\n) {\n const instance = prefetchable.get(element)\n if (instance === undefined) {\n return\n }\n // Prefetch the link on hover/touchstart.\n if (instance !== undefined) {\n if (\n process.env.__NEXT_DYNAMIC_ON_HOVER &&\n unstable_upgradeToDynamicPrefetch\n ) {\n // Switch to a full prefetch\n instance.fetchStrategy = FetchStrategy.Full\n }\n rescheduleLinkPrefetch(instance, PrefetchPriority.Intent)\n }\n}\n\nfunction rescheduleLinkPrefetch(\n instance: PrefetchableInstance,\n priority: PrefetchPriority.Default | PrefetchPriority.Intent\n) {\n // Ensures that app-router-instance is not compiled in the server bundle\n if (typeof window !== 'undefined') {\n const existingPrefetchTask = instance.prefetchTask\n\n if (!instance.isVisible) {\n // Cancel any in-progress prefetch task. (If it already finished then this\n // is a no-op.)\n if (existingPrefetchTask !== null) {\n cancelPrefetchTask(existingPrefetchTask)\n }\n // We don't need to reset the prefetchTask to null upon cancellation; an\n // old task object can be rescheduled with reschedulePrefetchTask. This is a\n // micro-optimization but also makes the code simpler (don't need to\n // worry about whether an old task object is stale).\n return\n }\n\n if (!process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n // The old prefetch implementation does not have different priority levels.\n // Just schedule a new prefetch task.\n prefetchWithOldCacheImplementation(instance)\n return\n }\n\n const { getCurrentAppRouterState } =\n require('./app-router-instance') as typeof import('./app-router-instance')\n\n const appRouterState = getCurrentAppRouterState()\n if (appRouterState !== null) {\n const treeAtTimeOfPrefetch = appRouterState.tree\n if (existingPrefetchTask === null) {\n // Initiate a prefetch task.\n const nextUrl = appRouterState.nextUrl\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority,\n null\n )\n } else {\n // We already have an old task object that we can reschedule. This is\n // effectively the same as canceling the old task and creating a new one.\n reschedulePrefetchTask(\n existingPrefetchTask,\n treeAtTimeOfPrefetch,\n instance.fetchStrategy,\n priority\n )\n }\n }\n }\n}\n\nexport function pingVisibleLinks(\n nextUrl: string | null,\n tree: FlightRouterState\n) {\n // For each currently visible link, cancel the existing prefetch task (if it\n // exists) and schedule a new one. This is effectively the same as if all the\n // visible links left and then re-entered the viewport.\n //\n // This is called when the Next-Url or the base tree changes, since those\n // may affect the result of a prefetch task. It's also called after a\n // cache invalidation.\n for (const instance of prefetchableAndVisible) {\n const task = instance.prefetchTask\n if (task !== null && !isPrefetchTaskDirty(task, nextUrl, tree)) {\n // The cache has not been invalidated, and none of the inputs have\n // changed. Bail out.\n continue\n }\n // Something changed. Cancel the existing prefetch task and schedule a\n // new one.\n if (task !== null) {\n cancelPrefetchTask(task)\n }\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n tree,\n instance.fetchStrategy,\n PrefetchPriority.Default,\n null\n )\n }\n}\n\nfunction prefetchWithOldCacheImplementation(instance: PrefetchableInstance) {\n // This is the path used when the Segment Cache is not enabled.\n if (typeof window === 'undefined') {\n return\n }\n\n const doPrefetch = async () => {\n // note that `appRouter.prefetch()` is currently sync,\n // so we have to wrap this call in an async function to be able to catch() errors below.\n\n let prefetchKind: PrefetchKind\n switch (instance.fetchStrategy) {\n case FetchStrategy.PPR: {\n prefetchKind = PrefetchKind.AUTO\n break\n }\n case FetchStrategy.Full: {\n prefetchKind = PrefetchKind.FULL\n break\n }\n case FetchStrategy.PPRRuntime: {\n // We can only get here if Client Segment Cache is off, and in that case\n // it shouldn't be possible for a link to request a runtime prefetch.\n throw new InvariantError(\n 'FetchStrategy.PPRRuntime should never be used when `experimental.clientSegmentCache` is disabled'\n )\n }\n default: {\n instance.fetchStrategy satisfies never\n // Unreachable, but otherwise typescript will consider the variable unassigned\n prefetchKind = undefined!\n }\n }\n\n return instance.router.prefetch(instance.prefetchHref, {\n kind: prefetchKind,\n })\n }\n\n // Prefetch the page if asked (only in the client)\n // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n doPrefetch().catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n // rethrow to show invalid URL errors\n throw err\n }\n })\n}\n","import type { Segment } from '../../shared/lib/app-router-types'\n\nexport const matchSegment = (\n existingSegment: Segment,\n segment: Segment\n): boolean => {\n // segment is either Array or string\n if (typeof existingSegment === 'string') {\n if (typeof segment === 'string') {\n // Common case: segment is just a string\n return existingSegment === segment\n }\n return false\n }\n\n if (typeof segment === 'string') {\n return false\n }\n return existingSegment[0] === segment[0] && existingSegment[1] === segment[1]\n}\n","import { RedirectStatusCode } from './redirect-status-code'\n\nexport const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT'\n\nexport enum RedirectType {\n push = 'push',\n replace = 'replace',\n}\n\nexport type RedirectError = Error & {\n digest: `${typeof REDIRECT_ERROR_CODE};${RedirectType};${string};${RedirectStatusCode};`\n}\n\n/**\n * Checks an error to determine if it's an error generated by the\n * `redirect(url)` helper.\n *\n * @param error the error that may reference a redirect error\n * @returns true if the error is a redirect error\n */\nexport function isRedirectError(error: unknown): error is RedirectError {\n if (\n typeof error !== 'object' ||\n error === null ||\n !('digest' in error) ||\n typeof error.digest !== 'string'\n ) {\n return false\n }\n\n const digest = error.digest.split(';')\n const [errorCode, type] = digest\n const destination = digest.slice(2, -2).join(';')\n const status = digest.at(-2)\n\n const statusCode = Number(status)\n\n return (\n errorCode === REDIRECT_ERROR_CODE &&\n (type === 'replace' || type === 'push') &&\n typeof destination === 'string' &&\n !isNaN(statusCode) &&\n statusCode in RedirectStatusCode\n )\n}\n","export enum RedirectStatusCode {\n SeeOther = 303,\n TemporaryRedirect = 307,\n PermanentRedirect = 308,\n}\n","export function createHrefFromUrl(\n url: Pick<URL, 'pathname' | 'search' | 'hash'>,\n includeHash: boolean = true\n): string {\n return url.pathname + url.search + (includeHash ? url.hash : '')\n}\n","import type { Segment } from '../../../shared/lib/app-router-types'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\n\nexport function createRouterCacheKey(\n segment: Segment,\n withoutSearchParameters: boolean = false\n) {\n // if the segment is an array, it means it's a dynamic segment\n // for example, ['lang', 'en', 'd']. We need to convert it to a string to store it as a cache node key.\n if (Array.isArray(segment)) {\n return `${segment[0]}|${segment[1]}|${segment[2]}`\n }\n\n // Page segments might have search parameters, ie __PAGE__?foo=bar\n // When `withoutSearchParameters` is true, we only want to return the page segment\n if (withoutSearchParameters && segment.startsWith(PAGE_SEGMENT_KEY)) {\n return PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n","'use client'\n\n// TODO: Explicitly import from client.browser\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport {\n createFromReadableStream as createFromReadableStreamBrowser,\n createFromFetch as createFromFetchBrowser,\n} from 'react-server-dom-webpack/client'\n\nimport type {\n FlightRouterState,\n NavigationFlightResponse,\n} from '../../../shared/lib/app-router-types'\n\nimport type { NEXT_ROUTER_SEGMENT_PREFETCH_HEADER } from '../app-router-headers'\nimport {\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_RSC_UNION_QUERY,\n NEXT_URL,\n RSC_HEADER,\n RSC_CONTENT_TYPE_HEADER,\n NEXT_HMR_REFRESH_HEADER,\n NEXT_DID_POSTPONE_HEADER,\n NEXT_ROUTER_STALE_TIME_HEADER,\n NEXT_HTML_REQUEST_ID_HEADER,\n NEXT_REQUEST_ID_HEADER,\n} from '../app-router-headers'\nimport { callServer } from '../../app-call-server'\nimport { findSourceMapURL } from '../../app-find-source-map-url'\nimport { PrefetchKind } from './router-reducer-types'\nimport {\n normalizeFlightData,\n prepareFlightRouterStateForRequest,\n type NormalizedFlightData,\n} from '../../flight-data-helpers'\nimport { getAppBuildId } from '../../app-build-id'\nimport { setCacheBustingSearchParam } from './set-cache-busting-search-param'\nimport {\n getRenderedSearch,\n urlToUrlWithoutFlightMarker,\n} from '../../route-params'\nimport type { NormalizedSearch } from '../segment-cache'\n\nconst createFromReadableStream =\n createFromReadableStreamBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromReadableStream']\nconst createFromFetch =\n createFromFetchBrowser as (typeof import('react-server-dom-webpack/client.browser'))['createFromFetch']\n\nlet createDebugChannel:\n | typeof import('../../dev/debug-channel').createDebugChannel\n | undefined\n\nif (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_REACT_DEBUG_CHANNEL\n) {\n createDebugChannel = (\n require('../../dev/debug-channel') as typeof import('../../dev/debug-channel')\n ).createDebugChannel\n}\n\nexport interface FetchServerResponseOptions {\n readonly flightRouterState: FlightRouterState\n readonly nextUrl: string | null\n readonly prefetchKind?: PrefetchKind\n readonly isHmrRefresh?: boolean\n}\n\ntype SpaFetchServerResponseResult = {\n flightData: NormalizedFlightData[]\n canonicalUrl: URL\n renderedSearch: NormalizedSearch\n couldBeIntercepted: boolean\n prerendered: boolean\n postponed: boolean\n staleTime: number\n debugInfo: Array<any> | null\n}\n\ntype MpaFetchServerResponseResult = string\n\nexport type FetchServerResponseResult =\n | MpaFetchServerResponseResult\n | SpaFetchServerResponseResult\n\nexport type RequestHeaders = {\n [RSC_HEADER]?: '1'\n [NEXT_ROUTER_STATE_TREE_HEADER]?: string\n [NEXT_URL]?: string\n [NEXT_ROUTER_PREFETCH_HEADER]?: '1' | '2'\n [NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]?: string\n 'x-deployment-id'?: string\n [NEXT_HMR_REFRESH_HEADER]?: '1'\n // A header that is only added in test mode to assert on fetch priority\n 'Next-Test-Fetch-Priority'?: RequestInit['priority']\n [NEXT_HTML_REQUEST_ID_HEADER]?: string // dev-only\n [NEXT_REQUEST_ID_HEADER]?: string // dev-only\n}\n\nfunction doMpaNavigation(url: string): FetchServerResponseResult {\n return urlToUrlWithoutFlightMarker(new URL(url, location.origin)).toString()\n}\n\nlet abortController = new AbortController()\n\nif (typeof window !== 'undefined') {\n // Abort any in-flight requests when the page is unloaded, e.g. due to\n // reloading the page or performing hard navigations. This allows us to ignore\n // what would otherwise be a thrown TypeError when the browser cancels the\n // requests.\n window.addEventListener('pagehide', () => {\n abortController.abort()\n })\n\n // Use a fresh AbortController instance on pageshow, e.g. when navigating back\n // and the JavaScript execution context is restored by the browser.\n window.addEventListener('pageshow', () => {\n abortController = new AbortController()\n })\n}\n\n/**\n * Fetch the flight data for the provided url. Takes in the current router state\n * to decide what to render server-side.\n */\nexport async function fetchServerResponse(\n url: URL,\n options: FetchServerResponseOptions\n): Promise<FetchServerResponseResult> {\n const { flightRouterState, nextUrl, prefetchKind } = options\n\n const headers: RequestHeaders = {\n // Enable flight response\n [RSC_HEADER]: '1',\n // Provide the current router state\n [NEXT_ROUTER_STATE_TREE_HEADER]: prepareFlightRouterStateForRequest(\n flightRouterState,\n options.isHmrRefresh\n ),\n }\n\n /**\n * Three cases:\n * - `prefetchKind` is `undefined`, it means it's a normal navigation, so we want to prefetch the page data fully\n * - `prefetchKind` is `full` - we want to prefetch the whole page so same as above\n * - `prefetchKind` is `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully\n */\n if (prefetchKind === PrefetchKind.AUTO) {\n headers[NEXT_ROUTER_PREFETCH_HEADER] = '1'\n }\n\n if (process.env.NODE_ENV === 'development' && options.isHmrRefresh) {\n headers[NEXT_HMR_REFRESH_HEADER] = '1'\n }\n\n if (nextUrl) {\n headers[NEXT_URL] = nextUrl\n }\n\n // In static export mode, we need to modify the URL to request the .txt file,\n // but we should preserve the original URL for the canonical URL and error handling.\n const originalUrl = url\n\n try {\n // When creating a \"temporary\" prefetch (the \"on-demand\" prefetch that gets created on navigation, if one doesn't exist)\n // we send the request with a \"high\" priority as it's in response to a user interaction that could be blocking a transition.\n // Otherwise, all other prefetches are sent with a \"low\" priority.\n // We use \"auto\" for in all other cases to match the existing default, as this function is shared outside of prefetching.\n const fetchPriority = prefetchKind\n ? prefetchKind === PrefetchKind.TEMPORARY\n ? 'high'\n : 'low'\n : 'auto'\n\n if (process.env.NODE_ENV === 'production') {\n if (process.env.__NEXT_CONFIG_OUTPUT === 'export') {\n // In \"output: export\" mode, we can't rely on headers to distinguish\n // between HTML and RSC requests. Instead, we append an extra prefix\n // to the request.\n url = new URL(url)\n if (url.pathname.endsWith('/')) {\n url.pathname += 'index.txt'\n } else {\n url.pathname += '.txt'\n }\n }\n }\n\n // Typically, during a navigation, we decode the response using Flight's\n // `createFromFetch` API, which accepts a `fetch` promise.\n // TODO: Remove this check once the old PPR flag is removed\n const isLegacyPPR =\n process.env.__NEXT_PPR && !process.env.__NEXT_CACHE_COMPONENTS\n const shouldImmediatelyDecode = !isLegacyPPR\n const res = await createFetch<NavigationFlightResponse>(\n url,\n headers,\n fetchPriority,\n shouldImmediatelyDecode,\n abortController.signal\n )\n\n const responseUrl = urlToUrlWithoutFlightMarker(new URL(res.url))\n const canonicalUrl = res.redirected ? responseUrl : originalUrl\n\n const contentType = res.headers.get('content-type') || ''\n const interception = !!res.headers.get('vary')?.includes(NEXT_URL)\n const postponed = !!res.headers.get(NEXT_DID_POSTPONE_HEADER)\n const staleTimeHeaderSeconds = res.headers.get(\n NEXT_ROUTER_STALE_TIME_HEADER\n )\n const staleTime =\n staleTimeHeaderSeconds !== null\n ? parseInt(staleTimeHeaderSeconds, 10) * 1000\n : -1\n let isFlightResponse = contentType.startsWith(RSC_CONTENT_TYPE_HEADER)\n\n if (process.env.NODE_ENV === 'production') {\n if (process.env.__NEXT_CONFIG_OUTPUT === 'export') {\n if (!isFlightResponse) {\n isFlightResponse = contentType.startsWith('text/plain')\n }\n }\n }\n\n // If fetch returns something different than flight response handle it like a mpa navigation\n // If the fetch was not 200, we also handle it like a mpa navigation\n if (!isFlightResponse || !res.ok || !res.body) {\n // in case the original URL came with a hash, preserve it before redirecting to the new URL\n if (url.hash) {\n responseUrl.hash = url.hash\n }\n\n return doMpaNavigation(responseUrl.toString())\n }\n\n // We may navigate to a page that requires a different Webpack runtime.\n // In prod, every page will have the same Webpack runtime.\n // In dev, the Webpack runtime is minimal for each page.\n // We need to ensure the Webpack runtime is updated before executing client-side JS of the new page.\n // TODO: This needs to happen in the Flight Client.\n // Or Webpack needs to include the runtime update in the Flight response as\n // a blocking script.\n if (process.env.NODE_ENV !== 'production' && !process.env.TURBOPACK) {\n await (\n require('../../dev/hot-reloader/app/hot-reloader-app') as typeof import('../../dev/hot-reloader/app/hot-reloader-app')\n ).waitForWebpackRuntimeHotUpdate()\n }\n\n let flightResponsePromise = res.flightResponse\n if (flightResponsePromise === null) {\n // Typically, `createFetch` would have already started decoding the\n // Flight response. If it hasn't, though, we need to decode it now.\n // TODO: This should only be reachable if legacy PPR is enabled (i.e. PPR\n // without Cache Components). Remove this branch once legacy PPR\n // is deleted.\n const flightStream = postponed\n ? createUnclosingPrefetchStream(res.body)\n : res.body\n flightResponsePromise =\n createFromNextReadableStream<NavigationFlightResponse>(\n flightStream,\n headers\n )\n }\n\n const flightResponse = await flightResponsePromise\n\n if (getAppBuildId() !== flightResponse.b) {\n return doMpaNavigation(res.url)\n }\n\n const normalizedFlightData = normalizeFlightData(flightResponse.f)\n if (typeof normalizedFlightData === 'string') {\n return doMpaNavigation(normalizedFlightData)\n }\n\n return {\n flightData: normalizedFlightData,\n canonicalUrl: canonicalUrl,\n renderedSearch: getRenderedSearch(res),\n couldBeIntercepted: interception,\n prerendered: flightResponse.S,\n postponed,\n staleTime,\n debugInfo: flightResponsePromise._debugInfo ?? null,\n }\n } catch (err) {\n if (!abortController.signal.aborted) {\n console.error(\n `Failed to fetch RSC payload for ${originalUrl}. Falling back to browser navigation.`,\n err\n )\n }\n\n // If fetch fails handle it like a mpa navigation\n // TODO-APP: Add a test for the case where a CORS request fails, e.g. external url redirect coming from the response.\n // See https://github.com/vercel/next.js/issues/43605#issuecomment-1451617521 for a reproduction.\n return originalUrl.toString()\n }\n}\n\n// This is a subset of the standard Response type. We use a custom type for\n// this so we can limit which details about the response leak into the rest of\n// the codebase. For example, there's some custom logic for manually following\n// redirects, so \"redirected\" in this type could be a composite of multiple\n// browser fetch calls; however, this fact should not leak to the caller.\nexport type RSCResponse<T> = {\n ok: boolean\n redirected: boolean\n headers: Headers\n body: ReadableStream<Uint8Array> | null\n status: number\n url: string\n flightResponse: (Promise<T> & { _debugInfo?: Array<any> }) | null\n}\n\nexport async function createFetch<T>(\n url: URL,\n headers: RequestHeaders,\n fetchPriority: 'auto' | 'high' | 'low' | null,\n shouldImmediatelyDecode: boolean,\n signal?: AbortSignal\n): Promise<RSCResponse<T>> {\n // TODO: In output: \"export\" mode, the headers do nothing. Omit them (and the\n // cache busting search param) from the request so they're\n // maximally cacheable.\n\n if (process.env.__NEXT_TEST_MODE && fetchPriority !== null) {\n headers['Next-Test-Fetch-Priority'] = fetchPriority\n }\n\n if (process.env.NEXT_DEPLOYMENT_ID) {\n headers['x-deployment-id'] = process.env.NEXT_DEPLOYMENT_ID\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (self.__next_r) {\n headers[NEXT_HTML_REQUEST_ID_HEADER] = self.__next_r\n }\n\n // Create a new request ID for the server action request. The server uses\n // this to tag debug information sent via WebSocket to the client, which\n // then routes those chunks to the debug channel associated with this ID.\n headers[NEXT_REQUEST_ID_HEADER] = crypto\n .getRandomValues(new Uint32Array(1))[0]\n .toString(16)\n }\n\n const fetchOptions: RequestInit = {\n // Backwards compat for older browsers. `same-origin` is the default in modern browsers.\n credentials: 'same-origin',\n headers,\n priority: fetchPriority || undefined,\n signal,\n }\n // `fetchUrl` is slightly different from `url` because we add a cache-busting\n // search param to it. This should not leak outside of this function, so we\n // track them separately.\n let fetchUrl = new URL(url)\n setCacheBustingSearchParam(fetchUrl, headers)\n let fetchPromise = fetch(fetchUrl, fetchOptions)\n // Immediately pass the fetch promise to the Flight client so that the debug\n // info includes the latency from the client to the server. The internal timer\n // in React starts as soon as `createFromFetch` is called.\n //\n // The only case where we don't do this is during a prefetch, because we have\n // to do some extra processing of the response stream (see\n // `createUnclosingPrefetchStream`). But this is fine, because a top-level\n // prefetch response never blocks a navigation; if it hasn't already been\n // written into the cache by the time the navigation happens, the router will\n // go straight to a dynamic request.\n let flightResponsePromise = shouldImmediatelyDecode\n ? createFromNextFetch<T>(fetchPromise, headers)\n : null\n let browserResponse = await fetchPromise\n\n // If the server responds with a redirect (e.g. 307), and the redirected\n // location does not contain the cache busting search param set in the\n // original request, the response is likely invalid — when following the\n // redirect, the browser forwards the request headers, but since the cache\n // busting search param is missing, the server will reject the request due to\n // a mismatch.\n //\n // Ideally, we would be able to intercept the redirect response and perform it\n // manually, instead of letting the browser automatically follow it, but this\n // is not allowed by the fetch API.\n //\n // So instead, we must \"replay\" the redirect by fetching the new location\n // again, but this time we'll append the cache busting search param to prevent\n // a mismatch.\n //\n // TODO: We can optimize Next.js's built-in middleware APIs by returning a\n // custom status code, to prevent the browser from automatically following it.\n //\n // This does not affect Server Action-based redirects; those are encoded\n // differently, as part of the Flight body. It only affects redirects that\n // occur in a middleware or a third-party proxy.\n\n let redirected = browserResponse.redirected\n if (process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS) {\n // This is to prevent a redirect loop. Same limit used by Chrome.\n const MAX_REDIRECTS = 20\n for (let n = 0; n < MAX_REDIRECTS; n++) {\n if (!browserResponse.redirected) {\n // The server did not perform a redirect.\n break\n }\n const responseUrl = new URL(browserResponse.url, fetchUrl)\n if (responseUrl.origin !== fetchUrl.origin) {\n // The server redirected to an external URL. The rest of the logic below\n // is not relevant, because it only applies to internal redirects.\n break\n }\n if (\n responseUrl.searchParams.get(NEXT_RSC_UNION_QUERY) ===\n fetchUrl.searchParams.get(NEXT_RSC_UNION_QUERY)\n ) {\n // The redirected URL already includes the cache busting search param.\n // This was probably intentional. Regardless, there's no reason to\n // issue another request to this URL because it already has the param\n // value that we would have added below.\n break\n }\n // The RSC request was redirected. Assume the response is invalid.\n //\n // Append the cache busting search param to the redirected URL and\n // fetch again.\n // TODO: We should abort the previous request.\n fetchUrl = new URL(responseUrl)\n setCacheBustingSearchParam(fetchUrl, headers)\n fetchPromise = fetch(fetchUrl, fetchOptions)\n flightResponsePromise = shouldImmediatelyDecode\n ? createFromNextFetch<T>(fetchPromise, headers)\n : null\n browserResponse = await fetchPromise\n // We just performed a manual redirect, so this is now true.\n redirected = true\n }\n }\n\n // Remove the cache busting search param from the response URL, to prevent it\n // from leaking outside of this function.\n const responseUrl = new URL(browserResponse.url, fetchUrl)\n responseUrl.searchParams.delete(NEXT_RSC_UNION_QUERY)\n\n const rscResponse: RSCResponse<T> = {\n url: responseUrl.href,\n\n // This is true if any redirects occurred, either automatically by the\n // browser, or manually by us. So it's different from\n // `browserResponse.redirected`, which only tells us whether the browser\n // followed a redirect, and only for the last response in the chain.\n redirected,\n\n // These can be copied from the last browser response we received. We\n // intentionally only expose the subset of fields that are actually used\n // elsewhere in the codebase.\n ok: browserResponse.ok,\n headers: browserResponse.headers,\n body: browserResponse.body,\n status: browserResponse.status,\n\n // This is the exact promise returned by `createFromFetch`. It contains\n // debug information that we need to transfer to any derived promises that\n // are later rendered by React.\n flightResponse: flightResponsePromise,\n }\n\n return rscResponse\n}\n\nexport function createFromNextReadableStream<T>(\n flightStream: ReadableStream<Uint8Array>,\n requestHeaders: RequestHeaders\n): Promise<T> {\n return createFromReadableStream(flightStream, {\n callServer,\n findSourceMapURL,\n debugChannel: createDebugChannel && createDebugChannel(requestHeaders),\n })\n}\n\nfunction createFromNextFetch<T>(\n promiseForResponse: Promise<Response>,\n requestHeaders: RequestHeaders\n): Promise<T> & { _debugInfo?: Array<any> } {\n return createFromFetch(promiseForResponse, {\n callServer,\n findSourceMapURL,\n debugChannel: createDebugChannel && createDebugChannel(requestHeaders),\n })\n}\n\nfunction createUnclosingPrefetchStream(\n originalFlightStream: ReadableStream<Uint8Array>\n): ReadableStream<Uint8Array> {\n // When PPR is enabled, prefetch streams may contain references that never\n // resolve, because that's how we encode dynamic data access. In the decoded\n // object returned by the Flight client, these are reified into hanging\n // promises that suspend during render, which is effectively what we want.\n // The UI resolves when it switches to the dynamic data stream\n // (via useDeferredValue(dynamic, static)).\n //\n // However, the Flight implementation currently errors if the server closes\n // the response before all the references are resolved. As a cheat to work\n // around this, we wrap the original stream in a new stream that never closes,\n // and therefore doesn't error.\n const reader = originalFlightStream.getReader()\n return new ReadableStream({\n async pull(controller) {\n while (true) {\n const { done, value } = await reader.read()\n if (!done) {\n // Pass to the target stream and keep consuming the Flight response\n // from the server.\n controller.enqueue(value)\n continue\n }\n // The server stream has closed. Exit, but intentionally do not close\n // the target stream.\n return\n }\n },\n })\n}\n","import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n} from '../../../shared/lib/app-router-types'\nimport type {\n CacheNode,\n ChildSegmentMap,\n ReadyCacheNode,\n} from '../../../shared/lib/app-router-types'\nimport type {\n HeadData,\n LoadingModuleData,\n} from '../../../shared/lib/app-router-types'\nimport { DEFAULT_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\nimport { createHrefFromUrl } from './create-href-from-url'\nimport { createRouterCacheKey } from './create-router-cache-key'\nimport type { FetchServerResponseResult } from './fetch-server-response'\nimport { isNavigatingToNewRootLayout } from './is-navigating-to-new-root-layout'\nimport { DYNAMIC_STALETIME_MS } from './reducers/navigate-reducer'\n\n// This is yet another tree type that is used to track pending promises that\n// need to be fulfilled once the dynamic data is received. The terminal nodes of\n// this tree represent the new Cache Node trees that were created during this\n// request. We can't use the Cache Node tree or Route State tree directly\n// because those include reused nodes, too. This tree is discarded as soon as\n// the navigation response is received.\ntype SPANavigationTask = {\n // The router state that corresponds to the tree that this Task represents.\n route: FlightRouterState\n // The CacheNode that corresponds to the tree that this Task represents. If\n // `children` is null (i.e. if this is a terminal task node), then `node`\n // represents a brand new Cache Node tree, which way or may not need to be\n // filled with dynamic data from the server.\n node: CacheNode | null\n // The tree sent to the server during the dynamic request. This is the\n // same as `route`, except with the `refetch` marker set on dynamic segments.\n // If all the segments are static, then this will be null, and no server\n // request is required.\n dynamicRequestTree: FlightRouterState | null\n children: Map<string, SPANavigationTask> | null\n}\n\n// A special type used to bail out and trigger a full-page navigation.\ntype MPANavigationTask = {\n // MPA tasks are distinguised from SPA tasks by having a null `route`.\n route: null\n node: null\n dynamicRequestTree: null\n children: null\n}\n\nconst MPA_NAVIGATION_TASK: MPANavigationTask = {\n route: null,\n node: null,\n dynamicRequestTree: null,\n children: null,\n}\n\nexport type Task = SPANavigationTask | MPANavigationTask\n\n// Creates a new Cache Node tree (i.e. copy-on-write) that represents the\n// optimistic result of a navigation, using both the current Cache Node tree and\n// data that was prefetched prior to navigation.\n//\n// At the moment we call this function, we haven't yet received the navigation\n// response from the server. It could send back something completely different\n// from the tree that was prefetched — due to rewrites, default routes, parallel\n// routes, etc.\n//\n// But in most cases, it will return the same tree that we prefetched, just with\n// the dynamic holes filled in. So we optimistically assume this will happen,\n// and accept that the real result could be arbitrarily different.\n//\n// We'll reuse anything that was already in the previous tree, since that's what\n// the server does.\n//\n// New segments (ones that don't appear in the old tree) are assigned an\n// unresolved promise. The data for these promises will be fulfilled later, when\n// the navigation response is received.\n//\n// The tree can be rendered immediately after it is created (that's why this is\n// a synchronous function). Any new trees that do not have prefetch data will\n// suspend during rendering, until the dynamic data streams in.\n//\n// Returns a Task object, which contains both the updated Cache Node and a path\n// to the pending subtrees that need to be resolved by the navigation response.\n//\n// A return value of `null` means there were no changes, and the previous tree\n// can be reused without initiating a server request.\nexport function startPPRNavigation(\n navigatedAt: number,\n oldUrl: URL,\n oldCacheNode: CacheNode,\n oldRouterState: FlightRouterState,\n newRouterState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n isSamePageNavigation: boolean,\n scrollableSegmentsResult: Array<FlightSegmentPath>\n): Task | null {\n const segmentPath: Array<FlightSegmentPath> = []\n return updateCacheNodeOnNavigation(\n navigatedAt,\n oldUrl,\n oldCacheNode,\n oldRouterState,\n newRouterState,\n false,\n prefetchData,\n prefetchHead,\n isPrefetchHeadPartial,\n isSamePageNavigation,\n segmentPath,\n scrollableSegmentsResult\n )\n}\n\nfunction updateCacheNodeOnNavigation(\n navigatedAt: number,\n oldUrl: URL,\n oldCacheNode: CacheNode,\n oldRouterState: FlightRouterState,\n newRouterState: FlightRouterState,\n didFindRootLayout: boolean,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n isSamePageNavigation: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array<FlightSegmentPath>\n): Task | null {\n // Diff the old and new trees to reuse the shared layouts.\n const oldRouterStateChildren = oldRouterState[1]\n const newRouterStateChildren = newRouterState[1]\n const prefetchDataChildren = prefetchData !== null ? prefetchData[1] : null\n\n if (!didFindRootLayout) {\n // We're currently traversing the part of the tree that was also part of\n // the previous route. If we discover a root layout, then we don't need to\n // trigger an MPA navigation. See beginRenderingNewRouteTree for context.\n const isRootLayout = newRouterState[4] === true\n if (isRootLayout) {\n // Found a matching root layout.\n didFindRootLayout = true\n }\n }\n\n const oldParallelRoutes = oldCacheNode.parallelRoutes\n\n // Clone the current set of segment children, even if they aren't active in\n // the new tree.\n // TODO: We currently retain all the inactive segments indefinitely, until\n // there's an explicit refresh, or a parent layout is lazily refreshed. We\n // rely on this for popstate navigations, which update the Router State Tree\n // but do not eagerly perform a data fetch, because they expect the segment\n // data to already be in the Cache Node tree. For highly static sites that\n // are mostly read-only, this may happen only rarely, causing memory to\n // leak. We should figure out a better model for the lifetime of inactive\n // segments, so we can maintain instant back/forward navigations without\n // leaking memory indefinitely.\n const prefetchParallelRoutes = new Map(oldParallelRoutes)\n\n // As we diff the trees, we may sometimes modify (copy-on-write, not mutate)\n // the Route Tree that was returned by the server — for example, in the case\n // of default parallel routes, we preserve the currently active segment. To\n // avoid mutating the original tree, we clone the router state children along\n // the return path.\n let patchedRouterStateChildren: {\n [parallelRouteKey: string]: FlightRouterState\n } = {}\n let taskChildren = null\n\n // Most navigations require a request to fetch additional data from the\n // server, either because the data was not already prefetched, or because the\n // target route contains dynamic data that cannot be prefetched.\n //\n // However, if the target route is fully static, and it's already completely\n // loaded into the segment cache, then we can skip the server request.\n //\n // This starts off as `false`, and is set to `true` if any of the child\n // routes requires a dynamic request.\n let needsDynamicRequest = false\n // As we traverse the children, we'll construct a FlightRouterState that can\n // be sent to the server to request the dynamic data. If it turns out that\n // nothing in the subtree is dynamic (i.e. needsDynamicRequest is false at the\n // end), then this will be discarded.\n // TODO: We can probably optimize the format of this data structure to only\n // include paths that are dynamic. Instead of reusing the\n // FlightRouterState type.\n let dynamicRequestTreeChildren: {\n [parallelRouteKey: string]: FlightRouterState\n } = {}\n\n for (let parallelRouteKey in newRouterStateChildren) {\n const newRouterStateChild: FlightRouterState =\n newRouterStateChildren[parallelRouteKey]\n const oldRouterStateChild: FlightRouterState | void =\n oldRouterStateChildren[parallelRouteKey]\n const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey)\n const prefetchDataChild: CacheNodeSeedData | void | null =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n\n const newSegmentChild = newRouterStateChild[0]\n const newSegmentPathChild = segmentPath.concat([\n parallelRouteKey,\n newSegmentChild,\n ])\n const newSegmentKeyChild = createRouterCacheKey(newSegmentChild)\n\n const oldSegmentChild =\n oldRouterStateChild !== undefined ? oldRouterStateChild[0] : undefined\n\n const oldCacheNodeChild =\n oldSegmentMapChild !== undefined\n ? oldSegmentMapChild.get(newSegmentKeyChild)\n : undefined\n\n let taskChild: Task | null\n if (newSegmentChild === DEFAULT_SEGMENT_KEY) {\n // This is another kind of leaf segment — a default route.\n //\n // Default routes have special behavior. When there's no matching segment\n // for a parallel route, Next.js preserves the currently active segment\n // during a client navigation — but not for initial render. The server\n // leaves it to the client to account for this. So we need to handle\n // it here.\n if (oldRouterStateChild !== undefined) {\n // Reuse the existing Router State for this segment. We spawn a \"task\"\n // just to keep track of the updated router state; unlike most, it's\n // already fulfilled and won't be affected by the dynamic response.\n taskChild = reuseActiveSegmentInDefaultSlot(oldUrl, oldRouterStateChild)\n } else {\n // There's no currently active segment. Switch to the \"create\" path.\n taskChild = beginRenderingNewRouteTree(\n navigatedAt,\n oldRouterStateChild,\n newRouterStateChild,\n oldCacheNodeChild,\n didFindRootLayout,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n }\n } else if (\n isSamePageNavigation &&\n // Check if this is a page segment.\n // TODO: We're not consistent about how we do this check. Some places\n // check if the segment starts with PAGE_SEGMENT_KEY, but most seem to\n // check if there any any children, which is why I'm doing it here. We\n // should probably encode an empty children set as `null` though. Either\n // way, we should update all the checks to be consistent.\n Object.keys(newRouterStateChild[1]).length === 0\n ) {\n // We special case navigations to the exact same URL as the current\n // location. It's a common UI pattern for apps to refresh when you click a\n // link to the current page. So when this happens, we refresh the dynamic\n // data in the page segments.\n //\n // Note that this does not apply if the any part of the hash or search\n // query has changed. This might feel a bit weird but it makes more sense\n // when you consider that the way to trigger this behavior is to click\n // the same link multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case\n // occurs, not just the page segments. Essentially treating it the same as\n // a refresh() triggered by an action, which is the more explicit way of\n // modeling the UI pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/\n // cached data. If the page segment is fully static and prefetched, the\n // request is skipped. (This is also how refresh() works.)\n taskChild = beginRenderingNewRouteTree(\n navigatedAt,\n oldRouterStateChild,\n newRouterStateChild,\n oldCacheNodeChild,\n didFindRootLayout,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n } else if (\n oldRouterStateChild !== undefined &&\n oldSegmentChild !== undefined &&\n matchSegment(newSegmentChild, oldSegmentChild)\n ) {\n if (\n oldCacheNodeChild !== undefined &&\n oldRouterStateChild !== undefined\n ) {\n // This segment exists in both the old and new trees. Recursively update\n // the children.\n taskChild = updateCacheNodeOnNavigation(\n navigatedAt,\n oldUrl,\n oldCacheNodeChild,\n oldRouterStateChild,\n newRouterStateChild,\n didFindRootLayout,\n prefetchDataChild,\n prefetchHead,\n isPrefetchHeadPartial,\n isSamePageNavigation,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n } else {\n // There's no existing Cache Node for this segment. Switch to the\n // \"create\" path.\n taskChild = beginRenderingNewRouteTree(\n navigatedAt,\n oldRouterStateChild,\n newRouterStateChild,\n oldCacheNodeChild,\n didFindRootLayout,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n }\n } else {\n // This is a new tree. Switch to the \"create\" path.\n taskChild = beginRenderingNewRouteTree(\n navigatedAt,\n oldRouterStateChild,\n newRouterStateChild,\n oldCacheNodeChild,\n didFindRootLayout,\n prefetchDataChild !== undefined ? prefetchDataChild : null,\n prefetchHead,\n isPrefetchHeadPartial,\n newSegmentPathChild,\n scrollableSegmentsResult\n )\n }\n\n if (taskChild !== null) {\n // Recursively propagate up the child tasks.\n\n if (taskChild.route === null) {\n // One of the child tasks discovered a change to the root layout.\n // Immediately unwind from this recursive traversal.\n return MPA_NAVIGATION_TASK\n }\n\n if (taskChildren === null) {\n taskChildren = new Map()\n }\n taskChildren.set(parallelRouteKey, taskChild)\n const newCacheNodeChild = taskChild.node\n if (newCacheNodeChild !== null) {\n const newSegmentMapChild: ChildSegmentMap = new Map(oldSegmentMapChild)\n newSegmentMapChild.set(newSegmentKeyChild, newCacheNodeChild)\n prefetchParallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n\n // The child tree's route state may be different from the prefetched\n // route sent by the server. We need to clone it as we traverse back up\n // the tree.\n const taskChildRoute = taskChild.route\n patchedRouterStateChildren[parallelRouteKey] = taskChildRoute\n\n const dynamicRequestTreeChild = taskChild.dynamicRequestTree\n if (dynamicRequestTreeChild !== null) {\n // Something in the child tree is dynamic.\n needsDynamicRequest = true\n dynamicRequestTreeChildren[parallelRouteKey] = dynamicRequestTreeChild\n } else {\n dynamicRequestTreeChildren[parallelRouteKey] = taskChildRoute\n }\n } else {\n // The child didn't change. We can use the prefetched router state.\n patchedRouterStateChildren[parallelRouteKey] = newRouterStateChild\n dynamicRequestTreeChildren[parallelRouteKey] = newRouterStateChild\n }\n }\n\n if (taskChildren === null) {\n // No new tasks were spawned.\n return null\n }\n\n const newCacheNode: ReadyCacheNode = {\n lazyData: null,\n rsc: oldCacheNode.rsc,\n // We intentionally aren't updating the prefetchRsc field, since this node\n // is already part of the current tree, because it would be weird for\n // prefetch data to be newer than the final data. It probably won't ever be\n // observable anyway, but it could happen if the segment is unmounted then\n // mounted again, because LayoutRouter will momentarily switch to rendering\n // prefetchRsc, via useDeferredValue.\n prefetchRsc: oldCacheNode.prefetchRsc,\n head: oldCacheNode.head,\n prefetchHead: oldCacheNode.prefetchHead,\n loading: oldCacheNode.loading,\n\n // Everything is cloned except for the children, which we computed above.\n parallelRoutes: prefetchParallelRoutes,\n\n navigatedAt,\n }\n\n return {\n // Return a cloned copy of the router state with updated children.\n route: patchRouterStateWithNewChildren(\n newRouterState,\n patchedRouterStateChildren\n ),\n node: newCacheNode,\n dynamicRequestTree: needsDynamicRequest\n ? patchRouterStateWithNewChildren(\n newRouterState,\n dynamicRequestTreeChildren\n )\n : null,\n children: taskChildren,\n }\n}\n\nfunction beginRenderingNewRouteTree(\n navigatedAt: number,\n oldRouterState: FlightRouterState | void,\n newRouterState: FlightRouterState,\n existingCacheNode: CacheNode | void,\n didFindRootLayout: boolean,\n prefetchData: CacheNodeSeedData | null,\n possiblyPartialPrefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array<FlightSegmentPath>\n): Task {\n if (!didFindRootLayout) {\n // The route tree changed before we reached a layout. (The highest-level\n // layout in a route tree is referred to as the \"root\" layout.) This could\n // mean that we're navigating between two different root layouts. When this\n // happens, we perform a full-page (MPA-style) navigation.\n //\n // However, the algorithm for deciding where to start rendering a route\n // (i.e. the one performed in order to reach this function) is stricter\n // than the one used to detect a change in the root layout. So just because\n // we're re-rendering a segment outside of the root layout does not mean we\n // should trigger a full-page navigation.\n //\n // Specifically, we handle dynamic parameters differently: two segments are\n // considered the same even if their parameter values are different.\n //\n // Refer to isNavigatingToNewRootLayout for details.\n //\n // Note that we only have to perform this extra traversal if we didn't\n // already discover a root layout in the part of the tree that is unchanged.\n // In the common case, this branch is skipped completely.\n if (\n oldRouterState === undefined ||\n isNavigatingToNewRootLayout(oldRouterState, newRouterState)\n ) {\n // The root layout changed. Perform a full-page navigation.\n return MPA_NAVIGATION_TASK\n }\n }\n return createCacheNodeOnNavigation(\n navigatedAt,\n newRouterState,\n existingCacheNode,\n prefetchData,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial,\n segmentPath,\n scrollableSegmentsResult\n )\n}\n\nfunction createCacheNodeOnNavigation(\n navigatedAt: number,\n routerState: FlightRouterState,\n existingCacheNode: CacheNode | void,\n prefetchData: CacheNodeSeedData | null,\n possiblyPartialPrefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array<FlightSegmentPath>\n): SPANavigationTask {\n // Same traversal as updateCacheNodeNavigation, but we switch to this path\n // once we reach the part of the tree that was not in the previous route. We\n // don't need to diff against the old tree, we just need to create a new one.\n\n // The head is assigned to every leaf segment delivered by the server. Based\n // on corresponding logic in fill-lazy-items-till-leaf-with-head.ts\n const routerStateChildren = routerState[1]\n const isLeafSegment = Object.keys(routerStateChildren).length === 0\n\n // Even we're rendering inside the \"new\" part of the target tree, we may have\n // a locally cached segment that we can reuse. This may come from either 1)\n // the CacheNode tree, which lives in React state and is populated by previous\n // navigations; or 2) the prefetch cache, which is a separate cache that is\n // populated by prefetches.\n let rsc: React.ReactNode\n let loading: LoadingModuleData | Promise<LoadingModuleData>\n let head: HeadData | null\n let cacheNodeNavigatedAt: number\n if (\n existingCacheNode !== undefined &&\n // DYNAMIC_STALETIME_MS defaults to 0, but it can be increased using\n // the experimental.staleTimes.dynamic config. When set, we'll avoid\n // refetching dynamic data if it was fetched within the given threshold.\n existingCacheNode.navigatedAt + DYNAMIC_STALETIME_MS > navigatedAt\n ) {\n // We have an existing CacheNode for this segment, and it's not stale. We\n // should reuse it rather than request a new one.\n rsc = existingCacheNode.rsc\n loading = existingCacheNode.loading\n head = existingCacheNode.head\n\n // Don't update the navigatedAt timestamp, since we're reusing stale data.\n cacheNodeNavigatedAt = existingCacheNode.navigatedAt\n } else if (prefetchData !== null) {\n // There's no existing CacheNode for this segment, but we do have prefetch\n // data. If the prefetch data is fully static (i.e. does not contain any\n // dynamic holes), we don't need to request it from the server.\n rsc = prefetchData[0]\n loading = prefetchData[2]\n head = isLeafSegment ? possiblyPartialPrefetchHead : null\n // Even though we're accessing the data from the prefetch cache, this is\n // conceptually a new segment, not a reused one. So we should update the\n // navigatedAt timestamp.\n cacheNodeNavigatedAt = navigatedAt\n const isPrefetchRscPartial = prefetchData[3]\n if (\n // Check if the segment data is partial\n isPrefetchRscPartial ||\n // Check if the head is partial (only relevant if this is a leaf segment)\n (isPrefetchHeadPartial && isLeafSegment)\n ) {\n // We only have partial data from this segment. Like missing segments, we\n // must request the full data from the server.\n return spawnPendingTask(\n navigatedAt,\n routerState,\n prefetchData,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial,\n segmentPath,\n scrollableSegmentsResult\n )\n } else {\n // The prefetch data is fully static, so we can omit it from the\n // navigation request.\n }\n } else {\n // There's no prefetch for this segment. Everything from this point will be\n // requested from the server, even if there are static children below it.\n // Create a terminal task node that will later be fulfilled by\n // server response.\n return spawnPendingTask(\n navigatedAt,\n routerState,\n null,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial,\n segmentPath,\n scrollableSegmentsResult\n )\n }\n\n // We already have a full segment we can render, so we don't need to request a\n // new one from the server. Keep traversing down the tree until we reach\n // something that requires a dynamic request.\n const prefetchDataChildren = prefetchData !== null ? prefetchData[1] : null\n const taskChildren = new Map()\n const existingCacheNodeChildren =\n existingCacheNode !== undefined ? existingCacheNode.parallelRoutes : null\n const cacheNodeChildren = new Map(existingCacheNodeChildren)\n let dynamicRequestTreeChildren: {\n [parallelRouteKey: string]: FlightRouterState\n } = {}\n let needsDynamicRequest = false\n if (isLeafSegment) {\n // The segment path of every leaf segment (i.e. page) is collected into\n // a result array. This is used by the LayoutRouter to scroll to ensure that\n // new pages are visible after a navigation.\n // TODO: We should use a string to represent the segment path instead of\n // an array. We already use a string representation for the path when\n // accessing the Segment Cache, so we can use the same one.\n scrollableSegmentsResult.push(segmentPath)\n } else {\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const prefetchDataChild: CacheNodeSeedData | void | null =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n const existingSegmentMapChild =\n existingCacheNodeChildren !== null\n ? existingCacheNodeChildren.get(parallelRouteKey)\n : undefined\n const segmentChild = routerStateChild[0]\n const segmentPathChild = segmentPath.concat([\n parallelRouteKey,\n segmentChild,\n ])\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n\n const existingCacheNodeChild =\n existingSegmentMapChild !== undefined\n ? existingSegmentMapChild.get(segmentKeyChild)\n : undefined\n\n const taskChild = createCacheNodeOnNavigation(\n navigatedAt,\n routerStateChild,\n existingCacheNodeChild,\n prefetchDataChild,\n possiblyPartialPrefetchHead,\n isPrefetchHeadPartial,\n segmentPathChild,\n scrollableSegmentsResult\n )\n taskChildren.set(parallelRouteKey, taskChild)\n const dynamicRequestTreeChild = taskChild.dynamicRequestTree\n if (dynamicRequestTreeChild !== null) {\n // Something in the child tree is dynamic.\n needsDynamicRequest = true\n dynamicRequestTreeChildren[parallelRouteKey] = dynamicRequestTreeChild\n } else {\n dynamicRequestTreeChildren[parallelRouteKey] = routerStateChild\n }\n const newCacheNodeChild = taskChild.node\n if (newCacheNodeChild !== null) {\n const newSegmentMapChild: ChildSegmentMap = new Map()\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n cacheNodeChildren.set(parallelRouteKey, newSegmentMapChild)\n }\n }\n }\n\n return {\n // Since we're inside a new route tree, unlike the\n // `updateCacheNodeOnNavigation` path, the router state on the children\n // tasks is always the same as the router state we pass in. So we don't need\n // to clone/modify it.\n route: routerState,\n node: {\n lazyData: null,\n // Since this segment is already full, we don't need to use the\n // `prefetchRsc` field.\n rsc,\n prefetchRsc: null,\n head,\n prefetchHead: null,\n loading,\n parallelRoutes: cacheNodeChildren,\n navigatedAt: cacheNodeNavigatedAt,\n },\n dynamicRequestTree: needsDynamicRequest\n ? patchRouterStateWithNewChildren(routerState, dynamicRequestTreeChildren)\n : null,\n children: taskChildren,\n }\n}\n\nfunction patchRouterStateWithNewChildren(\n baseRouterState: FlightRouterState,\n newChildren: { [parallelRouteKey: string]: FlightRouterState }\n): FlightRouterState {\n const clone: FlightRouterState = [baseRouterState[0], newChildren]\n // Based on equivalent logic in apply-router-state-patch-to-tree, but should\n // confirm whether we need to copy all of these fields. Not sure the server\n // ever sends, e.g. the refetch marker.\n if (2 in baseRouterState) {\n clone[2] = baseRouterState[2]\n }\n if (3 in baseRouterState) {\n clone[3] = baseRouterState[3]\n }\n if (4 in baseRouterState) {\n clone[4] = baseRouterState[4]\n }\n return clone\n}\n\nfunction spawnPendingTask(\n navigatedAt: number,\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array<FlightSegmentPath>\n): SPANavigationTask {\n // Create a task that will later be fulfilled by data from the server.\n\n // Clone the prefetched route tree and the `refetch` marker to it. We'll send\n // this to the server so it knows where to start rendering.\n const dynamicRequestTree = patchRouterStateWithNewChildren(\n routerState,\n routerState[1]\n )\n dynamicRequestTree[3] = 'refetch'\n\n const newTask: Task = {\n route: routerState,\n\n // Corresponds to the part of the route that will be rendered on the server.\n node: createPendingCacheNode(\n navigatedAt,\n routerState,\n prefetchData,\n prefetchHead,\n isPrefetchHeadPartial,\n segmentPath,\n scrollableSegmentsResult\n ),\n // Because this is non-null, and it gets propagated up through the parent\n // tasks, the root task will know that it needs to perform a server request.\n dynamicRequestTree,\n children: null,\n }\n return newTask\n}\n\nfunction reuseActiveSegmentInDefaultSlot(\n oldUrl: URL,\n oldRouterState: FlightRouterState\n): Task {\n // This is a \"default\" segment. These are never sent by the server during a\n // soft navigation; instead, the client reuses whatever segment was already\n // active in that slot on the previous route. This means if we later need to\n // refresh the segment, it will have to be refetched from the previous route's\n // URL. We store it in the Flight Router State.\n //\n // TODO: We also mark the segment with a \"refresh\" marker but I think we can\n // get rid of that eventually by making sure we only add URLs to page segments\n // that are reused. Then the presence of the URL alone is enough.\n let reusedRouterState\n\n const oldRefreshMarker = oldRouterState[3]\n if (oldRefreshMarker === 'refresh') {\n // This segment was already reused from an even older route. Keep its\n // existing URL and refresh marker.\n reusedRouterState = oldRouterState\n } else {\n // This segment was not previously reused, and it's not on the new route.\n // So it must have been delivered in the old route.\n reusedRouterState = patchRouterStateWithNewChildren(\n oldRouterState,\n oldRouterState[1]\n )\n reusedRouterState[2] = createHrefFromUrl(oldUrl)\n reusedRouterState[3] = 'refresh'\n }\n\n return {\n route: reusedRouterState,\n node: null,\n dynamicRequestTree: null,\n children: null,\n }\n}\n\n// Writes a dynamic server response into the tree created by\n// updateCacheNodeOnNavigation. All pending promises that were spawned by the\n// navigation will be resolved, either with dynamic data from the server, or\n// `null` to indicate that the data is missing.\n//\n// A `null` value will trigger a lazy fetch during render, which will then patch\n// up the tree using the same mechanism as the non-PPR implementation\n// (serverPatchReducer).\n//\n// Usually, the server will respond with exactly the subset of data that we're\n// waiting for — everything below the nearest shared layout. But technically,\n// the server can return anything it wants.\n//\n// This does _not_ create a new tree; it modifies the existing one in place.\n// Which means it must follow the Suspense rules of cache safety.\nexport function listenForDynamicRequest(\n task: SPANavigationTask,\n responsePromise: Promise<FetchServerResponseResult>\n) {\n responsePromise.then(\n (result: FetchServerResponseResult) => {\n if (typeof result === 'string') {\n // Happens when navigating to page in `pages` from `app`. We shouldn't\n // get here because should have already handled this during\n // the prefetch.\n return\n }\n const { flightData, debugInfo } = result\n for (const normalizedFlightData of flightData) {\n const {\n segmentPath,\n tree: serverRouterState,\n seedData: dynamicData,\n head: dynamicHead,\n } = normalizedFlightData\n\n if (!dynamicData) {\n // This shouldn't happen. PPR should always send back a response.\n // However, `FlightDataPath` is a shared type and the pre-PPR handling of\n // this might return null.\n continue\n }\n\n writeDynamicDataIntoPendingTask(\n task,\n segmentPath,\n serverRouterState,\n dynamicData,\n dynamicHead,\n debugInfo\n )\n }\n\n // Now that we've exhausted all the data we received from the server, if\n // there are any remaining pending tasks in the tree, abort them now.\n // If there's any missing data, it will trigger a lazy fetch.\n abortTask(task, null, debugInfo)\n },\n (error: any) => {\n // This will trigger an error during render\n abortTask(task, error, null)\n }\n )\n}\n\nfunction writeDynamicDataIntoPendingTask(\n rootTask: SPANavigationTask,\n segmentPath: FlightSegmentPath,\n serverRouterState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: HeadData,\n debugInfo: Array<any> | null\n) {\n // The data sent by the server represents only a subtree of the app. We need\n // to find the part of the task tree that matches the server response, and\n // fulfill it using the dynamic data.\n //\n // segmentPath represents the parent path of subtree. It's a repeating pattern\n // of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // Iterate through the path and finish any tasks that match this payload.\n let task = rootTask\n for (let i = 0; i < segmentPath.length; i += 2) {\n const parallelRouteKey: string = segmentPath[i]\n const segment: Segment = segmentPath[i + 1]\n const taskChildren = task.children\n if (taskChildren !== null) {\n const taskChild = taskChildren.get(parallelRouteKey)\n if (taskChild !== undefined) {\n const taskSegment = taskChild.route[0]\n if (matchSegment(segment, taskSegment)) {\n // Found a match for this task. Keep traversing down the task tree.\n task = taskChild\n continue\n }\n }\n }\n // We didn't find a child task that matches the server data. Exit. We won't\n // abort the task, though, because a different FlightDataPath may be able to\n // fulfill it (see loop in listenForDynamicRequest). We only abort tasks\n // once we've run out of data.\n return\n }\n\n finishTaskUsingDynamicDataPayload(\n task,\n serverRouterState,\n dynamicData,\n dynamicHead,\n debugInfo\n )\n}\n\nfunction finishTaskUsingDynamicDataPayload(\n task: SPANavigationTask,\n serverRouterState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: HeadData,\n debugInfo: Array<any> | null\n) {\n if (task.dynamicRequestTree === null) {\n // Everything in this subtree is already complete. Bail out.\n return\n }\n\n // dynamicData may represent a larger subtree than the task. Before we can\n // finish the task, we need to line them up.\n const taskChildren = task.children\n const taskNode = task.node\n if (taskChildren === null) {\n // We've reached the leaf node of the pending task. The server data tree\n // lines up the pending Cache Node tree. We can now switch to the\n // normal algorithm.\n if (taskNode !== null) {\n finishPendingCacheNode(\n taskNode,\n task.route,\n serverRouterState,\n dynamicData,\n dynamicHead,\n debugInfo\n )\n // Set this to null to indicate that this task is now complete.\n task.dynamicRequestTree = null\n }\n return\n }\n // The server returned more data than we need to finish the task. Skip over\n // the extra segments until we reach the leaf task node.\n const serverChildren = serverRouterState[1]\n const dynamicDataChildren = dynamicData[1]\n\n for (const parallelRouteKey in serverRouterState) {\n const serverRouterStateChild: FlightRouterState =\n serverChildren[parallelRouteKey]\n const dynamicDataChild: CacheNodeSeedData | null | void =\n dynamicDataChildren[parallelRouteKey]\n\n const taskChild = taskChildren.get(parallelRouteKey)\n if (taskChild !== undefined) {\n const taskSegment = taskChild.route[0]\n if (\n matchSegment(serverRouterStateChild[0], taskSegment) &&\n dynamicDataChild !== null &&\n dynamicDataChild !== undefined\n ) {\n // Found a match for this task. Keep traversing down the task tree.\n return finishTaskUsingDynamicDataPayload(\n taskChild,\n serverRouterStateChild,\n dynamicDataChild,\n dynamicHead,\n debugInfo\n )\n }\n }\n // We didn't find a child task that matches the server data. We won't abort\n // the task, though, because a different FlightDataPath may be able to\n // fulfill it (see loop in listenForDynamicRequest). We only abort tasks\n // once we've run out of data.\n }\n}\n\nfunction createPendingCacheNode(\n navigatedAt: number,\n routerState: FlightRouterState,\n prefetchData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n segmentPath: FlightSegmentPath,\n scrollableSegmentsResult: Array<FlightSegmentPath>\n): ReadyCacheNode {\n const routerStateChildren = routerState[1]\n const prefetchDataChildren = prefetchData !== null ? prefetchData[1] : null\n\n const parallelRoutes = new Map()\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const prefetchDataChild: CacheNodeSeedData | null | void =\n prefetchDataChildren !== null\n ? prefetchDataChildren[parallelRouteKey]\n : null\n\n const segmentChild = routerStateChild[0]\n const segmentPathChild = segmentPath.concat([\n parallelRouteKey,\n segmentChild,\n ])\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n\n const newCacheNodeChild = createPendingCacheNode(\n navigatedAt,\n routerStateChild,\n prefetchDataChild === undefined ? null : prefetchDataChild,\n prefetchHead,\n isPrefetchHeadPartial,\n segmentPathChild,\n scrollableSegmentsResult\n )\n\n const newSegmentMapChild: ChildSegmentMap = new Map()\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n parallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n\n // The head is assigned to every leaf segment delivered by the server. Based\n // on corresponding logic in fill-lazy-items-till-leaf-with-head.ts\n const isLeafSegment = parallelRoutes.size === 0\n\n if (isLeafSegment) {\n // The segment path of every leaf segment (i.e. page) is collected into\n // a result array. This is used by the LayoutRouter to scroll to ensure that\n // new pages are visible after a navigation.\n // TODO: We should use a string to represent the segment path instead of\n // an array. We already use a string representation for the path when\n // accessing the Segment Cache, so we can use the same one.\n scrollableSegmentsResult.push(segmentPath)\n }\n\n const maybePrefetchRsc = prefetchData !== null ? prefetchData[0] : null\n return {\n lazyData: null,\n parallelRoutes: parallelRoutes,\n\n prefetchRsc: maybePrefetchRsc !== undefined ? maybePrefetchRsc : null,\n prefetchHead: isLeafSegment ? prefetchHead : [null, null],\n\n // Create a deferred promise. This will be fulfilled once the dynamic\n // response is received from the server.\n rsc: createDeferredRsc() as React.ReactNode,\n head: isLeafSegment ? (createDeferredRsc() as React.ReactNode) : null,\n\n // TODO: Technically, a loading boundary could contain dynamic data. We must\n // have separate `loading` and `prefetchLoading` fields to handle this, like\n // we do for the segment data and head.\n loading:\n prefetchData !== null\n ? (prefetchData[2] ?? null)\n : // If we don't have a prefetch, then we don't know if there's a loading component.\n // We'll fulfill it based on the dynamic response, just like `rsc` and `head`.\n createDeferredRsc<LoadingModuleData>(),\n\n navigatedAt,\n }\n}\n\nfunction finishPendingCacheNode(\n cacheNode: CacheNode,\n taskState: FlightRouterState,\n serverState: FlightRouterState,\n dynamicData: CacheNodeSeedData,\n dynamicHead: HeadData,\n debugInfo: Array<any> | null\n): void {\n // Writes a dynamic response into an existing Cache Node tree. This does _not_\n // create a new tree, it updates the existing tree in-place. So it must follow\n // the Suspense rules of cache safety — it can resolve pending promises, but\n // it cannot overwrite existing data. It can add segments to the tree (because\n // a missing segment will cause the layout router to suspend).\n // but it cannot delete them.\n //\n // We must resolve every promise in the tree, or else it will suspend\n // indefinitely. If we did not receive data for a segment, we will resolve its\n // data promise to `null` to trigger a lazy fetch during render.\n const taskStateChildren = taskState[1]\n const serverStateChildren = serverState[1]\n const dataChildren = dynamicData[1]\n\n // The router state that we traverse the tree with (taskState) is the same one\n // that we used to construct the pending Cache Node tree. That way we're sure\n // to resolve all the pending promises.\n const parallelRoutes = cacheNode.parallelRoutes\n for (let parallelRouteKey in taskStateChildren) {\n const taskStateChild: FlightRouterState =\n taskStateChildren[parallelRouteKey]\n const serverStateChild: FlightRouterState | void =\n serverStateChildren[parallelRouteKey]\n const dataChild: CacheNodeSeedData | null | void =\n dataChildren[parallelRouteKey]\n\n const segmentMapChild = parallelRoutes.get(parallelRouteKey)\n const taskSegmentChild = taskStateChild[0]\n const taskSegmentKeyChild = createRouterCacheKey(taskSegmentChild)\n\n const cacheNodeChild =\n segmentMapChild !== undefined\n ? segmentMapChild.get(taskSegmentKeyChild)\n : undefined\n\n if (cacheNodeChild !== undefined) {\n if (\n serverStateChild !== undefined &&\n matchSegment(taskSegmentChild, serverStateChild[0])\n ) {\n if (dataChild !== undefined && dataChild !== null) {\n // This is the happy path. Recursively update all the children.\n finishPendingCacheNode(\n cacheNodeChild,\n taskStateChild,\n serverStateChild,\n dataChild,\n dynamicHead,\n debugInfo\n )\n } else {\n // The server never returned data for this segment. Trigger a lazy\n // fetch during render. This shouldn't happen because the Route Tree\n // and the Seed Data tree sent by the server should always be the same\n // shape when part of the same server response.\n abortPendingCacheNode(taskStateChild, cacheNodeChild, null, debugInfo)\n }\n } else {\n // The server never returned data for this segment. Trigger a lazy\n // fetch during render.\n abortPendingCacheNode(taskStateChild, cacheNodeChild, null, debugInfo)\n }\n } else {\n // The server response matches what was expected to receive, but there's\n // no matching Cache Node in the task tree. This is a bug in the\n // implementation because we should have created a node for every\n // segment in the tree that's associated with this task.\n }\n }\n\n // Use the dynamic data from the server to fulfill the deferred RSC promise\n // on the Cache Node.\n const rsc = cacheNode.rsc\n const dynamicSegmentData = dynamicData[0]\n if (rsc === null) {\n // This is a lazy cache node. We can overwrite it. This is only safe\n // because we know that the LayoutRouter suspends if `rsc` is `null`.\n cacheNode.rsc = dynamicSegmentData\n } else if (isDeferredRsc(rsc)) {\n // This is a deferred RSC promise. We can fulfill it with the data we just\n // received from the server. If it was already resolved by a different\n // navigation, then this does nothing because we can't overwrite data.\n rsc.resolve(dynamicSegmentData, debugInfo)\n } else {\n // This is not a deferred RSC promise, nor is it empty, so it must have\n // been populated by a different navigation. We must not overwrite it.\n }\n\n // If we navigated without a prefetch, then `loading` will be a deferred promise too.\n // Fulfill it using the dynamic response so that we can display the loading boundary.\n const loading = cacheNode.loading\n if (isDeferredRsc(loading)) {\n const dynamicLoading = dynamicData[2]\n loading.resolve(dynamicLoading, debugInfo)\n }\n\n // Check if this is a leaf segment. If so, it will have a `head` property with\n // a pending promise that needs to be resolved with the dynamic head from\n // the server.\n const head = cacheNode.head\n if (isDeferredRsc(head)) {\n head.resolve(dynamicHead, debugInfo)\n }\n}\n\nexport function abortTask(\n task: SPANavigationTask,\n error: any,\n debugInfo: Array<any> | null\n): void {\n const cacheNode = task.node\n if (cacheNode === null) {\n // This indicates the task is already complete.\n return\n }\n\n const taskChildren = task.children\n if (taskChildren === null) {\n // Reached the leaf task node. This is the root of a pending cache\n // node tree.\n abortPendingCacheNode(task.route, cacheNode, error, debugInfo)\n } else {\n // This is an intermediate task node. Keep traversing until we reach a\n // task node with no children. That will be the root of the cache node tree\n // that needs to be resolved.\n for (const taskChild of taskChildren.values()) {\n abortTask(taskChild, error, debugInfo)\n }\n }\n\n // Set this to null to indicate that this task is now complete.\n task.dynamicRequestTree = null\n}\n\nfunction abortPendingCacheNode(\n routerState: FlightRouterState,\n cacheNode: CacheNode,\n error: any,\n debugInfo: Array<any> | null\n): void {\n // For every pending segment in the tree, resolve its `rsc` promise to `null`\n // to trigger a lazy fetch during render.\n //\n // Or, if an error object is provided, it will error instead.\n const routerStateChildren = routerState[1]\n const parallelRoutes = cacheNode.parallelRoutes\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const segmentMapChild = parallelRoutes.get(parallelRouteKey)\n if (segmentMapChild === undefined) {\n // This shouldn't happen because we're traversing the same tree that was\n // used to construct the cache nodes in the first place.\n continue\n }\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const cacheNodeChild = segmentMapChild.get(segmentKeyChild)\n if (cacheNodeChild !== undefined) {\n abortPendingCacheNode(routerStateChild, cacheNodeChild, error, debugInfo)\n } else {\n // This shouldn't happen because we're traversing the same tree that was\n // used to construct the cache nodes in the first place.\n }\n }\n\n const rsc = cacheNode.rsc\n if (isDeferredRsc(rsc)) {\n if (error === null) {\n // This will trigger a lazy fetch during render.\n rsc.resolve(null, debugInfo)\n } else {\n // This will trigger an error during rendering.\n rsc.reject(error, debugInfo)\n }\n }\n\n const loading = cacheNode.loading\n if (isDeferredRsc(loading)) {\n loading.resolve(null, debugInfo)\n }\n\n // Check if this is a leaf segment. If so, it will have a `head` property with\n // a pending promise that needs to be resolved. If an error was provided, we\n // will not resolve it with an error, since this is rendered at the root of\n // the app. We want the segment to error, not the entire app.\n const head = cacheNode.head\n if (isDeferredRsc(head)) {\n head.resolve(null, debugInfo)\n }\n}\n\nexport function updateCacheNodeOnPopstateRestoration(\n oldCacheNode: CacheNode,\n routerState: FlightRouterState\n): ReadyCacheNode {\n // A popstate navigation reads data from the local cache. It does not issue\n // new network requests (unless the cache entries have been evicted). So, we\n // update the cache to drop the prefetch data for any segment whose dynamic\n // data was already received. This prevents an unnecessary flash back to PPR\n // state during a back/forward navigation.\n //\n // This function clones the entire cache node tree and sets the `prefetchRsc`\n // field to `null` to prevent it from being rendered. We can't mutate the node\n // in place because this is a concurrent data structure.\n\n const routerStateChildren = routerState[1]\n const oldParallelRoutes = oldCacheNode.parallelRoutes\n const newParallelRoutes = new Map(oldParallelRoutes)\n for (let parallelRouteKey in routerStateChildren) {\n const routerStateChild: FlightRouterState =\n routerStateChildren[parallelRouteKey]\n const segmentChild = routerStateChild[0]\n const segmentKeyChild = createRouterCacheKey(segmentChild)\n const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey)\n if (oldSegmentMapChild !== undefined) {\n const oldCacheNodeChild = oldSegmentMapChild.get(segmentKeyChild)\n if (oldCacheNodeChild !== undefined) {\n const newCacheNodeChild = updateCacheNodeOnPopstateRestoration(\n oldCacheNodeChild,\n routerStateChild\n )\n const newSegmentMapChild = new Map(oldSegmentMapChild)\n newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild)\n newParallelRoutes.set(parallelRouteKey, newSegmentMapChild)\n }\n }\n }\n\n // Only show prefetched data if the dynamic data is still pending.\n //\n // Tehnically, what we're actually checking is whether the dynamic network\n // response was received. But since it's a streaming response, this does not\n // mean that all the dynamic data has fully streamed in. It just means that\n // _some_ of the dynamic data was received. But as a heuristic, we assume that\n // the rest dynamic data will stream in quickly, so it's still better to skip\n // the prefetch state.\n const rsc = oldCacheNode.rsc\n const shouldUsePrefetch = isDeferredRsc(rsc) && rsc.status === 'pending'\n\n return {\n lazyData: null,\n rsc,\n head: oldCacheNode.head,\n\n prefetchHead: shouldUsePrefetch ? oldCacheNode.prefetchHead : [null, null],\n prefetchRsc: shouldUsePrefetch ? oldCacheNode.prefetchRsc : null,\n loading: oldCacheNode.loading,\n\n // These are the cloned children we computed above\n parallelRoutes: newParallelRoutes,\n\n navigatedAt: oldCacheNode.navigatedAt,\n }\n}\n\nconst DEFERRED = Symbol()\n\ntype PendingDeferredRsc<T> = Promise<T> & {\n status: 'pending'\n resolve: (value: T, debugInfo: Array<any> | null) => void\n reject: (error: any, debugInfo: Array<any> | null) => void\n tag: Symbol\n _debugInfo: Array<any>\n}\n\ntype FulfilledDeferredRsc<T> = Promise<T> & {\n status: 'fulfilled'\n value: T\n resolve: (value: T, debugInfo: Array<any> | null) => void\n reject: (error: any, debugInfo: Array<any> | null) => void\n tag: Symbol\n _debugInfo: Array<any>\n}\n\ntype RejectedDeferredRsc<T> = Promise<T> & {\n status: 'rejected'\n reason: any\n resolve: (value: T, debugInfo: Array<any> | null) => void\n reject: (error: any, debugInfo: Array<any> | null) => void\n tag: Symbol\n _debugInfo: Array<any>\n}\n\ntype DeferredRsc<T extends React.ReactNode = React.ReactNode> =\n | PendingDeferredRsc<T>\n | FulfilledDeferredRsc<T>\n | RejectedDeferredRsc<T>\n\n// This type exists to distinguish a DeferredRsc from a Flight promise. It's a\n// compromise to avoid adding an extra field on every Cache Node, which would be\n// awkward because the pre-PPR parts of codebase would need to account for it,\n// too. We can remove it once type Cache Node type is more settled.\nfunction isDeferredRsc(value: any): value is DeferredRsc {\n return value && typeof value === 'object' && value.tag === DEFERRED\n}\n\nfunction createDeferredRsc<\n T extends React.ReactNode = React.ReactNode,\n>(): PendingDeferredRsc<T> {\n // Create an unresolved promise that represents data derived from a Flight\n // response. The promise will be resolved later as soon as we start receiving\n // data from the server, i.e. as soon as the Flight client decodes and returns\n // the top-level response object.\n\n // The `_debugInfo` field contains profiling information. Promises that are\n // created by Flight already have this info added by React; for any derived\n // promise created by the router, we need to transfer the Flight debug info\n // onto the derived promise.\n //\n // The debug info represents the latency between the start of the navigation\n // and the start of rendering. (It does not represent the time it takes for\n // whole stream to finish.)\n const debugInfo: Array<any> = []\n\n let resolve: any\n let reject: any\n const pendingRsc = new Promise<T>((res, rej) => {\n resolve = res\n reject = rej\n }) as PendingDeferredRsc<T>\n pendingRsc.status = 'pending'\n pendingRsc.resolve = (value: T, responseDebugInfo: Array<any> | null) => {\n if (pendingRsc.status === 'pending') {\n const fulfilledRsc: FulfilledDeferredRsc<T> = pendingRsc as any\n fulfilledRsc.status = 'fulfilled'\n fulfilledRsc.value = value\n if (responseDebugInfo !== null) {\n // Transfer the debug info to the derived promise.\n debugInfo.push.apply(debugInfo, responseDebugInfo)\n }\n resolve(value)\n }\n }\n pendingRsc.reject = (error: any, responseDebugInfo: Array<any> | null) => {\n if (pendingRsc.status === 'pending') {\n const rejectedRsc: RejectedDeferredRsc<T> = pendingRsc as any\n rejectedRsc.status = 'rejected'\n rejectedRsc.reason = error\n if (responseDebugInfo !== null) {\n // Transfer the debug info to the derived promise.\n debugInfo.push.apply(debugInfo, responseDebugInfo)\n }\n reject(error)\n }\n }\n pendingRsc.tag = DEFERRED\n pendingRsc._debugInfo = debugInfo\n\n return pendingRsc\n}\n","import type { FlightRouterState } from '../../../shared/lib/app-router-types'\n\nexport function isNavigatingToNewRootLayout(\n currentTree: FlightRouterState,\n nextTree: FlightRouterState\n): boolean {\n // Compare segments\n const currentTreeSegment = currentTree[0]\n const nextTreeSegment = nextTree[0]\n\n // If any segment is different before we find the root layout, the root layout has changed.\n // E.g. /same/(group1)/layout.js -> /same/(group2)/layout.js\n // First segment is 'same' for both, keep looking. (group1) changed to (group2) before the root layout was found, it must have changed.\n if (Array.isArray(currentTreeSegment) && Array.isArray(nextTreeSegment)) {\n // Compare dynamic param name and type but ignore the value, different values would not affect the current root layout\n // /[name] - /slug1 and /slug2, both values (slug1 & slug2) still has the same layout /[name]/layout.js\n if (\n currentTreeSegment[0] !== nextTreeSegment[0] ||\n currentTreeSegment[2] !== nextTreeSegment[2]\n ) {\n return true\n }\n } else if (currentTreeSegment !== nextTreeSegment) {\n return true\n }\n\n // Current tree root layout found\n if (currentTree[4]) {\n // If the next tree doesn't have the root layout flag, it must have changed.\n return !nextTree[4]\n }\n // Current tree didn't have its root layout here, must have changed.\n if (nextTree[4]) {\n return true\n }\n // We can't assume it's `parallelRoutes.children` here in case the root layout is `app/@something/layout.js`\n // But it's not possible to be more than one parallelRoutes before the root layout is found\n // TODO-APP: change to traverse all parallel routes\n const currentTreeChild = Object.values(currentTree[1])[0]\n const nextTreeChild = Object.values(nextTree[1])[0]\n if (!currentTreeChild || !nextTreeChild) return true\n return isNavigatingToNewRootLayout(currentTreeChild, nextTreeChild)\n}\n","import type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../../shared/lib/app-router-types'\nimport { createHrefFromUrl } from '../create-href-from-url'\nimport type {\n Mutable,\n NavigateAction,\n ReadonlyReducerState,\n ReducerState,\n} from '../router-reducer-types'\nimport { handleMutable } from '../handle-mutable'\n\nimport {\n navigate as navigateUsingSegmentCache,\n NavigationResultTag,\n type NavigationResult,\n} from '../../segment-cache'\n\n// These values are set by `define-env-plugin` (based on `nextConfig.experimental.staleTimes`)\n// and default to 5 minutes (static) / 0 seconds (dynamic)\nexport const DYNAMIC_STALETIME_MS =\n Number(process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME) * 1000\n\nexport const STATIC_STALETIME_MS =\n Number(process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME) * 1000\n\nexport function handleExternalUrl(\n state: ReadonlyReducerState,\n mutable: Mutable,\n url: string,\n pendingPush: boolean\n) {\n mutable.mpaNavigation = true\n mutable.canonicalUrl = url\n mutable.pendingPush = pendingPush\n mutable.scrollableSegments = undefined\n\n return handleMutable(state, mutable)\n}\n\nexport function generateSegmentsFromPatch(\n flightRouterPatch: FlightRouterState\n): FlightSegmentPath[] {\n const segments: FlightSegmentPath[] = []\n const [segment, parallelRoutes] = flightRouterPatch\n\n if (Object.keys(parallelRoutes).length === 0) {\n return [[segment]]\n }\n\n for (const [parallelRouteKey, parallelRoute] of Object.entries(\n parallelRoutes\n )) {\n for (const childSegment of generateSegmentsFromPatch(parallelRoute)) {\n // If the segment is empty, it means we are at the root of the tree\n if (segment === '') {\n segments.push([parallelRouteKey, ...childSegment])\n } else {\n segments.push([segment, parallelRouteKey, ...childSegment])\n }\n }\n }\n\n return segments\n}\n\nfunction handleNavigationResult(\n url: URL,\n state: ReadonlyReducerState,\n mutable: Mutable,\n pendingPush: boolean,\n result: NavigationResult\n): ReducerState {\n switch (result.tag) {\n case NavigationResultTag.MPA: {\n // Perform an MPA navigation.\n const newUrl = result.data\n return handleExternalUrl(state, mutable, newUrl, pendingPush)\n }\n case NavigationResultTag.NoOp: {\n // The server responded with no change to the current page. However, if\n // the URL changed, we still need to update that.\n const newCanonicalUrl = result.data.canonicalUrl\n mutable.canonicalUrl = newCanonicalUrl\n\n // Check if the only thing that changed was the hash fragment.\n const oldUrl = new URL(state.canonicalUrl, url)\n const onlyHashChange =\n // We don't need to compare the origins, because client-driven\n // navigations are always same-origin.\n url.pathname === oldUrl.pathname &&\n url.search === oldUrl.search &&\n url.hash !== oldUrl.hash\n if (onlyHashChange) {\n // The only updated part of the URL is the hash.\n mutable.onlyHashChange = true\n mutable.shouldScroll = result.data.shouldScroll\n mutable.hashFragment = url.hash\n // Setting this to an empty array triggers a scroll for all new and\n // updated segments. See `ScrollAndFocusHandler` for more details.\n mutable.scrollableSegments = []\n }\n\n return handleMutable(state, mutable)\n }\n case NavigationResultTag.Success: {\n // Received a new result.\n mutable.cache = result.data.cacheNode\n mutable.patchedTree = result.data.flightRouterState\n mutable.renderedSearch = result.data.renderedSearch\n mutable.canonicalUrl = result.data.canonicalUrl\n mutable.scrollableSegments = result.data.scrollableSegments\n mutable.shouldScroll = result.data.shouldScroll\n mutable.hashFragment = result.data.hash\n return handleMutable(state, mutable)\n }\n case NavigationResultTag.Async: {\n return result.data.then(\n (asyncResult) =>\n handleNavigationResult(url, state, mutable, pendingPush, asyncResult),\n // If the navigation failed, return the current state.\n // TODO: This matches the current behavior but we need to do something\n // better here if the network fails.\n () => {\n return state\n }\n )\n }\n default: {\n result satisfies never\n return state\n }\n }\n}\n\nexport function navigateReducer(\n state: ReadonlyReducerState,\n action: NavigateAction\n): ReducerState {\n const { url, isExternalUrl, navigateType, shouldScroll } = action\n const mutable: Mutable = {}\n const href = createHrefFromUrl(url)\n const pendingPush = navigateType === 'push'\n\n mutable.preserveCustomHistoryState = false\n mutable.pendingPush = pendingPush\n\n if (isExternalUrl) {\n return handleExternalUrl(state, mutable, url.toString(), pendingPush)\n }\n\n // Handles case where `<meta http-equiv=\"refresh\">` tag is present,\n // which will trigger an MPA navigation.\n if (document.getElementById('__next-page-redirect')) {\n return handleExternalUrl(state, mutable, href, pendingPush)\n }\n\n // Temporary glue code between the router reducer and the new navigation\n // implementation. Eventually we'll rewrite the router reducer to a\n // state machine.\n const currentUrl = new URL(state.canonicalUrl, location.origin)\n const result = navigateUsingSegmentCache(\n url,\n currentUrl,\n state.cache,\n state.tree,\n state.nextUrl,\n shouldScroll,\n mutable\n )\n return handleNavigationResult(url, state, mutable, pendingPush, result)\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../shared/lib/app-router-types'\nimport type { FetchServerResponseResult } from './fetch-server-response'\n\nexport const ACTION_REFRESH = 'refresh'\nexport const ACTION_NAVIGATE = 'navigate'\nexport const ACTION_RESTORE = 'restore'\nexport const ACTION_SERVER_PATCH = 'server-patch'\nexport const ACTION_HMR_REFRESH = 'hmr-refresh'\nexport const ACTION_SERVER_ACTION = 'server-action'\n\nexport type RouterChangeByServerResponse = ({\n navigatedAt,\n previousTree,\n serverResponse,\n}: {\n navigatedAt: number\n previousTree: FlightRouterState\n serverResponse: FetchServerResponseResult\n}) => void\n\nexport interface Mutable {\n mpaNavigation?: boolean\n patchedTree?: FlightRouterState\n renderedSearch?: string\n canonicalUrl?: string\n scrollableSegments?: FlightSegmentPath[]\n pendingPush?: boolean\n cache?: CacheNode\n hashFragment?: string\n shouldScroll?: boolean\n preserveCustomHistoryState?: boolean\n onlyHashChange?: boolean\n collectedDebugInfo?: Array<unknown>\n}\n\nexport interface ServerActionMutable extends Mutable {\n inFlightServerAction?: Promise<any> | null\n}\n\n/**\n * Refresh triggers a refresh of the full page data.\n * - fetches the Flight data and fills rsc at the root of the cache.\n * - The router state is updated at the root.\n */\nexport interface RefreshAction {\n type: typeof ACTION_REFRESH\n origin: Location['origin']\n}\n\nexport interface HmrRefreshAction {\n type: typeof ACTION_HMR_REFRESH\n origin: Location['origin']\n}\n\nexport type ServerActionDispatcher = (\n args: Omit<\n ServerActionAction,\n 'type' | 'mutable' | 'navigate' | 'changeByServerResponse' | 'cache'\n >\n) => void\n\nexport interface ServerActionAction {\n type: typeof ACTION_SERVER_ACTION\n actionId: string\n actionArgs: any[]\n resolve: (value: any) => void\n reject: (reason?: any) => void\n didRevalidate?: boolean\n}\n\n/**\n * Navigate triggers a navigation to the provided url. It supports two types: `push` and `replace`.\n *\n * `navigateType`:\n * - `push` - pushes a new history entry in the browser history\n * - `replace` - replaces the current history entry in the browser history\n *\n * Navigate has multiple cache heuristics:\n * - page was prefetched\n * - Apply router state tree from prefetch\n * - Apply Flight data from prefetch to the cache\n * - If Flight data is a string, it's a redirect and the state is updated to trigger a redirect\n * - Check if hard navigation is needed\n * - Hard navigation happens when a dynamic parameter below the common layout changed\n * - When hard navigation is needed the cache is invalidated below the flightSegmentPath\n * - The missing cache nodes of the page will be fetched in layout-router and trigger the SERVER_PATCH action\n * - If hard navigation is not needed\n * - The cache is reused\n * - If any cache nodes are missing they'll be fetched in layout-router and trigger the SERVER_PATCH action\n * - page was not prefetched\n * - The navigate was called from `next/router` (`router.push()` / `router.replace()`) / `next/link` without prefetched data available (e.g. the prefetch didn't come back from the server before clicking the link)\n * - Flight data is fetched in the reducer (suspends the reducer)\n * - Router state tree is created based on Flight data\n * - Cache is filled based on the Flight data\n *\n * Above steps explain 3 cases:\n * - `soft` - Reuses the existing cache and fetches missing nodes in layout-router.\n * - `hard` - Creates a new cache where cache nodes are removed below the common layout and fetches missing nodes in layout-router.\n * - `optimistic` (explicit no prefetch) - Creates a new cache and kicks off the data fetch in the reducer. The data fetch is awaited in the layout-router.\n */\nexport interface NavigateAction {\n type: typeof ACTION_NAVIGATE\n url: URL\n isExternalUrl: boolean\n locationSearch: Location['search']\n navigateType: 'push' | 'replace'\n shouldScroll: boolean\n}\n\n/**\n * Restore applies the provided router state.\n * - Used for `popstate` (back/forward navigation) where a known router state has to be applied.\n * - Also used when syncing the router state with `pushState`/`replaceState` calls.\n * - Router state is applied as-is from the history state, if available.\n * - If the history state does not contain the router state, the existing router state is used.\n * - If any cache node is missing it will be fetched in layout-router during rendering and the server-patch case.\n * - If existing cache nodes match these are used.\n */\nexport interface RestoreAction {\n type: typeof ACTION_RESTORE\n url: URL\n historyState: AppHistoryState | undefined\n}\n\nexport type AppHistoryState = {\n tree: FlightRouterState\n renderedSearch: string\n}\n\n/**\n * Server-patch applies the provided Flight data to the cache and router tree.\n * - Only triggered in layout-router.\n * - Creates a new cache and router state with the Flight data applied.\n */\nexport interface ServerPatchAction {\n type: typeof ACTION_SERVER_PATCH\n navigatedAt: number\n serverResponse: FetchServerResponseResult\n previousTree: FlightRouterState\n}\n\n/**\n * PrefetchKind defines the type of prefetching that should be done.\n * - `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully.\n * - `full` - prefetch the page data fully.\n * - `temporary` - a temporary prefetch entry is added to the cache, this is used when prefetch={false} is used in next/link or when you push a route programmatically.\n */\n\nexport enum PrefetchKind {\n AUTO = 'auto',\n FULL = 'full',\n TEMPORARY = 'temporary',\n}\n\n/**\n * Prefetch adds the provided FlightData to the prefetch cache\n * - Creates the router state tree based on the patch in FlightData\n * - Adds the FlightData to the prefetch cache\n * - In ACTION_NAVIGATE the prefetch cache is checked and the router state tree and FlightData are applied.\n */\n\nexport interface PushRef {\n /**\n * If the app-router should push a new history entry in app-router's useEffect()\n */\n pendingPush: boolean\n /**\n * Multi-page navigation through location.href.\n */\n mpaNavigation: boolean\n /**\n * Skip applying the router state to the browser history state.\n */\n preserveCustomHistoryState: boolean\n}\n\nexport type FocusAndScrollRef = {\n /**\n * If focus and scroll should be set in the layout-router's useEffect()\n */\n apply: boolean\n /**\n * The hash fragment that should be scrolled to.\n */\n hashFragment: string | null\n /**\n * The paths of the segments that should be focused.\n */\n segmentPaths: FlightSegmentPath[]\n /**\n * If only the URLs hash fragment changed\n */\n onlyHashChange: boolean\n}\n\n/**\n * Handles keeping the state of app-router.\n */\nexport type AppRouterState = {\n /**\n * The router state, this is written into the history state in app-router using replaceState/pushState.\n * - Has to be serializable as it is written into the history state.\n * - Holds which segments and parallel routes are shown on the screen.\n */\n tree: FlightRouterState\n /**\n * The cache holds React nodes for every segment that is shown on screen as well as previously shown segments.\n * It also holds in-progress data requests.\n */\n cache: CacheNode\n /**\n * Decides if the update should create a new history entry and if the navigation has to trigger a browser navigation.\n */\n pushRef: PushRef\n /**\n * Decides if the update should apply scroll and focus management.\n */\n focusAndScrollRef: FocusAndScrollRef\n /**\n * The canonical url that is pushed/replaced.\n * - This is the url you see in the browser.\n */\n canonicalUrl: string\n renderedSearch: string\n /**\n * The underlying \"url\" representing the UI state, which is used for intercepting routes.\n */\n nextUrl: string | null\n\n /**\n * The previous next-url that was used previous to a dynamic navigation.\n */\n previousNextUrl: string | null\n\n debugInfo: Array<unknown> | null\n}\n\nexport type ReadonlyReducerState = Readonly<AppRouterState>\nexport type ReducerState =\n | (Promise<AppRouterState> & { _debugInfo?: Array<unknown> })\n | AppRouterState\nexport type ReducerActions = Readonly<\n | RefreshAction\n | NavigateAction\n | RestoreAction\n | ServerPatchAction\n | HmrRefreshAction\n | ServerActionAction\n>\n","'use client'\n\nimport { computeCacheBustingSearchParam } from '../../../shared/lib/router/utils/cache-busting-search-param'\nimport {\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_URL,\n NEXT_RSC_UNION_QUERY,\n} from '../app-router-headers'\nimport type { RequestHeaders } from './fetch-server-response'\n\n/**\n * Mutates the provided URL by adding a cache-busting search parameter for CDNs that don't\n * support custom headers. This helps avoid caching conflicts by making each request unique.\n *\n * Rather than relying on the Vary header which some CDNs ignore, we append a search param\n * to create a unique URL that forces a fresh request.\n *\n * Example:\n * URL before: https://example.com/path?query=1\n * URL after: https://example.com/path?query=1&_rsc=abc123\n *\n * Note: This function mutates the input URL directly and does not return anything.\n *\n * TODO: Since we need to use a search param anyway, we could simplify by removing the custom\n * headers approach entirely and just use search params.\n */\nexport const setCacheBustingSearchParam = (\n url: URL,\n headers: RequestHeaders\n): void => {\n const uniqueCacheKey = computeCacheBustingSearchParam(\n headers[NEXT_ROUTER_PREFETCH_HEADER],\n headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER],\n headers[NEXT_ROUTER_STATE_TREE_HEADER],\n headers[NEXT_URL]\n )\n setCacheBustingSearchParamWithHash(url, uniqueCacheKey)\n}\n\n/**\n * Sets a cache-busting search parameter on a URL using a provided hash value.\n *\n * This function performs the same logic as `setCacheBustingSearchParam` but accepts\n * a pre-computed hash instead of computing it from headers.\n *\n * Example:\n * URL before: https://example.com/path?query=1\n * hash: \"abc123\"\n * URL after: https://example.com/path?query=1&_rsc=abc123\n *\n * If the hash is null, we will set `_rsc` search param without a value.\n * Like this: https://example.com/path?query=1&_rsc\n *\n * Note: This function mutates the input URL directly and does not return anything.\n */\nexport const setCacheBustingSearchParamWithHash = (\n url: URL,\n hash: string\n): void => {\n /**\n * Note that we intentionally do not use `url.searchParams.set` here:\n *\n * const url = new URL('https://example.com/search?q=custom%20spacing');\n * url.searchParams.set('_rsc', 'abc123');\n * console.log(url.toString()); // Outputs: https://example.com/search?q=custom+spacing&_rsc=abc123\n * ^ <--- this is causing confusion\n * This is in fact intended based on https://url.spec.whatwg.org/#interface-urlsearchparams, but\n * we want to preserve the %20 as %20 if that's what the user passed in, hence the custom\n * logic below.\n */\n const existingSearch = url.search\n const rawQuery = existingSearch.startsWith('?')\n ? existingSearch.slice(1)\n : existingSearch\n\n // Always remove any existing cache busting param and add a fresh one to ensure\n // we have the correct value based on current request headers\n const pairs = rawQuery\n .split('&')\n .filter((pair) => pair && !pair.startsWith(`${NEXT_RSC_UNION_QUERY}=`))\n\n if (hash.length > 0) {\n pairs.push(`${NEXT_RSC_UNION_QUERY}=${hash}`)\n } else {\n pairs.push(`${NEXT_RSC_UNION_QUERY}`)\n }\n url.search = pairs.length ? `?${pairs.join('&')}` : ''\n}\n","// TypeScript trick to simulate opaque types, like in Flow.\ntype Opaque<K, T> = T & { __brand: K }\n\n// Only functions in this module should be allowed to create CacheKeys.\nexport type NormalizedHref = Opaque<'NormalizedHref', string>\nexport type NormalizedSearch = Opaque<'NormalizedSearch', string>\nexport type NormalizedNextUrl = Opaque<'NormalizedNextUrl', string>\n\nexport type RouteCacheKey = Opaque<\n 'RouteCacheKey',\n {\n href: NormalizedHref\n search: NormalizedSearch\n nextUrl: NormalizedNextUrl | null\n\n // TODO: Eventually the dynamic params will be added here, too.\n }\n>\n\nexport function createCacheKey(\n originalHref: string,\n nextUrl: string | null\n): RouteCacheKey {\n // TODO: We should remove the hash from the href and track that separately.\n // There's no reason to vary route entries by hash.\n const originalUrl = new URL(originalHref)\n const cacheKey = {\n href: originalHref as NormalizedHref,\n search: originalUrl.search as NormalizedSearch,\n nextUrl: nextUrl as NormalizedNextUrl | null,\n } as RouteCacheKey\n return cacheKey\n}\n","import type {\n TreePrefetch,\n RootTreePrefetch,\n SegmentPrefetch,\n} from '../../../server/app-render/collect-segment-data'\nimport type {\n HeadData,\n LoadingModuleData,\n} from '../../../shared/lib/app-router-types'\nimport type {\n CacheNodeSeedData,\n DynamicParamTypesShort,\n Segment as FlightRouterStateSegment,\n} from '../../../shared/lib/app-router-types'\nimport { HasLoadingBoundary } from '../../../shared/lib/app-router-types'\nimport {\n NEXT_DID_POSTPONE_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_ROUTER_STALE_TIME_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_URL,\n RSC_CONTENT_TYPE_HEADER,\n RSC_HEADER,\n} from '../app-router-headers'\nimport {\n createFetch,\n createFromNextReadableStream,\n type RSCResponse,\n type RequestHeaders,\n} from '../router-reducer/fetch-server-response'\nimport {\n pingPrefetchTask,\n isPrefetchTaskDirty,\n type PrefetchTask,\n type PrefetchSubtaskResult,\n startRevalidationCooldown,\n} from './scheduler'\nimport { getAppBuildId } from '../../app-build-id'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport type {\n NormalizedHref,\n NormalizedNextUrl,\n NormalizedSearch,\n RouteCacheKey,\n} from './cache-key'\n// TODO: Rename this module to avoid confusion with other types of cache keys\nimport { createCacheKey as createPrefetchRequestKey } from './cache-key'\nimport {\n doesStaticSegmentAppearInURL,\n getCacheKeyForDynamicParam,\n getParamValueFromCacheKey,\n getRenderedPathname,\n getRenderedSearch,\n parseDynamicParamFromURLPart,\n type RouteParam,\n} from '../../route-params'\nimport { createTupleMap, type TupleMap, type Prefix } from './tuple-map'\nimport { createLRU } from './lru'\nimport {\n appendSegmentCacheKeyPart,\n appendSegmentRequestKeyPart,\n convertSegmentPathToStaticExportFilename,\n createSegmentCacheKeyPart,\n createSegmentRequestKeyPart,\n ROOT_SEGMENT_CACHE_KEY,\n ROOT_SEGMENT_REQUEST_KEY,\n type SegmentCacheKey,\n type SegmentRequestKey,\n} from '../../../shared/lib/segment-cache/segment-value-encoding'\nimport type {\n FlightRouterState,\n NavigationFlightResponse,\n} from '../../../shared/lib/app-router-types'\nimport {\n normalizeFlightData,\n prepareFlightRouterStateForRequest,\n} from '../../flight-data-helpers'\nimport { STATIC_STALETIME_MS } from '../router-reducer/reducers/navigate-reducer'\nimport { pingVisibleLinks } from '../links'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\nimport {\n DOC_PREFETCH_RANGE_HEADER_VALUE,\n doesExportedHtmlMatchBuildId,\n} from '../../../shared/lib/segment-cache/output-export-prefetch-encoding'\nimport { FetchStrategy } from '../segment-cache'\nimport { createPromiseWithResolvers } from '../../../shared/lib/promise-with-resolvers'\n\n// A note on async/await when working in the prefetch cache:\n//\n// Most async operations in the prefetch cache should *not* use async/await,\n// Instead, spawn a subtask that writes the results to a cache entry, and attach\n// a \"ping\" listener to notify the prefetch queue to try again.\n//\n// The reason is we need to be able to access the segment cache and traverse its\n// data structures synchronously. For example, if there's a synchronous update\n// we can take an immediate snapshot of the cache to produce something we can\n// render. Limiting the use of async/await also makes it easier to avoid race\n// conditions, which is especially important because is cache is mutable.\n//\n// Another reason is that while we're performing async work, it's possible for\n// existing entries to become stale, or for Link prefetches to be removed from\n// the queue. For optimal scheduling, we need to be able to \"cancel\" subtasks\n// that are no longer needed. So, when a segment is received from the server, we\n// restart from the root of the tree that's being prefetched, to confirm all the\n// parent segments are still cached. If the segment is no longer reachable from\n// the root, then it's effectively canceled. This is similar to the design of\n// Rust Futures, or React Suspense.\n\nexport type RouteTree = {\n cacheKey: SegmentCacheKey\n requestKey: SegmentRequestKey\n // TODO: Remove the `segment` field, now that it can be reconstructed\n // from `param`.\n segment: FlightRouterStateSegment\n param: RouteParam | null\n slots: null | {\n [parallelRouteKey: string]: RouteTree\n }\n isRootLayout: boolean\n\n // If this is a dynamic route, indicates whether there is a loading boundary\n // somewhere in the tree. If not, we can skip the prefetch for the data,\n // because we know it would be an empty response. (For a static/PPR route,\n // this value is disregarded, because in that model `loading.tsx` is treated\n // like any other Suspense boundary.)\n hasLoadingBoundary: HasLoadingBoundary\n\n // Indicates whether this route has a runtime prefetch that we can request.\n // This is determined by the server; it's not purely a user configuration\n // because the server may determine that a route is fully static and doesn't\n // need runtime prefetching regardless of the configuration.\n hasRuntimePrefetch: boolean\n}\n\ntype RouteCacheEntryShared = {\n staleAt: number\n // This is false only if we're certain the route cannot be intercepted. It's\n // true in all other cases, including on initialization when we haven't yet\n // received a response from the server.\n couldBeIntercepted: boolean\n\n // See comment in scheduler.ts for context\n TODO_metadataStatus: EntryStatus.Empty | EntryStatus.Fulfilled\n TODO_isHeadDynamic: boolean\n\n // LRU-related fields\n keypath: null | Prefix<RouteCacheKeypath>\n next: null | RouteCacheEntry\n prev: null | RouteCacheEntry\n size: number\n}\n\n/**\n * Tracks the status of a cache entry as it progresses from no data (Empty),\n * waiting for server data (Pending), and finished (either Fulfilled or\n * Rejected depending on the response from the server.\n */\nexport const enum EntryStatus {\n Empty = 0,\n Pending = 1,\n Fulfilled = 2,\n Rejected = 3,\n}\n\ntype PendingRouteCacheEntry = RouteCacheEntryShared & {\n status: EntryStatus.Empty | EntryStatus.Pending\n blockedTasks: Set<PrefetchTask> | null\n canonicalUrl: null\n renderedSearch: null\n tree: null\n head: HeadData | null\n isHeadPartial: true\n isPPREnabled: false\n}\n\ntype RejectedRouteCacheEntry = RouteCacheEntryShared & {\n status: EntryStatus.Rejected\n blockedTasks: Set<PrefetchTask> | null\n canonicalUrl: null\n renderedSearch: null\n tree: null\n head: null\n isHeadPartial: true\n isPPREnabled: boolean\n}\n\nexport type FulfilledRouteCacheEntry = RouteCacheEntryShared & {\n status: EntryStatus.Fulfilled\n blockedTasks: null\n canonicalUrl: string\n renderedSearch: NormalizedSearch\n tree: RouteTree\n head: HeadData\n isHeadPartial: boolean\n isPPREnabled: boolean\n}\n\nexport type RouteCacheEntry =\n | PendingRouteCacheEntry\n | FulfilledRouteCacheEntry\n | RejectedRouteCacheEntry\n\ntype SegmentCacheEntryShared = {\n staleAt: number\n fetchStrategy: FetchStrategy\n revalidating: SegmentCacheEntry | null\n\n // LRU-related fields\n keypath: null | Prefix<SegmentCacheKeypath>\n next: null | SegmentCacheEntry\n prev: null | SegmentCacheEntry\n size: number\n}\n\nexport type EmptySegmentCacheEntry = SegmentCacheEntryShared & {\n status: EntryStatus.Empty\n rsc: null\n loading: null\n isPartial: true\n promise: null\n}\n\nexport type PendingSegmentCacheEntry = SegmentCacheEntryShared & {\n status: EntryStatus.Pending\n rsc: null\n loading: null\n isPartial: true\n promise: null | PromiseWithResolvers<FulfilledSegmentCacheEntry | null>\n}\n\ntype RejectedSegmentCacheEntry = SegmentCacheEntryShared & {\n status: EntryStatus.Rejected\n rsc: null\n loading: null\n isPartial: true\n promise: null\n}\n\nexport type FulfilledSegmentCacheEntry = SegmentCacheEntryShared & {\n status: EntryStatus.Fulfilled\n rsc: React.ReactNode | null\n loading: LoadingModuleData | Promise<LoadingModuleData>\n isPartial: boolean\n promise: null\n}\n\nexport type SegmentCacheEntry =\n | EmptySegmentCacheEntry\n | PendingSegmentCacheEntry\n | RejectedSegmentCacheEntry\n | FulfilledSegmentCacheEntry\n\nexport type NonEmptySegmentCacheEntry = Exclude<\n SegmentCacheEntry,\n EmptySegmentCacheEntry\n>\n\nconst isOutputExportMode =\n process.env.NODE_ENV === 'production' &&\n process.env.__NEXT_CONFIG_OUTPUT === 'export'\n\n/**\n * Ensures a minimum stale time of 30s to avoid issues where the server sends a too\n * short-lived stale time, which would prevent anything from being prefetched.\n */\nfunction getStaleTimeMs(staleTimeSeconds: number): number {\n return Math.max(staleTimeSeconds, 30) * 1000\n}\n\n// Route cache entries vary on multiple keys: the href and the Next-Url. Each of\n// these parts needs to be included in the internal cache key. Rather than\n// concatenate the keys into a single key, we use a multi-level map, where the\n// first level is keyed by href, the second level is keyed by Next-Url, and so\n// on (if were to add more levels).\ntype RouteCacheKeypath = [NormalizedHref, NormalizedNextUrl]\nlet routeCacheMap: TupleMap<RouteCacheKeypath, RouteCacheEntry> =\n createTupleMap()\n\n// We use an LRU for memory management. We must update this whenever we add or\n// remove a new cache entry, or when an entry changes size.\n// TODO: I chose the max size somewhat arbitrarily. Consider setting this based\n// on navigator.deviceMemory, or some other heuristic. We should make this\n// customizable via the Next.js config, too.\nconst maxRouteLruSize = 10 * 1024 * 1024 // 10 MB\nlet routeCacheLru = createLRU<RouteCacheEntry>(\n maxRouteLruSize,\n onRouteLRUEviction\n)\n\ntype SegmentCacheKeypath = [string, NormalizedSearch]\nlet segmentCacheMap: TupleMap<SegmentCacheKeypath, SegmentCacheEntry> =\n createTupleMap()\n// NOTE: Segments and Route entries are managed by separate LRUs. We could\n// combine them into a single LRU, but because they are separate types, we'd\n// need to wrap each one in an extra LRU node (to maintain monomorphism, at the\n// cost of additional memory).\nconst maxSegmentLruSize = 50 * 1024 * 1024 // 50 MB\nlet segmentCacheLru = createLRU<SegmentCacheEntry>(\n maxSegmentLruSize,\n onSegmentLRUEviction\n)\n\n// All invalidation listeners for the whole cache are tracked in single set.\n// Since we don't yet support tag or path-based invalidation, there's no point\n// tracking them any more granularly than this. Once we add granular\n// invalidation, that may change, though generally the model is to just notify\n// the listeners and allow the caller to poll the prefetch cache with a new\n// prefetch task if desired.\nlet invalidationListeners: Set<PrefetchTask> | null = null\n\n// Incrementing counter used to track cache invalidations.\nlet currentCacheVersion = 0\n\nexport function getCurrentCacheVersion(): number {\n return currentCacheVersion\n}\n\n/**\n * Used to clear the client prefetch cache when a server action calls\n * revalidatePath or revalidateTag. Eventually we will support only clearing the\n * segments that were actually affected, but there's more work to be done on the\n * server before the client is able to do this correctly.\n */\nexport function revalidateEntireCache(\n nextUrl: string | null,\n tree: FlightRouterState\n) {\n currentCacheVersion++\n\n // Start a cooldown before re-prefetching to allow CDN cache propagation.\n startRevalidationCooldown()\n\n // Clearing the cache also effectively rejects any pending requests, because\n // when the response is received, it gets written into a cache entry that is\n // no longer reachable.\n // TODO: There's an exception to this case that we don't currently handle\n // correctly: background revalidations. See note in `upsertSegmentEntry`.\n routeCacheMap = createTupleMap()\n routeCacheLru = createLRU(maxRouteLruSize, onRouteLRUEviction)\n segmentCacheMap = createTupleMap()\n segmentCacheLru = createLRU(maxSegmentLruSize, onSegmentLRUEviction)\n\n // Prefetch all the currently visible links again, to re-fill the cache.\n pingVisibleLinks(nextUrl, tree)\n\n // Similarly, notify all invalidation listeners (i.e. those passed to\n // `router.prefetch(onInvalidate)`), so they can trigger a new prefetch\n // if needed.\n pingInvalidationListeners(nextUrl, tree)\n}\n\nfunction attachInvalidationListener(task: PrefetchTask): void {\n // This function is called whenever a prefetch task reads a cache entry. If\n // the task has an onInvalidate function associated with it — i.e. the one\n // optionally passed to router.prefetch(onInvalidate) — then we attach that\n // listener to the every cache entry that the task reads. Then, if an entry\n // is invalidated, we call the function.\n if (task.onInvalidate !== null) {\n if (invalidationListeners === null) {\n invalidationListeners = new Set([task])\n } else {\n invalidationListeners.add(task)\n }\n }\n}\n\nfunction notifyInvalidationListener(task: PrefetchTask): void {\n const onInvalidate = task.onInvalidate\n if (onInvalidate !== null) {\n // Clear the callback from the task object to guarantee it's not called more\n // than once.\n task.onInvalidate = null\n\n // This is a user-space function, so we must wrap in try/catch.\n try {\n onInvalidate()\n } catch (error) {\n if (typeof reportError === 'function') {\n reportError(error)\n } else {\n console.error(error)\n }\n }\n }\n}\n\nexport function pingInvalidationListeners(\n nextUrl: string | null,\n tree: FlightRouterState\n): void {\n // The rough equivalent of pingVisibleLinks, but for onInvalidate callbacks.\n // This is called when the Next-Url or the base tree changes, since those\n // may affect the result of a prefetch task. It's also called after a\n // cache invalidation.\n if (invalidationListeners !== null) {\n const tasks = invalidationListeners\n invalidationListeners = null\n for (const task of tasks) {\n if (isPrefetchTaskDirty(task, nextUrl, tree)) {\n notifyInvalidationListener(task)\n }\n }\n }\n}\n\nexport function readExactRouteCacheEntry(\n now: number,\n href: NormalizedHref,\n nextUrl: NormalizedNextUrl | null\n): RouteCacheEntry | null {\n const keypath: Prefix<RouteCacheKeypath> =\n nextUrl === null ? [href] : [href, nextUrl]\n const existingEntry = routeCacheMap.get(keypath)\n if (existingEntry !== null) {\n // Check if the entry is stale\n if (existingEntry.staleAt > now) {\n // Reuse the existing entry.\n\n // Since this is an access, move the entry to the front of the LRU.\n routeCacheLru.put(existingEntry)\n\n return existingEntry\n } else {\n // Evict the stale entry from the cache.\n deleteRouteFromCache(existingEntry, keypath)\n }\n }\n return null\n}\n\nexport function readRouteCacheEntry(\n now: number,\n key: RouteCacheKey\n): RouteCacheEntry | null {\n // First check if there's a non-intercepted entry. Most routes cannot be\n // intercepted, so this is the common case.\n const nonInterceptedEntry = readExactRouteCacheEntry(now, key.href, null)\n if (nonInterceptedEntry !== null && !nonInterceptedEntry.couldBeIntercepted) {\n // Found a match, and the route cannot be intercepted. We can reuse it.\n return nonInterceptedEntry\n }\n // There was no match. Check again but include the Next-Url this time.\n return readExactRouteCacheEntry(now, key.href, key.nextUrl)\n}\n\nexport function getSegmentKeypath(\n fetchStrategy: FetchStrategy,\n route: FulfilledRouteCacheEntry,\n cacheKey: SegmentCacheKey\n): Prefix<SegmentCacheKeypath> {\n // When a prefetch includes dynamic data, the search params are included\n // in the result, so we must include the search string in the segment\n // cache key. (Note that this is true even if the search string is empty.)\n //\n // If we're fetching using PPR, we do not need to include the search params in\n // the cache key, because the search params are treated as dynamic data. The\n // cache entry is valid for all possible search param values.\n const isDynamic =\n fetchStrategy === FetchStrategy.Full ||\n fetchStrategy === FetchStrategy.PPRRuntime ||\n !route.isPPREnabled\n return isDynamic && cacheKey.endsWith('/' + PAGE_SEGMENT_KEY)\n ? [cacheKey, route.renderedSearch]\n : [cacheKey]\n}\n\nexport function readSegmentCacheEntry(\n now: number,\n route: FulfilledRouteCacheEntry,\n cacheKey: SegmentCacheKey\n): SegmentCacheEntry | null {\n if (!cacheKey.endsWith('/' + PAGE_SEGMENT_KEY)) {\n // Fast path. Search params only exist on page segments.\n return readExactSegmentCacheEntry(now, [cacheKey])\n }\n\n const renderedSearch = route.renderedSearch\n if (renderedSearch !== null) {\n // Page segments may or may not contain search params. If they were prefetched\n // using a dynamic request, then we will have an entry with search params.\n // Check for that case first.\n const entryWithSearchParams = readExactSegmentCacheEntry(now, [\n cacheKey,\n renderedSearch,\n ])\n if (entryWithSearchParams !== null) {\n return entryWithSearchParams\n }\n }\n\n // If we did not find an entry with the given search params, check for a\n // \"fallback\" entry, where the search params are treated as dynamic data. This\n // is the common case because PPR/static prerenders always treat search params\n // as dynamic.\n //\n // See corresponding logic in `getSegmentKeypath`.\n const entryWithoutSearchParams = readExactSegmentCacheEntry(now, [cacheKey])\n return entryWithoutSearchParams\n}\n\nfunction readExactSegmentCacheEntry(\n now: number,\n keypath: Prefix<SegmentCacheKeypath>\n): SegmentCacheEntry | null {\n const existingEntry = segmentCacheMap.get(keypath)\n if (existingEntry !== null) {\n // Check if the entry is stale\n if (existingEntry.staleAt > now) {\n // Reuse the existing entry.\n\n // Since this is an access, move the entry to the front of the LRU.\n segmentCacheLru.put(existingEntry)\n\n return existingEntry\n } else {\n // This is a stale entry.\n const revalidatingEntry = existingEntry.revalidating\n if (revalidatingEntry !== null) {\n // There's a revalidation in progress. Upsert it.\n const upsertedEntry = upsertSegmentEntry(\n now,\n keypath,\n revalidatingEntry\n )\n if (upsertedEntry !== null && upsertedEntry.staleAt > now) {\n // We can use the upserted revalidation entry.\n return upsertedEntry\n }\n } else {\n // Evict the stale entry from the cache.\n deleteSegmentFromCache(existingEntry, keypath)\n }\n }\n }\n return null\n}\n\nfunction readRevalidatingSegmentCacheEntry(\n now: number,\n owner: SegmentCacheEntry\n): SegmentCacheEntry | null {\n const existingRevalidation = owner.revalidating\n if (existingRevalidation !== null) {\n if (existingRevalidation.staleAt > now) {\n // There's already a revalidation in progress. Or a previous revalidation\n // failed and it has not yet expired.\n return existingRevalidation\n } else {\n // Clear the stale revalidation from its owner.\n clearRevalidatingSegmentFromOwner(owner)\n }\n }\n return null\n}\n\nexport function waitForSegmentCacheEntry(\n pendingEntry: PendingSegmentCacheEntry\n): Promise<FulfilledSegmentCacheEntry | null> {\n // Because the entry is pending, there's already a in-progress request.\n // Attach a promise to the entry that will resolve when the server responds.\n let promiseWithResolvers = pendingEntry.promise\n if (promiseWithResolvers === null) {\n promiseWithResolvers = pendingEntry.promise =\n createPromiseWithResolvers<FulfilledSegmentCacheEntry | null>()\n } else {\n // There's already a promise we can use\n }\n return promiseWithResolvers.promise\n}\n\n/**\n * Checks if an entry for a route exists in the cache. If so, it returns the\n * entry, If not, it adds an empty entry to the cache and returns it.\n */\nexport function readOrCreateRouteCacheEntry(\n now: number,\n task: PrefetchTask,\n key: RouteCacheKey\n): RouteCacheEntry {\n attachInvalidationListener(task)\n\n const existingEntry = readRouteCacheEntry(now, key)\n if (existingEntry !== null) {\n return existingEntry\n }\n // Create a pending entry and add it to the cache.\n const pendingEntry: PendingRouteCacheEntry = {\n canonicalUrl: null,\n status: EntryStatus.Empty,\n blockedTasks: null,\n tree: null,\n head: null,\n isHeadPartial: true,\n // Since this is an empty entry, there's no reason to ever evict it. It will\n // be updated when the data is populated.\n staleAt: Infinity,\n // This is initialized to true because we don't know yet whether the route\n // could be intercepted. It's only set to false once we receive a response\n // from the server.\n couldBeIntercepted: true,\n // Similarly, we don't yet know if the route supports PPR.\n isPPREnabled: false,\n renderedSearch: null,\n\n TODO_metadataStatus: EntryStatus.Empty,\n TODO_isHeadDynamic: false,\n\n // LRU-related fields\n keypath: null,\n next: null,\n prev: null,\n size: 0,\n }\n const keypath: Prefix<RouteCacheKeypath> =\n key.nextUrl === null ? [key.href] : [key.href, key.nextUrl]\n routeCacheMap.set(keypath, pendingEntry)\n // Stash the keypath on the entry so we know how to remove it from the map\n // if it gets evicted from the LRU.\n pendingEntry.keypath = keypath\n routeCacheLru.put(pendingEntry)\n return pendingEntry\n}\n\nexport function requestOptimisticRouteCacheEntry(\n now: number,\n requestedUrl: URL,\n nextUrl: string | null\n): FulfilledRouteCacheEntry | null {\n // This function is called during a navigation when there was no matching\n // route tree in the prefetch cache. Before de-opting to a blocking,\n // unprefetched navigation, we will first attempt to construct an \"optimistic\"\n // route tree by checking the cache for similar routes.\n //\n // Check if there's a route with the same pathname, but with different\n // search params. We can then base our optimistic route tree on this entry.\n //\n // Conceptually, we are simulating what would happen if we did perform a\n // prefetch the requested URL, under the assumption that the server will\n // not redirect or rewrite the request in a different manner than the\n // base route tree. This assumption might not hold, in which case we'll have\n // to recover when we perform the dynamic navigation request. However, this\n // is what would happen if a route were dynamically rewritten/redirected\n // in between the prefetch and the navigation. So the logic needs to exist\n // to handle this case regardless.\n\n // Look for a route with the same pathname, but with an empty search string.\n // TODO: There's nothing inherently special about the empty search string;\n // it's chosen somewhat arbitrarily, with the rationale that it's the most\n // likely one to exist. But we should update this to match _any_ search\n // string. The plan is to generalize this logic alongside other improvements\n // related to \"fallback\" cache entries.\n const requestedSearch = requestedUrl.search as NormalizedSearch\n if (requestedSearch === '') {\n // The caller would have already checked if a route with an empty search\n // string is in the cache. So we can bail out here.\n return null\n }\n const urlWithoutSearchParams = new URL(requestedUrl)\n urlWithoutSearchParams.search = ''\n const routeWithNoSearchParams = readRouteCacheEntry(\n now,\n createPrefetchRequestKey(urlWithoutSearchParams.href, nextUrl)\n )\n\n if (\n routeWithNoSearchParams === null ||\n routeWithNoSearchParams.status !== EntryStatus.Fulfilled\n ) {\n // Bail out of constructing an optimistic route tree. This will result in\n // a blocking, unprefetched navigation.\n return null\n }\n\n // Now we have a base route tree we can \"patch\" with our optimistic values.\n\n const TODO_isHeadDynamic = routeWithNoSearchParams.TODO_isHeadDynamic\n let head\n let isHeadPartial\n let TODO_metadataStatus: EntryStatus.Empty | EntryStatus.Fulfilled\n if (TODO_isHeadDynamic) {\n // If the head was fetched via dynamic request, then we don't know\n // whether it accessed search params. So we must be conservative — we\n // cannot reuse it. The head will stream in during the dynamic navigation.\n // TODO: When Cache Components is enabled, we should track whether the\n // head varied on search params.\n // TODO: Because we're rendering a `null` viewport as the partial state, the\n // viewport will not block the navigation; it will stream in later,\n // alongside the metadata. Viewport is supposed to be blocking. This is\n // a subtle bug in the old implementation that we've preserved here. It's\n // rare enough that we're not going to fix it for apps that don't enable\n // Cache Components; when Cache Components is enabled, though, we should\n // use an infinite promise here to block the navigation. But only if the\n // entry actually varies on search params.\n head = [null, null]\n // Setting this to `true` ensures that on navigation, the head is requested.\n isHeadPartial = true\n TODO_metadataStatus = EntryStatus.Empty\n } else {\n // The head was fetched via a static/PPR request. So it's guaranteed to\n // not contain search params. We can reuse it.\n head = routeWithNoSearchParams.head\n isHeadPartial = routeWithNoSearchParams.isHeadPartial\n TODO_metadataStatus = EntryStatus.Empty\n }\n\n // Optimistically assume that redirects for the requested pathname do\n // not vary on the search string. Therefore, if the base route was\n // redirected to a different search string, then the optimistic route\n // should be redirected to the same search string. Otherwise, we use\n // the requested search string.\n const canonicalUrlForRouteWithNoSearchParams = new URL(\n routeWithNoSearchParams.canonicalUrl,\n requestedUrl.origin\n )\n const optimisticCanonicalSearch =\n canonicalUrlForRouteWithNoSearchParams.search !== ''\n ? // Base route was redirected. Reuse the same redirected search string.\n canonicalUrlForRouteWithNoSearchParams.search\n : requestedSearch\n\n // Similarly, optimistically assume that rewrites for the requested\n // pathname do not vary on the search string. Therefore, if the base\n // route was rewritten to a different search string, then the optimistic\n // route should be rewritten to the same search string. Otherwise, we use\n // the requested search string.\n const optimisticRenderedSearch =\n routeWithNoSearchParams.renderedSearch !== ''\n ? // Base route was rewritten. Reuse the same rewritten search string.\n routeWithNoSearchParams.renderedSearch\n : requestedSearch\n\n const optimisticUrl = new URL(\n routeWithNoSearchParams.canonicalUrl,\n location.origin\n )\n optimisticUrl.search = optimisticCanonicalSearch\n const optimisticCanonicalUrl = createHrefFromUrl(optimisticUrl)\n\n // Clone the base route tree, and override the relevant fields with our\n // optimistic values.\n const optimisticEntry: FulfilledRouteCacheEntry = {\n canonicalUrl: optimisticCanonicalUrl,\n\n status: EntryStatus.Fulfilled,\n // This isn't cloned because it's instance-specific\n blockedTasks: null,\n tree: routeWithNoSearchParams.tree,\n head,\n isHeadPartial,\n staleAt: routeWithNoSearchParams.staleAt,\n couldBeIntercepted: routeWithNoSearchParams.couldBeIntercepted,\n isPPREnabled: routeWithNoSearchParams.isPPREnabled,\n\n // Override the rendered search with the optimistic value.\n renderedSearch: optimisticRenderedSearch,\n\n TODO_metadataStatus,\n TODO_isHeadDynamic,\n\n // LRU-related fields\n keypath: null,\n next: null,\n prev: null,\n size: 0,\n }\n\n // Do not insert this entry into the cache. It only exists so we can\n // perform the current navigation. Just return it to the caller.\n return optimisticEntry\n}\n\n/**\n * Checks if an entry for a segment exists in the cache. If so, it returns the\n * entry, If not, it adds an empty entry to the cache and returns it.\n */\nexport function readOrCreateSegmentCacheEntry(\n now: number,\n fetchStrategy: FetchStrategy,\n route: FulfilledRouteCacheEntry,\n cacheKey: SegmentCacheKey\n): SegmentCacheEntry {\n const keypath = getSegmentKeypath(fetchStrategy, route, cacheKey)\n const existingEntry = readExactSegmentCacheEntry(now, keypath)\n if (existingEntry !== null) {\n return existingEntry\n }\n // Create a pending entry and add it to the cache.\n const pendingEntry = createDetachedSegmentCacheEntry(route.staleAt)\n segmentCacheMap.set(keypath, pendingEntry)\n // Stash the keypath on the entry so we know how to remove it from the map\n // if it gets evicted from the LRU.\n pendingEntry.keypath = keypath\n segmentCacheLru.put(pendingEntry)\n return pendingEntry\n}\n\nexport function readOrCreateRevalidatingSegmentEntry(\n now: number,\n prevEntry: SegmentCacheEntry\n): SegmentCacheEntry {\n const existingRevalidation = readRevalidatingSegmentCacheEntry(now, prevEntry)\n if (existingRevalidation !== null) {\n return existingRevalidation\n }\n const pendingEntry = createDetachedSegmentCacheEntry(prevEntry.staleAt)\n\n // Background revalidations are not stored directly in the cache map or LRU;\n // they're stashed on the entry that they will (potentially) replace.\n //\n // Note that we don't actually ever clear this field, except when the entry\n // expires. When the revalidation finishes, one of two things will happen:\n //\n // 1) the revalidation is successful, `prevEntry` is removed from the cache\n // and garbage collected (so there's no point clearing any of its fields)\n // 2) the revalidation fails, and we'll use the `revalidating` field to\n // prevent subsequent revalidation attempts, until it expires.\n prevEntry.revalidating = pendingEntry\n\n return pendingEntry\n}\n\nexport function upsertSegmentEntry(\n now: number,\n keypath: Prefix<SegmentCacheKeypath>,\n candidateEntry: SegmentCacheEntry\n): SegmentCacheEntry | null {\n // We have a new entry that has not yet been inserted into the cache. Before\n // we do so, we need to confirm whether it takes precedence over the existing\n // entry (if one exists).\n // TODO: We should not upsert an entry if its key was invalidated in the time\n // since the request was made. We can do that by passing the \"owner\" entry to\n // this function and confirming it's the same as `existingEntry`.\n const existingEntry = readExactSegmentCacheEntry(now, keypath)\n if (existingEntry !== null) {\n // Don't replace a more specific segment with a less-specific one. A case where this\n // might happen is if the existing segment was fetched via\n // `<Link prefetch={true}>`.\n if (\n // We fetched the new segment using a different, less specific fetch strategy\n // than the segment we already have in the cache, so it can't have more content.\n (candidateEntry.fetchStrategy !== existingEntry.fetchStrategy &&\n !canNewFetchStrategyProvideMoreContent(\n existingEntry.fetchStrategy,\n candidateEntry.fetchStrategy\n )) ||\n // The existing entry isn't partial, but the new one is.\n // (TODO: can this be true if `candidateEntry.fetchStrategy >= existingEntry.fetchStrategy`?)\n (!existingEntry.isPartial && candidateEntry.isPartial)\n ) {\n // We're going to leave the entry on the owner's `revalidating` field\n // so that it doesn't get revalidated again unnecessarily. Downgrade the\n // Fulfilled entry to Rejected and null out the data so it can be garbage\n // collected. We leave `staleAt` intact to prevent subsequent revalidation\n // attempts only until the entry expires.\n const rejectedEntry: RejectedSegmentCacheEntry = candidateEntry as any\n rejectedEntry.status = EntryStatus.Rejected\n rejectedEntry.loading = null\n rejectedEntry.rsc = null\n return null\n }\n\n // Evict the existing entry from the cache.\n deleteSegmentFromCache(existingEntry, keypath)\n }\n segmentCacheMap.set(keypath, candidateEntry)\n // Stash the keypath on the entry so we know how to remove it from the map\n // if it gets evicted from the LRU.\n candidateEntry.keypath = keypath\n segmentCacheLru.put(candidateEntry)\n return candidateEntry\n}\n\nexport function createDetachedSegmentCacheEntry(\n staleAt: number\n): EmptySegmentCacheEntry {\n const emptyEntry: EmptySegmentCacheEntry = {\n status: EntryStatus.Empty,\n // Default to assuming the fetch strategy will be PPR. This will be updated\n // when a fetch is actually initiated.\n fetchStrategy: FetchStrategy.PPR,\n revalidating: null,\n rsc: null,\n loading: null,\n staleAt,\n isPartial: true,\n promise: null,\n\n // LRU-related fields\n keypath: null,\n next: null,\n prev: null,\n size: 0,\n }\n return emptyEntry\n}\n\nexport function upgradeToPendingSegment(\n emptyEntry: EmptySegmentCacheEntry,\n fetchStrategy: FetchStrategy\n): PendingSegmentCacheEntry {\n const pendingEntry: PendingSegmentCacheEntry = emptyEntry as any\n pendingEntry.status = EntryStatus.Pending\n pendingEntry.fetchStrategy = fetchStrategy\n return pendingEntry\n}\n\nfunction deleteRouteFromCache(\n entry: RouteCacheEntry,\n keypath: Prefix<RouteCacheKeypath>\n): void {\n pingBlockedTasks(entry)\n routeCacheMap.delete(keypath)\n routeCacheLru.delete(entry)\n}\n\nfunction deleteSegmentFromCache(\n entry: SegmentCacheEntry,\n keypath: Prefix<SegmentCacheKeypath>\n): void {\n cancelEntryListeners(entry)\n segmentCacheMap.delete(keypath)\n segmentCacheLru.delete(entry)\n clearRevalidatingSegmentFromOwner(entry)\n}\n\nfunction clearRevalidatingSegmentFromOwner(owner: SegmentCacheEntry): void {\n // Revalidating segments are not stored in the cache directly; they're\n // stored as a field on the entry that they will (potentially) replace. So\n // to dispose of an existing revalidation, we just need to null out the field\n // on the owner.\n const revalidatingSegment = owner.revalidating\n if (revalidatingSegment !== null) {\n cancelEntryListeners(revalidatingSegment)\n owner.revalidating = null\n }\n}\n\nexport function resetRevalidatingSegmentEntry(\n owner: SegmentCacheEntry\n): EmptySegmentCacheEntry {\n clearRevalidatingSegmentFromOwner(owner)\n const emptyEntry = createDetachedSegmentCacheEntry(owner.staleAt)\n owner.revalidating = emptyEntry\n return emptyEntry\n}\n\nfunction onRouteLRUEviction(entry: RouteCacheEntry): void {\n // The LRU evicted this entry. Remove it from the map.\n const keypath = entry.keypath\n if (keypath !== null) {\n entry.keypath = null\n pingBlockedTasks(entry)\n routeCacheMap.delete(keypath)\n }\n}\n\nfunction onSegmentLRUEviction(entry: SegmentCacheEntry): void {\n // The LRU evicted this entry. Remove it from the map.\n const keypath = entry.keypath\n if (keypath !== null) {\n entry.keypath = null\n cancelEntryListeners(entry)\n segmentCacheMap.delete(keypath)\n }\n}\n\nfunction cancelEntryListeners(entry: SegmentCacheEntry): void {\n if (entry.status === EntryStatus.Pending && entry.promise !== null) {\n // There were listeners for this entry. Resolve them with `null` to indicate\n // that the prefetch failed. It's up to the listener to decide how to handle\n // this case.\n // NOTE: We don't currently propagate the reason the prefetch was canceled\n // but we could by accepting a `reason` argument.\n entry.promise.resolve(null)\n entry.promise = null\n }\n}\n\nfunction pingBlockedTasks(entry: {\n blockedTasks: Set<PrefetchTask> | null\n}): void {\n const blockedTasks = entry.blockedTasks\n if (blockedTasks !== null) {\n for (const task of blockedTasks) {\n pingPrefetchTask(task)\n }\n entry.blockedTasks = null\n }\n}\n\nfunction fulfillRouteCacheEntry(\n entry: RouteCacheEntry,\n tree: RouteTree,\n head: HeadData,\n isHeadPartial: boolean,\n staleAt: number,\n couldBeIntercepted: boolean,\n canonicalUrl: string,\n renderedSearch: NormalizedSearch,\n isPPREnabled: boolean,\n isHeadDynamic: boolean\n): FulfilledRouteCacheEntry {\n const fulfilledEntry: FulfilledRouteCacheEntry = entry as any\n fulfilledEntry.status = EntryStatus.Fulfilled\n fulfilledEntry.tree = tree\n fulfilledEntry.head = head\n fulfilledEntry.isHeadPartial = isHeadPartial\n fulfilledEntry.staleAt = staleAt\n fulfilledEntry.couldBeIntercepted = couldBeIntercepted\n fulfilledEntry.canonicalUrl = canonicalUrl\n fulfilledEntry.renderedSearch = renderedSearch\n fulfilledEntry.isPPREnabled = isPPREnabled\n fulfilledEntry.TODO_isHeadDynamic = isHeadDynamic\n pingBlockedTasks(entry)\n return fulfilledEntry\n}\n\nfunction fulfillSegmentCacheEntry(\n segmentCacheEntry: PendingSegmentCacheEntry,\n rsc: React.ReactNode,\n loading: LoadingModuleData | Promise<LoadingModuleData>,\n staleAt: number,\n isPartial: boolean\n): FulfilledSegmentCacheEntry {\n const fulfilledEntry: FulfilledSegmentCacheEntry = segmentCacheEntry as any\n fulfilledEntry.status = EntryStatus.Fulfilled\n fulfilledEntry.rsc = rsc\n fulfilledEntry.loading = loading\n fulfilledEntry.staleAt = staleAt\n fulfilledEntry.isPartial = isPartial\n // Resolve any listeners that were waiting for this data.\n if (segmentCacheEntry.promise !== null) {\n segmentCacheEntry.promise.resolve(fulfilledEntry)\n // Free the promise for garbage collection.\n fulfilledEntry.promise = null\n }\n return fulfilledEntry\n}\n\nfunction rejectRouteCacheEntry(\n entry: PendingRouteCacheEntry,\n staleAt: number\n): void {\n const rejectedEntry: RejectedRouteCacheEntry = entry as any\n rejectedEntry.status = EntryStatus.Rejected\n rejectedEntry.staleAt = staleAt\n pingBlockedTasks(entry)\n}\n\nfunction rejectSegmentCacheEntry(\n entry: PendingSegmentCacheEntry,\n staleAt: number\n): void {\n const rejectedEntry: RejectedSegmentCacheEntry = entry as any\n rejectedEntry.status = EntryStatus.Rejected\n rejectedEntry.staleAt = staleAt\n if (entry.promise !== null) {\n // NOTE: We don't currently propagate the reason the prefetch was canceled\n // but we could by accepting a `reason` argument.\n entry.promise.resolve(null)\n entry.promise = null\n }\n}\n\nfunction convertRootTreePrefetchToRouteTree(\n rootTree: RootTreePrefetch,\n renderedPathname: string\n) {\n // Remove trailing and leading slashes\n const pathnameParts = renderedPathname.split('/').filter((p) => p !== '')\n const index = 0\n const rootSegment = ROOT_SEGMENT_CACHE_KEY\n return convertTreePrefetchToRouteTree(\n rootTree.tree,\n rootSegment,\n null,\n ROOT_SEGMENT_REQUEST_KEY,\n ROOT_SEGMENT_CACHE_KEY,\n pathnameParts,\n index\n )\n}\n\nfunction convertTreePrefetchToRouteTree(\n prefetch: TreePrefetch,\n segment: FlightRouterStateSegment,\n param: RouteParam | null,\n requestKey: SegmentRequestKey,\n cacheKey: SegmentCacheKey,\n pathnameParts: Array<string>,\n pathnamePartsIndex: number\n): RouteTree {\n // Converts the route tree sent by the server into the format used by the\n // cache. The cached version of the tree includes additional fields, such as a\n // cache key for each segment. Since this is frequently accessed, we compute\n // it once instead of on every access. This same cache key is also used to\n // request the segment from the server.\n\n let slots: { [parallelRouteKey: string]: RouteTree } | null = null\n const prefetchSlots = prefetch.slots\n if (prefetchSlots !== null) {\n slots = {}\n for (let parallelRouteKey in prefetchSlots) {\n const childPrefetch = prefetchSlots[parallelRouteKey]\n const childParamName = childPrefetch.name\n const childParamType = childPrefetch.paramType\n const childServerSentParamKey = childPrefetch.paramKey\n\n let childDoesAppearInURL: boolean\n let childParam: RouteParam | null = null\n let childSegment: FlightRouterStateSegment\n if (childParamType !== null) {\n // This segment is parameterized. Get the param from the pathname.\n const childParamValue = parseDynamicParamFromURLPart(\n childParamType,\n pathnameParts,\n pathnamePartsIndex\n )\n\n // Assign a cache key to the segment, based on the param value. In the\n // pre-Segment Cache implementation, the server computes this and sends\n // it in the body of the response. In the Segment Cache implementation,\n // the server sends an empty string and we fill it in here.\n\n // TODO: We're intentionally not adding the search param to page\n // segments here; it's tracked separately and added back during a read.\n // This would clearer if we waited to construct the segment until it's\n // read from the cache, since that's effectively what we're\n // doing anyway.\n const renderedSearch = '' as NormalizedSearch\n const childParamKey =\n // The server omits this field from the prefetch response when\n // cacheComponents is enabled.\n childServerSentParamKey !== null\n ? childServerSentParamKey\n : // If no param key was sent, use the value parsed on the client.\n getCacheKeyForDynamicParam(childParamValue, renderedSearch)\n\n childParam = {\n name: childParamName,\n value: childParamValue,\n type: childParamType,\n }\n childSegment = [childParamName, childParamKey, childParamType]\n childDoesAppearInURL = true\n } else {\n childSegment = childParamName\n childDoesAppearInURL = doesStaticSegmentAppearInURL(childParamName)\n }\n\n // Only increment the index if the segment appears in the URL. If it's a\n // \"virtual\" segment, like a route group, it remains the same.\n const childPathnamePartsIndex = childDoesAppearInURL\n ? pathnamePartsIndex + 1\n : pathnamePartsIndex\n\n const childRequestKeyPart = createSegmentRequestKeyPart(childSegment)\n const childRequestKey = appendSegmentRequestKeyPart(\n requestKey,\n parallelRouteKey,\n childRequestKeyPart\n )\n const childCacheKey = appendSegmentCacheKeyPart(\n cacheKey,\n parallelRouteKey,\n createSegmentCacheKeyPart(childRequestKeyPart, childSegment)\n )\n slots[parallelRouteKey] = convertTreePrefetchToRouteTree(\n childPrefetch,\n childSegment,\n childParam,\n childRequestKey,\n childCacheKey,\n pathnameParts,\n childPathnamePartsIndex\n )\n }\n }\n\n return {\n cacheKey,\n requestKey,\n segment,\n param,\n slots,\n isRootLayout: prefetch.isRootLayout,\n // This field is only relevant to dynamic routes. For a PPR/static route,\n // there's always some partial loading state we can fetch.\n hasLoadingBoundary: HasLoadingBoundary.SegmentHasLoadingBoundary,\n hasRuntimePrefetch: prefetch.hasRuntimePrefetch,\n }\n}\n\nfunction convertRootFlightRouterStateToRouteTree(\n flightRouterState: FlightRouterState\n): RouteTree {\n return convertFlightRouterStateToRouteTree(\n flightRouterState,\n ROOT_SEGMENT_CACHE_KEY,\n ROOT_SEGMENT_REQUEST_KEY\n )\n}\n\nfunction convertFlightRouterStateToRouteTree(\n flightRouterState: FlightRouterState,\n cacheKey: SegmentCacheKey,\n requestKey: SegmentRequestKey\n): RouteTree {\n let slots: { [parallelRouteKey: string]: RouteTree } | null = null\n\n const parallelRoutes = flightRouterState[1]\n for (let parallelRouteKey in parallelRoutes) {\n const childRouterState = parallelRoutes[parallelRouteKey]\n const childSegment = childRouterState[0]\n // TODO: Eventually, the param values will not be included in the response\n // from the server. We'll instead fill them in on the client by parsing\n // the URL. This is where we'll do that.\n const childRequestKeyPart = createSegmentRequestKeyPart(childSegment)\n const childRequestKey = appendSegmentRequestKeyPart(\n requestKey,\n parallelRouteKey,\n childRequestKeyPart\n )\n const childCacheKey = appendSegmentCacheKeyPart(\n cacheKey,\n parallelRouteKey,\n createSegmentCacheKeyPart(childRequestKeyPart, childSegment)\n )\n const childTree = convertFlightRouterStateToRouteTree(\n childRouterState,\n childCacheKey,\n childRequestKey\n )\n if (slots === null) {\n slots = {\n [parallelRouteKey]: childTree,\n }\n } else {\n slots[parallelRouteKey] = childTree\n }\n }\n const originalSegment = flightRouterState[0]\n\n let segment: FlightRouterStateSegment\n let param: RouteParam | null = null\n if (Array.isArray(originalSegment)) {\n const paramCacheKey = originalSegment[1]\n const paramType = originalSegment[2]\n const paramValue = getParamValueFromCacheKey(paramCacheKey, paramType)\n param = {\n name: originalSegment[0],\n value: paramValue === undefined ? null : paramValue,\n type: originalSegment[2] as DynamicParamTypesShort,\n }\n segment = originalSegment\n } else {\n // The navigation implementation expects the search params to be included\n // in the segment. However, in the case of a static response, the search\n // params are omitted. So the client needs to add them back in when reading\n // from the Segment Cache.\n //\n // For consistency, we'll do this for dynamic responses, too.\n //\n // TODO: We should move search params out of FlightRouterState and handle\n // them entirely on the client, similar to our plan for dynamic params.\n segment =\n typeof originalSegment === 'string' &&\n originalSegment.startsWith(PAGE_SEGMENT_KEY)\n ? PAGE_SEGMENT_KEY\n : originalSegment\n }\n\n return {\n cacheKey,\n requestKey,\n segment,\n param,\n slots,\n isRootLayout: flightRouterState[4] === true,\n hasLoadingBoundary:\n flightRouterState[5] !== undefined\n ? flightRouterState[5]\n : HasLoadingBoundary.SubtreeHasNoLoadingBoundary,\n\n // Non-static tree responses are only used by apps that haven't adopted\n // Cache Components. So this is always false.\n hasRuntimePrefetch: false,\n }\n}\n\nexport function convertRouteTreeToFlightRouterState(\n routeTree: RouteTree\n): FlightRouterState {\n const parallelRoutes: Record<string, FlightRouterState> = {}\n if (routeTree.slots !== null) {\n for (const parallelRouteKey in routeTree.slots) {\n parallelRoutes[parallelRouteKey] = convertRouteTreeToFlightRouterState(\n routeTree.slots[parallelRouteKey]\n )\n }\n }\n const flightRouterState: FlightRouterState = [\n routeTree.segment,\n parallelRoutes,\n null,\n null,\n routeTree.isRootLayout,\n ]\n return flightRouterState\n}\n\nexport async function fetchRouteOnCacheMiss(\n entry: PendingRouteCacheEntry,\n task: PrefetchTask,\n key: RouteCacheKey\n): Promise<PrefetchSubtaskResult<null> | null> {\n // This function is allowed to use async/await because it contains the actual\n // fetch that gets issued on a cache miss. Notice it writes the result to the\n // cache entry directly, rather than return data that is then written by\n // the caller.\n const href = key.href\n const nextUrl = key.nextUrl\n const segmentPath = '/_tree' as SegmentRequestKey\n\n const headers: RequestHeaders = {\n [RSC_HEADER]: '1',\n [NEXT_ROUTER_PREFETCH_HEADER]: '1',\n [NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: segmentPath,\n }\n if (nextUrl !== null) {\n headers[NEXT_URL] = nextUrl\n }\n\n try {\n let response\n let urlAfterRedirects\n if (isOutputExportMode) {\n // In output: \"export\" mode, we can't use headers to request a particular\n // segment. Instead, we encode the extra request information into the URL.\n // This is not part of the \"public\" interface of the app; it's an internal\n // Next.js implementation detail that the app developer should not need to\n // concern themselves with.\n //\n // For example, to request a segment:\n //\n // Path passed to <Link>: /path/to/page\n // Path passed to fetch: /path/to/page/__next-segments/_tree\n //\n // (This is not the exact protocol, just an illustration.)\n //\n // Before we do that, though, we need to account for redirects. Even in\n // output: \"export\" mode, a proxy might redirect the page to a different\n // location, but we shouldn't assume or expect that they also redirect all\n // the segment files, too.\n //\n // To check whether the page is redirected, we perform a range request of\n // the first N bytes of the HTML document. The canonical URL is determined\n // from the response.\n //\n // Then we can use the canonical URL to request the route tree.\n //\n // NOTE: We could embed the route tree into the HTML document, to avoid\n // a second request. We're not doing that currently because it would make\n // the HTML document larger and affect normal page loads.\n const url = new URL(href)\n const htmlResponse = await fetch(href, {\n headers: {\n Range: DOC_PREFETCH_RANGE_HEADER_VALUE,\n },\n })\n const partialHtml = await htmlResponse.text()\n if (!doesExportedHtmlMatchBuildId(partialHtml, getAppBuildId())) {\n // The target page is not part of this app, or it belongs to a\n // different build.\n rejectRouteCacheEntry(entry, Date.now() + 10 * 1000)\n return null\n }\n urlAfterRedirects = htmlResponse.redirected\n ? new URL(htmlResponse.url)\n : url\n response = await fetchPrefetchResponse(\n addSegmentPathToUrlInOutputExportMode(urlAfterRedirects, segmentPath),\n headers\n )\n } else {\n // \"Server\" mode. We can use request headers instead of the pathname.\n // TODO: The eventual plan is to get rid of our custom request headers and\n // encode everything into the URL, using a similar strategy to the\n // \"output: export\" block above.\n const url = new URL(href)\n response = await fetchPrefetchResponse(url, headers)\n urlAfterRedirects =\n response !== null && response.redirected ? new URL(response.url) : url\n }\n\n if (\n !response ||\n !response.ok ||\n // 204 is a Cache miss. Though theoretically this shouldn't happen when\n // PPR is enabled, because we always respond to route tree requests, even\n // if it needs to be blockingly generated on demand.\n response.status === 204 ||\n !response.body\n ) {\n // Server responded with an error, or with a miss. We should still cache\n // the response, but we can try again after 10 seconds.\n rejectRouteCacheEntry(entry, Date.now() + 10 * 1000)\n return null\n }\n\n // TODO: The canonical URL is the href without the origin. I think\n // historically the reason for this is because the initial canonical URL\n // gets passed as a prop to the top-level React component, which means it\n // needs to be computed during SSR. If it were to include the origin, it\n // would need to always be same as location.origin on the client, to prevent\n // a hydration mismatch. To sidestep this complexity, we omit the origin.\n //\n // However, since this is neither a native URL object nor a fully qualified\n // URL string, we need to be careful about how we use it. To prevent subtle\n // mistakes, we should create a special type for it, instead of just string.\n // Or, we should just use a (readonly) URL object instead. The type of the\n // prop that we pass to seed the initial state does not need to be the same\n // type as the state itself.\n const canonicalUrl = createHrefFromUrl(urlAfterRedirects)\n\n // Check whether the response varies based on the Next-Url header.\n const varyHeader = response.headers.get('vary')\n const couldBeIntercepted =\n varyHeader !== null && varyHeader.includes(NEXT_URL)\n\n // Track when the network connection closes.\n const closed = createPromiseWithResolvers<void>()\n\n // This checks whether the response was served from the per-segment cache,\n // rather than the old prefetching flow. If it fails, it implies that PPR\n // is disabled on this route.\n const routeIsPPREnabled =\n response.headers.get(NEXT_DID_POSTPONE_HEADER) === '2' ||\n // In output: \"export\" mode, we can't rely on response headers. But if we\n // receive a well-formed response, we can assume it's a static response,\n // because all data is static in this mode.\n isOutputExportMode\n\n // Regardless of the type of response, we will never receive dynamic\n // metadata as part of this prefetch request.\n const isHeadDynamic = false\n\n if (routeIsPPREnabled) {\n const prefetchStream = createPrefetchResponseStream(\n response.body,\n closed.resolve,\n function onResponseSizeUpdate(size) {\n routeCacheLru.updateSize(entry, size)\n }\n )\n const serverData = await createFromNextReadableStream<RootTreePrefetch>(\n prefetchStream,\n headers\n )\n if (serverData.buildId !== getAppBuildId()) {\n // The server build does not match the client. Treat as a 404. During\n // an actual navigation, the router will trigger an MPA navigation.\n // TODO: Consider moving the build ID to a response header so we can check\n // it before decoding the response, and so there's one way of checking\n // across all response types.\n // TODO: We should cache the fact that this is an MPA navigation.\n rejectRouteCacheEntry(entry, Date.now() + 10 * 1000)\n return null\n }\n\n // Get the params that were used to render the target page. These may\n // be different from the params in the request URL, if the page\n // was rewritten.\n const renderedPathname = getRenderedPathname(response)\n const renderedSearch = getRenderedSearch(response)\n\n const routeTree = convertRootTreePrefetchToRouteTree(\n serverData,\n renderedPathname\n )\n\n const staleTimeMs = getStaleTimeMs(serverData.staleTime)\n fulfillRouteCacheEntry(\n entry,\n routeTree,\n serverData.head,\n serverData.isHeadPartial,\n Date.now() + staleTimeMs,\n couldBeIntercepted,\n canonicalUrl,\n renderedSearch,\n routeIsPPREnabled,\n isHeadDynamic\n )\n } else {\n // PPR is not enabled for this route. The server responds with a\n // different format (FlightRouterState) that we need to convert.\n // TODO: We will unify the responses eventually. I'm keeping the types\n // separate for now because FlightRouterState has so many\n // overloaded concerns.\n const prefetchStream = createPrefetchResponseStream(\n response.body,\n closed.resolve,\n function onResponseSizeUpdate(size) {\n routeCacheLru.updateSize(entry, size)\n }\n )\n const serverData =\n await createFromNextReadableStream<NavigationFlightResponse>(\n prefetchStream,\n headers\n )\n if (serverData.b !== getAppBuildId()) {\n // The server build does not match the client. Treat as a 404. During\n // an actual navigation, the router will trigger an MPA navigation.\n // TODO: Consider moving the build ID to a response header so we can check\n // it before decoding the response, and so there's one way of checking\n // across all response types.\n // TODO: We should cache the fact that this is an MPA navigation.\n rejectRouteCacheEntry(entry, Date.now() + 10 * 1000)\n return null\n }\n\n writeDynamicTreeResponseIntoCache(\n Date.now(),\n task,\n // The non-PPR response format is what we'd get if we prefetched these segments\n // using the LoadingBoundary fetch strategy, so mark their cache entries accordingly.\n FetchStrategy.LoadingBoundary,\n response as RSCResponse<NavigationFlightResponse>,\n serverData,\n entry,\n couldBeIntercepted,\n canonicalUrl,\n routeIsPPREnabled\n )\n }\n\n if (!couldBeIntercepted && nextUrl !== null) {\n // This route will never be intercepted. So we can use this entry for all\n // requests to this route, regardless of the Next-Url header. This works\n // because when reading the cache we always check for a valid\n // non-intercepted entry first.\n //\n // Re-key the entry. Since we're in an async task, we must first confirm\n // that the entry hasn't been concurrently modified by a different task.\n const currentKeypath: Prefix<RouteCacheKeypath> = [href, nextUrl]\n const expectedEntry = routeCacheMap.get(currentKeypath)\n if (expectedEntry === entry) {\n routeCacheMap.delete(currentKeypath)\n const newKeypath: Prefix<RouteCacheKeypath> = [href]\n routeCacheMap.set(newKeypath, entry)\n // We don't need to update the LRU because the entry is already in it.\n // But since we changed the keypath, we do need to update that, so we\n // know how to remove it from the map if it gets evicted from the LRU.\n entry.keypath = newKeypath\n } else {\n // Something else modified this entry already. Since the re-keying is\n // just a performance optimization, we can safely skip it.\n }\n }\n // Return a promise that resolves when the network connection closes, so\n // the scheduler can track the number of concurrent network connections.\n return { value: null, closed: closed.promise }\n } catch (error) {\n // Either the connection itself failed, or something bad happened while\n // decoding the response.\n rejectRouteCacheEntry(entry, Date.now() + 10 * 1000)\n return null\n }\n}\n\nexport async function fetchSegmentOnCacheMiss(\n route: FulfilledRouteCacheEntry,\n segmentCacheEntry: PendingSegmentCacheEntry,\n routeKey: RouteCacheKey,\n tree: RouteTree\n): Promise<PrefetchSubtaskResult<FulfilledSegmentCacheEntry> | null> {\n // This function is allowed to use async/await because it contains the actual\n // fetch that gets issued on a cache miss. Notice it writes the result to the\n // cache entry directly, rather than return data that is then written by\n // the caller.\n //\n // Segment fetches are non-blocking so we don't need to ping the scheduler\n // on completion.\n\n // Use the canonical URL to request the segment, not the original URL. These\n // are usually the same, but the canonical URL will be different if the route\n // tree response was redirected. To avoid an extra waterfall on every segment\n // request, we pass the redirected URL instead of the original one.\n const url = new URL(route.canonicalUrl, routeKey.href)\n const nextUrl = routeKey.nextUrl\n\n const requestKey = tree.requestKey\n const normalizedRequestKey =\n requestKey === ROOT_SEGMENT_REQUEST_KEY\n ? // The root segment is a special case. To simplify the server-side\n // handling of these requests, we encode the root segment path as\n // `_index` instead of as an empty string. This should be treated as\n // an implementation detail and not as a stable part of the protocol.\n // It just needs to match the equivalent logic that happens when\n // prerendering the responses. It should not leak outside of Next.js.\n ('/_index' as SegmentRequestKey)\n : requestKey\n\n const headers: RequestHeaders = {\n [RSC_HEADER]: '1',\n [NEXT_ROUTER_PREFETCH_HEADER]: '1',\n [NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: normalizedRequestKey,\n }\n if (nextUrl !== null) {\n headers[NEXT_URL] = nextUrl\n }\n\n const requestUrl = isOutputExportMode\n ? // In output: \"export\" mode, we need to add the segment path to the URL.\n addSegmentPathToUrlInOutputExportMode(url, normalizedRequestKey)\n : url\n try {\n const response = await fetchPrefetchResponse(requestUrl, headers)\n if (\n !response ||\n !response.ok ||\n response.status === 204 || // Cache miss\n // This checks whether the response was served from the per-segment cache,\n // rather than the old prefetching flow. If it fails, it implies that PPR\n // is disabled on this route. Theoretically this should never happen\n // because we only issue requests for segments once we've verified that\n // the route supports PPR.\n (response.headers.get(NEXT_DID_POSTPONE_HEADER) !== '2' &&\n // In output: \"export\" mode, we can't rely on response headers. But if\n // we receive a well-formed response, we can assume it's a static\n // response, because all data is static in this mode.\n !isOutputExportMode) ||\n !response.body\n ) {\n // Server responded with an error, or with a miss. We should still cache\n // the response, but we can try again after 10 seconds.\n rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000)\n return null\n }\n\n // Track when the network connection closes.\n const closed = createPromiseWithResolvers<void>()\n\n // Wrap the original stream in a new stream that never closes. That way the\n // Flight client doesn't error if there's a hanging promise.\n const prefetchStream = createPrefetchResponseStream(\n response.body,\n closed.resolve,\n function onResponseSizeUpdate(size) {\n segmentCacheLru.updateSize(segmentCacheEntry, size)\n }\n )\n const serverData = await (createFromNextReadableStream(\n prefetchStream,\n headers\n ) as Promise<SegmentPrefetch>)\n if (serverData.buildId !== getAppBuildId()) {\n // The server build does not match the client. Treat as a 404. During\n // an actual navigation, the router will trigger an MPA navigation.\n // TODO: Consider moving the build ID to a response header so we can check\n // it before decoding the response, and so there's one way of checking\n // across all response types.\n rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000)\n return null\n }\n return {\n value: fulfillSegmentCacheEntry(\n segmentCacheEntry,\n serverData.rsc,\n serverData.loading,\n // TODO: The server does not currently provide per-segment stale time.\n // So we use the stale time of the route.\n route.staleAt,\n serverData.isPartial\n ),\n // Return a promise that resolves when the network connection closes, so\n // the scheduler can track the number of concurrent network connections.\n closed: closed.promise,\n }\n } catch (error) {\n // Either the connection itself failed, or something bad happened while\n // decoding the response.\n rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000)\n return null\n }\n}\n\nexport async function fetchSegmentPrefetchesUsingDynamicRequest(\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n fetchStrategy:\n | FetchStrategy.LoadingBoundary\n | FetchStrategy.PPRRuntime\n | FetchStrategy.Full,\n dynamicRequestTree: FlightRouterState,\n spawnedEntries: Map<SegmentCacheKey, PendingSegmentCacheEntry>\n): Promise<PrefetchSubtaskResult<null> | null> {\n const url = new URL(route.canonicalUrl, task.key.href)\n const nextUrl = task.key.nextUrl\n const headers: RequestHeaders = {\n [RSC_HEADER]: '1',\n [NEXT_ROUTER_STATE_TREE_HEADER]:\n prepareFlightRouterStateForRequest(dynamicRequestTree),\n }\n if (nextUrl !== null) {\n headers[NEXT_URL] = nextUrl\n }\n switch (fetchStrategy) {\n case FetchStrategy.Full: {\n // We omit the prefetch header from a full prefetch because it's essentially\n // just a navigation request that happens ahead of time — it should include\n // all the same data in the response.\n break\n }\n case FetchStrategy.PPRRuntime: {\n headers[NEXT_ROUTER_PREFETCH_HEADER] = '2'\n break\n }\n case FetchStrategy.LoadingBoundary: {\n headers[NEXT_ROUTER_PREFETCH_HEADER] = '1'\n break\n }\n default: {\n fetchStrategy satisfies never\n }\n }\n\n try {\n const response = await fetchPrefetchResponse(url, headers)\n if (!response || !response.ok || !response.body) {\n // Server responded with an error, or with a miss. We should still cache\n // the response, but we can try again after 10 seconds.\n rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000)\n return null\n }\n\n const renderedSearch = getRenderedSearch(response)\n if (renderedSearch !== route.renderedSearch) {\n // The search params that were used to render the target page are\n // different from the search params in the request URL. This only happens\n // when there's a dynamic rewrite in between the tree prefetch and the\n // data prefetch.\n // TODO: For now, since this is an edge case, we reject the prefetch, but\n // the proper way to handle this is to evict the stale route tree entry\n // then fill the cache with the new response.\n rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000)\n return null\n }\n\n // Track when the network connection closes.\n const closed = createPromiseWithResolvers<void>()\n\n let fulfilledEntries: Array<FulfilledSegmentCacheEntry> | null = null\n const prefetchStream = createPrefetchResponseStream(\n response.body,\n closed.resolve,\n function onResponseSizeUpdate(totalBytesReceivedSoFar) {\n // When processing a dynamic response, we don't know how large each\n // individual segment is, so approximate by assiging each segment\n // the average of the total response size.\n if (fulfilledEntries === null) {\n // Haven't received enough data yet to know which segments\n // were included.\n return\n }\n const averageSize = totalBytesReceivedSoFar / fulfilledEntries.length\n for (const entry of fulfilledEntries) {\n segmentCacheLru.updateSize(entry, averageSize)\n }\n }\n )\n const serverData = await (createFromNextReadableStream(\n prefetchStream,\n headers\n ) as Promise<NavigationFlightResponse>)\n\n const isResponsePartial =\n fetchStrategy === FetchStrategy.PPRRuntime\n ? // A runtime prefetch may have holes.\n !!response.headers.get(NEXT_DID_POSTPONE_HEADER)\n : // Full and LoadingBoundary prefetches cannot have holes.\n // (even if we did set the prefetch header, we only use this codepath for non-PPR-enabled routes)\n false\n\n // Aside from writing the data into the cache, this function also returns\n // the entries that were fulfilled, so we can streamingly update their sizes\n // in the LRU as more data comes in.\n fulfilledEntries = writeDynamicRenderResponseIntoCache(\n Date.now(),\n task,\n fetchStrategy,\n response as RSCResponse<NavigationFlightResponse>,\n serverData,\n isResponsePartial,\n route,\n spawnedEntries\n )\n\n // Return a promise that resolves when the network connection closes, so\n // the scheduler can track the number of concurrent network connections.\n return { value: null, closed: closed.promise }\n } catch (error) {\n rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000)\n return null\n }\n}\n\nfunction writeDynamicTreeResponseIntoCache(\n now: number,\n task: PrefetchTask,\n fetchStrategy:\n | FetchStrategy.LoadingBoundary\n | FetchStrategy.PPRRuntime\n | FetchStrategy.Full,\n response: RSCResponse<NavigationFlightResponse>,\n serverData: NavigationFlightResponse,\n entry: PendingRouteCacheEntry,\n couldBeIntercepted: boolean,\n canonicalUrl: string,\n routeIsPPREnabled: boolean\n) {\n // Get the URL that was used to render the target page. This may be different\n // from the URL in the request URL, if the page was rewritten.\n const renderedSearch = getRenderedSearch(response)\n\n const normalizedFlightDataResult = normalizeFlightData(serverData.f)\n if (\n // A string result means navigating to this route will result in an\n // MPA navigation.\n typeof normalizedFlightDataResult === 'string' ||\n normalizedFlightDataResult.length !== 1\n ) {\n rejectRouteCacheEntry(entry, now + 10 * 1000)\n return\n }\n const flightData = normalizedFlightDataResult[0]\n if (!flightData.isRootRender) {\n // Unexpected response format.\n rejectRouteCacheEntry(entry, now + 10 * 1000)\n return\n }\n\n const flightRouterState = flightData.tree\n // TODO: Extract to function\n const staleTimeHeaderSeconds = response.headers.get(\n NEXT_ROUTER_STALE_TIME_HEADER\n )\n const staleTimeMs =\n staleTimeHeaderSeconds !== null\n ? getStaleTimeMs(parseInt(staleTimeHeaderSeconds, 10))\n : STATIC_STALETIME_MS\n\n // If the response contains dynamic holes, then we must conservatively assume\n // that any individual segment might contain dynamic holes, and also the\n // head. If it did not contain dynamic holes, then we can assume every segment\n // and the head is completely static.\n const isResponsePartial =\n response.headers.get(NEXT_DID_POSTPONE_HEADER) === '1'\n\n // Since this is a dynamic response, we must conservatively assume that the\n // head responded with dynamic data.\n const isHeadDynamic = true\n\n const fulfilledEntry = fulfillRouteCacheEntry(\n entry,\n convertRootFlightRouterStateToRouteTree(flightRouterState),\n flightData.head,\n flightData.isHeadPartial,\n now + staleTimeMs,\n couldBeIntercepted,\n canonicalUrl,\n renderedSearch,\n routeIsPPREnabled,\n isHeadDynamic\n )\n\n // If the server sent segment data as part of the response, we should write\n // it into the cache to prevent a second, redundant prefetch request.\n //\n // TODO: When `clientSegmentCache` is enabled, the server does not include\n // segment data when responding to a route tree prefetch request. However,\n // when `clientSegmentCache` is set to \"client-only\", and PPR is enabled (or\n // the page is fully static), the normal check is bypassed and the server\n // responds with the full page. This is a temporary situation until we can\n // remove the \"client-only\" option. Then, we can delete this function call.\n writeDynamicRenderResponseIntoCache(\n now,\n task,\n fetchStrategy,\n response,\n serverData,\n isResponsePartial,\n fulfilledEntry,\n null\n )\n}\n\nfunction rejectSegmentEntriesIfStillPending(\n entries: Map<SegmentCacheKey, SegmentCacheEntry>,\n staleAt: number\n): Array<FulfilledSegmentCacheEntry> {\n const fulfilledEntries = []\n for (const entry of entries.values()) {\n if (entry.status === EntryStatus.Pending) {\n rejectSegmentCacheEntry(entry, staleAt)\n } else if (entry.status === EntryStatus.Fulfilled) {\n fulfilledEntries.push(entry)\n }\n }\n return fulfilledEntries\n}\n\nfunction writeDynamicRenderResponseIntoCache(\n now: number,\n task: PrefetchTask,\n fetchStrategy:\n | FetchStrategy.LoadingBoundary\n | FetchStrategy.PPRRuntime\n | FetchStrategy.Full,\n response: RSCResponse<NavigationFlightResponse>,\n serverData: NavigationFlightResponse,\n isResponsePartial: boolean,\n route: FulfilledRouteCacheEntry,\n spawnedEntries: Map<SegmentCacheKey, PendingSegmentCacheEntry> | null\n): Array<FulfilledSegmentCacheEntry> | null {\n if (serverData.b !== getAppBuildId()) {\n // The server build does not match the client. Treat as a 404. During\n // an actual navigation, the router will trigger an MPA navigation.\n // TODO: Consider moving the build ID to a response header so we can check\n // it before decoding the response, and so there's one way of checking\n // across all response types.\n if (spawnedEntries !== null) {\n rejectSegmentEntriesIfStillPending(spawnedEntries, now + 10 * 1000)\n }\n return null\n }\n\n const flightDatas = normalizeFlightData(serverData.f)\n if (typeof flightDatas === 'string') {\n // This means navigating to this route will result in an MPA navigation.\n // TODO: We should cache this, too, so that the MPA navigation is immediate.\n return null\n }\n\n const staleTimeHeaderSeconds = response.headers.get(\n NEXT_ROUTER_STALE_TIME_HEADER\n )\n const staleTimeMs =\n staleTimeHeaderSeconds !== null\n ? getStaleTimeMs(parseInt(staleTimeHeaderSeconds, 10))\n : STATIC_STALETIME_MS\n const staleAt = now + staleTimeMs\n\n for (const flightData of flightDatas) {\n const seedData = flightData.seedData\n if (seedData !== null) {\n // The data sent by the server represents only a subtree of the app. We\n // need to find the part of the task tree that matches the response.\n //\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n const segmentPath = flightData.segmentPath\n let requestKey = ROOT_SEGMENT_REQUEST_KEY\n let cacheKey = ROOT_SEGMENT_CACHE_KEY\n for (let i = 0; i < segmentPath.length; i += 2) {\n const parallelRouteKey: string = segmentPath[i]\n const segment: FlightRouterStateSegment = segmentPath[i + 1]\n const requestKeyPart = createSegmentRequestKeyPart(segment)\n requestKey = appendSegmentRequestKeyPart(\n requestKey,\n parallelRouteKey,\n requestKeyPart\n )\n cacheKey = appendSegmentCacheKeyPart(\n cacheKey,\n parallelRouteKey,\n createSegmentCacheKeyPart(requestKeyPart, segment)\n )\n }\n\n writeSeedDataIntoCache(\n now,\n task,\n fetchStrategy,\n route,\n staleAt,\n flightData.tree,\n seedData,\n isResponsePartial,\n cacheKey,\n requestKey,\n spawnedEntries\n )\n }\n\n // During a dynamic request, the server sends back new head data for the\n // page. Overwrite the existing head with the new one. Note that we're\n // intentionally not taking into account whether the existing head is\n // already complete, even though the incoming head might not have finished\n // streaming in yet. This is to prioritize consistency of the head with\n // the segment data (though it's still not a guarantee, since some of the\n // segment data may be reused from a previous request).\n route.head = flightData.head\n route.isHeadPartial = flightData.isHeadPartial\n route.TODO_isHeadDynamic = true\n\n // TODO: Currently the stale time of the route tree represents the\n // stale time of both the route tree *and* all the segment data. So we\n // can't just overwrite this field; we have to use whichever value is\n // lower. In the future, though, the plan is to track segment lifetimes\n // separately from the route tree lifetime.\n if (staleAt < route.staleAt) {\n route.staleAt = staleAt\n }\n }\n // Any entry that's still pending was intentionally not rendered by the\n // server, because it was inside the loading boundary. Mark them as rejected\n // so we know not to fetch them again.\n // TODO: If PPR is enabled on some routes but not others, then it's possible\n // that a different page is able to do a per-segment prefetch of one of the\n // segments we're marking as rejected here. We should mark on the segment\n // somehow that the reason for the rejection is because of a non-PPR prefetch.\n // That way a per-segment prefetch knows to disregard the rejection.\n if (spawnedEntries !== null) {\n const fulfilledEntries = rejectSegmentEntriesIfStillPending(\n spawnedEntries,\n now + 10 * 1000\n )\n return fulfilledEntries\n }\n return null\n}\n\nfunction writeSeedDataIntoCache(\n now: number,\n task: PrefetchTask,\n fetchStrategy:\n | FetchStrategy.LoadingBoundary\n | FetchStrategy.PPRRuntime\n | FetchStrategy.Full,\n route: FulfilledRouteCacheEntry,\n staleAt: number,\n flightRouterState: FlightRouterState,\n seedData: CacheNodeSeedData,\n isResponsePartial: boolean,\n cacheKey: SegmentCacheKey,\n requestKey: SegmentRequestKey,\n entriesOwnedByCurrentTask: Map<\n SegmentCacheKey,\n PendingSegmentCacheEntry\n > | null\n) {\n // This function is used to write the result of a dynamic server request\n // (CacheNodeSeedData) into the prefetch cache. It's used in cases where we\n // want to treat a dynamic response as if it were static. The two examples\n // where this happens are <Link prefetch={true}> (which implicitly opts\n // dynamic data into being static) and when prefetching a PPR-disabled route\n const rsc = seedData[0]\n const loading = seedData[2]\n const isPartial = rsc === null || isResponsePartial\n\n // We should only write into cache entries that are owned by us. Or create\n // a new one and write into that. We must never write over an entry that was\n // created by a different task, because that causes data races.\n const ownedEntry =\n entriesOwnedByCurrentTask !== null\n ? entriesOwnedByCurrentTask.get(cacheKey)\n : undefined\n if (ownedEntry !== undefined) {\n fulfillSegmentCacheEntry(ownedEntry, rsc, loading, staleAt, isPartial)\n } else {\n // There's no matching entry. Attempt to create a new one.\n const possiblyNewEntry = readOrCreateSegmentCacheEntry(\n now,\n fetchStrategy,\n route,\n cacheKey\n )\n if (possiblyNewEntry.status === EntryStatus.Empty) {\n // Confirmed this is a new entry. We can fulfill it.\n const newEntry = possiblyNewEntry\n fulfillSegmentCacheEntry(\n upgradeToPendingSegment(newEntry, fetchStrategy),\n rsc,\n loading,\n staleAt,\n isPartial\n )\n } else {\n // There was already an entry in the cache. But we may be able to\n // replace it with the new one from the server.\n const newEntry = fulfillSegmentCacheEntry(\n upgradeToPendingSegment(\n createDetachedSegmentCacheEntry(staleAt),\n fetchStrategy\n ),\n rsc,\n loading,\n staleAt,\n isPartial\n )\n upsertSegmentEntry(\n now,\n getSegmentKeypath(fetchStrategy, route, cacheKey),\n newEntry\n )\n }\n }\n // Recursively write the child data into the cache.\n const flightRouterStateChildren = flightRouterState[1]\n const seedDataChildren = seedData[1]\n for (const parallelRouteKey in flightRouterStateChildren) {\n const childFlightRouterState = flightRouterStateChildren[parallelRouteKey]\n const childSeedData: CacheNodeSeedData | null | void =\n seedDataChildren[parallelRouteKey]\n if (childSeedData !== null && childSeedData !== undefined) {\n const childSegment = childFlightRouterState[0]\n const childRequestKeyPart = createSegmentRequestKeyPart(childSegment)\n const childRequestKey = appendSegmentRequestKeyPart(\n requestKey,\n parallelRouteKey,\n childRequestKeyPart\n )\n const childCacheKey = appendSegmentCacheKeyPart(\n cacheKey,\n parallelRouteKey,\n createSegmentCacheKeyPart(childRequestKeyPart, childSegment)\n )\n writeSeedDataIntoCache(\n now,\n task,\n fetchStrategy,\n route,\n staleAt,\n childFlightRouterState,\n childSeedData,\n isResponsePartial,\n childCacheKey,\n childRequestKey,\n entriesOwnedByCurrentTask\n )\n }\n }\n}\n\nasync function fetchPrefetchResponse<T>(\n url: URL,\n headers: RequestHeaders\n): Promise<RSCResponse<T> | null> {\n const fetchPriority = 'low'\n // When issuing a prefetch request, don't immediately decode the response; we\n // use the lower level `createFromResponse` API instead because we need to do\n // some extra processing of the response stream. See\n // `createPrefetchResponseStream` for more details.\n const shouldImmediatelyDecode = false\n const response = await createFetch<T>(\n url,\n headers,\n fetchPriority,\n shouldImmediatelyDecode\n )\n if (!response.ok) {\n return null\n }\n\n // Check the content type\n if (isOutputExportMode) {\n // In output: \"export\" mode, we relaxed about the content type, since it's\n // not Next.js that's serving the response. If the status is OK, assume the\n // response is valid. If it's not a valid response, the Flight client won't\n // be able to decode it, and we'll treat it as a miss.\n } else {\n const contentType = response.headers.get('content-type')\n const isFlightResponse =\n contentType && contentType.startsWith(RSC_CONTENT_TYPE_HEADER)\n if (!isFlightResponse) {\n return null\n }\n }\n return response\n}\n\nfunction createPrefetchResponseStream(\n originalFlightStream: ReadableStream<Uint8Array>,\n onStreamClose: () => void,\n onResponseSizeUpdate: (size: number) => void\n): ReadableStream<Uint8Array> {\n // When PPR is enabled, prefetch streams may contain references that never\n // resolve, because that's how we encode dynamic data access. In the decoded\n // object returned by the Flight client, these are reified into hanging\n // promises that suspend during render, which is effectively what we want.\n // The UI resolves when it switches to the dynamic data stream\n // (via useDeferredValue(dynamic, static)).\n //\n // However, the Flight implementation currently errors if the server closes\n // the response before all the references are resolved. As a cheat to work\n // around this, we wrap the original stream in a new stream that never closes,\n // and therefore doesn't error.\n //\n // While processing the original stream, we also incrementally update the size\n // of the cache entry in the LRU.\n let totalByteLength = 0\n const reader = originalFlightStream.getReader()\n return new ReadableStream({\n async pull(controller) {\n while (true) {\n const { done, value } = await reader.read()\n if (!done) {\n // Pass to the target stream and keep consuming the Flight response\n // from the server.\n controller.enqueue(value)\n\n // Incrementally update the size of the cache entry in the LRU.\n // NOTE: Since prefetch responses are delivered in a single chunk,\n // it's not really necessary to do this streamingly, but I'm doing it\n // anyway in case this changes in the future.\n totalByteLength += value.byteLength\n onResponseSizeUpdate(totalByteLength)\n continue\n }\n // The server stream has closed. Exit, but intentionally do not close\n // the target stream. We do notify the caller, though.\n onStreamClose()\n return\n }\n },\n })\n}\n\nfunction addSegmentPathToUrlInOutputExportMode(\n url: URL,\n segmentPath: SegmentRequestKey\n): URL {\n if (isOutputExportMode) {\n // In output: \"export\" mode, we cannot use a header to encode the segment\n // path. Instead, we append it to the end of the pathname.\n const staticUrl = new URL(url)\n const routeDir = staticUrl.pathname.endsWith('/')\n ? staticUrl.pathname.slice(0, -1)\n : staticUrl.pathname\n const staticExportFilename =\n convertSegmentPathToStaticExportFilename(segmentPath)\n staticUrl.pathname = `${routeDir}/${staticExportFilename}`\n return staticUrl\n }\n return url\n}\n\n/**\n * Checks whether the new fetch strategy is likely to provide more content than the old one.\n *\n * Generally, when an app uses dynamic data, a \"more specific\" fetch strategy is expected to provide more content:\n * - `LoadingBoundary` only provides static layouts\n * - `PPR` can provide shells for each segment (even for segments that use dynamic data)\n * - `PPRRuntime` can additionally include content that uses searchParams, params, or cookies\n * - `Full` includes all the content, even if it uses dynamic data\n *\n * However, it's possible that a more specific fetch strategy *won't* give us more content if:\n * - a segment is fully static\n * (then, `PPR`/`PPRRuntime`/`Full` will all yield equivalent results)\n * - providing searchParams/params/cookies doesn't reveal any more content, e.g. because of an `await connection()`\n * (then, `PPR` and `PPRRuntime` will yield equivalent results, only `Full` will give us more)\n * Because of this, when comparing two segments, we should also check if the existing segment is partial.\n * If it's not partial, then there's no need to prefetch it again, even using a \"more specific\" strategy.\n * There's currently no way to know if `PPRRuntime` will yield more data that `PPR`, so we have to assume it will.\n *\n * Also note that, in practice, we don't expect to be comparing `LoadingBoundary` to `PPR`/`PPRRuntime`,\n * because a non-PPR-enabled route wouldn't ever use the latter strategies. It might however use `Full`.\n */\nexport function canNewFetchStrategyProvideMoreContent(\n currentStrategy: FetchStrategy,\n newStrategy: FetchStrategy\n): boolean {\n return currentStrategy < newStrategy\n}\n","// Utility type. Prefix<[A, B, C, D]> matches [A], [A, B], [A, B, C] etc.\nexport type Prefix<T extends any[]> = T extends [infer First, ...infer Rest]\n ? [] | [First] | [First, ...Prefix<Rest>]\n : []\n\nexport type TupleMap<Keypath extends Array<any>, V> = {\n set(keys: Prefix<Keypath>, value: V): void\n get(keys: Prefix<Keypath>): V | null\n delete(keys: Prefix<Keypath>): void\n}\n\n/**\n * Creates a map whose keys are tuples. Tuples are compared per-element. This\n * is useful when a key has multiple parts, but you don't want to concatenate\n * them into a single string value.\n *\n * In the Segment Cache, we use this to store cache entries by both their href\n * and their Next-URL.\n *\n * Example:\n * map.set(['https://localhost', 'foo/bar/baz'], 'yay');\n * map.get(['https://localhost', 'foo/bar/baz']); // returns 'yay'\n */\nexport function createTupleMap<Keypath extends Array<any>, V>(): TupleMap<\n Keypath,\n V\n> {\n type MapEntryShared = {\n parent: MapEntry | null\n key: any\n map: Map<any, MapEntry> | null\n }\n\n type EmptyMapEntry = MapEntryShared & {\n value: null\n hasValue: false\n }\n\n type FullMapEntry = MapEntryShared & {\n value: V\n hasValue: true\n }\n\n type MapEntry = EmptyMapEntry | FullMapEntry\n\n let rootEntry: MapEntry = {\n parent: null,\n key: null,\n hasValue: false,\n value: null,\n map: null,\n }\n\n // To optimize successive lookups, we cache the last accessed keypath.\n // Although it's not encoded in the type, these are both null or\n // both non-null. It uses object equality, so to take advantage of this\n // optimization, you must pass the same array instance to each successive\n // method call, and you must also not mutate the array between calls.\n let lastAccessedEntry: MapEntry | null = null\n let lastAccessedKeys: Prefix<Keypath> | null = null\n\n function getOrCreateEntry(keys: Prefix<Keypath>): MapEntry {\n if (lastAccessedKeys === keys) {\n return lastAccessedEntry!\n }\n\n // Go through each level of keys until we find the entry that matches,\n // or create a new one if it doesn't already exist.\n let entry = rootEntry\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n let map = entry.map\n if (map !== null) {\n const existingEntry = map.get(key)\n if (existingEntry !== undefined) {\n // Found a match. Keep going.\n entry = existingEntry\n continue\n }\n } else {\n map = new Map()\n entry.map = map\n }\n // No entry exists yet at this level. Create a new one.\n const newEntry: MapEntry = {\n parent: entry,\n key,\n value: null,\n hasValue: false,\n map: null,\n }\n map.set(key, newEntry)\n entry = newEntry\n }\n\n lastAccessedKeys = keys\n lastAccessedEntry = entry\n\n return entry\n }\n\n function getEntryIfExists(keys: Prefix<Keypath>): MapEntry | null {\n if (lastAccessedKeys === keys) {\n return lastAccessedEntry\n }\n\n // Go through each level of keys until we find the entry that matches, or\n // return null if no match exists.\n let entry = rootEntry\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n let map = entry.map\n if (map !== null) {\n const existingEntry = map.get(key)\n if (existingEntry !== undefined) {\n // Found a match. Keep going.\n entry = existingEntry\n continue\n }\n }\n // No entry exists at this level.\n return null\n }\n\n lastAccessedKeys = keys\n lastAccessedEntry = entry\n\n return entry\n }\n\n function set(keys: Prefix<Keypath>, value: V): void {\n const entry = getOrCreateEntry(keys)\n entry.hasValue = true\n entry.value = value\n }\n\n function get(keys: Prefix<Keypath>): V | null {\n const entry = getEntryIfExists(keys)\n if (entry === null || !entry.hasValue) {\n return null\n }\n return entry.value\n }\n\n function deleteEntry(keys: Prefix<Keypath>): void {\n const entry = getEntryIfExists(keys)\n if (entry === null || !entry.hasValue) {\n return\n }\n\n // Found a match. Delete it from the cache.\n const deletedEntry: EmptyMapEntry = entry as any\n deletedEntry.hasValue = false\n deletedEntry.value = null\n\n // Check if we can garbage collect the entry.\n if (deletedEntry.map === null) {\n // Since this entry has no value, and also no child entries, we can\n // garbage collect it. Remove it from its parent, and keep garbage\n // collecting the parents until we reach a non-empty entry.\n\n // Unlike a `set` operation, these are no longer valid because the entry\n // itself is being modified, not just the value it contains.\n lastAccessedEntry = null\n lastAccessedKeys = null\n\n let parent = deletedEntry.parent\n let key = deletedEntry.key\n while (parent !== null) {\n const parentMap = parent.map\n if (parentMap !== null) {\n parentMap.delete(key)\n if (parentMap.size === 0) {\n // We just removed the last entry in the parent map.\n parent.map = null\n if (parent.value === null) {\n // The parent node has no child entries, nor does it have a value\n // on itself. It can be garbage collected. Keep going.\n key = parent.key\n parent = parent.parent\n continue\n }\n }\n }\n // The parent is not empty. Stop garbage collecting.\n break\n }\n }\n }\n\n return {\n set,\n get,\n delete: deleteEntry,\n }\n}\n","export type LRU<T extends LRUNode> = {\n put(node: T): void\n delete(node: T): void\n updateSize(node: T, size: number): void\n}\n\n// Doubly-linked list\ntype LRUNode<T = any> = {\n // Although it's not encoded in the type, these are both null if the node is\n // not in the LRU; both non-null if it is.\n prev: T | null\n next: T | null\n size: number\n}\n\n// Rather than create an internal LRU node, the passed-in type must conform\n// the LRUNode interface. This is just a memory optimization to avoid creating\n// another object; we only use this for Segment Cache entries so it doesn't need\n// to be general purpose.\nexport function createLRU<T extends LRUNode>(\n // From the LRU's perspective, the size unit is arbitrary, but for our\n // purposes this is the byte size.\n maxLruSize: number,\n onEviction: (node: T) => void\n): LRU<T> {\n let head: T | null = null\n let didScheduleCleanup: boolean = false\n let lruSize: number = 0\n\n function put(node: T) {\n if (head === node) {\n // Already at the head\n return\n }\n const prev = node.prev\n const next = node.next\n if (next === null || prev === null) {\n // This is an insertion\n lruSize += node.size\n // Whenever we add an entry, we need to check if we've exceeded the\n // max size. We don't evict entries immediately; they're evicted later in\n // an asynchronous task.\n ensureCleanupIsScheduled()\n } else {\n // This is a move. Remove from its current position.\n prev.next = next\n next.prev = prev\n }\n\n // Move to the front of the list\n if (head === null) {\n // This is the first entry\n node.prev = node\n node.next = node\n } else {\n // Add to the front of the list\n const tail = head.prev\n node.prev = tail\n tail.next = node\n node.next = head\n head.prev = node\n }\n head = node\n }\n\n function updateSize(node: T, newNodeSize: number) {\n // This is a separate function from `put` so that we can resize the entry\n // regardless of whether it's currently being tracked by the LRU.\n const prevNodeSize = node.size\n node.size = newNodeSize\n if (node.next === null) {\n // This entry is not currently being tracked by the LRU.\n return\n }\n // Update the total LRU size\n lruSize = lruSize - prevNodeSize + newNodeSize\n ensureCleanupIsScheduled()\n }\n\n function deleteNode(deleted: T) {\n const next = deleted.next\n const prev = deleted.prev\n if (next !== null && prev !== null) {\n lruSize -= deleted.size\n\n deleted.next = null\n deleted.prev = null\n\n // Remove from the list\n if (head === deleted) {\n // Update the head\n if (next === head) {\n // This was the last entry\n head = null\n } else {\n head = next\n }\n } else {\n prev.next = next\n next.prev = prev\n }\n } else {\n // Already deleted\n }\n }\n\n function ensureCleanupIsScheduled() {\n if (didScheduleCleanup || lruSize <= maxLruSize) {\n return\n }\n didScheduleCleanup = true\n requestCleanupCallback(cleanup)\n }\n\n function cleanup() {\n didScheduleCleanup = false\n\n // Evict entries until we're at 90% capacity. We can assume this won't\n // infinite loop because even if `maxLruSize` were 0, eventually\n // `deleteNode` sets `head` to `null` when we run out entries.\n const ninetyPercentMax = maxLruSize * 0.9\n while (lruSize > ninetyPercentMax && head !== null) {\n const tail = head.prev\n deleteNode(tail)\n onEviction(tail)\n }\n }\n\n return {\n put,\n delete: deleteNode,\n updateSize,\n }\n}\n\nconst requestCleanupCallback =\n typeof requestIdleCallback === 'function'\n ? requestIdleCallback\n : (cb: () => void) => setTimeout(cb, 0)\n","import type {\n CacheNodeSeedData,\n FlightRouterState,\n FlightSegmentPath,\n} from '../../../shared/lib/app-router-types'\nimport type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type {\n HeadData,\n LoadingModuleData,\n} from '../../../shared/lib/app-router-types'\nimport type { NormalizedFlightData } from '../../flight-data-helpers'\nimport { fetchServerResponse } from '../router-reducer/fetch-server-response'\nimport {\n startPPRNavigation,\n listenForDynamicRequest,\n type Task as PPRNavigationTask,\n} from '../router-reducer/ppr-navigations'\nimport { createHrefFromUrl } from '../router-reducer/create-href-from-url'\nimport {\n EntryStatus,\n readRouteCacheEntry,\n readSegmentCacheEntry,\n waitForSegmentCacheEntry,\n requestOptimisticRouteCacheEntry,\n type RouteTree,\n type FulfilledRouteCacheEntry,\n} from './cache'\nimport { createCacheKey } from './cache-key'\nimport { addSearchParamsIfPageSegment } from '../../../shared/lib/segment'\nimport { NavigationResultTag } from '../segment-cache'\n\ntype MPANavigationResult = {\n tag: NavigationResultTag.MPA\n data: string\n}\n\ntype NoOpNavigationResult = {\n tag: NavigationResultTag.NoOp\n data: {\n canonicalUrl: string\n shouldScroll: boolean\n }\n}\n\ntype SuccessfulNavigationResult = {\n tag: NavigationResultTag.Success\n data: {\n flightRouterState: FlightRouterState\n cacheNode: CacheNode\n canonicalUrl: string\n renderedSearch: string\n scrollableSegments: Array<FlightSegmentPath>\n shouldScroll: boolean\n hash: string\n }\n}\n\ntype AsyncNavigationResult = {\n tag: NavigationResultTag.Async\n data: Promise<\n MPANavigationResult | NoOpNavigationResult | SuccessfulNavigationResult\n >\n}\n\nexport type NavigationResult =\n | MPANavigationResult\n | SuccessfulNavigationResult\n | NoOpNavigationResult\n | AsyncNavigationResult\n\n/**\n * Navigate to a new URL, using the Segment Cache to construct a response.\n *\n * To allow for synchronous navigations whenever possible, this is not an async\n * function. It returns a promise only if there's no matching prefetch in\n * the cache. Otherwise it returns an immediate result and uses Suspense/RSC to\n * stream in any missing data.\n */\nexport function navigate(\n url: URL,\n currentUrl: URL,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n nextUrl: string | null,\n shouldScroll: boolean,\n accumulation: { collectedDebugInfo?: Array<unknown> }\n): NavigationResult {\n const now = Date.now()\n const href = url.href\n\n // We special case navigations to the exact same URL as the current location.\n // It's a common UI pattern for apps to refresh when you click a link to the\n // current page. So when this happens, we refresh the dynamic data in the page\n // segments.\n //\n // Note that this does not apply if the any part of the hash or search query\n // has changed. This might feel a bit weird but it makes more sense when you\n // consider that the way to trigger this behavior is to click the same link\n // multiple times.\n //\n // TODO: We should probably refresh the *entire* route when this case occurs,\n // not just the page segments. Essentially treating it the same as a refresh()\n // triggered by an action, which is the more explicit way of modeling the UI\n // pattern described above.\n //\n // Also note that this only refreshes the dynamic data, not static/ cached\n // data. If the page segment is fully static and prefetched, the request is\n // skipped. (This is also how refresh() works.)\n const isSamePageNavigation =\n // TODO: This is not the only place we read from the location, but we should\n // consider storing the current URL in the router state instead of reading\n // from the location object. In practice I don't think this matters much\n // since we keep them in sync anyway, but having two sources of truth can\n // lead to subtle bugs and race conditions.\n href === window.location.href\n\n const cacheKey = createCacheKey(href, nextUrl)\n const route = readRouteCacheEntry(now, cacheKey)\n if (route !== null && route.status === EntryStatus.Fulfilled) {\n // We have a matching prefetch.\n const snapshot = readRenderSnapshotFromCache(now, route, route.tree)\n const prefetchFlightRouterState = snapshot.flightRouterState\n const prefetchSeedData = snapshot.seedData\n const prefetchHead = route.head\n const isPrefetchHeadPartial = route.isHeadPartial\n const newCanonicalUrl = route.canonicalUrl\n const renderedSearch = route.renderedSearch\n return navigateUsingPrefetchedRouteTree(\n now,\n url,\n currentUrl,\n nextUrl,\n isSamePageNavigation,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n newCanonicalUrl,\n renderedSearch,\n shouldScroll,\n url.hash\n )\n }\n\n // There was no matching route tree in the cache. Let's see if we can\n // construct an \"optimistic\" route tree.\n //\n // Do not construct an optimistic route tree if there was a cache hit, but\n // the entry has a rejected status, since it may have been rejected due to a\n // rewrite or redirect based on the search params.\n //\n // TODO: There are multiple reasons a prefetch might be rejected; we should\n // track them explicitly and choose what to do here based on that.\n if (route === null || route.status !== EntryStatus.Rejected) {\n const optimisticRoute = requestOptimisticRouteCacheEntry(now, url, nextUrl)\n if (optimisticRoute !== null) {\n // We have an optimistic route tree. Proceed with the normal flow.\n const snapshot = readRenderSnapshotFromCache(\n now,\n optimisticRoute,\n optimisticRoute.tree\n )\n const prefetchFlightRouterState = snapshot.flightRouterState\n const prefetchSeedData = snapshot.seedData\n const prefetchHead = optimisticRoute.head\n const isPrefetchHeadPartial = optimisticRoute.isHeadPartial\n const newCanonicalUrl = optimisticRoute.canonicalUrl\n const newRenderedSearch = optimisticRoute.renderedSearch\n return navigateUsingPrefetchedRouteTree(\n now,\n url,\n currentUrl,\n nextUrl,\n isSamePageNavigation,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n newCanonicalUrl,\n newRenderedSearch,\n shouldScroll,\n url.hash\n )\n }\n }\n\n // There's no matching prefetch for this route in the cache.\n let collectedDebugInfo = accumulation.collectedDebugInfo ?? []\n if (accumulation.collectedDebugInfo === undefined) {\n collectedDebugInfo = accumulation.collectedDebugInfo = []\n }\n return {\n tag: NavigationResultTag.Async,\n data: navigateDynamicallyWithNoPrefetch(\n now,\n url,\n currentUrl,\n nextUrl,\n isSamePageNavigation,\n currentCacheNode,\n currentFlightRouterState,\n shouldScroll,\n url.hash,\n collectedDebugInfo\n ),\n }\n}\n\nfunction navigateUsingPrefetchedRouteTree(\n now: number,\n url: URL,\n currentUrl: URL,\n nextUrl: string | null,\n isSamePageNavigation: boolean,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n prefetchFlightRouterState: FlightRouterState,\n prefetchSeedData: CacheNodeSeedData | null,\n prefetchHead: HeadData | null,\n isPrefetchHeadPartial: boolean,\n canonicalUrl: string,\n renderedSearch: string,\n shouldScroll: boolean,\n hash: string\n): SuccessfulNavigationResult | NoOpNavigationResult | MPANavigationResult {\n // Recursively construct a prefetch tree by reading from the Segment Cache. To\n // maintain compatibility, we output the same data structures as the old\n // prefetching implementation: FlightRouterState and CacheNodeSeedData.\n // TODO: Eventually updateCacheNodeOnNavigation (or the equivalent) should\n // read from the Segment Cache directly. It's only structured this way for now\n // so we can share code with the old prefetching implementation.\n const scrollableSegments: Array<FlightSegmentPath> = []\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n isSamePageNavigation,\n scrollableSegments\n )\n if (task !== null) {\n const dynamicRequestTree = task.dynamicRequestTree\n if (dynamicRequestTree !== null) {\n const promiseForDynamicServerResponse = fetchServerResponse(\n new URL(canonicalUrl, url.origin),\n {\n flightRouterState: dynamicRequestTree,\n nextUrl,\n }\n )\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We can skip the dynamic request.\n }\n return navigationTaskToResult(\n task,\n currentCacheNode,\n canonicalUrl,\n renderedSearch,\n scrollableSegments,\n shouldScroll,\n hash\n )\n }\n // The server sent back an empty tree patch. There's nothing to update, except\n // possibly the URL.\n return {\n tag: NavigationResultTag.NoOp,\n data: {\n canonicalUrl,\n shouldScroll,\n },\n }\n}\n\nfunction navigationTaskToResult(\n task: PPRNavigationTask,\n currentCacheNode: CacheNode,\n canonicalUrl: string,\n renderedSearch: string,\n scrollableSegments: Array<FlightSegmentPath>,\n shouldScroll: boolean,\n hash: string\n): SuccessfulNavigationResult | MPANavigationResult {\n const flightRouterState = task.route\n if (flightRouterState === null) {\n // When no router state is provided, it signals that we should perform an\n // MPA navigation.\n return {\n tag: NavigationResultTag.MPA,\n data: canonicalUrl,\n }\n }\n const newCacheNode = task.node\n return {\n tag: NavigationResultTag.Success,\n data: {\n flightRouterState,\n cacheNode: newCacheNode !== null ? newCacheNode : currentCacheNode,\n canonicalUrl,\n renderedSearch,\n scrollableSegments,\n shouldScroll,\n hash,\n },\n }\n}\n\nfunction readRenderSnapshotFromCache(\n now: number,\n route: FulfilledRouteCacheEntry,\n tree: RouteTree\n): { flightRouterState: FlightRouterState; seedData: CacheNodeSeedData } {\n let childRouterStates: { [parallelRouteKey: string]: FlightRouterState } = {}\n let childSeedDatas: {\n [parallelRouteKey: string]: CacheNodeSeedData | null\n } = {}\n const slots = tree.slots\n if (slots !== null) {\n for (const parallelRouteKey in slots) {\n const childTree = slots[parallelRouteKey]\n const childResult = readRenderSnapshotFromCache(now, route, childTree)\n childRouterStates[parallelRouteKey] = childResult.flightRouterState\n childSeedDatas[parallelRouteKey] = childResult.seedData\n }\n }\n\n let rsc: React.ReactNode | null = null\n let loading: LoadingModuleData | Promise<LoadingModuleData> = null\n let isPartial: boolean = true\n\n const segmentEntry = readSegmentCacheEntry(now, route, tree.cacheKey)\n if (segmentEntry !== null) {\n switch (segmentEntry.status) {\n case EntryStatus.Fulfilled: {\n // Happy path: a cache hit\n rsc = segmentEntry.rsc\n loading = segmentEntry.loading\n isPartial = segmentEntry.isPartial\n break\n }\n case EntryStatus.Pending: {\n // We haven't received data for this segment yet, but there's already\n // an in-progress request. Since it's extremely likely to arrive\n // before the dynamic data response, we might as well use it.\n const promiseForFulfilledEntry = waitForSegmentCacheEntry(segmentEntry)\n rsc = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.rsc : null\n )\n loading = promiseForFulfilledEntry.then((entry) =>\n entry !== null ? entry.loading : null\n )\n // Since we don't know yet whether the segment is partial or fully\n // static, we must assume it's partial; we can't skip the\n // dynamic request.\n isPartial = true\n break\n }\n case EntryStatus.Empty:\n case EntryStatus.Rejected:\n break\n default:\n segmentEntry satisfies never\n }\n }\n\n // The navigation implementation expects the search params to be\n // included in the segment. However, the Segment Cache tracks search\n // params separately from the rest of the segment key. So we need to\n // add them back here.\n //\n // See corresponding comment in convertFlightRouterStateToTree.\n //\n // TODO: What we should do instead is update the navigation diffing\n // logic to compare search params explicitly. This is a temporary\n // solution until more of the Segment Cache implementation has settled.\n const segment = addSearchParamsIfPageSegment(\n tree.segment,\n Object.fromEntries(new URLSearchParams(route.renderedSearch))\n )\n\n // We don't need this information in a render snapshot, so this can just be a placeholder.\n const hasRuntimePrefetch = false\n\n return {\n flightRouterState: [\n segment,\n childRouterStates,\n null,\n null,\n tree.isRootLayout,\n ],\n seedData: [rsc, childSeedDatas, loading, isPartial, hasRuntimePrefetch],\n }\n}\n\nasync function navigateDynamicallyWithNoPrefetch(\n now: number,\n url: URL,\n currentUrl: URL,\n nextUrl: string | null,\n isSamePageNavigation: boolean,\n currentCacheNode: CacheNode,\n currentFlightRouterState: FlightRouterState,\n shouldScroll: boolean,\n hash: string,\n collectedDebugInfo: Array<unknown>\n): Promise<\n MPANavigationResult | SuccessfulNavigationResult | NoOpNavigationResult\n> {\n // Runs when a navigation happens but there's no cached prefetch we can use.\n // Don't bother to wait for a prefetch response; go straight to a full\n // navigation that contains both static and dynamic data in a single stream.\n // (This is unlike the old navigation implementation, which instead blocks\n // the dynamic request until a prefetch request is received.)\n //\n // To avoid duplication of logic, we're going to pretend that the tree\n // returned by the dynamic request is, in fact, a prefetch tree. Then we can\n // use the same server response to write the actual data into the CacheNode\n // tree. So it's the same flow as the \"happy path\" (prefetch, then\n // navigation), except we use a single server response for both stages.\n\n const promiseForDynamicServerResponse = fetchServerResponse(url, {\n flightRouterState: currentFlightRouterState,\n nextUrl,\n })\n const result = await promiseForDynamicServerResponse\n if (typeof result === 'string') {\n // This is an MPA navigation.\n const newUrl = result\n return {\n tag: NavigationResultTag.MPA,\n data: newUrl,\n }\n }\n\n const {\n flightData,\n canonicalUrl,\n renderedSearch,\n debugInfo: debugInfoFromResponse,\n } = result\n if (debugInfoFromResponse !== null) {\n collectedDebugInfo.push(...debugInfoFromResponse)\n }\n\n // Since the response format of dynamic requests and prefetches is slightly\n // different, we'll need to massage the data a bit. Create FlightRouterState\n // tree that simulates what we'd receive as the result of a prefetch.\n const prefetchFlightRouterState = simulatePrefetchTreeUsingDynamicTreePatch(\n currentFlightRouterState,\n flightData\n )\n\n // In our simulated prefetch payload, we pretend that there's no seed data\n // nor a prefetch head.\n const prefetchSeedData = null\n const prefetchHead = null\n const isPrefetchHeadPartial = true\n\n // Now we proceed exactly as we would for normal navigation.\n const scrollableSegments: Array<FlightSegmentPath> = []\n const task = startPPRNavigation(\n now,\n currentUrl,\n currentCacheNode,\n currentFlightRouterState,\n prefetchFlightRouterState,\n prefetchSeedData,\n prefetchHead,\n isPrefetchHeadPartial,\n isSamePageNavigation,\n scrollableSegments\n )\n if (task !== null) {\n // In this case, we've already sent the dynamic request, so we don't\n // actually use the request tree created by `startPPRNavigation`,\n // except to check if it contains dynamic holes.\n //\n // This is almost always true, but it could be false if all the segment data\n // was present in the cache, but the route tree was not. E.g. navigating\n // to a URL that was not prefetched but rewrites to a different URL\n // that was.\n const hasDynamicHoles = task.dynamicRequestTree !== null\n if (hasDynamicHoles) {\n listenForDynamicRequest(task, promiseForDynamicServerResponse)\n } else {\n // The prefetched tree does not contain dynamic holes — it's\n // fully static. We don't need to process the server response further.\n }\n return navigationTaskToResult(\n task,\n currentCacheNode,\n createHrefFromUrl(canonicalUrl),\n renderedSearch,\n scrollableSegments,\n shouldScroll,\n hash\n )\n }\n // The server sent back an empty tree patch. There's nothing to update, except\n // possibly the URL.\n return {\n tag: NavigationResultTag.NoOp,\n data: {\n canonicalUrl: createHrefFromUrl(canonicalUrl),\n shouldScroll,\n },\n }\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatch(\n currentTree: FlightRouterState,\n flightData: Array<NormalizedFlightData>\n): FlightRouterState {\n // Takes the current FlightRouterState and applies the router state patch\n // received from the server, to create a full FlightRouterState tree that we\n // can pretend was returned by a prefetch.\n //\n // (It sounds similar to what applyRouterStatePatch does, but it doesn't need\n // to handle stuff like interception routes or diffing since that will be\n // handled later.)\n let baseTree = currentTree\n for (const { segmentPath, tree: treePatch } of flightData) {\n // If the server sends us multiple tree patches, we only need to clone the\n // base tree when applying the first patch. After the first patch, we can\n // apply the remaining patches in place without copying.\n const canMutateInPlace = baseTree !== currentTree\n baseTree = simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseTree,\n treePatch,\n segmentPath,\n canMutateInPlace,\n 0\n )\n }\n\n return baseTree\n}\n\nfunction simulatePrefetchTreeUsingDynamicTreePatchImpl(\n baseRouterState: FlightRouterState,\n patch: FlightRouterState,\n segmentPath: FlightSegmentPath,\n canMutateInPlace: boolean,\n index: number\n) {\n if (index === segmentPath.length) {\n // We reached the part of the tree that we need to patch.\n return patch\n }\n\n // segmentPath represents the parent path of subtree. It's a repeating\n // pattern of parallel route key and segment:\n //\n // [string, Segment, string, Segment, string, Segment, ...]\n //\n // This path tells us which part of the base tree to apply the tree patch.\n //\n // NOTE: In the case of a fully dynamic request with no prefetch, we receive\n // the FlightRouterState patch in the same request as the dynamic data.\n // Therefore we don't need to worry about diffing the segment values; we can\n // assume the server sent us a correct result.\n const updatedParallelRouteKey: string = segmentPath[index]\n // const segment: Segment = segmentPath[index + 1] <-- Not used, see note above\n\n const baseChildren = baseRouterState[1]\n const newChildren: { [parallelRouteKey: string]: FlightRouterState } = {}\n for (const parallelRouteKey in baseChildren) {\n if (parallelRouteKey === updatedParallelRouteKey) {\n const childBaseRouterState = baseChildren[parallelRouteKey]\n newChildren[parallelRouteKey] =\n simulatePrefetchTreeUsingDynamicTreePatchImpl(\n childBaseRouterState,\n patch,\n segmentPath,\n canMutateInPlace,\n // Advance the index by two and keep cloning until we reach\n // the end of the segment path.\n index + 2\n )\n } else {\n // This child is not being patched. Copy it over as-is.\n newChildren[parallelRouteKey] = baseChildren[parallelRouteKey]\n }\n }\n\n if (canMutateInPlace) {\n // We can mutate the base tree in place, because the base tree is already\n // a clone.\n baseRouterState[1] = newChildren\n return baseRouterState\n }\n\n // Clone all the fields except the children.\n //\n // Based on equivalent logic in apply-router-state-patch-to-tree, but should\n // confirm whether we need to copy all of these fields. Not sure the server\n // ever sends, e.g. the refetch marker.\n const clone: FlightRouterState = [baseRouterState[0], newChildren]\n if (2 in baseRouterState) {\n clone[2] = baseRouterState[2]\n }\n if (3 in baseRouterState) {\n clone[3] = baseRouterState[3]\n }\n if (4 in baseRouterState) {\n clone[4] = baseRouterState[4]\n }\n return clone\n}\n","import type { FlightRouterState } from '../../../shared/lib/app-router-types'\nimport { createPrefetchURL } from '../app-router-utils'\nimport { createCacheKey } from './cache-key'\nimport { schedulePrefetchTask } from './scheduler'\nimport {\n PrefetchPriority,\n type PrefetchTaskFetchStrategy,\n} from '../segment-cache'\n\n/**\n * Entrypoint for prefetching a URL into the Segment Cache.\n * @param href - The URL to prefetch. Typically this will come from a <Link>,\n * or router.prefetch. It must be validated before we attempt to prefetch it.\n * @param nextUrl - A special header used by the server for interception routes.\n * Roughly corresponds to the current URL.\n * @param treeAtTimeOfPrefetch - The FlightRouterState at the time the prefetch\n * was requested. This is only used when PPR is disabled.\n * @param fetchStrategy - Whether to prefetch dynamic data, in addition to\n * static data. This is used by `<Link prefetch={true}>`.\n * @param onInvalidate - A callback that will be called when the prefetch cache\n * When called, it signals to the listener that the data associated with the\n * prefetch may have been invalidated from the cache. This is not a live\n * subscription — it's called at most once per `prefetch` call. The only\n * supported use case is to trigger a new prefetch inside the listener, if\n * desired. It also may be called even in cases where the associated data is\n * still cached. Prefetching is a poll-based (pull) operation, not an event-\n * based (push) one. Rather than subscribe to specific cache entries, you\n * occasionally poll the prefetch cache to check if anything is missing.\n */\nexport function prefetch(\n href: string,\n nextUrl: string | null,\n treeAtTimeOfPrefetch: FlightRouterState,\n fetchStrategy: PrefetchTaskFetchStrategy,\n onInvalidate: null | (() => void)\n) {\n const url = createPrefetchURL(href)\n if (url === null) {\n // This href should not be prefetched.\n return\n }\n const cacheKey = createCacheKey(url.href, nextUrl)\n schedulePrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n fetchStrategy,\n PrefetchPriority.Default,\n onInvalidate\n )\n}\n","import type {\n FlightRouterState,\n Segment as FlightRouterStateSegment,\n Segment,\n} from '../../../shared/lib/app-router-types'\nimport { HasLoadingBoundary } from '../../../shared/lib/app-router-types'\nimport { matchSegment } from '../match-segments'\nimport {\n readOrCreateRouteCacheEntry,\n readOrCreateSegmentCacheEntry,\n fetchRouteOnCacheMiss,\n fetchSegmentOnCacheMiss,\n EntryStatus,\n type FulfilledRouteCacheEntry,\n type RouteCacheEntry,\n type SegmentCacheEntry,\n type RouteTree,\n fetchSegmentPrefetchesUsingDynamicRequest,\n type PendingSegmentCacheEntry,\n convertRouteTreeToFlightRouterState,\n readOrCreateRevalidatingSegmentEntry,\n upsertSegmentEntry,\n type FulfilledSegmentCacheEntry,\n upgradeToPendingSegment,\n waitForSegmentCacheEntry,\n resetRevalidatingSegmentEntry,\n getSegmentKeypath,\n canNewFetchStrategyProvideMoreContent,\n} from './cache'\nimport type { RouteCacheKey } from './cache-key'\nimport { createCacheKey } from './cache-key'\nimport {\n FetchStrategy,\n type PrefetchTaskFetchStrategy,\n getCurrentCacheVersion,\n PrefetchPriority,\n} from '../segment-cache'\nimport {\n addSearchParamsIfPageSegment,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport type { SegmentCacheKey } from '../../../shared/lib/segment-cache/segment-value-encoding'\n\nconst scheduleMicrotask =\n typeof queueMicrotask === 'function'\n ? queueMicrotask\n : (fn: () => unknown) =>\n Promise.resolve()\n .then(fn)\n .catch((error) =>\n setTimeout(() => {\n throw error\n })\n )\n\nexport type PrefetchTask = {\n key: RouteCacheKey\n\n /**\n * The FlightRouterState at the time the task was initiated. This is needed\n * when falling back to the non-PPR behavior, which only prefetches up to\n * the first loading boundary.\n */\n treeAtTimeOfPrefetch: FlightRouterState\n\n /**\n * The cache version at the time the task was initiated. This is used to\n * determine if the cache was invalidated since the task was initiated.\n */\n cacheVersion: number\n\n /**\n * Whether to prefetch dynamic data, in addition to static data. This is\n * used by `<Link prefetch={true}>`.\n *\n * Note that a task with `FetchStrategy.PPR` might need to use\n * `FetchStrategy.LoadingBoundary` instead if we find out that a route\n * does not support PPR after doing the initial route prefetch.\n */\n fetchStrategy: PrefetchTaskFetchStrategy\n\n /**\n * sortId is an incrementing counter\n *\n * Newer prefetches are prioritized over older ones, so that as new links\n * enter the viewport, they are not starved by older links that are no\n * longer relevant. In the future, we can add additional prioritization\n * heuristics, like removing prefetches once a link leaves the viewport.\n *\n * The sortId is assigned when the prefetch is initiated, and reassigned if\n * the same task is prefetched again (effectively bumping it to the top of\n * the queue).\n *\n * TODO: We can add additional fields here to indicate what kind of prefetch\n * it is. For example, was it initiated by a link? Or was it an imperative\n * call? If it was initiated by a link, we can remove it from the queue when\n * the link leaves the viewport, but if it was an imperative call, then we\n * should keep it in the queue until it's fulfilled.\n *\n * We can also add priority levels. For example, hovering over a link could\n * increase the priority of its prefetch.\n */\n sortId: number\n\n /**\n * The priority of the task. Like sortId, this affects the task's position in\n * the queue, so it must never be updated without resifting the heap.\n */\n priority: PrefetchPriority\n\n /**\n * The phase of the task. Tasks are split into multiple phases so that their\n * priority can be adjusted based on what kind of work they're doing.\n * Concretely, prefetching the route tree is higher priority than prefetching\n * segment data.\n */\n phase: PrefetchPhase\n\n /**\n * These fields are temporary state for tracking the currently running task.\n * They are reset after each iteration of the task queue.\n */\n hasBackgroundWork: boolean\n spawnedRuntimePrefetches: Set<SegmentCacheKey> | null\n\n /**\n * True if the prefetch was cancelled.\n */\n isCanceled: boolean\n\n /**\n * The callback passed to `router.prefetch`, if given.\n */\n onInvalidate: null | (() => void)\n\n /**\n * The index of the task in the heap's backing array. Used to efficiently\n * change the priority of a task by re-sifting it, which requires knowing\n * where it is in the array. This is only used internally by the heap\n * algorithm. The naive alternative is indexOf every time a task is queued,\n * which has O(n) complexity.\n *\n * We also use this field to check whether a task is currently in the queue.\n */\n _heapIndex: number\n}\n\nconst enum PrefetchTaskExitStatus {\n /**\n * The task yielded because there are too many requests in progress.\n */\n InProgress,\n\n /**\n * The task is blocked. It needs more data before it can proceed.\n *\n * Currently the only reason this happens is we're still waiting to receive a\n * route tree from the server, because we can't start prefetching the segments\n * until we know what to prefetch.\n */\n Blocked,\n\n /**\n * There's nothing left to prefetch.\n */\n Done,\n}\n\n/**\n * Prefetch tasks are processed in two phases: first the route tree is fetched,\n * then the segments. We use this to priortize tasks that have not yet fetched\n * the route tree.\n */\nconst enum PrefetchPhase {\n RouteTree = 1,\n Segments = 0,\n}\n\nexport type PrefetchSubtaskResult<T> = {\n /**\n * A promise that resolves when the network connection is closed.\n */\n closed: Promise<void>\n value: T\n}\n\nconst taskHeap: Array<PrefetchTask> = []\n\nlet inProgressRequests = 0\n\nlet sortIdCounter = 0\nlet didScheduleMicrotask = false\n\n// The most recently hovered (or touched, etc) link, i.e. the most recent task\n// scheduled at Intent priority. There's only ever a single task at Intent\n// priority at a time. We reserve special network bandwidth for this task only.\nlet mostRecentlyHoveredLink: PrefetchTask | null = null\n\n// CDN cache propagation delay after revalidation (in milliseconds)\nconst REVALIDATION_COOLDOWN_MS = 300\n\n// Timeout handle for the revalidation cooldown. When non-null, prefetch\n// requests are blocked to allow CDN cache propagation.\nlet revalidationCooldownTimeoutHandle: ReturnType<typeof setTimeout> | null =\n null\n\n/**\n * Called by the cache when revalidation occurs. Starts a cooldown period\n * during which prefetch requests are blocked to allow CDN cache propagation.\n */\nexport function startRevalidationCooldown(): void {\n // Clear any existing timeout in case multiple revalidations happen\n // in quick succession.\n if (revalidationCooldownTimeoutHandle !== null) {\n clearTimeout(revalidationCooldownTimeoutHandle)\n }\n\n // Schedule the cooldown to expire after the delay.\n revalidationCooldownTimeoutHandle = setTimeout(() => {\n revalidationCooldownTimeoutHandle = null\n // Retry the prefetch queue now that the cooldown has expired.\n ensureWorkIsScheduled()\n }, REVALIDATION_COOLDOWN_MS)\n}\n\nexport type IncludeDynamicData = null | 'full' | 'dynamic'\n\n/**\n * Initiates a prefetch task for the given URL. If a prefetch for the same URL\n * is already in progress, this will bump it to the top of the queue.\n *\n * This is not a user-facing function. By the time this is called, the href is\n * expected to be validated and normalized.\n *\n * @param key The RouteCacheKey to prefetch.\n * @param treeAtTimeOfPrefetch The app's current FlightRouterState\n * @param fetchStrategy Whether to prefetch dynamic data, in addition to\n * static data. This is used by `<Link prefetch={true}>`.\n */\nexport function schedulePrefetchTask(\n key: RouteCacheKey,\n treeAtTimeOfPrefetch: FlightRouterState,\n fetchStrategy: PrefetchTaskFetchStrategy,\n priority: PrefetchPriority,\n onInvalidate: null | (() => void)\n): PrefetchTask {\n // Spawn a new prefetch task\n const task: PrefetchTask = {\n key,\n treeAtTimeOfPrefetch,\n cacheVersion: getCurrentCacheVersion(),\n priority,\n phase: PrefetchPhase.RouteTree,\n hasBackgroundWork: false,\n spawnedRuntimePrefetches: null,\n fetchStrategy,\n sortId: sortIdCounter++,\n isCanceled: false,\n onInvalidate,\n _heapIndex: -1,\n }\n\n trackMostRecentlyHoveredLink(task)\n\n heapPush(taskHeap, task)\n\n // Schedule an async task to process the queue.\n //\n // The main reason we process the queue in an async task is for batching.\n // It's common for a single JS task/event to trigger multiple prefetches.\n // By deferring to a microtask, we only process the queue once per JS task.\n // If they have different priorities, it also ensures they are processed in\n // the optimal order.\n ensureWorkIsScheduled()\n\n return task\n}\n\nexport function cancelPrefetchTask(task: PrefetchTask): void {\n // Remove the prefetch task from the queue. If the task already completed,\n // then this is a no-op.\n //\n // We must also explicitly mark the task as canceled so that a blocked task\n // does not get added back to the queue when it's pinged by the network.\n task.isCanceled = true\n heapDelete(taskHeap, task)\n}\n\nexport function reschedulePrefetchTask(\n task: PrefetchTask,\n treeAtTimeOfPrefetch: FlightRouterState,\n fetchStrategy: PrefetchTaskFetchStrategy,\n priority: PrefetchPriority\n): void {\n // Bump the prefetch task to the top of the queue, as if it were a fresh\n // task. This is essentially the same as canceling the task and scheduling\n // a new one, except it reuses the original object.\n //\n // The primary use case is to increase the priority of a Link-initated\n // prefetch on hover.\n\n // Un-cancel the task, in case it was previously canceled.\n task.isCanceled = false\n task.phase = PrefetchPhase.RouteTree\n\n // Assign a new sort ID to move it ahead of all other tasks at the same\n // priority level. (Higher sort IDs are processed first.)\n task.sortId = sortIdCounter++\n task.priority =\n // If this task is the most recently hovered link, maintain its\n // Intent priority, even if the rescheduled priority is lower.\n task === mostRecentlyHoveredLink ? PrefetchPriority.Intent : priority\n\n task.treeAtTimeOfPrefetch = treeAtTimeOfPrefetch\n task.fetchStrategy = fetchStrategy\n\n trackMostRecentlyHoveredLink(task)\n\n if (task._heapIndex !== -1) {\n // The task is already in the queue.\n heapResift(taskHeap, task)\n } else {\n heapPush(taskHeap, task)\n }\n ensureWorkIsScheduled()\n}\n\nexport function isPrefetchTaskDirty(\n task: PrefetchTask,\n nextUrl: string | null,\n tree: FlightRouterState\n): boolean {\n // This is used to quickly bail out of a prefetch task if the result is\n // guaranteed to not have changed since the task was initiated. This is\n // strictly an optimization — theoretically, if it always returned true, no\n // behavior should change because a full prefetch task will effectively\n // perform the same checks.\n const currentCacheVersion = getCurrentCacheVersion()\n return (\n task.cacheVersion !== currentCacheVersion ||\n task.treeAtTimeOfPrefetch !== tree ||\n task.key.nextUrl !== nextUrl\n )\n}\n\nfunction trackMostRecentlyHoveredLink(task: PrefetchTask) {\n // Track the mostly recently hovered link, i.e. the most recently scheduled\n // task at Intent priority. There must only be one such task at a time.\n if (\n task.priority === PrefetchPriority.Intent &&\n task !== mostRecentlyHoveredLink\n ) {\n if (mostRecentlyHoveredLink !== null) {\n // Bump the previously hovered link's priority down to Default.\n if (mostRecentlyHoveredLink.priority !== PrefetchPriority.Background) {\n mostRecentlyHoveredLink.priority = PrefetchPriority.Default\n heapResift(taskHeap, mostRecentlyHoveredLink)\n }\n }\n mostRecentlyHoveredLink = task\n }\n}\n\nfunction ensureWorkIsScheduled() {\n if (didScheduleMicrotask) {\n // Already scheduled a task to process the queue\n return\n }\n didScheduleMicrotask = true\n scheduleMicrotask(processQueueInMicrotask)\n}\n\n/**\n * Checks if we've exceeded the maximum number of concurrent prefetch requests,\n * to avoid saturating the browser's internal network queue. This is a\n * cooperative limit — prefetch tasks should check this before issuing\n * new requests.\n *\n * Also checks if we're within the revalidation cooldown window, during which\n * prefetch requests are delayed to allow CDN cache propagation.\n */\nfunction hasNetworkBandwidth(task: PrefetchTask): boolean {\n // Check if we're within the revalidation cooldown window\n if (revalidationCooldownTimeoutHandle !== null) {\n // We're within the cooldown window. Return false to prevent prefetching.\n // When the cooldown expires, the timeout will call ensureWorkIsScheduled()\n // to retry the queue.\n return false\n }\n\n // TODO: Also check if there's an in-progress navigation. We should never\n // add prefetch requests to the network queue if an actual navigation is\n // taking place, to ensure there's sufficient bandwidth for render-blocking\n // data and resources.\n\n // TODO: Consider reserving some amount of bandwidth for static prefetches.\n\n if (task.priority === PrefetchPriority.Intent) {\n // The most recently hovered link is allowed to exceed the default limit.\n //\n // The goal is to always have enough bandwidth to start a new prefetch\n // request when hovering over a link.\n //\n // However, because we don't abort in-progress requests, it's still possible\n // we'll run out of bandwidth. When links are hovered in quick succession,\n // there could be multiple hover requests running simultaneously.\n return inProgressRequests < 12\n }\n\n // The default limit is lower than the limit for a hovered link.\n return inProgressRequests < 4\n}\n\nfunction spawnPrefetchSubtask<T>(\n prefetchSubtask: Promise<PrefetchSubtaskResult<T> | null>\n): Promise<T | null> {\n // When the scheduler spawns an async task, we don't await its result.\n // Instead, the async task writes its result directly into the cache, then\n // pings the scheduler to continue.\n //\n // We process server responses streamingly, so the prefetch subtask will\n // likely resolve before we're finished receiving all the data. The subtask\n // result includes a promise that resolves once the network connection is\n // closed. The scheduler uses this to control network bandwidth by tracking\n // and limiting the number of concurrent requests.\n inProgressRequests++\n return prefetchSubtask.then((result) => {\n if (result === null) {\n // The prefetch task errored before it could start processing the\n // network stream. Assume the connection is closed.\n onPrefetchConnectionClosed()\n return null\n }\n // Wait for the connection to close before freeing up more bandwidth.\n result.closed.then(onPrefetchConnectionClosed)\n return result.value\n })\n}\n\nfunction onPrefetchConnectionClosed(): void {\n inProgressRequests--\n\n // Notify the scheduler that we have more bandwidth, and can continue\n // processing tasks.\n ensureWorkIsScheduled()\n}\n\n/**\n * Notify the scheduler that we've received new data for an in-progress\n * prefetch. The corresponding task will be added back to the queue (unless the\n * task has been canceled in the meantime).\n */\nexport function pingPrefetchTask(task: PrefetchTask) {\n // \"Ping\" a prefetch that's already in progress to notify it of new data.\n if (\n // Check if prefetch was canceled.\n task.isCanceled ||\n // Check if prefetch is already queued.\n task._heapIndex !== -1\n ) {\n return\n }\n // Add the task back to the queue.\n heapPush(taskHeap, task)\n ensureWorkIsScheduled()\n}\n\nfunction processQueueInMicrotask() {\n didScheduleMicrotask = false\n\n // We aim to minimize how often we read the current time. Since nearly all\n // functions in the prefetch scheduler are synchronous, we can read the time\n // once and pass it as an argument wherever it's needed.\n const now = Date.now()\n\n // Process the task queue until we run out of network bandwidth.\n let task = heapPeek(taskHeap)\n while (task !== null && hasNetworkBandwidth(task)) {\n task.cacheVersion = getCurrentCacheVersion()\n\n const exitStatus = pingRoute(now, task)\n\n // These fields are only valid for a single attempt. Reset them after each\n // iteration of the task queue.\n const hasBackgroundWork = task.hasBackgroundWork\n task.hasBackgroundWork = false\n task.spawnedRuntimePrefetches = null\n\n switch (exitStatus) {\n case PrefetchTaskExitStatus.InProgress:\n // The task yielded because there are too many requests in progress.\n // Stop processing tasks until we have more bandwidth.\n return\n case PrefetchTaskExitStatus.Blocked:\n // The task is blocked. It needs more data before it can proceed.\n // Keep the task out of the queue until the server responds.\n heapPop(taskHeap)\n // Continue to the next task\n task = heapPeek(taskHeap)\n continue\n case PrefetchTaskExitStatus.Done:\n if (task.phase === PrefetchPhase.RouteTree) {\n // Finished prefetching the route tree. Proceed to prefetching\n // the segments.\n task.phase = PrefetchPhase.Segments\n heapResift(taskHeap, task)\n } else if (hasBackgroundWork) {\n // The task spawned additional background work. Reschedule the task\n // at background priority.\n task.priority = PrefetchPriority.Background\n heapResift(taskHeap, task)\n } else {\n // The prefetch is complete. Continue to the next task.\n heapPop(taskHeap)\n }\n task = heapPeek(taskHeap)\n continue\n default:\n exitStatus satisfies never\n }\n }\n}\n\n/**\n * Check this during a prefetch task to determine if background work can be\n * performed. If so, it evaluates to `true`. Otherwise, it returns `false`,\n * while also scheduling a background task to run later. Usage:\n *\n * @example\n * if (background(task)) {\n * // Perform background-pri work\n * }\n */\nfunction background(task: PrefetchTask): boolean {\n if (task.priority === PrefetchPriority.Background) {\n return true\n }\n task.hasBackgroundWork = true\n return false\n}\n\nfunction pingRoute(now: number, task: PrefetchTask): PrefetchTaskExitStatus {\n const key = task.key\n const route = readOrCreateRouteCacheEntry(now, task, key)\n const exitStatus = pingRootRouteTree(now, task, route)\n\n if (exitStatus !== PrefetchTaskExitStatus.InProgress && key.search !== '') {\n // If the URL has a non-empty search string, also prefetch the pathname\n // without the search string. We use the searchless route tree as a base for\n // optimistic routing; see requestOptimisticRouteCacheEntry for details.\n //\n // Note that we don't need to prefetch any of the segment data. Just the\n // route tree.\n //\n // TODO: This is a temporary solution; the plan is to replace this by adding\n // a wildcard lookup method to the TupleMap implementation. This is\n // non-trivial to implement because it needs to account for things like\n // fallback route entries, hence this temporary workaround.\n const url = new URL(key.href)\n url.search = ''\n const keyWithoutSearch = createCacheKey(url.href, key.nextUrl)\n const routeWithoutSearch = readOrCreateRouteCacheEntry(\n now,\n task,\n keyWithoutSearch\n )\n switch (routeWithoutSearch.status) {\n case EntryStatus.Empty: {\n if (background(task)) {\n routeWithoutSearch.status = EntryStatus.Pending\n spawnPrefetchSubtask(\n fetchRouteOnCacheMiss(routeWithoutSearch, task, keyWithoutSearch)\n )\n }\n break\n }\n case EntryStatus.Pending:\n case EntryStatus.Fulfilled:\n case EntryStatus.Rejected: {\n // Either the route tree is already cached, or there's already a\n // request in progress. Since we don't need to fetch any segment data\n // for this route, there's nothing left to do.\n break\n }\n default:\n routeWithoutSearch satisfies never\n }\n }\n\n return exitStatus\n}\n\nfunction pingRootRouteTree(\n now: number,\n task: PrefetchTask,\n route: RouteCacheEntry\n): PrefetchTaskExitStatus {\n switch (route.status) {\n case EntryStatus.Empty: {\n // Route is not yet cached, and there's no request already in progress.\n // Spawn a task to request the route, load it into the cache, and ping\n // the task to continue.\n\n // TODO: There are multiple strategies in the <Link> API for prefetching\n // a route. Currently we've only implemented the main one: per-segment,\n // static-data only.\n //\n // There's also `<Link prefetch={true}>`\n // which prefetch both static *and* dynamic data.\n // Similarly, we need to fallback to the old, per-page\n // behavior if PPR is disabled for a route (via the incremental opt-in).\n //\n // Those cases will be handled here.\n spawnPrefetchSubtask(fetchRouteOnCacheMiss(route, task, task.key))\n\n // If the request takes longer than a minute, a subsequent request should\n // retry instead of waiting for this one. When the response is received,\n // this value will be replaced by a new value based on the stale time sent\n // from the server.\n // TODO: We should probably also manually abort the fetch task, to reclaim\n // server bandwidth.\n route.staleAt = now + 60 * 1000\n\n // Upgrade to Pending so we know there's already a request in progress\n route.status = EntryStatus.Pending\n\n // Intentional fallthrough to the Pending branch\n }\n case EntryStatus.Pending: {\n // Still pending. We can't start prefetching the segments until the route\n // tree has loaded. Add the task to the set of blocked tasks so that it\n // is notified when the route tree is ready.\n const blockedTasks = route.blockedTasks\n if (blockedTasks === null) {\n route.blockedTasks = new Set([task])\n } else {\n blockedTasks.add(task)\n }\n return PrefetchTaskExitStatus.Blocked\n }\n case EntryStatus.Rejected: {\n // Route tree failed to load. Treat as a 404.\n return PrefetchTaskExitStatus.Done\n }\n case EntryStatus.Fulfilled: {\n if (task.phase !== PrefetchPhase.Segments) {\n // Do not prefetch segment data until we've entered the segment phase.\n return PrefetchTaskExitStatus.Done\n }\n // Recursively fill in the segment tree.\n if (!hasNetworkBandwidth(task)) {\n // Stop prefetching segments until there's more bandwidth.\n return PrefetchTaskExitStatus.InProgress\n }\n const tree = route.tree\n\n // A task's fetch strategy gets set to `PPR` for any \"auto\" prefetch.\n // If it turned out that the route isn't PPR-enabled, we need to use `LoadingBoundary` instead.\n // We don't need to do this for runtime prefetches, because those are only available in\n // `cacheComponents`, where every route is PPR.\n const fetchStrategy =\n task.fetchStrategy === FetchStrategy.PPR\n ? route.isPPREnabled\n ? FetchStrategy.PPR\n : FetchStrategy.LoadingBoundary\n : task.fetchStrategy\n\n switch (fetchStrategy) {\n case FetchStrategy.PPR: {\n // For Cache Components pages, each segment may be prefetched\n // statically or using a runtime request, based on various\n // configurations and heuristics. We'll do this in two passes: first\n // traverse the tree and perform all the static prefetches.\n //\n // Then, if there are any segments that need a runtime request,\n // do another pass to perform a runtime prefetch.\n const exitStatus = pingSharedPartOfCacheComponentsTree(\n now,\n task,\n route,\n task.treeAtTimeOfPrefetch,\n tree\n )\n if (exitStatus === PrefetchTaskExitStatus.InProgress) {\n // Child yielded without finishing.\n return PrefetchTaskExitStatus.InProgress\n }\n const spawnedRuntimePrefetches = task.spawnedRuntimePrefetches\n if (spawnedRuntimePrefetches !== null) {\n // During the first pass, we discovered segments that require a\n // runtime prefetch. Do a second pass to construct a request tree.\n const spawnedEntries = new Map<\n SegmentCacheKey,\n PendingSegmentCacheEntry\n >()\n const requestTree = pingRuntimePrefetches(\n now,\n task,\n route,\n tree,\n spawnedRuntimePrefetches,\n spawnedEntries\n )\n let needsDynamicRequest = spawnedEntries.size > 0\n if (needsDynamicRequest) {\n // Perform a dynamic prefetch request and populate the cache with\n // the result.\n spawnPrefetchSubtask(\n fetchSegmentPrefetchesUsingDynamicRequest(\n task,\n route,\n FetchStrategy.PPRRuntime,\n requestTree,\n spawnedEntries\n )\n )\n }\n }\n return PrefetchTaskExitStatus.Done\n }\n case FetchStrategy.Full:\n case FetchStrategy.PPRRuntime:\n case FetchStrategy.LoadingBoundary: {\n // Prefetch multiple segments using a single dynamic request.\n // TODO: We can consolidate this branch with previous one by modeling\n // it as if the first segment in the new tree has runtime prefetching\n // enabled. Will do this as a follow-up refactor. Might want to remove\n // the special metatdata case below first. In the meantime, it's not\n // really that much duplication, just would be nice to remove one of\n // these codepaths.\n const spawnedEntries = new Map<\n SegmentCacheKey,\n PendingSegmentCacheEntry\n >()\n const dynamicRequestTree = diffRouteTreeAgainstCurrent(\n now,\n task,\n route,\n task.treeAtTimeOfPrefetch,\n tree,\n spawnedEntries,\n fetchStrategy\n )\n\n let needsDynamicRequest = spawnedEntries.size > 0\n\n if (\n !needsDynamicRequest &&\n route.isHeadPartial &&\n route.TODO_metadataStatus === EntryStatus.Empty\n ) {\n // All the segment data is already cached, however, we need to issue\n // a request anyway so we can prefetch the head. Update the status\n // field to prevent additional requests from being spawned while\n // this one is in progress.\n // TODO: This is a temporary, targeted solution to fix a regression\n // we found. It exists to prevent the scheduler from sending a\n // redundant request if there's already one in progress.\n // Essentially, it will attempt once at most, then give up until the\n // route entry expires or is evicted by other means. But because\n // this doesn't have its own stale time separate from the route\n // itself, there will be edge cases where the metadata fails to be\n // fully prefetched. Consider caching metadata using a separate\n // entry type so we can model this more cleanly. The circumstances\n // that lead to this branch running in the first place are\n // relatively rare, so it's not critical.\n route.TODO_metadataStatus = EntryStatus.Fulfilled\n needsDynamicRequest = true\n // This instructs the server to only send the metadata.\n dynamicRequestTree[3] = 'metadata-only'\n // We can null out the children to reduce the request size, since\n // they won't be needed.\n dynamicRequestTree[1] = {}\n }\n\n if (needsDynamicRequest) {\n // Perform a dynamic prefetch request and populate the cache with\n // the result\n spawnPrefetchSubtask(\n fetchSegmentPrefetchesUsingDynamicRequest(\n task,\n route,\n fetchStrategy,\n dynamicRequestTree,\n spawnedEntries\n )\n )\n }\n return PrefetchTaskExitStatus.Done\n }\n default:\n fetchStrategy satisfies never\n }\n break\n }\n default: {\n route satisfies never\n }\n }\n return PrefetchTaskExitStatus.Done\n}\n\nfunction pingSharedPartOfCacheComponentsTree(\n now: number,\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n oldTree: FlightRouterState,\n newTree: RouteTree\n): PrefetchTaskExitStatus {\n // When Cache Components is enabled (or PPR, or a fully static route when PPR\n // is disabled; those cases are treated equivalently to Cache Components), we\n // start by prefetching each segment individually. Once we reach the \"new\"\n // part of the tree — the part that doesn't exist on the current page — we\n // may choose to switch to a runtime prefetch instead, based on the\n // information sent by the server in the route tree.\n //\n // The traversal starts in the \"shared\" part of the tree. Once we reach the\n // \"new\" part of the tree, we switch to a different traversal,\n // pingNewPartOfCacheComponentsTree.\n\n // Prefetch this segment's static data.\n const segment = readOrCreateSegmentCacheEntry(\n now,\n task.fetchStrategy,\n route,\n newTree.cacheKey\n )\n pingStaticSegmentData(now, task, route, segment, task.key, newTree)\n\n // Recursively ping the children.\n const oldTreeChildren = oldTree[1]\n const newTreeChildren = newTree.slots\n if (newTreeChildren !== null) {\n for (const parallelRouteKey in newTreeChildren) {\n if (!hasNetworkBandwidth(task)) {\n // Stop prefetching segments until there's more bandwidth.\n return PrefetchTaskExitStatus.InProgress\n }\n const newTreeChild = newTreeChildren[parallelRouteKey]\n const newTreeChildSegment = newTreeChild.segment\n const oldTreeChild: FlightRouterState | void =\n oldTreeChildren[parallelRouteKey]\n const oldTreeChildSegment: FlightRouterStateSegment | void =\n oldTreeChild?.[0]\n let childExitStatus\n if (\n oldTreeChildSegment !== undefined &&\n doesCurrentSegmentMatchCachedSegment(\n route,\n newTreeChildSegment,\n oldTreeChildSegment\n )\n ) {\n // We're still in the \"shared\" part of the tree.\n childExitStatus = pingSharedPartOfCacheComponentsTree(\n now,\n task,\n route,\n oldTreeChild,\n newTreeChild\n )\n } else {\n // We've entered the \"new\" part of the tree. Switch\n // traversal functions.\n childExitStatus = pingNewPartOfCacheComponentsTree(\n now,\n task,\n route,\n newTreeChild\n )\n }\n if (childExitStatus === PrefetchTaskExitStatus.InProgress) {\n // Child yielded without finishing.\n return PrefetchTaskExitStatus.InProgress\n }\n }\n }\n\n return PrefetchTaskExitStatus.Done\n}\n\nfunction pingNewPartOfCacheComponentsTree(\n now: number,\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n tree: RouteTree\n): PrefetchTaskExitStatus.InProgress | PrefetchTaskExitStatus.Done {\n // We're now prefetching in the \"new\" part of the tree, the part that doesn't\n // exist on the current page. (In other words, we're deeper than the\n // shared layouts.) Segments in here default to being prefetched statically.\n // However, if the server instructs us to, we may switch to a runtime\n // prefetch instead. Traverse the tree and check at each segment.\n if (tree.hasRuntimePrefetch) {\n // This route has a runtime prefetch response. Since we're below the shared\n // layout, everything from this point should be prefetched using a single,\n // combined runtime request, rather than using per-segment static requests.\n // This is true even if some of the child segments are known to be fully\n // static — once we've decided to perform a runtime prefetch, we might as\n // well respond with the static segments in the same roundtrip. (That's how\n // regular navigations work, too.) We'll still skip over segments that are\n // already cached, though.\n //\n // It's the server's responsibility to set a reasonable value of\n // `hasRuntimePrefetch`. Currently it's user-defined, but eventually, the\n // server may send a value of `false` even if the user opts in, if it\n // determines during build that the route is always fully static. There are\n // more optimizations we can do once we implement fallback param\n // tracking, too.\n //\n // Use the task object to collect the segments that need a runtime prefetch.\n // This will signal to the outer task queue that a second traversal is\n // required to construct a request tree.\n if (task.spawnedRuntimePrefetches === null) {\n task.spawnedRuntimePrefetches = new Set([tree.cacheKey])\n } else {\n task.spawnedRuntimePrefetches.add(tree.cacheKey)\n }\n // Then exit the traversal without prefetching anything further.\n return PrefetchTaskExitStatus.Done\n }\n\n // This segment should not be runtime prefetched. Prefetch its static data.\n const segment = readOrCreateSegmentCacheEntry(\n now,\n task.fetchStrategy,\n route,\n tree.cacheKey\n )\n pingStaticSegmentData(now, task, route, segment, task.key, tree)\n if (tree.slots !== null) {\n if (!hasNetworkBandwidth(task)) {\n // Stop prefetching segments until there's more bandwidth.\n return PrefetchTaskExitStatus.InProgress\n }\n // Recursively ping the children.\n for (const parallelRouteKey in tree.slots) {\n const childTree = tree.slots[parallelRouteKey]\n const childExitStatus = pingNewPartOfCacheComponentsTree(\n now,\n task,\n route,\n childTree\n )\n if (childExitStatus === PrefetchTaskExitStatus.InProgress) {\n // Child yielded without finishing.\n return PrefetchTaskExitStatus.InProgress\n }\n }\n }\n // This segment and all its children have finished prefetching.\n return PrefetchTaskExitStatus.Done\n}\n\nfunction diffRouteTreeAgainstCurrent(\n now: number,\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n oldTree: FlightRouterState,\n newTree: RouteTree,\n spawnedEntries: Map<string, PendingSegmentCacheEntry>,\n fetchStrategy:\n | FetchStrategy.Full\n | FetchStrategy.PPRRuntime\n | FetchStrategy.LoadingBoundary\n): FlightRouterState {\n // This is a single recursive traversal that does multiple things:\n // - Finds the parts of the target route (newTree) that are not part of\n // of the current page (oldTree) by diffing them, using the same algorithm\n // as a real navigation.\n // - Constructs a request tree (FlightRouterState) that describes which\n // segments need to be prefetched and which ones are already cached.\n // - Creates a set of pending cache entries for the segments that need to\n // be prefetched, so that a subsequent prefetch task does not request the\n // same segments again.\n const oldTreeChildren = oldTree[1]\n const newTreeChildren = newTree.slots\n let requestTreeChildren: Record<string, FlightRouterState> = {}\n if (newTreeChildren !== null) {\n for (const parallelRouteKey in newTreeChildren) {\n const newTreeChild = newTreeChildren[parallelRouteKey]\n const newTreeChildSegment = newTreeChild.segment\n const oldTreeChild: FlightRouterState | void =\n oldTreeChildren[parallelRouteKey]\n const oldTreeChildSegment: FlightRouterStateSegment | void =\n oldTreeChild?.[0]\n if (\n oldTreeChildSegment !== undefined &&\n doesCurrentSegmentMatchCachedSegment(\n route,\n newTreeChildSegment,\n oldTreeChildSegment\n )\n ) {\n // This segment is already part of the current route. Keep traversing.\n const requestTreeChild = diffRouteTreeAgainstCurrent(\n now,\n task,\n route,\n oldTreeChild,\n newTreeChild,\n spawnedEntries,\n fetchStrategy\n )\n requestTreeChildren[parallelRouteKey] = requestTreeChild\n } else {\n // This segment is not part of the current route. We're entering a\n // part of the tree that we need to prefetch (unless everything is\n // already cached).\n switch (fetchStrategy) {\n case FetchStrategy.LoadingBoundary: {\n // When PPR is disabled, we can't prefetch per segment. We must\n // fallback to the old prefetch behavior and send a dynamic request.\n // Only routes that include a loading boundary can be prefetched in\n // this way.\n //\n // This is simlar to a \"full\" prefetch, but we're much more\n // conservative about which segments to include in the request.\n //\n // The server will only render up to the first loading boundary\n // inside new part of the tree. If there's no loading boundary\n // anywhere in the tree, the server will never return any data, so\n // we can skip the request.\n const subtreeHasLoadingBoundary =\n newTreeChild.hasLoadingBoundary !==\n HasLoadingBoundary.SubtreeHasNoLoadingBoundary\n const requestTreeChild = subtreeHasLoadingBoundary\n ? pingPPRDisabledRouteTreeUpToLoadingBoundary(\n now,\n task,\n route,\n newTreeChild,\n null,\n spawnedEntries\n )\n : // There's no loading boundary within this tree. Bail out.\n convertRouteTreeToFlightRouterState(newTreeChild)\n requestTreeChildren[parallelRouteKey] = requestTreeChild\n break\n }\n case FetchStrategy.PPRRuntime: {\n // This is a runtime prefetch. Fetch all cacheable data in the tree,\n // not just the static PPR shell.\n const requestTreeChild = pingRouteTreeAndIncludeDynamicData(\n now,\n task,\n route,\n newTreeChild,\n false,\n spawnedEntries,\n fetchStrategy\n )\n requestTreeChildren[parallelRouteKey] = requestTreeChild\n break\n }\n case FetchStrategy.Full: {\n // This is a \"full\" prefetch. Fetch all the data in the tree, both\n // static and dynamic. We issue roughly the same request that we\n // would during a real navigation. The goal is that once the\n // navigation occurs, the router should not have to fetch any\n // additional data.\n //\n // Although the response will include dynamic data, opting into a\n // Full prefetch — via <Link prefetch={true}> — implicitly\n // instructs the cache to treat the response as \"static\", or non-\n // dynamic, since the whole point is to cache it for\n // future navigations.\n //\n // Construct a tree (currently a FlightRouterState) that represents\n // which segments need to be prefetched and which ones are already\n // cached. If the tree is empty, then we can exit. Otherwise, we'll\n // send the request tree to the server and use the response to\n // populate the segment cache.\n const requestTreeChild = pingRouteTreeAndIncludeDynamicData(\n now,\n task,\n route,\n newTreeChild,\n false,\n spawnedEntries,\n fetchStrategy\n )\n requestTreeChildren[parallelRouteKey] = requestTreeChild\n break\n }\n default:\n fetchStrategy satisfies never\n }\n }\n }\n }\n const requestTree: FlightRouterState = [\n newTree.segment,\n requestTreeChildren,\n null,\n null,\n newTree.isRootLayout,\n ]\n return requestTree\n}\n\nfunction pingPPRDisabledRouteTreeUpToLoadingBoundary(\n now: number,\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n tree: RouteTree,\n refetchMarkerContext: 'refetch' | 'inside-shared-layout' | null,\n spawnedEntries: Map<string, PendingSegmentCacheEntry>\n): FlightRouterState {\n // This function is similar to pingRouteTreeAndIncludeDynamicData, except the\n // server is only going to return a minimal loading state — it will stop\n // rendering at the first loading boundary. Whereas a Full prefetch is\n // intentionally aggressive and tries to pretfetch all the data that will be\n // needed for a navigation, a LoadingBoundary prefetch is much more\n // conservative. For example, it will omit from the request tree any segment\n // that is already cached, regardles of whether it's partial or full. By\n // contrast, a Full prefetch will refetch partial segments.\n\n // \"inside-shared-layout\" tells the server where to start looking for a\n // loading boundary.\n let refetchMarker: 'refetch' | 'inside-shared-layout' | null =\n refetchMarkerContext === null ? 'inside-shared-layout' : null\n\n const segment = readOrCreateSegmentCacheEntry(\n now,\n task.fetchStrategy,\n route,\n tree.cacheKey\n )\n switch (segment.status) {\n case EntryStatus.Empty: {\n // This segment is not cached. Add a refetch marker so the server knows\n // to start rendering here.\n // TODO: Instead of a \"refetch\" marker, we could just omit this subtree's\n // FlightRouterState from the request tree. I think this would probably\n // already work even without any updates to the server. For consistency,\n // though, I'll send the full tree and we'll look into this later as part\n // of a larger redesign of the request protocol.\n\n // Add the pending cache entry to the result map.\n spawnedEntries.set(\n tree.cacheKey,\n upgradeToPendingSegment(\n segment,\n // Set the fetch strategy to LoadingBoundary to indicate that the server\n // might not include it in the pending response. If another route is able\n // to issue a per-segment request, we'll do that in the background.\n FetchStrategy.LoadingBoundary\n )\n )\n if (refetchMarkerContext !== 'refetch') {\n refetchMarker = refetchMarkerContext = 'refetch'\n } else {\n // There's already a parent with a refetch marker, so we don't need\n // to add another one.\n }\n break\n }\n case EntryStatus.Fulfilled: {\n // The segment is already cached.\n const segmentHasLoadingBoundary =\n tree.hasLoadingBoundary === HasLoadingBoundary.SegmentHasLoadingBoundary\n if (segmentHasLoadingBoundary) {\n // This segment has a loading boundary, which means the server won't\n // render its children. So there's nothing left to prefetch along this\n // path. We can bail out.\n return convertRouteTreeToFlightRouterState(tree)\n }\n // NOTE: If the cached segment were fetched using PPR, then it might be\n // partial. We could get a more complete version of the segment by\n // including it in this non-PPR request.\n //\n // We're intentionally choosing not to, though, because it's generally\n // better to avoid doing a full prefetch whenever possible.\n break\n }\n case EntryStatus.Pending: {\n // There's another prefetch currently in progress. Don't add the refetch\n // marker yet, so the server knows it can skip rendering this segment.\n break\n }\n case EntryStatus.Rejected: {\n // The segment failed to load. We shouldn't issue another request until\n // the stale time has elapsed.\n break\n }\n default:\n segment satisfies never\n }\n const requestTreeChildren: Record<string, FlightRouterState> = {}\n if (tree.slots !== null) {\n for (const parallelRouteKey in tree.slots) {\n const childTree = tree.slots[parallelRouteKey]\n requestTreeChildren[parallelRouteKey] =\n pingPPRDisabledRouteTreeUpToLoadingBoundary(\n now,\n task,\n route,\n childTree,\n refetchMarkerContext,\n spawnedEntries\n )\n }\n }\n const requestTree: FlightRouterState = [\n tree.segment,\n requestTreeChildren,\n null,\n refetchMarker,\n tree.isRootLayout,\n ]\n return requestTree\n}\n\nfunction pingRouteTreeAndIncludeDynamicData(\n now: number,\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n tree: RouteTree,\n isInsideRefetchingParent: boolean,\n spawnedEntries: Map<string, PendingSegmentCacheEntry>,\n fetchStrategy: FetchStrategy.Full | FetchStrategy.PPRRuntime\n): FlightRouterState {\n // The tree we're constructing is the same shape as the tree we're navigating\n // to. But even though this is a \"new\" tree, some of the individual segments\n // may be cached as a result of other route prefetches.\n //\n // So we need to find the first uncached segment along each path add an\n // explicit \"refetch\" marker so the server knows where to start rendering.\n // Once the server starts rendering along a path, it keeps rendering the\n // entire subtree.\n const segment = readOrCreateSegmentCacheEntry(\n now,\n // Note that `fetchStrategy` might be different from `task.fetchStrategy`,\n // and we have to use the former here.\n // We can have a task with `FetchStrategy.PPR` where some of its segments are configured to\n // always use runtime prefetching (via `export const prefetch`), and those should check for\n // entries that include search params.\n fetchStrategy,\n route,\n tree.cacheKey\n )\n\n let spawnedSegment: PendingSegmentCacheEntry | null = null\n\n switch (segment.status) {\n case EntryStatus.Empty: {\n // This segment is not cached. Include it in the request.\n spawnedSegment = upgradeToPendingSegment(segment, fetchStrategy)\n break\n }\n case EntryStatus.Fulfilled: {\n // The segment is already cached.\n if (\n segment.isPartial &&\n canNewFetchStrategyProvideMoreContent(\n segment.fetchStrategy,\n fetchStrategy\n )\n ) {\n // The cached segment contains dynamic holes, and was prefetched using a less specific strategy than the current one.\n // This means we're in one of these cases:\n // - we have a static prefetch, and we're doing a runtime prefetch\n // - we have a static or runtime prefetch, and we're doing a Full prefetch (or a navigation).\n // In either case, we need to include it in the request to get a more specific (or full) version.\n spawnedSegment = pingFullSegmentRevalidation(\n now,\n route,\n segment,\n tree,\n fetchStrategy\n )\n }\n break\n }\n case EntryStatus.Pending:\n case EntryStatus.Rejected: {\n // There's either another prefetch currently in progress, or the previous\n // attempt failed. If the new strategy can provide more content, fetch it again.\n if (\n canNewFetchStrategyProvideMoreContent(\n segment.fetchStrategy,\n fetchStrategy\n )\n ) {\n spawnedSegment = pingFullSegmentRevalidation(\n now,\n route,\n segment,\n tree,\n fetchStrategy\n )\n }\n break\n }\n default:\n segment satisfies never\n }\n const requestTreeChildren: Record<string, FlightRouterState> = {}\n if (tree.slots !== null) {\n for (const parallelRouteKey in tree.slots) {\n const childTree = tree.slots[parallelRouteKey]\n requestTreeChildren[parallelRouteKey] =\n pingRouteTreeAndIncludeDynamicData(\n now,\n task,\n route,\n childTree,\n isInsideRefetchingParent || spawnedSegment !== null,\n spawnedEntries,\n fetchStrategy\n )\n }\n }\n\n if (spawnedSegment !== null) {\n // Add the pending entry to the result map.\n spawnedEntries.set(tree.cacheKey, spawnedSegment)\n }\n\n // Don't bother to add a refetch marker if one is already present in a parent.\n const refetchMarker =\n !isInsideRefetchingParent && spawnedSegment !== null ? 'refetch' : null\n\n const requestTree: FlightRouterState = [\n tree.segment,\n requestTreeChildren,\n null,\n refetchMarker,\n tree.isRootLayout,\n ]\n return requestTree\n}\n\nfunction pingRuntimePrefetches(\n now: number,\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n tree: RouteTree,\n spawnedRuntimePrefetches: Set<SegmentCacheKey>,\n spawnedEntries: Map<string, PendingSegmentCacheEntry>\n): FlightRouterState {\n // Construct a request tree (FlightRouterState) for a runtime prefetch. If\n // a segment is part of the runtime prefetch, the tree is constructed by\n // diffing against what's already in the prefetch cache. Otherwise, we send\n // a regular FlightRouterState with no special markers.\n //\n // See pingRouteTreeAndIncludeDynamicData for details.\n if (spawnedRuntimePrefetches.has(tree.cacheKey)) {\n // This segment needs a runtime prefetch.\n return pingRouteTreeAndIncludeDynamicData(\n now,\n task,\n route,\n tree,\n false,\n spawnedEntries,\n FetchStrategy.PPRRuntime\n )\n }\n let requestTreeChildren: Record<string, FlightRouterState> = {}\n const slots = tree.slots\n if (slots !== null) {\n for (const parallelRouteKey in slots) {\n const childTree = slots[parallelRouteKey]\n requestTreeChildren[parallelRouteKey] = pingRuntimePrefetches(\n now,\n task,\n route,\n childTree,\n spawnedRuntimePrefetches,\n spawnedEntries\n )\n }\n }\n\n // This segment is not part of the runtime prefetch. Clone the base tree.\n const requestTree: FlightRouterState = [\n tree.segment,\n requestTreeChildren,\n null,\n null,\n ]\n return requestTree\n}\n\nfunction pingStaticSegmentData(\n now: number,\n task: PrefetchTask,\n route: FulfilledRouteCacheEntry,\n segment: SegmentCacheEntry,\n routeKey: RouteCacheKey,\n tree: RouteTree\n): void {\n switch (segment.status) {\n case EntryStatus.Empty:\n // Upgrade to Pending so we know there's already a request in progress\n spawnPrefetchSubtask(\n fetchSegmentOnCacheMiss(\n route,\n upgradeToPendingSegment(segment, FetchStrategy.PPR),\n routeKey,\n tree\n )\n )\n break\n case EntryStatus.Pending: {\n // There's already a request in progress. Depending on what kind of\n // request it is, we may want to revalidate it.\n switch (segment.fetchStrategy) {\n case FetchStrategy.PPR:\n case FetchStrategy.PPRRuntime:\n case FetchStrategy.Full:\n // There's already a request in progress. Don't do anything.\n break\n case FetchStrategy.LoadingBoundary:\n // There's a pending request, but because it's using the old\n // prefetching strategy, we can't be sure if it will be fulfilled by\n // the response — it might be inside the loading boundary. Perform\n // a revalidation, but because it's speculative, wait to do it at\n // background priority.\n if (background(task)) {\n // TODO: Instead of speculatively revalidating, consider including\n // `hasLoading` in the route tree prefetch response.\n pingPPRSegmentRevalidation(\n now,\n task,\n segment,\n route,\n routeKey,\n tree\n )\n }\n break\n default:\n segment.fetchStrategy satisfies never\n }\n break\n }\n case EntryStatus.Rejected: {\n // The existing entry in the cache was rejected. Depending on how it\n // was originally fetched, we may or may not want to revalidate it.\n switch (segment.fetchStrategy) {\n case FetchStrategy.PPR:\n case FetchStrategy.PPRRuntime:\n case FetchStrategy.Full:\n // The previous attempt to fetch this entry failed. Don't attempt to\n // fetch it again until the entry expires.\n break\n case FetchStrategy.LoadingBoundary:\n // There's a rejected entry, but it was fetched using the loading\n // boundary strategy. So the reason it wasn't returned by the server\n // might just be because it was inside a loading boundary. Or because\n // there was a dynamic rewrite. Revalidate it using the per-\n // segment strategy.\n //\n // Because a rejected segment will definitely prevent the segment (and\n // all of its children) from rendering, we perform this revalidation\n // immediately instead of deferring it to a background task.\n pingPPRSegmentRevalidation(now, task, segment, route, routeKey, tree)\n break\n default:\n segment.fetchStrategy satisfies never\n }\n break\n }\n case EntryStatus.Fulfilled:\n // Segment is already cached. There's nothing left to prefetch.\n break\n default:\n segment satisfies never\n }\n\n // Segments do not have dependent tasks, so once the prefetch is initiated,\n // there's nothing else for us to do (except write the server data into the\n // entry, which is handled by `fetchSegmentOnCacheMiss`).\n}\n\nfunction pingPPRSegmentRevalidation(\n now: number,\n task: PrefetchTask,\n currentSegment: SegmentCacheEntry,\n route: FulfilledRouteCacheEntry,\n routeKey: RouteCacheKey,\n tree: RouteTree\n): void {\n const revalidatingSegment = readOrCreateRevalidatingSegmentEntry(\n now,\n currentSegment\n )\n switch (revalidatingSegment.status) {\n case EntryStatus.Empty:\n // Spawn a prefetch request and upsert the segment into the cache\n // upon completion.\n upsertSegmentOnCompletion(\n task.fetchStrategy,\n route,\n tree.cacheKey,\n spawnPrefetchSubtask(\n fetchSegmentOnCacheMiss(\n route,\n upgradeToPendingSegment(revalidatingSegment, FetchStrategy.PPR),\n routeKey,\n tree\n )\n )\n )\n break\n case EntryStatus.Pending:\n // There's already a revalidation in progress.\n break\n case EntryStatus.Fulfilled:\n case EntryStatus.Rejected:\n // A previous revalidation attempt finished, but we chose not to replace\n // the existing entry in the cache. Don't try again until or unless the\n // revalidation entry expires.\n break\n default:\n revalidatingSegment satisfies never\n }\n}\n\nfunction pingFullSegmentRevalidation(\n now: number,\n route: FulfilledRouteCacheEntry,\n currentSegment: SegmentCacheEntry,\n tree: RouteTree,\n fetchStrategy: FetchStrategy.Full | FetchStrategy.PPRRuntime\n): PendingSegmentCacheEntry | null {\n const revalidatingSegment = readOrCreateRevalidatingSegmentEntry(\n now,\n currentSegment\n )\n if (revalidatingSegment.status === EntryStatus.Empty) {\n // During a Full/PPRRuntime prefetch, a single dynamic request is made for all the\n // segments that we need. So we don't initiate a request here directly. By\n // returning a pending entry from this function, it signals to the caller\n // that this segment should be included in the request that's sent to\n // the server.\n const pendingSegment = upgradeToPendingSegment(\n revalidatingSegment,\n fetchStrategy\n )\n upsertSegmentOnCompletion(\n fetchStrategy,\n route,\n tree.cacheKey,\n waitForSegmentCacheEntry(pendingSegment)\n )\n return pendingSegment\n } else {\n // There's already a revalidation in progress.\n const nonEmptyRevalidatingSegment = revalidatingSegment\n if (\n canNewFetchStrategyProvideMoreContent(\n nonEmptyRevalidatingSegment.fetchStrategy,\n fetchStrategy\n )\n ) {\n // The existing revalidation was fetched using a less specific strategy.\n // Reset it and start a new revalidation.\n const emptySegment = resetRevalidatingSegmentEntry(\n nonEmptyRevalidatingSegment\n )\n const pendingSegment = upgradeToPendingSegment(\n emptySegment,\n fetchStrategy\n )\n upsertSegmentOnCompletion(\n fetchStrategy,\n route,\n tree.cacheKey,\n waitForSegmentCacheEntry(pendingSegment)\n )\n return pendingSegment\n }\n switch (nonEmptyRevalidatingSegment.status) {\n case EntryStatus.Pending:\n // There's already an in-progress prefetch that includes this segment.\n return null\n case EntryStatus.Fulfilled:\n case EntryStatus.Rejected:\n // A previous revalidation attempt finished, but we chose not to replace\n // the existing entry in the cache. Don't try again until or unless the\n // revalidation entry expires.\n return null\n default:\n nonEmptyRevalidatingSegment satisfies never\n return null\n }\n }\n}\n\nconst noop = () => {}\n\nfunction upsertSegmentOnCompletion(\n fetchStrategy: FetchStrategy,\n route: FulfilledRouteCacheEntry,\n cacheKey: SegmentCacheKey,\n promise: Promise<FulfilledSegmentCacheEntry | null>\n) {\n // Wait for a segment to finish loading, then upsert it into the cache\n promise.then((fulfilled) => {\n if (fulfilled !== null) {\n // Received new data. Attempt to replace the existing entry in the cache.\n const keypath = getSegmentKeypath(fetchStrategy, route, cacheKey)\n upsertSegmentEntry(Date.now(), keypath, fulfilled)\n }\n }, noop)\n}\n\nfunction doesCurrentSegmentMatchCachedSegment(\n route: FulfilledRouteCacheEntry,\n currentSegment: Segment,\n cachedSegment: Segment\n): boolean {\n if (cachedSegment === PAGE_SEGMENT_KEY) {\n // In the FlightRouterState stored by the router, the page segment has the\n // rendered search params appended to the name of the segment. In the\n // prefetch cache, however, this is stored separately. So, when comparing\n // the router's current FlightRouterState to the cached FlightRouterState,\n // we need to make sure we compare both parts of the segment.\n // TODO: This is not modeled clearly. We use the same type,\n // FlightRouterState, for both the CacheNode tree _and_ the prefetch cache\n // _and_ the server response format, when conceptually those are three\n // different things and treated in different ways. We should encode more of\n // this information into the type design so mistakes are less likely.\n return (\n currentSegment ===\n addSearchParamsIfPageSegment(\n PAGE_SEGMENT_KEY,\n Object.fromEntries(new URLSearchParams(route.renderedSearch))\n )\n )\n }\n // Non-page segments are compared using the same function as the server\n return matchSegment(cachedSegment, currentSegment)\n}\n\n// -----------------------------------------------------------------------------\n// The remainder of the module is a MinHeap implementation. Try not to put any\n// logic below here unless it's related to the heap algorithm. We can extract\n// this to a separate module if/when we need multiple kinds of heaps.\n// -----------------------------------------------------------------------------\n\nfunction compareQueuePriority(a: PrefetchTask, b: PrefetchTask) {\n // Since the queue is a MinHeap, this should return a positive number if b is\n // higher priority than a, and a negative number if a is higher priority\n // than b.\n\n // `priority` is an integer, where higher numbers are higher priority.\n const priorityDiff = b.priority - a.priority\n if (priorityDiff !== 0) {\n return priorityDiff\n }\n\n // If the priority is the same, check which phase the prefetch is in — is it\n // prefetching the route tree, or the segments? Route trees are prioritized.\n const phaseDiff = b.phase - a.phase\n if (phaseDiff !== 0) {\n return phaseDiff\n }\n\n // Finally, check the insertion order. `sortId` is an incrementing counter\n // assigned to prefetches. We want to process the newest prefetches first.\n return b.sortId - a.sortId\n}\n\nfunction heapPush(heap: Array<PrefetchTask>, node: PrefetchTask): void {\n const index = heap.length\n heap.push(node)\n node._heapIndex = index\n heapSiftUp(heap, node, index)\n}\n\nfunction heapPeek(heap: Array<PrefetchTask>): PrefetchTask | null {\n return heap.length === 0 ? null : heap[0]\n}\n\nfunction heapPop(heap: Array<PrefetchTask>): PrefetchTask | null {\n if (heap.length === 0) {\n return null\n }\n const first = heap[0]\n first._heapIndex = -1\n const last = heap.pop() as PrefetchTask\n if (last !== first) {\n heap[0] = last\n last._heapIndex = 0\n heapSiftDown(heap, last, 0)\n }\n return first\n}\n\nfunction heapDelete(heap: Array<PrefetchTask>, node: PrefetchTask): void {\n const index = node._heapIndex\n if (index !== -1) {\n node._heapIndex = -1\n if (heap.length !== 0) {\n const last = heap.pop() as PrefetchTask\n if (last !== node) {\n heap[index] = last\n last._heapIndex = index\n heapSiftDown(heap, last, index)\n }\n }\n }\n}\n\nfunction heapResift(heap: Array<PrefetchTask>, node: PrefetchTask): void {\n const index = node._heapIndex\n if (index !== -1) {\n if (index === 0) {\n heapSiftDown(heap, node, 0)\n } else {\n const parentIndex = (index - 1) >>> 1\n const parent = heap[parentIndex]\n if (compareQueuePriority(parent, node) > 0) {\n // The parent is larger. Sift up.\n heapSiftUp(heap, node, index)\n } else {\n // The parent is smaller (or equal). Sift down.\n heapSiftDown(heap, node, index)\n }\n }\n }\n}\n\nfunction heapSiftUp(\n heap: Array<PrefetchTask>,\n node: PrefetchTask,\n i: number\n): void {\n let index = i\n while (index > 0) {\n const parentIndex = (index - 1) >>> 1\n const parent = heap[parentIndex]\n if (compareQueuePriority(parent, node) > 0) {\n // The parent is larger. Swap positions.\n heap[parentIndex] = node\n node._heapIndex = parentIndex\n heap[index] = parent\n parent._heapIndex = index\n\n index = parentIndex\n } else {\n // The parent is smaller. Exit.\n return\n }\n }\n}\n\nfunction heapSiftDown(\n heap: Array<PrefetchTask>,\n node: PrefetchTask,\n i: number\n): void {\n let index = i\n const length = heap.length\n const halfLength = length >>> 1\n while (index < halfLength) {\n const leftIndex = (index + 1) * 2 - 1\n const left = heap[leftIndex]\n const rightIndex = leftIndex + 1\n const right = heap[rightIndex]\n\n // If the left or right node is smaller, swap with the smaller of those.\n if (compareQueuePriority(left, node) < 0) {\n if (rightIndex < length && compareQueuePriority(right, left) < 0) {\n heap[index] = right\n right._heapIndex = index\n heap[rightIndex] = node\n node._heapIndex = rightIndex\n\n index = rightIndex\n } else {\n heap[index] = left\n left._heapIndex = index\n heap[leftIndex] = node\n node._heapIndex = leftIndex\n\n index = leftIndex\n }\n } else if (rightIndex < length && compareQueuePriority(right, node) < 0) {\n heap[index] = right\n right._heapIndex = index\n heap[rightIndex] = node\n node._heapIndex = rightIndex\n\n index = rightIndex\n } else {\n // Neither child is smaller. Exit.\n return\n }\n }\n}\n","/**\n * Entry point to the Segment Cache implementation.\n *\n * All code related to the Segment Cache lives `segment-cache-impl` directory.\n * Callers access it through this indirection.\n *\n * This is to ensure the code is dead code eliminated from the bundle if the\n * flag is disabled.\n *\n * TODO: This is super tedious. Since experimental flags are an essential part\n * of our workflow, we should establish a better pattern for dead code\n * elimination. Ideally it would be done at the bundler level, like how React's\n * build process works. In the React repo, you don't even need to add any extra\n * configuration per experiment — if the code is not reachable, it gets stripped\n * from the build automatically by Rollup. Or, shorter term, we could stub out\n * experimental modules at build time by updating the build config, i.e. a more\n * automated version of what I'm doing manually in this file.\n */\n\nexport type { NavigationResult } from './segment-cache-impl/navigation'\nexport type { PrefetchTask } from './segment-cache-impl/scheduler'\nexport type { NormalizedSearch } from './segment-cache-impl/cache-key'\n\nconst notEnabled: any = () => {\n throw new Error(\n 'Segment Cache experiment is not enabled. This is a bug in Next.js.'\n )\n}\n\nexport const prefetch: typeof import('./segment-cache-impl/prefetch').prefetch =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return (\n require('./segment-cache-impl/prefetch') as typeof import('./segment-cache-impl/prefetch')\n ).prefetch(...args)\n }\n : notEnabled\n\nexport const navigate: typeof import('./segment-cache-impl/navigation').navigate =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return (\n require('./segment-cache-impl/navigation') as typeof import('./segment-cache-impl/navigation')\n ).navigate(...args)\n }\n : notEnabled\n\nexport const revalidateEntireCache: typeof import('./segment-cache-impl/cache').revalidateEntireCache =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return (\n require('./segment-cache-impl/cache') as typeof import('./segment-cache-impl/cache')\n ).revalidateEntireCache(...args)\n }\n : notEnabled\n\nexport const getCurrentCacheVersion: typeof import('./segment-cache-impl/cache').getCurrentCacheVersion =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return (\n require('./segment-cache-impl/cache') as typeof import('./segment-cache-impl/cache')\n ).getCurrentCacheVersion(...args)\n }\n : notEnabled\n\nexport const schedulePrefetchTask: typeof import('./segment-cache-impl/scheduler').schedulePrefetchTask =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return (\n require('./segment-cache-impl/scheduler') as typeof import('./segment-cache-impl/scheduler')\n ).schedulePrefetchTask(...args)\n }\n : notEnabled\n\nexport const cancelPrefetchTask: typeof import('./segment-cache-impl/scheduler').cancelPrefetchTask =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return (\n require('./segment-cache-impl/scheduler') as typeof import('./segment-cache-impl/scheduler')\n ).cancelPrefetchTask(...args)\n }\n : notEnabled\n\nexport const reschedulePrefetchTask: typeof import('./segment-cache-impl/scheduler').reschedulePrefetchTask =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return (\n require('./segment-cache-impl/scheduler') as typeof import('./segment-cache-impl/scheduler')\n ).reschedulePrefetchTask(...args)\n }\n : notEnabled\n\nexport const isPrefetchTaskDirty: typeof import('./segment-cache-impl/scheduler').isPrefetchTaskDirty =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return (\n require('./segment-cache-impl/scheduler') as typeof import('./segment-cache-impl/scheduler')\n ).isPrefetchTaskDirty(...args)\n }\n : notEnabled\n\nexport const createCacheKey: typeof import('./segment-cache-impl/cache-key').createCacheKey =\n process.env.__NEXT_CLIENT_SEGMENT_CACHE\n ? function (...args) {\n return (\n require('./segment-cache-impl/cache-key') as typeof import('./segment-cache-impl/cache-key')\n ).createCacheKey(...args)\n }\n : notEnabled\n\n/**\n * Below are public constants. They're small enough that we don't need to\n * DCE them.\n */\n\nexport const enum NavigationResultTag {\n MPA,\n Success,\n NoOp,\n Async,\n}\n\n/**\n * The priority of the prefetch task. Higher numbers are higher priority.\n */\nexport const enum PrefetchPriority {\n /**\n * Assigned to the most recently hovered/touched link. Special network\n * bandwidth is reserved for this task only. There's only ever one Intent-\n * priority task at a time; when a new Intent task is scheduled, the previous\n * one is bumped down to Default.\n */\n Intent = 2,\n /**\n * The default priority for prefetch tasks.\n */\n Default = 1,\n /**\n * Assigned to tasks when they spawn non-blocking background work, like\n * revalidating a partially cached entry to see if more data is available.\n */\n Background = 0,\n}\n\nexport const enum FetchStrategy {\n // Deliberately ordered so we can easily compare two segments\n // and determine if one segment is \"more specific\" than another\n // (i.e. if it's likely that it contains more data)\n LoadingBoundary = 0,\n PPR = 1,\n PPRRuntime = 2,\n Full = 3,\n}\n\n/**\n * A subset of fetch strategies used for prefetch tasks.\n * A prefetch task can't know if it should use `PPR` or `LoadingBoundary`\n * until we complete the initial tree prefetch request, so we use `PPR` to signal both cases\n * and adjust it based on the route when actually fetching.\n * */\nexport type PrefetchTaskFetchStrategy =\n | FetchStrategy.PPR\n | FetchStrategy.PPRRuntime\n | FetchStrategy.Full\n","const NEXT_STATIC_GEN_BAILOUT = 'NEXT_STATIC_GEN_BAILOUT'\n\nexport class StaticGenBailoutError extends Error {\n public readonly code = NEXT_STATIC_GEN_BAILOUT\n}\n\nexport function isStaticGenBailoutError(\n error: unknown\n): error is StaticGenBailoutError {\n if (typeof error !== 'object' || error === null || !('code' in error)) {\n return false\n }\n\n return error.code === NEXT_STATIC_GEN_BAILOUT\n}\n","import { isHangingPromiseRejectionError } from '../../server/dynamic-rendering-utils'\nimport { isPostpone } from '../../server/lib/router-utils/is-postpone'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { isNextRouterError } from './is-next-router-error'\nimport {\n isDynamicPostpone,\n isPrerenderInterruptedError,\n} from '../../server/app-render/dynamic-rendering'\nimport { isDynamicServerError } from './hooks-server-context'\n\nexport function unstable_rethrow(error: unknown): void {\n if (\n isNextRouterError(error) ||\n isBailoutToCSRError(error) ||\n isDynamicServerError(error) ||\n isDynamicPostpone(error) ||\n isPostpone(error) ||\n isHangingPromiseRejectionError(error) ||\n isPrerenderInterruptedError(error)\n ) {\n throw error\n }\n\n if (error instanceof Error && 'cause' in error) {\n unstable_rethrow(error.cause)\n }\n}\n","const REACT_POSTPONE_TYPE: symbol = Symbol.for('react.postpone')\n\nexport function isPostpone(error: any): boolean {\n return (\n typeof error === 'object' &&\n error !== null &&\n error.$$typeof === REACT_POSTPONE_TYPE\n )\n}\n","import type { Dispatch } from 'react'\nimport React, { use, useMemo } from 'react'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport type { AppRouterActionQueue } from './app-router-instance'\nimport type {\n AppRouterState,\n ReducerActions,\n ReducerState,\n} from './router-reducer/router-reducer-types'\n\n// The app router state lives outside of React, so we can import the dispatch\n// method directly wherever we need it, rather than passing it around via props\n// or context.\nlet dispatch: Dispatch<ReducerActions> | null = null\n\nexport function dispatchAppRouterAction(action: ReducerActions) {\n if (dispatch === null) {\n throw new Error(\n 'Internal Next.js error: Router action dispatched before initialization.'\n )\n }\n dispatch(action)\n}\n\nexport function useActionQueue(\n actionQueue: AppRouterActionQueue\n): AppRouterState {\n const [state, setState] = React.useState<ReducerState>(actionQueue.state)\n\n // Because of a known issue that requires to decode Flight streams inside the\n // render phase, we have to be a bit clever and assign the dispatch method to\n // a module-level variable upon initialization. The useState hook in this\n // module only exists to synchronize state that lives outside of React.\n // Ideally, what we'd do instead is pass the state as a prop to root.render;\n // this is conceptually how we're modeling the app router state, despite the\n // weird implementation details.\n if (process.env.NODE_ENV !== 'production') {\n const { useAppDevRenderingIndicator } =\n require('../../next-devtools/userspace/use-app-dev-rendering-indicator') as typeof import('../../next-devtools/userspace/use-app-dev-rendering-indicator')\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const appDevRenderingIndicator = useAppDevRenderingIndicator()\n\n dispatch = (action: ReducerActions) => {\n appDevRenderingIndicator(() => {\n actionQueue.dispatch(action, setState)\n })\n }\n } else {\n dispatch = (action: ReducerActions) =>\n actionQueue.dispatch(action, setState)\n }\n\n // When navigating to a non-prefetched route, then App Router state will be\n // blocked until the server responds. We need to transfer the `_debugInfo`\n // from the underlying Flight response onto the top-level promise that is\n // passed to React (via `use`) so that the latency is accurately represented\n // in the React DevTools.\n const stateWithDebugInfo = useMemo(() => {\n if (isThenable(state)) {\n const debugInfo: Array<unknown> = []\n const promiseWithDebugInfo = Promise.resolve(state).then((asyncState) => {\n if (asyncState.debugInfo !== null) {\n debugInfo.push(...asyncState.debugInfo)\n }\n return asyncState\n }) as Promise<AppRouterState> & { _debugInfo?: Array<unknown> }\n promiseWithDebugInfo._debugInfo = debugInfo\n return promiseWithDebugInfo\n }\n return state\n }, [state])\n\n return isThenable(stateWithDebugInfo)\n ? use(stateWithDebugInfo)\n : stateWithDebugInfo\n}\n","import type {\n CacheNodeSeedData,\n FlightData,\n FlightDataPath,\n FlightRouterState,\n FlightSegmentPath,\n Segment,\n HeadData,\n InitialRSCPayload,\n} from '../shared/lib/app-router-types'\nimport { PAGE_SEGMENT_KEY } from '../shared/lib/segment'\nimport type { NormalizedSearch } from './components/segment-cache'\nimport {\n getCacheKeyForDynamicParam,\n parseDynamicParamFromURLPart,\n doesStaticSegmentAppearInURL,\n getRenderedPathname,\n getRenderedSearch,\n} from './route-params'\nimport { createHrefFromUrl } from './components/router-reducer/create-href-from-url'\n\nexport type NormalizedFlightData = {\n /**\n * The full `FlightSegmentPath` inclusive of the final `Segment`\n */\n segmentPath: FlightSegmentPath\n /**\n * The `FlightSegmentPath` exclusive of the final `Segment`\n */\n pathToSegment: FlightSegmentPath\n segment: Segment\n tree: FlightRouterState\n seedData: CacheNodeSeedData | null\n head: HeadData\n isHeadPartial: boolean\n isRootRender: boolean\n}\n\n// TODO: We should only have to export `normalizeFlightData`, however because the initial flight data\n// that gets passed to `createInitialRouterState` doesn't conform to the `FlightDataPath` type (it's missing the root segment)\n// we're currently exporting it so we can use it directly. This should be fixed as part of the unification of\n// the different ways we express `FlightSegmentPath`.\nexport function getFlightDataPartsFromPath(\n flightDataPath: FlightDataPath\n): NormalizedFlightData {\n // Pick the last 4 items from the `FlightDataPath` to get the [tree, seedData, viewport, isHeadPartial].\n const flightDataPathLength = 4\n // tree, seedData, and head are *always* the last three items in the `FlightDataPath`.\n const [tree, seedData, head, isHeadPartial] =\n flightDataPath.slice(-flightDataPathLength)\n // The `FlightSegmentPath` is everything except the last three items. For a root render, it won't be present.\n const segmentPath = flightDataPath.slice(0, -flightDataPathLength)\n\n return {\n // TODO: Unify these two segment path helpers. We are inconsistently pushing an empty segment (\"\")\n // to the start of the segment path in some places which makes it hard to use solely the segment path.\n // Look for \"// TODO-APP: remove ''\" in the codebase.\n pathToSegment: segmentPath.slice(0, -1),\n segmentPath,\n // if the `FlightDataPath` corresponds with the root, there'll be no segment path,\n // in which case we default to ''.\n segment: segmentPath[segmentPath.length - 1] ?? '',\n tree,\n seedData,\n head,\n isHeadPartial,\n isRootRender: flightDataPath.length === flightDataPathLength,\n }\n}\n\nexport function createInitialRSCPayloadFromFallbackPrerender(\n response: Response,\n fallbackInitialRSCPayload: InitialRSCPayload\n): InitialRSCPayload {\n // This is a static fallback page. In order to hydrate the page, we need to\n // parse the client params from the URL, but to account for the possibility\n // that the page was rewritten, we need to check the response headers\n // for x-nextjs-rewritten-path or x-nextjs-rewritten-query headers. Since\n // we can't access the headers of the initial document response, the client\n // performs a fetch request to the current location. Since it's possible that\n // the fetch request will be dynamically rewritten to a different path than\n // the initial document, this fetch request delivers _all_ the hydration data\n // for the page; it was not inlined into the document, like it normally\n // would be.\n //\n // TODO: Consider treating the case where fetch is rewritten to a different\n // path from the document as a special deopt case. We should optimistically\n // assume this won't happen, inline the data into the document, and perform\n // a minimal request (like a HEAD or range request) to verify that the\n // response matches. Tricky to get right because we need to account for\n // all the different deployment environments we support, like output:\n // \"export\" mode, where we currently don't assume that custom response\n // headers are present.\n\n // Patch the Flight data sent by the server with the correct params parsed\n // from the URL + response object.\n const renderedPathname = getRenderedPathname(response)\n const renderedSearch = getRenderedSearch(response)\n const canonicalUrl = createHrefFromUrl(new URL(location.href))\n const originalFlightDataPath = fallbackInitialRSCPayload.f[0]\n const originalFlightRouterState = originalFlightDataPath[0]\n return {\n b: fallbackInitialRSCPayload.b,\n c: canonicalUrl.split('/'),\n q: renderedSearch,\n i: fallbackInitialRSCPayload.i,\n f: [\n [\n fillInFallbackFlightRouterState(\n originalFlightRouterState,\n renderedPathname,\n renderedSearch as NormalizedSearch\n ),\n originalFlightDataPath[1],\n originalFlightDataPath[2],\n originalFlightDataPath[2],\n ],\n ],\n m: fallbackInitialRSCPayload.m,\n G: fallbackInitialRSCPayload.G,\n s: fallbackInitialRSCPayload.s,\n S: fallbackInitialRSCPayload.S,\n }\n}\n\nfunction fillInFallbackFlightRouterState(\n flightRouterState: FlightRouterState,\n renderedPathname: string,\n renderedSearch: NormalizedSearch\n): FlightRouterState {\n const pathnameParts = renderedPathname.split('/').filter((p) => p !== '')\n const index = 0\n return fillInFallbackFlightRouterStateImpl(\n flightRouterState,\n renderedSearch,\n pathnameParts,\n index\n )\n}\n\nfunction fillInFallbackFlightRouterStateImpl(\n flightRouterState: FlightRouterState,\n renderedSearch: NormalizedSearch,\n pathnameParts: Array<string>,\n pathnamePartsIndex: number\n): FlightRouterState {\n const originalSegment = flightRouterState[0]\n let newSegment: Segment\n let doesAppearInURL: boolean\n if (typeof originalSegment === 'string') {\n newSegment = originalSegment\n doesAppearInURL = doesStaticSegmentAppearInURL(originalSegment)\n } else {\n const paramName = originalSegment[0]\n const paramType = originalSegment[2]\n const paramValue = parseDynamicParamFromURLPart(\n paramType,\n pathnameParts,\n pathnamePartsIndex\n )\n const cacheKey = getCacheKeyForDynamicParam(paramValue, renderedSearch)\n newSegment = [paramName, cacheKey, paramType]\n doesAppearInURL = true\n }\n\n // Only increment the index if the segment appears in the URL. If it's a\n // \"virtual\" segment, like a route group, it remains the same.\n const childPathnamePartsIndex = doesAppearInURL\n ? pathnamePartsIndex + 1\n : pathnamePartsIndex\n\n const children = flightRouterState[1]\n const newChildren: { [key: string]: FlightRouterState } = {}\n for (let key in children) {\n const childFlightRouterState = children[key]\n newChildren[key] = fillInFallbackFlightRouterStateImpl(\n childFlightRouterState,\n renderedSearch,\n pathnameParts,\n childPathnamePartsIndex\n )\n }\n\n const newState: FlightRouterState = [\n newSegment,\n newChildren,\n null,\n flightRouterState[3],\n flightRouterState[4],\n ]\n return newState\n}\n\nexport function getNextFlightSegmentPath(\n flightSegmentPath: FlightSegmentPath\n): FlightSegmentPath {\n // Since `FlightSegmentPath` is a repeated tuple of `Segment` and `ParallelRouteKey`, we slice off two items\n // to get the next segment path.\n return flightSegmentPath.slice(2)\n}\n\nexport function normalizeFlightData(\n flightData: FlightData\n): NormalizedFlightData[] | string {\n // FlightData can be a string when the server didn't respond with a proper flight response,\n // or when a redirect happens, to signal to the client that it needs to perform an MPA navigation.\n if (typeof flightData === 'string') {\n return flightData\n }\n\n return flightData.map((flightDataPath) =>\n getFlightDataPartsFromPath(flightDataPath)\n )\n}\n\n/**\n * This function is used to prepare the flight router state for the request.\n * It removes markers that are not needed by the server, and are purely used\n * for stashing state on the client.\n * @param flightRouterState - The flight router state to prepare.\n * @param isHmrRefresh - Whether this is an HMR refresh request.\n * @returns The prepared flight router state.\n */\nexport function prepareFlightRouterStateForRequest(\n flightRouterState: FlightRouterState,\n isHmrRefresh?: boolean\n): string {\n // HMR requests need the complete, unmodified state for proper functionality\n if (isHmrRefresh) {\n return encodeURIComponent(JSON.stringify(flightRouterState))\n }\n\n return encodeURIComponent(\n JSON.stringify(stripClientOnlyDataFromFlightRouterState(flightRouterState))\n )\n}\n\n/**\n * Recursively strips client-only data from FlightRouterState while preserving\n * server-needed information for proper rendering decisions.\n */\nfunction stripClientOnlyDataFromFlightRouterState(\n flightRouterState: FlightRouterState\n): FlightRouterState {\n const [\n segment,\n parallelRoutes,\n _url, // Intentionally unused - URLs are client-only\n refreshMarker,\n isRootLayout,\n hasLoadingBoundary,\n ] = flightRouterState\n\n // __PAGE__ segments are always fetched from the server, so there's\n // no need to send them up\n const cleanedSegment = stripSearchParamsFromPageSegment(segment)\n\n // Recursively process parallel routes\n const cleanedParallelRoutes: { [key: string]: FlightRouterState } = {}\n for (const [key, childState] of Object.entries(parallelRoutes)) {\n cleanedParallelRoutes[key] =\n stripClientOnlyDataFromFlightRouterState(childState)\n }\n\n const result: FlightRouterState = [\n cleanedSegment,\n cleanedParallelRoutes,\n null, // URLs omitted - server reconstructs paths from segments\n shouldPreserveRefreshMarker(refreshMarker) ? refreshMarker : null,\n ]\n\n // Append optional fields if present\n if (isRootLayout !== undefined) {\n result[4] = isRootLayout\n }\n if (hasLoadingBoundary !== undefined) {\n result[5] = hasLoadingBoundary\n }\n\n return result\n}\n\n/**\n * Strips search parameters from __PAGE__ segments to prevent sensitive\n * client-side data from being sent to the server.\n */\nfunction stripSearchParamsFromPageSegment(segment: Segment): Segment {\n if (\n typeof segment === 'string' &&\n segment.startsWith(PAGE_SEGMENT_KEY + '?')\n ) {\n return PAGE_SEGMENT_KEY\n }\n return segment\n}\n\n/**\n * Determines whether the refresh marker should be sent to the server\n * Client-only markers like 'refresh' are stripped, while server-needed markers\n * like 'refetch' and 'inside-shared-layout' are preserved.\n */\nfunction shouldPreserveRefreshMarker(\n refreshMarker: FlightRouterState[3]\n): boolean {\n return Boolean(refreshMarker && refreshMarker !== 'refresh')\n}\n","import type { DynamicParamTypesShort } from '../shared/lib/app-router-types'\nimport {\n addSearchParamsIfPageSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../shared/lib/segment'\nimport { ROOT_SEGMENT_REQUEST_KEY } from '../shared/lib/segment-cache/segment-value-encoding'\nimport {\n NEXT_REWRITTEN_PATH_HEADER,\n NEXT_REWRITTEN_QUERY_HEADER,\n NEXT_RSC_UNION_QUERY,\n} from './components/app-router-headers'\nimport type { NormalizedSearch } from './components/segment-cache'\nimport type { RSCResponse } from './components/router-reducer/fetch-server-response'\nimport type { ParsedUrlQuery } from 'querystring'\n\nexport type RouteParamValue = string | Array<string> | null\n\nexport type RouteParam = {\n name: string\n value: RouteParamValue\n type: DynamicParamTypesShort\n}\n\nexport function getRenderedSearch(\n response: RSCResponse<unknown> | Response\n): NormalizedSearch {\n // If the server performed a rewrite, the search params used to render the\n // page will be different from the params in the request URL. In this case,\n // the response will include a header that gives the rewritten search query.\n const rewrittenQuery = response.headers.get(NEXT_REWRITTEN_QUERY_HEADER)\n if (rewrittenQuery !== null) {\n return (\n rewrittenQuery === '' ? '' : '?' + rewrittenQuery\n ) as NormalizedSearch\n }\n // If the header is not present, there was no rewrite, so we use the search\n // query of the response URL.\n return urlToUrlWithoutFlightMarker(new URL(response.url))\n .search as NormalizedSearch\n}\n\nexport function getRenderedPathname(\n response: RSCResponse<unknown> | Response\n): string {\n // If the server performed a rewrite, the pathname used to render the\n // page will be different from the pathname in the request URL. In this case,\n // the response will include a header that gives the rewritten pathname.\n const rewrittenPath = response.headers.get(NEXT_REWRITTEN_PATH_HEADER)\n return (\n rewrittenPath ?? urlToUrlWithoutFlightMarker(new URL(response.url)).pathname\n )\n}\n\nexport function parseDynamicParamFromURLPart(\n paramType: DynamicParamTypesShort,\n pathnameParts: Array<string>,\n partIndex: number\n): RouteParamValue {\n // This needs to match the behavior in get-dynamic-param.ts.\n switch (paramType) {\n // Catchalls\n case 'c':\n case 'ci': {\n // Catchalls receive all the remaining URL parts. If there are no\n // remaining pathname parts, return an empty array.\n return partIndex < pathnameParts.length\n ? pathnameParts.slice(partIndex).map((s) => encodeURIComponent(s))\n : []\n }\n // Optional catchalls\n case 'oc': {\n // Optional catchalls receive all the remaining URL parts, unless this is\n // the end of the pathname, in which case they return null.\n return partIndex < pathnameParts.length\n ? pathnameParts.slice(partIndex).map((s) => encodeURIComponent(s))\n : null\n }\n // Dynamic\n case 'd':\n case 'di': {\n if (partIndex >= pathnameParts.length) {\n // The route tree expected there to be more parts in the URL than there\n // actually are. This could happen if the x-nextjs-rewritten-path header\n // is incorrectly set, or potentially due to bug in Next.js. TODO:\n // Should this be a hard error? During a prefetch, we can just abort.\n // During a client navigation, we could trigger a hard refresh. But if\n // it happens during initial render, we don't really have any\n // recovery options.\n return ''\n }\n return encodeURIComponent(pathnameParts[partIndex])\n }\n default:\n paramType satisfies never\n return ''\n }\n}\n\nexport function doesStaticSegmentAppearInURL(segment: string): boolean {\n // This is not a parameterized segment; however, we need to determine\n // whether or not this segment appears in the URL. For example, this route\n // groups do not appear in the URL, so they should be skipped. Any other\n // special cases must be handled here.\n // TODO: Consider encoding this directly into the router tree instead of\n // inferring it on the client based on the segment type. Something like\n // a `doesAppearInURL` flag in FlightRouterState.\n if (\n segment === ROOT_SEGMENT_REQUEST_KEY ||\n // For some reason, the loader tree sometimes includes extra __PAGE__\n // \"layouts\" when part of a parallel route. But it's not a leaf node.\n // Otherwise, we wouldn't need this special case because pages are\n // always leaf nodes.\n // TODO: Investigate why the loader produces these fake page segments.\n segment.startsWith(PAGE_SEGMENT_KEY) ||\n // Route groups.\n (segment[0] === '(' && segment.endsWith(')')) ||\n segment === DEFAULT_SEGMENT_KEY ||\n segment === '/_not-found'\n ) {\n return false\n } else {\n // All other segment types appear in the URL\n return true\n }\n}\n\nexport function getCacheKeyForDynamicParam(\n paramValue: RouteParamValue,\n renderedSearch: NormalizedSearch\n): string {\n // This needs to match the logic in get-dynamic-param.ts, until we're able to\n // unify the various implementations so that these are always computed on\n // the client.\n if (typeof paramValue === 'string') {\n // TODO: Refactor or remove this helper function to accept a string rather\n // than the whole segment type. Also we can probably just append the\n // search string instead of turning it into JSON.\n const pageSegmentWithSearchParams = addSearchParamsIfPageSegment(\n paramValue,\n Object.fromEntries(new URLSearchParams(renderedSearch))\n ) as string\n return pageSegmentWithSearchParams\n } else if (paramValue === null) {\n return ''\n } else {\n return paramValue.join('/')\n }\n}\n\nexport function urlToUrlWithoutFlightMarker(url: URL): URL {\n const urlWithoutFlightParameters = new URL(url)\n urlWithoutFlightParameters.searchParams.delete(NEXT_RSC_UNION_QUERY)\n if (process.env.NODE_ENV === 'production') {\n if (\n process.env.__NEXT_CONFIG_OUTPUT === 'export' &&\n urlWithoutFlightParameters.pathname.endsWith('.txt')\n ) {\n const { pathname } = urlWithoutFlightParameters\n const length = pathname.endsWith('/index.txt') ? 10 : 4\n // Slice off `/index.txt` or `.txt` from the end of the pathname\n urlWithoutFlightParameters.pathname = pathname.slice(0, -length)\n }\n }\n return urlWithoutFlightParameters\n}\n\nexport function getParamValueFromCacheKey(\n paramCacheKey: string,\n paramType: DynamicParamTypesShort\n) {\n // Turn the cache key string sent by the server (as part of FlightRouterState)\n // into a value that can be passed to `useParams` and client components.\n const isCatchAll = paramType === 'c' || paramType === 'oc'\n if (isCatchAll) {\n // Catch-all param keys are a concatenation of the path segments.\n // See equivalent logic in `getSelectedParams`.\n // TODO: We should just pass the array directly, rather than concatenate\n // it to a string and then split it back to an array. It needs to be an\n // array in some places, like when passing a key React, but we can convert\n // it at runtime in those places.\n return paramCacheKey.split('/')\n }\n return paramCacheKey\n}\n\nexport function urlSearchParamsToParsedUrlQuery(\n searchParams: URLSearchParams\n): ParsedUrlQuery {\n // Converts a URLSearchParams object to the same type used by the server when\n // creating search params props, i.e. the type returned by Node's\n // \"querystring\" module.\n const result: ParsedUrlQuery = {}\n for (const [key, value] of searchParams.entries()) {\n if (result[key] === undefined) {\n result[key] = value\n } else if (Array.isArray(result[key])) {\n result[key].push(value)\n } else {\n result[key] = [result[key], value]\n }\n }\n return result\n}\n","import type { ServerRuntime } from '../types'\n\nexport const TEXT_PLAIN_CONTENT_TYPE_HEADER = 'text/plain'\nexport const HTML_CONTENT_TYPE_HEADER = 'text/html; charset=utf-8'\nexport const JSON_CONTENT_TYPE_HEADER = 'application/json; charset=utf-8'\nexport const NEXT_QUERY_PARAM_PREFIX = 'nxtP'\nexport const NEXT_INTERCEPTION_MARKER_PREFIX = 'nxtI'\n\nexport const MATCHED_PATH_HEADER = 'x-matched-path'\nexport const PRERENDER_REVALIDATE_HEADER = 'x-prerender-revalidate'\nexport const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER =\n 'x-prerender-revalidate-if-generated'\n\nexport const RSC_PREFETCH_SUFFIX = '.prefetch.rsc'\nexport const RSC_SEGMENTS_DIR_SUFFIX = '.segments'\nexport const RSC_SEGMENT_SUFFIX = '.segment.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'\n\nexport const NEXT_CACHE_TAGS_HEADER = 'x-next-cache-tags'\nexport const NEXT_CACHE_REVALIDATED_TAGS_HEADER = 'x-next-revalidated-tags'\nexport const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER =\n 'x-next-revalidate-tag-token'\n\nexport const NEXT_RESUME_HEADER = 'next-resume'\n\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\n// in seconds\nexport const CACHE_ONE_YEAR = 31536000\n\n// in seconds, represents revalidate=false. I.e. never revaliate.\n// We use this value since it can be represented as a V8 SMI for optimal performance.\n// It can also be serialized as JSON if it ever leaks accidentally as an actual value.\nexport const INFINITE_CACHE = 0xfffffffe\n\n// Patterns to detect middleware files\nexport const MIDDLEWARE_FILENAME = 'middleware'\nexport const MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`\n\n// Patterns to detect proxy files (replacement for middleware)\nexport const PROXY_FILENAME = 'proxy'\nexport const PROXY_LOCATION_REGEXP = `(?:src/)?${PROXY_FILENAME}`\n\n// Pattern to detect instrumentation hooks file\nexport const INSTRUMENTATION_HOOK_FILENAME = 'instrumentation'\n\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_CACHE_WRAPPER_ALIAS = 'private-next-rsc-cache-wrapper'\nexport const RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS =\n 'private-next-rsc-track-dynamic-import'\nexport const RSC_ACTION_ENCRYPTION_ALIAS = 'private-next-rsc-action-encryption'\nexport const RSC_ACTION_CLIENT_WRAPPER_ALIAS =\n 'private-next-rsc-action-client-wrapper'\n\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`\n\nexport const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`\n\nexport const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`\n\nexport const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`\n\nexport const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`\n\nexport const SERVER_PROPS_EXPORT_ERROR = `pages with \\`getServerSideProps\\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`\n\nexport const GSP_NO_RETURNED_VALUE =\n 'Your `getStaticProps` function did not return an object. Did you forget to add a `return`?'\nexport const GSSP_NO_RETURNED_VALUE =\n 'Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?'\n\nexport const UNSTABLE_REVALIDATE_RENAME_ERROR =\n 'The `unstable_revalidate` property is available for general use.\\n' +\n 'Please use `revalidate` instead.'\n\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`\n\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`\n\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`\n\nexport const ESLINT_DEFAULT_DIRS = ['app', 'pages', 'components', 'lib', 'src']\n\nexport const SERVER_RUNTIME: Record<string, ServerRuntime> = {\n edge: 'edge',\n experimentalEdge: 'experimental-edge',\n nodejs: 'nodejs',\n}\n\nexport const WEB_SOCKET_MAX_RECONNECTIONS = 12\n\n/**\n * The names of the webpack layers. These layers are the primitives for the\n * webpack chunks.\n */\nconst WEBPACK_LAYERS_NAMES = {\n /**\n * The layer for the shared code between the client and server bundles.\n */\n shared: 'shared',\n /**\n * The layer for server-only runtime and picking up `react-server` export conditions.\n * Including app router RSC pages and app router custom routes and metadata routes.\n */\n reactServerComponents: 'rsc',\n /**\n * Server Side Rendering layer for app (ssr).\n */\n serverSideRendering: 'ssr',\n /**\n * The browser client bundle layer for actions.\n */\n actionBrowser: 'action-browser',\n /**\n * The Node.js bundle layer for the API routes.\n */\n apiNode: 'api-node',\n /**\n * The Edge Lite bundle layer for the API routes.\n */\n apiEdge: 'api-edge',\n /**\n * The layer for the middleware code.\n */\n middleware: 'middleware',\n /**\n * The layer for the instrumentation hooks.\n */\n instrument: 'instrument',\n /**\n * The layer for assets on the edge.\n */\n edgeAsset: 'edge-asset',\n /**\n * The browser client bundle layer for App directory.\n */\n appPagesBrowser: 'app-pages-browser',\n /**\n * The browser client bundle layer for Pages directory.\n */\n pagesDirBrowser: 'pages-dir-browser',\n /**\n * The Edge Lite bundle layer for Pages directory.\n */\n pagesDirEdge: 'pages-dir-edge',\n /**\n * The Node.js bundle layer for Pages directory.\n */\n pagesDirNode: 'pages-dir-node',\n} as const\n\nexport type WebpackLayerName =\n (typeof WEBPACK_LAYERS_NAMES)[keyof typeof WEBPACK_LAYERS_NAMES]\n\nconst WEBPACK_LAYERS = {\n ...WEBPACK_LAYERS_NAMES,\n GROUP: {\n builtinReact: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n ],\n serverOnly: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.instrument,\n WEBPACK_LAYERS_NAMES.middleware,\n ],\n neutralTarget: [\n // pages api\n WEBPACK_LAYERS_NAMES.apiNode,\n WEBPACK_LAYERS_NAMES.apiEdge,\n ],\n clientOnly: [\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n ],\n bundled: [\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.shared,\n WEBPACK_LAYERS_NAMES.instrument,\n WEBPACK_LAYERS_NAMES.middleware,\n ],\n appPages: [\n // app router pages and layouts\n WEBPACK_LAYERS_NAMES.reactServerComponents,\n WEBPACK_LAYERS_NAMES.serverSideRendering,\n WEBPACK_LAYERS_NAMES.appPagesBrowser,\n WEBPACK_LAYERS_NAMES.actionBrowser,\n ],\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}\n\nexport { WEBPACK_LAYERS, WEBPACK_RESOURCE_QUERIES }\n","import path from 'path'\nimport { pathToFileURL } from 'url'\n\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 */\nexport const formatDynamicImportPath = (dir: string, filePath: string) => {\n const absoluteFilePath = path.isAbsolute(filePath)\n ? filePath\n : path.join(dir, filePath)\n const formattedFilePath = pathToFileURL(absoluteFilePath).toString()\n\n return formattedFilePath\n}\n","export const METADATA_BOUNDARY_NAME = '__next_metadata_boundary__'\nexport const VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__'\nexport const OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__'\nexport const ROOT_LAYOUT_BOUNDARY_NAME = '__next_root_layout_boundary__'\n","import type { IncomingMessage } from 'http'\nimport type { BaseNextRequest } from '../base-http'\nimport type { CookieSerializeOptions } from 'next/dist/compiled/cookie'\nimport type { NextApiResponse } from '../../shared/lib/utils'\n\nimport { HeadersAdapter } from '../web/spec-extension/adapters/headers'\nimport {\n PRERENDER_REVALIDATE_HEADER,\n PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER,\n} from '../../lib/constants'\nimport { getTracer } from '../lib/trace/tracer'\nimport { NodeSpan } from '../lib/trace/constants'\n\nexport type NextApiRequestCookies = Partial<{ [key: string]: string }>\nexport type NextApiRequestQuery = Partial<{ [key: string]: string | string[] }>\n\nexport type __ApiPreviewProps = {\n previewModeId: string\n previewModeEncryptionKey: string\n previewModeSigningKey: string\n}\n\nexport function wrapApiHandler<T extends (...args: any[]) => any>(\n page: string,\n handler: T\n): T {\n return ((...args) => {\n getTracer().setRootSpanAttribute('next.route', page)\n // Call API route method\n return getTracer().trace(\n NodeSpan.runHandler,\n {\n spanName: `executing api route (pages) ${page}`,\n },\n () => handler(...args)\n )\n }) as T\n}\n\n/**\n *\n * @param res response object\n * @param statusCode `HTTP` status code of response\n */\nexport function sendStatusCode(\n res: NextApiResponse,\n statusCode: number\n): NextApiResponse<any> {\n res.statusCode = statusCode\n return res\n}\n\n/**\n *\n * @param res response object\n * @param [statusOrUrl] `HTTP` status code of redirect\n * @param url URL of redirect\n */\nexport function redirect(\n res: NextApiResponse,\n statusOrUrl: string | number,\n url?: string\n): NextApiResponse<any> {\n if (typeof statusOrUrl === 'string') {\n url = statusOrUrl\n statusOrUrl = 307\n }\n if (typeof statusOrUrl !== 'number' || typeof url !== 'string') {\n throw new Error(\n `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 }\n res.writeHead(statusOrUrl, { Location: url })\n res.write(url)\n res.end()\n return res\n}\n\nexport function checkIsOnDemandRevalidate(\n req: Request | IncomingMessage | BaseNextRequest,\n previewProps: __ApiPreviewProps\n): {\n isOnDemandRevalidate: boolean\n revalidateOnlyGenerated: boolean\n} {\n const headers = HeadersAdapter.from(req.headers)\n\n const previewModeId = headers.get(PRERENDER_REVALIDATE_HEADER)\n const isOnDemandRevalidate = previewModeId === previewProps.previewModeId\n\n const revalidateOnlyGenerated = headers.has(\n PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER\n )\n\n return { isOnDemandRevalidate, revalidateOnlyGenerated }\n}\n\nexport const COOKIE_NAME_PRERENDER_BYPASS = `__prerender_bypass`\nexport const COOKIE_NAME_PRERENDER_DATA = `__next_preview_data`\n\nexport const RESPONSE_LIMIT_DEFAULT = 4 * 1024 * 1024\n\nexport const SYMBOL_PREVIEW_DATA = Symbol(COOKIE_NAME_PRERENDER_DATA)\nexport const SYMBOL_CLEARED_COOKIES = Symbol(COOKIE_NAME_PRERENDER_BYPASS)\n\nexport function clearPreviewData<T>(\n res: NextApiResponse<T>,\n options: {\n path?: string\n } = {}\n): NextApiResponse<T> {\n if (SYMBOL_CLEARED_COOKIES in res) {\n return res\n }\n\n const { serialize } =\n require('next/dist/compiled/cookie') as typeof import('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)\n ? previous\n : []),\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 } as CookieSerializeOptions)\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 } as CookieSerializeOptions)\n : undefined),\n }),\n ])\n\n Object.defineProperty(res, SYMBOL_CLEARED_COOKIES, {\n value: true,\n enumerable: false,\n })\n return res\n}\n\n/**\n * Custom error class\n */\nexport class ApiError extends Error {\n readonly statusCode: number\n\n constructor(statusCode: number, message: string) {\n super(message)\n this.statusCode = statusCode\n }\n}\n\n/**\n * Sends error in `response`\n * @param res response object\n * @param statusCode of response\n * @param message of response\n */\nexport function sendError(\n res: NextApiResponse,\n statusCode: number,\n message: string\n): void {\n res.statusCode = statusCode\n res.statusMessage = message\n res.end(message)\n}\n\ninterface LazyProps {\n req: IncomingMessage\n}\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 */\nexport function setLazyProp<T>(\n { req }: LazyProps,\n prop: string,\n getter: () => T\n): void {\n const opts = { configurable: true, enumerable: true }\n const optsReset = { ...opts, 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, { ...optsReset, value })\n return value\n },\n set: (value) => {\n Object.defineProperty(req, prop, { ...optsReset, value })\n },\n })\n}\n","import type { IncomingMessage, ServerResponse } from 'http'\nimport type { NextApiResponse } from '../../../shared/lib/utils'\nimport { checkIsOnDemandRevalidate } from '../.'\nimport type { __ApiPreviewProps } from '../.'\nimport type { BaseNextRequest, BaseNextResponse } from '../../base-http'\nimport type { PreviewData } from '../../../types'\n\nimport {\n clearPreviewData,\n COOKIE_NAME_PRERENDER_BYPASS,\n COOKIE_NAME_PRERENDER_DATA,\n SYMBOL_PREVIEW_DATA,\n} from '../index'\nimport { RequestCookies } from '../../web/spec-extension/cookies'\nimport { HeadersAdapter } from '../../web/spec-extension/adapters/headers'\n\nexport function tryGetPreviewData(\n req: IncomingMessage | BaseNextRequest | Request,\n res: ServerResponse | BaseNextResponse,\n options: __ApiPreviewProps,\n multiZoneDraftMode: boolean\n): PreviewData {\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\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 as any)[SYMBOL_PREVIEW_DATA] as any\n }\n\n const headers = HeadersAdapter.from(req.headers)\n const cookies = new RequestCookies(headers)\n\n const previewModeId = cookies.get(COOKIE_NAME_PRERENDER_BYPASS)?.value\n const tokenPreviewData = cookies.get(COOKIE_NAME_PRERENDER_DATA)?.value\n\n // Case: preview mode cookie set but data cookie is not set\n if (\n previewModeId &&\n !tokenPreviewData &&\n previewModeId === options.previewModeId\n ) {\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\n // Case: neither cookie is set.\n if (!previewModeId && !tokenPreviewData) {\n return false\n }\n\n // Case: one cookie is set, but not the other.\n if (!previewModeId || !tokenPreviewData) {\n if (!multiZoneDraftMode) {\n clearPreviewData(res as NextApiResponse)\n }\n return false\n }\n\n // Case: preview session is for an old build.\n if (previewModeId !== options.previewModeId) {\n if (!multiZoneDraftMode) {\n clearPreviewData(res as NextApiResponse)\n }\n return false\n }\n\n let encryptedPreviewData: {\n data: string\n }\n try {\n const jsonwebtoken =\n require('next/dist/compiled/jsonwebtoken') as typeof import('next/dist/compiled/jsonwebtoken')\n encryptedPreviewData = jsonwebtoken.verify(\n tokenPreviewData,\n options.previewModeSigningKey\n ) as typeof encryptedPreviewData\n } catch {\n // TODO: warn\n clearPreviewData(res as NextApiResponse)\n return false\n }\n\n const { decryptWithSecret } =\n require('../../crypto-utils') as typeof import('../../crypto-utils')\n const decryptedPreviewData = decryptWithSecret(\n Buffer.from(options.previewModeEncryptionKey),\n encryptedPreviewData.data\n )\n\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 * The functions provided by this module are used to communicate certain properties\n * about the currently running code so that Next.js can make decisions on how to handle\n * the current execution in different rendering modes such as pre-rendering, resuming, and SSR.\n *\n * Today Next.js treats all code as potentially static. Certain APIs may only make sense when dynamically rendering.\n * Traditionally this meant deopting the entire render to dynamic however with PPR we can now deopt parts\n * of a React tree as dynamic while still keeping other parts static. There are really two different kinds of\n * Dynamic indications.\n *\n * The first is simply an intention to be dynamic. unstable_noStore is an example of this where\n * the currently executing code simply declares that the current scope is dynamic but if you use it\n * inside unstable_cache it can still be cached. This type of indication can be removed if we ever\n * make the default dynamic to begin with because the only way you would ever be static is inside\n * a cache scope which this indication does not affect.\n *\n * The second is an indication that a dynamic data source was read. This is a stronger form of dynamic\n * because it means that it is inappropriate to cache this at all. using a dynamic data source inside\n * unstable_cache should error. If you want to use some dynamic data inside unstable_cache you should\n * read that data outside the cache and pass it in as an argument to the cached function.\n */\n\nimport type { WorkStore } from '../app-render/work-async-storage.external'\nimport type {\n WorkUnitStore,\n RequestStore,\n PrerenderStoreLegacy,\n PrerenderStoreModern,\n PrerenderStoreModernRuntime,\n} from '../app-render/work-unit-async-storage.external'\n\n// Once postpone is in stable we should switch to importing the postpone export directly\nimport React from 'react'\n\nimport { DynamicServerError } from '../../client/components/hooks-server-context'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport {\n getRuntimeStagePromise,\n throwForMissingRequestStore,\n workUnitAsyncStorage,\n} from './work-unit-async-storage.external'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport {\n METADATA_BOUNDARY_NAME,\n VIEWPORT_BOUNDARY_NAME,\n OUTLET_BOUNDARY_NAME,\n ROOT_LAYOUT_BOUNDARY_NAME,\n} from '../../lib/framework/boundary-constants'\nimport { scheduleOnNextTick } from '../../lib/scheduler'\nimport { BailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { RenderStage } from './staged-rendering'\n\nconst hasPostpone = typeof React.unstable_postpone === 'function'\n\nexport type DynamicAccess = {\n /**\n * If debugging, this will contain the stack trace of where the dynamic access\n * occurred. This is used to provide more information to the user about why\n * their page is being rendered dynamically.\n */\n stack?: string\n\n /**\n * The expression that was accessed dynamically.\n */\n expression: string\n}\n\n// Stores dynamic reasons used during an RSC render.\nexport type DynamicTrackingState = {\n /**\n * When true, stack information will also be tracked during dynamic access.\n */\n readonly isDebugDynamicAccesses: boolean | undefined\n\n /**\n * The dynamic accesses that occurred during the render.\n */\n readonly dynamicAccesses: Array<DynamicAccess>\n\n syncDynamicErrorWithStack: null | Error\n}\n\n// Stores dynamic reasons used during an SSR render.\nexport type DynamicValidationState = {\n hasSuspenseAboveBody: boolean\n hasDynamicMetadata: boolean\n hasDynamicViewport: boolean\n hasAllowedDynamic: boolean\n dynamicErrors: Array<Error>\n}\n\nexport function createDynamicTrackingState(\n isDebugDynamicAccesses: boolean | undefined\n): DynamicTrackingState {\n return {\n isDebugDynamicAccesses,\n dynamicAccesses: [],\n syncDynamicErrorWithStack: null,\n }\n}\n\nexport function createDynamicValidationState(): DynamicValidationState {\n return {\n hasSuspenseAboveBody: false,\n hasDynamicMetadata: false,\n hasDynamicViewport: false,\n hasAllowedDynamic: false,\n dynamicErrors: [],\n }\n}\n\nexport function getFirstDynamicReason(\n trackingState: DynamicTrackingState\n): undefined | string {\n return trackingState.dynamicAccesses[0]?.expression\n}\n\n/**\n * This function communicates that the current scope should be treated as dynamic.\n *\n * In most cases this function is a no-op but if called during\n * a PPR prerender it will postpone the current sub-tree and calling\n * it during a normal prerender will cause the entire prerender to abort\n */\nexport function markCurrentScopeAsDynamic(\n store: WorkStore,\n workUnitStore: undefined | Exclude<WorkUnitStore, PrerenderStoreModern>,\n expression: string\n): void {\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'unstable-cache':\n // Inside cache scopes, marking a scope as dynamic has no effect,\n // because the outer cache scope creates a cache boundary. This is\n // subtly different from reading a dynamic data source, which is\n // forbidden inside a cache scope.\n return\n case 'private-cache':\n // A private cache scope is already dynamic by definition.\n return\n case 'prerender-legacy':\n case 'prerender-ppr':\n case 'request':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n // If we're forcing dynamic rendering or we're forcing static rendering, we\n // don't need to do anything here because the entire page is already dynamic\n // or it's static and it should not throw or postpone here.\n if (store.forceDynamic || store.forceStatic) return\n\n if (store.dynamicShouldError) {\n throw new StaticGenBailoutError(\n `Route ${store.route} with \\`dynamic = \"error\"\\` couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`\n )\n }\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender-ppr':\n return postponeWithTracking(\n store.route,\n expression,\n workUnitStore.dynamicTracking\n )\n case 'prerender-legacy':\n workUnitStore.revalidate = 0\n\n // We aren't prerendering, but we are generating a static page. We need\n // to bail out of static generation.\n const err = new DynamicServerError(\n `Route ${store.route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n store.dynamicUsageDescription = expression\n store.dynamicUsageStack = err.stack\n\n throw err\n case 'request':\n if (process.env.NODE_ENV !== 'production') {\n workUnitStore.usedDynamic = true\n }\n break\n default:\n workUnitStore satisfies never\n }\n }\n}\n\n/**\n * This function is meant to be used when prerendering without cacheComponents or PPR.\n * When called during a build it will cause Next.js to consider the route as dynamic.\n *\n * @internal\n */\nexport function throwToInterruptStaticGeneration(\n expression: string,\n store: WorkStore,\n prerenderStore: PrerenderStoreLegacy\n): never {\n // We aren't prerendering but we are generating a static page. We need to bail out of static generation\n const err = new DynamicServerError(\n `Route ${store.route} couldn't be rendered statically because it used \\`${expression}\\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`\n )\n\n prerenderStore.revalidate = 0\n\n store.dynamicUsageDescription = expression\n store.dynamicUsageStack = err.stack\n\n throw err\n}\n\n/**\n * This function should be used to track whether something dynamic happened even when\n * we are in a dynamic render. This is useful for Dev where all renders are dynamic but\n * we still track whether dynamic APIs were accessed for helpful messaging\n *\n * @internal\n */\nexport function trackDynamicDataInDynamicRender(workUnitStore: WorkUnitStore) {\n switch (workUnitStore.type) {\n case 'cache':\n case 'unstable-cache':\n // Inside cache scopes, marking a scope as dynamic has no effect,\n // because the outer cache scope creates a cache boundary. This is\n // subtly different from reading a dynamic data source, which is\n // forbidden inside a cache scope.\n return\n case 'private-cache':\n // A private cache scope is already dynamic by definition.\n return\n case 'prerender':\n case 'prerender-runtime':\n case 'prerender-legacy':\n case 'prerender-ppr':\n case 'prerender-client':\n break\n case 'request':\n if (process.env.NODE_ENV !== 'production') {\n workUnitStore.usedDynamic = true\n }\n break\n default:\n workUnitStore satisfies never\n }\n}\n\nfunction abortOnSynchronousDynamicDataAccess(\n route: string,\n expression: string,\n prerenderStore: PrerenderStoreModern\n): void {\n const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`\n\n const error = createPrerenderInterruptedError(reason)\n\n prerenderStore.controller.abort(error)\n\n const dynamicTracking = prerenderStore.dynamicTracking\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses\n ? new Error().stack\n : undefined,\n expression,\n })\n }\n}\n\nexport function abortOnSynchronousPlatformIOAccess(\n route: string,\n expression: string,\n errorWithStack: Error,\n prerenderStore: PrerenderStoreModern\n): void {\n const dynamicTracking = prerenderStore.dynamicTracking\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore)\n // It is important that we set this tracking value after aborting. Aborts are executed\n // synchronously except for the case where you abort during render itself. By setting this\n // value late we can use it to determine if any of the aborted tasks are the task that\n // called the sync IO expression in the first place.\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack\n }\n }\n}\n\nexport function trackSynchronousPlatformIOAccessInDev(\n requestStore: RequestStore\n): void {\n // We don't actually have a controller to abort but we do the semantic equivalent by\n // advancing the request store out of the prerender stage\n if (requestStore.stagedRendering) {\n // TODO: error for sync IO in the runtime stage\n // (which is not currently covered by the validation render in `spawnDynamicValidationInDev`)\n requestStore.stagedRendering.advanceStage(RenderStage.Dynamic)\n }\n}\n\n/**\n * use this function when prerendering with cacheComponents. If we are doing a\n * prospective prerender we don't actually abort because we want to discover\n * all caches for the shell. If this is the actual prerender we do abort.\n *\n * This function accepts a prerenderStore but the caller should ensure we're\n * actually running in cacheComponents mode.\n *\n * @internal\n */\nexport function abortAndThrowOnSynchronousRequestDataAccess(\n route: string,\n expression: string,\n errorWithStack: Error,\n prerenderStore: PrerenderStoreModern\n): never {\n const prerenderSignal = prerenderStore.controller.signal\n if (prerenderSignal.aborted === false) {\n // TODO it would be better to move this aborted check into the callsite so we can avoid making\n // the error object when it isn't relevant to the aborting of the prerender however\n // since we need the throw semantics regardless of whether we abort it is easier to land\n // this way. See how this was handled with `abortOnSynchronousPlatformIOAccess` for a closer\n // to ideal implementation\n abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore)\n // It is important that we set this tracking value after aborting. Aborts are executed\n // synchronously except for the case where you abort during render itself. By setting this\n // value late we can use it to determine if any of the aborted tasks are the task that\n // called the sync IO expression in the first place.\n const dynamicTracking = prerenderStore.dynamicTracking\n if (dynamicTracking) {\n if (dynamicTracking.syncDynamicErrorWithStack === null) {\n dynamicTracking.syncDynamicErrorWithStack = errorWithStack\n }\n }\n }\n throw createPrerenderInterruptedError(\n `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`\n )\n}\n\n/**\n * This component will call `React.postpone` that throws the postponed error.\n */\ntype PostponeProps = {\n reason: string\n route: string\n}\nexport function Postpone({ reason, route }: PostponeProps): never {\n const prerenderStore = workUnitAsyncStorage.getStore()\n const dynamicTracking =\n prerenderStore && prerenderStore.type === 'prerender-ppr'\n ? prerenderStore.dynamicTracking\n : null\n postponeWithTracking(route, reason, dynamicTracking)\n}\n\nexport function postponeWithTracking(\n route: string,\n expression: string,\n dynamicTracking: null | DynamicTrackingState\n): never {\n assertPostpone()\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n // When we aren't debugging, we don't need to create another error for the\n // stack trace.\n stack: dynamicTracking.isDebugDynamicAccesses\n ? new Error().stack\n : undefined,\n expression,\n })\n }\n\n React.unstable_postpone(createPostponeReason(route, expression))\n}\n\nfunction createPostponeReason(route: string, expression: string) {\n return (\n `Route ${route} needs to bail out of prerendering at this point because it used ${expression}. ` +\n `React throws this special object to indicate where. It should not be caught by ` +\n `your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`\n )\n}\n\nexport function isDynamicPostpone(err: unknown) {\n if (\n typeof err === 'object' &&\n err !== null &&\n typeof (err as any).message === 'string'\n ) {\n return isDynamicPostponeReason((err as any).message)\n }\n return false\n}\n\nfunction isDynamicPostponeReason(reason: string) {\n return (\n reason.includes(\n 'needs to bail out of prerendering at this point because it used'\n ) &&\n reason.includes(\n 'Learn more: https://nextjs.org/docs/messages/ppr-caught-error'\n )\n )\n}\n\nif (isDynamicPostponeReason(createPostponeReason('%%%', '^^^')) === false) {\n throw new Error(\n 'Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js'\n )\n}\n\nconst NEXT_PRERENDER_INTERRUPTED = 'NEXT_PRERENDER_INTERRUPTED'\n\nfunction createPrerenderInterruptedError(message: string): Error {\n const error = new Error(message)\n ;(error as any).digest = NEXT_PRERENDER_INTERRUPTED\n return error\n}\n\ntype DigestError = Error & {\n digest: string\n}\n\nexport function isPrerenderInterruptedError(\n error: unknown\n): error is DigestError {\n return (\n typeof error === 'object' &&\n error !== null &&\n (error as any).digest === NEXT_PRERENDER_INTERRUPTED &&\n 'name' in error &&\n 'message' in error &&\n error instanceof Error\n )\n}\n\nexport function accessedDynamicData(\n dynamicAccesses: Array<DynamicAccess>\n): boolean {\n return dynamicAccesses.length > 0\n}\n\nexport function consumeDynamicAccess(\n serverDynamic: DynamicTrackingState,\n clientDynamic: DynamicTrackingState\n): DynamicTrackingState['dynamicAccesses'] {\n // We mutate because we only call this once we are no longer writing\n // to the dynamicTrackingState and it's more efficient than creating a new\n // array.\n serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses)\n return serverDynamic.dynamicAccesses\n}\n\nexport function formatDynamicAPIAccesses(\n dynamicAccesses: Array<DynamicAccess>\n): string[] {\n return dynamicAccesses\n .filter(\n (access): access is Required<DynamicAccess> =>\n typeof access.stack === 'string' && access.stack.length > 0\n )\n .map(({ expression, stack }) => {\n stack = stack\n .split('\\n')\n // Remove the \"Error: \" prefix from the first line of the stack trace as\n // well as the first 4 lines of the stack trace which is the distance\n // from the user code and the `new Error().stack` call.\n .slice(4)\n .filter((line) => {\n // Exclude Next.js internals from the stack trace.\n if (line.includes('node_modules/next/')) {\n return false\n }\n\n // Exclude anonymous functions from the stack trace.\n if (line.includes(' (<anonymous>)')) {\n return false\n }\n\n // Exclude Node.js internals from the stack trace.\n if (line.includes(' (node:')) {\n return false\n }\n\n return true\n })\n .join('\\n')\n return `Dynamic API Usage Debug - ${expression}:\\n${stack}`\n })\n}\n\nfunction assertPostpone() {\n if (!hasPostpone) {\n throw new Error(\n `Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js`\n )\n }\n}\n\n/**\n * This is a bit of a hack to allow us to abort a render using a Postpone instance instead of an Error which changes React's\n * abort semantics slightly.\n */\nexport function createRenderInBrowserAbortSignal(): AbortSignal {\n const controller = new AbortController()\n controller.abort(new BailoutToCSRError('Render in Browser'))\n return controller.signal\n}\n\n/**\n * In a prerender, we may end up with hanging Promises as inputs due them\n * stalling on connection() or because they're loading dynamic data. In that\n * case we need to abort the encoding of arguments since they'll never complete.\n */\nexport function createHangingInputAbortSignal(\n workUnitStore: WorkUnitStore\n): AbortSignal | undefined {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-runtime':\n const controller = new AbortController()\n\n if (workUnitStore.cacheSignal) {\n // If we have a cacheSignal it means we're in a prospective render. If\n // the input we're waiting on is coming from another cache, we do want\n // to wait for it so that we can resolve this cache entry too.\n workUnitStore.cacheSignal.inputReady().then(() => {\n controller.abort()\n })\n } else {\n // Otherwise we're in the final render and we should already have all\n // our caches filled.\n // If the prerender uses stages, we have wait until the runtime stage,\n // at which point all runtime inputs will be resolved.\n // (otherwise, a runtime prerender might consider `cookies()` hanging\n // even though they'd resolve in the next task.)\n //\n // We might still be waiting on some microtasks so we\n // wait one tick before giving up. When we give up, we still want to\n // render the content of this cache as deeply as we can so that we can\n // suspend as deeply as possible in the tree or not at all if we don't\n // end up waiting for the input.\n const runtimeStagePromise = getRuntimeStagePromise(workUnitStore)\n if (runtimeStagePromise) {\n runtimeStagePromise.then(() =>\n scheduleOnNextTick(() => controller.abort())\n )\n } else {\n scheduleOnNextTick(() => controller.abort())\n }\n }\n\n return controller.signal\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n return undefined\n default:\n workUnitStore satisfies never\n }\n}\n\nexport function annotateDynamicAccess(\n expression: string,\n prerenderStore: PrerenderStoreModern\n) {\n const dynamicTracking = prerenderStore.dynamicTracking\n if (dynamicTracking) {\n dynamicTracking.dynamicAccesses.push({\n stack: dynamicTracking.isDebugDynamicAccesses\n ? new Error().stack\n : undefined,\n expression,\n })\n }\n}\n\nexport function useDynamicRouteParams(expression: string) {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workStore && workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender-client':\n case 'prerender': {\n const fallbackParams = workUnitStore.fallbackRouteParams\n\n if (fallbackParams && fallbackParams.size > 0) {\n // We are in a prerender with cacheComponents semantics. We are going to\n // hang here and never resolve. This will cause the currently\n // rendering component to effectively be a dynamic hole.\n React.use(\n makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n expression\n )\n )\n }\n break\n }\n case 'prerender-ppr': {\n const fallbackParams = workUnitStore.fallbackRouteParams\n if (fallbackParams && fallbackParams.size > 0) {\n return postponeWithTracking(\n workStore.route,\n expression,\n workUnitStore.dynamicTracking\n )\n }\n break\n }\n case 'prerender-runtime':\n throw new InvariantError(\n `\\`${expression}\\` was called during a runtime prerender. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`\n )\n case 'cache':\n case 'private-cache':\n throw new InvariantError(\n `\\`${expression}\\` was called inside a cache scope. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`\n )\n case 'prerender-legacy':\n case 'request':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n}\n\nexport function useDynamicSearchParams(expression: string) {\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (!workStore) {\n // We assume pages router context and just return\n return\n }\n\n if (!workUnitStore) {\n throwForMissingRequestStore(expression)\n }\n\n switch (workUnitStore.type) {\n case 'prerender-client': {\n React.use(\n makeHangingPromise(\n workUnitStore.renderSignal,\n workStore.route,\n expression\n )\n )\n break\n }\n case 'prerender-legacy':\n case 'prerender-ppr': {\n if (workStore.forceStatic) {\n return\n }\n throw new BailoutToCSRError(expression)\n }\n case 'prerender':\n case 'prerender-runtime':\n throw new InvariantError(\n `\\`${expression}\\` was called from a Server Component. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`\n )\n case 'cache':\n case 'unstable-cache':\n case 'private-cache':\n throw new InvariantError(\n `\\`${expression}\\` was called inside a cache scope. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`\n )\n case 'request':\n return\n default:\n workUnitStore satisfies never\n }\n}\n\nconst hasSuspenseRegex = /\\n\\s+at Suspense \\(<anonymous>\\)/\n\n// Common implicit body tags that React will treat as body when placed directly in html\nconst bodyAndImplicitTags =\n 'body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6'\n\n// Detects when RootLayoutBoundary (our framework marker component) appears\n// after Suspense in the component stack, indicating the root layout is wrapped\n// within a Suspense boundary. Ensures no body/html/implicit-body components are in between.\n//\n// Example matches:\n// at Suspense (<anonymous>)\n// at __next_root_layout_boundary__ (<anonymous>)\n//\n// Or with other components in between (but not body/html/implicit-body):\n// at Suspense (<anonymous>)\n// at SomeComponent (<anonymous>)\n// at __next_root_layout_boundary__ (<anonymous>)\nconst hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex = new RegExp(\n `\\\\n\\\\s+at Suspense \\\\(<anonymous>\\\\)(?:(?!\\\\n\\\\s+at (?:${bodyAndImplicitTags}) \\\\(<anonymous>\\\\))[\\\\s\\\\S])*?\\\\n\\\\s+at ${ROOT_LAYOUT_BOUNDARY_NAME} \\\\([^\\\\n]*\\\\)`\n)\n\nconst hasMetadataRegex = new RegExp(\n `\\\\n\\\\s+at ${METADATA_BOUNDARY_NAME}[\\\\n\\\\s]`\n)\nconst hasViewportRegex = new RegExp(\n `\\\\n\\\\s+at ${VIEWPORT_BOUNDARY_NAME}[\\\\n\\\\s]`\n)\nconst hasOutletRegex = new RegExp(`\\\\n\\\\s+at ${OUTLET_BOUNDARY_NAME}[\\\\n\\\\s]`)\n\nexport function trackAllowedDynamicAccess(\n workStore: WorkStore,\n componentStack: string,\n dynamicValidation: DynamicValidationState,\n clientDynamic: DynamicTrackingState\n) {\n if (hasOutletRegex.test(componentStack)) {\n // We don't need to track that this is dynamic. It is only so when something else is also dynamic.\n return\n } else if (hasMetadataRegex.test(componentStack)) {\n dynamicValidation.hasDynamicMetadata = true\n return\n } else if (hasViewportRegex.test(componentStack)) {\n dynamicValidation.hasDynamicViewport = true\n return\n } else if (\n hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(\n componentStack\n )\n ) {\n // For Suspense within body, the prelude wouldn't be empty so it wouldn't violate the empty static shells rule.\n // But if you have Suspense above body, the prelude is empty but we allow that because having Suspense\n // is an explicit signal from the user that they acknowledge the empty shell and want dynamic rendering.\n dynamicValidation.hasAllowedDynamic = true\n dynamicValidation.hasSuspenseAboveBody = true\n return\n } else if (hasSuspenseRegex.test(componentStack)) {\n // this error had a Suspense boundary above it so we don't need to report it as a source\n // of disallowed\n dynamicValidation.hasAllowedDynamic = true\n return\n } else if (clientDynamic.syncDynamicErrorWithStack) {\n // This task was the task that called the sync error.\n dynamicValidation.dynamicErrors.push(\n clientDynamic.syncDynamicErrorWithStack\n )\n return\n } else {\n const message =\n `Route \"${workStore.route}\": Uncached data was accessed outside of ` +\n '<Suspense>. This delays the entire page from rendering, resulting in a ' +\n 'slow user experience. Learn more: ' +\n 'https://nextjs.org/docs/messages/blocking-route'\n const error = createErrorWithComponentOrOwnerStack(message, componentStack)\n dynamicValidation.dynamicErrors.push(error)\n return\n }\n}\n\n/**\n * In dev mode, we prefer using the owner stack, otherwise the provided\n * component stack is used.\n */\nfunction createErrorWithComponentOrOwnerStack(\n message: string,\n componentStack: string\n) {\n const ownerStack =\n process.env.NODE_ENV !== 'production' && React.captureOwnerStack\n ? React.captureOwnerStack()\n : null\n\n const error = new Error(message)\n error.stack = error.name + ': ' + message + (ownerStack ?? componentStack)\n return error\n}\n\nexport enum PreludeState {\n Full = 0,\n Empty = 1,\n Errored = 2,\n}\n\nexport function logDisallowedDynamicError(\n workStore: WorkStore,\n error: Error\n): void {\n console.error(error)\n\n if (!workStore.dev) {\n if (workStore.hasReadableErrorStacks) {\n console.error(\n `To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \\`next dev\\`, then open \"${workStore.route}\" in your browser to investigate the error.`\n )\n } else {\n console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:\n - Start the app in development mode by running \\`next dev\\`, then open \"${workStore.route}\" in your browser to investigate the error.\n - Rerun the production build with \\`next build --debug-prerender\\` to generate better stack traces.`)\n }\n }\n}\n\nexport function throwIfDisallowedDynamic(\n workStore: WorkStore,\n prelude: PreludeState,\n dynamicValidation: DynamicValidationState,\n serverDynamic: DynamicTrackingState\n): void {\n if (serverDynamic.syncDynamicErrorWithStack) {\n logDisallowedDynamicError(\n workStore,\n serverDynamic.syncDynamicErrorWithStack\n )\n throw new StaticGenBailoutError()\n }\n\n if (prelude !== PreludeState.Full) {\n if (dynamicValidation.hasSuspenseAboveBody) {\n // This route has opted into allowing fully dynamic rendering\n // by including a Suspense boundary above the body. In this case\n // a lack of a shell is not considered disallowed so we simply return\n return\n }\n\n // We didn't have any sync bailouts but there may be user code which\n // blocked the root. We would have captured these during the prerender\n // and can log them here and then terminate the build/validating render\n const dynamicErrors = dynamicValidation.dynamicErrors\n if (dynamicErrors.length > 0) {\n for (let i = 0; i < dynamicErrors.length; i++) {\n logDisallowedDynamicError(workStore, dynamicErrors[i])\n }\n\n throw new StaticGenBailoutError()\n }\n\n // If we got this far then the only other thing that could be blocking\n // the root is dynamic Viewport. If this is dynamic then\n // you need to opt into that by adding a Suspense boundary above the body\n // to indicate your are ok with fully dynamic rendering.\n if (dynamicValidation.hasDynamicViewport) {\n console.error(\n `Route \"${workStore.route}\" has a \\`generateViewport\\` that depends on Request data (\\`cookies()\\`, etc...) or uncached external data (\\`fetch(...)\\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`\n )\n throw new StaticGenBailoutError()\n }\n\n if (prelude === PreludeState.Empty) {\n // If we ever get this far then we messed up the tracking of invalid dynamic.\n // We still adhere to the constraint that you must produce a shell but invite the\n // user to report this as a bug in Next.js.\n console.error(\n `Route \"${workStore.route}\" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`\n )\n throw new StaticGenBailoutError()\n }\n } else {\n if (\n dynamicValidation.hasAllowedDynamic === false &&\n dynamicValidation.hasDynamicMetadata\n ) {\n console.error(\n `Route \"${workStore.route}\" has a \\`generateMetadata\\` that depends on Request data (\\`cookies()\\`, etc...) or uncached external data (\\`fetch(...)\\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`\n )\n throw new StaticGenBailoutError()\n }\n }\n}\n\nexport function delayUntilRuntimeStage<T>(\n prerenderStore: PrerenderStoreModernRuntime,\n result: Promise<T>\n): Promise<T> {\n if (prerenderStore.runtimeStagePromise) {\n return prerenderStore.runtimeStagePromise.then(() => result)\n }\n return result\n}\n","import crypto from 'crypto'\n\n// Background:\n// https://security.stackexchange.com/questions/184305/why-would-i-ever-use-aes-256-cbc-if-aes-256-gcm-is-more-secure\n\nconst CIPHER_ALGORITHM = `aes-256-gcm`,\n CIPHER_KEY_LENGTH = 32, // https://stackoverflow.com/a/28307668/4397028\n CIPHER_IV_LENGTH = 16, // https://stackoverflow.com/a/28307668/4397028\n CIPHER_TAG_LENGTH = 16,\n CIPHER_SALT_LENGTH = 64\n\nconst PBKDF2_ITERATIONS = 100_000 // https://support.1password.com/pbkdf2/\n\nexport function encryptWithSecret(secret: Buffer, data: string): string {\n const iv = crypto.randomBytes(CIPHER_IV_LENGTH)\n const salt = crypto.randomBytes(CIPHER_SALT_LENGTH)\n\n // https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest\n const key = crypto.pbkdf2Sync(\n secret,\n salt,\n PBKDF2_ITERATIONS,\n CIPHER_KEY_LENGTH,\n `sha512`\n )\n\n const cipher = crypto.createCipheriv(CIPHER_ALGORITHM, key, iv)\n const encrypted = Buffer.concat([cipher.update(data, `utf8`), cipher.final()])\n\n // https://nodejs.org/api/crypto.html#crypto_cipher_getauthtag\n const tag = cipher.getAuthTag()\n\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}\n\nexport function decryptWithSecret(\n secret: Buffer,\n encryptedData: string\n): string {\n const buffer = Buffer.from(encryptedData, `hex`)\n\n const salt = buffer.slice(0, CIPHER_SALT_LENGTH)\n const iv = buffer.slice(\n CIPHER_SALT_LENGTH,\n CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH\n )\n const tag = buffer.slice(\n CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH,\n CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH + CIPHER_TAG_LENGTH\n )\n const encrypted = buffer.slice(\n CIPHER_SALT_LENGTH + CIPHER_IV_LENGTH + CIPHER_TAG_LENGTH\n )\n\n // https://nodejs.org/api/crypto.html#crypto_crypto_pbkdf2sync_password_salt_iterations_keylen_digest\n const key = crypto.pbkdf2Sync(\n secret,\n salt,\n PBKDF2_ITERATIONS,\n CIPHER_KEY_LENGTH,\n `sha512`\n )\n\n const decipher = crypto.createDecipheriv(CIPHER_ALGORITHM, key, iv)\n decipher.setAuthTag(tag)\n\n return decipher.update(encrypted) + decipher.final(`utf8`)\n}\n","import type { NonStaticRenderStage } from './app-render/staged-rendering'\nimport type { RequestStore } from './app-render/work-unit-async-storage.external'\n\nexport function isHangingPromiseRejectionError(\n err: unknown\n): err is HangingPromiseRejectionError {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false\n }\n\n return err.digest === HANGING_PROMISE_REJECTION\n}\n\nconst HANGING_PROMISE_REJECTION = 'HANGING_PROMISE_REJECTION'\n\nclass HangingPromiseRejectionError extends Error {\n public readonly digest = HANGING_PROMISE_REJECTION\n\n constructor(\n public readonly route: string,\n public readonly expression: string\n ) {\n super(\n `During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \\`setTimeout\\`, \\`after\\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route \"${route}\".`\n )\n }\n}\n\ntype AbortListeners = Array<(err: unknown) => void>\nconst abortListenersBySignal = new WeakMap<AbortSignal, AbortListeners>()\n\n/**\n * This function constructs a promise that will never resolve. This is primarily\n * useful for cacheComponents where we use promise resolution timing to determine which\n * parts of a render can be included in a prerender.\n *\n * @internal\n */\nexport function makeHangingPromise<T>(\n signal: AbortSignal,\n route: string,\n expression: string\n): Promise<T> {\n if (signal.aborted) {\n return Promise.reject(new HangingPromiseRejectionError(route, expression))\n } else {\n const hangingPromise = new Promise<T>((_, reject) => {\n const boundRejection = reject.bind(\n null,\n new HangingPromiseRejectionError(route, expression)\n )\n let currentListeners = abortListenersBySignal.get(signal)\n if (currentListeners) {\n currentListeners.push(boundRejection)\n } else {\n const listeners = [boundRejection]\n abortListenersBySignal.set(signal, listeners)\n signal.addEventListener(\n 'abort',\n () => {\n for (let i = 0; i < listeners.length; i++) {\n listeners[i]()\n }\n },\n { once: true }\n )\n }\n })\n // We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so\n // we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct\n // your own promise out of it you'll need to ensure you handle the error when it rejects.\n hangingPromise.catch(ignoreReject)\n return hangingPromise\n }\n}\n\nfunction ignoreReject() {}\n\nexport function makeDevtoolsIOAwarePromise<T>(\n underlying: T,\n requestStore: RequestStore,\n stage: NonStaticRenderStage\n): Promise<T> {\n if (requestStore.stagedRendering) {\n // We resolve each stage in a timeout, so React DevTools will pick this up as IO.\n return requestStore.stagedRendering.delayUntilStage(\n stage,\n undefined,\n underlying\n )\n }\n // in React DevTools if we resolve in a setTimeout we will observe\n // the promise resolution as something that can suspend a boundary or root.\n return new Promise<T>((resolve) => {\n // Must use setTimeout to be considered IO React DevTools. setImmediate will not work.\n setTimeout(() => {\n resolve(underlying)\n }, 0)\n })\n}\n","import type { CacheFs } from '../../shared/lib/utils'\n\nimport fs from 'fs'\n\nexport const nodeFs: CacheFs = {\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, { recursive: true }),\n stat: (f) => fs.promises.stat(f),\n}\n","/**\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 **/\n\n// eslint typescript has a bug with TS enums\n\nenum BaseServerSpan {\n handleRequest = 'BaseServer.handleRequest',\n run = 'BaseServer.run',\n pipe = 'BaseServer.pipe',\n getStaticHTML = 'BaseServer.getStaticHTML',\n render = 'BaseServer.render',\n renderToResponseWithComponents = 'BaseServer.renderToResponseWithComponents',\n renderToResponse = 'BaseServer.renderToResponse',\n renderToHTML = 'BaseServer.renderToHTML',\n renderError = 'BaseServer.renderError',\n renderErrorToResponse = 'BaseServer.renderErrorToResponse',\n renderErrorToHTML = 'BaseServer.renderErrorToHTML',\n render404 = 'BaseServer.render404',\n}\n\nenum LoadComponentsSpan {\n loadDefaultErrorComponents = 'LoadComponents.loadDefaultErrorComponents',\n loadComponents = 'LoadComponents.loadComponents',\n}\n\nenum NextServerSpan {\n getRequestHandler = 'NextServer.getRequestHandler',\n getRequestHandlerWithMetadata = 'NextServer.getRequestHandlerWithMetadata',\n getServer = 'NextServer.getServer',\n getServerRequestHandler = 'NextServer.getServerRequestHandler',\n createServer = 'createServer.createServer',\n}\n\nenum NextNodeServerSpan {\n compression = 'NextNodeServer.compression',\n getBuildId = 'NextNodeServer.getBuildId',\n createComponentTree = 'NextNodeServer.createComponentTree',\n clientComponentLoading = 'NextNodeServer.clientComponentLoading',\n getLayoutOrPageModule = 'NextNodeServer.getLayoutOrPageModule',\n generateStaticRoutes = 'NextNodeServer.generateStaticRoutes',\n generateFsStaticRoutes = 'NextNodeServer.generateFsStaticRoutes',\n generatePublicRoutes = 'NextNodeServer.generatePublicRoutes',\n generateImageRoutes = 'NextNodeServer.generateImageRoutes.route',\n sendRenderResult = 'NextNodeServer.sendRenderResult',\n proxyRequest = 'NextNodeServer.proxyRequest',\n runApi = 'NextNodeServer.runApi',\n render = 'NextNodeServer.render',\n renderHTML = 'NextNodeServer.renderHTML',\n imageOptimizer = 'NextNodeServer.imageOptimizer',\n getPagePath = 'NextNodeServer.getPagePath',\n getRoutesManifest = 'NextNodeServer.getRoutesManifest',\n findPageComponents = 'NextNodeServer.findPageComponents',\n getFontManifest = 'NextNodeServer.getFontManifest',\n getServerComponentManifest = 'NextNodeServer.getServerComponentManifest',\n getRequestHandler = 'NextNodeServer.getRequestHandler',\n renderToHTML = 'NextNodeServer.renderToHTML',\n renderError = 'NextNodeServer.renderError',\n renderErrorToHTML = 'NextNodeServer.renderErrorToHTML',\n render404 = 'NextNodeServer.render404',\n startResponse = 'NextNodeServer.startResponse',\n\n // nested inner span, does not require parent scope name\n route = 'route',\n onProxyReq = 'onProxyReq',\n apiResolver = 'apiResolver',\n internalFetch = 'internalFetch',\n}\n\nenum StartServerSpan {\n startServer = 'startServer.startServer',\n}\n\nenum RenderSpan {\n getServerSideProps = 'Render.getServerSideProps',\n getStaticProps = 'Render.getStaticProps',\n renderToString = 'Render.renderToString',\n renderDocument = 'Render.renderDocument',\n createBodyResult = 'Render.createBodyResult',\n}\n\nenum AppRenderSpan {\n renderToString = 'AppRender.renderToString',\n renderToReadableStream = 'AppRender.renderToReadableStream',\n getBodyResult = 'AppRender.getBodyResult',\n fetch = 'AppRender.fetch',\n}\n\nenum RouterSpan {\n executeRoute = 'Router.executeRoute',\n}\n\nenum NodeSpan {\n runHandler = 'Node.runHandler',\n}\n\nenum AppRouteRouteHandlersSpan {\n runHandler = 'AppRouteRouteHandlers.runHandler',\n}\n\nenum ResolveMetadataSpan {\n generateMetadata = 'ResolveMetadata.generateMetadata',\n generateViewport = 'ResolveMetadata.generateViewport',\n}\n\nenum MiddlewareSpan {\n execute = 'Middleware.execute',\n}\n\ntype SpanTypes =\n | `${BaseServerSpan}`\n | `${LoadComponentsSpan}`\n | `${NextServerSpan}`\n | `${StartServerSpan}`\n | `${NextNodeServerSpan}`\n | `${RenderSpan}`\n | `${RouterSpan}`\n | `${AppRenderSpan}`\n | `${NodeSpan}`\n | `${AppRouteRouteHandlersSpan}`\n | `${ResolveMetadataSpan}`\n | `${MiddlewareSpan}`\n\n// This list is used to filter out spans that are not relevant to the user\nexport const NextVanillaSpanAllowlist = [\n MiddlewareSpan.execute,\n BaseServerSpan.handleRequest,\n RenderSpan.getServerSideProps,\n RenderSpan.getStaticProps,\n AppRenderSpan.fetch,\n AppRenderSpan.getBodyResult,\n RenderSpan.renderDocument,\n NodeSpan.runHandler,\n AppRouteRouteHandlersSpan.runHandler,\n ResolveMetadataSpan.generateMetadata,\n ResolveMetadataSpan.generateViewport,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.getLayoutOrPageModule,\n NextNodeServerSpan.startResponse,\n NextNodeServerSpan.clientComponentLoading,\n]\n\n// These Spans are allowed to be always logged\n// when the otel log prefix env is set\nexport const LogSpanAllowList = [\n NextNodeServerSpan.findPageComponents,\n NextNodeServerSpan.createComponentTree,\n NextNodeServerSpan.clientComponentLoading,\n]\n\nexport {\n BaseServerSpan,\n LoadComponentsSpan,\n NextServerSpan,\n NextNodeServerSpan,\n StartServerSpan,\n RenderSpan,\n RouterSpan,\n AppRenderSpan,\n NodeSpan,\n AppRouteRouteHandlersSpan,\n ResolveMetadataSpan,\n MiddlewareSpan,\n}\n\nexport type { SpanTypes }\n","import * as React from 'react'\nimport * as ReactDOM from 'react-dom'\nimport * as ReactJsxDevRuntime from 'react/jsx-dev-runtime'\nimport * as ReactJsxRuntime from 'react/jsx-runtime'\nimport * as ReactCompilerRuntime from 'react/compiler-runtime'\n\nimport * as ReactDOMServer from 'react-dom/server'\n\nfunction getAltProxyForBindingsDEV(\n type: 'Turbopack' | 'Webpack',\n pkg: 'react-server-dom-turbopack/client' | 'react-server-dom-webpack/client'\n) {\n if (process.env.NODE_ENV === 'development') {\n const altType = type === 'Turbopack' ? 'Webpack' : 'Turbopack'\n const altPkg = pkg.replace(new RegExp(type, 'gi'), altType.toLowerCase())\n\n return new Proxy(\n {},\n {\n get(_, prop: string) {\n throw new Error(\n `Expected to use ${type} bindings (${pkg}) for React but the current process is referencing '${prop}' from the ${altType} bindings (${altPkg}). This is likely a bug in our integration of the Next.js server runtime.`\n )\n },\n }\n )\n }\n}\n\nlet ReactServerDOMTurbopackClient, ReactServerDOMWebpackClient\nif (process.env.TURBOPACK) {\n ReactServerDOMTurbopackClient =\n // @ts-expect-error -- TODO: Add types\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-turbopack/client') as typeof import('react-server-dom-turbopack/client')\n if (process.env.NODE_ENV === 'development') {\n ReactServerDOMWebpackClient = getAltProxyForBindingsDEV(\n 'Turbopack',\n 'react-server-dom-turbopack/client'\n )\n }\n} else {\n ReactServerDOMWebpackClient =\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client') as typeof import('react-server-dom-webpack/client')\n if (process.env.NODE_ENV === 'development') {\n ReactServerDOMTurbopackClient = getAltProxyForBindingsDEV(\n 'Webpack',\n 'react-server-dom-webpack/client'\n )\n }\n}\n\nexport {\n React,\n ReactJsxDevRuntime,\n ReactJsxRuntime,\n ReactCompilerRuntime,\n ReactDOM,\n ReactDOMServer,\n ReactServerDOMTurbopackClient,\n ReactServerDOMWebpackClient,\n}\n","import type { IncomingHttpHeaders } from 'http'\n\nimport { ReflectAdapter } from './reflect'\n\n/**\n * @internal\n */\nexport class ReadonlyHeadersError extends Error {\n constructor() {\n super(\n 'Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers'\n )\n }\n\n public static callable() {\n throw new ReadonlyHeadersError()\n }\n}\n\nexport type ReadonlyHeaders = Headers & {\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n append(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n set(...args: any[]): void\n /** @deprecated Method unavailable on `ReadonlyHeaders`. Read more: https://nextjs.org/docs/app/api-reference/functions/headers */\n delete(...args: any[]): void\n}\nexport class HeadersAdapter extends Headers {\n private readonly headers: IncomingHttpHeaders\n\n constructor(headers: IncomingHttpHeaders) {\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\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\n const lowercased = prop.toLowerCase()\n\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(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return undefined.\n if (typeof original === 'undefined') return\n\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\n const lowercased = prop.toLowerCase()\n\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(\n (o) => o.toLowerCase() === lowercased\n )\n\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\n const lowercased = prop.toLowerCase()\n\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(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return false.\n if (typeof original === 'undefined') return false\n\n // If the original casing exists, return true.\n return ReflectAdapter.has(target, original)\n },\n deleteProperty(target, prop) {\n if (typeof prop === 'symbol')\n return ReflectAdapter.deleteProperty(target, prop)\n\n const lowercased = prop.toLowerCase()\n\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(\n (o) => o.toLowerCase() === lowercased\n )\n\n // If the original casing doesn't exist, return true.\n if (typeof original === 'undefined') return true\n\n // If the original casing exists, delete the property.\n return ReflectAdapter.deleteProperty(target, original)\n },\n })\n }\n\n /**\n * Seals a Headers instance to prevent modification by throwing an error when\n * any mutating method is called.\n */\n public static seal(headers: Headers): ReadonlyHeaders {\n return new Proxy<ReadonlyHeaders>(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 /**\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 */\n private merge(value: string | string[]): string {\n if (Array.isArray(value)) return value.join(', ')\n\n return value\n }\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 */\n public static from(headers: IncomingHttpHeaders | Headers): Headers {\n if (headers instanceof Headers) return headers\n\n return new HeadersAdapter(headers)\n }\n\n public append(name: string, value: string): void {\n const existing = this.headers[name]\n if (typeof existing === 'string') {\n this.headers[name] = [existing, value]\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n this.headers[name] = value\n }\n }\n\n public delete(name: string): void {\n delete this.headers[name]\n }\n\n public get(name: string): string | null {\n const value = this.headers[name]\n if (typeof value !== 'undefined') return this.merge(value)\n\n return null\n }\n\n public has(name: string): boolean {\n return typeof this.headers[name] !== 'undefined'\n }\n\n public set(name: string, value: string): void {\n this.headers[name] = value\n }\n\n public forEach(\n callbackfn: (value: string, name: string, parent: Headers) => void,\n thisArg?: any\n ): void {\n for (const [name, value] of this.entries()) {\n callbackfn.call(thisArg, value, name, this)\n }\n }\n\n public *entries(): HeadersIterator<[string, string]> {\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) as string\n\n yield [name, value] as [string, string]\n }\n }\n\n public *keys(): HeadersIterator<string> {\n for (const key of Object.keys(this.headers)) {\n const name = key.toLowerCase()\n yield name\n }\n }\n\n public *values(): HeadersIterator<string> {\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) as string\n\n yield value\n }\n }\n\n public [Symbol.iterator](): HeadersIterator<[string, string]> {\n return this.entries()\n }\n}\n","export class ReflectAdapter {\n static get<T extends object>(\n target: T,\n prop: string | symbol,\n receiver: unknown\n ): any {\n const value = Reflect.get(target, prop, receiver)\n if (typeof value === 'function') {\n return value.bind(target)\n }\n\n return value\n }\n\n static set<T extends object>(\n target: T,\n prop: string | symbol,\n value: any,\n receiver: any\n ): boolean {\n return Reflect.set(target, prop, value, receiver)\n }\n\n static has<T extends object>(target: T, prop: string | symbol): boolean {\n return Reflect.has(target, prop)\n }\n\n static deleteProperty<T extends object>(\n target: T,\n prop: string | symbol\n ): boolean {\n return Reflect.deleteProperty(target, prop)\n }\n}\n","/**\n * App Router types - Client-safe types for the Next.js App Router\n *\n * This file contains type definitions that can be safely imported\n * by both client-side and server-side code without circular dependencies.\n */\nimport type { FetchServerResponseResult } from '../../client/components/router-reducer/fetch-server-response'\nimport type React from 'react'\n\nexport type LoadingModuleData =\n | [React.JSX.Element, React.ReactNode, React.ReactNode]\n | null\n\n/** viewport metadata node */\nexport type HeadData = React.ReactNode\n\nexport type ChildSegmentMap = Map<string, CacheNode>\n\n/**\n * Cache node used in app-router / layout-router.\n */\nexport type CacheNode = ReadyCacheNode | LazyCacheNode\n\nexport type LazyCacheNode = {\n /**\n * When rsc is null, this is a lazily-initialized cache node.\n *\n * If the app attempts to render it, it triggers a lazy data fetch,\n * postpones the render, and schedules an update to a new tree.\n *\n * TODO: This mechanism should not be used when PPR is enabled, though it\n * currently is in some cases until we've implemented partial\n * segment fetching.\n */\n rsc: null\n\n /**\n * A prefetched version of the segment data. See explanation in corresponding\n * field of ReadyCacheNode (below).\n *\n * Since LazyCacheNode mostly only exists in the non-PPR implementation, this\n * will usually be null, but it could have been cloned from a previous\n * CacheNode that was created by the PPR implementation. Eventually we want\n * to migrate everything away from LazyCacheNode entirely.\n */\n prefetchRsc: React.ReactNode\n\n /**\n * A pending response for the lazy data fetch. If this is not present\n * during render, it is lazily created.\n */\n lazyData: Promise<FetchServerResponseResult> | null\n\n prefetchHead: HeadData | null\n\n head: HeadData\n\n loading: LoadingModuleData | Promise<LoadingModuleData>\n\n /**\n * Child parallel routes.\n */\n parallelRoutes: Map<string, ChildSegmentMap>\n\n /**\n * The timestamp of the navigation that last updated the CacheNode's data. If\n * a CacheNode is reused from a previous navigation, this value is not\n * updated. Used to track the staleness of the data.\n */\n navigatedAt: number\n}\n\nexport type ReadyCacheNode = {\n /**\n * When rsc is not null, it represents the RSC data for the\n * corresponding segment.\n *\n * `null` is a valid React Node but because segment data is always a\n * <LayoutRouter> component, we can use `null` to represent empty.\n *\n * TODO: For additional type safety, update this type to\n * Exclude<React.ReactNode, null>. Need to update createEmptyCacheNode to\n * accept rsc as an argument, or just inline the callers.\n */\n rsc: React.ReactNode\n\n /**\n * Represents a static version of the segment that can be shown immediately,\n * and may or may not contain dynamic holes. It's prefetched before a\n * navigation occurs.\n *\n * During rendering, we will choose whether to render `rsc` or `prefetchRsc`\n * with `useDeferredValue`. As with the `rsc` field, a value of `null` means\n * no value was provided. In this case, the LayoutRouter will go straight to\n * rendering the `rsc` value; if that one is also missing, it will suspend and\n * trigger a lazy fetch.\n */\n prefetchRsc: React.ReactNode\n\n /**\n * There should never be a lazy data request in this case.\n */\n lazyData: null\n prefetchHead: HeadData | null\n\n head: HeadData\n\n loading: LoadingModuleData | Promise<LoadingModuleData>\n\n parallelRoutes: Map<string, ChildSegmentMap>\n\n navigatedAt: number\n}\n\nexport type DynamicParamTypes =\n | 'catchall'\n | 'catchall-intercepted'\n | 'optional-catchall'\n | 'dynamic'\n | 'dynamic-intercepted'\n\nexport type DynamicParamTypesShort = 'c' | 'ci' | 'oc' | 'd' | 'di'\n\nexport type Segment =\n | string\n | [\n // Param name\n paramName: string,\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n paramCacheKey: string,\n // Dynamic param type\n dynamicParamType: DynamicParamTypesShort,\n ]\n\n/**\n * Router state\n */\nexport type FlightRouterState = [\n segment: Segment,\n parallelRoutes: { [parallelRouterKey: string]: FlightRouterState },\n url?: string | null,\n /**\n * \"refresh\" and \"refetch\", despite being similarly named, have different\n * semantics:\n * - \"refetch\" is used during a request to inform the server where rendering\n * should start from.\n *\n * - \"refresh\" is used by the client to mark that a segment should re-fetch the\n * data from the server for the current segment. It uses the \"url\" property\n * above to determine where to fetch from.\n *\n * - \"inside-shared-layout\" is used during a prefetch request to inform the\n * server that even if the segment matches, it should be treated as if it's\n * within the \"new\" part of a navigation — inside the shared layout. If\n * the segment doesn't match, then it has no effect, since it would be\n * treated as new regardless. If it does match, though, the server does not\n * need to render it, because the client already has it.\n *\n * - \"metadata-only\" instructs the server to skip rendering the segments and\n * only send the head data.\n *\n * A bit confusing, but that's because it has only one extremely narrow use\n * case — during a non-PPR prefetch, the server uses it to find the first\n * loading boundary beneath a shared layout.\n *\n * TODO: We should rethink the protocol for dynamic requests. It might not\n * make sense for the client to send a FlightRouterState, since this type is\n * overloaded with concerns.\n */\n refresh?:\n | 'refetch'\n | 'refresh'\n | 'inside-shared-layout'\n | 'metadata-only'\n | null,\n isRootLayout?: boolean,\n /**\n * Only present when responding to a tree prefetch request. Indicates whether\n * there is a loading boundary somewhere in the tree. The client cache uses\n * this to determine if it can skip the data prefetch request.\n */\n hasLoadingBoundary?: HasLoadingBoundary,\n]\n\nexport const enum HasLoadingBoundary {\n // There is a loading boundary in this particular segment\n SegmentHasLoadingBoundary = 1,\n // There is a loading boundary somewhere in the subtree (but not in\n // this segment)\n SubtreeHasLoadingBoundary = 2,\n // There is no loading boundary in this segment or any of its descendants\n SubtreeHasNoLoadingBoundary = 3,\n}\n\n/**\n * Individual Flight response path\n */\nexport type FlightSegmentPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n segment: Segment,\n parallelRouterKey: string,\n ]\n\n/**\n * Represents a tree of segments and the Flight data (i.e. React nodes) that\n * correspond to each one. The tree is isomorphic to the FlightRouterState;\n * however in the future we want to be able to fetch arbitrary partial segments\n * without having to fetch all its children. So this response format will\n * likely change.\n */\nexport type CacheNodeSeedData = [\n node: React.ReactNode | null,\n parallelRoutes: {\n [parallelRouterKey: string]: CacheNodeSeedData | null\n },\n loading: LoadingModuleData | Promise<LoadingModuleData>,\n isPartial: boolean,\n /** TODO: this doesn't feel like it belongs here, because it's only used during build, in `collectSegmentData` */\n hasRuntimePrefetch: boolean,\n]\n\nexport type FlightDataSegment = [\n /* segment of the rendered slice: */ Segment,\n /* treePatch */ FlightRouterState,\n /* cacheNodeSeedData */ CacheNodeSeedData | null, // Can be null during prefetch if there's no loading component\n /* head: viewport */ HeadData,\n /* isHeadPartial */ boolean,\n]\n\nexport type FlightDataPath =\n // Uses `any` as repeating pattern can't be typed.\n | any[]\n // Looks somewhat like this\n | [\n // Holds full path to the segment.\n ...FlightSegmentPath[],\n ...FlightDataSegment,\n ]\n\n/**\n * The Flight response data\n */\nexport type FlightData = Array<FlightDataPath> | string\n\nexport type ActionResult = Promise<any>\n\nexport type InitialRSCPayload = {\n /** buildId */\n b: string\n /** initialCanonicalUrlParts */\n c: string[]\n /** initialRenderedSearch */\n q: string\n /** couldBeIntercepted */\n i: boolean\n /** initialFlightData */\n f: FlightDataPath[]\n /** missingSlots */\n m: Set<string> | undefined\n /** GlobalError */\n G: [React.ComponentType<any>, React.ReactNode | undefined]\n /** postponed */\n s: boolean\n /** prerendered */\n S: boolean\n}\n\n// Response from `createFromFetch` for normal rendering\nexport type NavigationFlightResponse = {\n /** buildId */\n b: string\n /** flightData */\n f: FlightData\n /** prerendered */\n S: boolean\n}\n\n// Response from `createFromFetch` for server actions. Action's flight data can be null\nexport type ActionFlightResponse = {\n /** actionResult */\n a: ActionResult\n /** buildId */\n b: string\n /** flightData */\n f: FlightData\n}\n\nexport type RSCPayload =\n | InitialRSCPayload\n | NavigationFlightResponse\n | ActionFlightResponse\n","import React from 'react'\n\nexport const HeadManagerContext: React.Context<{\n updateHead?: (state: any) => void\n mountedInstances?: any\n updateScripts?: (state: any) => void\n scripts?: any\n getIsSsr?: () => boolean\n\n // Used in app directory, to render script tags as server components.\n appDir?: boolean\n nonce?: string\n}> = React.createContext({})\n\nif (process.env.NODE_ENV !== 'production') {\n HeadManagerContext.displayName = 'HeadManagerContext'\n}\n","export class InvariantError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(\n `Invariant: ${message.endsWith('.') ? message : message + '.'} This is a bug in Next.js.`,\n options\n )\n this.name = 'InvariantError'\n }\n}\n","/**\n * Check to see if a value is Thenable.\n *\n * @param promise the maybe-thenable value\n * @returns true if the value is thenable\n */\nexport function isThenable<T = unknown>(\n promise: Promise<T> | T\n): promise is Promise<T> {\n return (\n promise !== null &&\n typeof promise === 'object' &&\n 'then' in promise &&\n typeof promise.then === 'function'\n )\n}\n","/**\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 */\nlet path\n\nif (process.env.NEXT_RUNTIME === 'edge') {\n path = require('next/dist/compiled/path-browserify')\n} else {\n path = require('path')\n}\n\nmodule.exports = path\n","// This has to be a shared module which is shared between client component error boundary and dynamic component\nconst BAILOUT_TO_CSR = 'BAILOUT_TO_CLIENT_SIDE_RENDERING'\n\n/** An error that should be thrown when we want to bail out to client-side rendering. */\nexport class BailoutToCSRError extends Error {\n public readonly digest = BAILOUT_TO_CSR\n\n constructor(public readonly reason: string) {\n super(`Bail out to client-side rendering: ${reason}`)\n }\n}\n\n/** Checks if a passed argument is an error that is thrown if we want to bail out to client-side rendering. */\nexport function isBailoutToCSRError(err: unknown): err is BailoutToCSRError {\n if (typeof err !== 'object' || err === null || !('digest' in err)) {\n return false\n }\n\n return err.digest === BAILOUT_TO_CSR\n}\n","// 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/**\n * These are the minimum browser versions that we consider \"modern\" and thus compile for by default.\n * This list was generated using `pnpm browserslist \"baseline widely available\"` on 2025-10-01.\n */\nconst MODERN_BROWSERSLIST_TARGET = [\n 'chrome 111',\n 'edge 111',\n 'firefox 111',\n 'safari 16.4',\n]\n\nmodule.exports = MODERN_BROWSERSLIST_TARGET\n","export function createPromiseWithResolvers<T>(): PromiseWithResolvers<T> {\n // Shim of Stage 4 Promise.withResolvers proposal\n let resolve: (value: T | PromiseLike<T>) => void\n let reject: (reason: any) => void\n const promise = new Promise<T>((res, rej) => {\n resolve = res\n reject = rej\n })\n return { resolve: resolve!, reject: reject!, promise }\n}\n","import { parsePath } from './parse-path'\n\n/**\n * Adds the provided prefix to the given path. It first ensures that the path\n * is indeed starting with a slash.\n */\nexport function addPathPrefix(path: string, prefix?: string) {\n if (!path.startsWith('/') || !prefix) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n return `${prefix}${pathname}${query}${hash}`\n}\n","import { hexHash } from '../../hash'\n\nexport function computeCacheBustingSearchParam(\n prefetchHeader: '1' | '2' | '0' | undefined,\n segmentPrefetchHeader: string | string[] | undefined,\n stateTreeHeader: string | string[] | undefined,\n nextUrlHeader: string | string[] | undefined\n): string {\n if (\n (prefetchHeader === undefined || prefetchHeader === '0') &&\n segmentPrefetchHeader === undefined &&\n stateTreeHeader === undefined &&\n nextUrlHeader === undefined\n ) {\n return ''\n }\n return hexHash(\n [\n prefetchHeader || '0',\n segmentPrefetchHeader || '0',\n stateTreeHeader || '0',\n nextUrlHeader || '0',\n ].join(',')\n )\n}\n","// http://www.cse.yorku.ca/~oz/hash.html\n// More specifically, 32-bit hash via djbxor\n// (ref: https://gist.github.com/eplawless/52813b1d8ad9af510d85?permalink_comment_id=3367765#gistcomment-3367765)\n// This is due to number type differences between rust for turbopack to js number types,\n// where rust does not have easy way to repreesnt js's 53-bit float number type for the matching\n// overflow behavior. This is more `correct` in terms of having canonical hash across different runtime / implementation\n// as can gaurantee determinstic output from 32bit hash.\nexport function djb2Hash(str: string) {\n let hash = 5381\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = ((hash << 5) + hash + char) & 0xffffffff\n }\n return hash >>> 0\n}\n\nexport function hexHash(str: string) {\n return djb2Hash(str).toString(36).slice(0, 5)\n}\n","// This regex contains the bots that we need to do a blocking render for and can't safely stream the response\n// due to how they parse the DOM. For example, they might explicitly check for metadata in the `head` tag, so we can't stream metadata tags after the `head` was sent.\n// Note: The pattern [\\w-]+-Google captures all Google crawlers with \"-Google\" suffix (e.g., Mediapartners-Google, AdsBot-Google, Storebot-Google)\n// as well as crawlers starting with \"Google-\" (e.g., Google-PageRenderer, Google-InspectionTool)\nexport const HTML_LIMITED_BOT_UA_RE =\n /[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight/i\n","import { HTML_LIMITED_BOT_UA_RE } from './html-bots'\n\n// Bot crawler that will spin up a headless browser and execute JS.\n// Only the main Googlebot search crawler executes JavaScript, not other Google crawlers.\n// x-ref: https://developers.google.com/search/docs/crawling-indexing/google-common-crawlers\n// This regex specifically matches \"Googlebot\" but NOT \"Mediapartners-Google\", \"AdsBot-Google\", etc.\nconst HEADLESS_BROWSER_BOT_UA_RE = /Googlebot(?!-)|Googlebot$/i\n\nexport const HTML_LIMITED_BOT_UA_RE_STRING = HTML_LIMITED_BOT_UA_RE.source\n\nexport { HTML_LIMITED_BOT_UA_RE }\n\nfunction isDomBotUA(userAgent: string) {\n return HEADLESS_BROWSER_BOT_UA_RE.test(userAgent)\n}\n\nfunction isHtmlLimitedBotUA(userAgent: string) {\n return HTML_LIMITED_BOT_UA_RE.test(userAgent)\n}\n\nexport function isBot(userAgent: string): boolean {\n return isDomBotUA(userAgent) || isHtmlLimitedBotUA(userAgent)\n}\n\nexport function getBotType(userAgent: string): 'dom' | 'html' | undefined {\n if (isDomBotUA(userAgent)) {\n return 'dom'\n }\n if (isHtmlLimitedBotUA(userAgent)) {\n return 'html'\n }\n return undefined\n}\n","/**\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 */\nexport function parsePath(path: string) {\n const hashIndex = path.indexOf('#')\n const queryIndex = path.indexOf('?')\n const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex)\n\n if (hasQuery || hashIndex > -1) {\n return {\n pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),\n query: hasQuery\n ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined)\n : '',\n hash: hashIndex > -1 ? path.slice(hashIndex) : '',\n }\n }\n\n return { pathname: path, query: '', hash: '' }\n}\n","/**\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 */\nexport function removeTrailingSlash(route: string) {\n return route.replace(/\\/$/, '') || '/'\n}\n","// In output: export mode, the build id is added to the start of the HTML\n// document, directly after the doctype declaration. During a prefetch, the\n// client performs a range request to get the build id, so it can check whether\n// the target page belongs to the same build.\n//\n// The first 64 bytes of the document are requested. The exact number isn't\n// too important; it must be larger than the build id + doctype + closing and\n// ending comment markers, but it doesn't need to match the end of the\n// comment exactly.\n//\n// Build ids are 21 bytes long in the default implementation, though this\n// can be overridden in the Next.js config. For the purposes of this check,\n// it's OK to only match the start of the id, so we'll truncate it if exceeds\n// a certain length.\n\nconst DOCTYPE_PREFIX = '<!DOCTYPE html>' // 15 bytes\nconst MAX_BUILD_ID_LENGTH = 24\n\n// Request the first 64 bytes. The Range header is inclusive of the end value.\nexport const DOC_PREFETCH_RANGE_HEADER_VALUE = 'bytes=0-63'\n\nfunction escapeBuildId(buildId: string) {\n // If the build id is longer than the given limit, it's OK for our purposes\n // to only match the beginning.\n const truncated = buildId.slice(0, MAX_BUILD_ID_LENGTH)\n // Replace hyphens with underscores so it doesn't break the HTML comment.\n // (Unlikely, but if this did happen it would break the whole document.)\n return truncated.replace(/-/g, '_')\n}\n\nexport function insertBuildIdComment(originalHtml: string, buildId: string) {\n if (\n // Skip if the build id contains a closing comment marker.\n buildId.includes('-->') ||\n // React always inserts a doctype at the start of the document. Skip if it\n // isn't present. Shouldn't happen; suggests an issue elsewhere.\n !originalHtml.startsWith(DOCTYPE_PREFIX)\n ) {\n // Return the original HTML unchanged. This means the document will not\n // be prefetched.\n // TODO: The build id comment is currently only used during prefetches, but\n // if we eventually use this mechanism for regular navigations, we may need\n // to error during build if we fail to insert it for some reason.\n return originalHtml\n }\n // The comment must be inserted after the doctype.\n return originalHtml.replace(\n DOCTYPE_PREFIX,\n DOCTYPE_PREFIX + '<!--' + escapeBuildId(buildId) + '-->'\n )\n}\n\nexport function doesExportedHtmlMatchBuildId(\n partialHtmlDocument: string,\n buildId: string\n) {\n // Check whether the document starts with the expected buildId.\n return partialHtmlDocument.startsWith(\n DOCTYPE_PREFIX + '<!--' + escapeBuildId(buildId) + '-->'\n )\n}\n","import { PAGE_SEGMENT_KEY } from '../segment'\nimport type { Segment as FlightRouterStateSegment } from '../app-router-types'\n\n// TypeScript trick to simulate opaque types, like in Flow.\ntype Opaque<K, T> = T & { __brand: K }\n\nexport type SegmentRequestKeyPart = Opaque<'SegmentRequestKeyPart', string>\nexport type SegmentRequestKey = Opaque<'SegmentRequestKey', string>\nexport type SegmentCacheKeyPart = Opaque<'SegmentCacheKeyPart', string>\nexport type SegmentCacheKey = Opaque<'SegmentCacheKey', string>\n\nexport const ROOT_SEGMENT_REQUEST_KEY = '' as SegmentRequestKey\nexport const ROOT_SEGMENT_CACHE_KEY = '' as SegmentCacheKey\n\nexport function createSegmentRequestKeyPart(\n segment: FlightRouterStateSegment\n): SegmentRequestKeyPart {\n if (typeof segment === 'string') {\n if (segment.startsWith(PAGE_SEGMENT_KEY)) {\n // The Flight Router State type sometimes includes the search params in\n // the page segment. However, the Segment Cache tracks this as a separate\n // key. So, we strip the search params here, and then add them back when\n // the cache entry is turned back into a FlightRouterState. This is an\n // unfortunate consequence of the FlightRouteState being used both as a\n // transport type and as a cache key; we'll address this once more of the\n // Segment Cache implementation has settled.\n // TODO: We should hoist the search params out of the FlightRouterState\n // type entirely, This is our plan for dynamic route params, too.\n return PAGE_SEGMENT_KEY as SegmentRequestKeyPart\n }\n const safeName =\n // TODO: FlightRouterState encodes Not Found routes as \"/_not-found\".\n // But params typically don't include the leading slash. We should use\n // a different encoding to avoid this special case.\n segment === '/_not-found'\n ? '_not-found'\n : encodeToFilesystemAndURLSafeString(segment)\n // Since this is not a dynamic segment, it's fully encoded. It does not\n // need to be \"hydrated\" with a param value.\n return safeName as SegmentRequestKeyPart\n }\n\n const name = segment[0]\n const paramType = segment[2]\n const safeName = encodeToFilesystemAndURLSafeString(name)\n\n const encodedName = '$' + paramType + '$' + safeName\n return encodedName as SegmentRequestKeyPart\n}\n\nexport function appendSegmentRequestKeyPart(\n parentRequestKey: SegmentRequestKey,\n parallelRouteKey: string,\n childRequestKeyPart: SegmentRequestKeyPart\n): SegmentRequestKey {\n // Aside from being filesystem safe, segment keys are also designed so that\n // each segment and parallel route creates its own subdirectory. Roughly in\n // the same shape as the source app directory. This is mostly just for easier\n // debugging (you can open up the build folder and navigate the output); if\n // we wanted to do we could just use a flat structure.\n\n // Omit the parallel route key for children, since this is the most\n // common case. Saves some bytes (and it's what the app directory does).\n const slotKey =\n parallelRouteKey === 'children'\n ? childRequestKeyPart\n : `@${encodeToFilesystemAndURLSafeString(parallelRouteKey)}/${childRequestKeyPart}`\n return (parentRequestKey + '/' + slotKey) as SegmentRequestKey\n}\n\nexport function createSegmentCacheKeyPart(\n requestKeyPart: SegmentRequestKeyPart,\n segment: FlightRouterStateSegment\n): SegmentCacheKeyPart {\n if (typeof segment === 'string') {\n return requestKeyPart as any as SegmentCacheKeyPart\n }\n const paramValue = segment[1]\n const safeValue = encodeToFilesystemAndURLSafeString(paramValue)\n return (requestKeyPart + '$' + safeValue) as SegmentCacheKeyPart\n}\n\nexport function appendSegmentCacheKeyPart(\n parentSegmentKey: SegmentCacheKey,\n parallelRouteKey: string,\n childCacheKeyPart: SegmentCacheKeyPart\n): SegmentCacheKey {\n const slotKey =\n parallelRouteKey === 'children'\n ? childCacheKeyPart\n : `@${encodeToFilesystemAndURLSafeString(parallelRouteKey)}/${childCacheKeyPart}`\n return (parentSegmentKey + '/' + slotKey) as SegmentCacheKey\n}\n\n// Define a regex pattern to match the most common characters found in a route\n// param. It excludes anything that might not be cross-platform filesystem\n// compatible, like |. It does not need to be precise because the fallback is to\n// just base64url-encode the whole parameter, which is fine; we just don't do it\n// by default for compactness, and for easier debugging.\nconst simpleParamValueRegex = /^[a-zA-Z0-9\\-_@]+$/\n\nfunction encodeToFilesystemAndURLSafeString(value: string) {\n if (simpleParamValueRegex.test(value)) {\n return value\n }\n // If there are any unsafe characters, base64url-encode the entire value.\n // We also add a ! prefix so it doesn't collide with the simple case.\n const base64url = btoa(value)\n .replace(/\\+/g, '-') // Replace '+' with '-'\n .replace(/\\//g, '_') // Replace '/' with '_'\n .replace(/=+$/, '') // Remove trailing '='\n return '!' + base64url\n}\n\nexport function convertSegmentPathToStaticExportFilename(\n segmentPath: string\n): string {\n return `__next${segmentPath.replace(/\\//g, '.')}.txt`\n}\n","import type { FlightRouterState, Segment } from './app-router-types'\n\nexport function getSegmentValue(segment: Segment) {\n return Array.isArray(segment) ? segment[1] : segment\n}\n\nexport function isGroupSegment(segment: string) {\n // Use array[0] for performant purpose\n return segment[0] === '(' && segment.endsWith(')')\n}\n\nexport function isParallelRouteSegment(segment: string) {\n return segment.startsWith('@') && segment !== '@children'\n}\n\nexport function addSearchParamsIfPageSegment(\n segment: Segment,\n searchParams: Record<string, string | string[] | undefined>\n) {\n const isPageSegment = segment.includes(PAGE_SEGMENT_KEY)\n\n if (isPageSegment) {\n const stringifiedQuery = JSON.stringify(searchParams)\n return stringifiedQuery !== '{}'\n ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery\n : PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n\nexport function computeSelectedLayoutSegment(\n segments: string[] | null,\n parallelRouteKey: string\n): string | null {\n if (!segments || segments.length === 0) {\n return null\n }\n\n // For 'children', use first segment; for other parallel routes, use last segment\n const rawSegment =\n parallelRouteKey === 'children'\n ? segments[0]\n : segments[segments.length - 1]\n\n // If the default slot is showing, return null since it's not technically \"selected\" (it's a fallback)\n // Returning an internal value like `__DEFAULT__` would be confusing\n return rawSegment === DEFAULT_SEGMENT_KEY ? null : rawSegment\n}\n\n/** Get the canonical parameters from the current level to the leaf node. */\nexport function getSelectedLayoutSegmentPath(\n tree: FlightRouterState,\n parallelRouteKey: string,\n first = true,\n segmentPath: string[] = []\n): string[] {\n let node: FlightRouterState\n if (first) {\n // Use the provided parallel route key on the first parallel route\n node = tree[1][parallelRouteKey]\n } else {\n // After first parallel route prefer children, if there's no children pick the first parallel route.\n const parallelRoutes = tree[1]\n node = parallelRoutes.children ?? Object.values(parallelRoutes)[0]\n }\n\n if (!node) return segmentPath\n const segment = node[0]\n\n let segmentValue = getSegmentValue(segment)\n\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) {\n return segmentPath\n }\n\n segmentPath.push(segmentValue)\n\n return getSelectedLayoutSegmentPath(\n node,\n parallelRouteKey,\n false,\n segmentPath\n )\n}\n\nexport const PAGE_SEGMENT_KEY = '__PAGE__'\nexport const DEFAULT_SEGMENT_KEY = '__DEFAULT__'\n","/**\n * @license React\n * react-dom.react-server.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"next/dist/compiled/react-experimental\");\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(\n \"Invalid form element. requestFormReset must be passed a form that was rendered by React.\"\n );\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n};\nif (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)\n throw Error(\n 'The \"react\" package in this environment is not configured correctly. The \"react-server\" condition must be enabled in any environment that runs React Server Components.'\n );\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0\n });\n } else Internals.d.m(href);\n};\nexports.version = \"19.3.0-experimental-2bcbf254-20251020\";\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-dom.react-server.production.js');\n} else {\n module.exports = require('./cjs/react-dom.react-server.development.js');\n}\n","/**\n * @license React\n * react-jsx-dev-runtime.react-server.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"next/dist/compiled/react-experimental\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nif (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)\n throw Error(\n 'The \"react\" package in this environment is not configured correctly. The \"react-server\" condition must be enabled in any environment that runs React Server Components.'\n );\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxDEV = void 0;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.react-server.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"next/dist/compiled/react-experimental\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nif (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)\n throw Error(\n 'The \"react\" package in this environment is not configured correctly. The \"react-server\" condition must be enabled in any environment that runs React Server Components.'\n );\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxDEV = void 0;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react.react-server.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar TaintRegistryObjects$1 = new WeakMap(),\n TaintRegistryValues$1 = new Map(),\n TaintRegistryByteLengths$1 = new Set(),\n TaintRegistryPendingRequests$1 = new Set(),\n ReactSharedInternals = {\n H: null,\n A: null,\n TaintRegistryObjects: TaintRegistryObjects$1,\n TaintRegistryValues: TaintRegistryValues$1,\n TaintRegistryByteLengths: TaintRegistryByteLengths$1,\n TaintRegistryPendingRequests: TaintRegistryPendingRequests$1\n };\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nvar isArrayImpl = Array.isArray;\nfunction noop() {}\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_POSTPONE_TYPE = Symbol.for(\"react.postpone\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty,\n assign = Object.assign;\nfunction ReactElement(type, key, props) {\n var refProp = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== refProp ? refProp : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(oldElement.type, newKey, oldElement.props);\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n formatProdErrorMessage(\n 31,\n \"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array\n )\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result;\n ctor = ctor();\n ctor.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1), (payload._result = moduleObject);\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2), (payload._result = error);\n }\n );\n -1 === payload._status && ((payload._status = 0), (payload._result = ctor));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nfunction createCacheRoot() {\n return new WeakMap();\n}\nfunction createCacheNode() {\n return { s: 0, v: void 0, o: null, p: null };\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n },\n getPrototypeOf = Object.getPrototypeOf,\n TaintRegistryObjects = ReactSharedInternals.TaintRegistryObjects,\n TaintRegistryValues = ReactSharedInternals.TaintRegistryValues,\n TaintRegistryByteLengths = ReactSharedInternals.TaintRegistryByteLengths,\n TaintRegistryPendingRequests =\n ReactSharedInternals.TaintRegistryPendingRequests,\n TypedArrayConstructor = getPrototypeOf(Uint32Array.prototype).constructor;\nfunction cleanup(entryValue) {\n var entry = TaintRegistryValues.get(entryValue);\n void 0 !== entry &&\n (TaintRegistryPendingRequests.forEach(function (requestQueue) {\n requestQueue.push(entryValue);\n entry.count++;\n }),\n 1 === entry.count ? TaintRegistryValues.delete(entryValue) : entry.count--);\n}\nvar finalizationRegistry =\n \"function\" === typeof FinalizationRegistry\n ? new FinalizationRegistry(cleanup)\n : null,\n Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children)) throw Error(formatProdErrorMessage(143));\n return children;\n }\n };\nexports.Activity = REACT_ACTIVITY_TYPE;\nexports.Children = Children;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.ViewTransition = REACT_VIEW_TRANSITION_TYPE;\nexports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.cache = function (fn) {\n return function () {\n var dispatcher = ReactSharedInternals.A;\n if (!dispatcher) return fn.apply(null, arguments);\n var fnMap = dispatcher.getCacheForType(createCacheRoot);\n dispatcher = fnMap.get(fn);\n void 0 === dispatcher &&\n ((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher));\n fnMap = 0;\n for (var l = arguments.length; fnMap < l; fnMap++) {\n var arg = arguments[fnMap];\n if (\n \"function\" === typeof arg ||\n (\"object\" === typeof arg && null !== arg)\n ) {\n var objectCache = dispatcher.o;\n null === objectCache && (dispatcher.o = objectCache = new WeakMap());\n dispatcher = objectCache.get(arg);\n void 0 === dispatcher &&\n ((dispatcher = createCacheNode()), objectCache.set(arg, dispatcher));\n } else\n (objectCache = dispatcher.p),\n null === objectCache && (dispatcher.p = objectCache = new Map()),\n (dispatcher = objectCache.get(arg)),\n void 0 === dispatcher &&\n ((dispatcher = createCacheNode()),\n objectCache.set(arg, dispatcher));\n }\n if (1 === dispatcher.s) return dispatcher.v;\n if (2 === dispatcher.s) throw dispatcher.v;\n try {\n var result = fn.apply(null, arguments);\n fnMap = dispatcher;\n fnMap.s = 1;\n return (fnMap.v = result);\n } catch (error) {\n throw ((result = dispatcher), (result.s = 2), (result.v = error), error);\n }\n };\n};\nexports.cacheSignal = function () {\n var dispatcher = ReactSharedInternals.A;\n return dispatcher ? dispatcher.cacheSignal() : null;\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(formatProdErrorMessage(267, element));\n var props = assign({}, element.props),\n key = element.key;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, props);\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.experimental_taintObjectReference = function (message, object) {\n message =\n \"\" +\n (message ||\n \"A tainted value was attempted to be serialized to a Client Component or Action closure. This would leak it to the client.\");\n if (\"string\" === typeof object || \"bigint\" === typeof object)\n throw Error(formatProdErrorMessage(496));\n if (\n null === object ||\n (\"object\" !== typeof object && \"function\" !== typeof object)\n )\n throw Error(formatProdErrorMessage(497));\n TaintRegistryObjects.set(object, message);\n};\nexports.experimental_taintUniqueValue = function (message, lifetime, value) {\n message =\n \"\" +\n (message ||\n \"A tainted value was attempted to be serialized to a Client Component or Action closure. This would leak it to the client.\");\n if (\n null === lifetime ||\n (\"object\" !== typeof lifetime && \"function\" !== typeof lifetime)\n )\n throw Error(formatProdErrorMessage(493));\n if (\"string\" !== typeof value && \"bigint\" !== typeof value)\n if (value instanceof TypedArrayConstructor || value instanceof DataView)\n TaintRegistryByteLengths.add(value.byteLength),\n (value = String.fromCharCode.apply(\n String,\n new Uint8Array(value.buffer, value.byteOffset, value.byteLength)\n ));\n else {\n message = null === value ? \"null\" : typeof value;\n if (\"object\" === message || \"function\" === message)\n throw Error(formatProdErrorMessage(494));\n throw Error(formatProdErrorMessage(495, message));\n }\n var existingEntry = TaintRegistryValues.get(value);\n void 0 === existingEntry\n ? TaintRegistryValues.set(value, { message: message, count: 1 })\n : existingEntry.count++;\n null !== finalizationRegistry &&\n finalizationRegistry.register(lifetime, value);\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n currentTransition.types =\n null !== prevTransition ? prevTransition.types : null;\n currentTransition.gesture = null;\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n returnValue.then(noop, reportGlobalError);\n } catch (error) {\n reportGlobalError(error);\n } finally {\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n};\nexports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;\nexports.unstable_getCacheForType = function (resourceType) {\n var dispatcher = ReactSharedInternals.A;\n return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();\n};\nexports.unstable_postpone = function (reason) {\n reason = Error(reason);\n reason.$$typeof = REACT_POSTPONE_TYPE;\n throw reason;\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useDebugValue = function () {};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.version = \"19.3.0-experimental-2bcbf254-20251020\";\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-dev-runtime.react-server.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-dev-runtime.react-server.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.react-server.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.react-server.development.js');\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.react-server.production.js');\n} else {\n module.exports = require('./cjs/react.react-server.development.js');\n}\n","/**\n * @license React\n * react-server-dom-webpack-server.node.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar stream = require(\"stream\"),\n util = require(\"util\");\nrequire(\"crypto\");\nvar async_hooks = require(\"async_hooks\"),\n ReactDOM = require(\"react-dom\"),\n React = require(\"react\"),\n REACT_LEGACY_ELEMENT_TYPE = Symbol.for(\"react.element\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_MEMO_CACHE_SENTINEL = Symbol.for(\"react.memo_cache_sentinel\"),\n REACT_POSTPONE_TYPE = Symbol.for(\"react.postpone\"),\n REACT_VIEW_TRANSITION_TYPE = Symbol.for(\"react.view_transition\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ASYNC_ITERATOR = Symbol.asyncIterator,\n scheduleMicrotask = queueMicrotask,\n currentView = null,\n writtenBytes = 0,\n destinationHasCapacity = !0;\nfunction writeToDestination(destination, view) {\n destination = destination.write(view);\n destinationHasCapacity = destinationHasCapacity && destination;\n}\nfunction writeChunkAndReturn(destination, chunk) {\n if (\"string\" === typeof chunk) {\n if (0 !== chunk.length)\n if (4096 < 3 * chunk.length)\n 0 < writtenBytes &&\n (writeToDestination(\n destination,\n currentView.subarray(0, writtenBytes)\n ),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0)),\n writeToDestination(destination, chunk);\n else {\n var target = currentView;\n 0 < writtenBytes && (target = currentView.subarray(writtenBytes));\n target = textEncoder.encodeInto(chunk, target);\n var read = target.read;\n writtenBytes += target.written;\n read < chunk.length &&\n (writeToDestination(\n destination,\n currentView.subarray(0, writtenBytes)\n ),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = textEncoder.encodeInto(\n chunk.slice(read),\n currentView\n ).written));\n 4096 === writtenBytes &&\n (writeToDestination(destination, currentView),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0));\n }\n } else\n 0 !== chunk.byteLength &&\n (4096 < chunk.byteLength\n ? (0 < writtenBytes &&\n (writeToDestination(\n destination,\n currentView.subarray(0, writtenBytes)\n ),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0)),\n writeToDestination(destination, chunk))\n : ((target = currentView.length - writtenBytes),\n target < chunk.byteLength &&\n (0 === target\n ? writeToDestination(destination, currentView)\n : (currentView.set(chunk.subarray(0, target), writtenBytes),\n (writtenBytes += target),\n writeToDestination(destination, currentView),\n (chunk = chunk.subarray(target))),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0)),\n currentView.set(chunk, writtenBytes),\n (writtenBytes += chunk.byteLength),\n 4096 === writtenBytes &&\n (writeToDestination(destination, currentView),\n (currentView = new Uint8Array(4096)),\n (writtenBytes = 0))));\n return destinationHasCapacity;\n}\nvar textEncoder = new util.TextEncoder();\nfunction byteLengthOfChunk(chunk) {\n return \"string\" === typeof chunk\n ? Buffer.byteLength(chunk, \"utf8\")\n : chunk.byteLength;\n}\nvar CLIENT_REFERENCE_TAG$1 = Symbol.for(\"react.client.reference\"),\n SERVER_REFERENCE_TAG = Symbol.for(\"react.server.reference\");\nfunction registerClientReferenceImpl(proxyImplementation, id, async) {\n return Object.defineProperties(proxyImplementation, {\n $$typeof: { value: CLIENT_REFERENCE_TAG$1 },\n $$id: { value: id },\n $$async: { value: async }\n });\n}\nvar FunctionBind = Function.prototype.bind,\n ArraySlice = Array.prototype.slice;\nfunction bind() {\n var newFn = FunctionBind.apply(this, arguments);\n if (this.$$typeof === SERVER_REFERENCE_TAG) {\n var args = ArraySlice.call(arguments, 1),\n $$typeof = { value: SERVER_REFERENCE_TAG },\n $$id = { value: this.$$id };\n args = { value: this.$$bound ? this.$$bound.concat(args) : args };\n return Object.defineProperties(newFn, {\n $$typeof: $$typeof,\n $$id: $$id,\n $$bound: args,\n bind: { value: bind, configurable: !0 }\n });\n }\n return newFn;\n}\nvar PROMISE_PROTOTYPE = Promise.prototype,\n deepProxyHandlers = {\n get: function (target, name) {\n switch (name) {\n case \"$$typeof\":\n return target.$$typeof;\n case \"$$id\":\n return target.$$id;\n case \"$$async\":\n return target.$$async;\n case \"name\":\n return target.name;\n case \"displayName\":\n return;\n case \"defaultProps\":\n return;\n case \"_debugInfo\":\n return;\n case \"toJSON\":\n return;\n case Symbol.toPrimitive:\n return Object.prototype[Symbol.toPrimitive];\n case Symbol.toStringTag:\n return Object.prototype[Symbol.toStringTag];\n case \"Provider\":\n throw Error(\n \"Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider.\"\n );\n case \"then\":\n throw Error(\n \"Cannot await or return from a thenable. You cannot await a client module from a server component.\"\n );\n }\n throw Error(\n \"Cannot access \" +\n (String(target.name) + \".\" + String(name)) +\n \" on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.\"\n );\n },\n set: function () {\n throw Error(\"Cannot assign to a client module from a server module.\");\n }\n };\nfunction getReference(target, name) {\n switch (name) {\n case \"$$typeof\":\n return target.$$typeof;\n case \"$$id\":\n return target.$$id;\n case \"$$async\":\n return target.$$async;\n case \"name\":\n return target.name;\n case \"defaultProps\":\n return;\n case \"_debugInfo\":\n return;\n case \"toJSON\":\n return;\n case Symbol.toPrimitive:\n return Object.prototype[Symbol.toPrimitive];\n case Symbol.toStringTag:\n return Object.prototype[Symbol.toStringTag];\n case \"__esModule\":\n var moduleId = target.$$id;\n target.default = registerClientReferenceImpl(\n function () {\n throw Error(\n \"Attempted to call the default export of \" +\n moduleId +\n \" from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.\"\n );\n },\n target.$$id + \"#\",\n target.$$async\n );\n return !0;\n case \"then\":\n if (target.then) return target.then;\n if (target.$$async) return;\n var clientReference = registerClientReferenceImpl({}, target.$$id, !0),\n proxy = new Proxy(clientReference, proxyHandlers$1);\n target.status = \"fulfilled\";\n target.value = proxy;\n return (target.then = registerClientReferenceImpl(\n function (resolve) {\n return Promise.resolve(resolve(proxy));\n },\n target.$$id + \"#then\",\n !1\n ));\n }\n if (\"symbol\" === typeof name)\n throw Error(\n \"Cannot read Symbol exports. Only named exports are supported on a client module imported on the server.\"\n );\n clientReference = target[name];\n clientReference ||\n ((clientReference = registerClientReferenceImpl(\n function () {\n throw Error(\n \"Attempted to call \" +\n String(name) +\n \"() from the server but \" +\n String(name) +\n \" is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.\"\n );\n },\n target.$$id + \"#\" + name,\n target.$$async\n )),\n Object.defineProperty(clientReference, \"name\", { value: name }),\n (clientReference = target[name] =\n new Proxy(clientReference, deepProxyHandlers)));\n return clientReference;\n}\nvar proxyHandlers$1 = {\n get: function (target, name) {\n return getReference(target, name);\n },\n getOwnPropertyDescriptor: function (target, name) {\n var descriptor = Object.getOwnPropertyDescriptor(target, name);\n descriptor ||\n ((descriptor = {\n value: getReference(target, name),\n writable: !1,\n configurable: !1,\n enumerable: !1\n }),\n Object.defineProperty(target, name, descriptor));\n return descriptor;\n },\n getPrototypeOf: function () {\n return PROMISE_PROTOTYPE;\n },\n set: function () {\n throw Error(\"Cannot assign to a client module from a server module.\");\n }\n },\n ReactDOMSharedInternals =\n ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n previousDispatcher = ReactDOMSharedInternals.d;\nReactDOMSharedInternals.d = {\n f: previousDispatcher.f,\n r: previousDispatcher.r,\n D: prefetchDNS,\n C: preconnect,\n L: preload,\n m: preloadModule$1,\n X: preinitScript,\n S: preinitStyle,\n M: preinitModuleScript\n};\nfunction prefetchDNS(href) {\n if (\"string\" === typeof href && href) {\n var request = resolveRequest();\n if (request) {\n var hints = request.hints,\n key = \"D|\" + href;\n hints.has(key) || (hints.add(key), emitHint(request, \"D\", href));\n } else previousDispatcher.D(href);\n }\n}\nfunction preconnect(href, crossOrigin) {\n if (\"string\" === typeof href) {\n var request = resolveRequest();\n if (request) {\n var hints = request.hints,\n key = \"C|\" + (null == crossOrigin ? \"null\" : crossOrigin) + \"|\" + href;\n hints.has(key) ||\n (hints.add(key),\n \"string\" === typeof crossOrigin\n ? emitHint(request, \"C\", [href, crossOrigin])\n : emitHint(request, \"C\", href));\n } else previousDispatcher.C(href, crossOrigin);\n }\n}\nfunction preload(href, as, options) {\n if (\"string\" === typeof href) {\n var request = resolveRequest();\n if (request) {\n var hints = request.hints,\n key = \"L\";\n if (\"image\" === as && options) {\n var imageSrcSet = options.imageSrcSet,\n imageSizes = options.imageSizes,\n uniquePart = \"\";\n \"string\" === typeof imageSrcSet && \"\" !== imageSrcSet\n ? ((uniquePart += \"[\" + imageSrcSet + \"]\"),\n \"string\" === typeof imageSizes &&\n (uniquePart += \"[\" + imageSizes + \"]\"))\n : (uniquePart += \"[][]\" + href);\n key += \"[image]\" + uniquePart;\n } else key += \"[\" + as + \"]\" + href;\n hints.has(key) ||\n (hints.add(key),\n (options = trimOptions(options))\n ? emitHint(request, \"L\", [href, as, options])\n : emitHint(request, \"L\", [href, as]));\n } else previousDispatcher.L(href, as, options);\n }\n}\nfunction preloadModule$1(href, options) {\n if (\"string\" === typeof href) {\n var request = resolveRequest();\n if (request) {\n var hints = request.hints,\n key = \"m|\" + href;\n if (hints.has(key)) return;\n hints.add(key);\n return (options = trimOptions(options))\n ? emitHint(request, \"m\", [href, options])\n : emitHint(request, \"m\", href);\n }\n previousDispatcher.m(href, options);\n }\n}\nfunction preinitStyle(href, precedence, options) {\n if (\"string\" === typeof href) {\n var request = resolveRequest();\n if (request) {\n var hints = request.hints,\n key = \"S|\" + href;\n if (hints.has(key)) return;\n hints.add(key);\n return (options = trimOptions(options))\n ? emitHint(request, \"S\", [\n href,\n \"string\" === typeof precedence ? precedence : 0,\n options\n ])\n : \"string\" === typeof precedence\n ? emitHint(request, \"S\", [href, precedence])\n : emitHint(request, \"S\", href);\n }\n previousDispatcher.S(href, precedence, options);\n }\n}\nfunction preinitScript(src, options) {\n if (\"string\" === typeof src) {\n var request = resolveRequest();\n if (request) {\n var hints = request.hints,\n key = \"X|\" + src;\n if (hints.has(key)) return;\n hints.add(key);\n return (options = trimOptions(options))\n ? emitHint(request, \"X\", [src, options])\n : emitHint(request, \"X\", src);\n }\n previousDispatcher.X(src, options);\n }\n}\nfunction preinitModuleScript(src, options) {\n if (\"string\" === typeof src) {\n var request = resolveRequest();\n if (request) {\n var hints = request.hints,\n key = \"M|\" + src;\n if (hints.has(key)) return;\n hints.add(key);\n return (options = trimOptions(options))\n ? emitHint(request, \"M\", [src, options])\n : emitHint(request, \"M\", src);\n }\n previousDispatcher.M(src, options);\n }\n}\nfunction trimOptions(options) {\n if (null == options) return null;\n var hasProperties = !1,\n trimmed = {},\n key;\n for (key in options)\n null != options[key] &&\n ((hasProperties = !0), (trimmed[key] = options[key]));\n return hasProperties ? trimmed : null;\n}\nfunction getChildFormatContext(parentContext, type, props) {\n switch (type) {\n case \"img\":\n type = props.src;\n var srcSet = props.srcSet;\n if (\n !(\n \"lazy\" === props.loading ||\n (!type && !srcSet) ||\n (\"string\" !== typeof type && null != type) ||\n (\"string\" !== typeof srcSet && null != srcSet) ||\n \"low\" === props.fetchPriority ||\n parentContext & 3\n ) &&\n (\"string\" !== typeof type ||\n \":\" !== type[4] ||\n (\"d\" !== type[0] && \"D\" !== type[0]) ||\n (\"a\" !== type[1] && \"A\" !== type[1]) ||\n (\"t\" !== type[2] && \"T\" !== type[2]) ||\n (\"a\" !== type[3] && \"A\" !== type[3])) &&\n (\"string\" !== typeof srcSet ||\n \":\" !== srcSet[4] ||\n (\"d\" !== srcSet[0] && \"D\" !== srcSet[0]) ||\n (\"a\" !== srcSet[1] && \"A\" !== srcSet[1]) ||\n (\"t\" !== srcSet[2] && \"T\" !== srcSet[2]) ||\n (\"a\" !== srcSet[3] && \"A\" !== srcSet[3]))\n ) {\n var sizes = \"string\" === typeof props.sizes ? props.sizes : void 0;\n var input = props.crossOrigin;\n preload(type || \"\", \"image\", {\n imageSrcSet: srcSet,\n imageSizes: sizes,\n crossOrigin:\n \"string\" === typeof input\n ? \"use-credentials\" === input\n ? input\n : \"\"\n : void 0,\n integrity: props.integrity,\n type: props.type,\n fetchPriority: props.fetchPriority,\n referrerPolicy: props.referrerPolicy\n });\n }\n return parentContext;\n case \"link\":\n type = props.rel;\n srcSet = props.href;\n if (\n !(\n parentContext & 1 ||\n null != props.itemProp ||\n \"string\" !== typeof type ||\n \"string\" !== typeof srcSet ||\n \"\" === srcSet\n )\n )\n switch (type) {\n case \"preload\":\n preload(srcSet, props.as, {\n crossOrigin: props.crossOrigin,\n integrity: props.integrity,\n nonce: props.nonce,\n type: props.type,\n fetchPriority: props.fetchPriority,\n referrerPolicy: props.referrerPolicy,\n imageSrcSet: props.imageSrcSet,\n imageSizes: props.imageSizes,\n media: props.media\n });\n break;\n case \"modulepreload\":\n preloadModule$1(srcSet, {\n as: props.as,\n crossOrigin: props.crossOrigin,\n integrity: props.integrity,\n nonce: props.nonce\n });\n break;\n case \"stylesheet\":\n preload(srcSet, \"style\", {\n crossOrigin: props.crossOrigin,\n integrity: props.integrity,\n nonce: props.nonce,\n type: props.type,\n fetchPriority: props.fetchPriority,\n referrerPolicy: props.referrerPolicy,\n media: props.media\n });\n }\n return parentContext;\n case \"picture\":\n return parentContext | 2;\n case \"noscript\":\n return parentContext | 1;\n default:\n return parentContext;\n }\n}\nvar requestStorage = new async_hooks.AsyncLocalStorage(),\n TEMPORARY_REFERENCE_TAG = Symbol.for(\"react.temporary.reference\"),\n proxyHandlers = {\n get: function (target, name) {\n switch (name) {\n case \"$$typeof\":\n return target.$$typeof;\n case \"name\":\n return;\n case \"displayName\":\n return;\n case \"defaultProps\":\n return;\n case \"_debugInfo\":\n return;\n case \"toJSON\":\n return;\n case Symbol.toPrimitive:\n return Object.prototype[Symbol.toPrimitive];\n case Symbol.toStringTag:\n return Object.prototype[Symbol.toStringTag];\n case \"Provider\":\n throw Error(\n \"Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider.\"\n );\n case \"then\":\n return;\n }\n throw Error(\n \"Cannot access \" +\n String(name) +\n \" on the server. You cannot dot into a temporary client reference from a server component. You can only pass the value through to the client.\"\n );\n },\n set: function () {\n throw Error(\n \"Cannot assign to a temporary client reference from a server module.\"\n );\n }\n };\nfunction createTemporaryReference(temporaryReferences, id) {\n var reference = Object.defineProperties(\n function () {\n throw Error(\n \"Attempted to call a temporary Client Reference from the server but it is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.\"\n );\n },\n { $$typeof: { value: TEMPORARY_REFERENCE_TAG } }\n );\n reference = new Proxy(reference, proxyHandlers);\n temporaryReferences.set(reference, id);\n return reference;\n}\nfunction noop() {}\nvar SuspenseException = Error(\n \"Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\\n\\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`.\"\n);\nfunction trackUsedThenable(thenableState, thenable, index) {\n index = thenableState[index];\n void 0 === index\n ? thenableState.push(thenable)\n : index !== thenable && (thenable.then(noop, noop), (thenable = index));\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n \"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenableState = thenable),\n (thenableState.status = \"pending\"),\n thenableState.then(\n function (fulfilledValue) {\n if (\"pending\" === thenable.status) {\n var fulfilledThenable = thenable;\n fulfilledThenable.status = \"fulfilled\";\n fulfilledThenable.value = fulfilledValue;\n }\n },\n function (error) {\n if (\"pending\" === thenable.status) {\n var rejectedThenable = thenable;\n rejectedThenable.status = \"rejected\";\n rejectedThenable.reason = error;\n }\n }\n ));\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n suspendedThenable = thenable;\n throw SuspenseException;\n }\n}\nvar suspendedThenable = null;\nfunction getSuspendedThenable() {\n if (null === suspendedThenable)\n throw Error(\n \"Expected a suspended thenable. This is a bug in React. Please file an issue.\"\n );\n var thenable = suspendedThenable;\n suspendedThenable = null;\n return thenable;\n}\nvar currentRequest$1 = null,\n thenableIndexCounter = 0,\n thenableState = null;\nfunction getThenableStateAfterSuspending() {\n var state = thenableState || [];\n thenableState = null;\n return state;\n}\nvar HooksDispatcher = {\n readContext: unsupportedContext,\n use: use,\n useCallback: function (callback) {\n return callback;\n },\n useContext: unsupportedContext,\n useEffect: unsupportedHook,\n useImperativeHandle: unsupportedHook,\n useLayoutEffect: unsupportedHook,\n useInsertionEffect: unsupportedHook,\n useMemo: function (nextCreate) {\n return nextCreate();\n },\n useReducer: unsupportedHook,\n useRef: unsupportedHook,\n useState: unsupportedHook,\n useDebugValue: function () {},\n useDeferredValue: unsupportedHook,\n useTransition: unsupportedHook,\n useSyncExternalStore: unsupportedHook,\n useId: useId,\n useHostTransitionStatus: unsupportedHook,\n useFormState: unsupportedHook,\n useActionState: unsupportedHook,\n useOptimistic: unsupportedHook,\n useMemoCache: function (size) {\n for (var data = Array(size), i = 0; i < size; i++)\n data[i] = REACT_MEMO_CACHE_SENTINEL;\n return data;\n },\n useCacheRefresh: function () {\n return unsupportedRefresh;\n }\n};\nHooksDispatcher.useEffectEvent = unsupportedHook;\nfunction unsupportedHook() {\n throw Error(\"This Hook is not supported in Server Components.\");\n}\nfunction unsupportedRefresh() {\n throw Error(\"Refreshing the cache is not supported in Server Components.\");\n}\nfunction unsupportedContext() {\n throw Error(\"Cannot read a Client Context from a Server Component.\");\n}\nfunction useId() {\n if (null === currentRequest$1)\n throw Error(\"useId can only be used while React is rendering\");\n var id = currentRequest$1.identifierCount++;\n return \"_\" + currentRequest$1.identifierPrefix + \"S_\" + id.toString(32) + \"_\";\n}\nfunction use(usable) {\n if (\n (null !== usable && \"object\" === typeof usable) ||\n \"function\" === typeof usable\n ) {\n if (\"function\" === typeof usable.then) {\n var index = thenableIndexCounter;\n thenableIndexCounter += 1;\n null === thenableState && (thenableState = []);\n return trackUsedThenable(thenableState, usable, index);\n }\n usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext();\n }\n if (usable.$$typeof === CLIENT_REFERENCE_TAG$1) {\n if (null != usable.value && usable.value.$$typeof === REACT_CONTEXT_TYPE)\n throw Error(\"Cannot read a Client Context from a Server Component.\");\n throw Error(\"Cannot use() an already resolved Client Reference.\");\n }\n throw Error(\"An unsupported type was passed to use(): \" + String(usable));\n}\nvar DefaultAsyncDispatcher = {\n getCacheForType: function (resourceType) {\n var JSCompiler_inline_result = (JSCompiler_inline_result =\n resolveRequest())\n ? JSCompiler_inline_result.cache\n : new Map();\n var entry = JSCompiler_inline_result.get(resourceType);\n void 0 === entry &&\n ((entry = resourceType()),\n JSCompiler_inline_result.set(resourceType, entry));\n return entry;\n },\n cacheSignal: function () {\n var request = resolveRequest();\n return request ? request.cacheController.signal : null;\n }\n },\n ReactSharedInternalsServer =\n React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nif (!ReactSharedInternalsServer)\n throw Error(\n 'The \"react\" package in this environment is not configured correctly. The \"react-server\" condition must be enabled in any environment that runs React Server Components.'\n );\nvar isArrayImpl = Array.isArray,\n getPrototypeOf = Object.getPrototypeOf;\nfunction objectName(object) {\n object = Object.prototype.toString.call(object);\n return object.slice(8, object.length - 1);\n}\nfunction describeValueForErrorMessage(value) {\n switch (typeof value) {\n case \"string\":\n return JSON.stringify(\n 10 >= value.length ? value : value.slice(0, 10) + \"...\"\n );\n case \"object\":\n if (isArrayImpl(value)) return \"[...]\";\n if (null !== value && value.$$typeof === CLIENT_REFERENCE_TAG)\n return \"client\";\n value = objectName(value);\n return \"Object\" === value ? \"{...}\" : value;\n case \"function\":\n return value.$$typeof === CLIENT_REFERENCE_TAG\n ? \"client\"\n : (value = value.displayName || value.name)\n ? \"function \" + value\n : \"function\";\n default:\n return String(value);\n }\n}\nfunction describeElementType(type) {\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_VIEW_TRANSITION_TYPE:\n return \"ViewTransition\";\n }\n if (\"object\" === typeof type)\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeElementType(type.render);\n case REACT_MEMO_TYPE:\n return describeElementType(type.type);\n case REACT_LAZY_TYPE:\n var payload = type._payload;\n type = type._init;\n try {\n return describeElementType(type(payload));\n } catch (x) {}\n }\n return \"\";\n}\nvar CLIENT_REFERENCE_TAG = Symbol.for(\"react.client.reference\");\nfunction describeObjectForErrorMessage(objectOrArray, expandedName) {\n var objKind = objectName(objectOrArray);\n if (\"Object\" !== objKind && \"Array\" !== objKind) return objKind;\n objKind = -1;\n var length = 0;\n if (isArrayImpl(objectOrArray)) {\n var str = \"[\";\n for (var i = 0; i < objectOrArray.length; i++) {\n 0 < i && (str += \", \");\n var value = objectOrArray[i];\n value =\n \"object\" === typeof value && null !== value\n ? describeObjectForErrorMessage(value)\n : describeValueForErrorMessage(value);\n \"\" + i === expandedName\n ? ((objKind = str.length), (length = value.length), (str += value))\n : (str =\n 10 > value.length && 40 > str.length + value.length\n ? str + value\n : str + \"...\");\n }\n str += \"]\";\n } else if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE)\n str = \"<\" + describeElementType(objectOrArray.type) + \"/>\";\n else {\n if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) return \"client\";\n str = \"{\";\n i = Object.keys(objectOrArray);\n for (value = 0; value < i.length; value++) {\n 0 < value && (str += \", \");\n var name = i[value],\n encodedKey = JSON.stringify(name);\n str += ('\"' + name + '\"' === encodedKey ? name : encodedKey) + \": \";\n encodedKey = objectOrArray[name];\n encodedKey =\n \"object\" === typeof encodedKey && null !== encodedKey\n ? describeObjectForErrorMessage(encodedKey)\n : describeValueForErrorMessage(encodedKey);\n name === expandedName\n ? ((objKind = str.length),\n (length = encodedKey.length),\n (str += encodedKey))\n : (str =\n 10 > encodedKey.length && 40 > str.length + encodedKey.length\n ? str + encodedKey\n : str + \"...\");\n }\n str += \"}\";\n }\n return void 0 === expandedName\n ? str\n : -1 < objKind && 0 < length\n ? ((objectOrArray = \" \".repeat(objKind) + \"^\".repeat(length)),\n \"\\n \" + str + \"\\n \" + objectOrArray)\n : \"\\n \" + str;\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty,\n ObjectPrototype = Object.prototype,\n stringify = JSON.stringify,\n TaintRegistryObjects = ReactSharedInternalsServer.TaintRegistryObjects,\n TaintRegistryValues = ReactSharedInternalsServer.TaintRegistryValues,\n TaintRegistryByteLengths =\n ReactSharedInternalsServer.TaintRegistryByteLengths,\n TaintRegistryPendingRequests =\n ReactSharedInternalsServer.TaintRegistryPendingRequests;\nfunction throwTaintViolation(message) {\n throw Error(message);\n}\nfunction cleanupTaintQueue(request) {\n request = request.taintCleanupQueue;\n TaintRegistryPendingRequests.delete(request);\n for (var i = 0; i < request.length; i++) {\n var entryValue = request[i],\n entry = TaintRegistryValues.get(entryValue);\n void 0 !== entry &&\n (1 === entry.count\n ? TaintRegistryValues.delete(entryValue)\n : entry.count--);\n }\n request.length = 0;\n}\nfunction defaultErrorHandler(error) {\n console.error(error);\n}\nfunction RequestInstance(\n type,\n model,\n bundlerConfig,\n onError,\n onPostpone,\n onAllReady,\n onFatalError,\n identifierPrefix,\n temporaryReferences\n) {\n if (\n null !== ReactSharedInternalsServer.A &&\n ReactSharedInternalsServer.A !== DefaultAsyncDispatcher\n )\n throw Error(\"Currently React only supports one RSC renderer at a time.\");\n ReactSharedInternalsServer.A = DefaultAsyncDispatcher;\n var abortSet = new Set(),\n pingedTasks = [],\n cleanupQueue = [];\n TaintRegistryPendingRequests.add(cleanupQueue);\n var hints = new Set();\n this.type = type;\n this.status = 10;\n this.flushScheduled = !1;\n this.destination = this.fatalError = null;\n this.bundlerConfig = bundlerConfig;\n this.cache = new Map();\n this.cacheController = new AbortController();\n this.pendingChunks = this.nextChunkId = 0;\n this.hints = hints;\n this.abortableTasks = abortSet;\n this.pingedTasks = pingedTasks;\n this.completedImportChunks = [];\n this.completedHintChunks = [];\n this.completedRegularChunks = [];\n this.completedErrorChunks = [];\n this.writtenSymbols = new Map();\n this.writtenClientReferences = new Map();\n this.writtenServerReferences = new Map();\n this.writtenObjects = new WeakMap();\n this.temporaryReferences = temporaryReferences;\n this.identifierPrefix = identifierPrefix || \"\";\n this.identifierCount = 1;\n this.taintCleanupQueue = cleanupQueue;\n this.onError = void 0 === onError ? defaultErrorHandler : onError;\n this.onPostpone = void 0 === onPostpone ? noop : onPostpone;\n this.onAllReady = onAllReady;\n this.onFatalError = onFatalError;\n type = createTask(this, model, null, !1, 0, abortSet);\n pingedTasks.push(type);\n}\nvar currentRequest = null;\nfunction resolveRequest() {\n if (currentRequest) return currentRequest;\n var store = requestStorage.getStore();\n return store ? store : null;\n}\nfunction serializeThenable(request, task, thenable) {\n var newTask = createTask(\n request,\n thenable,\n task.keyPath,\n task.implicitSlot,\n task.formatContext,\n request.abortableTasks\n );\n switch (thenable.status) {\n case \"fulfilled\":\n return (\n (newTask.model = thenable.value), pingTask(request, newTask), newTask.id\n );\n case \"rejected\":\n return erroredTask(request, newTask, thenable.reason), newTask.id;\n default:\n if (12 === request.status)\n return (\n request.abortableTasks.delete(newTask),\n 21 === request.type\n ? (haltTask(newTask), finishHaltedTask(newTask, request))\n : ((task = request.fatalError),\n abortTask(newTask),\n finishAbortedTask(newTask, request, task)),\n newTask.id\n );\n \"string\" !== typeof thenable.status &&\n ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n ));\n }\n thenable.then(\n function (value) {\n newTask.model = value;\n pingTask(request, newTask);\n },\n function (reason) {\n 0 === newTask.status &&\n (erroredTask(request, newTask, reason), enqueueFlush(request));\n }\n );\n return newTask.id;\n}\nfunction serializeReadableStream(request, task, stream) {\n function progress(entry) {\n if (0 === streamTask.status)\n if (entry.done)\n (streamTask.status = 1),\n (entry = streamTask.id.toString(16) + \":C\\n\"),\n request.completedRegularChunks.push(entry),\n request.abortableTasks.delete(streamTask),\n request.cacheController.signal.removeEventListener(\n \"abort\",\n abortStream\n ),\n enqueueFlush(request),\n callOnAllReadyIfReady(request);\n else\n try {\n (streamTask.model = entry.value),\n request.pendingChunks++,\n tryStreamTask(request, streamTask),\n enqueueFlush(request),\n reader.read().then(progress, error);\n } catch (x$8) {\n error(x$8);\n }\n }\n function error(reason) {\n 0 === streamTask.status &&\n (request.cacheController.signal.removeEventListener(\"abort\", abortStream),\n erroredTask(request, streamTask, reason),\n enqueueFlush(request),\n reader.cancel(reason).then(error, error));\n }\n function abortStream() {\n if (0 === streamTask.status) {\n var signal = request.cacheController.signal;\n signal.removeEventListener(\"abort\", abortStream);\n signal = signal.reason;\n 21 === request.type\n ? (request.abortableTasks.delete(streamTask),\n haltTask(streamTask),\n finishHaltedTask(streamTask, request))\n : (erroredTask(request, streamTask, signal), enqueueFlush(request));\n reader.cancel(signal).then(error, error);\n }\n }\n var supportsBYOB = stream.supportsBYOB;\n if (void 0 === supportsBYOB)\n try {\n stream.getReader({ mode: \"byob\" }).releaseLock(), (supportsBYOB = !0);\n } catch (x) {\n supportsBYOB = !1;\n }\n var reader = stream.getReader(),\n streamTask = createTask(\n request,\n task.model,\n task.keyPath,\n task.implicitSlot,\n task.formatContext,\n request.abortableTasks\n );\n request.pendingChunks++;\n task = streamTask.id.toString(16) + \":\" + (supportsBYOB ? \"r\" : \"R\") + \"\\n\";\n request.completedRegularChunks.push(task);\n request.cacheController.signal.addEventListener(\"abort\", abortStream);\n reader.read().then(progress, error);\n return serializeByValueID(streamTask.id);\n}\nfunction serializeAsyncIterable(request, task, iterable, iterator) {\n function progress(entry) {\n if (0 === streamTask.status)\n if (entry.done) {\n streamTask.status = 1;\n if (void 0 === entry.value)\n var endStreamRow = streamTask.id.toString(16) + \":C\\n\";\n else\n try {\n var chunkId = outlineModelWithFormatContext(\n request,\n entry.value,\n 0\n );\n endStreamRow =\n streamTask.id.toString(16) +\n \":C\" +\n stringify(serializeByValueID(chunkId)) +\n \"\\n\";\n } catch (x) {\n error(x);\n return;\n }\n request.completedRegularChunks.push(endStreamRow);\n request.abortableTasks.delete(streamTask);\n request.cacheController.signal.removeEventListener(\n \"abort\",\n abortIterable\n );\n enqueueFlush(request);\n callOnAllReadyIfReady(request);\n } else\n try {\n (streamTask.model = entry.value),\n request.pendingChunks++,\n tryStreamTask(request, streamTask),\n enqueueFlush(request),\n iterator.next().then(progress, error);\n } catch (x$9) {\n error(x$9);\n }\n }\n function error(reason) {\n 0 === streamTask.status &&\n (request.cacheController.signal.removeEventListener(\n \"abort\",\n abortIterable\n ),\n erroredTask(request, streamTask, reason),\n enqueueFlush(request),\n \"function\" === typeof iterator.throw &&\n iterator.throw(reason).then(error, error));\n }\n function abortIterable() {\n if (0 === streamTask.status) {\n var signal = request.cacheController.signal;\n signal.removeEventListener(\"abort\", abortIterable);\n var reason = signal.reason;\n 21 === request.type\n ? (request.abortableTasks.delete(streamTask),\n haltTask(streamTask),\n finishHaltedTask(streamTask, request))\n : (erroredTask(request, streamTask, signal.reason),\n enqueueFlush(request));\n \"function\" === typeof iterator.throw &&\n iterator.throw(reason).then(error, error);\n }\n }\n iterable = iterable === iterator;\n var streamTask = createTask(\n request,\n task.model,\n task.keyPath,\n task.implicitSlot,\n task.formatContext,\n request.abortableTasks\n );\n request.pendingChunks++;\n task = streamTask.id.toString(16) + \":\" + (iterable ? \"x\" : \"X\") + \"\\n\";\n request.completedRegularChunks.push(task);\n request.cacheController.signal.addEventListener(\"abort\", abortIterable);\n iterator.next().then(progress, error);\n return serializeByValueID(streamTask.id);\n}\nfunction emitHint(request, code, model) {\n model = stringify(model);\n request.completedHintChunks.push(\":H\" + code + model + \"\\n\");\n enqueueFlush(request);\n}\nfunction readThenable(thenable) {\n if (\"fulfilled\" === thenable.status) return thenable.value;\n if (\"rejected\" === thenable.status) throw thenable.reason;\n throw thenable;\n}\nfunction createLazyWrapperAroundWakeable(request, task, wakeable) {\n switch (wakeable.status) {\n case \"fulfilled\":\n return wakeable.value;\n case \"rejected\":\n break;\n default:\n \"string\" !== typeof wakeable.status &&\n ((wakeable.status = \"pending\"),\n wakeable.then(\n function (fulfilledValue) {\n \"pending\" === wakeable.status &&\n ((wakeable.status = \"fulfilled\"),\n (wakeable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === wakeable.status &&\n ((wakeable.status = \"rejected\"), (wakeable.reason = error));\n }\n ));\n }\n return { $$typeof: REACT_LAZY_TYPE, _payload: wakeable, _init: readThenable };\n}\nfunction voidHandler() {}\nfunction processServerComponentReturnValue(request, task, Component, result) {\n if (\n \"object\" !== typeof result ||\n null === result ||\n result.$$typeof === CLIENT_REFERENCE_TAG$1\n )\n return result;\n if (\"function\" === typeof result.then)\n return createLazyWrapperAroundWakeable(request, task, result);\n var iteratorFn = getIteratorFn(result);\n return iteratorFn\n ? ((request = {}),\n (request[Symbol.iterator] = function () {\n return iteratorFn.call(result);\n }),\n request)\n : \"function\" !== typeof result[ASYNC_ITERATOR] ||\n (\"function\" === typeof ReadableStream &&\n result instanceof ReadableStream)\n ? result\n : ((request = {}),\n (request[ASYNC_ITERATOR] = function () {\n return result[ASYNC_ITERATOR]();\n }),\n request);\n}\nfunction renderFunctionComponent(request, task, key, Component, props) {\n var prevThenableState = task.thenableState;\n task.thenableState = null;\n thenableIndexCounter = 0;\n thenableState = prevThenableState;\n props = Component(props, void 0);\n if (12 === request.status)\n throw (\n (\"object\" === typeof props &&\n null !== props &&\n \"function\" === typeof props.then &&\n props.$$typeof !== CLIENT_REFERENCE_TAG$1 &&\n props.then(voidHandler, voidHandler),\n null)\n );\n props = processServerComponentReturnValue(request, task, Component, props);\n Component = task.keyPath;\n prevThenableState = task.implicitSlot;\n null !== key\n ? (task.keyPath = null === Component ? key : Component + \",\" + key)\n : null === Component && (task.implicitSlot = !0);\n request = renderModelDestructive(request, task, emptyRoot, \"\", props);\n task.keyPath = Component;\n task.implicitSlot = prevThenableState;\n return request;\n}\nfunction renderFragment(request, task, children) {\n return null !== task.keyPath\n ? ((request = [\n REACT_ELEMENT_TYPE,\n REACT_FRAGMENT_TYPE,\n task.keyPath,\n { children: children }\n ]),\n task.implicitSlot ? [request] : request)\n : children;\n}\nvar serializedSize = 0;\nfunction deferTask(request, task) {\n task = createTask(\n request,\n task.model,\n task.keyPath,\n task.implicitSlot,\n task.formatContext,\n request.abortableTasks\n );\n pingTask(request, task);\n return serializeLazyID(task.id);\n}\nfunction renderElement(request, task, type, key, ref, props) {\n if (null !== ref && void 0 !== ref)\n throw Error(\n \"Refs cannot be used in Server Components, nor passed to Client Components.\"\n );\n if (\n \"function\" === typeof type &&\n type.$$typeof !== CLIENT_REFERENCE_TAG$1 &&\n type.$$typeof !== TEMPORARY_REFERENCE_TAG\n )\n return renderFunctionComponent(request, task, key, type, props);\n if (type === REACT_FRAGMENT_TYPE && null === key)\n return (\n (type = task.implicitSlot),\n null === task.keyPath && (task.implicitSlot = !0),\n (props = renderModelDestructive(\n request,\n task,\n emptyRoot,\n \"\",\n props.children\n )),\n (task.implicitSlot = type),\n props\n );\n if (\n null != type &&\n \"object\" === typeof type &&\n type.$$typeof !== CLIENT_REFERENCE_TAG$1\n )\n switch (type.$$typeof) {\n case REACT_LAZY_TYPE:\n var init = type._init;\n type = init(type._payload);\n if (12 === request.status) throw null;\n return renderElement(request, task, type, key, ref, props);\n case REACT_FORWARD_REF_TYPE:\n return renderFunctionComponent(request, task, key, type.render, props);\n case REACT_MEMO_TYPE:\n return renderElement(request, task, type.type, key, ref, props);\n }\n else\n \"string\" === typeof type &&\n ((ref = task.formatContext),\n (init = getChildFormatContext(ref, type, props)),\n ref !== init &&\n null != props.children &&\n outlineModelWithFormatContext(request, props.children, init));\n request = key;\n key = task.keyPath;\n null === request\n ? (request = key)\n : null !== key && (request = key + \",\" + request);\n props = [REACT_ELEMENT_TYPE, type, request, props];\n task = task.implicitSlot && null !== request ? [props] : props;\n return task;\n}\nfunction pingTask(request, task) {\n var pingedTasks = request.pingedTasks;\n pingedTasks.push(task);\n 1 === pingedTasks.length &&\n ((request.flushScheduled = null !== request.destination),\n 21 === request.type || 10 === request.status\n ? scheduleMicrotask(function () {\n return performWork(request);\n })\n : setImmediate(function () {\n return performWork(request);\n }));\n}\nfunction createTask(\n request,\n model,\n keyPath,\n implicitSlot,\n formatContext,\n abortSet\n) {\n request.pendingChunks++;\n var id = request.nextChunkId++;\n \"object\" !== typeof model ||\n null === model ||\n null !== keyPath ||\n implicitSlot ||\n request.writtenObjects.set(model, serializeByValueID(id));\n var task = {\n id: id,\n status: 0,\n model: model,\n keyPath: keyPath,\n implicitSlot: implicitSlot,\n formatContext: formatContext,\n ping: function () {\n return pingTask(request, task);\n },\n toJSON: function (parentPropertyName, value) {\n serializedSize += parentPropertyName.length;\n var prevKeyPath = task.keyPath,\n prevImplicitSlot = task.implicitSlot;\n try {\n var JSCompiler_inline_result = renderModelDestructive(\n request,\n task,\n this,\n parentPropertyName,\n value\n );\n } catch (thrownValue) {\n if (\n ((parentPropertyName = task.model),\n (parentPropertyName =\n \"object\" === typeof parentPropertyName &&\n null !== parentPropertyName &&\n (parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||\n parentPropertyName.$$typeof === REACT_LAZY_TYPE)),\n 12 === request.status)\n )\n (task.status = 3),\n 21 === request.type\n ? ((prevKeyPath = request.nextChunkId++),\n (prevKeyPath = parentPropertyName\n ? serializeLazyID(prevKeyPath)\n : serializeByValueID(prevKeyPath)),\n (JSCompiler_inline_result = prevKeyPath))\n : ((prevKeyPath = request.fatalError),\n (JSCompiler_inline_result = parentPropertyName\n ? serializeLazyID(prevKeyPath)\n : serializeByValueID(prevKeyPath)));\n else if (\n ((value =\n thrownValue === SuspenseException\n ? getSuspendedThenable()\n : thrownValue),\n \"object\" === typeof value &&\n null !== value &&\n \"function\" === typeof value.then)\n ) {\n JSCompiler_inline_result = createTask(\n request,\n task.model,\n task.keyPath,\n task.implicitSlot,\n task.formatContext,\n request.abortableTasks\n );\n var ping = JSCompiler_inline_result.ping;\n value.then(ping, ping);\n JSCompiler_inline_result.thenableState =\n getThenableStateAfterSuspending();\n task.keyPath = prevKeyPath;\n task.implicitSlot = prevImplicitSlot;\n JSCompiler_inline_result = parentPropertyName\n ? serializeLazyID(JSCompiler_inline_result.id)\n : serializeByValueID(JSCompiler_inline_result.id);\n } else\n (task.keyPath = prevKeyPath),\n (task.implicitSlot = prevImplicitSlot),\n request.pendingChunks++,\n (prevKeyPath = request.nextChunkId++),\n \"object\" === typeof value &&\n null !== value &&\n value.$$typeof === REACT_POSTPONE_TYPE\n ? (logPostpone(request, value.message, task),\n emitPostponeChunk(request, prevKeyPath))\n : ((prevImplicitSlot = logRecoverableError(request, value, task)),\n emitErrorChunk(request, prevKeyPath, prevImplicitSlot)),\n (JSCompiler_inline_result = parentPropertyName\n ? serializeLazyID(prevKeyPath)\n : serializeByValueID(prevKeyPath));\n }\n return JSCompiler_inline_result;\n },\n thenableState: null\n };\n abortSet.add(task);\n return task;\n}\nfunction serializeByValueID(id) {\n return \"$\" + id.toString(16);\n}\nfunction serializeLazyID(id) {\n return \"$L\" + id.toString(16);\n}\nfunction encodeReferenceChunk(request, id, reference) {\n request = stringify(reference);\n return id.toString(16) + \":\" + request + \"\\n\";\n}\nfunction serializeClientReference(\n request,\n parent,\n parentPropertyName,\n clientReference\n) {\n var clientReferenceKey = clientReference.$$async\n ? clientReference.$$id + \"#async\"\n : clientReference.$$id,\n writtenClientReferences = request.writtenClientReferences,\n existingId = writtenClientReferences.get(clientReferenceKey);\n if (void 0 !== existingId)\n return parent[0] === REACT_ELEMENT_TYPE && \"1\" === parentPropertyName\n ? serializeLazyID(existingId)\n : serializeByValueID(existingId);\n try {\n var config = request.bundlerConfig,\n modulePath = clientReference.$$id;\n existingId = \"\";\n var resolvedModuleData = config[modulePath];\n if (resolvedModuleData) existingId = resolvedModuleData.name;\n else {\n var idx = modulePath.lastIndexOf(\"#\");\n -1 !== idx &&\n ((existingId = modulePath.slice(idx + 1)),\n (resolvedModuleData = config[modulePath.slice(0, idx)]));\n if (!resolvedModuleData)\n throw Error(\n 'Could not find the module \"' +\n modulePath +\n '\" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'\n );\n }\n if (!0 === resolvedModuleData.async && !0 === clientReference.$$async)\n throw Error(\n 'The module \"' +\n modulePath +\n '\" is marked as an async ESM module but was loaded as a CJS proxy. This is probably a bug in the React Server Components bundler.'\n );\n var JSCompiler_inline_result =\n !0 === resolvedModuleData.async || !0 === clientReference.$$async\n ? [resolvedModuleData.id, resolvedModuleData.chunks, existingId, 1]\n : [resolvedModuleData.id, resolvedModuleData.chunks, existingId];\n request.pendingChunks++;\n var importId = request.nextChunkId++,\n json = stringify(JSCompiler_inline_result),\n processedChunk = importId.toString(16) + \":I\" + json + \"\\n\";\n request.completedImportChunks.push(processedChunk);\n writtenClientReferences.set(clientReferenceKey, importId);\n return parent[0] === REACT_ELEMENT_TYPE && \"1\" === parentPropertyName\n ? serializeLazyID(importId)\n : serializeByValueID(importId);\n } catch (x) {\n return (\n request.pendingChunks++,\n (parent = request.nextChunkId++),\n (parentPropertyName = logRecoverableError(request, x, null)),\n emitErrorChunk(request, parent, parentPropertyName),\n serializeByValueID(parent)\n );\n }\n}\nfunction outlineModelWithFormatContext(request, value, formatContext) {\n value = createTask(\n request,\n value,\n null,\n !1,\n formatContext,\n request.abortableTasks\n );\n retryTask(request, value);\n return value.id;\n}\nfunction serializeTypedArray(request, tag, typedArray) {\n request.pendingChunks++;\n var bufferId = request.nextChunkId++;\n emitTypedArrayChunk(request, bufferId, tag, typedArray, !1);\n return serializeByValueID(bufferId);\n}\nfunction serializeBlob(request, blob) {\n function progress(entry) {\n if (0 === newTask.status)\n if (entry.done)\n request.cacheController.signal.removeEventListener(\"abort\", abortBlob),\n pingTask(request, newTask);\n else\n return (\n model.push(entry.value), reader.read().then(progress).catch(error)\n );\n }\n function error(reason) {\n 0 === newTask.status &&\n (request.cacheController.signal.removeEventListener(\"abort\", abortBlob),\n erroredTask(request, newTask, reason),\n enqueueFlush(request),\n reader.cancel(reason).then(error, error));\n }\n function abortBlob() {\n if (0 === newTask.status) {\n var signal = request.cacheController.signal;\n signal.removeEventListener(\"abort\", abortBlob);\n signal = signal.reason;\n 21 === request.type\n ? (request.abortableTasks.delete(newTask),\n haltTask(newTask),\n finishHaltedTask(newTask, request))\n : (erroredTask(request, newTask, signal), enqueueFlush(request));\n reader.cancel(signal).then(error, error);\n }\n }\n var model = [blob.type],\n newTask = createTask(request, model, null, !1, 0, request.abortableTasks),\n reader = blob.stream().getReader();\n request.cacheController.signal.addEventListener(\"abort\", abortBlob);\n reader.read().then(progress).catch(error);\n return \"$B\" + newTask.id.toString(16);\n}\nvar modelRoot = !1;\nfunction renderModelDestructive(\n request,\n task,\n parent,\n parentPropertyName,\n value\n) {\n task.model = value;\n if (value === REACT_ELEMENT_TYPE) return \"$\";\n if (null === value) return null;\n if (\"object\" === typeof value) {\n switch (value.$$typeof) {\n case REACT_ELEMENT_TYPE:\n var elementReference = null,\n writtenObjects = request.writtenObjects;\n if (null === task.keyPath && !task.implicitSlot) {\n var existingReference = writtenObjects.get(value);\n if (void 0 !== existingReference)\n if (modelRoot === value) modelRoot = null;\n else return existingReference;\n else\n -1 === parentPropertyName.indexOf(\":\") &&\n ((parent = writtenObjects.get(parent)),\n void 0 !== parent &&\n ((elementReference = parent + \":\" + parentPropertyName),\n writtenObjects.set(value, elementReference)));\n }\n if (3200 < serializedSize) return deferTask(request, task);\n parentPropertyName = value.props;\n parent = parentPropertyName.ref;\n value = renderElement(\n request,\n task,\n value.type,\n value.key,\n void 0 !== parent ? parent : null,\n parentPropertyName\n );\n \"object\" === typeof value &&\n null !== value &&\n null !== elementReference &&\n (writtenObjects.has(value) ||\n writtenObjects.set(value, elementReference));\n return value;\n case REACT_LAZY_TYPE:\n if (3200 < serializedSize) return deferTask(request, task);\n task.thenableState = null;\n parentPropertyName = value._init;\n value = parentPropertyName(value._payload);\n if (12 === request.status) throw null;\n return renderModelDestructive(request, task, emptyRoot, \"\", value);\n case REACT_LEGACY_ELEMENT_TYPE:\n throw Error(\n 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\\n- Multiple copies of the \"react\" package is used.\\n- A library pre-bundled an old copy of \"react\" or \"react/jsx-runtime\".\\n- A compiler tries to \"inline\" JSX instead of using the runtime.'\n );\n }\n if (value.$$typeof === CLIENT_REFERENCE_TAG$1)\n return serializeClientReference(\n request,\n parent,\n parentPropertyName,\n value\n );\n if (\n void 0 !== request.temporaryReferences &&\n ((elementReference = request.temporaryReferences.get(value)),\n void 0 !== elementReference)\n )\n return \"$T\" + elementReference;\n elementReference = TaintRegistryObjects.get(value);\n void 0 !== elementReference && throwTaintViolation(elementReference);\n elementReference = request.writtenObjects;\n writtenObjects = elementReference.get(value);\n if (\"function\" === typeof value.then) {\n if (void 0 !== writtenObjects) {\n if (null !== task.keyPath || task.implicitSlot)\n return \"$@\" + serializeThenable(request, task, value).toString(16);\n if (modelRoot === value) modelRoot = null;\n else return writtenObjects;\n }\n request = \"$@\" + serializeThenable(request, task, value).toString(16);\n elementReference.set(value, request);\n return request;\n }\n if (void 0 !== writtenObjects)\n if (modelRoot === value) {\n if (writtenObjects !== serializeByValueID(task.id))\n return writtenObjects;\n modelRoot = null;\n } else return writtenObjects;\n else if (\n -1 === parentPropertyName.indexOf(\":\") &&\n ((writtenObjects = elementReference.get(parent)),\n void 0 !== writtenObjects)\n ) {\n existingReference = parentPropertyName;\n if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)\n switch (parentPropertyName) {\n case \"1\":\n existingReference = \"type\";\n break;\n case \"2\":\n existingReference = \"key\";\n break;\n case \"3\":\n existingReference = \"props\";\n break;\n case \"4\":\n existingReference = \"_owner\";\n }\n elementReference.set(value, writtenObjects + \":\" + existingReference);\n }\n if (isArrayImpl(value)) return renderFragment(request, task, value);\n if (value instanceof Map)\n return (\n (value = Array.from(value)),\n \"$Q\" + outlineModelWithFormatContext(request, value, 0).toString(16)\n );\n if (value instanceof Set)\n return (\n (value = Array.from(value)),\n \"$W\" + outlineModelWithFormatContext(request, value, 0).toString(16)\n );\n if (\"function\" === typeof FormData && value instanceof FormData)\n return (\n (value = Array.from(value.entries())),\n \"$K\" + outlineModelWithFormatContext(request, value, 0).toString(16)\n );\n if (value instanceof Error) return \"$Z\";\n if (value instanceof ArrayBuffer)\n return serializeTypedArray(request, \"A\", new Uint8Array(value));\n if (value instanceof Int8Array)\n return serializeTypedArray(request, \"O\", value);\n if (value instanceof Uint8Array)\n return serializeTypedArray(request, \"o\", value);\n if (value instanceof Uint8ClampedArray)\n return serializeTypedArray(request, \"U\", value);\n if (value instanceof Int16Array)\n return serializeTypedArray(request, \"S\", value);\n if (value instanceof Uint16Array)\n return serializeTypedArray(request, \"s\", value);\n if (value instanceof Int32Array)\n return serializeTypedArray(request, \"L\", value);\n if (value instanceof Uint32Array)\n return serializeTypedArray(request, \"l\", value);\n if (value instanceof Float32Array)\n return serializeTypedArray(request, \"G\", value);\n if (value instanceof Float64Array)\n return serializeTypedArray(request, \"g\", value);\n if (value instanceof BigInt64Array)\n return serializeTypedArray(request, \"M\", value);\n if (value instanceof BigUint64Array)\n return serializeTypedArray(request, \"m\", value);\n if (value instanceof DataView)\n return serializeTypedArray(request, \"V\", value);\n if (\"function\" === typeof Blob && value instanceof Blob)\n return serializeBlob(request, value);\n if ((elementReference = getIteratorFn(value)))\n return (\n (parentPropertyName = elementReference.call(value)),\n parentPropertyName === value\n ? ((value = Array.from(parentPropertyName)),\n \"$i\" +\n outlineModelWithFormatContext(request, value, 0).toString(16))\n : renderFragment(request, task, Array.from(parentPropertyName))\n );\n if (\"function\" === typeof ReadableStream && value instanceof ReadableStream)\n return serializeReadableStream(request, task, value);\n elementReference = value[ASYNC_ITERATOR];\n if (\"function\" === typeof elementReference)\n return (\n null !== task.keyPath\n ? ((value = [\n REACT_ELEMENT_TYPE,\n REACT_FRAGMENT_TYPE,\n task.keyPath,\n { children: value }\n ]),\n (value = task.implicitSlot ? [value] : value))\n : ((parentPropertyName = elementReference.call(value)),\n (value = serializeAsyncIterable(\n request,\n task,\n value,\n parentPropertyName\n ))),\n value\n );\n if (value instanceof Date) return \"$D\" + value.toJSON();\n request = getPrototypeOf(value);\n if (\n request !== ObjectPrototype &&\n (null === request || null !== getPrototypeOf(request))\n )\n throw Error(\n \"Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported.\" +\n describeObjectForErrorMessage(parent, parentPropertyName)\n );\n return value;\n }\n if (\"string\" === typeof value) {\n task = TaintRegistryValues.get(value);\n void 0 !== task && throwTaintViolation(task.message);\n serializedSize += value.length;\n if (\n \"Z\" === value[value.length - 1] &&\n parent[parentPropertyName] instanceof Date\n )\n return \"$D\" + value;\n if (1024 <= value.length && null !== byteLengthOfChunk)\n return (\n request.pendingChunks++,\n (task = request.nextChunkId++),\n emitTextChunk(request, task, value, !1),\n serializeByValueID(task)\n );\n value = \"$\" === value[0] ? \"$\" + value : value;\n return value;\n }\n if (\"boolean\" === typeof value) return value;\n if (\"number\" === typeof value)\n return Number.isFinite(value)\n ? 0 === value && -Infinity === 1 / value\n ? \"$-0\"\n : value\n : Infinity === value\n ? \"$Infinity\"\n : -Infinity === value\n ? \"$-Infinity\"\n : \"$NaN\";\n if (\"undefined\" === typeof value) return \"$undefined\";\n if (\"function\" === typeof value) {\n if (value.$$typeof === CLIENT_REFERENCE_TAG$1)\n return serializeClientReference(\n request,\n parent,\n parentPropertyName,\n value\n );\n if (value.$$typeof === SERVER_REFERENCE_TAG)\n return (\n (task = request.writtenServerReferences),\n (parentPropertyName = task.get(value)),\n void 0 !== parentPropertyName\n ? (value = \"$F\" + parentPropertyName.toString(16))\n : ((parentPropertyName = value.$$bound),\n (parentPropertyName =\n null === parentPropertyName\n ? null\n : Promise.resolve(parentPropertyName)),\n (request = outlineModelWithFormatContext(\n request,\n { id: value.$$id, bound: parentPropertyName },\n 0\n )),\n task.set(value, request),\n (value = \"$F\" + request.toString(16))),\n value\n );\n if (\n void 0 !== request.temporaryReferences &&\n ((request = request.temporaryReferences.get(value)), void 0 !== request)\n )\n return \"$T\" + request;\n request = TaintRegistryObjects.get(value);\n void 0 !== request && throwTaintViolation(request);\n if (value.$$typeof === TEMPORARY_REFERENCE_TAG)\n throw Error(\n \"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server.\"\n );\n if (/^on[A-Z]/.test(parentPropertyName))\n throw Error(\n \"Event handlers cannot be passed to Client Component props.\" +\n describeObjectForErrorMessage(parent, parentPropertyName) +\n \"\\nIf you need interactivity, consider converting part of this to a Client Component.\"\n );\n throw Error(\n 'Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with \"use server\". Or maybe you meant to call this function rather than return it.' +\n describeObjectForErrorMessage(parent, parentPropertyName)\n );\n }\n if (\"symbol\" === typeof value) {\n task = request.writtenSymbols;\n elementReference = task.get(value);\n if (void 0 !== elementReference)\n return serializeByValueID(elementReference);\n elementReference = value.description;\n if (Symbol.for(elementReference) !== value)\n throw Error(\n \"Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(\" +\n (value.description + \") cannot be found among global symbols.\") +\n describeObjectForErrorMessage(parent, parentPropertyName)\n );\n request.pendingChunks++;\n parentPropertyName = request.nextChunkId++;\n parent = encodeReferenceChunk(\n request,\n parentPropertyName,\n \"$S\" + elementReference\n );\n request.completedImportChunks.push(parent);\n task.set(value, parentPropertyName);\n return serializeByValueID(parentPropertyName);\n }\n if (\"bigint\" === typeof value)\n return (\n (request = TaintRegistryValues.get(value)),\n void 0 !== request && throwTaintViolation(request.message),\n \"$n\" + value.toString(10)\n );\n throw Error(\n \"Type \" +\n typeof value +\n \" is not supported in Client Component props.\" +\n describeObjectForErrorMessage(parent, parentPropertyName)\n );\n}\nfunction logPostpone(request, reason) {\n var prevRequest = currentRequest;\n currentRequest = null;\n try {\n requestStorage.run(void 0, request.onPostpone, reason);\n } finally {\n currentRequest = prevRequest;\n }\n}\nfunction logRecoverableError(request, error) {\n var prevRequest = currentRequest;\n currentRequest = null;\n try {\n var errorDigest = requestStorage.run(void 0, request.onError, error);\n } finally {\n currentRequest = prevRequest;\n }\n if (null != errorDigest && \"string\" !== typeof errorDigest)\n throw Error(\n 'onError returned something with a type other than \"string\". onError should return a string and may return null or undefined but must not return anything else. It received something of type \"' +\n typeof errorDigest +\n '\" instead'\n );\n return errorDigest || \"\";\n}\nfunction fatalError(request, error) {\n var onFatalError = request.onFatalError;\n onFatalError(error);\n cleanupTaintQueue(request);\n null !== request.destination\n ? ((request.status = 14), request.destination.destroy(error))\n : ((request.status = 13), (request.fatalError = error));\n request.cacheController.abort(\n Error(\"The render was aborted due to a fatal error.\", { cause: error })\n );\n}\nfunction emitPostponeChunk(request, id) {\n id = id.toString(16) + \":P\\n\";\n request.completedErrorChunks.push(id);\n}\nfunction emitErrorChunk(request, id, digest) {\n digest = { digest: digest };\n id = id.toString(16) + \":E\" + stringify(digest) + \"\\n\";\n request.completedErrorChunks.push(id);\n}\nfunction emitTypedArrayChunk(request, id, tag, typedArray, debug) {\n if (TaintRegistryByteLengths.has(typedArray.byteLength)) {\n var tainted = TaintRegistryValues.get(\n String.fromCharCode.apply(\n String,\n new Uint8Array(\n typedArray.buffer,\n typedArray.byteOffset,\n typedArray.byteLength\n )\n )\n );\n void 0 !== tainted && throwTaintViolation(tainted.message);\n }\n debug ? request.pendingDebugChunks++ : request.pendingChunks++;\n typedArray = new Uint8Array(\n typedArray.buffer,\n typedArray.byteOffset,\n typedArray.byteLength\n );\n debug = typedArray.byteLength;\n id = id.toString(16) + \":\" + tag + debug.toString(16) + \",\";\n request.completedRegularChunks.push(id, typedArray);\n}\nfunction emitTextChunk(request, id, text, debug) {\n if (null === byteLengthOfChunk)\n throw Error(\n \"Existence of byteLengthOfChunk should have already been checked. This is a bug in React.\"\n );\n debug ? request.pendingDebugChunks++ : request.pendingChunks++;\n debug = byteLengthOfChunk(text);\n id = id.toString(16) + \":T\" + debug.toString(16) + \",\";\n request.completedRegularChunks.push(id, text);\n}\nfunction emitChunk(request, task, value) {\n var id = task.id;\n \"string\" === typeof value && null !== byteLengthOfChunk\n ? ((task = TaintRegistryValues.get(value)),\n void 0 !== task && throwTaintViolation(task.message),\n emitTextChunk(request, id, value, !1))\n : value instanceof ArrayBuffer\n ? emitTypedArrayChunk(request, id, \"A\", new Uint8Array(value), !1)\n : value instanceof Int8Array\n ? emitTypedArrayChunk(request, id, \"O\", value, !1)\n : value instanceof Uint8Array\n ? emitTypedArrayChunk(request, id, \"o\", value, !1)\n : value instanceof Uint8ClampedArray\n ? emitTypedArrayChunk(request, id, \"U\", value, !1)\n : value instanceof Int16Array\n ? emitTypedArrayChunk(request, id, \"S\", value, !1)\n : value instanceof Uint16Array\n ? emitTypedArrayChunk(request, id, \"s\", value, !1)\n : value instanceof Int32Array\n ? emitTypedArrayChunk(request, id, \"L\", value, !1)\n : value instanceof Uint32Array\n ? emitTypedArrayChunk(request, id, \"l\", value, !1)\n : value instanceof Float32Array\n ? emitTypedArrayChunk(request, id, \"G\", value, !1)\n : value instanceof Float64Array\n ? emitTypedArrayChunk(request, id, \"g\", value, !1)\n : value instanceof BigInt64Array\n ? emitTypedArrayChunk(request, id, \"M\", value, !1)\n : value instanceof BigUint64Array\n ? emitTypedArrayChunk(request, id, \"m\", value, !1)\n : value instanceof DataView\n ? emitTypedArrayChunk(request, id, \"V\", value, !1)\n : ((value = stringify(value, task.toJSON)),\n (task =\n task.id.toString(16) + \":\" + value + \"\\n\"),\n request.completedRegularChunks.push(task));\n}\nfunction erroredTask(request, task, error) {\n task.status = 4;\n \"object\" === typeof error &&\n null !== error &&\n error.$$typeof === REACT_POSTPONE_TYPE\n ? (logPostpone(request, error.message, task),\n emitPostponeChunk(request, task.id))\n : ((error = logRecoverableError(request, error, task)),\n emitErrorChunk(request, task.id, error));\n request.abortableTasks.delete(task);\n callOnAllReadyIfReady(request);\n}\nvar emptyRoot = {};\nfunction retryTask(request, task) {\n if (0 === task.status) {\n task.status = 5;\n var parentSerializedSize = serializedSize;\n try {\n modelRoot = task.model;\n var resolvedModel = renderModelDestructive(\n request,\n task,\n emptyRoot,\n \"\",\n task.model\n );\n modelRoot = resolvedModel;\n task.keyPath = null;\n task.implicitSlot = !1;\n if (\"object\" === typeof resolvedModel && null !== resolvedModel)\n request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),\n emitChunk(request, task, resolvedModel);\n else {\n var json = stringify(resolvedModel),\n processedChunk = task.id.toString(16) + \":\" + json + \"\\n\";\n request.completedRegularChunks.push(processedChunk);\n }\n task.status = 1;\n request.abortableTasks.delete(task);\n callOnAllReadyIfReady(request);\n } catch (thrownValue) {\n if (12 === request.status)\n if (\n (request.abortableTasks.delete(task),\n (task.status = 0),\n 21 === request.type)\n )\n haltTask(task), finishHaltedTask(task, request);\n else {\n var errorId = request.fatalError;\n abortTask(task);\n finishAbortedTask(task, request, errorId);\n }\n else {\n var x =\n thrownValue === SuspenseException\n ? getSuspendedThenable()\n : thrownValue;\n if (\n \"object\" === typeof x &&\n null !== x &&\n \"function\" === typeof x.then\n ) {\n task.status = 0;\n task.thenableState = getThenableStateAfterSuspending();\n var ping = task.ping;\n x.then(ping, ping);\n } else erroredTask(request, task, x);\n }\n } finally {\n serializedSize = parentSerializedSize;\n }\n }\n}\nfunction tryStreamTask(request, task) {\n var parentSerializedSize = serializedSize;\n try {\n emitChunk(request, task, task.model);\n } finally {\n serializedSize = parentSerializedSize;\n }\n}\nfunction performWork(request) {\n var prevDispatcher = ReactSharedInternalsServer.H;\n ReactSharedInternalsServer.H = HooksDispatcher;\n var prevRequest = currentRequest;\n currentRequest$1 = currentRequest = request;\n try {\n var pingedTasks = request.pingedTasks;\n request.pingedTasks = [];\n for (var i = 0; i < pingedTasks.length; i++)\n retryTask(request, pingedTasks[i]);\n flushCompletedChunks(request);\n } catch (error) {\n logRecoverableError(request, error, null), fatalError(request, error);\n } finally {\n (ReactSharedInternalsServer.H = prevDispatcher),\n (currentRequest$1 = null),\n (currentRequest = prevRequest);\n }\n}\nfunction abortTask(task) {\n 0 === task.status && (task.status = 3);\n}\nfunction finishAbortedTask(task, request, errorId) {\n 3 === task.status &&\n ((errorId = serializeByValueID(errorId)),\n (task = encodeReferenceChunk(request, task.id, errorId)),\n request.completedErrorChunks.push(task));\n}\nfunction haltTask(task) {\n 0 === task.status && (task.status = 3);\n}\nfunction finishHaltedTask(task, request) {\n 3 === task.status && request.pendingChunks--;\n}\nfunction flushCompletedChunks(request) {\n var destination = request.destination;\n if (null !== destination) {\n currentView = new Uint8Array(4096);\n writtenBytes = 0;\n destinationHasCapacity = !0;\n try {\n for (\n var importsChunks = request.completedImportChunks, i = 0;\n i < importsChunks.length;\n i++\n )\n if (\n (request.pendingChunks--,\n !writeChunkAndReturn(destination, importsChunks[i]))\n ) {\n request.destination = null;\n i++;\n break;\n }\n importsChunks.splice(0, i);\n var hintChunks = request.completedHintChunks;\n for (i = 0; i < hintChunks.length; i++)\n if (!writeChunkAndReturn(destination, hintChunks[i])) {\n request.destination = null;\n i++;\n break;\n }\n hintChunks.splice(0, i);\n var regularChunks = request.completedRegularChunks;\n for (i = 0; i < regularChunks.length; i++)\n if (\n (request.pendingChunks--,\n !writeChunkAndReturn(destination, regularChunks[i]))\n ) {\n request.destination = null;\n i++;\n break;\n }\n regularChunks.splice(0, i);\n var errorChunks = request.completedErrorChunks;\n for (i = 0; i < errorChunks.length; i++)\n if (\n (request.pendingChunks--,\n !writeChunkAndReturn(destination, errorChunks[i]))\n ) {\n request.destination = null;\n i++;\n break;\n }\n errorChunks.splice(0, i);\n } finally {\n (request.flushScheduled = !1),\n currentView &&\n 0 < writtenBytes &&\n destination.write(currentView.subarray(0, writtenBytes)),\n (currentView = null),\n (writtenBytes = 0),\n (destinationHasCapacity = !0);\n }\n \"function\" === typeof destination.flush && destination.flush();\n }\n 0 === request.pendingChunks &&\n (cleanupTaintQueue(request),\n 12 > request.status &&\n request.cacheController.abort(\n Error(\n \"This render completed successfully. All cacheSignals are now aborted to allow clean up of any unused resources.\"\n )\n ),\n null !== request.destination &&\n ((request.status = 14),\n request.destination.end(),\n (request.destination = null)));\n}\nfunction startWork(request) {\n request.flushScheduled = null !== request.destination;\n scheduleMicrotask(function () {\n requestStorage.run(request, performWork, request);\n });\n setImmediate(function () {\n 10 === request.status && (request.status = 11);\n });\n}\nfunction enqueueFlush(request) {\n !1 === request.flushScheduled &&\n 0 === request.pingedTasks.length &&\n null !== request.destination &&\n ((request.flushScheduled = !0),\n setImmediate(function () {\n request.flushScheduled = !1;\n flushCompletedChunks(request);\n }));\n}\nfunction callOnAllReadyIfReady(request) {\n 0 === request.abortableTasks.size &&\n ((request = request.onAllReady), request());\n}\nfunction startFlowing(request, destination) {\n if (13 === request.status)\n (request.status = 14), destination.destroy(request.fatalError);\n else if (14 !== request.status && null === request.destination) {\n request.destination = destination;\n try {\n flushCompletedChunks(request);\n } catch (error) {\n logRecoverableError(request, error, null), fatalError(request, error);\n }\n }\n}\nfunction finishHalt(request, abortedTasks) {\n try {\n abortedTasks.forEach(function (task) {\n return finishHaltedTask(task, request);\n });\n var onAllReady = request.onAllReady;\n onAllReady();\n flushCompletedChunks(request);\n } catch (error) {\n logRecoverableError(request, error, null), fatalError(request, error);\n }\n}\nfunction finishAbort(request, abortedTasks, errorId) {\n try {\n abortedTasks.forEach(function (task) {\n return finishAbortedTask(task, request, errorId);\n });\n var onAllReady = request.onAllReady;\n onAllReady();\n flushCompletedChunks(request);\n } catch (error) {\n logRecoverableError(request, error, null), fatalError(request, error);\n }\n}\nfunction abort(request, reason) {\n if (!(11 < request.status))\n try {\n request.status = 12;\n request.cacheController.abort(reason);\n var abortableTasks = request.abortableTasks;\n if (0 < abortableTasks.size)\n if (21 === request.type)\n abortableTasks.forEach(function (task) {\n return haltTask(task, request);\n }),\n setImmediate(function () {\n return finishHalt(request, abortableTasks);\n });\n else if (\n \"object\" === typeof reason &&\n null !== reason &&\n reason.$$typeof === REACT_POSTPONE_TYPE\n ) {\n logPostpone(request, reason.message, null);\n var errorId = request.nextChunkId++;\n request.fatalError = errorId;\n request.pendingChunks++;\n emitPostponeChunk(request, errorId, reason);\n abortableTasks.forEach(function (task) {\n return abortTask(task, request, errorId);\n });\n setImmediate(function () {\n return finishAbort(request, abortableTasks, errorId);\n });\n } else {\n var error =\n void 0 === reason\n ? Error(\n \"The render was aborted by the server without a reason.\"\n )\n : \"object\" === typeof reason &&\n null !== reason &&\n \"function\" === typeof reason.then\n ? Error(\n \"The render was aborted by the server with a promise.\"\n )\n : reason,\n digest = logRecoverableError(request, error, null),\n errorId$26 = request.nextChunkId++;\n request.fatalError = errorId$26;\n request.pendingChunks++;\n emitErrorChunk(request, errorId$26, digest, error, !1, null);\n abortableTasks.forEach(function (task) {\n return abortTask(task, request, errorId$26);\n });\n setImmediate(function () {\n return finishAbort(request, abortableTasks, errorId$26);\n });\n }\n else {\n var onAllReady = request.onAllReady;\n onAllReady();\n flushCompletedChunks(request);\n }\n } catch (error$27) {\n logRecoverableError(request, error$27, null),\n fatalError(request, error$27);\n }\n}\nfunction resolveServerReference(bundlerConfig, id) {\n var name = \"\",\n resolvedModuleData = bundlerConfig[id];\n if (resolvedModuleData) name = resolvedModuleData.name;\n else {\n var idx = id.lastIndexOf(\"#\");\n -1 !== idx &&\n ((name = id.slice(idx + 1)),\n (resolvedModuleData = bundlerConfig[id.slice(0, idx)]));\n if (!resolvedModuleData)\n throw Error(\n 'Could not find the module \"' +\n id +\n '\" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'\n );\n }\n return resolvedModuleData.async\n ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]\n : [resolvedModuleData.id, resolvedModuleData.chunks, name];\n}\nvar chunkCache = new Map();\nfunction requireAsyncModule(id) {\n var promise = globalThis.__next_require__(id);\n if (\"function\" !== typeof promise.then || \"fulfilled\" === promise.status)\n return null;\n promise.then(\n function (value) {\n promise.status = \"fulfilled\";\n promise.value = value;\n },\n function (reason) {\n promise.status = \"rejected\";\n promise.reason = reason;\n }\n );\n return promise;\n}\nfunction ignoreReject() {}\nfunction preloadModule(metadata) {\n for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {\n var chunkId = chunks[i++];\n chunks[i++];\n var entry = chunkCache.get(chunkId);\n if (void 0 === entry) {\n entry = __webpack_chunk_load__(chunkId);\n promises.push(entry);\n var resolve = chunkCache.set.bind(chunkCache, chunkId, null);\n entry.then(resolve, ignoreReject);\n chunkCache.set(chunkId, entry);\n } else null !== entry && promises.push(entry);\n }\n return 4 === metadata.length\n ? 0 === promises.length\n ? requireAsyncModule(metadata[0])\n : Promise.all(promises).then(function () {\n return requireAsyncModule(metadata[0]);\n })\n : 0 < promises.length\n ? Promise.all(promises)\n : null;\n}\nfunction requireModule(metadata) {\n var moduleExports = globalThis.__next_require__(metadata[0]);\n if (4 === metadata.length && \"function\" === typeof moduleExports.then)\n if (\"fulfilled\" === moduleExports.status)\n moduleExports = moduleExports.value;\n else throw moduleExports.reason;\n return \"*\" === metadata[2]\n ? moduleExports\n : \"\" === metadata[2]\n ? moduleExports.__esModule\n ? moduleExports.default\n : moduleExports\n : moduleExports[metadata[2]];\n}\nfunction Chunk(status, value, reason, response) {\n this.status = status;\n this.value = value;\n this.reason = reason;\n this._response = response;\n}\nChunk.prototype = Object.create(Promise.prototype);\nChunk.prototype.then = function (resolve, reject) {\n switch (this.status) {\n case \"resolved_model\":\n initializeModelChunk(this);\n }\n switch (this.status) {\n case \"fulfilled\":\n resolve(this.value);\n break;\n case \"pending\":\n case \"blocked\":\n case \"cyclic\":\n resolve &&\n (null === this.value && (this.value = []), this.value.push(resolve));\n reject &&\n (null === this.reason && (this.reason = []), this.reason.push(reject));\n break;\n default:\n reject(this.reason);\n }\n};\nfunction createPendingChunk(response) {\n return new Chunk(\"pending\", null, null, response);\n}\nfunction wakeChunk(listeners, value) {\n for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);\n}\nfunction triggerErrorOnChunk(chunk, error) {\n if (\"pending\" !== chunk.status && \"blocked\" !== chunk.status)\n chunk.reason.error(error);\n else {\n var listeners = chunk.reason;\n chunk.status = \"rejected\";\n chunk.reason = error;\n null !== listeners && wakeChunk(listeners, error);\n }\n}\nfunction resolveModelChunk(chunk, value, id) {\n if (\"pending\" !== chunk.status)\n (chunk = chunk.reason),\n \"C\" === value[0]\n ? chunk.close(\"C\" === value ? '\"$undefined\"' : value.slice(1))\n : chunk.enqueueModel(value);\n else {\n var resolveListeners = chunk.value,\n rejectListeners = chunk.reason;\n chunk.status = \"resolved_model\";\n chunk.value = value;\n chunk.reason = id;\n if (null !== resolveListeners)\n switch ((initializeModelChunk(chunk), chunk.status)) {\n case \"fulfilled\":\n wakeChunk(resolveListeners, chunk.value);\n break;\n case \"pending\":\n case \"blocked\":\n case \"cyclic\":\n if (chunk.value)\n for (value = 0; value < resolveListeners.length; value++)\n chunk.value.push(resolveListeners[value]);\n else chunk.value = resolveListeners;\n if (chunk.reason) {\n if (rejectListeners)\n for (value = 0; value < rejectListeners.length; value++)\n chunk.reason.push(rejectListeners[value]);\n } else chunk.reason = rejectListeners;\n break;\n case \"rejected\":\n rejectListeners && wakeChunk(rejectListeners, chunk.reason);\n }\n }\n}\nfunction createResolvedIteratorResultChunk(response, value, done) {\n return new Chunk(\n \"resolved_model\",\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\",\n -1,\n response\n );\n}\nfunction resolveIteratorResultChunk(chunk, value, done) {\n resolveModelChunk(\n chunk,\n (done ? '{\"done\":true,\"value\":' : '{\"done\":false,\"value\":') + value + \"}\",\n -1\n );\n}\nfunction loadServerReference$1(\n response,\n id,\n bound,\n parentChunk,\n parentObject,\n key\n) {\n var serverReference = resolveServerReference(response._bundlerConfig, id);\n id = preloadModule(serverReference);\n if (bound)\n bound = Promise.all([bound, id]).then(function (_ref) {\n _ref = _ref[0];\n var fn = requireModule(serverReference);\n return fn.bind.apply(fn, [null].concat(_ref));\n });\n else if (id)\n bound = Promise.resolve(id).then(function () {\n return requireModule(serverReference);\n });\n else return requireModule(serverReference);\n bound.then(\n createModelResolver(\n parentChunk,\n parentObject,\n key,\n !1,\n response,\n createModel,\n []\n ),\n createModelReject(parentChunk)\n );\n return null;\n}\nfunction reviveModel(response, parentObj, parentKey, value, reference) {\n if (\"string\" === typeof value)\n return parseModelString(response, parentObj, parentKey, value, reference);\n if (\"object\" === typeof value && null !== value)\n if (\n (void 0 !== reference &&\n void 0 !== response._temporaryReferences &&\n response._temporaryReferences.set(value, reference),\n Array.isArray(value))\n )\n for (var i = 0; i < value.length; i++)\n value[i] = reviveModel(\n response,\n value,\n \"\" + i,\n value[i],\n void 0 !== reference ? reference + \":\" + i : void 0\n );\n else\n for (i in value)\n hasOwnProperty.call(value, i) &&\n ((parentObj =\n void 0 !== reference && -1 === i.indexOf(\":\")\n ? reference + \":\" + i\n : void 0),\n (parentObj = reviveModel(response, value, i, value[i], parentObj)),\n void 0 !== parentObj ? (value[i] = parentObj) : delete value[i]);\n return value;\n}\nvar initializingChunk = null,\n initializingChunkBlockedModel = null;\nfunction initializeModelChunk(chunk) {\n var prevChunk = initializingChunk,\n prevBlocked = initializingChunkBlockedModel;\n initializingChunk = chunk;\n initializingChunkBlockedModel = null;\n var rootReference = -1 === chunk.reason ? void 0 : chunk.reason.toString(16),\n resolvedModel = chunk.value;\n chunk.status = \"cyclic\";\n chunk.value = null;\n chunk.reason = null;\n try {\n var rawModel = JSON.parse(resolvedModel),\n value = reviveModel(\n chunk._response,\n { \"\": rawModel },\n \"\",\n rawModel,\n rootReference\n );\n if (\n null !== initializingChunkBlockedModel &&\n 0 < initializingChunkBlockedModel.deps\n )\n (initializingChunkBlockedModel.value = value), (chunk.status = \"blocked\");\n else {\n var resolveListeners = chunk.value;\n chunk.status = \"fulfilled\";\n chunk.value = value;\n null !== resolveListeners && wakeChunk(resolveListeners, value);\n }\n } catch (error) {\n (chunk.status = \"rejected\"), (chunk.reason = error);\n } finally {\n (initializingChunk = prevChunk),\n (initializingChunkBlockedModel = prevBlocked);\n }\n}\nfunction reportGlobalError(response, error) {\n response._closed = !0;\n response._closedReason = error;\n response._chunks.forEach(function (chunk) {\n \"pending\" === chunk.status && triggerErrorOnChunk(chunk, error);\n });\n}\nfunction getChunk(response, id) {\n var chunks = response._chunks,\n chunk = chunks.get(id);\n chunk ||\n ((chunk = response._formData.get(response._prefix + id)),\n (chunk =\n null != chunk\n ? new Chunk(\"resolved_model\", chunk, id, response)\n : response._closed\n ? new Chunk(\"rejected\", null, response._closedReason, response)\n : createPendingChunk(response)),\n chunks.set(id, chunk));\n return chunk;\n}\nfunction createModelResolver(\n chunk,\n parentObject,\n key,\n cyclic,\n response,\n map,\n path\n) {\n if (initializingChunkBlockedModel) {\n var blocked = initializingChunkBlockedModel;\n cyclic || blocked.deps++;\n } else\n blocked = initializingChunkBlockedModel = {\n deps: cyclic ? 0 : 1,\n value: null\n };\n return function (value) {\n for (var i = 1; i < path.length; i++) value = value[path[i]];\n parentObject[key] = map(response, value);\n \"\" === key && null === blocked.value && (blocked.value = parentObject[key]);\n blocked.deps--;\n 0 === blocked.deps &&\n \"blocked\" === chunk.status &&\n ((value = chunk.value),\n (chunk.status = \"fulfilled\"),\n (chunk.value = blocked.value),\n null !== value && wakeChunk(value, blocked.value));\n };\n}\nfunction createModelReject(chunk) {\n return function (error) {\n return triggerErrorOnChunk(chunk, error);\n };\n}\nfunction getOutlinedModel(response, reference, parentObject, key, map) {\n reference = reference.split(\":\");\n var id = parseInt(reference[0], 16);\n id = getChunk(response, id);\n switch (id.status) {\n case \"resolved_model\":\n initializeModelChunk(id);\n }\n switch (id.status) {\n case \"fulfilled\":\n parentObject = id.value;\n for (key = 1; key < reference.length; key++)\n parentObject = parentObject[reference[key]];\n return map(response, parentObject);\n case \"pending\":\n case \"blocked\":\n case \"cyclic\":\n var parentChunk = initializingChunk;\n id.then(\n createModelResolver(\n parentChunk,\n parentObject,\n key,\n \"cyclic\" === id.status,\n response,\n map,\n reference\n ),\n createModelReject(parentChunk)\n );\n return null;\n default:\n throw id.reason;\n }\n}\nfunction createMap(response, model) {\n return new Map(model);\n}\nfunction createSet(response, model) {\n return new Set(model);\n}\nfunction extractIterator(response, model) {\n return model[Symbol.iterator]();\n}\nfunction createModel(response, model) {\n return model;\n}\nfunction parseTypedArray(\n response,\n reference,\n constructor,\n bytesPerElement,\n parentObject,\n parentKey\n) {\n reference = parseInt(reference.slice(2), 16);\n reference = response._formData.get(response._prefix + reference);\n reference =\n constructor === ArrayBuffer\n ? reference.arrayBuffer()\n : reference.arrayBuffer().then(function (buffer) {\n return new constructor(buffer);\n });\n bytesPerElement = initializingChunk;\n reference.then(\n createModelResolver(\n bytesPerElement,\n parentObject,\n parentKey,\n !1,\n response,\n createModel,\n []\n ),\n createModelReject(bytesPerElement)\n );\n return null;\n}\nfunction resolveStream(response, id, stream, controller) {\n var chunks = response._chunks;\n stream = new Chunk(\"fulfilled\", stream, controller, response);\n chunks.set(id, stream);\n response = response._formData.getAll(response._prefix + id);\n for (id = 0; id < response.length; id++)\n (chunks = response[id]),\n \"C\" === chunks[0]\n ? controller.close(\"C\" === chunks ? '\"$undefined\"' : chunks.slice(1))\n : controller.enqueueModel(chunks);\n}\nfunction parseReadableStream(response, reference, type) {\n reference = parseInt(reference.slice(2), 16);\n var controller = null;\n type = new ReadableStream({\n type: type,\n start: function (c) {\n controller = c;\n }\n });\n var previousBlockedChunk = null;\n resolveStream(response, reference, type, {\n enqueueModel: function (json) {\n if (null === previousBlockedChunk) {\n var chunk = new Chunk(\"resolved_model\", json, -1, response);\n initializeModelChunk(chunk);\n \"fulfilled\" === chunk.status\n ? controller.enqueue(chunk.value)\n : (chunk.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n ),\n (previousBlockedChunk = chunk));\n } else {\n chunk = previousBlockedChunk;\n var chunk$30 = createPendingChunk(response);\n chunk$30.then(\n function (v) {\n return controller.enqueue(v);\n },\n function (e) {\n return controller.error(e);\n }\n );\n previousBlockedChunk = chunk$30;\n chunk.then(function () {\n previousBlockedChunk === chunk$30 && (previousBlockedChunk = null);\n resolveModelChunk(chunk$30, json, -1);\n });\n }\n },\n close: function () {\n if (null === previousBlockedChunk) controller.close();\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.close();\n });\n }\n },\n error: function (error) {\n if (null === previousBlockedChunk) controller.error(error);\n else {\n var blockedChunk = previousBlockedChunk;\n previousBlockedChunk = null;\n blockedChunk.then(function () {\n return controller.error(error);\n });\n }\n }\n });\n return type;\n}\nfunction asyncIterator() {\n return this;\n}\nfunction createIterator(next) {\n next = { next: next };\n next[ASYNC_ITERATOR] = asyncIterator;\n return next;\n}\nfunction parseAsyncIterable(response, reference, iterator) {\n reference = parseInt(reference.slice(2), 16);\n var buffer = [],\n closed = !1,\n nextWriteIndex = 0,\n $jscomp$compprop2 = {};\n $jscomp$compprop2 =\n (($jscomp$compprop2[ASYNC_ITERATOR] = function () {\n var nextReadIndex = 0;\n return createIterator(function (arg) {\n if (void 0 !== arg)\n throw Error(\n \"Values cannot be passed to next() of AsyncIterables passed to Client Components.\"\n );\n if (nextReadIndex === buffer.length) {\n if (closed)\n return new Chunk(\n \"fulfilled\",\n { done: !0, value: void 0 },\n null,\n response\n );\n buffer[nextReadIndex] = createPendingChunk(response);\n }\n return buffer[nextReadIndex++];\n });\n }),\n $jscomp$compprop2);\n iterator = iterator ? $jscomp$compprop2[ASYNC_ITERATOR]() : $jscomp$compprop2;\n resolveStream(response, reference, iterator, {\n enqueueModel: function (value) {\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !1\n ))\n : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !1);\n nextWriteIndex++;\n },\n close: function (value) {\n closed = !0;\n nextWriteIndex === buffer.length\n ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(\n response,\n value,\n !0\n ))\n : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !0);\n for (nextWriteIndex++; nextWriteIndex < buffer.length; )\n resolveIteratorResultChunk(\n buffer[nextWriteIndex++],\n '\"$undefined\"',\n !0\n );\n },\n error: function (error) {\n closed = !0;\n for (\n nextWriteIndex === buffer.length &&\n (buffer[nextWriteIndex] = createPendingChunk(response));\n nextWriteIndex < buffer.length;\n\n )\n triggerErrorOnChunk(buffer[nextWriteIndex++], error);\n }\n });\n return iterator;\n}\nfunction parseModelString(response, obj, key, value, reference) {\n if (\"$\" === value[0]) {\n switch (value[1]) {\n case \"$\":\n return value.slice(1);\n case \"@\":\n return (obj = parseInt(value.slice(2), 16)), getChunk(response, obj);\n case \"F\":\n return (\n (value = value.slice(2)),\n (value = getOutlinedModel(response, value, obj, key, createModel)),\n loadServerReference$1(\n response,\n value.id,\n value.bound,\n initializingChunk,\n obj,\n key\n )\n );\n case \"T\":\n if (void 0 === reference || void 0 === response._temporaryReferences)\n throw Error(\n \"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server.\"\n );\n return createTemporaryReference(\n response._temporaryReferences,\n reference\n );\n case \"Q\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, obj, key, createMap)\n );\n case \"W\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, obj, key, createSet)\n );\n case \"K\":\n obj = value.slice(2);\n var formPrefix = response._prefix + obj + \"_\",\n data = new FormData();\n response._formData.forEach(function (entry, entryKey) {\n entryKey.startsWith(formPrefix) &&\n data.append(entryKey.slice(formPrefix.length), entry);\n });\n return data;\n case \"i\":\n return (\n (value = value.slice(2)),\n getOutlinedModel(response, value, obj, key, extractIterator)\n );\n case \"I\":\n return Infinity;\n case \"-\":\n return \"$-0\" === value ? -0 : -Infinity;\n case \"N\":\n return NaN;\n case \"u\":\n return;\n case \"D\":\n return new Date(Date.parse(value.slice(2)));\n case \"n\":\n return BigInt(value.slice(2));\n }\n switch (value[1]) {\n case \"A\":\n return parseTypedArray(response, value, ArrayBuffer, 1, obj, key);\n case \"O\":\n return parseTypedArray(response, value, Int8Array, 1, obj, key);\n case \"o\":\n return parseTypedArray(response, value, Uint8Array, 1, obj, key);\n case \"U\":\n return parseTypedArray(response, value, Uint8ClampedArray, 1, obj, key);\n case \"S\":\n return parseTypedArray(response, value, Int16Array, 2, obj, key);\n case \"s\":\n return parseTypedArray(response, value, Uint16Array, 2, obj, key);\n case \"L\":\n return parseTypedArray(response, value, Int32Array, 4, obj, key);\n case \"l\":\n return parseTypedArray(response, value, Uint32Array, 4, obj, key);\n case \"G\":\n return parseTypedArray(response, value, Float32Array, 4, obj, key);\n case \"g\":\n return parseTypedArray(response, value, Float64Array, 8, obj, key);\n case \"M\":\n return parseTypedArray(response, value, BigInt64Array, 8, obj, key);\n case \"m\":\n return parseTypedArray(response, value, BigUint64Array, 8, obj, key);\n case \"V\":\n return parseTypedArray(response, value, DataView, 1, obj, key);\n case \"B\":\n return (\n (obj = parseInt(value.slice(2), 16)),\n response._formData.get(response._prefix + obj)\n );\n }\n switch (value[1]) {\n case \"R\":\n return parseReadableStream(response, value, void 0);\n case \"r\":\n return parseReadableStream(response, value, \"bytes\");\n case \"X\":\n return parseAsyncIterable(response, value, !1);\n case \"x\":\n return parseAsyncIterable(response, value, !0);\n }\n value = value.slice(1);\n return getOutlinedModel(response, value, obj, key, createModel);\n }\n return value;\n}\nfunction createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {\n var backingFormData =\n 3 < arguments.length && void 0 !== arguments[3]\n ? arguments[3]\n : new FormData(),\n chunks = new Map();\n return {\n _bundlerConfig: bundlerConfig,\n _prefix: formFieldPrefix,\n _formData: backingFormData,\n _chunks: chunks,\n _closed: !1,\n _closedReason: null,\n _temporaryReferences: temporaryReferences\n };\n}\nfunction resolveField(response, key, value) {\n response._formData.append(key, value);\n var prefix = response._prefix;\n key.startsWith(prefix) &&\n ((response = response._chunks),\n (key = +key.slice(prefix.length)),\n (prefix = response.get(key)) && resolveModelChunk(prefix, value, key));\n}\nfunction close(response) {\n reportGlobalError(response, Error(\"Connection closed.\"));\n}\nfunction loadServerReference(bundlerConfig, id, bound) {\n var serverReference = resolveServerReference(bundlerConfig, id);\n bundlerConfig = preloadModule(serverReference);\n return bound\n ? Promise.all([bound, bundlerConfig]).then(function (_ref) {\n _ref = _ref[0];\n var fn = requireModule(serverReference);\n return fn.bind.apply(fn, [null].concat(_ref));\n })\n : bundlerConfig\n ? Promise.resolve(bundlerConfig).then(function () {\n return requireModule(serverReference);\n })\n : Promise.resolve(requireModule(serverReference));\n}\nfunction decodeBoundActionMetaData(body, serverManifest, formFieldPrefix) {\n body = createResponse(serverManifest, formFieldPrefix, void 0, body);\n close(body);\n body = getChunk(body, 0);\n body.then(function () {});\n if (\"fulfilled\" !== body.status) throw body.reason;\n return body.value;\n}\nfunction createDrainHandler(destination, request) {\n return function () {\n return startFlowing(request, destination);\n };\n}\nfunction createCancelHandler(request, reason) {\n return function () {\n request.destination = null;\n abort(request, Error(reason));\n };\n}\nfunction createFakeWritableFromReadableStreamController(controller) {\n return {\n write: function (chunk) {\n \"string\" === typeof chunk && (chunk = textEncoder.encode(chunk));\n controller.enqueue(chunk);\n return !0;\n },\n end: function () {\n controller.close();\n },\n destroy: function (error) {\n \"function\" === typeof controller.error\n ? controller.error(error)\n : controller.close();\n }\n };\n}\nfunction createFakeWritableFromNodeReadable(readable) {\n return {\n write: function (chunk) {\n return readable.push(chunk);\n },\n end: function () {\n readable.push(null);\n },\n destroy: function (error) {\n readable.destroy(error);\n }\n };\n}\nexports.createClientModuleProxy = function (moduleId) {\n moduleId = registerClientReferenceImpl({}, moduleId, !1);\n return new Proxy(moduleId, proxyHandlers$1);\n};\nexports.createTemporaryReferenceSet = function () {\n return new WeakMap();\n};\nexports.decodeAction = function (body, serverManifest) {\n var formData = new FormData(),\n action = null;\n body.forEach(function (value, key) {\n key.startsWith(\"$ACTION_\")\n ? key.startsWith(\"$ACTION_REF_\")\n ? ((value = \"$ACTION_\" + key.slice(12) + \":\"),\n (value = decodeBoundActionMetaData(body, serverManifest, value)),\n (action = loadServerReference(serverManifest, value.id, value.bound)))\n : key.startsWith(\"$ACTION_ID_\") &&\n ((value = key.slice(11)),\n (action = loadServerReference(serverManifest, value, null)))\n : formData.append(key, value);\n });\n return null === action\n ? null\n : action.then(function (fn) {\n return fn.bind(null, formData);\n });\n};\nexports.decodeFormState = function (actionResult, body, serverManifest) {\n var keyPath = body.get(\"$ACTION_KEY\");\n if (\"string\" !== typeof keyPath) return Promise.resolve(null);\n var metaData = null;\n body.forEach(function (value, key) {\n key.startsWith(\"$ACTION_REF_\") &&\n ((value = \"$ACTION_\" + key.slice(12) + \":\"),\n (metaData = decodeBoundActionMetaData(body, serverManifest, value)));\n });\n if (null === metaData) return Promise.resolve(null);\n var referenceId = metaData.id;\n return Promise.resolve(metaData.bound).then(function (bound) {\n return null === bound\n ? null\n : [actionResult, keyPath, referenceId, bound.length - 1];\n });\n};\nexports.decodeReply = function (body, webpackMap, options) {\n if (\"string\" === typeof body) {\n var form = new FormData();\n form.append(\"0\", body);\n body = form;\n }\n body = createResponse(\n webpackMap,\n \"\",\n options ? options.temporaryReferences : void 0,\n body\n );\n webpackMap = getChunk(body, 0);\n close(body);\n return webpackMap;\n};\nexports.decodeReplyFromAsyncIterable = function (\n iterable,\n webpackMap,\n options\n) {\n function progress(entry) {\n if (entry.done) close(response);\n else {\n var _entry$value = entry.value;\n entry = _entry$value[0];\n _entry$value = _entry$value[1];\n \"string\" === typeof _entry$value\n ? resolveField(response, entry, _entry$value)\n : response._formData.append(entry, _entry$value);\n iterator.next().then(progress, error);\n }\n }\n function error(reason) {\n reportGlobalError(response, reason);\n \"function\" === typeof iterator.throw &&\n iterator.throw(reason).then(error, error);\n }\n var iterator = iterable[ASYNC_ITERATOR](),\n response = createResponse(\n webpackMap,\n \"\",\n options ? options.temporaryReferences : void 0\n );\n iterator.next().then(progress, error);\n return getChunk(response, 0);\n};\nexports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {\n var response = createResponse(\n webpackMap,\n \"\",\n options ? options.temporaryReferences : void 0\n ),\n pendingFiles = 0,\n queuedFields = [];\n busboyStream.on(\"field\", function (name, value) {\n 0 < pendingFiles\n ? queuedFields.push(name, value)\n : resolveField(response, name, value);\n });\n busboyStream.on(\"file\", function (name, value, _ref2) {\n var filename = _ref2.filename,\n mimeType = _ref2.mimeType;\n if (\"base64\" === _ref2.encoding.toLowerCase())\n throw Error(\n \"React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it.\"\n );\n pendingFiles++;\n var JSCompiler_object_inline_chunks_280 = [];\n value.on(\"data\", function (chunk) {\n JSCompiler_object_inline_chunks_280.push(chunk);\n });\n value.on(\"end\", function () {\n var blob = new Blob(JSCompiler_object_inline_chunks_280, {\n type: mimeType\n });\n response._formData.append(name, blob, filename);\n pendingFiles--;\n if (0 === pendingFiles) {\n for (blob = 0; blob < queuedFields.length; blob += 2)\n resolveField(response, queuedFields[blob], queuedFields[blob + 1]);\n queuedFields.length = 0;\n }\n });\n });\n busboyStream.on(\"finish\", function () {\n close(response);\n });\n busboyStream.on(\"error\", function (err) {\n reportGlobalError(response, err);\n });\n return getChunk(response, 0);\n};\nexports.prerender = function (model, webpackMap, options) {\n return new Promise(function (resolve, reject) {\n var request = new RequestInstance(\n 21,\n model,\n webpackMap,\n options ? options.onError : void 0,\n options ? options.onPostpone : void 0,\n function () {\n var writable,\n stream = new ReadableStream(\n {\n type: \"bytes\",\n start: function (controller) {\n writable =\n createFakeWritableFromReadableStreamController(controller);\n },\n pull: function () {\n startFlowing(request, writable);\n },\n cancel: function (reason) {\n request.destination = null;\n abort(request, reason);\n }\n },\n { highWaterMark: 0 }\n );\n resolve({ prelude: stream });\n },\n reject,\n options ? options.identifierPrefix : void 0,\n options ? options.temporaryReferences : void 0\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(request, signal.reason);\n else {\n var listener = function () {\n abort(request, signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n startWork(request);\n });\n};\nexports.prerenderToNodeStream = function (model, webpackMap, options) {\n return new Promise(function (resolve, reject) {\n var request = new RequestInstance(\n 21,\n model,\n webpackMap,\n options ? options.onError : void 0,\n options ? options.onPostpone : void 0,\n function () {\n var readable = new stream.Readable({\n read: function () {\n startFlowing(request, writable);\n }\n }),\n writable = createFakeWritableFromNodeReadable(readable);\n resolve({ prelude: readable });\n },\n reject,\n options ? options.identifierPrefix : void 0,\n options ? options.temporaryReferences : void 0\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(request, signal.reason);\n else {\n var listener = function () {\n abort(request, signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n startWork(request);\n });\n};\nexports.registerClientReference = function (\n proxyImplementation,\n id,\n exportName\n) {\n return registerClientReferenceImpl(\n proxyImplementation,\n id + \"#\" + exportName,\n !1\n );\n};\nexports.registerServerReference = function (reference, id, exportName) {\n return Object.defineProperties(reference, {\n $$typeof: { value: SERVER_REFERENCE_TAG },\n $$id: {\n value: null === exportName ? id : id + \"#\" + exportName,\n configurable: !0\n },\n $$bound: { value: null, configurable: !0 },\n bind: { value: bind, configurable: !0 }\n });\n};\nexports.renderToPipeableStream = function (model, webpackMap, options) {\n var request = new RequestInstance(\n 20,\n model,\n webpackMap,\n options ? options.onError : void 0,\n options ? options.onPostpone : void 0,\n noop,\n noop,\n options ? options.identifierPrefix : void 0,\n options ? options.temporaryReferences : void 0\n ),\n hasStartedFlowing = !1;\n startWork(request);\n return {\n pipe: function (destination) {\n if (hasStartedFlowing)\n throw Error(\n \"React currently only supports piping to one writable stream.\"\n );\n hasStartedFlowing = !0;\n startFlowing(request, destination);\n destination.on(\"drain\", createDrainHandler(destination, request));\n destination.on(\n \"error\",\n createCancelHandler(\n request,\n \"The destination stream errored while writing data.\"\n )\n );\n destination.on(\n \"close\",\n createCancelHandler(request, \"The destination stream closed early.\")\n );\n return destination;\n },\n abort: function (reason) {\n abort(request, reason);\n }\n };\n};\nexports.renderToReadableStream = function (model, webpackMap, options) {\n var request = new RequestInstance(\n 20,\n model,\n webpackMap,\n options ? options.onError : void 0,\n options ? options.onPostpone : void 0,\n noop,\n noop,\n options ? options.identifierPrefix : void 0,\n options ? options.temporaryReferences : void 0\n );\n if (options && options.signal) {\n var signal = options.signal;\n if (signal.aborted) abort(request, signal.reason);\n else {\n var listener = function () {\n abort(request, signal.reason);\n signal.removeEventListener(\"abort\", listener);\n };\n signal.addEventListener(\"abort\", listener);\n }\n }\n var writable;\n return new ReadableStream(\n {\n type: \"bytes\",\n start: function (controller) {\n writable = createFakeWritableFromReadableStreamController(controller);\n startWork(request);\n },\n pull: function () {\n startFlowing(request, writable);\n },\n cancel: function (reason) {\n request.destination = null;\n abort(request, reason);\n }\n },\n { highWaterMark: 0 }\n );\n};\n","'use strict';\n\nvar s;\nif (process.env.NODE_ENV === 'production') {\n s = require('./cjs/react-server-dom-webpack-server.node.production.js');\n} else {\n s = require('./cjs/react-server-dom-webpack-server.node.development.js');\n}\n\nexports.renderToReadableStream = s.renderToReadableStream;\nexports.renderToPipeableStream = s.renderToPipeableStream;\nexports.decodeReply = s.decodeReply;\nexports.decodeReplyFromBusboy = s.decodeReplyFromBusboy;\nexports.decodeReplyFromAsyncIterable = s.decodeReplyFromAsyncIterable;\nexports.decodeAction = s.decodeAction;\nexports.decodeFormState = s.decodeFormState;\nexports.registerServerReference = s.registerServerReference;\nexports.registerClientReference = s.registerClientReference;\nexports.createClientModuleProxy = s.createClientModuleProxy;\nexports.createTemporaryReferenceSet = s.createTemporaryReferenceSet;\n","'use strict';\n\nvar s;\nif (process.env.NODE_ENV === 'production') {\n s = require('./cjs/react-server-dom-webpack-server.node.production.js');\n} else {\n s = require('./cjs/react-server-dom-webpack-server.node.development.js');\n}\n\nexports.prerender = s.prerender;\nexports.prerenderToNodeStream = s.prerenderToNodeStream;\n","import * as React from 'react'\nimport * as ReactDOM from 'react-dom'\nimport * as ReactJsxDevRuntime from 'react/jsx-dev-runtime'\nimport * as ReactJsxRuntime from 'react/jsx-runtime'\nimport * as ReactCompilerRuntime from 'react/compiler-runtime'\n\nfunction getAltProxyForBindingsDEV(\n type: 'Turbopack' | 'Webpack',\n pkg:\n | 'react-server-dom-turbopack/server'\n | 'react-server-dom-turbopack/static'\n | 'react-server-dom-webpack/server'\n | 'react-server-dom-webpack/static'\n) {\n if (process.env.NODE_ENV === 'development') {\n const altType = type === 'Turbopack' ? 'Webpack' : 'Turbopack'\n const altPkg = pkg.replace(new RegExp(type, 'gi'), altType.toLowerCase())\n\n return new Proxy(\n {},\n {\n get(_, prop: string) {\n throw new Error(\n `Expected to use ${type} bindings (${pkg}) for React but the current process is referencing '${prop}' from the ${altType} bindings (${altPkg}). This is likely a bug in our integration of the Next.js server runtime.`\n )\n },\n }\n )\n }\n}\n\nlet ReactServerDOMTurbopackServer, ReactServerDOMWebpackServer\nlet ReactServerDOMTurbopackStatic, ReactServerDOMWebpackStatic\n\nif (process.env.TURBOPACK) {\n ReactServerDOMTurbopackServer =\n // @ts-expect-error -- TODO: Add types\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-turbopack/server') as typeof import('react-server-dom-turbopack/server')\n if (process.env.NODE_ENV === 'development') {\n ReactServerDOMWebpackServer = getAltProxyForBindingsDEV(\n 'Turbopack',\n 'react-server-dom-turbopack/server'\n )\n }\n ReactServerDOMTurbopackStatic =\n // @ts-expect-error -- TODO: Add types\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-turbopack/static') as typeof import('react-server-dom-turbopack/static')\n if (process.env.NODE_ENV === 'development') {\n ReactServerDOMWebpackStatic = getAltProxyForBindingsDEV(\n 'Turbopack',\n 'react-server-dom-turbopack/static'\n )\n }\n} else {\n ReactServerDOMWebpackServer =\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/server') as typeof import('react-server-dom-webpack/server')\n if (process.env.NODE_ENV === 'development') {\n ReactServerDOMTurbopackServer = getAltProxyForBindingsDEV(\n 'Webpack',\n 'react-server-dom-webpack/server'\n )\n }\n ReactServerDOMWebpackStatic =\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/static') as typeof import('react-server-dom-webpack/static')\n if (process.env.NODE_ENV === 'development') {\n ReactServerDOMTurbopackStatic = getAltProxyForBindingsDEV(\n 'Webpack',\n 'react-server-dom-webpack/static'\n )\n }\n}\n\nexport {\n React,\n ReactJsxDevRuntime,\n ReactJsxRuntime,\n ReactCompilerRuntime,\n ReactDOM,\n ReactServerDOMTurbopackServer,\n ReactServerDOMTurbopackStatic,\n ReactServerDOMWebpackServer,\n ReactServerDOMWebpackStatic,\n}\n","(()=>{var e={113:e=>{\"use strict\";e.exports=require(\"crypto\")},660:(e,r,t)=>{let l=t(113);let{urlAlphabet:a}=t(591);const n=128;let _,u;let fillPool=e=>{if(!_||_.length<e){_=Buffer.allocUnsafe(e*n);l.randomFillSync(_);u=0}else if(u+e>_.length){l.randomFillSync(_);u=0}u+=e};let random=e=>{fillPool(e-=0);return _.subarray(u-e,u)};let customRandom=(e,r,t)=>{let l=(2<<31-Math.clz32(e.length-1|1))-1;let a=Math.ceil(1.6*l*r/e.length);return()=>{let n=\"\";while(true){let _=t(a);let u=a;while(u--){n+=e[_[u]&l]||\"\";if(n.length===r)return n}}}};let customAlphabet=(e,r)=>customRandom(e,r,random);let nanoid=(e=21)=>{fillPool(e-=0);let r=\"\";for(let t=u-e;t<u;t++){r+=a[_[t]&63]}return r};e.exports={nanoid:nanoid,customAlphabet:customAlphabet,customRandom:customRandom,urlAlphabet:a,random:random}},591:e=>{let r=\"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict\";e.exports={urlAlphabet:r}}};var r={};function __nccwpck_require__(t){var l=r[t];if(l!==undefined){return l.exports}var a=r[t]={exports:{}};var n=true;try{e[t](a,a.exports,__nccwpck_require__);n=false}finally{if(n)delete r[t]}return a.exports}if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var t=__nccwpck_require__(660);module.exports=t})();","(()=>{var e={318:function(e,t){(function(e,n){true?n(t):0})(this,(function(e){\"use strict\";class StructError extends TypeError{constructor(e,t){let n;const{message:r,explanation:i,...c}=e;const{path:o}=e;const a=o.length===0?r:`At path: ${o.join(\".\")} -- ${r}`;super(i??a);if(i!=null)this.cause=a;Object.assign(this,c);this.name=this.constructor.name;this.failures=()=>n??(n=[e,...t()])}}function isIterable(e){return isObject(e)&&typeof e[Symbol.iterator]===\"function\"}function isObject(e){return typeof e===\"object\"&&e!=null}function isPlainObject(e){if(Object.prototype.toString.call(e)!==\"[object Object]\"){return false}const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function print(e){if(typeof e===\"symbol\"){return e.toString()}return typeof e===\"string\"?JSON.stringify(e):`${e}`}function shiftIterator(e){const{done:t,value:n}=e.next();return t?undefined:n}function toFailure(e,t,n,r){if(e===true){return}else if(e===false){e={}}else if(typeof e===\"string\"){e={message:e}}const{path:i,branch:c}=t;const{type:o}=n;const{refinement:a,message:s=`Expected a value of type \\`${o}\\`${a?` with refinement \\`${a}\\``:\"\"}, but received: \\`${print(r)}\\``}=e;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:c,...e,message:s}}function*toFailures(e,t,n,r){if(!isIterable(e)){e=[e]}for(const i of e){const e=toFailure(i,t,n,r);if(e){yield e}}}function*run(e,t,n={}){const{path:r=[],branch:i=[e],coerce:c=false,mask:o=false}=n;const a={path:r,branch:i};if(c){e=t.coercer(e,a);if(o&&t.type!==\"type\"&&isObject(t.schema)&&isObject(e)&&!Array.isArray(e)){for(const n in e){if(t.schema[n]===undefined){delete e[n]}}}}let s=\"valid\";for(const r of t.validator(e,a)){r.explanation=n.message;s=\"not_valid\";yield[r,undefined]}for(let[u,f,l]of t.entries(e,a)){const t=run(f,l,{path:u===undefined?r:[...r,u],branch:u===undefined?i:[...i,f],coerce:c,mask:o,message:n.message});for(const n of t){if(n[0]){s=n[0].refinement!=null?\"not_refined\":\"not_valid\";yield[n[0],undefined]}else if(c){f=n[1];if(u===undefined){e=f}else if(e instanceof Map){e.set(u,f)}else if(e instanceof Set){e.add(f)}else if(isObject(e)){if(f!==undefined||u in e)e[u]=f}}}}if(s!==\"not_valid\"){for(const r of t.refiner(e,a)){r.explanation=n.message;s=\"not_refined\";yield[r,undefined]}}if(s===\"valid\"){yield[undefined,e]}}class Struct{constructor(e){const{type:t,schema:n,validator:r,refiner:i,coercer:c=(e=>e),entries:o=function*(){}}=e;this.type=t;this.schema=n;this.entries=o;this.coercer=c;if(r){this.validator=(e,t)=>{const n=r(e,t);return toFailures(n,t,this,e)}}else{this.validator=()=>[]}if(i){this.refiner=(e,t)=>{const n=i(e,t);return toFailures(n,t,this,e)}}else{this.refiner=()=>[]}}assert(e,t){return assert(e,this,t)}create(e,t){return create(e,this,t)}is(e){return is(e,this)}mask(e,t){return mask(e,this,t)}validate(e,t={}){return validate(e,this,t)}}function assert(e,t,n){const r=validate(e,t,{message:n});if(r[0]){throw r[0]}}function create(e,t,n){const r=validate(e,t,{coerce:true,message:n});if(r[0]){throw r[0]}else{return r[1]}}function mask(e,t,n){const r=validate(e,t,{coerce:true,mask:true,message:n});if(r[0]){throw r[0]}else{return r[1]}}function is(e,t){const n=validate(e,t);return!n[0]}function validate(e,t,n={}){const r=run(e,t,n);const i=shiftIterator(r);if(i[0]){const e=new StructError(i[0],(function*(){for(const e of r){if(e[0]){yield e[0]}}}));return[e,undefined]}else{const e=i[1];return[undefined,e]}}function assign(...e){const t=e[0].type===\"type\";const n=e.map((e=>e.schema));const r=Object.assign({},...n);return t?type(r):object(r)}function define(e,t){return new Struct({type:e,schema:null,validator:t})}function deprecated(e,t){return new Struct({...e,refiner:(t,n)=>t===undefined||e.refiner(t,n),validator(n,r){if(n===undefined){return true}else{t(n,r);return e.validator(n,r)}}})}function dynamic(e){return new Struct({type:\"dynamic\",schema:null,*entries(t,n){const r=e(t,n);yield*r.entries(t,n)},validator(t,n){const r=e(t,n);return r.validator(t,n)},coercer(t,n){const r=e(t,n);return r.coercer(t,n)},refiner(t,n){const r=e(t,n);return r.refiner(t,n)}})}function lazy(e){let t;return new Struct({type:\"lazy\",schema:null,*entries(n,r){t??(t=e());yield*t.entries(n,r)},validator(n,r){t??(t=e());return t.validator(n,r)},coercer(n,r){t??(t=e());return t.coercer(n,r)},refiner(n,r){t??(t=e());return t.refiner(n,r)}})}function omit(e,t){const{schema:n}=e;const r={...n};for(const e of t){delete r[e]}switch(e.type){case\"type\":return type(r);default:return object(r)}}function partial(e){const t=e instanceof Struct?{...e.schema}:{...e};for(const e in t){t[e]=optional(t[e])}return object(t)}function pick(e,t){const{schema:n}=e;const r={};for(const e of t){r[e]=n[e]}return object(r)}function struct(e,t){console.warn(\"superstruct@0.11 - The `struct` helper has been renamed to `define`.\");return define(e,t)}function any(){return define(\"any\",(()=>true))}function array(e){return new Struct({type:\"array\",schema:e,*entries(t){if(e&&Array.isArray(t)){for(const[n,r]of t.entries()){yield[n,r,e]}}},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${print(e)}`}})}function bigint(){return define(\"bigint\",(e=>typeof e===\"bigint\"))}function boolean(){return define(\"boolean\",(e=>typeof e===\"boolean\"))}function date(){return define(\"date\",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \\`Date\\` object, but received: ${print(e)}`))}function enums(e){const t={};const n=e.map((e=>print(e))).join();for(const n of e){t[n]=n}return new Struct({type:\"enums\",schema:t,validator(t){return e.includes(t)||`Expected one of \\`${n}\\`, but received: ${print(t)}`}})}function func(){return define(\"func\",(e=>typeof e===\"function\"||`Expected a function, but received: ${print(e)}`))}function instance(e){return define(\"instance\",(t=>t instanceof e||`Expected a \\`${e.name}\\` instance, but received: ${print(t)}`))}function integer(){return define(\"integer\",(e=>typeof e===\"number\"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${print(e)}`))}function intersection(e){return new Struct({type:\"intersection\",schema:null,*entries(t,n){for(const r of e){yield*r.entries(t,n)}},*validator(t,n){for(const r of e){yield*r.validator(t,n)}},*refiner(t,n){for(const r of e){yield*r.refiner(t,n)}}})}function literal(e){const t=print(e);const n=typeof e;return new Struct({type:\"literal\",schema:n===\"string\"||n===\"number\"||n===\"boolean\"?e:null,validator(n){return n===e||`Expected the literal \\`${t}\\`, but received: ${print(n)}`}})}function map(e,t){return new Struct({type:\"map\",schema:null,*entries(n){if(e&&t&&n instanceof Map){for(const[r,i]of n.entries()){yield[r,r,e];yield[r,i,t]}}},coercer(e){return e instanceof Map?new Map(e):e},validator(e){return e instanceof Map||`Expected a \\`Map\\` object, but received: ${print(e)}`}})}function never(){return define(\"never\",(()=>false))}function nullable(e){return new Struct({...e,validator:(t,n)=>t===null||e.validator(t,n),refiner:(t,n)=>t===null||e.refiner(t,n)})}function number(){return define(\"number\",(e=>typeof e===\"number\"&&!isNaN(e)||`Expected a number, but received: ${print(e)}`))}function object(e){const t=e?Object.keys(e):[];const n=never();return new Struct({type:\"object\",schema:e?e:null,*entries(r){if(e&&isObject(r)){const i=new Set(Object.keys(r));for(const n of t){i.delete(n);yield[n,r[n],e[n]]}for(const e of i){yield[e,r[e],n]}}},validator(e){return isObject(e)||`Expected an object, but received: ${print(e)}`},coercer(e){return isObject(e)?{...e}:e}})}function optional(e){return new Struct({...e,validator:(t,n)=>t===undefined||e.validator(t,n),refiner:(t,n)=>t===undefined||e.refiner(t,n)})}function record(e,t){return new Struct({type:\"record\",schema:null,*entries(n){if(isObject(n)){for(const r in n){const i=n[r];yield[r,r,e];yield[r,i,t]}}},validator(e){return isObject(e)||`Expected an object, but received: ${print(e)}`}})}function regexp(){return define(\"regexp\",(e=>e instanceof RegExp))}function set(e){return new Struct({type:\"set\",schema:null,*entries(t){if(e&&t instanceof Set){for(const n of t){yield[n,n,e]}}},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \\`Set\\` object, but received: ${print(e)}`}})}function string(){return define(\"string\",(e=>typeof e===\"string\"||`Expected a string, but received: ${print(e)}`))}function tuple(e){const t=never();return new Struct({type:\"tuple\",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(e.length,n.length);for(let i=0;i<r;i++){yield[i,n[i],e[i]||t]}}},validator(e){return Array.isArray(e)||`Expected an array, but received: ${print(e)}`}})}function type(e){const t=Object.keys(e);return new Struct({type:\"type\",schema:e,*entries(n){if(isObject(n)){for(const r of t){yield[r,n[r],e[r]]}}},validator(e){return isObject(e)||`Expected an object, but received: ${print(e)}`},coercer(e){return isObject(e)?{...e}:e}})}function union(e){const t=e.map((e=>e.type)).join(\" | \");return new Struct({type:\"union\",schema:null,coercer(t){for(const n of e){const[e,r]=n.validate(t,{coerce:true});if(!e){return r}}return t},validator(n,r){const i=[];for(const t of e){const[...e]=run(n,t,r);const[c]=e;if(!c[0]){return[]}else{for(const[t]of e){if(t){i.push(t)}}}}return[`Expected the value to satisfy a union of \\`${t}\\`, but received: ${print(n)}`,...i]}})}function unknown(){return define(\"unknown\",(()=>true))}function coerce(e,t,n){return new Struct({...e,coercer:(r,i)=>is(r,t)?e.coercer(n(r,i),i):e.coercer(r,i)})}function defaulted(e,t,n={}){return coerce(e,unknown(),(e=>{const r=typeof t===\"function\"?t():t;if(e===undefined){return r}if(!n.strict&&isPlainObject(e)&&isPlainObject(r)){const t={...e};let n=false;for(const e in r){if(t[e]===undefined){t[e]=r[e];n=true}}if(n){return t}}return e}))}function trimmed(e){return coerce(e,string(),(e=>e.trim()))}function empty(e){return refine(e,\"empty\",(t=>{const n=getSize(t);return n===0||`Expected an empty ${e.type} but received one with a size of \\`${n}\\``}))}function getSize(e){if(e instanceof Map||e instanceof Set){return e.size}else{return e.length}}function max(e,t,n={}){const{exclusive:r}=n;return refine(e,\"max\",(n=>r?n<t:n<=t||`Expected a ${e.type} less than ${r?\"\":\"or equal to \"}${t} but received \\`${n}\\``))}function min(e,t,n={}){const{exclusive:r}=n;return refine(e,\"min\",(n=>r?n>t:n>=t||`Expected a ${e.type} greater than ${r?\"\":\"or equal to \"}${t} but received \\`${n}\\``))}function nonempty(e){return refine(e,\"nonempty\",(t=>{const n=getSize(t);return n>0||`Expected a nonempty ${e.type} but received an empty one`}))}function pattern(e,t){return refine(e,\"pattern\",(n=>t.test(n)||`Expected a ${e.type} matching \\`/${t.source}/\\` but received \"${n}\"`))}function size(e,t,n=t){const r=`Expected a ${e.type}`;const i=t===n?`of \\`${t}\\``:`between \\`${t}\\` and \\`${n}\\``;return refine(e,\"size\",(e=>{if(typeof e===\"number\"||e instanceof Date){return t<=e&&e<=n||`${r} ${i} but received \\`${e}\\``}else if(e instanceof Map||e instanceof Set){const{size:c}=e;return t<=c&&c<=n||`${r} with a size ${i} but received one with a size of \\`${c}\\``}else{const{length:c}=e;return t<=c&&c<=n||`${r} with a length ${i} but received one with a length of \\`${c}\\``}}))}function refine(e,t,n){return new Struct({...e,*refiner(r,i){yield*e.refiner(r,i);const c=n(r,i);const o=toFailures(c,i,e,r);for(const e of o){yield{...e,refinement:t}}}})}e.Struct=Struct;e.StructError=StructError;e.any=any;e.array=array;e.assert=assert;e.assign=assign;e.bigint=bigint;e.boolean=boolean;e.coerce=coerce;e.create=create;e.date=date;e.defaulted=defaulted;e.define=define;e.deprecated=deprecated;e.dynamic=dynamic;e.empty=empty;e.enums=enums;e.func=func;e.instance=instance;e.integer=integer;e.intersection=intersection;e.is=is;e.lazy=lazy;e.literal=literal;e.map=map;e.mask=mask;e.max=max;e.min=min;e.never=never;e.nonempty=nonempty;e.nullable=nullable;e.number=number;e.object=object;e.omit=omit;e.optional=optional;e.partial=partial;e.pattern=pattern;e.pick=pick;e.record=record;e.refine=refine;e.regexp=regexp;e.set=set;e.size=size;e.string=string;e.struct=struct;e.trimmed=trimmed;e.tuple=tuple;e.type=type;e.union=union;e.unknown=unknown;e.validate=validate}))}};if(typeof __nccwpck_require__!==\"undefined\")__nccwpck_require__.ab=__dirname+\"/\";var t={};e[318](0,t);module.exports=t})();","// getDefaultExport function for compatibility with non-ESM 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};\n","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n __webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => { def[key] = () => (value[key]) });\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve()) ","__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 type { AppPageRouteDefinition } from '../../route-definitions/app-page-route-definition'\nimport type RenderResult from '../../render-result'\nimport type { RenderOpts } from '../../app-render/types'\nimport type { NextParsedUrlQuery } from '../../request-meta'\nimport type { LoaderTree } from '../../lib/app-dir-module'\nimport type { PrerenderManifest } from '../../../build'\n\nimport {\n renderToHTMLOrFlight,\n type AppSharedContext,\n} from '../../app-render/app-render'\nimport {\n RouteModule,\n type RouteModuleOptions,\n type RouteModuleHandleContext,\n} from '../route-module'\nimport * as vendoredContexts from './vendored/contexts/entrypoints'\nimport type { BaseNextRequest, BaseNextResponse } from '../../base-http'\nimport type { ServerComponentsHmrCache } from '../../response-cache'\nimport type { OpaqueFallbackRouteParams } from '../../request/fallback-params'\nimport { PrerenderManifestMatcher } from './helpers/prerender-manifest-matcher'\nimport type { DeepReadonly } from '../../../shared/lib/deep-readonly'\nimport {\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_URL,\n RSC_HEADER,\n} from '../../../client/components/app-router-headers'\nimport { isInterceptionRouteAppPath } from '../../../shared/lib/router/utils/interception-routes'\n\nlet vendoredReactRSC\nlet vendoredReactSSR\n\n// the vendored Reacts are loaded from their original source in the edge runtime\nif (process.env.NEXT_RUNTIME !== 'edge') {\n vendoredReactRSC =\n require('./vendored/rsc/entrypoints') as typeof import('./vendored/rsc/entrypoints')\n vendoredReactSSR =\n require('./vendored/ssr/entrypoints') as typeof import('./vendored/ssr/entrypoints')\n\n // In Node environments we augment console logging with information contextual to a React render.\n // This patching is global so we need to register the cacheSignal getter from our bundled React instances\n // here when we load them rather than in the external module itself when the patch is applied.\n const { registerGetCacheSignal } =\n require('../../node-environment-extensions/console-dim.external') as typeof import('../../node-environment-extensions/console-dim.external')\n registerGetCacheSignal(vendoredReactRSC.React.cacheSignal)\n registerGetCacheSignal(vendoredReactSSR.React.cacheSignal)\n}\n\n/**\n * The AppPageModule is the type of the module exported by the bundled app page\n * module.\n */\nexport type AppPageModule = typeof import('../../../build/templates/app-page')\n\ntype AppPageUserlandModule = {\n /**\n * The tree created in next-app-loader that holds component segments and modules\n */\n loaderTree: LoaderTree\n}\n\nexport interface AppPageRouteHandlerContext extends RouteModuleHandleContext {\n page: string\n query: NextParsedUrlQuery\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n renderOpts: RenderOpts\n serverComponentsHmrCache?: ServerComponentsHmrCache\n sharedContext: AppSharedContext\n}\n\nexport type AppPageRouteModuleOptions = RouteModuleOptions<\n AppPageRouteDefinition,\n AppPageUserlandModule\n>\n\nexport class AppPageRouteModule extends RouteModule<\n AppPageRouteDefinition,\n AppPageUserlandModule\n> {\n private matchers = new WeakMap<\n DeepReadonly<PrerenderManifest>,\n PrerenderManifestMatcher\n >()\n public match(\n pathname: string,\n prerenderManifest: DeepReadonly<PrerenderManifest>\n ) {\n // Lazily create the matcher based on the provided prerender manifest.\n let matcher = this.matchers.get(prerenderManifest)\n if (!matcher) {\n matcher = new PrerenderManifestMatcher(\n this.definition.pathname,\n prerenderManifest\n )\n this.matchers.set(prerenderManifest, matcher)\n }\n\n // Match the pathname to the dynamic route.\n return matcher.match(pathname)\n }\n\n public render(\n req: BaseNextRequest,\n res: BaseNextResponse,\n context: AppPageRouteHandlerContext\n ): Promise<RenderResult> {\n return renderToHTMLOrFlight(\n req,\n res,\n context.page,\n context.query,\n context.fallbackRouteParams,\n context.renderOpts,\n context.serverComponentsHmrCache,\n context.sharedContext\n )\n }\n\n private pathCouldBeIntercepted(\n resolvedPathname: string,\n interceptionRoutePatterns: RegExp[]\n ): boolean {\n return (\n isInterceptionRouteAppPath(resolvedPathname) ||\n interceptionRoutePatterns.some((regexp) => {\n return regexp.test(resolvedPathname)\n })\n )\n }\n\n public getVaryHeader(\n resolvedPathname: string,\n interceptionRoutePatterns: RegExp[]\n ): string {\n const baseVaryHeader = `${RSC_HEADER}, ${NEXT_ROUTER_STATE_TREE_HEADER}, ${NEXT_ROUTER_PREFETCH_HEADER}, ${NEXT_ROUTER_SEGMENT_PREFETCH_HEADER}`\n\n if (\n this.pathCouldBeIntercepted(resolvedPathname, interceptionRoutePatterns)\n ) {\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 return `${baseVaryHeader}, ${NEXT_URL}`\n } else {\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 return baseVaryHeader\n }\n }\n}\n\nconst vendored = {\n 'react-rsc': vendoredReactRSC,\n 'react-ssr': vendoredReactSSR,\n contexts: vendoredContexts,\n}\n\nexport { renderToHTMLOrFlight, vendored }\n\nexport default AppPageRouteModule\n","// ISC License\n\n// Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov\n\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\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\n\nconst { env, stdout } = globalThis?.process ?? {}\n\nconst enabled =\n env &&\n !env.NO_COLOR &&\n (env.FORCE_COLOR || (stdout?.isTTY && !env.CI && env.TERM !== 'dumb'))\n\nconst replaceClose = (\n str: string,\n close: string,\n replace: string,\n index: number\n): string => {\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\n ? start + replaceClose(end, close, replace, nextIndex)\n : start + end\n}\n\nconst formatter = (open: string, close: string, replace = open) => {\n if (!enabled) return String\n return (input: string) => {\n const string = '' + input\n const index = string.indexOf(close, open.length)\n return ~index\n ? open + replaceClose(string, close, replace, index) + close\n : open + string + close\n }\n}\n\nexport const reset = enabled ? (s: string) => `\\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 * 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 */\nexport class DetachedPromise<T = any> {\n public readonly resolve: (value: T | PromiseLike<T>) => void\n public readonly reject: (reason: any) => void\n public readonly promise: Promise<T>\n\n constructor() {\n let resolve: (value: T | PromiseLike<T>) => void\n let reject: (reason: any) => void\n\n // Create the promise and assign the resolvers to the object.\n this.promise = new Promise<T>((res, rej) => {\n resolve = res\n reject = rej\n })\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","export type ScheduledFn<T = void> = () => T | PromiseLike<T>\nexport type SchedulerFn<T = void> = (cb: ScheduledFn<T>) => void\n\n/**\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 */\nexport const scheduleOnNextTick = (cb: ScheduledFn<void>) => {\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 if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0)\n } else {\n process.nextTick(cb)\n }\n })\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 */\nexport const scheduleImmediate = (cb: ScheduledFn<void>): void => {\n if (process.env.NEXT_RUNTIME === 'edge') {\n setTimeout(cb, 0)\n } else {\n setImmediate(cb)\n }\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 */\nexport function atLeastOneTask() {\n return new Promise<void>((resolve) => scheduleImmediate(resolve))\n}\n\n/**\n * This utility function is extracted to make it easier to find places where we are doing\n * specific timing tricks to try to schedule work after React has rendered. This is especially\n * important at the moment because Next.js uses the edge builds of React which use setTimeout to\n * schedule work when you might expect that something like setImmediate would do the trick.\n *\n * Long term we should switch to the node versions of React rendering when possible and then\n * update this to use setImmediate rather than setTimeout\n */\nexport function waitAtLeastOneReactRenderTask(): Promise<void> {\n if (process.env.NEXT_RUNTIME === 'edge') {\n return new Promise((r) => setTimeout(r, 0))\n } else {\n return new Promise((r) => setImmediate(r))\n }\n}\n","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([60, 104, 116, 109, 108]),\n // <body\n BODY: new Uint8Array([60, 98, 111, 100, 121]),\n },\n CLOSED: {\n // </head>\n HEAD: new Uint8Array([60, 47, 104, 101, 97, 100, 62]),\n // </body>\n BODY: new Uint8Array([60, 47, 98, 111, 100, 121, 62]),\n // </html>\n HTML: new Uint8Array([60, 47, 104, 116, 109, 108, 62]),\n // </body></html>\n BODY_AND_HTML: new Uint8Array([\n 60, 47, 98, 111, 100, 121, 62, 60, 47, 104, 116, 109, 108, 62,\n ]),\n },\n META: {\n // Only the match the prefix cause the suffix can be different wether it's xml compatible or not \">\" or \"/>\"\n // <meta name=\"«nxt-icon»\"\n // This is a special mark that will be replaced by the icon insertion script tag.\n ICON_MARK: new Uint8Array([\n 60, 109, 101, 116, 97, 32, 110, 97, 109, 101, 61, 34, 194, 171, 110, 120,\n 116, 45, 105, 99, 111, 110, 194, 187, 34,\n ]),\n },\n} as const\n","/**\n * Find the starting index of Uint8Array `b` within Uint8Array `a`.\n */\nexport function indexOfUint8Array(a: Uint8Array, b: Uint8Array) {\n if (b.length === 0) return 0\n if (a.length === 0 || b.length > a.length) return -1\n\n // start iterating through `a`\n for (let i = 0; i <= a.length - b.length; i++) {\n let completeMatch = true\n // from index `i`, iterate through `b` and check for mismatch\n for (let j = 0; j < b.length; j++) {\n // if the values do not match, then this isn't a complete match, exit `b` iteration early and iterate to next index of `a`.\n if (a[i + j] !== b[j]) {\n completeMatch = false\n break\n }\n }\n\n if (completeMatch) {\n return i\n }\n }\n\n return -1\n}\n\n/**\n * Check if two Uint8Arrays are strictly equivalent.\n */\nexport function isEquivalentUint8Arrays(a: Uint8Array, b: Uint8Array) {\n if (a.length !== b.length) return false\n\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false\n }\n\n return true\n}\n\n/**\n * Remove Uint8Array `b` from Uint8Array `a`.\n *\n * If `b` is not in `a`, `a` is returned unchanged.\n *\n * Otherwise, the function returns a new Uint8Array instance with size `a.length - b.length`\n */\nexport function removeFromUint8Array(a: Uint8Array, b: Uint8Array) {\n const tagIndex = indexOfUint8Array(a, b)\n if (tagIndex === 0) return a.subarray(b.length)\n if (tagIndex > -1) {\n const removed = new Uint8Array(a.length - b.length)\n removed.set(a.slice(0, tagIndex))\n removed.set(a.slice(tagIndex + b.length), tagIndex)\n return removed\n } else {\n return a\n }\n}\n","import type { ReactDOMServerReadableStream } from 'react-dom/server'\nimport { 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 './encoded-tags'\nimport {\n indexOfUint8Array,\n isEquivalentUint8Arrays,\n removeFromUint8Array,\n} from './uint8array-helpers'\nimport { MISSING_ROOT_TAGS_ERROR } from '../../shared/lib/errors/constants'\nimport { insertBuildIdComment } from '../../shared/lib/segment-cache/output-export-prefetch-encoding'\nimport {\n RSC_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_RSC_UNION_QUERY,\n} from '../../client/components/app-router-headers'\nimport { computeCacheBustingSearchParam } from '../../shared/lib/router/utils/cache-busting-search-param'\n\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\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()\n\nexport function chainStreams<T>(\n ...streams: ReadableStream<T>[]\n): ReadableStream<T> {\n // If we have no streams, return an empty stream. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n if (streams.length === 0) {\n return new ReadableStream<T>({\n start(controller) {\n controller.close()\n },\n })\n }\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\n const { readable, writable } = new TransformStream()\n\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, { preventClose: true })\n\n let i = 1\n for (; i < streams.length - 1; i++) {\n const nextStream = streams[i]\n promise = promise.then(() =>\n nextStream.pipeTo(writable, { preventClose: true })\n )\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\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\n return readable\n}\n\nexport function streamFromString(str: string): ReadableStream<Uint8Array> {\n return new ReadableStream({\n start(controller) {\n controller.enqueue(encoder.encode(str))\n controller.close()\n },\n })\n}\n\nexport function streamFromBuffer(chunk: Buffer): ReadableStream<Uint8Array> {\n return new ReadableStream({\n start(controller) {\n controller.enqueue(chunk)\n controller.close()\n },\n })\n}\n\nexport async function streamToBuffer(\n stream: ReadableStream<Uint8Array>\n): Promise<Buffer> {\n const reader = stream.getReader()\n const chunks: Uint8Array[] = []\n\n while (true) {\n const { done, value } = await reader.read()\n if (done) {\n break\n }\n\n chunks.push(value)\n }\n\n return Buffer.concat(chunks)\n}\n\nexport async function streamToString(\n stream: ReadableStream<Uint8Array>,\n signal?: AbortSignal\n): Promise<string> {\n const decoder = new TextDecoder('utf-8', { fatal: true })\n let string = ''\n\n for await (const chunk of stream) {\n if (signal?.aborted) {\n return string\n }\n\n string += decoder.decode(chunk, { stream: true })\n }\n\n string += decoder.decode()\n\n return string\n}\n\nexport type BufferedTransformOptions = {\n /**\n * Flush synchronously once the buffer reaches this many bytes.\n */\n readonly maxBufferByteLength?: number\n}\n\nexport function createBufferedTransformStream(\n options: BufferedTransformOptions = {}\n): TransformStream<Uint8Array, Uint8Array> {\n const { maxBufferByteLength = Infinity } = options\n\n let bufferedChunks: Array<Uint8Array> = []\n let bufferByteLength: number = 0\n let pending: DetachedPromise<void> | undefined\n\n const flush = (controller: TransformStreamDefaultController) => {\n try {\n if (bufferedChunks.length === 0) {\n return\n }\n\n const chunk = new Uint8Array(bufferByteLength)\n let copiedBytes = 0\n\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 // transformer. It's most likely caused by the controller having been\n // errored (for example, if the stream was cancelled).\n }\n }\n\n const scheduleFlush = (controller: TransformStreamDefaultController) => {\n if (pending) {\n return\n }\n\n const detached = new DetachedPromise<void>()\n pending = detached\n\n scheduleImmediate(() => {\n try {\n flush(controller)\n } finally {\n pending = undefined\n detached.resolve()\n }\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\n if (bufferByteLength >= maxBufferByteLength) {\n flush(controller)\n } else {\n scheduleFlush(controller)\n }\n },\n flush() {\n return pending?.promise\n },\n })\n}\n\nfunction createPrefetchCommentStream(\n isBuildTimePrerendering: boolean,\n buildId: string\n): TransformStream<Uint8Array, Uint8Array> {\n // Insert an extra comment at the beginning of the HTML document. This must\n // come after the DOCTYPE, which is inserted by React.\n //\n // The first chunk sent by React will contain the doctype. After that, we can\n // pass through the rest of the chunks as-is.\n let didTransformFirstChunk = false\n return new TransformStream({\n transform(chunk, controller) {\n if (isBuildTimePrerendering && !didTransformFirstChunk) {\n didTransformFirstChunk = true\n const decoder = new TextDecoder('utf-8', { fatal: true })\n const chunkStr = decoder.decode(chunk, {\n stream: true,\n })\n const updatedChunkStr = insertBuildIdComment(chunkStr, buildId)\n controller.enqueue(encoder.encode(updatedChunkStr))\n return\n }\n controller.enqueue(chunk)\n },\n })\n}\n\nexport function renderToInitialFizzStream({\n ReactDOMServer,\n element,\n streamOptions,\n}: {\n ReactDOMServer: {\n renderToReadableStream: typeof import('react-dom/server').renderToReadableStream\n }\n element: React.ReactElement\n streamOptions?: Parameters<typeof ReactDOMServer.renderToReadableStream>[1]\n}): Promise<ReactDOMServerReadableStream> {\n return getTracer().trace(AppRenderSpan.renderToReadableStream, async () =>\n ReactDOMServer.renderToReadableStream(element, streamOptions)\n )\n}\n\nfunction createMetadataTransformStream(\n insert: () => Promise<string> | string\n): TransformStream<Uint8Array, Uint8Array> {\n let chunkIndex = -1\n let isMarkRemoved = false\n\n return new TransformStream({\n async transform(chunk, controller) {\n let iconMarkIndex = -1\n let closedHeadIndex = -1\n chunkIndex++\n\n if (isMarkRemoved) {\n controller.enqueue(chunk)\n return\n }\n let iconMarkLength = 0\n // Only search for the closed head tag once\n if (iconMarkIndex === -1) {\n iconMarkIndex = indexOfUint8Array(chunk, ENCODED_TAGS.META.ICON_MARK)\n if (iconMarkIndex === -1) {\n controller.enqueue(chunk)\n return\n } else {\n // When we found the `<meta name=\"«nxt-icon»\"` tag prefix, we will remove it from the chunk.\n // Its close tag could either be `/>` or `>`, checking the next char to ensure we cover both cases.\n iconMarkLength = ENCODED_TAGS.META.ICON_MARK.length\n // Check if next char is /, this is for xml mode.\n if (chunk[iconMarkIndex + iconMarkLength] === 47) {\n iconMarkLength += 2\n } else {\n // The last char is `>`\n iconMarkLength++\n }\n }\n }\n\n // Check if icon mark is inside <head> tag in the first chunk.\n if (chunkIndex === 0) {\n closedHeadIndex = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.HEAD)\n if (iconMarkIndex !== -1) {\n // The mark icon is located in the 1st chunk before the head tag.\n // We do not need to insert the script tag in this case because it's in the head.\n // Just remove the icon mark from the chunk.\n if (iconMarkIndex < closedHeadIndex) {\n const replaced = new Uint8Array(chunk.length - iconMarkLength)\n\n // Remove the icon mark from the chunk.\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex\n )\n chunk = replaced\n } else {\n // The icon mark is after the head tag, replace and insert the script tag at that position.\n const insertion = await insert()\n const encodedInsertion = encoder.encode(insertion)\n const insertionLength = encodedInsertion.length\n const replaced = new Uint8Array(\n chunk.length - iconMarkLength + insertionLength\n )\n replaced.set(chunk.subarray(0, iconMarkIndex))\n replaced.set(encodedInsertion, iconMarkIndex)\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n }\n isMarkRemoved = true\n }\n // If there's no icon mark located, it will be handled later when if present in the following chunks.\n } else {\n // When it's appeared in the following chunks, we'll need to\n // remove the mark and then insert the script tag at that position.\n const insertion = await insert()\n const encodedInsertion = encoder.encode(insertion)\n const insertionLength = encodedInsertion.length\n // Replace the icon mark with the hoist script or empty string.\n const replaced = new Uint8Array(\n chunk.length - iconMarkLength + insertionLength\n )\n // Set the first part of the chunk, before the icon mark.\n replaced.set(chunk.subarray(0, iconMarkIndex))\n // Set the insertion after the icon mark.\n replaced.set(encodedInsertion, iconMarkIndex)\n\n // Set the rest of the chunk after the icon mark.\n replaced.set(\n chunk.subarray(iconMarkIndex + iconMarkLength),\n iconMarkIndex + insertionLength\n )\n chunk = replaced\n isMarkRemoved = true\n }\n controller.enqueue(chunk)\n },\n })\n}\n\nfunction createHeadInsertionTransformStream(\n insert: () => Promise<string>\n): TransformStream<Uint8Array, Uint8Array> {\n let inserted = false\n\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\n return new TransformStream({\n async transform(chunk, controller) {\n hasBytes = true\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 } 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 // In fully static rendering or non PPR rendering cases:\n // `/head>` will always be found in the chunk in first chunk rendering.\n if (index !== -1) {\n if (insertion) {\n const encodedInsertion = encoder.encode(insertion)\n // Get the total count of the bytes in the chunk and the insertion\n // e.g.\n // chunk = <head><meta charset=\"utf-8\"></head>\n // insertion = <script>...</script>\n // output = <head><meta charset=\"utf-8\"> [ <script>...</script> ] </head>\n const insertedHeadContent = new Uint8Array(\n chunk.length + encodedInsertion.length\n )\n // Append the first part of the chunk, before the head tag\n insertedHeadContent.set(chunk.slice(0, index))\n // Append the server inserted content\n insertedHeadContent.set(encodedInsertion, index)\n // Append the rest of the chunk\n insertedHeadContent.set(\n chunk.slice(index),\n index + encodedInsertion.length\n )\n controller.enqueue(insertedHeadContent)\n } else {\n controller.enqueue(chunk)\n }\n inserted = true\n } else {\n // This will happens in PPR rendering during next start, when the page is partially rendered.\n // When the page resumes, the head tag will be found in the middle of the chunk.\n // Where we just need to append the insertion and chunk to the current stream.\n // e.g.\n // PPR-static: <head>...</head><body> [ resume content ] </body>\n // PPR-resume: [ insertion ] [ rest content ]\n if (insertion) {\n controller.enqueue(encoder.encode(insertion))\n }\n controller.enqueue(chunk)\n inserted = true\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\nfunction createClientResumeScriptInsertionTransformStream(): TransformStream<\n Uint8Array,\n Uint8Array\n> {\n const segmentPath = '/_full'\n const cacheBustingHeader = computeCacheBustingSearchParam(\n '1', // headers[NEXT_ROUTER_PREFETCH_HEADER]\n '/_full', // headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]\n undefined, // headers[NEXT_ROUTER_STATE_TREE_HEADER]\n undefined // headers[NEXT_URL]\n )\n const searchStr = `${NEXT_RSC_UNION_QUERY}=${cacheBustingHeader}`\n const NEXT_CLIENT_RESUME_SCRIPT = `<script>__NEXT_CLIENT_RESUME=fetch(location.pathname+'?${searchStr}',{credentials:'same-origin',headers:{'${RSC_HEADER}': '1','${NEXT_ROUTER_PREFETCH_HEADER}': '1','${NEXT_ROUTER_SEGMENT_PREFETCH_HEADER}': '${segmentPath}'}})</script>`\n\n let didAlreadyInsert = false\n return new TransformStream({\n transform(chunk, controller) {\n if (didAlreadyInsert) {\n // Already inserted the script into the head. Pass through.\n controller.enqueue(chunk)\n return\n }\n // TODO (@Ethan-Arrowood): Replace the generic `indexOfUint8Array` method with something finely tuned for the subset of things actually being checked for.\n const headClosingTagIndex = indexOfUint8Array(\n chunk,\n ENCODED_TAGS.CLOSED.HEAD\n )\n\n if (headClosingTagIndex === -1) {\n // In fully static rendering or non PPR rendering cases:\n // `/head>` will always be found in the chunk in first chunk rendering.\n controller.enqueue(chunk)\n return\n }\n\n const encodedInsertion = encoder.encode(NEXT_CLIENT_RESUME_SCRIPT)\n // Get the total count of the bytes in the chunk and the insertion\n // e.g.\n // chunk = <head><meta charset=\"utf-8\"></head>\n // insertion = <script>...</script>\n // output = <head><meta charset=\"utf-8\"> [ <script>...</script> ] </head>\n const insertedHeadContent = new Uint8Array(\n chunk.length + encodedInsertion.length\n )\n // Append the first part of the chunk, before the head tag\n insertedHeadContent.set(chunk.slice(0, headClosingTagIndex))\n // Append the server inserted content\n insertedHeadContent.set(encodedInsertion, headClosingTagIndex)\n // Append the rest of the chunk\n insertedHeadContent.set(\n chunk.slice(headClosingTagIndex),\n headClosingTagIndex + encodedInsertion.length\n )\n\n controller.enqueue(insertedHeadContent)\n didAlreadyInsert = true\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(\n suffix: string\n): TransformStream<Uint8Array, Uint8Array> {\n let flushed = false\n let pending: DetachedPromise<void> | undefined\n\n const flush = (controller: TransformStreamDefaultController) => {\n const detached = new DetachedPromise<void>()\n pending = detached\n\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\n return new TransformStream({\n transform(chunk, controller) {\n controller.enqueue(chunk)\n\n // If we've already flushed, we're done.\n if (flushed) return\n\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\n // Flush now.\n controller.enqueue(encoder.encode(suffix))\n },\n })\n}\n\nfunction createFlightDataInjectionTransformStream(\n stream: ReadableStream<Uint8Array>,\n delayDataUntilFirstHtmlChunk: boolean\n): TransformStream<Uint8Array, Uint8Array> {\n let htmlStreamFinished = false\n\n let pull: Promise<void> | null = null\n let donePulling = false\n\n function startOrContinuePulling(\n controller: TransformStreamDefaultController\n ) {\n if (!pull) {\n pull = startPulling(controller)\n }\n return pull\n }\n\n async function startPulling(controller: TransformStreamDefaultController) {\n const reader = stream.getReader()\n\n if (delayDataUntilFirstHtmlChunk) {\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\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 }\n\n try {\n while (true) {\n const { done, value } = await reader.read()\n if (done) {\n donePulling = true\n return\n }\n\n // We want to prioritize HTML over RSC data.\n // The SSR render is based on the same RSC stream, so when we get a new RSC chunk,\n // we're likely to produce an HTML chunk as well, so give it a chance to flush first.\n if (!delayDataUntilFirstHtmlChunk && !htmlStreamFinished) {\n await atLeastOneTask()\n }\n controller.enqueue(value)\n }\n } catch (err) {\n controller.error(err)\n }\n }\n\n return new TransformStream({\n start(controller) {\n if (!delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(controller)\n }\n },\n transform(chunk, controller) {\n controller.enqueue(chunk)\n\n // Start the streaming if it hasn't already been started yet.\n if (delayDataUntilFirstHtmlChunk) {\n startOrContinuePulling(controller)\n }\n },\n flush(controller) {\n htmlStreamFinished = true\n if (donePulling) {\n return\n }\n return startOrContinuePulling(controller)\n },\n })\n}\n\nconst CLOSE_TAG = '</body></html>'\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 */\nfunction createMoveSuffixStream(): TransformStream<Uint8Array, Uint8Array> {\n let foundSuffix = false\n\n return new TransformStream({\n transform(chunk, controller) {\n if (foundSuffix) {\n return controller.enqueue(chunk)\n }\n\n const index = indexOfUint8Array(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n if (index > -1) {\n foundSuffix = true\n\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 === ENCODED_TAGS.CLOSED.BODY_AND_HTML.length) {\n return\n }\n\n // Write out the part before the suffix.\n const before = chunk.slice(0, index)\n controller.enqueue(before)\n\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 > ENCODED_TAGS.CLOSED.BODY_AND_HTML.length + index) {\n // Write out the part after the suffix.\n const after = chunk.slice(\n index + ENCODED_TAGS.CLOSED.BODY_AND_HTML.length\n )\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(ENCODED_TAGS.CLOSED.BODY_AND_HTML)\n },\n })\n}\n\nfunction createStripDocumentClosingTagsTransform(): TransformStream<\n Uint8Array,\n Uint8Array\n> {\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 (\n isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.BODY_AND_HTML) ||\n isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.BODY) ||\n isEquivalentUint8Arrays(chunk, ENCODED_TAGS.CLOSED.HTML)\n ) {\n // the entire chunk is the closing tags; return without enqueueing anything.\n return\n }\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\n controller.enqueue(chunk)\n },\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 */\nexport function createRootLayoutValidatorStream(): TransformStream<\n Uint8Array,\n Uint8Array\n> {\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 (\n !foundHtml &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.HTML) > -1\n ) {\n foundHtml = true\n }\n\n if (\n !foundBody &&\n indexOfUint8Array(chunk, ENCODED_TAGS.OPENING.BODY) > -1\n ) {\n foundBody = true\n }\n\n controller.enqueue(chunk)\n },\n flush(controller) {\n const missingTags: ('html' | 'body')[] = []\n if (!foundHtml) missingTags.push('html')\n if (!foundBody) missingTags.push('body')\n\n if (!missingTags.length) return\n\n controller.enqueue(\n encoder.encode(\n `<html id=\"__next_error__\">\n <template\n data-next-error-message=\"Missing ${missingTags\n .map((c) => `<${c}>`)\n .join(\n missingTags.length > 1 ? ' and ' : ''\n )} tags in the root layout.\\nRead more at https://nextjs.org/docs/messages/missing-root-layout-tags\"\n data-next-error-digest=\"${MISSING_ROOT_TAGS_ERROR}\"\n data-next-error-stack=\"\"\n ></template>\n `\n )\n )\n },\n })\n}\n\nfunction chainTransformers<T>(\n readable: ReadableStream<T>,\n transformers: ReadonlyArray<TransformStream<T, T> | null>\n): ReadableStream<T> {\n let stream = readable\n for (const transformer of transformers) {\n if (!transformer) continue\n\n stream = stream.pipeThrough(transformer)\n }\n return stream\n}\n\nexport type ContinueStreamOptions = {\n inlinedDataStream: ReadableStream<Uint8Array> | undefined\n isStaticGeneration: boolean\n isBuildTimePrerendering: boolean\n buildId: string\n getServerInsertedHTML: () => Promise<string>\n getServerInsertedMetadata: () => Promise<string>\n validateRootLayout?: boolean\n /**\n * Suffix to inject after the buffered data, but before the close tags.\n */\n suffix?: string | undefined\n}\n\nexport async function continueFizzStream(\n renderStream: ReactDOMServerReadableStream,\n {\n suffix,\n inlinedDataStream,\n isStaticGeneration,\n isBuildTimePrerendering,\n buildId,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n validateRootLayout,\n }: ContinueStreamOptions\n): Promise<ReadableStream<Uint8Array>> {\n // Suffix itself might contain close tags at the end, so we need to split it.\n const suffixUnclosed = suffix ? suffix.split(CLOSE_TAG, 1)[0] : null\n\n // If we're generating static HTML we need to wait for it to resolve before continuing.\n if (isStaticGeneration) {\n await renderStream.allReady\n }\n\n return chainTransformers(renderStream, [\n // Buffer everything to avoid flushing too frequently\n createBufferedTransformStream(),\n\n // Add build id comment to start of the HTML document (in export mode)\n createPrefetchCommentStream(isBuildTimePrerendering, buildId),\n\n // Transform metadata\n createMetadataTransformStream(getServerInsertedMetadata),\n\n // Insert suffix content\n suffixUnclosed != null && suffixUnclosed.length > 0\n ? createDeferredSuffixStream(suffixUnclosed)\n : null,\n\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n inlinedDataStream\n ? createFlightDataInjectionTransformStream(inlinedDataStream, true)\n : null,\n\n // Validate the root layout for missing html or body tags\n validateRootLayout ? createRootLayoutValidatorStream() : null,\n\n // Close tags should always be deferred to the end\n createMoveSuffixStream(),\n\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 createHeadInsertionTransformStream(getServerInsertedHTML),\n ])\n}\n\ntype ContinueDynamicPrerenderOptions = {\n getServerInsertedHTML: () => Promise<string>\n getServerInsertedMetadata: () => Promise<string>\n}\n\nexport async function continueDynamicPrerender(\n prerenderStream: ReadableStream<Uint8Array>,\n {\n getServerInsertedHTML,\n getServerInsertedMetadata,\n }: ContinueDynamicPrerenderOptions\n) {\n return (\n prerenderStream\n // Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream())\n .pipeThrough(createStripDocumentClosingTagsTransform())\n // Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML))\n // Transform metadata\n .pipeThrough(createMetadataTransformStream(getServerInsertedMetadata))\n )\n}\n\ntype ContinueStaticPrerenderOptions = {\n inlinedDataStream: ReadableStream<Uint8Array>\n getServerInsertedHTML: () => Promise<string>\n getServerInsertedMetadata: () => Promise<string>\n isBuildTimePrerendering: boolean\n buildId: string\n}\n\nexport async function continueStaticPrerender(\n prerenderStream: ReadableStream<Uint8Array>,\n {\n inlinedDataStream,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n isBuildTimePrerendering,\n buildId,\n }: ContinueStaticPrerenderOptions\n) {\n return (\n prerenderStream\n // Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream())\n // Add build id comment to start of the HTML document (in export mode)\n .pipeThrough(\n createPrefetchCommentStream(isBuildTimePrerendering, buildId)\n )\n // Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML))\n // Transform metadata\n .pipeThrough(createMetadataTransformStream(getServerInsertedMetadata))\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n .pipeThrough(\n createFlightDataInjectionTransformStream(inlinedDataStream, true)\n )\n // Close tags should always be deferred to the end\n .pipeThrough(createMoveSuffixStream())\n )\n}\n\nexport async function continueStaticFallbackPrerender(\n prerenderStream: ReadableStream<Uint8Array>,\n {\n inlinedDataStream,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n isBuildTimePrerendering,\n buildId,\n }: ContinueStaticPrerenderOptions\n) {\n // Same as `continueStaticPrerender`, but also inserts an additional script\n // to instruct the client to start fetching the hydration data as early\n // as possible.\n return (\n prerenderStream\n // Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream())\n // Add build id comment to start of the HTML document (in export mode)\n .pipeThrough(\n createPrefetchCommentStream(isBuildTimePrerendering, buildId)\n )\n // Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML))\n // Insert the client resume script into the head\n .pipeThrough(createClientResumeScriptInsertionTransformStream())\n // Transform metadata\n .pipeThrough(createMetadataTransformStream(getServerInsertedMetadata))\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n .pipeThrough(\n createFlightDataInjectionTransformStream(inlinedDataStream, true)\n )\n // Close tags should always be deferred to the end\n .pipeThrough(createMoveSuffixStream())\n )\n}\n\ntype ContinueResumeOptions = {\n inlinedDataStream: ReadableStream<Uint8Array>\n getServerInsertedHTML: () => Promise<string>\n getServerInsertedMetadata: () => Promise<string>\n delayDataUntilFirstHtmlChunk: boolean\n}\n\nexport async function continueDynamicHTMLResume(\n renderStream: ReadableStream<Uint8Array>,\n {\n delayDataUntilFirstHtmlChunk,\n inlinedDataStream,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n }: ContinueResumeOptions\n) {\n return (\n renderStream\n // Buffer everything to avoid flushing too frequently\n .pipeThrough(createBufferedTransformStream())\n // Insert generated tags to head\n .pipeThrough(createHeadInsertionTransformStream(getServerInsertedHTML))\n // Transform metadata\n .pipeThrough(createMetadataTransformStream(getServerInsertedMetadata))\n // Insert the inlined data (Flight data, form state, etc.) stream into the HTML\n .pipeThrough(\n createFlightDataInjectionTransformStream(\n inlinedDataStream,\n delayDataUntilFirstHtmlChunk\n )\n )\n // Close tags should always be deferred to the end\n .pipeThrough(createMoveSuffixStream())\n )\n}\n\nexport function createDocumentClosingStream(): ReadableStream<Uint8Array> {\n return streamFromString(CLOSE_TAG)\n}\n","import type { IncomingMessage } from 'http'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { UrlWithParsedQuery } from 'url'\nimport type { BaseNextRequest } from './base-http'\nimport type { CloneableBody } from './body-streams'\nimport type { RouteMatch } from './route-matches/route-match'\nimport type { NEXT_RSC_UNION_QUERY } from '../client/components/app-router-headers'\nimport type {\n ResponseCacheEntry,\n ServerComponentsHmrCache,\n} from './response-cache'\nimport type { PagesDevOverlayBridgeType } from '../next-devtools/userspace/pages/pages-dev-overlay-setup'\nimport type { OpaqueFallbackRouteParams } from './request/fallback-params'\nimport type { IncrementalCache } from './lib/incremental-cache'\n\n// FIXME: (wyattjoh) this is a temporary solution to allow us to pass data between bundled modules\nexport const NEXT_REQUEST_META = Symbol.for('NextInternalRequestMeta')\n\nexport type NextIncomingMessage = (BaseNextRequest | IncomingMessage) & {\n [NEXT_REQUEST_META]?: RequestMeta\n}\n\n/**\n * The callback function to call when a response cache entry was generated or\n * looked up in the cache. When it returns true, the server assumes that the\n * handler has already responded to the request and will not do so itself.\n */\nexport type OnCacheEntryHandler = (\n /**\n * The response cache entry that was generated or looked up in the cache.\n */\n cacheEntry: ResponseCacheEntry,\n\n /**\n * The request metadata.\n */\n requestMeta: {\n /**\n * The URL that was used to make the request.\n */\n url: string | undefined\n }\n) => Promise<boolean | void> | boolean | void\n\nexport interface RequestMeta {\n /**\n * The query that was used to make the request.\n */\n initQuery?: ParsedUrlQuery\n\n /**\n * The URL that was used to make the request.\n */\n initURL?: string\n\n /**\n * The protocol that was used to make the request.\n */\n initProtocol?: string\n\n /**\n * The body that was read from the request. This is used to allow the body to\n * be read multiple times.\n */\n clonableBody?: CloneableBody\n\n /**\n * True when the request matched a locale domain that was configured in the\n * next.config.js file.\n */\n isLocaleDomain?: boolean\n\n /**\n * True when the request had locale information stripped from the pathname\n * part of the URL.\n */\n didStripLocale?: boolean\n\n /**\n * If the request had it's URL rewritten, this is the URL it was rewritten to.\n */\n rewroteURL?: string\n\n /**\n * The cookies that were added by middleware and were added to the response.\n */\n middlewareCookie?: string[]\n\n /**\n * The match on the request for a given route.\n */\n match?: RouteMatch\n\n /**\n * The incremental cache to use for the request.\n */\n incrementalCache?: IncrementalCache\n\n /**\n * The server components HMR cache, only for dev.\n */\n serverComponentsHmrCache?: ServerComponentsHmrCache\n\n /**\n * Equals the segment path that was used for the prefetch RSC request.\n */\n segmentPrefetchRSCRequest?: string\n\n /**\n * True when the request is for the prefetch flight data.\n */\n isPrefetchRSCRequest?: true\n\n /**\n * True when the request is for the flight data.\n */\n isRSCRequest?: true\n\n /**\n * A search param set by the Next.js client when performing RSC requests.\n * Because some CDNs do not vary their cache entries on our custom headers,\n * this search param represents a hash of the header values. For any cached\n * RSC request, we should verify that the hash matches before responding.\n * Otherwise this can lead to cache poisoning.\n * TODO: Consider not using custom request headers at all, and instead encode\n * everything into the search param.\n */\n cacheBustingSearchParam?: string\n\n /**\n * True when the request is for the `/_next/data` route using the pages\n * router.\n */\n isNextDataReq?: true\n\n /**\n * Postponed state to use for resumption. If present it's assumed that the\n * request is for a page that has postponed (there are no guarantees that the\n * page actually has postponed though as it would incur an additional cache\n * lookup).\n */\n postponed?: string\n\n /**\n * If provided, this will be called when a response cache entry was generated\n * or looked up in the cache.\n *\n * @deprecated Use `onCacheEntryV2` instead.\n */\n onCacheEntry?: OnCacheEntryHandler\n\n /**\n * If provided, this will be called when a response cache entry was generated\n * or looked up in the cache.\n */\n onCacheEntryV2?: OnCacheEntryHandler\n\n /**\n * The previous revalidate before rendering 404 page for notFound: true\n */\n notFoundRevalidate?: number | false\n\n /**\n * In development, the original source page that returned a 404.\n */\n developmentNotFoundSourcePage?: string\n\n /**\n * The path we routed to and should be invoked\n */\n invokePath?: string\n\n /**\n * The specific page output we should be matching\n */\n invokeOutput?: string\n\n /**\n * The status we are invoking the request with from routing\n */\n invokeStatus?: number\n\n /**\n * The routing error we are invoking with\n */\n invokeError?: Error\n\n /**\n * The query parsed for the invocation\n */\n invokeQuery?: Record<string, undefined | string | string[]>\n\n /**\n * Whether the request is a middleware invocation\n */\n middlewareInvoke?: boolean\n\n /**\n * Whether the request should render the fallback shell or not.\n */\n renderFallbackShell?: boolean\n\n /**\n * Whether the request is for the custom error page.\n */\n customErrorRender?: true\n\n /**\n * Whether to bubble up the NoFallbackError to the caller when a 404 is\n * returned.\n */\n bubbleNoFallback?: true\n\n /**\n * True when the request had locale information inferred from the default\n * locale.\n */\n localeInferredFromDefault?: true\n\n /**\n * The locale that was inferred or explicitly set for the request.\n */\n locale?: string\n\n /**\n * The default locale that was inferred or explicitly set for the request.\n */\n defaultLocale?: string\n\n /**\n * The relative project dir the server is running in from project root\n */\n relativeProjectDir?: string\n\n /**\n * The dist directory the server is currently using\n */\n distDir?: string\n\n /**\n * The query after resolving routes\n */\n query?: ParsedUrlQuery\n\n /**\n * The params after resolving routes\n */\n params?: ParsedUrlQuery\n\n /**\n * ErrorOverlay component to use in development for pages router\n */\n PagesErrorDebug?: PagesDevOverlayBridgeType\n\n /**\n * Whether server is in minimal mode (this will be replaced with more\n * specific flags in future)\n */\n minimalMode?: boolean\n\n /**\n * DEV only: The fallback params that should be used when validating prerenders during dev\n */\n devValidatingFallbackParams?: OpaqueFallbackRouteParams\n\n /**\n * DEV only: Request timings in process.hrtime.bigint()\n */\n devRequestTimingStart?: bigint\n devRequestTimingMiddlewareStart?: bigint\n devRequestTimingMiddlewareEnd?: bigint\n devRequestTimingInternalsEnd?: bigint\n}\n\n/**\n * Gets the request metadata. If no key is provided, the entire metadata object\n * is returned.\n *\n * @param req the request to get the metadata from\n * @param key the key to get from the metadata (optional)\n * @returns the value for the key or the entire metadata object\n */\nexport function getRequestMeta(\n req: NextIncomingMessage,\n key?: undefined\n): RequestMeta\nexport function getRequestMeta<K extends keyof RequestMeta>(\n req: NextIncomingMessage,\n key: K\n): RequestMeta[K]\nexport function getRequestMeta<K extends keyof RequestMeta>(\n req: NextIncomingMessage,\n key?: K\n): RequestMeta | RequestMeta[K] {\n const meta = req[NEXT_REQUEST_META] || {}\n return typeof key === 'string' ? meta[key] : meta\n}\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 */\nexport function setRequestMeta(req: NextIncomingMessage, meta: RequestMeta) {\n req[NEXT_REQUEST_META] = meta\n return meta\n}\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 */\nexport function addRequestMeta<K extends keyof RequestMeta>(\n request: NextIncomingMessage,\n key: K,\n value: RequestMeta[K]\n) {\n const meta = getRequestMeta(request)\n meta[key] = value\n return setRequestMeta(request, meta)\n}\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 */\nexport function removeRequestMeta<K extends keyof RequestMeta>(\n request: NextIncomingMessage,\n key: K\n) {\n const meta = getRequestMeta(request)\n delete meta[key]\n return setRequestMeta(request, meta)\n}\n\ntype NextQueryMetadata = {\n /**\n * The `_rsc` query parameter used for cache busting to ensure that the RSC\n * requests do not get cached by the browser explicitly.\n */\n [NEXT_RSC_UNION_QUERY]?: string\n}\n\nexport type NextParsedUrlQuery = ParsedUrlQuery & NextQueryMetadata\n\nexport interface NextUrlWithParsedQuery extends UrlWithParsedQuery {\n query: NextParsedUrlQuery\n}\n","import type { OutgoingHttpHeaders } from 'http'\nimport {\n NEXT_INTERCEPTION_MARKER_PREFIX,\n NEXT_QUERY_PARAM_PREFIX,\n} from '../../lib/constants'\n\n/**\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 */\nexport function fromNodeOutgoingHttpHeaders(\n nodeHeaders: OutgoingHttpHeaders\n): Headers {\n const headers = new Headers()\n for (let [key, value] of Object.entries(nodeHeaders)) {\n const values = Array.isArray(value) ? value : [value]\n for (let v of values) {\n if (typeof v === 'undefined') continue\n if (typeof v === 'number') {\n v = v.toString()\n }\n\n headers.append(key, v)\n }\n }\n return headers\n}\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*/\nexport function splitCookiesString(cookiesString: string) {\n var cookiesStrings = []\n var pos = 0\n var start\n var ch\n var lastComma\n var nextStart\n var cookiesSeparatorFound\n\n function skipWhitespace() {\n while (pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))) {\n pos += 1\n }\n return pos < cookiesString.length\n }\n\n function notSpecialChar() {\n ch = cookiesString.charAt(pos)\n\n return ch !== '=' && ch !== ';' && ch !== ','\n }\n\n while (pos < cookiesString.length) {\n start = pos\n cookiesSeparatorFound = false\n\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\n skipWhitespace()\n nextStart = pos\n\n while (pos < cookiesString.length && notSpecialChar()) {\n pos += 1\n }\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\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length))\n }\n }\n\n return cookiesStrings\n}\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 */\nexport function toNodeOutgoingHttpHeaders(\n headers: Headers\n): OutgoingHttpHeaders {\n const nodeHeaders: OutgoingHttpHeaders = {}\n const cookies: string[] = []\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/**\n * Validate the correctness of a user-provided URL.\n */\nexport function validateURL(url: string | URL): string {\n try {\n return String(new URL(String(url)))\n } catch (error: any) {\n throw new Error(\n `URL is malformed \"${String(\n url\n )}\". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,\n { cause: error }\n )\n }\n}\n\n/**\n * Normalizes `nxtP` and `nxtI` query param values to remove the prefix.\n * This function does not mutate the input key.\n */\nexport function normalizeNextQueryParam(key: string): null | string {\n const prefixes = [NEXT_QUERY_PARAM_PREFIX, NEXT_INTERCEPTION_MARKER_PREFIX]\n for (const prefix of prefixes) {\n if (key !== prefix && key.startsWith(prefix)) {\n return key.substring(prefix.length)\n }\n }\n return null\n}\n","import type { DomainLocale } from '../../../server/config-shared'\n\nexport function detectDomainLocale(\n domainItems?: readonly DomainLocale[],\n hostname?: string,\n detectedLocale?: string\n) {\n if (!domainItems) return\n\n if (detectedLocale) {\n detectedLocale = detectedLocale.toLowerCase()\n }\n\n for (const item of domainItems) {\n // remove port if present\n const domainHostname = item.domain?.split(':', 1)[0].toLowerCase()\n if (\n hostname === domainHostname ||\n detectedLocale === item.defaultLocale.toLowerCase() ||\n item.locales?.some((locale) => locale.toLowerCase() === detectedLocale)\n ) {\n return item\n }\n }\n}\n","import { parsePath } from './parse-path'\n\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 */\nexport function addPathSuffix(path: string, suffix?: string) {\n if (!path.startsWith('/') || !suffix) {\n return path\n }\n\n const { pathname, query, hash } = parsePath(path)\n return `${pathname}${suffix}${query}${hash}`\n}\n","import { parsePath } from './parse-path'\n\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 */\nexport function pathHasPrefix(path: string, prefix: string) {\n if (typeof path !== 'string') {\n return false\n }\n\n const { pathname } = parsePath(path)\n return pathname === prefix || pathname.startsWith(prefix + '/')\n}\n","import type { OutgoingHttpHeaders } from 'http'\n\n/**\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 */\nexport function getHostname(\n parsed: { hostname?: string | null },\n headers?: OutgoingHttpHeaders\n): string | undefined {\n // Get the hostname from the headers if it exists, otherwise use the parsed\n // hostname.\n let hostname: string\n if (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\n return hostname.toLowerCase()\n}\n","export interface PathLocale {\n detectedLocale?: string\n pathname: string\n}\n\n/**\n * A cache of lowercased locales for each list of locales. This is stored as a\n * WeakMap so if the locales are garbage collected, the cache entry will be\n * removed as well.\n */\nconst cache = new WeakMap<readonly string[], readonly string[]>()\n\n/**\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 */\nexport function normalizeLocalePath(\n pathname: string,\n locales?: readonly string[]\n): PathLocale {\n // If locales is undefined, return the pathname as is.\n if (!locales) return { pathname }\n\n // Get the cached lowercased locales or create a new cache entry.\n let lowercasedLocales = cache.get(locales)\n if (!lowercasedLocales) {\n lowercasedLocales = locales.map((locale) => locale.toLowerCase())\n cache.set(locales, lowercasedLocales)\n }\n\n let detectedLocale: string | undefined\n\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\n // If there's no second segment (ie, the pathname is just `/`), there's no\n // locale.\n if (!segments[1]) return { pathname }\n\n // The second segment will contain the locale part if any.\n const segment = segments[1].toLowerCase()\n\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 = lowercasedLocales.indexOf(segment)\n if (index < 0) return { pathname }\n\n // Return the case-sensitive locale.\n detectedLocale = locales[index]\n\n // Remove the `/${locale}` part of the pathname.\n pathname = pathname.slice(detectedLocale.length + 1) || '/'\n\n return { pathname, detectedLocale }\n}\n","import { pathHasPrefix } from './path-has-prefix'\n\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 */\nexport function removePathPrefix(path: string, prefix: string): string {\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\n // Remove the prefix from the path via slicing.\n const withoutPrefix = path.slice(prefix.length)\n\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\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","import type { OutgoingHttpHeaders } from 'http'\nimport type { DomainLocale, I18NConfig } from '../config-shared'\nimport type { I18NProvider } from '../lib/i18n-provider'\n\nimport { 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'\n\ninterface Options {\n base?: string | URL\n headers?: OutgoingHttpHeaders\n forceLocale?: boolean\n nextConfig?: {\n basePath?: string\n i18n?: I18NConfig | null\n trailingSlash?: boolean\n }\n i18nProvider?: I18NProvider\n}\n\nconst REGEX_LOCALHOST_HOSTNAME =\n /(?!^https?:\\/\\/)(127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\\[::1\\]|localhost)/\n\nfunction parseURL(url: string | URL, base?: string | URL) {\n return new URL(\n String(url).replace(REGEX_LOCALHOST_HOSTNAME, 'localhost'),\n base && String(base).replace(REGEX_LOCALHOST_HOSTNAME, 'localhost')\n )\n}\n\nconst Internal = Symbol('NextURLInternal')\n\nexport class NextURL {\n private [Internal]: {\n basePath: string\n buildId?: string\n flightSearchParameters?: Record<string, string>\n defaultLocale?: string\n domainLocale?: DomainLocale\n locale?: string\n options: Options\n trailingSlash?: boolean\n url: URL\n }\n\n constructor(input: string | URL, base?: string | URL, opts?: Options)\n constructor(input: string | URL, opts?: Options)\n constructor(\n input: string | URL,\n baseOrOpts?: string | URL | Options,\n opts?: Options\n ) {\n let base: undefined | string | URL\n let options: Options\n\n if (\n (typeof baseOrOpts === 'object' && 'pathname' in baseOrOpts) ||\n typeof baseOrOpts === 'string'\n ) {\n base = baseOrOpts\n options = opts || {}\n } else {\n options = opts || baseOrOpts || {}\n }\n\n this[Internal] = {\n url: parseURL(input, base ?? options.base),\n options: options,\n basePath: '',\n }\n\n this.analyze()\n }\n\n private analyze() {\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\n const hostname = getHostname(\n this[Internal].url,\n this[Internal].options.headers\n )\n this[Internal].domainLocale = this[Internal].options.i18nProvider\n ? this[Internal].options.i18nProvider.detectDomainLocale(hostname)\n : detectDomainLocale(\n this[Internal].options.nextConfig?.i18n?.domains,\n hostname\n )\n\n const defaultLocale =\n this[Internal].domainLocale?.defaultLocale ||\n this[Internal].options.nextConfig?.i18n?.defaultLocale\n\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\n private formatPathname() {\n return formatNextPathnameInfo({\n basePath: this[Internal].basePath,\n buildId: this[Internal].buildId,\n defaultLocale: !this[Internal].options.forceLocale\n ? this[Internal].defaultLocale\n : undefined,\n locale: this[Internal].locale,\n pathname: this[Internal].url.pathname,\n trailingSlash: this[Internal].trailingSlash,\n })\n }\n\n private formatSearch() {\n return this[Internal].url.search\n }\n\n public get buildId() {\n return this[Internal].buildId\n }\n\n public set buildId(buildId: string | undefined) {\n this[Internal].buildId = buildId\n }\n\n public get locale() {\n return this[Internal].locale ?? ''\n }\n\n public set locale(locale: string) {\n if (\n !this[Internal].locale ||\n !this[Internal].options.nextConfig?.i18n?.locales.includes(locale)\n ) {\n throw new TypeError(\n `The NextURL configuration includes no locale \"${locale}\"`\n )\n }\n\n this[Internal].locale = locale\n }\n\n get defaultLocale() {\n return this[Internal].defaultLocale\n }\n\n get domainLocale() {\n return this[Internal].domainLocale\n }\n\n get searchParams() {\n return this[Internal].url.searchParams\n }\n\n get host() {\n return this[Internal].url.host\n }\n\n set host(value: string) {\n this[Internal].url.host = value\n }\n\n get hostname() {\n return this[Internal].url.hostname\n }\n\n set hostname(value: string) {\n this[Internal].url.hostname = value\n }\n\n get port() {\n return this[Internal].url.port\n }\n\n set port(value: string) {\n this[Internal].url.port = value\n }\n\n get protocol() {\n return this[Internal].url.protocol\n }\n\n set protocol(value: string) {\n this[Internal].url.protocol = value\n }\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\n set href(url: string) {\n this[Internal].url = parseURL(url)\n this.analyze()\n }\n\n get origin() {\n return this[Internal].url.origin\n }\n\n get pathname() {\n return this[Internal].url.pathname\n }\n\n set pathname(value: string) {\n this[Internal].url.pathname = value\n }\n\n get hash() {\n return this[Internal].url.hash\n }\n\n set hash(value: string) {\n this[Internal].url.hash = value\n }\n\n get search() {\n return this[Internal].url.search\n }\n\n set search(value: string) {\n this[Internal].url.search = value\n }\n\n get password() {\n return this[Internal].url.password\n }\n\n set password(value: string) {\n this[Internal].url.password = value\n }\n\n get username() {\n return this[Internal].url.username\n }\n\n set username(value: string) {\n this[Internal].url.username = value\n }\n\n get basePath() {\n return this[Internal].basePath\n }\n\n set basePath(value: string) {\n this[Internal].basePath = value.startsWith('/') ? value : `/${value}`\n }\n\n toString() {\n return this.href\n }\n\n toJSON() {\n return this.href\n }\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\n clone() {\n return new NextURL(String(this), this[Internal].options)\n }\n}\n","import { normalizeLocalePath } from '../../i18n/normalize-locale-path'\nimport { removePathPrefix } from './remove-path-prefix'\nimport { pathHasPrefix } from './path-has-prefix'\nimport type { I18NProvider } from '../../../../server/lib/i18n-provider'\n\nexport interface NextPathnameInfo {\n /**\n * The base path in case the pathname included it.\n */\n basePath?: string\n /**\n * The buildId for when the parsed URL is a data URL. Parsing it can be\n * disabled with the `parseData` option.\n */\n buildId?: string\n /**\n * If there was a locale in the pathname, this will hold its value.\n */\n locale?: string\n /**\n * The processed pathname without a base path, locale, or data URL elements\n * when parsing it is enabled.\n */\n pathname: string\n /**\n * A boolean telling if the pathname had a trailingSlash. This can be only\n * true if trailingSlash is enabled.\n */\n trailingSlash?: boolean\n}\n\ninterface Options {\n /**\n * When passed to true, this function will also parse Nextjs data URLs.\n */\n parseData?: boolean\n /**\n * A partial of the Next.js configuration to parse the URL.\n */\n nextConfig?: {\n basePath?: string\n i18n?: { locales?: readonly string[] } | null\n trailingSlash?: boolean\n }\n\n /**\n * If provided, this normalizer will be used to detect the locale instead of\n * the default locale detection.\n */\n i18nProvider?: I18NProvider\n}\n\nexport function getNextPathnameInfo(\n pathname: string,\n options: Options\n): NextPathnameInfo {\n const { basePath, i18n, trailingSlash } = options.nextConfig ?? {}\n const info: NextPathnameInfo = {\n pathname,\n trailingSlash: pathname !== '/' ? pathname.endsWith('/') : trailingSlash,\n }\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\n if (\n info.pathname.startsWith('/_next/data/') &&\n info.pathname.endsWith('.json')\n ) {\n const paths = info.pathname\n .replace(/^\\/_next\\/data\\//, '')\n .replace(/\\.json$/, '')\n .split('/')\n\n const buildId = paths[0]\n info.buildId = buildId\n pathnameNoDataPrefix =\n paths[1] !== 'index' ? `/${paths.slice(1).join('/')}` : '/'\n\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\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\n ? options.i18nProvider.analyze(info.pathname)\n : normalizeLocalePath(info.pathname, i18n.locales)\n\n info.locale = result.detectedLocale\n info.pathname = result.pathname ?? info.pathname\n\n if (!result.detectedLocale && info.buildId) {\n result = options.i18nProvider\n ? options.i18nProvider.analyze(pathnameNoDataPrefix)\n : normalizeLocalePath(pathnameNoDataPrefix, i18n.locales)\n\n if (result.detectedLocale) {\n info.locale = result.detectedLocale\n }\n }\n }\n return info\n}\n","import type { NextPathnameInfo } from './get-next-pathname-info'\nimport { removeTrailingSlash } from './remove-trailing-slash'\nimport { addPathPrefix } from './add-path-prefix'\nimport { addPathSuffix } from './add-path-suffix'\nimport { addLocale } from './add-locale'\n\ninterface ExtendedInfo extends NextPathnameInfo {\n defaultLocale?: string\n ignorePrefix?: boolean\n}\n\nexport function formatNextPathnameInfo(info: ExtendedInfo) {\n let pathname = addLocale(\n info.pathname,\n info.locale,\n info.buildId ? undefined : info.defaultLocale,\n info.ignorePrefix\n )\n\n if (info.buildId || !info.trailingSlash) {\n pathname = removeTrailingSlash(pathname)\n }\n\n if (info.buildId) {\n pathname = addPathSuffix(\n addPathPrefix(pathname, `/_next/data/${info.buildId}`),\n info.pathname === '/' ? 'index.json' : '.json'\n )\n }\n\n pathname = addPathPrefix(pathname, info.basePath)\n return !info.buildId && info.trailingSlash\n ? !pathname.endsWith('/')\n ? addPathSuffix(pathname, '/')\n : pathname\n : removeTrailingSlash(pathname)\n}\n","import { addPathPrefix } from './add-path-prefix'\nimport { pathHasPrefix } from './path-has-prefix'\n\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 */\nexport function addLocale(\n path: string,\n locale?: string | false,\n defaultLocale?: string,\n ignorePrefix?: boolean\n) {\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\n const lower = path.toLowerCase()\n\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\n // Add the locale prefix to the path.\n return addPathPrefix(path, `/${locale}`)\n}\n","import type { I18NConfig } from '../../config-shared'\nimport { NextURL } from '../next-url'\nimport { toNodeOutgoingHttpHeaders, validateURL } from '../utils'\nimport { RemovedUAError, RemovedPageError } from '../error'\nimport { RequestCookies } from './cookies'\n\nexport const INTERNALS = Symbol('internal request')\n\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 */\nexport class NextRequest extends Request {\n /** @internal */\n [INTERNALS]: {\n cookies: RequestCookies\n url: string\n nextUrl: NextURL\n }\n\n constructor(input: URL | RequestInfo, init: RequestInit = {}) {\n const url =\n typeof input !== 'string' && 'url' in input ? input.url : String(input)\n\n validateURL(url)\n\n // node Request instance requires duplex option when a body\n // is present or it errors, we don't handle this for\n // Request being passed in since it would have already\n // errored if this wasn't configured\n if (process.env.NEXT_RUNTIME !== 'edge') {\n if (init.body && init.duplex !== 'half') {\n init.duplex = 'half'\n }\n }\n\n if (input instanceof Request) super(input, init)\n else super(url, init)\n\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 nextUrl,\n url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE\n ? url\n : nextUrl.toString(),\n }\n }\n\n [Symbol.for('edge-runtime.inspect.custom')]() {\n return {\n cookies: this.cookies,\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\n public get cookies() {\n return this[INTERNALS].cookies\n }\n\n public get nextUrl() {\n return this[INTERNALS].nextUrl\n }\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 */\n public get page() {\n throw new RemovedPageError()\n }\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 */\n public get ua() {\n throw new RemovedUAError()\n }\n\n public get url() {\n return this[INTERNALS].url\n }\n}\n\nexport interface RequestInit extends globalThis.RequestInit {\n nextConfig?: {\n basePath?: string\n i18n?: I18NConfig | null\n trailingSlash?: boolean\n }\n signal?: AbortSignal\n // see https://github.com/whatwg/fetch/pull/1457\n duplex?: 'half'\n}\n","import type { BaseNextRequest } from '../../../base-http'\nimport type { NodeNextRequest } from '../../../base-http/node'\nimport type { WebNextRequest } from '../../../base-http/web'\nimport type { Writable } from 'node:stream'\n\nimport { getRequestMeta } from '../../../request-meta'\nimport { fromNodeOutgoingHttpHeaders } from '../../utils'\nimport { NextRequest } from '../request'\nimport { isNodeNextRequest, isWebNextRequest } from '../../../base-http/helpers'\n\nexport const ResponseAbortedName = 'ResponseAborted'\nexport class ResponseAborted extends Error {\n public readonly 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 */\nexport function createAbortController(response: Writable): AbortController {\n const controller = new AbortController()\n\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\n controller.abort(new ResponseAborted())\n })\n\n return controller\n}\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 */\nexport function signalFromNodeResponse(response: Writable): AbortSignal {\n const { errored, destroyed } = response\n if (errored || destroyed) {\n return AbortSignal.abort(errored ?? new ResponseAborted())\n }\n\n const { signal } = createAbortController(response)\n return signal\n}\n\nexport class NextRequestAdapter {\n public static fromBaseNextRequest(\n request: BaseNextRequest,\n signal: AbortSignal\n ): NextRequest {\n if (\n // The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME === 'edge' &&\n isWebNextRequest(request)\n ) {\n return NextRequestAdapter.fromWebNextRequest(request)\n } else if (\n // The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME !== 'edge' &&\n isNodeNextRequest(request)\n ) {\n return NextRequestAdapter.fromNodeNextRequest(request, signal)\n } else {\n throw new Error('Invariant: Unsupported NextRequest type')\n }\n }\n\n public static fromNodeNextRequest(\n request: NodeNextRequest,\n signal: AbortSignal\n ): NextRequest {\n // HEAD and GET requests can not have a body.\n let body: BodyInit | null = 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\n let url: 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\n return new NextRequest(url, {\n method: request.method,\n headers: fromNodeOutgoingHttpHeaders(request.headers),\n duplex: 'half',\n signal,\n // geo\n // ip\n // nextConfig\n\n // body can not be passed if request was aborted\n // or we get a Request body was disturbed error\n ...(signal.aborted\n ? {}\n : {\n body,\n }),\n })\n }\n\n public static fromWebNextRequest(request: WebNextRequest): NextRequest {\n // HEAD and GET requests can not have a body.\n let body: ReadableStream | null = null\n if (request.method !== 'GET' && request.method !== 'HEAD') {\n body = request.body\n }\n\n return new NextRequest(request.url, {\n method: request.method,\n headers: fromNodeOutgoingHttpHeaders(request.headers),\n duplex: 'half',\n signal: request.request.signal,\n // geo\n // ip\n // nextConfig\n\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 ? {}\n : {\n body,\n }),\n })\n }\n}\n","import type { AppPageModule } from './route-modules/app-page/module'\n\n// Combined load times for loading client components\nlet clientComponentLoadStart = 0\nlet clientComponentLoadTimes = 0\nlet clientComponentLoadCount = 0\n\nexport function wrapClientComponentLoader(\n ComponentMod: AppPageModule\n): AppPageModule['__next_app__'] {\n if (!('performance' in globalThis)) {\n return ComponentMod.__next_app__\n }\n\n return {\n require: (...args) => {\n const startTime = performance.now()\n\n if (clientComponentLoadStart === 0) {\n clientComponentLoadStart = startTime\n }\n\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 const result = ComponentMod.__next_app__.loadChunk(...args)\n // Avoid wrapping `loadChunk`'s result in an extra promise in case something like React depends on its identity.\n // We only need to know when it's settled.\n result.finally(() => {\n clientComponentLoadTimes += performance.now() - startTime\n })\n return result\n },\n }\n}\n\nexport function getClientComponentLoaderMetrics(\n options: { reset?: boolean } = {}\n) {\n const metrics =\n clientComponentLoadStart === 0\n ? undefined\n : {\n clientComponentLoadStart,\n clientComponentLoadTimes,\n clientComponentLoadCount,\n }\n\n if (options.reset) {\n clientComponentLoadStart = 0\n clientComponentLoadTimes = 0\n clientComponentLoadCount = 0\n }\n\n return metrics\n}\n","import type { ServerResponse } from 'node:http'\n\nimport {\n ResponseAbortedName,\n createAbortController,\n} 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'\n\nexport function isAbortError(e: any): e is Error & { name: 'AbortError' } {\n return e?.name === 'AbortError' || e?.name === ResponseAbortedName\n}\n\nfunction createWriterFromResponse(\n res: ServerResponse,\n waitUntilForEnd?: Promise<unknown>\n): WritableStream<Uint8Array> {\n let started = false\n\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<void>()\n function onDrain() {\n drained.resolve()\n }\n res.on('drain', onDrain)\n\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\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<void>()\n res.once('finish', () => {\n finished.resolve()\n })\n\n // Create a writable stream that will write to the response.\n return new WritableStream<Uint8Array>({\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\n if (\n 'performance' in globalThis &&\n process.env.NEXT_OTEL_PERFORMANCE_PREFIX\n ) {\n const metrics = getClientComponentLoaderMetrics()\n if (metrics) {\n performance.measure(\n `${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,\n {\n start: metrics.clientComponentLoadStart,\n end:\n metrics.clientComponentLoadStart +\n metrics.clientComponentLoadTimes,\n }\n )\n }\n }\n\n res.flushHeaders()\n getTracer().trace(\n NextNodeServerSpan.startResponse,\n {\n spanName: 'start response',\n },\n () => undefined\n )\n }\n\n try {\n const ok = res.write(chunk)\n\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\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\n // Reset the drained promise so that we can wait for the next drain event.\n drained = new DetachedPromise<void>()\n }\n } catch (err) {\n res.end()\n throw new Error('failed to write chunk to response', { cause: err })\n }\n },\n abort: (err) => {\n if (res.writableFinished) return\n\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\n if (res.writableFinished) return\n\n res.end()\n return finished.promise\n },\n })\n}\n\nexport async function pipeToNodeResponse(\n readable: ReadableStream<Uint8Array>,\n res: ServerResponse,\n waitUntilForEnd?: Promise<unknown>\n) {\n try {\n // If the response has already errored, then just return now.\n const { errored, destroyed } = res\n if (errored || destroyed) return\n\n // Create a new AbortController so that we can abort the readable if the\n // client disconnects.\n const controller = createAbortController(res)\n\n const writer = createWriterFromResponse(res, waitUntilForEnd)\n\n await readable.pipeTo(writer, { signal: controller.signal })\n } catch (err: any) {\n // If this isn't related to an abort error, re-throw it.\n if (isAbortError(err)) return\n\n throw new Error('failed to pipe response', { cause: err })\n }\n}\n","import type { OutgoingHttpHeaders, ServerResponse } from 'http'\nimport type { CacheControl } from './lib/cache-control'\nimport type { FetchMetrics } from './base-http'\n\nimport {\n chainStreams,\n streamFromBuffer,\n streamFromString,\n streamToString,\n} from './stream-utils/node-web-streams-helper'\nimport { isAbortError, pipeToNodeResponse } from './pipe-readable'\nimport type { RenderResumeDataCache } from './resume-data-cache/resume-data-cache'\nimport { InvariantError } from '../shared/lib/invariant-error'\nimport type {\n HTML_CONTENT_TYPE_HEADER,\n JSON_CONTENT_TYPE_HEADER,\n TEXT_PLAIN_CONTENT_TYPE_HEADER,\n} from '../lib/constants'\nimport type { RSC_CONTENT_TYPE_HEADER } from '../client/components/app-router-headers'\n\ntype ContentTypeOption =\n | typeof RSC_CONTENT_TYPE_HEADER // For App Page RSC responses\n | typeof HTML_CONTENT_TYPE_HEADER // For App Page, Pages HTML responses\n | typeof JSON_CONTENT_TYPE_HEADER // For API routes, Next.js data requests\n | typeof TEXT_PLAIN_CONTENT_TYPE_HEADER // For simplified errors\n\nexport type AppPageRenderResultMetadata = {\n flightData?: Buffer\n cacheControl?: CacheControl\n staticBailoutInfo?: {\n stack?: string\n description?: string\n }\n\n /**\n * The postponed state if the render had postponed and needs to be resumed.\n */\n postponed?: string\n\n /**\n * The headers to set on the response that were added by the render.\n */\n headers?: OutgoingHttpHeaders\n statusCode?: number\n fetchTags?: string\n fetchMetrics?: FetchMetrics\n\n segmentData?: Map<string, Buffer>\n\n /**\n * In development, the resume data cache is warmed up before the render. This\n * is attached to the metadata so that it can be used during the render. When\n * prerendering, the filled resume data cache is also attached to the metadata\n * so that it can be used when prerendering matching fallback shells.\n */\n renderResumeDataCache?: RenderResumeDataCache\n}\n\nexport type PagesRenderResultMetadata = {\n pageData?: any\n cacheControl?: CacheControl\n assetQueryString?: string\n isNotFound?: boolean\n isRedirect?: boolean\n}\n\nexport type StaticRenderResultMetadata = {}\n\nexport type RenderResultMetadata = AppPageRenderResultMetadata &\n PagesRenderResultMetadata &\n StaticRenderResultMetadata\n\nexport type RenderResultResponse =\n | ReadableStream<Uint8Array>[]\n | ReadableStream<Uint8Array>\n | string\n | Buffer\n | null\n\nexport type RenderResultOptions<\n Metadata extends RenderResultMetadata = RenderResultMetadata,\n> = {\n contentType: ContentTypeOption | null\n waitUntil?: Promise<unknown>\n metadata: Metadata\n}\n\nexport default class RenderResult<\n Metadata extends RenderResultMetadata = RenderResultMetadata,\n> {\n /**\n * The detected content type for the response. This is used to set the\n * `Content-Type` header.\n */\n public readonly contentType: ContentTypeOption | null\n\n /**\n * The metadata for the response. This is used to set the revalidation times\n * and other metadata.\n */\n public readonly metadata: Readonly<Metadata>\n\n /**\n * The response itself. This can be a string, a stream, or null. If it's a\n * string, then it's a static response. If it's a stream, then it's a\n * dynamic response. If it's null, then the response was not found or was\n * already sent.\n */\n private response: RenderResultResponse\n\n /**\n * A render result that represents an empty response. This is used to\n * represent a response that was not found or was already sent.\n */\n public static readonly EMPTY = new RenderResult<StaticRenderResultMetadata>(\n null,\n { metadata: {}, contentType: null }\n )\n\n /**\n * Creates a new RenderResult instance from a static response.\n *\n * @param value the static response value\n * @param contentType the content type of the response\n * @returns a new RenderResult instance\n */\n public static fromStatic(\n value: string | Buffer,\n contentType: ContentTypeOption\n ) {\n return new RenderResult<StaticRenderResultMetadata>(value, {\n metadata: {},\n contentType,\n })\n }\n\n private readonly waitUntil?: Promise<unknown>\n\n constructor(\n response: RenderResultResponse,\n { contentType, waitUntil, metadata }: RenderResultOptions<Metadata>\n ) {\n this.response = response\n this.contentType = contentType\n this.metadata = metadata\n this.waitUntil = waitUntil\n }\n\n public assignMetadata(metadata: Metadata) {\n Object.assign(this.metadata, metadata)\n }\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 */\n public get isNull(): boolean {\n return this.response === null\n }\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 */\n public get isDynamic(): boolean {\n return typeof this.response !== 'string'\n }\n\n /**\n * Returns the response if it is a string. If the page was dynamic, this will\n * return a promise if the `stream` option is true, or it will throw an error.\n *\n * @param stream Whether or not to return a promise if the response is dynamic\n * @returns The response as a string\n */\n public toUnchunkedString(stream?: false): string\n public toUnchunkedString(stream: true): Promise<string>\n public toUnchunkedString(stream = false): Promise<string> | string {\n if (this.response === null) {\n // If the response is null, return an empty string. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n return ''\n }\n\n if (typeof this.response !== 'string') {\n if (!stream) {\n throw new InvariantError(\n 'dynamic responses cannot be unchunked. This is a bug in Next.js'\n )\n }\n\n return streamToString(this.readable)\n }\n\n return this.response\n }\n\n /**\n * Returns a readable stream of the response.\n */\n private get readable(): ReadableStream<Uint8Array> {\n if (this.response === null) {\n // If the response is null, return an empty stream. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n return new ReadableStream<Uint8Array>({\n start(controller) {\n controller.close()\n },\n })\n }\n\n if (typeof this.response === 'string') {\n return streamFromString(this.response)\n }\n\n if (Buffer.isBuffer(this.response)) {\n return streamFromBuffer(this.response)\n }\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\n return this.response\n }\n\n /**\n * Coerces the response to an array of streams. This will convert the response\n * to an array of streams if it is not already one.\n *\n * @returns An array of streams\n */\n private coerce(): ReadableStream<Uint8Array>[] {\n if (this.response === null) {\n // If the response is null, return an empty stream. This behavior is\n // intentional as we're now providing the `RenderResult.EMPTY` value.\n return []\n }\n\n if (typeof this.response === 'string') {\n return [streamFromString(this.response)]\n } else if (Array.isArray(this.response)) {\n return this.response\n } else if (Buffer.isBuffer(this.response)) {\n return [streamFromBuffer(this.response)]\n } else {\n return [this.response]\n }\n }\n\n /**\n * Unshifts 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 start of the array. When this response is piped, all of the streams\n * will be piped one after the other.\n *\n * @param readable The new stream to unshift\n */\n public unshift(readable: ReadableStream<Uint8Array>): void {\n // Coerce the response to an array of streams.\n this.response = this.coerce()\n\n // Add the new stream to the start of the array.\n this.response.unshift(readable)\n }\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 */\n public push(readable: ReadableStream<Uint8Array>): void {\n // Coerce the response to an array of streams.\n this.response = this.coerce()\n\n // Add the new stream to the end of the array.\n this.response.push(readable)\n }\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 */\n public async pipeTo(writable: WritableStream<Uint8Array>): Promise<void> {\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\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\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\n return\n }\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 /**\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 */\n public async pipeToNodeResponse(res: ServerResponse) {\n await pipeToNodeResponse(this.readable, res, this.waitUntil)\n }\n}\n","import type { NextParsedUrlQuery } from './request-meta'\n\nimport { NEXT_RSC_UNION_QUERY } from '../client/components/app-router-headers'\n\nconst INTERNAL_QUERY_NAMES = [NEXT_RSC_UNION_QUERY] as const\n\nexport function stripInternalQueries(query: NextParsedUrlQuery) {\n for (const name of INTERNAL_QUERY_NAMES) {\n delete query[name]\n }\n}\n\nexport function stripInternalSearchParams<T extends string | URL>(url: T): T {\n const isStringUrl = typeof url === 'string'\n const instance = isStringUrl ? new URL(url) : (url as URL)\n\n instance.searchParams.delete(NEXT_RSC_UNION_QUERY)\n\n return (isStringUrl ? instance.toString() : instance) as T\n}\n","import type { AppRenderContext } from '../../server/app-render/app-render'\nimport type { MetadataContext } from './types/resolvers'\n\nexport function createMetadataContext(\n renderOpts: AppRenderContext['renderOpts']\n): MetadataContext {\n return {\n trailingSlash: renderOpts.trailingSlash,\n isStaticMetadataRouteFile: false,\n }\n}\n","import { RequestCookies } from '../cookies'\n\nimport { ResponseCookies } from '../cookies'\nimport { ReflectAdapter } from './reflect'\nimport { workAsyncStorage } from '../../../app-render/work-async-storage.external'\nimport type { RequestStore } from '../../../app-render/work-unit-async-storage.external'\n\n/**\n * @internal\n */\nexport class ReadonlyRequestCookiesError extends Error {\n constructor() {\n super(\n 'Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options'\n )\n }\n\n public static callable() {\n throw new ReadonlyRequestCookiesError()\n }\n}\n\n// We use this to type some APIs but we don't construct instances directly\nexport type { ResponseCookies }\n\n// The `cookies()` API is a mix of request and response cookies. For `.get()` methods,\n// we want to return the request cookie if it exists. For mutative methods like `.set()`,\n// we want to return the response cookie.\nexport type ReadonlyRequestCookies = Omit<\n RequestCookies,\n 'set' | 'clear' | 'delete'\n> &\n Pick<ResponseCookies, 'set' | 'delete'>\n\nexport class RequestCookiesAdapter {\n public static seal(cookies: RequestCookies): ReadonlyRequestCookies {\n return new Proxy(cookies as any, {\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}\n\nconst SYMBOL_MODIFY_COOKIE_VALUES = Symbol.for('next.mutated.cookies')\n\nexport function getModifiedCookieValues(\n cookies: ResponseCookies\n): ResponseCookie[] {\n const modified: ResponseCookie[] | undefined = (cookies as unknown as any)[\n SYMBOL_MODIFY_COOKIE_VALUES\n ]\n if (!modified || !Array.isArray(modified) || modified.length === 0) {\n return []\n }\n\n return modified\n}\n\ntype SetCookieArgs =\n | [key: string, value: string, cookie?: Partial<ResponseCookie>]\n | [options: ResponseCookie]\n\nexport function appendMutableCookies(\n headers: Headers,\n mutableCookies: ResponseCookies\n): boolean {\n const modifiedCookieValues = getModifiedCookieValues(mutableCookies)\n if (modifiedCookieValues.length === 0) {\n return false\n }\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\n // Set the modified cookies as fallbacks.\n for (const cookie of modifiedCookieValues) {\n resCookies.set(cookie)\n }\n\n // Set the original cookies as the final values.\n for (const cookie of returnedCookies) {\n resCookies.set(cookie)\n }\n\n return true\n}\n\ntype ResponseCookie = NonNullable<\n ReturnType<InstanceType<typeof ResponseCookies>['get']>\n>\n\nexport class MutableRequestCookiesAdapter {\n public static wrap(\n cookies: RequestCookies,\n onUpdateCookies?: (cookies: string[]) => void\n ): ResponseCookies {\n const responseCookies = new ResponseCookies(new Headers())\n for (const cookie of cookies.getAll()) {\n responseCookies.set(cookie)\n }\n\n let modifiedValues: ResponseCookie[] = []\n const modifiedCookies = new Set<string>()\n const updateResponseCookies = () => {\n // TODO-APP: change method of getting workStore\n const workStore = workAsyncStorage.getStore()\n if (workStore) {\n workStore.pathWasRevalidated = true\n }\n\n const allCookies = responseCookies.getAll()\n modifiedValues = allCookies.filter((c) => modifiedCookies.has(c.name))\n if (onUpdateCookies) {\n const serializedCookies: string[] = []\n for (const cookie of modifiedValues) {\n const tempCookies = new ResponseCookies(new Headers())\n tempCookies.set(cookie)\n serializedCookies.push(tempCookies.toString())\n }\n\n onUpdateCookies(serializedCookies)\n }\n }\n\n const wrappedCookies = 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\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: [string] | [ResponseCookie]) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.delete(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n modifiedCookies.add(\n typeof args[0] === 'string' ? args[0] : args[0].name\n )\n try {\n target.set(...args)\n return wrappedCookies\n } finally {\n updateResponseCookies()\n }\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n\n return wrappedCookies\n }\n}\n\nexport function createCookiesWithMutableAccessCheck(\n requestStore: RequestStore\n): ResponseCookies {\n const wrappedCookies = new Proxy(requestStore.mutableCookies, {\n get(target, prop, receiver) {\n switch (prop) {\n case 'delete':\n return function (...args: [string] | [ResponseCookie]) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().delete')\n target.delete(...args)\n return wrappedCookies\n }\n case 'set':\n return function (...args: SetCookieArgs) {\n ensureCookiesAreStillMutable(requestStore, 'cookies().set')\n target.set(...args)\n return wrappedCookies\n }\n\n default:\n return ReflectAdapter.get(target, prop, receiver)\n }\n },\n })\n return wrappedCookies\n}\n\nexport function areCookiesMutableInCurrentPhase(requestStore: RequestStore) {\n return requestStore.phase === 'action'\n}\n\n/** Ensure that cookies() starts throwing on mutation\n * if we changed phases and can no longer mutate.\n *\n * This can happen when going:\n * 'render' -> 'after'\n * 'action' -> 'render'\n * */\nfunction ensureCookiesAreStillMutable(\n requestStore: RequestStore,\n _callingExpression: string\n) {\n if (!areCookiesMutableInCurrentPhase(requestStore)) {\n // TODO: maybe we can give a more precise error message based on callingExpression?\n throw new ReadonlyRequestCookiesError()\n }\n}\n\nexport function responseCookiesToRequestCookies(\n responseCookies: ResponseCookies\n): RequestCookies {\n const requestCookies = new RequestCookies(new Headers())\n for (const cookie of responseCookies.getAll()) {\n requestCookies.set(cookie)\n }\n return requestCookies\n}\n","import type { IncomingMessage } from 'http'\nimport type { ReadonlyRequestCookies } from '../web/spec-extension/adapters/request-cookies'\nimport type { ResponseCookies } from '../web/spec-extension/cookies'\nimport type { BaseNextRequest } from '../base-http'\nimport type { NextRequest } from '../web/spec-extension/request'\n\nimport {\n COOKIE_NAME_PRERENDER_BYPASS,\n checkIsOnDemandRevalidate,\n} from '../api-utils'\nimport type { __ApiPreviewProps } from '../api-utils'\n\nexport class DraftModeProvider {\n /**\n * @internal - this declaration is stripped via `tsc --stripInternal`\n */\n private _isEnabled: boolean\n\n /**\n * @internal - this declaration is stripped via `tsc --stripInternal`\n */\n private readonly _previewModeId: string | undefined\n\n /**\n * @internal - this declaration is stripped via `tsc --stripInternal`\n */\n private readonly _mutableCookies: ResponseCookies\n\n constructor(\n previewProps: __ApiPreviewProps | undefined,\n req: IncomingMessage | BaseNextRequest<unknown> | NextRequest,\n cookies: ReadonlyRequestCookies,\n mutableCookies: ResponseCookies\n ) {\n // The logic for draftMode() is very similar to tryGetPreviewData()\n // but Draft Mode does not have any data associated with it.\n const isOnDemandRevalidate =\n previewProps &&\n checkIsOnDemandRevalidate(req, previewProps).isOnDemandRevalidate\n\n const cookieValue = cookies.get(COOKIE_NAME_PRERENDER_BYPASS)?.value\n\n this._isEnabled = Boolean(\n !isOnDemandRevalidate &&\n cookieValue &&\n previewProps &&\n (cookieValue === previewProps.previewModeId ||\n // In dev mode, the cookie can be actual hash value preview id but the preview props can still be `development-id`.\n (process.env.NODE_ENV !== 'production' &&\n previewProps.previewModeId === 'development-id'))\n )\n\n this._previewModeId = previewProps?.previewModeId\n this._mutableCookies = mutableCookies\n }\n\n get isEnabled() {\n return this._isEnabled\n }\n\n enable() {\n if (!this._previewModeId) {\n throw new Error(\n 'Invariant: previewProps missing previewModeId this should never happen'\n )\n }\n\n this._mutableCookies.set({\n name: COOKIE_NAME_PRERENDER_BYPASS,\n value: this._previewModeId,\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== 'development' ? 'none' : 'lax',\n secure: process.env.NODE_ENV !== 'development',\n path: '/',\n })\n\n this._isEnabled = true\n }\n\n disable() {\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 this._mutableCookies.set({\n name: COOKIE_NAME_PRERENDER_BYPASS,\n value: '',\n httpOnly: true,\n sameSite: process.env.NODE_ENV !== 'development' ? 'none' : 'lax',\n secure: process.env.NODE_ENV !== 'development',\n path: '/',\n expires: new Date(0),\n })\n\n this._isEnabled = false\n }\n}\n","import type { BaseNextRequest, BaseNextResponse } from '../base-http'\nimport type { IncomingHttpHeaders } from 'http'\nimport type { RequestStore } from '../app-render/work-unit-async-storage.external'\nimport type { RenderOpts } from '../app-render/types'\nimport type { NextRequest } from '../web/spec-extension/request'\nimport type { __ApiPreviewProps } from '../api-utils'\n\nimport { FLIGHT_HEADERS } from '../../client/components/app-router-headers'\nimport {\n HeadersAdapter,\n type ReadonlyHeaders,\n} from '../web/spec-extension/adapters/headers'\nimport {\n MutableRequestCookiesAdapter,\n RequestCookiesAdapter,\n responseCookiesToRequestCookies,\n createCookiesWithMutableAccessCheck,\n type ReadonlyRequestCookies,\n} from '../web/spec-extension/adapters/request-cookies'\nimport { ResponseCookies, RequestCookies } from '../web/spec-extension/cookies'\nimport { DraftModeProvider } from './draft-mode-provider'\nimport { splitCookiesString } from '../web/utils'\nimport type { ServerComponentsHmrCache } from '../response-cache'\nimport type { RenderResumeDataCache } from '../resume-data-cache/resume-data-cache'\nimport type { Params } from '../request/params'\nimport type { ImplicitTags } from '../lib/implicit-tags'\nimport type { OpaqueFallbackRouteParams } from '../request/fallback-params'\n\nfunction getHeaders(headers: Headers | IncomingHttpHeaders): ReadonlyHeaders {\n const cleaned = HeadersAdapter.from(headers)\n for (const header of FLIGHT_HEADERS) {\n cleaned.delete(header)\n }\n\n return HeadersAdapter.seal(cleaned)\n}\n\nfunction getMutableCookies(\n headers: Headers | IncomingHttpHeaders,\n onUpdateCookies?: (cookies: string[]) => void\n): ResponseCookies {\n const cookies = new RequestCookies(HeadersAdapter.from(headers))\n return MutableRequestCookiesAdapter.wrap(cookies, onUpdateCookies)\n}\n\nexport type WrapperRenderOpts = Partial<Pick<RenderOpts, 'onUpdateCookies'>> & {\n previewProps?: __ApiPreviewProps\n}\n\ntype RequestContext = RequestResponsePair & {\n /**\n * The URL of the request. This only specifies the pathname and the search\n * part of the URL. This is only undefined when generating static paths (ie,\n * there is no request in progress, nor do we know one).\n */\n url: {\n /**\n * The pathname of the requested URL.\n */\n pathname: string\n\n /**\n * The search part of the requested URL. If the request did not provide a\n * search part, this will be an empty string.\n */\n search?: string\n }\n phase: RequestStore['phase']\n renderOpts?: WrapperRenderOpts\n isHmrRefresh?: boolean\n serverComponentsHmrCache?: ServerComponentsHmrCache\n implicitTags: ImplicitTags\n}\n\ntype RequestResponsePair =\n | { req: BaseNextRequest; res: BaseNextResponse } // for an app page\n | { req: NextRequest; res: undefined } // in an api route or middleware\n\n/**\n * If middleware set cookies in this request (indicated by `x-middleware-set-cookie`),\n * then merge those into the existing cookie object, so that when `cookies()` is accessed\n * it's able to read the newly set cookies.\n */\nfunction mergeMiddlewareCookies(\n req: RequestContext['req'],\n existingCookies: RequestCookies | ResponseCookies\n) {\n if (\n 'x-middleware-set-cookie' in req.headers &&\n typeof req.headers['x-middleware-set-cookie'] === 'string'\n ) {\n const setCookieValue = req.headers['x-middleware-set-cookie']\n const responseHeaders = new Headers()\n\n for (const cookie of splitCookiesString(setCookieValue)) {\n responseHeaders.append('set-cookie', cookie)\n }\n\n const responseCookies = new ResponseCookies(responseHeaders)\n\n // Transfer cookies from ResponseCookies to RequestCookies\n for (const cookie of responseCookies.getAll()) {\n existingCookies.set(cookie)\n }\n }\n}\n\nexport function createRequestStoreForRender(\n req: RequestContext['req'],\n res: RequestContext['res'],\n url: RequestContext['url'],\n rootParams: Params,\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps'],\n isHmrRefresh: RequestContext['isHmrRefresh'],\n serverComponentsHmrCache: RequestContext['serverComponentsHmrCache'],\n renderResumeDataCache: RenderResumeDataCache | null,\n devFallbackParams: OpaqueFallbackRouteParams | null\n): RequestStore {\n return createRequestStoreImpl(\n // Pages start in render phase by default\n 'render',\n req,\n res,\n url,\n rootParams,\n implicitTags,\n onUpdateCookies,\n renderResumeDataCache,\n previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n devFallbackParams\n )\n}\n\nexport function createRequestStoreForAPI(\n req: RequestContext['req'],\n url: RequestContext['url'],\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n previewProps: WrapperRenderOpts['previewProps']\n): RequestStore {\n return createRequestStoreImpl(\n // API routes start in action phase by default\n 'action',\n req,\n undefined,\n url,\n {},\n implicitTags,\n onUpdateCookies,\n null,\n previewProps,\n false,\n undefined,\n null\n )\n}\n\nfunction createRequestStoreImpl(\n phase: RequestStore['phase'],\n req: RequestContext['req'],\n res: RequestContext['res'],\n url: RequestContext['url'],\n rootParams: Params,\n implicitTags: RequestContext['implicitTags'],\n onUpdateCookies: RenderOpts['onUpdateCookies'],\n renderResumeDataCache: RenderResumeDataCache | null,\n previewProps: WrapperRenderOpts['previewProps'],\n isHmrRefresh: RequestContext['isHmrRefresh'],\n serverComponentsHmrCache: RequestContext['serverComponentsHmrCache'],\n devFallbackParams: OpaqueFallbackRouteParams | null | undefined\n): RequestStore {\n function defaultOnUpdateCookies(cookies: string[]) {\n if (res) {\n res.setHeader('Set-Cookie', cookies)\n }\n }\n\n const cache: {\n headers?: ReadonlyHeaders\n cookies?: ReadonlyRequestCookies\n mutableCookies?: ResponseCookies\n userspaceMutableCookies?: ResponseCookies\n draftMode?: DraftModeProvider\n } = {}\n\n return {\n type: 'request',\n phase,\n implicitTags,\n // Rather than just using the whole `url` here, we pull the parts we want\n // to ensure we don't use parts of the URL that we shouldn't. This also\n // lets us avoid requiring an empty string for `search` in the type.\n url: { pathname: url.pathname, search: url.search ?? '' },\n rootParams,\n get headers() {\n if (!cache.headers) {\n // Seal the headers object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.headers = getHeaders(req.headers)\n }\n\n return cache.headers\n },\n get cookies() {\n if (!cache.cookies) {\n // if middleware is setting cookie(s), then include those in\n // the initial cached cookies so they can be read in render\n const requestCookies = new RequestCookies(\n HeadersAdapter.from(req.headers)\n )\n\n mergeMiddlewareCookies(req, requestCookies)\n\n // Seal the cookies object that'll freeze out any methods that could\n // mutate the underlying data.\n cache.cookies = RequestCookiesAdapter.seal(requestCookies)\n }\n\n return cache.cookies\n },\n set cookies(value: ReadonlyRequestCookies) {\n cache.cookies = value\n },\n get mutableCookies() {\n if (!cache.mutableCookies) {\n const mutableCookies = getMutableCookies(\n req.headers,\n onUpdateCookies || (res ? defaultOnUpdateCookies : undefined)\n )\n\n mergeMiddlewareCookies(req, mutableCookies)\n\n cache.mutableCookies = mutableCookies\n }\n return cache.mutableCookies\n },\n get userspaceMutableCookies() {\n if (!cache.userspaceMutableCookies) {\n const userspaceMutableCookies =\n createCookiesWithMutableAccessCheck(this)\n cache.userspaceMutableCookies = userspaceMutableCookies\n }\n return cache.userspaceMutableCookies\n },\n get draftMode() {\n if (!cache.draftMode) {\n cache.draftMode = new DraftModeProvider(\n previewProps,\n req,\n this.cookies,\n this.mutableCookies\n )\n }\n\n return cache.draftMode\n },\n renderResumeDataCache: renderResumeDataCache ?? null,\n isHmrRefresh,\n serverComponentsHmrCache:\n serverComponentsHmrCache ||\n (globalThis as any).__serverComponentsHmrCache,\n devFallbackParams,\n }\n}\n\nexport function synchronizeMutableCookies(store: RequestStore) {\n // TODO: does this need to update headers as well?\n store.cookies = RequestCookiesAdapter.seal(\n responseCookiesToRequestCookies(store.mutableCookies)\n )\n}\n","/**\n * Node in the doubly-linked list used for LRU tracking.\n * Each node represents a cache entry with bidirectional pointers.\n */\nclass LRUNode<T> {\n public readonly key: string\n public data: T\n public size: number\n public prev: LRUNode<T> | SentinelNode<T> | null = null\n public next: LRUNode<T> | SentinelNode<T> | null = null\n\n constructor(key: string, data: T, size: number) {\n this.key = key\n this.data = data\n this.size = size\n }\n}\n\n/**\n * Sentinel node used for head/tail boundaries.\n * These nodes don't contain actual cache data but simplify list operations.\n */\nclass SentinelNode<T> {\n public prev: LRUNode<T> | SentinelNode<T> | null = null\n public next: LRUNode<T> | SentinelNode<T> | null = null\n}\n\n/**\n * LRU (Least Recently Used) Cache implementation using a doubly-linked list\n * and hash map for O(1) operations.\n *\n * Algorithm:\n * - Uses a doubly-linked list to maintain access order (most recent at head)\n * - Hash map provides O(1) key-to-node lookup\n * - Sentinel head/tail nodes simplify edge case handling\n * - Size-based eviction supports custom size calculation functions\n *\n * Data Structure Layout:\n * HEAD <-> [most recent] <-> ... <-> [least recent] <-> TAIL\n *\n * Operations:\n * - get(): Move accessed node to head (mark as most recent)\n * - set(): Add new node at head, evict from tail if over capacity\n * - Eviction: Remove least recent node (tail.prev) when size exceeds limit\n */\nexport class LRUCache<T> {\n private readonly cache: Map<string, LRUNode<T>> = new Map()\n private readonly head: SentinelNode<T>\n private readonly tail: SentinelNode<T>\n private totalSize: number = 0\n private readonly maxSize: number\n private readonly calculateSize: ((value: T) => number) | undefined\n\n constructor(maxSize: number, calculateSize?: (value: T) => number) {\n this.maxSize = maxSize\n this.calculateSize = calculateSize\n\n // Create sentinel nodes to simplify doubly-linked list operations\n // HEAD <-> TAIL (empty list)\n this.head = new SentinelNode<T>()\n this.tail = new SentinelNode<T>()\n this.head.next = this.tail\n this.tail.prev = this.head\n }\n\n /**\n * Adds a node immediately after the head (marks as most recently used).\n * Used when inserting new items or when an item is accessed.\n * PRECONDITION: node must be disconnected (prev/next should be null)\n */\n private addToHead(node: LRUNode<T>): void {\n node.prev = this.head\n node.next = this.head.next\n // head.next is always non-null (points to tail or another node)\n this.head.next!.prev = node\n this.head.next = node\n }\n\n /**\n * Removes a node from its current position in the doubly-linked list.\n * Updates the prev/next pointers of adjacent nodes to maintain list integrity.\n * PRECONDITION: node must be connected (prev/next are non-null)\n */\n private removeNode(node: LRUNode<T>): void {\n // Connected nodes always have non-null prev/next\n node.prev!.next = node.next\n node.next!.prev = node.prev\n }\n\n /**\n * Moves an existing node to the head position (marks as most recently used).\n * This is the core LRU operation - accessed items become most recent.\n */\n private moveToHead(node: LRUNode<T>): void {\n this.removeNode(node)\n this.addToHead(node)\n }\n\n /**\n * Removes and returns the least recently used node (the one before tail).\n * This is called during eviction when the cache exceeds capacity.\n * PRECONDITION: cache is not empty (ensured by caller)\n */\n private removeTail(): LRUNode<T> {\n const lastNode = this.tail.prev as LRUNode<T>\n // tail.prev is always non-null and always LRUNode when cache is not empty\n this.removeNode(lastNode)\n return lastNode\n }\n\n /**\n * Sets a key-value pair in the cache.\n * If the key exists, updates the value and moves to head.\n * If new, adds at head and evicts from tail if necessary.\n *\n * Time Complexity:\n * - O(1) for uniform item sizes\n * - O(k) where k is the number of items evicted (can be O(N) for variable sizes)\n */\n public set(key: string, value: T): void {\n const size = this.calculateSize?.(value) ?? 1\n if (size > this.maxSize) {\n console.warn('Single item size exceeds maxSize')\n return\n }\n\n const existing = this.cache.get(key)\n if (existing) {\n // Update existing node: adjust size and move to head (most recent)\n existing.data = value\n this.totalSize = this.totalSize - existing.size + size\n existing.size = size\n this.moveToHead(existing)\n } else {\n // Add new node at head (most recent position)\n const newNode = new LRUNode(key, value, size)\n this.cache.set(key, newNode)\n this.addToHead(newNode)\n this.totalSize += size\n }\n\n // Evict least recently used items until under capacity\n while (this.totalSize > this.maxSize && this.cache.size > 0) {\n const tail = this.removeTail()\n this.cache.delete(tail.key)\n this.totalSize -= tail.size\n }\n }\n\n /**\n * Checks if a key exists in the cache.\n * This is a pure query operation - does NOT update LRU order.\n *\n * Time Complexity: O(1)\n */\n public has(key: string): boolean {\n return this.cache.has(key)\n }\n\n /**\n * Retrieves a value by key and marks it as most recently used.\n * Moving to head maintains the LRU property for future evictions.\n *\n * Time Complexity: O(1)\n */\n public get(key: string): T | undefined {\n const node = this.cache.get(key)\n if (!node) return undefined\n\n // Mark as most recently used by moving to head\n this.moveToHead(node)\n\n return node.data\n }\n\n /**\n * Returns an iterator over the cache entries. The order is outputted in the\n * order of most recently used to least recently used.\n */\n public *[Symbol.iterator](): IterableIterator<[string, T]> {\n let current = this.head.next\n while (current && current !== this.tail) {\n // Between head and tail, current is always LRUNode\n const node = current as LRUNode<T>\n yield [node.key, node.data]\n current = current.next\n }\n }\n\n /**\n * Removes a specific key from the cache.\n * Updates both the hash map and doubly-linked list.\n *\n * Time Complexity: O(1)\n */\n public remove(key: string): void {\n const node = this.cache.get(key)\n if (!node) return\n\n this.removeNode(node)\n this.cache.delete(key)\n this.totalSize -= node.size\n }\n\n /**\n * Returns the number of items in the cache.\n */\n public get size(): number {\n return this.cache.size\n }\n\n /**\n * Returns the current total size of all cached items.\n * This uses the custom size calculation if provided.\n */\n public get currentSize(): number {\n return this.totalSize\n }\n}\n","/**\n * This is the default \"use cache\" handler it defaults to an in-memory store.\n * In-memory caches are fragile and should not use stale-while-revalidate\n * semantics on the caches because it's not worth warming up an entry that's\n * likely going to get evicted before we get to use it anyway. However, we also\n * don't want to reuse a stale entry for too long so stale entries should be\n * considered expired/missing in such cache handlers.\n */\n\nimport { LRUCache } from '../lru-cache'\nimport type { CacheEntry, CacheHandler } from './types'\nimport {\n areTagsExpired,\n areTagsStale,\n tagsManifest,\n type TagManifestEntry,\n} from '../incremental-cache/tags-manifest.external'\n\ntype PrivateCacheEntry = {\n entry: CacheEntry\n\n // For the default cache we store errored cache\n // entries and allow them to be used up to 3 times\n // after that we want to dispose it and try for fresh\n\n // If an entry is errored we return no entry\n // three times so that we retry hitting origin (MISS)\n // and then if it still fails to set after the third we\n // return the errored content and use expiration of\n // Math.min(30, entry.expiration)\n isErrored: boolean\n errorRetryCount: number\n\n // compute size on set since we need to read size\n // of the ReadableStream for LRU evicting\n size: number\n}\n\nexport function createDefaultCacheHandler(maxSize: number): CacheHandler {\n // If the max size is 0, return a cache handler that doesn't cache anything,\n // this avoids an unnecessary LRUCache instance and potential memory\n // allocation.\n if (maxSize === 0) {\n return {\n get: () => Promise.resolve(undefined),\n set: () => Promise.resolve(),\n refreshTags: () => Promise.resolve(),\n getExpiration: () => Promise.resolve(0),\n updateTags: () => Promise.resolve(),\n }\n }\n\n const memoryCache = new LRUCache<PrivateCacheEntry>(\n maxSize,\n (entry) => entry.size\n )\n const pendingSets = new Map<string, Promise<void>>()\n\n const debug = process.env.NEXT_PRIVATE_DEBUG_CACHE\n ? console.debug.bind(console, 'DefaultCacheHandler:')\n : undefined\n\n return {\n async get(cacheKey) {\n const pendingPromise = pendingSets.get(cacheKey)\n\n if (pendingPromise) {\n debug?.('get', cacheKey, 'pending')\n await pendingPromise\n }\n\n const privateEntry = memoryCache.get(cacheKey)\n\n if (!privateEntry) {\n debug?.('get', cacheKey, 'not found')\n return undefined\n }\n\n const entry = privateEntry.entry\n if (\n performance.timeOrigin + performance.now() >\n entry.timestamp + entry.revalidate * 1000\n ) {\n // In-memory caches should expire after revalidate time because it is\n // unlikely that a new entry will be able to be used before it is dropped\n // from the cache.\n debug?.('get', cacheKey, 'expired')\n\n return undefined\n }\n\n let revalidate = entry.revalidate\n\n if (areTagsExpired(entry.tags, entry.timestamp)) {\n debug?.('get', cacheKey, 'had expired tag')\n return undefined\n }\n\n if (areTagsStale(entry.tags, entry.timestamp)) {\n debug?.('get', cacheKey, 'had stale tag')\n revalidate = -1\n }\n\n const [returnStream, newSaved] = entry.value.tee()\n entry.value = newSaved\n\n debug?.('get', cacheKey, 'found', {\n tags: entry.tags,\n timestamp: entry.timestamp,\n expire: entry.expire,\n revalidate,\n })\n\n return {\n ...entry,\n revalidate,\n value: returnStream,\n }\n },\n\n async set(cacheKey, pendingEntry) {\n debug?.('set', cacheKey, 'start')\n\n let resolvePending: () => void = () => {}\n const pendingPromise = new Promise<void>((resolve) => {\n resolvePending = resolve\n })\n pendingSets.set(cacheKey, pendingPromise)\n\n const entry = await pendingEntry\n\n let size = 0\n\n try {\n const [value, clonedValue] = entry.value.tee()\n entry.value = value\n const reader = clonedValue.getReader()\n\n for (let chunk; !(chunk = await reader.read()).done; ) {\n size += Buffer.from(chunk.value).byteLength\n }\n\n memoryCache.set(cacheKey, {\n entry,\n isErrored: false,\n errorRetryCount: 0,\n size,\n })\n\n debug?.('set', cacheKey, 'done')\n } catch (err) {\n // TODO: store partial buffer with error after we retry 3 times\n debug?.('set', cacheKey, 'failed', err)\n } finally {\n resolvePending()\n pendingSets.delete(cacheKey)\n }\n },\n\n async refreshTags() {\n // Nothing to do for an in-memory cache handler.\n },\n\n async getExpiration(tags) {\n const expirations = tags.map((tag) => {\n const entry = tagsManifest.get(tag)\n if (!entry) return 0\n // Return the most recent timestamp (either expired or stale)\n return entry.expired || 0\n })\n\n const expiration = Math.max(...expirations, 0)\n\n debug?.('getExpiration', { tags, expiration })\n\n return expiration\n },\n\n async updateTags(tags, durations) {\n const now = Math.round(performance.timeOrigin + performance.now())\n debug?.('updateTags', { tags, timestamp: now })\n\n for (const tag of tags) {\n // TODO: update file-system-cache?\n const existingEntry = tagsManifest.get(tag) || {}\n\n if (durations) {\n // Use provided durations directly\n const updates: TagManifestEntry = { ...existingEntry }\n\n // mark as stale immediately\n updates.stale = now\n\n if (durations.expire !== undefined) {\n updates.expired = now + durations.expire * 1000 // Convert seconds to ms\n }\n\n tagsManifest.set(tag, updates)\n } else {\n // Update expired field for immediate expiration (default behavior when no durations provided)\n tagsManifest.set(tag, { ...existingEntry, expired: now })\n }\n }\n },\n }\n}\n","import { createDefaultCacheHandler } from '../lib/cache-handlers/default'\nimport type { CacheHandler } from '../lib/cache-handlers/types'\n\nconst debug = process.env.NEXT_PRIVATE_DEBUG_CACHE\n ? (message: string, ...args: any[]) => {\n console.log(`use-cache: ${message}`, ...args)\n }\n : undefined\n\nconst handlersSymbol = Symbol.for('@next/cache-handlers')\nconst handlersMapSymbol = Symbol.for('@next/cache-handlers-map')\nconst handlersSetSymbol = Symbol.for('@next/cache-handlers-set')\n\n/**\n * The reference to the cache handlers. We store the cache handlers on the\n * global object so that we can access the same instance across different\n * boundaries (such as different copies of the same module).\n */\nconst reference: typeof globalThis & {\n [handlersSymbol]?: {\n RemoteCache?: CacheHandler\n DefaultCache?: CacheHandler\n }\n [handlersMapSymbol]?: Map<string, CacheHandler>\n [handlersSetSymbol]?: Set<CacheHandler>\n} = globalThis\n\n/**\n * Initialize the cache handlers.\n * @param cacheMaxMemorySize - The maximum memory size of the cache in bytes, if\n * not provided, the default memory size will be used.\n * @returns `true` if the cache handlers were initialized, `false` if they were already initialized.\n */\nexport function initializeCacheHandlers(cacheMaxMemorySize: number): boolean {\n // If the cache handlers have already been initialized, don't do it again.\n if (reference[handlersMapSymbol]) {\n debug?.('cache handlers already initialized')\n return false\n }\n\n debug?.('initializing cache handlers')\n reference[handlersMapSymbol] = new Map<string, CacheHandler>()\n\n // Initialize the cache from the symbol contents first.\n if (reference[handlersSymbol]) {\n let fallback: CacheHandler\n if (reference[handlersSymbol].DefaultCache) {\n debug?.('setting \"default\" cache handler from symbol')\n fallback = reference[handlersSymbol].DefaultCache\n } else {\n debug?.('setting \"default\" cache handler from default')\n fallback = createDefaultCacheHandler(cacheMaxMemorySize)\n }\n\n reference[handlersMapSymbol].set('default', fallback)\n\n if (reference[handlersSymbol].RemoteCache) {\n debug?.('setting \"remote\" cache handler from symbol')\n reference[handlersMapSymbol].set(\n 'remote',\n reference[handlersSymbol].RemoteCache\n )\n } else {\n debug?.('setting \"remote\" cache handler from default')\n reference[handlersMapSymbol].set('remote', fallback)\n }\n } else {\n const handler = createDefaultCacheHandler(cacheMaxMemorySize)\n\n debug?.('setting \"default\" cache handler from default')\n reference[handlersMapSymbol].set('default', handler)\n debug?.('setting \"remote\" cache handler from default')\n reference[handlersMapSymbol].set('remote', handler)\n }\n\n // Create a set of the cache handlers.\n reference[handlersSetSymbol] = new Set(reference[handlersMapSymbol].values())\n\n return true\n}\n\n/**\n * Get a cache handler by kind.\n * @param kind - The kind of cache handler to get.\n * @returns The cache handler, or `undefined` if it does not exist.\n * @throws If the cache handlers are not initialized.\n */\nexport function getCacheHandler(kind: string): CacheHandler | undefined {\n // This should never be called before initializeCacheHandlers.\n if (!reference[handlersMapSymbol]) {\n throw new Error('Cache handlers not initialized')\n }\n\n return reference[handlersMapSymbol].get(kind)\n}\n\n/**\n * Get a set iterator over the cache handlers.\n * @returns An iterator over the cache handlers, or `undefined` if they are not\n * initialized.\n */\nexport function getCacheHandlers(): SetIterator<CacheHandler> | undefined {\n if (!reference[handlersSetSymbol]) {\n return undefined\n }\n\n return reference[handlersSetSymbol].values()\n}\n\n/**\n * Get a map iterator over the cache handlers (keyed by kind).\n * @returns An iterator over the cache handler entries, or `undefined` if they\n * are not initialized.\n * @throws If the cache handlers are not initialized.\n */\nexport function getCacheHandlerEntries():\n | MapIterator<[string, CacheHandler]>\n | undefined {\n if (!reference[handlersMapSymbol]) {\n return undefined\n }\n\n return reference[handlersMapSymbol].entries()\n}\n\n/**\n * Set a cache handler by kind.\n * @param kind - The kind of cache handler to set.\n * @param cacheHandler - The cache handler to set.\n */\nexport function setCacheHandler(\n kind: string,\n cacheHandler: CacheHandler\n): void {\n // This should never be called before initializeCacheHandlers.\n if (!reference[handlersMapSymbol] || !reference[handlersSetSymbol]) {\n throw new Error('Cache handlers not initialized')\n }\n\n debug?.('setting cache handler for \"%s\"', kind)\n reference[handlersMapSymbol].set(kind, cacheHandler)\n reference[handlersSetSymbol].add(cacheHandler)\n}\n","import type { WorkStore } from './app-render/work-async-storage.external'\nimport type { IncrementalCache } from './lib/incremental-cache'\nimport { getCacheHandlers } from './use-cache/handlers'\n\n/** Run a callback, and execute any *new* revalidations added during its runtime. */\nexport async function withExecuteRevalidates<T>(\n store: WorkStore | undefined,\n callback: () => Promise<T>\n): Promise<T> {\n if (!store) {\n return callback()\n }\n // If we executed any revalidates during the request, then we don't want to execute them again.\n // save the state so we can check if anything changed after we're done running callbacks.\n const savedRevalidationState = cloneRevalidationState(store)\n try {\n return await callback()\n } finally {\n // Check if we have any new revalidates, and if so, wait until they are all resolved.\n const newRevalidates = diffRevalidationState(\n savedRevalidationState,\n cloneRevalidationState(store)\n )\n await executeRevalidates(store, newRevalidates)\n }\n}\n\ntype RevalidationState = Required<\n Pick<\n WorkStore,\n 'pendingRevalidatedTags' | 'pendingRevalidates' | 'pendingRevalidateWrites'\n >\n>\n\nfunction cloneRevalidationState(store: WorkStore): RevalidationState {\n return {\n pendingRevalidatedTags: store.pendingRevalidatedTags\n ? [...store.pendingRevalidatedTags]\n : [],\n pendingRevalidates: { ...store.pendingRevalidates },\n pendingRevalidateWrites: store.pendingRevalidateWrites\n ? [...store.pendingRevalidateWrites]\n : [],\n }\n}\n\nfunction diffRevalidationState(\n prev: RevalidationState,\n curr: RevalidationState\n): RevalidationState {\n const prevTagsWithProfile = new Set(\n prev.pendingRevalidatedTags.map((item) => {\n const profileKey =\n typeof item.profile === 'object'\n ? JSON.stringify(item.profile)\n : item.profile || ''\n return `${item.tag}:${profileKey}`\n })\n )\n const prevRevalidateWrites = new Set(prev.pendingRevalidateWrites)\n return {\n pendingRevalidatedTags: curr.pendingRevalidatedTags.filter((item) => {\n const profileKey =\n typeof item.profile === 'object'\n ? JSON.stringify(item.profile)\n : item.profile || ''\n return !prevTagsWithProfile.has(`${item.tag}:${profileKey}`)\n }),\n pendingRevalidates: Object.fromEntries(\n Object.entries(curr.pendingRevalidates).filter(\n ([key]) => !(key in prev.pendingRevalidates)\n )\n ),\n pendingRevalidateWrites: curr.pendingRevalidateWrites.filter(\n (promise) => !prevRevalidateWrites.has(promise)\n ),\n }\n}\n\nasync function revalidateTags(\n tagsWithProfile: Array<{\n tag: string\n profile?: string | { expire?: number }\n }>,\n incrementalCache: IncrementalCache | undefined,\n workStore?: WorkStore\n): Promise<void> {\n if (tagsWithProfile.length === 0) {\n return\n }\n\n const handlers = getCacheHandlers()\n const promises: Promise<void>[] = []\n\n // Group tags by profile for batch processing\n const tagsByProfile = new Map<\n | string\n | { stale?: number; revalidate?: number; expire?: number }\n | undefined,\n string[]\n >()\n\n for (const item of tagsWithProfile) {\n const profile = item.profile\n // Find existing profile by comparing values\n let existingKey = undefined\n for (const [key] of tagsByProfile) {\n if (\n typeof key === 'string' &&\n typeof profile === 'string' &&\n key === profile\n ) {\n existingKey = key\n break\n }\n if (\n typeof key === 'object' &&\n typeof profile === 'object' &&\n JSON.stringify(key) === JSON.stringify(profile)\n ) {\n existingKey = key\n break\n }\n if (key === profile) {\n existingKey = key\n break\n }\n }\n\n const profileKey = existingKey || profile\n if (!tagsByProfile.has(profileKey)) {\n tagsByProfile.set(profileKey, [])\n }\n tagsByProfile.get(profileKey)!.push(item.tag)\n }\n\n // Process each profile group\n for (const [profile, tagsForProfile] of tagsByProfile) {\n // Look up the cache profile from workStore if available\n let durations: { expire?: number } | undefined\n\n if (profile) {\n let cacheLife:\n | { stale?: number; revalidate?: number; expire?: number }\n | undefined\n\n if (typeof profile === 'object') {\n // Profile is already a cacheLife configuration object\n cacheLife = profile\n } else if (typeof profile === 'string') {\n // Profile is a string key, look it up in workStore\n cacheLife = workStore?.cacheLifeProfiles?.[profile]\n\n if (!cacheLife) {\n throw new Error(\n `Invalid profile provided \"${profile}\" must be configured under cacheLife in next.config or be \"max\"`\n )\n }\n }\n\n if (cacheLife) {\n durations = {\n expire: cacheLife.expire,\n }\n }\n }\n // If profile is not found and not 'max', durations will be undefined\n // which will trigger immediate expiration in the cache handler\n\n for (const handler of handlers || []) {\n if (profile) {\n promises.push(handler.updateTags?.(tagsForProfile, durations))\n } else {\n promises.push(handler.updateTags?.(tagsForProfile))\n }\n }\n\n if (incrementalCache) {\n promises.push(incrementalCache.revalidateTag(tagsForProfile, durations))\n }\n }\n\n await Promise.all(promises)\n}\n\nexport async function executeRevalidates(\n workStore: WorkStore,\n state?: RevalidationState\n) {\n const pendingRevalidatedTags =\n state?.pendingRevalidatedTags ?? workStore.pendingRevalidatedTags ?? []\n\n const pendingRevalidates =\n state?.pendingRevalidates ?? workStore.pendingRevalidates ?? {}\n\n const pendingRevalidateWrites =\n state?.pendingRevalidateWrites ?? workStore.pendingRevalidateWrites ?? []\n\n return Promise.all([\n revalidateTags(\n pendingRevalidatedTags,\n workStore.incrementalCache,\n workStore\n ),\n ...Object.values(pendingRevalidates),\n ...pendingRevalidateWrites,\n ])\n}\n","import type { AsyncLocalStorage } from 'async_hooks'\n\nconst sharedAsyncLocalStorageNotAvailableError = new Error(\n 'Invariant: AsyncLocalStorage accessed in runtime where it is not available'\n)\n\nclass FakeAsyncLocalStorage<Store extends {}>\n implements AsyncLocalStorage<Store>\n{\n disable(): void {\n throw sharedAsyncLocalStorageNotAvailableError\n }\n\n getStore(): Store | undefined {\n // This fake implementation of AsyncLocalStorage always returns `undefined`.\n return undefined\n }\n\n run<R>(): R {\n throw sharedAsyncLocalStorageNotAvailableError\n }\n\n exit<R>(): R {\n throw sharedAsyncLocalStorageNotAvailableError\n }\n\n enterWith(): void {\n throw sharedAsyncLocalStorageNotAvailableError\n }\n\n static bind<T>(fn: T): T {\n return fn\n }\n}\n\nconst maybeGlobalAsyncLocalStorage =\n typeof globalThis !== 'undefined' && (globalThis as any).AsyncLocalStorage\n\nexport function createAsyncLocalStorage<\n Store extends {},\n>(): AsyncLocalStorage<Store> {\n if (maybeGlobalAsyncLocalStorage) {\n return new maybeGlobalAsyncLocalStorage()\n }\n return new FakeAsyncLocalStorage()\n}\n\nexport function bindSnapshot<T>(\n // WARNING: Don't pass a named function to this argument! See: https://github.com/facebook/react/pull/34911\n fn: T\n): T {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.bind(fn)\n }\n return FakeAsyncLocalStorage.bind(fn)\n}\n\nexport function createSnapshot(): <R, TArgs extends any[]>(\n fn: (...args: TArgs) => R,\n ...args: TArgs\n) => R {\n if (maybeGlobalAsyncLocalStorage) {\n return maybeGlobalAsyncLocalStorage.snapshot()\n }\n return function (fn: any, ...args: any[]) {\n return fn(...args)\n }\n}\n","import PromiseQueue from 'next/dist/compiled/p-queue'\nimport type { RequestLifecycleOpts } from '../base-server'\nimport type { AfterCallback, AfterTask } from './after'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { withExecuteRevalidates } from '../revalidation-utils'\nimport { bindSnapshot } from '../app-render/async-local-storage'\nimport {\n workUnitAsyncStorage,\n type WorkUnitStore,\n} from '../app-render/work-unit-async-storage.external'\nimport { afterTaskAsyncStorage } from '../app-render/after-task-async-storage.external'\n\nexport type AfterContextOpts = {\n waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n onClose: RequestLifecycleOpts['onClose']\n onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n}\n\nexport class AfterContext {\n private waitUntil: RequestLifecycleOpts['waitUntil'] | undefined\n private onClose: RequestLifecycleOpts['onClose']\n private onTaskError: RequestLifecycleOpts['onAfterTaskError'] | undefined\n\n private runCallbacksOnClosePromise: Promise<void> | undefined\n private callbackQueue: PromiseQueue\n private workUnitStores = new Set<WorkUnitStore>()\n\n constructor({ waitUntil, onClose, onTaskError }: AfterContextOpts) {\n this.waitUntil = waitUntil\n this.onClose = onClose\n this.onTaskError = onTaskError\n\n this.callbackQueue = new PromiseQueue()\n this.callbackQueue.pause()\n }\n\n public after(task: AfterTask): void {\n if (isThenable(task)) {\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n this.waitUntil(\n task.catch((error) => this.reportTaskError('promise', error))\n )\n } else if (typeof task === 'function') {\n // TODO(after): implement tracing\n this.addCallback(task)\n } else {\n throw new Error('`after()`: Argument must be a promise or a function')\n }\n }\n\n private addCallback(callback: AfterCallback) {\n // if something is wrong, throw synchronously, bubbling up to the `after` callsite.\n if (!this.waitUntil) {\n errorWaitUntilNotAvailable()\n }\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n this.workUnitStores.add(workUnitStore)\n }\n\n const afterTaskStore = afterTaskAsyncStorage.getStore()\n\n // This is used for checking if request APIs can be called inside `after`.\n // Note that we need to check the phase in which the *topmost* `after` was called (which should be \"action\"),\n // not the current phase (which might be \"after\" if we're in a nested after).\n // Otherwise, we might allow `after(() => headers())`, but not `after(() => after(() => headers()))`.\n const rootTaskSpawnPhase = afterTaskStore\n ? afterTaskStore.rootTaskSpawnPhase // nested after\n : workUnitStore?.phase // topmost after\n\n // this should only happen once.\n if (!this.runCallbacksOnClosePromise) {\n this.runCallbacksOnClosePromise = this.runCallbacksOnClose()\n this.waitUntil(this.runCallbacksOnClosePromise)\n }\n\n // Bind the callback to the current execution context (i.e. preserve all currently available ALS-es).\n // We do this because we want all of these to be equivalent in every regard except timing:\n // after(() => x())\n // after(x())\n // await x()\n const wrappedCallback = bindSnapshot(\n // WARNING: Don't make this a named function. It must be anonymous.\n // See: https://github.com/facebook/react/pull/34911\n async () => {\n try {\n await afterTaskAsyncStorage.run({ rootTaskSpawnPhase }, () =>\n callback()\n )\n } catch (error) {\n this.reportTaskError('function', error)\n }\n }\n )\n\n this.callbackQueue.add(wrappedCallback)\n }\n\n private async runCallbacksOnClose() {\n await new Promise<void>((resolve) => this.onClose!(resolve))\n return this.runCallbacks()\n }\n\n private async runCallbacks(): Promise<void> {\n if (this.callbackQueue.size === 0) return\n\n for (const workUnitStore of this.workUnitStores) {\n workUnitStore.phase = 'after'\n }\n\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new InvariantError('Missing workStore in AfterContext.runCallbacks')\n }\n\n return withExecuteRevalidates(workStore, () => {\n this.callbackQueue.start()\n return this.callbackQueue.onIdle()\n })\n }\n\n private reportTaskError(taskKind: 'promise' | 'function', error: unknown) {\n // TODO(after): this is fine for now, but will need better intergration with our error reporting.\n // TODO(after): should we log this if we have a onTaskError callback?\n console.error(\n taskKind === 'promise'\n ? `A promise passed to \\`after()\\` rejected:`\n : `An error occurred in a function passed to \\`after()\\`:`,\n error\n )\n if (this.onTaskError) {\n // this is very defensive, but we really don't want anything to blow up in an error handler\n try {\n this.onTaskError?.(error)\n } catch (handlerError) {\n console.error(\n new InvariantError(\n '`onTaskError` threw while handling an error thrown from an `after` task',\n {\n cause: handlerError,\n }\n )\n )\n }\n }\n }\n}\n\nfunction errorWaitUntilNotAvailable(): never {\n throw new Error(\n '`after()` will not work correctly, because `waitUntil` is not available in the current environment.'\n )\n}\n","/**\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 */\nexport function ensureLeadingSlash(path: string) {\n return path.startsWith('/') ? path : `/${path}`\n}\n","import { ensureLeadingSlash } from '../../page-path/ensure-leading-slash'\nimport { isGroupSegment } from '../../segment'\n\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 */\nexport function normalizeAppPath(route: string) {\n return ensureLeadingSlash(\n route.split('/').reduce((pathname, segment, index, segments) => {\n // Empty segments are ignored.\n if (!segment) {\n return pathname\n }\n\n // Groups are ignored.\n if (isGroupSegment(segment)) {\n return pathname\n }\n\n // Parallel segments are ignored.\n if (segment[0] === '@') {\n return pathname\n }\n\n // The last segment (if it's a leaf) should be ignored.\n if (\n (segment === 'page' || segment === 'route') &&\n index === segments.length - 1\n ) {\n return pathname\n }\n\n return `${pathname}/${segment}`\n }, '')\n )\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 */\nexport function normalizeRscURL(url: string) {\n return url.replace(\n /\\.rsc($|\\?)/,\n // $1 ensures `?` is preserved\n '$1'\n )\n}\n","export type LazyResult<TValue> = PromiseLike<TValue> & { value?: TValue }\nexport type ResolvedLazyResult<TValue> = PromiseLike<TValue> & { value: TValue }\n\n/**\n * Calls the given async function only when the returned promise-like object is\n * awaited. Afterwards, it provides the resolved value synchronously as `value`\n * property.\n */\nexport function createLazyResult<TValue>(\n fn: () => Promise<TValue>\n): LazyResult<TValue> {\n let pendingResult: Promise<TValue> | undefined\n\n const result: LazyResult<TValue> = {\n then(onfulfilled, onrejected) {\n if (!pendingResult) {\n pendingResult = fn()\n }\n\n pendingResult\n .then((value) => {\n result.value = value\n })\n .catch(() => {\n // The externally awaited result will be rejected via `onrejected`. We\n // don't need to handle it here. But we do want to avoid an unhandled\n // rejection.\n })\n\n return pendingResult.then(onfulfilled, onrejected)\n },\n }\n\n return result\n}\n\nexport function isResolvedLazyResult<TValue>(\n result: LazyResult<TValue>\n): result is ResolvedLazyResult<TValue> {\n return result.hasOwnProperty('value')\n}\n","import { RedirectStatusCode } from './redirect-status-code'\nimport {\n RedirectType,\n type RedirectError,\n isRedirectError,\n REDIRECT_ERROR_CODE,\n} from './redirect-error'\n\nconst actionAsyncStorage =\n typeof window === 'undefined'\n ? (\n require('../../server/app-render/action-async-storage.external') as typeof import('../../server/app-render/action-async-storage.external')\n ).actionAsyncStorage\n : undefined\n\nexport function getRedirectError(\n url: string,\n type: RedirectType,\n statusCode: RedirectStatusCode = RedirectStatusCode.TemporaryRedirect\n): RedirectError {\n const error = new Error(REDIRECT_ERROR_CODE) as RedirectError\n error.digest = `${REDIRECT_ERROR_CODE};${type};${url};${statusCode};`\n return error\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler or Server Action, it will serve a 307/303 to the caller.\n * - In a Server Action, type defaults to 'push' and 'replace' elsewhere.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function redirect(\n /** The URL to redirect to */\n url: string,\n type?: RedirectType\n): never {\n type ??= actionAsyncStorage?.getStore()?.isAction\n ? RedirectType.push\n : RedirectType.replace\n\n throw getRedirectError(url, type, RedirectStatusCode.TemporaryRedirect)\n}\n\n/**\n * This function allows you to redirect the user to another URL. It can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a meta tag to redirect the user to the target page.\n * - In a Route Handler or Server Action, it will serve a 308/303 to the caller.\n *\n * Read more: [Next.js Docs: `redirect`](https://nextjs.org/docs/app/api-reference/functions/redirect)\n */\nexport function permanentRedirect(\n /** The URL to redirect to */\n url: string,\n type: RedirectType = RedirectType.replace\n): never {\n throw getRedirectError(url, type, RedirectStatusCode.PermanentRedirect)\n}\n\n/**\n * Returns the encoded URL from the error if it's a RedirectError, null\n * otherwise. Note that this does not validate the URL returned.\n *\n * @param error the error that may be a redirect error\n * @return the url if the error was a redirect error\n */\nexport function getURLFromRedirectError(error: RedirectError): string\nexport function getURLFromRedirectError(error: unknown): string | null {\n if (!isRedirectError(error)) return null\n\n // Slices off the beginning of the digest that contains the code and the\n // separating ';'.\n return error.digest.split(';').slice(2, -2).join(';')\n}\n\nexport function getRedirectTypeFromError(error: RedirectError): RedirectType {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return error.digest.split(';', 2)[1] as RedirectType\n}\n\nexport function getRedirectStatusCodeFromError(error: RedirectError): number {\n if (!isRedirectError(error)) {\n throw new Error('Not a redirect error')\n }\n\n return Number(error.digest.split(';').at(-2))\n}\n","import { NEXT_CACHE_IMPLICIT_TAG_ID } from '../../lib/constants'\nimport type { OpaqueFallbackRouteParams } from '../request/fallback-params'\nimport { getCacheHandlerEntries } from '../use-cache/handlers'\nimport { createLazyResult, type LazyResult } from './lazy-result'\n\nexport interface ImplicitTags {\n /**\n * For legacy usage, the implicit tags are passed to the incremental cache\n * handler in `get` calls.\n */\n readonly tags: string[]\n\n /**\n * Modern cache handlers don't receive implicit tags. Instead, the implicit\n * tags' expirations are stored in the work unit store, and used to compare\n * with a cache entry's timestamp.\n *\n * Note: This map contains lazy results so that we can evaluate them when the\n * first cache entry is read. It allows us to skip fetching the expiration\n * values if no caches are read at all.\n */\n readonly expirationsByCacheKind: Map<string, LazyResult<number>>\n}\n\nconst getDerivedTags = (pathname: string): string[] => {\n const derivedTags: string[] = [`/layout`]\n\n // we automatically add the current path segments as tags\n // for revalidatePath handling\n if (pathname.startsWith('/')) {\n const pathnameParts = pathname.split('/')\n\n for (let i = 1; i < pathnameParts.length + 1; i++) {\n let curPathname = pathnameParts.slice(0, i).join('/')\n\n if (curPathname) {\n // all derived tags other than the page are layout tags\n if (!curPathname.endsWith('/page') && !curPathname.endsWith('/route')) {\n curPathname = `${curPathname}${\n !curPathname.endsWith('/') ? '/' : ''\n }layout`\n }\n derivedTags.push(curPathname)\n }\n }\n }\n return derivedTags\n}\n\n/**\n * Creates a map with lazy results that fetch the expiration value for the given\n * tags and respective cache kind when they're awaited for the first time.\n */\nfunction createTagsExpirationsByCacheKind(\n tags: string[]\n): Map<string, LazyResult<number>> {\n const expirationsByCacheKind = new Map<string, LazyResult<number>>()\n const cacheHandlers = getCacheHandlerEntries()\n\n if (cacheHandlers) {\n for (const [kind, cacheHandler] of cacheHandlers) {\n if ('getExpiration' in cacheHandler) {\n expirationsByCacheKind.set(\n kind,\n createLazyResult(async () => cacheHandler.getExpiration(tags))\n )\n }\n }\n }\n\n return expirationsByCacheKind\n}\n\nexport async function getImplicitTags(\n page: string,\n url: {\n pathname: string\n search?: string\n },\n fallbackRouteParams: null | OpaqueFallbackRouteParams\n): Promise<ImplicitTags> {\n const tags = new Set<string>()\n\n // Add the derived tags from the page.\n const derivedTags = getDerivedTags(page)\n for (let tag of derivedTags) {\n tag = `${NEXT_CACHE_IMPLICIT_TAG_ID}${tag}`\n tags.add(tag)\n }\n\n // Add the tags from the pathname. If the route has unknown params, we don't\n // want to add the pathname as a tag, as it will be invalid.\n if (\n url.pathname &&\n (!fallbackRouteParams || fallbackRouteParams.size === 0)\n ) {\n const tag = `${NEXT_CACHE_IMPLICIT_TAG_ID}${url.pathname}`\n tags.add(tag)\n }\n\n if (tags.has(`${NEXT_CACHE_IMPLICIT_TAG_ID}/`)) {\n tags.add(`${NEXT_CACHE_IMPLICIT_TAG_ID}/index`)\n }\n\n if (tags.has(`${NEXT_CACHE_IMPLICIT_TAG_ID}/index`)) {\n tags.add(`${NEXT_CACHE_IMPLICIT_TAG_ID}/`)\n }\n\n const tagsArray = Array.from(tags)\n return {\n tags: tagsArray,\n expirationsByCacheKind: createTagsExpirationsByCacheKind(tagsArray),\n }\n}\n","import { RSC_CONTENT_TYPE_HEADER } from '../../client/components/app-router-headers'\nimport RenderResult, { type RenderResultMetadata } from '../render-result'\n\n/**\n * Flight Response is always set to RSC_CONTENT_TYPE_HEADER to ensure it does not get interpreted as HTML.\n */\nexport class FlightRenderResult extends RenderResult {\n constructor(\n response: string | ReadableStream<Uint8Array>,\n metadata: RenderResultMetadata = {}\n ) {\n super(response, { contentType: RSC_CONTENT_TYPE_HEADER, metadata })\n }\n}\n","const invalidServerComponentReactHooks = [\n 'useDeferredValue',\n 'useEffect',\n 'useImperativeHandle',\n 'useInsertionEffect',\n 'useLayoutEffect',\n 'useReducer',\n 'useRef',\n 'useState',\n 'useSyncExternalStore',\n 'useTransition',\n 'experimental_useOptimistic',\n 'useOptimistic',\n]\n\nfunction setMessage(error: Error, message: string): void {\n error.message = message\n if (error.stack) {\n const lines = error.stack.split('\\n')\n lines[0] = message\n error.stack = lines.join('\\n')\n }\n}\n\n/**\n * Input:\n * Error: Something went wrong\n at funcName (/path/to/file.js:10:5)\n at anotherFunc (/path/to/file.js:15:10)\n \n * Output:\n at funcName (/path/to/file.js:10:5)\n at anotherFunc (/path/to/file.js:15:10) \n */\nexport function getStackWithoutErrorMessage(error: Error): string {\n const stack = error.stack\n if (!stack) return ''\n return stack.replace(/^[^\\n]*\\n/, '')\n}\n\nexport function formatServerError(error: Error): void {\n if (typeof error?.message !== 'string') return\n\n if (\n error.message.includes(\n 'Class extends value undefined is not a constructor or null'\n )\n ) {\n const addedMessage =\n 'This might be caused by a React Class Component being rendered in a Server Component, React Class Components only works in Client Components. Read more: https://nextjs.org/docs/messages/class-component-in-server-component'\n\n // If this error instance already has the message, don't add it again\n if (error.message.includes(addedMessage)) return\n\n setMessage(\n error,\n `${error.message}\n\n${addedMessage}`\n )\n return\n }\n\n if (error.message.includes('createContext is not a function')) {\n setMessage(\n error,\n 'createContext only works in Client Components. Add the \"use client\" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component'\n )\n return\n }\n\n for (const clientHook of invalidServerComponentReactHooks) {\n const regex = new RegExp(`\\\\b${clientHook}\\\\b.*is not a function`)\n if (regex.test(error.message)) {\n setMessage(\n error,\n `${clientHook} only works in Client Components. Add the \"use client\" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component`\n )\n return\n }\n }\n}\n","import { isPlainObject } from '../shared/lib/is-plain-object'\nimport safeStringify from 'next/dist/compiled/safe-stable-stringify'\n\n// We allow some additional attached properties for Next.js errors\nexport interface NextError extends Error {\n type?: string\n page?: string\n code?: string | number\n cancelled?: boolean\n digest?: number\n}\n\n/**\n * Checks whether the given value is a NextError.\n * This can be used to print a more detailed error message with properties like `code` & `digest`.\n */\nexport default function isError(err: unknown): err is NextError {\n return (\n typeof err === 'object' && err !== null && 'name' in err && 'message' in err\n )\n}\n\nexport function getProperError(err: unknown): Error {\n if (isError(err)) {\n return err\n }\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(\n 'An undefined error was thrown, ' +\n 'see here for more info: https://nextjs.org/docs/messages/threw-undefined'\n )\n }\n\n if (err === null) {\n return new Error(\n 'A null error was thrown, ' +\n 'see here for more info: https://nextjs.org/docs/messages/threw-undefined'\n )\n }\n }\n\n return new Error(isPlainObject(err) ? safeStringify(err) : err + '')\n}\n","export function getObjectClassLabel(value: any): string {\n return Object.prototype.toString.call(value)\n}\n\nexport function isPlainObject(value: any): boolean {\n if (getObjectClassLabel(value) !== '[object Object]') {\n return false\n }\n\n const prototype = Object.getPrototypeOf(value)\n\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 */\n return prototype === null || prototype.hasOwnProperty('isPrototypeOf')\n}\n","const ERROR_CODE_DELIMITER = '@'\n\n/**\n * Augments the digest field of errors thrown in React Server Components (RSC) with an error code.\n * Since RSC errors can only be serialized through the digest field, this provides a way to include\n * an additional error code that can be extracted client-side via `extractNextErrorCode`.\n *\n * The error code is appended to the digest string with a semicolon separator, allowing it to be\n * parsed out later while preserving the original digest value.\n */\nexport const createDigestWithErrorCode = (\n thrownValue: unknown,\n originalDigest: string\n): string => {\n if (\n typeof thrownValue === 'object' &&\n thrownValue !== null &&\n '__NEXT_ERROR_CODE' in thrownValue\n ) {\n return `${originalDigest}${ERROR_CODE_DELIMITER}${thrownValue.__NEXT_ERROR_CODE}`\n }\n return originalDigest\n}\n\nexport const extractNextErrorCode = (error: unknown): string | undefined => {\n if (\n typeof error === 'object' &&\n error !== null &&\n '__NEXT_ERROR_CODE' in error &&\n typeof error.__NEXT_ERROR_CODE === 'string'\n ) {\n return error.__NEXT_ERROR_CODE\n }\n\n if (\n typeof error === 'object' &&\n error !== null &&\n 'digest' in error &&\n typeof error.digest === 'string'\n ) {\n const segments = error.digest.split(ERROR_CODE_DELIMITER)\n const errorCode = segments.find((segment) => segment.startsWith('E'))\n return errorCode\n }\n\n return undefined\n}\n","// TODO: isWellKnownError -> isNextInternalError\n// isReactLargeShellError -> isWarning\nexport function isReactLargeShellError(\n error: unknown\n): error is Error & { digest?: string } {\n return (\n typeof error === 'object' &&\n error !== null &&\n 'message' in error &&\n typeof error.message === 'string' &&\n error.message.startsWith('This rendered a large document (>')\n )\n}\n","import type { ErrorInfo } from 'react'\n\nimport stringHash from 'next/dist/compiled/string-hash'\nimport { formatServerError } from '../../lib/format-server-error'\nimport { SpanStatusCode, getTracer } from '../lib/trace/tracer'\nimport { isAbortError } from '../pipe-readable'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { isDynamicServerError } from '../../client/components/hooks-server-context'\nimport { isNextRouterError } from '../../client/components/is-next-router-error'\nimport { isPrerenderInterruptedError } from './dynamic-rendering'\nimport { getProperError } from '../../lib/is-error'\nimport { createDigestWithErrorCode } from '../../lib/error-telemetry-utils'\nimport { isReactLargeShellError } from './react-large-shell-error'\n\ndeclare global {\n var __next_log_error__: undefined | ((err: unknown) => void)\n}\n\ntype RSCErrorHandler = (err: unknown) => string | undefined\ntype SSRErrorHandler = (\n err: unknown,\n errorInfo?: ErrorInfo\n) => string | undefined\n\nexport type DigestedError = Error & { digest: string }\n\n/**\n * Returns a digest for well-known Next.js errors, otherwise `undefined`. If a\n * digest is returned this also means that the error does not need to be\n * reported.\n */\nexport function getDigestForWellKnownError(error: unknown): string | undefined {\n // If we're bailing out to CSR, we don't need to log the error.\n if (isBailoutToCSRError(error)) return error.digest\n\n // If this is a navigation error, we don't need to log the error.\n if (isNextRouterError(error)) return error.digest\n\n // If this error occurs, we know that we should be stopping the static\n // render. This is only thrown in static generation when PPR is not enabled,\n // which causes the whole page to be marked as dynamic. We don't need to\n // tell the user about this error, as it's not actionable.\n if (isDynamicServerError(error)) return error.digest\n\n // If this is a prerender interrupted error, we don't need to log the error.\n if (isPrerenderInterruptedError(error)) return error.digest\n\n return undefined\n}\n\nexport function createFlightReactServerErrorHandler(\n shouldFormatError: boolean,\n onReactServerRenderError: (err: DigestedError) => void\n): RSCErrorHandler {\n return (thrownValue: unknown) => {\n if (typeof thrownValue === 'string') {\n // TODO-APP: look at using webcrypto instead. Requires a promise to be awaited.\n return stringHash(thrownValue).toString()\n }\n\n // If the response was closed, we don't need to log the error.\n if (isAbortError(thrownValue)) return\n\n const digest = getDigestForWellKnownError(thrownValue)\n\n if (digest) {\n return digest\n }\n\n if (isReactLargeShellError(thrownValue)) {\n // TODO: Aggregate\n console.error(thrownValue)\n return undefined\n }\n\n const err = getProperError(thrownValue) as DigestedError\n\n // If the error already has a digest, respect the original digest,\n // so it won't get re-generated into another new error.\n if (!err.digest) {\n // TODO-APP: look at using webcrypto instead. Requires a promise to be awaited.\n err.digest = stringHash(err.message + err.stack || '').toString()\n }\n\n // Format server errors in development to add more helpful error messages\n if (shouldFormatError) {\n formatServerError(err)\n }\n\n // Record exception in an active span, if available.\n const span = getTracer().getActiveScopeSpan()\n if (span) {\n span.recordException(err)\n span.setAttribute('error.type', err.name)\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n })\n }\n\n onReactServerRenderError(err)\n\n return createDigestWithErrorCode(thrownValue, err.digest)\n }\n}\n\nexport function createHTMLReactServerErrorHandler(\n shouldFormatError: boolean,\n isNextExport: boolean,\n reactServerErrors: Map<string, DigestedError>,\n silenceLogger: boolean,\n onReactServerRenderError: undefined | ((err: DigestedError) => void)\n): RSCErrorHandler {\n return (thrownValue: unknown) => {\n if (typeof thrownValue === 'string') {\n // TODO-APP: look at using webcrypto instead. Requires a promise to be awaited.\n return stringHash(thrownValue).toString()\n }\n\n // If the response was closed, we don't need to log the error.\n if (isAbortError(thrownValue)) return\n\n const digest = getDigestForWellKnownError(thrownValue)\n\n if (digest) {\n return digest\n }\n\n if (isReactLargeShellError(thrownValue)) {\n // TODO: Aggregate\n console.error(thrownValue)\n return undefined\n }\n\n const err = getProperError(thrownValue) as DigestedError\n\n // If the error already has a digest, respect the original digest,\n // so it won't get re-generated into another new error.\n if (!err.digest) {\n // TODO-APP: look at using webcrypto instead. Requires a promise to be awaited.\n err.digest = stringHash(err.message + (err.stack || '')).toString()\n }\n\n // @TODO by putting this here and not at the top it is possible that\n // we don't error the build in places we actually expect to\n if (!reactServerErrors.has(err.digest)) {\n reactServerErrors.set(err.digest, err)\n }\n\n // Format server errors in development to add more helpful error messages\n if (shouldFormatError) {\n formatServerError(err)\n }\n\n // Don't log the suppressed error during export\n if (\n !(\n isNextExport &&\n err?.message?.includes(\n 'The specific message is omitted in production builds to avoid leaking sensitive details.'\n )\n )\n ) {\n // Record exception in an active span, if available.\n const span = getTracer().getActiveScopeSpan()\n if (span) {\n span.recordException(err)\n span.setAttribute('error.type', err.name)\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n })\n }\n\n if (!silenceLogger) {\n onReactServerRenderError?.(err)\n }\n }\n\n return createDigestWithErrorCode(thrownValue, err.digest)\n }\n}\n\nexport function createHTMLErrorHandler(\n shouldFormatError: boolean,\n isNextExport: boolean,\n reactServerErrors: Map<string, DigestedError>,\n allCapturedErrors: Array<unknown>,\n silenceLogger: boolean,\n onHTMLRenderSSRError: (err: DigestedError, errorInfo?: ErrorInfo) => void\n): SSRErrorHandler {\n return (thrownValue: unknown, errorInfo?: ErrorInfo) => {\n if (isReactLargeShellError(thrownValue)) {\n // TODO: Aggregate\n console.error(thrownValue)\n return undefined\n }\n\n let isSSRError = true\n\n allCapturedErrors.push(thrownValue)\n\n // If the response was closed, we don't need to log the error.\n if (isAbortError(thrownValue)) return\n\n const digest = getDigestForWellKnownError(thrownValue)\n\n if (digest) {\n return digest\n }\n\n const err = getProperError(thrownValue) as DigestedError\n // If the error already has a digest, respect the original digest,\n // so it won't get re-generated into another new error.\n if (err.digest) {\n if (reactServerErrors.has(err.digest)) {\n // This error is likely an obfuscated error from react-server.\n // We recover the original error here.\n thrownValue = reactServerErrors.get(err.digest)\n isSSRError = false\n } else {\n // The error is not from react-server but has a digest\n // from other means so we don't need to produce a new one\n }\n } else {\n err.digest = stringHash(\n err.message + (errorInfo?.componentStack || err.stack || '')\n ).toString()\n }\n\n // Format server errors in development to add more helpful error messages\n if (shouldFormatError) {\n formatServerError(err)\n }\n\n // Don't log the suppressed error during export\n if (\n !(\n isNextExport &&\n err?.message?.includes(\n 'The specific message is omitted in production builds to avoid leaking sensitive details.'\n )\n )\n ) {\n // Record exception in an active span, if available.\n const span = getTracer().getActiveScopeSpan()\n if (span) {\n span.recordException(err)\n span.setAttribute('error.type', err.name)\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n })\n }\n\n if (\n !silenceLogger &&\n // HTML errors contain RSC errors as well, filter them out before reporting\n isSSRError\n ) {\n onHTMLRenderSSRError(err, errorInfo)\n }\n }\n\n return createDigestWithErrorCode(thrownValue, err.digest)\n }\n}\n\nexport function isUserLandError(err: any): boolean {\n return (\n !isAbortError(err) && !isBailoutToCSRError(err) && !isNextRouterError(err)\n )\n}\n","import type {\n DynamicParamTypes,\n DynamicParamTypesShort,\n} from '../../shared/lib/app-router-types'\n\nexport const dynamicParamTypes: Record<\n DynamicParamTypes,\n DynamicParamTypesShort\n> = {\n catchall: 'c',\n 'catchall-intercepted': 'ci',\n 'optional-catchall': 'oc',\n dynamic: 'd',\n 'dynamic-intercepted': 'di',\n}\n","import { normalizeAppPath } from './app-paths'\n\n// order matters here, the first match will be used\nexport const INTERCEPTION_ROUTE_MARKERS = [\n '(..)(..)',\n '(.)',\n '(..)',\n '(...)',\n] as const\n\nexport function isInterceptionRouteAppPath(path: string): boolean {\n // TODO-APP: add more serious validation\n return (\n path\n .split('/')\n .find((segment) =>\n INTERCEPTION_ROUTE_MARKERS.find((m) => segment.startsWith(m))\n ) !== undefined\n )\n}\n\ntype InterceptionRouteInformation = {\n /**\n * The intercepting route. This is the route that is being intercepted or the\n * route that the user was coming from. This is matched by the Next-Url\n * header.\n */\n interceptingRoute: string\n\n /**\n * The intercepted route. This is the route that is being intercepted or the\n * route that the user is going to. This is matched by the request pathname.\n */\n interceptedRoute: string\n}\n\nexport function extractInterceptionRouteInformation(\n path: string\n): InterceptionRouteInformation {\n let interceptingRoute: string | undefined\n let marker: (typeof INTERCEPTION_ROUTE_MARKERS)[number] | undefined\n let interceptedRoute: string | undefined\n\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\n if (!interceptingRoute || !marker || !interceptedRoute) {\n throw new Error(\n `Invalid interception route: ${path}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`\n )\n }\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(\n `Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`\n )\n }\n interceptedRoute = interceptingRoute\n .split('/')\n .slice(0, -1)\n .concat(interceptedRoute)\n .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\n const splitInterceptingRoute = interceptingRoute.split('/')\n if (splitInterceptingRoute.length <= 2) {\n throw new Error(\n `Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`\n )\n }\n\n interceptedRoute = splitInterceptingRoute\n .slice(0, -2)\n .concat(interceptedRoute)\n .join('/')\n break\n default:\n throw new Error('Invariant: unexpected marker')\n }\n\n return { interceptingRoute, interceptedRoute }\n}\n","import { INTERCEPTION_ROUTE_MARKERS } from './interception-routes'\nimport type { DynamicParamTypes } from '../../app-router-types'\n\n/**\n * Parse dynamic route segment to type of parameter\n */\nexport function getSegmentParam(segment: string): {\n param: string\n type: DynamicParamTypes\n} | null {\n const interceptionMarker = INTERCEPTION_ROUTE_MARKERS.find((marker) =>\n segment.startsWith(marker)\n )\n\n // if an interception marker is part of the path segment, we need to jump ahead\n // to the relevant portion for param parsing\n if (interceptionMarker) {\n segment = segment.slice(interceptionMarker.length)\n }\n\n if (segment.startsWith('[[...') && segment.endsWith(']]')) {\n return {\n // TODO-APP: Optional catchall does not currently work with parallel routes,\n // so for now aren't handling a potential interception marker.\n type: 'optional-catchall',\n param: segment.slice(5, -2),\n }\n }\n\n if (segment.startsWith('[...') && segment.endsWith(']')) {\n return {\n type: interceptionMarker ? 'catchall-intercepted' : 'catchall',\n param: segment.slice(4, -1),\n }\n }\n\n if (segment.startsWith('[') && segment.endsWith(']')) {\n return {\n type: interceptionMarker ? 'dynamic-intercepted' : 'dynamic',\n param: segment.slice(1, -1),\n }\n }\n\n return null\n}\n\nexport function isCatchAll(\n type: DynamicParamTypes\n): type is 'catchall' | 'catchall-intercepted' | 'optional-catchall' {\n return (\n type === 'catchall' ||\n type === 'catchall-intercepted' ||\n type === 'optional-catchall'\n )\n}\n\nexport function getParamProperties(paramType: DynamicParamTypes): {\n repeat: boolean\n optional: boolean\n} {\n let repeat = false\n let optional = false\n\n switch (paramType) {\n case 'catchall':\n case 'catchall-intercepted':\n repeat = true\n break\n case 'optional-catchall':\n repeat = true\n optional = true\n break\n case 'dynamic':\n case 'dynamic-intercepted':\n break\n default:\n paramType satisfies never\n }\n\n return { repeat, optional }\n}\n","// This utility is based on https://github.com/zertosh/htmlescape\n// License: https://github.com/zertosh/htmlescape/blob/0527ca7156a524d256101bb310a9f970f63078ad/LICENSE\n\nconst ESCAPE_LOOKUP: { [match: string]: string } = {\n '&': '\\\\u0026',\n '>': '\\\\u003e',\n '<': '\\\\u003c',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029',\n}\n\nexport const ESCAPE_REGEX = /[&><\\u2028\\u2029]/g\n\nexport function htmlEscapeJsonString(str: string): string {\n return str.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match])\n}\n","import type { LoadComponentsReturnType } from '../load-components'\nimport type { ServerRuntime, SizeLimit } from '../../types'\nimport type {\n ExperimentalConfig,\n NextConfigComplete,\n} from '../../server/config-shared'\nimport type { ClientReferenceManifest } from '../../build/webpack/plugins/flight-manifest-plugin'\nimport type { NextFontManifest } from '../../build/webpack/plugins/next-font-manifest-plugin'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { AppPageModule } from '../route-modules/app-page/module'\nimport type { DeepReadonly } from '../../shared/lib/deep-readonly'\nimport type { ImageConfigComplete } from '../../shared/lib/image-config'\nimport type { __ApiPreviewProps } from '../api-utils'\n\nimport s from 'next/dist/compiled/superstruct'\nimport type { RequestLifecycleOpts } from '../base-server'\nimport type { InstrumentationOnRequestError } from '../instrumentation/types'\nimport type { NextRequestHint } from '../web/adapter'\nimport type { BaseNextRequest } from '../base-http'\nimport type { IncomingMessage } from 'http'\nimport type { RenderResumeDataCache } from '../resume-data-cache/resume-data-cache'\nimport type { ServerCacheStatus } from '../../next-devtools/dev-overlay/cache-indicator'\n\nconst dynamicParamTypesSchema = s.enums(['c', 'ci', 'oc', 'd', 'di'])\n\nconst segmentSchema = s.union([\n s.string(),\n\n s.tuple([\n // Param name\n s.string(),\n // Param cache key (almost the same as the value, but arrays are\n // concatenated into strings)\n // TODO: We should change this to just be the value. Currently we convert\n // it back to a value when passing to useParams. It only needs to be\n // a string when converted to a a cache key, but that doesn't mean we\n // need to store it as that representation.\n s.string(),\n // Dynamic param type\n dynamicParamTypesSchema,\n ]),\n])\n\n// unfortunately the tuple is not understood well by Describe so we have to\n// use any here. This does not have any impact on the runtime type since the validation\n// does work correctly.\nexport const flightRouterStateSchema: s.Describe<any> = s.tuple([\n segmentSchema,\n s.record(\n s.string(),\n s.lazy(() => flightRouterStateSchema)\n ),\n s.optional(s.nullable(s.string())),\n s.optional(\n s.nullable(\n s.union([\n s.literal('refetch'),\n s.literal('refresh'),\n s.literal('inside-shared-layout'),\n s.literal('metadata-only'),\n ])\n )\n ),\n s.optional(s.boolean()),\n])\n\nexport type ServerOnInstrumentationRequestError = (\n error: unknown,\n // The request could be middleware, node server or web server request,\n // we normalized them into an aligned format to `onRequestError` API later.\n request: NextRequestHint | BaseNextRequest | IncomingMessage,\n errorContext: Parameters<InstrumentationOnRequestError>[2]\n) => void | Promise<void>\n\nexport interface RenderOptsPartial {\n dir?: string\n previewProps: __ApiPreviewProps | undefined\n err?: Error | null\n dev?: boolean\n basePath: string\n cacheComponents: boolean\n trailingSlash: boolean\n images: ImageConfigComplete\n clientReferenceManifest?: DeepReadonly<ClientReferenceManifest>\n supportsDynamicResponse: boolean\n runtime?: ServerRuntime\n serverComponents?: boolean\n enableTainting?: boolean\n assetPrefix?: string\n crossOrigin?: '' | 'anonymous' | 'use-credentials' | undefined\n nextFontManifest?: DeepReadonly<NextFontManifest>\n botType?: 'dom' | 'html' | undefined\n serveStreamingMetadata?: boolean\n incrementalCache?: import('../lib/incremental-cache').IncrementalCache\n cacheLifeProfiles?: {\n [profile: string]: import('../use-cache/cache-life').CacheLife\n }\n isOnDemandRevalidate?: boolean\n isPossibleServerAction?: boolean\n setCacheStatus?: (\n status: ServerCacheStatus,\n htmlRequestId: string,\n requestId: string\n ) => void\n setIsrStatus?: (key: string, value: boolean | undefined) => void\n setReactDebugChannel?: (\n debugChannel: { readable: ReadableStream<Uint8Array> },\n htmlRequestId: string,\n requestId: string\n ) => void\n nextExport?: boolean\n nextConfigOutput?: 'standalone' | 'export'\n onInstrumentationRequestError?: ServerOnInstrumentationRequestError\n isDraftMode?: boolean\n deploymentId?: string\n onUpdateCookies?: (cookies: string[]) => void\n loadConfig?: (\n phase: string,\n dir: string,\n customConfig?: object | null,\n rawConfig?: boolean,\n silent?: boolean\n ) => Promise<NextConfigComplete>\n serverActions?: {\n bodySizeLimit?: SizeLimit\n allowedOrigins?: string[]\n }\n params?: ParsedUrlQuery\n isPrefetch?: boolean\n htmlLimitedBots: string | undefined\n experimental: {\n /**\n * When true, it indicates that the current page supports partial\n * prerendering.\n */\n isRoutePPREnabled?: boolean\n expireTime: number | undefined\n staleTimes: ExperimentalConfig['staleTimes'] | undefined\n clientTraceMetadata: string[] | undefined\n clientSegmentCache: boolean | 'client-only'\n\n /**\n * The origins that are allowed to write the rewritten headers when\n * performing a non-relative rewrite. When undefined, no non-relative\n * rewrites will get the rewrite headers.\n */\n clientParamParsingOrigins: string[] | undefined\n dynamicOnHover: boolean\n inlineCss: boolean\n authInterrupts: boolean\n }\n postponed?: string\n\n /**\n * Should wait for react stream allReady to resolve all suspense boundaries,\n * in order to perform a full page render.\n */\n shouldWaitOnAllReady?: boolean\n\n /**\n * A prefilled resume data cache. This was either generated for this page\n * during dev warmup, or when a page with defined params was previously\n * prerendered, and now its matching optional fallback shell is prerendered.\n */\n renderResumeDataCache?: RenderResumeDataCache\n\n /**\n * When true, the page will be rendered using the static rendering to detect\n * any dynamic API's that would have stopped the page from being fully\n * statically generated.\n */\n isDebugDynamicAccesses?: boolean\n\n /**\n * This is true when:\n * - source maps are generated\n * - source maps are applied\n * - minification is disabled\n */\n hasReadableErrorStacks?: boolean\n\n /**\n * The maximum length of the headers that are emitted by React and added to\n * the response.\n */\n reactMaxHeadersLength: number | undefined\n\n isStaticGeneration?: boolean\n\n /**\n * When true, the page is prerendered as a fallback shell, while allowing any\n * dynamic accesses to result in an empty shell. This is the case when there\n * are also routes prerendered with a more complete set of params.\n * Prerendering those routes would catch any invalid dynamic accesses.\n */\n allowEmptyStaticShell?: boolean\n}\n\nexport type RenderOpts = LoadComponentsReturnType<AppPageModule> &\n RenderOptsPartial &\n RequestLifecycleOpts\n\nexport type PreloadCallbacks = (() => void)[]\n","import type { LoaderTree } from '../lib/app-dir-module'\nimport {\n HasLoadingBoundary,\n type FlightRouterState,\n} from '../../shared/lib/app-router-types'\nimport type { GetDynamicParamFromSegment } from './app-render'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\n\nfunction createFlightRouterStateFromLoaderTreeImpl(\n [segment, parallelRoutes, { layout, loading }]: LoaderTree,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any,\n includeHasLoadingBoundary: boolean,\n didFindRootLayout: boolean\n): FlightRouterState {\n const dynamicParam = getDynamicParamFromSegment(segment)\n const treeSegment = dynamicParam ? dynamicParam.treeSegment : segment\n\n const segmentTree: FlightRouterState = [\n addSearchParamsIfPageSegment(treeSegment, searchParams),\n {},\n ]\n\n // Mark the first segment that has a layout as the \"root\" layout\n if (!didFindRootLayout && typeof layout !== 'undefined') {\n didFindRootLayout = true\n segmentTree[4] = true\n }\n\n let childHasLoadingBoundary = false\n const children: FlightRouterState[1] = {}\n Object.keys(parallelRoutes).forEach((parallelRouteKey) => {\n const child = createFlightRouterStateFromLoaderTreeImpl(\n parallelRoutes[parallelRouteKey],\n getDynamicParamFromSegment,\n searchParams,\n includeHasLoadingBoundary,\n didFindRootLayout\n )\n if (\n includeHasLoadingBoundary &&\n child[5] !== HasLoadingBoundary.SubtreeHasNoLoadingBoundary\n ) {\n childHasLoadingBoundary = true\n }\n children[parallelRouteKey] = child\n })\n segmentTree[1] = children\n\n if (includeHasLoadingBoundary) {\n // During a route tree prefetch, the FlightRouterState includes whether a\n // tree has a loading boundary. The client uses this to determine if it can\n // skip the data prefetch request — if `hasLoadingBoundary` is `false`, the\n // data prefetch response will be empty, so there's no reason to request it.\n // NOTE: It would be better to accumulate this while building the loader\n // tree so we don't have to keep re-deriving it, but since this won't be\n // once PPR is enabled everywhere, it's not that important.\n segmentTree[5] = loading\n ? HasLoadingBoundary.SegmentHasLoadingBoundary\n : childHasLoadingBoundary\n ? HasLoadingBoundary.SubtreeHasLoadingBoundary\n : HasLoadingBoundary.SubtreeHasNoLoadingBoundary\n }\n\n return segmentTree\n}\n\nexport function createFlightRouterStateFromLoaderTree(\n loaderTree: LoaderTree,\n getDynamicParamFromSegment: GetDynamicParamFromSegment,\n searchParams: any\n) {\n const includeHasLoadingBoundary = false\n const didFindRootLayout = false\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n getDynamicParamFromSegment,\n searchParams,\n includeHasLoadingBoundary,\n didFindRootLayout\n )\n}\n\nexport function createRouteTreePrefetch(\n loaderTree: LoaderTree,\n getDynamicParamFromSegment: GetDynamicParamFromSegment\n): FlightRouterState {\n // Search params should not be added to page segment's cache key during a\n // route tree prefetch request, because they do not affect the structure of\n // the route. The client cache has its own logic to handle search params.\n const searchParams = {}\n // During a route tree prefetch, we include `hasLoadingBoundary` in\n // the response.\n const includeHasLoadingBoundary = true\n const didFindRootLayout = false\n return createFlightRouterStateFromLoaderTreeImpl(\n loaderTree,\n getDynamicParamFromSegment,\n searchParams,\n includeHasLoadingBoundary,\n didFindRootLayout\n )\n}\n","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]\n\nexport const actionsForbiddenHeaders = [\n ...ipcForbiddenHeaders,\n 'content-length',\n 'set-cookie',\n]\n\nexport const filterReqHeaders = (\n headers: Record<string, undefined | string | number | string[]>,\n forbiddenHeaders: string[]\n) => {\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\n for (const [key, value] of Object.entries(headers)) {\n if (\n forbiddenHeaders.includes(key) ||\n !(Array.isArray(value) || typeof value === 'string')\n ) {\n delete headers[key]\n }\n }\n return headers as Record<string, undefined | string | string[]>\n}\n\n// These are headers that are only used internally and should\n// not be honored from the external request\nconst INTERNAL_HEADERS = [\n 'x-middleware-rewrite',\n 'x-middleware-redirect',\n 'x-middleware-set-cookie',\n 'x-middleware-skip',\n 'x-middleware-override-headers',\n 'x-middleware-next',\n 'x-now-route-matches',\n 'x-matched-path',\n]\n\nexport const filterInternalHeaders = (\n headers: Record<string, undefined | string | string[]>\n) => {\n for (const header in headers) {\n if (INTERNAL_HEADERS.includes(header)) {\n delete headers[header]\n }\n }\n}\n","import type { IncomingMessage } from 'http'\nimport type { BaseNextRequest } from '../base-http'\nimport type { NextRequest } from '../web/exports'\nimport { ACTION_HEADER } from '../../client/components/app-router-headers'\n\nexport function getServerActionRequestMetadata(\n req: IncomingMessage | BaseNextRequest | NextRequest\n): {\n actionId: string | null\n isURLEncodedAction: boolean\n isMultipartAction: boolean\n isFetchAction: boolean\n isPossibleServerAction: boolean\n} {\n let actionId: string | null\n let contentType: string | null\n\n if (req.headers instanceof Headers) {\n actionId = req.headers.get(ACTION_HEADER) ?? null\n contentType = req.headers.get('content-type')\n } else {\n actionId = (req.headers[ACTION_HEADER] as string) ?? null\n contentType = req.headers['content-type'] ?? null\n }\n\n const isURLEncodedAction = Boolean(\n req.method === 'POST' && contentType === 'application/x-www-form-urlencoded'\n )\n const isMultipartAction = Boolean(\n req.method === 'POST' && contentType?.startsWith('multipart/form-data')\n )\n const isFetchAction = Boolean(\n actionId !== undefined &&\n typeof actionId === 'string' &&\n req.method === 'POST'\n )\n\n const isPossibleServerAction = Boolean(\n isFetchAction || isURLEncodedAction || isMultipartAction\n )\n\n return {\n actionId,\n isURLEncodedAction,\n isMultipartAction,\n isFetchAction,\n isPossibleServerAction,\n }\n}\n\nexport function getIsPossibleServerAction(\n req: IncomingMessage | BaseNextRequest | NextRequest\n): boolean {\n return getServerActionRequestMetadata(req).isPossibleServerAction\n}\n","import { bold, green, magenta, red, yellow, white } from '../../lib/picocolors'\nimport { LRUCache } from '../../server/lib/lru-cache'\n\nexport const prefixes = {\n wait: white(bold('○')),\n error: red(bold('')),\n warn: yellow(bold('⚠')),\n ready: '▲', // no color\n info: white(bold(' ')),\n event: green(bold('✓')),\n trace: magenta(bold('»')),\n} as const\n\nconst LOGGING_METHOD = {\n log: 'log',\n warn: 'warn',\n error: 'error',\n} as const\n\nfunction prefixedLog(prefixType: keyof typeof prefixes, ...message: any[]) {\n if ((message[0] === '' || message[0] === undefined) && message.length === 1) {\n message.shift()\n }\n\n const consoleMethod: keyof typeof LOGGING_METHOD =\n prefixType in LOGGING_METHOD\n ? LOGGING_METHOD[prefixType as keyof typeof LOGGING_METHOD]\n : 'log'\n\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 // Ensure if there's ANSI escape codes it's concatenated into one string.\n // Chrome DevTool can only handle color if it's in one string.\n if (message.length === 1 && typeof message[0] === 'string') {\n console[consoleMethod](' ' + prefix + ' ' + message[0])\n } else {\n console[consoleMethod](' ' + prefix, ...message)\n }\n }\n}\n\nexport function bootstrap(...message: string[]) {\n // logging format: ' <prefix> <message>'\n // e.g. ' ✓ Compiled successfully'\n // Add spaces to align with the indent of other logs\n console.log(' ' + message.join(' '))\n}\n\nexport function wait(...message: any[]) {\n prefixedLog('wait', ...message)\n}\n\nexport function error(...message: any[]) {\n prefixedLog('error', ...message)\n}\n\nexport function warn(...message: any[]) {\n prefixedLog('warn', ...message)\n}\n\nexport function ready(...message: any[]) {\n prefixedLog('ready', ...message)\n}\n\nexport function info(...message: any[]) {\n prefixedLog('info', ...message)\n}\n\nexport function event(...message: any[]) {\n prefixedLog('event', ...message)\n}\n\nexport function trace(...message: any[]) {\n prefixedLog('trace', ...message)\n}\n\nconst warnOnceCache = new LRUCache<string>(10_000, (value) => value.length)\nexport function warnOnce(...message: any[]) {\n const key = message.join(' ')\n if (!warnOnceCache.has(key)) {\n warnOnceCache.set(key, key)\n warn(...message)\n }\n}\n\nconst errorOnceCache = new LRUCache<string>(10_000, (value) => value.length)\nexport function errorOnce(...message: any[]) {\n const key = message.join(' ')\n if (!errorOnceCache.has(key)) {\n errorOnceCache.set(key, key)\n error(...message)\n }\n}\n","import type { ActionManifest } from '../../build/webpack/plugins/flight-client-entry-plugin'\nimport { 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'\nimport { workAsyncStorage } from './work-async-storage.external'\n\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({\n serverActionsManifest,\n}: {\n serverActionsManifest: ActionManifest\n}) {\n return new Proxy(\n {},\n {\n get: (_, id: string) => {\n const workers =\n serverActionsManifest[\n process.env.NEXT_RUNTIME === 'edge' ? 'edge' : 'node'\n ]?.[id]?.workers\n\n if (!workers) {\n return undefined\n }\n\n const workStore = workAsyncStorage.getStore()\n\n let workerEntry:\n | { moduleId: string | number; async: boolean }\n | undefined\n\n if (workStore) {\n workerEntry = workers[normalizeWorkerPageName(workStore.page)]\n } else {\n // If there's no work store defined, we can assume that a server\n // module map is needed during module evaluation, e.g. to create a\n // server action using a higher-order function. Therefore it should be\n // safe to return any entry from the manifest that matches the action\n // ID. They all refer to the same module ID, which must also exist in\n // the current page bundle. TODO: This is currently not guaranteed in\n // Turbopack, and needs to be fixed.\n workerEntry = Object.values(workers).at(0)\n }\n\n if (!workerEntry) {\n return undefined\n }\n\n const { moduleId, async } = workerEntry\n\n return { id: moduleId, name: id, chunks: [], async }\n },\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 */\nexport function selectWorkerForForwarding(\n actionId: string,\n pageName: string,\n serverActionsManifest: ActionManifest\n) {\n const workers =\n serverActionsManifest[\n process.env.NEXT_RUNTIME === 'edge' ? 'edge' : 'node'\n ][actionId]?.workers\n const workerName = normalizeWorkerPageName(pageName)\n\n // no workers, nothing to forward to\n if (!workers) return\n\n // if there is a worker for this page, no need to forward it.\n if (workers[workerName]) {\n return\n }\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/**\n * The flight entry loader keys actions by bundlePath.\n * bundlePath corresponds with the relative path (including 'app') to the page entrypoint.\n */\nfunction normalizeWorkerPageName(pageName: string) {\n if (pathHasPrefix(pageName, 'app')) {\n return pageName\n }\n\n return 'app' + pageName\n}\n\n/**\n * Converts a bundlePath (relative path to the entrypoint) to a routable page name\n */\nfunction denormalizeWorkerPageName(bundlePath: string) {\n return normalizeAppPath(removePathPrefix(bundlePath, 'app'))\n}\n","import type { IncomingHttpHeaders, OutgoingHttpHeaders } from 'node:http'\nimport type { SizeLimit } from '../../types'\nimport type { RequestStore } from '../app-render/work-unit-async-storage.external'\nimport type { AppRenderContext, GenerateFlight } from './app-render'\nimport type { AppPageModule } from '../route-modules/app-page/module'\nimport type { BaseNextRequest, BaseNextResponse } from '../base-http'\n\nimport {\n RSC_HEADER,\n RSC_CONTENT_TYPE_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n ACTION_HEADER,\n NEXT_ACTION_NOT_FOUND_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_URL,\n} from '../../client/components/app-router-headers'\nimport {\n getAccessFallbackHTTPStatus,\n isHTTPAccessFallbackError,\n} from '../../client/components/http-access-fallback/http-access-fallback'\nimport {\n getRedirectTypeFromError,\n getURLFromRedirectError,\n} from '../../client/components/redirect'\nimport {\n isRedirectError,\n type RedirectType,\n} from '../../client/components/redirect-error'\nimport RenderResult, {\n type AppPageRenderResultMetadata,\n} from '../render-result'\nimport type { WorkStore } from '../app-render/work-async-storage.external'\nimport { FlightRenderResult } from './flight-render-result'\nimport {\n filterReqHeaders,\n actionsForbiddenHeaders,\n} from '../lib/server-ipc/utils'\nimport { getModifiedCookieValues } from '../web/spec-extension/adapters/request-cookies'\n\nimport {\n JSON_CONTENT_TYPE_HEADER,\n NEXT_CACHE_REVALIDATED_TAGS_HEADER,\n NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER,\n} from '../../lib/constants'\nimport { getServerActionRequestMetadata } from '../lib/server-action-request-meta'\nimport { isCsrfOriginAllowed } from './csrf-protection'\nimport { warn } from '../../build/output/log'\nimport { RequestCookies, ResponseCookies } from '../web/spec-extension/cookies'\nimport { HeadersAdapter } from '../web/spec-extension/adapters/headers'\nimport { fromNodeOutgoingHttpHeaders } from '../web/utils'\nimport { selectWorkerForForwarding } from './action-utils'\nimport { isNodeNextRequest, isWebNextRequest } from '../base-http/helpers'\nimport { RedirectStatusCode } from '../../client/components/redirect-status-code'\nimport { synchronizeMutableCookies } from '../async-storage/request-store'\nimport type { TemporaryReferenceSet } from 'react-server-dom-webpack/server'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { executeRevalidates } from '../revalidation-utils'\nimport { getRequestMeta } from '../request-meta'\nimport { setCacheBustingSearchParam } from '../../client/components/router-reducer/set-cache-busting-search-param'\n\nfunction formDataFromSearchQueryString(query: string) {\n const searchParams = new URLSearchParams(query)\n const formData = new FormData()\n for (const [key, value] of searchParams) {\n formData.append(key, value)\n }\n return formData\n}\n\nfunction nodeHeadersToRecord(\n headers: IncomingHttpHeaders | OutgoingHttpHeaders\n) {\n const record: Record<string, string> = {}\n for (const [key, value] of Object.entries(headers)) {\n if (value !== undefined) {\n record[key] = Array.isArray(value) ? value.join(', ') : `${value}`\n }\n }\n return record\n}\n\nfunction getForwardedHeaders(\n req: BaseNextRequest,\n res: BaseNextResponse\n): Headers {\n // Get request headers and cookies\n const requestHeaders = req.headers\n const requestCookies = new RequestCookies(HeadersAdapter.from(requestHeaders))\n\n // Get response headers and cookies\n const responseHeaders = res.getHeaders()\n const responseCookies = new ResponseCookies(\n fromNodeOutgoingHttpHeaders(responseHeaders)\n )\n\n // Merge request and response headers\n const mergedHeaders = filterReqHeaders(\n {\n ...nodeHeadersToRecord(requestHeaders),\n ...nodeHeadersToRecord(responseHeaders),\n },\n actionsForbiddenHeaders\n ) as Record<string, string>\n\n // Merge cookies into requestCookies, so responseCookies always take precedence\n // and overwrite/delete those from requestCookies.\n responseCookies.getAll().forEach((cookie) => {\n if (typeof cookie.value === 'undefined') {\n requestCookies.delete(cookie.name)\n } else {\n requestCookies.set(cookie)\n }\n })\n\n // Update the 'cookie' header with the merged cookies\n mergedHeaders['cookie'] = requestCookies.toString()\n\n // Remove headers that should not be forwarded\n delete mergedHeaders['transfer-encoding']\n\n return new Headers(mergedHeaders)\n}\n\nfunction addRevalidationHeader(\n res: BaseNextResponse,\n {\n workStore,\n requestStore,\n }: {\n workStore: WorkStore\n requestStore: RequestStore\n }\n) {\n // If a tag was revalidated, the client router needs to invalidate all the\n // client router cache as they may be stale. And if a path was revalidated, the\n // client needs to invalidate all subtrees below that path.\n\n // To keep the header size small, we use a tuple of\n // [[revalidatedPaths], isTagRevalidated ? 1 : 0, isCookieRevalidated ? 1 : 0]\n // instead of a JSON object.\n\n // TODO-APP: Currently the prefetch cache doesn't have subtree information,\n // so we need to invalidate the entire cache if a path was revalidated.\n // TODO-APP: Currently paths are treated as tags, so the second element of the tuple\n // is always empty.\n\n const isTagRevalidated = workStore.pendingRevalidatedTags?.length ? 1 : 0\n const isCookieRevalidated = getModifiedCookieValues(\n requestStore.mutableCookies\n ).length\n ? 1\n : 0\n\n res.setHeader(\n 'x-action-revalidated',\n JSON.stringify([[], isTagRevalidated, isCookieRevalidated])\n )\n}\n\n/**\n * Forwards a server action request to a separate worker. Used when the requested action is not available in the current worker.\n */\nasync function createForwardedActionResponse(\n req: BaseNextRequest,\n res: BaseNextResponse,\n host: Host,\n workerPathname: string,\n basePath: string\n) {\n if (!host) {\n throw new Error(\n 'Invariant: Missing `host` header from a forwarded Server Actions request.'\n )\n }\n\n const forwardedHeaders = getForwardedHeaders(req, res)\n\n // indicate that this action request was forwarded from another worker\n // we use this to skip rendering the flight tree so that we don't update the UI\n // with the response from the forwarded worker\n forwardedHeaders.set('x-action-forwarded', '1')\n\n const proto =\n getRequestMeta(req, 'initProtocol')?.replace(/:+$/, '') || 'https'\n\n // For standalone or the serverful mode, use the internal origin directly\n // other than the host headers from the request.\n const origin = process.env.__NEXT_PRIVATE_ORIGIN || `${proto}://${host.value}`\n\n const fetchUrl = new URL(`${origin}${basePath}${workerPathname}`)\n\n try {\n let body: BodyInit | ReadableStream<Uint8Array> | undefined\n if (\n // The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME === 'edge' &&\n isWebNextRequest(req)\n ) {\n if (!req.body) {\n throw new Error('Invariant: missing request body.')\n }\n\n body = req.body\n } else if (\n // The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME !== 'edge' &&\n isNodeNextRequest(req)\n ) {\n body = req.stream()\n } else {\n throw new Error('Invariant: Unknown request type.')\n }\n\n // Forward the request to the new worker\n const response = await fetch(fetchUrl, {\n method: 'POST',\n body,\n duplex: 'half',\n headers: forwardedHeaders,\n redirect: 'manual',\n next: {\n // @ts-ignore\n internal: 1,\n },\n })\n\n if (\n response.headers.get('content-type')?.startsWith(RSC_CONTENT_TYPE_HEADER)\n ) {\n // copy the headers from the redirect response to the response we're sending\n for (const [key, value] of response.headers) {\n if (!actionsForbiddenHeaders.includes(key)) {\n res.setHeader(key, value)\n }\n }\n\n return new FlightRenderResult(response.body!)\n } else {\n // Since we aren't consuming the response body, we cancel it to avoid memory leaks\n response.body?.cancel()\n }\n } catch (err) {\n // we couldn't stream the forwarded response, so we'll just return an empty response\n console.error(`failed to forward action response`, err)\n }\n\n return RenderResult.fromStatic('{}', JSON_CONTENT_TYPE_HEADER)\n}\n\n/**\n * Returns the parsed redirect URL if we deem that it is hosted by us.\n *\n * We handle both relative and absolute redirect URLs.\n *\n * In case the redirect URL is not relative to the application we return `null`.\n */\nfunction getAppRelativeRedirectUrl(\n basePath: string,\n host: Host,\n redirectUrl: string,\n currentPathname?: string\n): URL | null {\n if (redirectUrl.startsWith('/')) {\n // Absolute path - just add basePath\n return new URL(`${basePath}${redirectUrl}`, 'http://n')\n } else if (redirectUrl.startsWith('.')) {\n // Relative path - resolve relative to current pathname\n let base = currentPathname || '/'\n // Ensure the base path ends with a slash so relative resolution works correctly\n // e.g., \"./subpage\" from \"/subdir\" should resolve to \"/subdir/subpage\"\n // not \"/subpage\"\n if (!base.endsWith('/')) {\n base = base + '/'\n }\n const resolved = new URL(redirectUrl, `http://n${base}`)\n // Include basePath in the final URL\n return new URL(\n `${basePath}${resolved.pathname}${resolved.search}${resolved.hash}`,\n 'http://n'\n )\n }\n\n const parsedRedirectUrl = new URL(redirectUrl)\n\n if (host?.value !== parsedRedirectUrl.host) {\n return null\n }\n\n // At this point the hosts are the same, just confirm we\n // are routing to a path underneath the `basePath`\n return parsedRedirectUrl.pathname.startsWith(basePath)\n ? parsedRedirectUrl\n : null\n}\n\nasync function createRedirectRenderResult(\n req: BaseNextRequest,\n res: BaseNextResponse,\n originalHost: Host,\n redirectUrl: string,\n redirectType: RedirectType,\n basePath: string,\n workStore: WorkStore,\n currentPathname?: string\n) {\n res.setHeader('x-action-redirect', `${redirectUrl};${redirectType}`)\n\n // If we're redirecting to another route of this Next.js application, we'll\n // try to stream the response from the other worker path. When that works,\n // we can save an extra roundtrip and avoid a full page reload.\n // When the redirect URL starts with a `/` or is to the same host, under the\n // `basePath` we treat it as an app-relative redirect;\n const appRelativeRedirectUrl = getAppRelativeRedirectUrl(\n basePath,\n originalHost,\n redirectUrl,\n currentPathname\n )\n\n if (appRelativeRedirectUrl) {\n if (!originalHost) {\n throw new Error(\n 'Invariant: Missing `host` header from a forwarded Server Actions request.'\n )\n }\n\n const forwardedHeaders = getForwardedHeaders(req, res)\n forwardedHeaders.set(RSC_HEADER, '1')\n\n const proto =\n getRequestMeta(req, 'initProtocol')?.replace(/:+$/, '') || 'https'\n\n // For standalone or the serverful mode, use the internal origin directly\n // other than the host headers from the request.\n const origin =\n process.env.__NEXT_PRIVATE_ORIGIN || `${proto}://${originalHost.value}`\n\n const fetchUrl = new URL(\n `${origin}${appRelativeRedirectUrl.pathname}${appRelativeRedirectUrl.search}`\n )\n\n if (workStore.pendingRevalidatedTags) {\n forwardedHeaders.set(\n NEXT_CACHE_REVALIDATED_TAGS_HEADER,\n workStore.pendingRevalidatedTags.map((item) => item.tag).join(',')\n )\n forwardedHeaders.set(\n NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER,\n workStore.incrementalCache?.prerenderManifest?.preview?.previewModeId ||\n ''\n )\n }\n\n // Ensures that when the path was revalidated we don't return a partial response on redirects\n forwardedHeaders.delete(NEXT_ROUTER_STATE_TREE_HEADER)\n // When an action follows a redirect, it's no longer handling an action: it's just a normal RSC request\n // to the requested URL. We should remove the `next-action` header so that it's not treated as an action\n forwardedHeaders.delete(ACTION_HEADER)\n\n try {\n setCacheBustingSearchParam(fetchUrl, {\n [NEXT_ROUTER_PREFETCH_HEADER]: forwardedHeaders.get(\n NEXT_ROUTER_PREFETCH_HEADER\n )\n ? ('1' as const)\n : undefined,\n [NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]:\n forwardedHeaders.get(NEXT_ROUTER_SEGMENT_PREFETCH_HEADER) ??\n undefined,\n [NEXT_ROUTER_STATE_TREE_HEADER]:\n forwardedHeaders.get(NEXT_ROUTER_STATE_TREE_HEADER) ?? undefined,\n [NEXT_URL]: forwardedHeaders.get(NEXT_URL) ?? undefined,\n })\n\n const response = await fetch(fetchUrl, {\n method: 'GET',\n headers: forwardedHeaders,\n next: {\n // @ts-ignore\n internal: 1,\n },\n })\n\n if (\n response.headers\n .get('content-type')\n ?.startsWith(RSC_CONTENT_TYPE_HEADER)\n ) {\n // copy the headers from the redirect response to the response we're sending\n for (const [key, value] of response.headers) {\n if (!actionsForbiddenHeaders.includes(key)) {\n res.setHeader(key, value)\n }\n }\n\n return new FlightRenderResult(response.body!)\n } else {\n // Since we aren't consuming the response body, we cancel it to avoid memory leaks\n response.body?.cancel()\n }\n } catch (err) {\n // we couldn't stream the redirect response, so we'll just do a normal redirect\n console.error(`failed to get redirect response`, err)\n }\n }\n\n return RenderResult.EMPTY\n}\n\n// Used to compare Host header and Origin header.\nconst enum HostType {\n XForwardedHost = 'x-forwarded-host',\n Host = 'host',\n}\ntype Host =\n | {\n type: HostType.XForwardedHost\n value: string\n }\n | {\n type: HostType.Host\n value: string\n }\n | undefined\n\n/**\n * Ensures the value of the header can't create long logs.\n */\nfunction limitUntrustedHeaderValueForLogs(value: string) {\n return value.length > 100 ? value.slice(0, 100) + '...' : value\n}\n\nexport function parseHostHeader(\n headers: IncomingHttpHeaders,\n originDomain?: string\n) {\n const forwardedHostHeader = headers['x-forwarded-host']\n const forwardedHostHeaderValue =\n forwardedHostHeader && Array.isArray(forwardedHostHeader)\n ? forwardedHostHeader[0]\n : forwardedHostHeader?.split(',')?.[0]?.trim()\n const hostHeader = headers['host']\n\n if (originDomain) {\n return forwardedHostHeaderValue === originDomain\n ? {\n type: HostType.XForwardedHost,\n value: forwardedHostHeaderValue,\n }\n : hostHeader === originDomain\n ? {\n type: HostType.Host,\n value: hostHeader,\n }\n : undefined\n }\n\n return forwardedHostHeaderValue\n ? {\n type: HostType.XForwardedHost,\n value: forwardedHostHeaderValue,\n }\n : hostHeader\n ? {\n type: HostType.Host,\n value: hostHeader,\n }\n : undefined\n}\n\ntype ServerModuleMap = Record<\n string,\n {\n id: string\n chunks: string[]\n name: string\n }\n>\n\ntype ServerActionsConfig = {\n bodySizeLimit?: SizeLimit\n allowedOrigins?: string[]\n}\n\ntype HandleActionResult =\n | {\n /** An MPA action threw notFound(), and we need to render the appropriate HTML */\n type: 'not-found'\n }\n | {\n type: 'done'\n result: RenderResult | undefined\n formState?: any\n }\n /** The request turned out not to be a server action. */\n | null\n\nexport async function handleAction({\n req,\n res,\n ComponentMod,\n serverModuleMap,\n generateFlight,\n workStore,\n requestStore,\n serverActions,\n ctx,\n metadata,\n}: {\n req: BaseNextRequest\n res: BaseNextResponse\n ComponentMod: AppPageModule\n serverModuleMap: ServerModuleMap\n generateFlight: GenerateFlight\n workStore: WorkStore\n requestStore: RequestStore\n serverActions?: ServerActionsConfig\n ctx: AppRenderContext\n metadata: AppPageRenderResultMetadata\n}): Promise<HandleActionResult> {\n const contentType = req.headers['content-type']\n const { serverActionsManifest, page } = ctx.renderOpts\n\n const {\n actionId,\n isURLEncodedAction,\n isMultipartAction,\n isFetchAction,\n isPossibleServerAction,\n } = getServerActionRequestMetadata(req)\n\n // If it can't be a Server Action, skip handling.\n // Note that this can be a false positive -- any multipart/urlencoded POST can get us here,\n // But won't know if it's an MPA action or not until we call `decodeAction` below.\n if (!isPossibleServerAction) {\n return null\n }\n\n if (workStore.isStaticGeneration) {\n throw new Error(\n \"Invariant: server actions can't be handled during static rendering\"\n )\n }\n\n let temporaryReferences: TemporaryReferenceSet | undefined\n\n // When running actions the default is no-store, you can still `cache: 'force-cache'`\n workStore.fetchCache = 'default-no-store'\n\n const originDomain =\n typeof req.headers['origin'] === 'string'\n ? new URL(req.headers['origin']).host\n : undefined\n const host = parseHostHeader(req.headers)\n\n let warning: string | undefined = undefined\n\n function warnBadServerActionRequest() {\n if (warning) {\n warn(warning)\n }\n }\n // This is to prevent CSRF attacks. If `x-forwarded-host` is set, we need to\n // ensure that the request is coming from the same host.\n if (!originDomain) {\n // This might be an old browser that doesn't send `host` header. We ignore\n // this case.\n warning = 'Missing `origin` header from a forwarded Server Actions request.'\n } else if (!host || originDomain !== host.value) {\n // If the customer sets a list of allowed origins, we'll allow the request.\n // These are considered safe but might be different from forwarded host set\n // by the infra (i.e. reverse proxies).\n if (isCsrfOriginAllowed(originDomain, serverActions?.allowedOrigins)) {\n // Ignore it\n } else {\n if (host) {\n // This seems to be an CSRF attack. We should not proceed the action.\n console.error(\n `\\`${\n host.type\n }\\` header with value \\`${limitUntrustedHeaderValueForLogs(\n host.value\n )}\\` does not match \\`origin\\` header with value \\`${limitUntrustedHeaderValueForLogs(\n originDomain\n )}\\` from a forwarded Server Actions request. Aborting the action.`\n )\n } else {\n // This is an attack. We should not proceed the action.\n console.error(\n `\\`x-forwarded-host\\` or \\`host\\` headers are not provided. One of these is needed to compare the \\`origin\\` header from a forwarded Server Actions request. Aborting the action.`\n )\n }\n\n const error = new Error('Invalid Server Actions request.')\n\n if (isFetchAction) {\n res.statusCode = 500\n metadata.statusCode = 500\n\n const promise = Promise.reject(error)\n try {\n // we need to await the promise to trigger the rejection early\n // so that it's already handled by the time we call\n // the RSC runtime. Otherwise, it will throw an unhandled\n // promise rejection error in the renderer.\n await promise\n } catch {\n // swallow error, it's gonna be handled on the client\n }\n\n return {\n type: 'done',\n result: await generateFlight(req, ctx, requestStore, {\n actionResult: promise,\n // We didn't execute an action, so no revalidations could have occurred. We can skip rendering the page.\n skipFlight: true,\n temporaryReferences,\n }),\n }\n }\n\n throw error\n }\n }\n\n // ensure we avoid caching server actions unexpectedly\n res.setHeader(\n 'Cache-Control',\n 'no-cache, no-store, max-age=0, must-revalidate'\n )\n\n const { actionAsyncStorage } = ComponentMod\n\n const actionWasForwarded = Boolean(req.headers['x-action-forwarded'])\n\n if (actionId) {\n const forwardedWorker = selectWorkerForForwarding(\n actionId,\n page,\n serverActionsManifest\n )\n\n // If forwardedWorker is truthy, it means there isn't a worker for the action\n // in the current handler, so we forward the request to a worker that has the action.\n if (forwardedWorker) {\n return {\n type: 'done',\n result: await createForwardedActionResponse(\n req,\n res,\n host,\n forwardedWorker,\n ctx.renderOpts.basePath\n ),\n }\n }\n }\n\n const handleUnrecognizedFetchAction = (err: unknown): HandleActionResult => {\n // If the deployment doesn't have skew protection, this is expected to occasionally happen,\n // so we use a warning instead of an error.\n console.warn(err)\n\n // Return an empty response with a header that the client router will interpret.\n // We don't need to waste time encoding a flight response, and using a blank body + header\n // means that unrecognized actions can also be handled at the infra level\n // (i.e. without needing to invoke a lambda)\n res.setHeader(NEXT_ACTION_NOT_FOUND_HEADER, '1')\n res.setHeader('content-type', 'text/plain')\n res.statusCode = 404\n return {\n type: 'done',\n result: RenderResult.fromStatic('Server action not found.', 'text/plain'),\n }\n }\n\n try {\n return await actionAsyncStorage.run(\n { isAction: true },\n async (): Promise<HandleActionResult> => {\n // We only use these for fetch actions -- MPA actions handle them inside `decodeAction`.\n let actionModId: string | undefined\n let boundActionArguments: unknown[] = []\n\n if (\n // The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME === 'edge' &&\n isWebNextRequest(req)\n ) {\n if (!req.body) {\n throw new Error('invariant: Missing request body.')\n }\n\n // TODO: add body limit\n\n // Use react-server-dom-webpack/server\n const {\n createTemporaryReferenceSet,\n decodeReply,\n decodeAction,\n decodeFormState,\n } = ComponentMod\n\n temporaryReferences = createTemporaryReferenceSet()\n\n if (isMultipartAction) {\n // TODO-APP: Add streaming support\n const formData = await req.request.formData()\n if (isFetchAction) {\n // A fetch action with a multipart body.\n boundActionArguments = await decodeReply(\n formData,\n serverModuleMap,\n { temporaryReferences }\n )\n } else {\n // Multipart POST, but not a fetch action.\n // Potentially an MPA action, we have to try decoding it to check.\n const action = await decodeAction(formData, serverModuleMap)\n if (typeof action === 'function') {\n // an MPA action.\n\n // Only warn if it's a server action, otherwise skip for other post requests\n warnBadServerActionRequest()\n\n const actionReturnedState =\n await executeActionAndPrepareForRender(\n action as () => Promise<unknown>,\n [],\n workStore,\n requestStore\n )\n\n const formState = await decodeFormState(\n actionReturnedState,\n formData,\n serverModuleMap\n )\n\n // Skip the fetch path.\n // We need to render a full HTML version of the page for the response, we'll handle that in app-render.\n return {\n type: 'done',\n result: undefined,\n formState,\n }\n } else {\n // We couldn't decode an action, so this POST request turned out not to be a server action request.\n return null\n }\n }\n } else {\n // POST with non-multipart body.\n\n // If it's not multipart AND not a fetch action,\n // then it can't be an action request.\n if (!isFetchAction) {\n return null\n }\n\n try {\n actionModId = getActionModIdOrError(actionId, serverModuleMap)\n } catch (err) {\n return handleUnrecognizedFetchAction(err)\n }\n\n // A fetch action with a non-multipart body.\n // In practice, this happens if `encodeReply` returned a string instead of FormData,\n // which can happen for very simple JSON-like values that don't need multiple flight rows.\n\n const chunks: Buffer[] = []\n const reader = req.body.getReader()\n while (true) {\n const { done, value } = await reader.read()\n if (done) {\n break\n }\n\n chunks.push(value)\n }\n\n const actionData = Buffer.concat(chunks).toString('utf-8')\n\n if (isURLEncodedAction) {\n const formData = formDataFromSearchQueryString(actionData)\n boundActionArguments = await decodeReply(\n formData,\n serverModuleMap,\n { temporaryReferences }\n )\n } else {\n boundActionArguments = await decodeReply(\n actionData,\n serverModuleMap,\n { temporaryReferences }\n )\n }\n }\n } else if (\n // The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME !== 'edge' &&\n isNodeNextRequest(req)\n ) {\n // Use react-server-dom-webpack/server.node which supports streaming\n const {\n createTemporaryReferenceSet,\n decodeReply,\n decodeReplyFromBusboy,\n decodeAction,\n decodeFormState,\n } = require(\n `./react-server.node`\n ) as typeof import('./react-server.node')\n\n temporaryReferences = createTemporaryReferenceSet()\n\n const { Transform, pipeline } =\n require('node:stream') as typeof import('node:stream')\n\n const defaultBodySizeLimit = '1 MB'\n const bodySizeLimit =\n serverActions?.bodySizeLimit ?? defaultBodySizeLimit\n const bodySizeLimitBytes =\n bodySizeLimit !== defaultBodySizeLimit\n ? (\n require('next/dist/compiled/bytes') as typeof import('next/dist/compiled/bytes')\n ).parse(bodySizeLimit)\n : 1024 * 1024 // 1 MB\n\n let size = 0\n const sizeLimitTransform = new Transform({\n transform(chunk, encoding, callback) {\n size += Buffer.byteLength(chunk, encoding)\n if (size > bodySizeLimitBytes) {\n const { ApiError } =\n require('../api-utils') as typeof import('../api-utils')\n\n callback(\n new ApiError(\n 413,\n `Body exceeded ${bodySizeLimit} limit.\\n` +\n `To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit`\n )\n )\n return\n }\n\n callback(null, chunk)\n },\n })\n\n const sizeLimitedBody = pipeline(\n req.body,\n sizeLimitTransform,\n // Avoid unhandled errors from `pipeline()` by passing an empty completion callback.\n // We'll propagate the errors properly when consuming the stream.\n () => {}\n )\n\n if (isMultipartAction) {\n if (isFetchAction) {\n // A fetch action with a multipart body.\n\n const busboy = (\n require('next/dist/compiled/busboy') as typeof import('next/dist/compiled/busboy')\n )({\n defParamCharset: 'utf8',\n headers: req.headers,\n limits: { fieldSize: bodySizeLimitBytes },\n })\n\n // We need to use `pipeline(one, two)` instead of `one.pipe(two)` to propagate size limit errors correctly.\n pipeline(\n sizeLimitedBody,\n busboy,\n // Avoid unhandled errors from `pipeline()` by passing an empty completion callback.\n // We'll propagate the errors properly when consuming the stream.\n () => {}\n )\n\n boundActionArguments = await decodeReplyFromBusboy(\n busboy,\n serverModuleMap,\n { temporaryReferences }\n )\n } else {\n // Multipart POST, but not a fetch action.\n // Potentially an MPA action, we have to try decoding it to check.\n\n // React doesn't yet publish a busboy version of decodeAction\n // so we polyfill the parsing of FormData.\n const fakeRequest = new Request('http://localhost', {\n method: 'POST',\n // @ts-expect-error\n headers: { 'Content-Type': contentType },\n body: new ReadableStream({\n start: (controller) => {\n sizeLimitedBody.on('data', (chunk) => {\n controller.enqueue(new Uint8Array(chunk))\n })\n sizeLimitedBody.on('end', () => {\n controller.close()\n })\n sizeLimitedBody.on('error', (err) => {\n controller.error(err)\n })\n },\n }),\n duplex: 'half',\n })\n const formData = await fakeRequest.formData()\n const action = await decodeAction(formData, serverModuleMap)\n if (typeof action === 'function') {\n // an MPA action.\n\n // Only warn if it's a server action, otherwise skip for other post requests\n warnBadServerActionRequest()\n\n const actionReturnedState =\n await executeActionAndPrepareForRender(\n action as () => Promise<unknown>,\n [],\n workStore,\n requestStore\n )\n\n const formState = await decodeFormState(\n actionReturnedState,\n formData,\n serverModuleMap\n )\n\n // Skip the fetch path.\n // We need to render a full HTML version of the page for the response, we'll handle that in app-render.\n return {\n type: 'done',\n result: undefined,\n formState,\n }\n } else {\n // We couldn't decode an action, so this POST request turned out not to be a server action request.\n return null\n }\n }\n } else {\n // POST with non-multipart body.\n\n // If it's not multipart AND not a fetch action,\n // then it can't be an action request.\n if (!isFetchAction) {\n return null\n }\n\n try {\n actionModId = getActionModIdOrError(actionId, serverModuleMap)\n } catch (err) {\n return handleUnrecognizedFetchAction(err)\n }\n\n // A fetch action with a non-multipart body.\n // In practice, this happens if `encodeReply` returned a string instead of FormData,\n // which can happen for very simple JSON-like values that don't need multiple flight rows.\n\n const chunks: Buffer[] = []\n for await (const chunk of sizeLimitedBody) {\n chunks.push(Buffer.from(chunk))\n }\n\n const actionData = Buffer.concat(chunks).toString('utf-8')\n\n if (isURLEncodedAction) {\n const formData = formDataFromSearchQueryString(actionData)\n boundActionArguments = await decodeReply(\n formData,\n serverModuleMap,\n { temporaryReferences }\n )\n } else {\n boundActionArguments = await decodeReply(\n actionData,\n serverModuleMap,\n { temporaryReferences }\n )\n }\n }\n } else {\n throw new Error('Invariant: Unknown request type.')\n }\n\n // actions.js\n // app/page.js\n // action worker1\n // appRender1\n\n // app/foo/page.js\n // action worker2\n // appRender\n\n // / -> fire action -> POST / -> appRender1 -> modId for the action file\n // /foo -> fire action -> POST /foo -> appRender2 -> modId for the action file\n\n try {\n actionModId =\n actionModId ?? getActionModIdOrError(actionId, serverModuleMap)\n } catch (err) {\n return handleUnrecognizedFetchAction(err)\n }\n\n const actionMod = (await ComponentMod.__next_app__.require(\n actionModId\n )) as Record<string, (...args: unknown[]) => Promise<unknown>>\n const actionHandler =\n actionMod[\n // `actionId` must exist if we got here, as otherwise we would have thrown an error above\n actionId!\n ]\n\n const returnVal = await executeActionAndPrepareForRender(\n actionHandler,\n boundActionArguments,\n workStore,\n requestStore\n ).finally(() => {\n addRevalidationHeader(res, { workStore, requestStore })\n })\n\n // For form actions, we need to continue rendering the page.\n if (isFetchAction) {\n const actionResult = await generateFlight(req, ctx, requestStore, {\n actionResult: Promise.resolve(returnVal),\n // if the page was not revalidated, or if the action was forwarded from another worker, we can skip the rendering the flight tree\n skipFlight: !workStore.pathWasRevalidated || actionWasForwarded,\n temporaryReferences,\n })\n\n return {\n type: 'done',\n result: actionResult,\n }\n } else {\n // TODO: this shouldn't be reachable, because all non-fetch codepaths return early.\n // this will be handled in a follow-up refactor PR.\n return null\n }\n }\n )\n } catch (err) {\n if (isRedirectError(err)) {\n const redirectUrl = getURLFromRedirectError(err)\n const redirectType = getRedirectTypeFromError(err)\n\n // if it's a fetch action, we'll set the status code for logging/debugging purposes\n // but we won't set a Location header, as the redirect will be handled by the client router\n res.statusCode = RedirectStatusCode.SeeOther\n metadata.statusCode = RedirectStatusCode.SeeOther\n\n if (isFetchAction) {\n return {\n type: 'done',\n result: await createRedirectRenderResult(\n req,\n res,\n host,\n redirectUrl,\n redirectType,\n ctx.renderOpts.basePath,\n workStore,\n requestStore.url.pathname\n ),\n }\n }\n\n // For an MPA action, the redirect doesn't need a body, just a Location header.\n res.setHeader('Location', redirectUrl)\n return {\n type: 'done',\n result: RenderResult.EMPTY,\n }\n } else if (isHTTPAccessFallbackError(err)) {\n res.statusCode = getAccessFallbackHTTPStatus(err)\n metadata.statusCode = res.statusCode\n\n if (isFetchAction) {\n const promise = Promise.reject(err)\n try {\n // we need to await the promise to trigger the rejection early\n // so that it's already handled by the time we call\n // the RSC runtime. Otherwise, it will throw an unhandled\n // promise rejection error in the renderer.\n await promise\n } catch {\n // swallow error, it's gonna be handled on the client\n }\n return {\n type: 'done',\n result: await generateFlight(req, ctx, requestStore, {\n skipFlight: false,\n actionResult: promise,\n temporaryReferences,\n }),\n }\n }\n\n // For an MPA action, we need to render a HTML response. We'll handle that in app-render.\n return {\n type: 'not-found',\n }\n }\n\n // An error that didn't come from `redirect()` or `notFound()`, likely thrown from user code\n // (but it could also be a bug in our code!)\n\n if (isFetchAction) {\n // TODO: consider checking if the error is an `ApiError` and change status code\n // so that we can respond with a 413 to requests that break the body size limit\n // (but if we do that, we also need to make sure that whatever handles the non-fetch error path below does the same)\n res.statusCode = 500\n metadata.statusCode = 500\n const promise = Promise.reject(err)\n try {\n // we need to await the promise to trigger the rejection early\n // so that it's already handled by the time we call\n // the RSC runtime. Otherwise, it will throw an unhandled\n // promise rejection error in the renderer.\n await promise\n } catch {\n // swallow error, it's gonna be handled on the client\n }\n\n return {\n type: 'done',\n result: await generateFlight(req, ctx, requestStore, {\n actionResult: promise,\n // if the page was not revalidated, or if the action was forwarded from another worker, we can skip the rendering the flight tree\n skipFlight: !workStore.pathWasRevalidated || actionWasForwarded,\n temporaryReferences,\n }),\n }\n }\n\n // For an MPA action, we need to render a HTML response. We'll rethrow the error and let it be handled above.\n throw err\n }\n}\n\nasync function executeActionAndPrepareForRender<\n TFn extends (...args: any[]) => Promise<any>,\n>(\n action: TFn,\n args: Parameters<TFn>,\n workStore: WorkStore,\n requestStore: RequestStore\n): Promise<Awaited<ReturnType<TFn>>> {\n requestStore.phase = 'action'\n try {\n return await workUnitAsyncStorage.run(requestStore, () =>\n action.apply(null, args)\n )\n } finally {\n requestStore.phase = 'render'\n\n // When we switch to the render phase, cookies() will return\n // `workUnitStore.cookies` instead of `workUnitStore.userspaceMutableCookies`.\n // We want the render to see any cookie writes that we performed during the action,\n // so we need to update the immutable cookies to reflect the changes.\n synchronizeMutableCookies(requestStore)\n\n // The server action might have toggled draft mode, so we need to reflect\n // that in the work store to be up-to-date for subsequent rendering.\n workStore.isDraftMode = requestStore.draftMode.isEnabled\n\n // If the action called revalidateTag/revalidatePath, then that might affect data used by the subsequent render,\n // so we need to make sure all revalidations are applied before that\n await executeRevalidates(workStore)\n }\n}\n\n/**\n * Attempts to find the module ID for the action from the module map. When this fails, it could be a deployment skew where\n * the action came from a different deployment. It could also simply be an invalid POST request that is not a server action.\n * In either case, we'll throw an error to be handled by the caller.\n */\nfunction getActionModIdOrError(\n actionId: string | null,\n serverModuleMap: ServerModuleMap\n): string {\n // if we're missing the action ID header, we can't do any further processing\n if (!actionId) {\n throw new InvariantError(\"Missing 'next-action' header.\")\n }\n\n const actionModId = serverModuleMap[actionId]?.id\n\n if (!actionModId) {\n throw new Error(\n `Failed to find Server Action \"${actionId}\". This request might be from an older or newer deployment.\\nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action`\n )\n }\n\n return actionModId\n}\n","// micromatch is only available at node runtime, so it cannot be used here since the code path that calls this function\n// can be run from edge. This is a simple implementation that safely achieves the required functionality.\n// the goal is to match the functionality for remotePatterns as defined here -\n// https://nextjs.org/docs/app/api-reference/components/image#remotepatterns\n// TODO - retrofit micromatch to work in edge and use that instead\nfunction matchWildcardDomain(domain: string, pattern: string) {\n const domainParts = domain.split('.')\n const patternParts = pattern.split('.')\n\n if (patternParts.length < 1) {\n // pattern is empty and therefore invalid to match against\n return false\n }\n\n if (domainParts.length < patternParts.length) {\n // domain has too few segments and thus cannot match\n return false\n }\n\n // Prevent wildcards from matching entire domains (e.g. '**' or '*.com')\n // This ensures wildcards can only match subdomains, not the main domain\n if (\n patternParts.length === 1 &&\n (patternParts[0] === '*' || patternParts[0] === '**')\n ) {\n return false\n }\n\n while (patternParts.length) {\n const patternPart = patternParts.pop()\n const domainPart = domainParts.pop()\n\n switch (patternPart) {\n case '': {\n // invalid pattern. pattern segments must be non empty\n return false\n }\n case '*': {\n // wildcard matches anything so we continue if the domain part is non-empty\n if (domainPart) {\n continue\n } else {\n return false\n }\n }\n case '**': {\n // if this is not the last item in the pattern the pattern is invalid\n if (patternParts.length > 0) {\n return false\n }\n // recursive wildcard matches anything so we terminate here if the domain part is non empty\n return domainPart !== undefined\n }\n case undefined:\n default: {\n if (domainPart !== patternPart) {\n return false\n }\n }\n }\n }\n\n // We exhausted the pattern. If we also exhausted the domain we have a match\n return domainParts.length === 0\n}\n\nexport const isCsrfOriginAllowed = (\n originDomain: string,\n allowedOrigins: string[] = []\n): boolean => {\n return allowedOrigins.some(\n (allowedOrigin) =>\n allowedOrigin &&\n (allowedOrigin === originDomain ||\n matchWildcardDomain(originDomain, allowedOrigin))\n )\n}\n","'use client'\n\nimport React, { useContext } from 'react'\n\nexport type ServerInsertedHTMLHook = (callbacks: () => React.ReactNode) => void\n\n// Use `React.createContext` to avoid errors from the RSC checks because\n// it can't be imported directly in Server Components:\n//\n// import { createContext } from 'react'\n//\n// More info: https://github.com/vercel/next.js/pull/40686\nexport const ServerInsertedHTMLContext =\n React.createContext<ServerInsertedHTMLHook | null>(null as any)\n\nexport function useServerInsertedHTML(callback: () => React.ReactNode): void {\n const addInsertedServerHTMLCallback = useContext(ServerInsertedHTMLContext)\n // Should have no effects on client where there's no flush effects provider\n if (addInsertedServerHTMLCallback) {\n addInsertedServerHTMLCallback(callback)\n }\n}\n","/* eslint-disable @next/internal/no-ambiguous-jsx -- whole module is used in React Client */\n// Provider for the `useServerInsertedHTML` API to register callbacks to insert\n// elements into the HTML stream.\n\nimport type { JSX, ReactNode } from 'react'\nimport * as ReactClient from 'react'\nimport { ServerInsertedHTMLContext } from '../../shared/lib/server-inserted-html.shared-runtime'\n\nexport function createServerInsertedHTML() {\n const serverInsertedHTMLCallbacks: (() => ReactNode)[] = []\n const addInsertedHtml = (handler: () => ReactNode) => {\n serverInsertedHTMLCallbacks.push(handler)\n }\n\n return {\n ServerInsertedHTMLProvider({ children }: { children: JSX.Element }) {\n return (\n <ServerInsertedHTMLContext.Provider value={addInsertedHtml}>\n {children}\n </ServerInsertedHTMLContext.Provider>\n )\n },\n renderServerInsertedHTML() {\n return serverInsertedHTMLCallbacks.map((callback, index) => (\n <ReactClient.Fragment key={'__next_server_inserted__' + index}>\n {callback()}\n </ReactClient.Fragment>\n ))\n },\n }\n}\n","export function encodeURIPath(file: string) {\n return file\n .split('/')\n .map((p) => encodeURIComponent(p))\n .join('/')\n}\n","import { encodeURIPath } from '../../shared/lib/encode-uri-path'\nimport type { BuildManifest } from '../get-page-files'\n\nimport ReactDOM from 'react-dom'\n\nexport function getRequiredScripts(\n buildManifest: BuildManifest,\n assetPrefix: string,\n crossOrigin: undefined | '' | 'anonymous' | 'use-credentials',\n SRIManifest: undefined | Record<string, string>,\n qs: string,\n nonce: string | undefined,\n pagePath: string\n): [\n () => void,\n { src: string; integrity?: string; crossOrigin?: string | undefined },\n] {\n let preinitScripts: () => void\n let preinitScriptCommands: string[] = []\n const bootstrapScript: {\n src: string\n integrity?: string\n crossOrigin?: string | undefined\n } = {\n src: '',\n crossOrigin,\n }\n\n const files = (\n buildManifest.rootMainFilesTree?.[pagePath] || buildManifest.rootMainFiles\n ).map(encodeURIPath)\n if (files.length === 0) {\n throw new Error(\n 'Invariant: missing bootstrap script. This is a bug in Next.js'\n )\n }\n if (SRIManifest) {\n bootstrapScript.src = `${assetPrefix}/_next/` + files[0] + qs\n bootstrapScript.integrity = SRIManifest[files[0]]\n\n for (let i = 1; i < files.length; i++) {\n const src = `${assetPrefix}/_next/` + files[i] + qs\n const integrity = SRIManifest[files[i]]\n preinitScriptCommands.push(src, integrity)\n }\n preinitScripts = () => {\n // preinitScriptCommands is a double indexed array of src/integrity pairs\n for (let i = 0; i < preinitScriptCommands.length; i += 2) {\n ReactDOM.preinit(preinitScriptCommands[i], {\n as: 'script',\n integrity: preinitScriptCommands[i + 1],\n crossOrigin,\n nonce,\n })\n }\n }\n } else {\n bootstrapScript.src = `${assetPrefix}/_next/` + files[0] + qs\n\n for (let i = 1; i < files.length; i++) {\n const src = `${assetPrefix}/_next/` + files[i] + qs\n preinitScriptCommands.push(src)\n }\n preinitScripts = () => {\n // preinitScriptCommands is a singled indexed array of src values\n for (let i = 0; i < preinitScriptCommands.length; i++) {\n ReactDOM.preinit(preinitScriptCommands[i], {\n as: 'script',\n nonce,\n crossOrigin,\n })\n }\n }\n }\n\n return [preinitScripts, bootstrapScript]\n}\n","/* eslint-disable @next/internal/no-ambiguous-jsx -- whole module is used in React Client */\nimport React, { type JSX } from 'react'\nimport { isHTTPAccessFallbackError } from '../../client/components/http-access-fallback/http-access-fallback'\nimport {\n getURLFromRedirectError,\n getRedirectStatusCodeFromError,\n} from '../../client/components/redirect'\nimport { isRedirectError } from '../../client/components/redirect-error'\nimport { renderToReadableStream } from 'react-dom/server'\nimport { streamToString } from '../stream-utils/node-web-streams-helper'\nimport { RedirectStatusCode } from '../../client/components/redirect-status-code'\nimport { addPathPrefix } from '../../shared/lib/router/utils/add-path-prefix'\nimport type { ClientTraceDataEntry } from '../lib/trace/tracer'\n\nexport function makeGetServerInsertedHTML({\n polyfills,\n renderServerInsertedHTML,\n serverCapturedErrors,\n tracingMetadata,\n basePath,\n}: {\n polyfills: JSX.IntrinsicElements['script'][]\n renderServerInsertedHTML: () => React.ReactNode\n tracingMetadata: ClientTraceDataEntry[] | undefined\n serverCapturedErrors: Array<unknown>\n basePath: string\n}) {\n let flushedErrorMetaTagsUntilIndex = 0\n // flag for static content that only needs to be flushed once\n let hasFlushedInitially = false\n\n const polyfillTags = polyfills.map((polyfill) => {\n return <script key={polyfill.src} {...polyfill} />\n })\n\n return async function getServerInsertedHTML() {\n // Loop through all the errors that have been captured but not yet\n // flushed.\n const errorMetaTags = []\n while (flushedErrorMetaTagsUntilIndex < serverCapturedErrors.length) {\n const error = serverCapturedErrors[flushedErrorMetaTagsUntilIndex]\n flushedErrorMetaTagsUntilIndex++\n\n if (isHTTPAccessFallbackError(error)) {\n errorMetaTags.push(\n <meta name=\"robots\" content=\"noindex\" key={error.digest} />,\n process.env.NODE_ENV === 'development' ? (\n <meta name=\"next-error\" content=\"not-found\" key=\"next-error\" />\n ) : null\n )\n } else if (isRedirectError(error)) {\n const redirectUrl = addPathPrefix(\n getURLFromRedirectError(error),\n basePath\n )\n const statusCode = getRedirectStatusCodeFromError(error)\n const isPermanent =\n statusCode === RedirectStatusCode.PermanentRedirect ? true : false\n if (redirectUrl) {\n errorMetaTags.push(\n <meta\n id=\"__next-page-redirect\"\n httpEquiv=\"refresh\"\n content={`${isPermanent ? 0 : 1};url=${redirectUrl}`}\n key={error.digest}\n />\n )\n }\n }\n }\n\n const traceMetaTags = (tracingMetadata || []).map(\n ({ key, value }, index) => (\n <meta key={`next-trace-data-${index}`} name={key} content={value} />\n )\n )\n\n const serverInsertedHTML = renderServerInsertedHTML()\n\n // Skip React rendering if we know the content is empty.\n if (\n polyfillTags.length === 0 &&\n traceMetaTags.length === 0 &&\n errorMetaTags.length === 0 &&\n Array.isArray(serverInsertedHTML) &&\n serverInsertedHTML.length === 0\n ) {\n return ''\n }\n\n const stream = await renderToReadableStream(\n <>\n {\n /* Insert the polyfills if they haven't been flushed yet. */\n hasFlushedInitially ? null : polyfillTags\n }\n {serverInsertedHTML}\n {hasFlushedInitially ? null : traceMetaTags}\n {errorMetaTags}\n </>,\n {\n // Larger chunk because this isn't sent over the network.\n // Let's set it to 1MB.\n progressiveChunkSize: 1024 * 1024,\n }\n )\n\n hasFlushedInitially = true\n\n // There's no need to wait for the stream to be ready\n // e.g. calling `await stream.allReady` because `streamToString` will\n // wait and decode the stream progressively with better parallelism.\n return streamToString(stream)\n }\n}\n","import type {\n ClientReferenceManifest,\n CssResource,\n} from '../../build/webpack/plugins/flight-manifest-plugin'\nimport type { DeepReadonly } from '../../shared/lib/deep-readonly'\n\n/**\n * Get external stylesheet link hrefs based on server CSS manifest.\n */\nexport function getLinkAndScriptTags(\n clientReferenceManifest: DeepReadonly<ClientReferenceManifest>,\n filePath: string,\n injectedCSS: Set<string>,\n injectedScripts: Set<string>,\n collectNewImports?: boolean\n): { styles: CssResource[]; scripts: string[] } {\n const filePathWithoutExt = filePath.replace(/\\.[^.]+$/, '')\n const cssChunks = new Set<CssResource>()\n const jsChunks = new Set<string>()\n\n const entryCSSFiles =\n clientReferenceManifest.entryCSSFiles[filePathWithoutExt]\n const entryJSFiles =\n clientReferenceManifest.entryJSFiles?.[filePathWithoutExt] ?? []\n\n if (entryCSSFiles) {\n for (const css of entryCSSFiles) {\n if (!injectedCSS.has(css.path)) {\n if (collectNewImports) {\n injectedCSS.add(css.path)\n }\n cssChunks.add(css)\n }\n }\n }\n\n if (entryJSFiles) {\n for (const file of entryJSFiles) {\n if (!injectedScripts.has(file)) {\n if (collectNewImports) {\n injectedScripts.add(file)\n }\n jsChunks.add(file)\n }\n }\n }\n\n return { styles: [...cssChunks], scripts: [...jsChunks] }\n}\n","import type { NextFontManifest } from '../../build/webpack/plugins/next-font-manifest-plugin'\nimport type { DeepReadonly } from '../../shared/lib/deep-readonly'\n\n/**\n * Get hrefs for fonts to preload\n * Returns null if there are no fonts at all.\n * Returns string[] if there are fonts to preload (font paths)\n * Returns empty string[] if there are fonts but none to preload and no other fonts have been preloaded\n * Returns null if there are fonts but none to preload and at least some were previously preloaded\n */\nexport function getPreloadableFonts(\n nextFontManifest: DeepReadonly<NextFontManifest> | undefined,\n filePath: string | undefined,\n injectedFontPreloadTags: Set<string>\n): string[] | null {\n if (!nextFontManifest || !filePath) {\n return null\n }\n const filepathWithoutExtension = filePath.replace(/\\.[^.]+$/, '')\n const fontFiles = new Set<string>()\n let foundFontUsage = false\n\n const preloadedFontFiles = nextFontManifest.app[filepathWithoutExtension]\n if (preloadedFontFiles) {\n foundFontUsage = true\n for (const fontFile of preloadedFontFiles) {\n if (!injectedFontPreloadTags.has(fontFile)) {\n fontFiles.add(fontFile)\n injectedFontPreloadTags.add(fontFile)\n }\n }\n }\n\n if (fontFiles.size) {\n return [...fontFiles].sort()\n } else if (foundFontUsage && injectedFontPreloadTags.size === 0) {\n return []\n } else {\n return null\n }\n}\n","import type { LoaderTree } from '../lib/app-dir-module'\n\nexport function hasLoadingComponentInTree(tree: LoaderTree): boolean {\n const [, parallelRoutes, { loading }] = tree\n\n if (loading) {\n return true\n }\n\n return Object.values(parallelRoutes).some((parallelRoute) =>\n hasLoadingComponentInTree(parallelRoute)\n ) as boolean\n}\n","import {\n extractInfoFromServerReferenceId,\n type ServerReferenceInfo,\n} from '../shared/lib/server-reference-info'\n\n// Only contains the properties we're interested in.\nexport interface ServerReference {\n $$typeof: Symbol\n $$id: string\n}\n\nexport type ServerFunction = ServerReference &\n ((...args: unknown[]) => Promise<unknown>)\n\nexport function isServerReference<T>(\n value: T & Partial<ServerReference>\n): value is T & ServerFunction {\n return value.$$typeof === Symbol.for('react.server.reference')\n}\n\nexport function isUseCacheFunction<T>(\n value: T & Partial<ServerReference>\n): value is T & ServerFunction {\n if (!isServerReference(value)) {\n return false\n }\n\n const { type } = extractInfoFromServerReferenceId(value.$$id)\n\n return type === 'use-cache'\n}\n\nexport function getUseCacheFunctionInfo<T>(\n value: T & Partial<ServerReference>\n): ServerReferenceInfo | null {\n if (!isServerReference(value)) {\n return null\n }\n\n const info = extractInfoFromServerReferenceId(value.$$id)\n\n return info.type === 'use-cache' ? info : null\n}\n\nexport function isClientReference(mod: any): boolean {\n const defaultExport = mod?.default || mod\n return defaultExport?.$$typeof === Symbol.for('react.client.reference')\n}\n","export interface ServerReferenceInfo {\n type: 'server-action' | 'use-cache'\n usedArgs: [boolean, boolean, boolean, boolean, boolean, boolean]\n hasRestArgs: boolean\n}\n\n/**\n * Extracts info about the server reference for the given server reference ID by\n * parsing the first byte of the hex-encoded ID.\n *\n * ```\n * Bit positions: [7] [6] [5] [4] [3] [2] [1] [0]\n * Bits: typeBit argMask restArgs\n * ```\n *\n * If the `typeBit` is `1` the server reference represents a `\"use cache\"`\n * function, otherwise a server action.\n *\n * The `argMask` encodes whether the function uses the argument at the\n * respective position.\n *\n * The `restArgs` bit indicates whether the function uses a rest parameter. It's\n * also set to 1 if the function has more than 6 args.\n *\n * @param id hex-encoded server reference ID\n */\nexport function extractInfoFromServerReferenceId(\n id: string\n): ServerReferenceInfo {\n const infoByte = parseInt(id.slice(0, 2), 16)\n const typeBit = (infoByte >> 7) & 0x1\n const argMask = (infoByte >> 1) & 0x3f\n const restArgs = infoByte & 0x1\n const usedArgs = Array(6)\n\n for (let index = 0; index < 6; index++) {\n const bitPosition = 5 - index\n const bit = (argMask >> bitPosition) & 0x1\n usedArgs[index] = bit === 1\n }\n\n return {\n type: typeBit === 1 ? 'use-cache' : 'server-action',\n usedArgs: usedArgs as [\n boolean,\n boolean,\n boolean,\n boolean,\n boolean,\n boolean,\n ],\n hasRestArgs: restArgs === 1,\n }\n}\n\n/**\n * Creates a sparse array containing only the used arguments based on the\n * provided action info.\n */\nexport function omitUnusedArgs(\n args: unknown[],\n info: ServerReferenceInfo\n): unknown[] {\n const filteredArgs = new Array(args.length)\n\n for (let index = 0; index < args.length; index++) {\n if (\n (index < 6 && info.usedArgs[index]) ||\n // This assumes that the server reference info byte has the restArgs bit\n // set to 1 if there are more than 6 args.\n (index >= 6 && info.hasRestArgs)\n ) {\n filteredArgs[index] = args[index]\n }\n }\n\n return filteredArgs\n}\n","import type { AppDirModules } from '../../build/webpack/loaders/next-app-loader'\nimport { DEFAULT_SEGMENT_KEY } from '../../shared/lib/segment'\n\n/**\n * LoaderTree is generated in next-app-loader.\n */\nexport type LoaderTree = [\n segment: string,\n parallelRoutes: { [parallelRouterKey: string]: LoaderTree },\n modules: AppDirModules,\n]\n\nexport async function getLayoutOrPageModule(loaderTree: LoaderTree) {\n const { layout, page, defaultPage } = loaderTree[2]\n const isLayout = typeof layout !== 'undefined'\n const isPage = typeof page !== 'undefined'\n const isDefaultPage =\n typeof defaultPage !== 'undefined' && loaderTree[0] === DEFAULT_SEGMENT_KEY\n\n let mod = undefined\n let modType: 'layout' | 'page' | undefined = undefined\n let filePath = undefined\n\n if (isLayout) {\n mod = await layout[0]()\n modType = 'layout'\n filePath = layout[1]\n } else if (isPage) {\n mod = await page[0]()\n modType = 'page'\n filePath = page[1]\n } else if (isDefaultPage) {\n mod = await defaultPage[0]()\n modType = 'page'\n filePath = defaultPage[1]\n }\n\n return { mod, modType, filePath }\n}\n\nexport async function getComponentTypeModule(\n loaderTree: LoaderTree,\n moduleType: 'layout' | 'not-found' | 'forbidden' | 'unauthorized'\n) {\n const { [moduleType]: module } = loaderTree[2]\n if (typeof module !== 'undefined') {\n return await module[0]()\n }\n return undefined\n}\n","/**\n * Interop between \"export default\" and \"module.exports\".\n */\nexport function interopDefault(mod: any) {\n return mod.default || mod\n}\n","import { DEFAULT_SEGMENT_KEY } from '../../segment'\nimport type { LoaderTree } from '../../../../server/lib/app-dir-module'\n\nexport function parseLoaderTree(tree: LoaderTree) {\n const [segment, parallelRoutes, modules] = tree\n const { layout, template } = modules\n let { page } = modules\n // a __DEFAULT__ segment means that this route didn't match any of the\n // segments in the route, so we should use the default page\n page = segment === DEFAULT_SEGMENT_KEY ? modules.defaultPage : page\n\n const conventionPath = layout?.[1] || template?.[1] || page?.[1]\n\n return {\n page,\n segment,\n modules,\n /* it can be either layout / template / page */\n conventionPath,\n parallelRoutes,\n }\n}\n","import type { AppRenderContext } from './app-render'\n\nconst isDev = process.env.NODE_ENV === 'development'\nconst isTurbopack = !!process.env.TURBOPACK\n\nexport function getAssetQueryString(\n ctx: AppRenderContext,\n addTimestamp: boolean\n) {\n let qs = ''\n\n // In development we add the request timestamp to allow react to\n // reload assets when a new RSC response is received.\n // Turbopack handles HMR of assets itself and react doesn't need to reload them\n // so this approach is not needed for Turbopack.\n const shouldAddVersion = isDev && !isTurbopack && addTimestamp\n if (shouldAddVersion) {\n qs += `?v=${ctx.requestTimestamp}`\n }\n\n if (ctx.renderOpts.deploymentId) {\n qs += `${shouldAddVersion ? '&' : '?'}dpl=${ctx.renderOpts.deploymentId}`\n }\n return qs\n}\n","import type { CssResource } from '../../build/webpack/plugins/flight-manifest-plugin'\nimport { encodeURIPath } from '../../shared/lib/encode-uri-path'\nimport type { AppRenderContext } from './app-render'\nimport { getAssetQueryString } from './get-asset-query-string'\nimport type { PreloadCallbacks } from './types'\n\n/**\n * Abstracts the rendering of CSS files based on whether they are inlined or not.\n * For inlined CSS, renders a <style> tag with the CSS content directly embedded.\n * For external CSS files, renders a <link> tag pointing to the CSS file.\n */\nexport function renderCssResource(\n entryCssFiles: CssResource[],\n ctx: AppRenderContext,\n preloadCallbacks?: PreloadCallbacks\n) {\n const {\n componentMod: { createElement },\n } = ctx\n return entryCssFiles.map((entryCssFile, index) => {\n // `Precedence` is an opt-in signal for React to handle resource\n // loading and deduplication, etc. It's also used as the key to sort\n // resources so they will be injected in the correct order.\n // During HMR, it's critical to use different `precedence` values\n // for different stylesheets, so their order will be kept.\n // https://github.com/facebook/react/pull/25060\n const precedence =\n process.env.NODE_ENV === 'development'\n ? 'next_' + entryCssFile.path\n : 'next'\n\n // In dev, Safari and Firefox will cache the resource during HMR:\n // - https://github.com/vercel/next.js/issues/5860\n // - https://bugs.webkit.org/show_bug.cgi?id=187726\n // Because of this, we add a `?v=` query to bypass the cache during\n // development. We need to also make sure that the number is always\n // increasing.\n const fullHref = `${ctx.assetPrefix}/_next/${encodeURIPath(\n entryCssFile.path\n )}${getAssetQueryString(ctx, true)}`\n\n if (entryCssFile.inlined && !ctx.parsedRequestHeaders.isRSCRequest) {\n return createElement(\n 'style',\n {\n key: index,\n nonce: ctx.nonce,\n precedence: precedence,\n href: fullHref,\n },\n entryCssFile.content\n )\n }\n\n preloadCallbacks?.push(() => {\n ctx.componentMod.preloadStyle(\n fullHref,\n ctx.renderOpts.crossOrigin,\n ctx.nonce\n )\n })\n\n return createElement('link', {\n key: index,\n rel: 'stylesheet',\n href: fullHref,\n precedence: precedence,\n crossOrigin: ctx.renderOpts.crossOrigin,\n nonce: ctx.nonce,\n })\n })\n}\n","import { interopDefault } from './interop-default'\nimport { getLinkAndScriptTags } from './get-css-inlined-link-tags'\nimport type { AppRenderContext } from './app-render'\nimport { getAssetQueryString } from './get-asset-query-string'\nimport { encodeURIPath } from '../../shared/lib/encode-uri-path'\nimport { renderCssResource } from './render-css-resource'\n\nexport async function createComponentStylesAndScripts({\n filePath,\n getComponent,\n injectedCSS,\n injectedJS,\n ctx,\n}: {\n filePath: string\n getComponent: () => any\n injectedCSS: Set<string>\n injectedJS: Set<string>\n ctx: AppRenderContext\n}): Promise<[React.ComponentType<any>, React.ReactNode, React.ReactNode]> {\n const {\n componentMod: { createElement },\n } = ctx\n const { styles: entryCssFiles, scripts: jsHrefs } = getLinkAndScriptTags(\n ctx.clientReferenceManifest,\n filePath,\n injectedCSS,\n injectedJS\n )\n\n const styles = renderCssResource(entryCssFiles, ctx)\n\n const scripts = jsHrefs\n ? jsHrefs.map((href, index) =>\n createElement('script', {\n src: `${ctx.assetPrefix}/_next/${encodeURIPath(href)}${getAssetQueryString(ctx, true)}`,\n async: true,\n key: `script-${index}`,\n })\n )\n : null\n\n const Comp = interopDefault(await getComponent())\n\n return [Comp, styles, scripts]\n}\n","const noop = () => {}\n\nlet registry: FinalizationRegistry<WeakRef<ReadableStream>> | undefined\n\nif (globalThis.FinalizationRegistry) {\n registry = new FinalizationRegistry((weakRef: WeakRef<ReadableStream>) => {\n const stream = weakRef.deref()\n if (stream && !stream.locked) {\n stream.cancel('Response object has been garbage collected').then(noop)\n }\n })\n}\n\n/**\n * Clones a response by teeing the body so we can return two independent\n * ReadableStreams from it. This avoids the bug in the undici library around\n * response cloning.\n *\n * After cloning, the original response's body will be consumed and closed.\n *\n * @see https://github.com/vercel/next.js/pull/73274\n *\n * @param original - The original response to clone.\n * @returns A tuple containing two independent clones of the original response.\n */\nexport function cloneResponse(original: Response): [Response, Response] {\n // If the response has no body, then we can just return the original response\n // twice because it's immutable.\n if (!original.body) {\n return [original, original]\n }\n\n const [body1, body2] = original.body.tee()\n\n const cloned1 = new Response(body1, {\n status: original.status,\n statusText: original.statusText,\n headers: original.headers,\n })\n\n Object.defineProperty(cloned1, 'url', {\n value: original.url,\n // How the original response.url behaves\n configurable: true,\n enumerable: true,\n writable: false,\n })\n\n // The Fetch Standard allows users to skip consuming the response body by\n // relying on garbage collection to release connection resources.\n // https://github.com/nodejs/undici?tab=readme-ov-file#garbage-collection\n //\n // To cancel the stream you then need to cancel both resulting branches.\n // Teeing a stream will generally lock it for the duration, preventing other\n // readers from locking it.\n // https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/tee\n\n // cloned2 is stored in a react cache and cloned for subsequent requests.\n // It is the original request, and is is garbage collected by a\n // FinalizationRegistry in Undici, but since we're tee-ing the stream\n // ourselves, we need to cancel clone1's stream (the response returned from\n // our dedupe fetch) when clone1 is reclaimed, otherwise we leak memory.\n if (registry && cloned1.body) {\n registry.register(cloned1, new WeakRef(cloned1.body))\n }\n\n const cloned2 = new Response(body2, {\n status: original.status,\n statusText: original.statusText,\n headers: original.headers,\n })\n\n Object.defineProperty(cloned2, 'url', {\n value: original.url,\n // How the original response.url behaves\n configurable: true,\n enumerable: true,\n writable: false,\n })\n\n return [cloned1, cloned2]\n}\n","import type { SchedulerFn } from './scheduler'\n\nimport { DetachedPromise } from './detached-promise'\n\ntype CacheKeyFn<K, C extends string | number | null> = (\n key: K\n) => PromiseLike<C> | C\n\ntype BatcherOptions<K, C extends string | number | null> = {\n cacheKeyFn?: CacheKeyFn<K, C>\n schedulerFn?: SchedulerFn<void>\n}\n\ntype WorkFnContext<V, K> = {\n resolve: (value: V | PromiseLike<V>) => void\n key: K\n}\n\ntype WorkFn<V, K> = (context: WorkFnContext<V, K>) => Promise<V>\n\n/**\n * A wrapper for a function that will only allow one call to the function to\n * execute at a time.\n */\nexport class Batcher<K, V, C extends string | number | null> {\n private readonly pending = new Map<C, Promise<V>>()\n\n protected constructor(\n private readonly cacheKeyFn?: CacheKeyFn<K, C>,\n /**\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 */\n private readonly schedulerFn: SchedulerFn<void> = (fn) => fn()\n ) {}\n\n /**\n * Creates a new instance of PendingWrapper. If the key extends a string or\n * number, the key will be used as the cache key. If the key is an object, a\n * cache key function must be provided.\n */\n public static create<K extends string | number | null, V>(\n options?: BatcherOptions<K, K>\n ): Batcher<K, V, K>\n public static create<K, V, C extends string | number | null>(\n options: BatcherOptions<K, C> &\n Required<Pick<BatcherOptions<K, C>, 'cacheKeyFn'>>\n ): Batcher<K, V, C>\n public static create<K, V, C extends string | number | null>(\n options?: BatcherOptions<K, C>\n ): Batcher<K, V, C> {\n return new Batcher<K, V, C>(options?.cacheKeyFn, options?.schedulerFn)\n }\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 */\n public async batch(key: K, fn: WorkFn<V, K>): Promise<V> {\n const cacheKey = (this.cacheKeyFn ? await this.cacheKeyFn(key) : key) as C\n if (cacheKey === null) {\n return fn({ resolve: (value) => Promise.resolve(value), key })\n }\n\n const pending = this.pending.get(cacheKey)\n if (pending) return pending\n\n const { promise, resolve, reject } = new DetachedPromise<V>()\n this.pending.set(cacheKey, promise)\n\n this.schedulerFn(async () => {\n try {\n const result = await fn({ resolve, key })\n\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\n return promise\n }\n}\n","import type { OutgoingHttpHeaders } from 'http'\nimport type RenderResult from '../render-result'\nimport type { CacheControl, Revalidate } from '../lib/cache-control'\nimport type { RouteKind } from '../route-kind'\n\nexport interface ResponseCacheBase {\n get(\n key: string | null,\n responseGenerator: ResponseGenerator,\n context: {\n isOnDemandRevalidate?: boolean\n isPrefetch?: boolean\n incrementalCache: IncrementalCache\n /**\n * This is a hint to the cache to help it determine what kind of route\n * this is so it knows where to look up the cache entry from. If not\n * provided it will test the filesystem to check.\n */\n routeKind: RouteKind\n\n /**\n * True if this is a fallback request.\n */\n isFallback?: boolean\n\n /**\n * True if the route is enabled for PPR.\n */\n isRoutePPREnabled?: boolean\n }\n ): Promise<ResponseCacheEntry | null>\n}\n\n// The server components HMR cache might store other data as well in the future,\n// at which point this should be refactored to a discriminated union type.\nexport interface ServerComponentsHmrCache {\n get(key: string): CachedFetchData | undefined\n set(key: string, data: CachedFetchData): void\n}\n\nexport type CachedFetchData = {\n headers: Record<string, string>\n body: string\n url: string\n status?: number\n}\n\nexport const enum CachedRouteKind {\n APP_PAGE = 'APP_PAGE',\n APP_ROUTE = 'APP_ROUTE',\n PAGES = 'PAGES',\n FETCH = 'FETCH',\n REDIRECT = 'REDIRECT',\n IMAGE = 'IMAGE',\n}\n\nexport interface CachedFetchValue {\n kind: CachedRouteKind.FETCH\n data: CachedFetchData\n // tags are only present with file-system-cache\n // fetch cache stores tags outside of cache entry\n tags?: string[]\n revalidate: number\n}\n\nexport interface CachedRedirectValue {\n kind: CachedRouteKind.REDIRECT\n props: Object\n}\n\nexport interface CachedAppPageValue {\n kind: CachedRouteKind.APP_PAGE\n // this needs to be a RenderResult so since renderResponse\n // expects that type instead of a string\n html: RenderResult\n rscData: Buffer | undefined\n status: number | undefined\n postponed: string | undefined\n headers: OutgoingHttpHeaders | undefined\n segmentData: Map<string, Buffer> | undefined\n}\n\nexport interface CachedPageValue {\n kind: CachedRouteKind.PAGES\n // this needs to be a RenderResult so since renderResponse\n // expects that type instead of a string\n html: RenderResult\n pageData: Object\n status: number | undefined\n headers: OutgoingHttpHeaders | undefined\n}\n\nexport interface CachedRouteValue {\n kind: CachedRouteKind.APP_ROUTE\n // this needs to be a RenderResult so since renderResponse\n // expects that type instead of a string\n body: Buffer\n status: number\n headers: OutgoingHttpHeaders\n}\n\nexport interface CachedImageValue {\n kind: CachedRouteKind.IMAGE\n etag: string\n upstreamEtag: string\n buffer: Buffer\n extension: string\n isMiss?: boolean\n isStale?: boolean\n}\n\nexport interface IncrementalCachedAppPageValue {\n kind: CachedRouteKind.APP_PAGE\n // this needs to be a string since the cache expects to store\n // the string value\n html: string\n rscData: Buffer | undefined\n headers: OutgoingHttpHeaders | undefined\n postponed: string | undefined\n status: number | undefined\n segmentData: Map<string, Buffer> | undefined\n}\n\nexport interface IncrementalCachedPageValue {\n kind: CachedRouteKind.PAGES\n // this needs to be a string since the cache expects to store\n // the string value\n html: string\n pageData: Object\n headers: OutgoingHttpHeaders | undefined\n status: number | undefined\n}\n\nexport interface IncrementalResponseCacheEntry {\n cacheControl?: CacheControl\n /**\n * timestamp in milliseconds to revalidate after\n */\n revalidateAfter?: Revalidate\n /**\n * `-1` here dictates a blocking revalidate should be used\n */\n isStale?: boolean | -1\n isMiss?: boolean\n value: Exclude<IncrementalCacheValue, CachedFetchValue> | null\n}\n\nexport interface IncrementalFetchCacheEntry {\n /**\n * `-1` here dictates a blocking revalidate should be used\n */\n isStale?: boolean | -1\n value: CachedFetchValue\n}\n\nexport type IncrementalCacheEntry =\n | IncrementalResponseCacheEntry\n | IncrementalFetchCacheEntry\n\nexport type IncrementalCacheValue =\n | CachedRedirectValue\n | IncrementalCachedPageValue\n | IncrementalCachedAppPageValue\n | CachedImageValue\n | CachedFetchValue\n | CachedRouteValue\n\nexport type ResponseCacheValue =\n | CachedRedirectValue\n | CachedPageValue\n | CachedAppPageValue\n | CachedImageValue\n | CachedRouteValue\n\nexport type ResponseCacheEntry = {\n cacheControl?: CacheControl\n value: ResponseCacheValue | null\n isStale?: boolean | -1\n isMiss?: boolean\n}\n\n/**\n * @param hasResolved whether the responseGenerator has resolved it's promise\n * @param previousCacheEntry the previous cache entry if it exists or the current\n */\nexport type ResponseGenerator = (state: {\n hasResolved: boolean\n previousCacheEntry?: IncrementalResponseCacheEntry | null\n isRevalidating?: boolean\n span?: any\n\n /**\n * When true, this indicates that the response generator is being called in a\n * context where the response must be generated statically.\n *\n * CRITICAL: This should only currently be used when revalidating due to a\n * dynamic RSC request.\n */\n forceStaticRender?: boolean\n}) => Promise<ResponseCacheEntry | null>\n\nexport const enum IncrementalCacheKind {\n APP_PAGE = 'APP_PAGE',\n APP_ROUTE = 'APP_ROUTE',\n PAGES = 'PAGES',\n FETCH = 'FETCH',\n IMAGE = 'IMAGE',\n}\n\nexport interface GetIncrementalFetchCacheContext {\n kind: IncrementalCacheKind.FETCH\n revalidate?: Revalidate\n fetchUrl?: string\n fetchIdx?: number\n tags?: string[]\n softTags?: string[]\n}\n\nexport interface GetIncrementalResponseCacheContext {\n kind: Exclude<IncrementalCacheKind, IncrementalCacheKind.FETCH>\n\n /**\n * True if the route is enabled for PPR.\n */\n isRoutePPREnabled?: boolean\n\n /**\n * True if this is a fallback request.\n */\n isFallback: boolean\n}\n\nexport interface SetIncrementalFetchCacheContext {\n fetchCache: true\n fetchUrl?: string\n fetchIdx?: number\n tags?: string[]\n isImplicitBuildTimeCache?: boolean\n}\n\nexport interface SetIncrementalResponseCacheContext {\n fetchCache?: false\n cacheControl?: CacheControl\n\n /**\n * True if the route is enabled for PPR.\n */\n isRoutePPREnabled?: boolean\n\n /**\n * True if this is a fallback request.\n */\n isFallback?: boolean\n}\n\nexport interface IncrementalResponseCache {\n get(\n cacheKey: string,\n ctx: GetIncrementalResponseCacheContext\n ): Promise<IncrementalResponseCacheEntry | null>\n set(\n key: string,\n data: Exclude<IncrementalCacheValue, CachedFetchValue> | null,\n ctx: SetIncrementalResponseCacheContext\n ): Promise<void>\n}\n\nexport interface IncrementalCache extends IncrementalResponseCache {\n get(\n cacheKey: string,\n ctx: GetIncrementalFetchCacheContext\n ): Promise<IncrementalFetchCacheEntry | null>\n get(\n cacheKey: string,\n ctx: GetIncrementalResponseCacheContext\n ): Promise<IncrementalResponseCacheEntry | null>\n set(\n key: string,\n data: CachedFetchValue | null,\n ctx: SetIncrementalFetchCacheContext\n ): Promise<void>\n set(\n key: string,\n data: Exclude<IncrementalCacheValue, CachedFetchValue> | null,\n ctx: SetIncrementalResponseCacheContext\n ): Promise<void>\n revalidateTag(\n tags: string | string[],\n durations?: { expire?: number }\n ): Promise<void>\n}\n","export const enum RouteKind {\n /**\n * `PAGES` represents all the React pages that are under `pages/`.\n */\n PAGES = 'PAGES',\n /**\n * `PAGES_API` represents all the API routes under `pages/api/`.\n */\n 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 */\n 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 */\n APP_ROUTE = 'APP_ROUTE',\n\n /**\n * `IMAGE` represents all the images that are generated by `next/image`.\n */\n IMAGE = 'IMAGE',\n}\n","import {\n CachedRouteKind,\n IncrementalCacheKind,\n type CachedAppPageValue,\n type CachedPageValue,\n type IncrementalResponseCacheEntry,\n type ResponseCacheEntry,\n} from './types'\n\nimport RenderResult from '../render-result'\nimport { RouteKind } from '../route-kind'\nimport { HTML_CONTENT_TYPE_HEADER } from '../../lib/constants'\n\nexport async function fromResponseCacheEntry(\n cacheEntry: ResponseCacheEntry\n): Promise<IncrementalResponseCacheEntry> {\n return {\n ...cacheEntry,\n value:\n cacheEntry.value?.kind === CachedRouteKind.PAGES\n ? {\n kind: CachedRouteKind.PAGES,\n html: await cacheEntry.value.html.toUnchunkedString(true),\n pageData: cacheEntry.value.pageData,\n headers: cacheEntry.value.headers,\n status: cacheEntry.value.status,\n }\n : cacheEntry.value?.kind === CachedRouteKind.APP_PAGE\n ? {\n kind: CachedRouteKind.APP_PAGE,\n html: await cacheEntry.value.html.toUnchunkedString(true),\n postponed: cacheEntry.value.postponed,\n rscData: cacheEntry.value.rscData,\n headers: cacheEntry.value.headers,\n status: cacheEntry.value.status,\n segmentData: cacheEntry.value.segmentData,\n }\n : cacheEntry.value,\n }\n}\n\nexport async function toResponseCacheEntry(\n response: IncrementalResponseCacheEntry | null\n): Promise<ResponseCacheEntry | null> {\n if (!response) return null\n\n return {\n isMiss: response.isMiss,\n isStale: response.isStale,\n cacheControl: response.cacheControl,\n value:\n response.value?.kind === CachedRouteKind.PAGES\n ? ({\n kind: CachedRouteKind.PAGES,\n html: RenderResult.fromStatic(\n response.value.html,\n HTML_CONTENT_TYPE_HEADER\n ),\n pageData: response.value.pageData,\n headers: response.value.headers,\n status: response.value.status,\n } satisfies CachedPageValue)\n : response.value?.kind === CachedRouteKind.APP_PAGE\n ? ({\n kind: CachedRouteKind.APP_PAGE,\n html: RenderResult.fromStatic(\n response.value.html,\n HTML_CONTENT_TYPE_HEADER\n ),\n rscData: response.value.rscData,\n headers: response.value.headers,\n status: response.value.status,\n postponed: response.value.postponed,\n segmentData: response.value.segmentData,\n } satisfies CachedAppPageValue)\n : response.value,\n }\n}\n\nexport function routeKindToIncrementalCacheKind(\n routeKind: RouteKind\n): Exclude<IncrementalCacheKind, IncrementalCacheKind.FETCH> {\n switch (routeKind) {\n case RouteKind.PAGES:\n return IncrementalCacheKind.PAGES\n case RouteKind.APP_PAGE:\n return IncrementalCacheKind.APP_PAGE\n case RouteKind.IMAGE:\n return IncrementalCacheKind.IMAGE\n case RouteKind.APP_ROUTE:\n return IncrementalCacheKind.APP_ROUTE\n case RouteKind.PAGES_API:\n // Pages Router API routes are not cached in the incremental cache.\n throw new Error(`Unexpected route kind ${routeKind}`)\n default:\n return routeKind satisfies never\n }\n}\n","import type {\n ResponseCacheEntry,\n ResponseGenerator,\n ResponseCacheBase,\n IncrementalResponseCacheEntry,\n IncrementalResponseCache,\n} from './types'\n\nimport { Batcher } from '../../lib/batcher'\nimport { scheduleOnNextTick } from '../../lib/scheduler'\nimport {\n fromResponseCacheEntry,\n routeKindToIncrementalCacheKind,\n toResponseCacheEntry,\n} from './utils'\nimport type { RouteKind } from '../route-kind'\n\nexport * from './types'\n\nexport default class ResponseCache implements ResponseCacheBase {\n private readonly getBatcher = Batcher.create<\n { key: string; isOnDemandRevalidate: boolean },\n IncrementalResponseCacheEntry | null,\n string\n >({\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 }) =>\n `${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\n private readonly revalidateBatcher = Batcher.create<\n string,\n IncrementalResponseCacheEntry | null\n >({\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\n private previousCacheItem?: {\n key: string\n entry: IncrementalResponseCacheEntry | null\n expiresAt: number\n }\n\n // we don't use minimal_mode name here as this.minimal_mode is\n // statically replace for server runtimes but we need it to\n // be dynamic here\n private minimal_mode?: boolean\n\n constructor(minimal_mode: boolean) {\n this.minimal_mode = minimal_mode\n }\n\n /**\n * Gets the response cache entry for the given key.\n *\n * @param key - The key to get the response cache entry for.\n * @param responseGenerator - The response generator to use to generate the response cache entry.\n * @param context - The context for the get request.\n * @returns The response cache entry.\n */\n public async get(\n key: string | null,\n responseGenerator: ResponseGenerator,\n context: {\n routeKind: RouteKind\n isOnDemandRevalidate?: boolean\n isPrefetch?: boolean\n incrementalCache: IncrementalResponseCache\n isRoutePPREnabled?: boolean\n isFallback?: boolean\n waitUntil?: (prom: Promise<any>) => void\n }\n ): Promise<ResponseCacheEntry | null> {\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) {\n return responseGenerator({\n hasResolved: false,\n previousCacheEntry: null,\n })\n }\n\n // Check minimal mode cache before doing any other work\n if (\n this.minimal_mode &&\n this.previousCacheItem?.key === key &&\n this.previousCacheItem.expiresAt > Date.now()\n ) {\n return toResponseCacheEntry(this.previousCacheItem.entry)\n }\n\n const {\n incrementalCache,\n isOnDemandRevalidate = false,\n isFallback = false,\n isRoutePPREnabled = false,\n isPrefetch = false,\n waitUntil,\n routeKind,\n } = context\n\n const response = await this.getBatcher.batch(\n { key, isOnDemandRevalidate },\n ({ resolve }) => {\n const promise = this.handleGet(\n key,\n responseGenerator,\n {\n incrementalCache,\n isOnDemandRevalidate,\n isFallback,\n isRoutePPREnabled,\n isPrefetch,\n routeKind,\n },\n resolve\n )\n\n // We need to ensure background revalidates are passed to waitUntil.\n if (waitUntil) waitUntil(promise)\n\n return promise\n }\n )\n\n return toResponseCacheEntry(response)\n }\n\n /**\n * Handles the get request for the response cache.\n *\n * @param key - The key to get the response cache entry for.\n * @param responseGenerator - The response generator to use to generate the response cache entry.\n * @param context - The context for the get request.\n * @param resolve - The resolve function to use to resolve the response cache entry.\n * @returns The response cache entry.\n */\n private async handleGet(\n key: string,\n responseGenerator: ResponseGenerator,\n context: {\n incrementalCache: IncrementalResponseCache\n isOnDemandRevalidate: boolean\n isFallback: boolean\n isRoutePPREnabled: boolean\n isPrefetch: boolean\n routeKind: RouteKind\n },\n resolve: (value: IncrementalResponseCacheEntry | null) => void\n ): Promise<IncrementalResponseCacheEntry | null> {\n let previousIncrementalCacheEntry: IncrementalResponseCacheEntry | null =\n null\n let resolved = false\n\n try {\n // Get the previous cache entry if not in minimal mode\n previousIncrementalCacheEntry = !this.minimal_mode\n ? await context.incrementalCache.get(key, {\n kind: routeKindToIncrementalCacheKind(context.routeKind),\n isRoutePPREnabled: context.isRoutePPREnabled,\n isFallback: context.isFallback,\n })\n : null\n\n if (previousIncrementalCacheEntry && !context.isOnDemandRevalidate) {\n resolve(previousIncrementalCacheEntry)\n resolved = true\n\n if (!previousIncrementalCacheEntry.isStale || context.isPrefetch) {\n // The cached value is still valid, so we don't need to update it yet.\n return previousIncrementalCacheEntry\n }\n }\n\n // Revalidate the cache entry\n const incrementalResponseCacheEntry = await this.revalidate(\n key,\n context.incrementalCache,\n context.isRoutePPREnabled,\n context.isFallback,\n responseGenerator,\n previousIncrementalCacheEntry,\n previousIncrementalCacheEntry !== null && !context.isOnDemandRevalidate\n )\n\n // Handle null response\n if (!incrementalResponseCacheEntry) {\n // Unset the previous cache item if it was set so we don't use it again.\n if (this.minimal_mode) this.previousCacheItem = undefined\n return null\n }\n\n // Resolve for on-demand revalidation or if not already resolved\n if (context.isOnDemandRevalidate && !resolved) {\n return incrementalResponseCacheEntry\n }\n\n return incrementalResponseCacheEntry\n } catch (err) {\n // If we've already resolved the cache entry, we can't reject as we\n // already resolved the cache entry so log the error here.\n if (resolved) {\n console.error(err)\n return null\n }\n\n throw err\n }\n }\n\n /**\n * Revalidates the cache entry for the given key.\n *\n * @param key - The key to revalidate the cache entry for.\n * @param incrementalCache - The incremental cache to use to revalidate the cache entry.\n * @param isRoutePPREnabled - Whether the route is PPR enabled.\n * @param isFallback - Whether the route is a fallback.\n * @param responseGenerator - The response generator to use to generate the response cache entry.\n * @param previousIncrementalCacheEntry - The previous cache entry to use to revalidate the cache entry.\n * @param hasResolved - Whether the response has been resolved.\n * @returns The revalidated cache entry.\n */\n public async revalidate(\n key: string,\n incrementalCache: IncrementalResponseCache,\n isRoutePPREnabled: boolean,\n isFallback: boolean,\n responseGenerator: ResponseGenerator,\n previousIncrementalCacheEntry: IncrementalResponseCacheEntry | null,\n hasResolved: boolean,\n waitUntil?: (prom: Promise<any>) => void\n ) {\n return this.revalidateBatcher.batch(key, () => {\n const promise = this.handleRevalidate(\n key,\n incrementalCache,\n isRoutePPREnabled,\n isFallback,\n responseGenerator,\n previousIncrementalCacheEntry,\n hasResolved\n )\n\n // We need to ensure background revalidates are passed to waitUntil.\n if (waitUntil) waitUntil(promise)\n\n return promise\n })\n }\n\n private async handleRevalidate(\n key: string,\n incrementalCache: IncrementalResponseCache,\n isRoutePPREnabled: boolean,\n isFallback: boolean,\n responseGenerator: ResponseGenerator,\n previousIncrementalCacheEntry: IncrementalResponseCacheEntry | null,\n hasResolved: boolean\n ) {\n try {\n // Generate the response cache entry using the response generator.\n const responseCacheEntry = await responseGenerator({\n hasResolved,\n previousCacheEntry: previousIncrementalCacheEntry,\n isRevalidating: true,\n })\n if (!responseCacheEntry) {\n return null\n }\n\n // Convert the response cache entry to an incremental response cache entry.\n const incrementalResponseCacheEntry = await fromResponseCacheEntry({\n ...responseCacheEntry,\n isMiss: !previousIncrementalCacheEntry,\n })\n\n // We want to persist the result only if it has a cache control value\n // defined.\n if (incrementalResponseCacheEntry.cacheControl) {\n if (this.minimal_mode) {\n this.previousCacheItem = {\n key,\n entry: incrementalResponseCacheEntry,\n expiresAt: Date.now() + 1000,\n }\n } else {\n await incrementalCache.set(key, incrementalResponseCacheEntry.value, {\n cacheControl: incrementalResponseCacheEntry.cacheControl,\n isRoutePPREnabled,\n isFallback,\n })\n }\n }\n\n return incrementalResponseCacheEntry\n } catch (err) {\n // When a path is erroring we automatically re-set the existing cache\n // with new revalidate and expire times to prevent non-stop retrying.\n if (previousIncrementalCacheEntry?.cacheControl) {\n const revalidate = Math.min(\n Math.max(\n previousIncrementalCacheEntry.cacheControl.revalidate || 3,\n 3\n ),\n 30\n )\n const expire =\n previousIncrementalCacheEntry.cacheControl.expire === undefined\n ? undefined\n : Math.max(\n revalidate + 3,\n previousIncrementalCacheEntry.cacheControl.expire\n )\n\n await incrementalCache.set(key, previousIncrementalCacheEntry.value, {\n cacheControl: { revalidate: revalidate, expire: expire },\n isRoutePPREnabled,\n isFallback,\n })\n }\n\n // We haven't resolved yet, so let's throw to indicate an error.\n throw err\n }\n }\n}\n","import type {\n WorkAsyncStorage,\n WorkStore,\n} from '../app-render/work-async-storage.external'\n\nimport { AppRenderSpan, NextNodeServerSpan } from './trace/constants'\nimport { getTracer, SpanKind } from './trace/tracer'\nimport {\n CACHE_ONE_YEAR,\n INFINITE_CACHE,\n NEXT_CACHE_TAG_MAX_ITEMS,\n NEXT_CACHE_TAG_MAX_LENGTH,\n} from '../../lib/constants'\nimport { markCurrentScopeAsDynamic } from '../app-render/dynamic-rendering'\nimport { makeHangingPromise } from '../dynamic-rendering-utils'\nimport type { FetchMetric } from '../base-http'\nimport { createDedupeFetch } from './dedupe-fetch'\nimport {\n getCacheSignal,\n type RevalidateStore,\n type WorkUnitAsyncStorage,\n} from '../app-render/work-unit-async-storage.external'\nimport {\n CachedRouteKind,\n IncrementalCacheKind,\n type CachedFetchData,\n type ServerComponentsHmrCache,\n type SetIncrementalFetchCacheContext,\n} from '../response-cache'\nimport { cloneResponse } from './clone-response'\nimport type { IncrementalCache } from './incremental-cache'\nimport { RenderStage } from '../app-render/staged-rendering'\n\nconst isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge'\n\ntype Fetcher = typeof fetch\n\ntype PatchedFetcher = Fetcher & {\n readonly __nextPatched: true\n readonly __nextGetStaticStore: () => WorkAsyncStorage\n readonly _nextOriginalFetch: Fetcher\n}\n\nexport const NEXT_PATCH_SYMBOL = Symbol.for('next-patch')\n\nfunction isFetchPatched() {\n return (globalThis as Record<symbol, unknown>)[NEXT_PATCH_SYMBOL] === true\n}\n\nexport function validateRevalidate(\n revalidateVal: unknown,\n route: string\n): undefined | number {\n try {\n let normalizedRevalidate: number | undefined = undefined\n\n if (revalidateVal === false) {\n normalizedRevalidate = INFINITE_CACHE\n } else if (\n typeof revalidateVal === 'number' &&\n !isNaN(revalidateVal) &&\n revalidateVal > -1\n ) {\n normalizedRevalidate = revalidateVal\n } else if (typeof revalidateVal !== 'undefined') {\n throw new Error(\n `Invalid revalidate value \"${revalidateVal}\" on \"${route}\", must be a non-negative number or false`\n )\n }\n return normalizedRevalidate\n } catch (err: any) {\n // handle client component error from attempting to check revalidate value\n if (err instanceof Error && err.message.includes('Invalid revalidate')) {\n throw err\n }\n return undefined\n }\n}\n\nexport function validateTags(tags: any[], description: string) {\n const validTags: string[] = []\n const invalidTags: Array<{\n tag: any\n reason: string\n }> = []\n\n for (let i = 0; i < tags.length; i++) {\n const tag = tags[i]\n\n if (typeof tag !== 'string') {\n invalidTags.push({ tag, reason: 'invalid type, must be a string' })\n } else if (tag.length > NEXT_CACHE_TAG_MAX_LENGTH) {\n invalidTags.push({\n tag,\n reason: `exceeded max length of ${NEXT_CACHE_TAG_MAX_LENGTH}`,\n })\n } else {\n validTags.push(tag)\n }\n\n if (validTags.length > NEXT_CACHE_TAG_MAX_ITEMS) {\n console.warn(\n `Warning: exceeded max tag count for ${description}, dropped tags:`,\n tags.slice(i).join(', ')\n )\n break\n }\n }\n\n if (invalidTags.length > 0) {\n console.warn(`Warning: invalid tags passed to ${description}: `)\n\n for (const { tag, reason } of invalidTags) {\n console.log(`tag: \"${tag}\" ${reason}`)\n }\n }\n return validTags\n}\n\nfunction trackFetchMetric(\n workStore: WorkStore,\n ctx: Omit<FetchMetric, 'end' | 'idx'>\n) {\n if (!workStore.shouldTrackFetchMetrics) {\n return\n }\n\n workStore.fetchMetrics ??= []\n\n workStore.fetchMetrics.push({\n ...ctx,\n end: performance.timeOrigin + performance.now(),\n idx: workStore.nextFetchId || 0,\n })\n}\n\nasync function createCachedPrerenderResponse(\n res: Response,\n cacheKey: string,\n incrementalCacheContext: SetIncrementalFetchCacheContext | undefined,\n incrementalCache: IncrementalCache,\n revalidate: number,\n handleUnlock: () => Promise<void> | void\n): Promise<Response> {\n // We are prerendering at build time or revalidate time with cacheComponents so we\n // need to buffer the response so we can guarantee it can be read in a\n // microtask.\n const bodyBuffer = await res.arrayBuffer()\n\n const fetchedData = {\n headers: Object.fromEntries(res.headers.entries()),\n body: Buffer.from(bodyBuffer).toString('base64'),\n status: res.status,\n url: res.url,\n }\n\n // We can skip setting the serverComponentsHmrCache because we aren't in dev\n // mode.\n\n if (incrementalCacheContext) {\n await incrementalCache.set(\n cacheKey,\n { kind: CachedRouteKind.FETCH, data: fetchedData, revalidate },\n incrementalCacheContext\n )\n }\n\n await handleUnlock()\n\n // We return a new Response to the caller.\n return new Response(bodyBuffer, {\n headers: res.headers,\n status: res.status,\n statusText: res.statusText,\n })\n}\n\nasync function createCachedDynamicResponse(\n workStore: WorkStore,\n res: Response,\n cacheKey: string,\n incrementalCacheContext: SetIncrementalFetchCacheContext | undefined,\n incrementalCache: IncrementalCache,\n serverComponentsHmrCache: ServerComponentsHmrCache | undefined,\n revalidate: number,\n input: RequestInfo | URL,\n handleUnlock: () => Promise<void> | void\n): Promise<Response> {\n // We're cloning the response using this utility because there exists a bug in\n // the undici library around response cloning. See the following pull request\n // for more details: https://github.com/vercel/next.js/pull/73274\n const [cloned1, cloned2] = cloneResponse(res)\n\n // We are dynamically rendering including dev mode. We want to return the\n // response to the caller as soon as possible because it might stream over a\n // very long time.\n const cacheSetPromise = cloned1\n .arrayBuffer()\n .then(async (arrayBuffer) => {\n const bodyBuffer = Buffer.from(arrayBuffer)\n\n const fetchedData = {\n headers: Object.fromEntries(cloned1.headers.entries()),\n body: bodyBuffer.toString('base64'),\n status: cloned1.status,\n url: cloned1.url,\n }\n\n serverComponentsHmrCache?.set(cacheKey, fetchedData)\n\n if (incrementalCacheContext) {\n await incrementalCache.set(\n cacheKey,\n { kind: CachedRouteKind.FETCH, data: fetchedData, revalidate },\n incrementalCacheContext\n )\n }\n })\n .catch((error) => console.warn(`Failed to set fetch cache`, input, error))\n .finally(handleUnlock)\n\n const pendingRevalidateKey = `cache-set-${cacheKey}`\n workStore.pendingRevalidates ??= {}\n\n if (pendingRevalidateKey in workStore.pendingRevalidates) {\n // there is already a pending revalidate entry that we need to await to\n // avoid race conditions\n await workStore.pendingRevalidates[pendingRevalidateKey]\n }\n\n workStore.pendingRevalidates[pendingRevalidateKey] = cacheSetPromise.finally(\n () => {\n // If the pending revalidate is not present in the store, then we have\n // nothing to delete.\n if (!workStore.pendingRevalidates?.[pendingRevalidateKey]) {\n return\n }\n\n delete workStore.pendingRevalidates[pendingRevalidateKey]\n }\n )\n\n return cloned2\n}\n\ninterface PatchableModule {\n workAsyncStorage: WorkAsyncStorage\n workUnitAsyncStorage: WorkUnitAsyncStorage\n}\n\nexport function createPatchedFetcher(\n originFetch: Fetcher,\n { workAsyncStorage, workUnitAsyncStorage }: PatchableModule\n): PatchedFetcher {\n // Create the patched fetch function.\n const patched = async function fetch(\n input: RequestInfo | URL,\n init: RequestInit | undefined\n ): Promise<Response> {\n let url: URL | undefined\n try {\n url = new URL(input instanceof Request ? input.url : input)\n url.username = ''\n url.password = ''\n } catch {\n // Error caused by malformed URL should be handled by native fetch\n url = undefined\n }\n const fetchUrl = url?.href ?? ''\n const method = init?.method?.toUpperCase() || 'GET'\n\n // Do create a new span trace for internal fetches in the\n // non-verbose mode.\n const isInternal = (init?.next as any)?.internal === true\n const hideSpan = process.env.NEXT_OTEL_FETCH_DISABLED === '1'\n // We don't track fetch metrics for internal fetches\n // so it's not critical that we have a start time, as it won't be recorded.\n // This is to workaround a flaky issue where performance APIs might\n // not be available and will require follow-up investigation.\n const fetchStart: number | undefined = isInternal\n ? undefined\n : performance.timeOrigin + performance.now()\n\n const workStore = workAsyncStorage.getStore()\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n let cacheSignal = workUnitStore ? getCacheSignal(workUnitStore) : null\n if (cacheSignal) {\n cacheSignal.beginRead()\n }\n\n const result = getTracer().trace(\n isInternal ? NextNodeServerSpan.internalFetch : AppRenderSpan.fetch,\n {\n hideSpan,\n kind: SpanKind.CLIENT,\n spanName: ['fetch', method, fetchUrl].filter(Boolean).join(' '),\n attributes: {\n 'http.url': fetchUrl,\n 'http.method': method,\n 'net.peer.name': url?.hostname,\n 'net.peer.port': url?.port || undefined,\n },\n },\n async () => {\n // If this is an internal fetch, we should not do any special treatment.\n if (isInternal) {\n return originFetch(input, init)\n }\n\n // If the workStore is not available, we can't do any\n // special treatment of fetch, therefore fallback to the original\n // fetch implementation.\n if (!workStore) {\n return originFetch(input, init)\n }\n\n // We should also fallback to the original fetch implementation if we\n // are in draft mode, it does not constitute a static generation.\n if (workStore.isDraftMode) {\n return originFetch(input, init)\n }\n\n const isRequestInput =\n input &&\n typeof input === 'object' &&\n typeof (input as Request).method === 'string'\n\n const getRequestMeta = (field: string) => {\n // If request input is present but init is not, retrieve from input first.\n const value = (init as any)?.[field]\n return value || (isRequestInput ? (input as any)[field] : null)\n }\n\n let finalRevalidate: number | undefined = undefined\n const getNextField = (field: 'revalidate' | 'tags') => {\n return typeof init?.next?.[field] !== 'undefined'\n ? init?.next?.[field]\n : isRequestInput\n ? (input as any).next?.[field]\n : undefined\n }\n // RequestInit doesn't keep extra fields e.g. next so it's\n // only available if init is used separate\n const originalFetchRevalidate = getNextField('revalidate')\n let currentFetchRevalidate = originalFetchRevalidate\n const tags: string[] = validateTags(\n getNextField('tags') || [],\n `fetch ${input.toString()}`\n )\n\n let revalidateStore: RevalidateStore | undefined\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-runtime':\n // TODO: Stop accumulating tags in client prerender. (fallthrough)\n case 'prerender-client':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n revalidateStore = workUnitStore\n break\n case 'request':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (revalidateStore) {\n if (Array.isArray(tags)) {\n // Collect tags onto parent caches or parent prerenders.\n const collectedTags =\n revalidateStore.tags ?? (revalidateStore.tags = [])\n for (const tag of tags) {\n if (!collectedTags.includes(tag)) {\n collectedTags.push(tag)\n }\n }\n }\n }\n\n const implicitTags = workUnitStore?.implicitTags\n\n let pageFetchCacheMode = workStore.fetchCache\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'unstable-cache':\n // Inside unstable-cache we treat it the same as force-no-store on\n // the page.\n pageFetchCacheMode = 'force-no-store'\n break\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n const isUsingNoStore = !!workStore.isUnstableNoStore\n\n let currentFetchCacheConfig = getRequestMeta('cache')\n let cacheReason = ''\n let cacheWarning: string | undefined\n\n if (\n typeof currentFetchCacheConfig === 'string' &&\n typeof currentFetchRevalidate !== 'undefined'\n ) {\n // If the revalidate value conflicts with the cache value, we should warn the user and unset the conflicting values.\n const isConflictingRevalidate =\n // revalidate: 0 and cache: force-cache\n (currentFetchCacheConfig === 'force-cache' &&\n currentFetchRevalidate === 0) ||\n // revalidate: >0 or revalidate: false and cache: no-store\n (currentFetchCacheConfig === 'no-store' &&\n (currentFetchRevalidate > 0 || currentFetchRevalidate === false))\n\n if (isConflictingRevalidate) {\n cacheWarning = `Specified \"cache: ${currentFetchCacheConfig}\" and \"revalidate: ${currentFetchRevalidate}\", only one should be specified.`\n currentFetchCacheConfig = undefined\n currentFetchRevalidate = undefined\n }\n }\n\n const hasExplicitFetchCacheOptOut =\n // fetch config itself signals not to cache\n currentFetchCacheConfig === 'no-cache' ||\n currentFetchCacheConfig === 'no-store' ||\n // the fetch isn't explicitly caching and the segment level cache config signals not to cache\n // note: `pageFetchCacheMode` is also set by being in an unstable_cache context.\n pageFetchCacheMode === 'force-no-store' ||\n pageFetchCacheMode === 'only-no-store'\n\n // If no explicit fetch cache mode is set, but dynamic = `force-dynamic` is set,\n // we shouldn't consider caching the fetch. This is because the `dynamic` cache\n // is considered a \"top-level\" cache mode, whereas something like `fetchCache` is more\n // fine-grained. Top-level modes are responsible for setting reasonable defaults for the\n // other configurations.\n const noFetchConfigAndForceDynamic =\n !pageFetchCacheMode &&\n !currentFetchCacheConfig &&\n !currentFetchRevalidate &&\n workStore.forceDynamic\n\n if (\n // force-cache was specified without a revalidate value. We set the revalidate value to false\n // which will signal the cache to not revalidate\n currentFetchCacheConfig === 'force-cache' &&\n typeof currentFetchRevalidate === 'undefined'\n ) {\n currentFetchRevalidate = false\n } else if (\n hasExplicitFetchCacheOptOut ||\n noFetchConfigAndForceDynamic\n ) {\n currentFetchRevalidate = 0\n }\n\n if (\n currentFetchCacheConfig === 'no-cache' ||\n currentFetchCacheConfig === 'no-store'\n ) {\n cacheReason = `cache: ${currentFetchCacheConfig}`\n }\n\n finalRevalidate = validateRevalidate(\n currentFetchRevalidate,\n workStore.route\n )\n\n const _headers = getRequestMeta('headers')\n const initHeaders: Headers =\n typeof _headers?.get === 'function'\n ? _headers\n : new Headers(_headers || {})\n\n const hasUnCacheableHeader =\n initHeaders.get('authorization') || initHeaders.get('cookie')\n\n const isUnCacheableMethod = !['get', 'head'].includes(\n getRequestMeta('method')?.toLowerCase() || 'get'\n )\n\n /**\n * We automatically disable fetch caching under the following conditions:\n * - Fetch cache configs are not set. Specifically:\n * - A page fetch cache mode is not set (export const fetchCache=...)\n * - A fetch cache mode is not set in the fetch call (fetch(url, { cache: ... }))\n * or the fetch cache mode is set to 'default'\n * - A fetch revalidate value is not set in the fetch call (fetch(url, { revalidate: ... }))\n * - OR the fetch comes after a configuration that triggered dynamic rendering (e.g., reading cookies())\n * and the fetch was considered uncacheable (e.g., POST method or has authorization headers)\n */\n const hasNoExplicitCacheConfig =\n // eslint-disable-next-line eqeqeq\n pageFetchCacheMode == undefined &&\n // eslint-disable-next-line eqeqeq\n (currentFetchCacheConfig == undefined ||\n // when considering whether to opt into the default \"no-cache\" fetch semantics,\n // a \"default\" cache config should be treated the same as no cache config\n currentFetchCacheConfig === 'default') &&\n // eslint-disable-next-line eqeqeq\n currentFetchRevalidate == undefined\n\n let autoNoCache = Boolean(\n (hasUnCacheableHeader || isUnCacheableMethod) &&\n revalidateStore?.revalidate === 0\n )\n\n let isImplicitBuildTimeCache = false\n\n if (!autoNoCache && hasNoExplicitCacheConfig) {\n // We don't enable automatic no-cache behavior during build-time\n // prerendering so that we can still leverage the fetch cache between\n // export workers.\n if (workStore.isBuildTimePrerendering) {\n isImplicitBuildTimeCache = true\n } else {\n autoNoCache = true\n }\n }\n\n // If we have no cache config, and we're in Dynamic I/O prerendering,\n // it'll be a dynamic call. We don't have to issue that dynamic call.\n if (hasNoExplicitCacheConfig && workUnitStore !== undefined) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-runtime':\n // While we don't want to do caching in the client scope we know the\n // fetch will be dynamic for cacheComponents so we may as well avoid the\n // call here. (fallthrough)\n case 'prerender-client':\n if (cacheSignal) {\n cacheSignal.endRead()\n cacheSignal = null\n }\n\n return makeHangingPromise<Response>(\n workUnitStore.renderSignal,\n workStore.route,\n 'fetch()'\n )\n case 'request':\n if (\n process.env.NODE_ENV === 'development' &&\n workUnitStore.stagedRendering\n ) {\n if (cacheSignal) {\n cacheSignal.endRead()\n cacheSignal = null\n }\n await workUnitStore.stagedRendering.waitForStage(\n RenderStage.Dynamic\n )\n }\n break\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n switch (pageFetchCacheMode) {\n case 'force-no-store': {\n cacheReason = 'fetchCache = force-no-store'\n break\n }\n case 'only-no-store': {\n if (\n currentFetchCacheConfig === 'force-cache' ||\n (typeof finalRevalidate !== 'undefined' && finalRevalidate > 0)\n ) {\n throw new Error(\n `cache: 'force-cache' used on fetch for ${fetchUrl} with 'export const fetchCache = 'only-no-store'`\n )\n }\n cacheReason = 'fetchCache = only-no-store'\n break\n }\n case 'only-cache': {\n if (currentFetchCacheConfig === 'no-store') {\n throw new Error(\n `cache: 'no-store' used on fetch for ${fetchUrl} with 'export const fetchCache = 'only-cache'`\n )\n }\n break\n }\n case 'force-cache': {\n if (\n typeof currentFetchRevalidate === 'undefined' ||\n currentFetchRevalidate === 0\n ) {\n cacheReason = 'fetchCache = force-cache'\n finalRevalidate = INFINITE_CACHE\n }\n break\n }\n case 'default-cache':\n case 'default-no-store':\n case 'auto':\n case undefined:\n // sometimes we won't match the above cases. the reason we don't move\n // everything to this switch is the use of autoNoCache which is not a fetchCacheMode\n // I suspect this could be unified with fetchCacheMode however in which case we could\n // simplify the switch case and ensure we have an exhaustive switch handling all modes\n break\n default:\n pageFetchCacheMode satisfies never\n }\n\n if (typeof finalRevalidate === 'undefined') {\n if (pageFetchCacheMode === 'default-cache' && !isUsingNoStore) {\n finalRevalidate = INFINITE_CACHE\n cacheReason = 'fetchCache = default-cache'\n } else if (pageFetchCacheMode === 'default-no-store') {\n finalRevalidate = 0\n cacheReason = 'fetchCache = default-no-store'\n } else if (isUsingNoStore) {\n finalRevalidate = 0\n cacheReason = 'noStore call'\n } else if (autoNoCache) {\n finalRevalidate = 0\n cacheReason = 'auto no cache'\n } else {\n // TODO: should we consider this case an invariant?\n cacheReason = 'auto cache'\n finalRevalidate = revalidateStore\n ? revalidateStore.revalidate\n : INFINITE_CACHE\n }\n } else if (!cacheReason) {\n cacheReason = `revalidate: ${finalRevalidate}`\n }\n\n if (\n // when force static is configured we don't bail from\n // `revalidate: 0` values\n !(workStore.forceStatic && finalRevalidate === 0) &&\n // we don't consider autoNoCache to switch to dynamic for ISR\n !autoNoCache &&\n // If the revalidate value isn't currently set or the value is less\n // than the current revalidate value, we should update the revalidate\n // value.\n revalidateStore &&\n finalRevalidate < revalidateStore.revalidate\n ) {\n // If we were setting the revalidate value to 0, we should try to\n // postpone instead first.\n if (finalRevalidate === 0) {\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n if (cacheSignal) {\n cacheSignal.endRead()\n cacheSignal = null\n }\n return makeHangingPromise<Response>(\n workUnitStore.renderSignal,\n workStore.route,\n 'fetch()'\n )\n case 'request':\n if (\n process.env.NODE_ENV === 'development' &&\n workUnitStore.stagedRendering\n ) {\n if (cacheSignal) {\n cacheSignal.endRead()\n cacheSignal = null\n }\n await workUnitStore.stagedRendering.waitForStage(\n RenderStage.Dynamic\n )\n }\n break\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n markCurrentScopeAsDynamic(\n workStore,\n workUnitStore,\n `revalidate: 0 fetch ${input} ${workStore.route}`\n )\n }\n\n // We only want to set the revalidate store's revalidate time if it\n // was explicitly set for the fetch call, i.e.\n // originalFetchRevalidate.\n if (revalidateStore && originalFetchRevalidate === finalRevalidate) {\n revalidateStore.revalidate = finalRevalidate\n }\n }\n\n const isCacheableRevalidate =\n typeof finalRevalidate === 'number' && finalRevalidate > 0\n\n let cacheKey: string | undefined\n const { incrementalCache } = workStore\n let isHmrRefresh = false\n let serverComponentsHmrCache: ServerComponentsHmrCache | undefined\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'request':\n case 'cache':\n case 'private-cache':\n isHmrRefresh = workUnitStore.isHmrRefresh ?? false\n serverComponentsHmrCache = workUnitStore.serverComponentsHmrCache\n break\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (\n incrementalCache &&\n (isCacheableRevalidate || serverComponentsHmrCache)\n ) {\n try {\n cacheKey = await incrementalCache.generateCacheKey(\n fetchUrl,\n isRequestInput ? (input as RequestInit) : init\n )\n } catch (err) {\n console.error(`Failed to generate cache key for`, input)\n }\n }\n\n const fetchIdx = workStore.nextFetchId ?? 1\n workStore.nextFetchId = fetchIdx + 1\n\n let handleUnlock: () => Promise<void> | void = () => {}\n\n const doOriginalFetch = async (\n isStale?: boolean,\n cacheReasonOverride?: string\n ) => {\n const requestInputFields = [\n 'cache',\n 'credentials',\n 'headers',\n 'integrity',\n 'keepalive',\n 'method',\n 'mode',\n 'redirect',\n 'referrer',\n 'referrerPolicy',\n 'window',\n 'duplex',\n\n // don't pass through signal when revalidating\n ...(isStale ? [] : ['signal']),\n ]\n\n if (isRequestInput) {\n const reqInput: Request = input as any\n const reqOptions: RequestInit = {\n body: (reqInput as any)._ogBody || reqInput.body,\n }\n\n for (const field of requestInputFields) {\n // @ts-expect-error custom fields\n reqOptions[field] = reqInput[field]\n }\n input = new Request(reqInput.url, reqOptions)\n } else if (init) {\n const { _ogBody, body, signal, ...otherInput } =\n init as RequestInit & { _ogBody?: any }\n init = {\n ...otherInput,\n body: _ogBody || body,\n signal: isStale ? undefined : signal,\n }\n }\n\n // add metadata to init without editing the original\n const clonedInit = {\n ...init,\n next: { ...init?.next, fetchType: 'origin', fetchIdx },\n }\n\n return originFetch(input, clonedInit)\n .then(async (res) => {\n if (!isStale && fetchStart) {\n trackFetchMetric(workStore, {\n start: fetchStart,\n url: fetchUrl,\n cacheReason: cacheReasonOverride || cacheReason,\n cacheStatus:\n finalRevalidate === 0 || cacheReasonOverride\n ? 'skip'\n : 'miss',\n cacheWarning,\n status: res.status,\n method: clonedInit.method || 'GET',\n })\n }\n if (\n res.status === 200 &&\n incrementalCache &&\n cacheKey &&\n (isCacheableRevalidate || serverComponentsHmrCache)\n ) {\n const normalizedRevalidate =\n finalRevalidate >= INFINITE_CACHE\n ? CACHE_ONE_YEAR\n : finalRevalidate\n\n const incrementalCacheConfig:\n | SetIncrementalFetchCacheContext\n | undefined = isCacheableRevalidate\n ? {\n fetchCache: true,\n fetchUrl,\n fetchIdx,\n tags,\n isImplicitBuildTimeCache,\n }\n : undefined\n\n switch (workUnitStore?.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n return createCachedPrerenderResponse(\n res,\n cacheKey,\n incrementalCacheConfig,\n incrementalCache,\n normalizedRevalidate,\n handleUnlock\n )\n case 'request':\n if (\n process.env.NODE_ENV === 'development' &&\n workUnitStore.stagedRendering &&\n workUnitStore.cacheSignal\n ) {\n // We're filling caches for a staged render,\n // so we need to wait for the response to finish instead of streaming.\n return createCachedPrerenderResponse(\n res,\n cacheKey,\n incrementalCacheConfig,\n incrementalCache,\n normalizedRevalidate,\n handleUnlock\n )\n }\n // fallthrough\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case undefined:\n return createCachedDynamicResponse(\n workStore,\n res,\n cacheKey,\n incrementalCacheConfig,\n incrementalCache,\n serverComponentsHmrCache,\n normalizedRevalidate,\n input,\n handleUnlock\n )\n default:\n workUnitStore satisfies never\n }\n }\n\n // we had response that we determined shouldn't be cached so we return it\n // and don't cache it. This also needs to unlock the cache lock we acquired.\n await handleUnlock()\n\n return res\n })\n .catch((error) => {\n handleUnlock()\n throw error\n })\n }\n\n let cacheReasonOverride\n let isForegroundRevalidate = false\n let isHmrRefreshCache = false\n\n if (cacheKey && incrementalCache) {\n let cachedFetchData: CachedFetchData | undefined\n\n if (isHmrRefresh && serverComponentsHmrCache) {\n cachedFetchData = serverComponentsHmrCache.get(cacheKey)\n isHmrRefreshCache = true\n }\n\n if (isCacheableRevalidate && !cachedFetchData) {\n handleUnlock = await incrementalCache.lock(cacheKey)\n const entry = workStore.isOnDemandRevalidate\n ? null\n : await incrementalCache.get(cacheKey, {\n kind: IncrementalCacheKind.FETCH,\n revalidate: finalRevalidate,\n fetchUrl,\n fetchIdx,\n tags,\n softTags: implicitTags?.tags,\n })\n\n if (hasNoExplicitCacheConfig && workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n // We sometimes use the cache to dedupe fetches that do not\n // specify a cache configuration. In these cases we want to\n // make sure we still exclude them from prerenders if\n // cacheComponents is on so we introduce an artificial task boundary\n // here.\n await getTimeoutBoundary()\n break\n case 'request':\n if (\n process.env.NODE_ENV === 'development' &&\n workUnitStore.stagedRendering\n ) {\n await workUnitStore.stagedRendering.waitForStage(\n RenderStage.Dynamic\n )\n }\n break\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (entry) {\n await handleUnlock()\n } else {\n // in dev, incremental cache response will be null in case the browser adds `cache-control: no-cache` in the request headers\n // TODO: it seems like we also hit this after revalidates in dev?\n cacheReasonOverride = 'cache-control: no-cache (hard refresh)'\n }\n\n if (entry?.value && entry.value.kind === CachedRouteKind.FETCH) {\n // when stale and is revalidating we wait for fresh data\n // so the revalidated entry has the updated data\n if (workStore.isStaticGeneration && entry.isStale) {\n isForegroundRevalidate = true\n } else {\n if (entry.isStale) {\n workStore.pendingRevalidates ??= {}\n if (!workStore.pendingRevalidates[cacheKey]) {\n const pendingRevalidate = doOriginalFetch(true)\n .then(async (response) => ({\n body: await response.arrayBuffer(),\n headers: response.headers,\n status: response.status,\n statusText: response.statusText,\n }))\n .finally(() => {\n workStore.pendingRevalidates ??= {}\n delete workStore.pendingRevalidates[cacheKey || '']\n })\n\n // Attach the empty catch here so we don't get a \"unhandled\n // promise rejection\" warning.\n pendingRevalidate.catch(console.error)\n\n workStore.pendingRevalidates[cacheKey] = pendingRevalidate\n }\n }\n\n cachedFetchData = entry.value.data\n }\n }\n }\n\n if (cachedFetchData) {\n if (fetchStart) {\n trackFetchMetric(workStore, {\n start: fetchStart,\n url: fetchUrl,\n cacheReason,\n cacheStatus: isHmrRefreshCache ? 'hmr' : 'hit',\n cacheWarning,\n status: cachedFetchData.status || 200,\n method: init?.method || 'GET',\n })\n }\n\n const response = new Response(\n Buffer.from(cachedFetchData.body, 'base64'),\n {\n headers: cachedFetchData.headers,\n status: cachedFetchData.status,\n }\n )\n\n Object.defineProperty(response, 'url', {\n value: cachedFetchData.url,\n })\n\n return response\n }\n }\n\n if (\n (workStore.isStaticGeneration ||\n (process.env.NODE_ENV === 'development' &&\n process.env.__NEXT_CACHE_COMPONENTS &&\n workUnitStore &&\n // eslint-disable-next-line no-restricted-syntax\n workUnitStore.type === 'request' &&\n workUnitStore.stagedRendering)) &&\n init &&\n typeof init === 'object'\n ) {\n const { cache } = init\n\n // Delete `cache` property as Cloudflare Workers will throw an error\n if (isEdgeRuntime) delete init.cache\n\n if (cache === 'no-store') {\n // If enabled, we should bail out of static generation.\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n if (cacheSignal) {\n cacheSignal.endRead()\n cacheSignal = null\n }\n return makeHangingPromise<Response>(\n workUnitStore.renderSignal,\n workStore.route,\n 'fetch()'\n )\n case 'request':\n if (\n process.env.NODE_ENV === 'development' &&\n workUnitStore.stagedRendering\n ) {\n if (cacheSignal) {\n cacheSignal.endRead()\n cacheSignal = null\n }\n await workUnitStore.stagedRendering.waitForStage(\n RenderStage.Dynamic\n )\n }\n break\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n markCurrentScopeAsDynamic(\n workStore,\n workUnitStore,\n `no-store fetch ${input} ${workStore.route}`\n )\n }\n\n const hasNextConfig = 'next' in init\n const { next = {} } = init\n if (\n typeof next.revalidate === 'number' &&\n revalidateStore &&\n next.revalidate < revalidateStore.revalidate\n ) {\n if (next.revalidate === 0) {\n // If enabled, we should bail out of static generation.\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n return makeHangingPromise<Response>(\n workUnitStore.renderSignal,\n workStore.route,\n 'fetch()'\n )\n case 'request':\n if (\n process.env.NODE_ENV === 'development' &&\n workUnitStore.stagedRendering\n ) {\n await workUnitStore.stagedRendering.waitForStage(\n RenderStage.Dynamic\n )\n }\n break\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n case 'prerender-legacy':\n case 'prerender-ppr':\n break\n default:\n workUnitStore satisfies never\n }\n }\n markCurrentScopeAsDynamic(\n workStore,\n workUnitStore,\n `revalidate: 0 fetch ${input} ${workStore.route}`\n )\n }\n\n if (!workStore.forceStatic || next.revalidate !== 0) {\n revalidateStore.revalidate = next.revalidate\n }\n }\n if (hasNextConfig) delete init.next\n }\n\n // if we are revalidating the whole page via time or on-demand and\n // the fetch cache entry is stale we should still de-dupe the\n // origin hit if it's a cache-able entry\n if (cacheKey && isForegroundRevalidate) {\n const pendingRevalidateKey = cacheKey\n workStore.pendingRevalidates ??= {}\n let pendingRevalidate =\n workStore.pendingRevalidates[pendingRevalidateKey]\n\n if (pendingRevalidate) {\n const revalidatedResult: {\n body: ArrayBuffer\n headers: Headers\n status: number\n statusText: string\n } = await pendingRevalidate\n return new Response(revalidatedResult.body, {\n headers: revalidatedResult.headers,\n status: revalidatedResult.status,\n statusText: revalidatedResult.statusText,\n })\n }\n\n // We used to just resolve the Response and clone it however for\n // static generation with cacheComponents we need the response to be able to\n // be resolved in a microtask and cloning the response will never have\n // a body that can resolve in a microtask in node (as observed through\n // experimentation) So instead we await the body and then when it is\n // available we construct manually cloned Response objects with the\n // body as an ArrayBuffer. This will be resolvable in a microtask\n // making it compatible with cacheComponents.\n const pendingResponse = doOriginalFetch(true, cacheReasonOverride)\n // We're cloning the response using this utility because there\n // exists a bug in the undici library around response cloning.\n // See the following pull request for more details:\n // https://github.com/vercel/next.js/pull/73274\n .then(cloneResponse)\n\n pendingRevalidate = pendingResponse\n .then(async (responses) => {\n const response = responses[0]\n return {\n body: await response.arrayBuffer(),\n headers: response.headers,\n status: response.status,\n statusText: response.statusText,\n }\n })\n .finally(() => {\n // If the pending revalidate is not present in the store, then\n // we have nothing to delete.\n if (!workStore.pendingRevalidates?.[pendingRevalidateKey]) {\n return\n }\n\n delete workStore.pendingRevalidates[pendingRevalidateKey]\n })\n\n // Attach the empty catch here so we don't get a \"unhandled promise\n // rejection\" warning\n pendingRevalidate.catch(() => {})\n\n workStore.pendingRevalidates[pendingRevalidateKey] = pendingRevalidate\n\n return pendingResponse.then((responses) => responses[1])\n } else {\n return doOriginalFetch(false, cacheReasonOverride)\n }\n }\n )\n\n if (cacheSignal) {\n try {\n return await result\n } finally {\n if (cacheSignal) {\n cacheSignal.endRead()\n }\n }\n }\n return result\n }\n\n // Attach the necessary properties to the patched fetch function.\n // We don't use this to determine if the fetch function has been patched,\n // but for external consumers to determine if the fetch function has been\n // patched.\n patched.__nextPatched = true as const\n patched.__nextGetStaticStore = () => workAsyncStorage\n patched._nextOriginalFetch = originFetch\n ;(globalThis as Record<symbol, unknown>)[NEXT_PATCH_SYMBOL] = true\n\n // Assign the function name also as a name property, so that it's preserved\n // even when mangling is enabled.\n Object.defineProperty(patched, 'name', { value: 'fetch', writable: false })\n\n return patched\n}\n\n// we patch fetch to collect cache information used for\n// determining if a page is static or not\nexport function patchFetch(options: PatchableModule) {\n // If we've already patched fetch, we should not patch it again.\n if (isFetchPatched()) return\n\n // Grab the original fetch function. We'll attach this so we can use it in\n // the patched fetch function.\n const original = createDedupeFetch(globalThis.fetch)\n\n // Set the global fetch to the patched fetch.\n globalThis.fetch = createPatchedFetcher(original, options)\n}\n\nlet currentTimeoutBoundary: null | Promise<void> = null\nfunction getTimeoutBoundary() {\n if (!currentTimeoutBoundary) {\n currentTimeoutBoundary = new Promise((r) => {\n setTimeout(() => {\n currentTimeoutBoundary = null\n r()\n }, 0)\n })\n }\n return currentTimeoutBoundary\n}\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n/**\n * This function allows you to render the [not-found.js file](https://nextjs.org/docs/app/api-reference/file-conventions/not-found)\n * within a route segment as well as inject a tag.\n *\n * `notFound()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * - In a Server Component, this will insert a `<meta name=\"robots\" content=\"noindex\" />` meta tag and set the status code to 404.\n * - In a Route Handler or Server Action, it will serve a 404 to the caller.\n *\n * Read more: [Next.js Docs: `notFound`](https://nextjs.org/docs/app/api-reference/functions/not-found)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};404`\n\nexport function notFound(): never {\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n\n throw error\n}\n","import type { LoaderTree } from '../lib/app-dir-module'\n\nexport const BUILTIN_PREFIX = '__next_builtin__'\n\nconst nextInternalPrefixRegex =\n /^(.*[\\\\/])?next[\\\\/]dist[\\\\/]client[\\\\/]components[\\\\/]builtin[\\\\/]/\n\nexport function normalizeConventionFilePath(\n projectDir: string,\n conventionPath: string | undefined\n) {\n // Turbopack project path is formed as: \"<project root>/<cwd>\".\n // When project root is not the working directory, we can extract the relative project root path.\n // This is mostly used for running Next.js inside a monorepo.\n const cwd = process.env.NEXT_RUNTIME === 'edge' ? '' : process.cwd()\n const relativeProjectRoot = projectDir.replace(cwd, '')\n\n let relativePath = (conventionPath || '')\n // remove turbopack [project] prefix\n .replace(/^\\[project\\]/, '')\n // remove turbopack relative project path, everything after [project] and before the working directory.\n .replace(relativeProjectRoot, '')\n // remove the project root from the path\n .replace(projectDir, '')\n // remove cwd prefix\n .replace(cwd, '')\n // remove /(src/)?app/ dir prefix\n .replace(/^([\\\\/])*(src[\\\\/])?app[\\\\/]/, '')\n\n // If it's internal file only keep the filename, strip nextjs internal prefix\n if (nextInternalPrefixRegex.test(relativePath)) {\n relativePath = relativePath.replace(nextInternalPrefixRegex, '')\n // Add a special prefix to let segment explorer know it's a built-in component\n relativePath = `${BUILTIN_PREFIX}${relativePath}`\n }\n\n return relativePath.replace(/\\\\/g, '/')\n}\n\n// if a filepath is a builtin file. e.g.\n// .../project/node_modules/next/dist/client/components/builtin/global-error.js -> true\n// .../project/app/global-error.js -> false\nexport const isNextjsBuiltinFilePath = (filePath: string) => {\n return nextInternalPrefixRegex.test(filePath)\n}\n\nexport const BOUNDARY_SUFFIX = '@boundary'\nexport function normalizeBoundaryFilename(filename: string) {\n return filename\n .replace(new RegExp(`^${BUILTIN_PREFIX}`), '')\n .replace(new RegExp(`${BOUNDARY_SUFFIX}$`), '')\n}\n\nexport const BOUNDARY_PREFIX = 'boundary:'\nexport function isBoundaryFile(fileType: string) {\n return fileType.startsWith(BOUNDARY_PREFIX)\n}\n\n// if a filename is a builtin file.\n// __next_builtin__global-error.js -> true\n// page.js -> false\nexport function isBuiltinBoundaryFile(fileType: string) {\n return fileType.startsWith(BUILTIN_PREFIX)\n}\n\nexport function getBoundaryOriginFileType(fileType: string) {\n return fileType.replace(BOUNDARY_PREFIX, '')\n}\n\nexport function getConventionPathByType(\n tree: LoaderTree,\n dir: string,\n conventionType:\n | 'layout'\n | 'template'\n | 'page'\n | 'not-found'\n | 'error'\n | 'loading'\n | 'forbidden'\n | 'unauthorized'\n | 'defaultPage'\n | 'global-error'\n) {\n const modules = tree[2]\n const conventionPath = modules[conventionType]\n ? modules[conventionType][1]\n : undefined\n if (conventionPath) {\n return normalizeConventionFilePath(dir, conventionPath)\n }\n return undefined\n}\n","import type { ComponentType } from 'react'\nimport type {\n CacheNodeSeedData,\n LoadingModuleData,\n} from '../../shared/lib/app-router-types'\nimport type { PreloadCallbacks } from './types'\nimport {\n isClientReference,\n isUseCacheFunction,\n} from '../../lib/client-and-server-references'\nimport { getLayoutOrPageModule } from '../lib/app-dir-module'\nimport type { LoaderTree } from '../lib/app-dir-module'\nimport { interopDefault } from './interop-default'\nimport { parseLoaderTree } from '../../shared/lib/router/utils/parse-loader-tree'\nimport type { AppRenderContext, GetDynamicParamFromSegment } from './app-render'\nimport { createComponentStylesAndScripts } from './create-component-styles-and-scripts'\nimport { getLayerAssets } from './get-layer-assets'\nimport { hasLoadingComponentInTree } from './has-loading-component-in-tree'\nimport { validateRevalidate } from '../lib/patch-fetch'\nimport { PARALLEL_ROUTE_DEFAULT_PATH } from '../../client/components/builtin/default'\nimport { getTracer } from '../lib/trace/tracer'\nimport { NextNodeServerSpan } from '../lib/trace/constants'\nimport { StaticGenBailoutError } from '../../client/components/static-generation-bailout'\nimport type { Params } from '../request/params'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport type {\n UseCacheLayoutProps,\n UseCachePageProps,\n} from '../use-cache/use-cache-wrapper'\nimport { DEFAULT_SEGMENT_KEY } from '../../shared/lib/segment'\nimport {\n BOUNDARY_PREFIX,\n BOUNDARY_SUFFIX,\n BUILTIN_PREFIX,\n getConventionPathByType,\n isNextjsBuiltinFilePath,\n} from './segment-explorer-path'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\n\n/**\n * Use the provided loader tree to create the React Component tree.\n */\nexport function createComponentTree(props: {\n loaderTree: LoaderTree\n parentParams: Params\n rootLayoutIncluded: boolean\n injectedCSS: Set<string>\n injectedJS: Set<string>\n injectedFontPreloadTags: Set<string>\n ctx: AppRenderContext\n missingSlots?: Set<string>\n preloadCallbacks: PreloadCallbacks\n authInterrupts: boolean\n MetadataOutlet: ComponentType\n}): Promise<CacheNodeSeedData> {\n return getTracer().trace(\n NextNodeServerSpan.createComponentTree,\n {\n spanName: 'build component tree',\n },\n () => createComponentTreeInternal(props, true)\n )\n}\n\nfunction errorMissingDefaultExport(\n pagePath: string,\n convention: string\n): never {\n const normalizedPagePath = pagePath === '/' ? '' : pagePath\n throw new Error(\n `The default export is not a React Component in \"${normalizedPagePath}/${convention}\"`\n )\n}\n\nconst cacheNodeKey = 'c'\n\nasync function createComponentTreeInternal(\n {\n loaderTree: tree,\n parentParams,\n rootLayoutIncluded,\n injectedCSS,\n injectedJS,\n injectedFontPreloadTags,\n ctx,\n missingSlots,\n preloadCallbacks,\n authInterrupts,\n MetadataOutlet,\n }: {\n loaderTree: LoaderTree\n parentParams: Params\n rootLayoutIncluded: boolean\n injectedCSS: Set<string>\n injectedJS: Set<string>\n injectedFontPreloadTags: Set<string>\n ctx: AppRenderContext\n missingSlots?: Set<string>\n preloadCallbacks: PreloadCallbacks\n authInterrupts: boolean\n MetadataOutlet: ComponentType | null\n },\n isRoot: boolean\n): Promise<CacheNodeSeedData> {\n const {\n renderOpts: { nextConfigOutput, experimental, cacheComponents },\n workStore,\n componentMod: {\n createElement,\n Fragment,\n SegmentViewNode,\n HTTPAccessFallbackBoundary,\n LayoutRouter,\n RenderFromTemplateContext,\n ClientPageRoot,\n ClientSegmentRoot,\n createServerSearchParamsForServerPage,\n createPrerenderSearchParamsForClientPage,\n createServerParamsForServerSegment,\n createPrerenderParamsForClientSegment,\n serverHooks: { DynamicServerError },\n Postpone,\n },\n pagePath,\n getDynamicParamFromSegment,\n isPrefetch,\n query,\n } = ctx\n\n const { page, conventionPath, segment, modules, parallelRoutes } =\n parseLoaderTree(tree)\n\n const {\n layout,\n template,\n error,\n loading,\n 'not-found': notFound,\n forbidden,\n unauthorized,\n } = modules\n\n const injectedCSSWithCurrentLayout = new Set(injectedCSS)\n const injectedJSWithCurrentLayout = new Set(injectedJS)\n const injectedFontPreloadTagsWithCurrentLayout = new Set(\n injectedFontPreloadTags\n )\n\n const layerAssets = getLayerAssets({\n preloadCallbacks,\n ctx,\n layoutOrPagePath: conventionPath,\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n injectedFontPreloadTags: injectedFontPreloadTagsWithCurrentLayout,\n })\n\n const [Template, templateStyles, templateScripts] = template\n ? await createComponentStylesAndScripts({\n ctx,\n filePath: template[1],\n getComponent: template[0],\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n })\n : [Fragment]\n\n const [ErrorComponent, errorStyles, errorScripts] = error\n ? await createComponentStylesAndScripts({\n ctx,\n filePath: error[1],\n getComponent: error[0],\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n })\n : []\n\n const [Loading, loadingStyles, loadingScripts] = loading\n ? await createComponentStylesAndScripts({\n ctx,\n filePath: loading[1],\n getComponent: loading[0],\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n })\n : []\n\n const isLayout = typeof layout !== 'undefined'\n const isPage = typeof page !== 'undefined'\n const { mod: layoutOrPageMod, modType } = await getTracer().trace(\n NextNodeServerSpan.getLayoutOrPageModule,\n {\n hideSpan: !(isLayout || isPage),\n spanName: 'resolve segment modules',\n attributes: {\n 'next.segment': segment,\n },\n },\n () => getLayoutOrPageModule(tree)\n )\n\n /**\n * Checks if the current segment is a root layout.\n */\n const rootLayoutAtThisLevel = isLayout && !rootLayoutIncluded\n /**\n * Checks if the current segment or any level above it has a root layout.\n */\n const rootLayoutIncludedAtThisLevelOrAbove =\n rootLayoutIncluded || rootLayoutAtThisLevel\n\n const [NotFound, notFoundStyles] = notFound\n ? await createComponentStylesAndScripts({\n ctx,\n filePath: notFound[1],\n getComponent: notFound[0],\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n })\n : []\n\n const prefetchConfig = layoutOrPageMod\n ? (layoutOrPageMod as AppSegmentConfig).unstable_prefetch\n : undefined\n /** Whether this segment should use a runtime prefetch instead of a static prefetch. */\n const hasRuntimePrefetch = prefetchConfig?.mode === 'runtime'\n\n const [Forbidden, forbiddenStyles] =\n authInterrupts && forbidden\n ? await createComponentStylesAndScripts({\n ctx,\n filePath: forbidden[1],\n getComponent: forbidden[0],\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n })\n : []\n\n const [Unauthorized, unauthorizedStyles] =\n authInterrupts && unauthorized\n ? await createComponentStylesAndScripts({\n ctx,\n filePath: unauthorized[1],\n getComponent: unauthorized[0],\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n })\n : []\n\n let dynamic = layoutOrPageMod?.dynamic\n\n if (nextConfigOutput === 'export') {\n if (!dynamic || dynamic === 'auto') {\n dynamic = 'error'\n } else if (dynamic === 'force-dynamic') {\n // force-dynamic is always incompatible with 'export'. We must interrupt the build\n throw new StaticGenBailoutError(\n `Page with \\`dynamic = \"force-dynamic\"\\` couldn't be exported. \\`output: \"export\"\\` requires all pages be renderable statically because there is no runtime server to dynamically render routes in this output format. Learn more: https://nextjs.org/docs/app/building-your-application/deploying/static-exports`\n )\n }\n }\n\n if (typeof dynamic === 'string') {\n // the nested most config wins so we only force-static\n // if it's configured above any parent that configured\n // otherwise\n if (dynamic === 'error') {\n workStore.dynamicShouldError = true\n } else if (dynamic === 'force-dynamic') {\n workStore.forceDynamic = true\n\n // TODO: (PPR) remove this bailout once PPR is the default\n if (workStore.isStaticGeneration && !experimental.isRoutePPREnabled) {\n // If the postpone API isn't available, we can't postpone the render and\n // therefore we can't use the dynamic API.\n const err = new DynamicServerError(\n `Page with \\`dynamic = \"force-dynamic\"\\` won't be rendered statically.`\n )\n workStore.dynamicUsageDescription = err.message\n workStore.dynamicUsageStack = err.stack\n throw err\n }\n } else {\n workStore.dynamicShouldError = false\n workStore.forceStatic = dynamic === 'force-static'\n }\n }\n\n if (typeof layoutOrPageMod?.fetchCache === 'string') {\n workStore.fetchCache = layoutOrPageMod?.fetchCache\n }\n\n if (typeof layoutOrPageMod?.revalidate !== 'undefined') {\n validateRevalidate(layoutOrPageMod?.revalidate, workStore.route)\n }\n\n if (typeof layoutOrPageMod?.revalidate === 'number') {\n const defaultRevalidate = layoutOrPageMod.revalidate as number\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (workUnitStore) {\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-runtime':\n case 'prerender-legacy':\n case 'prerender-ppr':\n if (workUnitStore.revalidate > defaultRevalidate) {\n workUnitStore.revalidate = defaultRevalidate\n }\n break\n case 'request':\n // A request store doesn't have a revalidate property.\n break\n // createComponentTree is not called for these stores:\n case 'cache':\n case 'private-cache':\n case 'prerender-client':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n if (\n !workStore.forceStatic &&\n workStore.isStaticGeneration &&\n defaultRevalidate === 0 &&\n // If the postpone API isn't available, we can't postpone the render and\n // therefore we can't use the dynamic API.\n !experimental.isRoutePPREnabled\n ) {\n const dynamicUsageDescription = `revalidate: 0 configured ${segment}`\n workStore.dynamicUsageDescription = dynamicUsageDescription\n\n throw new DynamicServerError(dynamicUsageDescription)\n }\n }\n\n const isStaticGeneration = workStore.isStaticGeneration\n\n // Assume the segment we're rendering contains only partial data if PPR is\n // enabled and this is a statically generated response. This is used by the\n // client Segment Cache after a prefetch to determine if it can skip the\n // second request to fill in the dynamic data.\n //\n // It's OK for this to be `true` when the data is actually fully static, but\n // it's not OK for this to be `false` when the data possibly contains holes.\n // Although the value here is overly pessimistic, for prefetches, it will be\n // replaced by a more specific value when the data is later processed into\n // per-segment responses (see collect-segment-data.tsx)\n //\n // For dynamic requests, this must always be `false` because dynamic responses\n // are never partial.\n const isPossiblyPartialResponse =\n isStaticGeneration && experimental.isRoutePPREnabled === true\n\n const LayoutOrPage: ComponentType<any> | undefined = layoutOrPageMod\n ? interopDefault(layoutOrPageMod)\n : undefined\n\n /**\n * The React Component to render.\n */\n let MaybeComponent = LayoutOrPage\n\n if (process.env.NODE_ENV === 'development' || isStaticGeneration) {\n const { isValidElementType } =\n require('next/dist/compiled/react-is') as typeof import('next/dist/compiled/react-is')\n if (\n typeof MaybeComponent !== 'undefined' &&\n !isValidElementType(MaybeComponent)\n ) {\n errorMissingDefaultExport(pagePath, modType ?? 'page')\n }\n\n if (\n typeof ErrorComponent !== 'undefined' &&\n !isValidElementType(ErrorComponent)\n ) {\n errorMissingDefaultExport(pagePath, 'error')\n }\n\n if (typeof Loading !== 'undefined' && !isValidElementType(Loading)) {\n errorMissingDefaultExport(pagePath, 'loading')\n }\n\n if (typeof NotFound !== 'undefined' && !isValidElementType(NotFound)) {\n errorMissingDefaultExport(pagePath, 'not-found')\n }\n\n if (typeof Forbidden !== 'undefined' && !isValidElementType(Forbidden)) {\n errorMissingDefaultExport(pagePath, 'forbidden')\n }\n\n if (\n typeof Unauthorized !== 'undefined' &&\n !isValidElementType(Unauthorized)\n ) {\n errorMissingDefaultExport(pagePath, 'unauthorized')\n }\n }\n\n // Handle dynamic segment params.\n const segmentParam = getDynamicParamFromSegment(segment)\n\n // Create object holding the parent params and current params\n let currentParams: Params = parentParams\n if (segmentParam && segmentParam.value !== null) {\n currentParams = {\n ...parentParams,\n [segmentParam.param]: segmentParam.value,\n }\n }\n\n // Resolve the segment param\n const isSegmentViewEnabled = !!ctx.renderOpts.dev\n const dir =\n (process.env.NEXT_RUNTIME === 'edge'\n ? process.env.__NEXT_EDGE_PROJECT_DIR\n : ctx.renderOpts.dir) || ''\n\n const [notFoundElement, notFoundFilePath] =\n await createBoundaryConventionElement({\n ctx,\n conventionName: 'not-found',\n Component: NotFound,\n styles: notFoundStyles,\n tree,\n })\n\n const [forbiddenElement] = await createBoundaryConventionElement({\n ctx,\n conventionName: 'forbidden',\n Component: Forbidden,\n styles: forbiddenStyles,\n tree,\n })\n\n const [unauthorizedElement] = await createBoundaryConventionElement({\n ctx,\n conventionName: 'unauthorized',\n Component: Unauthorized,\n styles: unauthorizedStyles,\n tree,\n })\n\n // TODO: Combine this `map` traversal with the loop below that turns the array\n // into an object.\n const parallelRouteMap = await Promise.all(\n Object.keys(parallelRoutes).map(\n async (\n parallelRouteKey\n ): Promise<[string, React.ReactNode, CacheNodeSeedData | null]> => {\n const isChildrenRouteKey = parallelRouteKey === 'children'\n const parallelRoute = parallelRoutes[parallelRouteKey]\n\n const notFoundComponent = isChildrenRouteKey\n ? notFoundElement\n : undefined\n\n const forbiddenComponent = isChildrenRouteKey\n ? forbiddenElement\n : undefined\n\n const unauthorizedComponent = isChildrenRouteKey\n ? unauthorizedElement\n : undefined\n\n // if we're prefetching and that there's a Loading component, we bail out\n // otherwise we keep rendering for the prefetch.\n // We also want to bail out if there's no Loading component in the tree.\n let childCacheNodeSeedData: CacheNodeSeedData | null = null\n\n if (\n // Before PPR, the way instant navigations work in Next.js is we\n // prefetch everything up to the first route segment that defines a\n // loading.tsx boundary. (We do the same if there's no loading\n // boundary in the entire tree, because we don't want to prefetch too\n // much) The rest of the tree is deferred until the actual navigation.\n // It does not take into account whether the data is dynamic — even if\n // the tree is completely static, it will still defer everything\n // inside the loading boundary.\n //\n // This behavior predates PPR and is only relevant if the\n // PPR flag is not enabled.\n isPrefetch &&\n (Loading || !hasLoadingComponentInTree(parallelRoute)) &&\n // The approach with PPR is different — loading.tsx behaves like a\n // regular Suspense boundary and has no special behavior.\n //\n // With PPR, we prefetch as deeply as possible, and only defer when\n // dynamic data is accessed. If so, we only defer the nearest parent\n // Suspense boundary of the dynamic data access, regardless of whether\n // the boundary is defined by loading.tsx or a normal <Suspense>\n // component in userspace.\n //\n // NOTE: In practice this usually means we'll end up prefetching more\n // than we were before PPR, which may or may not be considered a\n // performance regression by some apps. The plan is to address this\n // before General Availability of PPR by introducing granular\n // per-segment fetching, so we can reuse as much of the tree as\n // possible during both prefetches and dynamic navigations. But during\n // the beta period, we should be clear about this trade off in our\n // communications.\n !experimental.isRoutePPREnabled\n ) {\n // Don't prefetch this child. This will trigger a lazy fetch by the\n // client router.\n } else {\n // Create the child component\n\n if (process.env.NODE_ENV === 'development' && missingSlots) {\n // When we detect the default fallback (which triggers a 404), we collect the missing slots\n // to provide more helpful debug information during development mode.\n const parsedTree = parseLoaderTree(parallelRoute)\n if (\n parsedTree.conventionPath?.endsWith(PARALLEL_ROUTE_DEFAULT_PATH)\n ) {\n missingSlots.add(parallelRouteKey)\n }\n }\n\n const seedData = await createComponentTreeInternal(\n {\n loaderTree: parallelRoute,\n parentParams: currentParams,\n rootLayoutIncluded: rootLayoutIncludedAtThisLevelOrAbove,\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n injectedFontPreloadTags: injectedFontPreloadTagsWithCurrentLayout,\n ctx,\n missingSlots,\n preloadCallbacks,\n authInterrupts,\n // `StreamingMetadataOutlet` is used to conditionally throw. In the case of parallel routes we will have more than one page\n // but we only want to throw on the first one.\n MetadataOutlet: isChildrenRouteKey ? MetadataOutlet : null,\n },\n false\n )\n\n childCacheNodeSeedData = seedData\n }\n\n const templateNode = createElement(\n Template,\n null,\n createElement(RenderFromTemplateContext, null)\n )\n\n const templateFilePath = getConventionPathByType(tree, dir, 'template')\n const errorFilePath = getConventionPathByType(tree, dir, 'error')\n const loadingFilePath = getConventionPathByType(tree, dir, 'loading')\n const globalErrorFilePath = isRoot\n ? getConventionPathByType(tree, dir, 'global-error')\n : undefined\n\n const wrappedErrorStyles =\n isSegmentViewEnabled && errorFilePath\n ? createElement(\n SegmentViewNode,\n {\n type: 'error',\n pagePath: errorFilePath,\n },\n errorStyles\n )\n : errorStyles\n\n // Add a suffix to avoid conflict with the segment view node representing rendered file.\n // existence: not-found.tsx@boundary\n // rendered: not-found.tsx\n const fileNameSuffix = BOUNDARY_SUFFIX\n const segmentViewBoundaries = isSegmentViewEnabled\n ? createElement(\n Fragment,\n null,\n notFoundFilePath &&\n createElement(SegmentViewNode, {\n type: `${BOUNDARY_PREFIX}not-found`,\n pagePath: notFoundFilePath + fileNameSuffix,\n }),\n loadingFilePath &&\n createElement(SegmentViewNode, {\n type: `${BOUNDARY_PREFIX}loading`,\n pagePath: loadingFilePath + fileNameSuffix,\n }),\n errorFilePath &&\n createElement(SegmentViewNode, {\n type: `${BOUNDARY_PREFIX}error`,\n pagePath: errorFilePath + fileNameSuffix,\n }),\n globalErrorFilePath &&\n createElement(SegmentViewNode, {\n type: `${BOUNDARY_PREFIX}global-error`,\n pagePath: isNextjsBuiltinFilePath(globalErrorFilePath)\n ? `${BUILTIN_PREFIX}global-error.js${fileNameSuffix}`\n : globalErrorFilePath,\n })\n )\n : null\n\n return [\n parallelRouteKey,\n createElement(LayoutRouter, {\n parallelRouterKey: parallelRouteKey,\n error: ErrorComponent,\n errorStyles: wrappedErrorStyles,\n errorScripts: errorScripts,\n template:\n isSegmentViewEnabled && templateFilePath\n ? createElement(\n SegmentViewNode,\n {\n type: 'template',\n pagePath: templateFilePath,\n },\n templateNode\n )\n : templateNode,\n templateStyles: templateStyles,\n templateScripts: templateScripts,\n notFound: notFoundComponent,\n forbidden: forbiddenComponent,\n unauthorized: unauthorizedComponent,\n ...(isSegmentViewEnabled && {\n segmentViewBoundaries,\n }),\n }),\n childCacheNodeSeedData,\n ]\n }\n )\n )\n\n // Convert the parallel route map into an object after all promises have been resolved.\n let parallelRouteProps: { [key: string]: React.ReactNode } = {}\n let parallelRouteCacheNodeSeedData: {\n [key: string]: CacheNodeSeedData | null\n } = {}\n for (const parallelRoute of parallelRouteMap) {\n const [parallelRouteKey, parallelRouteProp, flightData] = parallelRoute\n parallelRouteProps[parallelRouteKey] = parallelRouteProp\n parallelRouteCacheNodeSeedData[parallelRouteKey] = flightData\n }\n\n let loadingElement = Loading\n ? createElement(Loading, {\n key: 'l',\n })\n : null\n const loadingFilePath = getConventionPathByType(tree, dir, 'loading')\n if (isSegmentViewEnabled && loadingElement) {\n if (loadingFilePath) {\n loadingElement = createElement(\n SegmentViewNode,\n {\n key: cacheNodeKey + '-loading',\n type: 'loading',\n pagePath: loadingFilePath,\n },\n loadingElement\n )\n }\n }\n\n const loadingData: LoadingModuleData = loadingElement\n ? [loadingElement, loadingStyles, loadingScripts]\n : null\n\n // When the segment does not have a layout or page we still have to add the layout router to ensure the path holds the loading component\n if (!MaybeComponent) {\n return [\n createElement(\n Fragment,\n {\n key: cacheNodeKey,\n },\n layerAssets,\n parallelRouteProps.children\n ),\n parallelRouteCacheNodeSeedData,\n loadingData,\n isPossiblyPartialResponse,\n hasRuntimePrefetch,\n ]\n }\n\n const Component = MaybeComponent\n // If force-dynamic is used and the current render supports postponing, we\n // replace it with a node that will postpone the render. This ensures that the\n // postpone is invoked during the react render phase and not during the next\n // render phase.\n // @TODO this does not actually do what it seems like it would or should do. The idea is that\n // if we are rendering in a force-dynamic mode and we can postpone we should only make the segments\n // that ask for force-dynamic to be dynamic, allowing other segments to still prerender. However\n // because this comes after the children traversal and the static generation store is mutated every segment\n // along the parent path of a force-dynamic segment will hit this condition effectively making the entire\n // render force-dynamic. We should refactor this function so that we can correctly track which segments\n // need to be dynamic\n if (\n workStore.isStaticGeneration &&\n workStore.forceDynamic &&\n experimental.isRoutePPREnabled\n ) {\n return [\n createElement(\n Fragment,\n {\n key: cacheNodeKey,\n },\n createElement(Postpone, {\n reason: 'dynamic = \"force-dynamic\" was used',\n route: workStore.route,\n }),\n layerAssets\n ),\n parallelRouteCacheNodeSeedData,\n loadingData,\n true,\n hasRuntimePrefetch,\n ]\n }\n\n const isClientComponent = isClientReference(layoutOrPageMod)\n\n if (\n process.env.NODE_ENV === 'development' &&\n 'params' in parallelRouteProps\n ) {\n // @TODO consider making this an error and running the check in build as well\n console.error(\n `\"params\" is a reserved prop in Layouts and Pages and cannot be used as the name of a parallel route in ${segment}`\n )\n }\n\n if (isPage) {\n const PageComponent = Component\n\n // Assign searchParams to props if this is a page\n let pageElement: React.ReactNode\n if (isClientComponent) {\n if (cacheComponents) {\n // Params are omitted when Cache Components is enabled\n pageElement = createElement(ClientPageRoot, {\n Component: PageComponent,\n serverProvidedParams: null,\n })\n } else if (isStaticGeneration) {\n const promiseOfParams =\n createPrerenderParamsForClientSegment(currentParams)\n const promiseOfSearchParams =\n createPrerenderSearchParamsForClientPage(workStore)\n pageElement = createElement(ClientPageRoot, {\n Component: PageComponent,\n serverProvidedParams: {\n searchParams: query,\n params: currentParams,\n promises: [promiseOfSearchParams, promiseOfParams],\n },\n })\n } else {\n pageElement = createElement(ClientPageRoot, {\n Component: PageComponent,\n serverProvidedParams: {\n searchParams: query,\n params: currentParams,\n promises: null,\n },\n })\n }\n } else {\n // If we are passing params to a server component Page we need to track\n // their usage in case the current render mode tracks dynamic API usage.\n const params = createServerParamsForServerSegment(\n currentParams,\n workStore\n )\n\n // If we are passing searchParams to a server component Page we need to\n // track their usage in case the current render mode tracks dynamic API\n // usage.\n let searchParams = createServerSearchParamsForServerPage(query, workStore)\n\n if (isUseCacheFunction(PageComponent)) {\n const UseCachePageComponent: ComponentType<UseCachePageProps> =\n PageComponent\n\n pageElement = createElement(UseCachePageComponent, {\n params: params,\n searchParams: searchParams,\n $$isPage: true,\n })\n } else {\n pageElement = createElement(PageComponent, {\n params: params,\n searchParams: searchParams,\n })\n }\n }\n\n const isDefaultSegment = segment === DEFAULT_SEGMENT_KEY\n const pageFilePath =\n getConventionPathByType(tree, dir, 'page') ??\n getConventionPathByType(tree, dir, 'defaultPage')\n const segmentType = isDefaultSegment ? 'default' : 'page'\n const wrappedPageElement =\n isSegmentViewEnabled && pageFilePath\n ? createElement(\n SegmentViewNode,\n {\n key: cacheNodeKey + '-' + segmentType,\n type: segmentType,\n pagePath: pageFilePath,\n },\n pageElement\n )\n : pageElement\n\n return [\n createElement(\n Fragment,\n {\n key: cacheNodeKey,\n },\n wrappedPageElement,\n layerAssets,\n MetadataOutlet ? createElement(MetadataOutlet, null) : null\n ),\n parallelRouteCacheNodeSeedData,\n loadingData,\n isPossiblyPartialResponse,\n hasRuntimePrefetch,\n ]\n } else {\n const SegmentComponent = Component\n const isRootLayoutWithChildrenSlotAndAtLeastOneMoreSlot =\n rootLayoutAtThisLevel &&\n 'children' in parallelRoutes &&\n Object.keys(parallelRoutes).length > 1\n\n let segmentNode: React.ReactNode\n\n if (isClientComponent) {\n let clientSegment: React.ReactNode\n if (cacheComponents) {\n // Params are omitted when Cache Components is enabled\n clientSegment = createElement(ClientSegmentRoot, {\n Component: SegmentComponent,\n slots: parallelRouteProps,\n serverProvidedParams: null,\n })\n } else if (isStaticGeneration) {\n const promiseOfParams =\n createPrerenderParamsForClientSegment(currentParams)\n\n clientSegment = createElement(ClientSegmentRoot, {\n Component: SegmentComponent,\n slots: parallelRouteProps,\n serverProvidedParams: {\n params: currentParams,\n promises: [promiseOfParams],\n },\n })\n } else {\n clientSegment = createElement(ClientSegmentRoot, {\n Component: SegmentComponent,\n slots: parallelRouteProps,\n serverProvidedParams: {\n params: currentParams,\n promises: null,\n },\n })\n }\n\n if (isRootLayoutWithChildrenSlotAndAtLeastOneMoreSlot) {\n let notfoundClientSegment: React.ReactNode\n let forbiddenClientSegment: React.ReactNode\n let unauthorizedClientSegment: React.ReactNode\n // TODO-APP: This is a hack to support unmatched parallel routes, which will throw `notFound()`.\n // This ensures that a `HTTPAccessFallbackBoundary` is available for when that happens,\n // but it's not ideal, as it needlessly invokes the `NotFound` component and renders the `RootLayout` twice.\n // We should instead look into handling the fallback behavior differently in development mode so that it doesn't\n // rely on the `NotFound` behavior.\n notfoundClientSegment = createErrorBoundaryClientSegmentRoot({\n ctx,\n ErrorBoundaryComponent: NotFound,\n errorElement: notFoundElement,\n ClientSegmentRoot,\n layerAssets,\n SegmentComponent,\n currentParams,\n })\n forbiddenClientSegment = createErrorBoundaryClientSegmentRoot({\n ctx,\n ErrorBoundaryComponent: Forbidden,\n errorElement: forbiddenElement,\n ClientSegmentRoot,\n layerAssets,\n SegmentComponent,\n currentParams,\n })\n unauthorizedClientSegment = createErrorBoundaryClientSegmentRoot({\n ctx,\n ErrorBoundaryComponent: Unauthorized,\n errorElement: unauthorizedElement,\n ClientSegmentRoot,\n layerAssets,\n SegmentComponent,\n currentParams,\n })\n if (\n notfoundClientSegment ||\n forbiddenClientSegment ||\n unauthorizedClientSegment\n ) {\n segmentNode = createElement(\n HTTPAccessFallbackBoundary,\n {\n key: cacheNodeKey,\n notFound: notfoundClientSegment,\n forbidden: forbiddenClientSegment,\n unauthorized: unauthorizedClientSegment,\n },\n layerAssets,\n clientSegment\n )\n } else {\n segmentNode = createElement(\n Fragment,\n {\n key: cacheNodeKey,\n },\n layerAssets,\n clientSegment\n )\n }\n } else {\n segmentNode = createElement(\n Fragment,\n {\n key: cacheNodeKey,\n },\n layerAssets,\n clientSegment\n )\n }\n } else {\n const params = createServerParamsForServerSegment(\n currentParams,\n workStore\n )\n\n let serverSegment: React.ReactNode\n\n if (isUseCacheFunction(SegmentComponent)) {\n const UseCacheLayoutComponent: ComponentType<UseCacheLayoutProps> =\n SegmentComponent\n\n serverSegment = createElement(\n UseCacheLayoutComponent,\n {\n ...parallelRouteProps,\n params: params,\n $$isLayout: true,\n },\n // Force static children here so that they're validated.\n // See https://github.com/facebook/react/pull/34846\n parallelRouteProps.children\n )\n } else {\n serverSegment = createElement(\n SegmentComponent,\n {\n ...parallelRouteProps,\n params: params,\n },\n // Force static children here so that they're validated.\n // See https://github.com/facebook/react/pull/34846\n parallelRouteProps.children\n )\n }\n\n if (isRootLayoutWithChildrenSlotAndAtLeastOneMoreSlot) {\n // TODO-APP: This is a hack to support unmatched parallel routes, which will throw `notFound()`.\n // This ensures that a `HTTPAccessFallbackBoundary` is available for when that happens,\n // but it's not ideal, as it needlessly invokes the `NotFound` component and renders the `RootLayout` twice.\n // We should instead look into handling the fallback behavior differently in development mode so that it doesn't\n // rely on the `NotFound` behavior.\n segmentNode = createElement(\n HTTPAccessFallbackBoundary,\n {\n key: cacheNodeKey,\n notFound: notFoundElement\n ? createElement(\n Fragment,\n null,\n layerAssets,\n createElement(\n SegmentComponent,\n {\n params: params,\n },\n notFoundStyles,\n notFoundElement\n )\n )\n : undefined,\n },\n layerAssets,\n serverSegment\n )\n } else {\n segmentNode = createElement(\n Fragment,\n {\n key: cacheNodeKey,\n },\n layerAssets,\n serverSegment\n )\n }\n }\n\n const layoutFilePath = getConventionPathByType(tree, dir, 'layout')\n const wrappedSegmentNode =\n isSegmentViewEnabled && layoutFilePath\n ? createElement(\n SegmentViewNode,\n {\n key: 'layout',\n type: 'layout',\n pagePath: layoutFilePath,\n },\n segmentNode\n )\n : segmentNode\n\n // For layouts we just render the component\n return [\n wrappedSegmentNode,\n parallelRouteCacheNodeSeedData,\n loadingData,\n isPossiblyPartialResponse,\n hasRuntimePrefetch,\n ]\n }\n}\n\nfunction createErrorBoundaryClientSegmentRoot({\n ctx,\n ErrorBoundaryComponent,\n errorElement,\n ClientSegmentRoot,\n layerAssets,\n SegmentComponent,\n currentParams,\n}: {\n ctx: AppRenderContext\n ErrorBoundaryComponent: ComponentType<any> | undefined\n errorElement: React.ReactNode\n ClientSegmentRoot: ComponentType<any>\n layerAssets: React.ReactNode\n SegmentComponent: ComponentType<any>\n currentParams: Params\n}) {\n const {\n componentMod: { createElement, Fragment },\n } = ctx\n if (ErrorBoundaryComponent) {\n const notFoundParallelRouteProps = {\n children: errorElement,\n }\n return createElement(\n Fragment,\n null,\n layerAssets,\n createElement(ClientSegmentRoot, {\n Component: SegmentComponent,\n slots: notFoundParallelRouteProps,\n params: currentParams,\n })\n )\n }\n return null\n}\n\nexport function getRootParams(\n loaderTree: LoaderTree,\n getDynamicParamFromSegment: GetDynamicParamFromSegment\n): Params {\n return getRootParamsImpl({}, loaderTree, getDynamicParamFromSegment)\n}\n\nfunction getRootParamsImpl(\n parentParams: Params,\n loaderTree: LoaderTree,\n getDynamicParamFromSegment: GetDynamicParamFromSegment\n): Params {\n const {\n segment,\n modules: { layout },\n parallelRoutes,\n } = parseLoaderTree(loaderTree)\n\n const segmentParam = getDynamicParamFromSegment(segment)\n\n let currentParams: Params = parentParams\n if (segmentParam && segmentParam.value !== null) {\n currentParams = {\n ...parentParams,\n [segmentParam.param]: segmentParam.value,\n }\n }\n\n const isRootLayout = typeof layout !== 'undefined'\n\n if (isRootLayout) {\n return currentParams\n } else if (!parallelRoutes.children) {\n // This should really be an error but there are bugs in Turbopack that cause\n // the _not-found LoaderTree to not have any layouts. For rootParams sake\n // this is somewhat irrelevant when you are not customizing the 404 page.\n // If you are customizing 404\n // TODO update rootParams to make all params optional if `/app/not-found.tsx` is defined\n return currentParams\n } else {\n return getRootParamsImpl(\n currentParams,\n // We stop looking for root params as soon as we hit the first layout\n // and it is not possible to use parallel route children above the root layout\n // so every parallelRoutes object that this function can visit will necessarily\n // have a single `children` prop and no others.\n parallelRoutes.children,\n getDynamicParamFromSegment\n )\n }\n}\n\nasync function createBoundaryConventionElement({\n ctx,\n conventionName,\n Component,\n styles,\n tree,\n}: {\n ctx: AppRenderContext\n conventionName:\n | 'not-found'\n | 'error'\n | 'loading'\n | 'forbidden'\n | 'unauthorized'\n Component: ComponentType<any> | undefined\n styles: React.ReactNode | undefined\n tree: LoaderTree\n}) {\n const {\n componentMod: { createElement, Fragment },\n } = ctx\n const isSegmentViewEnabled = !!ctx.renderOpts.dev\n const dir =\n (process.env.NEXT_RUNTIME === 'edge'\n ? process.env.__NEXT_EDGE_PROJECT_DIR\n : ctx.renderOpts.dir) || ''\n const { SegmentViewNode } = ctx.componentMod\n const element = Component\n ? createElement(Fragment, null, createElement(Component, null), styles)\n : undefined\n\n const pagePath = getConventionPathByType(tree, dir, conventionName)\n\n const wrappedElement =\n isSegmentViewEnabled && element\n ? createElement(\n SegmentViewNode,\n {\n key: cacheNodeKey + '-' + conventionName,\n type: conventionName,\n // TODO: Discovered when moving to `createElement`.\n // `SegmentViewNode` doesn't support undefined `pagePath`\n pagePath: pagePath!,\n },\n element\n )\n : element\n\n return [wrappedElement, pagePath] as const\n}\n","import { getLinkAndScriptTags } from './get-css-inlined-link-tags'\nimport { getPreloadableFonts } from './get-preloadable-fonts'\nimport type { AppRenderContext } from './app-render'\nimport { getAssetQueryString } from './get-asset-query-string'\nimport { encodeURIPath } from '../../shared/lib/encode-uri-path'\nimport type { PreloadCallbacks } from './types'\nimport { renderCssResource } from './render-css-resource'\n\nexport function getLayerAssets({\n ctx,\n layoutOrPagePath,\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n injectedFontPreloadTags: injectedFontPreloadTagsWithCurrentLayout,\n preloadCallbacks,\n}: {\n layoutOrPagePath: string | undefined\n injectedCSS: Set<string>\n injectedJS: Set<string>\n injectedFontPreloadTags: Set<string>\n ctx: AppRenderContext\n preloadCallbacks: PreloadCallbacks\n}): React.ReactNode {\n const {\n componentMod: { createElement },\n } = ctx\n const { styles: styleTags, scripts: scriptTags } = layoutOrPagePath\n ? getLinkAndScriptTags(\n ctx.clientReferenceManifest,\n layoutOrPagePath,\n injectedCSSWithCurrentLayout,\n injectedJSWithCurrentLayout,\n true\n )\n : { styles: [], scripts: [] }\n\n const preloadedFontFiles = layoutOrPagePath\n ? getPreloadableFonts(\n ctx.renderOpts.nextFontManifest,\n layoutOrPagePath,\n injectedFontPreloadTagsWithCurrentLayout\n )\n : null\n\n if (preloadedFontFiles) {\n if (preloadedFontFiles.length) {\n for (let i = 0; i < preloadedFontFiles.length; i++) {\n const fontFilename = preloadedFontFiles[i]\n const ext = /\\.(woff|woff2|eot|ttf|otf)$/.exec(fontFilename)![1]\n const type = `font/${ext}`\n const href = `${ctx.assetPrefix}/_next/${encodeURIPath(fontFilename)}`\n\n preloadCallbacks.push(() => {\n ctx.componentMod.preloadFont(\n href,\n type,\n ctx.renderOpts.crossOrigin,\n ctx.nonce\n )\n })\n }\n } else {\n try {\n let url = new URL(ctx.assetPrefix)\n preloadCallbacks.push(() => {\n ctx.componentMod.preconnect(url.origin, 'anonymous', ctx.nonce)\n })\n } catch (error) {\n // assetPrefix must not be a fully qualified domain name. We assume\n // we should preconnect to same origin instead\n preloadCallbacks.push(() => {\n ctx.componentMod.preconnect('/', 'anonymous', ctx.nonce)\n })\n }\n }\n }\n\n const styles = renderCssResource(styleTags, ctx, preloadCallbacks)\n\n const scripts = scriptTags\n ? scriptTags.map((href, index) => {\n const fullSrc = `${ctx.assetPrefix}/_next/${encodeURIPath(\n href\n )}${getAssetQueryString(ctx, true)}`\n\n return createElement('script', {\n src: fullSrc,\n async: true,\n key: `script-${index}`,\n nonce: ctx.nonce,\n })\n })\n : []\n\n return styles.length || scripts.length ? [...styles, ...scripts] : null\n}\n","import type {\n FlightDataPath,\n FlightDataSegment,\n FlightRouterState,\n Segment,\n HeadData,\n} from '../../shared/lib/app-router-types'\nimport type { PreloadCallbacks } from './types'\nimport { matchSegment } from '../../client/components/match-segments'\nimport type { LoaderTree } from '../lib/app-dir-module'\nimport { getLinkAndScriptTags } from './get-css-inlined-link-tags'\nimport { getPreloadableFonts } from './get-preloadable-fonts'\nimport {\n createFlightRouterStateFromLoaderTree,\n createRouteTreePrefetch,\n} from './create-flight-router-state-from-loader-tree'\nimport type { AppRenderContext } from './app-render'\nimport { hasLoadingComponentInTree } from './has-loading-component-in-tree'\nimport { addSearchParamsIfPageSegment } from '../../shared/lib/segment'\nimport { createComponentTree } from './create-component-tree'\nimport { getSegmentParam } from '../../shared/lib/router/utils/get-segment-param'\n\n/**\n * Use router state to decide at what common layout to render the page.\n * This can either be the common layout between two pages or a specific place to start rendering from using the \"refetch\" marker in the tree.\n */\nexport async function walkTreeWithFlightRouterState({\n loaderTreeToFilter,\n parentParams,\n flightRouterState,\n parentIsInsideSharedLayout,\n rscHead,\n injectedCSS,\n injectedJS,\n injectedFontPreloadTags,\n rootLayoutIncluded,\n ctx,\n preloadCallbacks,\n MetadataOutlet,\n}: {\n loaderTreeToFilter: LoaderTree\n parentParams: { [key: string]: string | string[] }\n flightRouterState?: FlightRouterState\n rscHead: HeadData\n parentIsInsideSharedLayout?: boolean\n injectedCSS: Set<string>\n injectedJS: Set<string>\n injectedFontPreloadTags: Set<string>\n rootLayoutIncluded: boolean\n ctx: AppRenderContext\n preloadCallbacks: PreloadCallbacks\n MetadataOutlet: React.ComponentType\n}): Promise<FlightDataPath[]> {\n const {\n renderOpts: { nextFontManifest, experimental },\n query,\n isPrefetch,\n getDynamicParamFromSegment,\n parsedRequestHeaders,\n } = ctx\n\n const [segment, parallelRoutes, modules] = loaderTreeToFilter\n\n const parallelRoutesKeys = Object.keys(parallelRoutes)\n\n const { layout } = modules\n const isLayout = typeof layout !== 'undefined'\n\n /**\n * Checks if the current segment is a root layout.\n */\n const rootLayoutAtThisLevel = isLayout && !rootLayoutIncluded\n /**\n * Checks if the current segment or any level above it has a root layout.\n */\n const rootLayoutIncludedAtThisLevelOrAbove =\n rootLayoutIncluded || rootLayoutAtThisLevel\n\n // Because this function walks to a deeper point in the tree to start rendering we have to track the dynamic parameters up to the point where rendering starts\n const segmentParam = getDynamicParamFromSegment(segment)\n const currentParams =\n // Handle null case where dynamic param is optional\n segmentParam && segmentParam.value !== null\n ? {\n ...parentParams,\n [segmentParam.param]: segmentParam.value,\n }\n : parentParams\n const actualSegment: Segment = addSearchParamsIfPageSegment(\n segmentParam ? segmentParam.treeSegment : segment,\n query\n )\n\n /**\n * Decide if the current segment is where rendering has to start.\n */\n const renderComponentsOnThisLevel =\n // No further router state available\n !flightRouterState ||\n // Segment in router state does not match current segment\n !matchSegment(actualSegment, flightRouterState[0]) ||\n // Last item in the tree\n parallelRoutesKeys.length === 0 ||\n // Explicit refresh\n flightRouterState[3] === 'refetch'\n\n // Pre-PPR, the `loading` component signals to the router how deep to render the component tree\n // to ensure prefetches are quick and inexpensive. If there's no `loading` component anywhere in the tree being rendered,\n // the prefetch will be short-circuited to avoid requesting a potentially very expensive subtree. If there's a `loading`\n // somewhere in the tree, we'll recursively render the component tree up until we encounter that loading component, and then stop.\n\n // Check if we're inside the \"new\" part of the navigation — inside the\n // shared layout. In the case of a prefetch, this can be true even if the\n // segment matches, because the client might send a matching segment to\n // indicate that it already has the data in its cache. But in order to find\n // the correct loading boundary, we still need to track where the shared\n // layout begins.\n //\n // TODO: We should rethink the protocol for dynamic requests. It might not\n // make sense for the client to send a FlightRouterState, since that type is\n // overloaded with other concerns.\n const isInsideSharedLayout =\n renderComponentsOnThisLevel ||\n parentIsInsideSharedLayout ||\n flightRouterState[3] === 'inside-shared-layout'\n\n if (\n isInsideSharedLayout &&\n !experimental.isRoutePPREnabled &&\n // If PPR is disabled, and this is a request for the route tree, then we\n // never render any components. Only send the router state.\n (parsedRequestHeaders.isRouteTreePrefetchRequest ||\n // Otherwise, check for the presence of a `loading` component.\n (isPrefetch &&\n !Boolean(modules.loading) &&\n !hasLoadingComponentInTree(loaderTreeToFilter)))\n ) {\n // Send only the router state.\n // TODO: Even for a dynamic route, we should cache these responses,\n // because they do not contain any render data (neither segment data nor\n // the head). They can be made even more cacheable once we move the route\n // params into a separate data structure.\n const overriddenSegment =\n flightRouterState &&\n // TODO: Why does canSegmentBeOverridden exist? Why don't we always just\n // use `actualSegment`? Is it to avoid overwriting some state that's\n // tracked by the client? Dig deeper to see if we can simplify this.\n canSegmentBeOverridden(actualSegment, flightRouterState[0])\n ? flightRouterState[0]\n : actualSegment\n\n const routerState = parsedRequestHeaders.isRouteTreePrefetchRequest\n ? // Route tree prefetch requests contain some extra information\n createRouteTreePrefetch(loaderTreeToFilter, getDynamicParamFromSegment)\n : createFlightRouterStateFromLoaderTree(\n loaderTreeToFilter,\n getDynamicParamFromSegment,\n query\n )\n\n return [\n [\n overriddenSegment,\n routerState,\n null,\n [null, null],\n true,\n ] satisfies FlightDataSegment,\n ]\n }\n\n // Similar to the previous branch. This flag is sent by the client to request\n // only the metadata for a page. No segment data.\n if (flightRouterState && flightRouterState[3] === 'metadata-only') {\n const overriddenSegment =\n flightRouterState &&\n canSegmentBeOverridden(actualSegment, flightRouterState[0])\n ? flightRouterState[0]\n : actualSegment\n const routerState = parsedRequestHeaders.isRouteTreePrefetchRequest\n ? createRouteTreePrefetch(loaderTreeToFilter, getDynamicParamFromSegment)\n : createFlightRouterStateFromLoaderTree(\n loaderTreeToFilter,\n getDynamicParamFromSegment,\n query\n )\n return [\n [\n overriddenSegment,\n routerState,\n null,\n rscHead,\n false,\n ] satisfies FlightDataSegment,\n ]\n }\n\n if (renderComponentsOnThisLevel) {\n const overriddenSegment =\n flightRouterState &&\n // TODO: Why does canSegmentBeOverridden exist? Why don't we always just\n // use `actualSegment`? Is it to avoid overwriting some state that's\n // tracked by the client? Dig deeper to see if we can simplify this.\n canSegmentBeOverridden(actualSegment, flightRouterState[0])\n ? flightRouterState[0]\n : actualSegment\n\n const routerState = createFlightRouterStateFromLoaderTree(\n // Create router state using the slice of the loaderTree\n loaderTreeToFilter,\n getDynamicParamFromSegment,\n query\n )\n\n // Create component tree using the slice of the loaderTree\n const seedData = await createComponentTree(\n // This ensures flightRouterPath is valid and filters down the tree\n {\n ctx,\n loaderTree: loaderTreeToFilter,\n parentParams: currentParams,\n injectedCSS,\n injectedJS,\n injectedFontPreloadTags,\n // This is intentionally not \"rootLayoutIncludedAtThisLevelOrAbove\" as createComponentTree starts at the current level and does a check for \"rootLayoutAtThisLevel\" too.\n rootLayoutIncluded,\n preloadCallbacks,\n authInterrupts: experimental.authInterrupts,\n MetadataOutlet,\n }\n )\n\n return [\n [\n overriddenSegment,\n routerState,\n seedData,\n rscHead,\n false,\n ] satisfies FlightDataSegment,\n ]\n }\n\n // If we are not rendering on this level we need to check if the current\n // segment has a layout. If so, we need to track all the used CSS to make\n // the result consistent.\n const layoutPath = layout?.[1]\n const injectedCSSWithCurrentLayout = new Set(injectedCSS)\n const injectedJSWithCurrentLayout = new Set(injectedJS)\n const injectedFontPreloadTagsWithCurrentLayout = new Set(\n injectedFontPreloadTags\n )\n if (layoutPath) {\n getLinkAndScriptTags(\n ctx.clientReferenceManifest,\n layoutPath,\n injectedCSSWithCurrentLayout,\n injectedJSWithCurrentLayout,\n true\n )\n getPreloadableFonts(\n nextFontManifest,\n layoutPath,\n injectedFontPreloadTagsWithCurrentLayout\n )\n }\n\n const paths: FlightDataPath[] = []\n\n // Walk through all parallel routes.\n for (const parallelRouteKey of parallelRoutesKeys) {\n const parallelRoute = parallelRoutes[parallelRouteKey]\n\n const subPaths = await walkTreeWithFlightRouterState({\n ctx,\n loaderTreeToFilter: parallelRoute,\n parentParams: currentParams,\n flightRouterState:\n flightRouterState && flightRouterState[1][parallelRouteKey],\n parentIsInsideSharedLayout: isInsideSharedLayout,\n rscHead,\n injectedCSS: injectedCSSWithCurrentLayout,\n injectedJS: injectedJSWithCurrentLayout,\n injectedFontPreloadTags: injectedFontPreloadTagsWithCurrentLayout,\n rootLayoutIncluded: rootLayoutIncludedAtThisLevelOrAbove,\n preloadCallbacks,\n MetadataOutlet,\n })\n\n for (const subPath of subPaths) {\n paths.push([actualSegment, parallelRouteKey, ...subPath])\n }\n }\n\n return paths\n}\n\n/*\n * This function is used to determine if an existing segment can be overridden\n * by the incoming segment.\n */\nconst canSegmentBeOverridden = (\n existingSegment: Segment,\n segment: Segment\n): boolean => {\n if (Array.isArray(existingSegment) || !Array.isArray(segment)) {\n return false\n }\n\n return getSegmentParam(existingSegment)?.param === segment[0]\n}\n","import type { ActionManifest } from '../../build/webpack/plugins/flight-client-entry-plugin'\nimport type {\n ClientReferenceManifest,\n ClientReferenceManifestForRsc,\n} from '../../build/webpack/plugins/flight-manifest-plugin'\nimport type { DeepReadonly } from '../../shared/lib/deep-readonly'\nimport { InvariantError } from '../../shared/lib/invariant-error'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { workAsyncStorage } from './work-async-storage.external'\n\nlet __next_loaded_action_key: CryptoKey\n\nexport function arrayBufferToString(\n buffer: ArrayBuffer | Uint8Array<ArrayBufferLike>\n) {\n const bytes = new Uint8Array(buffer)\n const len = bytes.byteLength\n\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 as unknown as number[])\n }\n\n let binary = ''\n for (let i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i])\n }\n return binary\n}\n\nexport function stringToUint8Array(binary: string) {\n const len = binary.length\n const arr = new Uint8Array(len)\n\n for (let i = 0; i < len; i++) {\n arr[i] = binary.charCodeAt(i)\n }\n\n return arr\n}\n\nexport function encrypt(\n key: CryptoKey,\n iv: Uint8Array<ArrayBuffer>,\n data: Uint8Array<ArrayBuffer>\n) {\n return crypto.subtle.encrypt(\n {\n name: 'AES-GCM',\n iv,\n },\n key,\n data\n )\n}\n\nexport function decrypt(\n key: CryptoKey,\n iv: Uint8Array<ArrayBuffer>,\n data: Uint8Array<ArrayBuffer>\n) {\n return crypto.subtle.decrypt(\n {\n name: 'AES-GCM',\n iv,\n },\n key,\n data\n )\n}\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(\n 'next.server.action-manifests'\n)\n\nexport function setReferenceManifestsSingleton({\n page,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap,\n}: {\n page: string\n clientReferenceManifest: DeepReadonly<ClientReferenceManifest>\n serverActionsManifest: DeepReadonly<ActionManifest>\n serverModuleMap: {\n [id: string]: {\n id: string\n chunks: string[]\n name: string\n }\n }\n}) {\n // @ts-expect-error\n const clientReferenceManifestsPerPage = globalThis[\n SERVER_ACTION_MANIFESTS_SINGLETON\n ]?.clientReferenceManifestsPerPage as\n | undefined\n | DeepReadonly<Record<string, ClientReferenceManifest>>\n\n // @ts-expect-error\n globalThis[SERVER_ACTION_MANIFESTS_SINGLETON] = {\n clientReferenceManifestsPerPage: {\n ...clientReferenceManifestsPerPage,\n [normalizeAppPath(page)]: clientReferenceManifest,\n },\n serverActionsManifest,\n serverModuleMap,\n }\n}\n\nexport function getServerModuleMap() {\n const serverActionsManifestSingleton = (globalThis as any)[\n SERVER_ACTION_MANIFESTS_SINGLETON\n ] as {\n serverModuleMap: {\n [id: string]: {\n id: string\n chunks: string[]\n name: string\n }\n }\n }\n\n if (!serverActionsManifestSingleton) {\n throw new InvariantError('Missing manifest for Server Actions.')\n }\n\n return serverActionsManifestSingleton.serverModuleMap\n}\n\nexport function getClientReferenceManifestForRsc(): DeepReadonly<ClientReferenceManifestForRsc> {\n const serverActionsManifestSingleton = (globalThis as any)[\n SERVER_ACTION_MANIFESTS_SINGLETON\n ] as {\n clientReferenceManifestsPerPage: DeepReadonly<\n Record<string, ClientReferenceManifest>\n >\n }\n\n if (!serverActionsManifestSingleton) {\n throw new InvariantError('Missing manifest for Server Actions.')\n }\n\n const { clientReferenceManifestsPerPage } = serverActionsManifestSingleton\n const workStore = workAsyncStorage.getStore()\n\n if (!workStore) {\n // If there's no work store defined, we can assume that a client reference\n // manifest is needed during module evaluation, e.g. to create a server\n // action using a higher-order function. This might also use client\n // components which need to be serialized by Flight, and therefore client\n // references need to be resolvable. To make this work, we're returning a\n // merged manifest across all pages. This is fine as long as the module IDs\n // are not page specific, which they are not for Webpack. TODO: Fix this in\n // Turbopack.\n return mergeClientReferenceManifests(clientReferenceManifestsPerPage)\n }\n\n const clientReferenceManifest =\n clientReferenceManifestsPerPage[workStore.route]\n\n if (!clientReferenceManifest) {\n throw new InvariantError(\n `Missing Client Reference Manifest for ${workStore.route}.`\n )\n }\n\n return clientReferenceManifest\n}\n\nexport async function getActionEncryptionKey() {\n if (__next_loaded_action_key) {\n return __next_loaded_action_key\n }\n\n const serverActionsManifestSingleton = (globalThis as any)[\n SERVER_ACTION_MANIFESTS_SINGLETON\n ] as {\n serverActionsManifest: DeepReadonly<ActionManifest>\n }\n\n if (!serverActionsManifestSingleton) {\n throw new InvariantError('Missing manifest for Server Actions.')\n }\n\n const rawKey =\n process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY ||\n serverActionsManifestSingleton.serverActionsManifest.encryptionKey\n\n if (rawKey === undefined) {\n throw new InvariantError('Missing encryption key for Server Actions')\n }\n\n __next_loaded_action_key = await crypto.subtle.importKey(\n 'raw',\n stringToUint8Array(atob(rawKey)),\n 'AES-GCM',\n true,\n ['encrypt', 'decrypt']\n )\n\n return __next_loaded_action_key\n}\n\nfunction mergeClientReferenceManifests(\n clientReferenceManifestsPerPage: DeepReadonly<\n Record<string, ClientReferenceManifest>\n >\n): ClientReferenceManifestForRsc {\n const clientReferenceManifests = Object.values(\n clientReferenceManifestsPerPage as Record<string, ClientReferenceManifest>\n )\n\n const mergedClientReferenceManifest: ClientReferenceManifestForRsc = {\n clientModules: {},\n edgeRscModuleMapping: {},\n rscModuleMapping: {},\n }\n\n for (const clientReferenceManifest of clientReferenceManifests) {\n mergedClientReferenceManifest.clientModules = {\n ...mergedClientReferenceManifest.clientModules,\n ...clientReferenceManifest.clientModules,\n }\n mergedClientReferenceManifest.edgeRscModuleMapping = {\n ...mergedClientReferenceManifest.edgeRscModuleMapping,\n ...clientReferenceManifest.edgeRscModuleMapping,\n }\n mergedClientReferenceManifest.rscModuleMapping = {\n ...mergedClientReferenceManifest.rscModuleMapping,\n ...clientReferenceManifest.rscModuleMapping,\n }\n }\n\n return mergedClientReferenceManifest\n}\n","import type { DynamicParam } from '../../../../server/app-render/app-render'\nimport type { LoaderTree } from '../../../../server/lib/app-dir-module'\nimport type { OpaqueFallbackRouteParams } from '../../../../server/request/fallback-params'\nimport type { Params } from '../../../../server/request/params'\nimport type { DynamicParamTypesShort } from '../../app-router-types'\nimport { InvariantError } from '../../invariant-error'\nimport { parseLoaderTree } from './parse-loader-tree'\nimport { getSegmentParam } from './get-segment-param'\n\n/**\n * Gets the value of a param from the params object. This correctly handles the\n * case where the param is a fallback route param and encodes the resulting\n * value.\n *\n * @param interpolatedParams - The params object.\n * @param segmentKey - The key of the segment.\n * @param fallbackRouteParams - The fallback route params.\n * @returns The value of the param.\n */\nfunction getParamValue(\n interpolatedParams: Params,\n segmentKey: string,\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n) {\n let value = interpolatedParams[segmentKey]\n\n if (fallbackRouteParams?.has(segmentKey)) {\n // We know that the fallback route params has the segment key because we\n // checked that above.\n const [searchValue] = fallbackRouteParams.get(segmentKey)!\n value = searchValue\n } else if (Array.isArray(value)) {\n value = value.map((i) => encodeURIComponent(i))\n } else if (typeof value === 'string') {\n value = encodeURIComponent(value)\n }\n\n return value\n}\n\nexport function interpolateParallelRouteParams(\n loaderTree: LoaderTree,\n params: Params,\n pagePath: string,\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n) {\n const interpolated = structuredClone(params)\n\n // Stack-based traversal with depth tracking\n const stack: Array<{ tree: LoaderTree; depth: number }> = [\n { tree: loaderTree, depth: 0 },\n ]\n\n // Derive value from pagePath based on depth and parameter type\n const pathSegments = pagePath.split('/').slice(1) // Remove first empty string\n\n while (stack.length > 0) {\n const { tree, depth } = stack.pop()!\n const { segment, parallelRoutes } = parseLoaderTree(tree)\n\n // Check if current segment contains a parameter\n const segmentParam = getSegmentParam(segment)\n if (\n segmentParam &&\n !interpolated.hasOwnProperty(segmentParam.param) &&\n // If the param is in the fallback route params, we don't need to\n // interpolate it because it's already marked as being unknown.\n !fallbackRouteParams?.has(segmentParam.param)\n ) {\n switch (segmentParam.type) {\n case 'catchall':\n case 'optional-catchall':\n case 'catchall-intercepted':\n // For catchall parameters, take all remaining segments from this depth\n const remainingSegments = pathSegments.slice(depth)\n\n // Process each segment to handle any dynamic params\n const processedSegments = remainingSegments\n .flatMap((pathSegment) => {\n const param = getSegmentParam(pathSegment)\n // If the segment matches a param, return the param value otherwise,\n // it's a static segment, so just return that. We don't use the\n // `getParamValue` function here because we don't want the values to\n // be encoded, that's handled on get by the `getDynamicParam`\n // function.\n return param ? interpolated[param.param] : pathSegment\n })\n .filter((s) => s !== undefined)\n\n if (processedSegments.length > 0) {\n interpolated[segmentParam.param] = processedSegments\n }\n break\n case 'dynamic':\n case 'dynamic-intercepted':\n // For regular dynamic parameters, take the segment at this depth\n if (depth < pathSegments.length) {\n const pathSegment = pathSegments[depth]\n const param = getSegmentParam(pathSegment)\n\n interpolated[segmentParam.param] = param\n ? interpolated[param.param]\n : pathSegment\n }\n break\n default:\n segmentParam.type satisfies never\n }\n }\n\n // Calculate next depth - increment if this is not a route group and not empty\n let nextDepth = depth\n const isRouteGroup = segment.startsWith('(') && segment.endsWith(')')\n if (!isRouteGroup && segment !== '') {\n nextDepth++\n }\n\n // Add all parallel routes to the stack for processing\n for (const route of Object.values(parallelRoutes)) {\n stack.push({ tree: route, depth: nextDepth })\n }\n }\n\n return interpolated\n}\n\n/**\n *\n * Shared logic on client and server for creating a dynamic param value.\n *\n * This code needs to be shared with the client so it can extract dynamic route\n * params from the URL without a server request.\n *\n * Because everything in this module is sent to the client, we should aim to\n * keep this code as simple as possible. The special case handling for catchall\n * and optional is, alas, unfortunate.\n */\nexport function getDynamicParam(\n interpolatedParams: Params,\n segmentKey: string,\n dynamicParamType: DynamicParamTypesShort,\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n): DynamicParam {\n let value: string | string[] | undefined = getParamValue(\n interpolatedParams,\n segmentKey,\n fallbackRouteParams\n )\n\n // handle the case where an optional catchall does not have a value,\n // e.g. `/dashboard/[[...slug]]` when requesting `/dashboard`\n if (!value || value.length === 0) {\n if (dynamicParamType === 'oc') {\n return {\n param: segmentKey,\n value: null,\n type: dynamicParamType,\n treeSegment: [segmentKey, '', dynamicParamType],\n }\n }\n\n throw new InvariantError(\n `Missing value for segment key: \"${segmentKey}\" with dynamic param type: ${dynamicParamType}`\n )\n }\n\n return {\n param: segmentKey,\n // The value that is passed to user code.\n value,\n // The value that is rendered in the router tree.\n treeSegment: [\n segmentKey,\n Array.isArray(value) ? value.join('/') : value,\n dynamicParamType,\n ],\n type: dynamicParamType,\n }\n}\n\n/**\n * Regular expression pattern used to match route parameters.\n * Matches both single parameters and parameter groups.\n * Examples:\n * - `[[...slug]]` matches parameter group with key 'slug', repeat: true, optional: true\n * - `[...slug]` matches parameter group with key 'slug', repeat: true, optional: false\n * - `[[foo]]` matches parameter with key 'foo', repeat: false, optional: true\n * - `[bar]` matches parameter with key 'bar', repeat: false, optional: false\n */\nexport const PARAMETER_PATTERN = /^([^[]*)\\[((?:\\[[^\\]]*\\])|[^\\]]+)\\](.*)$/\n\n/**\n * Parses a given parameter from a route to a data structure that can be used\n * to generate the parametrized route.\n * 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 * - `fizz` -> `{ key: 'fizz', repeat: false, optional: false }`\n * @param param - The parameter to parse.\n * @returns The parsed parameter as a data structure.\n */\nexport function parseParameter(param: string) {\n const match = param.match(PARAMETER_PATTERN)\n\n if (!match) {\n return parseMatchedParameter(param)\n }\n\n return parseMatchedParameter(match[2])\n}\n\n/**\n * Parses a matched parameter from the PARAMETER_PATTERN regex to a data structure that can be used\n * to generate the parametrized route.\n * 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 * @param param - The matched parameter to parse.\n * @returns The parsed parameter as a data structure.\n */\nexport function parseMatchedParameter(param: string) {\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 { key: param, repeat, optional }\n}\n","import {\n arrayBufferToString,\n stringToUint8Array,\n} from '../app-render/encryption-utils'\nimport type { CacheEntry } from '../lib/cache-handlers/types'\nimport type { CachedFetchValue } from '../response-cache/types'\nimport { DYNAMIC_EXPIRE } from '../use-cache/constants'\n\n/**\n * A generic cache store type that provides a subset of Map functionality\n */\ntype CacheStore<T> = Pick<\n Map<string, T>,\n 'entries' | 'keys' | 'size' | 'get' | 'set'\n>\n\n/**\n * A cache store specifically for fetch cache values\n */\nexport type FetchCacheStore = CacheStore<CachedFetchValue>\n\n/**\n * A cache store for encrypted bound args of inline server functions.\n */\nexport type EncryptedBoundArgsCacheStore = CacheStore<string>\n\n/**\n * An in-memory-only cache store for decrypted bound args of inline server\n * functions.\n */\nexport type DecryptedBoundArgsCacheStore = CacheStore<string>\n\n/**\n * Serialized format for \"use cache\" entries\n */\nexport interface UseCacheCacheStoreSerialized {\n value: string\n tags: string[]\n stale: number\n timestamp: number\n expire: number\n revalidate: number\n}\n\n/**\n * A cache store specifically for \"use cache\" values that stores promises of\n * cache entries.\n */\nexport type UseCacheCacheStore = CacheStore<Promise<CacheEntry>>\n\n/**\n * Parses serialized cache entries into a UseCacheCacheStore\n * @param entries - The serialized entries to parse\n * @returns A new UseCacheCacheStore containing the parsed entries\n */\nexport function parseUseCacheCacheStore(\n entries: Iterable<[string, UseCacheCacheStoreSerialized]>\n): UseCacheCacheStore {\n const store = new Map<string, Promise<CacheEntry>>()\n\n for (const [\n key,\n { value, tags, stale, timestamp, expire, revalidate },\n ] of entries) {\n store.set(\n key,\n Promise.resolve({\n // Create a ReadableStream from the Uint8Array\n value: new ReadableStream<Uint8Array>({\n start(controller) {\n // Enqueue the Uint8Array to the stream\n controller.enqueue(stringToUint8Array(atob(value)))\n\n // Close the stream\n controller.close()\n },\n }),\n tags,\n stale,\n timestamp,\n expire,\n revalidate,\n })\n )\n }\n\n return store\n}\n\n/**\n * Serializes UseCacheCacheStore entries into an array of key-value pairs\n * @param entries - The store entries to stringify\n * @returns A promise that resolves to an array of key-value pairs with serialized values\n */\nexport async function serializeUseCacheCacheStore(\n entries: IterableIterator<[string, Promise<CacheEntry>]>,\n isCacheComponentsEnabled: boolean\n): Promise<Array<[string, UseCacheCacheStoreSerialized] | null>> {\n return Promise.all(\n Array.from(entries).map(([key, value]) => {\n return value\n .then(async (entry) => {\n if (\n isCacheComponentsEnabled &&\n (entry.revalidate === 0 || entry.expire < DYNAMIC_EXPIRE)\n ) {\n // The entry was omitted from the prerender result, and subsequently\n // does not need to be included in the serialized RDC.\n return null\n }\n\n const [left, right] = entry.value.tee()\n entry.value = right\n\n let binaryString: string = ''\n\n // We want to encode the value as a string, but we aren't sure if the\n // value is a a stream of UTF-8 bytes or not, so let's just encode it\n // as a string using base64.\n for await (const chunk of left) {\n binaryString += arrayBufferToString(chunk)\n }\n\n return [\n key,\n {\n // Encode the value as a base64 string.\n value: btoa(binaryString),\n tags: entry.tags,\n stale: entry.stale,\n timestamp: entry.timestamp,\n expire: entry.expire,\n revalidate: entry.revalidate,\n },\n ] satisfies [string, UseCacheCacheStoreSerialized]\n })\n .catch(() => {\n // Any failed cache writes should be ignored as to not discard the\n // entire cache.\n return null\n })\n })\n )\n}\n","export const DYNAMIC_EXPIRE = 300 // 5 minutes\nexport const RUNTIME_PREFETCH_DYNAMIC_STALE = 30 // 30 seconds\n","import { InvariantError } from '../../shared/lib/invariant-error'\nimport {\n type UseCacheCacheStore,\n type FetchCacheStore,\n type EncryptedBoundArgsCacheStore,\n serializeUseCacheCacheStore,\n parseUseCacheCacheStore,\n type DecryptedBoundArgsCacheStore,\n type UseCacheCacheStoreSerialized,\n} from './cache-store'\n\n/**\n * An immutable version of the resume data cache used during rendering.\n * This cache is read-only and cannot be modified once created.\n */\nexport interface RenderResumeDataCache {\n /**\n * A read-only Map store for values cached by the 'use cache' React hook.\n * The 'set' operation is omitted to enforce immutability.\n */\n readonly cache: Omit<UseCacheCacheStore, 'set'>\n\n /**\n * A read-only Map store for cached fetch responses.\n * The 'set' operation is omitted to enforce immutability.\n */\n readonly fetch: Omit<FetchCacheStore, 'set'>\n\n /**\n * A read-only Map store for encrypted bound args of inline server functions.\n * The 'set' operation is omitted to enforce immutability.\n */\n readonly encryptedBoundArgs: Omit<EncryptedBoundArgsCacheStore, 'set'>\n\n /**\n * A read-only Map store for decrypted bound args of inline server functions.\n * This is only intended for in-memory usage during pre-rendering, and must\n * not be persisted in the resume store. The 'set' operation is omitted to\n * enforce immutability.\n */\n readonly decryptedBoundArgs: Omit<DecryptedBoundArgsCacheStore, 'set'>\n}\n\n/**\n * A mutable version of the resume data cache used during pre-rendering.\n * This cache allows both reading and writing of cached values.\n */\nexport interface PrerenderResumeDataCache {\n /**\n * A mutable Map store for values cached by the 'use cache' React hook.\n * Supports both 'get' and 'set' operations to build the cache during\n * pre-rendering.\n */\n readonly cache: UseCacheCacheStore\n\n /**\n * A mutable Map store for cached fetch responses.\n * Supports both 'get' and 'set' operations to build the cache during\n * pre-rendering.\n */\n readonly fetch: FetchCacheStore\n\n /**\n * A mutable Map store for encrypted bound args of inline server functions.\n * Supports both 'get' and 'set' operations to build the cache during\n * pre-rendering.\n */\n readonly encryptedBoundArgs: EncryptedBoundArgsCacheStore\n\n /**\n * A mutable Map store for decrypted bound args of inline server functions.\n * This is only intended for in-memory usage during pre-rendering, and must\n * not be persisted in the resume store. Supports both 'get' and 'set'\n * operations to build the cache during pre-rendering.\n */\n readonly decryptedBoundArgs: DecryptedBoundArgsCacheStore\n}\n\ntype ResumeStoreSerialized = {\n store: {\n cache: {\n [key: string]: any\n }\n fetch: {\n [key: string]: any\n }\n encryptedBoundArgs: {\n [key: string]: string\n }\n }\n}\n\n/**\n * Serializes a resume data cache into a JSON string for storage or\n * transmission. Handles 'use cache' values, fetch responses, and encrypted\n * bound args for inline server functions.\n *\n * @param resumeDataCache - The immutable cache to serialize\n * @returns A Promise that resolves to the serialized cache as a JSON string, or\n * 'null' if empty\n */\nexport async function stringifyResumeDataCache(\n resumeDataCache: RenderResumeDataCache | PrerenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n if (process.env.NEXT_RUNTIME === 'edge') {\n throw new InvariantError(\n '`stringifyResumeDataCache` should not be called in edge runtime.'\n )\n } else {\n if (resumeDataCache.fetch.size === 0 && resumeDataCache.cache.size === 0) {\n return 'null'\n }\n\n const json: ResumeStoreSerialized = {\n store: {\n fetch: Object.fromEntries(Array.from(resumeDataCache.fetch.entries())),\n cache: Object.fromEntries(\n (\n await serializeUseCacheCacheStore(\n resumeDataCache.cache.entries(),\n isCacheComponentsEnabled\n )\n ).filter(\n (entry): entry is [string, UseCacheCacheStoreSerialized] =>\n entry !== null\n )\n ),\n encryptedBoundArgs: Object.fromEntries(\n Array.from(resumeDataCache.encryptedBoundArgs.entries())\n ),\n },\n }\n\n // Compress the JSON string using zlib. As the data we already want to\n // decompress is in memory, we use the synchronous deflateSync function.\n const { deflateSync } = require('node:zlib') as typeof import('node:zlib')\n\n return deflateSync(JSON.stringify(json)).toString('base64')\n }\n}\n\n/**\n * Creates a new empty mutable resume data cache for pre-rendering.\n * Initializes fresh Map instances for both the 'use cache' and fetch caches.\n * Used at the start of pre-rendering to begin collecting cached values.\n *\n * @returns A new empty PrerenderResumeDataCache instance\n */\nexport function createPrerenderResumeDataCache(): PrerenderResumeDataCache {\n return {\n cache: new Map(),\n fetch: new Map(),\n encryptedBoundArgs: new Map(),\n decryptedBoundArgs: new Map(),\n }\n}\n\n/**\n * Creates an immutable render resume data cache from either:\n * 1. An existing prerender cache instance\n * 2. A serialized cache string\n *\n * @param renderResumeDataCache - A RenderResumeDataCache instance to be used directly\n * @param prerenderResumeDataCache - A PrerenderResumeDataCache instance to convert to immutable\n * @param persistedCache - A serialized cache string to parse\n * @returns An immutable RenderResumeDataCache instance\n */\nexport function createRenderResumeDataCache(\n renderResumeDataCache: RenderResumeDataCache\n): RenderResumeDataCache\nexport function createRenderResumeDataCache(\n prerenderResumeDataCache: PrerenderResumeDataCache\n): RenderResumeDataCache\nexport function createRenderResumeDataCache(\n persistedCache: string\n): RenderResumeDataCache\nexport function createRenderResumeDataCache(\n resumeDataCacheOrPersistedCache:\n | RenderResumeDataCache\n | PrerenderResumeDataCache\n | string\n): RenderResumeDataCache {\n if (process.env.NEXT_RUNTIME === 'edge') {\n throw new InvariantError(\n '`createRenderResumeDataCache` should not be called in edge runtime.'\n )\n } else {\n if (typeof resumeDataCacheOrPersistedCache !== 'string') {\n // If the cache is already a prerender or render cache, we can return it\n // directly. For the former, we're just performing a type change.\n return resumeDataCacheOrPersistedCache\n }\n\n if (resumeDataCacheOrPersistedCache === 'null') {\n return {\n cache: new Map(),\n fetch: new Map(),\n encryptedBoundArgs: new Map(),\n decryptedBoundArgs: new Map(),\n }\n }\n\n // This should be a compressed string. Let's decompress it using zlib.\n // As the data we already want to decompress is in memory, we use the\n // synchronous inflateSync function.\n const { inflateSync } = require('node:zlib') as typeof import('node:zlib')\n\n const json: ResumeStoreSerialized = JSON.parse(\n inflateSync(\n Buffer.from(resumeDataCacheOrPersistedCache, 'base64')\n ).toString('utf-8')\n )\n\n return {\n cache: parseUseCacheCacheStore(Object.entries(json.store.cache)),\n fetch: new Map(Object.entries(json.store.fetch)),\n encryptedBoundArgs: new Map(\n Object.entries(json.store.encryptedBoundArgs)\n ),\n decryptedBoundArgs: new Map(),\n }\n }\n}\n","import type {\n OpaqueFallbackRouteParamEntries,\n OpaqueFallbackRouteParams,\n} from '../../server/request/fallback-params'\nimport { getDynamicParam } from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { Params } from '../request/params'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport { stringifyResumeDataCache } from '../resume-data-cache/resume-data-cache'\n\nexport enum DynamicState {\n /**\n * The dynamic access occurred during the RSC render phase.\n */\n DATA = 1,\n\n /**\n * The dynamic access occurred during the HTML shell render phase.\n */\n HTML = 2,\n}\n\n/**\n * The postponed state for dynamic data.\n */\nexport type DynamicDataPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.DATA\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\n/**\n * The postponed state for dynamic HTML.\n */\nexport type DynamicHTMLPostponedState = {\n /**\n * The type of dynamic state.\n */\n readonly type: DynamicState.HTML\n\n /**\n * The postponed data used by React.\n */\n readonly data: [\n preludeState: DynamicHTMLPreludeState,\n postponed: ReactPostponed,\n ]\n\n /**\n * The immutable resume data cache.\n */\n readonly renderResumeDataCache: RenderResumeDataCache\n}\n\nexport const enum DynamicHTMLPreludeState {\n Empty = 0,\n Full = 1,\n}\n\ntype ReactPostponed = NonNullable<\n import('react-dom/static').PrerenderResult['postponed']\n>\n\nexport type PostponedState =\n | DynamicDataPostponedState\n | DynamicHTMLPostponedState\n\nexport async function getDynamicHTMLPostponedState(\n postponed: ReactPostponed,\n preludeState: DynamicHTMLPreludeState,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n const data: DynamicHTMLPostponedState['data'] = [preludeState, postponed]\n const dataString = JSON.stringify(data)\n\n // If there are no fallback route params, we can just serialize the postponed\n // state as is.\n if (!fallbackRouteParams || fallbackRouteParams.size === 0) {\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${dataString.length}:${dataString}${await stringifyResumeDataCache(\n createRenderResumeDataCache(resumeDataCache),\n isCacheComponentsEnabled\n )}`\n }\n\n const replacements: OpaqueFallbackRouteParamEntries = Array.from(\n fallbackRouteParams.entries()\n )\n const replacementsString = JSON.stringify(replacements)\n\n // Serialized as `<replacements.length><replacements><data>`\n const postponedString = `${replacementsString.length}${replacementsString}${dataString}`\n\n // Serialized as `<postponedString.length>:<postponedString><renderResumeDataCache>`\n return `${postponedString.length}:${postponedString}${await stringifyResumeDataCache(resumeDataCache, isCacheComponentsEnabled)}`\n}\n\nexport async function getDynamicDataPostponedState(\n resumeDataCache: PrerenderResumeDataCache | RenderResumeDataCache,\n isCacheComponentsEnabled: boolean\n): Promise<string> {\n return `4:null${await stringifyResumeDataCache(createRenderResumeDataCache(resumeDataCache), isCacheComponentsEnabled)}`\n}\n\nexport function parsePostponedState(\n state: string,\n interpolatedParams: Params\n): PostponedState {\n try {\n const postponedStringLengthMatch = state.match(/^([0-9]*):/)?.[1]\n if (!postponedStringLengthMatch) {\n throw new Error(`Invariant: invalid postponed state ${state}`)\n }\n\n const postponedStringLength = parseInt(postponedStringLengthMatch)\n\n // We add a `:` to the end of the length as the first character of the\n // postponed string is the length of the replacement entries.\n const postponedString = state.slice(\n postponedStringLengthMatch.length + 1,\n postponedStringLengthMatch.length + postponedStringLength + 1\n )\n\n const renderResumeDataCache = createRenderResumeDataCache(\n state.slice(postponedStringLengthMatch.length + postponedStringLength + 1)\n )\n\n try {\n if (postponedString === 'null') {\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n\n if (/^[0-9]/.test(postponedString)) {\n const match = postponedString.match(/^([0-9]*)/)?.[1]\n if (!match) {\n throw new Error(\n `Invariant: invalid postponed state ${JSON.stringify(postponedString)}`\n )\n }\n\n // This is the length of the replacements entries.\n const length = parseInt(match)\n const replacements = JSON.parse(\n postponedString.slice(\n match.length,\n // We then go to the end of the string.\n match.length + length\n )\n ) as OpaqueFallbackRouteParamEntries\n\n let postponed = postponedString.slice(match.length + length)\n for (const [\n segmentKey,\n [searchValue, dynamicParamType],\n ] of replacements) {\n const {\n treeSegment: [\n ,\n // This is the same value that'll be used in the postponed state\n // as it's part of the tree data. That's why we use it as the\n // replacement value.\n value,\n ],\n } = getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n null\n )\n\n postponed = postponed.replaceAll(searchValue, value)\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponed),\n renderResumeDataCache,\n }\n }\n\n return {\n type: DynamicState.HTML,\n data: JSON.parse(postponedString),\n renderResumeDataCache,\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return { type: DynamicState.DATA, renderResumeDataCache }\n }\n } catch (err) {\n console.error('Failed to parse postponed state', err)\n return {\n type: DynamicState.DATA,\n renderResumeDataCache: createPrerenderResumeDataCache(),\n }\n }\n}\n\nexport function getPostponedFromState(state: DynamicHTMLPostponedState) {\n const [preludeState, postponed] = state.data\n return { preludeState, postponed }\n}\n","import type { ClientReferenceManifest } from '../../build/webpack/plugins/flight-manifest-plugin'\nimport type { BinaryStreamOf } from './app-render'\n\nimport { htmlEscapeJsonString } from '../htmlescape'\nimport type { DeepReadonly } from '../../shared/lib/deep-readonly'\nimport { workUnitAsyncStorage } from './work-unit-async-storage.external'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nconst isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge'\n\nconst INLINE_FLIGHT_PAYLOAD_BOOTSTRAP = 0\nconst INLINE_FLIGHT_PAYLOAD_DATA = 1\nconst INLINE_FLIGHT_PAYLOAD_FORM_STATE = 2\nconst INLINE_FLIGHT_PAYLOAD_BINARY = 3\n\nconst flightResponses = new WeakMap<BinaryStreamOf<any>, Promise<any>>()\nconst encoder = new TextEncoder()\n\nconst findSourceMapURL =\n process.env.NODE_ENV !== 'production'\n ? (require('../lib/source-maps') as typeof import('../lib/source-maps'))\n .findSourceMapURLDEV\n : undefined\n\n/**\n * Render Flight stream.\n * This is only used for renderToHTML, the Flight response does not need additional wrappers.\n */\nexport function useFlightStream<T>(\n flightStream: BinaryStreamOf<T>,\n debugStream: ReadableStream<Uint8Array> | undefined,\n clientReferenceManifest: DeepReadonly<ClientReferenceManifest>,\n nonce: string | undefined\n): Promise<T> {\n const response = flightResponses.get(flightStream)\n\n if (response) {\n return response\n }\n\n // react-server-dom-webpack/client.edge must not be hoisted for require cache clearing to work correctly\n const { createFromReadableStream } =\n // eslint-disable-next-line import/no-extraneous-dependencies\n require('react-server-dom-webpack/client') as typeof import('react-server-dom-webpack/client')\n\n const newResponse = createFromReadableStream<T>(flightStream, {\n findSourceMapURL,\n serverConsumerManifest: {\n moduleLoading: clientReferenceManifest.moduleLoading,\n moduleMap: isEdgeRuntime\n ? clientReferenceManifest.edgeSSRModuleMapping\n : clientReferenceManifest.ssrModuleMapping,\n serverModuleMap: null,\n },\n nonce,\n debugChannel: debugStream ? { readable: debugStream } : undefined,\n })\n\n // Edge pages are never prerendered so they necessarily cannot have a workUnitStore type\n // that requires the nextTick behavior. This is why it is safe to access a node only API here\n if (process.env.NEXT_RUNTIME !== 'edge') {\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (!workUnitStore) {\n throw new InvariantError('Expected workUnitAsyncStorage to have a store.')\n }\n\n switch (workUnitStore.type) {\n case 'prerender-client':\n const responseOnNextTick = new Promise<T>((resolve) => {\n process.nextTick(() => resolve(newResponse))\n })\n flightResponses.set(flightStream, responseOnNextTick)\n return responseOnNextTick\n case 'prerender':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n }\n\n flightResponses.set(flightStream, newResponse)\n\n return newResponse\n}\n\n/**\n * Creates a ReadableStream provides inline script tag chunks for writing hydration\n * data to the client outside the React render itself.\n *\n * @param flightStream The RSC render stream\n * @param nonce optionally a nonce used during this particular render\n * @param formState optionally the formState used with this particular render\n * @returns a ReadableStream without the complete property. This signifies a lazy ReadableStream\n */\nexport function createInlinedDataReadableStream(\n flightStream: ReadableStream<Uint8Array>,\n nonce: string | undefined,\n formState: unknown | null\n): ReadableStream<Uint8Array> {\n const startScriptTag = nonce\n ? `<script nonce=${JSON.stringify(nonce)}>`\n : '<script>'\n\n const flightReader = flightStream.getReader()\n const decoder = new TextDecoder('utf-8', { fatal: true })\n\n const readable = new ReadableStream({\n type: 'bytes',\n start(controller) {\n try {\n writeInitialInstructions(controller, startScriptTag, formState)\n } catch (error) {\n // during encoding or enqueueing forward the error downstream\n controller.error(error)\n }\n },\n async pull(controller) {\n try {\n const { done, value } = await flightReader.read()\n\n if (value) {\n try {\n const decodedString = decoder.decode(value, { stream: !done })\n\n // The chunk cannot be decoded as valid UTF-8 string as it might\n // have arbitrary binary data.\n writeFlightDataInstruction(\n controller,\n startScriptTag,\n decodedString\n )\n } catch {\n // The chunk cannot be decoded as valid UTF-8 string.\n writeFlightDataInstruction(controller, startScriptTag, value)\n }\n }\n\n if (done) {\n controller.close()\n }\n } catch (error) {\n // There was a problem in the upstream reader or during decoding or enqueuing\n // forward the error downstream\n controller.error(error)\n }\n },\n })\n\n return readable\n}\n\nfunction writeInitialInstructions(\n controller: ReadableStreamDefaultController,\n scriptStart: string,\n formState: unknown | null\n) {\n let scriptContents = `(self.__next_f=self.__next_f||[]).push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BOOTSTRAP])\n )})`\n\n if (formState != null) {\n scriptContents += `;self.__next_f.push(${htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_FORM_STATE, formState])\n )})`\n }\n\n controller.enqueue(encoder.encode(`${scriptStart}${scriptContents}</script>`))\n}\n\nfunction writeFlightDataInstruction(\n controller: ReadableStreamDefaultController,\n scriptStart: string,\n chunk: string | Uint8Array\n) {\n let htmlInlinedData: string\n\n if (typeof chunk === 'string') {\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_DATA, chunk])\n )\n } else {\n // The chunk cannot be embedded as a UTF-8 string in the script tag.\n // Instead let's inline it in base64.\n // Credits to Devon Govett (devongovett) for the technique.\n // https://github.com/devongovett/rsc-html-stream\n const base64 = btoa(String.fromCodePoint(...chunk))\n htmlInlinedData = htmlEscapeJsonString(\n JSON.stringify([INLINE_FLIGHT_PAYLOAD_BINARY, base64])\n )\n }\n\n controller.enqueue(\n encoder.encode(\n `${scriptStart}self.__next_f.push(${htmlInlinedData})</script>`\n )\n )\n}\n","import type { HtmlProps } from './html-context.shared-runtime'\nimport type { ComponentType, JSX } from 'react'\nimport type { DomainLocale } from '../../server/config'\nimport type { Env } from '@next/env'\nimport type { IncomingMessage, ServerResponse } from 'http'\nimport type { NextRouter } from './router/router'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { PreviewData } from '../../types'\nimport type { COMPILER_NAMES } from './constants'\nimport type fs from 'fs'\n\nexport type NextComponentType<\n Context extends BaseContext = NextPageContext,\n InitialProps = {},\n Props = {},\n> = ComponentType<Props> & {\n /**\n * Used for initial page load data population. Data returned from `getInitialProps` is serialized when server rendered.\n * Make sure to return plain `Object` without using `Date`, `Map`, `Set`.\n * @param context Context of `page`\n */\n getInitialProps?(context: Context): InitialProps | Promise<InitialProps>\n}\n\nexport type DocumentType = NextComponentType<\n DocumentContext,\n DocumentInitialProps,\n DocumentProps\n>\n\nexport type AppType<P = {}> = NextComponentType<\n AppContextType,\n P,\n AppPropsType<any, P>\n>\n\nexport type AppTreeType = ComponentType<\n AppInitialProps & { [name: string]: any }\n>\n\n/**\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 */\nexport const WEB_VITALS = ['CLS', 'FCP', 'FID', 'INP', 'LCP', 'TTFB'] as const\nexport type NextWebVitalsMetric = {\n id: string\n startTime: number\n value: number\n attribution?: { [key: string]: unknown }\n} & (\n | {\n label: 'web-vital'\n name: (typeof WEB_VITALS)[number]\n }\n | {\n label: 'custom'\n name:\n | 'Next.js-hydration'\n | 'Next.js-route-change-to-render'\n | 'Next.js-render'\n }\n)\n\nexport type Enhancer<C> = (Component: C) => C\n\nexport type ComponentsEnhancer =\n | {\n enhanceApp?: Enhancer<AppType>\n enhanceComponent?: Enhancer<NextComponentType>\n }\n | Enhancer<NextComponentType>\n\nexport type RenderPageResult = {\n html: string\n head?: Array<JSX.Element | null>\n}\n\nexport type RenderPage = (\n options?: ComponentsEnhancer\n) => DocumentInitialProps | Promise<DocumentInitialProps>\n\nexport type BaseContext = {\n res?: ServerResponse\n [k: string]: any\n}\n\nexport type NEXT_DATA = {\n props: Record<string, any>\n page: string\n query: ParsedUrlQuery\n buildId: string\n assetPrefix?: string\n nextExport?: boolean\n autoExport?: boolean\n isFallback?: boolean\n isExperimentalCompile?: boolean\n dynamicIds?: (string | number)[]\n err?: Error & {\n statusCode?: number\n source?: typeof COMPILER_NAMES.server | typeof COMPILER_NAMES.edgeServer\n }\n gsp?: boolean\n gssp?: boolean\n customServer?: boolean\n gip?: boolean\n appGip?: boolean\n locale?: string\n locales?: readonly string[]\n defaultLocale?: string\n domainLocales?: readonly DomainLocale[]\n scriptLoader?: any[]\n isPreview?: boolean\n notFoundSrcPage?: string\n}\n\n/**\n * `Next` context\n */\nexport interface NextPageContext {\n /**\n * Error object if encountered during rendering\n */\n err?: (Error & { statusCode?: number }) | null\n /**\n * `HTTP` request object.\n */\n req?: IncomingMessage\n /**\n * `HTTP` response object.\n */\n res?: ServerResponse\n /**\n * Path section of `URL`.\n */\n pathname: string\n /**\n * Query string section of `URL` parsed as an object.\n */\n query: ParsedUrlQuery\n /**\n * `String` of the actual path including query.\n */\n asPath?: string\n /**\n * The currently active locale\n */\n locale?: string\n /**\n * All configured locales\n */\n locales?: readonly string[]\n /**\n * The configured default locale\n */\n defaultLocale?: string\n /**\n * `Component` the tree of the App to use if needing to render separately\n */\n AppTree: AppTreeType\n}\n\nexport type AppContextType<Router extends NextRouter = NextRouter> = {\n Component: NextComponentType<NextPageContext>\n AppTree: AppTreeType\n ctx: NextPageContext\n router: Router\n}\n\nexport type AppInitialProps<PageProps = any> = {\n pageProps: PageProps\n}\n\nexport type AppPropsType<\n Router extends NextRouter = NextRouter,\n PageProps = {},\n> = AppInitialProps<PageProps> & {\n Component: NextComponentType<NextPageContext, any, any>\n router: Router\n __N_SSG?: boolean\n __N_SSP?: boolean\n}\n\nexport type DocumentContext = NextPageContext & {\n renderPage: RenderPage\n defaultGetInitialProps(\n ctx: DocumentContext,\n options?: { nonce?: string }\n ): Promise<DocumentInitialProps>\n}\n\nexport type DocumentInitialProps = RenderPageResult & {\n styles?: React.ReactElement[] | Iterable<React.ReactNode> | JSX.Element\n}\n\nexport type DocumentProps = DocumentInitialProps & HtmlProps\n\n/**\n * Next `API` route request\n */\nexport interface NextApiRequest extends IncomingMessage {\n /**\n * Object of `query` values from url\n */\n query: Partial<{\n [key: string]: string | string[]\n }>\n /**\n * Object of `cookies` from header\n */\n cookies: Partial<{\n [key: string]: string\n }>\n\n body: any\n\n env: Env\n\n draftMode?: boolean\n\n preview?: boolean\n /**\n * Preview data set on the request, if any\n * */\n previewData?: PreviewData\n}\n\n/**\n * Send body of response\n */\ntype Send<T> = (body: T) => void\n\n/**\n * Next `API` route response\n */\nexport type NextApiResponse<Data = any> = ServerResponse & {\n /**\n * Send data `any` data in response\n */\n send: Send<Data>\n /**\n * Send data `json` data in response\n */\n json: Send<Data>\n status: (statusCode: number) => NextApiResponse<Data>\n redirect(url: string): NextApiResponse<Data>\n redirect(status: number, url: string): NextApiResponse<Data>\n\n /**\n * Set draft mode\n */\n setDraftMode: (options: { enable: boolean }) => NextApiResponse<Data>\n\n /**\n * Set preview data for Next.js' prerender mode\n */\n setPreviewData: (\n data: object | string,\n options?: {\n /**\n * Specifies the number (in seconds) for the preview session to last for.\n * The given number will be converted to an integer by rounding down.\n * By default, no maximum age is set and the preview session finishes\n * when the client shuts down (browser is closed).\n */\n maxAge?: number\n /**\n * Specifies the path for the preview session to work under. By default,\n * the path is considered the \"default path\", i.e., any pages under \"/\".\n */\n path?: string\n }\n ) => NextApiResponse<Data>\n\n /**\n * Clear preview data for Next.js' prerender mode\n */\n clearPreviewData: (options?: { path?: string }) => NextApiResponse<Data>\n\n /**\n * Revalidate a specific page and regenerate it using On-Demand Incremental\n * Static Regeneration.\n * The path should be an actual path, not a rewritten path. E.g. for\n * \"/blog/[slug]\" this should be \"/blog/post-1\".\n * @link https://nextjs.org/docs/app/building-your-application/data-fetching/incremental-static-regeneration#on-demand-revalidation-with-revalidatepath\n */\n revalidate: (\n urlPath: string,\n opts?: {\n unstable_onlyGenerated?: boolean\n }\n ) => Promise<void>\n}\n\n/**\n * Next `API` route handler\n */\nexport type NextApiHandler<T = any> = (\n req: NextApiRequest,\n res: NextApiResponse<T>\n) => unknown | Promise<unknown>\n\n/**\n * Utils\n */\nexport function execOnce<T extends (...args: any[]) => ReturnType<T>>(\n fn: T\n): T {\n let used = false\n let result: ReturnType<T>\n\n return ((...args: any[]) => {\n if (!used) {\n used = true\n result = fn(...args)\n }\n return result\n }) as T\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: string) => ABSOLUTE_URL_REGEX.test(url)\n\nexport function getLocationOrigin() {\n const { protocol, hostname, port } = window.location\n return `${protocol}//${hostname}${port ? ':' + port : ''}`\n}\n\nexport function getURL() {\n const { href } = window.location\n const origin = getLocationOrigin()\n return href.substring(origin.length)\n}\n\nexport function getDisplayName<P>(Component: ComponentType<P>) {\n return typeof Component === 'string'\n ? Component\n : Component.displayName || Component.name || 'Unknown'\n}\n\nexport function isResSent(res: ServerResponse) {\n return res.finished || res.headersSent\n}\n\nexport function normalizeRepeatedSlashes(url: string) {\n const urlParts = url.split('?')\n const urlNoQuery = urlParts[0]\n\n return (\n urlNoQuery\n // first we replace any non-encoded backslashes with forward\n // then normalize repeated forward slashes\n .replace(/\\\\/g, '/')\n .replace(/\\/\\/+/g, '/') +\n (urlParts[1] ? `?${urlParts.slice(1).join('?')}` : '')\n )\n}\n\nexport async function loadGetInitialProps<\n C extends BaseContext,\n IP = {},\n P = {},\n>(App: NextComponentType<C, IP, P>, ctx: C): Promise<IP> {\n if (process.env.NODE_ENV !== 'production') {\n if (App.prototype?.getInitialProps) {\n const message = `\"${getDisplayName(\n App\n )}.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\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 {} as IP\n }\n\n const props = await App.getInitialProps(ctx)\n\n if (res && isResSent(res)) {\n return props\n }\n\n if (!props) {\n const message = `\"${getDisplayName(\n App\n )}.getInitialProps()\" should resolve to an object. But found \"${props}\" instead.`\n throw new Error(message)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (Object.keys(props).length === 0 && !ctx.ctx) {\n console.warn(\n `${getDisplayName(\n App\n )} 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 }\n\n return props\n}\n\nexport const SP = typeof performance !== 'undefined'\nexport const ST =\n SP &&\n (['mark', 'measure', 'getEntriesByName'] as const).every(\n (method) => typeof performance[method] === 'function'\n )\n\nexport class DecodeError extends Error {}\nexport class NormalizeError extends Error {}\nexport class PageNotFoundError extends Error {\n code: string\n\n constructor(page: string) {\n super()\n this.code = 'ENOENT'\n this.name = 'PageNotFoundError'\n this.message = `Cannot find module for page: ${page}`\n }\n}\n\nexport class MissingStaticPage extends Error {\n constructor(page: string, message: string) {\n super()\n this.message = `Failed to load static file for page: ${page} ${message}`\n }\n}\n\nexport class MiddlewareNotFoundError extends Error {\n code: string\n constructor() {\n super()\n this.code = 'ENOENT'\n this.message = `Cannot find the middleware module`\n }\n}\n\nexport interface CacheFs {\n existsSync: typeof fs.existsSync\n readFile: typeof fs.promises.readFile\n readFileSync: typeof fs.readFileSync\n writeFile(f: string, d: any): Promise<void>\n mkdir(dir: string): Promise<void | string>\n stat(f: string): Promise<{ mtime: Date }>\n}\n\nexport function stringifyError(error: Error) {\n return JSON.stringify({ message: error.message, stack: error.stack })\n}\n","import type { ParsedUrlQuery } from 'querystring'\n\nexport function searchParamsToUrlQuery(\n searchParams: URLSearchParams\n): ParsedUrlQuery {\n const query: ParsedUrlQuery = {}\n for (const [key, value] of searchParams.entries()) {\n const existing = query[key]\n if (typeof existing === 'undefined') {\n query[key] = value\n } else if (Array.isArray(existing)) {\n existing.push(value)\n } else {\n query[key] = [existing, value]\n }\n }\n return query\n}\n\nfunction stringifyUrlQueryParam(param: unknown): string {\n if (typeof param === 'string') {\n return param\n }\n\n if (\n (typeof param === 'number' && !isNaN(param)) ||\n typeof param === 'boolean'\n ) {\n return String(param)\n } else {\n return ''\n }\n}\n\nexport function urlQueryToSearchParams(query: ParsedUrlQuery): URLSearchParams {\n const searchParams = new URLSearchParams()\n for (const [key, value] of Object.entries(query)) {\n if (Array.isArray(value)) {\n for (const item of value) {\n searchParams.append(key, stringifyUrlQueryParam(item))\n }\n } else {\n searchParams.set(key, stringifyUrlQueryParam(value))\n }\n }\n return searchParams\n}\n\nexport function assign(\n target: URLSearchParams,\n ...searchParamsList: URLSearchParams[]\n): URLSearchParams {\n for (const searchParams of searchParamsList) {\n for (const key of searchParams.keys()) {\n target.delete(key)\n }\n\n for (const [key, value] of searchParams.entries()) {\n target.append(key, value)\n }\n }\n\n return target\n}\n","import type { ParsedUrlQuery } from 'querystring'\nimport { getLocationOrigin } from '../../utils'\nimport { searchParamsToUrlQuery } from './querystring'\n\nexport interface ParsedRelativeUrl {\n hash: string\n href: string\n pathname: string\n query: ParsedUrlQuery\n search: string\n slashes: undefined\n}\n\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 */\nexport function parseRelativeUrl(\n url: string,\n base?: string,\n parseQuery?: true\n): ParsedRelativeUrl\nexport function parseRelativeUrl(\n url: string,\n base: string | undefined,\n parseQuery: false\n): Omit<ParsedRelativeUrl, 'query'>\nexport function parseRelativeUrl(\n url: string,\n base?: string,\n parseQuery = true\n): ParsedRelativeUrl | Omit<ParsedRelativeUrl, 'query'> {\n const globalBase = new URL(\n typeof window === 'undefined' ? 'http://n' : getLocationOrigin()\n )\n\n const resolvedBase = base\n ? new URL(base, globalBase)\n : url.startsWith('.')\n ? new URL(\n typeof window === 'undefined' ? 'http://n' : window.location.href\n )\n : globalBase\n\n const { pathname, searchParams, search, hash, href, origin } = new URL(\n url,\n resolvedBase\n )\n\n if (origin !== globalBase.origin) {\n throw new Error(`invariant: invalid relative URL, router received ${url}`)\n }\n\n return {\n pathname,\n query: parseQuery ? searchParamsToUrlQuery(searchParams) : undefined,\n search,\n hash,\n href: href.slice(origin.length),\n // We don't know for relative URLs at this point since we set a custom, internal\n // base that isn't surfaced to users.\n slashes: undefined,\n }\n}\n","'use client'\n\nimport type {\n FocusAndScrollRef,\n PrefetchKind,\n} from '../../client/components/router-reducer/router-reducer-types'\nimport type { Params } from '../../server/request/params'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n CacheNode,\n} from './app-router-types'\nimport React from 'react'\n\nexport interface NavigateOptions {\n scroll?: boolean\n}\n\nexport interface PrefetchOptions {\n kind: PrefetchKind\n onInvalidate?: () => void\n}\n\nexport interface AppRouterInstance {\n /**\n * Navigate to the previous history entry.\n */\n back(): void\n /**\n * Navigate to the next history entry.\n */\n forward(): void\n /**\n * Refresh the current page.\n */\n refresh(): void\n /**\n * Refresh the current page. Use in development only.\n * @internal\n */\n hmrRefresh(): void\n /**\n * Navigate to the provided href.\n * Pushes a new history entry.\n */\n push(href: string, options?: NavigateOptions): void\n /**\n * Navigate to the provided href.\n * Replaces the current history entry.\n */\n replace(href: string, options?: NavigateOptions): void\n /**\n * Prefetch the provided href.\n */\n prefetch(href: string, options?: PrefetchOptions): void\n}\n\nexport const AppRouterContext = React.createContext<AppRouterInstance | null>(\n null\n)\nexport const LayoutRouterContext = React.createContext<{\n parentTree: FlightRouterState\n parentCacheNode: CacheNode\n parentSegmentPath: FlightSegmentPath | null\n parentParams: Params\n debugNameContext: string\n url: string\n isActive: boolean\n} | null>(null)\n\nexport const GlobalLayoutRouterContext = React.createContext<{\n tree: FlightRouterState\n focusAndScrollRef: FocusAndScrollRef\n nextUrl: string | null\n previousNextUrl: string | null\n}>(null as any)\n\nexport const TemplateContext = React.createContext<React.ReactNode>(null as any)\n\nif (process.env.NODE_ENV !== 'production') {\n AppRouterContext.displayName = 'AppRouterContext'\n LayoutRouterContext.displayName = 'LayoutRouterContext'\n GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext'\n TemplateContext.displayName = 'TemplateContext'\n}\n\nexport const MissingSlotContext = React.createContext<Set<string>>(new Set())\n","'use client'\n\nimport { createContext } from 'react'\nimport type { Params } from '../../server/request/params'\n\nexport const SearchParamsContext = createContext<URLSearchParams | null>(null)\nexport const PathnameContext = createContext<string | null>(null)\nexport const PathParamsContext = createContext<Params | null>(null)\n\n// Dev-only context for Suspense DevTools instrumentation\n// These promises are used to track navigation hook usage in React DevTools\nexport type InstrumentedPromise<T> = Promise<T> & {\n status: 'fulfilled'\n value: T\n displayName: string\n}\n\nexport type NavigationPromises = {\n pathname: InstrumentedPromise<string>\n searchParams: InstrumentedPromise<any> // ReadonlyURLSearchParams\n params: InstrumentedPromise<any> // Params\n // Layout segment hooks (updated at each layout boundary)\n selectedLayoutSegmentPromises?: Map<\n string,\n InstrumentedPromise<string | null>\n >\n selectedLayoutSegmentsPromises?: Map<string, InstrumentedPromise<string[]>>\n}\n\nexport const NavigationPromisesContext =\n createContext<NavigationPromises | null>(null)\n\n// Creates an instrumented promise for Suspense DevTools\n// These promises are always fulfilled and exist purely for\n// tracking in React's Suspense DevTools.\nexport function createDevToolsInstrumentedPromise<T>(\n displayName: string,\n value: T\n): InstrumentedPromise<T> {\n const promise = Promise.resolve(value) as InstrumentedPromise<T>\n promise.status = 'fulfilled'\n promise.value = value\n promise.displayName = `${displayName} (SSR)`\n return promise\n}\n\nif (process.env.NODE_ENV !== 'production') {\n SearchParamsContext.displayName = 'SearchParamsContext'\n PathnameContext.displayName = 'PathnameContext'\n PathParamsContext.displayName = 'PathParamsContext'\n NavigationPromisesContext.displayName = 'NavigationPromisesContext'\n}\n","import { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport type { FlightRouterState } from '../../shared/lib/app-router-types'\n\nconst ANNOUNCER_TYPE = 'next-route-announcer'\nconst ANNOUNCER_ID = '__next-route-announcer__'\n\nfunction getAnnouncerNode() {\n const existingAnnouncer = document.getElementsByName(ANNOUNCER_TYPE)[0]\n if (existingAnnouncer?.shadowRoot?.childNodes[0]) {\n return existingAnnouncer.shadowRoot.childNodes[0] as HTMLElement\n } else {\n const container = document.createElement(ANNOUNCER_TYPE)\n container.style.cssText = 'position:absolute'\n const announcer = document.createElement('div')\n announcer.ariaLive = 'assertive'\n announcer.id = ANNOUNCER_ID\n announcer.role = 'alert'\n announcer.style.cssText =\n 'position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal'\n\n // Use shadow DOM here to avoid any potential CSS bleed\n const shadow = container.attachShadow({ mode: 'open' })\n shadow.appendChild(announcer)\n document.body.appendChild(container)\n return announcer\n }\n}\n\nexport function AppRouterAnnouncer({ tree }: { tree: FlightRouterState }) {\n const [portalNode, setPortalNode] = useState<HTMLElement | null>(null)\n\n useEffect(() => {\n const announcer = getAnnouncerNode()\n setPortalNode(announcer)\n return () => {\n const container = document.getElementsByTagName(ANNOUNCER_TYPE)[0]\n if (container?.isConnected) {\n document.body.removeChild(container)\n }\n }\n }, [])\n\n const [routeAnnouncement, setRouteAnnouncement] = useState('')\n const previousTitle = useRef<string | undefined>(undefined)\n\n useEffect(() => {\n let currentTitle = ''\n if (document.title) {\n currentTitle = document.title\n } else {\n const pageHeader = document.querySelector('h1')\n if (pageHeader) {\n currentTitle = pageHeader.innerText || pageHeader.textContent || ''\n }\n }\n\n // Only announce the title change, but not for the first load because screen\n // readers do that automatically.\n if (\n previousTitle.current !== undefined &&\n previousTitle.current !== currentTitle\n ) {\n setRouteAnnouncement(currentTitle)\n }\n previousTitle.current = currentTitle\n }, [tree])\n\n return portalNode ? createPortal(routeAnnouncement, portalNode) : null\n}\n","import type { Params } from '../../server/request/params'\n\nimport React, { useContext, useMemo, use } from 'react'\nimport {\n AppRouterContext,\n LayoutRouterContext,\n type AppRouterInstance,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport {\n SearchParamsContext,\n PathnameContext,\n PathParamsContext,\n NavigationPromisesContext,\n} from '../../shared/lib/hooks-client-context.shared-runtime'\nimport {\n computeSelectedLayoutSegment,\n getSelectedLayoutSegmentPath,\n} from '../../shared/lib/segment'\nimport { ReadonlyURLSearchParams } from './readonly-url-search-params'\n\nconst useDynamicRouteParams =\n typeof window === 'undefined'\n ? (\n require('../../server/app-render/dynamic-rendering') as typeof import('../../server/app-render/dynamic-rendering')\n ).useDynamicRouteParams\n : undefined\n\nconst useDynamicSearchParams =\n typeof window === 'undefined'\n ? (\n require('../../server/app-render/dynamic-rendering') as typeof import('../../server/app-render/dynamic-rendering')\n ).useDynamicSearchParams\n : undefined\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you *read* the current URL's search parameters.\n *\n * Learn more about [`URLSearchParams` on MDN](https://developer.mozilla.org/docs/Web/API/URLSearchParams)\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useSearchParams } from 'next/navigation'\n *\n * export default function Page() {\n * const searchParams = useSearchParams()\n * searchParams.get('foo') // returns 'bar' when ?foo=bar\n * // ...\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSearchParams`](https://nextjs.org/docs/app/api-reference/functions/use-search-params)\n */\n// Client components API\nexport function useSearchParams(): ReadonlyURLSearchParams {\n useDynamicSearchParams?.('useSearchParams()')\n\n const searchParams = useContext(SearchParamsContext)\n\n // In the case where this is `null`, the compat types added in\n // `next-env.d.ts` will add a new overload that changes the return type to\n // include `null`.\n const readonlySearchParams = useMemo(() => {\n if (!searchParams) {\n // When the router is not ready in pages, we won't have the search params\n // available.\n return null\n }\n\n return new ReadonlyURLSearchParams(searchParams)\n }, [searchParams]) as ReadonlyURLSearchParams\n\n // Instrument with Suspense DevTools (dev-only)\n if (process.env.NODE_ENV !== 'production' && 'use' in React) {\n const navigationPromises = use(NavigationPromisesContext)\n if (navigationPromises) {\n return use(navigationPromises.searchParams)\n }\n }\n\n return readonlySearchParams\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the current URL's pathname.\n *\n * @example\n * ```ts\n * \"use client\"\n * import { usePathname } from 'next/navigation'\n *\n * export default function Page() {\n * const pathname = usePathname() // returns \"/dashboard\" on /dashboard?foo=bar\n * // ...\n * }\n * ```\n *\n * Read more: [Next.js Docs: `usePathname`](https://nextjs.org/docs/app/api-reference/functions/use-pathname)\n */\n// Client components API\nexport function usePathname(): string {\n useDynamicRouteParams?.('usePathname()')\n\n // In the case where this is `null`, the compat types added in `next-env.d.ts`\n // will add a new overload that changes the return type to include `null`.\n const pathname = useContext(PathnameContext) as string\n\n // Instrument with Suspense DevTools (dev-only)\n if (process.env.NODE_ENV !== 'production' && 'use' in React) {\n const navigationPromises = use(NavigationPromisesContext)\n if (navigationPromises) {\n return use(navigationPromises.pathname)\n }\n }\n\n return pathname\n}\n\n// Client components API\nexport {\n ServerInsertedHTMLContext,\n useServerInsertedHTML,\n} from '../../shared/lib/server-inserted-html.shared-runtime'\n\n/**\n *\n * This hook allows you to programmatically change routes inside [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components).\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useRouter } from 'next/navigation'\n *\n * export default function Page() {\n * const router = useRouter()\n * // ...\n * router.push('/dashboard') // Navigate to /dashboard\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useRouter`](https://nextjs.org/docs/app/api-reference/functions/use-router)\n */\n// Client components API\nexport function useRouter(): AppRouterInstance {\n const router = useContext(AppRouterContext)\n if (router === null) {\n throw new Error('invariant expected app router to be mounted')\n }\n\n return router\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read a route's dynamic params filled in by the current URL.\n *\n * @example\n * ```ts\n * \"use client\"\n * import { useParams } from 'next/navigation'\n *\n * export default function Page() {\n * // on /dashboard/[team] where pathname is /dashboard/nextjs\n * const { team } = useParams() // team === \"nextjs\"\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useParams`](https://nextjs.org/docs/app/api-reference/functions/use-params)\n */\n// Client components API\nexport function useParams<T extends Params = Params>(): T {\n useDynamicRouteParams?.('useParams()')\n\n const params = useContext(PathParamsContext) as T\n\n // Instrument with Suspense DevTools (dev-only)\n if (process.env.NODE_ENV !== 'production' && 'use' in React) {\n const navigationPromises = use(NavigationPromisesContext)\n if (navigationPromises) {\n return use(navigationPromises.params) as T\n }\n }\n\n return params\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the active route segments **below** the Layout it is called from.\n *\n * @example\n * ```ts\n * 'use client'\n *\n * import { useSelectedLayoutSegments } from 'next/navigation'\n *\n * export default function ExampleClientComponent() {\n * const segments = useSelectedLayoutSegments()\n *\n * return (\n * <ul>\n * {segments.map((segment, index) => (\n * <li key={index}>{segment}</li>\n * ))}\n * </ul>\n * )\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSelectedLayoutSegments`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segments)\n */\n// Client components API\nexport function useSelectedLayoutSegments(\n parallelRouteKey: string = 'children'\n): string[] {\n useDynamicRouteParams?.('useSelectedLayoutSegments()')\n\n const context = useContext(LayoutRouterContext)\n // @ts-expect-error This only happens in `pages`. Type is overwritten in navigation.d.ts\n if (!context) return null\n\n // Instrument with Suspense DevTools (dev-only)\n if (process.env.NODE_ENV !== 'production' && 'use' in React) {\n const navigationPromises = use(NavigationPromisesContext)\n if (navigationPromises) {\n const promise =\n navigationPromises.selectedLayoutSegmentsPromises?.get(parallelRouteKey)\n if (promise) {\n // We should always have a promise here, but if we don't, it's not worth erroring over.\n // We just won't be able to instrument it, but can still provide the value.\n return use(promise)\n }\n }\n }\n\n return getSelectedLayoutSegmentPath(context.parentTree, parallelRouteKey)\n}\n\n/**\n * A [Client Component](https://nextjs.org/docs/app/building-your-application/rendering/client-components) hook\n * that lets you read the active route segment **one level below** the Layout it is called from.\n *\n * @example\n * ```ts\n * 'use client'\n * import { useSelectedLayoutSegment } from 'next/navigation'\n *\n * export default function ExampleClientComponent() {\n * const segment = useSelectedLayoutSegment()\n *\n * return <p>Active segment: {segment}</p>\n * }\n * ```\n *\n * Read more: [Next.js Docs: `useSelectedLayoutSegment`](https://nextjs.org/docs/app/api-reference/functions/use-selected-layout-segment)\n */\n// Client components API\nexport function useSelectedLayoutSegment(\n parallelRouteKey: string = 'children'\n): string | null {\n useDynamicRouteParams?.('useSelectedLayoutSegment()')\n const navigationPromises = useContext(NavigationPromisesContext)\n const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey)\n\n // Instrument with Suspense DevTools (dev-only)\n if (\n process.env.NODE_ENV !== 'production' &&\n navigationPromises &&\n 'use' in React\n ) {\n const promise =\n navigationPromises.selectedLayoutSegmentPromises?.get(parallelRouteKey)\n if (promise) {\n // We should always have a promise here, but if we don't, it's not worth erroring over.\n // We just won't be able to instrument it, but can still provide the value.\n return use(promise)\n }\n }\n\n return computeSelectedLayoutSegment(selectedLayoutSegments, parallelRouteKey)\n}\n\nexport { unstable_isUnrecognizedActionError } from './unrecognized-action-error'\n\n// Shared components APIs\nexport {\n notFound,\n forbidden,\n unauthorized,\n redirect,\n permanentRedirect,\n RedirectType,\n ReadonlyURLSearchParams,\n unstable_rethrow,\n} from './navigation.react-server'\n","'use client'\nimport React, { useEffect } from 'react'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport { useRouter } from './navigation'\nimport { getRedirectTypeFromError, getURLFromRedirectError } from './redirect'\nimport { RedirectType, isRedirectError } from './redirect-error'\n\ninterface RedirectBoundaryProps {\n router: AppRouterInstance\n children: React.ReactNode\n}\n\nfunction HandleRedirect({\n redirect,\n reset,\n redirectType,\n}: {\n redirect: string\n redirectType: RedirectType\n reset: () => void\n}) {\n const router = useRouter()\n\n useEffect(() => {\n React.startTransition(() => {\n if (redirectType === RedirectType.push) {\n router.push(redirect, {})\n } else {\n router.replace(redirect, {})\n }\n reset()\n })\n }, [redirect, redirectType, reset, router])\n\n return null\n}\n\nexport class RedirectErrorBoundary extends React.Component<\n RedirectBoundaryProps,\n { redirect: string | null; redirectType: RedirectType | null }\n> {\n constructor(props: RedirectBoundaryProps) {\n super(props)\n this.state = { redirect: null, redirectType: null }\n }\n\n static getDerivedStateFromError(error: any) {\n if (isRedirectError(error)) {\n const url = getURLFromRedirectError(error)\n const redirectType = getRedirectTypeFromError(error)\n return { redirect: url, redirectType }\n }\n // Re-throw if error is not for redirect\n throw error\n }\n\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.\n render(): React.ReactNode {\n const { redirect, redirectType } = this.state\n if (redirect !== null && redirectType !== null) {\n return (\n <HandleRedirect\n redirect={redirect}\n redirectType={redirectType}\n reset={() => this.setState({ redirect: null })}\n />\n )\n }\n\n return this.props.children\n }\n}\n\nexport function RedirectBoundary({ children }: { children: React.ReactNode }) {\n const router = useRouter()\n return (\n <RedirectErrorBoundary router={router}>{children}</RedirectErrorBoundary>\n )\n}\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n// TODO: Add `forbidden` docs\n/**\n * @experimental\n * This function allows you to render the [forbidden.js file](https://nextjs.org/docs/app/api-reference/file-conventions/forbidden)\n * within a route segment as well as inject a tag.\n *\n * `forbidden()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n * Read more: [Next.js Docs: `forbidden`](https://nextjs.org/docs/app/api-reference/functions/forbidden)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};403`\n\nexport function forbidden(): never {\n if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {\n throw new Error(\n `\\`forbidden()\\` is experimental and only allowed to be enabled when \\`experimental.authInterrupts\\` is enabled.`\n )\n }\n\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n throw error\n}\n","import {\n HTTP_ERROR_FALLBACK_ERROR_CODE,\n type HTTPAccessFallbackError,\n} from './http-access-fallback/http-access-fallback'\n\n// TODO: Add `unauthorized` docs\n/**\n * @experimental\n * This function allows you to render the [unauthorized.js file](https://nextjs.org/docs/app/api-reference/file-conventions/unauthorized)\n * within a route segment as well as inject a tag.\n *\n * `unauthorized()` can be used in\n * [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),\n * [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and\n * [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).\n *\n *\n * Read more: [Next.js Docs: `unauthorized`](https://nextjs.org/docs/app/api-reference/functions/unauthorized)\n */\n\nconst DIGEST = `${HTTP_ERROR_FALLBACK_ERROR_CODE};401`\n\nexport function unauthorized(): never {\n if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {\n throw new Error(\n `\\`unauthorized()\\` is experimental and only allowed to be used when \\`experimental.authInterrupts\\` is enabled.`\n )\n }\n\n const error = new Error(DIGEST) as HTTPAccessFallbackError\n ;(error as HTTPAccessFallbackError).digest = DIGEST\n throw error\n}\n","/**\n * This function should be used to rethrow internal Next.js errors so that they can be handled by the framework.\n * When wrapping an API that uses errors to interrupt control flow, you should use this function before you do any error handling.\n * This function will rethrow the error if it is a Next.js error so it can be handled, otherwise it will do nothing.\n *\n * Read more: [Next.js Docs: `unstable_rethrow`](https://nextjs.org/docs/app/api-reference/functions/unstable_rethrow)\n */\nexport const unstable_rethrow =\n typeof window === 'undefined'\n ? (\n require('./unstable-rethrow.server') as typeof import('./unstable-rethrow.server')\n ).unstable_rethrow\n : (\n require('./unstable-rethrow.browser') as typeof import('./unstable-rethrow.browser')\n ).unstable_rethrow\n","/**\n * Create a \"Thenable\" that does not resolve. This is used to suspend indefinitely when data is not available yet.\n */\nexport const unresolvedThenable = {\n then: () => {},\n} as PromiseLike<void>\n","import { pathHasPrefix } from '../shared/lib/router/utils/path-has-prefix'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function hasBasePath(path: string): boolean {\n return pathHasPrefix(path, basePath)\n}\n","import { hasBasePath } from './has-base-path'\n\nconst basePath = (process.env.__NEXT_ROUTER_BASEPATH as string) || ''\n\nexport function removeBasePath(path: string): string {\n if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {\n if (!hasBasePath(path)) {\n return path\n }\n }\n\n // Can't trim the basePath if it has zero length!\n if (basePath.length === 0) return path\n\n path = path.slice(basePath.length)\n if (!path.startsWith('/')) path = `/${path}`\n return path\n}\n","import {\n type AppRouterState,\n type ReducerActions,\n type ReducerState,\n ACTION_REFRESH,\n ACTION_SERVER_ACTION,\n ACTION_NAVIGATE,\n ACTION_RESTORE,\n type NavigateAction,\n ACTION_HMR_REFRESH,\n PrefetchKind,\n type AppHistoryState,\n} from './router-reducer/router-reducer-types'\nimport { reducer } from './router-reducer/router-reducer'\nimport { startTransition } from 'react'\nimport { isThenable } from '../../shared/lib/is-thenable'\nimport {\n FetchStrategy,\n prefetch as prefetchWithSegmentCache,\n type PrefetchTaskFetchStrategy,\n} from './segment-cache'\nimport { dispatchAppRouterAction } from './use-action-queue'\nimport { addBasePath } from '../add-base-path'\nimport { isExternalURL } from './app-router-utils'\nimport type {\n AppRouterInstance,\n NavigateOptions,\n PrefetchOptions,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { setLinkForCurrentNavigation, type LinkInstance } from './links'\nimport type { ClientInstrumentationHooks } from '../app-index'\nimport type { GlobalErrorComponent } from './builtin/global-error'\n\nexport type DispatchStatePromise = React.Dispatch<ReducerState>\n\nexport type AppRouterActionQueue = {\n state: AppRouterState\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) => void\n action: (state: AppRouterState, action: ReducerActions) => ReducerState\n\n onRouterTransitionStart:\n | ((url: string, type: 'push' | 'replace' | 'traverse') => void)\n | null\n\n pending: ActionQueueNode | null\n needsRefresh?: boolean\n last: ActionQueueNode | null\n}\n\nexport type GlobalErrorState = [\n GlobalError: GlobalErrorComponent,\n styles: React.ReactNode,\n]\n\nexport type ActionQueueNode = {\n payload: ReducerActions\n next: ActionQueueNode | null\n resolve: (value: ReducerState) => void\n reject: (err: Error) => void\n discarded?: boolean\n}\n\nfunction runRemainingActions(\n actionQueue: AppRouterActionQueue,\n setState: DispatchStatePromise\n) {\n if (actionQueue.pending !== null) {\n actionQueue.pending = actionQueue.pending.next\n if (actionQueue.pending !== null) {\n runAction({\n actionQueue,\n action: actionQueue.pending,\n setState,\n })\n }\n } else {\n // Check for refresh when pending is already null\n // This handles the case where a discarded server action completes\n // after the navigation has already finished and the queue is empty\n if (actionQueue.needsRefresh) {\n actionQueue.needsRefresh = false\n actionQueue.dispatch(\n {\n type: ACTION_REFRESH,\n origin: window.location.origin,\n },\n setState\n )\n }\n }\n}\n\nasync function runAction({\n actionQueue,\n action,\n setState,\n}: {\n actionQueue: AppRouterActionQueue\n action: ActionQueueNode\n setState: DispatchStatePromise\n}) {\n const prevState = actionQueue.state\n\n actionQueue.pending = action\n\n const payload = action.payload\n const actionResult = actionQueue.action(prevState, payload)\n\n function handleResult(nextState: AppRouterState) {\n // if we discarded this action, the state should also be discarded\n if (action.discarded) {\n // Check if the discarded server action revalidated data\n if (\n action.payload.type === ACTION_SERVER_ACTION &&\n action.payload.didRevalidate\n ) {\n // The server action was discarded but it revalidated data,\n // mark that we need to refresh after all actions complete\n actionQueue.needsRefresh = true\n }\n // Still need to run remaining actions even for discarded actions\n // to potentially trigger the refresh\n runRemainingActions(actionQueue, setState)\n return\n }\n\n actionQueue.state = nextState\n\n runRemainingActions(actionQueue, setState)\n action.resolve(nextState)\n }\n\n // if the action is a promise, set up a callback to resolve it\n if (isThenable(actionResult)) {\n actionResult.then(handleResult, (err) => {\n runRemainingActions(actionQueue, setState)\n action.reject(err)\n })\n } else {\n handleResult(actionResult)\n }\n}\n\nfunction dispatchAction(\n actionQueue: AppRouterActionQueue,\n payload: ReducerActions,\n setState: DispatchStatePromise\n) {\n let resolvers: {\n resolve: (value: ReducerState) => void\n reject: (reason: any) => void\n } = { resolve: setState, reject: () => {} }\n\n // most of the action types are async with the exception of restore\n // it's important that restore is handled quickly since it's fired on the popstate event\n // and we don't want to add any delay on a back/forward nav\n // this only creates a promise for the async actions\n if (payload.type !== ACTION_RESTORE) {\n // Create the promise and assign the resolvers to the object.\n const deferredPromise = new Promise<AppRouterState>((resolve, reject) => {\n resolvers = { resolve, reject }\n })\n\n startTransition(() => {\n // we immediately notify React of the pending promise -- the resolver is attached to the action node\n // and will be called when the associated action promise resolves\n setState(deferredPromise)\n })\n }\n\n const newAction: ActionQueueNode = {\n payload,\n next: null,\n resolve: resolvers.resolve,\n reject: resolvers.reject,\n }\n\n // Check if the queue is empty\n if (actionQueue.pending === null) {\n // The queue is empty, so add the action and start it immediately\n // Mark this action as the last in the queue\n actionQueue.last = newAction\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else if (\n payload.type === ACTION_NAVIGATE ||\n payload.type === ACTION_RESTORE\n ) {\n // Navigations (including back/forward) take priority over any pending actions.\n // Mark the pending action as discarded (so the state is never applied) and start the navigation action immediately.\n actionQueue.pending.discarded = true\n\n // The rest of the current queue should still execute after this navigation.\n // (Note that it can't contain any earlier navigations, because we always put those into `actionQueue.pending` by calling `runAction`)\n newAction.next = actionQueue.pending.next\n\n runAction({\n actionQueue,\n action: newAction,\n setState,\n })\n } else {\n // The queue is not empty, so add the action to the end of the queue\n // It will be started by runRemainingActions after the previous action finishes\n if (actionQueue.last !== null) {\n actionQueue.last.next = newAction\n }\n actionQueue.last = newAction\n }\n}\n\nlet globalActionQueue: AppRouterActionQueue | null = null\n\nexport function createMutableActionQueue(\n initialState: AppRouterState,\n instrumentationHooks: ClientInstrumentationHooks | null\n): AppRouterActionQueue {\n const actionQueue: AppRouterActionQueue = {\n state: initialState,\n dispatch: (payload: ReducerActions, setState: DispatchStatePromise) =>\n dispatchAction(actionQueue, payload, setState),\n action: async (state: AppRouterState, action: ReducerActions) => {\n const result = reducer(state, action)\n return result\n },\n pending: null,\n last: null,\n onRouterTransitionStart:\n instrumentationHooks !== null &&\n typeof instrumentationHooks.onRouterTransitionStart === 'function'\n ? // This profiling hook will be called at the start of every navigation.\n instrumentationHooks.onRouterTransitionStart\n : null,\n }\n\n if (typeof window !== 'undefined') {\n // The action queue is lazily created on hydration, but after that point\n // it doesn't change. So we can store it in a global rather than pass\n // it around everywhere via props/context.\n if (globalActionQueue !== null) {\n throw new Error(\n 'Internal Next.js Error: createMutableActionQueue was called more ' +\n 'than once'\n )\n }\n globalActionQueue = actionQueue\n }\n\n return actionQueue\n}\n\nexport function getCurrentAppRouterState(): AppRouterState | null {\n return globalActionQueue !== null ? globalActionQueue.state : null\n}\n\nfunction getAppRouterActionQueue(): AppRouterActionQueue {\n if (globalActionQueue === null) {\n throw new Error(\n 'Internal Next.js error: Router action dispatched before initialization.'\n )\n }\n return globalActionQueue\n}\n\nfunction getProfilingHookForOnNavigationStart() {\n if (globalActionQueue !== null) {\n return globalActionQueue.onRouterTransitionStart\n }\n return null\n}\n\nexport function dispatchNavigateAction(\n href: string,\n navigateType: NavigateAction['navigateType'],\n shouldScroll: boolean,\n linkInstanceRef: LinkInstance | null\n): void {\n // TODO: This stuff could just go into the reducer. Leaving as-is for now\n // since we're about to rewrite all the router reducer stuff anyway.\n const url = new URL(addBasePath(href), location.href)\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n window.next.__pendingUrl = url\n }\n\n setLinkForCurrentNavigation(linkInstanceRef)\n\n const onRouterTransitionStart = getProfilingHookForOnNavigationStart()\n if (onRouterTransitionStart !== null) {\n onRouterTransitionStart(href, navigateType)\n }\n\n dispatchAppRouterAction({\n type: ACTION_NAVIGATE,\n url,\n isExternalUrl: isExternalURL(url),\n locationSearch: location.search,\n shouldScroll,\n navigateType,\n })\n}\n\nexport function dispatchTraverseAction(\n href: string,\n historyState: AppHistoryState | undefined\n) {\n const onRouterTransitionStart = getProfilingHookForOnNavigationStart()\n if (onRouterTransitionStart !== null) {\n onRouterTransitionStart(href, 'traverse')\n }\n dispatchAppRouterAction({\n type: ACTION_RESTORE,\n url: new URL(href),\n historyState,\n })\n}\n\n/**\n * The app router that is exposed through `useRouter`. These are public API\n * methods. Internal Next.js code should call the lower level methods directly\n * (although there's lots of existing code that doesn't do that).\n */\nexport const publicAppRouterInstance: AppRouterInstance = {\n back: () => window.history.back(),\n forward: () => window.history.forward(),\n prefetch:\n // Unlike the old implementation, the Segment Cache doesn't store its\n // data in the router reducer state; it writes into a global mutable\n // cache. So we don't need to dispatch an action.\n (href: string, options?: PrefetchOptions) => {\n const actionQueue = getAppRouterActionQueue()\n const prefetchKind = options?.kind ?? PrefetchKind.AUTO\n\n // We don't currently offer a way to issue a runtime prefetch via `router.prefetch()`.\n // This will be possible when we update its API to not take a PrefetchKind.\n let fetchStrategy: PrefetchTaskFetchStrategy\n switch (prefetchKind) {\n case PrefetchKind.AUTO: {\n // We default to PPR. We'll discover whether or not the route supports it with the initial prefetch.\n fetchStrategy = FetchStrategy.PPR\n break\n }\n case PrefetchKind.FULL: {\n fetchStrategy = FetchStrategy.Full\n break\n }\n case PrefetchKind.TEMPORARY: {\n // This concept doesn't exist in the segment cache implementation.\n return\n }\n default: {\n prefetchKind satisfies never\n // Despite typescript thinking that this can't happen,\n // we might get an unexpected value from user code.\n // We don't know what they want, but we know they want a prefetch,\n // so use the default.\n fetchStrategy = FetchStrategy.PPR\n }\n }\n\n prefetchWithSegmentCache(\n href,\n actionQueue.state.nextUrl,\n actionQueue.state.tree,\n fetchStrategy,\n options?.onInvalidate ?? null\n )\n },\n replace: (href: string, options?: NavigateOptions) => {\n startTransition(() => {\n dispatchNavigateAction(href, 'replace', options?.scroll ?? true, null)\n })\n },\n push: (href: string, options?: NavigateOptions) => {\n startTransition(() => {\n dispatchNavigateAction(href, 'push', options?.scroll ?? true, null)\n })\n },\n refresh: () => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_REFRESH,\n origin: window.location.origin,\n })\n })\n },\n hmrRefresh: () => {\n if (process.env.NODE_ENV !== 'development') {\n throw new Error(\n 'hmrRefresh can only be used in development mode. Please use refresh instead.'\n )\n } else {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_HMR_REFRESH,\n origin: window.location.origin,\n })\n })\n }\n },\n}\n\n// Exists for debugging purposes. Don't use in application code.\nif (typeof window !== 'undefined' && window.next) {\n window.next.router = publicAppRouterInstance\n}\n","'use client'\n\nimport { Component, createRef, type ReactNode } from 'react'\n\ninterface ErrorBoundaryProps {\n children: ReactNode\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean\n}\n\nfunction getDomNodeAttributes(node: HTMLElement): Record<string, string> {\n const result: Record<string, string> = {}\n for (let i = 0; i < node.attributes.length; i++) {\n const attr = node.attributes[i]\n result[attr.name] = attr.value\n }\n return result\n}\n\nexport class GracefulDegradeBoundary extends Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n private rootHtml: string\n private htmlAttributes: Record<string, string>\n private htmlRef: React.RefObject<HTMLHtmlElement | null>\n\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n this.rootHtml = ''\n this.htmlAttributes = {}\n this.htmlRef = createRef<HTMLHtmlElement>()\n }\n\n static getDerivedStateFromError(_: unknown): ErrorBoundaryState {\n return { hasError: true }\n }\n\n componentDidMount() {\n const htmlNode = this.htmlRef.current\n if (this.state.hasError && htmlNode) {\n // Reapply the cached HTML attributes to the root element\n Object.entries(this.htmlAttributes).forEach(([key, value]) => {\n htmlNode.setAttribute(key, value)\n })\n }\n }\n\n render() {\n const { hasError } = this.state\n // Cache the root HTML content on the first render\n if (typeof window !== 'undefined' && !this.rootHtml) {\n this.rootHtml = document.documentElement.innerHTML\n this.htmlAttributes = getDomNodeAttributes(document.documentElement)\n }\n\n if (hasError) {\n // Render the current HTML content without hydration\n return (\n <html\n ref={this.htmlRef}\n suppressHydrationWarning\n dangerouslySetInnerHTML={{\n __html: this.rootHtml,\n }}\n />\n )\n }\n\n return this.props.children\n }\n}\n\nexport default GracefulDegradeBoundary\n","const workAsyncStorage =\n typeof window === 'undefined'\n ? (\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n ).workAsyncStorage\n : undefined\n\n// if we are revalidating we want to re-throw the error so the\n// function crashes so we can maintain our previous cache\n// instead of caching the error page\nexport function HandleISRError({ error }: { error: any }) {\n if (workAsyncStorage) {\n const store = workAsyncStorage.getStore()\n if (store?.isStaticGeneration) {\n if (error) {\n console.error(error)\n }\n throw error\n }\n }\n\n return null\n}\n","'use client'\n\nimport React, { type JSX } from 'react'\nimport { useUntrackedPathname } from './navigation-untracked'\nimport { isNextRouterError } from './is-next-router-error'\nimport { handleHardNavError } from './nav-failure-handler'\nimport { HandleISRError } from './handle-isr-error'\nimport { isBot } from '../../shared/lib/router/utils/is-bot'\n\nconst isBotUserAgent =\n typeof window !== 'undefined' && isBot(window.navigator.userAgent)\n\nexport type ErrorComponent = React.ComponentType<{\n error: Error\n // global-error, there's no `reset` function;\n // regular error boundary, there's a `reset` function.\n reset?: () => void\n}>\n\nexport interface ErrorBoundaryProps {\n children?: React.ReactNode\n errorComponent: ErrorComponent | undefined\n errorStyles?: React.ReactNode | undefined\n errorScripts?: React.ReactNode | undefined\n}\n\ninterface ErrorBoundaryHandlerProps extends ErrorBoundaryProps {\n pathname: string | null\n errorComponent: ErrorComponent\n}\n\ninterface ErrorBoundaryHandlerState {\n error: Error | null\n previousPathname: string | null\n}\n\nexport class ErrorBoundaryHandler extends React.Component<\n ErrorBoundaryHandlerProps,\n ErrorBoundaryHandlerState\n> {\n constructor(props: ErrorBoundaryHandlerProps) {\n super(props)\n this.state = { error: null, previousPathname: this.props.pathname }\n }\n\n static getDerivedStateFromError(error: Error) {\n if (isNextRouterError(error)) {\n // Re-throw if an expected internal Next.js router error occurs\n // this means it should be handled by a different boundary (such as a NotFound boundary in a parent segment)\n throw error\n }\n\n return { error }\n }\n\n static getDerivedStateFromProps(\n props: ErrorBoundaryHandlerProps,\n state: ErrorBoundaryHandlerState\n ): ErrorBoundaryHandlerState | null {\n const { error } = state\n\n // if we encounter an error while\n // a navigation is pending we shouldn't render\n // the error boundary and instead should fallback\n // to a hard navigation to attempt recovering\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n if (error && handleHardNavError(error)) {\n // clear error so we don't render anything\n return {\n error: null,\n previousPathname: props.pathname,\n }\n }\n }\n\n /**\n * Handles reset of the error boundary when a navigation happens.\n * Ensures the error boundary does not stay enabled when navigating to a new page.\n * Approach of setState in render is safe as it checks the previous pathname and then overrides\n * it as outlined in https://react.dev/reference/react/useState#storing-information-from-previous-renders\n */\n if (props.pathname !== state.previousPathname && state.error) {\n return {\n error: null,\n previousPathname: props.pathname,\n }\n }\n return {\n error: state.error,\n previousPathname: props.pathname,\n }\n }\n\n reset = () => {\n this.setState({ error: null })\n }\n\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.\n render(): React.ReactNode {\n //When it's bot request, segment level error boundary will keep rendering the children,\n // the final error will be caught by the root error boundary and determine wether need to apply graceful degrade.\n if (this.state.error && !isBotUserAgent) {\n return (\n <>\n <HandleISRError error={this.state.error} />\n {this.props.errorStyles}\n {this.props.errorScripts}\n <this.props.errorComponent\n error={this.state.error}\n reset={this.reset}\n />\n </>\n )\n }\n\n return this.props.children\n }\n}\n\n/**\n * Handles errors through `getDerivedStateFromError`.\n * Renders the provided error component and provides a way to `reset` the error boundary state.\n */\n\n/**\n * Renders error boundary with the provided \"errorComponent\" property as the fallback.\n * If no \"errorComponent\" property is provided it renders the children without an error boundary.\n */\nexport function ErrorBoundary({\n errorComponent,\n errorStyles,\n errorScripts,\n children,\n}: ErrorBoundaryProps & {\n children: React.ReactNode\n}): JSX.Element {\n // When we're rendering the missing params shell, this will return null. This\n // is because we won't be rendering any not found boundaries or error\n // boundaries for the missing params shell. When this runs on the client\n // (where these errors can occur), we will get the correct pathname.\n const pathname = useUntrackedPathname()\n if (errorComponent) {\n return (\n <ErrorBoundaryHandler\n pathname={pathname}\n errorComponent={errorComponent}\n errorStyles={errorStyles}\n errorScripts={errorScripts}\n >\n {children}\n </ErrorBoundaryHandler>\n )\n }\n\n return <>{children}</>\n}\n","import { useContext } from 'react'\nimport { PathnameContext } from '../../shared/lib/hooks-client-context.shared-runtime'\n\n/**\n * This checks to see if the current render has any unknown route parameters that\n * would cause the pathname to be dynamic. It's used to trigger a different\n * render path in the error boundary.\n *\n * @returns true if there are any unknown route parameters, false otherwise\n */\nfunction hasFallbackRouteParams(): boolean {\n if (typeof window === 'undefined') {\n // AsyncLocalStorage should not be included in the client bundle.\n const { workUnitAsyncStorage } =\n require('../../server/app-render/work-unit-async-storage.external') as typeof import('../../server/app-render/work-unit-async-storage.external')\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (!workUnitStore) return false\n\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-ppr':\n const fallbackParams = workUnitStore.fallbackRouteParams\n return fallbackParams ? fallbackParams.size > 0 : false\n case 'prerender-legacy':\n case 'request':\n case 'prerender-runtime':\n case 'cache':\n case 'private-cache':\n case 'unstable-cache':\n break\n default:\n workUnitStore satisfies never\n }\n\n return false\n }\n\n return false\n}\n\n/**\n * This returns a `null` value if there are any unknown route parameters, and\n * otherwise returns the pathname from the context. This is an alternative to\n * `usePathname` that is used in the error boundary to avoid rendering the\n * error boundary when there are unknown route parameters. This doesn't throw\n * when accessed with unknown route parameters.\n *\n * @returns\n *\n * @internal\n */\nexport function useUntrackedPathname(): string | null {\n // If there are any unknown route parameters we would typically throw\n // an error, but this internal method allows us to return a null value instead\n // for components that do not propagate the pathname to the static shell (like\n // the error boundary).\n if (hasFallbackRouteParams()) {\n return null\n }\n\n // This shouldn't cause any issues related to conditional rendering because\n // the environment will be consistent for the render.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useContext(PathnameContext)\n}\n","'use client'\n\nimport React, { type JSX } from 'react'\nimport GracefulDegradeBoundary from './graceful-degrade-boundary'\nimport { ErrorBoundary, type ErrorBoundaryProps } from '../error-boundary'\nimport { isBot } from '../../../shared/lib/router/utils/is-bot'\n\nconst isBotUserAgent =\n typeof window !== 'undefined' && isBot(window.navigator.userAgent)\n\nexport default function RootErrorBoundary({\n children,\n errorComponent,\n errorStyles,\n errorScripts,\n}: ErrorBoundaryProps & { children: React.ReactNode }): JSX.Element {\n if (isBotUserAgent) {\n // Preserve existing DOM/HTML for bots to avoid replacing content with an error UI\n // and to keep the original SSR output intact.\n return <GracefulDegradeBoundary>{children}</GracefulDegradeBoundary>\n }\n\n return (\n <ErrorBoundary\n errorComponent={errorComponent}\n errorStyles={errorStyles}\n errorScripts={errorScripts}\n >\n {children}\n </ErrorBoundary>\n )\n}\n","'use client'\n\nimport { HandleISRError } from '../handle-isr-error'\n\nconst styles = {\n error: {\n // https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css#L38-L52\n fontFamily:\n 'system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"',\n height: '100vh',\n textAlign: 'center',\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n },\n text: {\n fontSize: '14px',\n fontWeight: 400,\n lineHeight: '28px',\n margin: '0 8px',\n },\n} as const\n\nexport type GlobalErrorComponent = React.ComponentType<{\n error: any\n}>\nfunction DefaultGlobalError({ error }: { error: any }) {\n const digest: string | undefined = error?.digest\n return (\n <html id=\"__next_error__\">\n <head></head>\n <body>\n <HandleISRError error={error} />\n <div style={styles.error}>\n <div>\n <h2 style={styles.text}>\n Application error: a {digest ? 'server' : 'client'}-side exception\n has occurred while loading {window.location.hostname} (see the{' '}\n {digest ? 'server logs' : 'browser console'} for more\n information).\n </h2>\n {digest ? <p style={styles.text}>{`Digest: ${digest}`}</p> : null}\n </div>\n </div>\n </body>\n </html>\n )\n}\n\n// Exported so that the import signature in the loaders can be identical to user\n// supplied custom global error signatures.\nexport default DefaultGlobalError\n","'use client'\n\nimport type { ReactNode } from 'react'\nimport {\n METADATA_BOUNDARY_NAME,\n VIEWPORT_BOUNDARY_NAME,\n OUTLET_BOUNDARY_NAME,\n ROOT_LAYOUT_BOUNDARY_NAME,\n} from './boundary-constants'\n\n// We use a namespace object to allow us to recover the name of the function\n// at runtime even when production bundling/minification is used.\nconst NameSpace = {\n [METADATA_BOUNDARY_NAME]: function ({ children }: { children: ReactNode }) {\n return children\n },\n [VIEWPORT_BOUNDARY_NAME]: function ({ children }: { children: ReactNode }) {\n return children\n },\n [OUTLET_BOUNDARY_NAME]: function ({ children }: { children: ReactNode }) {\n return children\n },\n [ROOT_LAYOUT_BOUNDARY_NAME]: function ({\n children,\n }: {\n children: ReactNode\n }) {\n return children\n },\n}\n\nexport const MetadataBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[METADATA_BOUNDARY_NAME.slice(0) as typeof METADATA_BOUNDARY_NAME]\n\nexport const ViewportBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[VIEWPORT_BOUNDARY_NAME.slice(0) as typeof VIEWPORT_BOUNDARY_NAME]\n\nexport const OutletBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[OUTLET_BOUNDARY_NAME.slice(0) as typeof OUTLET_BOUNDARY_NAME]\n\nexport const RootLayoutBoundary =\n // We use slice(0) to trick the bundler into not inlining/minifying the function\n // so it retains the name inferred from the namespace object\n NameSpace[\n ROOT_LAYOUT_BOUNDARY_NAME.slice(0) as typeof ROOT_LAYOUT_BOUNDARY_NAME\n ]\n","import React, {\n useEffect,\n useMemo,\n startTransition,\n useInsertionEffect,\n useDeferredValue,\n} from 'react'\nimport {\n AppRouterContext,\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport type { CacheNode } from '../../shared/lib/app-router-types'\nimport { ACTION_RESTORE } from './router-reducer/router-reducer-types'\nimport type {\n AppHistoryState,\n AppRouterState,\n} from './router-reducer/router-reducer-types'\nimport { createHrefFromUrl } from './router-reducer/create-href-from-url'\nimport {\n SearchParamsContext,\n PathnameContext,\n PathParamsContext,\n NavigationPromisesContext,\n type NavigationPromises,\n} from '../../shared/lib/hooks-client-context.shared-runtime'\nimport { dispatchAppRouterAction, useActionQueue } from './use-action-queue'\nimport { AppRouterAnnouncer } from './app-router-announcer'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { findHeadInCache } from './router-reducer/reducers/find-head-in-cache'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { removeBasePath } from '../remove-base-path'\nimport { hasBasePath } from '../has-base-path'\nimport { getSelectedParams } from './router-reducer/compute-changed-path'\nimport { useNavFailureHandler } from './nav-failure-handler'\nimport {\n dispatchTraverseAction,\n publicAppRouterInstance,\n type AppRouterActionQueue,\n type GlobalErrorState,\n} from './app-router-instance'\nimport { getRedirectTypeFromError, getURLFromRedirectError } from './redirect'\nimport { isRedirectError, RedirectType } from './redirect-error'\nimport { pingVisibleLinks } from './links'\nimport RootErrorBoundary from './errors/root-error-boundary'\nimport DefaultGlobalError from './builtin/global-error'\nimport { RootLayoutBoundary } from '../../lib/framework/boundary-components'\nimport type { StaticIndicatorState } from '../dev/hot-reloader/app/hot-reloader-app'\n\nconst globalMutable: {\n pendingMpaPath?: string\n} = {}\n\nfunction HistoryUpdater({\n appRouterState,\n}: {\n appRouterState: AppRouterState\n}) {\n useInsertionEffect(() => {\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n // clear pending URL as navigation is no longer\n // in flight\n window.next.__pendingUrl = undefined\n }\n\n const { tree, pushRef, canonicalUrl, renderedSearch } = appRouterState\n\n const appHistoryState: AppHistoryState = {\n tree,\n renderedSearch,\n }\n\n const historyState = {\n ...(pushRef.preserveCustomHistoryState ? window.history.state : {}),\n // Identifier is shortened intentionally.\n // __NA is used to identify if the history entry can be handled by the app-router.\n // __N is used to identify if the history entry can be handled by the old router.\n __NA: true,\n __PRIVATE_NEXTJS_INTERNALS_TREE: appHistoryState,\n }\n if (\n pushRef.pendingPush &&\n // Skip pushing an additional history entry if the canonicalUrl is the same as the current url.\n // This mirrors the browser behavior for normal navigation.\n createHrefFromUrl(new URL(window.location.href)) !== canonicalUrl\n ) {\n // This intentionally mutates React state, pushRef is overwritten to ensure additional push/replace calls do not trigger an additional history entry.\n pushRef.pendingPush = false\n window.history.pushState(historyState, '', canonicalUrl)\n } else {\n window.history.replaceState(historyState, '', canonicalUrl)\n }\n }, [appRouterState])\n\n useEffect(() => {\n // The Next-Url and the base tree may affect the result of a prefetch\n // task. Re-prefetch all visible links with the updated values. In most\n // cases, this will not result in any new network requests, only if\n // the prefetch result actually varies on one of these inputs.\n if (process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n pingVisibleLinks(appRouterState.nextUrl, appRouterState.tree)\n }\n }, [appRouterState.nextUrl, appRouterState.tree])\n\n return null\n}\n\nexport function createEmptyCacheNode(): CacheNode {\n return {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n navigatedAt: -1,\n }\n}\n\nfunction copyNextJsInternalHistoryState(data: any) {\n if (data == null) data = {}\n const currentState = window.history.state\n const __NA = currentState?.__NA\n if (__NA) {\n data.__NA = __NA\n }\n const __PRIVATE_NEXTJS_INTERNALS_TREE =\n currentState?.__PRIVATE_NEXTJS_INTERNALS_TREE\n if (__PRIVATE_NEXTJS_INTERNALS_TREE) {\n data.__PRIVATE_NEXTJS_INTERNALS_TREE = __PRIVATE_NEXTJS_INTERNALS_TREE\n }\n\n return data\n}\n\nfunction Head({\n headCacheNode,\n}: {\n headCacheNode: CacheNode | null\n}): React.ReactNode {\n // If this segment has a `prefetchHead`, it's the statically prefetched data.\n // We should use that on initial render instead of `head`. Then we'll switch\n // to `head` when the dynamic response streams in.\n const head = headCacheNode !== null ? headCacheNode.head : null\n const prefetchHead =\n headCacheNode !== null ? headCacheNode.prefetchHead : null\n\n // If no prefetch data is available, then we go straight to rendering `head`.\n const resolvedPrefetchRsc = prefetchHead !== null ? prefetchHead : head\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n return useDeferredValue(head, resolvedPrefetchRsc)\n}\n\n/**\n * The global router that wraps the application components.\n */\nfunction Router({\n actionQueue,\n globalError,\n webSocket,\n staticIndicatorState,\n}: {\n actionQueue: AppRouterActionQueue\n globalError: GlobalErrorState\n webSocket: WebSocket | undefined\n staticIndicatorState: StaticIndicatorState | undefined\n}) {\n const state = useActionQueue(actionQueue)\n const { canonicalUrl } = state\n // Add memoized pathname/query for useSearchParams and usePathname.\n const { searchParams, pathname } = useMemo(() => {\n const url = new URL(\n canonicalUrl,\n typeof window === 'undefined' ? 'http://n' : window.location.href\n )\n\n return {\n // This is turned into a readonly class in `useSearchParams`\n searchParams: url.searchParams,\n pathname: hasBasePath(url.pathname)\n ? removeBasePath(url.pathname)\n : url.pathname,\n }\n }, [canonicalUrl])\n\n if (process.env.NODE_ENV !== 'production') {\n const { cache, tree } = state\n\n // This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n // Add `window.nd` for debugging purposes.\n // This is not meant for use in applications as concurrent rendering will affect the cache/tree/router.\n // @ts-ignore this is for debugging\n window.nd = {\n router: publicAppRouterInstance,\n cache,\n tree,\n }\n }, [cache, tree])\n }\n\n useEffect(() => {\n // If the app is restored from bfcache, it's possible that\n // pushRef.mpaNavigation is true, which would mean that any re-render of this component\n // would trigger the mpa navigation logic again from the lines below.\n // This will restore the router to the initial state in the event that the app is restored from bfcache.\n function handlePageShow(event: PageTransitionEvent) {\n if (\n !event.persisted ||\n !window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE\n ) {\n return\n }\n\n // Clear the pendingMpaPath value so that a subsequent MPA navigation to the same URL can be triggered.\n // This is necessary because if the browser restored from bfcache, the pendingMpaPath would still be set to the value\n // of the last MPA navigation.\n globalMutable.pendingMpaPath = undefined\n\n dispatchAppRouterAction({\n type: ACTION_RESTORE,\n url: new URL(window.location.href),\n historyState: window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE,\n })\n }\n\n window.addEventListener('pageshow', handlePageShow)\n\n return () => {\n window.removeEventListener('pageshow', handlePageShow)\n }\n }, [])\n\n useEffect(() => {\n // Ensure that any redirect errors that bubble up outside of the RedirectBoundary\n // are caught and handled by the router.\n function handleUnhandledRedirect(\n event: ErrorEvent | PromiseRejectionEvent\n ) {\n const error = 'reason' in event ? event.reason : event.error\n if (isRedirectError(error)) {\n event.preventDefault()\n const url = getURLFromRedirectError(error)\n const redirectType = getRedirectTypeFromError(error)\n // TODO: This should access the router methods directly, rather than\n // go through the public interface.\n if (redirectType === RedirectType.push) {\n publicAppRouterInstance.push(url, {})\n } else {\n publicAppRouterInstance.replace(url, {})\n }\n }\n }\n window.addEventListener('error', handleUnhandledRedirect)\n window.addEventListener('unhandledrejection', handleUnhandledRedirect)\n\n return () => {\n window.removeEventListener('error', handleUnhandledRedirect)\n window.removeEventListener('unhandledrejection', handleUnhandledRedirect)\n }\n }, [])\n\n // When mpaNavigation flag is set do a hard navigation to the new url.\n // Infinitely suspend because we don't actually want to rerender any child\n // components with the new URL and any entangled state updates shouldn't\n // commit either (eg: useTransition isPending should stay true until the page\n // unloads).\n //\n // This is a side effect in render. Don't try this at home, kids. It's\n // probably safe because we know this is a singleton component and it's never\n // in <Offscreen>. At least I hope so. (It will run twice in dev strict mode,\n // but that's... fine?)\n const { pushRef } = state\n if (pushRef.mpaNavigation) {\n // if there's a re-render, we don't want to trigger another redirect if one is already in flight to the same URL\n if (globalMutable.pendingMpaPath !== canonicalUrl) {\n const location = window.location\n if (pushRef.pendingPush) {\n location.assign(canonicalUrl)\n } else {\n location.replace(canonicalUrl)\n }\n\n globalMutable.pendingMpaPath = canonicalUrl\n }\n // TODO-APP: Should we listen to navigateerror here to catch failed\n // navigations somehow? And should we call window.stop() if a SPA navigation\n // should interrupt an MPA one?\n // NOTE: This is intentionally using `throw` instead of `use` because we're\n // inside an externally mutable condition (pushRef.mpaNavigation), which\n // violates the rules of hooks.\n throw unresolvedThenable\n }\n\n useEffect(() => {\n const originalPushState = window.history.pushState.bind(window.history)\n const originalReplaceState = window.history.replaceState.bind(\n window.history\n )\n\n // Ensure the canonical URL in the Next.js Router is updated when the URL is changed so that `usePathname` and `useSearchParams` hold the pushed values.\n const applyUrlFromHistoryPushReplace = (\n url: string | URL | null | undefined\n ) => {\n const href = window.location.href\n const appHistoryState: AppHistoryState | undefined =\n window.history.state?.__PRIVATE_NEXTJS_INTERNALS_TREE\n\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_RESTORE,\n url: new URL(url ?? href, href),\n historyState: appHistoryState,\n })\n })\n }\n\n /**\n * Patch pushState to ensure external changes to the history are reflected in the Next.js Router.\n * Ensures Next.js internal history state is copied to the new history entry.\n * Ensures usePathname and useSearchParams hold the newly provided url.\n */\n window.history.pushState = function pushState(\n data: any,\n _unused: string,\n url?: string | URL | null\n ): void {\n // Avoid a loop when Next.js internals trigger pushState/replaceState\n if (data?.__NA || data?._N) {\n return originalPushState(data, _unused, url)\n }\n\n data = copyNextJsInternalHistoryState(data)\n\n if (url) {\n applyUrlFromHistoryPushReplace(url)\n }\n\n return originalPushState(data, _unused, url)\n }\n\n /**\n * Patch replaceState to ensure external changes to the history are reflected in the Next.js Router.\n * Ensures Next.js internal history state is copied to the new history entry.\n * Ensures usePathname and useSearchParams hold the newly provided url.\n */\n window.history.replaceState = function replaceState(\n data: any,\n _unused: string,\n url?: string | URL | null\n ): void {\n // Avoid a loop when Next.js internals trigger pushState/replaceState\n if (data?.__NA || data?._N) {\n return originalReplaceState(data, _unused, url)\n }\n data = copyNextJsInternalHistoryState(data)\n\n if (url) {\n applyUrlFromHistoryPushReplace(url)\n }\n return originalReplaceState(data, _unused, url)\n }\n\n /**\n * Handle popstate event, this is used to handle back/forward in the browser.\n * By default dispatches ACTION_RESTORE, however if the history entry was not pushed/replaced by app-router it will reload the page.\n * That case can happen when the old router injected the history entry.\n */\n const onPopState = (event: PopStateEvent) => {\n if (!event.state) {\n // TODO-APP: this case only happens when pushState/replaceState was called outside of Next.js. It should probably reload the page in this case.\n return\n }\n\n // This case happens when the history entry was pushed by the `pages` router.\n if (!event.state.__NA) {\n window.location.reload()\n return\n }\n\n // TODO-APP: Ideally the back button should not use startTransition as it should apply the updates synchronously\n // Without startTransition works if the cache is there for this path\n startTransition(() => {\n dispatchTraverseAction(\n window.location.href,\n event.state.__PRIVATE_NEXTJS_INTERNALS_TREE\n )\n })\n }\n\n // Register popstate event to call onPopstate.\n window.addEventListener('popstate', onPopState)\n return () => {\n window.history.pushState = originalPushState\n window.history.replaceState = originalReplaceState\n window.removeEventListener('popstate', onPopState)\n }\n }, [])\n\n const { cache, tree, nextUrl, focusAndScrollRef, previousNextUrl } = state\n\n const matchingHead = useMemo(() => {\n return findHeadInCache(cache, tree[1])\n }, [cache, tree])\n\n // Add memoized pathParams for useParams.\n const pathParams = useMemo(() => {\n return getSelectedParams(tree)\n }, [tree])\n\n // Create instrumented promises for navigation hooks (dev-only)\n // These are specially instrumented promises to show in the Suspense DevTools\n // Promises are cached outside of render to survive suspense retries.\n let instrumentedNavigationPromises: NavigationPromises | null = null\n if (process.env.NODE_ENV !== 'production') {\n const { createRootNavigationPromises } =\n require('./navigation-devtools') as typeof import('./navigation-devtools')\n\n instrumentedNavigationPromises = createRootNavigationPromises(\n tree,\n pathname,\n searchParams,\n pathParams\n )\n }\n\n const layoutRouterContext = useMemo(() => {\n return {\n parentTree: tree,\n parentCacheNode: cache,\n parentSegmentPath: null,\n parentParams: {},\n // This is the <Activity> \"name\" that shows up in the Suspense DevTools.\n // It represents the root of the app.\n debugNameContext: '/',\n // Root node always has `url`\n // Provided in AppTreeContext to ensure it can be overwritten in layout-router\n url: canonicalUrl,\n // Root segment is always active\n isActive: true,\n }\n }, [tree, cache, canonicalUrl])\n\n const globalLayoutRouterContext = useMemo(() => {\n return {\n tree,\n focusAndScrollRef,\n nextUrl,\n previousNextUrl,\n }\n }, [tree, focusAndScrollRef, nextUrl, previousNextUrl])\n\n let head\n if (matchingHead !== null) {\n // The head is wrapped in an extra component so we can use\n // `useDeferredValue` to swap between the prefetched and final versions of\n // the head. (This is what LayoutRouter does for segment data, too.)\n //\n // The `key` is used to remount the component whenever the head moves to\n // a different segment.\n const [headCacheNode, headKey, headKeyWithoutSearchParams] = matchingHead\n\n head = (\n <Head\n key={\n // Necessary for PPR: omit search params from the key to match prerendered keys\n typeof window === 'undefined' ? headKeyWithoutSearchParams : headKey\n }\n headCacheNode={headCacheNode}\n />\n )\n } else {\n head = null\n }\n\n let content = (\n <RedirectBoundary>\n {head}\n {/* RootLayoutBoundary enables detection of Suspense boundaries around the root layout.\n When users wrap their layout in <Suspense>, this creates the component stack pattern\n \"Suspense -> RootLayoutBoundary\" which dynamic-rendering.ts uses to allow dynamic rendering. */}\n <RootLayoutBoundary>{cache.rsc}</RootLayoutBoundary>\n <AppRouterAnnouncer tree={tree} />\n </RedirectBoundary>\n )\n\n if (process.env.NODE_ENV !== 'production') {\n // In development, we apply few error boundaries and hot-reloader:\n // - DevRootHTTPAccessFallbackBoundary: avoid using navigation API like notFound() in root layout\n // - HotReloader:\n // - hot-reload the app when the code changes\n // - render dev overlay\n // - catch runtime errors and display global-error when necessary\n if (typeof window !== 'undefined') {\n const { DevRootHTTPAccessFallbackBoundary } =\n require('./dev-root-http-access-fallback-boundary') as typeof import('./dev-root-http-access-fallback-boundary')\n content = (\n <DevRootHTTPAccessFallbackBoundary>\n {content}\n </DevRootHTTPAccessFallbackBoundary>\n )\n }\n const HotReloader: typeof import('../dev/hot-reloader/app/hot-reloader-app').default =\n (\n require('../dev/hot-reloader/app/hot-reloader-app') as typeof import('../dev/hot-reloader/app/hot-reloader-app')\n ).default\n\n content = (\n <HotReloader\n globalError={globalError}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n >\n {content}\n </HotReloader>\n )\n } else {\n content = (\n <RootErrorBoundary\n errorComponent={globalError[0]}\n errorStyles={globalError[1]}\n >\n {content}\n </RootErrorBoundary>\n )\n }\n\n return (\n <>\n <HistoryUpdater appRouterState={state} />\n <RuntimeStyles />\n <NavigationPromisesContext.Provider\n value={instrumentedNavigationPromises}\n >\n <PathParamsContext.Provider value={pathParams}>\n <PathnameContext.Provider value={pathname}>\n <SearchParamsContext.Provider value={searchParams}>\n <GlobalLayoutRouterContext.Provider\n value={globalLayoutRouterContext}\n >\n {/* TODO: We should be able to remove this context. useRouter\n should import from app-router-instance instead. It's only\n necessary because useRouter is shared between Pages and\n App Router. We should fork that module, then remove this\n context provider. */}\n <AppRouterContext.Provider value={publicAppRouterInstance}>\n <LayoutRouterContext.Provider value={layoutRouterContext}>\n {content}\n </LayoutRouterContext.Provider>\n </AppRouterContext.Provider>\n </GlobalLayoutRouterContext.Provider>\n </SearchParamsContext.Provider>\n </PathnameContext.Provider>\n </PathParamsContext.Provider>\n </NavigationPromisesContext.Provider>\n </>\n )\n}\n\nexport default function AppRouter({\n actionQueue,\n globalErrorState,\n webSocket,\n staticIndicatorState,\n}: {\n actionQueue: AppRouterActionQueue\n globalErrorState: GlobalErrorState\n webSocket?: WebSocket\n staticIndicatorState?: StaticIndicatorState\n}) {\n useNavFailureHandler()\n\n const router = (\n <Router\n actionQueue={actionQueue}\n globalError={globalErrorState}\n webSocket={webSocket}\n staticIndicatorState={staticIndicatorState}\n />\n )\n\n // At the very top level, use the default GlobalError component as the final fallback.\n // When the app router itself fails, which means the framework itself fails, we show the default error.\n return (\n <RootErrorBoundary errorComponent={DefaultGlobalError}>\n {router}\n </RootErrorBoundary>\n )\n}\n\nconst runtimeStyles = new Set<string>()\nlet runtimeStyleChanged = new Set<() => void>()\n\nglobalThis._N_E_STYLE_LOAD = function (href: string) {\n let len = runtimeStyles.size\n runtimeStyles.add(href)\n if (runtimeStyles.size !== len) {\n runtimeStyleChanged.forEach((cb) => cb())\n }\n // TODO figure out how to get a promise here\n // But maybe it's not necessary as react would block rendering until it's loaded\n return Promise.resolve()\n}\n\nfunction RuntimeStyles() {\n const [, forceUpdate] = React.useState(0)\n const renderedStylesSize = runtimeStyles.size\n useEffect(() => {\n const changed = () => forceUpdate((c) => c + 1)\n runtimeStyleChanged.add(changed)\n if (renderedStylesSize !== runtimeStyles.size) {\n changed()\n }\n return () => {\n runtimeStyleChanged.delete(changed)\n }\n }, [renderedStylesSize, forceUpdate])\n\n const dplId = process.env.NEXT_DEPLOYMENT_ID\n ? `?dpl=${process.env.NEXT_DEPLOYMENT_ID}`\n : ''\n return [...runtimeStyles].map((href, i) => (\n <link\n key={i}\n rel=\"stylesheet\"\n href={`${href}${dplId}`}\n // @ts-ignore\n precedence=\"next\"\n // TODO figure out crossOrigin and nonce\n // crossOrigin={TODO}\n // nonce={TODO}\n />\n ))\n}\n","import type {\n FlightRouterState,\n CacheNode,\n} from '../../../../shared/lib/app-router-types'\nimport { DEFAULT_SEGMENT_KEY } from '../../../../shared/lib/segment'\nimport { createRouterCacheKey } from '../create-router-cache-key'\n\nexport function findHeadInCache(\n cache: CacheNode,\n parallelRoutes: FlightRouterState[1]\n): [CacheNode, string, string] | null {\n return findHeadInCacheImpl(cache, parallelRoutes, '', '')\n}\n\nfunction findHeadInCacheImpl(\n cache: CacheNode,\n parallelRoutes: FlightRouterState[1],\n keyPrefix: string,\n keyPrefixWithoutSearchParams: string\n): [CacheNode, string, string] | null {\n const isLastItem = Object.keys(parallelRoutes).length === 0\n if (isLastItem) {\n // Returns the entire Cache Node of the segment whose head we will render.\n return [cache, keyPrefix, keyPrefixWithoutSearchParams]\n }\n\n // First try the 'children' parallel route if it exists\n // when starting from the \"root\", this corresponds with the main page component\n const parallelRoutesKeys = Object.keys(parallelRoutes).filter(\n (key) => key !== 'children'\n )\n\n // if we are at the root, we need to check the children slot first\n if ('children' in parallelRoutes) {\n parallelRoutesKeys.unshift('children')\n }\n\n for (const key of parallelRoutesKeys) {\n const [segment, childParallelRoutes] = parallelRoutes[key]\n // If the parallel is not matched and using the default segment,\n // skip searching the head from it.\n if (segment === DEFAULT_SEGMENT_KEY) {\n continue\n }\n const childSegmentMap = cache.parallelRoutes.get(key)\n if (!childSegmentMap) {\n continue\n }\n\n const cacheKey = createRouterCacheKey(segment)\n const cacheKeyWithoutSearchParams = createRouterCacheKey(segment, true)\n\n const cacheNode = childSegmentMap.get(cacheKey)\n if (!cacheNode) {\n continue\n }\n\n const item = findHeadInCacheImpl(\n cacheNode,\n childParallelRoutes,\n keyPrefix + '/' + cacheKey,\n keyPrefix + '/' + cacheKeyWithoutSearchParams\n )\n\n if (item) {\n return item\n }\n }\n\n return null\n}\n","import type {\n FlightRouterState,\n Segment,\n} from '../../../shared/lib/app-router-types'\nimport { INTERCEPTION_ROUTE_MARKERS } from '../../../shared/lib/router/utils/interception-routes'\nimport type { Params } from '../../../server/request/params'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../shared/lib/segment'\nimport { matchSegment } from '../match-segments'\n\nconst removeLeadingSlash = (segment: string): string => {\n return segment[0] === '/' ? segment.slice(1) : segment\n}\n\nconst segmentToPathname = (segment: Segment): string => {\n if (typeof segment === 'string') {\n // 'children' is not a valid path -- it's technically a parallel route that corresponds with the current segment's page\n // if we don't skip it, then the computed pathname might be something like `/children` which doesn't make sense.\n if (segment === 'children') return ''\n\n return segment\n }\n\n return segment[1]\n}\n\nfunction normalizeSegments(segments: string[]): string {\n return (\n segments.reduce((acc, segment) => {\n segment = removeLeadingSlash(segment)\n if (segment === '' || isGroupSegment(segment)) {\n return acc\n }\n\n return `${acc}/${segment}`\n }, '') || '/'\n )\n}\n\nexport function extractPathFromFlightRouterState(\n flightRouterState: FlightRouterState\n): string | undefined {\n const segment = Array.isArray(flightRouterState[0])\n ? flightRouterState[0][1]\n : flightRouterState[0]\n\n if (\n segment === DEFAULT_SEGMENT_KEY ||\n INTERCEPTION_ROUTE_MARKERS.some((m) => segment.startsWith(m))\n )\n return undefined\n\n if (segment.startsWith(PAGE_SEGMENT_KEY)) return ''\n\n const segments = [segmentToPathname(segment)]\n const parallelRoutes = flightRouterState[1] ?? {}\n\n const childrenPath = parallelRoutes.children\n ? extractPathFromFlightRouterState(parallelRoutes.children)\n : undefined\n\n if (childrenPath !== undefined) {\n segments.push(childrenPath)\n } else {\n for (const [key, value] of Object.entries(parallelRoutes)) {\n if (key === 'children') continue\n\n const childPath = extractPathFromFlightRouterState(value)\n\n if (childPath !== undefined) {\n segments.push(childPath)\n }\n }\n }\n\n return normalizeSegments(segments)\n}\n\nfunction computeChangedPathImpl(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const [segmentA, parallelRoutesA] = treeA\n const [segmentB, parallelRoutesB] = treeB\n\n const normalizedSegmentA = segmentToPathname(segmentA)\n const normalizedSegmentB = segmentToPathname(segmentB)\n\n if (\n INTERCEPTION_ROUTE_MARKERS.some(\n (m) =>\n normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m)\n )\n ) {\n return ''\n }\n\n if (!matchSegment(segmentA, segmentB)) {\n // once we find where the tree changed, we compute the rest of the path by traversing the tree\n return extractPathFromFlightRouterState(treeB) ?? ''\n }\n\n for (const parallelRouterKey in parallelRoutesA) {\n if (parallelRoutesB[parallelRouterKey]) {\n const changedPath = computeChangedPathImpl(\n parallelRoutesA[parallelRouterKey],\n parallelRoutesB[parallelRouterKey]\n )\n if (changedPath !== null) {\n return `${segmentToPathname(segmentB)}/${changedPath}`\n }\n }\n }\n\n return null\n}\n\nexport function computeChangedPath(\n treeA: FlightRouterState,\n treeB: FlightRouterState\n): string | null {\n const changedPath = computeChangedPathImpl(treeA, treeB)\n\n if (changedPath == null || changedPath === '/') {\n return changedPath\n }\n\n // lightweight normalization to remove route groups\n return normalizeSegments(changedPath.split('/'))\n}\n\n/**\n * Recursively extracts dynamic parameters from FlightRouterState.\n */\nexport function getSelectedParams(\n currentTree: FlightRouterState,\n params: Params = {}\n): Params {\n const parallelRoutes = currentTree[1]\n\n for (const parallelRoute of Object.values(parallelRoutes)) {\n const segment = parallelRoute[0]\n const isDynamicParameter = Array.isArray(segment)\n const segmentValue = isDynamicParameter ? segment[1] : segment\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) continue\n\n // Ensure catchAll and optional catchall are turned into an array\n const isCatchAll =\n isDynamicParameter && (segment[2] === 'c' || segment[2] === 'oc')\n\n if (isCatchAll) {\n params[segment[0]] = segment[1].split('/')\n } else if (isDynamicParameter) {\n params[segment[0]] = segment[1]\n }\n\n params = getSelectedParams(parallelRoute, params)\n }\n\n return params\n}\n","import { useEffect } from 'react'\nimport { createHrefFromUrl } from './router-reducer/create-href-from-url'\n\nexport function handleHardNavError(error: unknown): boolean {\n if (\n error &&\n typeof window !== 'undefined' &&\n window.next.__pendingUrl &&\n createHrefFromUrl(new URL(window.location.href)) !==\n createHrefFromUrl(window.next.__pendingUrl)\n ) {\n console.error(\n `Error occurred during navigation, falling back to hard navigation`,\n error\n )\n window.location.href = window.next.__pendingUrl.toString()\n return true\n }\n return false\n}\n\nexport function useNavFailureHandler() {\n if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) {\n // this if is only for DCE of the feature flag not conditional\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n const uncaughtExceptionHandler = (\n evt: ErrorEvent | PromiseRejectionEvent\n ) => {\n const error = 'reason' in evt ? evt.reason : evt.error\n // if we have an unhandled exception/rejection during\n // a navigation we fall back to a hard navigation to\n // attempt recovering to a good state\n handleHardNavError(error)\n }\n window.addEventListener('unhandledrejection', uncaughtExceptionHandler)\n window.addEventListener('error', uncaughtExceptionHandler)\n return () => {\n window.removeEventListener('error', uncaughtExceptionHandler)\n window.removeEventListener(\n 'unhandledrejection',\n uncaughtExceptionHandler\n )\n }\n }, [])\n }\n}\n","import type {\n CacheNode,\n FlightDataPath,\n} from '../../../shared/lib/app-router-types'\n\nimport { createHrefFromUrl } from './create-href-from-url'\nimport { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head'\nimport { extractPathFromFlightRouterState } from './compute-changed-path'\n\nimport type { AppRouterState } from './router-reducer-types'\nimport { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-parallel-segments'\nimport { getFlightDataPartsFromPath } from '../../flight-data-helpers'\n\nexport interface InitialRouterStateParameters {\n navigatedAt: number\n initialCanonicalUrlParts: string[]\n initialRenderedSearch: string\n initialParallelRoutes: CacheNode['parallelRoutes']\n initialFlightData: FlightDataPath[]\n location: Location | null\n}\n\nexport function createInitialRouterState({\n navigatedAt,\n initialFlightData,\n initialCanonicalUrlParts,\n initialRenderedSearch,\n initialParallelRoutes,\n location,\n}: InitialRouterStateParameters): AppRouterState {\n // When initialized on the server, the canonical URL is provided as an array of parts.\n // This is to ensure that when the RSC payload streamed to the client, crawlers don't interpret it\n // as a URL that should be crawled.\n const initialCanonicalUrl = initialCanonicalUrlParts.join('/')\n\n const normalizedFlightData = getFlightDataPartsFromPath(initialFlightData[0])\n const {\n tree: initialTree,\n seedData: initialSeedData,\n head: initialHead,\n } = normalizedFlightData\n // For the SSR render, seed data should always be available (we only send back a `null` response\n // in the case of a `loading` segment, pre-PPR.)\n const rsc = initialSeedData?.[0]\n const loading = initialSeedData?.[2] ?? null\n\n const cache: CacheNode = {\n lazyData: null,\n rsc,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n // The cache gets seeded during the first render. `initialParallelRoutes` ensures the cache from the first render is there during the second render.\n parallelRoutes: initialParallelRoutes,\n loading,\n navigatedAt,\n }\n\n const canonicalUrl =\n // location.href is read as the initial value for canonicalUrl in the browser\n // This is safe to do as canonicalUrl can't be rendered, it's only used to control the history updates in the useEffect further down in this file.\n location\n ? // window.location does not have the same type as URL but has all the fields createHrefFromUrl needs.\n createHrefFromUrl(location)\n : initialCanonicalUrl\n\n addRefreshMarkerToActiveParallelSegments(initialTree, canonicalUrl)\n\n // When the cache hasn't been seeded yet we fill the cache with the head.\n if (initialParallelRoutes === null || initialParallelRoutes.size === 0) {\n fillLazyItemsTillLeafWithHead(\n navigatedAt,\n cache,\n undefined,\n initialTree,\n initialSeedData,\n initialHead\n )\n }\n\n const initialState = {\n tree: initialTree,\n cache,\n pushRef: {\n pendingPush: false,\n mpaNavigation: false,\n // First render needs to preserve the previous window.history.state\n // to avoid it being overwritten on navigation back/forward with MPA Navigation.\n preserveCustomHistoryState: true,\n },\n focusAndScrollRef: {\n apply: false,\n onlyHashChange: false,\n hashFragment: null,\n segmentPaths: [],\n },\n canonicalUrl,\n renderedSearch: initialRenderedSearch,\n nextUrl:\n // the || operator is intentional, the pathname can be an empty string\n (extractPathFromFlightRouterState(initialTree) || location?.pathname) ??\n null,\n previousNextUrl: null,\n debugInfo: null,\n }\n\n return initialState\n}\n","import type {\n FlightRouterState,\n CacheNode,\n} from '../../../shared/lib/app-router-types'\nimport type { AppRouterState } from './router-reducer-types'\nimport { applyFlightData } from './apply-flight-data'\nimport { fetchServerResponse } from './fetch-server-response'\nimport { PAGE_SEGMENT_KEY } from '../../../shared/lib/segment'\n\ninterface RefreshInactiveParallelSegments {\n navigatedAt: number\n state: AppRouterState\n updatedTree: FlightRouterState\n updatedCache: CacheNode\n includeNextUrl: boolean\n canonicalUrl: string\n}\n\n/**\n * Refreshes inactive segments that are still in the current FlightRouterState.\n * A segment is considered \"inactive\" when the server response indicates it didn't match to a page component.\n * This happens during a soft-navigation, where the server will want to patch in the segment\n * with the \"default\" component, but we explicitly ignore the server in this case\n * and keep the existing state for that segment. New data for inactive segments are inherently\n * not part of the server response when we patch the tree, because they were associated with a response\n * from an earlier navigation/request. For each segment, once it becomes \"active\", we encode the URL that provided\n * the data for it. This function traverses parallel routes looking for these markers so that it can re-fetch\n * and patch the new data into the tree.\n */\nexport async function refreshInactiveParallelSegments(\n options: RefreshInactiveParallelSegments\n) {\n const fetchedSegments = new Set<string>()\n await refreshInactiveParallelSegmentsImpl({\n ...options,\n rootTree: options.updatedTree,\n fetchedSegments,\n })\n}\n\nasync function refreshInactiveParallelSegmentsImpl({\n navigatedAt,\n state,\n updatedTree,\n updatedCache,\n includeNextUrl,\n fetchedSegments,\n rootTree = updatedTree,\n canonicalUrl,\n}: RefreshInactiveParallelSegments & {\n fetchedSegments: Set<string>\n rootTree: FlightRouterState\n}) {\n const [, parallelRoutes, refetchPath, refetchMarker] = updatedTree\n const fetchPromises = []\n\n if (\n refetchPath &&\n refetchPath !== canonicalUrl &&\n refetchMarker === 'refresh' &&\n // it's possible for the tree to contain multiple segments that contain data at the same URL\n // we keep track of them so we can dedupe the requests\n !fetchedSegments.has(refetchPath)\n ) {\n fetchedSegments.add(refetchPath) // Mark this URL as fetched\n\n // Eagerly kick off the fetch for the refetch path & the parallel routes. This should be fine to do as they each operate\n // independently on their own cache nodes, and `applyFlightData` will copy anything it doesn't care about from the existing cache.\n const fetchPromise = fetchServerResponse(\n new URL(refetchPath, location.origin),\n {\n // refetch from the root of the updated tree, otherwise it will be scoped to the current segment\n // and might not contain the data we need to patch in interception route data (such as dynamic params from a previous segment)\n flightRouterState: [rootTree[0], rootTree[1], rootTree[2], 'refetch'],\n nextUrl: includeNextUrl ? state.nextUrl : null,\n }\n ).then((result) => {\n if (typeof result !== 'string') {\n const { flightData } = result\n for (const flightDataPath of flightData) {\n // we only pass the new cache as this function is called after clearing the router cache\n // and filling in the new page data from the server. Meaning the existing cache is actually the cache that's\n // just been created & has been written to, but hasn't been \"committed\" yet.\n applyFlightData(\n navigatedAt,\n updatedCache,\n updatedCache,\n flightDataPath\n )\n }\n } else {\n // When result is a string, it suggests that the server response should have triggered an MPA navigation\n // I'm not 100% sure of this decision, but it seems unlikely that we'd want to introduce a redirect side effect\n // when refreshing on-screen data, so handling this has been ommitted.\n }\n })\n\n fetchPromises.push(fetchPromise)\n }\n\n for (const key in parallelRoutes) {\n const parallelFetchPromise = refreshInactiveParallelSegmentsImpl({\n navigatedAt,\n state,\n updatedTree: parallelRoutes[key],\n updatedCache,\n includeNextUrl,\n fetchedSegments,\n rootTree,\n canonicalUrl,\n })\n\n fetchPromises.push(parallelFetchPromise)\n }\n\n await Promise.all(fetchPromises)\n}\n\n/**\n * Walks the current parallel segments to determine if they are \"active\".\n * An active parallel route will have a `__PAGE__` segment in the FlightRouterState.\n * As opposed to a `__DEFAULT__` segment, which means there was no match for that parallel route.\n * We add a special marker here so that we know how to refresh its data when the router is revalidated.\n */\nexport function addRefreshMarkerToActiveParallelSegments(\n tree: FlightRouterState,\n path: string\n) {\n const [segment, parallelRoutes, , refetchMarker] = tree\n // a page segment might also contain concatenated search params, so we do a partial match on the key\n if (segment.includes(PAGE_SEGMENT_KEY) && refetchMarker !== 'refresh') {\n tree[2] = path\n tree[3] = 'refresh'\n }\n\n for (const key in parallelRoutes) {\n addRefreshMarkerToActiveParallelSegments(parallelRoutes[key], path)\n }\n}\n","import type { CacheNode } from '../../../shared/lib/app-router-types'\nimport type {\n FlightRouterState,\n CacheNodeSeedData,\n} from '../../../shared/lib/app-router-types'\nimport { createRouterCacheKey } from './create-router-cache-key'\n\nexport function fillLazyItemsTillLeafWithHead(\n navigatedAt: number,\n newCache: CacheNode,\n existingCache: CacheNode | undefined,\n routerState: FlightRouterState,\n cacheNodeSeedData: CacheNodeSeedData | null,\n head: React.ReactNode\n): void {\n const isLastSegment = Object.keys(routerState[1]).length === 0\n if (isLastSegment) {\n newCache.head = head\n return\n }\n // Remove segment that we got data for so that it is filled in during rendering of rsc.\n for (const key in routerState[1]) {\n const parallelRouteState = routerState[1][key]\n const segmentForParallelRoute = parallelRouteState[0]\n const cacheKey = createRouterCacheKey(segmentForParallelRoute)\n\n // TODO: We should traverse the cacheNodeSeedData tree instead of the router\n // state tree. Ideally, they would always be the same shape, but because of\n // the loading.js pattern, cacheNodeSeedData sometimes only represents a\n // partial tree. That's why this node is sometimes null. Once PPR lands,\n // loading.js will no longer have special behavior and we can traverse the\n // data tree instead.\n //\n // We should also consider merging the router state tree and the data tree\n // in the response format, so that we don't have to send the keys twice.\n // Then the client can convert them into separate representations.\n const parallelSeedData =\n cacheNodeSeedData !== null && cacheNodeSeedData[1][key] !== undefined\n ? cacheNodeSeedData[1][key]\n : null\n if (existingCache) {\n const existingParallelRoutesCacheNode =\n existingCache.parallelRoutes.get(key)\n if (existingParallelRoutesCacheNode) {\n let parallelRouteCacheNode = new Map(existingParallelRoutesCacheNode)\n const existingCacheNode = parallelRouteCacheNode.get(cacheKey)\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[0]\n const loading = parallelSeedData[2]\n newCacheNode = {\n lazyData: null,\n rsc: seedNode,\n // This is a PPR-only field. When PPR is enabled, we shouldn't hit\n // this path during a navigation, but until PPR is fully implemented\n // yet it's possible the existing node does have a non-null\n // `prefetchRsc`. As an incremental step, we'll just de-opt to the\n // old behavior — no PPR value.\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n loading,\n parallelRoutes: new Map(existingCacheNode?.parallelRoutes),\n navigatedAt,\n }\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(existingCacheNode?.parallelRoutes),\n loading: null,\n navigatedAt,\n }\n }\n\n // Overrides the cache key with the new cache node.\n parallelRouteCacheNode.set(cacheKey, newCacheNode)\n // Traverse deeper to apply the head / fill lazy items till the head.\n fillLazyItemsTillLeafWithHead(\n navigatedAt,\n newCacheNode,\n existingCacheNode,\n parallelRouteState,\n parallelSeedData ? parallelSeedData : null,\n head\n )\n\n newCache.parallelRoutes.set(key, parallelRouteCacheNode)\n continue\n }\n }\n\n let newCacheNode: CacheNode\n if (parallelSeedData !== null) {\n // New data was sent from the server.\n const seedNode = parallelSeedData[0]\n const loading = parallelSeedData[2]\n newCacheNode = {\n lazyData: null,\n rsc: seedNode,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading,\n navigatedAt,\n }\n } else {\n // No data available for this node. This will trigger a lazy fetch\n // during render.\n newCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n navigatedAt,\n }\n }\n\n const existingParallelRoutes = newCache.parallelRoutes.get(key)\n if (existingParallelRoutes) {\n existingParallelRoutes.set(cacheKey, newCacheNode)\n } else {\n newCache.parallelRoutes.set(key, new Map([[cacheKey, newCacheNode]]))\n }\n\n fillLazyItemsTillLeafWithHead(\n navigatedAt,\n newCacheNode,\n undefined,\n parallelRouteState,\n parallelSeedData,\n head\n )\n }\n}\n","import { InvariantError } from '../../shared/lib/invariant-error'\n\n/**\n * This is a utility function to make scheduling sequential tasks that run back to back easier.\n * We schedule on the same queue (setTimeout) at the same time to ensure no other events can sneak in between.\n */\nexport function prerenderAndAbortInSequentialTasks<R>(\n prerender: () => Promise<R>,\n abort: () => void\n): Promise<R> {\n if (process.env.NEXT_RUNTIME === 'edge') {\n throw new InvariantError(\n '`prerenderAndAbortInSequentialTasks` should not be called in edge runtime.'\n )\n } else {\n return new Promise((resolve, reject) => {\n let pendingResult: Promise<R>\n setTimeout(() => {\n try {\n pendingResult = prerender()\n pendingResult.catch(() => {})\n } catch (err) {\n reject(err)\n }\n }, 0)\n setTimeout(() => {\n abort()\n resolve(pendingResult)\n }, 0)\n })\n }\n}\n\n/**\n * Like `prerenderAndAbortInSequentialTasks`, but with another task between `prerender` and `abort`,\n * which allows us to move a part of the render into a separate task.\n */\nexport function prerenderAndAbortInSequentialTasksWithStages<R>(\n prerender: () => Promise<R>,\n advanceStage: () => void,\n abort: () => void\n): Promise<R> {\n if (process.env.NEXT_RUNTIME === 'edge') {\n throw new InvariantError(\n '`prerenderAndAbortInSequentialTasksWithStages` should not be called in edge runtime.'\n )\n } else {\n return new Promise((resolve, reject) => {\n let pendingResult: Promise<R>\n setTimeout(() => {\n try {\n pendingResult = prerender()\n pendingResult.catch(() => {})\n } catch (err) {\n reject(err)\n }\n }, 0)\n setTimeout(() => {\n advanceStage()\n }, 0)\n setTimeout(() => {\n abort()\n resolve(pendingResult)\n }, 0)\n })\n }\n}\n\n// React's RSC prerender function will emit an incomplete flight stream when using `prerender`. If the connection\n// closes then whatever hanging chunks exist will be errored. This is because prerender (an experimental feature)\n// has not yet implemented a concept of resume. For now we will simulate a paused connection by wrapping the stream\n// in one that doesn't close even when the underlying is complete.\nexport class ReactServerResult {\n private _stream: null | ReadableStream<Uint8Array>\n\n constructor(stream: ReadableStream<Uint8Array>) {\n this._stream = stream\n }\n\n tee() {\n if (this._stream === null) {\n throw new Error(\n 'Cannot tee a ReactServerResult that has already been consumed'\n )\n }\n const tee = this._stream.tee()\n this._stream = tee[0]\n return tee[1]\n }\n\n consume() {\n if (this._stream === null) {\n throw new Error(\n 'Cannot consume a ReactServerResult that has already been consumed'\n )\n }\n const stream = this._stream\n this._stream = null\n return stream\n }\n}\n\nexport type ReactServerPrerenderResolveToType = {\n prelude: ReadableStream<Uint8Array>\n}\n\nexport async function createReactServerPrerenderResult(\n underlying: Promise<ReactServerPrerenderResolveToType>\n): Promise<ReactServerPrerenderResult> {\n const chunks: Array<Uint8Array> = []\n const { prelude } = await underlying\n const reader = prelude.getReader()\n while (true) {\n const { done, value } = await reader.read()\n if (done) {\n return new ReactServerPrerenderResult(chunks)\n } else {\n chunks.push(value)\n }\n }\n}\n\nexport async function createReactServerPrerenderResultFromRender(\n underlying: ReadableStream<Uint8Array>\n): Promise<ReactServerPrerenderResult> {\n const chunks: Array<Uint8Array> = []\n const reader = underlying.getReader()\n while (true) {\n const { done, value } = await reader.read()\n if (done) {\n break\n } else {\n chunks.push(value)\n }\n }\n return new ReactServerPrerenderResult(chunks)\n}\nexport class ReactServerPrerenderResult {\n private _chunks: null | Array<Uint8Array>\n\n private assertChunks(expression: string): Array<Uint8Array> {\n if (this._chunks === null) {\n throw new InvariantError(\n `Cannot \\`${expression}\\` on a ReactServerPrerenderResult that has already been consumed.`\n )\n }\n return this._chunks\n }\n\n private consumeChunks(expression: string): Array<Uint8Array> {\n const chunks = this.assertChunks(expression)\n this.consume()\n return chunks\n }\n\n consume(): void {\n this._chunks = null\n }\n\n constructor(chunks: Array<Uint8Array>) {\n this._chunks = chunks\n }\n\n asUnclosingStream(): ReadableStream<Uint8Array> {\n const chunks = this.assertChunks('asUnclosingStream()')\n return createUnclosingStream(chunks)\n }\n\n consumeAsUnclosingStream(): ReadableStream<Uint8Array> {\n const chunks = this.consumeChunks('consumeAsUnclosingStream()')\n return createUnclosingStream(chunks)\n }\n\n asStream(): ReadableStream<Uint8Array> {\n const chunks = this.assertChunks('asStream()')\n return createClosingStream(chunks)\n }\n\n consumeAsStream(): ReadableStream<Uint8Array> {\n const chunks = this.consumeChunks('consumeAsStream()')\n return createClosingStream(chunks)\n }\n}\n\nfunction createUnclosingStream(\n chunks: Array<Uint8Array>\n): ReadableStream<Uint8Array> {\n let i = 0\n return new ReadableStream({\n async pull(controller) {\n if (i < chunks.length) {\n controller.enqueue(chunks[i++])\n }\n // we intentionally keep the stream open. The consumer will clear\n // out chunks once finished and the remaining memory will be GC'd\n // when this object goes out of scope\n },\n })\n}\n\nfunction createClosingStream(\n chunks: Array<Uint8Array>\n): ReadableStream<Uint8Array> {\n let i = 0\n return new ReadableStream({\n async pull(controller) {\n if (i < chunks.length) {\n controller.enqueue(chunks[i++])\n } else {\n controller.close()\n }\n },\n })\n}\n\nexport async function processPrelude(\n unprocessedPrelude: ReadableStream<Uint8Array>\n) {\n const [prelude, peek] = unprocessedPrelude.tee()\n\n const reader = peek.getReader()\n const firstResult = await reader.read()\n reader.cancel()\n\n const preludeIsEmpty = firstResult.done === true\n\n return { prelude, preludeIsEmpty }\n}\n","import { getDigestForWellKnownError } from './create-error-handler'\nimport { isReactLargeShellError } from './react-large-shell-error'\n\nexport function printDebugThrownValueForProspectiveRender(\n thrownValue: unknown,\n route: string\n) {\n // We don't need to print well-known Next.js errors.\n if (getDigestForWellKnownError(thrownValue)) {\n return\n }\n\n if (isReactLargeShellError(thrownValue)) {\n // TODO: Aggregate\n console.error(thrownValue)\n return undefined\n }\n\n let message: undefined | string\n if (\n typeof thrownValue === 'object' &&\n thrownValue !== null &&\n typeof (thrownValue as any).message === 'string'\n ) {\n message = (thrownValue as any).message\n if (typeof (thrownValue as any).stack === 'string') {\n const originalErrorStack: string = (thrownValue as any).stack\n const stackStart = originalErrorStack.indexOf('\\n')\n if (stackStart > -1) {\n const error = new Error(\n `Route ${route} errored during the prospective render. These errors are normally ignored and may not prevent the route from prerendering but are logged here because build debugging is enabled.\n \nOriginal Error: ${message}`\n )\n error.stack =\n 'Error: ' + error.message + originalErrorStack.slice(stackStart)\n console.error(error)\n return\n }\n }\n } else if (typeof thrownValue === 'string') {\n message = thrownValue\n }\n\n if (message) {\n console.error(`Route ${route} errored during the prospective render. These errors are normally ignored and may not prevent the route from prerendering but are logged here because build debugging is enabled. No stack was provided.\n \nOriginal Message: ${message}`)\n return\n }\n\n console.error(\n `Route ${route} errored during the prospective render. These errors are normally ignored and may not prevent the route from prerendering but are logged here because build debugging is enabled. The thrown value is logged just following this message`\n )\n console.error(thrownValue)\n return\n}\n","/**\n * This class is used to detect when all cache reads for a given render are settled.\n * We do this to allow for cache warming the prerender without having to continue rendering\n * the remainder of the page. This feature is really only useful when the cacheComponents flag is on\n * and should only be used in codepaths gated with this feature.\n */\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nexport class CacheSignal {\n private count = 0\n private earlyListeners: Array<() => void> = []\n private listeners: Array<() => void> = []\n private tickPending = false\n private pendingTimeoutCleanup: (() => void) | null = null\n\n private subscribedSignals: Set<CacheSignal> | null = null\n\n constructor() {\n if (process.env.NEXT_RUNTIME === 'edge') {\n // we rely on `process.nextTick`, which is not supported in edge\n throw new InvariantError(\n 'CacheSignal cannot be used in the edge runtime, because `cacheComponents` does not support it.'\n )\n }\n }\n\n private noMorePendingCaches() {\n if (!this.tickPending) {\n this.tickPending = true\n queueMicrotask(() =>\n process.nextTick(() => {\n this.tickPending = false\n if (this.count === 0) {\n for (let i = 0; i < this.earlyListeners.length; i++) {\n this.earlyListeners[i]()\n }\n this.earlyListeners.length = 0\n }\n })\n )\n }\n\n // After a cache resolves, React will schedule new rendering work:\n // - in a microtask (when prerendering)\n // - in setImmediate (when rendering)\n // To cover both of these, we have to make sure that we let immediates execute at least once after each cache resolved.\n // We don't know when the pending timeout was scheduled (and if it's about to resolve),\n // so by scheduling a new one, we can be sure that we'll go around the event loop at least once.\n if (this.pendingTimeoutCleanup) {\n // We cancel the timeout in beginRead, so this shouldn't ever be active here,\n // but we still cancel it defensively.\n this.pendingTimeoutCleanup()\n }\n this.pendingTimeoutCleanup = scheduleImmediateAndTimeoutWithCleanup(\n this.invokeListenersIfNoPendingReads\n )\n }\n\n private invokeListenersIfNoPendingReads = () => {\n this.pendingTimeoutCleanup = null\n if (this.count === 0) {\n for (let i = 0; i < this.listeners.length; i++) {\n this.listeners[i]()\n }\n this.listeners.length = 0\n }\n }\n\n /**\n * This promise waits until there are no more in progress cache reads but no later.\n * This allows for adding more cache reads after to delay cacheReady.\n */\n inputReady() {\n return new Promise<void>((resolve) => {\n this.earlyListeners.push(resolve)\n if (this.count === 0) {\n this.noMorePendingCaches()\n }\n })\n }\n\n /**\n * If there are inflight cache reads this Promise can resolve in a microtask however\n * if there are no inflight cache reads then we wait at least one task to allow initial\n * cache reads to be initiated.\n */\n cacheReady() {\n return new Promise<void>((resolve) => {\n this.listeners.push(resolve)\n if (this.count === 0) {\n this.noMorePendingCaches()\n }\n })\n }\n\n beginRead() {\n this.count++\n\n // There's a new pending cache, so if there's a `noMorePendingCaches` timeout running,\n // we should cancel it.\n if (this.pendingTimeoutCleanup) {\n this.pendingTimeoutCleanup()\n this.pendingTimeoutCleanup = null\n }\n\n if (this.subscribedSignals !== null) {\n for (const subscriber of this.subscribedSignals) {\n subscriber.beginRead()\n }\n }\n }\n\n endRead() {\n if (this.count === 0) {\n throw new InvariantError(\n 'CacheSignal got more endRead() calls than beginRead() calls'\n )\n }\n\n // If this is the last read we need to wait a task before we can claim the cache is settled.\n // The cache read will likely ping a Server Component which can read from the cache again and this\n // will play out in a microtask so we need to only resolve pending listeners if we're still at 0\n // after at least one task.\n // We only want one task scheduled at a time so when we hit count 1 we don't decrement the counter immediately.\n // If intervening reads happen before the scheduled task runs they will never observe count 1 preventing reentrency\n this.count--\n if (this.count === 0) {\n this.noMorePendingCaches()\n }\n\n if (this.subscribedSignals !== null) {\n for (const subscriber of this.subscribedSignals) {\n subscriber.endRead()\n }\n }\n }\n\n hasPendingReads(): boolean {\n return this.count > 0\n }\n\n trackRead<T>(promise: Promise<T>) {\n this.beginRead()\n // `promise.finally()` still rejects, so don't use it here to avoid unhandled rejections\n const onFinally = this.endRead.bind(this)\n promise.then(onFinally, onFinally)\n return promise\n }\n\n subscribeToReads(subscriber: CacheSignal): () => void {\n if (subscriber === this) {\n throw new InvariantError('A CacheSignal cannot subscribe to itself')\n }\n if (this.subscribedSignals === null) {\n this.subscribedSignals = new Set()\n }\n this.subscribedSignals.add(subscriber)\n\n // we'll notify the subscriber of each endRead() on this signal,\n // so we need to give it a corresponding beginRead() for each read we have in flight now.\n for (let i = 0; i < this.count; i++) {\n subscriber.beginRead()\n }\n\n return this.unsubscribeFromReads.bind(this, subscriber)\n }\n\n unsubscribeFromReads(subscriber: CacheSignal) {\n if (!this.subscribedSignals) {\n return\n }\n this.subscribedSignals.delete(subscriber)\n\n // we don't need to set the set back to `null` if it's empty --\n // if other signals are subscribing to this one, it'll likely get more subscriptions later,\n // so we'd have to allocate a fresh set again when that happens.\n }\n}\n\nfunction scheduleImmediateAndTimeoutWithCleanup(cb: () => void): () => void {\n // If we decide to clean up the timeout, we want to remove\n // either the immediate or the timeout, whichever is still pending.\n let clearPending: () => void\n\n const immediate = setImmediate(() => {\n const timeout = setTimeout(cb, 0)\n clearPending = clearTimeout.bind(null, timeout)\n })\n clearPending = clearImmediate.bind(null, immediate)\n\n return () => clearPending()\n}\n","import type { ClientTraceDataEntry } from './tracer'\n\n/**\n * Takes OpenTelemetry client trace data and the `clientTraceMetadata` option configured in the Next.js config (currently\n * experimental) and returns a filtered/allowed list of client trace data entries.\n */\nexport function getTracedMetadata(\n traceData: ClientTraceDataEntry[],\n clientTraceMetadata: string[] | undefined\n): ClientTraceDataEntry[] | undefined {\n if (!clientTraceMetadata) return undefined\n return traceData.filter(({ key }) => clientTraceMetadata.includes(key))\n}\n","/**\n * For chromium based browsers (Chrome, Edge, etc.) and Safari,\n * icons need to stay under <head> to be picked up by the browser.\n *\n */\nconst REINSERT_ICON_SCRIPT = `\\\ndocument.querySelectorAll('body link[rel=\"icon\"], body link[rel=\"apple-touch-icon\"]').forEach(el => document.head.appendChild(el))`\n\nexport function createServerInsertedMetadata(nonce: string | undefined) {\n let inserted = false\n\n return async function getServerInsertedMetadata(): Promise<string> {\n if (inserted) {\n return ''\n }\n\n inserted = true\n return `<script ${nonce ? `nonce=\"${nonce}\"` : ''}>${REINSERT_ICON_SCRIPT}</script>`\n }\n}\n","// regexp is based on https://github.com/sindresorhus/escape-string-regexp\nconst reHasRegExp = /[|\\\\{}()[\\]^$+*?.-]/\nconst reReplaceRegExp = /[|\\\\{}()[\\]^$+*?.-]/g\n\nexport function escapeStringRegexp(str: string) {\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","import {\n NEXT_INTERCEPTION_MARKER_PREFIX,\n NEXT_QUERY_PARAM_PREFIX,\n} from '../../../../lib/constants'\nimport { INTERCEPTION_ROUTE_MARKERS } from './interception-routes'\nimport { escapeStringRegexp } from '../../escape-regexp'\nimport { removeTrailingSlash } from './remove-trailing-slash'\nimport { PARAMETER_PATTERN, parseMatchedParameter } from './get-dynamic-param'\n\nexport interface Group {\n pos: number\n repeat: boolean\n optional: boolean\n}\n\nexport interface RouteRegex {\n groups: { [groupName: string]: Group }\n re: RegExp\n}\n\nexport type RegexReference = {\n names: Record<string, string>\n intercepted: Record<string, string>\n}\n\ntype GetNamedRouteRegexOptions = {\n /**\n * Whether to prefix the route keys with the NEXT_INTERCEPTION_MARKER_PREFIX\n * or NEXT_QUERY_PARAM_PREFIX. This is only relevant when creating the\n * routes-manifest during the build.\n */\n prefixRouteKeys: boolean\n\n /**\n * Whether to include the suffix in the route regex. This means that when you\n * have something like `/[...slug].json` the `.json` part will be included\n * in the regex, yielding `/(.*).json` as the regex.\n */\n includeSuffix?: boolean\n\n /**\n * Whether to include the prefix in the route regex. This means that when you\n * have something like `/[...slug].json` the `/` part will be included\n * in the regex, yielding `^/(.*).json$` as the regex.\n *\n * Note that interception markers will already be included without the need\n */\n includePrefix?: boolean\n\n /**\n * Whether to exclude the optional trailing slash from the route regex.\n */\n excludeOptionalTrailingSlash?: boolean\n\n /**\n * Whether to backtrack duplicate keys. This is only relevant when creating\n * the routes-manifest during the build.\n */\n backreferenceDuplicateKeys?: boolean\n\n /**\n * If provided, this will be used as the reference for the dynamic parameter\n * keys instead of generating them in context. This is currently only used for\n * interception routes.\n */\n reference?: RegexReference\n}\n\ntype GetRouteRegexOptions = {\n /**\n * Whether to include extra parts in the route regex. This means that when you\n * have something like `/[...slug].json` the `.json` part will be included\n * in the regex, yielding `/(.*).json` as the regex.\n */\n includeSuffix?: boolean\n\n /**\n * Whether to include the prefix in the route regex. This means that when you\n * have something like `/[...slug].json` the `/` part will be included\n * in the regex, yielding `^/(.*).json$` as the regex.\n *\n * Note that interception markers will already be included without the need\n * of adding this option.\n */\n includePrefix?: boolean\n\n /**\n * Whether to exclude the optional trailing slash from the route regex.\n */\n excludeOptionalTrailingSlash?: boolean\n}\n\nfunction getParametrizedRoute(\n route: string,\n includeSuffix: boolean,\n includePrefix: boolean\n) {\n const groups: { [groupName: string]: Group } = {}\n let groupIndex = 1\n\n const segments: string[] = []\n for (const segment of removeTrailingSlash(route).slice(1).split('/')) {\n const markerMatch = INTERCEPTION_ROUTE_MARKERS.find((m) =>\n segment.startsWith(m)\n )\n const paramMatches = segment.match(PARAMETER_PATTERN) // Check for parameters\n\n if (markerMatch && paramMatches && paramMatches[2]) {\n const { key, optional, repeat } = parseMatchedParameter(paramMatches[2])\n groups[key] = { pos: groupIndex++, repeat, optional }\n segments.push(`/${escapeStringRegexp(markerMatch)}([^/]+?)`)\n } else if (paramMatches && paramMatches[2]) {\n const { key, repeat, optional } = parseMatchedParameter(paramMatches[2])\n groups[key] = { pos: groupIndex++, repeat, optional }\n\n if (includePrefix && paramMatches[1]) {\n segments.push(`/${escapeStringRegexp(paramMatches[1])}`)\n }\n\n let s = repeat ? (optional ? '(?:/(.+?))?' : '/(.+?)') : '/([^/]+?)'\n\n // Remove the leading slash if includePrefix already added it.\n if (includePrefix && paramMatches[1]) {\n s = s.substring(1)\n }\n\n segments.push(s)\n } else {\n segments.push(`/${escapeStringRegexp(segment)}`)\n }\n\n // If there's a suffix, add it to the segments if it's enabled.\n if (includeSuffix && paramMatches && paramMatches[3]) {\n segments.push(escapeStringRegexp(paramMatches[3]))\n }\n }\n\n return {\n parameterizedRoute: segments.join(''),\n groups,\n }\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 */\nexport function getRouteRegex(\n normalizedRoute: string,\n {\n includeSuffix = false,\n includePrefix = false,\n excludeOptionalTrailingSlash = false,\n }: GetRouteRegexOptions = {}\n): RouteRegex {\n const { parameterizedRoute, groups } = getParametrizedRoute(\n normalizedRoute,\n includeSuffix,\n includePrefix\n )\n\n let re = parameterizedRoute\n if (!excludeOptionalTrailingSlash) {\n re += '(?:/)?'\n }\n\n return {\n re: new RegExp(`^${re}$`),\n groups: groups,\n }\n}\n\n/**\n * Builds a function to generate a minimal routeKey using only a-z and minimal\n * number of characters.\n */\nfunction buildGetSafeRouteKey() {\n let i = 0\n\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}\n\nfunction getSafeKeyFromSegment({\n interceptionMarker,\n getSafeRouteKey,\n segment,\n routeKeys,\n keyPrefix,\n backreferenceDuplicateKeys,\n}: {\n interceptionMarker?: string\n getSafeRouteKey: () => string\n segment: string\n routeKeys: Record<string, string>\n keyPrefix?: string\n backreferenceDuplicateKeys: boolean\n}) {\n const { key, optional, repeat } = parseMatchedParameter(segment)\n\n // replace any non-word characters since they can break\n // the named regex\n let cleanedKey = key.replace(/\\W/g, '')\n\n if (keyPrefix) {\n cleanedKey = `${keyPrefix}${cleanedKey}`\n }\n let invalidKey = false\n\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\n if (invalidKey) {\n cleanedKey = getSafeRouteKey()\n }\n\n const duplicateKey = cleanedKey in routeKeys\n\n if (keyPrefix) {\n routeKeys[cleanedKey] = `${keyPrefix}${key}`\n } else {\n routeKeys[cleanedKey] = key\n }\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\n ? escapeStringRegexp(interceptionMarker)\n : ''\n\n let pattern: string\n if (duplicateKey && backreferenceDuplicateKeys) {\n // Use a backreference to the key to ensure that the key is the same value\n // in each of the placeholders.\n pattern = `\\\\k<${cleanedKey}>`\n } else if (repeat) {\n pattern = `(?<${cleanedKey}>.+?)`\n } else {\n pattern = `(?<${cleanedKey}>[^/]+?)`\n }\n\n return {\n key,\n pattern: optional\n ? `(?:/${interceptionPrefix}${pattern})?`\n : `/${interceptionPrefix}${pattern}`,\n cleanedKey: cleanedKey,\n optional,\n repeat,\n }\n}\n\nfunction getNamedParametrizedRoute(\n route: string,\n prefixRouteKeys: boolean,\n includeSuffix: boolean,\n includePrefix: boolean,\n backreferenceDuplicateKeys: boolean,\n reference: RegexReference = { names: {}, intercepted: {} }\n) {\n const getSafeRouteKey = buildGetSafeRouteKey()\n const routeKeys: { [named: string]: string } = {}\n\n const segments: string[] = []\n const inverseParts: string[] = []\n\n // Ensure we don't mutate the original reference object.\n reference = structuredClone(reference)\n\n for (const segment of removeTrailingSlash(route).slice(1).split('/')) {\n const hasInterceptionMarker = INTERCEPTION_ROUTE_MARKERS.some((m) =>\n segment.startsWith(m)\n )\n\n const paramMatches = segment.match(PARAMETER_PATTERN) // Check for parameters\n\n const interceptionMarker = hasInterceptionMarker\n ? paramMatches?.[1]\n : undefined\n\n let keyPrefix: string | undefined\n if (interceptionMarker && paramMatches?.[2]) {\n keyPrefix = prefixRouteKeys ? NEXT_INTERCEPTION_MARKER_PREFIX : undefined\n reference.intercepted[paramMatches[2]] = interceptionMarker\n } else if (paramMatches?.[2] && reference.intercepted[paramMatches[2]]) {\n keyPrefix = prefixRouteKeys ? NEXT_INTERCEPTION_MARKER_PREFIX : undefined\n } else {\n keyPrefix = prefixRouteKeys ? NEXT_QUERY_PARAM_PREFIX : undefined\n }\n\n if (interceptionMarker && paramMatches && paramMatches[2]) {\n // If there's an interception marker, add it to the segments.\n const { key, pattern, cleanedKey, repeat, optional } =\n getSafeKeyFromSegment({\n getSafeRouteKey,\n interceptionMarker,\n segment: paramMatches[2],\n routeKeys,\n keyPrefix,\n backreferenceDuplicateKeys,\n })\n\n segments.push(pattern)\n inverseParts.push(\n `/${paramMatches[1]}:${reference.names[key] ?? cleanedKey}${repeat ? (optional ? '*' : '+') : ''}`\n )\n reference.names[key] ??= cleanedKey\n } else if (paramMatches && paramMatches[2]) {\n // If there's a prefix, add it to the segments if it's enabled.\n if (includePrefix && paramMatches[1]) {\n segments.push(`/${escapeStringRegexp(paramMatches[1])}`)\n inverseParts.push(`/${paramMatches[1]}`)\n }\n\n const { key, pattern, cleanedKey, repeat, optional } =\n getSafeKeyFromSegment({\n getSafeRouteKey,\n segment: paramMatches[2],\n routeKeys,\n keyPrefix,\n backreferenceDuplicateKeys,\n })\n\n // Remove the leading slash if includePrefix already added it.\n let s = pattern\n if (includePrefix && paramMatches[1]) {\n s = s.substring(1)\n }\n\n segments.push(s)\n inverseParts.push(\n `/:${reference.names[key] ?? cleanedKey}${repeat ? (optional ? '*' : '+') : ''}`\n )\n reference.names[key] ??= cleanedKey\n } else {\n segments.push(`/${escapeStringRegexp(segment)}`)\n inverseParts.push(`/${segment}`)\n }\n\n // If there's a suffix, add it to the segments if it's enabled.\n if (includeSuffix && paramMatches && paramMatches[3]) {\n segments.push(escapeStringRegexp(paramMatches[3]))\n inverseParts.push(paramMatches[3])\n }\n }\n\n return {\n namedParameterizedRoute: segments.join(''),\n routeKeys,\n pathToRegexpPattern: inverseParts.join(''),\n reference,\n }\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 */\nexport function getNamedRouteRegex(\n normalizedRoute: string,\n options: GetNamedRouteRegexOptions\n) {\n const result = getNamedParametrizedRoute(\n normalizedRoute,\n options.prefixRouteKeys,\n options.includeSuffix ?? false,\n options.includePrefix ?? false,\n options.backreferenceDuplicateKeys ?? false,\n options.reference\n )\n\n let namedRegex = result.namedParameterizedRoute\n if (!options.excludeOptionalTrailingSlash) {\n namedRegex += '(?:/)?'\n }\n\n return {\n ...getRouteRegex(normalizedRoute, options),\n namedRegex: `^${namedRegex}$`,\n routeKeys: result.routeKeys,\n pathToRegexpPattern: result.pathToRegexpPattern,\n reference: result.reference,\n }\n}\n\n/**\n * Generates a named regexp.\n * This is intended to be using for build time only.\n */\nexport function getNamedMiddlewareRegex(\n normalizedRoute: string,\n options: {\n catchAll?: boolean\n }\n) {\n const { parameterizedRoute } = getParametrizedRoute(\n normalizedRoute,\n false,\n false\n )\n const { catchAll = true } = options\n if (parameterizedRoute === '/') {\n let catchAllRegex = catchAll ? '.*' : ''\n return {\n namedRegex: `^/${catchAllRegex}$`,\n }\n }\n\n const { namedParameterizedRoute } = getNamedParametrizedRoute(\n normalizedRoute,\n false,\n false,\n false,\n false,\n undefined\n )\n let catchAllGroupedRegex = catchAll ? '(?:(/.*)?)' : ''\n return {\n namedRegex: `^${namedParameterizedRoute}${catchAllGroupedRegex}$`,\n }\n}\n","import type { Token } from 'next/dist/compiled/path-to-regexp'\n\n/**\n * Route pattern normalization utilities for path-to-regexp compatibility.\n *\n * path-to-regexp 6.3.0+ introduced stricter validation that rejects certain\n * patterns commonly used in Next.js interception routes. This module provides\n * normalization functions to make Next.js route patterns compatible with the\n * updated library while preserving all functionality.\n */\n\n/**\n * Internal separator used to normalize adjacent parameter patterns.\n * This unique marker is inserted between adjacent parameters and stripped out\n * during parameter extraction to avoid conflicts with real URL content.\n */\nexport const PARAM_SEPARATOR = '_NEXTSEP_'\n\n/**\n * Detects if a route pattern needs normalization for path-to-regexp compatibility.\n */\nexport function hasAdjacentParameterIssues(route: string): boolean {\n if (typeof route !== 'string') return false\n\n // Check for interception route markers followed immediately by parameters\n // Pattern: /(.):param, /(..):param, /(...):param, /(.)(.):param etc.\n // These patterns cause \"Must have text between two parameters\" errors\n if (/\\/\\(\\.{1,3}\\):[^/\\s]+/.test(route)) {\n return true\n }\n\n // Check for basic adjacent parameters without separators\n // Pattern: :param1:param2 (but not :param* or other URL patterns)\n if (/:[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*/.test(route)) {\n return true\n }\n\n return false\n}\n\n/**\n * Normalizes route patterns that have adjacent parameters without text between them.\n * Inserts a unique separator that can be safely stripped out later.\n */\nexport function normalizeAdjacentParameters(route: string): string {\n let normalized = route\n\n // Handle interception route patterns: (.):param -> (.)_NEXTSEP_:param\n normalized = normalized.replace(\n /(\\([^)]*\\)):([^/\\s]+)/g,\n `$1${PARAM_SEPARATOR}:$2`\n )\n\n // Handle other adjacent parameter patterns: :param1:param2 -> :param1_NEXTSEP_:param2\n normalized = normalized.replace(/:([^:/\\s)]+)(?=:)/g, `:$1${PARAM_SEPARATOR}`)\n\n return normalized\n}\n\n/**\n * Normalizes tokens that have repeating modifiers (* or +) but empty prefix and suffix.\n *\n * path-to-regexp 6.3.0+ introduced validation that throws:\n * \"Can not repeat without prefix/suffix\"\n *\n * This occurs when a token has modifier: '*' or '+' with both prefix: '' and suffix: ''\n */\nexport function normalizeTokensForRegexp(tokens: Token[]): Token[] {\n return tokens.map((token) => {\n // Token union type: Token = string | TokenObject\n // Literal path segments are strings, parameters/wildcards are objects\n if (\n typeof token === 'object' &&\n token !== null &&\n // Not all token objects have 'modifier' property (e.g., simple text tokens)\n 'modifier' in token &&\n // Only repeating modifiers (* or +) cause the validation error\n // Other modifiers like '?' (optional) are fine\n (token.modifier === '*' || token.modifier === '+') &&\n // Token objects can have different shapes depending on route pattern\n 'prefix' in token &&\n 'suffix' in token &&\n // Both prefix and suffix must be empty strings\n // This is what causes the validation error in path-to-regexp\n token.prefix === '' &&\n token.suffix === ''\n ) {\n // Add minimal prefix to satisfy path-to-regexp validation\n // We use '/' as it's the most common path delimiter and won't break route matching\n // The prefix gets used in regex generation but doesn't affect parameter extraction\n return {\n ...token,\n prefix: '/',\n }\n }\n return token\n })\n}\n\n/**\n * Strips normalization separators from compiled pathname.\n * This removes separators that were inserted by normalizeAdjacentParameters\n * to satisfy path-to-regexp validation.\n *\n * Only removes separators in the specific contexts where they were inserted:\n * - After interception route markers: (.)_NEXTSEP_ -> (.)\n *\n * This targeted approach ensures we don't accidentally remove the separator\n * from legitimate user content.\n */\nexport function stripNormalizedSeparators(pathname: string): string {\n // Remove separator after interception route markers\n // Pattern: (.)_NEXTSEP_ -> (.), (..)_NEXTSEP_ -> (..), etc.\n // The separator appears after the closing paren of interception markers\n return pathname.replace(new RegExp(`\\\\)${PARAM_SEPARATOR}`, 'g'), ')')\n}\n\n/**\n * Strips normalization separators from extracted route parameters.\n * Used by both server and client code to clean up parameters after route matching.\n */\nexport function stripParameterSeparators(\n params: Record<string, any>\n): Record<string, any> {\n const cleaned: Record<string, any> = {}\n\n for (const [key, value] of Object.entries(params)) {\n if (typeof value === 'string') {\n // Remove the separator if it appears at the start of parameter values\n cleaned[key] = value.replace(new RegExp(`^${PARAM_SEPARATOR}`), '')\n } else if (Array.isArray(value)) {\n // Handle array parameters (from repeated route segments)\n cleaned[key] = value.map((item) =>\n typeof item === 'string'\n ? item.replace(new RegExp(`^${PARAM_SEPARATOR}`), '')\n : item\n )\n } else {\n cleaned[key] = value\n }\n }\n\n return cleaned\n}\n","/**\n * Client-safe utilities for route matching that don't import server-side\n * utilities to avoid bundling issues with Turbopack\n */\n\nimport type {\n Key,\n TokensToRegexpOptions,\n ParseOptions,\n TokensToFunctionOptions,\n} from 'next/dist/compiled/path-to-regexp'\nimport {\n pathToRegexp,\n compile,\n regexpToFunction,\n} from 'next/dist/compiled/path-to-regexp'\nimport {\n hasAdjacentParameterIssues,\n normalizeAdjacentParameters,\n stripParameterSeparators,\n stripNormalizedSeparators,\n} from '../../../../lib/route-pattern-normalizer'\n\n/**\n * Client-safe wrapper around pathToRegexp that handles path-to-regexp 6.3.0+ validation errors.\n * This includes both \"Can not repeat without prefix/suffix\" and \"Must have text between parameters\" errors.\n */\nexport function safePathToRegexp(\n route: string | RegExp | Array<string | RegExp>,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n): RegExp {\n if (typeof route !== 'string') {\n return pathToRegexp(route, keys, options)\n }\n\n // Check if normalization is needed and cache the result\n const needsNormalization = hasAdjacentParameterIssues(route)\n const routeToUse = needsNormalization\n ? normalizeAdjacentParameters(route)\n : route\n\n try {\n return pathToRegexp(routeToUse, keys, options)\n } catch (error) {\n // Only try normalization if we haven't already normalized\n if (!needsNormalization) {\n try {\n const normalizedRoute = normalizeAdjacentParameters(route)\n return pathToRegexp(normalizedRoute, keys, options)\n } catch (retryError) {\n // If that doesn't work, fall back to original error\n throw error\n }\n }\n throw error\n }\n}\n\n/**\n * Client-safe wrapper around compile that handles path-to-regexp 6.3.0+ validation errors.\n * No server-side error reporting to avoid bundling issues.\n * When normalization is applied, the returned compiler function automatically strips\n * the internal separator from the output URL.\n */\nexport function safeCompile(\n route: string,\n options?: TokensToFunctionOptions & ParseOptions\n) {\n // Check if normalization is needed and cache the result\n const needsNormalization = hasAdjacentParameterIssues(route)\n const routeToUse = needsNormalization\n ? normalizeAdjacentParameters(route)\n : route\n\n try {\n const compiler = compile(routeToUse, options)\n\n // If we normalized the route, wrap the compiler to strip separators from output\n // The normalization inserts _NEXTSEP_ as a literal string in the pattern to satisfy\n // path-to-regexp validation, but we don't want it in the final compiled URL\n if (needsNormalization) {\n return (params: any) => {\n return stripNormalizedSeparators(compiler(params))\n }\n }\n\n return compiler\n } catch (error) {\n // Only try normalization if we haven't already normalized\n if (!needsNormalization) {\n try {\n const normalizedRoute = normalizeAdjacentParameters(route)\n const compiler = compile(normalizedRoute, options)\n\n // Wrap the compiler to strip separators from output\n return (params: any) => {\n return stripNormalizedSeparators(compiler(params))\n }\n } catch (retryError) {\n // If that doesn't work, fall back to original error\n throw error\n }\n }\n throw error\n }\n}\n\n/**\n * Client-safe wrapper around regexpToFunction that automatically cleans parameters.\n */\nexport function safeRegexpToFunction<\n T extends Record<string, any> = Record<string, any>,\n>(regexp: RegExp, keys?: Key[]): (pathname: string) => { params: T } | false {\n const originalMatcher = regexpToFunction<T>(regexp, keys || [])\n\n return (pathname: string) => {\n const result = originalMatcher(pathname)\n if (!result) return false\n\n // Clean parameters before returning\n return {\n ...result,\n params: stripParameterSeparators(result.params as any) as T,\n }\n }\n}\n\n/**\n * Safe wrapper for route matcher functions that automatically cleans parameters.\n * This is client-safe and doesn't import path-to-regexp.\n */\nexport function safeRouteMatcher<T extends Record<string, any>>(\n matcherFn: (pathname: string) => false | T\n): (pathname: string) => false | T {\n return (pathname: string) => {\n const result = matcherFn(pathname)\n if (!result) return false\n\n // Clean parameters before returning\n return stripParameterSeparators(result) as T\n }\n}\n","import type { Group } from './route-regex'\nimport { DecodeError } from '../../utils'\nimport type { Params } from '../../../../server/request/params'\nimport { safeRouteMatcher } from './route-match-utils'\n\nexport interface RouteMatchFn {\n (pathname: string): false | Params\n}\n\ntype RouteMatcherOptions = {\n // We only use the exec method of the RegExp object. This helps us avoid using\n // type assertions that the passed in properties are of the correct type.\n re: Pick<RegExp, 'exec'>\n groups: Record<string, Group>\n}\n\nexport function getRouteMatcher({\n re,\n groups,\n}: RouteMatcherOptions): RouteMatchFn {\n const rawMatcher = (pathname: string) => {\n const routeMatch = re.exec(pathname)\n if (!routeMatch) return false\n\n const decode = (param: string) => {\n try {\n return decodeURIComponent(param)\n } catch {\n throw new DecodeError('failed to decode param')\n }\n }\n\n const params: Params = {}\n for (const [key, group] of Object.entries(groups)) {\n const match = routeMatch[group.pos]\n if (match !== undefined) {\n if (group.repeat) {\n params[key] = match.split('/').map((entry) => decode(entry))\n } else {\n params[key] = decode(match)\n }\n }\n }\n\n return params\n }\n\n // Wrap with safe matcher to handle parameter cleaning\n return safeRouteMatcher(rawMatcher)\n}\n","import type { IncomingMessage } from 'http'\nimport type { Key } from 'next/dist/compiled/path-to-regexp'\nimport type { NextParsedUrlQuery } from '../../../../server/request-meta'\nimport type { RouteHas } from '../../../../lib/load-custom-routes'\nimport type { BaseNextRequest } from '../../../../server/base-http'\n\nimport { escapeStringRegexp } from '../../escape-regexp'\nimport { parseUrl } from './parse-url'\nimport {\n INTERCEPTION_ROUTE_MARKERS,\n isInterceptionRouteAppPath,\n} from './interception-routes'\nimport { getCookieParser } from '../../../../server/api-utils/get-cookie-parser'\nimport type { Params } from '../../../../server/request/params'\nimport { safePathToRegexp, safeCompile } from './route-match-utils'\n\n/**\n * Ensure only a-zA-Z are used for param names for proper interpolating\n * with path-to-regexp\n */\nfunction getSafeParamName(paramName: string) {\n let newParamName = ''\n\n for (let i = 0; i < paramName.length; i++) {\n const charCode = paramName.charCodeAt(i)\n\n if (\n (charCode > 64 && charCode < 91) || // A-Z\n (charCode > 96 && charCode < 123) // a-z\n ) {\n newParamName += paramName[i]\n }\n }\n return newParamName\n}\n\nfunction escapeSegment(str: string, segmentName: string) {\n return str.replace(\n new RegExp(`:${escapeStringRegexp(segmentName)}`, 'g'),\n `__ESC_COLON_${segmentName}`\n )\n}\n\nfunction unescapeSegments(str: string) {\n return str.replace(/__ESC_COLON_/gi, ':')\n}\n\nexport function matchHas(\n req: BaseNextRequest | IncomingMessage,\n query: Params,\n has: RouteHas[] = [],\n missing: RouteHas[] = []\n): false | Params {\n const params: Params = {}\n\n const hasMatch = (hasItem: RouteHas) => {\n let value\n let key = hasItem.key\n\n switch (hasItem.type) {\n case 'header': {\n key = key!.toLowerCase()\n value = req.headers[key] as string\n break\n }\n case 'cookie': {\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\n break\n }\n case 'query': {\n value = query[key!]\n break\n }\n case 'host': {\n const { host } = req?.headers || {}\n // remove port from host if present\n const hostname = host?.split(':', 1)[0].toLowerCase()\n value = hostname\n break\n }\n default: {\n break\n }\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)\n ? value.slice(-1)[0].match(matcher)\n : value.match(matcher)\n\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\n const allMatch =\n has.every((item) => hasMatch(item)) &&\n !missing.some((item) => hasMatch(item))\n\n if (allMatch) {\n return params\n }\n return false\n}\n\nexport function compileNonPath(value: string, params: Params): string {\n if (!value.includes(':')) {\n return value\n }\n\n for (const key of Object.keys(params)) {\n if (value.includes(`:${key}`)) {\n value = value\n .replace(\n new RegExp(`:${key}\\\\*`, 'g'),\n `:${key}--ESCAPED_PARAM_ASTERISKS`\n )\n .replace(\n new RegExp(`:${key}\\\\?`, 'g'),\n `:${key}--ESCAPED_PARAM_QUESTION`\n )\n .replace(new RegExp(`:${key}\\\\+`, 'g'), `:${key}--ESCAPED_PARAM_PLUS`)\n .replace(\n new RegExp(`:${key}(?!\\\\w)`, 'g'),\n `--ESCAPED_PARAM_COLON${key}`\n )\n }\n }\n value = value\n .replace(/(:|\\*|\\?|\\+|\\(|\\)|\\{|\\})/g, '\\\\$1')\n .replace(/--ESCAPED_PARAM_PLUS/g, '+')\n .replace(/--ESCAPED_PARAM_COLON/g, ':')\n .replace(/--ESCAPED_PARAM_QUESTION/g, '?')\n .replace(/--ESCAPED_PARAM_ASTERISKS/g, '*')\n\n // the value needs to start with a forward-slash to be compiled\n // correctly\n return safeCompile(`/${value}`, { validate: false })(params).slice(1)\n}\n\nexport function parseDestination(args: {\n destination: string\n params: Readonly<Params>\n query: Readonly<NextParsedUrlQuery>\n}) {\n let escaped = args.destination\n for (const param of Object.keys({ ...args.params, ...args.query })) {\n if (!param) continue\n\n escaped = escapeSegment(escaped, param)\n }\n\n const parsed = parseUrl(escaped)\n\n let pathname = parsed.pathname\n if (pathname) {\n pathname = unescapeSegments(pathname)\n }\n\n let href = parsed.href\n if (href) {\n href = unescapeSegments(href)\n }\n\n let hostname = parsed.hostname\n if (hostname) {\n hostname = unescapeSegments(hostname)\n }\n\n let hash = parsed.hash\n if (hash) {\n hash = unescapeSegments(hash)\n }\n\n let search = parsed.search\n if (search) {\n search = unescapeSegments(search)\n }\n\n let origin = parsed.origin\n if (origin) {\n origin = unescapeSegments(origin)\n }\n\n return {\n ...parsed,\n pathname,\n hostname,\n href,\n hash,\n search,\n origin,\n }\n}\n\nexport function prepareDestination(args: {\n appendParamsToQuery: boolean\n destination: string\n params: Params\n query: NextParsedUrlQuery\n}) {\n const parsedDestination = parseDestination(args)\n\n const {\n hostname: destHostname,\n query: destQuery,\n search: destSearch,\n } = parsedDestination\n\n // The following code assumes that the pathname here includes the hash if it's\n // present.\n let destPath = parsedDestination.pathname\n if (parsedDestination.hash) {\n destPath = `${destPath}${parsedDestination.hash}`\n }\n\n const destParams: (string | number)[] = []\n\n const destPathParamKeys: Key[] = []\n safePathToRegexp(destPath, destPathParamKeys)\n for (const key of destPathParamKeys) {\n destParams.push(key.name)\n }\n\n if (destHostname) {\n const destHostnameParamKeys: Key[] = []\n safePathToRegexp(destHostname, destHostnameParamKeys)\n for (const key of destHostnameParamKeys) {\n destParams.push(key.name)\n }\n }\n\n const destPathCompiler = safeCompile(\n destPath,\n // 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 { validate: false }\n )\n\n let destHostnameCompiler\n if (destHostname) {\n destHostnameCompiler = safeCompile(destHostname, { validate: false })\n }\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) =>\n compileNonPath(unescapeSegments(value), args.params)\n )\n } else if (typeof strOrArray === 'string') {\n destQuery[key] = compileNonPath(unescapeSegments(strOrArray), args.params)\n }\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(\n (name) => name !== 'nextInternalLocale'\n )\n\n if (\n args.appendParamsToQuery &&\n !paramKeys.some((key) => destParams.includes(key))\n ) {\n for (const key of paramKeys) {\n if (!(key in destQuery)) {\n destQuery[key] = args.params[key]\n }\n }\n }\n\n let newUrl\n\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) =>\n segment.startsWith(m)\n )\n if (marker) {\n if (marker === '(..)(..)') {\n args.params['0'] = '(..)'\n args.params['1'] = '(..)'\n } else {\n args.params['0'] = marker\n }\n break\n }\n }\n }\n\n try {\n newUrl = destPathCompiler(args.params)\n\n const [pathname, hash] = newUrl.split('#', 2)\n if (destHostnameCompiler) {\n parsedDestination.hostname = destHostnameCompiler(args.params)\n }\n parsedDestination.pathname = pathname\n parsedDestination.hash = `${hash ? '#' : ''}${hash || ''}`\n parsedDestination.search = destSearch\n ? compileNonPath(destSearch, args.params)\n : ''\n } catch (err: any) {\n if (err.message.match(/Expected .*? to not repeat, but got an array/)) {\n throw new Error(\n `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 }\n throw err\n }\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 ...args.query,\n ...parsedDestination.query,\n }\n\n return {\n newUrl,\n destQuery,\n parsedDestination,\n }\n}\n","/**\n * Decodes a query path parameter.\n *\n * @param value - The value to decode.\n * @returns The decoded value.\n */\nexport function decodeQueryPathParameter(value: string) {\n // When deployed to Vercel, the value may be encoded, so this attempts to\n // decode it and returns the original value if it fails.\n try {\n return decodeURIComponent(value)\n } catch {\n return value\n }\n}\n","import type { UrlWithParsedQuery } from 'url'\nimport { NEXT_RSC_UNION_QUERY } from '../client/components/app-router-headers'\n\nconst DUMMY_ORIGIN = 'http://n'\n\nexport function isFullStringUrl(url: string) {\n return /https?:\\/\\//.test(url)\n}\n\nexport function parseUrl(url: string): URL | undefined {\n let parsed: URL | undefined = undefined\n try {\n parsed = new URL(url, DUMMY_ORIGIN)\n } catch {}\n return parsed\n}\n\nexport function parseReqUrl(url: string): UrlWithParsedQuery | undefined {\n const parsedUrl: URL | undefined = parseUrl(url)\n\n if (!parsedUrl) {\n return\n }\n\n const query: Record<string, string | string[]> = {}\n\n for (const key of parsedUrl.searchParams.keys()) {\n const values = parsedUrl.searchParams.getAll(key)\n query[key] = values.length > 1 ? values : values[0]\n }\n\n const legacyUrl: UrlWithParsedQuery = {\n query,\n hash: parsedUrl.hash,\n search: parsedUrl.search,\n path: parsedUrl.pathname,\n pathname: parsedUrl.pathname,\n href: `${parsedUrl.pathname}${parsedUrl.search}${parsedUrl.hash}`,\n host: '',\n hostname: '',\n auth: '',\n protocol: '',\n slashes: null,\n port: '',\n }\n return legacyUrl\n}\n\nexport function stripNextRscUnionQuery(relativeUrl: string): string {\n const urlInstance = new URL(relativeUrl, DUMMY_ORIGIN)\n urlInstance.searchParams.delete(NEXT_RSC_UNION_QUERY)\n\n return urlInstance.pathname + urlInstance.search\n}\n","// Format function modified from nodejs\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.\n\nimport type { UrlObject } from 'url'\nimport type { ParsedUrlQuery } from 'querystring'\nimport * as querystring from './querystring'\n\nconst slashedProtocols = /https?|ftp|gopher|file/\n\nexport function formatUrl(urlObj: UrlObject) {\n let { auth, hostname } = urlObj\n let protocol = urlObj.protocol || ''\n let pathname = urlObj.pathname || ''\n let hash = urlObj.hash || ''\n let query = urlObj.query || ''\n let host: string | false = false\n\n auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ':') + '@' : ''\n\n if (urlObj.host) {\n host = auth + urlObj.host\n } else if (hostname) {\n host = auth + (~hostname.indexOf(':') ? `[${hostname}]` : hostname)\n if (urlObj.port) {\n host += ':' + urlObj.port\n }\n }\n\n if (query && typeof query === 'object') {\n query = String(querystring.urlQueryToSearchParams(query as ParsedUrlQuery))\n }\n\n let search = urlObj.search || (query && `?${query}`) || ''\n\n if (protocol && !protocol.endsWith(':')) protocol += ':'\n\n if (\n urlObj.slashes ||\n ((!protocol || slashedProtocols.test(protocol)) && host !== false)\n ) {\n host = '//' + (host || '')\n if (pathname && pathname[0] !== '/') pathname = '/' + pathname\n } else if (!host) {\n host = ''\n }\n\n if (hash && hash[0] !== '#') hash = '#' + hash\n if (search && search[0] !== '?') search = '?' + search\n\n pathname = pathname.replace(/[?#]/g, encodeURIComponent)\n search = search.replace('#', '%23')\n\n return `${protocol}${host}${pathname}${search}${hash}`\n}\n\nexport const urlObjectKeys = [\n 'auth',\n 'hash',\n 'host',\n 'hostname',\n 'href',\n 'path',\n 'pathname',\n 'port',\n 'protocol',\n 'query',\n 'search',\n 'slashes',\n]\n\nexport function formatWithValidation(url: UrlObject): string {\n if (process.env.NODE_ENV === 'development') {\n if (url !== null && typeof url === 'object') {\n Object.keys(url).forEach((key) => {\n if (!urlObjectKeys.includes(key)) {\n console.warn(\n `Unknown key passed via urlObject into url.format: ${key}`\n )\n }\n })\n }\n }\n\n return formatUrl(url)\n}\n","import type { Rewrite } from '../lib/load-custom-routes'\nimport type { RouteMatchFn } from '../shared/lib/router/utils/route-matcher'\nimport type { NextConfig } from './config'\nimport type { BaseNextRequest } from './base-http'\nimport type { ParsedUrlQuery } from 'querystring'\nimport type { UrlWithParsedQuery } from 'url'\n\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 {\n matchHas,\n prepareDestination,\n} 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 {\n NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER,\n NEXT_CACHE_REVALIDATED_TAGS_HEADER,\n NEXT_INTERCEPTION_MARKER_PREFIX,\n NEXT_QUERY_PARAM_PREFIX,\n} from '../lib/constants'\nimport { normalizeNextQueryParam } from './web/utils'\nimport type { IncomingHttpHeaders, IncomingMessage } from 'http'\nimport { decodeQueryPathParameter } from './lib/decode-query-path-parameter'\nimport type { DeepReadonly } from '../shared/lib/deep-readonly'\nimport { parseReqUrl } from '../lib/url'\nimport { formatUrl } from '../shared/lib/router/utils/format-url'\n\nfunction filterInternalQuery(\n query: Record<string, undefined | string | string[]>,\n paramKeys: string[]\n) {\n // this is used to pass query information in rewrites\n // but should not be exposed in final query\n delete query['nextInternalLocale']\n\n for (const key in query) {\n const isNextQueryPrefix =\n key !== NEXT_QUERY_PARAM_PREFIX && key.startsWith(NEXT_QUERY_PARAM_PREFIX)\n\n const isNextInterceptionMarkerPrefix =\n key !== NEXT_INTERCEPTION_MARKER_PREFIX &&\n key.startsWith(NEXT_INTERCEPTION_MARKER_PREFIX)\n\n if (\n isNextQueryPrefix ||\n isNextInterceptionMarkerPrefix ||\n paramKeys.includes(key)\n ) {\n delete query[key]\n }\n }\n}\n\nexport function normalizeCdnUrl(\n req: BaseNextRequest | IncomingMessage,\n paramKeys: string[]\n) {\n // make sure to normalize req.url from CDNs to strip dynamic and rewrite\n // params from the query which are added during routing\n const _parsedUrl = parseReqUrl(req.url!)\n\n // we can't normalize if we can't parse\n if (!_parsedUrl) {\n return req.url\n }\n delete (_parsedUrl as any).search\n filterInternalQuery(_parsedUrl.query, paramKeys)\n\n req.url = formatUrl(_parsedUrl)\n}\n\nexport function interpolateDynamicPath(\n pathname: string,\n params: ParsedUrlQuery,\n defaultRouteRegex?: ReturnType<typeof getNamedRouteRegex> | undefined\n) {\n if (!defaultRouteRegex) return pathname\n\n for (const param of Object.keys(defaultRouteRegex.groups)) {\n const { optional, repeat } = defaultRouteRegex.groups[param]\n let builtParam = `[${repeat ? '...' : ''}${param}]`\n\n if (optional) {\n builtParam = `[${builtParam}]`\n }\n\n let paramValue: string\n const value = params[param]\n\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\n if (paramValue || optional) {\n pathname = pathname.replaceAll(builtParam, paramValue)\n }\n }\n\n return pathname\n}\n\nexport function normalizeDynamicRouteParams(\n query: ParsedUrlQuery,\n defaultRouteRegex: ReturnType<typeof getNamedRouteRegex>,\n defaultRouteMatches: ParsedUrlQuery,\n ignoreMissingOptional: boolean\n) {\n let hasValidParams = true\n let params: ParsedUrlQuery = {}\n\n for (const key of Object.keys(defaultRouteRegex.groups)) {\n let value: string | string[] | undefined = query[key]\n\n if (typeof value === 'string') {\n value = normalizeRscURL(value)\n } else if (Array.isArray(value)) {\n value = value.map(normalizeRscURL)\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\n const isDefaultValue = Array.isArray(defaultValue)\n ? defaultValue.some((defaultVal) => {\n return Array.isArray(value)\n ? value.some((val) => val.includes(defaultVal))\n : value?.includes(defaultVal)\n })\n : value?.includes(defaultValue as string)\n\n if (\n isDefaultValue ||\n (typeof value === 'undefined' && !(isOptional && ignoreMissingOptional))\n ) {\n return { params: {}, hasValidParams: false }\n }\n\n // non-provided optional values should be undefined so normalize\n // them to undefined\n if (\n isOptional &&\n (!value ||\n (Array.isArray(value) &&\n value.length === 1 &&\n // fallback optional catch-all SSG pages have\n // [[...paramName]] for the root path on Vercel\n (value[0] === 'index' || value[0] === `[[...${key}]]`)) ||\n value === 'index' ||\n value === `[[...${key}]]`)\n ) {\n value = undefined\n delete query[key]\n }\n\n // query values from the proxy aren't already split into arrays\n // so make sure to normalize catch-all values\n if (\n value &&\n typeof value === 'string' &&\n defaultRouteRegex!.groups[key].repeat\n ) {\n value = value.split('/')\n }\n\n if (value) {\n params[key] = value\n }\n }\n\n return {\n params,\n hasValidParams,\n }\n}\n\nexport function getServerUtils({\n page,\n i18n,\n basePath,\n rewrites,\n pageIsDynamic,\n trailingSlash,\n caseSensitive,\n}: {\n page: string\n i18n?: NextConfig['i18n']\n basePath: string\n rewrites: DeepReadonly<{\n fallback?: ReadonlyArray<Rewrite>\n afterFiles?: ReadonlyArray<Rewrite>\n beforeFiles?: ReadonlyArray<Rewrite>\n }>\n pageIsDynamic: boolean\n trailingSlash?: boolean\n caseSensitive: boolean\n}) {\n let defaultRouteRegex: ReturnType<typeof getNamedRouteRegex> | undefined\n let dynamicRouteMatcher: RouteMatchFn | undefined\n let defaultRouteMatches: ParsedUrlQuery | undefined\n\n if (pageIsDynamic) {\n defaultRouteRegex = getNamedRouteRegex(page, {\n prefixRouteKeys: false,\n })\n dynamicRouteMatcher = getRouteMatcher(defaultRouteRegex)\n defaultRouteMatches = dynamicRouteMatcher(page) as ParsedUrlQuery\n }\n\n function handleRewrites(\n req: BaseNextRequest | IncomingMessage,\n parsedUrl: DeepReadonly<UrlWithParsedQuery>\n ) {\n // Here we deep clone the parsedUrl to avoid mutating the original. We also\n // cast this to a mutable type so we can mutate it within this scope.\n const rewrittenParsedUrl = structuredClone(parsedUrl) as UrlWithParsedQuery\n const rewriteParams: Record<string, string> = {}\n let fsPathname = rewrittenParsedUrl.pathname\n\n const matchesPage = () => {\n const fsPathnameNoSlash = removeTrailingSlash(fsPathname || '')\n return (\n fsPathnameNoSlash === removeTrailingSlash(page) ||\n dynamicRouteMatcher?.(fsPathnameNoSlash)\n )\n }\n\n const checkRewrite = (rewrite: DeepReadonly<Rewrite>): boolean => {\n const matcher = getPathMatch(\n rewrite.source + (trailingSlash ? '(/)?' : ''),\n {\n removeUnnamedParams: true,\n strict: true,\n sensitive: !!caseSensitive,\n }\n )\n\n if (!rewrittenParsedUrl.pathname) return false\n\n let params = matcher(rewrittenParsedUrl.pathname)\n\n if ((rewrite.has || rewrite.missing) && params) {\n const hasParams = matchHas(\n req,\n rewrittenParsedUrl.query,\n rewrite.has as Rewrite['has'],\n rewrite.missing as Rewrite['missing']\n )\n\n if (hasParams) {\n Object.assign(params, hasParams)\n } else {\n params = false\n }\n }\n\n if (params) {\n const { parsedDestination, destQuery } = prepareDestination({\n appendParamsToQuery: true,\n destination: rewrite.destination,\n params: params,\n query: rewrittenParsedUrl.query,\n })\n\n // if the rewrite destination is external break rewrite chain\n if (parsedDestination.protocol) {\n return true\n }\n\n Object.assign(rewriteParams, destQuery, params)\n Object.assign(rewrittenParsedUrl.query, parsedDestination.query)\n delete (parsedDestination as any).query\n\n Object.assign(rewrittenParsedUrl, parsedDestination)\n\n fsPathname = rewrittenParsedUrl.pathname\n if (!fsPathname) return false\n\n if (basePath) {\n fsPathname = fsPathname.replace(new RegExp(`^${basePath}`), '') || '/'\n }\n\n if (i18n) {\n const result = normalizeLocalePath(fsPathname, i18n.locales)\n fsPathname = result.pathname\n rewrittenParsedUrl.query.nextInternalLocale =\n result.detectedLocale || params.nextInternalLocale\n }\n\n if (fsPathname === page) {\n return true\n }\n\n if (pageIsDynamic && dynamicRouteMatcher) {\n const dynamicParams = dynamicRouteMatcher(fsPathname)\n if (dynamicParams) {\n rewrittenParsedUrl.query = {\n ...rewrittenParsedUrl.query,\n ...dynamicParams,\n }\n return true\n }\n }\n }\n\n return false\n }\n\n for (const rewrite of rewrites.beforeFiles || []) {\n checkRewrite(rewrite)\n }\n\n if (fsPathname !== page) {\n let finished = false\n\n for (const rewrite of rewrites.afterFiles || []) {\n finished = checkRewrite(rewrite)\n if (finished) break\n }\n\n if (!finished && !matchesPage()) {\n for (const rewrite of rewrites.fallback || []) {\n finished = checkRewrite(rewrite)\n if (finished) break\n }\n }\n }\n\n return { rewriteParams, rewrittenParsedUrl }\n }\n\n function getParamsFromRouteMatches(routeMatchesHeader: string) {\n // If we don't have a default route regex, we can't get params from route\n // matches\n if (!defaultRouteRegex) return null\n\n const { groups, routeKeys } = defaultRouteRegex\n\n const matcher = getRouteMatcher({\n re: {\n // Simulate a RegExp match from the \\`req.url\\` input\n exec: (str: string) => {\n // Normalize all the prefixed query params.\n const obj: Record<string, string> = Object.fromEntries(\n new URLSearchParams(str)\n )\n for (const [key, value] of Object.entries(obj)) {\n const normalizedKey = normalizeNextQueryParam(key)\n if (!normalizedKey) continue\n\n obj[normalizedKey] = value\n delete obj[key]\n }\n\n // Use all the named route keys.\n const result = {} as RegExpExecArray\n for (const keyName of Object.keys(routeKeys)) {\n const paramName = routeKeys[keyName]\n\n // If this param name is not a valid parameter name, then skip it.\n if (!paramName) continue\n\n const group = groups[paramName]\n const value = obj[keyName]\n\n // When we're missing a required param, we can't match the route.\n if (!group.optional && !value) return null\n\n result[group.pos] = value\n }\n\n return result\n },\n },\n groups,\n })\n\n const routeMatches = matcher(routeMatchesHeader)\n if (!routeMatches) return null\n\n return routeMatches\n }\n\n function normalizeQueryParams(\n query: Record<string, string | string[] | undefined>,\n routeParamKeys: Set<string>\n ) {\n // this is used to pass query information in rewrites\n // but should not be exposed in final query\n delete query['nextInternalLocale']\n\n for (const [key, value] of Object.entries(query)) {\n const normalizedKey = normalizeNextQueryParam(key)\n if (!normalizedKey) continue\n\n // Remove the prefixed key from the query params because we want\n // to consume it for the dynamic route matcher.\n delete query[key]\n routeParamKeys.add(normalizedKey)\n\n if (typeof value === 'undefined') continue\n\n query[normalizedKey] = Array.isArray(value)\n ? value.map((v) => decodeQueryPathParameter(v))\n : decodeQueryPathParameter(value)\n }\n }\n\n return {\n handleRewrites,\n defaultRouteRegex,\n dynamicRouteMatcher,\n defaultRouteMatches,\n normalizeQueryParams,\n getParamsFromRouteMatches,\n /**\n * Normalize dynamic route params.\n *\n * @param query - The query params to normalize.\n * @param ignoreMissingOptional - Whether to ignore missing optional params.\n * @returns The normalized params and whether they are valid.\n */\n normalizeDynamicRouteParams: (\n query: ParsedUrlQuery,\n ignoreMissingOptional: boolean\n ) => {\n if (!defaultRouteRegex || !defaultRouteMatches) {\n return { params: {}, hasValidParams: false }\n }\n\n return normalizeDynamicRouteParams(\n query,\n defaultRouteRegex,\n defaultRouteMatches,\n ignoreMissingOptional\n )\n },\n\n normalizeCdnUrl: (\n req: BaseNextRequest | IncomingMessage,\n paramKeys: string[]\n ) => normalizeCdnUrl(req, paramKeys),\n\n interpolateDynamicPath: (\n pathname: string,\n params: Record<string, undefined | string | string[]>\n ) => interpolateDynamicPath(pathname, params, defaultRouteRegex),\n\n filterInternalQuery: (query: ParsedUrlQuery, paramKeys: string[]) =>\n filterInternalQuery(query, paramKeys),\n }\n}\n\nexport function getPreviouslyRevalidatedTags(\n headers: IncomingHttpHeaders,\n previewModeId: string | undefined\n): string[] {\n return typeof headers[NEXT_CACHE_REVALIDATED_TAGS_HEADER] === 'string' &&\n headers[NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER] === previewModeId\n ? headers[NEXT_CACHE_REVALIDATED_TAGS_HEADER].split(',')\n : []\n}\n","export const VALID_LOADERS = [\n 'default',\n 'imgix',\n 'cloudinary',\n 'akamai',\n 'custom',\n] as const\n\nexport type LoaderValue = (typeof VALID_LOADERS)[number]\n\nexport type ImageLoaderProps = {\n src: string\n width: number\n quality?: number\n}\n\nexport type ImageLoaderPropsWithConfig = ImageLoaderProps & {\n config: Readonly<ImageConfig>\n}\n\nexport type LocalPattern = {\n /**\n * Can be literal or wildcard.\n * Single `*` matches a single path segment.\n * Double `**` matches any number of path segments.\n */\n pathname?: string\n\n /**\n * Can be literal query string such as `?v=1` or\n * empty string meaning no query string.\n */\n search?: string\n}\n\nexport type RemotePattern = {\n /**\n * Must be `http` or `https`.\n */\n protocol?: 'http' | 'https'\n\n /**\n * Can be literal or wildcard.\n * Single `*` matches a single subdomain.\n * Double `**` matches any number of subdomains.\n */\n hostname: string\n\n /**\n * Can be literal port such as `8080` or empty string\n * meaning no port.\n */\n port?: string\n\n /**\n * Can be literal or wildcard.\n * Single `*` matches a single path segment.\n * Double `**` matches any number of path segments.\n */\n pathname?: string\n\n /**\n * Can be literal query string such as `?v=1` or\n * empty string meaning no query string.\n */\n search?: string\n}\n\ntype ImageFormat = 'image/avif' | 'image/webp'\n\n/**\n * Image configurations\n *\n * @see [Image configuration options](https://nextjs.org/docs/api-reference/next/image#configuration-options)\n */\nexport type ImageConfigComplete = {\n /** @see [Device sizes documentation](https://nextjs.org/docs/api-reference/next/image#device-sizes) */\n deviceSizes: number[]\n\n /** @see [Image sizing documentation](https://nextjs.org/docs/app/building-your-application/optimizing/images#image-sizing) */\n imageSizes: number[]\n\n /** @see [Image loaders configuration](https://nextjs.org/docs/api-reference/next/legacy/image#loader) */\n loader: LoaderValue\n\n /** @see [Image loader configuration](https://nextjs.org/docs/app/api-reference/components/image#path) */\n path: string\n\n /** @see [Image loader configuration](https://nextjs.org/docs/api-reference/next/image#loader-configuration) */\n loaderFile: string\n\n /**\n * @deprecated Use `remotePatterns` instead.\n */\n domains: string[]\n\n /** @see [Disable static image import configuration](https://nextjs.org/docs/api-reference/next/image#disable-static-imports) */\n disableStaticImages: boolean\n\n /** @see [Cache behavior](https://nextjs.org/docs/api-reference/next/image#caching-behavior) */\n minimumCacheTTL: number\n\n /** @see [Acceptable formats](https://nextjs.org/docs/api-reference/next/image#acceptable-formats) */\n formats: ImageFormat[]\n\n /** @see [Maximum Redirects](https://nextjs.org/docs/api-reference/next/image#maximumredirects) */\n maximumRedirects: number\n\n /** @see [Dangerously Allow Local IP](https://nextjs.org/docs/api-reference/next/image#dangerously-allow-local-ip) */\n dangerouslyAllowLocalIP: boolean\n\n /** @see [Dangerously Allow SVG](https://nextjs.org/docs/api-reference/next/image#dangerously-allow-svg) */\n dangerouslyAllowSVG: boolean\n\n /** @see [Content Security Policy](https://nextjs.org/docs/api-reference/next/image#contentsecuritypolicy) */\n contentSecurityPolicy: string\n\n /** @see [Content Disposition Type](https://nextjs.org/docs/api-reference/next/image#contentdispositiontype) */\n contentDispositionType: 'inline' | 'attachment'\n\n /** @see [Remote Patterns](https://nextjs.org/docs/api-reference/next/image#remotepatterns) */\n remotePatterns: Array<URL | RemotePattern>\n\n /** @see [Local Patterns](https://nextjs.org/docs/api-reference/next/image#localPatterns) */\n localPatterns: LocalPattern[] | undefined\n\n /** @see [Qualities](https://nextjs.org/docs/api-reference/next/image#qualities) */\n qualities: number[] | undefined\n\n /** @see [Unoptimized](https://nextjs.org/docs/api-reference/next/image#unoptimized) */\n unoptimized: boolean\n}\n\nexport type ImageConfig = Partial<ImageConfigComplete>\n\nexport const imageConfigDefault: ImageConfigComplete = {\n deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],\n imageSizes: [32, 48, 64, 96, 128, 256, 384],\n path: '/_next/image',\n loader: 'default',\n loaderFile: '',\n /**\n * @deprecated Use `remotePatterns` instead to protect your application from malicious users.\n */\n domains: [],\n disableStaticImages: false,\n minimumCacheTTL: 14400, // 4 hours\n formats: ['image/webp'],\n maximumRedirects: 3,\n dangerouslyAllowLocalIP: false,\n dangerouslyAllowSVG: false,\n contentSecurityPolicy: `script-src 'none'; frame-src 'none'; sandbox;`,\n contentDispositionType: 'attachment',\n localPatterns: undefined, // default: allow all local images\n remotePatterns: [], // default: allow no remote images\n qualities: [75],\n unoptimized: false,\n}\n","import React from 'react'\nimport type { ImageConfigComplete } from './image-config'\nimport { imageConfigDefault } from './image-config'\n\nexport const ImageConfigContext =\n React.createContext<ImageConfigComplete>(imageConfigDefault)\n\nif (process.env.NODE_ENV !== 'production') {\n ImageConfigContext.displayName = 'ImageConfigContext'\n}\n","import type { ComponentType, ErrorInfo, JSX, ReactNode } from 'react'\nimport type { RenderOpts, PreloadCallbacks } from './types'\nimport type {\n ActionResult,\n DynamicParamTypesShort,\n FlightRouterState,\n Segment,\n CacheNodeSeedData,\n RSCPayload,\n FlightData,\n InitialRSCPayload,\n FlightDataPath,\n} from '../../shared/lib/app-router-types'\nimport {\n workAsyncStorage,\n type WorkStore,\n} from '../app-render/work-async-storage.external'\nimport type {\n PrerenderStoreModernRuntime,\n RequestStore,\n} from '../app-render/work-unit-async-storage.external'\nimport type { NextParsedUrlQuery } from '../request-meta'\nimport type { LoaderTree } from '../lib/app-dir-module'\nimport type { AppPageModule } from '../route-modules/app-page/module'\nimport type {\n ClientReferenceManifest,\n ManifestNode,\n} from '../../build/webpack/plugins/flight-manifest-plugin'\nimport type { DeepReadonly } from '../../shared/lib/deep-readonly'\nimport type { BaseNextRequest, BaseNextResponse } from '../base-http'\nimport type { IncomingHttpHeaders } from 'http'\nimport * as ReactClient from 'react'\n\nimport RenderResult, {\n type AppPageRenderResultMetadata,\n type RenderResultOptions,\n} from '../render-result'\nimport {\n chainStreams,\n renderToInitialFizzStream,\n createDocumentClosingStream,\n continueFizzStream,\n continueDynamicPrerender,\n continueStaticPrerender,\n continueDynamicHTMLResume,\n streamToBuffer,\n streamToString,\n continueStaticFallbackPrerender,\n} from '../stream-utils/node-web-streams-helper'\nimport { stripInternalQueries } from '../internal-utils'\nimport {\n NEXT_HMR_REFRESH_HEADER,\n NEXT_ROUTER_PREFETCH_HEADER,\n NEXT_ROUTER_STATE_TREE_HEADER,\n NEXT_ROUTER_STALE_TIME_HEADER,\n NEXT_URL,\n RSC_HEADER,\n NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,\n NEXT_HMR_REFRESH_HASH_COOKIE,\n NEXT_DID_POSTPONE_HEADER,\n NEXT_REQUEST_ID_HEADER,\n NEXT_HTML_REQUEST_ID_HEADER,\n} from '../../client/components/app-router-headers'\nimport { createMetadataContext } from '../../lib/metadata/metadata-context'\nimport { createRequestStoreForRender } from '../async-storage/request-store'\nimport { createWorkStore } from '../async-storage/work-store'\nimport {\n getAccessFallbackErrorTypeByStatus,\n getAccessFallbackHTTPStatus,\n isHTTPAccessFallbackError,\n} from '../../client/components/http-access-fallback/http-access-fallback'\nimport {\n getURLFromRedirectError,\n getRedirectStatusCodeFromError,\n} from '../../client/components/redirect'\nimport { isRedirectError } from '../../client/components/redirect-error'\nimport { getImplicitTags, type ImplicitTags } from '../lib/implicit-tags'\nimport { AppRenderSpan, NextNodeServerSpan } from '../lib/trace/constants'\nimport { getTracer } from '../lib/trace/tracer'\nimport { FlightRenderResult } from './flight-render-result'\nimport {\n createFlightReactServerErrorHandler,\n createHTMLReactServerErrorHandler,\n createHTMLErrorHandler,\n type DigestedError,\n isUserLandError,\n getDigestForWellKnownError,\n} from './create-error-handler'\nimport { dynamicParamTypes } from './get-short-dynamic-param-type'\nimport { getSegmentParam } from '../../shared/lib/router/utils/get-segment-param'\nimport { getScriptNonceFromHeader } from './get-script-nonce-from-header'\nimport { parseAndValidateFlightRouterState } from './parse-and-validate-flight-router-state'\nimport { createFlightRouterStateFromLoaderTree } from './create-flight-router-state-from-loader-tree'\nimport { handleAction } from './action-handler'\nimport { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr'\nimport { warn, error } from '../../build/output/log'\nimport { appendMutableCookies } from '../web/spec-extension/adapters/request-cookies'\nimport { createServerInsertedHTML } from './server-inserted-html'\nimport { getRequiredScripts } from './required-scripts'\nimport { addPathPrefix } from '../../shared/lib/router/utils/add-path-prefix'\nimport { makeGetServerInsertedHTML } from './make-get-server-inserted-html'\nimport { walkTreeWithFlightRouterState } from './walk-tree-with-flight-router-state'\nimport { createComponentTree, getRootParams } from './create-component-tree'\nimport { getAssetQueryString } from './get-asset-query-string'\nimport {\n getServerModuleMap,\n setReferenceManifestsSingleton,\n} from './encryption-utils'\nimport {\n DynamicState,\n type PostponedState,\n DynamicHTMLPreludeState,\n parsePostponedState,\n} from './postponed-state'\nimport {\n getDynamicDataPostponedState,\n getDynamicHTMLPostponedState,\n getPostponedFromState,\n} from './postponed-state'\nimport { isDynamicServerError } from '../../client/components/hooks-server-context'\nimport {\n useFlightStream,\n createInlinedDataReadableStream,\n} from './use-flight-response'\nimport {\n StaticGenBailoutError,\n isStaticGenBailoutError,\n} from '../../client/components/static-generation-bailout'\nimport { getStackWithoutErrorMessage } from '../../lib/format-server-error'\nimport {\n accessedDynamicData,\n createRenderInBrowserAbortSignal,\n formatDynamicAPIAccesses,\n isPrerenderInterruptedError,\n createDynamicTrackingState,\n createDynamicValidationState,\n trackAllowedDynamicAccess,\n throwIfDisallowedDynamic,\n PreludeState,\n consumeDynamicAccess,\n type DynamicAccess,\n logDisallowedDynamicError,\n} from './dynamic-rendering'\nimport {\n getClientComponentLoaderMetrics,\n wrapClientComponentLoader,\n} from '../client-component-renderer-logger'\nimport { createServerModuleMap } from './action-utils'\nimport { isNodeNextRequest } from '../base-http/helpers'\nimport { parseRelativeUrl } from '../../shared/lib/router/utils/parse-relative-url'\nimport AppRouter from '../../client/components/app-router'\nimport type { ServerComponentsHmrCache } from '../response-cache'\nimport type { RequestErrorContext } from '../instrumentation/types'\nimport { getIsPossibleServerAction } from '../lib/server-action-request-meta'\nimport { createInitialRouterState } from '../../client/components/router-reducer/create-initial-router-state'\nimport { createMutableActionQueue } from '../../client/components/app-router-instance'\nimport { getRevalidateReason } from '../instrumentation/utils'\nimport { PAGE_SEGMENT_KEY } from '../../shared/lib/segment'\nimport type { OpaqueFallbackRouteParams } from '../request/fallback-params'\nimport {\n prerenderAndAbortInSequentialTasksWithStages,\n processPrelude,\n} from './app-render-prerender-utils'\nimport {\n type ReactServerPrerenderResult,\n ReactServerResult,\n createReactServerPrerenderResult,\n createReactServerPrerenderResultFromRender,\n prerenderAndAbortInSequentialTasks,\n} from './app-render-prerender-utils'\nimport { printDebugThrownValueForProspectiveRender } from './prospective-render-utils'\nimport {\n pipelineInSequentialTasks,\n scheduleInSequentialTasks,\n} from './app-render-render-utils'\nimport { waitAtLeastOneReactRenderTask } from '../../lib/scheduler'\nimport {\n workUnitAsyncStorage,\n type PrerenderStore,\n} from './work-unit-async-storage.external'\nimport { consoleAsyncStorage } from './console-async-storage.external'\nimport { CacheSignal } from './cache-signal'\nimport { getTracedMetadata } from '../lib/trace/utils'\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nimport { HTML_CONTENT_TYPE_HEADER, INFINITE_CACHE } from '../../lib/constants'\nimport { createComponentStylesAndScripts } from './create-component-styles-and-scripts'\nimport { parseLoaderTree } from '../../shared/lib/router/utils/parse-loader-tree'\nimport {\n createPrerenderResumeDataCache,\n createRenderResumeDataCache,\n type PrerenderResumeDataCache,\n type RenderResumeDataCache,\n} from '../resume-data-cache/resume-data-cache'\nimport type { MetadataErrorType } from '../../lib/metadata/resolve-metadata'\nimport isError from '../../lib/is-error'\nimport { createServerInsertedMetadata } from './metadata-insertion/create-server-inserted-metadata'\nimport { getPreviouslyRevalidatedTags } from '../server-utils'\nimport { executeRevalidates } from '../revalidation-utils'\nimport {\n trackPendingChunkLoad,\n trackPendingImport,\n trackPendingModules,\n} from './module-loading/track-module-loading.external'\nimport { isReactLargeShellError } from './react-large-shell-error'\nimport type { GlobalErrorComponent } from '../../client/components/builtin/global-error'\nimport { normalizeConventionFilePath } from './segment-explorer-path'\nimport { getRequestMeta } from '../request-meta'\nimport {\n getDynamicParam,\n interpolateParallelRouteParams,\n} from '../../shared/lib/router/utils/get-dynamic-param'\nimport type { ExperimentalConfig } from '../config-shared'\nimport type { Params } from '../request/params'\nimport { createPromiseWithResolvers } from '../../shared/lib/promise-with-resolvers'\nimport { ImageConfigContext } from '../../shared/lib/image-config-context.shared-runtime'\nimport { imageConfigDefault } from '../../shared/lib/image-config'\nimport { RenderStage, StagedRenderingController } from './staged-rendering'\nimport { anySegmentHasRuntimePrefetchEnabled } from './staged-validation'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\n\nexport type GetDynamicParamFromSegment = (\n // [slug] / [[slug]] / [...slug]\n segment: string\n) => DynamicParam | null\n\nexport type DynamicParam = {\n param: string\n value: string | string[] | null\n treeSegment: Segment\n type: DynamicParamTypesShort\n}\n\nexport type GenerateFlight = typeof generateDynamicFlightRenderResult\n\nexport type AppSharedContext = {\n buildId: string\n}\n\nexport type AppRenderContext = {\n sharedContext: AppSharedContext\n workStore: WorkStore\n url: ReturnType<typeof parseRelativeUrl>\n componentMod: AppPageModule\n renderOpts: RenderOpts\n parsedRequestHeaders: ParsedRequestHeaders\n getDynamicParamFromSegment: GetDynamicParamFromSegment\n query: NextParsedUrlQuery\n isPrefetch: boolean\n isPossibleServerAction: boolean\n requestTimestamp: number\n appUsingSizeAdjustment: boolean\n flightRouterState?: FlightRouterState\n requestId: string\n htmlRequestId: string\n pagePath: string\n clientReferenceManifest: DeepReadonly<ClientReferenceManifest>\n assetPrefix: string\n isNotFoundPath: boolean\n nonce: string | undefined\n res: BaseNextResponse\n /**\n * For now, the implicit tags are common for the whole route. If we ever start\n * rendering/revalidating segments independently, they need to move to the\n * work unit store.\n */\n implicitTags: ImplicitTags\n}\n\ninterface ParseRequestHeadersOptions {\n readonly isRoutePPREnabled: boolean\n readonly previewModeId: string | undefined\n}\n\nconst flightDataPathHeadKey = 'h'\nconst getFlightViewportKey = (requestId: string) => requestId + 'v'\nconst getFlightMetadataKey = (requestId: string) => requestId + 'm'\n\nconst filterStackFrame =\n process.env.NODE_ENV !== 'production'\n ? (require('../lib/source-maps') as typeof import('../lib/source-maps'))\n .filterStackFrameDEV\n : undefined\n\ninterface ParsedRequestHeaders {\n /**\n * Router state provided from the client-side router. Used to handle rendering\n * from the common layout down. This value will be undefined if the request is\n * not a client-side navigation request, or if the request is a prefetch\n * request.\n */\n readonly flightRouterState: FlightRouterState | undefined\n readonly isPrefetchRequest: boolean\n readonly isRuntimePrefetchRequest: boolean\n readonly isRouteTreePrefetchRequest: boolean\n readonly isHmrRefresh: boolean\n readonly isRSCRequest: boolean\n readonly nonce: string | undefined\n readonly previouslyRevalidatedTags: string[]\n readonly requestId: string | undefined\n readonly htmlRequestId: string | undefined\n}\n\nfunction parseRequestHeaders(\n headers: IncomingHttpHeaders,\n options: ParseRequestHeadersOptions\n): ParsedRequestHeaders {\n // runtime prefetch requests are *not* treated as prefetch requests\n // (TODO: this is confusing, we should refactor this to express this better)\n const isPrefetchRequest = headers[NEXT_ROUTER_PREFETCH_HEADER] === '1'\n\n const isRuntimePrefetchRequest = headers[NEXT_ROUTER_PREFETCH_HEADER] === '2'\n\n const isHmrRefresh = headers[NEXT_HMR_REFRESH_HEADER] !== undefined\n\n const isRSCRequest = headers[RSC_HEADER] !== undefined\n\n const shouldProvideFlightRouterState =\n isRSCRequest && (!isPrefetchRequest || !options.isRoutePPREnabled)\n\n const flightRouterState = shouldProvideFlightRouterState\n ? parseAndValidateFlightRouterState(headers[NEXT_ROUTER_STATE_TREE_HEADER])\n : undefined\n\n // Checks if this is a prefetch of the Route Tree by the Segment Cache\n const isRouteTreePrefetchRequest =\n headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER] === '/_tree'\n\n const csp =\n headers['content-security-policy'] ||\n headers['content-security-policy-report-only']\n\n const nonce =\n typeof csp === 'string' ? getScriptNonceFromHeader(csp) : undefined\n\n const previouslyRevalidatedTags = getPreviouslyRevalidatedTags(\n headers,\n options.previewModeId\n )\n\n let requestId: string | undefined\n let htmlRequestId: string | undefined\n\n if (process.env.NODE_ENV !== 'production') {\n // The request IDs are only used in development mode to send debug\n // information to the matching client (identified by the HTML request ID\n // that was sent to the client with the HTML document) for the current\n // request (identified by the request ID, as defined by the client).\n\n requestId =\n typeof headers[NEXT_REQUEST_ID_HEADER] === 'string'\n ? headers[NEXT_REQUEST_ID_HEADER]\n : undefined\n\n htmlRequestId =\n typeof headers[NEXT_HTML_REQUEST_ID_HEADER] === 'string'\n ? headers[NEXT_HTML_REQUEST_ID_HEADER]\n : undefined\n }\n\n return {\n flightRouterState,\n isPrefetchRequest,\n isRuntimePrefetchRequest,\n isRouteTreePrefetchRequest,\n isHmrRefresh,\n isRSCRequest,\n nonce,\n previouslyRevalidatedTags,\n requestId,\n htmlRequestId,\n }\n}\n\nfunction createNotFoundLoaderTree(loaderTree: LoaderTree): LoaderTree {\n const components = loaderTree[2]\n const hasGlobalNotFound = !!components['global-not-found']\n const notFoundTreeComponents: LoaderTree[2] = hasGlobalNotFound\n ? {\n layout: components['global-not-found']!,\n page: [() => null, 'next/dist/client/components/builtin/empty-stub'],\n }\n : {\n page: components['not-found'],\n }\n\n return [\n '',\n {\n children: [PAGE_SEGMENT_KEY, {}, notFoundTreeComponents],\n },\n // When global-not-found is present, skip layout from components\n hasGlobalNotFound ? components : {},\n ]\n}\n\n/**\n * Returns a function that parses the dynamic segment and return the associated value.\n */\nfunction makeGetDynamicParamFromSegment(\n interpolatedParams: Params,\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n): GetDynamicParamFromSegment {\n return function getDynamicParamFromSegment(\n // [slug] / [[slug]] / [...slug]\n segment: string\n ) {\n const segmentParam = getSegmentParam(segment)\n if (!segmentParam) {\n return null\n }\n const segmentKey = segmentParam.param\n const dynamicParamType = dynamicParamTypes[segmentParam.type]\n return getDynamicParam(\n interpolatedParams,\n segmentKey,\n dynamicParamType,\n fallbackRouteParams\n )\n }\n}\n\nfunction NonIndex({\n createElement,\n pagePath,\n statusCode,\n isPossibleServerAction,\n}: {\n createElement: typeof ReactClient.createElement\n pagePath: string\n statusCode: number | undefined\n isPossibleServerAction: boolean\n}) {\n const is404Page = pagePath === '/404'\n const isInvalidStatusCode = typeof statusCode === 'number' && statusCode > 400\n\n // Only render noindex for page request, skip for server actions\n // TODO: is this correct if `isPossibleServerAction` is a false positive?\n if (!isPossibleServerAction && (is404Page || isInvalidStatusCode)) {\n return createElement('meta', {\n name: 'robots',\n content: 'noindex',\n })\n }\n return null\n}\n\n/**\n * This is used by server actions & client-side navigations to generate RSC data from a client-side request.\n * This function is only called on \"dynamic\" requests (ie, there wasn't already a static response).\n * It uses request headers (namely `next-router-state-tree`) to determine where to start rendering.\n */\nasync function generateDynamicRSCPayload(\n ctx: AppRenderContext,\n options?: {\n actionResult: ActionResult\n skipFlight: boolean\n }\n): Promise<RSCPayload> {\n // Flight data that is going to be passed to the browser.\n // Currently a single item array but in the future multiple patches might be combined in a single request.\n\n // We initialize `flightData` to an empty string because the client router knows how to tolerate\n // it (treating it as an MPA navigation). The only time this function wouldn't generate flight data\n // is for server actions, if the server action handler instructs this function to skip it. When the server\n // action reducer sees a falsy value, it'll simply resolve the action with no data.\n let flightData: FlightData = ''\n\n const {\n componentMod: {\n routeModule: {\n userland: { loaderTree },\n },\n createElement,\n createMetadataComponents,\n Fragment,\n },\n getDynamicParamFromSegment,\n query,\n requestId,\n flightRouterState,\n workStore,\n url,\n } = ctx\n\n const serveStreamingMetadata = !!ctx.renderOpts.serveStreamingMetadata\n\n if (!options?.skipFlight) {\n const preloadCallbacks: PreloadCallbacks = []\n\n const { Viewport, Metadata, MetadataOutlet } = createMetadataComponents({\n tree: loaderTree,\n parsedQuery: query,\n pathname: url.pathname,\n metadataContext: createMetadataContext(ctx.renderOpts),\n getDynamicParamFromSegment,\n workStore,\n serveStreamingMetadata,\n })\n\n flightData = (\n await walkTreeWithFlightRouterState({\n ctx,\n loaderTreeToFilter: loaderTree,\n parentParams: {},\n flightRouterState,\n // For flight, render metadata inside leaf page\n rscHead: createElement(\n Fragment,\n {\n key: flightDataPathHeadKey,\n },\n createElement(NonIndex, {\n createElement,\n pagePath: ctx.pagePath,\n statusCode: ctx.res.statusCode,\n isPossibleServerAction: ctx.isPossibleServerAction,\n }),\n createElement(Viewport, {\n key: getFlightViewportKey(requestId),\n }),\n createElement(Metadata, {\n key: getFlightMetadataKey(requestId),\n })\n ),\n injectedCSS: new Set(),\n injectedJS: new Set(),\n injectedFontPreloadTags: new Set(),\n rootLayoutIncluded: false,\n preloadCallbacks,\n MetadataOutlet,\n })\n ).map((path) => path.slice(1)) // remove the '' (root) segment\n }\n\n // If we have an action result, then this is a server action response.\n // We can rely on this because `ActionResult` will always be a promise, even if\n // the result is falsey.\n if (options?.actionResult) {\n return {\n a: options.actionResult,\n f: flightData,\n b: ctx.sharedContext.buildId,\n }\n }\n\n // Otherwise, it's a regular RSC response.\n return {\n b: ctx.sharedContext.buildId,\n f: flightData,\n S: workStore.isStaticGeneration,\n }\n}\n\nfunction createErrorContext(\n ctx: AppRenderContext,\n renderSource: RequestErrorContext['renderSource']\n): RequestErrorContext {\n return {\n routerKind: 'App Router',\n routePath: ctx.pagePath,\n // TODO: is this correct if `isPossibleServerAction` is a false positive?\n routeType: ctx.isPossibleServerAction ? 'action' : 'render',\n renderSource,\n revalidateReason: getRevalidateReason(ctx.workStore),\n }\n}\n\n/**\n * Produces a RenderResult containing the Flight data for the given request. See\n * `generateDynamicRSCPayload` for information on the contents of the render result.\n */\nasync function generateDynamicFlightRenderResult(\n req: BaseNextRequest,\n ctx: AppRenderContext,\n requestStore: RequestStore,\n options?: {\n actionResult: ActionResult\n skipFlight: boolean\n componentTree?: CacheNodeSeedData\n preloadCallbacks?: PreloadCallbacks\n temporaryReferences?: WeakMap<any, string>\n }\n): Promise<RenderResult> {\n const {\n clientReferenceManifest,\n componentMod: { renderToReadableStream },\n htmlRequestId,\n renderOpts,\n requestId,\n workStore,\n } = ctx\n\n const {\n dev = false,\n onInstrumentationRequestError,\n setReactDebugChannel,\n } = renderOpts\n\n function onFlightDataRenderError(err: DigestedError) {\n return onInstrumentationRequestError?.(\n err,\n req,\n createErrorContext(ctx, 'react-server-components-payload')\n )\n }\n const onError = createFlightReactServerErrorHandler(\n dev,\n onFlightDataRenderError\n )\n\n const debugChannel = setReactDebugChannel && createDebugChannel()\n\n if (debugChannel) {\n setReactDebugChannel(debugChannel.clientSide, htmlRequestId, requestId)\n }\n\n // For app dir, use the bundled version of Flight server renderer (renderToReadableStream)\n // which contains the subset React.\n const rscPayload = await workUnitAsyncStorage.run(\n requestStore,\n generateDynamicRSCPayload,\n ctx,\n options\n )\n\n const flightReadableStream = workUnitAsyncStorage.run(\n requestStore,\n renderToReadableStream,\n rscPayload,\n clientReferenceManifest.clientModules,\n {\n onError,\n temporaryReferences: options?.temporaryReferences,\n filterStackFrame,\n debugChannel: debugChannel?.serverSide,\n }\n )\n\n return new FlightRenderResult(flightReadableStream, {\n fetchMetrics: workStore.fetchMetrics,\n })\n}\n\ntype RenderToReadableStreamServerOptions = NonNullable<\n Parameters<\n (typeof import('react-server-dom-webpack/server.node'))['renderToReadableStream']\n >[2]\n>\n\nasync function stagedRenderToReadableStreamWithoutCachesInDev(\n ctx: AppRenderContext,\n requestStore: RequestStore,\n getPayload: (requestStore: RequestStore) => Promise<RSCPayload>,\n clientReferenceManifest: NonNullable<RenderOpts['clientReferenceManifest']>,\n options: Omit<RenderToReadableStreamServerOptions, 'environmentName'>\n) {\n const {\n componentMod: { renderToReadableStream },\n } = ctx\n // We're rendering while bypassing caches,\n // so we have no hope of showing a useful runtime stage.\n // But we still want things like `params` to show up in devtools correctly,\n // which relies on mechanisms we've set up for staged rendering,\n // so we do a 2-task version (Static -> Dynamic) instead.\n\n const stageController = new StagedRenderingController()\n const environmentName = () => {\n const currentStage = stageController.currentStage\n switch (currentStage) {\n case RenderStage.Static:\n return 'Prerender'\n case RenderStage.Runtime:\n case RenderStage.Dynamic:\n return 'Server'\n default:\n currentStage satisfies never\n throw new InvariantError(`Invalid render stage: ${currentStage}`)\n }\n }\n\n requestStore.stagedRendering = stageController\n requestStore.asyncApiPromises = createAsyncApiPromisesInDev(\n stageController,\n requestStore.cookies,\n requestStore.mutableCookies,\n requestStore.headers\n )\n\n const rscPayload = await getPayload(requestStore)\n\n return await workUnitAsyncStorage.run(\n requestStore,\n scheduleInSequentialTasks,\n () => {\n return renderToReadableStream(\n rscPayload,\n clientReferenceManifest.clientModules,\n {\n ...options,\n environmentName,\n }\n )\n },\n () => {\n stageController.advanceStage(RenderStage.Dynamic)\n }\n )\n}\n\n/**\n * Fork of `generateDynamicFlightRenderResult` that renders using `renderWithRestartOnCacheMissInDev`\n * to ensure correct separation of environments Prerender/Server (for use in Cache Components)\n */\nasync function generateDynamicFlightRenderResultWithStagesInDev(\n req: BaseNextRequest,\n ctx: AppRenderContext,\n initialRequestStore: RequestStore,\n createRequestStore: (() => RequestStore) | undefined\n): Promise<RenderResult> {\n const {\n htmlRequestId,\n renderOpts,\n requestId,\n workStore,\n componentMod: { createElement },\n } = ctx\n\n const {\n dev = false,\n onInstrumentationRequestError,\n setReactDebugChannel,\n setCacheStatus,\n clientReferenceManifest,\n } = renderOpts\n\n function onFlightDataRenderError(err: DigestedError) {\n return onInstrumentationRequestError?.(\n err,\n req,\n createErrorContext(ctx, 'react-server-components-payload')\n )\n }\n const onError = createFlightReactServerErrorHandler(\n dev,\n onFlightDataRenderError\n )\n\n const getPayload = async (requestStore: RequestStore) => {\n const payload: RSCPayload & RSCPayloadDevProperties =\n await workUnitAsyncStorage.run(\n requestStore,\n generateDynamicRSCPayload,\n ctx,\n undefined\n )\n\n if (isBypassingCachesInDev(renderOpts, requestStore)) {\n // Mark the RSC payload to indicate that caches were bypassed in dev.\n // This lets the client know not to cache anything based on this render.\n payload._bypassCachesInDev = createElement(WarnForBypassCachesInDev, {\n route: workStore.route,\n })\n }\n\n return payload\n }\n\n let debugChannel: DebugChannelPair | undefined\n let stream: ReadableStream<Uint8Array>\n\n if (\n // We only do this flow if we can safely recreate the store from scratch\n // (which is not the case for renders after an action)\n createRequestStore &&\n // We only do this flow if we're not bypassing caches in dev using\n // \"disable cache\" in devtools or a hard refresh (cache-control: \"no-store\")\n !isBypassingCachesInDev(renderOpts, initialRequestStore)\n ) {\n // Before we kick off the render, we set the cache status back to it's initial state\n // in case a previous render bypassed the cache.\n if (setCacheStatus) {\n setCacheStatus('ready', htmlRequestId, requestId)\n }\n\n const result = await renderWithRestartOnCacheMissInDev(\n ctx,\n initialRequestStore,\n createRequestStore,\n getPayload,\n onError\n )\n debugChannel = result.debugChannel\n stream = result.stream\n } else {\n // We're either bypassing caches or we can't restart the render.\n // Do a dynamic render, but with (basic) environment labels.\n\n assertClientReferenceManifest(clientReferenceManifest)\n\n // Set cache status to bypass when specifically bypassing caches in dev\n if (setCacheStatus) {\n setCacheStatus('bypass', htmlRequestId, requestId)\n }\n\n debugChannel = setReactDebugChannel && createDebugChannel()\n\n stream = await stagedRenderToReadableStreamWithoutCachesInDev(\n ctx,\n initialRequestStore,\n getPayload,\n clientReferenceManifest,\n {\n onError: onError,\n filterStackFrame,\n debugChannel: debugChannel?.serverSide,\n }\n )\n }\n\n if (debugChannel && setReactDebugChannel) {\n setReactDebugChannel(debugChannel.clientSide, htmlRequestId, requestId)\n }\n\n return new FlightRenderResult(stream, {\n fetchMetrics: workStore.fetchMetrics,\n })\n}\n\nasync function generateRuntimePrefetchResult(\n req: BaseNextRequest,\n res: BaseNextResponse,\n ctx: AppRenderContext,\n requestStore: RequestStore\n): Promise<RenderResult> {\n const { workStore } = ctx\n const renderOpts = ctx.renderOpts\n\n function onFlightDataRenderError(err: DigestedError) {\n return renderOpts.onInstrumentationRequestError?.(\n err,\n req,\n // TODO(runtime-ppr): should we use a different value?\n createErrorContext(ctx, 'react-server-components-payload')\n )\n }\n const onError = createFlightReactServerErrorHandler(\n false,\n onFlightDataRenderError\n )\n\n const metadata: AppPageRenderResultMetadata = {}\n\n const generatePayload = () => generateDynamicRSCPayload(ctx, undefined)\n\n const {\n componentMod: {\n routeModule: {\n userland: { loaderTree },\n },\n },\n getDynamicParamFromSegment,\n } = ctx\n const rootParams = getRootParams(loaderTree, getDynamicParamFromSegment)\n\n // We need to share caches between the prospective prerender and the final prerender,\n // but we're not going to persist this anywhere.\n const prerenderResumeDataCache = createPrerenderResumeDataCache()\n // We're not resuming an existing render.\n const renderResumeDataCache = null\n\n await prospectiveRuntimeServerPrerender(\n ctx,\n generatePayload,\n prerenderResumeDataCache,\n renderResumeDataCache,\n rootParams,\n requestStore.headers,\n requestStore.cookies,\n requestStore.draftMode\n )\n\n const response = await finalRuntimeServerPrerender(\n ctx,\n generatePayload,\n prerenderResumeDataCache,\n renderResumeDataCache,\n rootParams,\n requestStore.headers,\n requestStore.cookies,\n requestStore.draftMode,\n onError\n )\n\n applyMetadataFromPrerenderResult(response, metadata, workStore)\n metadata.fetchMetrics = ctx.workStore.fetchMetrics\n\n if (response.isPartial) {\n res.setHeader(NEXT_DID_POSTPONE_HEADER, '1')\n }\n\n return new FlightRenderResult(response.result.prelude, metadata)\n}\n\nasync function prospectiveRuntimeServerPrerender(\n ctx: AppRenderContext,\n getPayload: () => any,\n prerenderResumeDataCache: PrerenderResumeDataCache | null,\n renderResumeDataCache: RenderResumeDataCache | null,\n rootParams: Params,\n headers: PrerenderStoreModernRuntime['headers'],\n cookies: PrerenderStoreModernRuntime['cookies'],\n draftMode: PrerenderStoreModernRuntime['draftMode']\n) {\n const { implicitTags, renderOpts, workStore } = ctx\n\n const { clientReferenceManifest, ComponentMod } = renderOpts\n\n assertClientReferenceManifest(clientReferenceManifest)\n\n // Prerender controller represents the lifetime of the prerender.\n // It will be aborted when a Task is complete or a synchronously aborting\n // API is called. Notably during cache-filling renders this does not actually\n // terminate the render itself which will continue until all caches are filled\n const initialServerPrerenderController = new AbortController()\n\n // This controller represents the lifetime of the React render call. Notably\n // during the cache-filling render it is different from the prerender controller\n // because we don't want to end the react render until all caches are filled.\n const initialServerRenderController = new AbortController()\n\n // The cacheSignal helps us track whether caches are still filling or we are ready\n // to cut the render off.\n const cacheSignal = new CacheSignal()\n\n const initialServerPrerenderStore: PrerenderStoreModernRuntime = {\n type: 'prerender-runtime',\n phase: 'render',\n rootParams,\n implicitTags,\n renderSignal: initialServerRenderController.signal,\n controller: initialServerPrerenderController,\n // During the initial prerender we need to track all cache reads to ensure\n // we render long enough to fill every cache it is possible to visit during\n // the final prerender.\n cacheSignal,\n // We only need to track dynamic accesses during the final prerender.\n dynamicTracking: null,\n // Runtime prefetches are never cached server-side, only client-side,\n // so we set `expire` and `revalidate` to their minimum values just in case.\n revalidate: 1,\n expire: 0,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n renderResumeDataCache,\n prerenderResumeDataCache,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined,\n // We only need task sequencing in the final prerender.\n runtimeStagePromise: null,\n // These are not present in regular prerenders, but allowed in a runtime prerender.\n headers,\n cookies,\n draftMode,\n }\n\n // We're not going to use the result of this render because the only time it could be used\n // is if it completes in a microtask and that's likely very rare for any non-trivial app\n const initialServerPayload = await workUnitAsyncStorage.run(\n initialServerPrerenderStore,\n getPayload\n )\n\n const pendingInitialServerResult = workUnitAsyncStorage.run(\n initialServerPrerenderStore,\n ComponentMod.prerender,\n initialServerPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: (err) => {\n const digest = getDigestForWellKnownError(err)\n\n if (digest) {\n return digest\n }\n\n if (initialServerPrerenderController.signal.aborted) {\n // The render aborted before this error was handled which indicates\n // the error is caused by unfinished components within the render\n return\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n },\n // we don't care to track postpones during the prospective render because we need\n // to always do a final render anyway\n onPostpone: undefined,\n // We don't want to stop rendering until the cacheSignal is complete so we pass\n // a different signal to this render call than is used by dynamic APIs to signify\n // transitioning out of the prerender environment\n signal: initialServerRenderController.signal,\n }\n )\n\n // Wait for all caches to be finished filling and for async imports to resolve\n trackPendingModules(cacheSignal)\n await cacheSignal.cacheReady()\n\n initialServerRenderController.abort()\n initialServerPrerenderController.abort()\n\n // We don't need to continue the prerender process if we already\n // detected invalid dynamic usage in the initial prerender phase.\n if (workStore.invalidDynamicUsageError) {\n throw workStore.invalidDynamicUsageError\n }\n\n try {\n return await createReactServerPrerenderResult(pendingInitialServerResult)\n } catch (err) {\n if (\n initialServerRenderController.signal.aborted ||\n initialServerPrerenderController.signal.aborted\n ) {\n // These are expected errors that might error the prerender. we ignore them.\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n // We don't normally log these errors because we are going to retry anyway but\n // it can be useful for debugging Next.js itself to get visibility here when needed\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n return null\n }\n}\n\nasync function finalRuntimeServerPrerender(\n ctx: AppRenderContext,\n getPayload: () => any,\n prerenderResumeDataCache: PrerenderResumeDataCache | null,\n renderResumeDataCache: RenderResumeDataCache | null,\n rootParams: Params,\n headers: PrerenderStoreModernRuntime['headers'],\n cookies: PrerenderStoreModernRuntime['cookies'],\n draftMode: PrerenderStoreModernRuntime['draftMode'],\n onError: (err: unknown) => string | undefined\n) {\n const { implicitTags, renderOpts } = ctx\n\n const {\n clientReferenceManifest,\n ComponentMod,\n experimental,\n isDebugDynamicAccesses,\n } = renderOpts\n\n assertClientReferenceManifest(clientReferenceManifest)\n\n const selectStaleTime = createSelectStaleTime(experimental)\n\n let serverIsDynamic = false\n const finalServerController = new AbortController()\n\n const serverDynamicTracking = createDynamicTrackingState(\n isDebugDynamicAccesses\n )\n\n const { promise: runtimeStagePromise, resolve: resolveBlockedRuntimeAPIs } =\n createPromiseWithResolvers<void>()\n\n const finalServerPrerenderStore: PrerenderStoreModernRuntime = {\n type: 'prerender-runtime',\n phase: 'render',\n rootParams,\n implicitTags,\n renderSignal: finalServerController.signal,\n controller: finalServerController,\n // All caches we could read must already be filled so no tracking is necessary\n cacheSignal: null,\n dynamicTracking: serverDynamicTracking,\n // Runtime prefetches are never cached server-side, only client-side,\n // so we set `expire` and `revalidate` to their minimum values just in case.\n revalidate: 1,\n expire: 0,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined,\n // Used to separate the \"Static\" stage from the \"Runtime\" stage.\n runtimeStagePromise,\n // These are not present in regular prerenders, but allowed in a runtime prerender.\n headers,\n cookies,\n draftMode,\n }\n\n const finalRSCPayload = await workUnitAsyncStorage.run(\n finalServerPrerenderStore,\n getPayload\n )\n\n let prerenderIsPending = true\n const result = await prerenderAndAbortInSequentialTasksWithStages(\n async () => {\n // Static stage\n const prerenderResult = await workUnitAsyncStorage.run(\n finalServerPrerenderStore,\n ComponentMod.prerender,\n finalRSCPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError,\n signal: finalServerController.signal,\n }\n )\n prerenderIsPending = false\n return prerenderResult\n },\n () => {\n // Advance to the runtime stage.\n //\n // We make runtime APIs hang during the first task (above), and unblock them in the following task (here).\n // This makes sure that, at this point, we'll have finished all the static parts (what we'd prerender statically).\n // We know that they don't contain any incorrect sync IO, because that'd have caused a build error.\n // After we unblock Runtime APIs, if we encounter sync IO (e.g. `await cookies(); Date.now()`),\n // we'll abort, but we'll produce at least as much output as a static prerender would.\n resolveBlockedRuntimeAPIs()\n },\n () => {\n // Abort.\n if (finalServerController.signal.aborted) {\n // If the server controller is already aborted we must have called something\n // that required aborting the prerender synchronously such as with new Date()\n serverIsDynamic = true\n return\n }\n\n if (prerenderIsPending) {\n // If prerenderIsPending then we have blocked for longer than a Task and we assume\n // there is something unfinished.\n serverIsDynamic = true\n }\n finalServerController.abort()\n }\n )\n\n return {\n result,\n // TODO(runtime-ppr): do we need to produce a digest map here?\n // digestErrorsMap: ...,\n dynamicAccess: serverDynamicTracking,\n isPartial: serverIsDynamic,\n collectedRevalidate: finalServerPrerenderStore.revalidate,\n collectedExpire: finalServerPrerenderStore.expire,\n collectedStale: selectStaleTime(finalServerPrerenderStore.stale),\n collectedTags: finalServerPrerenderStore.tags,\n }\n}\n\n/**\n * Crawlers will inadvertently think the canonicalUrl in the RSC payload should be crawled\n * when our intention is to just seed the router state with the current URL.\n * This function splits up the pathname so that we can later join it on\n * when we're ready to consume the path.\n */\nfunction prepareInitialCanonicalUrl(url: RequestStore['url']) {\n return (url.pathname + url.search).split('/')\n}\n\nfunction getRenderedSearch(query: NextParsedUrlQuery): string {\n // Inlined implementation of querystring.encode, which is not available in\n // the Edge runtime.\n const pairs = []\n for (const key in query) {\n const value = query[key]\n if (value == null) continue\n if (Array.isArray(value)) {\n for (const v of value) {\n pairs.push(\n `${encodeURIComponent(key)}=${encodeURIComponent(String(v))}`\n )\n }\n } else {\n pairs.push(\n `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`\n )\n }\n }\n\n // The result should match the format of a web URL's `search` property, since\n // this is the format that's stored in the App Router state.\n // TODO: We're a bit inconsistent about this. The x-nextjs-rewritten-query\n // header omits the leading question mark. Should refactor to always do\n // that instead.\n if (pairs.length === 0) {\n // If the search string is empty, return an empty string.\n return ''\n }\n // Prepend '?' to the search params string.\n return '?' + pairs.join('&')\n}\n\n// This is the data necessary to render <AppRouter /> when no SSR errors are encountered\nasync function getRSCPayload(\n tree: LoaderTree,\n ctx: AppRenderContext,\n is404: boolean\n): Promise<InitialRSCPayload & { P: ReactNode }> {\n const injectedCSS = new Set<string>()\n const injectedJS = new Set<string>()\n const injectedFontPreloadTags = new Set<string>()\n let missingSlots: Set<string> | undefined\n\n // We only track missing parallel slots in development\n if (process.env.NODE_ENV === 'development') {\n missingSlots = new Set<string>()\n }\n\n const {\n getDynamicParamFromSegment,\n query,\n appUsingSizeAdjustment,\n componentMod: { createMetadataComponents, createElement, Fragment },\n url,\n workStore,\n } = ctx\n\n const initialTree = createFlightRouterStateFromLoaderTree(\n tree,\n getDynamicParamFromSegment,\n query\n )\n const serveStreamingMetadata = !!ctx.renderOpts.serveStreamingMetadata\n const hasGlobalNotFound = !!tree[2]['global-not-found']\n\n const { Viewport, Metadata, MetadataOutlet } = createMetadataComponents({\n tree,\n // When it's using global-not-found, metadata errorType is undefined, which will retrieve the\n // metadata from the page.\n // When it's using not-found, metadata errorType is 'not-found', which will retrieve the\n // metadata from the not-found.js boundary.\n // TODO: remove this condition and keep it undefined when global-not-found is stabilized.\n errorType: is404 && !hasGlobalNotFound ? 'not-found' : undefined,\n parsedQuery: query,\n pathname: url.pathname,\n metadataContext: createMetadataContext(ctx.renderOpts),\n getDynamicParamFromSegment,\n workStore,\n serveStreamingMetadata,\n })\n\n const preloadCallbacks: PreloadCallbacks = []\n\n const seedData = await createComponentTree({\n ctx,\n loaderTree: tree,\n parentParams: {},\n injectedCSS,\n injectedJS,\n injectedFontPreloadTags,\n rootLayoutIncluded: false,\n missingSlots,\n preloadCallbacks,\n authInterrupts: ctx.renderOpts.experimental.authInterrupts,\n MetadataOutlet,\n })\n\n // When the `vary` response header is present with `Next-URL`, that means there's a chance\n // it could respond differently if there's an interception route. We provide this information\n // to `AppRouter` so that it can properly seed the prefetch cache with a prefix, if needed.\n const varyHeader = ctx.res.getHeader('vary')\n const couldBeIntercepted =\n typeof varyHeader === 'string' && varyHeader.includes(NEXT_URL)\n\n const initialHead = createElement(\n Fragment,\n {\n key: flightDataPathHeadKey,\n },\n createElement(NonIndex, {\n createElement,\n pagePath: ctx.pagePath,\n statusCode: ctx.res.statusCode,\n isPossibleServerAction: ctx.isPossibleServerAction,\n }),\n createElement(Viewport, null),\n createElement(Metadata, null),\n appUsingSizeAdjustment\n ? createElement('meta', {\n name: 'next-size-adjust',\n content: '',\n })\n : null\n )\n\n const { GlobalError, styles: globalErrorStyles } = await getGlobalErrorStyles(\n tree,\n ctx\n )\n\n // Assume the head we're rendering contains only partial data if PPR is\n // enabled and this is a statically generated response. This is used by the\n // client Segment Cache after a prefetch to determine if it can skip the\n // second request to fill in the dynamic data.\n //\n // See similar comment in create-component-tree.tsx for more context.\n const isPossiblyPartialHead =\n workStore.isStaticGeneration &&\n ctx.renderOpts.experimental.isRoutePPREnabled === true\n\n return {\n // See the comment above the `Preloads` component (below) for why this is part of the payload\n P: createElement(Preloads, {\n preloadCallbacks: preloadCallbacks,\n }),\n b: ctx.sharedContext.buildId,\n c: prepareInitialCanonicalUrl(url),\n q: getRenderedSearch(query),\n i: !!couldBeIntercepted,\n f: [\n [\n initialTree,\n seedData,\n initialHead,\n isPossiblyPartialHead,\n ] as FlightDataPath,\n ],\n m: missingSlots,\n G: [GlobalError, globalErrorStyles],\n s: typeof ctx.renderOpts.postponed === 'string',\n S: workStore.isStaticGeneration,\n }\n}\n\n/**\n * Preload calls (such as `ReactDOM.preloadStyle` and `ReactDOM.preloadFont`) need to be called during rendering\n * in order to create the appropriate preload tags in the DOM, otherwise they're a no-op. Since we invoke\n * renderToReadableStream with a function that returns component props rather than a component itself, we use\n * this component to \"render \" the preload calls.\n */\nfunction Preloads({ preloadCallbacks }: { preloadCallbacks: Function[] }) {\n preloadCallbacks.forEach((preloadFn) => preloadFn())\n return null\n}\n\n// This is the data necessary to render <AppRouter /> when an error state is triggered\nasync function getErrorRSCPayload(\n tree: LoaderTree,\n ctx: AppRenderContext,\n ssrError: unknown,\n errorType: MetadataErrorType | 'redirect' | undefined\n) {\n const {\n getDynamicParamFromSegment,\n query,\n componentMod: { createMetadataComponents, createElement, Fragment },\n url,\n workStore,\n } = ctx\n\n const serveStreamingMetadata = !!ctx.renderOpts.serveStreamingMetadata\n const { Viewport, Metadata } = createMetadataComponents({\n tree,\n parsedQuery: query,\n pathname: url.pathname,\n metadataContext: createMetadataContext(ctx.renderOpts),\n errorType,\n getDynamicParamFromSegment,\n workStore,\n serveStreamingMetadata: serveStreamingMetadata,\n })\n\n const initialHead = createElement(\n Fragment,\n {\n key: flightDataPathHeadKey,\n },\n createElement(NonIndex, {\n createElement,\n pagePath: ctx.pagePath,\n statusCode: ctx.res.statusCode,\n isPossibleServerAction: ctx.isPossibleServerAction,\n }),\n createElement(Viewport, null),\n process.env.NODE_ENV === 'development' &&\n createElement('meta', {\n name: 'next-error',\n content: 'not-found',\n }),\n createElement(Metadata, null)\n )\n\n const initialTree = createFlightRouterStateFromLoaderTree(\n tree,\n getDynamicParamFromSegment,\n query\n )\n\n let err: Error | undefined = undefined\n if (ssrError) {\n err = isError(ssrError) ? ssrError : new Error(ssrError + '')\n }\n\n // For metadata notFound error there's no global not found boundary on top\n // so we create a not found page with AppRouter\n const seedData: CacheNodeSeedData = [\n createElement(\n 'html',\n {\n id: '__next_error__',\n },\n createElement('head', null),\n createElement(\n 'body',\n null,\n process.env.NODE_ENV !== 'production' && err\n ? createElement('template', {\n 'data-next-error-message': err.message,\n 'data-next-error-digest': 'digest' in err ? err.digest : '',\n 'data-next-error-stack': err.stack,\n })\n : null\n )\n ),\n {},\n null,\n false,\n false, // We don't currently support runtime prefetching for error pages.\n ]\n\n const { GlobalError, styles: globalErrorStyles } = await getGlobalErrorStyles(\n tree,\n ctx\n )\n\n const isPossiblyPartialHead =\n workStore.isStaticGeneration &&\n ctx.renderOpts.experimental.isRoutePPREnabled === true\n\n return {\n b: ctx.sharedContext.buildId,\n c: prepareInitialCanonicalUrl(url),\n q: getRenderedSearch(query),\n m: undefined,\n i: false,\n f: [\n [\n initialTree,\n seedData,\n initialHead,\n isPossiblyPartialHead,\n ] as FlightDataPath,\n ],\n G: [GlobalError, globalErrorStyles],\n s: typeof ctx.renderOpts.postponed === 'string',\n S: workStore.isStaticGeneration,\n } satisfies InitialRSCPayload\n}\n\nfunction assertClientReferenceManifest(\n clientReferenceManifest: RenderOpts['clientReferenceManifest']\n): asserts clientReferenceManifest is NonNullable<\n RenderOpts['clientReferenceManifest']\n> {\n if (!clientReferenceManifest) {\n throw new InvariantError('Expected clientReferenceManifest to be defined.')\n }\n}\n\n// This component must run in an SSR context. It will render the RSC root component\nfunction App<T>({\n reactServerStream,\n reactDebugStream,\n preinitScripts,\n clientReferenceManifest,\n ServerInsertedHTMLProvider,\n nonce,\n images,\n}: {\n /* eslint-disable @next/internal/no-ambiguous-jsx -- React Client */\n reactServerStream: BinaryStreamOf<T>\n reactDebugStream: ReadableStream<Uint8Array> | undefined\n preinitScripts: () => void\n clientReferenceManifest: NonNullable<RenderOpts['clientReferenceManifest']>\n ServerInsertedHTMLProvider: ComponentType<{\n children: JSX.Element\n }>\n images: RenderOpts['images']\n nonce?: string\n}): JSX.Element {\n preinitScripts()\n const response = ReactClient.use(\n useFlightStream<InitialRSCPayload>(\n reactServerStream,\n reactDebugStream,\n clientReferenceManifest,\n nonce\n )\n )\n\n const initialState = createInitialRouterState({\n // This is not used during hydration, so we don't have to pass a\n // real timestamp.\n navigatedAt: -1,\n initialFlightData: response.f,\n initialCanonicalUrlParts: response.c,\n initialRenderedSearch: response.q,\n initialParallelRoutes: new Map(),\n // location is not initialized in the SSR render\n // it's set to window.location during hydration\n location: null,\n })\n\n const actionQueue = createMutableActionQueue(initialState, null)\n\n const { HeadManagerContext } =\n require('../../shared/lib/head-manager-context.shared-runtime') as typeof import('../../shared/lib/head-manager-context.shared-runtime')\n\n return (\n <HeadManagerContext.Provider\n value={{\n appDir: true,\n nonce,\n }}\n >\n <ImageConfigContext.Provider value={images ?? imageConfigDefault}>\n <ServerInsertedHTMLProvider>\n <AppRouter actionQueue={actionQueue} globalErrorState={response.G} />\n </ServerInsertedHTMLProvider>\n </ImageConfigContext.Provider>\n </HeadManagerContext.Provider>\n )\n /* eslint-enable @next/internal/no-ambiguous-jsx -- React Client */\n}\n\n// @TODO our error stream should be probably just use the same root component. But it was previously\n// different I don't want to figure out if that is meaningful at this time so just keeping the behavior\n// consistent for now.\nfunction ErrorApp<T>({\n reactServerStream,\n reactDebugStream,\n preinitScripts,\n clientReferenceManifest,\n ServerInsertedHTMLProvider,\n nonce,\n images,\n}: {\n reactServerStream: BinaryStreamOf<T>\n reactDebugStream: ReadableStream<Uint8Array> | undefined\n preinitScripts: () => void\n clientReferenceManifest: NonNullable<RenderOpts['clientReferenceManifest']>\n ServerInsertedHTMLProvider: ComponentType<{\n children: JSX.Element\n }>\n nonce?: string\n images: RenderOpts['images']\n}): JSX.Element {\n /* eslint-disable @next/internal/no-ambiguous-jsx -- React Client */\n preinitScripts()\n const response = ReactClient.use(\n useFlightStream<InitialRSCPayload>(\n reactServerStream,\n reactDebugStream,\n clientReferenceManifest,\n nonce\n )\n )\n\n const initialState = createInitialRouterState({\n // This is not used during hydration, so we don't have to pass a\n // real timestamp.\n navigatedAt: -1,\n initialFlightData: response.f,\n initialCanonicalUrlParts: response.c,\n initialRenderedSearch: response.q,\n initialParallelRoutes: new Map(),\n // location is not initialized in the SSR render\n // it's set to window.location during hydration\n location: null,\n })\n\n const actionQueue = createMutableActionQueue(initialState, null)\n\n return (\n <ImageConfigContext.Provider value={images ?? imageConfigDefault}>\n <ServerInsertedHTMLProvider>\n <AppRouter actionQueue={actionQueue} globalErrorState={response.G} />\n </ServerInsertedHTMLProvider>\n </ImageConfigContext.Provider>\n )\n /* eslint-enable @next/internal/no-ambiguous-jsx -- React Client */\n}\n\n// We use a trick with TS Generics to branch streams with a type so we can\n// consume the parsed value of a Readable Stream if it was constructed with a\n// certain object shape. The generic type is not used directly in the type so it\n// requires a disabling of the eslint rule disallowing unused vars\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type BinaryStreamOf<T> = ReadableStream<Uint8Array>\n\nasync function renderToHTMLOrFlightImpl(\n req: BaseNextRequest,\n res: BaseNextResponse,\n url: ReturnType<typeof parseRelativeUrl>,\n pagePath: string,\n query: NextParsedUrlQuery,\n renderOpts: RenderOpts,\n workStore: WorkStore,\n parsedRequestHeaders: ParsedRequestHeaders,\n postponedState: PostponedState | null,\n serverComponentsHmrCache: ServerComponentsHmrCache | undefined,\n sharedContext: AppSharedContext,\n interpolatedParams: Params,\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n) {\n const isNotFoundPath = pagePath === '/404'\n if (isNotFoundPath) {\n res.statusCode = 404\n }\n\n // A unique request timestamp used by development to ensure that it's\n // consistent and won't change during this request. This is important to\n // avoid that resources can be deduped by React Float if the same resource is\n // rendered or preloaded multiple times: `<link href=\"a.css?v={Date.now()}\"/>`.\n const requestTimestamp = Date.now()\n\n const {\n clientReferenceManifest,\n serverActionsManifest,\n ComponentMod,\n nextFontManifest,\n serverActions,\n assetPrefix = '',\n enableTainting,\n cacheComponents,\n } = renderOpts\n\n // We need to expose the bundled `require` API globally for\n // react-server-dom-webpack. This is a hack until we find a better way.\n if (ComponentMod.__next_app__) {\n const instrumented = wrapClientComponentLoader(ComponentMod)\n\n // When we are prerendering if there is a cacheSignal for tracking\n // cache reads we track calls to `loadChunk` and `require`. This allows us\n // to treat chunk/module loading with similar semantics as cache reads to avoid\n // module loading from causing a prerender to abort too early.\n\n const shouldTrackModuleLoading = () => {\n if (!cacheComponents) {\n return false\n }\n if (renderOpts.dev) {\n return true\n }\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n if (!workUnitStore) {\n return false\n }\n\n switch (workUnitStore.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n case 'cache':\n case 'private-cache':\n return true\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'unstable-cache':\n return false\n default:\n workUnitStore satisfies never\n }\n }\n\n const __next_require__: typeof instrumented.require = (...args) => {\n const exportsOrPromise = instrumented.require(...args)\n if (shouldTrackModuleLoading()) {\n // requiring an async module returns a promise.\n trackPendingImport(exportsOrPromise)\n }\n return exportsOrPromise\n }\n // @ts-expect-error\n globalThis.__next_require__ = __next_require__\n\n const __next_chunk_load__: typeof instrumented.loadChunk = (...args) => {\n const loadingChunk = instrumented.loadChunk(...args)\n if (shouldTrackModuleLoading()) {\n trackPendingChunkLoad(loadingChunk)\n }\n return loadingChunk\n }\n // @ts-expect-error\n globalThis.__next_chunk_load__ = __next_chunk_load__\n }\n\n if (\n process.env.NODE_ENV === 'development' &&\n renderOpts.setIsrStatus &&\n !cacheComponents\n ) {\n // Reset the ISR status at start of request.\n const { pathname } = new URL(req.url || '/', 'http://n')\n renderOpts.setIsrStatus(\n pathname,\n // Only pages using the Node runtime can use ISR, Edge is always dynamic.\n process.env.NEXT_RUNTIME === 'edge' ? false : undefined\n )\n }\n\n if (\n // The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME !== 'edge' &&\n isNodeNextRequest(req)\n ) {\n res.onClose(() => {\n // We stop tracking fetch metrics when the response closes, since we\n // report them at that time.\n workStore.shouldTrackFetchMetrics = false\n })\n\n req.originalRequest.on('end', () => {\n if ('performance' in globalThis) {\n const metrics = getClientComponentLoaderMetrics({ reset: true })\n if (metrics) {\n getTracer()\n .startSpan(NextNodeServerSpan.clientComponentLoading, {\n startTime: metrics.clientComponentLoadStart,\n attributes: {\n 'next.clientComponentLoadCount':\n metrics.clientComponentLoadCount,\n 'next.span_type': NextNodeServerSpan.clientComponentLoading,\n },\n })\n .end(\n metrics.clientComponentLoadStart +\n metrics.clientComponentLoadTimes\n )\n }\n }\n })\n }\n\n const metadata: AppPageRenderResultMetadata = {\n statusCode: isNotFoundPath ? 404 : undefined,\n }\n\n const appUsingSizeAdjustment = !!nextFontManifest?.appUsingSizeAdjust\n\n assertClientReferenceManifest(clientReferenceManifest)\n\n const serverModuleMap = createServerModuleMap({ serverActionsManifest })\n\n setReferenceManifestsSingleton({\n page: workStore.page,\n clientReferenceManifest,\n serverActionsManifest,\n serverModuleMap,\n })\n\n ComponentMod.patchFetch()\n\n // Pull out the hooks/references from the component.\n const {\n routeModule: {\n userland: { loaderTree },\n },\n taintObjectReference,\n } = ComponentMod\n if (enableTainting) {\n taintObjectReference(\n 'Do not pass process.env to Client Components since it will leak sensitive data',\n process.env\n )\n }\n\n workStore.fetchMetrics = []\n metadata.fetchMetrics = workStore.fetchMetrics\n\n // don't modify original query object\n query = { ...query }\n stripInternalQueries(query)\n\n const { isStaticGeneration } = workStore\n\n let requestId: string\n let htmlRequestId: string\n\n const {\n flightRouterState,\n isPrefetchRequest,\n isRuntimePrefetchRequest,\n isRSCRequest,\n isHmrRefresh,\n nonce,\n } = parsedRequestHeaders\n\n if (parsedRequestHeaders.requestId) {\n // If the client has provided a request ID (in development mode), we use it.\n requestId = parsedRequestHeaders.requestId\n } else {\n // Otherwise we generate a new request ID.\n if (isStaticGeneration) {\n requestId = Buffer.from(\n await crypto.subtle.digest('SHA-1', Buffer.from(req.url))\n ).toString('hex')\n } else if (process.env.NEXT_RUNTIME === 'edge') {\n requestId = crypto.randomUUID()\n } else {\n requestId = (\n require('next/dist/compiled/nanoid') as typeof import('next/dist/compiled/nanoid')\n ).nanoid()\n }\n }\n\n // If the client has provided an HTML request ID, we use it to associate the\n // request with the HTML document from which it originated, which is used to\n // send debug information to the associated WebSocket client. Otherwise, this\n // is the request for the HTML document, so we use the request ID also as the\n // HTML request ID.\n htmlRequestId = parsedRequestHeaders.htmlRequestId || requestId\n\n const getDynamicParamFromSegment = makeGetDynamicParamFromSegment(\n interpolatedParams,\n fallbackRouteParams\n )\n\n const isPossibleActionRequest = getIsPossibleServerAction(req)\n\n const implicitTags = await getImplicitTags(\n workStore.page,\n url,\n fallbackRouteParams\n )\n\n const ctx: AppRenderContext = {\n componentMod: ComponentMod,\n url,\n renderOpts,\n workStore,\n parsedRequestHeaders,\n getDynamicParamFromSegment,\n query,\n isPrefetch: isPrefetchRequest,\n isPossibleServerAction: isPossibleActionRequest,\n requestTimestamp,\n appUsingSizeAdjustment,\n flightRouterState,\n requestId,\n htmlRequestId,\n pagePath,\n clientReferenceManifest,\n assetPrefix,\n isNotFoundPath,\n nonce,\n res,\n sharedContext,\n implicitTags,\n }\n\n getTracer().setRootSpanAttribute('next.route', pagePath)\n\n if (isStaticGeneration) {\n // We're either building or revalidating. In either case we need to\n // prerender our page rather than render it.\n const prerenderToStreamWithTracing = getTracer().wrap(\n AppRenderSpan.getBodyResult,\n {\n spanName: `prerender route (app) ${pagePath}`,\n attributes: {\n 'next.route': pagePath,\n },\n },\n prerenderToStream\n )\n\n const response = await prerenderToStreamWithTracing(\n req,\n res,\n ctx,\n metadata,\n loaderTree,\n fallbackRouteParams\n )\n\n // If we're debugging partial prerendering, print all the dynamic API accesses\n // that occurred during the render.\n // @TODO move into renderToStream function\n if (\n response.dynamicAccess &&\n accessedDynamicData(response.dynamicAccess) &&\n renderOpts.isDebugDynamicAccesses\n ) {\n warn('The following dynamic usage was detected:')\n for (const access of formatDynamicAPIAccesses(response.dynamicAccess)) {\n warn(access)\n }\n }\n\n // If we encountered any unexpected errors during build we fail the\n // prerendering phase and the build.\n if (workStore.invalidDynamicUsageError) {\n logDisallowedDynamicError(workStore, workStore.invalidDynamicUsageError)\n throw new StaticGenBailoutError()\n }\n if (response.digestErrorsMap.size) {\n const buildFailingError = response.digestErrorsMap.values().next().value\n if (buildFailingError) throw buildFailingError\n }\n // Pick first userland SSR error, which is also not a RSC error.\n if (response.ssrErrors.length) {\n const buildFailingError = response.ssrErrors.find((err) =>\n isUserLandError(err)\n )\n if (buildFailingError) throw buildFailingError\n }\n\n const options: RenderResultOptions = {\n metadata,\n contentType: HTML_CONTENT_TYPE_HEADER,\n }\n // If we have pending revalidates, wait until they are all resolved.\n if (\n workStore.pendingRevalidates ||\n workStore.pendingRevalidateWrites ||\n workStore.pendingRevalidatedTags\n ) {\n const pendingPromise = executeRevalidates(workStore).finally(() => {\n if (process.env.NEXT_PRIVATE_DEBUG_CACHE) {\n console.log('pending revalidates promise finished for:', url)\n }\n })\n\n if (renderOpts.waitUntil) {\n renderOpts.waitUntil(pendingPromise)\n } else {\n options.waitUntil = pendingPromise\n }\n }\n\n applyMetadataFromPrerenderResult(response, metadata, workStore)\n\n if (response.renderResumeDataCache) {\n metadata.renderResumeDataCache = response.renderResumeDataCache\n }\n\n return new RenderResult(await streamToString(response.stream), options)\n } else {\n // We're rendering dynamically\n const renderResumeDataCache =\n renderOpts.renderResumeDataCache ??\n postponedState?.renderResumeDataCache ??\n null\n\n const rootParams = getRootParams(loaderTree, ctx.getDynamicParamFromSegment)\n const devValidatingFallbackParams =\n getRequestMeta(req, 'devValidatingFallbackParams') || null\n\n const createRequestStore = createRequestStoreForRender.bind(\n null,\n req,\n res,\n url,\n rootParams,\n implicitTags,\n renderOpts.onUpdateCookies,\n renderOpts.previewProps,\n isHmrRefresh,\n serverComponentsHmrCache,\n renderResumeDataCache,\n devValidatingFallbackParams\n )\n const requestStore = createRequestStore()\n\n if (\n process.env.NODE_ENV === 'development' &&\n renderOpts.setIsrStatus &&\n !cacheComponents &&\n // Only pages using the Node runtime can use ISR, so we only need to\n // update the status for those.\n // The type check here ensures that `req` is correctly typed, and the\n // environment variable check provides dead code elimination.\n process.env.NEXT_RUNTIME !== 'edge' &&\n isNodeNextRequest(req)\n ) {\n const setIsrStatus = renderOpts.setIsrStatus\n req.originalRequest.on('end', () => {\n const { pathname } = new URL(req.url || '/', 'http://n')\n const isStatic = !requestStore.usedDynamic && !workStore.forceDynamic\n setIsrStatus(pathname, isStatic)\n })\n }\n\n if (isRSCRequest) {\n if (isRuntimePrefetchRequest) {\n return generateRuntimePrefetchResult(req, res, ctx, requestStore)\n } else {\n if (\n process.env.NODE_ENV === 'development' &&\n process.env.NEXT_RUNTIME !== 'edge' &&\n cacheComponents\n ) {\n return generateDynamicFlightRenderResultWithStagesInDev(\n req,\n ctx,\n requestStore,\n createRequestStore\n )\n } else {\n return generateDynamicFlightRenderResult(req, ctx, requestStore)\n }\n }\n }\n\n const renderToStreamWithTracing = getTracer().wrap(\n AppRenderSpan.getBodyResult,\n {\n spanName: `render route (app) ${pagePath}`,\n attributes: {\n 'next.route': pagePath,\n },\n },\n renderToStream\n )\n\n let didExecuteServerAction = false\n let formState: null | any = null\n if (isPossibleActionRequest) {\n // For action requests, we don't want to use the resume data cache.\n requestStore.renderResumeDataCache = null\n\n // For action requests, we handle them differently with a special render result.\n const actionRequestResult = await handleAction({\n req,\n res,\n ComponentMod,\n serverModuleMap,\n generateFlight: generateDynamicFlightRenderResult,\n workStore,\n requestStore,\n serverActions,\n ctx,\n metadata,\n })\n\n if (actionRequestResult) {\n if (actionRequestResult.type === 'not-found') {\n const notFoundLoaderTree = createNotFoundLoaderTree(loaderTree)\n res.statusCode = 404\n metadata.statusCode = 404\n const stream = await renderToStreamWithTracing(\n requestStore,\n req,\n res,\n ctx,\n notFoundLoaderTree,\n formState,\n postponedState,\n metadata,\n undefined, // Prevent restartable-render behavior in dev + Cache Components mode\n devValidatingFallbackParams\n )\n\n return new RenderResult(stream, {\n metadata,\n contentType: HTML_CONTENT_TYPE_HEADER,\n })\n } else if (actionRequestResult.type === 'done') {\n if (actionRequestResult.result) {\n actionRequestResult.result.assignMetadata(metadata)\n return actionRequestResult.result\n } else if (actionRequestResult.formState) {\n formState = actionRequestResult.formState\n }\n }\n }\n\n didExecuteServerAction = true\n // Restore the resume data cache\n requestStore.renderResumeDataCache = renderResumeDataCache\n }\n\n const options: RenderResultOptions = {\n metadata,\n contentType: HTML_CONTENT_TYPE_HEADER,\n }\n\n const stream = await renderToStreamWithTracing(\n // NOTE: in Cache Components (dev), if the render is restarted, it will use a different requestStore\n // than the one that we're passing in here.\n requestStore,\n req,\n res,\n ctx,\n loaderTree,\n formState,\n postponedState,\n metadata,\n // If we're rendering HTML after an action, we don't want restartable-render behavior\n // because the result should be dynamic, like it is in prod.\n // Also, the request store might have been mutated by the action (e.g. enabling draftMode)\n // and we currently we don't copy changes over when creating a new store,\n // so the restarted render wouldn't be correct.\n didExecuteServerAction ? undefined : createRequestStore,\n devValidatingFallbackParams\n )\n\n // Invalid dynamic usages should only error the request in development.\n // In production, it's better to produce a result.\n // (the dynamic error will still be thrown inside the component tree, but it's catchable by error boundaries)\n if (workStore.invalidDynamicUsageError && workStore.dev) {\n throw workStore.invalidDynamicUsageError\n }\n\n // If we have pending revalidates, wait until they are all resolved.\n if (\n workStore.pendingRevalidates ||\n workStore.pendingRevalidateWrites ||\n workStore.pendingRevalidatedTags\n ) {\n const pendingPromise = executeRevalidates(workStore).finally(() => {\n if (process.env.NEXT_PRIVATE_DEBUG_CACHE) {\n console.log('pending revalidates promise finished for:', url)\n }\n })\n\n if (renderOpts.waitUntil) {\n renderOpts.waitUntil(pendingPromise)\n } else {\n options.waitUntil = pendingPromise\n }\n }\n\n // Create the new render result for the response.\n return new RenderResult(stream, options)\n }\n}\n\nexport type AppPageRender = (\n req: BaseNextRequest,\n res: BaseNextResponse,\n pagePath: string,\n query: NextParsedUrlQuery,\n fallbackRouteParams: OpaqueFallbackRouteParams | null,\n renderOpts: RenderOpts,\n serverComponentsHmrCache: ServerComponentsHmrCache | undefined,\n sharedContext: AppSharedContext\n) => Promise<RenderResult<AppPageRenderResultMetadata>>\n\nexport const renderToHTMLOrFlight: AppPageRender = (\n req,\n res,\n pagePath,\n query,\n fallbackRouteParams,\n renderOpts,\n serverComponentsHmrCache,\n sharedContext\n) => {\n if (!req.url) {\n throw new Error('Invalid URL')\n }\n\n const url = parseRelativeUrl(req.url, undefined, false)\n\n // We read these values from the request object as, in certain cases,\n // base-server will strip them to opt into different rendering behavior.\n const parsedRequestHeaders = parseRequestHeaders(req.headers, {\n isRoutePPREnabled: renderOpts.experimental.isRoutePPREnabled === true,\n previewModeId: renderOpts.previewProps?.previewModeId,\n })\n\n const { isPrefetchRequest, previouslyRevalidatedTags, nonce } =\n parsedRequestHeaders\n\n let interpolatedParams: Params\n let postponedState: PostponedState | null = null\n\n // If provided, the postpone state should be parsed so it can be provided to\n // React.\n if (typeof renderOpts.postponed === 'string') {\n if (fallbackRouteParams) {\n throw new InvariantError(\n 'postponed state should not be provided when fallback params are provided'\n )\n }\n\n interpolatedParams = interpolateParallelRouteParams(\n renderOpts.ComponentMod.routeModule.userland.loaderTree,\n renderOpts.params ?? {},\n pagePath,\n fallbackRouteParams\n )\n\n postponedState = parsePostponedState(\n renderOpts.postponed,\n interpolatedParams\n )\n } else {\n interpolatedParams = interpolateParallelRouteParams(\n renderOpts.ComponentMod.routeModule.userland.loaderTree,\n renderOpts.params ?? {},\n pagePath,\n fallbackRouteParams\n )\n }\n\n if (\n postponedState?.renderResumeDataCache &&\n renderOpts.renderResumeDataCache\n ) {\n throw new InvariantError(\n 'postponed state and dev warmup immutable resume data cache should not be provided together'\n )\n }\n\n const workStore = createWorkStore({\n page: renderOpts.routeModule.definition.page,\n renderOpts,\n // @TODO move to workUnitStore of type Request\n isPrefetchRequest,\n buildId: sharedContext.buildId,\n previouslyRevalidatedTags,\n nonce,\n })\n\n return workAsyncStorage.run(\n workStore,\n // The function to run\n renderToHTMLOrFlightImpl,\n // all of it's args\n req,\n res,\n url,\n pagePath,\n query,\n renderOpts,\n workStore,\n parsedRequestHeaders,\n postponedState,\n serverComponentsHmrCache,\n sharedContext,\n interpolatedParams,\n fallbackRouteParams\n )\n}\n\nfunction applyMetadataFromPrerenderResult(\n response: Pick<\n PrerenderToStreamResult,\n | 'collectedExpire'\n | 'collectedRevalidate'\n | 'collectedStale'\n | 'collectedTags'\n >,\n metadata: AppPageRenderResultMetadata,\n workStore: WorkStore\n) {\n if (response.collectedTags) {\n metadata.fetchTags = response.collectedTags.join(',')\n }\n\n // Let the client router know how long to keep the cached entry around.\n const staleHeader = String(response.collectedStale)\n metadata.headers ??= {}\n metadata.headers[NEXT_ROUTER_STALE_TIME_HEADER] = staleHeader\n\n // If force static is specifically set to false, we should not revalidate\n // the page.\n if (workStore.forceStatic === false || response.collectedRevalidate === 0) {\n metadata.cacheControl = { revalidate: 0, expire: undefined }\n } else {\n // Copy the cache control value onto the render result metadata.\n metadata.cacheControl = {\n revalidate:\n response.collectedRevalidate >= INFINITE_CACHE\n ? false\n : response.collectedRevalidate,\n expire:\n response.collectedExpire >= INFINITE_CACHE\n ? undefined\n : response.collectedExpire,\n }\n }\n\n // provide bailout info for debugging\n if (metadata.cacheControl.revalidate === 0) {\n metadata.staticBailoutInfo = {\n description: workStore.dynamicUsageDescription,\n stack: workStore.dynamicUsageStack,\n }\n }\n}\n\ntype RSCPayloadDevProperties = {\n /** Only available during cacheComponents development builds. Used for logging errors. */\n _validation?: Promise<ReactNode>\n _bypassCachesInDev?: ReactNode\n}\n\nasync function renderToStream(\n requestStore: RequestStore,\n req: BaseNextRequest,\n res: BaseNextResponse,\n ctx: AppRenderContext,\n tree: LoaderTree,\n formState: any,\n postponedState: PostponedState | null,\n metadata: AppPageRenderResultMetadata,\n createRequestStore: (() => RequestStore) | undefined,\n devValidatingFallbackParams: OpaqueFallbackRouteParams | null\n): Promise<ReadableStream<Uint8Array>> {\n /* eslint-disable @next/internal/no-ambiguous-jsx -- React Client */\n const {\n assetPrefix,\n htmlRequestId,\n nonce,\n pagePath,\n renderOpts,\n requestId,\n workStore,\n } = ctx\n\n const {\n basePath,\n buildManifest,\n clientReferenceManifest,\n ComponentMod: {\n createElement,\n renderToReadableStream: serverRenderToReadableStream,\n },\n crossOrigin,\n dev = false,\n experimental,\n nextExport = false,\n onInstrumentationRequestError,\n page,\n reactMaxHeadersLength,\n setReactDebugChannel,\n shouldWaitOnAllReady,\n subresourceIntegrityManifest,\n supportsDynamicResponse,\n cacheComponents,\n } = renderOpts\n\n assertClientReferenceManifest(clientReferenceManifest)\n\n const { ServerInsertedHTMLProvider, renderServerInsertedHTML } =\n createServerInsertedHTML()\n const getServerInsertedMetadata = createServerInsertedMetadata(nonce)\n\n const tracingMetadata = getTracedMetadata(\n getTracer().getTracePropagationData(),\n experimental.clientTraceMetadata\n )\n\n const polyfills: JSX.IntrinsicElements['script'][] =\n buildManifest.polyfillFiles\n .filter(\n (polyfill) =>\n polyfill.endsWith('.js') && !polyfill.endsWith('.module.js')\n )\n .map((polyfill) => ({\n src: `${assetPrefix}/_next/${polyfill}${getAssetQueryString(\n ctx,\n false\n )}`,\n integrity: subresourceIntegrityManifest?.[polyfill],\n crossOrigin,\n noModule: true,\n nonce,\n }))\n\n const [preinitScripts, bootstrapScript] = getRequiredScripts(\n buildManifest,\n // Why is assetPrefix optional on renderOpts?\n // @TODO make it default empty string on renderOpts and get rid of it from ctx\n assetPrefix,\n crossOrigin,\n subresourceIntegrityManifest,\n getAssetQueryString(ctx, true),\n nonce,\n page\n )\n\n // In development mode, set the request ID as a global variable, before the\n // bootstrap script is executed, which depends on it during hydration.\n const bootstrapScriptContent =\n process.env.NODE_ENV !== 'production'\n ? `self.__next_r=${JSON.stringify(requestId)}`\n : undefined\n\n const reactServerErrorsByDigest: Map<string, DigestedError> = new Map()\n const silenceLogger = false\n function onHTMLRenderRSCError(err: DigestedError) {\n return onInstrumentationRequestError?.(\n err,\n req,\n createErrorContext(ctx, 'react-server-components')\n )\n }\n const serverComponentsErrorHandler = createHTMLReactServerErrorHandler(\n dev,\n nextExport,\n reactServerErrorsByDigest,\n silenceLogger,\n onHTMLRenderRSCError\n )\n\n function onHTMLRenderSSRError(err: DigestedError) {\n return onInstrumentationRequestError?.(\n err,\n req,\n createErrorContext(ctx, 'server-rendering')\n )\n }\n\n const allCapturedErrors: Array<unknown> = []\n const htmlRendererErrorHandler = createHTMLErrorHandler(\n dev,\n nextExport,\n reactServerErrorsByDigest,\n allCapturedErrors,\n silenceLogger,\n onHTMLRenderSSRError\n )\n\n let reactServerResult: null | ReactServerResult = null\n let reactDebugStream: ReadableStream<Uint8Array> | undefined\n\n const setHeader = res.setHeader.bind(res)\n const appendHeader = res.appendHeader.bind(res)\n\n try {\n if (\n // We only want this behavior when we have React's dev builds available\n process.env.NODE_ENV === 'development' &&\n // We only want this behavior when running `next dev`\n dev &&\n // Edge routes never prerender so we don't have a Prerender environment for anything in edge runtime\n process.env.NEXT_RUNTIME !== 'edge' &&\n // We only have a Prerender environment for projects opted into cacheComponents\n cacheComponents\n ) {\n const [resolveValidation, validationOutlet] = createValidationOutlet()\n let debugChannel: DebugChannelPair | undefined\n const getPayload = async (\n // eslint-disable-next-line @typescript-eslint/no-shadow\n requestStore: RequestStore\n ) => {\n const payload: InitialRSCPayload & RSCPayloadDevProperties =\n await workUnitAsyncStorage.run(\n requestStore,\n getRSCPayload,\n tree,\n ctx,\n res.statusCode === 404\n )\n // Placing the validation outlet in the payload is safe\n // even if we end up discarding a render and restarting,\n // because we're not going to wait for the stream to complete,\n // so leaving the validation unresolved is fine.\n payload._validation = validationOutlet\n\n if (isBypassingCachesInDev(renderOpts, requestStore)) {\n // Mark the RSC payload to indicate that caches were bypassed in dev.\n // This lets the client know not to cache anything based on this render.\n if (renderOpts.setCacheStatus) {\n // we know this is available when cacheComponents is enabled, but typeguard to be safe\n renderOpts.setCacheStatus('bypass', htmlRequestId, requestId)\n }\n payload._bypassCachesInDev = createElement(WarnForBypassCachesInDev, {\n route: workStore.route,\n })\n }\n\n return payload\n }\n\n if (\n // We only do this flow if we can safely recreate the store from scratch\n // (which is not the case for renders after an action)\n createRequestStore &&\n // We only do this flow if we're not bypassing caches in dev using\n // \"disable cache\" in devtools or a hard refresh (cache-control: \"no-store\")\n !isBypassingCachesInDev(renderOpts, requestStore)\n ) {\n const {\n stream: serverStream,\n debugChannel: returnedDebugChannel,\n requestStore: finalRequestStore,\n } = await renderWithRestartOnCacheMissInDev(\n ctx,\n requestStore,\n createRequestStore,\n getPayload,\n serverComponentsErrorHandler\n )\n\n reactServerResult = new ReactServerResult(serverStream)\n requestStore = finalRequestStore\n debugChannel = returnedDebugChannel\n } else {\n // We're either bypassing caches or we can't restart the render.\n // Do a dynamic render, but with (basic) environment labels.\n\n debugChannel = setReactDebugChannel && createDebugChannel()\n\n const serverStream =\n await stagedRenderToReadableStreamWithoutCachesInDev(\n ctx,\n requestStore,\n getPayload,\n clientReferenceManifest,\n {\n onError: serverComponentsErrorHandler,\n filterStackFrame,\n debugChannel: debugChannel?.serverSide,\n }\n )\n reactServerResult = new ReactServerResult(serverStream)\n }\n\n if (debugChannel && setReactDebugChannel) {\n const [readableSsr, readableBrowser] =\n debugChannel.clientSide.readable.tee()\n\n reactDebugStream = readableSsr\n\n setReactDebugChannel(\n { readable: readableBrowser },\n htmlRequestId,\n requestId\n )\n }\n\n // TODO(restart-on-cache-miss):\n // This can probably be optimized to do less work,\n // because we've already made sure that we have warm caches.\n consoleAsyncStorage.run(\n { dim: true },\n spawnDynamicValidationInDev,\n resolveValidation,\n tree,\n ctx,\n res.statusCode === 404,\n clientReferenceManifest,\n requestStore,\n devValidatingFallbackParams\n )\n } else {\n // This is a dynamic render. We don't do dynamic tracking because we're not prerendering\n const RSCPayload: RSCPayload & RSCPayloadDevProperties =\n await workUnitAsyncStorage.run(\n requestStore,\n getRSCPayload,\n tree,\n ctx,\n res.statusCode === 404\n )\n\n const debugChannel = setReactDebugChannel && createDebugChannel()\n\n if (debugChannel) {\n const [readableSsr, readableBrowser] =\n debugChannel.clientSide.readable.tee()\n\n reactDebugStream = readableSsr\n\n setReactDebugChannel(\n { readable: readableBrowser },\n htmlRequestId,\n requestId\n )\n }\n\n reactServerResult = new ReactServerResult(\n workUnitAsyncStorage.run(\n requestStore,\n serverRenderToReadableStream,\n RSCPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: serverComponentsErrorHandler,\n debugChannel: debugChannel?.serverSide,\n }\n )\n )\n }\n\n // React doesn't start rendering synchronously but we want the RSC render to have a chance to start\n // before we begin SSR rendering because we want to capture any available preload headers so we tick\n // one task before continuing\n await waitAtLeastOneReactRenderTask()\n\n // If provided, the postpone state should be parsed as JSON so it can be\n // provided to React.\n if (typeof renderOpts.postponed === 'string') {\n if (postponedState?.type === DynamicState.DATA) {\n // We have a complete HTML Document in the prerender but we need to\n // still include the new server component render because it was not included\n // in the static prelude.\n const inlinedReactServerDataStream = createInlinedDataReadableStream(\n reactServerResult.tee(),\n nonce,\n formState\n )\n\n return chainStreams(\n inlinedReactServerDataStream,\n createDocumentClosingStream()\n )\n } else if (postponedState) {\n // We assume we have dynamic HTML requiring a resume render to complete\n const { postponed, preludeState } =\n getPostponedFromState(postponedState)\n const resume = (\n require('react-dom/server') as typeof import('react-dom/server')\n ).resume\n\n const htmlStream = await workUnitAsyncStorage.run(\n requestStore,\n resume,\n <App\n reactServerStream={reactServerResult.tee()}\n reactDebugStream={reactDebugStream}\n preinitScripts={preinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n postponed,\n { onError: htmlRendererErrorHandler, nonce }\n )\n\n const getServerInsertedHTML = makeGetServerInsertedHTML({\n polyfills,\n renderServerInsertedHTML,\n serverCapturedErrors: allCapturedErrors,\n basePath,\n tracingMetadata: tracingMetadata,\n })\n return await continueDynamicHTMLResume(htmlStream, {\n // If the prelude is empty (i.e. is no static shell), we should wait for initial HTML to be rendered\n // to avoid injecting RSC data too early.\n // If we have a non-empty-prelude (i.e. a static HTML shell), then it's already been sent separately,\n // so we shouldn't wait for any HTML to be emitted from the resume before sending RSC data.\n delayDataUntilFirstHtmlChunk:\n preludeState === DynamicHTMLPreludeState.Empty,\n inlinedDataStream: createInlinedDataReadableStream(\n reactServerResult.consume(),\n nonce,\n formState\n ),\n getServerInsertedHTML,\n getServerInsertedMetadata,\n })\n }\n }\n\n // This is a regular dynamic render\n const renderToReadableStream = (\n require('react-dom/server') as typeof import('react-dom/server')\n ).renderToReadableStream\n\n const htmlStream = await workUnitAsyncStorage.run(\n requestStore,\n renderToReadableStream,\n <App\n reactServerStream={reactServerResult.tee()}\n reactDebugStream={reactDebugStream}\n preinitScripts={preinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n {\n onError: htmlRendererErrorHandler,\n nonce,\n onHeaders: (headers: Headers) => {\n headers.forEach((value, key) => {\n appendHeader(key, value)\n })\n },\n maxHeadersLength: reactMaxHeadersLength,\n bootstrapScriptContent,\n bootstrapScripts: [bootstrapScript],\n formState,\n }\n )\n\n const getServerInsertedHTML = makeGetServerInsertedHTML({\n polyfills,\n renderServerInsertedHTML,\n serverCapturedErrors: allCapturedErrors,\n basePath,\n tracingMetadata: tracingMetadata,\n })\n /**\n * Rules of Static & Dynamic HTML:\n *\n * 1.) We must generate static HTML unless the caller explicitly opts\n * in to dynamic HTML support.\n *\n * 2.) If dynamic HTML support is requested, we must honor that request\n * or throw an error. It is the sole responsibility of the caller to\n * ensure they aren't e.g. requesting dynamic HTML for a static page.\n *\n * 3.) If `shouldWaitOnAllReady` is true, which indicates we need to\n * resolve all suspenses and generate a full HTML. e.g. when it's a\n * html limited bot requests, we produce the full HTML content.\n *\n * These rules help ensure that other existing features like request caching,\n * coalescing, and ISR continue working as intended.\n */\n const generateStaticHTML =\n supportsDynamicResponse !== true || !!shouldWaitOnAllReady\n\n return await continueFizzStream(htmlStream, {\n inlinedDataStream: createInlinedDataReadableStream(\n reactServerResult.consume(),\n nonce,\n formState\n ),\n isStaticGeneration: generateStaticHTML,\n isBuildTimePrerendering: ctx.workStore.isBuildTimePrerendering === true,\n buildId: ctx.workStore.buildId,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n validateRootLayout: dev,\n })\n } catch (err) {\n if (\n isStaticGenBailoutError(err) ||\n (typeof err === 'object' &&\n err !== null &&\n 'message' in err &&\n typeof err.message === 'string' &&\n err.message.includes(\n 'https://nextjs.org/docs/advanced-features/static-html-export'\n ))\n ) {\n // Ensure that \"next dev\" prints the red error overlay\n throw err\n }\n\n // If a bailout made it to this point, it means it wasn't wrapped inside\n // a suspense boundary.\n const shouldBailoutToCSR = isBailoutToCSRError(err)\n if (shouldBailoutToCSR) {\n const stack = getStackWithoutErrorMessage(err)\n error(\n `${err.reason} should be wrapped in a suspense boundary at page \"${pagePath}\". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\\n${stack}`\n )\n\n throw err\n }\n\n let errorType: MetadataErrorType | 'redirect' | undefined\n\n if (isHTTPAccessFallbackError(err)) {\n res.statusCode = getAccessFallbackHTTPStatus(err)\n metadata.statusCode = res.statusCode\n errorType = getAccessFallbackErrorTypeByStatus(res.statusCode)\n } else if (isRedirectError(err)) {\n errorType = 'redirect'\n res.statusCode = getRedirectStatusCodeFromError(err)\n metadata.statusCode = res.statusCode\n\n const redirectUrl = addPathPrefix(getURLFromRedirectError(err), basePath)\n\n // If there were mutable cookies set, we need to set them on the\n // response.\n const headers = new Headers()\n if (appendMutableCookies(headers, requestStore.mutableCookies)) {\n setHeader('set-cookie', Array.from(headers.values()))\n }\n\n setHeader('location', redirectUrl)\n } else if (!shouldBailoutToCSR) {\n res.statusCode = 500\n metadata.statusCode = res.statusCode\n }\n\n const [errorPreinitScripts, errorBootstrapScript] = getRequiredScripts(\n buildManifest,\n assetPrefix,\n crossOrigin,\n subresourceIntegrityManifest,\n getAssetQueryString(ctx, false),\n nonce,\n '/_not-found/page'\n )\n\n const errorRSCPayload = await workUnitAsyncStorage.run(\n requestStore,\n getErrorRSCPayload,\n tree,\n ctx,\n reactServerErrorsByDigest.has((err as any).digest) ? null : err,\n errorType\n )\n\n const errorServerStream = workUnitAsyncStorage.run(\n requestStore,\n serverRenderToReadableStream,\n errorRSCPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: serverComponentsErrorHandler,\n }\n )\n\n if (reactServerResult === null) {\n // We errored when we did not have an RSC stream to read from. This is not just a render\n // error, we need to throw early\n throw err\n }\n\n try {\n const fizzStream = await workUnitAsyncStorage.run(\n requestStore,\n renderToInitialFizzStream,\n {\n ReactDOMServer:\n require('react-dom/server') as typeof import('react-dom/server'),\n element: (\n <ErrorApp\n reactServerStream={errorServerStream}\n reactDebugStream={undefined}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n preinitScripts={errorPreinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />\n ),\n streamOptions: {\n nonce,\n bootstrapScriptContent,\n // Include hydration scripts in the HTML\n bootstrapScripts: [errorBootstrapScript],\n formState,\n },\n }\n )\n\n /**\n * Rules of Static & Dynamic HTML:\n *\n * 1.) We must generate static HTML unless the caller explicitly opts\n * in to dynamic HTML support.\n *\n * 2.) If dynamic HTML support is requested, we must honor that request\n * or throw an error. It is the sole responsibility of the caller to\n * ensure they aren't e.g. requesting dynamic HTML for a static page.\n * 3.) If `shouldWaitOnAllReady` is true, which indicates we need to\n * resolve all suspenses and generate a full HTML. e.g. when it's a\n * html limited bot requests, we produce the full HTML content.\n *\n * These rules help ensure that other existing features like request caching,\n * coalescing, and ISR continue working as intended.\n */\n const generateStaticHTML =\n supportsDynamicResponse !== true || !!shouldWaitOnAllReady\n return await continueFizzStream(fizzStream, {\n inlinedDataStream: createInlinedDataReadableStream(\n // This is intentionally using the readable datastream from the\n // main render rather than the flight data from the error page\n // render\n reactServerResult.consume(),\n nonce,\n formState\n ),\n isStaticGeneration: generateStaticHTML,\n isBuildTimePrerendering: ctx.workStore.isBuildTimePrerendering === true,\n buildId: ctx.workStore.buildId,\n getServerInsertedHTML: makeGetServerInsertedHTML({\n polyfills,\n renderServerInsertedHTML,\n serverCapturedErrors: [],\n basePath,\n tracingMetadata: tracingMetadata,\n }),\n getServerInsertedMetadata,\n validateRootLayout: dev,\n })\n } catch (finalErr: any) {\n if (\n process.env.NODE_ENV === 'development' &&\n isHTTPAccessFallbackError(finalErr)\n ) {\n const { bailOnRootNotFound } =\n require('../../client/components/dev-root-http-access-fallback-boundary') as typeof import('../../client/components/dev-root-http-access-fallback-boundary')\n bailOnRootNotFound()\n }\n throw finalErr\n }\n }\n /* eslint-enable @next/internal/no-ambiguous-jsx */\n}\n\nasync function renderWithRestartOnCacheMissInDev(\n ctx: AppRenderContext,\n initialRequestStore: RequestStore,\n createRequestStore: () => RequestStore,\n getPayload: (requestStore: RequestStore) => Promise<RSCPayload>,\n onError: (error: unknown) => void\n) {\n const {\n htmlRequestId,\n renderOpts,\n requestId,\n componentMod: {\n routeModule: {\n userland: { loaderTree },\n },\n },\n } = ctx\n const {\n clientReferenceManifest,\n ComponentMod,\n setCacheStatus,\n setReactDebugChannel,\n } = renderOpts\n assertClientReferenceManifest(clientReferenceManifest)\n\n const hasRuntimePrefetch =\n await anySegmentHasRuntimePrefetchEnabled(loaderTree)\n\n // If the render is restarted, we'll recreate a fresh request store\n let requestStore: RequestStore = initialRequestStore\n\n const environmentName = () => {\n const currentStage = requestStore.stagedRendering!.currentStage\n switch (currentStage) {\n case RenderStage.Static:\n return 'Prerender'\n case RenderStage.Runtime:\n return hasRuntimePrefetch ? 'Prefetch' : 'Prefetchable'\n case RenderStage.Dynamic:\n return 'Server'\n default:\n currentStage satisfies never\n throw new InvariantError(`Invalid render stage: ${currentStage}`)\n }\n }\n\n //===============================================\n // Initial render\n //===============================================\n\n // Try to render the page and see if there's any cache misses.\n // If there are, wait for caches to finish and restart the render.\n\n // This render might end up being used as a prospective render (if there's cache misses),\n // so we need to set it up for filling caches.\n const cacheSignal = new CacheSignal()\n\n // If we encounter async modules that delay rendering, we'll also need to restart.\n // TODO(restart-on-cache-miss): technically, we only need to wait for pending *server* modules here,\n // but `trackPendingModules` doesn't distinguish between client and server.\n trackPendingModules(cacheSignal)\n\n const prerenderResumeDataCache = createPrerenderResumeDataCache()\n\n const initialReactController = new AbortController()\n const initialDataController = new AbortController() // Controls hanging promises we create\n const initialStageController = new StagedRenderingController(\n initialDataController.signal\n )\n\n requestStore.prerenderResumeDataCache = prerenderResumeDataCache\n // `getRenderResumeDataCache` will fall back to using `prerenderResumeDataCache` as `renderResumeDataCache`,\n // so not having a resume data cache won't break any expectations in case we don't need to restart.\n requestStore.renderResumeDataCache = null\n requestStore.stagedRendering = initialStageController\n requestStore.asyncApiPromises = createAsyncApiPromisesInDev(\n initialStageController,\n requestStore.cookies,\n requestStore.mutableCookies,\n requestStore.headers\n )\n requestStore.cacheSignal = cacheSignal\n\n let debugChannel = setReactDebugChannel && createDebugChannel()\n\n const initialRscPayload = await getPayload(requestStore)\n const maybeInitialServerStream = await workUnitAsyncStorage.run(\n requestStore,\n () =>\n pipelineInSequentialTasks(\n () => {\n // Static stage\n const stream = ComponentMod.renderToReadableStream(\n initialRscPayload,\n clientReferenceManifest.clientModules,\n {\n onError,\n environmentName,\n filterStackFrame,\n debugChannel: debugChannel?.serverSide,\n signal: initialReactController.signal,\n }\n )\n // If we abort the render, we want to reject the stage-dependent promises as well.\n // Note that we want to install this listener after the render is started\n // so that it runs after react is finished running its abort code.\n initialReactController.signal.addEventListener('abort', () => {\n initialDataController.abort(initialReactController.signal.reason)\n })\n return stream\n },\n (stream) => {\n // Runtime stage\n initialStageController.advanceStage(RenderStage.Runtime)\n\n // If we had a cache miss in the static stage, we'll have to disard this stream\n // and render again once the caches are warm.\n if (cacheSignal.hasPendingReads()) {\n return null\n }\n\n // If there's no cache misses, we'll continue rendering,\n // and see if there's any cache misses in the runtime stage.\n return stream\n },\n async (maybeStream) => {\n // Dynamic stage\n\n // If we had cache misses in either of the previous stages,\n // then we'll only use this render for filling caches.\n // We won't advance the stage, and thus leave dynamic APIs hanging,\n // because they won't be cached anyway, so it'd be wasted work.\n if (maybeStream === null || cacheSignal.hasPendingReads()) {\n return null\n }\n\n // If there's no cache misses, we'll use this render, so let it advance to the dynamic stage.\n initialStageController.advanceStage(RenderStage.Dynamic)\n return maybeStream\n }\n )\n )\n\n if (maybeInitialServerStream !== null) {\n // No cache misses. We can use the stream as is.\n return {\n stream: maybeInitialServerStream,\n debugChannel,\n requestStore,\n }\n }\n\n if (process.env.NODE_ENV === 'development' && setCacheStatus) {\n setCacheStatus('filling', htmlRequestId, requestId)\n }\n\n // Cache miss. We will use the initial render to fill caches, and discard its result.\n // Then, we can render again with warm caches.\n\n // TODO(restart-on-cache-miss):\n // This might end up waiting for more caches than strictly necessary,\n // because we can't abort the render yet, and we'll let runtime/dynamic APIs resolve.\n // Ideally we'd only wait for caches that are needed in the static stage.\n // This will be optimized in the future by not allowing runtime/dynamic APIs to resolve.\n\n await cacheSignal.cacheReady()\n initialReactController.abort()\n\n //===============================================\n // Final render (restarted)\n //===============================================\n\n // The initial render acted as a prospective render to warm the caches.\n requestStore = createRequestStore()\n\n const finalStageController = new StagedRenderingController()\n\n // We've filled the caches, so now we can render as usual,\n // without any cache-filling mechanics.\n requestStore.prerenderResumeDataCache = null\n requestStore.renderResumeDataCache = createRenderResumeDataCache(\n prerenderResumeDataCache\n )\n requestStore.stagedRendering = finalStageController\n requestStore.cacheSignal = null\n requestStore.asyncApiPromises = createAsyncApiPromisesInDev(\n finalStageController,\n requestStore.cookies,\n requestStore.mutableCookies,\n requestStore.headers\n )\n\n // The initial render already wrote to its debug channel.\n // We're not using it, so we need to create a new one.\n debugChannel = setReactDebugChannel && createDebugChannel()\n\n const finalRscPayload = await getPayload(requestStore)\n const finalServerStream = await workUnitAsyncStorage.run(requestStore, () =>\n pipelineInSequentialTasks(\n () => {\n // Static stage\n return ComponentMod.renderToReadableStream(\n finalRscPayload,\n clientReferenceManifest.clientModules,\n {\n onError,\n environmentName,\n filterStackFrame,\n debugChannel: debugChannel?.serverSide,\n }\n )\n },\n (stream) => {\n // Runtime stage\n finalStageController.advanceStage(RenderStage.Runtime)\n return stream\n },\n (stream) => {\n // Dynamic stage\n finalStageController.advanceStage(RenderStage.Dynamic)\n return stream\n }\n )\n )\n\n if (process.env.NODE_ENV === 'development' && setCacheStatus) {\n setCacheStatus('filled', htmlRequestId, requestId)\n }\n\n return {\n stream: finalServerStream,\n debugChannel,\n requestStore,\n }\n}\n\nfunction createAsyncApiPromisesInDev(\n stagedRendering: StagedRenderingController,\n cookies: RequestStore['cookies'],\n mutableCookies: RequestStore['mutableCookies'],\n headers: RequestStore['headers']\n): NonNullable<RequestStore['asyncApiPromises']> {\n return {\n // Runtime APIs\n cookies: stagedRendering.delayUntilStage(\n RenderStage.Runtime,\n 'cookies',\n cookies\n ),\n mutableCookies: stagedRendering.delayUntilStage(\n RenderStage.Runtime,\n 'cookies',\n mutableCookies as RequestStore['cookies']\n ),\n headers: stagedRendering.delayUntilStage(\n RenderStage.Runtime,\n 'headers',\n headers\n ),\n // These are not used directly, but we chain other `params`/`searchParams` promises off of them.\n sharedParamsParent: stagedRendering.delayUntilStage(\n RenderStage.Runtime,\n undefined,\n '<internal params>'\n ),\n sharedSearchParamsParent: stagedRendering.delayUntilStage(\n RenderStage.Runtime,\n undefined,\n '<internal searchParams>'\n ),\n connection: stagedRendering.delayUntilStage(\n RenderStage.Dynamic,\n 'connection',\n undefined\n ),\n }\n}\n\ntype DebugChannelPair = {\n serverSide: DebugChannelServer\n clientSide: DebugChannelClient\n}\n\ntype DebugChannelServer = {\n readable?: ReadableStream<Uint8Array>\n writable: WritableStream<Uint8Array>\n}\ntype DebugChannelClient = {\n readable: ReadableStream<Uint8Array>\n writable?: WritableStream<Uint8Array>\n}\n\nfunction createDebugChannel(): DebugChannelPair | undefined {\n if (process.env.NODE_ENV === 'production') {\n return undefined\n }\n\n let readableController: ReadableStreamDefaultController | undefined\n\n const clientSideReadable = new ReadableStream<Uint8Array>({\n start(controller) {\n readableController = controller\n },\n })\n\n return {\n serverSide: {\n writable: new WritableStream<Uint8Array>({\n write(chunk) {\n readableController?.enqueue(chunk)\n },\n close() {\n readableController?.close()\n },\n abort(err) {\n readableController?.error(err)\n },\n }),\n },\n clientSide: {\n readable: clientSideReadable,\n },\n }\n}\n\nfunction createValidationOutlet() {\n let resolveValidation: (value: ReactNode) => void\n let outlet = new Promise<ReactNode>((resolve) => {\n resolveValidation = resolve\n })\n return [resolveValidation!, outlet] as const\n}\n\n/**\n * This function is a fork of prerenderToStream cacheComponents branch.\n * While it doesn't return a stream we want it to have identical\n * prerender semantics to prerenderToStream and should update it\n * in conjunction with any changes to that function.\n */\nasync function spawnDynamicValidationInDev(\n resolveValidation: (validatingElement: ReactNode) => void,\n tree: LoaderTree,\n ctx: AppRenderContext,\n isNotFound: boolean,\n clientReferenceManifest: NonNullable<RenderOpts['clientReferenceManifest']>,\n requestStore: RequestStore,\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n): Promise<void> {\n const {\n componentMod: ComponentMod,\n getDynamicParamFromSegment,\n implicitTags,\n nonce,\n renderOpts,\n workStore,\n } = ctx\n\n const { allowEmptyStaticShell = false } = renderOpts\n\n // These values are placeholder values for this validating render\n // that are provided during the actual prerenderToStream.\n const preinitScripts = () => {}\n const { ServerInsertedHTMLProvider } = createServerInsertedHTML()\n\n const rootParams = getRootParams(\n ComponentMod.routeModule.userland.loaderTree,\n getDynamicParamFromSegment\n )\n\n const hmrRefreshHash = requestStore.cookies.get(\n NEXT_HMR_REFRESH_HASH_COOKIE\n )?.value\n\n // The prerender controller represents the lifetime of the prerender. It will\n // be aborted when a task is complete or a synchronously aborting API is\n // called. Notably, during prospective prerenders, this does not actually\n // terminate the prerender itself, which will continue until all caches are\n // filled.\n const initialServerPrerenderController = new AbortController()\n\n // This controller is used to abort the React prerender.\n const initialServerReactController = new AbortController()\n\n // This controller represents the lifetime of the React prerender. Its signal\n // can be used for any I/O operation to abort the I/O and/or to reject, when\n // prerendering aborts. This includes our own hanging promises for accessing\n // request data, and for fetch calls. It might be replaced in the future by\n // React.cacheSignal(). It's aborted after the React controller, so that no\n // pending I/O can register abort listeners that are called before React's\n // abort listener is called. This ensures that pending I/O is not rejected too\n // early when aborting the prerender. Notably, during the prospective\n // prerender, it is different from the prerender controller because we don't\n // want to end the React prerender until all caches are filled.\n const initialServerRenderController = new AbortController()\n\n // The cacheSignal helps us track whether caches are still filling or we are\n // ready to cut the render off.\n const cacheSignal = new CacheSignal()\n\n const captureOwnerStackClient = ReactClient.captureOwnerStack\n const { captureOwnerStack: captureOwnerStackServer, createElement } =\n ComponentMod\n\n // The resume data cache here should use a fresh instance as it's\n // performing a fresh prerender. If we get to implementing the\n // prerendering of an already prerendered page, we should use the passed\n // resume data cache instead.\n const prerenderResumeDataCache = createPrerenderResumeDataCache()\n const initialServerPayloadPrerenderStore: PrerenderStore = {\n type: 'prerender',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n // While this render signal isn't going to be used to abort a React render while getting the RSC payload\n // various request data APIs bind to this controller to reject after completion.\n renderSignal: initialServerRenderController.signal,\n // When we generate the RSC payload we might abort this controller due to sync IO\n // but we don't actually care about sync IO in this phase so we use a throw away controller\n // that isn't connected to anything\n controller: new AbortController(),\n // During the initial prerender we need to track all cache reads to ensure\n // we render long enough to fill every cache it is possible to visit during\n // the final prerender.\n cacheSignal,\n dynamicTracking: null,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache: null,\n hmrRefreshHash,\n captureOwnerStack: captureOwnerStackServer,\n }\n\n // We're not going to use the result of this render because the only time it could be used\n // is if it completes in a microtask and that's likely very rare for any non-trivial app\n const initialServerPayload = await workUnitAsyncStorage.run(\n initialServerPayloadPrerenderStore,\n getRSCPayload,\n tree,\n ctx,\n isNotFound\n )\n\n const initialServerPrerenderStore: PrerenderStore = {\n type: 'prerender',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n renderSignal: initialServerRenderController.signal,\n controller: initialServerPrerenderController,\n // During the initial prerender we need to track all cache reads to ensure\n // we render long enough to fill every cache it is possible to visit during\n // the final prerender.\n cacheSignal,\n dynamicTracking: null,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache: null,\n hmrRefreshHash,\n captureOwnerStack: captureOwnerStackServer,\n }\n\n const pendingInitialServerResult = workUnitAsyncStorage.run(\n initialServerPrerenderStore,\n ComponentMod.prerender,\n initialServerPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: (err) => {\n const digest = getDigestForWellKnownError(err)\n\n if (digest) {\n return digest\n }\n\n if (isReactLargeShellError(err)) {\n // TODO: Aggregate\n console.error(err)\n return undefined\n }\n\n if (initialServerPrerenderController.signal.aborted) {\n // The render aborted before this error was handled which indicates\n // the error is caused by unfinished components within the render\n return\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n },\n // we don't care to track postpones during the prospective render because we need\n // to always do a final render anyway\n onPostpone: undefined,\n // We don't want to stop rendering until the cacheSignal is complete so we pass\n // a different signal to this render call than is used by dynamic APIs to signify\n // transitioning out of the prerender environment\n signal: initialServerReactController.signal,\n }\n )\n\n // The listener to abort our own render controller must be added after React\n // has added its listener, to ensure that pending I/O is not aborted/rejected\n // too early.\n initialServerReactController.signal.addEventListener(\n 'abort',\n () => {\n initialServerRenderController.abort()\n },\n { once: true }\n )\n\n // Wait for all caches to be finished filling and for async imports to resolve\n trackPendingModules(cacheSignal)\n await cacheSignal.cacheReady()\n\n initialServerReactController.abort()\n\n // We don't need to continue the prerender process if we already\n // detected invalid dynamic usage in the initial prerender phase.\n const { invalidDynamicUsageError } = workStore\n if (invalidDynamicUsageError) {\n resolveValidation(\n createElement(LogSafely, {\n fn: () => {\n console.error(invalidDynamicUsageError)\n },\n })\n )\n return\n }\n\n let initialServerResult\n try {\n initialServerResult = await createReactServerPrerenderResult(\n pendingInitialServerResult\n )\n } catch (err) {\n if (\n initialServerReactController.signal.aborted ||\n initialServerPrerenderController.signal.aborted\n ) {\n // These are expected errors that might error the prerender. we ignore them.\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n // We don't normally log these errors because we are going to retry anyway but\n // it can be useful for debugging Next.js itself to get visibility here when needed\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n }\n\n if (initialServerResult) {\n const initialClientPrerenderController = new AbortController()\n const initialClientReactController = new AbortController()\n const initialClientRenderController = new AbortController()\n\n const initialClientPrerenderStore: PrerenderStore = {\n type: 'prerender-client',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n renderSignal: initialClientRenderController.signal,\n controller: initialClientPrerenderController,\n // For HTML Generation the only cache tracked activity\n // is module loading, which has it's own cache signal\n cacheSignal: null,\n dynamicTracking: null,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache: null,\n hmrRefreshHash: undefined,\n captureOwnerStack: captureOwnerStackClient,\n }\n\n const prerender = (\n require('react-dom/static') as typeof import('react-dom/static')\n ).prerender\n const pendingInitialClientResult = workUnitAsyncStorage.run(\n initialClientPrerenderStore,\n prerender,\n // eslint-disable-next-line @next/internal/no-ambiguous-jsx -- React Client\n <App\n reactServerStream={initialServerResult.asUnclosingStream()}\n reactDebugStream={undefined}\n preinitScripts={preinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n {\n signal: initialClientReactController.signal,\n onError: (err) => {\n const digest = getDigestForWellKnownError(err)\n\n if (digest) {\n return digest\n }\n\n if (isReactLargeShellError(err)) {\n // TODO: Aggregate\n console.error(err)\n return undefined\n }\n\n if (initialClientReactController.signal.aborted) {\n // These are expected errors that might error the prerender. we ignore them.\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n // We don't normally log these errors because we are going to retry anyway but\n // it can be useful for debugging Next.js itself to get visibility here when needed\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n },\n // We don't need bootstrap scripts in this prerender\n // bootstrapScripts: [bootstrapScript],\n }\n )\n\n // The listener to abort our own render controller must be added after React\n // has added its listener, to ensure that pending I/O is not\n // aborted/rejected too early.\n initialClientReactController.signal.addEventListener(\n 'abort',\n () => {\n initialClientRenderController.abort()\n },\n { once: true }\n )\n\n pendingInitialClientResult.catch((err) => {\n if (\n initialClientReactController.signal.aborted ||\n isPrerenderInterruptedError(err)\n ) {\n // These are expected errors that might error the prerender. we ignore them.\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n // We don't normally log these errors because we are going to retry anyway but\n // it can be useful for debugging Next.js itself to get visibility here when needed\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n })\n\n // This is mostly needed for dynamic `import()`s in client components.\n // Promises passed to client were already awaited above (assuming that they came from cached functions)\n trackPendingModules(cacheSignal)\n await cacheSignal.cacheReady()\n initialClientReactController.abort()\n }\n\n const finalServerReactController = new AbortController()\n const finalServerRenderController = new AbortController()\n\n const finalServerPayloadPrerenderStore: PrerenderStore = {\n type: 'prerender',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n // While this render signal isn't going to be used to abort a React render while getting the RSC payload\n // various request data APIs bind to this controller to reject after completion.\n renderSignal: finalServerRenderController.signal,\n // When we generate the RSC payload we might abort this controller due to sync IO\n // but we don't actually care about sync IO in this phase so we use a throw away controller\n // that isn't connected to anything\n controller: new AbortController(),\n // All caches we could read must already be filled so no tracking is necessary\n cacheSignal: null,\n dynamicTracking: null,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache: null,\n hmrRefreshHash,\n captureOwnerStack: captureOwnerStackServer,\n }\n\n const finalAttemptRSCPayload = await workUnitAsyncStorage.run(\n finalServerPayloadPrerenderStore,\n getRSCPayload,\n tree,\n ctx,\n isNotFound\n )\n\n const serverDynamicTracking = createDynamicTrackingState(\n false // isDebugDynamicAccesses\n )\n\n const finalServerPrerenderStore: PrerenderStore = {\n type: 'prerender',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n renderSignal: finalServerRenderController.signal,\n controller: finalServerReactController,\n // All caches we could read must already be filled so no tracking is necessary\n cacheSignal: null,\n dynamicTracking: serverDynamicTracking,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache: null,\n hmrRefreshHash,\n captureOwnerStack: captureOwnerStackServer,\n }\n\n const reactServerResult = await createReactServerPrerenderResult(\n prerenderAndAbortInSequentialTasks(\n async () => {\n const pendingPrerenderResult = workUnitAsyncStorage.run(\n // The store to scope\n finalServerPrerenderStore,\n // The function to run\n ComponentMod.prerender,\n // ... the arguments for the function to run\n finalAttemptRSCPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: (err: unknown) => {\n if (\n finalServerReactController.signal.aborted &&\n isPrerenderInterruptedError(err)\n ) {\n return err.digest\n }\n\n if (isReactLargeShellError(err)) {\n // TODO: Aggregate\n console.error(err)\n return undefined\n }\n\n return getDigestForWellKnownError(err)\n },\n signal: finalServerReactController.signal,\n }\n )\n\n // The listener to abort our own render controller must be added after\n // React has added its listener, to ensure that pending I/O is not\n // aborted/rejected too early.\n finalServerReactController.signal.addEventListener(\n 'abort',\n () => {\n finalServerRenderController.abort()\n },\n { once: true }\n )\n\n return pendingPrerenderResult\n },\n () => {\n finalServerReactController.abort()\n }\n )\n )\n\n const clientDynamicTracking = createDynamicTrackingState(\n false //isDebugDynamicAccesses\n )\n const finalClientReactController = new AbortController()\n const finalClientRenderController = new AbortController()\n\n const finalClientPrerenderStore: PrerenderStore = {\n type: 'prerender-client',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n renderSignal: finalClientRenderController.signal,\n controller: finalClientReactController,\n // No APIs require a cacheSignal through the workUnitStore during the HTML prerender\n cacheSignal: null,\n dynamicTracking: clientDynamicTracking,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache: null,\n hmrRefreshHash,\n captureOwnerStack: captureOwnerStackClient,\n }\n\n let dynamicValidation = createDynamicValidationState()\n\n try {\n const prerender = (\n require('react-dom/static') as typeof import('react-dom/static')\n ).prerender\n let { prelude: unprocessedPrelude } =\n await prerenderAndAbortInSequentialTasks(\n () => {\n const pendingFinalClientResult = workUnitAsyncStorage.run(\n finalClientPrerenderStore,\n prerender,\n // eslint-disable-next-line @next/internal/no-ambiguous-jsx -- React Client\n <App\n reactServerStream={reactServerResult.asUnclosingStream()}\n reactDebugStream={undefined}\n preinitScripts={preinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n {\n signal: finalClientReactController.signal,\n onError: (err: unknown, errorInfo: ErrorInfo) => {\n if (\n isPrerenderInterruptedError(err) ||\n finalClientReactController.signal.aborted\n ) {\n const componentStack = errorInfo.componentStack\n if (typeof componentStack === 'string') {\n trackAllowedDynamicAccess(\n workStore,\n componentStack,\n dynamicValidation,\n clientDynamicTracking\n )\n }\n return\n }\n\n if (isReactLargeShellError(err)) {\n // TODO: Aggregate\n console.error(err)\n return undefined\n }\n\n return getDigestForWellKnownError(err)\n },\n // We don't need bootstrap scripts in this prerender\n // bootstrapScripts: [bootstrapScript],\n }\n )\n\n // The listener to abort our own render controller must be added after\n // React has added its listener, to ensure that pending I/O is not\n // aborted/rejected too early.\n finalClientReactController.signal.addEventListener(\n 'abort',\n () => {\n finalClientRenderController.abort()\n },\n { once: true }\n )\n\n return pendingFinalClientResult\n },\n () => {\n finalClientReactController.abort()\n }\n )\n\n const { preludeIsEmpty } = await processPrelude(unprocessedPrelude)\n resolveValidation(\n createElement(LogSafely, {\n fn: throwIfDisallowedDynamic.bind(\n null,\n workStore,\n preludeIsEmpty ? PreludeState.Empty : PreludeState.Full,\n dynamicValidation,\n serverDynamicTracking\n ),\n })\n )\n } catch (thrownValue) {\n // Even if the root errors we still want to report any cache components errors\n // that were discovered before the root errored.\n\n let loggingFunction = throwIfDisallowedDynamic.bind(\n null,\n workStore,\n PreludeState.Errored,\n dynamicValidation,\n serverDynamicTracking\n )\n\n if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {\n // We don't normally log these errors because we are going to retry anyway but\n // it can be useful for debugging Next.js itself to get visibility here when needed\n const originalLoggingFunction = loggingFunction\n loggingFunction = () => {\n console.error(\n 'During dynamic validation the root of the page errored. The next logged error is the thrown value. It may be a duplicate of errors reported during the normal development mode render.'\n )\n console.error(thrownValue)\n originalLoggingFunction()\n }\n }\n\n resolveValidation(\n createElement(LogSafely, {\n fn: loggingFunction,\n })\n )\n }\n}\n\nasync function LogSafely({ fn }: { fn: () => unknown }) {\n try {\n await fn()\n } catch {}\n return null\n}\n\ntype PrerenderToStreamResult = {\n stream: ReadableStream<Uint8Array>\n digestErrorsMap: Map<string, DigestedError>\n ssrErrors: Array<unknown>\n dynamicAccess?: null | Array<DynamicAccess>\n collectedRevalidate: number\n collectedExpire: number\n collectedStale: number\n collectedTags: null | string[]\n renderResumeDataCache?: RenderResumeDataCache\n}\n\n/**\n * Determines whether we should generate static flight data.\n */\nfunction shouldGenerateStaticFlightData(workStore: WorkStore): boolean {\n const { isStaticGeneration } = workStore\n if (!isStaticGeneration) return false\n\n return true\n}\n\nasync function prerenderToStream(\n req: BaseNextRequest,\n res: BaseNextResponse,\n ctx: AppRenderContext,\n metadata: AppPageRenderResultMetadata,\n tree: LoaderTree,\n fallbackRouteParams: OpaqueFallbackRouteParams | null\n): Promise<PrerenderToStreamResult> {\n // When prerendering formState is always null. We still include it\n // because some shared APIs expect a formState value and this is slightly\n // more explicit than making it an optional function argument\n const formState = null\n\n const {\n assetPrefix,\n getDynamicParamFromSegment,\n implicitTags,\n nonce,\n pagePath,\n renderOpts,\n workStore,\n } = ctx\n\n const {\n allowEmptyStaticShell = false,\n basePath,\n buildManifest,\n clientReferenceManifest,\n ComponentMod,\n crossOrigin,\n dev = false,\n experimental,\n isDebugDynamicAccesses,\n nextExport = false,\n onInstrumentationRequestError,\n page,\n reactMaxHeadersLength,\n subresourceIntegrityManifest,\n cacheComponents,\n } = renderOpts\n\n assertClientReferenceManifest(clientReferenceManifest)\n\n const rootParams = getRootParams(tree, getDynamicParamFromSegment)\n\n const { ServerInsertedHTMLProvider, renderServerInsertedHTML } =\n createServerInsertedHTML()\n const getServerInsertedMetadata = createServerInsertedMetadata(nonce)\n\n const tracingMetadata = getTracedMetadata(\n getTracer().getTracePropagationData(),\n experimental.clientTraceMetadata\n )\n\n const polyfills: JSX.IntrinsicElements['script'][] =\n buildManifest.polyfillFiles\n .filter(\n (polyfill) =>\n polyfill.endsWith('.js') && !polyfill.endsWith('.module.js')\n )\n .map((polyfill) => ({\n src: `${assetPrefix}/_next/${polyfill}${getAssetQueryString(\n ctx,\n false\n )}`,\n integrity: subresourceIntegrityManifest?.[polyfill],\n crossOrigin,\n noModule: true,\n nonce,\n }))\n\n const [preinitScripts, bootstrapScript] = getRequiredScripts(\n buildManifest,\n // Why is assetPrefix optional on renderOpts?\n // @TODO make it default empty string on renderOpts and get rid of it from ctx\n assetPrefix,\n crossOrigin,\n subresourceIntegrityManifest,\n getAssetQueryString(ctx, true),\n nonce,\n page\n )\n\n const reactServerErrorsByDigest: Map<string, DigestedError> = new Map()\n // We don't report errors during prerendering through our instrumentation hooks\n const silenceLogger = !!experimental.isRoutePPREnabled\n function onHTMLRenderRSCError(err: DigestedError) {\n return onInstrumentationRequestError?.(\n err,\n req,\n createErrorContext(ctx, 'react-server-components')\n )\n }\n const serverComponentsErrorHandler = createHTMLReactServerErrorHandler(\n dev,\n nextExport,\n reactServerErrorsByDigest,\n silenceLogger,\n onHTMLRenderRSCError\n )\n\n function onHTMLRenderSSRError(err: DigestedError) {\n return onInstrumentationRequestError?.(\n err,\n req,\n createErrorContext(ctx, 'server-rendering')\n )\n }\n const allCapturedErrors: Array<unknown> = []\n const htmlRendererErrorHandler = createHTMLErrorHandler(\n dev,\n nextExport,\n reactServerErrorsByDigest,\n allCapturedErrors,\n silenceLogger,\n onHTMLRenderSSRError\n )\n\n let reactServerPrerenderResult: null | ReactServerPrerenderResult = null\n const setMetadataHeader = (name: string) => {\n metadata.headers ??= {}\n metadata.headers[name] = res.getHeader(name)\n }\n const setHeader = (name: string, value: string | string[]) => {\n res.setHeader(name, value)\n setMetadataHeader(name)\n return res\n }\n const appendHeader = (name: string, value: string | string[]) => {\n if (Array.isArray(value)) {\n value.forEach((item) => {\n res.appendHeader(name, item)\n })\n } else {\n res.appendHeader(name, value)\n }\n setMetadataHeader(name)\n }\n\n const selectStaleTime = createSelectStaleTime(experimental)\n\n let prerenderStore: PrerenderStore | null = null\n\n try {\n if (cacheComponents) {\n /**\n * cacheComponents with PPR\n *\n * The general approach is to render the RSC stream first allowing any cache reads to resolve.\n * Once we have settled all cache reads we restart the render and abort after a single Task.\n *\n * Unlike with the non PPR case we can't synchronously abort the render when a dynamic API is used\n * during the initial render because we need to ensure all caches can be filled as part of the initial Task\n * and a synchronous abort might prevent us from filling all caches.\n *\n * Once the render is complete we allow the SSR render to finish and use a combination of the postponed state\n * and the reactServerIsDynamic value to determine how to treat the resulting render\n */\n\n // The prerender controller represents the lifetime of the prerender. It\n // will be aborted when a task is complete or a synchronously aborting API\n // is called. Notably, during prospective prerenders, this does not\n // actually terminate the prerender itself, which will continue until all\n // caches are filled.\n const initialServerPrerenderController = new AbortController()\n\n // This controller is used to abort the React prerender.\n const initialServerReactController = new AbortController()\n\n // This controller represents the lifetime of the React prerender. Its\n // signal can be used for any I/O operation to abort the I/O and/or to\n // reject, when prerendering aborts. This includes our own hanging\n // promises for accessing request data, and for fetch calls. It might be\n // replaced in the future by React.cacheSignal(). It's aborted after the\n // React controller, so that no pending I/O can register abort listeners\n // that are called before React's abort listener is called. This ensures\n // that pending I/O is not rejected too early when aborting the prerender.\n // Notably, during the prospective prerender, it is different from the\n // prerender controller because we don't want to end the React prerender\n // until all caches are filled.\n const initialServerRenderController = new AbortController()\n\n // The cacheSignal helps us track whether caches are still filling or we are ready\n // to cut the render off.\n const cacheSignal = new CacheSignal()\n\n let resumeDataCache: RenderResumeDataCache | PrerenderResumeDataCache\n let renderResumeDataCache: RenderResumeDataCache | null = null\n let prerenderResumeDataCache: PrerenderResumeDataCache | null = null\n\n if (renderOpts.renderResumeDataCache) {\n // If a prefilled immutable render resume data cache is provided, e.g.\n // when prerendering an optional fallback shell after having prerendered\n // pages with defined params, we use this instead of a prerender resume\n // data cache.\n resumeDataCache = renderResumeDataCache =\n renderOpts.renderResumeDataCache\n } else {\n // Otherwise we create a new mutable prerender resume data cache.\n resumeDataCache = prerenderResumeDataCache =\n createPrerenderResumeDataCache()\n }\n\n const initialServerPayloadPrerenderStore: PrerenderStore = {\n type: 'prerender',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n // While this render signal isn't going to be used to abort a React render while getting the RSC payload\n // various request data APIs bind to this controller to reject after completion.\n renderSignal: initialServerRenderController.signal,\n // When we generate the RSC payload we might abort this controller due to sync IO\n // but we don't actually care about sync IO in this phase so we use a throw away controller\n // that isn't connected to anything\n controller: new AbortController(),\n // During the initial prerender we need to track all cache reads to ensure\n // we render long enough to fill every cache it is possible to visit during\n // the final prerender.\n cacheSignal,\n dynamicTracking: null,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined, // Not available in production.\n }\n\n // We're not going to use the result of this render because the only time it could be used\n // is if it completes in a microtask and that's likely very rare for any non-trivial app\n const initialServerPayload = await workUnitAsyncStorage.run(\n initialServerPayloadPrerenderStore,\n getRSCPayload,\n tree,\n ctx,\n res.statusCode === 404\n )\n\n const initialServerPrerenderStore: PrerenderStore = (prerenderStore = {\n type: 'prerender',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n renderSignal: initialServerRenderController.signal,\n controller: initialServerPrerenderController,\n // During the initial prerender we need to track all cache reads to ensure\n // we render long enough to fill every cache it is possible to visit during\n // the final prerender.\n cacheSignal,\n dynamicTracking: null,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined, // Not available in production.\n })\n\n const pendingInitialServerResult = workUnitAsyncStorage.run(\n initialServerPrerenderStore,\n ComponentMod.prerender,\n initialServerPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: (err) => {\n const digest = getDigestForWellKnownError(err)\n\n if (digest) {\n return digest\n }\n\n if (isReactLargeShellError(err)) {\n // TODO: Aggregate\n console.error(err)\n return undefined\n }\n\n if (initialServerPrerenderController.signal.aborted) {\n // The render aborted before this error was handled which indicates\n // the error is caused by unfinished components within the render\n return\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n },\n // we don't care to track postpones during the prospective render because we need\n // to always do a final render anyway\n onPostpone: undefined,\n // We don't want to stop rendering until the cacheSignal is complete so we pass\n // a different signal to this render call than is used by dynamic APIs to signify\n // transitioning out of the prerender environment\n signal: initialServerReactController.signal,\n }\n )\n\n // The listener to abort our own render controller must be added after\n // React has added its listener, to ensure that pending I/O is not\n // aborted/rejected too early.\n initialServerReactController.signal.addEventListener(\n 'abort',\n () => {\n initialServerRenderController.abort()\n initialServerPrerenderController.abort()\n },\n { once: true }\n )\n\n // Wait for all caches to be finished filling and for async imports to resolve\n trackPendingModules(cacheSignal)\n await cacheSignal.cacheReady()\n\n initialServerReactController.abort()\n\n // We don't need to continue the prerender process if we already\n // detected invalid dynamic usage in the initial prerender phase.\n if (workStore.invalidDynamicUsageError) {\n logDisallowedDynamicError(workStore, workStore.invalidDynamicUsageError)\n throw new StaticGenBailoutError()\n }\n\n let initialServerResult\n try {\n initialServerResult = await createReactServerPrerenderResult(\n pendingInitialServerResult\n )\n } catch (err) {\n if (\n initialServerReactController.signal.aborted ||\n initialServerPrerenderController.signal.aborted\n ) {\n // These are expected errors that might error the prerender. we ignore them.\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n // We don't normally log these errors because we are going to retry anyway but\n // it can be useful for debugging Next.js itself to get visibility here when needed\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n }\n\n if (initialServerResult) {\n const initialClientPrerenderController = new AbortController()\n const initialClientReactController = new AbortController()\n const initialClientRenderController = new AbortController()\n\n const initialClientPrerenderStore: PrerenderStore = {\n type: 'prerender-client',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n renderSignal: initialClientRenderController.signal,\n controller: initialClientPrerenderController,\n // For HTML Generation the only cache tracked activity\n // is module loading, which has it's own cache signal\n cacheSignal: null,\n dynamicTracking: null,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined, // Not available in production.\n }\n\n const prerender = (\n require('react-dom/static') as typeof import('react-dom/static')\n ).prerender\n const pendingInitialClientResult = workUnitAsyncStorage.run(\n initialClientPrerenderStore,\n prerender,\n // eslint-disable-next-line @next/internal/no-ambiguous-jsx\n <App\n reactServerStream={initialServerResult.asUnclosingStream()}\n reactDebugStream={undefined}\n preinitScripts={preinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n {\n signal: initialClientReactController.signal,\n onError: (err) => {\n const digest = getDigestForWellKnownError(err)\n\n if (digest) {\n return digest\n }\n\n if (isReactLargeShellError(err)) {\n // TODO: Aggregate\n console.error(err)\n return undefined\n }\n\n if (initialClientReactController.signal.aborted) {\n // These are expected errors that might error the prerender. we ignore them.\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n // We don't normally log these errors because we are going to retry anyway but\n // it can be useful for debugging Next.js itself to get visibility here when needed\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n },\n bootstrapScripts: [bootstrapScript],\n }\n )\n\n // The listener to abort our own render controller must be added after\n // React has added its listener, to ensure that pending I/O is not\n // aborted/rejected too early.\n initialClientReactController.signal.addEventListener(\n 'abort',\n () => {\n initialClientRenderController.abort()\n },\n { once: true }\n )\n\n pendingInitialClientResult.catch((err) => {\n if (\n initialClientReactController.signal.aborted ||\n isPrerenderInterruptedError(err)\n ) {\n // These are expected errors that might error the prerender. we ignore them.\n } else if (\n process.env.NEXT_DEBUG_BUILD ||\n process.env.__NEXT_VERBOSE_LOGGING\n ) {\n // We don't normally log these errors because we are going to retry anyway but\n // it can be useful for debugging Next.js itself to get visibility here when needed\n printDebugThrownValueForProspectiveRender(err, workStore.route)\n }\n })\n\n // This is mostly needed for dynamic `import()`s in client components.\n // Promises passed to client were already awaited above (assuming that they came from cached functions)\n trackPendingModules(cacheSignal)\n await cacheSignal.cacheReady()\n initialClientReactController.abort()\n }\n\n const finalServerReactController = new AbortController()\n const finalServerRenderController = new AbortController()\n\n const finalServerPayloadPrerenderStore: PrerenderStore = {\n type: 'prerender',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n // While this render signal isn't going to be used to abort a React render while getting the RSC payload\n // various request data APIs bind to this controller to reject after completion.\n renderSignal: finalServerRenderController.signal,\n // When we generate the RSC payload we might abort this controller due to sync IO\n // but we don't actually care about sync IO in this phase so we use a throw away controller\n // that isn't connected to anything\n controller: new AbortController(),\n // All caches we could read must already be filled so no tracking is necessary\n cacheSignal: null,\n dynamicTracking: null,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined, // Not available in production.\n }\n\n const finalAttemptRSCPayload = await workUnitAsyncStorage.run(\n finalServerPayloadPrerenderStore,\n getRSCPayload,\n tree,\n ctx,\n res.statusCode === 404\n )\n\n const serverDynamicTracking = createDynamicTrackingState(\n isDebugDynamicAccesses\n )\n let serverIsDynamic = false\n\n const finalServerPrerenderStore: PrerenderStore = (prerenderStore = {\n type: 'prerender',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n renderSignal: finalServerRenderController.signal,\n controller: finalServerReactController,\n // All caches we could read must already be filled so no tracking is necessary\n cacheSignal: null,\n dynamicTracking: serverDynamicTracking,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined, // Not available in production.\n })\n\n let prerenderIsPending = true\n const reactServerResult = (reactServerPrerenderResult =\n await createReactServerPrerenderResult(\n prerenderAndAbortInSequentialTasks(\n async () => {\n const pendingPrerenderResult = workUnitAsyncStorage.run(\n // The store to scope\n finalServerPrerenderStore,\n // The function to run\n ComponentMod.prerender,\n // ... the arguments for the function to run\n finalAttemptRSCPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: (err: unknown) => {\n return serverComponentsErrorHandler(err)\n },\n signal: finalServerReactController.signal,\n }\n )\n\n // The listener to abort our own render controller must be added\n // after React has added its listener, to ensure that pending I/O\n // is not aborted/rejected too early.\n finalServerReactController.signal.addEventListener(\n 'abort',\n () => {\n finalServerRenderController.abort()\n },\n { once: true }\n )\n\n const prerenderResult = await pendingPrerenderResult\n prerenderIsPending = false\n\n return prerenderResult\n },\n () => {\n if (finalServerReactController.signal.aborted) {\n // If the server controller is already aborted we must have called something\n // that required aborting the prerender synchronously such as with new Date()\n serverIsDynamic = true\n return\n }\n\n if (prerenderIsPending) {\n // If prerenderIsPending then we have blocked for longer than a Task and we assume\n // there is something unfinished.\n serverIsDynamic = true\n }\n\n finalServerReactController.abort()\n }\n )\n ))\n\n const clientDynamicTracking = createDynamicTrackingState(\n isDebugDynamicAccesses\n )\n\n const finalClientReactController = new AbortController()\n const finalClientRenderController = new AbortController()\n\n const finalClientPrerenderStore: PrerenderStore = {\n type: 'prerender-client',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n renderSignal: finalClientRenderController.signal,\n controller: finalClientReactController,\n // No APIs require a cacheSignal through the workUnitStore during the HTML prerender\n cacheSignal: null,\n dynamicTracking: clientDynamicTracking,\n allowEmptyStaticShell,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n renderResumeDataCache,\n hmrRefreshHash: undefined,\n captureOwnerStack: undefined, // Not available in production.\n }\n\n let dynamicValidation = createDynamicValidationState()\n\n const prerender = (\n require('react-dom/static') as typeof import('react-dom/static')\n ).prerender\n let { prelude: unprocessedPrelude, postponed } =\n await prerenderAndAbortInSequentialTasks(\n () => {\n const pendingFinalClientResult = workUnitAsyncStorage.run(\n finalClientPrerenderStore,\n prerender,\n // eslint-disable-next-line @next/internal/no-ambiguous-jsx\n <App\n reactServerStream={reactServerResult.asUnclosingStream()}\n reactDebugStream={undefined}\n preinitScripts={preinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n {\n signal: finalClientReactController.signal,\n onError: (err: unknown, errorInfo: ErrorInfo) => {\n if (\n isPrerenderInterruptedError(err) ||\n finalClientReactController.signal.aborted\n ) {\n const componentStack: string | undefined = (\n errorInfo as any\n ).componentStack\n if (typeof componentStack === 'string') {\n trackAllowedDynamicAccess(\n workStore,\n componentStack,\n dynamicValidation,\n clientDynamicTracking\n )\n }\n return\n }\n\n return htmlRendererErrorHandler(err, errorInfo)\n },\n onHeaders: (headers: Headers) => {\n headers.forEach((value, key) => {\n appendHeader(key, value)\n })\n },\n maxHeadersLength: reactMaxHeadersLength,\n bootstrapScripts: [bootstrapScript],\n }\n )\n\n // The listener to abort our own render controller must be added\n // after React has added its listener, to ensure that pending I/O is\n // not aborted/rejected too early.\n finalClientReactController.signal.addEventListener(\n 'abort',\n () => {\n finalClientRenderController.abort()\n },\n { once: true }\n )\n\n return pendingFinalClientResult\n },\n () => {\n finalClientReactController.abort()\n }\n )\n\n const { prelude, preludeIsEmpty } =\n await processPrelude(unprocessedPrelude)\n\n // If we've disabled throwing on empty static shell, then we don't need to\n // track any dynamic access that occurs above the suspense boundary because\n // we'll do so in the route shell.\n if (!allowEmptyStaticShell) {\n throwIfDisallowedDynamic(\n workStore,\n preludeIsEmpty ? PreludeState.Empty : PreludeState.Full,\n dynamicValidation,\n serverDynamicTracking\n )\n }\n\n const getServerInsertedHTML = makeGetServerInsertedHTML({\n polyfills,\n renderServerInsertedHTML,\n serverCapturedErrors: allCapturedErrors,\n basePath,\n tracingMetadata: tracingMetadata,\n })\n\n const flightData = await streamToBuffer(reactServerResult.asStream())\n metadata.flightData = flightData\n metadata.segmentData = await collectSegmentData(\n flightData,\n finalServerPrerenderStore,\n ComponentMod,\n renderOpts\n )\n\n if (serverIsDynamic) {\n // Dynamic case\n // We will always need to perform a \"resume\" render of some kind when this route is accessed\n // because the RSC data itself is dynamic. We determine if there are any HTML holes or not\n // but generally this is a \"partial\" prerender in that there will be a per-request compute\n // concatenated to the static shell.\n if (postponed != null) {\n // Dynamic HTML case\n metadata.postponed = await getDynamicHTMLPostponedState(\n postponed,\n preludeIsEmpty\n ? DynamicHTMLPreludeState.Empty\n : DynamicHTMLPreludeState.Full,\n fallbackRouteParams,\n resumeDataCache,\n cacheComponents\n )\n } else {\n // Dynamic Data case\n metadata.postponed = await getDynamicDataPostponedState(\n resumeDataCache,\n cacheComponents\n )\n }\n reactServerResult.consume()\n return {\n digestErrorsMap: reactServerErrorsByDigest,\n ssrErrors: allCapturedErrors,\n stream: await continueDynamicPrerender(prelude, {\n getServerInsertedHTML,\n getServerInsertedMetadata,\n }),\n dynamicAccess: consumeDynamicAccess(\n serverDynamicTracking,\n clientDynamicTracking\n ),\n // TODO: Should this include the SSR pass?\n collectedRevalidate: finalServerPrerenderStore.revalidate,\n collectedExpire: finalServerPrerenderStore.expire,\n collectedStale: selectStaleTime(finalServerPrerenderStore.stale),\n collectedTags: finalServerPrerenderStore.tags,\n renderResumeDataCache: createRenderResumeDataCache(resumeDataCache),\n }\n } else {\n // Static case\n // We will not perform resumption per request. The result can be served statically to the requestor\n // and if there was anything dynamic it will only be rendered in the browser.\n if (workStore.forceDynamic) {\n throw new StaticGenBailoutError(\n 'Invariant: a Page with `dynamic = \"force-dynamic\"` did not trigger the dynamic pathway. This is a bug in Next.js'\n )\n }\n\n let htmlStream = prelude\n if (postponed != null) {\n // We postponed but nothing dynamic was used. We resume the render now and immediately abort it\n // so we can set all the postponed boundaries to client render mode before we store the HTML response\n const resume = (\n require('react-dom/server') as typeof import('react-dom/server')\n ).resume\n\n // We don't actually want to render anything so we just pass a stream\n // that never resolves. The resume call is going to abort immediately anyway\n const foreverStream = new ReadableStream<Uint8Array>()\n\n const resumeStream = await resume(\n // eslint-disable-next-line @next/internal/no-ambiguous-jsx\n <App\n reactServerStream={foreverStream}\n reactDebugStream={undefined}\n preinitScripts={() => {}}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n JSON.parse(JSON.stringify(postponed)),\n {\n signal: createRenderInBrowserAbortSignal(),\n onError: htmlRendererErrorHandler,\n nonce,\n }\n )\n\n // First we write everything from the prerender, then we write everything from the aborted resume render\n htmlStream = chainStreams(prelude, resumeStream)\n }\n\n let finalStream\n const hasFallbackRouteParams =\n fallbackRouteParams && fallbackRouteParams.size > 0\n if (hasFallbackRouteParams) {\n // This is a \"static fallback\" prerender: although the page didn't\n // access any runtime params in a Server Component, it may have\n // accessed a runtime param in a client segment.\n //\n // TODO: If there were no client segments, we can use the fully static\n // path instead.\n //\n // Rather than use a dynamic server resume to fill in the params,\n // we can rely on the client to parse the params from the URL and use\n // that to hydrate the page.\n //\n // Send an empty InitialRSCPayload to the server component renderer\n // The data will be fetched by the client instead.\n // TODO: In the future, rather than defer the entire hydration payload\n // to be fetched by the client, we should only defer the client\n // segments, since those are the only ones whose data is not complete.\n const emptyReactServerResult =\n await createReactServerPrerenderResultFromRender(\n ComponentMod.renderToReadableStream(\n [],\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: serverComponentsErrorHandler,\n }\n )\n )\n finalStream = await continueStaticFallbackPrerender(htmlStream, {\n inlinedDataStream: createInlinedDataReadableStream(\n emptyReactServerResult.consumeAsStream(),\n nonce,\n formState\n ),\n getServerInsertedHTML,\n getServerInsertedMetadata,\n isBuildTimePrerendering:\n ctx.workStore.isBuildTimePrerendering === true,\n buildId: ctx.workStore.buildId,\n })\n } else {\n // Normal static prerender case, no fallback param handling needed\n finalStream = await continueStaticPrerender(htmlStream, {\n inlinedDataStream: createInlinedDataReadableStream(\n reactServerResult.consumeAsStream(),\n nonce,\n formState\n ),\n getServerInsertedHTML,\n getServerInsertedMetadata,\n isBuildTimePrerendering:\n ctx.workStore.isBuildTimePrerendering === true,\n buildId: ctx.workStore.buildId,\n })\n }\n\n return {\n digestErrorsMap: reactServerErrorsByDigest,\n ssrErrors: allCapturedErrors,\n stream: finalStream,\n dynamicAccess: consumeDynamicAccess(\n serverDynamicTracking,\n clientDynamicTracking\n ),\n // TODO: Should this include the SSR pass?\n collectedRevalidate: finalServerPrerenderStore.revalidate,\n collectedExpire: finalServerPrerenderStore.expire,\n collectedStale: selectStaleTime(finalServerPrerenderStore.stale),\n collectedTags: finalServerPrerenderStore.tags,\n renderResumeDataCache: createRenderResumeDataCache(resumeDataCache),\n }\n }\n } else if (experimental.isRoutePPREnabled) {\n // We're statically generating with PPR and need to do dynamic tracking\n let dynamicTracking = createDynamicTrackingState(isDebugDynamicAccesses)\n\n const prerenderResumeDataCache = createPrerenderResumeDataCache()\n const reactServerPrerenderStore: PrerenderStore = (prerenderStore = {\n type: 'prerender-ppr',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n dynamicTracking,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n })\n const RSCPayload = await workUnitAsyncStorage.run(\n reactServerPrerenderStore,\n getRSCPayload,\n tree,\n ctx,\n res.statusCode === 404\n )\n const reactServerResult = (reactServerPrerenderResult =\n await createReactServerPrerenderResultFromRender(\n workUnitAsyncStorage.run(\n reactServerPrerenderStore,\n ComponentMod.renderToReadableStream,\n // ... the arguments for the function to run\n RSCPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: serverComponentsErrorHandler,\n }\n )\n ))\n\n const ssrPrerenderStore: PrerenderStore = {\n type: 'prerender-ppr',\n phase: 'render',\n rootParams,\n fallbackRouteParams,\n implicitTags,\n dynamicTracking,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n prerenderResumeDataCache,\n }\n const prerender = (\n require('react-dom/static') as typeof import('react-dom/static')\n ).prerender\n const { prelude: unprocessedPrelude, postponed } =\n await workUnitAsyncStorage.run(\n ssrPrerenderStore,\n prerender,\n // eslint-disable-next-line @next/internal/no-ambiguous-jsx\n <App\n reactServerStream={reactServerResult.asUnclosingStream()}\n reactDebugStream={undefined}\n preinitScripts={preinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n {\n onError: htmlRendererErrorHandler,\n onHeaders: (headers: Headers) => {\n headers.forEach((value, key) => {\n appendHeader(key, value)\n })\n },\n maxHeadersLength: reactMaxHeadersLength,\n bootstrapScripts: [bootstrapScript],\n }\n )\n const getServerInsertedHTML = makeGetServerInsertedHTML({\n polyfills,\n renderServerInsertedHTML,\n serverCapturedErrors: allCapturedErrors,\n basePath,\n tracingMetadata: tracingMetadata,\n })\n\n // After awaiting here we've waited for the entire RSC render to complete. Crucially this means\n // that when we detect whether we've used dynamic APIs below we know we'll have picked up even\n // parts of the React Server render that might not be used in the SSR render.\n const flightData = await streamToBuffer(reactServerResult.asStream())\n\n if (shouldGenerateStaticFlightData(workStore)) {\n metadata.flightData = flightData\n metadata.segmentData = await collectSegmentData(\n flightData,\n ssrPrerenderStore,\n ComponentMod,\n renderOpts\n )\n }\n\n const { prelude, preludeIsEmpty } =\n await processPrelude(unprocessedPrelude)\n\n /**\n * When prerendering there are three outcomes to consider\n *\n * Dynamic HTML: The prerender has dynamic holes (caused by using Next.js Dynamic Rendering APIs)\n * We will need to resume this result when requests are handled and we don't include\n * any server inserted HTML or inlined flight data in the static HTML\n *\n * Dynamic Data: The prerender has no dynamic holes but dynamic APIs were used. We will not\n * resume this render when requests are handled but we will generate new inlined\n * flight data since it is dynamic and differences may end up reconciling on the client\n *\n * Static: The prerender has no dynamic holes and no dynamic APIs were used. We statically encode\n * all server inserted HTML and flight data\n */\n // First we check if we have any dynamic holes in our HTML prerender\n if (accessedDynamicData(dynamicTracking.dynamicAccesses)) {\n if (postponed != null) {\n // Dynamic HTML case.\n metadata.postponed = await getDynamicHTMLPostponedState(\n postponed,\n preludeIsEmpty\n ? DynamicHTMLPreludeState.Empty\n : DynamicHTMLPreludeState.Full,\n fallbackRouteParams,\n prerenderResumeDataCache,\n cacheComponents\n )\n } else {\n // Dynamic Data case.\n metadata.postponed = await getDynamicDataPostponedState(\n prerenderResumeDataCache,\n cacheComponents\n )\n }\n // Regardless of whether this is the Dynamic HTML or Dynamic Data case we need to ensure we include\n // server inserted html in the static response because the html that is part of the prerender may depend on it\n // It is possible in the set of stream transforms for Dynamic HTML vs Dynamic Data may differ but currently both states\n // require the same set so we unify the code path here\n reactServerResult.consume()\n return {\n digestErrorsMap: reactServerErrorsByDigest,\n ssrErrors: allCapturedErrors,\n stream: await continueDynamicPrerender(prelude, {\n getServerInsertedHTML,\n getServerInsertedMetadata,\n }),\n dynamicAccess: dynamicTracking.dynamicAccesses,\n // TODO: Should this include the SSR pass?\n collectedRevalidate: reactServerPrerenderStore.revalidate,\n collectedExpire: reactServerPrerenderStore.expire,\n collectedStale: selectStaleTime(reactServerPrerenderStore.stale),\n collectedTags: reactServerPrerenderStore.tags,\n }\n } else if (fallbackRouteParams && fallbackRouteParams.size > 0) {\n // Rendering the fallback case.\n metadata.postponed = await getDynamicDataPostponedState(\n prerenderResumeDataCache,\n cacheComponents\n )\n\n return {\n digestErrorsMap: reactServerErrorsByDigest,\n ssrErrors: allCapturedErrors,\n stream: await continueDynamicPrerender(prelude, {\n getServerInsertedHTML,\n getServerInsertedMetadata,\n }),\n dynamicAccess: dynamicTracking.dynamicAccesses,\n // TODO: Should this include the SSR pass?\n collectedRevalidate: reactServerPrerenderStore.revalidate,\n collectedExpire: reactServerPrerenderStore.expire,\n collectedStale: selectStaleTime(reactServerPrerenderStore.stale),\n collectedTags: reactServerPrerenderStore.tags,\n }\n } else {\n // Static case\n // We still have not used any dynamic APIs. At this point we can produce an entirely static prerender response\n if (workStore.forceDynamic) {\n throw new StaticGenBailoutError(\n 'Invariant: a Page with `dynamic = \"force-dynamic\"` did not trigger the dynamic pathway. This is a bug in Next.js'\n )\n }\n\n let htmlStream = prelude\n if (postponed != null) {\n // We postponed but nothing dynamic was used. We resume the render now and immediately abort it\n // so we can set all the postponed boundaries to client render mode before we store the HTML response\n const resume = (\n require('react-dom/server') as typeof import('react-dom/server')\n ).resume\n\n // We don't actually want to render anything so we just pass a stream\n // that never resolves. The resume call is going to abort immediately anyway\n const foreverStream = new ReadableStream<Uint8Array>()\n\n const resumeStream = await resume(\n // eslint-disable-next-line @next/internal/no-ambiguous-jsx\n <App\n reactServerStream={foreverStream}\n reactDebugStream={undefined}\n preinitScripts={() => {}}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n JSON.parse(JSON.stringify(postponed)),\n {\n signal: createRenderInBrowserAbortSignal(),\n onError: htmlRendererErrorHandler,\n nonce,\n }\n )\n\n // First we write everything from the prerender, then we write everything from the aborted resume render\n htmlStream = chainStreams(prelude, resumeStream)\n }\n\n return {\n digestErrorsMap: reactServerErrorsByDigest,\n ssrErrors: allCapturedErrors,\n stream: await continueStaticPrerender(htmlStream, {\n inlinedDataStream: createInlinedDataReadableStream(\n reactServerResult.consumeAsStream(),\n nonce,\n formState\n ),\n getServerInsertedHTML,\n getServerInsertedMetadata,\n isBuildTimePrerendering:\n ctx.workStore.isBuildTimePrerendering === true,\n buildId: ctx.workStore.buildId,\n }),\n dynamicAccess: dynamicTracking.dynamicAccesses,\n // TODO: Should this include the SSR pass?\n collectedRevalidate: reactServerPrerenderStore.revalidate,\n collectedExpire: reactServerPrerenderStore.expire,\n collectedStale: selectStaleTime(reactServerPrerenderStore.stale),\n collectedTags: reactServerPrerenderStore.tags,\n }\n }\n } else {\n const prerenderLegacyStore: PrerenderStore = (prerenderStore = {\n type: 'prerender-legacy',\n phase: 'render',\n rootParams,\n implicitTags,\n revalidate: INFINITE_CACHE,\n expire: INFINITE_CACHE,\n stale: INFINITE_CACHE,\n tags: [...implicitTags.tags],\n })\n // This is a regular static generation. We don't do dynamic tracking because we rely on\n // the old-school dynamic error handling to bail out of static generation\n const RSCPayload = await workUnitAsyncStorage.run(\n prerenderLegacyStore,\n getRSCPayload,\n tree,\n ctx,\n res.statusCode === 404\n )\n\n const reactServerResult = (reactServerPrerenderResult =\n await createReactServerPrerenderResultFromRender(\n workUnitAsyncStorage.run(\n prerenderLegacyStore,\n ComponentMod.renderToReadableStream,\n RSCPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: serverComponentsErrorHandler,\n }\n )\n ))\n\n const renderToReadableStream = (\n require('react-dom/server') as typeof import('react-dom/server')\n ).renderToReadableStream\n const htmlStream = await workUnitAsyncStorage.run(\n prerenderLegacyStore,\n renderToReadableStream,\n // eslint-disable-next-line @next/internal/no-ambiguous-jsx\n <App\n reactServerStream={reactServerResult.asUnclosingStream()}\n reactDebugStream={undefined}\n preinitScripts={preinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />,\n {\n onError: htmlRendererErrorHandler,\n nonce,\n bootstrapScripts: [bootstrapScript],\n }\n )\n\n if (shouldGenerateStaticFlightData(workStore)) {\n const flightData = await streamToBuffer(reactServerResult.asStream())\n metadata.flightData = flightData\n metadata.segmentData = await collectSegmentData(\n flightData,\n prerenderLegacyStore,\n ComponentMod,\n renderOpts\n )\n }\n\n const getServerInsertedHTML = makeGetServerInsertedHTML({\n polyfills,\n renderServerInsertedHTML,\n serverCapturedErrors: allCapturedErrors,\n basePath,\n tracingMetadata: tracingMetadata,\n })\n return {\n digestErrorsMap: reactServerErrorsByDigest,\n ssrErrors: allCapturedErrors,\n stream: await continueFizzStream(htmlStream, {\n inlinedDataStream: createInlinedDataReadableStream(\n reactServerResult.consumeAsStream(),\n nonce,\n formState\n ),\n isStaticGeneration: true,\n isBuildTimePrerendering:\n ctx.workStore.isBuildTimePrerendering === true,\n buildId: ctx.workStore.buildId,\n getServerInsertedHTML,\n getServerInsertedMetadata,\n }),\n // TODO: Should this include the SSR pass?\n collectedRevalidate: prerenderLegacyStore.revalidate,\n collectedExpire: prerenderLegacyStore.expire,\n collectedStale: selectStaleTime(prerenderLegacyStore.stale),\n collectedTags: prerenderLegacyStore.tags,\n }\n }\n } catch (err) {\n if (\n isStaticGenBailoutError(err) ||\n (typeof err === 'object' &&\n err !== null &&\n 'message' in err &&\n typeof err.message === 'string' &&\n err.message.includes(\n 'https://nextjs.org/docs/advanced-features/static-html-export'\n ))\n ) {\n // Ensure that \"next dev\" prints the red error overlay\n throw err\n }\n\n // If this is a static generation error, we need to throw it so that it\n // can be handled by the caller if we're in static generation mode.\n if (isDynamicServerError(err)) {\n throw err\n }\n\n // If a bailout made it to this point, it means it wasn't wrapped inside\n // a suspense boundary.\n const shouldBailoutToCSR = isBailoutToCSRError(err)\n if (shouldBailoutToCSR) {\n const stack = getStackWithoutErrorMessage(err)\n error(\n `${err.reason} should be wrapped in a suspense boundary at page \"${pagePath}\". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\\n${stack}`\n )\n\n throw err\n }\n\n // If we errored when we did not have an RSC stream to read from. This is\n // not just a render error, we need to throw early.\n if (reactServerPrerenderResult === null) {\n throw err\n }\n\n let errorType: MetadataErrorType | 'redirect' | undefined\n\n if (isHTTPAccessFallbackError(err)) {\n res.statusCode = getAccessFallbackHTTPStatus(err)\n metadata.statusCode = res.statusCode\n errorType = getAccessFallbackErrorTypeByStatus(res.statusCode)\n } else if (isRedirectError(err)) {\n errorType = 'redirect'\n res.statusCode = getRedirectStatusCodeFromError(err)\n metadata.statusCode = res.statusCode\n\n const redirectUrl = addPathPrefix(getURLFromRedirectError(err), basePath)\n\n setHeader('location', redirectUrl)\n } else if (!shouldBailoutToCSR) {\n res.statusCode = 500\n metadata.statusCode = res.statusCode\n }\n\n const [errorPreinitScripts, errorBootstrapScript] = getRequiredScripts(\n buildManifest,\n assetPrefix,\n crossOrigin,\n subresourceIntegrityManifest,\n getAssetQueryString(ctx, false),\n nonce,\n '/_not-found/page'\n )\n\n const prerenderLegacyStore: PrerenderStore = (prerenderStore = {\n type: 'prerender-legacy',\n phase: 'render',\n rootParams,\n implicitTags: implicitTags,\n revalidate:\n typeof prerenderStore?.revalidate !== 'undefined'\n ? prerenderStore.revalidate\n : INFINITE_CACHE,\n expire:\n typeof prerenderStore?.expire !== 'undefined'\n ? prerenderStore.expire\n : INFINITE_CACHE,\n stale:\n typeof prerenderStore?.stale !== 'undefined'\n ? prerenderStore.stale\n : INFINITE_CACHE,\n tags: [...(prerenderStore?.tags || implicitTags.tags)],\n })\n const errorRSCPayload = await workUnitAsyncStorage.run(\n prerenderLegacyStore,\n getErrorRSCPayload,\n tree,\n ctx,\n reactServerErrorsByDigest.has((err as any).digest) ? undefined : err,\n errorType\n )\n\n const errorServerStream = workUnitAsyncStorage.run(\n prerenderLegacyStore,\n ComponentMod.renderToReadableStream,\n errorRSCPayload,\n clientReferenceManifest.clientModules,\n {\n filterStackFrame,\n onError: serverComponentsErrorHandler,\n }\n )\n\n try {\n // TODO we should use the same prerender semantics that we initially rendered\n // with in this case too. The only reason why this is ok atm is because it's essentially\n // an empty page and no user code runs.\n const fizzStream = await workUnitAsyncStorage.run(\n prerenderLegacyStore,\n renderToInitialFizzStream,\n {\n ReactDOMServer:\n require('react-dom/server') as typeof import('react-dom/server'),\n element: (\n // eslint-disable-next-line @next/internal/no-ambiguous-jsx\n <ErrorApp\n reactServerStream={errorServerStream}\n reactDebugStream={undefined}\n ServerInsertedHTMLProvider={ServerInsertedHTMLProvider}\n preinitScripts={errorPreinitScripts}\n clientReferenceManifest={clientReferenceManifest}\n nonce={nonce}\n images={ctx.renderOpts.images}\n />\n ),\n streamOptions: {\n nonce,\n // Include hydration scripts in the HTML\n bootstrapScripts: [errorBootstrapScript],\n formState,\n },\n }\n )\n\n if (shouldGenerateStaticFlightData(workStore)) {\n const flightData = await streamToBuffer(\n reactServerPrerenderResult.asStream()\n )\n metadata.flightData = flightData\n metadata.segmentData = await collectSegmentData(\n flightData,\n prerenderLegacyStore,\n ComponentMod,\n renderOpts\n )\n }\n\n // This is intentionally using the readable datastream from the main\n // render rather than the flight data from the error page render\n const flightStream = reactServerPrerenderResult.consumeAsStream()\n\n return {\n // Returning the error that was thrown so it can be used to handle\n // the response in the caller.\n digestErrorsMap: reactServerErrorsByDigest,\n ssrErrors: allCapturedErrors,\n stream: await continueFizzStream(fizzStream, {\n inlinedDataStream: createInlinedDataReadableStream(\n flightStream,\n nonce,\n formState\n ),\n isStaticGeneration: true,\n isBuildTimePrerendering:\n ctx.workStore.isBuildTimePrerendering === true,\n buildId: ctx.workStore.buildId,\n getServerInsertedHTML: makeGetServerInsertedHTML({\n polyfills,\n renderServerInsertedHTML,\n serverCapturedErrors: [],\n basePath,\n tracingMetadata: tracingMetadata,\n }),\n getServerInsertedMetadata,\n validateRootLayout: dev,\n }),\n dynamicAccess: null,\n collectedRevalidate:\n prerenderStore !== null ? prerenderStore.revalidate : INFINITE_CACHE,\n collectedExpire:\n prerenderStore !== null ? prerenderStore.expire : INFINITE_CACHE,\n collectedStale: selectStaleTime(\n prerenderStore !== null ? prerenderStore.stale : INFINITE_CACHE\n ),\n collectedTags: prerenderStore !== null ? prerenderStore.tags : null,\n }\n } catch (finalErr: any) {\n if (\n process.env.NODE_ENV === 'development' &&\n isHTTPAccessFallbackError(finalErr)\n ) {\n const { bailOnRootNotFound } =\n require('../../client/components/dev-root-http-access-fallback-boundary') as typeof import('../../client/components/dev-root-http-access-fallback-boundary')\n bailOnRootNotFound()\n }\n throw finalErr\n }\n }\n}\n\nconst getGlobalErrorStyles = async (\n tree: LoaderTree,\n ctx: AppRenderContext\n): Promise<{\n GlobalError: GlobalErrorComponent\n styles: ReactNode | undefined\n}> => {\n const {\n modules: { 'global-error': globalErrorModule },\n } = parseLoaderTree(tree)\n\n const {\n componentMod: { createElement },\n } = ctx\n const GlobalErrorComponent: GlobalErrorComponent =\n ctx.componentMod.GlobalError\n let globalErrorStyles\n if (globalErrorModule) {\n const [, styles] = await createComponentStylesAndScripts({\n ctx,\n filePath: globalErrorModule[1],\n getComponent: globalErrorModule[0],\n injectedCSS: new Set(),\n injectedJS: new Set(),\n })\n globalErrorStyles = styles\n }\n if (ctx.renderOpts.dev) {\n const dir =\n (process.env.NEXT_RUNTIME === 'edge'\n ? process.env.__NEXT_EDGE_PROJECT_DIR\n : ctx.renderOpts.dir) || ''\n\n const globalErrorModulePath = normalizeConventionFilePath(\n dir,\n globalErrorModule?.[1]\n )\n if (globalErrorModulePath) {\n const SegmentViewNode = ctx.componentMod.SegmentViewNode\n globalErrorStyles =\n // This will be rendered next to GlobalError component under ErrorBoundary,\n // it requires a key to avoid React warning about duplicate keys.\n createElement(\n SegmentViewNode,\n {\n key: 'ge-svn',\n type: 'global-error',\n pagePath: globalErrorModulePath,\n },\n globalErrorStyles\n )\n }\n }\n\n return {\n GlobalError: GlobalErrorComponent,\n styles: globalErrorStyles,\n }\n}\n\nfunction createSelectStaleTime(experimental: ExperimentalConfig) {\n return (stale: number) =>\n stale === INFINITE_CACHE &&\n typeof experimental.staleTimes?.static === 'number'\n ? experimental.staleTimes.static\n : stale\n}\n\nasync function collectSegmentData(\n fullPageDataBuffer: Buffer,\n prerenderStore: PrerenderStore,\n ComponentMod: AppPageModule,\n renderOpts: RenderOpts\n): Promise<Map<string, Buffer> | undefined> {\n // Per-segment prefetch data\n //\n // All of the segments for a page are generated simultaneously, including\n // during revalidations. This is to ensure consistency, because it's\n // possible for a mismatch between a layout and page segment can cause the\n // client to error during rendering. We want to preserve the ability of the\n // client to recover from such a mismatch by re-requesting all the segments\n // to get a consistent view of the page.\n //\n // For performance, we reuse the Flight output that was created when\n // generating the initial page HTML. The Flight stream for the whole page is\n // decomposed into a separate stream per segment.\n\n const clientReferenceManifest = renderOpts.clientReferenceManifest\n if (\n !clientReferenceManifest ||\n // Do not generate per-segment data unless the experimental Segment Cache\n // flag is enabled.\n //\n // We also skip generating segment data if flag is set to \"client-only\",\n // rather than true. (The \"client-only\" option only affects the behavior of\n // the client-side implementation; per-segment prefetches are intentionally\n // disabled in that configuration).\n renderOpts.experimental.clientSegmentCache !== true\n ) {\n return\n }\n\n // Manifest passed to the Flight client for reading the full-page Flight\n // stream. Based off similar code in use-cache-wrapper.ts.\n const isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge'\n const serverConsumerManifest = {\n // moduleLoading must be null because we don't want to trigger preloads of ClientReferences\n // to be added to the consumer. Instead, we'll wait for any ClientReference to be emitted\n // which themselves will handle the preloading.\n moduleLoading: null,\n moduleMap: isEdgeRuntime\n ? clientReferenceManifest.edgeRscModuleMapping\n : clientReferenceManifest.rscModuleMapping,\n serverModuleMap: getServerModuleMap(),\n }\n\n const selectStaleTime = createSelectStaleTime(renderOpts.experimental)\n const staleTime = selectStaleTime(prerenderStore.stale)\n return await ComponentMod.collectSegmentData(\n renderOpts.cacheComponents,\n fullPageDataBuffer,\n staleTime,\n clientReferenceManifest.clientModules as ManifestNode,\n serverConsumerManifest\n )\n}\n\nfunction isBypassingCachesInDev(\n renderOpts: RenderOpts,\n requestStore: RequestStore\n): boolean {\n return (\n process.env.NODE_ENV === 'development' &&\n !!renderOpts.dev &&\n requestStore.headers.get('cache-control') === 'no-cache'\n )\n}\n\nfunction WarnForBypassCachesInDev({ route }: { route: string }) {\n warnOnce(\n `Route ${route} is rendering with server caches disabled. For this navigation, Component Metadata in React DevTools will not accurately reflect what is statically prerenderable and runtime prefetchable. See more info here: https://nextjs.org/docs/messages/cache-bypass-in-dev`\n )\n return null\n}\n","export function getRevalidateReason(params: {\n isOnDemandRevalidate?: boolean\n isStaticGeneration?: boolean\n}): 'on-demand' | 'stale' | undefined {\n if (params.isOnDemandRevalidate) {\n return 'on-demand'\n }\n if (params.isStaticGeneration) {\n return 'stale'\n }\n return undefined\n}\n","import type { FlightRouterState } from '../../shared/lib/app-router-types'\nimport { flightRouterStateSchema } from './types'\nimport { assert } from 'next/dist/compiled/superstruct'\n\nexport function parseAndValidateFlightRouterState(\n stateHeader: string | string[]\n): FlightRouterState\nexport function parseAndValidateFlightRouterState(\n stateHeader: undefined\n): undefined\nexport function parseAndValidateFlightRouterState(\n stateHeader: string | string[] | undefined\n): FlightRouterState | undefined\nexport function parseAndValidateFlightRouterState(\n stateHeader: string | string[] | undefined\n): FlightRouterState | undefined {\n if (typeof stateHeader === 'undefined') {\n return undefined\n }\n if (Array.isArray(stateHeader)) {\n throw new Error(\n 'Multiple router state headers were sent. This is not allowed.'\n )\n }\n\n // We limit the size of the router state header to ~40kb. This is to prevent\n // a malicious user from sending a very large header and slowing down the\n // resolving of the router state.\n // This is around 2,000 nested or parallel route segment states:\n // '{\"children\":[\"\",{}]}'.length === 20.\n if (stateHeader.length > 20 * 2000) {\n throw new Error('The router state header was too large.')\n }\n\n try {\n const state = JSON.parse(decodeURIComponent(stateHeader))\n assert(state, flightRouterStateSchema)\n return state\n } catch {\n throw new Error('The router state header was sent but could not be parsed.')\n }\n}\n","import { ESCAPE_REGEX } from '../htmlescape'\n\nexport function getScriptNonceFromHeader(\n cspHeaderValue: string\n): string | undefined {\n const directives = cspHeaderValue\n // Directives are split by ';'.\n .split(';')\n .map((directive) => directive.trim())\n\n // First try to find the directive for the 'script-src', otherwise try to\n // fallback to the 'default-src'.\n const directive =\n directives.find((dir) => dir.startsWith('script-src')) ||\n directives.find((dir) => dir.startsWith('default-src'))\n\n // If no directive could be found, then we're done.\n if (!directive) {\n return\n }\n\n // Extract the nonce from the directive\n const nonce = directive\n .split(' ')\n // Remove the 'strict-src'/'default-src' string, this can't be the nonce.\n .slice(1)\n .map((source) => source.trim())\n // Find the first source with the 'nonce-' prefix.\n .find(\n (source) =>\n source.startsWith(\"'nonce-\") &&\n source.length > 8 &&\n source.endsWith(\"'\")\n )\n // Grab the nonce by trimming the 'nonce-' prefix.\n ?.slice(7, -1)\n\n // If we could't find the nonce, then we're done.\n if (!nonce) {\n return\n }\n\n // Don't accept the nonce value if it contains HTML escape characters.\n // Technically, the spec requires a base64'd value, but this is just an\n // extra layer.\n if (ESCAPE_REGEX.test(nonce)) {\n throw new Error(\n 'Nonce value from Content-Security-Policy contained HTML escape characters.\\nLearn more: https://nextjs.org/docs/messages/nonce-contained-invalid-characters'\n )\n }\n\n return nonce\n}\n","import type { WorkStore } from '../app-render/work-async-storage.external'\nimport type { IncrementalCache } from '../lib/incremental-cache'\nimport type { RenderOpts } from '../app-render/types'\nimport type { FetchMetric } from '../base-http'\nimport type { RequestLifecycleOpts } from '../base-server'\nimport type { AppSegmentConfig } from '../../build/segment-config/app/app-segment-config'\nimport type { CacheLife } from '../use-cache/cache-life'\n\nimport { AfterContext } from '../after/after-context'\n\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { createLazyResult, type LazyResult } from '../lib/lazy-result'\nimport { getCacheHandlerEntries } from '../use-cache/handlers'\nimport { createSnapshot } from '../app-render/async-local-storage'\n\nexport type WorkStoreContext = {\n /**\n * The page that is being rendered. This relates to the path to the page file.\n */\n page: string\n\n isPrefetchRequest?: boolean\n nonce?: string\n renderOpts: {\n cacheLifeProfiles?: { [profile: string]: CacheLife }\n incrementalCache?: IncrementalCache\n isOnDemandRevalidate?: boolean\n cacheComponents: boolean\n fetchCache?: AppSegmentConfig['fetchCache']\n isPossibleServerAction?: boolean\n pendingWaitUntil?: Promise<any>\n experimental: Pick<\n RenderOpts['experimental'],\n 'isRoutePPREnabled' | 'authInterrupts'\n >\n\n /**\n * Fetch metrics attached in patch-fetch.ts\n **/\n fetchMetrics?: FetchMetric[]\n\n /**\n * A hack around accessing the store value outside the context of the\n * request.\n *\n * @internal\n * @deprecated should only be used as a temporary workaround\n */\n // TODO: remove this when we resolve accessing the store outside the execution context\n store?: WorkStore\n } & Pick<\n // Pull some properties from RenderOpts so that the docs are also\n // mirrored.\n RenderOpts,\n | 'assetPrefix'\n | 'supportsDynamicResponse'\n | 'shouldWaitOnAllReady'\n | 'nextExport'\n | 'isDraftMode'\n | 'isDebugDynamicAccesses'\n | 'dev'\n | 'hasReadableErrorStacks'\n > &\n RequestLifecycleOpts &\n Partial<Pick<RenderOpts, 'reactLoadableManifest'>>\n\n /**\n * The build ID of the current build.\n */\n buildId: string\n\n // Tags that were previously revalidated (e.g. by a redirecting server action)\n // and have already been sent to cache handlers.\n previouslyRevalidatedTags: string[]\n}\n\nexport function createWorkStore({\n page,\n renderOpts,\n isPrefetchRequest,\n buildId,\n previouslyRevalidatedTags,\n nonce,\n}: WorkStoreContext): WorkStore {\n /**\n * Rules of Static & Dynamic HTML:\n *\n * 1.) We must generate static HTML unless the caller explicitly opts\n * in to dynamic HTML support.\n *\n * 2.) If dynamic HTML support is requested, we must honor that request\n * or throw an error. It is the sole responsibility of the caller to\n * ensure they aren't e.g. requesting dynamic HTML for a static page.\n *\n * 3.) If the request is in draft mode, we must generate dynamic HTML.\n *\n * 4.) If the request is a server action, we must generate dynamic HTML.\n *\n * These rules help ensure that other existing features like request caching,\n * coalescing, and ISR continue working as intended.\n */\n const isStaticGeneration =\n !renderOpts.shouldWaitOnAllReady &&\n !renderOpts.supportsDynamicResponse &&\n !renderOpts.isDraftMode &&\n !renderOpts.isPossibleServerAction\n\n const isDevelopment = renderOpts.dev ?? false\n\n const shouldTrackFetchMetrics =\n isDevelopment ||\n // The only times we want to track fetch metrics outside of development is\n // when we are performing a static generation and we either are in debug\n // mode, or tracking fetch metrics was specifically opted into.\n (isStaticGeneration &&\n (!!process.env.NEXT_DEBUG_BUILD ||\n process.env.NEXT_SSG_FETCH_METRICS === '1'))\n\n const store: WorkStore = {\n isStaticGeneration,\n page,\n route: normalizeAppPath(page),\n incrementalCache:\n // we fallback to a global incremental cache for edge-runtime locally\n // so that it can access the fs cache without mocks\n renderOpts.incrementalCache || (globalThis as any).__incrementalCache,\n cacheLifeProfiles: renderOpts.cacheLifeProfiles,\n isBuildTimePrerendering: renderOpts.nextExport,\n hasReadableErrorStacks: renderOpts.hasReadableErrorStacks,\n fetchCache: renderOpts.fetchCache,\n isOnDemandRevalidate: renderOpts.isOnDemandRevalidate,\n\n isDraftMode: renderOpts.isDraftMode,\n\n isPrefetchRequest,\n buildId,\n reactLoadableManifest: renderOpts?.reactLoadableManifest || {},\n assetPrefix: renderOpts?.assetPrefix || '',\n nonce,\n\n afterContext: createAfterContext(renderOpts),\n cacheComponentsEnabled: renderOpts.cacheComponents,\n dev: isDevelopment,\n previouslyRevalidatedTags,\n refreshTagsByCacheKind: createRefreshTagsByCacheKind(),\n runInCleanSnapshot: createSnapshot(),\n shouldTrackFetchMetrics,\n }\n\n // TODO: remove this when we resolve accessing the store outside the execution context\n renderOpts.store = store\n\n return store\n}\n\nfunction createAfterContext(renderOpts: RequestLifecycleOpts): AfterContext {\n const { waitUntil, onClose, onAfterTaskError } = renderOpts\n return new AfterContext({\n waitUntil,\n onClose,\n onTaskError: onAfterTaskError,\n })\n}\n\n/**\n * Creates a map with lazy results that refresh tags for the respective cache\n * kind when they're awaited for the first time.\n */\nfunction createRefreshTagsByCacheKind(): Map<string, LazyResult<void>> {\n const refreshTagsByCacheKind = new Map<string, LazyResult<void>>()\n const cacheHandlers = getCacheHandlerEntries()\n\n if (cacheHandlers) {\n for (const [kind, cacheHandler] of cacheHandlers) {\n if ('refreshTags' in cacheHandler) {\n refreshTagsByCacheKind.set(\n kind,\n createLazyResult(async () => cacheHandler.refreshTags())\n )\n }\n }\n }\n\n return refreshTagsByCacheKind\n}\n","import MODERN_BROWSERSLIST_TARGET from './modern-browserslist-target'\n\nexport { MODERN_BROWSERSLIST_TARGET }\n\nexport type ValueOf<T> = Required<T>[keyof T]\n\nexport const COMPILER_NAMES = {\n client: 'client',\n server: 'server',\n edgeServer: 'edge-server',\n} as const\n\nexport type CompilerNameValues = ValueOf<typeof COMPILER_NAMES>\n\nexport const COMPILER_INDEXES: {\n [compilerKey in CompilerNameValues]: number\n} = {\n [COMPILER_NAMES.client]: 0,\n [COMPILER_NAMES.server]: 1,\n [COMPILER_NAMES.edgeServer]: 2,\n} as const\n\n// Re-export entry constants for backward compatibility\nexport {\n UNDERSCORE_NOT_FOUND_ROUTE,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n UNDERSCORE_GLOBAL_ERROR_ROUTE,\n UNDERSCORE_GLOBAL_ERROR_ROUTE_ENTRY,\n} from './entry-constants'\n\nexport enum AdapterOutputType {\n /**\n * `PAGES` represents all the React pages that are under `pages/`.\n */\n PAGES = 'PAGES',\n\n /**\n * `PAGES_API` represents all the API routes under `pages/api/`.\n */\n 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 */\n APP_PAGE = 'APP_PAGE',\n\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 */\n APP_ROUTE = 'APP_ROUTE',\n\n /**\n * `PRERENDER` represents an ISR enabled route that might\n * have a seeded cache entry or fallback generated during build\n */\n PRERENDER = 'PRERENDER',\n\n /**\n * `STATIC_FILE` represents a static file (ie /_next/static)\n */\n STATIC_FILE = 'STATIC_FILE',\n\n /**\n * `MIDDLEWARE` represents the middleware output if present\n */\n MIDDLEWARE = 'MIDDLEWARE',\n}\n\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'\n\nexport type PHASE_TYPE =\n | typeof PHASE_INFO\n | typeof PHASE_TEST\n | typeof PHASE_EXPORT\n | typeof PHASE_PRODUCTION_BUILD\n | typeof PHASE_PRODUCTION_SERVER\n | typeof PHASE_DEVELOPMENT_SERVER\n\nexport const PAGES_MANIFEST = 'pages-manifest.json'\nexport const WEBPACK_STATS = 'webpack-stats.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 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 TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST =\n '_clientMiddlewareManifest.json'\nexport const TURBOPACK_CLIENT_BUILD_MANIFEST = 'client-build-manifest.json'\nexport const DEV_CLIENT_MIDDLEWARE_MANIFEST = '_devMiddlewareManifest.json'\nexport const REACT_LOADABLE_MANIFEST = 'react-loadable-manifest.json'\nexport const SERVER_DIRECTORY = 'server'\nexport const CONFIG_FILES = [\n 'next.config.js',\n 'next.config.mjs',\n 'next.config.ts',\n // process.features can be undefined on Edge runtime\n // TODO: Remove `as any` once we bump @types/node to v22.10.0+\n ...((process?.features as any)?.typescript ? ['next.config.mts'] : []),\n]\nexport const BUILD_ID_FILE = 'BUILD_ID'\nexport const BLOCKED_PAGES = ['/_document', '/_app', '/_error']\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\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 =\n 'middleware-react-loadable-manifest'\n// server/interception-route-rewrite-manifest.js\nexport const INTERCEPTION_ROUTE_REWRITE_MANIFEST =\n 'interception-route-rewrite-manifest'\n// server/dynamic-css-manifest.js\nexport const DYNAMIC_CSS_MANIFEST = 'dynamic-css-manifest'\n\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/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(\n CLIENT_STATIC_FILES_RUNTIME_POLYFILLS\n)\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 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 = ['/500']\nexport const TRACE_OUTPUT_VERSION = 1\n// in `MB`\nexport const TURBO_TRACE_DEFAULT_MEMORY_LIMIT = 6000\n\nexport const RSC_MODULE_TYPES = {\n client: 'client',\n server: 'server',\n} as const\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]\n\nexport const SYSTEM_ENTRYPOINTS = new Set<string>([\n CLIENT_STATIC_FILES_RUNTIME_MAIN,\n CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH,\n CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,\n])\n","import {\n extractInterceptionRouteInformation,\n isInterceptionRouteAppPath,\n} from './interception-routes'\n\n// Identify /.*[param].*/ in route string\nconst TEST_ROUTE = /\\/[^/]*\\[[^/]+\\][^/]*(?=\\/|$)/\n\n// Identify /[param]/ in route string\nconst TEST_STRICT_ROUTE = /\\/\\[[^/]+\\](?=\\/|$)/\n\n/**\n * Check if a route is dynamic.\n *\n * @param route - The route to check.\n * @param strict - Whether to use strict mode which prohibits segments with prefixes/suffixes (default: true).\n * @returns Whether the route is dynamic.\n */\nexport function isDynamicRoute(route: string, strict: boolean = true): boolean {\n if (isInterceptionRouteAppPath(route)) {\n route = extractInterceptionRouteInformation(route).interceptedRoute\n }\n\n if (strict) {\n return TEST_STRICT_ROUTE.test(route)\n }\n\n return TEST_ROUTE.test(route)\n}\n","import { pathHasPrefix } from '../router/utils/path-has-prefix'\n\n/**\n * strip _next/data/<build-id>/ prefix and .json suffix\n */\nexport function normalizeDataPath(pathname: string) {\n if (!pathHasPrefix(pathname || '/', '/_next/data')) {\n return pathname\n }\n pathname = pathname\n .replace(/\\/_next\\/data\\/[^/]{1,}/, '')\n .replace(/\\.json$/, '')\n\n if (pathname === '/index') {\n return '/'\n }\n return pathname\n}\n","import { ensureLeadingSlash } from './ensure-leading-slash'\nimport { isDynamicRoute } from '../router/utils'\nimport { NormalizeError } from '../utils'\n\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 */\nexport function normalizePagePath(page: string): string {\n const normalized =\n /^\\/index(\\/|$)/.test(page) && !isDynamicRoute(page)\n ? `/index${page}`\n : page === '/'\n ? '/index'\n : ensureLeadingSlash(page)\n\n if (process.env.NEXT_RUNTIME !== 'edge') {\n const { posix } = require('path') as typeof import('path')\n const resolvedPage = posix.normalize(normalized)\n if (resolvedPage !== normalized) {\n throw new NormalizeError(\n `Requested and resolved page mismatch: ${normalized} ${resolvedPage}`\n )\n }\n }\n\n return normalized\n}\n","import type { PageExtensions } from '../../build/page-extensions-type'\nimport { normalizePathSep } from '../../shared/lib/page-path/normalize-path-sep'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { isAppRouteRoute } from '../is-app-route-route'\n\nexport const STATIC_METADATA_IMAGES = {\n icon: {\n filename: 'icon',\n extensions: ['ico', 'jpg', 'jpeg', 'png', 'svg'],\n },\n apple: {\n filename: 'apple-icon',\n extensions: ['jpg', 'jpeg', 'png'],\n },\n favicon: {\n filename: 'favicon',\n extensions: ['ico'],\n },\n openGraph: {\n filename: 'opengraph-image',\n extensions: ['jpg', 'jpeg', 'png', 'gif'],\n },\n twitter: {\n filename: 'twitter-image',\n extensions: ['jpg', 'jpeg', 'png', 'gif'],\n },\n} as const\n\n// Match routes that are metadata routes, e.g. /sitemap.xml, /favicon.<ext>, /<icon>.<ext>, etc.\n// TODO-METADATA: support more metadata routes with more extensions\nexport const DEFAULT_METADATA_ROUTE_EXTENSIONS = ['js', 'jsx', 'ts', 'tsx']\n\n// Match the file extension with the dynamic multi-routes extensions\n// e.g. ([xml, js], null) -> can match `/sitemap.xml/route`, `sitemap.js/route`\n// e.g. ([png], [ts]) -> can match `/opengraph-image.png`, `/opengraph-image.ts`\nexport const getExtensionRegexString = (\n staticExtensions: readonly string[],\n dynamicExtensions: readonly string[] | null\n) => {\n let result: string\n // If there's no possible multi dynamic routes, will not match any <name>[].<ext> files\n if (!dynamicExtensions || dynamicExtensions.length === 0) {\n result = `(\\\\.(?:${staticExtensions.join('|')}))`\n } else {\n result = `(?:\\\\.(${staticExtensions.join('|')})|(\\\\.(${dynamicExtensions.join('|')})))`\n }\n return result\n}\n\n/**\n * Matches the static metadata files, e.g. /robots.txt, /sitemap.xml, /favicon.ico, etc.\n * @param appDirRelativePath the relative file path to app/\n * @returns if the path is a static metadata file route\n */\nexport function isStaticMetadataFile(appDirRelativePath: string) {\n return isMetadataRouteFile(appDirRelativePath, [], true)\n}\n\n// Pre-compiled static regexes for common cases\nconst FAVICON_REGEX = /^[\\\\/]favicon\\.ico$/\nconst ROBOTS_TXT_REGEX = /^[\\\\/]robots\\.txt$/\nconst MANIFEST_JSON_REGEX = /^[\\\\/]manifest\\.json$/\nconst MANIFEST_WEBMANIFEST_REGEX = /^[\\\\/]manifest\\.webmanifest$/\nconst SITEMAP_XML_REGEX = /[\\\\/]sitemap\\.xml$/\n\n// Cache for compiled regex patterns based on parameters\nconst compiledRegexCache = new Map<string, RegExp[]>()\n\n// Fast path checks for common metadata files\nfunction fastPathCheck(normalizedPath: string): boolean | null {\n // Check favicon.ico first (most common)\n if (FAVICON_REGEX.test(normalizedPath)) return true\n\n // Check other common static files\n if (ROBOTS_TXT_REGEX.test(normalizedPath)) return true\n if (MANIFEST_JSON_REGEX.test(normalizedPath)) return true\n if (MANIFEST_WEBMANIFEST_REGEX.test(normalizedPath)) return true\n if (SITEMAP_XML_REGEX.test(normalizedPath)) return true\n\n // Quick negative check - if it doesn't contain any metadata keywords, skip\n if (\n !normalizedPath.includes('robots') &&\n !normalizedPath.includes('manifest') &&\n !normalizedPath.includes('sitemap') &&\n !normalizedPath.includes('icon') &&\n !normalizedPath.includes('apple-icon') &&\n !normalizedPath.includes('opengraph-image') &&\n !normalizedPath.includes('twitter-image') &&\n !normalizedPath.includes('favicon')\n ) {\n return false\n }\n\n return null // Continue with full regex matching\n}\n\nfunction getCompiledRegexes(\n pageExtensions: PageExtensions,\n strictlyMatchExtensions: boolean\n): RegExp[] {\n // Create cache key\n const cacheKey = `${pageExtensions.join(',')}|${strictlyMatchExtensions}`\n\n const cached = compiledRegexCache.get(cacheKey)\n if (cached) {\n return cached\n }\n\n // Pre-compute common strings\n const trailingMatcher = strictlyMatchExtensions ? '$' : '?$'\n const variantsMatcher = '\\\\d?'\n const groupSuffix = strictlyMatchExtensions ? '' : '(-\\\\w{6})?'\n const suffixMatcher = variantsMatcher + groupSuffix\n\n // Pre-compute extension arrays to avoid repeated concatenation\n const robotsExts =\n pageExtensions.length > 0 ? [...pageExtensions, 'txt'] : ['txt']\n const manifestExts =\n pageExtensions.length > 0\n ? [...pageExtensions, 'webmanifest', 'json']\n : ['webmanifest', 'json']\n\n const regexes = [\n new RegExp(\n `^[\\\\\\\\/]robots${getExtensionRegexString(robotsExts, null)}${trailingMatcher}`\n ),\n new RegExp(\n `^[\\\\\\\\/]manifest${getExtensionRegexString(manifestExts, null)}${trailingMatcher}`\n ),\n // FAVICON_REGEX removed - already handled in fastPathCheck\n new RegExp(\n `[\\\\\\\\/]sitemap${getExtensionRegexString(['xml'], pageExtensions)}${trailingMatcher}`\n ),\n new RegExp(\n `[\\\\\\\\/]icon${suffixMatcher}${getExtensionRegexString(\n STATIC_METADATA_IMAGES.icon.extensions,\n pageExtensions\n )}${trailingMatcher}`\n ),\n new RegExp(\n `[\\\\\\\\/]apple-icon${suffixMatcher}${getExtensionRegexString(\n STATIC_METADATA_IMAGES.apple.extensions,\n pageExtensions\n )}${trailingMatcher}`\n ),\n new RegExp(\n `[\\\\\\\\/]opengraph-image${suffixMatcher}${getExtensionRegexString(\n STATIC_METADATA_IMAGES.openGraph.extensions,\n pageExtensions\n )}${trailingMatcher}`\n ),\n new RegExp(\n `[\\\\\\\\/]twitter-image${suffixMatcher}${getExtensionRegexString(\n STATIC_METADATA_IMAGES.twitter.extensions,\n pageExtensions\n )}${trailingMatcher}`\n ),\n ]\n\n compiledRegexCache.set(cacheKey, regexes)\n return regexes\n}\n\n/**\n * Determine if the file is a metadata route file entry\n * @param appDirRelativePath the relative file path to app/\n * @param pageExtensions the js extensions, such as ['js', 'jsx', 'ts', 'tsx']\n * @param strictlyMatchExtensions if it's true, match the file with page extension, otherwise match the file with default corresponding extension\n * @returns if the file is a metadata route file\n */\nexport function isMetadataRouteFile(\n appDirRelativePath: string,\n pageExtensions: PageExtensions,\n strictlyMatchExtensions: boolean\n): boolean {\n // Early exit for empty or obviously non-metadata paths\n if (!appDirRelativePath || appDirRelativePath.length < 2) {\n return false\n }\n\n const normalizedPath = normalizePathSep(appDirRelativePath)\n\n // Fast path check for common cases\n const fastResult = fastPathCheck(normalizedPath)\n if (fastResult !== null) {\n return fastResult\n }\n\n // Get compiled regexes from cache\n const regexes = getCompiledRegexes(pageExtensions, strictlyMatchExtensions)\n\n // Use for loop instead of .some() for better performance\n for (let i = 0; i < regexes.length; i++) {\n if (regexes[i].test(normalizedPath)) {\n return true\n }\n }\n\n return false\n}\n\n// Check if the route is a static metadata route, with /route suffix\n// e.g. /favicon.ico/route, /icon.png/route, etc.\n// But skip the text routes like robots.txt since they might also be dynamic.\n// Checking route path is not enough to determine if text routes is dynamic.\nexport function isStaticMetadataRoute(route: string) {\n // extract ext with regex\n const pathname = route.replace(/\\/route$/, '')\n\n const matched =\n isAppRouteRoute(route) &&\n isMetadataRouteFile(pathname, [], true) &&\n // These routes can either be built by static or dynamic entrypoints,\n // so we assume they're dynamic\n pathname !== '/robots.txt' &&\n pathname !== '/manifest.webmanifest' &&\n !pathname.endsWith('/sitemap.xml')\n\n return matched\n}\n\n/**\n * Determine if a page or pathname is a metadata page.\n *\n * The input is a page or pathname, which can be with or without page suffix /foo/page or /foo.\n * But it will not contain the /route suffix.\n *\n * .e.g\n * /robots -> true\n * /sitemap -> true\n * /foo -> false\n */\nexport function isMetadataPage(page: string) {\n const matched = !isAppRouteRoute(page) && isMetadataRouteFile(page, [], false)\n\n return matched\n}\n\n/*\n * Determine if a Next.js route is a metadata route.\n * `route` will has a route suffix.\n *\n * e.g.\n * /app/robots/route -> true\n * /robots/route -> true\n * /sitemap/[__metadata_id__]/route -> true\n * /app/sitemap/page -> false\n * /icon-a102f4/route -> true\n */\nexport function isMetadataRoute(route: string): boolean {\n let page = normalizeAppPath(route)\n .replace(/^\\/?app\\//, '')\n // Remove the dynamic route id\n .replace('/[__metadata_id__]', '')\n // Remove the /route suffix\n .replace(/\\/route$/, '')\n\n if (page[0] !== '/') page = '/' + page\n\n const matched = isAppRouteRoute(route) && isMetadataRouteFile(page, [], false)\n\n return matched\n}\n","import path from '../shared/lib/isomorphic/path'\nimport type { CacheFs } from '../shared/lib/utils'\n\n/**\n * A task to be written.\n */\ntype Task = [\n /**\n * The directory to create.\n */\n directory: string,\n\n /**\n * The promise to create the directory.\n */\n mkdir: Promise<unknown>,\n\n /**\n * The promises to write the files that are dependent on the directory being\n * created.\n */\n writeFile: Promise<unknown>[],\n]\n/**\n * MultiFileWriter is a utility for writing multiple files in parallel that\n * guarantees that all files will be written after their containing directory\n * is created, and that the directory will only be created once.\n */\nexport class MultiFileWriter {\n /**\n * The tasks to be written.\n */\n private readonly tasks: Task[] = []\n\n constructor(\n /**\n * The file system methods to use.\n */\n private readonly fs: Pick<CacheFs, 'mkdir' | 'writeFile'>\n ) {}\n\n /**\n * Finds or creates a task for a directory.\n *\n * @param directory - The directory to find or create a task for.\n * @returns The task for the directory.\n */\n private findOrCreateTask(directory: string): Task {\n // See if this directory already has a task to create it.\n for (const task of this.tasks) {\n if (task[0] === directory) {\n return task\n }\n }\n\n const promise = this.fs.mkdir(directory)\n\n // Attach a catch handler so that it doesn't throw an unhandled promise\n // rejection warning.\n promise.catch(() => {})\n\n // Otherwise, create a new task for this directory.\n const task: Task = [directory, promise, []]\n this.tasks.push(task)\n\n return task\n }\n\n /**\n * Appends a file to the writer to be written after its containing directory\n * is created. The file writer should be awaited after all the files have been\n * appended. Any async operation that occurs between appending and awaiting\n * may cause an unhandled promise rejection warning and potentially crash the\n * process.\n *\n * @param filePath - The path to the file to write.\n * @param data - The data to write to the file.\n */\n public append(filePath: string, data: Buffer | string): void {\n // Find or create a task for the directory that contains the file.\n const task = this.findOrCreateTask(path.dirname(filePath))\n\n const promise = task[1].then(() => this.fs.writeFile(filePath, data))\n\n // Attach a catch handler so that it doesn't throw an unhandled promise\n // rejection warning.\n promise.catch(() => {})\n\n // Add the file write to the task AFTER the directory promise has resolved.\n task[2].push(promise)\n }\n\n /**\n * Returns a promise that resolves when all the files have been written.\n */\n public wait(): Promise<unknown> {\n return Promise.all(this.tasks.flatMap((task) => task[2]))\n }\n}\n","import type { RouteMetadata } from '../../../export/routes/types'\nimport type { CacheHandler, CacheHandlerContext, CacheHandlerValue } from '.'\nimport type { CacheFs } from '../../../shared/lib/utils'\nimport type { TagManifestEntry } from './tags-manifest.external'\nimport {\n CachedRouteKind,\n IncrementalCacheKind,\n type CachedFetchValue,\n type IncrementalCacheValue,\n type SetIncrementalFetchCacheContext,\n type SetIncrementalResponseCacheContext,\n} from '../../response-cache'\n\nimport type { LRUCache } from '../lru-cache'\nimport path from '../../../shared/lib/isomorphic/path'\nimport {\n NEXT_CACHE_TAGS_HEADER,\n NEXT_DATA_SUFFIX,\n NEXT_META_SUFFIX,\n RSC_PREFETCH_SUFFIX,\n RSC_SEGMENT_SUFFIX,\n RSC_SEGMENTS_DIR_SUFFIX,\n RSC_SUFFIX,\n} from '../../../lib/constants'\nimport { areTagsExpired, tagsManifest } from './tags-manifest.external'\nimport { MultiFileWriter } from '../../../lib/multi-file-writer'\nimport { getMemoryCache } from './memory-cache.external'\n\ntype FileSystemCacheContext = Omit<\n CacheHandlerContext,\n 'fs' | 'serverDistDir'\n> & {\n fs: CacheFs\n serverDistDir: string\n}\n\nexport default class FileSystemCache implements CacheHandler {\n private fs: FileSystemCacheContext['fs']\n private flushToDisk?: FileSystemCacheContext['flushToDisk']\n private serverDistDir: FileSystemCacheContext['serverDistDir']\n private revalidatedTags: string[]\n private static debug: boolean = !!process.env.NEXT_PRIVATE_DEBUG_CACHE\n private static memoryCache: LRUCache<CacheHandlerValue> | undefined\n\n constructor(ctx: FileSystemCacheContext) {\n this.fs = ctx.fs\n this.flushToDisk = ctx.flushToDisk\n this.serverDistDir = ctx.serverDistDir\n this.revalidatedTags = ctx.revalidatedTags\n\n if (ctx.maxMemoryCacheSize) {\n if (!FileSystemCache.memoryCache) {\n if (FileSystemCache.debug) {\n console.log('FileSystemCache: using memory store for fetch cache')\n }\n\n FileSystemCache.memoryCache = getMemoryCache(ctx.maxMemoryCacheSize)\n } else if (FileSystemCache.debug) {\n console.log('FileSystemCache: memory store already initialized')\n }\n } else if (FileSystemCache.debug) {\n console.log('FileSystemCache: not using memory store for fetch cache')\n }\n }\n\n public resetRequestCache(): void {}\n\n public async revalidateTag(\n tags: string | string[],\n durations?: { expire?: number }\n ) {\n tags = typeof tags === 'string' ? [tags] : tags\n\n if (FileSystemCache.debug) {\n console.log('FileSystemCache: revalidateTag', tags, durations)\n }\n\n if (tags.length === 0) {\n return\n }\n\n const now = Date.now()\n\n for (const tag of tags) {\n const existingEntry = tagsManifest.get(tag) || {}\n\n if (durations) {\n // Use provided durations directly\n const updates: TagManifestEntry = { ...existingEntry }\n\n // mark as stale immediately\n updates.stale = now\n\n if (durations.expire !== undefined) {\n updates.expired = now + durations.expire * 1000 // Convert seconds to ms\n }\n\n tagsManifest.set(tag, updates)\n } else {\n // Update expired field for immediate expiration (default behavior when no durations provided)\n tagsManifest.set(tag, { ...existingEntry, expired: now })\n }\n }\n }\n\n public async get(...args: Parameters<CacheHandler['get']>) {\n const [key, ctx] = args\n const { kind } = ctx\n\n let data = FileSystemCache.memoryCache?.get(key)\n\n if (FileSystemCache.debug) {\n if (kind === IncrementalCacheKind.FETCH) {\n console.log('FileSystemCache: get', key, ctx.tags, kind, !!data)\n } else {\n console.log('FileSystemCache: get', key, kind, !!data)\n }\n }\n\n // let's check the disk for seed data\n if (!data && process.env.NEXT_RUNTIME !== 'edge') {\n try {\n if (kind === IncrementalCacheKind.APP_ROUTE) {\n const filePath = this.getFilePath(\n `${key}.body`,\n IncrementalCacheKind.APP_ROUTE\n )\n const fileData = await this.fs.readFile(filePath)\n const { mtime } = await this.fs.stat(filePath)\n\n const meta = JSON.parse(\n await this.fs.readFile(\n filePath.replace(/\\.body$/, NEXT_META_SUFFIX),\n 'utf8'\n )\n )\n\n data = {\n lastModified: mtime.getTime(),\n value: {\n kind: CachedRouteKind.APP_ROUTE,\n body: fileData,\n headers: meta.headers,\n status: meta.status,\n },\n }\n } else {\n const filePath = this.getFilePath(\n kind === IncrementalCacheKind.FETCH ? key : `${key}.html`,\n kind\n )\n\n const fileData = await this.fs.readFile(filePath, 'utf8')\n const { mtime } = await this.fs.stat(filePath)\n\n if (kind === IncrementalCacheKind.FETCH) {\n const { tags, fetchIdx, fetchUrl } = ctx\n\n if (!this.flushToDisk) return null\n\n const lastModified = mtime.getTime()\n const parsedData: CachedFetchValue = JSON.parse(fileData)\n data = {\n lastModified,\n value: parsedData,\n }\n\n if (data.value?.kind === CachedRouteKind.FETCH) {\n const storedTags = data.value?.tags\n\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?.every((tag) => storedTags?.includes(tag))) {\n if (FileSystemCache.debug) {\n console.log(\n 'FileSystemCache: tags vs storedTags mismatch',\n tags,\n storedTags\n )\n }\n await this.set(key, data.value, {\n fetchCache: true,\n tags,\n fetchIdx,\n fetchUrl,\n })\n }\n }\n } else if (kind === IncrementalCacheKind.APP_PAGE) {\n // We try to load the metadata file, but if it fails, we don't\n // error. We also don't load it if this is a fallback.\n let meta: RouteMetadata | undefined\n try {\n meta = JSON.parse(\n await this.fs.readFile(\n filePath.replace(/\\.html$/, NEXT_META_SUFFIX),\n 'utf8'\n )\n )\n } catch {}\n\n let maybeSegmentData: Map<string, Buffer> | undefined\n if (meta?.segmentPaths) {\n // Collect all the segment data for this page.\n // TODO: To optimize file system reads, we should consider creating\n // separate cache entries for each segment, rather than storing them\n // all on the page's entry. Though the behavior is\n // identical regardless.\n const segmentData: Map<string, Buffer> = new Map()\n maybeSegmentData = segmentData\n const segmentsDir = key + RSC_SEGMENTS_DIR_SUFFIX\n await Promise.all(\n meta.segmentPaths.map(async (segmentPath: string) => {\n const segmentDataFilePath = this.getFilePath(\n segmentsDir + segmentPath + RSC_SEGMENT_SUFFIX,\n IncrementalCacheKind.APP_PAGE\n )\n try {\n segmentData.set(\n segmentPath,\n await this.fs.readFile(segmentDataFilePath)\n )\n } catch {\n // This shouldn't happen, but if for some reason we fail to\n // load a segment from the filesystem, treat it the same as if\n // the segment is dynamic and does not have a prefetch.\n }\n })\n )\n }\n\n let rscData: Buffer | undefined\n if (!ctx.isFallback) {\n rscData = await this.fs.readFile(\n this.getFilePath(\n `${key}${ctx.isRoutePPREnabled ? RSC_PREFETCH_SUFFIX : RSC_SUFFIX}`,\n IncrementalCacheKind.APP_PAGE\n )\n )\n }\n\n data = {\n lastModified: mtime.getTime(),\n value: {\n kind: CachedRouteKind.APP_PAGE,\n html: fileData,\n rscData,\n postponed: meta?.postponed,\n headers: meta?.headers,\n status: meta?.status,\n segmentData: maybeSegmentData,\n },\n }\n } else if (kind === IncrementalCacheKind.PAGES) {\n let meta: RouteMetadata | undefined\n let pageData: string | object = {}\n\n if (!ctx.isFallback) {\n pageData = JSON.parse(\n await this.fs.readFile(\n this.getFilePath(\n `${key}${NEXT_DATA_SUFFIX}`,\n IncrementalCacheKind.PAGES\n ),\n 'utf8'\n )\n )\n }\n\n data = {\n lastModified: mtime.getTime(),\n value: {\n kind: CachedRouteKind.PAGES,\n html: fileData,\n pageData,\n headers: meta?.headers,\n status: meta?.status,\n },\n }\n } else {\n throw new Error(\n `Invariant: Unexpected route kind ${kind} in file system cache.`\n )\n }\n }\n\n if (data) {\n FileSystemCache.memoryCache?.set(key, data)\n }\n } catch {\n return null\n }\n }\n\n if (\n data?.value?.kind === CachedRouteKind.APP_PAGE ||\n data?.value?.kind === CachedRouteKind.APP_ROUTE ||\n data?.value?.kind === CachedRouteKind.PAGES\n ) {\n const tagsHeader = data.value.headers?.[NEXT_CACHE_TAGS_HEADER]\n if (typeof tagsHeader === 'string') {\n const cacheTags = tagsHeader.split(',')\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 (\n cacheTags.length > 0 &&\n areTagsExpired(cacheTags, data.lastModified)\n ) {\n if (FileSystemCache.debug) {\n console.log('FileSystemCache: expired tags', cacheTags)\n }\n\n return null\n }\n }\n } else if (data?.value?.kind === CachedRouteKind.FETCH) {\n const combinedTags =\n ctx.kind === IncrementalCacheKind.FETCH\n ? [...(ctx.tags || []), ...(ctx.softTags || [])]\n : []\n\n // When revalidate tag is called we don't return stale data so it's\n // updated right away.\n if (combinedTags.some((tag) => this.revalidatedTags.includes(tag))) {\n if (FileSystemCache.debug) {\n console.log('FileSystemCache: was revalidated', combinedTags)\n }\n\n return null\n }\n\n if (areTagsExpired(combinedTags, data.lastModified)) {\n if (FileSystemCache.debug) {\n console.log('FileSystemCache: expired tags', combinedTags)\n }\n\n return null\n }\n }\n\n return data ?? null\n }\n\n public async set(\n key: string,\n data: IncrementalCacheValue | null,\n ctx: SetIncrementalFetchCacheContext | SetIncrementalResponseCacheContext\n ) {\n FileSystemCache.memoryCache?.set(key, {\n value: data,\n lastModified: Date.now(),\n })\n\n if (FileSystemCache.debug) {\n console.log('FileSystemCache: set', key)\n }\n\n if (!this.flushToDisk || !data) return\n\n // Create a new writer that will prepare to write all the files to disk\n // after their containing directory is created.\n const writer = new MultiFileWriter(this.fs)\n\n if (data.kind === CachedRouteKind.APP_ROUTE) {\n const filePath = this.getFilePath(\n `${key}.body`,\n IncrementalCacheKind.APP_ROUTE\n )\n\n writer.append(filePath, data.body)\n\n const meta: RouteMetadata = {\n headers: data.headers,\n status: data.status,\n postponed: undefined,\n segmentPaths: undefined,\n }\n\n writer.append(\n filePath.replace(/\\.body$/, NEXT_META_SUFFIX),\n JSON.stringify(meta, null, 2)\n )\n } else if (\n data.kind === CachedRouteKind.PAGES ||\n data.kind === CachedRouteKind.APP_PAGE\n ) {\n const isAppPath = data.kind === CachedRouteKind.APP_PAGE\n const htmlPath = this.getFilePath(\n `${key}.html`,\n isAppPath ? IncrementalCacheKind.APP_PAGE : IncrementalCacheKind.PAGES\n )\n\n writer.append(htmlPath, data.html)\n\n // Fallbacks don't generate a data file.\n if (!ctx.fetchCache && !ctx.isFallback) {\n writer.append(\n this.getFilePath(\n `${key}${\n isAppPath\n ? ctx.isRoutePPREnabled\n ? RSC_PREFETCH_SUFFIX\n : RSC_SUFFIX\n : NEXT_DATA_SUFFIX\n }`,\n isAppPath\n ? IncrementalCacheKind.APP_PAGE\n : IncrementalCacheKind.PAGES\n ),\n isAppPath ? data.rscData! : JSON.stringify(data.pageData)\n )\n }\n\n if (data?.kind === CachedRouteKind.APP_PAGE) {\n let segmentPaths: string[] | undefined\n if (data.segmentData) {\n segmentPaths = []\n const segmentsDir = htmlPath.replace(\n /\\.html$/,\n RSC_SEGMENTS_DIR_SUFFIX\n )\n\n for (const [segmentPath, buffer] of data.segmentData) {\n segmentPaths.push(segmentPath)\n const segmentDataFilePath =\n segmentsDir + segmentPath + RSC_SEGMENT_SUFFIX\n writer.append(segmentDataFilePath, buffer)\n }\n }\n\n const meta: RouteMetadata = {\n headers: data.headers,\n status: data.status,\n postponed: data.postponed,\n segmentPaths,\n }\n\n writer.append(\n htmlPath.replace(/\\.html$/, NEXT_META_SUFFIX),\n JSON.stringify(meta)\n )\n }\n } else if (data.kind === CachedRouteKind.FETCH) {\n const filePath = this.getFilePath(key, IncrementalCacheKind.FETCH)\n writer.append(\n filePath,\n JSON.stringify({\n ...data,\n tags: ctx.fetchCache ? ctx.tags : [],\n })\n )\n }\n\n // Wait for all FS operations to complete.\n await writer.wait()\n }\n\n private getFilePath(pathname: string, kind: IncrementalCacheKind): string {\n switch (kind) {\n case IncrementalCacheKind.FETCH:\n // we store in .next/cache/fetch-cache so it can be persisted\n // across deploys\n return path.join(\n this.serverDistDir,\n '..',\n 'cache',\n 'fetch-cache',\n pathname\n )\n case IncrementalCacheKind.PAGES:\n return path.join(this.serverDistDir, 'pages', pathname)\n case IncrementalCacheKind.IMAGE:\n case IncrementalCacheKind.APP_PAGE:\n case IncrementalCacheKind.APP_ROUTE:\n return path.join(this.serverDistDir, 'app', pathname)\n default:\n throw new Error(`Unexpected file path kind: ${kind}`)\n }\n }\n}\n","/**\n * This transforms a URL pathname into a route. It removes any trailing slashes\n * and the `/index` suffix.\n *\n * @param pathname - The URL path that needs to be optimized.\n * @returns - 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 */\nexport function toRoute(pathname: string): string {\n return pathname.replace(/(?:\\/index)?\\/?$/, '') || '/'\n}\n","import type { CacheFs } from '../../../shared/lib/utils'\nimport type { PrerenderManifest } from '../../../build'\nimport {\n type IncrementalCacheValue,\n type IncrementalCacheEntry,\n type IncrementalCache as IncrementalCacheType,\n IncrementalCacheKind,\n CachedRouteKind,\n type IncrementalResponseCacheEntry,\n type IncrementalFetchCacheEntry,\n type GetIncrementalFetchCacheContext,\n type GetIncrementalResponseCacheContext,\n type CachedFetchValue,\n type SetIncrementalFetchCacheContext,\n type SetIncrementalResponseCacheContext,\n} from '../../response-cache'\nimport type { DeepReadonly } from '../../../shared/lib/deep-readonly'\nimport FileSystemCache from './file-system-cache'\nimport { normalizePagePath } from '../../../shared/lib/page-path/normalize-page-path'\n\nimport {\n CACHE_ONE_YEAR,\n NEXT_CACHE_TAGS_HEADER,\n PRERENDER_REVALIDATE_HEADER,\n} from '../../../lib/constants'\nimport { toRoute } from '../to-route'\nimport { SharedCacheControls } from './shared-cache-controls.external'\nimport {\n getPrerenderResumeDataCache,\n getRenderResumeDataCache,\n workUnitAsyncStorage,\n} from '../../app-render/work-unit-async-storage.external'\nimport { InvariantError } from '../../../shared/lib/invariant-error'\nimport type { Revalidate } from '../cache-control'\nimport { getPreviouslyRevalidatedTags } from '../../server-utils'\nimport { workAsyncStorage } from '../../app-render/work-async-storage.external'\nimport { DetachedPromise } from '../../../lib/detached-promise'\nimport { areTagsExpired, areTagsStale } from './tags-manifest.external'\n\nexport interface CacheHandlerContext {\n fs?: CacheFs\n dev?: boolean\n flushToDisk?: boolean\n serverDistDir?: string\n maxMemoryCacheSize?: number\n fetchCacheKeyPrefix?: string\n prerenderManifest?: PrerenderManifest\n revalidatedTags: string[]\n _requestHeaders: IncrementalCache['requestHeaders']\n}\n\nexport interface CacheHandlerValue {\n lastModified: number\n age?: number\n cacheState?: string\n value: IncrementalCacheValue | null\n}\n\nexport class CacheHandler {\n // eslint-disable-next-line\n constructor(_ctx: CacheHandlerContext) {}\n\n public async get(\n _cacheKey: string,\n _ctx: GetIncrementalFetchCacheContext | GetIncrementalResponseCacheContext\n ): Promise<CacheHandlerValue | null> {\n return {} as any\n }\n\n public async set(\n _cacheKey: string,\n _data: IncrementalCacheValue | null,\n _ctx: SetIncrementalFetchCacheContext | SetIncrementalResponseCacheContext\n ): Promise<void> {}\n\n public async revalidateTag(\n _tags: string | string[],\n _durations?: { expire?: number }\n ): Promise<void> {}\n\n public resetRequestCache(): void {}\n}\n\nexport class IncrementalCache implements IncrementalCacheType {\n readonly dev?: boolean\n readonly disableForTestmode?: boolean\n readonly cacheHandler?: CacheHandler\n readonly hasCustomCacheHandler: boolean\n readonly prerenderManifest: DeepReadonly<PrerenderManifest>\n readonly requestHeaders: Record<string, undefined | string | string[]>\n readonly allowedRevalidateHeaderKeys?: string[]\n readonly minimalMode?: boolean\n readonly fetchCacheKeyPrefix?: string\n readonly isOnDemandRevalidate?: boolean\n readonly revalidatedTags?: readonly string[]\n\n private static readonly debug: boolean =\n !!process.env.NEXT_PRIVATE_DEBUG_CACHE\n private readonly locks = new Map<string, Promise<void>>()\n\n /**\n * The cache controls for routes. This will source the values from the\n * prerender manifest until the in-memory cache is updated with new values.\n */\n private readonly cacheControls: SharedCacheControls\n\n constructor({\n fs,\n dev,\n flushToDisk,\n minimalMode,\n serverDistDir,\n requestHeaders,\n maxMemoryCacheSize,\n getPrerenderManifest,\n fetchCacheKeyPrefix,\n CurCacheHandler,\n allowedRevalidateHeaderKeys,\n }: {\n fs?: CacheFs\n dev: boolean\n minimalMode?: boolean\n serverDistDir?: string\n flushToDisk?: boolean\n allowedRevalidateHeaderKeys?: string[]\n requestHeaders: IncrementalCache['requestHeaders']\n maxMemoryCacheSize?: number\n getPrerenderManifest: () => DeepReadonly<PrerenderManifest>\n fetchCacheKeyPrefix?: string\n CurCacheHandler?: typeof CacheHandler\n }) {\n this.hasCustomCacheHandler = Boolean(CurCacheHandler)\n\n const cacheHandlersSymbol = Symbol.for('@next/cache-handlers')\n const _globalThis: typeof globalThis & {\n [cacheHandlersSymbol]?: {\n FetchCache?: typeof CacheHandler\n }\n } = globalThis\n\n if (!CurCacheHandler) {\n // if we have a global cache handler available leverage it\n const globalCacheHandler = _globalThis[cacheHandlersSymbol]\n\n if (globalCacheHandler?.FetchCache) {\n CurCacheHandler = globalCacheHandler.FetchCache\n if (IncrementalCache.debug) {\n console.log('IncrementalCache: using global FetchCache cache handler')\n }\n } else {\n if (fs && serverDistDir) {\n if (IncrementalCache.debug) {\n console.log('IncrementalCache: using filesystem cache handler')\n }\n CurCacheHandler = FileSystemCache\n }\n }\n } else if (IncrementalCache.debug) {\n console.log(\n 'IncrementalCache: using custom cache handler',\n CurCacheHandler.name\n )\n }\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.allowedRevalidateHeaderKeys = allowedRevalidateHeaderKeys\n this.prerenderManifest = getPrerenderManifest()\n this.cacheControls = new SharedCacheControls(this.prerenderManifest)\n this.fetchCacheKeyPrefix = fetchCacheKeyPrefix\n let revalidatedTags: string[] = []\n\n if (\n requestHeaders[PRERENDER_REVALIDATE_HEADER] ===\n this.prerenderManifest?.preview?.previewModeId\n ) {\n this.isOnDemandRevalidate = true\n }\n\n if (minimalMode) {\n revalidatedTags = this.revalidatedTags = getPreviouslyRevalidatedTags(\n requestHeaders,\n this.prerenderManifest?.preview?.previewModeId\n )\n }\n\n if (CurCacheHandler) {\n this.cacheHandler = new CurCacheHandler({\n dev,\n fs,\n flushToDisk,\n serverDistDir,\n revalidatedTags,\n maxMemoryCacheSize,\n _requestHeaders: requestHeaders,\n fetchCacheKeyPrefix,\n })\n }\n }\n\n private calculateRevalidate(\n pathname: string,\n fromTime: number,\n dev: boolean,\n isFallback: boolean | undefined\n ): Revalidate {\n // in development we don't have a prerender-manifest\n // and default to always revalidating to allow easier debugging\n if (dev)\n return Math.floor(performance.timeOrigin + performance.now() - 1000)\n\n const cacheControl = this.cacheControls.get(toRoute(pathname))\n\n // if an entry isn't present in routes we fallback to a default\n // of revalidating after 1 second unless it's a fallback request.\n const initialRevalidateSeconds = cacheControl\n ? cacheControl.revalidate\n : isFallback\n ? false\n : 1\n\n const revalidateAfter =\n typeof initialRevalidateSeconds === 'number'\n ? initialRevalidateSeconds * 1000 + fromTime\n : initialRevalidateSeconds\n\n return revalidateAfter\n }\n\n _getPathname(pathname: string, fetchCache?: boolean) {\n return fetchCache ? pathname : normalizePagePath(pathname)\n }\n\n resetRequestCache() {\n this.cacheHandler?.resetRequestCache?.()\n }\n\n async lock(cacheKey: string): Promise<() => Promise<void> | void> {\n // Wait for any existing lock on this cache key to be released\n // This implements a simple queue-based locking mechanism\n while (true) {\n const lock = this.locks.get(cacheKey)\n\n if (IncrementalCache.debug) {\n console.log('IncrementalCache: lock get', cacheKey, !!lock)\n }\n\n // If no lock exists, we can proceed to acquire it\n if (!lock) break\n\n // Wait for the existing lock to be released before trying again\n await lock\n }\n\n // Create a new detached promise that will represent this lock\n // The resolve function (unlock) will be returned to the caller\n const { resolve, promise } = new DetachedPromise<void>()\n\n if (IncrementalCache.debug) {\n console.log('IncrementalCache: successfully locked', cacheKey)\n }\n\n // Store the lock promise in the locks map\n this.locks.set(cacheKey, promise)\n\n return () => {\n // Resolve the promise to release the lock.\n resolve()\n\n // Remove the lock from the map once it's released so that future gets\n // can acquire the lock.\n this.locks.delete(cacheKey)\n }\n }\n\n async revalidateTag(\n tags: string | string[],\n durations?: { expire?: number }\n ): Promise<void> {\n return this.cacheHandler?.revalidateTag(tags, durations)\n }\n\n // x-ref: https://github.com/facebook/react/blob/2655c9354d8e1c54ba888444220f63e836925caa/packages/react/src/ReactFetch.js#L23\n async generateCacheKey(\n url: string,\n init: RequestInit | Request = {}\n ): Promise<string> {\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\n const bodyChunks: string[] = []\n\n const encoder = new TextEncoder()\n const decoder = new TextDecoder()\n\n if (init.body) {\n // handle Uint8Array body\n if (init.body instanceof Uint8Array) {\n bodyChunks.push(decoder.decode(init.body))\n ;(init as any)._ogBody = init.body\n } // handle ReadableStream body\n else if (typeof (init.body as any).getReader === 'function') {\n const readableBody = init.body as ReadableStream<Uint8Array | string>\n\n const chunks: Uint8Array[] = []\n\n try {\n await readableBody.pipeTo(\n 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, { stream: true }))\n }\n },\n })\n )\n\n // Flush the decoder.\n bodyChunks.push(decoder.decode())\n\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\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\n ;(init as any)._ogBody = arrayBuffer\n } catch (err) {\n console.error('Problem reading body', err)\n }\n } // handle FormData or URLSearchParams bodies\n else if (typeof (init.body as any).keys === 'function') {\n const formData = init.body as FormData\n ;(init as any)._ogBody = init.body\n for (const key of new Set([...formData.keys()])) {\n const values = formData.getAll(key)\n bodyChunks.push(\n `${key}=${(\n await Promise.all(\n values.map(async (val) => {\n if (typeof val === 'string') {\n return val\n } else {\n return await val.text()\n }\n })\n )\n ).join(',')}`\n )\n }\n // handle blob body\n } else if (typeof (init.body as any).arrayBuffer === 'function') {\n const blob = init.body as Blob\n const arrayBuffer = await blob.arrayBuffer()\n bodyChunks.push(await blob.text())\n ;(init as any)._ogBody = new Blob([arrayBuffer], { type: blob.type })\n } else if (typeof init.body === 'string') {\n bodyChunks.push(init.body)\n ;(init as any)._ogBody = init.body\n }\n }\n\n const headers =\n typeof (init.headers || {}).keys === 'function'\n ? Object.fromEntries(init.headers as Headers)\n : Object.assign({}, init.headers)\n\n // w3c trace context headers can break request caching and deduplication\n // so we remove them from the cache key\n if ('traceparent' in headers) delete headers['traceparent']\n if ('tracestate' in headers) delete headers['tracestate']\n\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\n if (process.env.NEXT_RUNTIME === 'edge') {\n function bufferToHex(buffer: ArrayBuffer): string {\n return Array.prototype.map\n .call(new Uint8Array(buffer), (b) => b.toString(16).padStart(2, '0'))\n .join('')\n }\n const buffer = encoder.encode(cacheString)\n return bufferToHex(await crypto.subtle.digest('SHA-256', buffer))\n } else {\n const crypto = require('crypto') as typeof import('crypto')\n return crypto.createHash('sha256').update(cacheString).digest('hex')\n }\n }\n\n async get(\n cacheKey: string,\n ctx: GetIncrementalFetchCacheContext\n ): Promise<IncrementalFetchCacheEntry | null>\n async get(\n cacheKey: string,\n ctx: GetIncrementalResponseCacheContext\n ): Promise<IncrementalResponseCacheEntry | null>\n async get(\n cacheKey: string,\n ctx: GetIncrementalFetchCacheContext | GetIncrementalResponseCacheContext\n ): Promise<IncrementalCacheEntry | null> {\n // Unlike other caches if we have a resume data cache, we use it even if\n // testmode would normally disable it or if requestHeaders say 'no-cache'.\n if (ctx.kind === IncrementalCacheKind.FETCH) {\n const workUnitStore = workUnitAsyncStorage.getStore()\n const resumeDataCache = workUnitStore\n ? getRenderResumeDataCache(workUnitStore)\n : null\n if (resumeDataCache) {\n const memoryCacheData = resumeDataCache.fetch.get(cacheKey)\n if (memoryCacheData?.kind === CachedRouteKind.FETCH) {\n if (IncrementalCache.debug) {\n console.log('IncrementalCache: rdc:hit', cacheKey)\n }\n\n return { isStale: false, value: memoryCacheData }\n } else if (IncrementalCache.debug) {\n console.log('IncrementalCache: rdc:miss', cacheKey)\n }\n } else {\n if (IncrementalCache.debug) {\n console.log('IncrementalCache: rdc:no-resume-data')\n }\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 (\n this.disableForTestmode ||\n (this.dev &&\n (ctx.kind !== IncrementalCacheKind.FETCH ||\n this.requestHeaders['cache-control'] === 'no-cache'))\n ) {\n return null\n }\n\n cacheKey = this._getPathname(\n cacheKey,\n ctx.kind === IncrementalCacheKind.FETCH\n )\n\n const cacheData = await this.cacheHandler?.get(cacheKey, ctx)\n\n if (ctx.kind === IncrementalCacheKind.FETCH) {\n if (!cacheData) {\n return null\n }\n\n if (cacheData.value?.kind !== CachedRouteKind.FETCH) {\n throw new InvariantError(\n `Expected cached value for cache key ${JSON.stringify(cacheKey)} to be a \"FETCH\" kind, got ${JSON.stringify(cacheData.value?.kind)} instead.`\n )\n }\n\n const workStore = workAsyncStorage.getStore()\n const combinedTags = [...(ctx.tags || []), ...(ctx.softTags || [])]\n // if a tag was revalidated we don't return stale data\n if (\n combinedTags.some(\n (tag) =>\n this.revalidatedTags?.includes(tag) ||\n workStore?.pendingRevalidatedTags?.some((item) => item.tag === tag)\n )\n ) {\n if (IncrementalCache.debug) {\n console.log('IncrementalCache: expired tag', cacheKey)\n }\n\n return null\n }\n\n // As we're able to get the cache entry for this fetch, and the prerender\n // resume data cache (RDC) is available, it must have been populated by a\n // previous fetch, but was not yet present in the in-memory cache. This\n // could be the case when performing multiple renders in parallel during\n // build time where we de-duplicate the fetch calls.\n //\n // We add it to the RDC so that the next fetch call will be able to use it\n // and it won't have to reach into the fetch cache implementation.\n const workUnitStore = workUnitAsyncStorage.getStore()\n if (workUnitStore) {\n const prerenderResumeDataCache =\n getPrerenderResumeDataCache(workUnitStore)\n if (prerenderResumeDataCache) {\n if (IncrementalCache.debug) {\n console.log('IncrementalCache: rdc:set', cacheKey)\n }\n\n prerenderResumeDataCache.fetch.set(cacheKey, cacheData.value)\n }\n }\n\n const revalidate = ctx.revalidate || cacheData.value.revalidate\n const age =\n (performance.timeOrigin +\n performance.now() -\n (cacheData.lastModified || 0)) /\n 1000\n\n let isStale = age > revalidate\n const data = cacheData.value.data\n\n if (areTagsExpired(combinedTags, cacheData.lastModified)) {\n return null\n } else if (areTagsStale(combinedTags, cacheData.lastModified)) {\n isStale = true\n }\n\n return {\n isStale,\n value: { kind: CachedRouteKind.FETCH, data, revalidate },\n }\n } else if (cacheData?.value?.kind === CachedRouteKind.FETCH) {\n throw new InvariantError(\n `Expected cached value for cache key ${JSON.stringify(cacheKey)} not to be a ${JSON.stringify(ctx.kind)} kind, got \"FETCH\" instead.`\n )\n }\n\n let entry: IncrementalResponseCacheEntry | null = null\n const cacheControl = this.cacheControls.get(toRoute(cacheKey))\n\n let isStale: boolean | -1 | undefined\n let revalidateAfter: Revalidate\n\n if (cacheData?.lastModified === -1) {\n isStale = -1\n revalidateAfter = -1 * CACHE_ONE_YEAR\n } else {\n const now = performance.timeOrigin + performance.now()\n const lastModified = cacheData?.lastModified || now\n\n revalidateAfter = this.calculateRevalidate(\n cacheKey,\n lastModified,\n this.dev ?? false,\n ctx.isFallback\n )\n\n isStale =\n revalidateAfter !== false && revalidateAfter < now ? true : undefined\n\n // If the stale time couldn't be determined based on the revalidation\n // time, we check if the tags are expired or stale.\n if (\n isStale === undefined &&\n (cacheData?.value?.kind === CachedRouteKind.APP_PAGE ||\n cacheData?.value?.kind === CachedRouteKind.APP_ROUTE)\n ) {\n const tagsHeader = cacheData.value.headers?.[NEXT_CACHE_TAGS_HEADER]\n\n if (typeof tagsHeader === 'string') {\n const cacheTags = tagsHeader.split(',')\n\n if (cacheTags.length > 0) {\n if (areTagsExpired(cacheTags, lastModified)) {\n isStale = -1\n } else if (areTagsStale(cacheTags, lastModified)) {\n isStale = true\n }\n }\n }\n }\n }\n\n if (cacheData) {\n entry = {\n isStale,\n cacheControl,\n revalidateAfter,\n value: cacheData.value,\n }\n }\n\n if (\n !cacheData &&\n this.prerenderManifest.notFoundRoutes.includes(cacheKey)\n ) {\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 cacheControl,\n revalidateAfter,\n }\n this.set(cacheKey, entry.value, { ...ctx, cacheControl })\n }\n return entry\n }\n\n async set(\n pathname: string,\n data: CachedFetchValue | null,\n ctx: SetIncrementalFetchCacheContext\n ): Promise<void>\n async set(\n pathname: string,\n data: Exclude<IncrementalCacheValue, CachedFetchValue> | null,\n ctx: SetIncrementalResponseCacheContext\n ): Promise<void>\n async set(\n pathname: string,\n data: IncrementalCacheValue | null,\n ctx: SetIncrementalFetchCacheContext | SetIncrementalResponseCacheContext\n ): Promise<void> {\n // Even if we otherwise disable caching for testMode or if no fetchCache is\n // configured we still always stash results in the resume data cache if one\n // exists. This is because this is a transient in memory cache that\n // populates caches ahead of a dynamic render in dev mode to allow the RSC\n // debug info to have the right environment associated to it.\n if (data?.kind === CachedRouteKind.FETCH) {\n const workUnitStore = workUnitAsyncStorage.getStore()\n const prerenderResumeDataCache = workUnitStore\n ? getPrerenderResumeDataCache(workUnitStore)\n : null\n if (prerenderResumeDataCache) {\n if (IncrementalCache.debug) {\n console.log('IncrementalCache: rdc:set', pathname)\n }\n\n prerenderResumeDataCache.fetch.set(pathname, data)\n }\n }\n\n if (this.disableForTestmode || (this.dev && !ctx.fetchCache)) return\n\n pathname = this._getPathname(pathname, ctx.fetchCache)\n\n // FetchCache has upper limit of 2MB per-entry currently\n const itemSize = JSON.stringify(data).length\n if (\n ctx.fetchCache &&\n itemSize > 2 * 1024 * 1024 &&\n // We ignore the size limit when custom cache handler is being used, as it\n // might not have this limit\n !this.hasCustomCacheHandler &&\n // We also ignore the size limit when it's an implicit build-time-only\n // caching that the user isn't even aware of.\n !ctx.isImplicitBuildTimeCache\n ) {\n const warningText = `Failed to set Next.js data cache for ${ctx.fetchUrl || pathname}, items over 2MB can not be cached (${itemSize} bytes)`\n\n if (this.dev) {\n throw new Error(warningText)\n }\n console.warn(warningText)\n return\n }\n\n try {\n if (!ctx.fetchCache && ctx.cacheControl) {\n this.cacheControls.set(toRoute(pathname), ctx.cacheControl)\n }\n\n await this.cacheHandler?.set(pathname, data, ctx)\n } catch (error) {\n console.warn('Failed to update prerender cache for', pathname, error)\n }\n }\n}\n","import type { IncomingMessage, ServerResponse } from 'node:http'\nimport type { NextConfigComplete } from '../../config-shared'\nimport type { UrlWithParsedQuery } from 'node:url'\nimport type { ServerCacheStatus } from '../../../next-devtools/dev-overlay/cache-indicator'\n\nexport type RevalidateFn = (config: {\n urlPath: string\n revalidateHeaders: { [key: string]: string | string[] }\n opts: { unstable_onlyGenerated?: boolean }\n}) => Promise<void>\n\n// The RouterServerContext contains instance specific\n// information that isn't available/relevant when\n// deployed in serverless environments, the key is\n// the relative project dir this allows separate contexts\n// when running multiple next instances in same process\nexport type RouterServerContext = Record<\n string,\n {\n // hostname the server is started with\n hostname?: string\n // revalidate function to bypass going through network\n // to invoke revalidate request (uses mocked req/res)\n revalidate?: RevalidateFn\n // function to render the 404 page\n render404?: (\n req: IncomingMessage,\n res: ServerResponse,\n parsedUrl?: UrlWithParsedQuery,\n setHeaders?: boolean\n ) => Promise<void>\n // exposing nextConfig for dev mode specifically\n nextConfig?: NextConfigComplete\n // whether running in custom server mode\n isCustomServer?: boolean\n // whether test proxy is enabled\n experimentalTestProxy?: boolean\n // allow dev server to log with original stack\n logErrorWithOriginalStack?: (err: unknown, type: string) => void\n // allow setting ISR status in dev\n setIsrStatus?: (key: string, value: boolean | undefined) => void\n setReactDebugChannel?: (\n debugChannel: { readable: ReadableStream<Uint8Array> },\n htmlRequestId: string,\n requestId: string\n ) => void\n setCacheStatus?: (\n status: ServerCacheStatus,\n htmlRequestId: string,\n requestId: string\n ) => void\n }\n>\n\nexport const RouterServerContextSymbol = Symbol.for(\n '@next/router-server-methods'\n)\n\nexport const routerServerGlobal = globalThis as typeof globalThis & {\n [RouterServerContextSymbol]?: RouterServerContext\n}\n","import { NEXT_URL } from '../client/components/app-router-headers'\nimport {\n extractInterceptionRouteInformation,\n isInterceptionRouteAppPath,\n} from '../shared/lib/router/utils/interception-routes'\nimport type { Rewrite } from './load-custom-routes'\nimport type { DeepReadonly } from '../shared/lib/deep-readonly'\nimport { getNamedRouteRegex } from '../shared/lib/router/utils/route-regex'\n\nexport function generateInterceptionRoutesRewrites(\n appPaths: string[],\n basePath = ''\n): Rewrite[] {\n const rewrites: Rewrite[] = []\n\n for (const appPath of appPaths) {\n if (isInterceptionRouteAppPath(appPath)) {\n const { interceptingRoute, interceptedRoute } =\n extractInterceptionRouteInformation(appPath)\n\n const destination = getNamedRouteRegex(basePath + appPath, {\n prefixRouteKeys: true,\n })\n\n const header = getNamedRouteRegex(interceptingRoute, {\n prefixRouteKeys: true,\n reference: destination.reference,\n })\n\n const source = getNamedRouteRegex(basePath + interceptedRoute, {\n prefixRouteKeys: true,\n reference: header.reference,\n })\n\n const headerRegex = header.namedRegex\n // Strip ^ and $ anchors since matchHas() will add them automatically\n .replace(/^\\^/, '')\n .replace(/\\$$/, '')\n // Replace matching the `/` with matching any route segment.\n .replace(/^\\/\\(\\?:\\/\\)\\?$/, '/.*')\n // Replace the optional trailing with slash capture group with one that\n // will match any descendants.\n .replace(/\\(\\?:\\/\\)\\?$/, '(?:/.*)?')\n\n rewrites.push({\n source: source.pathToRegexpPattern,\n destination: destination.pathToRegexpPattern,\n has: [\n {\n type: 'header',\n key: NEXT_URL,\n value: headerRegex,\n },\n ],\n internal: true,\n regex: source.namedRegex,\n })\n }\n }\n\n return rewrites\n}\n\nexport function isInterceptionRouteRewrite(route: DeepReadonly<Rewrite>) {\n // When we generate interception rewrites in the above implementation, we always do so with only a single `has` condition.\n return route.has?.[0]?.key === NEXT_URL\n}\n","import type { IncomingMessage, ServerResponse } from 'node:http'\nimport type {\n InstrumentationOnRequestError,\n RequestErrorContext,\n} from '../instrumentation/types'\nimport type { ParsedUrlQuery } from 'node:querystring'\nimport type { UrlWithParsedQuery } from 'node:url'\nimport type {\n PrerenderManifest,\n RequiredServerFilesManifest,\n} from '../../build'\nimport type { DevRoutesManifest } from '../lib/router-utils/setup-dev-bundler'\nimport type { RouteDefinition } from '../route-definitions/route-definition'\nimport type { DeepReadonly } from '../../shared/lib/deep-readonly'\nimport {\n BUILD_ID_FILE,\n BUILD_MANIFEST,\n CLIENT_REFERENCE_MANIFEST,\n DYNAMIC_CSS_MANIFEST,\n NEXT_FONT_MANIFEST,\n PRERENDER_MANIFEST,\n REACT_LOADABLE_MANIFEST,\n ROUTES_MANIFEST,\n SERVER_FILES_MANIFEST,\n SERVER_REFERENCE_MANIFEST,\n SUBRESOURCE_INTEGRITY_MANIFEST,\n} from '../../shared/lib/constants'\nimport { parseReqUrl } from '../../lib/url'\nimport {\n normalizeLocalePath,\n type PathLocale,\n} from '../../shared/lib/i18n/normalize-locale-path'\nimport { isDynamicRoute } from '../../shared/lib/router/utils'\nimport { removePathPrefix } from '../../shared/lib/router/utils/remove-path-prefix'\nimport { getServerUtils } from '../server-utils'\nimport { detectDomainLocale } from '../../shared/lib/i18n/detect-domain-locale'\nimport { getHostname } from '../../shared/lib/get-hostname'\nimport { checkIsOnDemandRevalidate } from '../api-utils'\nimport type { PreviewData } from '../../types'\nimport type { BuildManifest } from '../get-page-files'\nimport type { ReactLoadableManifest } from '../load-components'\nimport type { NextFontManifest } from '../../build/webpack/plugins/next-font-manifest-plugin'\nimport { normalizeDataPath } from '../../shared/lib/page-path/normalize-data-path'\nimport { pathHasPrefix } from '../../shared/lib/router/utils/path-has-prefix'\nimport { addRequestMeta, getRequestMeta } from '../request-meta'\nimport { normalizePagePath } from '../../shared/lib/page-path/normalize-page-path'\nimport { isStaticMetadataRoute } from '../../lib/metadata/is-metadata-route'\nimport { IncrementalCache } from '../lib/incremental-cache'\nimport { initializeCacheHandlers, setCacheHandler } from '../use-cache/handlers'\nimport { interopDefault } from '../app-render/interop-default'\nimport { RouteKind } from '../route-kind'\nimport type { BaseNextRequest } from '../base-http'\nimport type { I18NConfig, NextConfigComplete } from '../config-shared'\nimport ResponseCache, { type ResponseGenerator } from '../response-cache'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport {\n RouterServerContextSymbol,\n routerServerGlobal,\n type RouterServerContext,\n} from '../lib/router-utils/router-server-context'\nimport { decodePathParams } from '../lib/router-utils/decode-path-params'\nimport { removeTrailingSlash } from '../../shared/lib/router/utils/remove-trailing-slash'\nimport { isInterceptionRouteRewrite } from '../../lib/generate-interception-routes-rewrites'\n\n/**\n * RouteModuleOptions is the options that are passed to the route module, other\n * route modules should extend this class to add specific options for their\n * route.\n */\nexport interface RouteModuleOptions<\n D extends RouteDefinition = RouteDefinition,\n U = unknown,\n> {\n readonly definition: Readonly<D>\n readonly userland: Readonly<U>\n readonly distDir: string\n readonly relativeProjectDir: string\n}\n\n/**\n * RouteHandlerContext is the base context for a route handler.\n */\nexport interface RouteModuleHandleContext {\n /**\n * Any matched parameters for the request. This is only defined for dynamic\n * routes.\n */\n params: Record<string, string | string[] | undefined> | undefined\n}\n\nconst dynamicImportEsmDefault = (id: string) =>\n import(/* webpackIgnore: true */ /* turbopackIgnore: true */ id).then(\n (mod) => mod.default || mod\n )\n\n/**\n * RouteModule is the base class for all route modules. This class should be\n * extended by all route modules.\n */\nexport abstract class RouteModule<\n D extends RouteDefinition = RouteDefinition,\n U = unknown,\n> {\n /**\n * The userland module. This is the module that is exported from the user's\n * code. This is marked as readonly to ensure that the module is not mutated\n * because the module (when compiled) only provides getters.\n */\n public readonly userland: Readonly<U>\n\n /**\n * The definition of the route.\n */\n public readonly definition: Readonly<D>\n\n /**\n * The shared modules that are exposed and required for the route module.\n */\n public static readonly sharedModules: any\n\n public isDev: boolean\n public distDir: string\n public relativeProjectDir: string\n public incrementCache?: IncrementalCache\n public responseCache?: ResponseCache\n\n constructor({\n userland,\n definition,\n distDir,\n relativeProjectDir,\n }: RouteModuleOptions<D, U>) {\n this.userland = userland\n this.definition = definition\n this.isDev = process.env.NODE_ENV === 'development'\n this.distDir = distDir\n this.relativeProjectDir = relativeProjectDir\n }\n\n public async instrumentationOnRequestError(\n req: IncomingMessage | BaseNextRequest,\n ...args: Parameters<InstrumentationOnRequestError>\n ) {\n if (process.env.NEXT_RUNTIME === 'edge') {\n const { getEdgeInstrumentationModule } = await import('../web/globals')\n const instrumentation = await getEdgeInstrumentationModule()\n\n if (instrumentation) {\n await instrumentation.onRequestError?.(...args)\n }\n } else {\n const { join } = require('node:path') as typeof import('node:path')\n const absoluteProjectDir = join(\n /* turbopackIgnore: true */\n process.cwd(),\n getRequestMeta(req, 'relativeProjectDir') || this.relativeProjectDir\n )\n\n const { instrumentationOnRequestError } = await import(\n '../lib/router-utils/instrumentation-globals.external.js'\n )\n\n return instrumentationOnRequestError(\n absoluteProjectDir,\n this.distDir,\n ...args\n )\n }\n }\n\n private loadManifests(\n srcPage: string,\n projectDir?: string\n ): {\n buildId: string\n buildManifest: BuildManifest\n fallbackBuildManifest: BuildManifest\n routesManifest: DeepReadonly<DevRoutesManifest>\n nextFontManifest: DeepReadonly<NextFontManifest>\n prerenderManifest: DeepReadonly<PrerenderManifest>\n serverFilesManifest: RequiredServerFilesManifest\n reactLoadableManifest: DeepReadonly<ReactLoadableManifest>\n subresourceIntegrityManifest: any\n clientReferenceManifest: any\n serverActionsManifest: any\n dynamicCssManifest: any\n interceptionRoutePatterns: RegExp[]\n } {\n if (process.env.NEXT_RUNTIME === 'edge') {\n const { getEdgePreviewProps } =\n require('../web/get-edge-preview-props') as typeof import('../web/get-edge-preview-props')\n\n const maybeJSONParse = (str?: string) =>\n str ? JSON.parse(str) : undefined\n\n return {\n buildId: process.env.__NEXT_BUILD_ID || '',\n buildManifest: self.__BUILD_MANIFEST as any,\n fallbackBuildManifest: {} as any,\n reactLoadableManifest: maybeJSONParse(self.__REACT_LOADABLE_MANIFEST),\n nextFontManifest: maybeJSONParse(self.__NEXT_FONT_MANIFEST),\n prerenderManifest: {\n routes: {},\n dynamicRoutes: {},\n notFoundRoutes: [],\n version: 4,\n preview: getEdgePreviewProps(),\n },\n routesManifest: {\n version: 4,\n caseSensitive: Boolean(process.env.__NEXT_CASE_SENSITIVE_ROUTES),\n basePath: process.env.__NEXT_BASE_PATH || '',\n rewrites: (process.env.__NEXT_REWRITES as any) || {\n beforeFiles: [],\n afterFiles: [],\n fallback: [],\n },\n redirects: [],\n headers: [],\n i18n:\n (process.env.__NEXT_I18N_CONFIG as any as I18NConfig) || undefined,\n skipProxyUrlNormalize: Boolean(\n process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE\n ),\n },\n serverFilesManifest: {\n config: (globalThis as any).nextConfig || {},\n } as any,\n clientReferenceManifest: self.__RSC_MANIFEST?.[srcPage],\n serverActionsManifest: maybeJSONParse(self.__RSC_SERVER_MANIFEST),\n subresourceIntegrityManifest: maybeJSONParse(\n self.__SUBRESOURCE_INTEGRITY_MANIFEST\n ),\n dynamicCssManifest: maybeJSONParse(self.__DYNAMIC_CSS_MANIFEST),\n interceptionRoutePatterns: (\n maybeJSONParse(self.__INTERCEPTION_ROUTE_REWRITE_MANIFEST) ?? []\n ).map((rewrite: any) => new RegExp(rewrite.regex)),\n }\n } else {\n if (!projectDir) {\n throw new Error('Invariant: projectDir is required for node runtime')\n }\n const { loadManifestFromRelativePath } =\n require('../load-manifest.external') as typeof import('../load-manifest.external')\n const normalizedPagePath = normalizePagePath(srcPage)\n\n const router =\n this.definition.kind === RouteKind.PAGES ||\n this.definition.kind === RouteKind.PAGES_API\n ? 'pages'\n : 'app'\n\n const [\n routesManifest,\n prerenderManifest,\n buildManifest,\n fallbackBuildManifest,\n reactLoadableManifest,\n nextFontManifest,\n clientReferenceManifest,\n serverActionsManifest,\n subresourceIntegrityManifest,\n serverFilesManifest,\n buildId,\n dynamicCssManifest,\n ] = [\n loadManifestFromRelativePath<DevRoutesManifest>({\n projectDir,\n distDir: this.distDir,\n manifest: ROUTES_MANIFEST,\n shouldCache: !this.isDev,\n }),\n loadManifestFromRelativePath<PrerenderManifest>({\n projectDir,\n distDir: this.distDir,\n manifest: PRERENDER_MANIFEST,\n shouldCache: !this.isDev,\n }),\n loadManifestFromRelativePath<BuildManifest>({\n projectDir,\n distDir: this.distDir,\n manifest: BUILD_MANIFEST,\n shouldCache: !this.isDev,\n }),\n srcPage === '/_error'\n ? loadManifestFromRelativePath<BuildManifest>({\n projectDir,\n distDir: this.distDir,\n manifest: `fallback-${BUILD_MANIFEST}`,\n shouldCache: !this.isDev,\n handleMissing: true,\n })\n : ({} as BuildManifest),\n loadManifestFromRelativePath<ReactLoadableManifest>({\n projectDir,\n distDir: this.distDir,\n manifest: process.env.TURBOPACK\n ? `server/${router === 'app' ? 'app' : 'pages'}${normalizedPagePath}/${REACT_LOADABLE_MANIFEST}`\n : REACT_LOADABLE_MANIFEST,\n handleMissing: true,\n shouldCache: !this.isDev,\n }),\n loadManifestFromRelativePath<NextFontManifest>({\n projectDir,\n distDir: this.distDir,\n manifest: `server/${NEXT_FONT_MANIFEST}.json`,\n shouldCache: !this.isDev,\n }),\n router === 'app' && !isStaticMetadataRoute(srcPage)\n ? loadManifestFromRelativePath({\n distDir: this.distDir,\n projectDir,\n useEval: true,\n handleMissing: true,\n manifest: `server/app${srcPage.replace(/%5F/g, '_') + '_' + CLIENT_REFERENCE_MANIFEST}.js`,\n shouldCache: !this.isDev,\n })\n : undefined,\n router === 'app'\n ? loadManifestFromRelativePath<any>({\n distDir: this.distDir,\n projectDir,\n manifest: `server/${SERVER_REFERENCE_MANIFEST}.json`,\n handleMissing: true,\n shouldCache: !this.isDev,\n })\n : {},\n loadManifestFromRelativePath<Record<string, string>>({\n projectDir,\n distDir: this.distDir,\n manifest: `server/${SUBRESOURCE_INTEGRITY_MANIFEST}.json`,\n handleMissing: true,\n shouldCache: !this.isDev,\n }),\n this.isDev\n ? ({} as any)\n : loadManifestFromRelativePath<RequiredServerFilesManifest>({\n projectDir,\n distDir: this.distDir,\n manifest: SERVER_FILES_MANIFEST,\n }),\n this.isDev\n ? 'development'\n : loadManifestFromRelativePath<any>({\n projectDir,\n distDir: this.distDir,\n manifest: BUILD_ID_FILE,\n skipParse: true,\n }),\n loadManifestFromRelativePath<any>({\n projectDir,\n distDir: this.distDir,\n manifest: DYNAMIC_CSS_MANIFEST,\n handleMissing: true,\n }),\n ]\n\n return {\n buildId,\n buildManifest,\n fallbackBuildManifest,\n routesManifest,\n nextFontManifest,\n prerenderManifest,\n serverFilesManifest,\n reactLoadableManifest,\n clientReferenceManifest: (clientReferenceManifest as any)\n ?.__RSC_MANIFEST?.[srcPage.replace(/%5F/g, '_')],\n serverActionsManifest,\n subresourceIntegrityManifest,\n dynamicCssManifest,\n interceptionRoutePatterns: routesManifest.rewrites.beforeFiles\n .filter(isInterceptionRouteRewrite)\n .map((rewrite) => new RegExp(rewrite.regex)),\n }\n }\n }\n\n public async loadCustomCacheHandlers(\n req: IncomingMessage | BaseNextRequest,\n nextConfig: NextConfigComplete\n ) {\n if (process.env.NEXT_RUNTIME !== 'edge') {\n const { cacheMaxMemorySize, cacheHandlers } = nextConfig\n if (!cacheHandlers) return\n\n // If we've already initialized the cache handlers interface, don't do it\n // again.\n if (!initializeCacheHandlers(cacheMaxMemorySize)) return\n\n for (const [kind, handler] of Object.entries(cacheHandlers)) {\n if (!handler) continue\n\n const { formatDynamicImportPath } =\n require('../../lib/format-dynamic-import-path') as typeof import('../../lib/format-dynamic-import-path')\n\n const { join } = require('node:path') as typeof import('node:path')\n const absoluteProjectDir = join(\n /* turbopackIgnore: true */\n process.cwd(),\n getRequestMeta(req, 'relativeProjectDir') || this.relativeProjectDir\n )\n\n setCacheHandler(\n kind,\n interopDefault(\n await dynamicImportEsmDefault(\n formatDynamicImportPath(\n `${absoluteProjectDir}/${this.distDir}`,\n handler\n )\n )\n )\n )\n }\n }\n }\n\n public async getIncrementalCache(\n req: IncomingMessage | BaseNextRequest,\n nextConfig: NextConfigComplete,\n prerenderManifest: DeepReadonly<PrerenderManifest>,\n isMinimalMode: boolean\n ): Promise<IncrementalCache> {\n if (process.env.NEXT_RUNTIME === 'edge') {\n return (globalThis as any).__incrementalCache\n } else {\n let CacheHandler: any\n const { cacheHandler } = nextConfig\n\n if (cacheHandler) {\n const { formatDynamicImportPath } =\n require('../../lib/format-dynamic-import-path') as typeof import('../../lib/format-dynamic-import-path')\n\n CacheHandler = interopDefault(\n await dynamicImportEsmDefault(\n formatDynamicImportPath(this.distDir, cacheHandler)\n )\n )\n }\n const { join } = require('node:path') as typeof import('node:path')\n const projectDir = join(\n /* turbopackIgnore: true */\n process.cwd(),\n getRequestMeta(req, 'relativeProjectDir') || this.relativeProjectDir\n )\n\n await this.loadCustomCacheHandlers(req, nextConfig)\n\n // incremental-cache is request specific\n // although can have shared caches in module scope\n // per-cache handler\n const incrementalCache = new IncrementalCache({\n fs: (\n require('../lib/node-fs-methods') as typeof import('../lib/node-fs-methods')\n ).nodeFs,\n dev: this.isDev,\n requestHeaders: req.headers,\n allowedRevalidateHeaderKeys:\n nextConfig.experimental.allowedRevalidateHeaderKeys,\n minimalMode: isMinimalMode,\n serverDistDir: `${projectDir}/${this.distDir}/server`,\n fetchCacheKeyPrefix: nextConfig.experimental.fetchCacheKeyPrefix,\n maxMemoryCacheSize: nextConfig.cacheMaxMemorySize,\n flushToDisk: !isMinimalMode && nextConfig.experimental.isrFlushToDisk,\n getPrerenderManifest: () => prerenderManifest,\n CurCacheHandler: CacheHandler,\n })\n\n // we need to expose this on globalThis as the app-render\n // workStore grabs the incrementalCache from there\n ;(globalThis as any).__incrementalCache = incrementalCache\n return incrementalCache\n }\n }\n\n public async onRequestError(\n req: IncomingMessage | BaseNextRequest,\n err: unknown,\n errorContext: RequestErrorContext,\n routerServerContext?: RouterServerContext[string]\n ) {\n if (routerServerContext?.logErrorWithOriginalStack) {\n routerServerContext.logErrorWithOriginalStack(err, 'app-dir')\n } else {\n console.error(err)\n }\n await this.instrumentationOnRequestError(\n req,\n err,\n {\n path: req.url || '/',\n headers: req.headers,\n method: req.method || 'GET',\n },\n errorContext\n )\n }\n\n public async prepare(\n req: IncomingMessage | BaseNextRequest,\n res: ServerResponse | null,\n {\n srcPage,\n multiZoneDraftMode,\n }: {\n srcPage: string\n multiZoneDraftMode?: boolean\n }\n ): Promise<\n | {\n buildId: string\n locale?: string\n locales?: readonly string[]\n defaultLocale?: string\n query: ParsedUrlQuery\n originalQuery: ParsedUrlQuery\n originalPathname: string\n params?: ParsedUrlQuery\n parsedUrl: UrlWithParsedQuery\n previewData: PreviewData\n pageIsDynamic: boolean\n isDraftMode: boolean\n resolvedPathname: string\n encodedResolvedPathname: string\n isNextDataRequest: boolean\n buildManifest: DeepReadonly<BuildManifest>\n fallbackBuildManifest: DeepReadonly<BuildManifest>\n nextFontManifest: DeepReadonly<NextFontManifest>\n serverFilesManifest: DeepReadonly<RequiredServerFilesManifest>\n reactLoadableManifest: DeepReadonly<ReactLoadableManifest>\n routesManifest: DeepReadonly<DevRoutesManifest>\n prerenderManifest: DeepReadonly<PrerenderManifest>\n // we can't pull in the client reference type or it causes issues with\n // our pre-compiled types\n clientReferenceManifest?: any\n serverActionsManifest?: any\n dynamicCssManifest?: any\n subresourceIntegrityManifest?: DeepReadonly<Record<string, string>>\n isOnDemandRevalidate: boolean\n revalidateOnlyGenerated: boolean\n nextConfig: NextConfigComplete\n routerServerContext?: RouterServerContext[string]\n interceptionRoutePatterns?: any\n }\n | undefined\n > {\n let absoluteProjectDir: string | undefined\n\n // edge runtime handles loading instrumentation at the edge adapter level\n if (process.env.NEXT_RUNTIME !== 'edge') {\n const { join, relative } =\n require('node:path') as typeof import('node:path')\n\n absoluteProjectDir = join(\n /* turbopackIgnore: true */\n process.cwd(),\n getRequestMeta(req, 'relativeProjectDir') || this.relativeProjectDir\n )\n\n const absoluteDistDir = getRequestMeta(req, 'distDir')\n\n if (absoluteDistDir) {\n this.distDir = relative(absoluteProjectDir, absoluteDistDir)\n }\n const { ensureInstrumentationRegistered } = await import(\n '../lib/router-utils/instrumentation-globals.external.js'\n )\n // ensure instrumentation is registered and pass\n // onRequestError below\n ensureInstrumentationRegistered(absoluteProjectDir, this.distDir)\n }\n const manifests = await this.loadManifests(srcPage, absoluteProjectDir)\n const { routesManifest, prerenderManifest, serverFilesManifest } = manifests\n\n const { basePath, i18n, rewrites } = routesManifest\n\n if (basePath) {\n req.url = removePathPrefix(req.url || '/', basePath)\n }\n\n const parsedUrl = parseReqUrl(req.url || '/')\n // if we couldn't parse the URL we can't continue\n if (!parsedUrl) {\n return\n }\n let isNextDataRequest = false\n\n if (pathHasPrefix(parsedUrl.pathname || '/', '/_next/data')) {\n isNextDataRequest = true\n parsedUrl.pathname = normalizeDataPath(parsedUrl.pathname || '/')\n }\n let originalPathname = parsedUrl.pathname || '/'\n const originalQuery = { ...parsedUrl.query }\n const pageIsDynamic = isDynamicRoute(srcPage)\n\n let localeResult: PathLocale | undefined\n let detectedLocale: string | undefined\n\n if (i18n) {\n localeResult = normalizeLocalePath(\n parsedUrl.pathname || '/',\n i18n.locales\n )\n\n if (localeResult.detectedLocale) {\n req.url = `${localeResult.pathname}${parsedUrl.search}`\n originalPathname = localeResult.pathname\n\n if (!detectedLocale) {\n detectedLocale = localeResult.detectedLocale\n }\n }\n }\n\n // Normalize the page path for route matching. The srcPage contains the\n // internal page path (e.g., /app/[slug]/page), but route matchers expect\n // the pathname format (e.g., /app/[slug]).\n const normalizedSrcPage = normalizeAppPath(srcPage)\n\n const serverUtils = getServerUtils({\n page: normalizedSrcPage,\n i18n,\n basePath,\n rewrites,\n pageIsDynamic,\n trailingSlash: process.env.__NEXT_TRAILING_SLASH as any as boolean,\n caseSensitive: Boolean(routesManifest.caseSensitive),\n })\n\n const domainLocale = detectDomainLocale(\n i18n?.domains,\n getHostname(parsedUrl, req.headers),\n detectedLocale\n )\n addRequestMeta(req, 'isLocaleDomain', Boolean(domainLocale))\n\n const defaultLocale = domainLocale?.defaultLocale || i18n?.defaultLocale\n\n // Ensure parsedUrl.pathname includes locale before processing\n // rewrites or they won't match correctly.\n if (defaultLocale && !detectedLocale) {\n parsedUrl.pathname = `/${defaultLocale}${parsedUrl.pathname === '/' ? '' : parsedUrl.pathname}`\n }\n const locale =\n getRequestMeta(req, 'locale') || detectedLocale || defaultLocale\n\n // we apply rewrites against cloned URL so that we don't\n // modify the original with the rewrite destination\n const { rewriteParams, rewrittenParsedUrl } = serverUtils.handleRewrites(\n req,\n parsedUrl\n )\n const rewriteParamKeys = Object.keys(rewriteParams)\n Object.assign(parsedUrl.query, rewrittenParsedUrl.query)\n\n // after processing rewrites we want to remove locale\n // from parsedUrl pathname\n if (i18n) {\n parsedUrl.pathname = normalizeLocalePath(\n parsedUrl.pathname || '/',\n i18n.locales\n ).pathname\n\n rewrittenParsedUrl.pathname = normalizeLocalePath(\n rewrittenParsedUrl.pathname || '/',\n i18n.locales\n ).pathname\n }\n\n let params: Record<string, undefined | string | string[]> | undefined =\n getRequestMeta(req, 'params')\n\n // attempt parsing from pathname\n if (!params && serverUtils.dynamicRouteMatcher) {\n const paramsMatch = serverUtils.dynamicRouteMatcher(\n normalizeDataPath(\n rewrittenParsedUrl?.pathname || parsedUrl.pathname || '/'\n )\n )\n const paramsResult = serverUtils.normalizeDynamicRouteParams(\n paramsMatch || {},\n true\n )\n\n if (paramsResult.hasValidParams) {\n params = paramsResult.params\n }\n }\n\n // Local \"next start\" expects the routing parsed query values\n // to not be present in the URL although when deployed proxies\n // will add query values from resolving the routes to pass to function.\n\n // TODO: do we want to change expectations for \"next start\"\n // to include these query values in the URL which affects asPath\n // but would match deployed behavior, e.g. a rewrite from middleware\n // that adds a query param would be in asPath as query but locally\n // it won't be in the asPath but still available in the query object\n const query = getRequestMeta(req, 'query') || {\n ...parsedUrl.query,\n }\n\n const routeParamKeys = new Set<string>()\n const combinedParamKeys = []\n\n // We don't include rewriteParamKeys in the combinedParamKeys\n // for app router since the searchParams is populated from the\n // URL so we don't want to strip the rewrite params from the URL\n // so that searchParams can include them.\n if (\n this.definition.kind === RouteKind.PAGES ||\n this.definition.kind === RouteKind.PAGES_API\n ) {\n for (const key of [\n ...rewriteParamKeys,\n ...Object.keys(serverUtils.defaultRouteMatches || {}),\n ]) {\n // We only want to filter rewrite param keys from the URL\n // if they are matches from the URL e.g. the key/value matches\n // before and after applying the rewrites /:path for /hello and\n // { path: 'hello' } but not for { path: 'another' } and /hello\n // TODO: we should prefix rewrite param keys the same as we do\n // for dynamic routes so we can identify them properly\n const originalValue = Array.isArray(originalQuery[key])\n ? originalQuery[key].join('')\n : originalQuery[key]\n\n const queryValue = Array.isArray(query[key])\n ? query[key].join('')\n : query[key]\n\n if (!(key in originalQuery) || originalValue === queryValue) {\n combinedParamKeys.push(key)\n }\n }\n }\n\n serverUtils.normalizeCdnUrl(req, combinedParamKeys)\n serverUtils.normalizeQueryParams(query, routeParamKeys)\n serverUtils.filterInternalQuery(originalQuery, combinedParamKeys)\n\n if (pageIsDynamic) {\n const queryResult = serverUtils.normalizeDynamicRouteParams(query, true)\n\n const paramsResult = serverUtils.normalizeDynamicRouteParams(\n params || {},\n true\n )\n\n let paramsToInterpolate: ParsedUrlQuery\n\n if (\n // if both query and params are valid but one\n // provided more information rely on that one\n query &&\n params &&\n paramsResult.hasValidParams &&\n queryResult.hasValidParams &&\n Object.keys(paramsResult.params).length <\n Object.keys(queryResult.params).length\n ) {\n paramsToInterpolate = queryResult.params\n params = Object.assign(queryResult.params)\n } else {\n paramsToInterpolate =\n paramsResult.hasValidParams && params\n ? params\n : queryResult.hasValidParams\n ? query\n : {}\n }\n\n req.url = serverUtils.interpolateDynamicPath(\n req.url || '/',\n paramsToInterpolate\n )\n parsedUrl.pathname = serverUtils.interpolateDynamicPath(\n parsedUrl.pathname || '/',\n paramsToInterpolate\n )\n originalPathname = serverUtils.interpolateDynamicPath(\n originalPathname,\n paramsToInterpolate\n )\n\n // try pulling from query if valid\n if (!params) {\n if (queryResult.hasValidParams) {\n params = Object.assign({}, queryResult.params)\n\n // If we pulled from query remove it so it's\n // only in params\n for (const key in serverUtils.defaultRouteMatches) {\n delete query[key]\n }\n } else {\n // use final params from URL matching\n const paramsMatch = serverUtils.dynamicRouteMatcher?.(\n normalizeDataPath(\n localeResult?.pathname || parsedUrl.pathname || '/'\n )\n )\n // we don't normalize these as they are allowed to be\n // the literal slug matches here e.g. /blog/[slug]\n // actually being requested\n if (paramsMatch) {\n params = Object.assign({}, paramsMatch)\n }\n }\n }\n }\n\n // Remove any normalized params from the query if they\n // weren't present as non-prefixed query key e.g.\n // ?search=1&nxtPsearch=hello we don't delete search\n for (const key of routeParamKeys) {\n if (!(key in originalQuery)) {\n delete query[key]\n }\n }\n\n const { isOnDemandRevalidate, revalidateOnlyGenerated } =\n checkIsOnDemandRevalidate(req, prerenderManifest.preview)\n\n let isDraftMode = false\n let previewData: PreviewData\n\n // preview data relies on non-edge utils\n if (process.env.NEXT_RUNTIME !== 'edge' && res) {\n const { tryGetPreviewData } =\n require('../api-utils/node/try-get-preview-data') as typeof import('../api-utils/node/try-get-preview-data')\n\n previewData = tryGetPreviewData(\n req,\n res,\n prerenderManifest.preview,\n Boolean(multiZoneDraftMode)\n )\n isDraftMode = previewData !== false\n }\n\n const relativeProjectDir =\n getRequestMeta(req, 'relativeProjectDir') || this.relativeProjectDir\n\n const routerServerContext =\n routerServerGlobal[RouterServerContextSymbol]?.[relativeProjectDir]\n const nextConfig =\n routerServerContext?.nextConfig || serverFilesManifest.config\n\n let resolvedPathname = normalizedSrcPage\n if (isDynamicRoute(resolvedPathname) && params) {\n resolvedPathname = serverUtils.interpolateDynamicPath(\n resolvedPathname,\n params\n )\n }\n\n if (resolvedPathname === '/index') {\n resolvedPathname = '/'\n }\n const encodedResolvedPathname = resolvedPathname\n\n // we decode for cache key/manifest usage encoded is\n // for URL building\n try {\n resolvedPathname = decodePathParams(resolvedPathname)\n } catch (_) {}\n\n resolvedPathname = removeTrailingSlash(resolvedPathname)\n\n return {\n query,\n originalQuery,\n originalPathname,\n params,\n parsedUrl,\n locale,\n isNextDataRequest,\n locales: i18n?.locales,\n defaultLocale,\n isDraftMode,\n previewData,\n pageIsDynamic,\n resolvedPathname,\n encodedResolvedPathname,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n ...manifests,\n serverActionsManifest: manifests.serverActionsManifest,\n clientReferenceManifest: manifests.clientReferenceManifest,\n nextConfig,\n routerServerContext,\n }\n }\n\n public getResponseCache(req: IncomingMessage | BaseNextRequest) {\n if (!this.responseCache) {\n const minimalMode =\n (Boolean(process.env.MINIMAL_MODE) ||\n getRequestMeta(req, 'minimalMode')) ??\n false\n this.responseCache = new ResponseCache(minimalMode)\n }\n return this.responseCache\n }\n\n public async handleResponse({\n req,\n nextConfig,\n cacheKey,\n routeKind,\n isFallback,\n prerenderManifest,\n isRoutePPREnabled,\n isOnDemandRevalidate,\n revalidateOnlyGenerated,\n responseGenerator,\n waitUntil,\n isMinimalMode,\n }: {\n req: IncomingMessage | BaseNextRequest\n nextConfig: NextConfigComplete\n cacheKey: string | null\n routeKind: RouteKind\n isFallback?: boolean\n prerenderManifest: DeepReadonly<PrerenderManifest>\n isRoutePPREnabled?: boolean\n isOnDemandRevalidate?: boolean\n revalidateOnlyGenerated?: boolean\n responseGenerator: ResponseGenerator\n waitUntil?: (prom: Promise<any>) => void\n isMinimalMode: boolean\n }) {\n const responseCache = this.getResponseCache(req)\n const cacheEntry = await responseCache.get(cacheKey, responseGenerator, {\n routeKind,\n isFallback,\n isRoutePPREnabled,\n isOnDemandRevalidate,\n isPrefetch: req.headers.purpose === 'prefetch',\n incrementalCache: await this.getIncrementalCache(\n req,\n nextConfig,\n prerenderManifest,\n isMinimalMode\n ),\n waitUntil,\n })\n\n if (!cacheEntry) {\n if (\n cacheKey &&\n // revalidate only generated can bail even if cacheKey is provided\n !(isOnDemandRevalidate && revalidateOnlyGenerated)\n ) {\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 }\n return cacheEntry\n }\n}\n","export function isAppRouteRoute(route: string): boolean {\n return route.endsWith('/route')\n}\n","/**\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 */\nexport function normalizePathSep(path: string): string {\n return path.replace(/\\\\/g, '/')\n}\n","import type { Key } from 'next/dist/compiled/path-to-regexp'\nimport { regexpToFunction } from 'next/dist/compiled/path-to-regexp'\nimport { pathToRegexp } from 'next/dist/compiled/path-to-regexp'\n\ninterface Options {\n /**\n * A transformer function that will be applied to the regexp generated\n * from the provided path and path-to-regexp.\n */\n regexModifier?: (regex: string) => string\n /**\n * When true the function will remove all unnamed parameters\n * from the matched parameters.\n */\n removeUnnamedParams?: boolean\n /**\n * When true the regexp won't allow an optional trailing delimiter\n * to match.\n */\n strict?: boolean\n\n /**\n * When true the matcher will be case-sensitive, defaults to false\n */\n sensitive?: boolean\n}\n\nexport type PatchMatcher = (\n pathname: string,\n params?: Record<string, any>\n) => Record<string, any> | false\n\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 */\nexport function getPathMatch(path: string, options?: Options): PatchMatcher {\n const keys: Key[] = []\n const regexp = pathToRegexp(path, keys, {\n delimiter: '/',\n sensitive:\n typeof options?.sensitive === 'boolean' ? options.sensitive : false,\n strict: options?.strict,\n })\n\n const matcher = regexpToFunction<Record<string, any>>(\n options?.regexModifier\n ? new RegExp(options.regexModifier(regexp.source), regexp.flags)\n : regexp,\n keys\n )\n\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 */\n return (pathname, params) => {\n // If no pathname is provided it's not a match.\n if (typeof pathname !== 'string') return false\n\n const match = matcher(pathname)\n\n // If the path did not match `false` will be returned.\n if (!match) return false\n\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 */\n if (options?.removeUnnamedParams) {\n for (const key of keys) {\n if (typeof key.name === 'number') {\n delete match.params[key.name]\n }\n }\n }\n\n return { ...params, ...match.params }\n }\n}\n","import type { NextApiRequestCookies } from '.'\n\n/**\n * Parse cookies from the `headers` of request\n * @param req request object\n */\n\nexport function getCookieParser(headers: {\n [key: string]: string | string[] | null | undefined\n}): () => NextApiRequestCookies {\n return function parseCookie(): NextApiRequestCookies {\n const { cookie } = headers\n\n if (!cookie) {\n return {}\n }\n\n const { parse: parseCookieFn } =\n require('next/dist/compiled/cookie') as typeof import('next/dist/compiled/cookie')\n return parseCookieFn(Array.isArray(cookie) ? cookie.join('; ') : cookie)\n }\n}\n","import type { ParsedUrlQuery } from 'querystring'\n\nimport { searchParamsToUrlQuery } from './querystring'\nimport { parseRelativeUrl } from './parse-relative-url'\n\nexport interface ParsedUrl {\n hash: string\n hostname?: string | null\n href: string\n pathname: string\n port?: string | null\n protocol?: string | null\n query: ParsedUrlQuery\n origin?: string | null\n search: string\n slashes: boolean | undefined\n}\n\nexport function parseUrl(url: string): ParsedUrl {\n if (url.startsWith('/')) {\n return parseRelativeUrl(url)\n }\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 origin: parsedURL.origin,\n slashes:\n parsedURL.href.slice(\n parsedURL.protocol.length,\n parsedURL.protocol.length + 2\n ) === '//',\n }\n}\n","import escapePathDelimiters from '../../../shared/lib/router/utils/escape-path-delimiters'\nimport { DecodeError } from '../../../shared/lib/utils'\n\n/**\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.\n * Japanese characters.\n * */\nfunction decodePathParams(pathname: string): string {\n // TODO: investigate adding this handling for non-SSG\n // pages so non-ascii names also work there.\n return pathname\n .split('/')\n .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 path param(s).')\n }\n return seg\n })\n .join('/')\n}\n\nexport { decodePathParams }\n","// escape delimiters used by path-to-regexp\nexport default function escapePathDelimiters(\n segment: string,\n escapeEncoded?: boolean\n): string {\n return segment.replace(\n new RegExp(`([/#?]${escapeEncoded ? '|%(2f|23|3f|5c)' : ''})`, 'gi'),\n (char: string) => encodeURIComponent(char)\n )\n}\n","import React from 'react'\nimport type { NextRouter } from './router/router'\n\nexport const RouterContext = React.createContext<NextRouter | null>(null)\n\nif (process.env.NODE_ENV !== 'production') {\n RouterContext.displayName = 'RouterContext'\n}\n","import type {\n DynamicPrerenderManifestRoute,\n PrerenderManifest,\n} from '../../../../build'\nimport type { DeepReadonly } from '../../../../shared/lib/deep-readonly'\nimport {\n getRouteMatcher,\n type RouteMatchFn,\n} from '../../../../shared/lib/router/utils/route-matcher'\nimport { getRouteRegex } from '../../../../shared/lib/router/utils/route-regex'\n\n/**\n * A matcher for a dynamic route.\n */\ntype Matcher = {\n /**\n * The matcher for the dynamic route. This is lazily created when the matcher\n * is first used.\n */\n matcher?: RouteMatchFn\n\n /**\n * The source of the dynamic route.\n */\n source: string\n\n /**\n * The route that matches the source.\n */\n route: DeepReadonly<DynamicPrerenderManifestRoute>\n}\n\n/**\n * A matcher for the prerender manifest.\n *\n * This class is used to match the pathname to the dynamic route.\n */\nexport class PrerenderManifestMatcher {\n private readonly matchers: Array<Matcher>\n constructor(\n pathname: string,\n prerenderManifest: DeepReadonly<PrerenderManifest>\n ) {\n this.matchers = Object.entries(prerenderManifest.dynamicRoutes)\n .filter(([source, route]) => {\n // If the pathname is a fallback source route, or the source route is\n // the same as the pathname, then we should include it in the matchers.\n return route.fallbackSourceRoute === pathname || source === pathname\n })\n .map(([source, route]) => ({ source, route }))\n }\n\n /**\n * Match the pathname to the dynamic route. If no match is found, an error is\n * thrown.\n *\n * @param pathname - The pathname to match.\n * @returns The dynamic route that matches the pathname.\n */\n public match(\n pathname: string\n ): DeepReadonly<DynamicPrerenderManifestRoute> | null {\n // Iterate over the matchers. They're already in the correct order of\n // specificity as they were inserted into the prerender manifest that way\n // and iterating over them with Object.entries guarantees that.\n for (const matcher of this.matchers) {\n // Lazily create the matcher, this is only done once per matcher.\n if (!matcher.matcher) {\n matcher.matcher = getRouteMatcher(getRouteRegex(matcher.source))\n }\n\n const match = matcher.matcher(pathname)\n if (match) {\n return matcher.route\n }\n }\n\n return null\n }\n}\n"],"names":["b","error","Error","exports","require","version","renderToReadableStream","resume","Object","Date","Boolean","encodeURIComponent","Map","decodeURIComponent","Number","Symbol","Array","n","r","JSON","e","t","c","Buffer","process","Math","String","s","TextDecoder","i","h","__dirname","o","u","isNaN","parseFloat","parseInt","__nccwpck_require__","TypeError","a","isFinite","arguments","f","Promise","setTimeout","clearTimeout","clearInterval","setInterval","RegExp","_","R","queueMicrotask","Uint8Array","V","Set","Blob","WeakMap","Function","Reflect","console","setImmediate","p","Headers","ReadableStream","__REACT_DEVTOOLS_GLOBAL_HOOK__","reportError","globalThis","FormData","ArrayBuffer","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","DataView","NaN","BigInt","RangeError","basePath","env","__NEXT_ROUTER_BASEPATH","addBasePath","path","required","__NEXT_MANUAL_CLIENT_BASE_PATH","addPathPrefix","startsWith","__NEXT_MANUAL_TRAILING_SLASH","pathname","query","hash","parsePath","__NEXT_TRAILING_SLASH","test","endsWith","removeTrailingSlash","getAppBuildId","callServer","actionId","actionArgs","resolve","reject","startTransition","dispatchAppRouterAction","type","ACTION_SERVER_ACTION","findSourceMapURL","undefined","RSC_HEADER","ACTION_HEADER","NEXT_ROUTER_STATE_TREE_HEADER","NEXT_ROUTER_PREFETCH_HEADER","NEXT_ROUTER_SEGMENT_PREFETCH_HEADER","NEXT_HMR_REFRESH_HEADER","NEXT_URL","RSC_CONTENT_TYPE_HEADER","FLIGHT_HEADERS","NEXT_RSC_UNION_QUERY","NEXT_ROUTER_STALE_TIME_HEADER","NEXT_DID_POSTPONE_HEADER","NEXT_REWRITTEN_PATH_HEADER","NEXT_REWRITTEN_QUERY_HEADER","NEXT_ACTION_NOT_FOUND_HEADER","isExternalURL","url","origin","window","location","createPrefetchURL","href","isBot","navigator","userAgent","URL","isDynamicServerError","err","digest","ALLOWED_CODES","values","NOT_FOUND","FORBIDDEN","UNAUTHORIZED","HTTP_ERROR_FALLBACK_ERROR_CODE","isHTTPAccessFallbackError","prefix","httpStatus","split","has","getAccessFallbackHTTPStatus","getAccessFallbackErrorTypeByStatus","status","isNextRouterError","isRedirectError","linkForMostRecentNavigation","PENDING_LINK_STATUS","pending","IDLE_LINK_STATUS","setLinkForCurrentNavigation","link","setOptimisticLinkStatus","prefetchable","prefetchableAndVisible","pingVisibleLinks","nextUrl","tree","instance","task","prefetchTask","isPrefetchTaskDirty","cancelPrefetchTask","cacheKey","createCacheKey","prefetchHref","scheduleSegmentPrefetchTask","fetchStrategy","PrefetchPriority","IntersectionObserver","entries","entry","isVisible","intersectionRatio","element","target","get","add","delete","rescheduleLinkPrefetch","rootMargin","matchSegment","existingSegment","segment","RedirectType","errorCode","destination","slice","join","statusCode","at","RedirectStatusCode","createHrefFromUrl","includeHash","search","createRouterCacheKey","withoutSearchParameters","isArray","PAGE_SEGMENT_KEY","createDebugChannel","createFromReadableStream","createFromReadableStreamBrowser","createFromFetch","createFromFetchBrowser","doMpaNavigation","urlToUrlWithoutFlightMarker","toString","abortController","AbortController","fetchServerResponse","options","flightRouterState","prefetchKind","headers","prepareFlightRouterStateForRequest","isHmrRefresh","PrefetchKind","originalUrl","fetchPriority","__NEXT_CONFIG_OUTPUT","isLegacyPPR","__NEXT_PPR","__NEXT_CACHE_COMPONENTS","res","createFetch","signal","responseUrl","canonicalUrl","redirected","contentType","interception","includes","postponed","staleTimeHeaderSeconds","staleTime","isFlightResponse","ok","body","flightResponsePromise","flightResponse","flightStream","createUnclosingPrefetchStream","originalFlightStream","reader","getReader","pull","controller","done","value","read","enqueue","createFromNextReadableStream","normalizedFlightData","normalizeFlightData","flightData","renderedSearch","getRenderedSearch","couldBeIntercepted","prerendered","S","debugInfo","_debugInfo","aborted","shouldImmediatelyDecode","__NEXT_TEST_MODE","NEXT_DEPLOYMENT_ID","fetchOptions","credentials","priority","fetchUrl","setCacheBustingSearchParam","fetchPromise","fetch","createFromNextFetch","browserResponse","__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS","searchParams","requestHeaders","debugChannel","promiseForResponse","MPA_NAVIGATION_TASK","route","node","dynamicRequestTree","children","startPPRNavigation","navigatedAt","oldUrl","oldCacheNode","oldRouterState","newRouterState","prefetchData","prefetchHead","isPrefetchHeadPartial","isSamePageNavigation","scrollableSegmentsResult","updateCacheNodeOnNavigation","didFindRootLayout","segmentPath","oldRouterStateChildren","newRouterStateChildren","prefetchDataChildren","isRootLayout","oldParallelRoutes","parallelRoutes","prefetchParallelRoutes","patchedRouterStateChildren","taskChildren","needsDynamicRequest","dynamicRequestTreeChildren","parallelRouteKey","taskChild","newRouterStateChild","oldRouterStateChild","oldSegmentMapChild","prefetchDataChild","newSegmentChild","newSegmentPathChild","concat","newSegmentKeyChild","oldSegmentChild","oldCacheNodeChild","DEFAULT_SEGMENT_KEY","reuseActiveSegmentInDefaultSlot","reusedRouterState","oldRefreshMarker","patchRouterStateWithNewChildren","beginRenderingNewRouteTree","keys","length","set","newCacheNodeChild","newSegmentMapChild","taskChildRoute","dynamicRequestTreeChild","newCacheNode","lazyData","rsc","prefetchRsc","head","loading","existingCacheNode","possiblyPartialPrefetchHead","isNavigatingToNewRootLayout","currentTree","nextTree","currentTreeSegment","nextTreeSegment","currentTreeChild","nextTreeChild","createCacheNodeOnNavigation","routerState","cacheNodeNavigatedAt","routerStateChildren","isLeafSegment","DYNAMIC_STALETIME_MS","spawnPendingTask","isPrefetchRscPartial","existingCacheNodeChildren","cacheNodeChildren","push","routerStateChild","existingSegmentMapChild","segmentChild","segmentPathChild","segmentKeyChild","baseRouterState","newChildren","clone","createPendingCacheNode","size","maybePrefetchRsc","createDeferredRsc","listenForDynamicRequest","responsePromise","then","result","serverRouterState","seedData","dynamicData","dynamicHead","writeDynamicDataIntoPendingTask","rootTask","taskSegment","finishTaskUsingDynamicDataPayload","taskNode","finishPendingCacheNode","cacheNode","taskState","serverState","taskStateChildren","serverStateChildren","dataChildren","taskStateChild","serverStateChild","dataChild","segmentMapChild","taskSegmentChild","taskSegmentKeyChild","cacheNodeChild","abortPendingCacheNode","dynamicSegmentData","isDeferredRsc","dynamicLoading","serverChildren","dynamicDataChildren","serverRouterStateChild","dynamicDataChild","abortTask","DEFERRED","tag","pendingRsc","rej","responseDebugInfo","fulfilledRsc","apply","rejectedRsc","reason","__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME","STATIC_STALETIME_MS","__NEXT_CLIENT_ROUTER_STATIC_STALETIME","ACTION_REFRESH","ACTION_NAVIGATE","ACTION_RESTORE","setCacheBustingSearchParamWithHash","computeCacheBustingSearchParam","existingSearch","pairs","rawQuery","filter","pair","originalHref","convertRouteTreeToFlightRouterState","routeTree","slots","EntryStatus","createTupleMap","rootEntry","parent","key","hasValue","map","lastAccessedEntry","lastAccessedKeys","getEntryIfExists","existingEntry","getOrCreateEntry","newEntry","deletedEntry","parentMap","createLRU","maxLruSize","onEviction","didScheduleCleanup","lruSize","deleteNode","deleted","next","prev","ensureCleanupIsScheduled","requestCleanupCallback","cleanup","ninetyPercentMax","tail","put","updateSize","newNodeSize","prevNodeSize","requestIdleCallback","cb","isOutputExportMode","getStaleTimeMs","staleTimeSeconds","max","routeCacheMap","routeCacheLru","onRouteLRUEviction","segmentCacheMap","segmentCacheLru","onSegmentLRUEviction","invalidationListeners","currentCacheVersion","getCurrentCacheVersion","revalidateEntireCache","startRevalidationCooldown","pingInvalidationListeners","tasks","notifyInvalidationListener","onInvalidate","readExactRouteCacheEntry","now","keypath","staleAt","deleteRouteFromCache","pingBlockedTasks","readRouteCacheEntry","nonInterceptedEntry","getSegmentKeypath","isDynamic","FetchStrategy","isPPREnabled","readSegmentCacheEntry","readExactSegmentCacheEntry","entryWithSearchParams","revalidatingEntry","revalidating","upsertedEntry","upsertSegmentEntry","deleteSegmentFromCache","waitForSegmentCacheEntry","pendingEntry","promiseWithResolvers","promise","createPromiseWithResolvers","readOrCreateRouteCacheEntry","blockedTasks","isHeadPartial","Infinity","TODO_metadataStatus","TODO_isHeadDynamic","requestOptimisticRouteCacheEntry","requestedUrl","requestedSearch","urlWithoutSearchParams","routeWithNoSearchParams","createPrefetchRequestKey","canonicalUrlForRouteWithNoSearchParams","optimisticCanonicalSearch","optimisticRenderedSearch","optimisticUrl","readOrCreateSegmentCacheEntry","createDetachedSegmentCacheEntry","readOrCreateRevalidatingSegmentEntry","prevEntry","existingRevalidation","readRevalidatingSegmentCacheEntry","owner","clearRevalidatingSegmentFromOwner","candidateEntry","currentStrategy","isPartial","rejectedEntry","upgradeToPendingSegment","emptyEntry","cancelEntryListeners","revalidatingSegment","resetRevalidatingSegmentEntry","pingPrefetchTask","fulfillRouteCacheEntry","isHeadDynamic","fulfilledEntry","fulfillSegmentCacheEntry","segmentCacheEntry","rejectRouteCacheEntry","rejectSegmentCacheEntry","fetchRouteOnCacheMiss","response","urlAfterRedirects","htmlResponse","Range","DOC_PREFETCH_RANGE_HEADER_VALUE","partialHtml","text","doesExportedHtmlMatchBuildId","fetchPrefetchResponse","addSegmentPathToUrlInOutputExportMode","varyHeader","closed","routeIsPPREnabled","prefetchStream","createPrefetchResponseStream","serverData","buildId","renderedPathname","getRenderedPathname","convertRootTreePrefetchToRouteTree","rootTree","pathnameParts","rootSegment","ROOT_SEGMENT_CACHE_KEY","convertTreePrefetchToRouteTree","prefetch","param","requestKey","pathnamePartsIndex","prefetchSlots","childDoesAppearInURL","childSegment","childPrefetch","childParamName","name","childParamType","paramType","childServerSentParamKey","paramKey","childParam","childParamValue","parseDynamicParamFromURLPart","childParamKey","getCacheKeyForDynamicParam","doesStaticSegmentAppearInURL","childPathnamePartsIndex","childRequestKeyPart","createSegmentRequestKeyPart","childRequestKey","appendSegmentRequestKeyPart","childCacheKey","appendSegmentCacheKeyPart","createSegmentCacheKeyPart","hasLoadingBoundary","HasLoadingBoundary","hasRuntimePrefetch","ROOT_SEGMENT_REQUEST_KEY","staleTimeMs","writeDynamicTreeResponseIntoCache","normalizedFlightDataResult","isRootRender","isResponsePartial","convertFlightRouterStateToRouteTree","childRouterState","childTree","originalSegment","paramCacheKey","paramValue","getParamValueFromCacheKey","writeDynamicRenderResponseIntoCache","currentKeypath","expectedEntry","newKeypath","fetchSegmentOnCacheMiss","routeKey","normalizedRequestKey","requestUrl","fetchSegmentPrefetchesUsingDynamicRequest","spawnedEntries","rejectSegmentEntriesIfStillPending","fulfilledEntries","totalBytesReceivedSoFar","averageSize","flightDatas","requestKeyPart","writeSeedDataIntoCache","entriesOwnedByCurrentTask","ownedEntry","possiblyNewEntry","flightRouterStateChildren","seedDataChildren","childFlightRouterState","childSeedData","onStreamClose","onResponseSizeUpdate","totalByteLength","byteLength","staticUrl","routeDir","staticExportFilename","convertSegmentPathToStaticExportFilename","canNewFetchStrategyProvideMoreContent","newStrategy","navigate","currentUrl","currentCacheNode","currentFlightRouterState","shouldScroll","accumulation","snapshot","readRenderSnapshotFromCache","prefetchFlightRouterState","prefetchSeedData","navigateUsingPrefetchedRouteTree","optimisticRoute","collectedDebugInfo","NavigationResultTag","data","navigateDynamicallyWithNoPrefetch","scrollableSegments","promiseForDynamicServerResponse","navigationTaskToResult","childRouterStates","childSeedDatas","childResult","segmentEntry","promiseForFulfilledEntry","addSearchParamsIfPageSegment","fromEntries","URLSearchParams","debugInfoFromResponse","simulatePrefetchTreeUsingDynamicTreePatch","baseTree","treePatch","canMutateInPlace","simulatePrefetchTreeUsingDynamicTreePatchImpl","patch","index","updatedParallelRouteKey","baseChildren","childBaseRouterState","treeAtTimeOfPrefetch","schedulePrefetchTask","scheduleMicrotask","fn","catch","taskHeap","inProgressRequests","sortIdCounter","didScheduleMicrotask","mostRecentlyHoveredLink","revalidationCooldownTimeoutHandle","ensureWorkIsScheduled","cacheVersion","phase","hasBackgroundWork","spawnedRuntimePrefetches","sortId","isCanceled","_heapIndex","trackMostRecentlyHoveredLink","heapPush","heapDelete","heap","last","pop","heapSiftDown","reschedulePrefetchTask","heapResift","processQueueInMicrotask","hasNetworkBandwidth","spawnPrefetchSubtask","prefetchSubtask","onPrefetchConnectionClosed","heapPeek","exitStatus","pingRoute","pingRootRouteTree","pingSharedPartOfCacheComponentsTree","oldTree","newTree","pingStaticSegmentData","oldTreeChildren","newTreeChildren","newTreeChild","newTreeChildSegment","oldTreeChild","oldTreeChildSegment","childExitStatus","doesCurrentSegmentMatchCachedSegment","pingNewPartOfCacheComponentsTree","requestTree","pingRuntimePrefetches","pingRouteTreeAndIncludeDynamicData","requestTreeChildren","diffRouteTreeAgainstCurrent","requestTreeChild","subtreeHasLoadingBoundary","pingPPRDisabledRouteTreeUpToLoadingBoundary","refetchMarkerContext","refetchMarker","keyWithoutSearch","routeWithoutSearch","background","heapPop","isInsideRefetchingParent","spawnedSegment","pingFullSegmentRevalidation","pingPPRSegmentRevalidation","currentSegment","upsertSegmentOnCompletion","pendingSegment","nonEmptyRevalidatingSegment","emptySegment","noop","fulfilled","cachedSegment","compareQueuePriority","priorityDiff","phaseDiff","heapSiftUp","first","parentIndex","halfLength","leftIndex","left","rightIndex","right","notEnabled","__NEXT_CLIENT_SEGMENT_CACHE","args","NEXT_STATIC_GEN_BAILOUT","StaticGenBailoutError","code","isStaticGenBailoutError","unstable_rethrow","isBailoutToCSRError","isDynamicPostpone","$$typeof","REACT_POSTPONE_TYPE","isHangingPromiseRejectionError","isPrerenderInterruptedError","cause","for","dispatch","action","useActionQueue","actionQueue","state","setState","React","stateWithDebugInfo","useMemo","isThenable","promiseWithDebugInfo","asyncState","use","getFlightDataPartsFromPath","flightDataPath","pathToSegment","stringify","stripClientOnlyDataFromFlightRouterState","refreshMarker","_url","cleanedSegment","cleanedParallelRoutes","childState","shouldPreserveRefreshMarker","rewrittenQuery","rewrittenPath","partIndex","urlWithoutFlightParameters","HTML_CONTENT_TYPE_HEADER","JSON_CONTENT_TYPE_HEADER","NEXT_QUERY_PARAM_PREFIX","NEXT_INTERCEPTION_MARKER_PREFIX","PRERENDER_REVALIDATE_HEADER","PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER","RSC_PREFETCH_SUFFIX","RSC_SEGMENTS_DIR_SUFFIX","RSC_SEGMENT_SUFFIX","RSC_SUFFIX","NEXT_DATA_SUFFIX","NEXT_META_SUFFIX","NEXT_CACHE_TAGS_HEADER","NEXT_CACHE_REVALIDATED_TAGS_HEADER","NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER","NEXT_CACHE_IMPLICIT_TAG_ID","CACHE_ONE_YEAR","INFINITE_CACHE","WEBPACK_LAYERS_NAMES","shared","reactServerComponents","serverSideRendering","actionBrowser","apiNode","apiEdge","middleware","instrument","edgeAsset","appPagesBrowser","pagesDirBrowser","pagesDirEdge","pagesDirNode","GROUP","builtinReact","serverOnly","neutralTarget","clientOnly","bundled","appPages","formatDynamicImportPath","dir","filePath","absoluteFilePath","pathToFileURL","METADATA_BOUNDARY_NAME","VIEWPORT_BOUNDARY_NAME","OUTLET_BOUNDARY_NAME","ROOT_LAYOUT_BOUNDARY_NAME","wrapApiHandler","page","handler","getTracer","setRootSpanAttribute","trace","NodeSpan","spanName","sendStatusCode","redirect","statusOrUrl","writeHead","Location","write","end","checkIsOnDemandRevalidate","req","previewProps","HeadersAdapter","isOnDemandRevalidate","previewModeId","revalidateOnlyGenerated","COOKIE_NAME_PRERENDER_BYPASS","COOKIE_NAME_PRERENDER_DATA","RESPONSE_LIMIT_DEFAULT","SYMBOL_PREVIEW_DATA","SYMBOL_CLEARED_COOKIES","clearPreviewData","serialize","previous","getHeader","setHeader","expires","httpOnly","sameSite","secure","defineProperty","enumerable","ApiError","constructor","message","sendError","statusMessage","setLazyProp","prop","getter","opts","configurable","optsReset","writable","tryGetPreviewData","multiZoneDraftMode","cookies","encryptedPreviewData","RequestCookies","tokenPreviewData","jsonwebtoken","verify","previewModeSigningKey","decryptWithSecret","decryptedPreviewData","from","previewModeEncryptionKey","parse","PreludeState","hasPostpone","createDynamicTrackingState","isDebugDynamicAccesses","dynamicAccesses","syncDynamicErrorWithStack","createDynamicValidationState","hasSuspenseAboveBody","hasDynamicMetadata","hasDynamicViewport","hasAllowedDynamic","dynamicErrors","createPostponeReason","expression","isDynamicPostponeReason","accessedDynamicData","consumeDynamicAccess","serverDynamic","clientDynamic","formatDynamicAPIAccesses","access","stack","line","createRenderInBrowserAbortSignal","abort","BailoutToCSRError","useDynamicRouteParams","workStore","workAsyncStorage","workUnitStore","workUnitAsyncStorage","fallbackParams","fallbackRouteParams","makeHangingPromise","renderSignal","dynamicTracking","assertPostpone","InvariantError","useDynamicSearchParams","throwForMissingRequestStore","forceStatic","hasSuspenseRegex","hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex","hasMetadataRegex","hasViewportRegex","hasOutletRegex","trackAllowedDynamicAccess","componentStack","dynamicValidation","createErrorWithComponentOrOwnerStack","logDisallowedDynamicError","dev","hasReadableErrorStacks","throwIfDisallowedDynamic","prelude","CIPHER_ALGORITHM","encryptWithSecret","secret","iv","crypto","salt","cipher","encrypted","update","final","getAuthTag","encryptedData","buffer","CIPHER_SALT_LENGTH","decipher","setAuthTag","HANGING_PROMISE_REJECTION","HangingPromiseRejectionError","abortListenersBySignal","hangingPromise","boundRejection","bind","currentListeners","listeners","addEventListener","once","ignoreReject","nodeFs","existsSync","fs","readFile","readFileSync","writeFile","d","mkdir","recursive","stat","NextNodeServerSpan","AppRenderSpan","ReactServerDOMTurbopackClient","ReactServerDOMWebpackClient","ReadonlyHeadersError","callable","Proxy","receiver","ReflectAdapter","lowercased","toLowerCase","original","find","deleteProperty","seal","merge","append","existing","forEach","callbackfn","thisArg","call","iterator","HeadManagerContext","module","BAILOUT_TO_CSR","prefetchHeader","segmentPrefetchHeader","stateTreeHeader","nextUrlHeader","djb2Hash","str","charCodeAt","HTML_LIMITED_BOT_UA_RE","HEADLESS_BROWSER_BOT_UA_RE","hashIndex","indexOf","queryIndex","hasQuery","substring","replace","DOCTYPE_PREFIX","escapeBuildId","truncated","insertBuildIdComment","originalHtml","partialHtmlDocument","encodeToFilesystemAndURLSafeString","parentRequestKey","parentSegmentKey","childCacheKeyPart","simpleParamValueRegex","btoa","isGroupSegment","stringifiedQuery","FinalizationRegistry","l","ReactServerDOMTurbopackServer","ReactServerDOMWebpackServer","ReactServerDOMTurbopackStatic","ReactServerDOMWebpackStatic","vendoredReactRSC","vendoredReactSSR","DetachedPromise","scheduleOnNextTick","nextTick","scheduleImmediate","atLeastOneTask","ENCODED_TAGS","OPENING","HTML","BODY","CLOSED","HEAD","BODY_AND_HTML","META","ICON_MARK","indexOfUint8Array","completeMatch","j","isEquivalentUint8Arrays","removeFromUint8Array","tagIndex","subarray","removed","voidCatch","encoder","TextEncoder","chainStreams","streams","start","close","readable","TransformStream","pipeTo","preventClose","nextStream","lastStream","streamFromString","encode","streamFromBuffer","chunk","streamToBuffer","stream","chunks","streamToString","decoder","fatal","string","decode","createBufferedTransformStream","maxBufferByteLength","bufferedChunks","bufferByteLength","flush","copiedBytes","bufferedChunk","transform","scheduleFlush","detached","createPrefetchCommentStream","isBuildTimePrerendering","didTransformFirstChunk","chunkStr","updatedChunkStr","renderToInitialFizzStream","ReactDOMServer","streamOptions","createMetadataTransformStream","insert","chunkIndex","isMarkRemoved","iconMarkIndex","closedHeadIndex","iconMarkLength","replaced","insertion","encodedInsertion","insertionLength","createHeadInsertionTransformStream","inserted","hasBytes","insertedHeadContent","createFlightDataInjectionTransformStream","delayDataUntilFirstHtmlChunk","htmlStreamFinished","donePulling","startOrContinuePulling","startPulling","CLOSE_TAG","createMoveSuffixStream","foundSuffix","before","after","continueFizzStream","renderStream","suffix","inlinedDataStream","isStaticGeneration","getServerInsertedHTML","getServerInsertedMetadata","validateRootLayout","flushed","foundHtml","foundBody","suffixUnclosed","allReady","transformers","missingTags","transformer","pipeThrough","continueDynamicPrerender","prerenderStream","continueStaticPrerender","continueStaticFallbackPrerender","createClientResumeScriptInsertionTransformStream","cacheBustingHeader","searchStr","NEXT_CLIENT_RESUME_SCRIPT","didAlreadyInsert","headClosingTagIndex","continueDynamicHTMLResume","NEXT_REQUEST_META","getRequestMeta","meta","normalizeNextQueryParam","detectDomainLocale","domainItems","hostname","detectedLocale","item","domain","defaultLocale","locales","some","locale","addPathSuffix","pathHasPrefix","getHostname","parsed","host","cache","normalizeLocalePath","lowercasedLocales","segments","removePathPrefix","withoutPrefix","REGEX_LOCALHOST_HOSTNAME","parseURL","base","Internal","NextURL","input","baseOrOpts","analyze","info","getNextPathnameInfo","i18n","trailingSlash","nextConfig","pathnameNoDataPrefix","paths","parseData","i18nProvider","__NEXT_NO_MIDDLEWARE_URL_NORMALIZE","domainLocale","domains","formatPathname","addLocale","ignorePrefix","lower","forceLocale","formatSearch","port","protocol","password","username","toJSON","Request","ResponseAbortedName","ResponseAborted","clientComponentLoadStart","clientComponentLoadTimes","clientComponentLoadCount","getClientComponentLoaderMetrics","metrics","reset","isAbortError","pipeToNodeResponse","waitUntilForEnd","errored","destroyed","createAbortController","writableFinished","writer","createWriterFromResponse","started","drained","onDrain","on","off","finished","WritableStream","NEXT_OTEL_PERFORMANCE_PREFIX","performance","measure","flushHeaders","destroy","RenderResult","EMPTY","metadata","fromStatic","waitUntil","assignMetadata","assign","isNull","toUnchunkedString","isBuffer","coerce","unshift","INTERNAL_QUERY_NAMES","createMetadataContext","renderOpts","isStaticMetadataRouteFile","ReadonlyRequestCookiesError","RequestCookiesAdapter","SYMBOL_MODIFY_COOKIE_VALUES","getModifiedCookieValues","modified","MutableRequestCookiesAdapter","wrap","onUpdateCookies","responseCookies","ResponseCookies","cookie","getAll","modifiedValues","modifiedCookies","updateResponseCookies","pathWasRevalidated","allCookies","serializedCookies","tempCookies","wrappedCookies","ensureCookiesAreStillMutable","requestStore","_callingExpression","DraftModeProvider","mutableCookies","cookieValue","_isEnabled","_previewModeId","_mutableCookies","isEnabled","enable","disable","mergeMiddlewareCookies","existingCookies","setCookieValue","responseHeaders","splitCookiesString","cookiesString","ch","lastComma","nextStart","cookiesSeparatorFound","cookiesStrings","pos","skipWhitespace","charAt","createRequestStoreForRender","rootParams","implicitTags","serverComponentsHmrCache","renderResumeDataCache","devFallbackParams","defaultOnUpdateCookies","getHeaders","cleaned","header","requestCookies","getMutableCookies","userspaceMutableCookies","createCookiesWithMutableAccessCheck","draftMode","__serverComponentsHmrCache","LRUNode","SentinelNode","LRUCache","maxSize","calculateSize","totalSize","addToHead","removeNode","moveToHead","removeTail","lastNode","warn","newNode","current","remove","currentSize","createDefaultCacheHandler","refreshTags","getExpiration","updateTags","memoryCache","pendingSets","debug","NEXT_PRIVATE_DEBUG_CACHE","pendingPromise","privateEntry","timeOrigin","timestamp","revalidate","areTagsExpired","tags","areTagsStale","returnStream","newSaved","tee","expire","resolvePending","clonedValue","isErrored","errorRetryCount","expiration","tagsManifest","expired","durations","round","updates","stale","log","handlersSymbol","handlersMapSymbol","handlersSetSymbol","reference","getCacheHandlerEntries","withExecuteRevalidates","store","callback","savedRevalidationState","cloneRevalidationState","newRevalidates","diffRevalidationState","curr","prevTagsWithProfile","pendingRevalidatedTags","profileKey","profile","prevRevalidateWrites","pendingRevalidateWrites","pendingRevalidates","executeRevalidates","revalidateTags","tagsWithProfile","incrementalCache","handlers","getCacheHandlers","promises","tagsByProfile","existingKey","tagsForProfile","cacheLife","cacheLifeProfiles","revalidateTag","all","sharedAsyncLocalStorageNotAvailableError","FakeAsyncLocalStorage","getStore","run","exit","enterWith","maybeGlobalAsyncLocalStorage","AsyncLocalStorage","AfterContext","onClose","onTaskError","workUnitStores","callbackQueue","PromiseQueue","pause","errorWaitUntilNotAvailable","reportTaskError","addCallback","afterTaskStore","afterTaskAsyncStorage","rootTaskSpawnPhase","runCallbacksOnClosePromise","runCallbacksOnClose","wrappedCallback","runCallbacks","onIdle","taskKind","handlerError","ensureLeadingSlash","normalizeAppPath","reduce","normalizeRscURL","createLazyResult","pendingResult","onfulfilled","onrejected","getURLFromRedirectError","getRedirectTypeFromError","getRedirectStatusCodeFromError","getImplicitTags","getDerivedTags","derivedTags","curPathname","tagsArray","expirationsByCacheKind","createTagsExpirationsByCacheKind","cacheHandlers","kind","cacheHandler","FlightRenderResult","invalidServerComponentReactHooks","setMessage","lines","getStackWithoutErrorMessage","formatServerError","addedMessage","clientHook","regex","isError","getProperError","isPlainObject","getObjectClassLabel","prototype","getPrototypeOf","hasOwnProperty","safeStringify","createDigestWithErrorCode","thrownValue","originalDigest","__NEXT_ERROR_CODE","isReactLargeShellError","getDigestForWellKnownError","createFlightReactServerErrorHandler","shouldFormatError","onReactServerRenderError","stringHash","span","getActiveScopeSpan","recordException","setAttribute","setStatus","SpanStatusCode","createHTMLReactServerErrorHandler","isNextExport","reactServerErrors","silenceLogger","createHTMLErrorHandler","allCapturedErrors","onHTMLRenderSSRError","errorInfo","isSSRError","dynamicParamTypes","catchall","dynamic","INTERCEPTION_ROUTE_MARKERS","isInterceptionRouteAppPath","m","getSegmentParam","interceptionMarker","marker","ESCAPE_LOOKUP","ESCAPE_REGEX","htmlEscapeJsonString","match","dynamicParamTypesSchema","segmentSchema","flightRouterStateSchema","createFlightRouterStateFromLoaderTreeImpl","layout","getDynamicParamFromSegment","includeHasLoadingBoundary","dynamicParam","treeSegment","segmentTree","childHasLoadingBoundary","child","createFlightRouterStateFromLoaderTree","loaderTree","createRouteTreePrefetch","actionsForbiddenHeaders","getServerActionRequestMetadata","isURLEncodedAction","method","isMultipartAction","isFetchAction","isPossibleServerAction","stdout","enabled","NO_COLOR","FORCE_COLOR","isTTY","CI","TERM","replaceClose","nextIndex","formatter","open","bold","red","green","yellow","magenta","white","prefixes","wait","ready","event","LOGGING_METHOD","prefixedLog","prefixType","shift","consoleMethod","normalizeWorkerPageName","pageName","nodeHeadersToRecord","record","getForwardedHeaders","fromNodeOutgoingHttpHeaders","nodeHeaders","v","mergedHeaders","filterReqHeaders","forbiddenHeaders","createForwardedActionResponse","workerPathname","forwardedHeaders","proto","__NEXT_PRIVATE_ORIGIN","duplex","internal","cancel","createRedirectRenderResult","originalHost","redirectUrl","redirectType","currentPathname","appRelativeRedirectUrl","getAppRelativeRedirectUrl","resolved","parsedRedirectUrl","prerenderManifest","preview","limitUntrustedHeaderValueForLogs","handleAction","ComponentMod","serverModuleMap","generateFlight","serverActions","ctx","temporaryReferences","warning","serverActionsManifest","fetchCache","originDomain","parseHostHeader","forwardedHostHeader","forwardedHostHeaderValue","trim","hostHeader","isCsrfOriginAllowed","allowedOrigins","allowedOrigin","matchWildcardDomain","pattern","domainParts","patternParts","patternPart","domainPart","actionResult","skipFlight","actionAsyncStorage","actionWasForwarded","forwardedWorker","selectWorkerForForwarding","workers","workerName","handleUnrecognizedFetchAction","isAction","actionModId","boundActionArguments","createTemporaryReferenceSet","decodeReply","decodeReplyFromBusboy","decodeAction","decodeFormState","Transform","pipeline","defaultBodySizeLimit","bodySizeLimit","bodySizeLimitBytes","sizeLimitTransform","encoding","sizeLimitedBody","busboy","defParamCharset","limits","fieldSize","fakeRequest","formData","actionReturnedState","executeActionAndPrepareForRender","formState","getActionModIdOrError","actionData","formDataFromSearchQueryString","actionHandler","actionMod","__next_app__","returnVal","finally","addRevalidationHeader","isTagRevalidated","isCookieRevalidated","responseCookiesToRequestCookies","isDraftMode","id","ServerInsertedHTMLContext","useServerInsertedHTML","addInsertedServerHTMLCallback","useContext","createServerInsertedHTML","serverInsertedHTMLCallbacks","addInsertedHtml","ServerInsertedHTMLProvider","renderServerInsertedHTML","ReactClient","encodeURIPath","file","getRequiredScripts","buildManifest","assetPrefix","crossOrigin","SRIManifest","qs","nonce","pagePath","preinitScripts","preinitScriptCommands","bootstrapScript","src","files","rootMainFilesTree","rootMainFiles","integrity","ReactDOM","as","makeGetServerInsertedHTML","polyfills","serverCapturedErrors","tracingMetadata","flushedErrorMetaTagsUntilIndex","hasFlushedInitially","polyfillTags","polyfill","script","errorMetaTags","content","isPermanent","httpEquiv","traceMetaTags","serverInsertedHTML","progressiveChunkSize","getLinkAndScriptTags","clientReferenceManifest","injectedCSS","injectedScripts","collectNewImports","filePathWithoutExt","cssChunks","jsChunks","entryCSSFiles","entryJSFiles","css","styles","scripts","getPreloadableFonts","nextFontManifest","injectedFontPreloadTags","filepathWithoutExtension","fontFiles","foundFontUsage","preloadedFontFiles","app","fontFile","sort","hasLoadingComponentInTree","parallelRoute","isUseCacheFunction","extractInfoFromServerReferenceId","infoByte","argMask","usedArgs","bit","typeBit","hasRestArgs","restArgs","$$id","getLayoutOrPageModule","mod","modType","defaultPage","isLayout","isPage","isDefaultPage","interopDefault","default","parseLoaderTree","modules","template","conventionPath","getAssetQueryString","addTimestamp","deploymentId","renderCssResource","entryCssFiles","preloadCallbacks","componentMod","createElement","entryCssFile","precedence","fullHref","inlined","parsedRequestHeaders","isRSCRequest","preloadStyle","rel","createComponentStylesAndScripts","getComponent","injectedJS","jsHrefs","async","weakRef","deref","locked","Batcher","cacheKeyFn","schedulerFn","create","batch","CachedRouteKind","IncrementalCacheKind","RouteKind","fromResponseCacheEntry","cacheEntry","html","pageData","rscData","segmentData","toResponseCacheEntry","isMiss","isStale","cacheControl","ResponseCache","minimal_mode","getBatcher","revalidateBatcher","responseGenerator","context","hasResolved","previousCacheEntry","previousCacheItem","expiresAt","isFallback","isRoutePPREnabled","isPrefetch","routeKind","handleGet","previousIncrementalCacheEntry","routeKindToIncrementalCacheKind","incrementalResponseCacheEntry","handleRevalidate","responseCacheEntry","isRevalidating","min","BUILTIN_PREFIX","nextInternalPrefixRegex","normalizeConventionFilePath","projectDir","cwd","relativeProjectRoot","relativePath","BOUNDARY_PREFIX","getConventionPathByType","conventionType","createComponentTree","props","createComponentTreeInternal","errorMissingDefaultExport","convention","parentParams","rootLayoutIncluded","missingSlots","authInterrupts","MetadataOutlet","isRoot","nextConfigOutput","experimental","cacheComponents","Fragment","SegmentViewNode","HTTPAccessFallbackBoundary","LayoutRouter","RenderFromTemplateContext","ClientPageRoot","ClientSegmentRoot","createServerSearchParamsForServerPage","createPrerenderSearchParamsForClientPage","createServerParamsForServerSegment","createPrerenderParamsForClientSegment","serverHooks","DynamicServerError","Postpone","notFound","forbidden","unauthorized","injectedCSSWithCurrentLayout","injectedJSWithCurrentLayout","injectedFontPreloadTagsWithCurrentLayout","layerAssets","getLayerAssets","layoutOrPagePath","styleTags","scriptTags","fontFilename","ext","exec","preloadFont","preconnect","Template","templateStyles","templateScripts","ErrorComponent","errorStyles","errorScripts","Loading","loadingStyles","loadingScripts","layoutOrPageMod","hideSpan","attributes","rootLayoutAtThisLevel","rootLayoutIncludedAtThisLevelOrAbove","NotFound","notFoundStyles","prefetchConfig","unstable_prefetch","mode","Forbidden","forbiddenStyles","Unauthorized","unauthorizedStyles","dynamicShouldError","forceDynamic","dynamicUsageDescription","dynamicUsageStack","validateRevalidate","revalidateVal","defaultRevalidate","isPossiblyPartialResponse","LayoutOrPage","isValidElementType","segmentParam","currentParams","isSegmentViewEnabled","notFoundElement","notFoundFilePath","createBoundaryConventionElement","conventionName","Component","forbiddenElement","unauthorizedElement","parallelRouteMap","isChildrenRouteKey","notFoundComponent","forbiddenComponent","unauthorizedComponent","childCacheNodeSeedData","templateNode","templateFilePath","errorFilePath","loadingFilePath","globalErrorFilePath","wrappedErrorStyles","fileNameSuffix","segmentViewBoundaries","isNextjsBuiltinFilePath","parallelRouterKey","parallelRouteProps","parallelRouteCacheNodeSeedData","parallelRouteProp","loadingElement","cacheNodeKey","loadingData","isClientComponent","isClientReference","defaultExport","pageElement","serverProvidedParams","promiseOfParams","promiseOfSearchParams","params","$$isPage","isDefaultSegment","pageFilePath","segmentType","wrappedPageElement","segmentNode","isRootLayoutWithChildrenSlotAndAtLeastOneMoreSlot","clientSegment","notfoundClientSegment","forbiddenClientSegment","unauthorizedClientSegment","createErrorBoundaryClientSegmentRoot","ErrorBoundaryComponent","errorElement","SegmentComponent","serverSegment","$$isLayout","layoutFilePath","getRootParamsImpl","walkTreeWithFlightRouterState","loaderTreeToFilter","parentIsInsideSharedLayout","rscHead","parallelRoutesKeys","actualSegment","renderComponentsOnThisLevel","isInsideSharedLayout","isRouteTreePrefetchRequest","canSegmentBeOverridden","overriddenSegment","layoutPath","subPath","SERVER_ACTION_MANIFESTS_SINGLETON","interpolateParallelRouteParams","interpolated","structuredClone","depth","pathSegments","processedSegments","remainingSegments","flatMap","pathSegment","nextDepth","getDynamicParam","interpolatedParams","segmentKey","dynamicParamType","getParamValue","searchValue","PARAMETER_PATTERN","parseMatchedParameter","optional","repeat","serializeUseCacheCacheStore","isCacheComponentsEnabled","binaryString","arrayBufferToString","bytes","len","fromCharCode","binary","stringifyResumeDataCache","resumeDataCache","json","encryptedBoundArgs","deflateSync","createPrerenderResumeDataCache","decryptedBoundArgs","createRenderResumeDataCache","resumeDataCacheOrPersistedCache","inflateSync","parseUseCacheCacheStore","stringToUint8Array","arr","atob","DynamicState","DynamicHTMLPreludeState","getDynamicHTMLPostponedState","preludeState","dataString","replacementsString","postponedString","getDynamicDataPostponedState","flightResponses","useFlightStream","debugStream","newResponse","serverConsumerManifest","moduleLoading","moduleMap","ssrModuleMapping","responseOnNextTick","createInlinedDataReadableStream","startScriptTag","flightReader","scriptStart","scriptContents","decodedString","writeFlightDataInstruction","htmlInlinedData","fromCodePoint","SP","every","DecodeError","NormalizeError","searchParamsToUrlQuery","stringifyUrlQueryParam","parseRelativeUrl","parseQuery","globalBase","resolvedBase","slashes","AppRouterContext","LayoutRouterContext","GlobalLayoutRouterContext","TemplateContext","MissingSlotContext","SearchParamsContext","createContext","PathnameContext","PathParamsContext","NavigationPromisesContext","createDevToolsInstrumentedPromise","displayName","ANNOUNCER_TYPE","AppRouterAnnouncer","portalNode","setPortalNode","useState","useEffect","getAnnouncerNode","existingAnnouncer","document","getElementsByName","shadowRoot","childNodes","container","style","cssText","announcer","ariaLive","role","shadow","attachShadow","appendChild","getElementsByTagName","isConnected","removeChild","routeAnnouncement","setRouteAnnouncement","previousTitle","useRef","currentTitle","title","pageHeader","querySelector","innerText","textContent","createPortal","useRouter","router","HandleRedirect","RedirectErrorBoundary","getDerivedStateFromError","render","RedirectBoundary","unresolvedThenable","runRemainingActions","runAction","needsRefresh","prevState","payload","handleResult","nextState","discarded","didRevalidate","createMutableActionQueue","initialState","instrumentationHooks","dispatchAction","resolvers","deferredPromise","newAction","onRouterTransitionStart","dispatchNavigateAction","navigateType","linkInstanceRef","__NEXT_APP_NAV_FAIL_HANDLING","__pendingUrl","isExternalUrl","locationSearch","publicAppRouterInstance","back","history","forward","getAppRouterActionQueue","prefetchWithSegmentCache","scroll","refresh","hmrRefresh","HandleISRError","ErrorBoundaryHandler","previousPathname","getDerivedStateFromProps","this","errorComponent","ErrorBoundary","hasFallbackRouteParams","RootErrorBoundary","fontFamily","height","textAlign","display","flexDirection","alignItems","justifyContent","fontSize","fontWeight","lineHeight","margin","div","h2","NameSpace","RootLayoutBoundary","globalMutable","HistoryUpdater","appRouterState","useInsertionEffect","pushRef","historyState","preserveCustomHistoryState","__NA","__PRIVATE_NEXTJS_INTERNALS_TREE","pendingPush","pushState","replaceState","copyNextJsInternalHistoryState","currentState","Head","headCacheNode","resolvedPrefetchRsc","useDeferredValue","Router","globalError","webSocket","staticIndicatorState","hasBasePath","handlePageShow","persisted","pendingMpaPath","removeEventListener","handleUnhandledRedirect","preventDefault","mpaNavigation","originalPushState","originalReplaceState","applyUrlFromHistoryPushReplace","appHistoryState","_unused","_N","onPopState","reload","focusAndScrollRef","previousNextUrl","matchingHead","findHeadInCacheImpl","keyPrefix","keyPrefixWithoutSearchParams","childParallelRoutes","childSegmentMap","cacheKeyWithoutSearchParams","pathParams","getSelectedParams","isDynamicParameter","segmentValue","layoutRouterContext","parentTree","parentCacheNode","parentSegmentPath","debugNameContext","isActive","globalLayoutRouterContext","headKey","headKeyWithoutSearchParams","RuntimeStyles","AppRouter","globalErrorState","uncaughtExceptionHandler","evt","DefaultGlobalError","runtimeStyles","runtimeStyleChanged","forceUpdate","renderedStylesSize","changed","dplId","_N_E_STYLE_LOAD","createInitialRouterState","initialFlightData","initialCanonicalUrlParts","initialRenderedSearch","initialParallelRoutes","initialCanonicalUrl","initialTree","initialSeedData","initialHead","addRefreshMarkerToActiveParallelSegments","fillLazyItemsTillLeafWithHead","newCache","existingCache","cacheNodeSeedData","parallelRouteState","segmentForParallelRoute","parallelSeedData","existingParallelRoutesCacheNode","parallelRouteCacheNode","seedNode","existingParallelRoutes","onlyHashChange","hashFragment","segmentPaths","extractPathFromFlightRouterState","childrenPath","childPath","acc","prerenderAndAbortInSequentialTasks","prerender","ReactServerResult","_stream","consume","createReactServerPrerenderResult","underlying","ReactServerPrerenderResult","createReactServerPrerenderResultFromRender","assertChunks","_chunks","consumeChunks","asUnclosingStream","createUnclosingStream","consumeAsUnclosingStream","asStream","createClosingStream","consumeAsStream","processPrelude","unprocessedPrelude","peek","firstResult","preludeIsEmpty","printDebugThrownValueForProspectiveRender","originalErrorStack","stackStart","CacheSignal","count","earlyListeners","tickPending","pendingTimeoutCleanup","subscribedSignals","invokeListenersIfNoPendingReads","noMorePendingCaches","scheduleImmediateAndTimeoutWithCleanup","clearPending","immediate","clearImmediate","inputReady","cacheReady","beginRead","subscriber","endRead","hasPendingReads","trackRead","onFinally","subscribeToReads","unsubscribeFromReads","getTracedMetadata","traceData","clientTraceMetadata","createServerInsertedMetadata","reHasRegExp","reReplaceRegExp","escapeStringRegexp","getRouteRegex","normalizedRoute","includeSuffix","includePrefix","excludeOptionalTrailingSlash","parameterizedRoute","groups","getParametrizedRoute","groupIndex","markerMatch","paramMatches","re","getSafeKeyFromSegment","getSafeRouteKey","routeKeys","backreferenceDuplicateKeys","cleanedKey","invalidKey","duplicateKey","interceptionPrefix","PARAM_SEPARATOR","hasAdjacentParameterIssues","normalizeAdjacentParameters","normalized","stripNormalizedSeparators","safePathToRegexp","pathToRegexp","needsNormalization","routeToUse","retryError","safeCompile","compiler","compile","getRouteMatcher","matcherFn","routeMatch","group","unescapeSegments","compileNonPath","validate","decodeQueryPathParameter","parseReqUrl","parsedUrl","parseUrl","auth","slashedProtocols","filterInternalQuery","paramKeys","isNextQueryPrefix","isNextInterceptionMarkerPrefix","getPreviouslyRevalidatedTags","imageConfigDefault","deviceSizes","imageSizes","loader","loaderFile","disableStaticImages","minimumCacheTTL","formats","maximumRedirects","dangerouslyAllowLocalIP","dangerouslyAllowSVG","contentSecurityPolicy","contentDispositionType","localPatterns","remotePatterns","qualities","unoptimized","ImageConfigContext","filterStackFrame","NonIndex","is404Page","generateDynamicRSCPayload","routeModule","userland","createMetadataComponents","requestId","serveStreamingMetadata","Viewport","Metadata","parsedQuery","metadataContext","sharedContext","createErrorContext","renderSource","routerKind","routePath","routeType","revalidateReason","generateDynamicFlightRenderResult","htmlRequestId","onInstrumentationRequestError","setReactDebugChannel","onError","clientSide","rscPayload","clientModules","serverSide","fetchMetrics","generateRuntimePrefetchResult","generatePayload","prerenderResumeDataCache","prospectiveRuntimeServerPrerender","finalRuntimeServerPrerender","applyMetadataFromPrerenderResult","getPayload","assertClientReferenceManifest","initialServerPrerenderController","initialServerRenderController","cacheSignal","initialServerPrerenderStore","hmrRefreshHash","captureOwnerStack","runtimeStagePromise","initialServerPayload","pendingInitialServerResult","NEXT_DEBUG_BUILD","__NEXT_VERBOSE_LOGGING","onPostpone","trackPendingModules","invalidDynamicUsageError","advanceStage","selectStaleTime","createSelectStaleTime","serverIsDynamic","finalServerController","serverDynamicTracking","resolveBlockedRuntimeAPIs","finalServerPrerenderStore","finalRSCPayload","prerenderIsPending","prerenderResult","dynamicAccess","collectedRevalidate","collectedExpire","collectedStale","collectedTags","prepareInitialCanonicalUrl","getRSCPayload","is404","appUsingSizeAdjustment","hasGlobalNotFound","errorType","GlobalError","globalErrorStyles","getGlobalErrorStyles","isPossiblyPartialHead","P","Preloads","q","G","preloadFn","getErrorRSCPayload","ssrError","App","reactServerStream","reactDebugStream","images","Provider","appDir","ErrorApp","renderToHTMLOrFlightImpl","postponedState","isNotFoundPath","requestTimestamp","enableTainting","instrumented","startTime","loadChunk","shouldTrackModuleLoading","__next_require__","exportsOrPromise","trackPendingImport","__next_chunk_load__","loadingChunk","trackPendingChunkLoad","shouldTrackFetchMetrics","originalRequest","startSpan","appUsingSizeAdjust","createServerModuleMap","workerEntry","moduleId","setReferenceManifestsSingleton","clientReferenceManifestsPerPage","patchFetch","taintObjectReference","isPrefetchRequest","isRuntimePrefetchRequest","subtle","isPossibleActionRequest","prerenderToStreamWithTracing","prerenderToStream","digestErrorsMap","buildFailingError","ssrErrors","devValidatingFallbackParams","createRequestStore","renderToStreamWithTracing","renderToStream","didExecuteServerAction","actionRequestResult","notFoundLoaderTree","createNotFoundLoaderTree","components","notFoundTreeComponents","renderToHTMLOrFlight","parseRequestHeaders","shouldProvideFlightRouterState","parseAndValidateFlightRouterState","stateHeader","assert","csp","getScriptNonceFromHeader","cspHeaderValue","directive","directives","source","previouslyRevalidatedTags","parsePostponedState","postponedStringLengthMatch","postponedStringLength","replacements","replaceAll","createWorkStore","shouldWaitOnAllReady","supportsDynamicResponse","isDevelopment","NEXT_SSG_FETCH_METRICS","__incrementalCache","nextExport","reactLoadableManifest","afterContext","createAfterContext","onAfterTaskError","cacheComponentsEnabled","refreshTagsByCacheKind","createRefreshTagsByCacheKind","runInCleanSnapshot","definition","fetchTags","staleHeader","staticBailoutInfo","description","serverRenderToReadableStream","reactMaxHeadersLength","subresourceIntegrityManifest","getTracePropagationData","polyfillFiles","noModule","bootstrapScriptContent","reactServerErrorsByDigest","serverComponentsErrorHandler","htmlRendererErrorHandler","reactServerResult","appendHeader","RSCPayload","readableSsr","readableBrowser","inlinedReactServerDataStream","getPostponedFromState","htmlStream","onHeaders","maxHeadersLength","bootstrapScripts","shouldBailoutToCSR","appendMutableCookies","modifiedCookieValues","resCookies","returnedCookies","errorPreinitScripts","errorBootstrapScript","errorRSCPayload","errorServerStream","fizzStream","finalErr","shouldGenerateStaticFlightData","allowEmptyStaticShell","reactServerPrerenderResult","setMetadataHeader","prerenderStore","initialServerResult","initialServerReactController","initialServerPayloadPrerenderStore","initialClientPrerenderController","initialClientReactController","initialClientRenderController","initialClientPrerenderStore","pendingInitialClientResult","finalServerReactController","finalServerRenderController","finalServerPayloadPrerenderStore","finalAttemptRSCPayload","pendingPrerenderResult","clientDynamicTracking","finalClientReactController","finalClientRenderController","finalClientPrerenderStore","pendingFinalClientResult","collectSegmentData","finalStream","foreverStream","resumeStream","emptyReactServerResult","reactServerPrerenderStore","ssrPrerenderStore","prerenderLegacyStore","globalErrorModule","GlobalErrorComponent","globalErrorModulePath","staleTimes","static","fullPageDataBuffer","clientSegmentCache","rscModuleMapping","getServerModuleMap","serverActionsManifestSingleton","COMPILER_NAMES","client","server","edgeServer","BUILD_MANIFEST","features","typescript","TEST_ROUTE","TEST_STRICT_ROUTE","isDynamicRoute","strict","extractInterceptionRouteInformation","interceptingRoute","interceptedRoute","splitInterceptingRoute","normalizeDataPath","normalizePagePath","posix","resolvedPage","normalize","STATIC_METADATA_IMAGES","icon","filename","extensions","apple","openGraph","twitter","getExtensionRegexString","staticExtensions","dynamicExtensions","FAVICON_REGEX","ROBOTS_TXT_REGEX","MANIFEST_JSON_REGEX","MANIFEST_WEBMANIFEST_REGEX","SITEMAP_XML_REGEX","compiledRegexCache","MultiFileWriter","findOrCreateTask","directory","FileSystemCache","flushToDisk","serverDistDir","revalidatedTags","maxMemoryCacheSize","getMemoryCache","resetRequestCache","getFilePath","fileData","mtime","lastModified","getTime","fetchIdx","parsedData","storedTags","maybeSegmentData","segmentsDir","segmentDataFilePath","tagsHeader","cacheTags","combinedTags","softTags","isAppPath","htmlPath","toRoute","IncrementalCache","minimalMode","getPrerenderManifest","fetchCacheKeyPrefix","CurCacheHandler","allowedRevalidateHeaderKeys","locks","hasCustomCacheHandler","cacheHandlersSymbol","_globalThis","globalCacheHandler","FetchCache","__NEXT_TEST_MAX_ISR_CACHE","disableForTestmode","NEXT_PRIVATE_TEST_PROXY","cacheControls","SharedCacheControls","_requestHeaders","calculateRevalidate","fromTime","floor","initialRevalidateSeconds","_getPathname","lock","generateCacheKey","init","bodyChunks","_ogBody","readableBody","total","arrayBuffer","offset","val","blob","cacheString","referrer","referrerPolicy","createHash","cacheData","revalidateAfter","getRenderResumeDataCache","memoryCacheData","getPrerenderResumeDataCache","age","notFoundRoutes","itemSize","isImplicitBuildTimeCache","warningText","RouterServerContextSymbol","routerServerGlobal","isInterceptionRouteRewrite","dynamicImportEsmDefault","RouteModule","distDir","relativeProjectDir","isDev","instrumentationOnRequestError","absoluteProjectDir","loadManifests","srcPage","loadManifestFromRelativePath","routesManifest","fallbackBuildManifest","serverFilesManifest","dynamicCssManifest","manifest","shouldCache","handleMissing","isStaticMetadataRoute","isAppRouteRoute","isMetadataRouteFile","appDirRelativePath","pageExtensions","strictlyMatchExtensions","normalizedPath","fastResult","regexes","getCompiledRegexes","cached","trailingMatcher","suffixMatcher","variantsMatcher","robotsExts","manifestExts","useEval","skipParse","__RSC_MANIFEST","interceptionRoutePatterns","rewrites","beforeFiles","rewrite","loadCustomCacheHandlers","cacheMaxMemorySize","initializeCacheHandlers","fallback","DefaultCache","RemoteCache","getIncrementalCache","isMinimalMode","CacheHandler","isrFlushToDisk","onRequestError","errorContext","routerServerContext","logErrorWithOriginalStack","prepare","localeResult","previewData","relative","absoluteDistDir","ensureInstrumentationRegistered","manifests","isNextDataRequest","originalPathname","originalQuery","pageIsDynamic","normalizedSrcPage","serverUtils","getServerUtils","caseSensitive","defaultRouteRegex","dynamicRouteMatcher","defaultRouteMatches","getNamedRouteRegex","getNamedParametrizedRoute","prefixRouteKeys","names","intercepted","inverseParts","hasInterceptionMarker","namedParameterizedRoute","pathToRegexpPattern","namedRegex","handleRewrites","rewrittenParsedUrl","rewriteParams","fsPathname","checkRewrite","matcher","getPathMatch","regexp","delimiter","sensitive","regexpToFunction","regexModifier","flags","removeUnnamedParams","missing","hasParams","matchHas","hasMatch","hasItem","getCookieParser","parseCookieFn","getSafeParamName","paramName","newParamName","charCode","matches","groupKey","parsedDestination","destQuery","prepareDestination","destHostnameCompiler","newUrl","parseDestination","escaped","parsedURL","destHostname","destSearch","destPath","destParams","destPathParamKeys","destHostnameParamKeys","destPathCompiler","strOrArray","appendParamsToQuery","nextInternalLocale","dynamicParams","afterFiles","matchesPage","fsPathnameNoSlash","normalizeQueryParams","routeParamKeys","normalizedKey","getParamsFromRouteMatches","routeMatchesHeader","routeMatches","obj","keyName","normalizeDynamicRouteParams","ignoreMissingOptional","hasValidParams","defaultValue","isOptional","isDefaultValue","defaultVal","normalizeCdnUrl","_parsedUrl","formatUrl","urlObj","querystring","interpolateDynamicPath","builtParam","addRequestMeta","request","rewriteParamKeys","paramsMatch","paramsResult","combinedParamKeys","originalValue","queryValue","paramsToInterpolate","queryResult","config","resolvedPathname","encodedResolvedPathname","seg","char","getResponseCache","responseCache","MINIMAL_MODE","handleResponse","purpose","RouterContext","PrerenderManifestMatcher","matchers","dynamicRoutes","fallbackSourceRoute","registerGetCacheSignal","AppPageRouteModule","pathCouldBeIntercepted","getVaryHeader","baseVaryHeader","vendored","contexts","vendoredContexts"],"mappings":"4GAOIA,EAJJ,SAASC,IACP,MAAM,qBAAwB,CAAxB,AAAIC,MAHV,qIAGM,qB,MAAA,O,WAAA,G,aAAA,EAAuB,EAC/B,CAiBAC,EAAQ,OAAO,CAAGH,AAZdA,CAAAA,EAAII,EAAQ,iFAAmF,EAY/EC,OAAO,CAC3BF,EAAQ,sBAAsB,CAAGH,EAAEM,sBAAsB,CACzDH,EAAQ,cAAc,CAAGF,EACzBE,EAAQ,oBAAoB,CAAGF,EAC3BD,EAAEO,MAAM,EACVJ,CAAAA,EAAQ,MAAM,CAAGH,EAAEO,MAAM,AAAD,C,4EC1B1B,IAAI,EAAYC,OAAO,cAAc,CACjC,EAAmBA,OAAO,wBAAwB,CAClD,EAAoB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GAbd,EAAiB,IAAI,GACnB,EACAA,EACA,EACA,EACA,EACAc,EACA,EACA,EACA,EACA,EACA,GAIA,EACA,KACA,EACA,CAAC,EACD,CAAC,EACH,EACY,aAAa,CAAG,CAAC,EAkB7B,GAjBA,EAAW,GACT,EACA,KACA,EACA,GACA,KACAd,EACA,KACA,KACA,EAAe,cAAc,CAC7B,KACA,EACA,KACA,GACA,KACA,OAGF,EAAe,WAAW,CAAC,IAAI,CAAC,GACzB,CACT,CACA,SAAS,GACP,CAAQ,CACR,CAAc,CACdA,CAAW,CACX,CAAiB,CACjB,CAAoB,CACpB,CAAO,CACPc,CAAU,CACV,CAAY,CACZ,CAAY,CACZ,CAAY,CACZ,CAAU,EAqBV,MALA,AAdA,GAAW,GACT,EACA,EACAd,EACA,EACA,EACA,EACAc,EACA,EACA,EACA,EACA,EACA,KAAK,EACP,EACS,gBAAgB,CAAG,CAC1B,WAAY,IAAIpB,IAChB,UAAW,EAAE,CACb,UAAW,IACb,EACO,CACT,CACA,SAAS,GACP,CAAQ,CACR,CAAc,CACdM,CAAW,CACX,CAAO,CACP,CAAU,CACV,CAAY,CACZc,CAAY,CACZ,CAAY,CACZ,CAAU,SAeV,AAbAd,CAAAA,EAAc,IAAI,GAChB,EAAe,cAAc,CAC7BA,EACA,EAAe,iBAAiB,CAChC,EAAe,oBAAoB,CACnC,EACA,EACA,EACAc,EACA,EACA,EACA,KACF,EACY,aAAa,CAAG,EAAe,aAAa,CACpD,UAAa,OAAO,EAAe,WAAW,EAE9C,CAQC,AARA,GAAU,GACTd,EACA,EACA,KACA,EAAe,iBAAiB,CAChC,CAAC,EACD,CAAC,EACH,EACS,aAAa,CAAG,CAAC,EAkB1B,GAjBC,EAAW,GACVA,EACA,KACA,EACA,GACA,KACA,EACA,KACA,KACAA,EAAY,cAAc,CAC1B,KACA,EAAe,iBAAiB,CAChC,KACA,GACA,KACA,MAIQ,EAsBd,GApBA,EAAW,GACTA,EACA,KACA,CACE,MAAO,EAAe,WAAW,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AC,EAAEkJ,EAAe,EAAE,EAAEx0F,EAAAA,EAAQA,CAAC,CAAC,CAIhCw0F,CAEX,C,kBAxEK,iBAIGP,QAAQ,CAAG,IAAIh4F,O,CAqEzB,CAEA,IAAMw4F,GAAW,CACf,YAAa/2D,EACb,YAAaC,EACb+2D,SAAUC,CACZ,EAIA,GAAeN,E","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277]}